diff options
-rw-r--r-- | dftest.c | 10 | ||||
-rw-r--r-- | epan/epan.c | 10 | ||||
-rw-r--r-- | epan/epan.h | 7 | ||||
-rw-r--r-- | rawshark.c | 8 | ||||
-rw-r--r-- | tshark.c | 8 | ||||
-rw-r--r-- | ui/gtk/main.c | 8 | ||||
-rw-r--r-- | ui/qt/main.cpp | 9 |
7 files changed, 28 insertions, 32 deletions
@@ -40,6 +40,7 @@ #include <wsutil/plugins.h> #include <wsutil/filesystem.h> #include <wsutil/privileges.h> +#include <wsutil/report_err.h> #include "ui/util.h" #include "register.h" @@ -74,6 +75,9 @@ main(int argc, char **argv) init_progfile_dir_error); } + init_report_err(failure_message, open_failure_message, + read_failure_message, write_failure_message); + timestamp_set_type(TS_RELATIVE); timestamp_set_seconds_type(TS_SECONDS_DEFAULT); @@ -81,10 +85,8 @@ main(int argc, char **argv) "-g" flag, as the "-g" flag dumps a list of fields registered by the dissectors, and we must do it before we read the preferences, in case any dissectors register preferences. */ - epan_init(register_all_protocols, - register_all_protocol_handoffs, NULL, NULL, - failure_message, open_failure_message, read_failure_message, - write_failure_message); + epan_init(register_all_protocols, register_all_protocol_handoffs, + NULL, NULL); /* set the c-language locale to the native environment. */ setlocale(LC_ALL, ""); diff --git a/epan/epan.c b/epan/epan.c index e4d6be73ef..b52244c921 100644 --- a/epan/epan.c +++ b/epan/epan.c @@ -41,7 +41,6 @@ #include "epan.h" #include "dfilter/dfilter.h" #include "epan_dissect.h" -#include "wsutil/report_err.h" #include "conversation.h" #include "circuit.h" @@ -94,15 +93,8 @@ void epan_init(void (*register_all_protocols_func)(register_cb cb, gpointer client_data), void (*register_all_handoffs_func)(register_cb cb, gpointer client_data), register_cb cb, - gpointer client_data, - void (*report_failure_fcn_p)(const char *, va_list), - void (*report_open_failure_fcn_p)(const char *, int, gboolean), - void (*report_read_failure_fcn_p)(const char *, int), - void (*report_write_failure_fcn_p)(const char *, int)) + gpointer client_data) { - init_report_err(report_failure_fcn_p, report_open_failure_fcn_p, - report_read_failure_fcn_p, report_write_failure_fcn_p); - /* initialize memory allocation subsystems */ emem_init(); wmem_init(); diff --git a/epan/epan.h b/epan/epan.h index 57f871a22d..ca3432b550 100644 --- a/epan/epan.h +++ b/epan/epan.h @@ -95,12 +95,7 @@ WS_DLL_PUBLIC void epan_register_plugin_types(void); WS_DLL_PUBLIC void epan_init(void (*register_all_protocols_func)(register_cb cb, gpointer client_data), void (*register_all_handoffs_func)(register_cb cb, gpointer client_data), - register_cb cb, - void *client_data, - void (*report_failure_fcn_p)(const char *, va_list), - void (*report_open_failure_fcn_p)(const char *, int, gboolean), - void (*report_read_failure_fcn_p)(const char *, int), - void (*report_write_failure_fcn_p)(const char *, int)); + register_cb cb, void *client_data); /** cleanup the whole epan module, this is used to be called only once in a program */ WS_DLL_PUBLIC diff --git a/rawshark.c b/rawshark.c index 7dd8b793d3..6623639849 100644 --- a/rawshark.c +++ b/rawshark.c @@ -71,6 +71,7 @@ #include <wsutil/file_util.h> #include <wsutil/filesystem.h> #include <wsutil/plugins.h> +#include <wsutil/report_err.h> #include "globals.h" #include <epan/packet.h> @@ -538,6 +539,9 @@ main(int argc, char *argv[]) (GLogLevelFlags)log_flags, log_func_ignore, NULL /* user_data */); + init_report_err(failure_message, open_failure_message, read_failure_message, + write_failure_message); + timestamp_set_type(TS_RELATIVE); timestamp_set_precision(TS_PREC_AUTO); timestamp_set_seconds_type(TS_SECONDS_DEFAULT); @@ -546,9 +550,7 @@ main(int argc, char *argv[]) "-G" flag, as the "-G" flag dumps information registered by the dissectors, and we must do it before we read the preferences, in case any dissectors register preferences. */ - epan_init(register_all_protocols, register_all_protocol_handoffs, NULL, NULL, - failure_message, open_failure_message, read_failure_message, - write_failure_message); + epan_init(register_all_protocols, register_all_protocol_handoffs, NULL, NULL); /* Set the C-language locale to the native environment. */ setlocale(LC_ALL, ""); @@ -66,6 +66,7 @@ #include <wsutil/privileges.h> #include <wsutil/file_util.h> #include <wsutil/filesystem.h> +#include <wsutil/report_err.h> #include "globals.h" #include <epan/timestamp.h> @@ -1096,6 +1097,9 @@ main(int argc, char *argv[]) initialize_funnel_ops(); + init_report_err(failure_message, open_failure_message, read_failure_message, + write_failure_message); + #ifdef HAVE_LIBPCAP capture_opts_init(&global_capture_opts); capture_session_init(&global_capture_session, (void *)&cfile); @@ -1122,9 +1126,7 @@ main(int argc, char *argv[]) "-G" flag, as the "-G" flag dumps information registered by the dissectors, and we must do it before we read the preferences, in case any dissectors register preferences. */ - epan_init(register_all_protocols, register_all_protocol_handoffs, NULL, NULL, - failure_message, open_failure_message, read_failure_message, - write_failure_message); + epan_init(register_all_protocols, register_all_protocol_handoffs, NULL, NULL); /* Register all tap listeners; we do this before we parse the arguments, as the "-z" argument can specify a registered tap. */ diff --git a/ui/gtk/main.c b/ui/gtk/main.c index 6affd20ea1..ba605c8e06 100644 --- a/ui/gtk/main.c +++ b/ui/gtk/main.c @@ -67,6 +67,7 @@ #include <wsutil/filesystem.h> #include <wsutil/file_util.h> #include <wsutil/privileges.h> +#include <wsutil/report_err.h> #include <wsutil/u3.h> #include <wiretap/merge.h> @@ -2501,6 +2502,9 @@ main(int argc, char *argv[]) capture_session_init(&global_capture_session, (void *)&cfile); #endif + init_report_err(failure_alert_box, open_failure_alert_box, + read_failure_alert_box, write_failure_alert_box); + /* Initialize whatever we need to allocate colors for GTK+ */ colors_init(); @@ -2545,9 +2549,7 @@ main(int argc, char *argv[]) dissectors, and we must do it before we read the preferences, in case any dissectors register preferences. */ epan_init(register_all_protocols,register_all_protocol_handoffs, - splash_update, (gpointer) splash_win, - failure_alert_box,open_failure_alert_box,read_failure_alert_box, - write_failure_alert_box); + splash_update, (gpointer) splash_win); splash_update(RA_LISTENERS, NULL, (gpointer)splash_win); diff --git a/ui/qt/main.cpp b/ui/qt/main.cpp index b63692dac9..7dcd2bc41b 100644 --- a/ui/qt/main.cpp +++ b/ui/qt/main.cpp @@ -43,6 +43,7 @@ #ifdef HAVE_PLUGINS #include <wsutil/plugins.h> #endif +#include <wsutil/report_err.h> #include <wsutil/u3.h> #include <wiretap/merge.h> @@ -827,6 +828,9 @@ int main(int argc, char *argv[]) capture_session_init(&global_capture_session, (void *)&cfile); #endif + init_report_err(failure_alert_box, open_failure_alert_box, + read_failure_alert_box, write_failure_alert_box); + #ifdef HAVE_PLUGINS /* Register all the plugin types we have. */ epan_register_plugin_types(); /* Types known to libwireshark */ @@ -849,10 +853,7 @@ int main(int argc, char *argv[]) dissectors, and we must do it before we read the preferences, in case any dissectors register preferences. */ epan_init(register_all_protocols,register_all_protocol_handoffs, - splash_update, NULL, - failure_alert_box,open_failure_alert_box,read_failure_alert_box, - write_failure_alert_box - ); + splash_update, NULL); splash_update(RA_LISTENERS, NULL, NULL); |