]> git.mxchange.org Git - simgear.git/blob - simgear/fg_zlib.h
Fix a build order problem.
[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 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.
13  *
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.
18  *
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.
23  *
24  * $Id$
25  **************************************************************************/
26
27
28 #ifndef _FG_ZLIB_H
29 #define _FG_ZLIB_H
30
31
32 #ifdef HAVE_CONFIG_H
33 #  include <config.h>
34 #endif
35
36
37 #ifdef AVOID_USING_ZLIB
38
39   #include <stdio.h>
40
41   #define fgFile FILE *
42
43   /* fgFile fgopen(char *filename, const char *flags) */
44   #define fgopen(P, F)  (fopen((P), (F)))
45
46   /* int fgseek(fgFile *file, long offset, int whence) */
47   #define fgseek(F, O, W)  (fseek((F), (O), (W)))
48
49   /* fgread(fgFile file, void *buf, int size); */
50   #define fgread(F, B, S)  (fread((B), (S), 1, (F)))
51
52   /* int fggets(fgFile fd, char *buffer, int len) */
53   #define fggets(F, B, L)  (fgets((B), (L), (F)))
54
55   /* int fgclose(fgFile fd) */
56   #define fgclose(F)  (fclose((F)))
57 #else
58
59 #ifdef HAVE_ZLIB
60   #include <zlib.h>
61 #else
62   #include <simgear/zlib/zlib.h>
63 #endif
64
65   #define fgFile gzFile
66
67   /* fgFile fgopen(char *filename, const char *flags) */
68   #define fgopen(P, F)  (gzopen((P), (F)))
69
70   /* int fgseek(fgFile *file, long offset, int whence) */
71   #define fgseek(F, O, W)  (gzseek((F), (O), (W)))
72
73   /* fgread(fgFile file, void *buf, int size); */
74   #define fgread(F, B, S)  (gzread((F), (B), (S)))
75
76   /* int fggets(fgFile fd, char *buffer, int len) */
77   #define fggets(F, B, L)  (gzgets((F), (B), (L)))
78
79   /* int fgclose(fgFile fd) */
80   #define fgclose(F)  (gzclose((F)))
81
82 #endif /* #ifdef AVOID_USING_ZLIB #else #endif */
83
84
85 #endif /* _FG_ZLIB_H */
86
87