diff options
author | Gilbert Ramirez <gram@alumni.rice.edu> | 2000-09-07 05:34:23 +0000 |
---|---|---|
committer | Gilbert Ramirez <gram@alumni.rice.edu> | 2000-09-07 05:34:23 +0000 |
commit | f52ffba40709c1d134671eef22086827cdeda0f3 (patch) | |
tree | 31fc7f12926ced1a03d1ebd95053a6131039c09b /file.c | |
parent | e1f3604b376f38c081ff142d54d91aa3f68bd0f8 (diff) | |
download | wireshark-f52ffba40709c1d134671eef22086827cdeda0f3.tar.gz wireshark-f52ffba40709c1d134671eef22086827cdeda0f3.tar.bz2 wireshark-f52ffba40709c1d134671eef22086827cdeda0f3.zip |
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).
svn path=/trunk/; revision=2392
Diffstat (limited to 'file.c')
-rw-r--r-- | file.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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 |