diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2004-02-21 02:15:07 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2004-02-21 02:15:07 +0000 |
commit | d1e57ceb69a008d2f68a9339fa16f833f8a0d8c2 (patch) | |
tree | f03010f140c0d14d34e24452b6be237db29f625a /alert_box.c | |
parent | ac2166167d4a1d4546a53901fb58dce97380f290 (diff) |
Add routines that can be called from dissectors to report file open and
read errors; there are separate implementations for Ethereal (pops up an
alert box) and Tethereal (prints an error message).
Use those routines in the ASN.1 dissector.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10152 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'alert_box.c')
-rw-r--r-- | alert_box.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/alert_box.c b/alert_box.c index 4df5296f9c..d8a18b47db 100644 --- a/alert_box.c +++ b/alert_box.c @@ -2,7 +2,7 @@ * Routines to put up various "standard" alert boxes used in multiple * places * - * $Id: alert_box.c,v 1.3 2004/02/11 01:37:11 guy Exp $ + * $Id: alert_box.c,v 1.4 2004/02/21 02:15:05 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -27,12 +27,15 @@ # include "config.h" #endif +#include <string.h> + #include <glib.h> #include <epan/filesystem.h> #include <epan/dfilter/dfilter.h> #include "alert_box.h" +#include "report_err.h" #include "simple_dialog.h" @@ -56,6 +59,26 @@ open_failure_alert_box(const char *filename, int err, gboolean for_writing) } /* + * Open/create errors are reported with an alert box in Ethereal. + */ +void +report_open_failure(const char *filename, int err, gboolean for_writing) +{ + open_failure_alert_box(filename, err, for_writing); +} + +/* + * Read errors are reported with an alert box in Ethereal. + */ +void +report_read_failure(const char *filename, int err) +{ + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, + "An error occurred while reading from the file \"%s\": %s.", + filename, strerror(err)); +} + +/* * Alert box for a failed attempt to write to a file. * "err" is assumed to be a UNIX-style errno. * |