diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2004-02-21 22:00:46 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2004-02-21 22:00:46 +0000 |
commit | 872f52d27b05a9b151a9ea321f52004d1cc96f43 (patch) | |
tree | 8720f1a203585bf6e1280bba8703ac858a6e18db /dftest.c | |
parent | 99f9461702d78d9fae6265e6bdb80aab5f8242c1 (diff) |
Get rid of some "#if 0"ed out #includes.
Define "report_open_failure()" and "report_read_failure()", so that
dissectors can report file open and read errors.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10171 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'dftest.c')
-rw-r--r-- | dftest.c | 36 |
1 files changed, 25 insertions, 11 deletions
@@ -1,6 +1,6 @@ /* dftest.c.c * - * $Id: dftest.c,v 1.7 2004/01/19 03:46:41 ulfl Exp $ + * $Id: dftest.c,v 1.8 2004/02/21 22:00:46 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -21,7 +21,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * */ #ifdef HAVE_CONFIG_H @@ -41,17 +40,9 @@ #include <glib.h> #include <epan/epan.h> -#if 0 -#include "globals.h" -#include <epan/packet.h> -#include "file.h" -#include "column.h" -#include "print.h" -#include <epan/resolv.h> -#include <epan/conversation.h> -#endif #include <epan/timestamp.h> #include <epan/plugins.h> +#include <epan/filesystem.h> #include "prefs.h" #include "util.h" #include "epan/dfilter/dfilter.h" @@ -142,3 +133,26 @@ main(int argc, char **argv) epan_cleanup(); exit(0); } + +/* + * Open/create errors are reported with an console message in "dftest". + */ +void +report_open_failure(const char *filename, int err, gboolean for_writing) +{ + char *errmsg; + + errmsg = g_strdup_printf(file_open_error_message(err, for_writing), filename); + fprintf(stderr, "dftest: %s\n", errmsg); + g_free(errmsg); +} + +/* + * Read errors are reported with an console message in "dftest". + */ +void +report_read_failure(const char *filename, int err) +{ + fprintf(stderr, "dftest: An error occurred while reading from the file \"%s\": %s.", + filename, strerror(err)); +} |