1 /* 2 Relay -- a tool to record and play Quake2 demos 3 Copyright (C) 2000 Conor Davis 4 5 This program is free software; you can redistribute it and/or 6 modify it under the terms of the GNU General Public License 7 as published by the Free Software Foundation; either version 2 8 of the License, or (at your option) any later version. 9 10 This program is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 GNU General Public License for more details. 14 15 You should have received a copy of the GNU General Public License 16 along with this program; if not, write to the Free Software 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 19 Conor Davis 20 cedavis@planetquake.com 21 */ 22 23 #ifndef __PAK_H 24 #define __PAK_H 25 26 #include <stdio.h> 27 28 #define PACK_FILES 0x01 29 #define PACK_PACKS 0x02 30 #define PACK_ALL (PACK_FILES|PACK_PACKS) 31 32 #define PF_READONLY 0x01 33 #define PF_WRITEONLY 0x02 34 #define PF_READWRITE 0x04 35 #define PF_APPEND 0x08 36 #define PF_TEXT 0x10 37 38 typedef struct 39 { 40 FILE *fd; 41 size_t filepos; 42 size_t filelen; 43 int flags; 44 } PFILE; 45 46 extern void RemoveAllPackFiles(); 47 extern int AddPackFile(const char *filename); 48 extern void RemovePackDir(const char *dir, int flags); 49 extern void RemoveAllPackDirs(); 50 extern void AddPackDir(const char *dir, int flags); 51 extern PFILE *pfopen(const char *filename, const char *mode); 52 extern void pfclose(PFILE *pfd); 53 extern int pfseek(PFILE *pfd, long offset, int origin); 54 extern size_t pftell(PFILE *pfd); 55 extern size_t pfread(void *buffer, size_t size, size_t count, PFILE *pfd); 56 extern size_t pfwrite(void *buffer, size_t size, size_t count, PFILE *pfd); 57 58 #endif // __PAK_H 59