nexmon – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | /* report_err.h |
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). |
||
5 | * |
||
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. |
||
11 | * |
||
12 | * Wireshark - Network traffic analyzer |
||
13 | * By Gerald Combs <gerald@wireshark.org> |
||
14 | * Copyright 1998 Gerald Combs |
||
15 | * |
||
16 | * This program is free software; you can redistribute it and/or |
||
17 | * modify it under the terms of the GNU General Public License |
||
18 | * as published by the Free Software Foundation; either version 2 |
||
19 | * of the License, or (at your option) any later version. |
||
20 | * |
||
21 | * This program is distributed in the hope that it will be useful, |
||
22 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
23 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
24 | * GNU General Public License for more details. |
||
25 | * |
||
26 | * You should have received a copy of the GNU General Public License |
||
27 | * along with this program; if not, write to the Free Software |
||
28 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
||
29 | */ |
||
30 | |||
31 | #ifndef __REPORT_ERR_H__ |
||
32 | #define __REPORT_ERR_H__ |
||
33 | |||
34 | #include "ws_symbol_export.h" |
||
35 | |||
36 | #ifdef __cplusplus |
||
37 | extern "C" { |
||
38 | #endif /* __cplusplus */ |
||
39 | |||
40 | /* |
||
41 | * Initialize the report err routines |
||
42 | */ |
||
43 | WS_DLL_PUBLIC void init_report_err( |
||
44 | void (*vreport_failure)(const char *, va_list), |
||
45 | void (*report_open_failure)(const char *, int, gboolean), |
||
46 | void (*report_read_failure)(const char *, int), |
||
47 | void (*report_write_failure)(const char *, int)); |
||
48 | |||
49 | /* |
||
50 | * Report a general error. |
||
51 | */ |
||
52 | WS_DLL_PUBLIC void report_failure(const char *msg_format, ...) G_GNUC_PRINTF(1, 2); |
||
53 | |||
54 | /* |
||
55 | * Report an error when trying to open a file. |
||
56 | * "err" is assumed to be an error code from Wiretap; positive values are |
||
57 | * UNIX-style errnos, so this can be used for open failures not from |
||
58 | * Wiretap as long as the failure code is just an errno. |
||
59 | */ |
||
60 | WS_DLL_PUBLIC void report_open_failure(const char *filename, int err, |
||
61 | gboolean for_writing); |
||
62 | |||
63 | /* |
||
64 | * Report an error when trying to read a file. |
||
65 | * "err" is assumed to be a UNIX-style errno. |
||
66 | */ |
||
67 | WS_DLL_PUBLIC void report_read_failure(const char *filename, int err); |
||
68 | |||
69 | /* |
||
70 | * Report an error when trying to write a file. |
||
71 | * "err" is assumed to be a UNIX-style errno. |
||
72 | */ |
||
73 | WS_DLL_PUBLIC void report_write_failure(const char *filename, int err); |
||
74 | |||
75 | #ifdef __cplusplus |
||
76 | } |
||
77 | #endif /* __cplusplus */ |
||
78 | |||
79 | #endif /* __REPORT_ERR_H__ */ |