From ab07f8e0f89eb1bb2c2c61c71e44e3fd0e31cc52 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Sun, 4 Dec 2016 13:42:07 -0800 Subject: Have a routine to do all the work of initializing libwiretap. Have programs that use libwiretap call that routine rather than separately calling some or all of init_open_routines(), wtap_register_plugin_types(), and wtap_opttypes_initialize(). Also don't have routines internal to libwiretap call those. Yes, this means doing some initialization work when it isn't necessary, but scattering on-demand calls throughout the code is a great way to forget to make those calls. Change-Id: I5828e1c5591c9d94fbb3eb0a0e54591e8fc61710 Reviewed-on: https://code.wireshark.org/review/19069 Reviewed-by: Guy Harris --- editcap.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'editcap.c') diff --git a/editcap.c b/editcap.c index 40a6a81746..6b6e27ab0e 100644 --- a/editcap.c +++ b/editcap.c @@ -1013,7 +1013,8 @@ main(int argc, char *argv[]) * Get credential information for later use. */ init_process_policies(); - init_open_routines(); + + wtap_init(); #ifdef HAVE_PLUGINS /* Register wiretap plugins */ @@ -1021,9 +1022,6 @@ main(int argc, char *argv[]) g_warning("editcap: init_progfile_dir(): %s", init_progfile_dir_error); g_free(init_progfile_dir_error); } else { - /* Register all the plugin types we have. */ - wtap_register_plugin_types(); /* Types known to libwiretap */ - init_report_err(failure_message,NULL,NULL,NULL); /* Scan for plugins. This does *not* call their registration routines; -- cgit v1.2.1