LOCAL: ignore build dirs
[wireshark-wip.git] / filters.h
blob066cdf01154cbe8c97373e657ed0cd2e83d2b4fd
1 /* filters.h
2 * Declarations of routines for reading and writing the filters file.
4 * $Id$
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 #ifndef FILTERS_H
27 #define FILTERS_H
29 #ifdef __cplusplus
30 extern "C" {
31 #endif /* __cplusplus */
34 * Filter lists.
36 typedef enum {
37 CFILTER_LIST, /* capture filter list - saved */
38 DFILTER_LIST, /* display filter list - saved */
39 CFILTER_EDITED_LIST, /* capture filter list - currently edited */
40 DFILTER_EDITED_LIST /* display filter list - currently edited */
41 } filter_list_type_t;
44 * Item in a list of filters.
46 typedef struct {
47 char *name; /* filter name */
48 char *strval; /* filter expression */
49 } filter_def;
52 * Read in a list of filters.
54 * On success, "*pref_path_return" is set to NULL.
55 * On error, "*pref_path_return" is set to point to the pathname of
56 * the file we tried to read - it should be freed by our caller -
57 * and "*errno_return" is set to the error.
59 void read_filter_list(filter_list_type_t list_type, char **pref_path_return,
60 int *errno_return);
63 * Get a pointer to the first entry in a filter list.
65 GList *get_filter_list_first(filter_list_type_t list);
68 * Add a new filter to the end of a list.
69 * Returns a pointer to the newly-added entry.
71 GList *add_to_filter_list(filter_list_type_t list, const char *name,
72 const char *expression);
75 * Remove a filter from a list.
77 void remove_from_filter_list(filter_list_type_t list, GList *fl_entry);
80 * Write out a list of filters.
82 * On success, "*pref_path_return" is set to NULL.
83 * On error, "*pref_path_return" is set to point to the pathname of
84 * the file we tried to read - it should be freed by our caller -
85 * and "*errno_return" is set to the error.
87 void save_filter_list(filter_list_type_t list_type, char **pref_path_return,
88 int *errno_return);
91 * Clone the filter list so it can be edited.
93 void copy_filter_list(filter_list_type_t dest_type, filter_list_type_t src_type);
95 #ifdef __cplusplus
97 #endif /* __cplusplus */
99 #endif /* FILTERS_H */