diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2001-01-28 09:13:10 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2001-01-28 09:13:10 +0000 |
commit | 6725db54d5b7faf133af69f3d63d71175685cf75 (patch) | |
tree | 0da9239313e69f8834f9e0f21acc328ae614045f /filters.h | |
parent | 2e1178251f74db77a85cfebd109e7cff1761edfa (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.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@2948 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'filters.h')
-rw-r--r-- | filters.h | 48 |
1 files changed, 43 insertions, 5 deletions
@@ -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); |