X11 generator: avoid extraneous parens in conditionals.
[metze/wireshark/wip.git] / ringbuffer.h
1 /* ringbuffer.h
2  * Definitions for capture ringbuffer files
3  *
4  * Wireshark - Network traffic analyzer
5  * By Gerald Combs <gerald@wireshark.org>
6  * Copyright 1998 Gerald Combs
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21  */
22
23 #ifndef __RINGBUFFER_H__
24 #define __RINGBUFFER_H__
25
26 #include <stdio.h>
27 #include "file.h"
28 #include "wiretap/wtap.h"
29
30 #define RINGBUFFER_UNLIMITED_FILES 0
31 /* Minimum number of ringbuffer files */
32 #define RINGBUFFER_MIN_NUM_FILES 0
33 /* Maximum number of ringbuffer files */
34 /* Avoid crashes on very large numbers. Should be a power of 10 */
35 #define RINGBUFFER_MAX_NUM_FILES 100000
36 /* Maximum number for FAT filesystems */
37 #define RINGBUFFER_WARN_NUM_FILES 65535
38
39 int ringbuf_init(const char *capture_name, guint num_files, gboolean group_read_access);
40 const gchar *ringbuf_current_filename(void);
41 FILE *ringbuf_init_libpcap_fdopen(int *err);
42 gboolean ringbuf_switch_file(FILE **pdh, gchar **save_file, int *save_file_fd,
43                              int *err);
44 gboolean ringbuf_libpcap_dump_close(gchar **save_file, int *err);
45 void ringbuf_free(void);
46 void ringbuf_error_cleanup(void);
47
48 #endif /* ringbuffer.h */
49
50 /*
51  * Editor modelines  -  http://www.wireshark.org/tools/modelines.html
52  *
53  * Local Variables:
54  * c-basic-offset: 2
55  * tab-width: 8
56  * indent-tabs-mode: nil
57  * End:
58  *
59  * vi: set shiftwidth=2 tabstop=8 expandtab:
60  * :indentSize=2:tabSize=8:noTabs=true:
61  */