/* file.c
* File I/O routines
*
- * $Id: file.c,v 1.241 2001/06/19 23:08:55 guy Exp $
+ * $Id: file.c,v 1.242 2001/07/05 00:34:38 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
{
wtap *wth;
int err;
- FILE_T fh;
int fd;
struct stat cf_stat;
goto fail;
/* Find the size of the file. */
- fh = wtap_file(wth);
fd = wtap_fd(wth);
if (fstat(fd, &cf_stat) < 0) {
err = errno;
/* file.h
* Definitions for file structures and routines
*
- * $Id: file.h,v 1.83 2001/06/05 07:38:33 guy Exp $
+ * $Id: file.h,v 1.84 2001/07/05 00:34:39 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
#include <errno.h>
#include <epan.h>
-#ifdef HAVE_LIBZ
-#include "zlib.h"
-#define FILE_T gzFile
-#define file_open gzopen
-#define filed_open gzdopen
-#define file_close gzclose
-#else /* No zLib */
-#define FILE_T FILE *
-#define file_open fopen
-#define filed_open fdopen
-#define file_close fclose
-#endif /* HAVE_LIBZ */
-
/* Current state of file. */
typedef enum {
FILE_CLOSED, /* No file open */
/* main.c
*
- * $Id: main.c,v 1.202 2001/06/27 08:36:08 guy Exp $
+ * $Id: main.c,v 1.203 2001/07/05 00:34:40 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
#include <pcap.h>
#endif
+#ifdef HAVE_LIBZ
+#include <zlib.h> /* to get the libz version number */
+#endif
+
#ifdef NEED_SNPRINTF_H
# include "snprintf.h"
#endif
/* tethereal.c
*
- * $Id: tethereal.c,v 1.86 2001/06/08 08:50:49 guy Exp $
+ * $Id: tethereal.c,v 1.87 2001/07/05 00:34:39 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
#include <pcap.h>
#endif
+#ifdef HAVE_LIBZ
+#include <zlib.h> /* to get the libz version number */
+#endif
+
#ifdef NEED_SNPRINTF_H
# include "snprintf.h"
#endif
{
wtap *wth;
int err;
- FILE_T fh;
int fd;
struct stat cf_stat;
char err_msg[2048+1];
goto fail;
/* Find the size of the file. */
- fh = wtap_file(wth);
fd = wtap_fd(wth);
if (fstat(fd, &cf_stat) < 0) {
err = errno;
/* wtap.c
*
- * $Id: wtap.c,v 1.52 2001/03/15 09:11:03 guy Exp $
+ * $Id: wtap.c,v 1.53 2001/07/05 00:34:42 guy Exp $
*
* Wiretap Library
* Copyright (c) 1998 by Gilbert Ramirez <gram@xiexie.org>
#include "file_wrappers.h"
#include "buffer.h"
-FILE*
-wtap_file(wtap *wth)
-{
- return wth->fh;
-}
-
int
wtap_fd(wtap *wth)
{
/* wtap.h
*
- * $Id: wtap.h,v 1.86 2001/03/15 09:11:03 guy Exp $
+ * $Id: wtap.h,v 1.87 2001/07/05 00:34:42 guy Exp $
*
* Wiretap Library
* Copyright (c) 1998 by Gilbert Ramirez <gram@xiexie.org>
union wtap_pseudo_header *wtap_pseudoheader(wtap *wth);
guint8 *wtap_buf_ptr(wtap *wth);
-FILE* wtap_file(wtap *wth);
int wtap_fd(wtap *wth);
int wtap_snapshot_length(wtap *wth); /* per file */
int wtap_file_type(wtap *wth);