ui: use SPDX identifiers.
[metze/wireshark/wip.git] / ui / alert_box.h
1 /* alert_box.h
2  * Routines to put up various "standard" alert boxes used in multiple
3  * places
4  *
5  * Wireshark - Network traffic analyzer
6  * By Gerald Combs <gerald@wireshark.org>
7  * Copyright 1998 Gerald Combs
8  *
9  * SPDX-License-Identifier: GPL-2.0+*/
10
11 #ifndef __ALERT_BOX_H__
12 #define __ALERT_BOX_H__
13
14 #ifdef __cplusplus
15 extern "C" {
16 #endif /* __cplusplus */
17
18 /*
19  * Alert box for general errors.
20  */
21 extern void failure_alert_box(const char *msg_format, ...) G_GNUC_PRINTF(1, 2);
22 extern void vfailure_alert_box(const char *msg_format, va_list ap);
23
24 /*
25  * Alert box for general warnings.
26  */
27 extern void vwarning_alert_box(const char *msg_format, va_list ap);
28
29 /*
30  * Alert box for a failed attempt to open a capture file for reading.
31  * "filename" is the name of the file being opened; "err" is assumed
32  * to be a UNIX-style errno or a WTAP_ERR_ value; "err_info" is assumed
33  * to be a string giving further information for some WTAP_ERR_ values..
34  */
35 extern void cfile_open_failure_alert_box(const char *filename, int err,
36                                          gchar *err_info);
37
38 /*
39  * Alert box for a failed attempt to open a capture file for writing.
40  * "filename" is the name of the file being opened; "err" is assumed
41  * to be a UNIX-style errno or a WTAP_ERR_ value; "file_type_subtype"
42  * is a WTAP_FILE_TYPE_SUBTYPE_ value for the type and subtype of file
43  * being opened.
44  */
45 extern void cfile_dump_open_failure_alert_box(const char *filename, int err,
46                                               int file_type_subtype);
47
48 /*
49  * Alert box for a failed attempt to read from a capture file.
50  * "err" is assumed to be a UNIX-style errno or a WTAP_ERR_ value;
51  * "err_info" is assumed to be a string giving further information for
52  * some WTAP_ERR_ values.
53  */
54 extern void cfile_read_failure_alert_box(const char *filename, int err,
55                                          gchar *err_info);
56
57 /*
58  * Alert box for a failed attempt to write to a capture file.
59  * "in_filename" is the name of the file from which the record being
60  * written came; "out_filename" is the name of the file to which we're
61  * writing; "err" is assumed "err" is assumed to be a UNIX-style errno
62  * or a WTAP_ERR_ value; "err_info" is assumed to be a string giving
63  * further information for some WTAP_ERR_ values; "framenum" is the frame
64  * number of the record on which the error occurred; "file_type_subtype"
65  * is a WTAP_FILE_TYPE_SUBTYPE_ value for the type and subtype of file
66  * being written.
67  */
68 extern void cfile_write_failure_alert_box(const char *in_filename,
69                                           const char *out_filename,
70                                           int err, gchar *err_info,
71                                           guint32 framenum,
72                                           int file_type_subtype);
73
74 /*
75  * Alert box for a failed attempt to close a capture file.
76  * "err" is assumed to be a UNIX-style errno or a WTAP_ERR_ value.
77  *
78  * When closing a capture file:
79  *
80  *    some information in the file that can't be determined until
81  *    all packets have been written might be written to the file
82  *    (such as a table of the file offsets of all packets);
83  *
84  *    data buffered in the low-level file writing code might be
85  *    flushed to the file;
86  *
87  *    for remote file systems, data written to the file but not
88  *    yet sent to the server might be sent to the server or, if
89  *    that data was sent asynchronously, "out of space", "disk
90  *    quota exceeded", or "I/O error" indications might have
91  *    been received but not yet delivered, and the close operation
92  *    could deliver them;
93  *
94  * so we have to check for write errors here.
95  */
96 extern void cfile_close_failure_alert_box(const char *filename, int err);
97
98 /*
99  * Alert box for a failed attempt to open or create a file.
100  * "err" is assumed to be a UNIX-style errno; "for_writing" is TRUE if
101  * the file is being opened for writing and FALSE if it's being opened
102  * for reading.
103  */
104 extern void open_failure_alert_box(const char *filename, int err,
105                                    gboolean for_writing);
106
107 /*
108  * Alert box for a failed attempt to read a file.
109  * "err" is assumed to be a UNIX-style errno.
110  */
111 extern void read_failure_alert_box(const char *filename, int err);
112
113 /*
114  * Alert box for a failed attempt to write to a file.
115  * "err" is assumed to be a UNIX-style errno.
116  */
117 extern void write_failure_alert_box(const char *filename, int err);
118
119 #ifdef __cplusplus
120 }
121 #endif /* __cplusplus */
122
123 #endif /* __ALERT_BOX_H__ */
124
125 /*
126  * Editor modelines
127  *
128  * Local Variables:
129  * c-basic-offset: 4
130  * tab-width: 8
131  * indent-tabs-mode: nil
132  * End:
133  *
134  * ex: set shiftwidth=4 tabstop=8 expandtab:
135  * :indentSize=4:tabSize=8:noTabs=true:
136  */