diff --git a/epan/plugins.c b/epan/plugins.c index a90f8cb78c..60bd534ab2 100644 --- a/epan/plugins.c +++ b/epan/plugins.c @@ -1,7 +1,7 @@ /* plugins.c * plugin routines * - * $Id: plugins.c,v 1.70 2003/05/01 21:10:42 guy Exp $ + * $Id: plugins.c,v 1.71 2003/06/03 02:32:54 gerald Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -144,13 +144,19 @@ static void plugins_scan_dir(const char *dirname) { #define FILENAME_LEN 1024 +#if GLIB_MAJOR_VERSION < 2 gchar *hack_path; /* pathname used to construct lt_lib_ext */ gchar *lt_lib_ext; /* extension for loadable modules */ DIR *dir; /* scanned directory */ struct dirent *file; /* current file */ + gchar *name; +#else /* GLIB 2 */ + GDir *dir; /* scanned directory */ + GError **dummy; + const gchar *name; +#endif gchar filename[FILENAME_LEN]; /* current file name */ GModule *handle; /* handle returned by dlopen */ - gchar *name; gchar *version; void (*init)(void *); void (*reg_handoff)(void); @@ -168,6 +174,8 @@ plugins_scan_dir(const char *dirname) * to use, but that's not checked into the GLib CVS tree yet, * and we can't use it on systems that don't have GLib 2.0. */ + +#if GLIB_MAJOR_VERSION < 2 hack_path = g_module_build_path("", ""); lt_lib_ext = strrchr(hack_path, '.'); if (lt_lib_ext == NULL) @@ -202,6 +210,27 @@ plugins_scan_dir(const char *dirname) continue; } name = (gchar *)file->d_name; +#else /* GLIB 2 */ + dummy = g_malloc(sizeof(GError *)); + *dummy = NULL; + if ((dir = g_dir_open(dirname, 0, dummy)) != NULL) + { + while ((name = g_dir_read_name(dir)) != NULL) + { + /* skip anything but files with G_MODULE_SUFFIX */ + dot = strrchr(name, '.'); + if (dot == NULL || strcmp(dot+1, G_MODULE_SUFFIX) != 0) continue; + + snprintf(filename, FILENAME_LEN, "%s" G_DIR_SEPARATOR_S "%s", + dirname, name); + + if ((handle = g_module_open(filename, 0)) == NULL) + { + g_warning("Couldn't load module %s: %s", filename, + g_module_error()); + continue; + } +#endif if (g_module_symbol(handle, "version", (gpointer*)&version) == FALSE) { g_warning("The plugin %s has no version symbol", name); @@ -234,7 +263,7 @@ plugins_scan_dir(const char *dirname) * We have a "plugin_reg_handoff()" routine, so we don't * need the protocol, filter string, or dissector pointer. */ - if ((cr = add_plugin(handle, g_strdup(file->d_name), version, + if ((cr = add_plugin(handle, g_strdup(name), version, reg_handoff))) { if (cr == EEXIST) @@ -268,9 +297,16 @@ plugins_scan_dir(const char *dirname) "Those are no longer supported.\n", name, version); } } +#if GLIB_MAJOR_VERSION < 2 closedir(dir); } g_free(hack_path); +#else /* GLIB 2 */ + g_dir_close(dir); + } + g_clear_error(dummy); + g_free(dummy); +#endif } /* @@ -489,7 +525,7 @@ init_plugins(const char *plugin_dir) patable.p_fragment_delete = fragment_delete; patable.p_show_fragment_tree = show_fragment_tree; patable.p_show_fragment_seq_tree = show_fragment_seq_tree; - + patable.p_register_tap = register_tap; patable.p_tap_queue_packet = tap_queue_packet; @@ -517,7 +553,7 @@ init_plugins(const char *plugin_dir) patable.p_asn1_oid_decode = asn1_oid_decode; patable.p_asn1_sequence_decode = asn1_sequence_decode; patable.p_asn1_err_to_str = asn1_err_to_str; - + patable.p_proto_item_set_end = proto_item_set_end; patable.p_proto_tree_add_none_format = proto_tree_add_none_format; @@ -533,6 +569,8 @@ init_plugins(const char *plugin_dir) patable.p_except_free = except_free; patable.p_except_pop = except_pop; patable.p_except_setup_try = except_setup_try; + + patable.p_col_set_fence = col_set_fence; #endif #ifdef WIN32 diff --git a/packaging/nsis/ethereal.nsi b/packaging/nsis/ethereal.nsi index 995013f472..67c52b37bd 100644 --- a/packaging/nsis/ethereal.nsi +++ b/packaging/nsis/ethereal.nsi @@ -1,7 +1,7 @@ ; ; ethereal.nsi ; -; $Id: ethereal.nsi,v 1.13 2003/06/02 18:40:02 gerald Exp $ +; $Id: ethereal.nsi,v 1.14 2003/06/03 02:32:55 gerald Exp $ ; ============================================================================ ; Header configuration @@ -185,6 +185,11 @@ Section "Uninstall" DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Ethereal" DeleteRegKey HKEY_LOCAL_MACHINE SOFTWARE\Ethereal +; +; UnInstall for every user +; +SetShellVarContext all + Delete "$INSTDIR\plugins\${VERSION}\*.*" Delete "$INSTDIR\plugins\*.*" Delete "$INSTDIR\diameter\*.*" diff --git a/plugins/plugin_api.c b/plugins/plugin_api.c index 2efba30562..498f1668be 100644 --- a/plugins/plugin_api.c +++ b/plugins/plugin_api.c @@ -1,7 +1,7 @@ /* plugin_api.c * Routines for Ethereal plugins. * - * $Id: plugin_api.c,v 1.50 2003/05/01 21:10:43 guy Exp $ + * $Id: plugin_api.c,v 1.51 2003/06/03 02:32:55 gerald Exp $ * * Ethereal - Network traffic analyzer * Copyright 2000 by Gilbert Ramirez @@ -254,4 +254,6 @@ plugin_address_table_init(plugin_address_table_t *pat) p_except_free = pat->p_except_free; p_except_pop = pat->p_except_pop; p_except_setup_try = pat->p_except_setup_try; + + p_col_set_fence = pat->p_col_set_fence; } diff --git a/plugins/plugin_api.h b/plugins/plugin_api.h index 1cddf69574..91e9ef169b 100644 --- a/plugins/plugin_api.h +++ b/plugins/plugin_api.h @@ -1,7 +1,7 @@ /* plugin_api.h * Routines for Ethereal plugins. * - * $Id: plugin_api.h,v 1.51 2003/05/01 21:10:43 guy Exp $ + * $Id: plugin_api.h,v 1.52 2003/06/03 02:32:55 gerald Exp $ * * Ethereal - Network traffic analyzer * Copyright 2000 by Gilbert Ramirez @@ -285,6 +285,8 @@ #define except_pop (*p_except_pop) #define except_setup_try (*p_except_setup_try) +#define col_set_fence (*p_col_set_fence) + #endif #include diff --git a/plugins/plugin_api_decls.h b/plugins/plugin_api_decls.h index 10a734e17b..c2bc0fc7f1 100644 --- a/plugins/plugin_api_decls.h +++ b/plugins/plugin_api_decls.h @@ -2,7 +2,7 @@ * Declarations of a list of "p_" names; included in various places * to declare them as variables or as function members. * - * $Id: plugin_api_decls.h,v 1.13 2003/05/01 21:10:43 guy Exp $ + * $Id: plugin_api_decls.h,v 1.14 2003/06/03 02:32:56 gerald Exp $ * * Ethereal - Network traffic analyzer * Copyright 2000 by Gilbert Ramirez @@ -293,3 +293,5 @@ addr_except_alloc p_except_alloc; addr_except_free p_except_free; addr_except_pop p_except_pop; addr_except_setup_try p_except_setup_try; + +addr_col_set_fence p_col_set_fence; diff --git a/plugins/plugin_table.h b/plugins/plugin_table.h index 05be705fcb..a338644069 100644 --- a/plugins/plugin_table.h +++ b/plugins/plugin_table.h @@ -1,7 +1,7 @@ /* plugin_table.h * Table of exported addresses for Ethereal plugins. * - * $Id: plugin_table.h,v 1.63 2003/05/01 21:10:43 guy Exp $ + * $Id: plugin_table.h,v 1.64 2003/06/03 02:32:56 gerald Exp $ * * Ethereal - Network traffic analyzer * Copyright 2000 by Gilbert Ramirez @@ -331,6 +331,8 @@ typedef void (*addr_except_free)(void *); typedef struct except_stacknode *(*addr_except_pop)(void); typedef void (*addr_except_setup_try)(struct except_stacknode *, struct except_catch *, const except_id_t [], size_t); +typedef void (*addr_col_set_fence)(column_info*, gint); + typedef struct { #include "plugin_api_decls.h"