2 * Declarations of routines for reading and writing the filters file.
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
30 CFILTER_LIST, /* capture filter list - saved */
31 DFILTER_LIST, /* display filter list - saved */
32 CFILTER_EDITED_LIST, /* capture filter list - currently edited */
33 DFILTER_EDITED_LIST /* display filter list - currently edited */
37 * Item in a list of filters.
40 char *name; /* filter name */
41 char *strval; /* filter expression */
45 * Read in a list of filters.
47 * On success, "*pref_path_return" is set to NULL.
48 * On error, "*pref_path_return" is set to point to the pathname of
49 * the file we tried to read - it should be freed by our caller -
50 * and "*errno_return" is set to the error.
52 void read_filter_list(filter_list_type_t list_type, char **pref_path_return,
56 * Get a pointer to the first entry in a filter list.
58 GList *get_filter_list_first(filter_list_type_t list);
61 * Add a new filter to the end of a list.
62 * Returns a pointer to the newly-added entry.
64 GList *add_to_filter_list(filter_list_type_t list, const char *name,
65 const char *expression);
68 * Remove a filter from a list.
70 void remove_from_filter_list(filter_list_type_t list, GList *fl_entry);
73 * Write out a list of filters.
75 * On success, "*pref_path_return" is set to NULL.
76 * On error, "*pref_path_return" is set to point to the pathname of
77 * the file we tried to read - it should be freed by our caller -
78 * and "*errno_return" is set to the error.
80 void save_filter_list(filter_list_type_t list_type, char **pref_path_return,
84 * Clone the filter list so it can be edited.
86 void copy_filter_list(filter_list_type_t dest_type, filter_list_type_t src_type);