2 * Declarations of routines for reading and writing the filters file.
4 * Wireshark - Network traffic analyzer
5 * By Gerald Combs <gerald@wireshark.org>
6 * Copyright 1998 Gerald Combs
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
29 #endif /* __cplusplus */
35 CFILTER_LIST, /* capture filter list - saved */
36 DFILTER_LIST, /* display filter list - saved */
37 CFILTER_EDITED_LIST, /* capture filter list - currently edited */
38 DFILTER_EDITED_LIST /* display filter list - currently edited */
42 * Item in a list of filters.
45 char *name; /* filter name */
46 char *strval; /* filter expression */
50 * Read in a list of filters.
52 * On success, "*pref_path_return" is set to NULL.
53 * On error, "*pref_path_return" is set to point to the pathname of
54 * the file we tried to read - it should be freed by our caller -
55 * and "*errno_return" is set to the error.
57 void read_filter_list(filter_list_type_t list_type, char **pref_path_return,
61 * Get a pointer to the first entry in a filter list.
63 GList *get_filter_list_first(filter_list_type_t list);
66 * Add a new filter to the end of a list.
67 * Returns a pointer to the newly-added entry.
69 GList *add_to_filter_list(filter_list_type_t list, const char *name,
70 const char *expression);
73 * Remove a filter from a list.
75 void remove_from_filter_list(filter_list_type_t list, GList *fl_entry);
78 * Write out a list of filters.
80 * On success, "*pref_path_return" is set to NULL.
81 * On error, "*pref_path_return" is set to point to the pathname of
82 * the file we tried to read - it should be freed by our caller -
83 * and "*errno_return" is set to the error.
85 void save_filter_list(filter_list_type_t list_type, char **pref_path_return,
89 * Clone the filter list so it can be edited.
91 void copy_filter_list(filter_list_type_t dest_type, filter_list_type_t src_type);
95 #endif /* __cplusplus */
97 #endif /* FILTERS_H */