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 */ 29 #ifndef __quakeio_h 30 #define __quakeio_h 31 32 #include <stdio.h> 33 34 /** \defgroup quakeio File IO 35 \ingroup utils 36 */ 37 //@{ 38 39 typedef struct QFile_s QFile; 40 41 int Qrename(const char *old_path, const char *new_path); 42 int Qremove(const char *path); 43 int Qfilesize (QFile *file); 44 QFile *Qopen(const char *path, const char *mode); 45 QFile *Qdopen(int fd, const char *mode); 46 QFile *Qfopen (FILE *file, const char *mode); 47 QFile *Qsubopen (const char *path, int offs, int len, int zip); 48 void Qclose(QFile *file); 49 int Qread(QFile *file, void *buf, int count); 50 int Qwrite(QFile *file, const void *buf, int count); 51 int Qprintf(QFile *file, const char *fmt, ...) __attribute__((format(printf,2,3))); 52 int Qputs(QFile *file, const char *buf); 53 char *Qgets(QFile *file, char *buf, int count); 54 int Qgetc(QFile *file); 55 int Qputc(QFile *file, int c); 56 int Qungetc (QFile *file, int c); 57 int Qseek(QFile *file, long offset, int whence); 58 long Qtell(QFile *file); 59 int Qflush(QFile *file); 60 int Qeof(QFile *file); 61 const char *Qgetline(QFile *file); 62 63 //@} 64 65 #endif /*__quakeio_h*/ 66