X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=perl%2FGuestfs.xs;h=fd287e7beeff98d1c3bf7e8e4ac7220ad1fd53d3;hb=45f3a8981723079a5a020ab9438593531b1d8368;hp=e3f17c257eaa772c4cb46fdff50b4a5645b7e05e;hpb=1ee6da96efe8340a7d3904a865d80cd59d9d3fde;p=libguestfs.git diff --git a/perl/Guestfs.xs b/perl/Guestfs.xs index e3f17c2..fd287e7 100644 --- a/perl/Guestfs.xs +++ b/perl/Guestfs.xs @@ -25,8 +25,6 @@ #include -/* #include cannot be used for local files in XS */ - #ifndef PRId64 #define PRId64 "lld" #endif @@ -79,19 +77,128 @@ MODULE = Sys::Guestfs PACKAGE = Sys::Guestfs guestfs_h * _create () -CODE: - RETVAL = guestfs_create (); - if (!RETVAL) - croak ("could not create guestfs handle"); - guestfs_set_error_handler (RETVAL, error_handler, NULL); -OUTPUT: - RETVAL + CODE: + RETVAL = guestfs_create (); + if (!RETVAL) + croak ("could not create guestfs handle"); + guestfs_set_error_handler (RETVAL, error_handler, NULL); + OUTPUT: + RETVAL void DESTROY (g) - guestfs_h *g; -PPCODE: - guestfs_close (g); + guestfs_h *g; + PPCODE: + guestfs_close (g); + +void +launch (g) + guestfs_h *g; + PPCODE: + if (guestfs_launch (g) == -1) + croak ("launch: %s", last_error); + +void +wait_ready (g) + guestfs_h *g; + PPCODE: + if (guestfs_wait_ready (g) == -1) + croak ("wait_ready: %s", last_error); + +void +kill_subprocess (g) + guestfs_h *g; + PPCODE: + if (guestfs_kill_subprocess (g) == -1) + croak ("kill_subprocess: %s", last_error); + +void +add_drive (g, filename) + guestfs_h *g; + char *filename; + PPCODE: + if (guestfs_add_drive (g, filename) == -1) + croak ("add_drive: %s", last_error); + +void +add_cdrom (g, filename) + guestfs_h *g; + char *filename; + PPCODE: + if (guestfs_add_cdrom (g, filename) == -1) + croak ("add_cdrom: %s", last_error); + +void +config (g, qemuparam, qemuvalue) + guestfs_h *g; + char *qemuparam; + char *qemuvalue; + PPCODE: + if (guestfs_config (g, qemuparam, qemuvalue) == -1) + croak ("config: %s", last_error); + +void +set_path (g, path) + guestfs_h *g; + char *path; + PPCODE: + if (guestfs_set_path (g, path) == -1) + croak ("set_path: %s", last_error); + +SV * +get_path (g) + guestfs_h *g; +PREINIT: + const char *path; + CODE: + path = guestfs_get_path (g); + if (path == NULL) + croak ("get_path: %s", last_error); + RETVAL = newSVpv (path, 0); + OUTPUT: + RETVAL + +void +set_autosync (g, autosync) + guestfs_h *g; + int autosync; + PPCODE: + if (guestfs_set_autosync (g, autosync) == -1) + croak ("set_autosync: %s", last_error); + +SV * +get_autosync (g) + guestfs_h *g; +PREINIT: + int autosync; + CODE: + autosync = guestfs_get_autosync (g); + if (autosync == -1) + croak ("get_autosync: %s", last_error); + RETVAL = newSViv (autosync); + OUTPUT: + RETVAL + +void +set_verbose (g, verbose) + guestfs_h *g; + int verbose; + PPCODE: + if (guestfs_set_verbose (g, verbose) == -1) + croak ("set_verbose: %s", last_error); + +SV * +get_verbose (g) + guestfs_h *g; +PREINIT: + int verbose; + CODE: + verbose = guestfs_get_verbose (g); + if (verbose == -1) + croak ("get_verbose: %s", last_error); + RETVAL = newSViv (verbose); + OUTPUT: + RETVAL void mount (g, device, mountpoint)