*)
#load "unix.cma";;
+#load "str.cma";;
open Printf
allows you to set both the mount options and the vfstype
as for the L<mount(8)> I<-o> and I<-t> flags.");
+ ("debug", (RString "result", [String "subcmd"; StringList "extraargs"]), 76, [],
+ [],
+ "debugging and internals",
+ "\
+The C<guestfs_debug> command exposes some internals of
+C<guestfsd> (the guestfs daemon) that runs inside the
+qemu subprocess.
+
+There is no comprehensive help for this command. You have
+to look at the file C<daemon/debug.c> in the libguestfs source
+to find out what you can do.");
+
]
let all_functions = non_daemon_functions @ daemon_functions
fun (_, _, _, flags, _, _, _) -> not (List.mem NotInFish flags)
) all_functions_sorted in
+ let rex = Str.regexp "C<guestfs_\\([^>]+\\)>" in
+
List.iter (
fun (name, style, _, flags, _, _, longdesc) ->
- let longdesc = replace_str longdesc "C<guestfs_" "C<" in
+ let longdesc =
+ Str.global_substitute rex (
+ fun s ->
+ let sub =
+ try Str.matched_group 1 s
+ with Not_found ->
+ failwithf "error substituting C<guestfs_...> in longdesc of function %s" name in
+ "C<" ^ replace_char sub '_' '-' ^ ">"
+ ) longdesc in
let name = replace_char name '_' '-' in
let alias =
try find_map (function FishAlias n -> Some n | _ -> None) flags
return 0;
}
guestfs_set_error_handler (g, NULL, NULL);
- return (jlong) g;
+ return (jlong) (long) g;
}
JNIEXPORT void JNICALL
Java_com_redhat_et_libguestfs_GuestFS__1close
(JNIEnv *env, jobject obj, jlong jg)
{
- guestfs_h *g = (guestfs_h *) jg;
+ guestfs_h *g = (guestfs_h *) (long) jg;
guestfs_close (g);
}
) (snd style);
pr ")\n";
pr "{\n";
- pr " guestfs_h *g = (guestfs_h *) jg;\n";
+ pr " guestfs_h *g = (guestfs_h *) (long) jg;\n";
let error_code, no_ret =
match fst style with
| RErr -> pr " int r;\n"; "-1", ""