diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2009-02-15 21:47:57 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2009-02-15 21:47:57 +0000 |
commit | 1372d880e493ce404f3b1cb8a1bad010d3749f88 (patch) | |
tree | ab9611fe056fd19c3674191f606c15790b40380c /epan/report_err.h | |
parent | a5983c36bd9e5653d4be552ce0b9b3a3a2c37b79 (diff) |
Add a routine to report write errors to the list of failure-reporting
routines handled by epan/report_err.c.
Move copy_binary_file() in file.c to epan/filesystem.c, and rename it to
copy_file_binary_mode() (to clarify that it *can* copy text files;
arguably, *all* files are "binary" unless you're on, say, an IBM 1401
:-)). Have it use the report_err.c routines, so it works in
console-mode programs.
Clean up some comments while we're at it.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@27456 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/report_err.h')
-rw-r--r-- | epan/report_err.h | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/epan/report_err.h b/epan/report_err.h index 159cd96cee..9717221424 100644 --- a/epan/report_err.h +++ b/epan/report_err.h @@ -1,6 +1,13 @@ /* report_err.h - * Declarations of routines for dissectors to use to report errors to - * the user (e.g., problems with preference settings) + * Declarations of routines for code that can run in GUI and command-line + * environments to use to report errors to the user (e.g., I/O errors, or + * problems with preference settings). + * + * The application using libwireshark will register error-reporting + * 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. * * $Id$ * @@ -36,23 +43,34 @@ extern "C" { extern void init_report_err( void (*report_failure)(const char *, va_list), void (*report_open_failure)(const char *, int, gboolean), - void (*report_read_failure)(const char *, int)); + void (*report_read_failure)(const char *, int), + void (*report_write_failure)(const char *, int)); + +/* + * Report a general error. + */ +extern void report_failure(const char *msg_format, ...); /* * Report an error when trying to open a file. + * "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. */ extern void report_open_failure(const char *filename, int err, gboolean for_writing); /* * Report an error when trying to read a file. + * "err" is assumed to be a UNIX-style errno. */ extern void report_read_failure(const char *filename, int err); /* - * Report a general error. + * Report an error when trying to write a file. + * "err" is assumed to be a UNIX-style errno. */ -extern void report_failure(const char *msg_format, ...); +extern void report_write_failure(const char *filename, int err); #ifdef __cplusplus } |