]> git.mxchange.org Git - simgear.git/blob - simgear/io/lowlevel.hxx
Fixed a bug in how zlib.h was included.
[simgear.git] / simgear / io / lowlevel.hxx
1 // lowlevel.hxx -- routines to handle lowlevel compressed binary IO of
2 //                 various datatypes
3 //
4 // Shamelessly adapted from plib  January 2001
5 //
6 // Original version Copyright (C) 2000  the plib team
7 // Local changes Copyright (C) 2000  Curtis L. Olson  - curt@flightgear.org
8 //
9 // This program is free software; you can redistribute it and/or modify
10 // it under the terms of the GNU General Public License as published by
11 // the Free Software Foundation; either version 2 of the License, or
12 // (at your option) any later version.
13 //
14 // This program 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
17 // GNU 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 _SG_LOWLEVEL_HXX
28 #define _SG_LOWLEVEL_HXX
29
30
31 #include <stdio.h>
32
33 #ifdef HAVE_ZLIB
34 #  include <zlib.h>
35 #else
36 #  include <simgear/zlib/zlib.h>
37 #endif
38
39 #include <plib/sg.h>
40
41
42 void sgReadChar ( gzFile fd, char *var ) ;
43 void sgWriteChar ( gzFile fd, const char var ) ;
44 void sgReadFloat ( gzFile fd, float *var ) ;
45 void sgWriteFloat ( gzFile fd, const float var ) ;
46 void sgReadDouble ( gzFile fd, double *var ) ;
47 void sgWriteDouble ( gzFile fd, const double var ) ;
48 void sgReadUInt ( gzFile fd, unsigned int *var ) ;
49 void sgWriteUInt ( gzFile fd, const unsigned int var ) ;
50 void sgReadInt ( gzFile fd, int *var ) ;
51 void sgWriteInt ( gzFile fd, const int var ) ;
52 void sgReadLong ( gzFile fd, long int *var ) ;
53 void sgWriteLong ( gzFile fd, const long int var ) ;
54 void sgReadUShort ( gzFile fd, unsigned short *var ) ;
55 void sgWriteUShort ( gzFile fd, const unsigned short var ) ;
56 void sgReadShort ( gzFile fd, short *var ) ;
57 void sgWriteShort ( gzFile fd, const short var ) ;
58
59 void sgReadFloat ( gzFile fd, const unsigned int n, float *var ) ;
60 void sgWriteFloat ( gzFile fd, const unsigned int n, const float *var ) ;
61 void sgReadDouble ( gzFile fd, const unsigned int n, double *var ) ;
62 void sgWriteDouble ( gzFile fd, const unsigned int n, const double *var ) ;
63 void sgReadUInt ( gzFile fd, const unsigned int n, unsigned int *var ) ;
64 void sgWriteUInt ( gzFile fd, const unsigned int n, const unsigned int *var ) ;
65 void sgReadInt ( gzFile fd, const unsigned int n, int *var ) ;
66 void sgWriteInt ( gzFile fd, const unsigned int n, const int *var ) ;
67 void sgReadUShort ( gzFile fd, const unsigned int n, unsigned short *var ) ;
68 void sgWriteUShort ( gzFile fd, const unsigned int n, const unsigned short *var ) ;
69 void sgReadShort ( gzFile fd, const unsigned int n, short *var ) ;
70 void sgWriteShort ( gzFile fd, const unsigned int n, const short *var ) ;
71 void sgReadBytes ( gzFile fd, const unsigned int n, void *var ) ;
72 void sgWriteBytes ( gzFile fd, const unsigned int n, const void *var ) ;
73
74 void sgReadString ( gzFile fd, char **var ) ;
75 void sgWriteString ( gzFile fd, const char *var ) ;
76
77 void sgReadVec2 ( gzFile fd, sgVec2 var ) ;
78 void sgWriteVec2 ( gzFile fd, const sgVec2 var ) ;
79 void sgReadVec3 ( gzFile fd, sgVec3 var ) ;
80 void sgWriteVec3 ( gzFile fd, const sgVec3 var ) ;
81 void sgReaddVec3 ( gzFile fd, sgdVec3 var ) ;
82 void sgWritedVec3 ( gzFile fd, const sgdVec3 var ) ;
83 void sgReadVec4 ( gzFile fd, sgVec4 var ) ;
84 void sgWriteVec4 ( gzFile fd, const sgVec4 var ) ;
85
86 void sgReadMat4 ( gzFile fd, sgMat4 var ) ;
87 void sgWriteMat4 ( gzFile fd, const sgMat4 var ) ;
88
89 void sgClearReadError();
90 void sgClearWriteError();
91 int sgReadError();
92 int sgWriteError();
93
94
95 #endif // _SG_LOWLEVEL_HXX