pr "JNICALL\n";
pr "Java_com_redhat_et_libguestfs_GuestFS_";
pr "%s" (replace_str ("_" ^ name) "_" "_1");
- pr "\n";
pr " (JNIEnv *env, jobject obj, jlong jg";
List.iter (
function
pr " %s %s;\n" t n
) args;
+ if optargs <> [] then (
+ pr " struct guestfs_%s_argv optargs_s;\n" name;
+ pr " const struct guestfs_%s_argv *optargs = &optargs_s;\n" name
+ );
+
let needs_i =
(match ret with
| RStringList _ | RStructList _ | RHashtable _ -> true
) args;
if optargs <> [] then (
- pr " struct guestfs_%s_argv optargs_s;\n" name;
- pr " const struct guestfs_%s_argv *optargs = &optargs_s;\n" name;
pr " optargs_s.bitmask = joptargs_bitmask;\n";
List.iter (
function
) optargs;
);
+ pr "\n";
+
(* Make the call. *)
if optargs = [] then
pr " r = guestfs_%s " name
generate_c_call_args ~handle:"g" style;
pr ";\n";
+ pr "\n";
+
(* Release the parameters. *)
List.iter (
function
| _ -> assert false
) optargs;
+ pr "\n";
+
(* Check for errors. *)
(match errcode_of_ret ret with
| `CannotReturnError -> ()