2017-04-08 19:45:19 +00:00
|
|
|
/* report_message.h
|
2009-02-15 21:47:57 +00:00
|
|
|
* Declarations of routines for code that can run in GUI and command-line
|
2017-04-08 19:45:19 +00:00
|
|
|
* environments to use to report errors and warnings to the user (e.g.,
|
|
|
|
* I/O errors, or problems with preference settings) if the message should
|
|
|
|
* be shown as a GUI error in a GUI environment.
|
2009-02-15 21:47:57 +00:00
|
|
|
*
|
2017-04-08 19:45:19 +00:00
|
|
|
* The application using libwsutil will register message-reporting
|
2009-02-15 21:47:57 +00:00
|
|
|
* routines, and the routines declared here will call the registered
|
|
|
|
* routines. That way, these routines can be called by code that
|
|
|
|
* doesn't itself know whether to pop up a dialog or print something
|
|
|
|
* to the standard error.
|
2004-02-21 02:15:07 +00:00
|
|
|
*
|
2006-05-21 05:12:17 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
2004-02-21 02:15:07 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
2018-02-07 11:26:45 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
2004-02-21 02:15:07 +00:00
|
|
|
*/
|
|
|
|
|
2017-04-08 19:45:19 +00:00
|
|
|
#ifndef __REPORT_MESSAGE_H__
|
|
|
|
#define __REPORT_MESSAGE_H__
|
2004-02-21 02:15:07 +00:00
|
|
|
|
2013-03-01 23:53:11 +00:00
|
|
|
#include "ws_symbol_export.h"
|
|
|
|
|
2004-02-21 02:15:07 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
2007-05-25 17:22:32 +00:00
|
|
|
/*
|
2017-04-08 19:45:19 +00:00
|
|
|
* Initialize the report message routines
|
2007-05-25 17:22:32 +00:00
|
|
|
*/
|
2017-04-08 19:45:19 +00:00
|
|
|
WS_DLL_PUBLIC void init_report_message(
|
2016-03-27 02:05:20 +00:00
|
|
|
void (*vreport_failure)(const char *, va_list),
|
2017-04-08 19:45:19 +00:00
|
|
|
void (*vreport_warning)(const char *, va_list),
|
2007-05-25 17:22:32 +00:00
|
|
|
void (*report_open_failure)(const char *, int, gboolean),
|
2009-02-15 21:47:57 +00:00
|
|
|
void (*report_read_failure)(const char *, int),
|
|
|
|
void (*report_write_failure)(const char *, int));
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Report a general error.
|
|
|
|
*/
|
2015-07-04 20:14:56 +00:00
|
|
|
WS_DLL_PUBLIC void report_failure(const char *msg_format, ...) G_GNUC_PRINTF(1, 2);
|
2007-05-25 17:22:32 +00:00
|
|
|
|
2017-04-08 19:45:19 +00:00
|
|
|
/*
|
|
|
|
* Report a general warning.
|
|
|
|
*/
|
|
|
|
WS_DLL_PUBLIC void report_warning(const char *msg_format, ...) G_GNUC_PRINTF(1, 2);
|
|
|
|
|
2004-02-21 02:15:07 +00:00
|
|
|
/*
|
|
|
|
* Report an error when trying to open a file.
|
2009-02-15 21:47:57 +00:00
|
|
|
* "err" is assumed to be an error code from Wiretap; positive values are
|
|
|
|
* UNIX-style errnos, so this can be used for open failures not from
|
|
|
|
* Wiretap as long as the failure code is just an errno.
|
2004-02-21 02:15:07 +00:00
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC void report_open_failure(const char *filename, int err,
|
2004-02-21 02:15:07 +00:00
|
|
|
gboolean for_writing);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Report an error when trying to read a file.
|
2009-02-15 21:47:57 +00:00
|
|
|
* "err" is assumed to be a UNIX-style errno.
|
2004-02-21 02:15:07 +00:00
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC void report_read_failure(const char *filename, int err);
|
2004-02-21 02:15:07 +00:00
|
|
|
|
2004-04-16 23:17:13 +00:00
|
|
|
/*
|
2009-02-15 21:47:57 +00:00
|
|
|
* Report an error when trying to write a file.
|
|
|
|
* "err" is assumed to be a UNIX-style errno.
|
2004-04-16 23:17:13 +00:00
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC void report_write_failure(const char *filename, int err);
|
2004-04-16 23:17:13 +00:00
|
|
|
|
2004-02-21 02:15:07 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
2017-04-08 19:45:19 +00:00
|
|
|
#endif /* __REPORT_MESSAGE_H__ */
|