d30592f3fb454de9cfaf709c9c3857e90316ddf2
[obnox/wireshark/wip.git] / wiretap / file.h
1 /* file.h
2  *
3  * $Id: file.h,v 1.4 1999/10/05 07:06:05 guy Exp $
4  *
5  * Wiretap Library
6  * Copyright (c) 1998 by Gilbert Ramirez <gram@verdict.uthscsa.edu>
7  * 
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  * 
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  * 
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
21  *
22  */
23
24 #ifndef __FILE_H__
25 #define __FILE_H__
26
27 #ifdef HAVE_LIBZ
28 #define file_open gzopen
29 #define filed_open gzdopen
30 #define file_seek gzseek
31 #define file_read(buf, bsize, count, file) gzread((file),(buf),((count)*(bsize)))
32 #define file_write(buf, bsize, count, file) gzwrite((file),(buf),((count)*(bsize)))
33 #define file_close gzclose
34 #define file_tell gztell
35 #define file_getc gzgetc
36 extern int file_error(void *fh);
37
38 #else /* No zLib */
39 #define file_open fopen
40 #define filed_open fdopen
41 #define file_seek fseek
42 #define file_read fread
43 #define file_write fwrite
44 #define file_close fclose
45 extern int file_error(FILE *fh);
46 #define file_tell ftell
47 #define file_getc fgetc
48 #endif /* HAVE_LIBZ */
49
50 #endif /* __FILE_H__ */