c++ - JNA Pointer to Pointer -


I am trying to use JNA at one point and execute with an indicator but I have trouble. I am able to use other functions in the classroom, although the arguments of this function are causing me trouble. My interface and Java work fine, and I can use other methods, though "execute_file" & amp; "Alenacexicute" is giving me trouble Is my law declaration closed? I am thinking that I want a string array instead of pointerfire? Below I included C ++ with execute_file.

Thank you!

  The public interface extends the libcvm library {void alenkaInit (PointerByReference av); Int execute_file (int ac, pointerfreeference avi); Zero alenaclos (); Int Alenka Execute (Byte Buffer S); } Public static zero main (string [] args) {libcvm libcvm = (libcvm) Native.loadLibrary ("libcvm.so", libcvm.class); Pointerbearer reference pref = new pointer breather (); Libcvm.execute_file (2, prefix); Pointer P = pref.getValue (); } Int execute_file (int ac, char ** av) {bool just_once = 0; String script; Process_count = 6200000; Verbose = 0; Total_buffer_size = 0; (Int i = 1; i & lt; ac; i ++) {if (strcmp (av [i], "-l") == 0} {process_count = atoff (av [i + 1]); } And if (strcmp (av [i], "-i") == 0) {interactive = 1;} and {strcmp (av [i], "- v") == 0} {verbose = 1;} and if (strcmp (av [i] Break;} and if (strcmp (av [i], "-s") == 0) {just_once = 1; interactive = 1; script = avi [i + 1];};}; load_col_data (data_ dict, "data .dictionary "); if (interactive) (if ((yyin = fopen (av [ac-1]," r ")) == null () (membrane (av [ac-1]); 1);}; If (yyparse ()) {printf ("SQL scan pars failed \ n"); Exit (1);}; // Exit (0); Scan_state = 1; Std :: clock_t start1 = Std :: clock (); load_vars (); Statement_count = 0; clean_queues (); yin = FOpin (av [AC-1], "R"); PROC_FLUSH_BUF (yyin); statement_count = 0; External file * yyin; Context = CreateCudaDevice (0, AV, verbose); hash_seed = 100; if (! Yyparse ()) {if ( Verbose) cout & lt; "SQL scan pars work done" & lt; endl;} and cout & lt; "SQL scan pars fail" & lt; Endl; Fclose (yyin); (Map  :: iterator = varNames.begin (); it! = VarNames.end (); ++ this) {(* this) .second-> free (); }; If (alloced_sz) {cudaFree (alloced_tmp); }; If (verbose) {cout & lt; & Lt; "Cycle time" & lt; & Lt; ((Std :: clock () - start1) / (Double) CLOCKS_PER_SEC) & lt; & Lt; "" & Lt; & Lt; GetFreeMem () & lt; & Lt; Endl; }; } Else {context = CreateCudaDevice (0, av, verbose); Hash_sed = 100; If (! Just_once) getline (cin, script); While (script! = "Exit" & script! = "Remove") {used_vars.clear (); Yy_scan_string (script.c_str ()); Scan_state = 0; Statement_count = 0; Clean_queues (); if (yyparse ()) {printf ("SQL scan pars failed \ n"); Gateline (pin, script); to continue; }; Scan_state = 1; Load_vars (); Statement_count = 0; Clean_queues (); Yy_scan_string (script.c_str ()); std :: clock_t start1 = std :: clock (); If (! Yyparse ()) {if (cortical) cout & lt; & Lt; "SQL scan pars work" & lt; & Lt; Endl; }; (Map  :: iterator = varNames.begin (); it! = VarNames.end (); ++ this) {(* this) .second-> free (); }; VarNames.clear (); If (verbose) {cout & lt; & Lt; "Cycle time" & lt; & Lt; ((Std :: clock () - start1) / (Double) CLOCKS_PER_SEC) & lt; & Lt; Endl; }; If (! Just_once) getline (cin, script); Other script = "exit"; }; If (alloced_sz) {cudaFree (alloced_tmp); alloced_sz = 0; }; While (! Buffer_names.empty ()) {delete} [buffer_names.front ()]; Buffer_sizes.erase (buffer_names.front ()); Buffers.erase (buffer_names.front ()); buffer_names.pop (); }; }; If (save_dict) save_col_data (data_ dict, "data.dictionary"); Return 0; }    

asking for your API char ** , Which is an array of strings in common language.

If you use the string [] as the argument type, JNA will automatically handle the conversion.

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -