2 * Declarations of routines for code that can run in GUI and command-line
3 * environments to use to report errors to the user (e.g., I/O errors, or
4 * problems with preference settings).
6 * The application using libwireshark will register error-reporting
7 * routines, and the routines declared here will call the registered
8 * routines. That way, these routines can be called by code that
9 * doesn't itself know whether to pop up a dialog or print something
10 * to the standard error.
14 * Wireshark - Network traffic analyzer
15 * By Gerald Combs <gerald@wireshark.org>
16 * Copyright 1998 Gerald Combs
18 * This program is free software; you can redistribute it and/or
19 * modify it under the terms of the GNU General Public License
20 * as published by the Free Software Foundation; either version 2
21 * of the License, or (at your option) any later version.
23 * This program is distributed in the hope that it will be useful,
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 * GNU General Public License for more details.
28 * You should have received a copy of the GNU General Public License
29 * along with this program; if not, write to the Free Software
30 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
33 #ifndef __REPORT_ERR_H__
34 #define __REPORT_ERR_H__
36 #include "ws_symbol_export.h"
40 #endif /* __cplusplus */
43 * Initialize the report err routines
45 WS_DLL_PUBLIC
void init_report_err(
46 void (*report_failure
)(const char *, va_list),
47 void (*report_open_failure
)(const char *, int, gboolean
),
48 void (*report_read_failure
)(const char *, int),
49 void (*report_write_failure
)(const char *, int));
52 * Report a general error.
54 WS_DLL_PUBLIC
void report_failure(const char *msg_format
, ...);
57 * Report an error when trying to open a file.
58 * "err" is assumed to be an error code from Wiretap; positive values are
59 * UNIX-style errnos, so this can be used for open failures not from
60 * Wiretap as long as the failure code is just an errno.
62 WS_DLL_PUBLIC
void report_open_failure(const char *filename
, int err
,
63 gboolean for_writing
);
66 * Report an error when trying to read a file.
67 * "err" is assumed to be a UNIX-style errno.
69 WS_DLL_PUBLIC
void report_read_failure(const char *filename
, int err
);
72 * Report an error when trying to write a file.
73 * "err" is assumed to be a UNIX-style errno.
75 WS_DLL_PUBLIC
void report_write_failure(const char *filename
, int err
);
79 #endif /* __cplusplus */
81 #endif /* __REPORT_ERR_H__ */