diff options
author | Guy Harris <guy@alum.mit.edu> | 1999-10-11 06:39:26 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 1999-10-11 06:39:26 +0000 |
commit | 3b9013d39358c54611c8ba82595c3a4ff2f596eb (patch) | |
tree | dfec8b639fbd755acc879b925ce7a2d2dd8e9302 /dfilter.h | |
parent | 29b9c8a2850ae3be73d1fce38a1e96591ba165fb (diff) |
When a new display filter is to be applied, don't set "cf.dfilter" or
"cf.dfcode" if the new filter doesn't compile, because the filter
currently in effect will be the one that was last applied - just free up
the text of the new filter, and whatever memory was allocated for the
new filter code.
This means we allocate a new dfilter when a new filter is to be applied,
rather than recycling stuff from the old filter, as we want the old
filter code to remain around if the new filter doesn't compile.
This means that "cf.dfilter" and "cf.dfcode" will be null if there's no
filter in effect.
svn path=/trunk/; revision=803
Diffstat (limited to 'dfilter.h')
-rw-r--r-- | dfilter.h | 10 |
1 files changed, 3 insertions, 7 deletions
@@ -1,7 +1,7 @@ /* dfilter.h * Definitions for display filters * - * $Id: dfilter.h,v 1.10 1999/08/26 06:20:49 gram Exp $ + * $Id: dfilter.h,v 1.11 1999/10/11 06:39:04 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -26,7 +26,7 @@ #ifndef __DFILTER_H__ #define __DFILTER_H__ -#define DFILTER_CONTAINS_FILTER(x) ((x)->dftree) +#define DFILTER_CONTAINS_FILTER(x) ((x) != NULL && (x)->dftree) /* dfilter_error_msg is NULL if there was no error during dfilter_compile, * otherwise it points to a displayable error message. */ @@ -36,7 +36,6 @@ extern gchar dfilter_error_msg_buf[1024]; typedef struct { GNode *dftree; - gchar *dftext; /* space for dfilter_nodes */ GMemChunk *node_memchunk; @@ -59,12 +58,9 @@ dfilter* dfilter_new(void); void dfilter_destroy(dfilter *df); /* Compile display filter text */ -int dfilter_compile(dfilter* df, gchar* dfilter_text); +dfilter* dfilter_compile(gchar* dfilter_text); /* Apply compiled dfilter to a proto_tree */ gboolean dfilter_apply(dfilter *df, proto_tree *ptree, const guint8* pd); -/* Clears the current filter int the dfilter */ -void dfilter_clear_filter(dfilter *df); - #endif /* ! __DFILTER_H__ */ |