aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authorgram <gram@f5534014-38df-0310-8fa8-9805f1628bb7>2000-09-07 05:34:23 +0000
committergram <gram@f5534014-38df-0310-8fa8-9805f1628bb7>2000-09-07 05:34:23 +0000
commit1e5772081f03227dc1d592574bff66f20d91baf5 (patch)
tree31fc7f12926ced1a03d1ebd95053a6131039c09b /file.c
parentf26d1aec1fc976411cdefcc21b4aa24074f94fb2 (diff)
Change wtap_read() API so that the data offset is set via a pointer, and
a "keep reading" boolean value is returned from the function. This avoids having to hack around the fact that some file formats truly do have records that start at offset 0. (i4btrace and csids have no file header. Neither does the pppdump-style file that I'm looking at right now). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@2392 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'file.c')
-rw-r--r--file.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/file.c b/file.c
index 929db878ac..32895d7a52 100644
--- a/file.c
+++ b/file.c
@@ -1,7 +1,7 @@
/* file.c
* File I/O routines
*
- * $Id: file.c,v 1.212 2000/08/24 09:16:39 guy Exp $
+ * $Id: file.c,v 1.213 2000/09/07 05:33:49 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -327,7 +327,7 @@ read_cap_file(capture_file *cf, int *err)
progbar = create_progress_dlg(load_msg, "Stop", &stop_flag);
g_free(load_msg);
- while ((data_offset = wtap_read(cf->wth, err)) > 0) {
+ while ((wtap_read(cf->wth, err, &data_offset))) {
/* Update the progress bar, but do it only N_PROGBAR_UPDATES times;
when we update it, we have to run the GTK+ main loop to get it
to repaint what's pending, and doing so may involve an "ioctl()"
@@ -466,7 +466,7 @@ continue_tail_cap_file(capture_file *cf, int to_read, int *err)
gtk_clist_freeze(GTK_CLIST(packet_list));
- while (to_read != 0 && (data_offset = wtap_read(cf->wth, err)) > 0) {
+ while (to_read != 0 && (wtap_read(cf->wth, err, &data_offset))) {
if (cf->state == FILE_READ_ABORTED) {
/* Well, the user decided to exit Ethereal. Break out of the
loop, and let the code below (which is called even if there
@@ -507,7 +507,7 @@ finish_tail_cap_file(capture_file *cf, int *err)
gtk_clist_freeze(GTK_CLIST(packet_list));
- while ((data_offset = wtap_read(cf->wth, err)) > 0) {
+ while ((wtap_read(cf->wth, err, &data_offset))) {
if (cf->state == FILE_READ_ABORTED) {
/* Well, the user decided to abort the read. Break out of the
loop, and let the code below (which is called even if there