aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/wtap.h
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2004-01-25 21:55:17 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2004-01-25 21:55:17 +0000
commiteafb6f1a62804a76eafc74341cfc2b05bed2a1c0 (patch)
tree392720e018248f9cf2b46db00a4a9740ff7d1fca /wiretap/wtap.h
parentf57e0824e84eda071b365893f195892227548c2b (diff)
Have the Wiretap open, read, and seek-and-read routines return, in
addition to an error code, an error info string, for WTAP_ERR_UNSUPPORTED, WTAP_ERR_UNSUPPORTED_ENCAP, and WTAP_ERR_BAD_RECORD errors. Replace the error messages logged with "g_message()" for those errors with g_strdup()ed or g_strdup_printf()ed strings returned as the error info string, and change the callers of those routines to, for those errors, put the info string into the printed message or alert box for the error. Add messages for cases where those errors were returned without printing an additional message. Nobody uses the error code from "cf_read()" - "cf_read()" puts up the alert box itself for failures; get rid of the error code, so it just returns a success/failure indication. Rename "file_read_error_message()" to "cf_read_error_message()", as it handles read errors from Wiretap, and have it take an error info string as an argument. (That handles a lot of the work of putting the info string into the error message.) Make some variables in "ascend-grammar.y" static. Check the return value of "erf_read_header()" in "erf_seek_read()". Get rid of an unused #define in "i4btrace.c". git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9852 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'wiretap/wtap.h')
-rw-r--r--wiretap/wtap.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/wiretap/wtap.h b/wiretap/wtap.h
index 3b2133a7f8..9dfed9bf96 100644
--- a/wiretap/wtap.h
+++ b/wiretap/wtap.h
@@ -1,6 +1,6 @@
/* wtap.h
*
- * $Id: wtap.h,v 1.147 2003/12/18 19:07:14 guy Exp $
+ * $Id: wtap.h,v 1.148 2004/01/25 21:55:17 guy Exp $
*
* Wiretap Library
* Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
@@ -427,16 +427,19 @@ typedef struct wtap_dumper wtap_dumper;
*
* a negative number, indicating the type of error, on other failures.
*/
-struct wtap* wtap_open_offline(const char *filename, int *err, gboolean do_random);
+struct wtap* wtap_open_offline(const char *filename, int *err,
+ gchar **err_info, gboolean do_random);
/* Returns TRUE if entire loop-reading was successful. If read failure
* happened, FALSE is returned and err is set. */
-gboolean wtap_loop(wtap *wth, int, wtap_handler, guchar*, int *err);
+gboolean wtap_loop(wtap *wth, int, wtap_handler, guchar*, int *err,
+ gchar **err_info);
/* Returns TRUE if read was successful. FALSE if failure. data_offset is
* set the the offset in the file where the data for the read packet is
* located. */
-gboolean wtap_read(wtap *wth, int *err, long *data_offset);
+gboolean wtap_read(wtap *wth, int *err, gchar **err_info,
+ long *data_offset);
struct wtap_pkthdr *wtap_phdr(wtap *wth);
union wtap_pseudo_header *wtap_pseudoheader(wtap *wth);
@@ -459,7 +462,8 @@ const char *wtap_strerror(int err);
void wtap_sequential_close(wtap *wth);
void wtap_close(wtap *wth);
gboolean wtap_seek_read (wtap *wth, long seek_off,
- union wtap_pseudo_header *pseudo_header, guint8 *pd, int len, int *err);
+ union wtap_pseudo_header *pseudo_header, guint8 *pd, int len,
+ int *err, gchar **err_info);
gboolean wtap_dump_can_open(int filetype);
gboolean wtap_dump_can_write_encap(int filetype, int encap);