aboutsummaryrefslogtreecommitdiffstats
path: root/filters.h
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2001-01-28 09:13:10 +0000
committerGuy Harris <guy@alum.mit.edu>2001-01-28 09:13:10 +0000
commitceef26d2c17d4ea94e1d323d2538f5488e734a92 (patch)
tree0da9239313e69f8834f9e0f21acc328ae614045f /filters.h
parent3c596f5d718465872676cdf4330d6174bc68342d (diff)
Have separate capture and display filter lists; some filter dialog boxes
use the capture filter lists, and others use the display filter list, as appropriate. Have separate menu items for editing the capture and display filter lists. Have separate "~/.ethereal/cfilters" and "~/.ethereal/dfilters" files for the two lists; if either of those files isn't found, we try "~/.ethereal/filters", which means that you will start out with two identical lists holding all your filters - if certain filters belong only in one list, you'll have to delete them by hand from the other list. Do I/O error checking when reading and writing filter lists; when writing a filter list, write it to a new file, and then rename the new file on top of the old file, so that you don't lose your old filter list if, for example, you run out of disk space or disk quota. svn path=/trunk/; revision=2948
Diffstat (limited to 'filters.h')
-rw-r--r--filters.h48
1 files changed, 43 insertions, 5 deletions
diff --git a/filters.h b/filters.h
index 8839af72d8..bf0a000e38 100644
--- a/filters.h
+++ b/filters.h
@@ -1,7 +1,7 @@
/* filters.c
* Declarations of routines for reading and writing the filters file.
*
- * $Id: filters.h,v 1.1 2001/01/28 04:43:24 guy Exp $
+ * $Id: filters.h,v 1.2 2001/01/28 09:13:07 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -24,9 +24,12 @@
*/
/*
- * List of filters.
+ * Filter lists.
*/
-extern GList *fl;
+typedef enum {
+ CFILTER_LIST, /* capture filter list */
+ DFILTER_LIST /* display filter list */
+} filter_list_type_t;
/*
* Item in a list of filters.
@@ -36,6 +39,41 @@ typedef struct {
char *strval; /* filter expression */
} filter_def;
-void get_filter_list(void);
+/*
+ * Read in a list of filters.
+ *
+ * On success, "*pref_path_return" is set to NULL.
+ * On error, "*pref_path_return" is set to point to the pathname of
+ * the file we tried to read - it should be freed by our caller -
+ * and "*errno_return" is set to the error.
+ */
+void read_filter_list(filter_list_type_t list, char **pref_path_return,
+ int *errno_return);
+
+/*
+ * Get a pointer to the first entry in a filter list.
+ */
+GList *get_filter_list_first(filter_list_type_t list);
-void save_filter_list(void);
+/*
+ * Add a new filter to the end of a list.
+ * Returns a pointer to the newly-added entry.
+ */
+GList *add_to_filter_list(filter_list_type_t list, char *name,
+ char *expression);
+
+/*
+ * Remove a filter from a list.
+ */
+void remove_from_filter_list(filter_list_type_t list, GList *fl_entry);
+
+/*
+ * Write out a list of filters.
+ *
+ * On success, "*pref_path_return" is set to NULL.
+ * On error, "*pref_path_return" is set to point to the pathname of
+ * the file we tried to read - it should be freed by our caller -
+ * and "*errno_return" is set to the error.
+ */
+void save_filter_list(filter_list_type_t list, char **pref_path_return,
+ int *errno_return);