From: Richard Jones Date: Wed, 1 Sep 2010 12:19:05 +0000 (+0100) Subject: Consistent use of 'void *opaque' to refer to opaque pointer in C API. X-Git-Tag: 1.2.13~5 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=2ad4a17a958d16f085f95f6112ffe90901a1a469;p=libguestfs.git Consistent use of 'void *opaque' to refer to opaque pointer in C API. We inconsistently used 'void *data' or 'void *opaque' all over to refer to the same thing. Use 'void *opaque' in all places in the published API and documentation. Cherry picked from commit 867319ec5f9030d3c14c32e3302606f2bf11ac27. --- diff --git a/src/guestfs.h b/src/guestfs.h index b43cd8b..1c7ee04 100644 --- a/src/guestfs.h +++ b/src/guestfs.h @@ -43,19 +43,19 @@ extern void guestfs_close (guestfs_h *g); /*--- Error handling ---*/ extern const char *guestfs_last_error (guestfs_h *g); -typedef void (*guestfs_error_handler_cb) (guestfs_h *g, void *data, const char *msg); +typedef void (*guestfs_error_handler_cb) (guestfs_h *g, void *opaque, const char *msg); typedef void (*guestfs_abort_cb) (void) __attribute__((__noreturn__)); -extern void guestfs_set_error_handler (guestfs_h *g, guestfs_error_handler_cb cb, void *data); -extern guestfs_error_handler_cb guestfs_get_error_handler (guestfs_h *g, void **data_rtn); +extern void guestfs_set_error_handler (guestfs_h *g, guestfs_error_handler_cb cb, void *opaque); +extern guestfs_error_handler_cb guestfs_get_error_handler (guestfs_h *g, void **opaque_rtn); extern void guestfs_set_out_of_memory_handler (guestfs_h *g, guestfs_abort_cb); extern guestfs_abort_cb guestfs_get_out_of_memory_handler (guestfs_h *g); /*--- Events ---*/ -typedef void (*guestfs_log_message_cb) (guestfs_h *g, void *data, char *buf, int len); -typedef void (*guestfs_subprocess_quit_cb) (guestfs_h *g, void *data); -typedef void (*guestfs_launch_done_cb) (guestfs_h *g, void *data); +typedef void (*guestfs_log_message_cb) (guestfs_h *g, void *opaque, char *buf, int len); +typedef void (*guestfs_subprocess_quit_cb) (guestfs_h *g, void *opaque); +typedef void (*guestfs_launch_done_cb) (guestfs_h *g, void *opaque); extern void guestfs_set_log_message_callback (guestfs_h *g, guestfs_log_message_cb cb, void *opaque); extern void guestfs_set_subprocess_quit_callback (guestfs_h *g, guestfs_subprocess_quit_cb cb, void *opaque); diff --git a/src/guestfs.pod b/src/guestfs.pod index 96b4623..a61a2e5 100644 --- a/src/guestfs.pod +++ b/src/guestfs.pod @@ -716,11 +716,11 @@ largest number of results. =head2 guestfs_set_error_handler typedef void (*guestfs_error_handler_cb) (guestfs_h *g, - void *data, + void *opaque, const char *msg); void guestfs_set_error_handler (guestfs_h *g, guestfs_error_handler_cb cb, - void *data); + void *opaque); The callback C will be called if there is an error. The parameters passed to the callback are an opaque data pointer and the @@ -737,7 +737,7 @@ If you set C to C then I handler is called. =head2 guestfs_get_error_handler guestfs_error_handler_cb guestfs_get_error_handler (guestfs_h *g, - void **data_rtn); + void **opaque_rtn); Returns the current error handler callback.