1 /**************************************************************************
2 * fg_zlib.h -- a zlib wrapper to replace zlib calls with normal uncompressed
3 * calls for systems that have problems building zlib.
5 * Written by Curtis Olson, started April 1998.
7 * Copyright (C) 1998 Curtis L. Olson - curt@me.umn.edu
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of the
12 * License, or (at your option) any later version.
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 **************************************************************************/
36 #ifdef AVOID_USING_ZLIB
42 /* fgFile fgopen(char *filename, const char *flags) */
43 #define fgopen(P, F) (fopen((P), (F)))
45 /* int fgseek(fgFile *file, long offset, int whence) */
46 #define fgseek(F, O, W) (fseek((F), (O), (W)))
48 /* fgread(fgFile file, void *buf, int size); */
49 #define fgread(F, B, S) (fread((B), (S), 1, (F)))
51 /* int fggets(fgFile fd, char *buffer, int len) */
52 #define fggets(F, B, L) (fgets((B), (L), (F)))
54 /* int fgclose(fgFile fd) */
55 #define fgclose(F) (fclose((F)))
61 #include <simgear/zlib/zlib.h>
66 /* fgFile fgopen(char *filename, const char *flags) */
67 #define fgopen(P, F) (gzopen((P), (F)))
69 /* int fgseek(fgFile *file, long offset, int whence) */
70 #define fgseek(F, O, W) (gzseek((F), (O), (W)))
72 /* fgread(fgFile file, void *buf, int size); */
73 #define fgread(F, B, S) (gzread((F), (B), (S)))
75 /* int fggets(fgFile fd, char *buffer, int len) */
76 #define fggets(F, B, L) (gzgets((F), (B), (L)))
78 /* int fgclose(fgFile fd) */
79 #define fgclose(F) (gzclose((F)))
81 #endif /* #ifdef AVOID_USING_ZLIB #else #endif */
84 #endif /* _FG_ZLIB_H */