Fix for bug 2839:
[obnox/wireshark/wip.git] / fileset.h
1 /* fileset.h
2  * Definitions for routines for file sets.
3  *
4  * $Id$
5  *
6  * Wireshark - Network traffic analyzer
7  * By Gerald Combs <gerald@wireshark.org>
8  * Copyright 1998 Gerald Combs
9  *
10  * This program is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU General Public License
12  * as published by the Free Software Foundation; either version 2
13  * of the License, or (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
23  */
24
25 #ifndef __FILESET_H__
26 #define __FILESET_H__
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif /* __cplusplus */
31
32
33 typedef struct _fileset_entry {
34   const char    *fullname;      /* File name with path (g_strdup'ed) */
35   const char    *name;          /* File name without path (g_strdup'ed) */
36   time_t        ctime;          /* create time */
37   time_t        mtime;          /* last modified time */
38   long          size;           /* size of file in bytes */
39   gboolean      current;        /* is this the currently loaded file? */
40 } fileset_entry;
41
42
43 /* helper: is this a probable file of a file set (does the naming pattern match)? */
44 extern gboolean fileset_filename_match_pattern(const char *fname);
45
46 /* helper: test, if both files could be in the same file set */
47 extern gboolean fileset_is_file_in_set(const char *fname1, const char *fname2);
48
49 extern void fileset_add_dir(const char *fname);
50
51 extern void fileset_delete(void);
52
53 /* get the current directory name */
54 extern const char *fileset_get_dirname(void);
55
56 extern fileset_entry *fileset_get_next(void);
57 extern fileset_entry *fileset_get_previous(void);
58
59
60
61 /* this file is a part of the current file set */
62 extern void fileset_dlg_add_file(fileset_entry *entry);
63
64 extern void fileset_file_opened(const char *fname);
65
66 extern void fileset_file_closed(void);
67
68 extern void fileset_update_dlg(void);
69
70 #ifdef __cplusplus
71 }
72 #endif /* __cplusplus */
73
74 #endif /* __FILESET_H__ */
75