]> git.mxchange.org Git - simgear.git/blob - simgear/fg_zlib.h
Updates to remove unneeded dependencies on FlightGear and SimGear.
[simgear.git] / simgear / fg_zlib.h
1 /**************************************************************************
2  * fg_zlib.h -- a zlib wrapper to replace zlib calls with normal uncompressed
3  *              calls for systems that have problems building zlib.
4  *
5  * Written by Curtis Olson, started April 1998.
6  *
7  * Copyright (C) 1998  Curtis L. Olson  - curt@me.umn.edu
8  *
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.
13  *
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.
18  *
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.
22  *
23  * $Id$
24  **************************************************************************/
25
26
27 #ifndef _FG_ZLIB_H
28 #define _FG_ZLIB_H
29
30
31 #ifdef HAVE_CONFIG_H
32 #  include <config.h>
33 #endif
34
35
36 #ifdef AVOID_USING_ZLIB
37
38   #include <stdio.h>
39
40   #define fgFile FILE *
41
42   /* fgFile fgopen(char *filename, const char *flags) */
43   #define fgopen(P, F)  (fopen((P), (F)))
44
45   /* int fgseek(fgFile *file, long offset, int whence) */
46   #define fgseek(F, O, W)  (fseek((F), (O), (W)))
47
48   /* fgread(fgFile file, void *buf, int size); */
49   #define fgread(F, B, S)  (fread((B), (S), 1, (F)))
50
51   /* int fggets(fgFile fd, char *buffer, int len) */
52   #define fggets(F, B, L)  (fgets((B), (L), (F)))
53
54   /* int fgclose(fgFile fd) */
55   #define fgclose(F)  (fclose((F)))
56 #else
57
58 #ifdef HAVE_ZLIB
59   #include <zlib.h>
60 #else
61   #include <simgear/zlib/zlib.h>
62 #endif
63
64   #define fgFile gzFile
65
66   /* fgFile fgopen(char *filename, const char *flags) */
67   #define fgopen(P, F)  (gzopen((P), (F)))
68
69   /* int fgseek(fgFile *file, long offset, int whence) */
70   #define fgseek(F, O, W)  (gzseek((F), (O), (W)))
71
72   /* fgread(fgFile file, void *buf, int size); */
73   #define fgread(F, B, S)  (gzread((F), (B), (S)))
74
75   /* int fggets(fgFile fd, char *buffer, int len) */
76   #define fggets(F, B, L)  (gzgets((F), (B), (L)))
77
78   /* int fgclose(fgFile fd) */
79   #define fgclose(F)  (gzclose((F)))
80
81 #endif /* #ifdef AVOID_USING_ZLIB #else #endif */
82
83
84 #endif /* _FG_ZLIB_H */
85
86