From 867319ec5f9030d3c14c32e3302606f2bf11ac27 Mon Sep 17 00:00:00 2001 From: Richard Jones Date: Wed, 1 Sep 2010 13:19:05 +0100 Subject: [PATCH] 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. --- src/guestfs.h | 16 ++++++++-------- src/guestfs.pod | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/guestfs.h b/src/guestfs.h index 0bfad4f..9fc6ca5 100644 --- a/src/guestfs.h +++ b/src/guestfs.h @@ -45,21 +45,21 @@ 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_close_cb) (guestfs_h *g, void *data); -typedef void (*guestfs_progress_cb) (guestfs_h *g, void *data, int proc_nr, int serial, uint64_t position, uint64_t total); +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); +typedef void (*guestfs_close_cb) (guestfs_h *g, void *opaque); +typedef void (*guestfs_progress_cb) (guestfs_h *g, void *opaque, int proc_nr, int serial, uint64_t position, uint64_t total); 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 455cd89..ccc719d 100644 --- a/src/guestfs.pod +++ b/src/guestfs.pod @@ -844,11 +844,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 @@ -865,7 +865,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. -- 1.8.3.1