Revert "TODO: smb2: simplify preauth_hash calculation..."
[wireshark-sm.git] / fileset.h
blob06680bfc99edff2fcf95c63c0842267da17592c1
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 #include <inttypes.h>
16 #include <time.h>
18 #ifdef __cplusplus
19 extern "C" {
20 #endif /* __cplusplus */
22 typedef 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? */
29 } fileset_entry;
31 typedef enum {
32 FILESET_NO_MATCH,
33 FILESET_TIME_NUM,
34 FILESET_NUM_TIME
35 } fileset_match_t;
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.
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 extern fileset_match_t fileset_filename_match_pattern(const char *fname, char **prefix, char **suffix, char **time);
52 extern void fileset_add_dir(const char *fname, void *window);
54 extern void fileset_delete(void);
56 /* get the current directory name */
57 extern const char *fileset_get_dirname(void);
59 extern fileset_entry *fileset_get_next(void);
60 extern fileset_entry *fileset_get_previous(void);
62 /**
63 * Add an entry to our dialog / window. Called by fileset_update_dlg.
64 * Must be implemented in the UI.
66 * @param entry The new fileset entry.
67 * @param window Window / dialog reference provided by the UI code.
69 extern void fileset_dlg_add_file(fileset_entry *entry, void *window);
71 /**
72 * Notify our dialog / window that we're about to add files. Called by fileset_update_dlg.
73 * Must be implemented in the UI.
75 * @param window Window / dialog reference provided by the UI code.
77 extern void fileset_dlg_begin_add_file(void *window);
79 /**
80 * Notify our dialog / window that we're done adding files. Called by fileset_update_dlg.
81 * Must be implemented in the UI.
83 * @param window Window / dialog reference provided by the UI code.
85 extern void fileset_dlg_end_add_file(void *window);
87 extern void fileset_update_dlg(void *window);
89 extern void fileset_update_file(const char *path);
91 #ifdef __cplusplus
93 #endif /* __cplusplus */
95 #endif /* __FILESET_H__ */
98 * Editor modelines - https://www.wireshark.org/tools/modelines.html
100 * Local variables:
101 * c-basic-offset: 4
102 * tab-width: 8
103 * indent-tabs-mode: nil
104 * End:
106 * vi: set shiftwidth=4 tabstop=8 expandtab:
107 * :indentSize=4:tabSize=8:noTabs=true: