aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/file_wrappers.c
AgeCommit message (Collapse)AuthorFilesLines
2006-11-06fix the return value of file_seek, as noted by SteveUlf Lamping1-1/+1
svn path=/trunk/; revision=19816
2006-11-05change all file offsets from long to gint64 so we can - theoretically - ↵Ulf Lamping1-21/+79
handle files > 2GB correct. Please distclean Win32 builds! svn path=/trunk/; revision=19814
2005-11-10Include <unistd.h> if available, to get "close()" declared.Guy Harris1-14/+20
Update the big comment to reflect current reality. svn path=/trunk/; revision=16453
2005-11-07If we're using libz, make file_open() construct the open() flagGuy Harris1-8/+37
argument, rather than requiring the caller to get the open() flag and the fopen() flag in sync. That also means that if we're *not* using libz, it can just be a wrapper around eth_fopen(). We need to include <fcntl.h>, at least on UN*X, to get open() declared and the O_ flags defined. svn path=/trunk/; revision=16409
2005-11-06replace *a lot* of file related calls by their GLib counterparts. This is ↵Ulf Lamping1-0/+22
necessary for the switch to GTK 2.6 (at least on WIN32). to do this, I've added file_util.h to wiretap (would file_compat.h be a better name?), and provide compat_macros like eth_open() instead of open(). While at it, move other file related things there, like #include <io.h>, definition of O_BINARY and alike, so it's all in one place. deleted related things from config.h.win32 As of these massive changes, I'm almost certain that this will break the Unix build. I'll keep an eye on the buildbot so hopefully everything is working again soon. svn path=/trunk/; revision=16403
2004-07-18Set the svn:eol-style property on all text files to "native", so thatGuy Harris1-1/+1
they have LF at the end of the line on UN*X and CR/LF on Windows; hopefully this means that if a CR/LF version is checked in on Windows, the CRs will be stripped so that they show up only when checked out on Windows, not on UN*X. svn path=/trunk/; revision=11400
2002-08-28Removed trailing whitespaces from .h and .c files using theJörg Mayer1-4/+4
winapi_cleanup tool written by Patrik Stridvall for the wine project. svn path=/trunk/; revision=6115
2002-06-07Graeme Hewson noted that zlib has a bug wherein "gzseek()" doesn't setGuy Harris1-3/+31
the internal z_err value for the stream if an "fseek()" call it makes fails, so that if "gzerror()" is subsequently called, it returns Z_OK rather than an error. To work around this, we pass "file_seek()" an "int *err", and have the with-zlib version of "file_seek()" check, if "gzseek()" fails, whether the return value of "file_error()" is 0 and, if so, have it return "errno" instead. svn path=/trunk/; revision=5642
2002-02-06zlib 1.0.8 - the version that comes with X11 - does have "gzseek()",Guy Harris1-25/+1
even if it doesn't have "gzgets()", so one might think we could use it by using our own replacement for "gzgets()". One would be wrong to think so, however, as the "gzseek()" it has doesn't actually work when reading uncompressed files. zlib 1.0.9 has "gzgets()", and fixes that bug, so we rever to checking for "gzgets()" rather than "gzseek()", so that we don't accept pre-1.0.9 versions of zlib, and we get rid of our "gzgets()" replacement. svn path=/trunk/; revision=4702
2001-11-13Hopefully the last time I have to change my e-mail address.Gilbert Ramirez1-2/+2
svn path=/trunk/; revision=4199
2001-09-20Removed the dependency on gzgetc and gzgets by implementing internalAshok Narayanan1-1/+25
versions of these commands in file_wrappers.c. This allows us to compile successfully even on platforms where X has an older zlib built in. Removed this restriction from acinclude.m4 svn path=/trunk/; revision=3948
2000-05-19Add wtap-int.h. Move definitions relevant to the internal workins of wiretapGilbert Ramirez1-2/+2
to that file, leave public definitions in wtap.h. Rename "union pseudo_header" to "union wtap_pseudo_header". Make the wtap_pseudo_header pointer available in packet_info struct. svn path=/trunk/; revision=1989
2000-03-14Sigh. OpenBSD defines "HAVE_UNISTD_H" in the Makefile for zlib, so,Guy Harris1-11/+28
unlike FreeBSD and older versions of NetBSD, which give "gzseek()" and "gztell()" signatures with "long" file-offset arguments, and thus, on some versions, requires that "HAVE_UNISTD_H" *not* be defined before including "zlib.h" if you want the functions declared with a signature that matches what's actually in the library, it requires that it *be* defined before including "zlib.h" if you want the functions declared with a signature that matches what's actually in the library. svn path=/trunk/; revision=1719
2000-01-26Always declare, and define, "file_seek()" to return a "long", as it'sGuy Harris1-11/+10
supposed to look like "ftell()". If you don't have zlib, just define "file_seek" as an alias for "fseek", rather than defining it as a routine. svn path=/trunk/; revision=1571
2000-01-25"gztell()" is also affected by the libz mess on platforms where "off_t"Guy Harris1-3/+9
is bigger than a "long"; this is itojun's fix for that, turning "file_tell()" into a wrapper function in "file_wrappers.c", just like "file_seek()". svn path=/trunk/; revision=1554
2000-01-22Fix files that had Gilbert's old e-mail address or that didn't have myGuy Harris1-2/+2
forwarding e-mail address. svn path=/trunk/; revision=1522
2000-01-13Fix "ascend-scanner.l" to include "file_wrappers.h" rather than theGuy Harris1-11/+13
defunct "file.h". Make "file_wrappers.c" include "wtap.h", so that the WTAP_ERR_ZLIB_ values are defined. svn path=/trunk/; revision=1464
2000-01-13We are obliged to define HAVE_UNISTD_H in "config.h"; to avoid theGuy Harris1-0/+131
hideous problem on FreeBSD 3.[23] (and perhaps other BSDs) if HAVE_UNISTD_H is defined before "zlib.h" is included, turn "file_seek()" into a subroutine defined in a file that *undefines* HAVE_UNISTD_H before including "zlib.h", so that the *only* call to "gzseek()" is made from a file that does not have HAVE_UNISTD_H defined when it includes "zlib.h". Move "file_error()" to that file while you're at it, so it holds all the wrappers that hide the presence or absence of zlib from routines to read capture files. Turn "file.h", which declared those wrapper functions as well as wrapper macros, into "file_wrapper.h" - it belongs with the "file_wrapper.c" file that defines the wrapper functions, not with "file.c" which handles higher-layer file access functions. Remove the comment in "configure.in" that explained why defining HAVE_UNISTD_H was a bad idea, as we're not obliged to define it and work around the problem. (The comment in "file_wrapper.c" explains the workaround.) svn path=/trunk/; revision=1463