Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
/builds/wireshark/wireshark/fileset.h
Go to the documentation of this file.
1
12#ifndef __FILESET_H__
13#define __FILESET_H__
14
15#include <inttypes.h>
16#include <time.h>
17
18#ifdef __cplusplus
19extern "C" {
20#endif /* __cplusplus */
21
22typedef struct _fileset_entry {
23 char *fullname; /* File name with path (g_strdup'ed) */
24 char *name; /* File name without path (g_strdup'ed) */
25 time_t ctime; /* create time */
26 time_t mtime; /* last modified time */
27 int64_t size; /* size of file in bytes */
28 bool current; /* is this the currently loaded file? */
30
31typedef enum {
32 FILESET_NO_MATCH,
33 FILESET_TIME_NUM,
34 FILESET_NUM_TIME
35} fileset_match_t;
36
37/* helper: is this a probable file of a file set (does the naming pattern match)?
38 * Possible naming patterns are prefix_NNNNN_YYYYMMDDHHMMSS.ext[.gz] and
39 * prefix_YYYYMMDDHHMMSS_NNNNN.ext[.gz], where any compression suffix
40 * supported by libwiretap is allowed. The validation is minimal; e.g., the
41 * time is only checked to see if all 14 characters are digits.
42 *
43 * @param[in] fname The filename to check for a naming pattern.
44 * @param[out] prefix If not NULL and the filename matches, the prefix
45 * @param[out] suffix If not NULL and the filename matches, the suffix
46 * (file extension) not including the compression suffix
47 * @param[out] time If not NULL and the filename matches, the time component
48 * @return The type of pattern match, or FILESET_NO_MATCH.
49 * */
50
63extern fileset_match_t fileset_filename_match_pattern(const char *fname, char **prefix, char **suffix, char **time);
64
71extern void fileset_add_dir(const char *fname, void *window);
72
78extern void fileset_delete(void);
79
85/* get the current directory name */
86extern const char *fileset_get_dirname(void);
87
88extern fileset_entry *fileset_get_next(void);
89extern fileset_entry *fileset_get_previous(void);
90
98extern void fileset_dlg_add_file(fileset_entry *entry, void *window);
99
106extern void fileset_dlg_begin_add_file(void *window);
107
114extern void fileset_dlg_end_add_file(void *window);
115
121extern void fileset_update_dlg(void *window);
122
132extern void fileset_update_file(const char *path);
133
134#ifdef __cplusplus
135}
136#endif /* __cplusplus */
137
138#endif /* __FILESET_H__ */
139
140/*
141 * Editor modelines - https://www.wireshark.org/tools/modelines.html
142 *
143 * Local variables:
144 * c-basic-offset: 4
145 * tab-width: 8
146 * indent-tabs-mode: nil
147 * End:
148 *
149 * vi: set shiftwidth=4 tabstop=8 expandtab:
150 * :indentSize=4:tabSize=8:noTabs=true:
151 */
void fileset_delete(void)
Deletes the fileset and frees all associated resources.
Definition fileset.c:480
void fileset_dlg_add_file(fileset_entry *entry, void *window)
Definition file_set_dialog.cpp:43
fileset_match_t fileset_filename_match_pattern(const char *fname, char **prefix, char **suffix, char **time)
Determines if a filename matches a specific pattern and extracts relevant parts.
Definition fileset.c:64
void fileset_update_dlg(void *window)
Updates the file dialog with the current file entries.
Definition fileset.c:331
void fileset_add_dir(const char *fname, void *window)
Adds a directory to the fileset.
Definition fileset.c:348
void fileset_dlg_end_add_file(void *window)
Definition file_set_dialog.cpp:50
void fileset_dlg_begin_add_file(void *window)
Definition file_set_dialog.cpp:35
const char * fileset_get_dirname(void)
Get the current directory name.
Definition fileset.c:396
void fileset_update_file(const char *path)
Updates the file entry with the given path.
Definition fileset.c:248
Definition fileset.h:22