]> icculus.org git repositories - divverent/darkplaces.git/blob - quakeio.h
removed unused portalstack array
[divverent/darkplaces.git] / quakeio.h
1 /*
2         quakeio.h
3
4         (description)
5
6         Copyright (C) 1996-1997  Id Software, Inc.
7         Copyright (C) 1999,2000  contributors of the QuakeForge project
8         Please see the file "AUTHORS" for a list of contributors
9
10         This program is free software; you can redistribute it and/or
11         modify it under the terms of the GNU General Public License
12         as published by the Free Software Foundation; either version 2
13         of the License, or (at your option) any later version.
14
15         This program is distributed in the hope that it will be useful,
16         but WITHOUT ANY WARRANTY; without even the implied warranty of
17         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18
19         See the GNU General Public License for more details.
20
21         You should have received a copy of the GNU General Public License
22         along with this program; if not, write to:
23
24                 Free Software Foundation, Inc.
25                 59 Temple Place - Suite 330
26                 Boston, MA  02111-1307, USA
27
28         $Id$
29 */
30 #ifndef __quakeio_h
31 #define __quakeio_h
32
33 //#define HAVE_ZLIB
34
35 #ifdef HAVE_CONFIG_H
36 # include "config.h"
37 #endif
38
39 #include <stdio.h>
40
41 #ifdef HAVE_ZLIB
42 # include <zlib.h>
43 # ifdef WIN32
44 #  undef FAR
45 # endif
46 #endif
47
48 //#include "QF/gcc_attr.h"
49
50 typedef struct {
51         FILE *file;
52 #ifdef HAVE_ZLIB
53         gzFile *gzfile;
54 #endif
55 } QFile;
56
57 void Qexpand_squiggle(const char *path, char *dest);
58 int Qrename(const char *old, const char *new);
59 QFile *Qopen(const char *path, const char *mode);
60 QFile *Qdopen(int fd, const char *mode);
61 void Qclose(QFile *file);
62 int Qread(QFile *file, void *buf, int count);
63 int Qwrite(QFile *file, void *buf, int count);
64 //int Qprintf(QFile *file, const char *fmt, ...) __attribute__((format(printf,2,3)));
65 int Qprintf(QFile *file, const char *fmt, ...);
66 char *Qgets(QFile *file, char *buf, int count);
67 int Qgetc(QFile *file);
68 int Qputc(QFile *file, int c);
69 int Qseek(QFile *file, long offset, int whence);
70 long Qtell(QFile *file);
71 int Qflush(QFile *file);
72 int Qeof(QFile *file);
73 char *Qgetline(QFile *file);
74
75 #endif /*__quakeio_h*/