diff options
author | Guy Harris <guy@alum.mit.edu> | 2008-06-24 01:23:33 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2008-06-24 01:23:33 +0000 |
commit | 2a691a0aeccb8a2b41a62bf02cbcea83c8109df4 (patch) | |
tree | 150fa12ca8af874b398cf896e06974b5f2a882aa | |
parent | 2eb5983b4707f274f47fd2c9029f40e8a513f96b (diff) |
Have capture_info_ui_create() and capture_info_open() take a pointer to
the capture_opts structure as an argument, rather than just a pointer to
the interface name.
Don't declare a global "capture_opts" pointer, as we don't define it any
more.
svn path=/trunk/; revision=25570
-rw-r--r-- | capture.c | 2 | ||||
-rw-r--r-- | capture_info.c | 4 | ||||
-rw-r--r-- | capture_info.h | 4 | ||||
-rw-r--r-- | gtk/capture_info_dlg.c | 7 | ||||
-rw-r--r-- | gtk/main.h | 5 |
5 files changed, 9 insertions, 13 deletions
@@ -142,7 +142,7 @@ capture_start(capture_options *capture_opts) cf_callback_invoke(cf_cb_live_capture_prepared, capture_opts); if(capture_opts->show_info) - capture_info_open(capture_opts->iface); + capture_info_open(capture_opts); } return ret; diff --git a/capture_info.c b/capture_info.c index ea236eccd3..3a3c092e3e 100644 --- a/capture_info.c +++ b/capture_info.c @@ -74,7 +74,7 @@ info_data_t info_data; /* open the info */ -void capture_info_open(const char *iface) +void capture_info_open(capture_opts *capture_opts) { info_data.counts.total = 0; info_data.counts.sctp = 0; @@ -92,7 +92,7 @@ void capture_info_open(const char *iface) info_data.wtap = NULL; info_data.ui.counts = &info_data.counts; - capture_info_ui_create(&info_data.ui, iface); + capture_info_ui_create(&info_data.ui, capture_opts); } diff --git a/capture_info.h b/capture_info.h index be77e03803..6943314c0f 100644 --- a/capture_info.h +++ b/capture_info.h @@ -34,7 +34,7 @@ /* open the info - init values (wtap, counts), create dialog */ -extern void capture_info_open(const char *iface); +extern void capture_info_open(capture_opts *capture_opts); /* new file arrived - (eventually close old wtap), open wtap */ extern gboolean capture_info_new_file(const char *new_filename); @@ -62,7 +62,7 @@ typedef struct { /** Create the capture info dialog */ extern void capture_info_ui_create( capture_info *cinfo, -const gchar *iface); +capture_opts *capture_opts); /** Update the capture info counters in the dialog */ extern void capture_info_ui_update( diff --git a/gtk/capture_info_dlg.c b/gtk/capture_info_dlg.c index 801e96fdb0..68e7958542 100644 --- a/gtk/capture_info_dlg.c +++ b/gtk/capture_info_dlg.c @@ -90,7 +90,8 @@ pct(gint num, gint denom) { } static gboolean -capture_info_delete_cb(GtkWidget *w _U_, GdkEvent *event _U_, gpointer data _U_) { +capture_info_delete_cb(GtkWidget *w _U_, GdkEvent *event _U_, gpointer data) { + capture_opts *capture_opts = data; #ifdef HAVE_AIRPCAP airpcap_set_toolbar_stop_capture(airpcap_if_active); #endif @@ -118,7 +119,7 @@ capture_info_ui_update_cb(gpointer data) /* will keep pointers to the fields in the counts parameter */ void capture_info_ui_create( capture_info *cinfo, -const gchar *iface) +capture_opts *capture_opts) { unsigned int i; GtkWidget *main_vb, *stop_bt, *counts_tb; @@ -167,7 +168,7 @@ const gchar *iface) * it might be less cryptic, but if a more descriptive name is * available, we should still use that. */ - descr = get_interface_descriptive_name(iface); + descr = get_interface_descriptive_name(capture_opts->iface); title_iface = g_strdup_printf("Wireshark: Capture from %s", descr); g_free(descr); cap_w_title = create_user_window_title(title_iface); diff --git a/gtk/main.h b/gtk/main.h index d8c28dd644..40442bfee0 100644 --- a/gtk/main.h +++ b/gtk/main.h @@ -64,11 +64,6 @@ extern GString *runtime_info_str; extern GtkWidget* airpcap_tb; -/** Global capture options type. */ -typedef struct capture_options_tag * p_capture_options_t; -/** Pointer to global capture options. */ -extern p_capture_options_t capture_opts; - extern void protect_thread_critical_region(void); extern void unprotect_thread_critical_region(void); |