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 library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public
11 * License as published by the Free Software Foundation; either
12 * version 2 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Library General Public License for more details.
19 * You should have received a copy of the GNU Library General Public
20 * License along with this library; if not, write to the
21 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22 * Boston, MA 02111-1307, USA.
25 **************************************************************************/
37 #ifdef AVOID_USING_ZLIB
43 /* fgFile fgopen(char *filename, const char *flags) */
44 #define fgopen(P, F) (fopen((P), (F)))
46 /* int fgseek(fgFile *file, long offset, int whence) */
47 #define fgseek(F, O, W) (fseek((F), (O), (W)))
49 /* fgread(fgFile file, void *buf, int size); */
50 #define fgread(F, B, S) (fread((B), (S), 1, (F)))
52 /* int fggets(fgFile fd, char *buffer, int len) */
53 #define fggets(F, B, L) (fgets((B), (L), (F)))
55 /* int fgclose(fgFile fd) */
56 #define fgclose(F) (fclose((F)))
62 #include <simgear/zlib/zlib.h>
67 /* fgFile fgopen(char *filename, const char *flags) */
68 #define fgopen(P, F) (gzopen((P), (F)))
70 /* int fgseek(fgFile *file, long offset, int whence) */
71 #define fgseek(F, O, W) (gzseek((F), (O), (W)))
73 /* fgread(fgFile file, void *buf, int size); */
74 #define fgread(F, B, S) (gzread((F), (B), (S)))
76 /* int fggets(fgFile fd, char *buffer, int len) */
77 #define fggets(F, B, L) (gzgets((F), (B), (L)))
79 /* int fgclose(fgFile fd) */
80 #define fgclose(F) (gzclose((F)))
82 #endif /* #ifdef AVOID_USING_ZLIB #else #endif */
85 #endif /* _FG_ZLIB_H */