3 * A file IO wrapper system that can select at compile time if the system
4 * should use zlib calls or normal uncompressed calls for systems that have
5 * problems building zlib.
6 * Define AVOID_USING_ZLIB to use standard uncompressed calls.
10 * Written by Curtis Olson, started April 1998.
12 * Copyright (C) 1998 Curtis L. Olson - curt@me.umn.edu
14 * This library is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU Library General Public
16 * License as published by the Free Software Foundation; either
17 * version 2 of the License, or (at your option) any later version.
19 * This library is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * Library General Public License for more details.
24 * You should have received a copy of the GNU Library General Public
25 * License along with this library; if not, write to the
26 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
27 * Boston, MA 02111-1307, USA.
30 **************************************************************************/
42 #ifdef AVOID_USING_ZLIB
48 /* sgFile sgopen(char *filename, const char *flags) */
49 #define sgopen(P, F) (fopen((P), (F)))
51 /* int sgseek(sgFile *file, long offset, int whence) */
52 #define sgseek(F, O, W) (fseek((F), (O), (W)))
54 /* sgread(sgFile file, void *buf, int size); */
55 #define sgread(F, B, S) (fread((B), (S), 1, (F)))
57 /* int sggets(sgFile fd, char *buffer, int len) */
58 #define sggets(F, B, L) (sgets((B), (L), (F)))
60 /* int sgclose(sgFile fd) */
61 #define sgclose(F) (fclose((F)))
67 #include <simgear/zlib/zlib.h>
72 /* sgFile sgopen(char *filename, const char *flags) */
73 #define sgopen(P, F) (gzopen((P), (F)))
75 /* int sgseek(sgFile *file, long offset, int whence) */
76 #define sgseek(F, O, W) (gzseek((F), (O), (W)))
78 /* sgread(sgFile file, void *buf, int size); */
79 #define sgread(F, B, S) (gzread((F), (B), (S)))
81 /* int sggets(sgFile fd, char *buffer, int len) */
82 #define sggets(F, B, L) (gzgets((F), (B), (L)))
84 /* int sgclose(sgFile fd) */
85 #define sgclose(F) (gzclose((F)))
87 #endif /* #ifdef AVOID_USING_ZLIB #else #endif */
90 #endif /* _SG_ZLIB_H */