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