Don't use PCRE if we have GRegex.
[obnox/wireshark/wip.git] / cfile.c
1 /* cfile.c
2  * capture_file GUI-independent manipulation
3  * Vassilii Khachaturov <vassilii@tarunz.org>
4  *
5  * $Id$
6  *
7  * Wireshark - Network traffic analyzer
8  * By Gerald Combs <gerald@wireshark.org>
9  * Copyright 1998 Gerald Combs
10  *
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.
15  *
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.
20  *
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.
24  */
25
26 #ifdef HAVE_CONFIG_H
27 # include "config.h"
28 #endif
29
30 #include <glib.h>
31
32 #include <epan/packet.h>
33
34 #include "cfile.h"
35
36 void
37 cap_file_init(capture_file *cf)
38 {
39   /* Initialize the capture file struct */
40   cf->plist_start   = NULL;
41   cf->plist_end     = NULL;
42   cf->wth           = NULL;
43   cf->filename      = NULL;
44   cf->user_saved    = FALSE;
45   cf->is_tempfile   = FALSE;
46   cf->rfcode        = NULL;
47   cf->dfilter       = NULL;
48   cf->has_snap      = FALSE;
49   cf->snap          = WTAP_MAX_PACKET_SIZE;
50   cf->count         = 0;
51   cf->redissecting  = FALSE;
52 }
53
54 void
55 cap_file_add_fdata(capture_file *cf, frame_data *fdata)
56 {
57   frame_data *plist_end = cf->plist_end;
58   fdata->prev = plist_end;
59   if (plist_end != NULL)
60     plist_end->next = fdata;
61   else
62     cf->plist_start = fdata;
63   cf->plist_end = fdata;
64 }
65