]> de.git.xonotic.org Git - xonotic/darkplaces.git/blob - quakeio.h
updated to build 102
[xonotic/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 #ifdef HAVE_CONFIG_H
34 # include "config.h"
35 #endif
36
37 #include <stdio.h>
38
39 #include <zlib.h>
40
41 //#include "QF/gcc_attr.h"
42
43 typedef struct {
44         FILE *file;
45 #ifdef HAVE_ZLIB
46         gzFile *gzfile;
47 #endif
48 } QFile;
49
50 void Qexpand_squiggle(const char *path, char *dest);
51 int Qrename(const char *old, const char *new);
52 QFile *Qopen(const char *path, const char *mode);
53 QFile *Qdopen(int fd, const char *mode);
54 void Qclose(QFile *file);
55 int Qread(QFile *file, void *buf, int count);
56 int Qwrite(QFile *file, void *buf, int count);
57 //int Qprintf(QFile *file, const char *fmt, ...) __attribute__((format(printf,2,3)));
58 int Qprintf(QFile *file, const char *fmt, ...);
59 char *Qgets(QFile *file, char *buf, int count);
60 int Qgetc(QFile *file);
61 int Qputc(QFile *file, int c);
62 int Qseek(QFile *file, long offset, int whence);
63 long Qtell(QFile *file);
64 int Qflush(QFile *file);
65 int Qeof(QFile *file);
66 char *Qgetline(QFile *file);
67 int Qgetpos(QFile *file, fpos_t *pos);
68 int Qsetpos(QFile *file, fpos_t *pos);
69
70 #endif /*__quakeio_h*/