diff options
author | Guy Harris <guy@alum.mit.edu> | 2003-11-16 23:17:27 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2003-11-16 23:17:27 +0000 |
commit | 7bd2e232a9994756ba0f97d4d93ce64fe885e7df (patch) | |
tree | 564e732958fa7b21a0ce2aaf6f0123b674ea3a71 /gtk/help_dlg.c | |
parent | 21313199e4282797e5cbebb039c417cf8fca739f (diff) | |
download | wireshark-7bd2e232a9994756ba0f97d4d93ce64fe885e7df.tar.gz wireshark-7bd2e232a9994756ba0f97d4d93ce64fe885e7df.tar.bz2 wireshark-7bd2e232a9994756ba0f97d4d93ce64fe885e7df.zip |
Export "protocol_t" as an opaque type.
Make "proto_is_protocol_enabled()" and "proto_get_protocol_short_name()"
take a "protocol_t *" as an argument, so they don't have to look up the
"protocol_t" - this will probably speed them up considerably, and
they're called on almost every dissector handoff.
Get rid of a number of "proto_is_protocol_enabled()" calls that aren't
necessary (dissectors called through handles, including those called
through dissector tables, or called as heuristic dissectors, aren't even
called if their protocol isn't enabled).
Change some direct dissector calls to go through handles.
svn path=/trunk/; revision=8979
Diffstat (limited to 'gtk/help_dlg.c')
-rw-r--r-- | gtk/help_dlg.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/gtk/help_dlg.c b/gtk/help_dlg.c index b48a67040f..c139d74632 100644 --- a/gtk/help_dlg.c +++ b/gtk/help_dlg.c @@ -1,6 +1,6 @@ /* help_dlg.c * - * $Id: help_dlg.c,v 1.35 2003/08/25 21:42:33 guy Exp $ + * $Id: help_dlg.c,v 1.36 2003/11/16 23:17:26 guy Exp $ * * Laurent Deniel <laurent.deniel@free.fr> * @@ -420,6 +420,7 @@ static void set_help_text(GtkWidget *w, help_type_t type) #endif const char *type_name; void *cookie, *cookie2; + protocol_t *protocol; char *name, *short_name, *filter_name; int namel = 0, short_namel = 0, filter_namel = 0; int count, fcount; @@ -449,8 +450,9 @@ static void set_help_text(GtkWidget *w, help_type_t type) for (i = proto_get_first_protocol(&cookie); i != -1; i = proto_get_next_protocol(&cookie)) { count++; + protocol = find_protocol_by_id(i); name = proto_get_protocol_name(i); - short_name = proto_get_protocol_short_name(i); + short_name = proto_get_protocol_short_name(protocol); filter_name = proto_get_protocol_filter_name(i); if ((len = strlen(name)) > namel) namel = len; @@ -473,8 +475,9 @@ static void set_help_text(GtkWidget *w, help_type_t type) /* ok, display the correctly aligned strings */ for (i = proto_get_first_protocol(&cookie); i != -1; i = proto_get_next_protocol(&cookie)) { + protocol = find_protocol_by_id(i); name = proto_get_protocol_name(i); - short_name = proto_get_protocol_short_name(i); + short_name = proto_get_protocol_short_name(protocol); filter_name = proto_get_protocol_filter_name(i); /* the name used for sorting in the left column */ @@ -535,8 +538,9 @@ static void set_help_text(GtkWidget *w, help_type_t type) fcount = 0; for (i = proto_get_first_protocol(&cookie); i != -1; i = proto_get_next_protocol(&cookie)) { + protocol = find_protocol_by_id(i); name = proto_get_protocol_name(i); - short_name = proto_get_protocol_short_name(i); + short_name = proto_get_protocol_short_name(protocol); filter_name = proto_get_protocol_filter_name(i); count = 0; |