6 * Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
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.
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.
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.
27 extern gint64 file_seek(void *stream, gint64 offset, int whence, int *err);
28 extern gint64 file_tell(void *stream);
29 extern int file_error(void *fh);
33 extern FILE_T file_open(const char *path, const char *mode);
34 #define filed_open gzdopen
35 /* XX: gzread and gzwrite return number of *bytes* (not number of elements) */
36 #define file_read(buf, bsize, count, file) gzread((file),(buf),((count)*(bsize)))
37 #define file_write(buf, bsize, count, file) gzwrite((file),(buf),((count)*(bsize)))
38 #define file_close gzclose
39 #define file_getc gzgetc
40 #define file_gets(buf, len, file) gzgets((file), (buf), (len))
41 #define file_eof gzeof
45 #define file_open(path, mode) eth_fopen(path, mode)
46 #define filed_open fdopen
47 /* XX: file_read and file_write defined to return number of *bytes* to be consistent with gzread & gzwrite */
48 #define file_read(buf, bsize, count, file) ((bsize) * fread((buf), (bsize), (count), (file)))
49 #define file_write(buf, bsize, count, file) ((bsize) * fwrite((buf), (bsize), (count), (file)))
50 #define file_close fclose
51 #define file_getc fgetc
52 #define file_gets fgets
55 #endif /* HAVE_LIBZ */
57 #endif /* __FILE_H__ */