sq krb_pa_supported_enctypes
[metze/wireshark/wip.git] / wsutil / report_message.h
1 /* report_message.h
2  * Declarations of routines for code that can run in GUI and command-line
3  * environments to use to report errors and warnings to the user (e.g.,
4  * I/O errors, or problems with preference settings) if the message should
5  * be shown as a GUI error in a GUI environment.
6  *
7  * The application using libwsutil will register message-reporting
8  * routines, and the routines declared here will call the registered
9  * routines.  That way, these routines can be called by code that
10  * doesn't itself know whether to pop up a dialog or print something
11  * to the standard error.
12  *
13  * Wireshark - Network traffic analyzer
14  * By Gerald Combs <gerald@wireshark.org>
15  * Copyright 1998 Gerald Combs
16  *
17  * SPDX-License-Identifier: GPL-2.0-or-later
18  */
19
20 #ifndef __REPORT_MESSAGE_H__
21 #define __REPORT_MESSAGE_H__
22
23 #include "ws_symbol_export.h"
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif /* __cplusplus */
28
29 /*
30  *  Initialize the report message routines
31  */
32 WS_DLL_PUBLIC void init_report_message(
33         void (*vreport_failure)(const char *, va_list),
34         void (*vreport_warning)(const char *, va_list),
35         void (*report_open_failure)(const char *, int, gboolean),
36         void (*report_read_failure)(const char *, int),
37         void (*report_write_failure)(const char *, int));
38
39 /*
40  * Report a general error.
41  */
42 WS_DLL_PUBLIC void report_failure(const char *msg_format, ...) G_GNUC_PRINTF(1, 2);
43
44 /*
45  * Report a general warning.
46  */
47 WS_DLL_PUBLIC void report_warning(const char *msg_format, ...) G_GNUC_PRINTF(1, 2);
48
49 /*
50  * Report an error when trying to open a file.
51  * "err" is assumed to be an error code from Wiretap; positive values are
52  * UNIX-style errnos, so this can be used for open failures not from
53  * Wiretap as long as the failure code is just an errno.
54  */
55 WS_DLL_PUBLIC void report_open_failure(const char *filename, int err,
56     gboolean for_writing);
57
58 /*
59  * Report an error when trying to read a file.
60  * "err" is assumed to be a UNIX-style errno.
61  */
62 WS_DLL_PUBLIC void report_read_failure(const char *filename, int err);
63
64 /*
65  * Report an error when trying to write a file.
66  * "err" is assumed to be a UNIX-style errno.
67  */
68 WS_DLL_PUBLIC void report_write_failure(const char *filename, int err);
69
70 #ifdef __cplusplus
71 }
72 #endif /* __cplusplus */
73
74 #endif /* __REPORT_MESSAGE_H__ */