From 9ba9cd83a4f72339b15aebbc1fbdde32f08ef3bc Mon Sep 17 00:00:00 2001 From: Gerald Combs Date: Tue, 9 Sep 2014 16:42:58 -0400 Subject: Qt: Add a CaptureFile class. Wrap the capture_file struct in a QObject which translates cf_cb_* and capture_cb_* events into signals. Move the global cfile to capture_file.cpp. Don't use a void pointer for the capture file struct. Change-Id: Ic5d5efb4bb1db64aa0247245890e5669b1da723a Reviewed-on: https://code.wireshark.org/review/5885 Petri-Dish: Gerald Combs Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs --- file.h | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'file.h') diff --git a/file.h b/file.h index 51ed688f6d..0f082730aa 100644 --- a/file.h +++ b/file.h @@ -95,11 +95,29 @@ typedef struct { field_info *finfo; } match_data; +/** + * Add a capture file event callback. + * + * @param func The function to be called for each event. + * The function will be passed three parameters: The event type (event), + * event-dependent data (data), and user-supplied data (user_data). + * Event-dependent data may be a capture_file pointer, character pointer, + * or NULL. + * @param user_data User-supplied data to pass to the callback. May be NULL. + */ + extern void cf_callback_add(cf_callback_t func, gpointer user_data); +/** + * Remove a capture file event callback. + * + * @param func The function to be removed. + * @param user_data User-supplied data. Must be the same value supplied to cf_callback_add. + */ + extern void -cf_callback_remove(cf_callback_t func); +cf_callback_remove(cf_callback_t func, gpointer user_data); /** * Open a capture file. -- cgit v1.2.3