From f5cf9c8dcaebd81935264cbcc55bb6de1fa98ba2 Mon Sep 17 00:00:00 2001 From: Ed Warnicke Date: Mon, 2 Apr 2001 00:38:36 +0000 Subject: Added two new arguments to epan_init() and proto_init() to allow the passing of register_all_protocols() and register_all_protocol_handoffs() through epan_init() to proto_init(). This allows the removal of the compile time dependence of proto.c on register.h. Modified dftest.c, tethereal.c, and gtk/main.c to use the new style epan_init() and depend on register.h. svn path=/trunk/; revision=3237 --- epan/epan.c | 7 ++++--- epan/epan.h | 5 +++-- epan/proto.c | 6 +++--- epan/proto.h | 5 +++-- 4 files changed, 13 insertions(+), 10 deletions(-) (limited to 'epan') diff --git a/epan/epan.c b/epan/epan.c index a779cb876b..407f6aa11b 100644 --- a/epan/epan.c +++ b/epan/epan.c @@ -1,6 +1,6 @@ /* epan.h * - * $Id: epan.c,v 1.9 2001/04/01 22:01:34 hagbard Exp $ + * $Id: epan.c,v 1.10 2001/04/02 00:38:34 hagbard Exp $ * * Ethereal Protocol Analyzer Library * @@ -42,12 +42,13 @@ * libraries are located.) */ void -epan_init(const char *plugin_dir) +epan_init(const char *plugin_dir, void (register_all_protocols)(void), + void (register_all_handoffs)(void)) { except_init(); tvbuff_init(); frame_data_init(); - proto_init(plugin_dir); + proto_init(plugin_dir,register_all_protocols,register_all_handoffs); packet_init(); dfilter_init(); } diff --git a/epan/epan.h b/epan/epan.h index 9f94865f2e..a2d97585f8 100644 --- a/epan/epan.h +++ b/epan/epan.h @@ -1,6 +1,6 @@ /* epan.h * - * $Id: epan.h,v 1.5 2001/02/01 20:21:16 gram Exp $ + * $Id: epan.h,v 1.6 2001/04/02 00:38:34 hagbard Exp $ * * Ethereal Protocol Analyzer Library * @@ -14,7 +14,8 @@ /* XXX - for now */ #include "packet.h" -void epan_init(const char *); +void epan_init(const char * plugindir, void (register_all_protocols)(void), + void (register_all_handoffs)(void)); void epan_cleanup(void); void epan_conversation_init(void); diff --git a/epan/proto.c b/epan/proto.c index c2f23f2b2d..e1e33677d8 100644 --- a/epan/proto.c +++ b/epan/proto.c @@ -1,7 +1,7 @@ /* proto.c * Routines for protocol tree * - * $Id: proto.c,v 1.18 2001/04/01 22:50:08 hagbard Exp $ + * $Id: proto.c,v 1.19 2001/04/02 00:38:34 hagbard Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -42,7 +42,6 @@ #include "packet.h" #include "strutil.h" #include "resolv.h" -#include "register.h" #include "plugins.h" #include "ipv6-utils.h" #include "proto.h" @@ -164,7 +163,8 @@ gboolean proto_tree_is_visible = FALSE; /* initialize data structures and register protocols and fields */ void -proto_init(const char *plugin_dir) +proto_init(const char *plugin_dir,void (register_all_protocols)(void), + void (register_all_protocol_handoffs)(void)) { static hf_register_info hf[] = { { &hf_text_only, diff --git a/epan/proto.h b/epan/proto.h index 42fdd52fc0..5bf1b2c5d9 100644 --- a/epan/proto.h +++ b/epan/proto.h @@ -1,7 +1,7 @@ /* proto.h * Definitions for protocol display * - * $Id: proto.h,v 1.10 2001/04/01 22:50:08 hagbard Exp $ + * $Id: proto.h,v 1.11 2001/04/02 00:38:34 hagbard Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -129,7 +129,8 @@ typedef struct field_info { #define NullTVB NULL /* Sets up memory used by proto routines. Called at program startup */ -void proto_init(const char *plugin_dir); +void proto_init(const char *plugin_dir, void (register_all_protocols)(void), + void (register_all_handoffs)(void)); /* Frees memory used by proto routines. Called at program shutdown */ void proto_cleanup(void); -- cgit v1.2.3