ldap: assume GSS-SPNEGO as default
[wireshark-sm.git] / fileset.h
blob84c075d206fb6bac7dc60c86c3ffe72bd7395b22
1 /** @file
3 * Definitions for routines for file sets.
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * SPDX-License-Identifier: GPL-2.0-or-later
12 #ifndef __FILESET_H__
13 #define __FILESET_H__
15 #ifdef __cplusplus
16 extern "C" {
17 #endif /* __cplusplus */
19 typedef struct _fileset_entry {
20 char *fullname; /* File name with path (g_strdup'ed) */
21 char *name; /* File name without path (g_strdup'ed) */
22 time_t ctime; /* create time */
23 time_t mtime; /* last modified time */
24 gint64 size; /* size of file in bytes */
25 gboolean current; /* is this the currently loaded file? */
26 } fileset_entry;
28 typedef enum {
29 FILESET_NO_MATCH,
30 FILESET_TIME_NUM,
31 FILESET_NUM_TIME
32 } fileset_match_t;
34 /* helper: is this a probable file of a file set (does the naming pattern match)?
35 * Possible naming patterns are prefix_NNNNN_YYYYMMDDHHMMSS.ext[.gz] and
36 * prefix_YYYYMMDDHHMMSS_NNNNN.ext[.gz], where any compression suffix
37 * supported by libwiretap is allowed. The validation is minimal; e.g., the
38 * time is only checked to see if all 14 characters are digits.
40 * @param[in] fname The filename to check for a naming pattern.
41 * @param[out] prefix If not NULL and the filename matches, the prefix
42 * @param[out] suffix If not NULL and the filename matches, the suffix
43 * (file extension) not including the compression suffix
44 * @param[out] time If not NULL and the filename matches, the time component
45 * @return The type of pattern match, or FILESET_NO_MATCH.
46 * */
47 extern fileset_match_t fileset_filename_match_pattern(const char *fname, char **prefix, char **suffix, char **time);
49 extern void fileset_add_dir(const char *fname, void *window);
51 extern void fileset_delete(void);
53 /* get the current directory name */
54 extern const char *fileset_get_dirname(void);
56 extern fileset_entry *fileset_get_next(void);
57 extern fileset_entry *fileset_get_previous(void);
59 /**
60 * Add an entry to our dialog / window. Called by fileset_update_dlg.
61 * Must be implemented in the UI.
63 * @param entry The new fileset entry.
64 * @param window Window / dialog reference provided by the UI code.
66 extern void fileset_dlg_add_file(fileset_entry *entry, void *window);
68 /**
69 * Notify our dialog / window that we're about to add files. Called by fileset_update_dlg.
70 * Must be implemented in the UI.
72 * @param window Window / dialog reference provided by the UI code.
74 extern void fileset_dlg_begin_add_file(void *window);
76 /**
77 * Notify our dialog / window that we're done adding files. Called by fileset_update_dlg.
78 * Must be implemented in the UI.
80 * @param window Window / dialog reference provided by the UI code.
82 extern void fileset_dlg_end_add_file(void *window);
84 extern void fileset_update_dlg(void *window);
86 extern void fileset_update_file(const char *path);
88 #ifdef __cplusplus
90 #endif /* __cplusplus */
92 #endif /* __FILESET_H__ */
95 * Editor modelines - https://www.wireshark.org/tools/modelines.html
97 * Local variables:
98 * c-basic-offset: 4
99 * tab-width: 8
100 * indent-tabs-mode: nil
101 * End:
103 * vi: set shiftwidth=4 tabstop=8 expandtab:
104 * :indentSize=4:tabSize=8:noTabs=true: