From 74777083d35400bb6ca9fff58ea3e0d53f24671d Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Sat, 18 Nov 2000 21:41:40 +0000 Subject: Fix a number of problems that caused compiles to fail if PLUGINS_NEED_ADDRESS_TABLE was defined. svn path=/trunk/; revision=2662 --- epan/plugins.c | 12 ++++++------ epan/plugins.h | 3 ++- gtk/gui_prefs.c | 22 +++++++++++----------- gtk/prefs_dlg.c | 4 ++-- plugins/plugin_table.h | 19 ++++++++++--------- prefs-int.h | 6 +++--- prefs.c | 10 +++++----- prefs.h | 6 +++--- 8 files changed, 42 insertions(+), 40 deletions(-) diff --git a/epan/plugins.c b/epan/plugins.c index c3be06f4c7..7d68315b7d 100644 --- a/epan/plugins.c +++ b/epan/plugins.c @@ -1,7 +1,7 @@ /* plugins.c * plugin routines * - * $Id: plugins.c,v 1.10 2000/11/15 09:37:51 guy Exp $ + * $Id: plugins.c,v 1.11 2000/11/18 21:41:37 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -619,7 +619,7 @@ init_plugins(const char *plugin_dir) /* Intialize address table */ patable.p_check_col = check_col; patable.p_col_add_fstr = col_add_fstr; - patable.p_col_append_fstr = col_append_str; + patable.p_col_append_fstr = col_append_fstr; patable.p_col_add_str = col_add_str; patable.p_col_append_str = col_append_str; @@ -638,10 +638,10 @@ init_plugins(const char *plugin_dir) patable.p_heur_dissector_add = heur_dissector_add; - patable.p_register_dissector = p_register_dissector; - patable.p_find_dissector = p_find_dissector; - patable.p_old_call_dissector = p_old_call_dissector; - patable.p_call_dissector = p_call_dissector; + patable.p_register_dissector = register_dissector; + patable.p_find_dissector = find_dissector; + patable.p_old_call_dissector = old_call_dissector; + patable.p_call_dissector = call_dissector; patable.p_dissect_data = dissect_data; patable.p_old_dissect_data = old_dissect_data; diff --git a/epan/plugins.h b/epan/plugins.h index 6221823b71..1d25afb584 100644 --- a/epan/plugins.h +++ b/epan/plugins.h @@ -1,7 +1,7 @@ /* plugins.h * definitions for plugins structures * - * $Id: plugins.h,v 1.3 2000/11/15 09:37:51 guy Exp $ + * $Id: plugins.h,v 1.4 2000/11/18 21:41:37 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -31,6 +31,7 @@ #include "dfilter.h" #include "packet.h" +#include "prefs.h" typedef struct _plugin { GModule *handle; /* handle returned by dlopen */ diff --git a/gtk/gui_prefs.c b/gtk/gui_prefs.c index bf6747d781..2a8edf1c15 100644 --- a/gtk/gui_prefs.c +++ b/gtk/gui_prefs.c @@ -1,7 +1,7 @@ /* gui_prefs.c * Dialog box for GUI preferences * - * $Id: gui_prefs.c,v 1.22 2000/10/20 04:26:40 gram Exp $ + * $Id: gui_prefs.c,v 1.23 2000/11/18 21:41:38 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -46,11 +46,11 @@ static void create_option_menu(GtkWidget *main_vb, const gchar *key, GtkWidget *main_tb, int table_position, - const gchar *label_text, const enum_val *enumvals, gint current_val); + const gchar *label_text, const enum_val_t *enumvals, gint current_val); static void font_browse_cb(GtkWidget *w, gpointer data); static void font_browse_ok_cb(GtkWidget *w, GtkFontSelectionDialog *fs); static void font_browse_destroy(GtkWidget *win, gpointer data); -static gint fetch_enum_value(gpointer control, const enum_val *enumvals); +static gint fetch_enum_value(gpointer control, const enum_val_t *enumvals); static void color_browse_cb(GtkWidget *w, gpointer data); static void update_text_color(GtkWidget *w, gpointer data); static void update_current_color(GtkWidget *w, gpointer data); @@ -74,19 +74,19 @@ static void fetch_colors(void); #define COLOR_SAMPLE_PTR_KEY "color_sample_ptr" #define COLOR_SELECTION_PTR_KEY "color_selection_ptr" -static const enum_val scrollbar_placement_vals[] = { +static const enum_val_t scrollbar_placement_vals[] = { { "Left", FALSE }, { "Right", TRUE }, { NULL, 0 } }; -static const enum_val selection_mode_vals[] = { +static const enum_val_t selection_mode_vals[] = { { "Selects", FALSE }, { "Browses", TRUE }, { NULL, 0 } }; -static const enum_val line_style_vals[] = { +static const enum_val_t line_style_vals[] = { { "None", 0 }, { "Solid", 1 }, { "Dotted", 2 }, @@ -94,7 +94,7 @@ static const enum_val line_style_vals[] = { { NULL, 0 } }; -static const enum_val expander_style_vals[] = { +static const enum_val_t expander_style_vals[] = { { "None", 0 }, { "Square", 1 }, { "Triangle", 2 }, @@ -102,7 +102,7 @@ static const enum_val expander_style_vals[] = { { NULL, 0 } }; -static const enum_val highlight_style_vals[] = { +static const enum_val_t highlight_style_vals[] = { { "Bold", 0 }, { "Inverse", 1 }, { NULL, 0 } @@ -194,11 +194,11 @@ gui_prefs_show(void) static void create_option_menu(GtkWidget *main_vb, const gchar *key, GtkWidget *main_tb, int table_position, - const gchar *label_text, const enum_val *enumvals, gint current_val) + const gchar *label_text, const enum_val_t *enumvals, gint current_val) { GtkWidget *label, *menu, *menu_item, *option_menu; int menu_index, index; - const enum_val *enum_valp; + const enum_val_t *enum_valp; label = gtk_label_new(label_text); gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); @@ -389,7 +389,7 @@ font_browse_destroy(GtkWidget *win, gpointer data) } static gint -fetch_enum_value(gpointer control, const enum_val *enumvals) +fetch_enum_value(gpointer control, const enum_val_t *enumvals) { GtkWidget *label; char *label_string; diff --git a/gtk/prefs_dlg.c b/gtk/prefs_dlg.c index 804126973a..d204be4741 100644 --- a/gtk/prefs_dlg.c +++ b/gtk/prefs_dlg.c @@ -1,7 +1,7 @@ /* prefs_dlg.c * Routines for handling preferences * - * $Id: prefs_dlg.c,v 1.22 2000/08/23 06:56:11 guy Exp $ + * $Id: prefs_dlg.c,v 1.23 2000/11/18 21:41:38 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -107,7 +107,7 @@ pref_show(pref_t *pref, gpointer user_data) GtkWidget *label, *menu, *menu_item, *widget, *button; GSList *rb_group; char uint_str[10+1]; - const enum_val *enum_valp; + const enum_val_t *enum_valp; int menu_index, index; /* Give this preference a label which is its title, followed by a colon, diff --git a/plugins/plugin_table.h b/plugins/plugin_table.h index 126e205955..2476290348 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.10 2000/11/16 07:35:43 guy Exp $ + * $Id: plugin_table.h,v 1.11 2000/11/18 21:41:40 guy Exp $ * * Ethereal - Network traffic analyzer * Copyright 2000 by Gilbert Ramirez @@ -163,14 +163,15 @@ typedef gint (*addr_tvb_strncaseeql)(tvbuff_t*, gint, const guint8 *, gint); typedef gchar *(*addr_tvb_bytes_to_str)(tvbuff_t*, gint, gint len); -typedef module_t *(*addr_prefs_register_module)(const char *, const char *, - void (*)(void)); -typedef void (*addr_prefs_register_uint_preference)(module_t *, const char *, - const char *, const char *, guint, guint *); -typedef void (*addr_prefs_register_bool_preference)(module_t *, const char *, - const char *, const char *, gboolean *); -typedef void (*addr_prefs_register_enum_preference)(module_t *, const char *, - const char *, const char *, gint *, const enum_val *, gboolean); +typedef struct pref_module *(*addr_prefs_register_module)(const char *, + const char *, void (*)(void)); +typedef void (*addr_prefs_register_uint_preference)(struct pref_module *, + const char *, const char *, const char *, guint, guint *); +typedef void (*addr_prefs_register_bool_preference)(struct pref_module *, + const char *, const char *, const char *, gboolean *); +typedef void (*addr_prefs_register_enum_preference)(struct pref_module *, + const char *, const char *, const char *, gint *, const enum_val_t *, + gboolean); typedef struct { addr_check_col p_check_col; diff --git a/prefs-int.h b/prefs-int.h index 3df04f88b6..04eb084c38 100644 --- a/prefs-int.h +++ b/prefs-int.h @@ -2,7 +2,7 @@ * Definitions for implementation of preference handling routines; * used by "friends" of the preferences type. * - * $Id: prefs-int.h,v 1.2 2000/07/09 03:29:27 guy Exp $ + * $Id: prefs-int.h,v 1.3 2000/11/18 21:41:36 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -64,7 +64,7 @@ struct preference { union { guint base; /* input/output base, for PREF_UINT */ struct { - const enum_val *enumvals; /* list of name & values */ + const enum_val_t *enumvals; /* list of name & values */ gboolean radio_buttons; /* TRUE if it should be shown as radio buttons rather than as an option menu or combo box in @@ -74,7 +74,7 @@ struct preference { void *control; /* handle for GUI control for this preference */ }; -gint find_val_for_string(const char *needle, const enum_val *haystack, +gint find_val_for_string(const char *needle, const enum_val_t *haystack, gint default_value); #endif /* prefs-int.h */ diff --git a/prefs.c b/prefs.c index 006c851fe7..fcd9903313 100644 --- a/prefs.c +++ b/prefs.c @@ -1,7 +1,7 @@ /* prefs.c * Routines for handling preferences * - * $Id: prefs.c,v 1.43 2000/10/15 08:46:18 guy Exp $ + * $Id: prefs.c,v 1.44 2000/11/18 21:41:36 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -286,7 +286,7 @@ prefs_register_bool_preference(module_t *module, const char *name, void prefs_register_enum_preference(module_t *module, const char *name, const char *title, const char *description, gint *var, - const enum_val *enumvals, gboolean radio_buttons) + const enum_val_t *enumvals, gboolean radio_buttons) { pref_t *preference; @@ -406,7 +406,7 @@ clear_string_list(GList *sl) { } /* - * Takes a string, a pointer to an array of "enum_val"s, and a default gint + * Takes a string, a pointer to an array of "enum_val_t"s, and a default gint * value. * The array must be terminated by an entry with a null "name" string. * If the string matches a "name" strings in an entry, the value from that @@ -414,7 +414,7 @@ clear_string_list(GList *sl) { * third argument is returned. */ gint -find_val_for_string(const char *needle, const enum_val *haystack, +find_val_for_string(const char *needle, const enum_val_t *haystack, gint default_value) { int i = 0; @@ -1015,7 +1015,7 @@ write_pref(gpointer data, gpointer user_data) { pref_t *pref = data; write_pref_arg_t *arg = user_data; - const enum_val *enum_valp; + const enum_val_t *enum_valp; const char *val_string; fprintf(arg->pf, "\n# %s\n", pref->description); diff --git a/prefs.h b/prefs.h index 783f34db56..5975e5944d 100644 --- a/prefs.h +++ b/prefs.h @@ -1,7 +1,7 @@ /* prefs.h * Definitions for preference handling routines * - * $Id: prefs.h,v 1.24 2000/09/08 09:49:21 guy Exp $ + * $Id: prefs.h,v 1.25 2000/11/18 21:41:36 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -123,11 +123,11 @@ void prefs_register_bool_preference(module_t *module, const char *name, typedef struct { char *name; gint value; -} enum_val; +} enum_val_t; void prefs_register_enum_preference(module_t *module, const char *name, const char *title, const char *description, gint *var, - const enum_val *enumvals, gboolean radio_buttons); + const enum_val_t *enumvals, gboolean radio_buttons); /* * Register a preference with a character-string value. -- cgit v1.2.3