Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

l_qfiles.h

Go to the documentation of this file.
00001 /*
00002 ===========================================================================
00003 Copyright (C) 1999-2005 Id Software, Inc.
00004 
00005 This file is part of Quake III Arena source code.
00006 
00007 Quake III Arena source code is free software; you can redistribute it
00008 and/or modify it under the terms of the GNU General Public License as
00009 published by the Free Software Foundation; either version 2 of the License,
00010 or (at your option) any later version.
00011 
00012 Quake III Arena source code is distributed in the hope that it will be
00013 useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 GNU General Public License for more details.
00016 
00017 You should have received a copy of the GNU General Public License
00018 along with Foobar; if not, write to the Free Software
00019 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00020 ===========================================================================
00021 */
00022 
00023 #include "../qcommon/unzip.h"
00024 
00025 #define QFILETYPE_UNKNOWN           0x8000
00026 #define QFILETYPE_PAK               0x0001
00027 #define QFILETYPE_PK3               0x0002
00028 #define QFILETYPE_BSP               0x0004
00029 #define QFILETYPE_MAP               0x0008
00030 #define QFILETYPE_MDL               0x0010
00031 #define QFILETYPE_MD2               0x0020
00032 #define QFILETYPE_MD3               0x0040
00033 #define QFILETYPE_WAL               0x0080
00034 #define QFILETYPE_WAV               0x0100
00035 #define QFILETYPE_AAS               0x4000
00036 
00037 #define QFILEEXT_UNKNOWN            ""
00038 #define QFILEEXT_PAK                ".PAK"
00039 #define QFILEEXT_PK3                ".PK3"
00040 #define QFILEEXT_SIN                ".SIN"
00041 #define QFILEEXT_BSP                ".BSP"
00042 #define QFILEEXT_MAP                ".MAP"
00043 #define QFILEEXT_MDL                ".MDL"
00044 #define QFILEEXT_MD2                ".MD2"
00045 #define QFILEEXT_MD3                ".MD3"
00046 #define QFILEEXT_WAL                ".WAL"
00047 #define QFILEEXT_WAV                ".WAV"
00048 #define QFILEEXT_AAS                ".AAS"
00049 
00050 //maximum path length
00051 #ifndef _MAX_PATH
00052     #define _MAX_PATH               1024
00053 #endif
00054 
00055 //for Sin packs
00056 #define MAX_PAK_FILENAME_LENGTH 120
00057 #define SINPAKHEADER        (('K'<<24)+('A'<<16)+('P'<<8)+'S')
00058 
00059 typedef struct
00060 {
00061     char    name[MAX_PAK_FILENAME_LENGTH];
00062     int filepos, filelen;
00063 } dsinpackfile_t;
00064 
00065 typedef struct quakefile_s
00066 {
00067     char pakfile[_MAX_PATH];
00068     char filename[_MAX_PATH];
00069     char origname[_MAX_PATH];
00070     int zipfile;
00071     int type;
00072     int offset;
00073     int length;
00074     unz_s zipinfo;
00075     struct quakefile_s *next;
00076 } quakefile_t;
00077 
00078 //returns the file extension for the given type
00079 char *QuakeFileTypeExtension(int type);
00080 //returns the file type for the given extension
00081 int QuakeFileExtensionType(char *extension);
00082 //return the Quake file type for the given file
00083 int QuakeFileType(char *filename);
00084 //returns true if the filename complies to the filter
00085 int FileFilter(char *filter, char *filename, int casesensitive);
00086 //find Quake files using the given filter
00087 quakefile_t *FindQuakeFiles(char *filter);
00088 //load the given Quake file, returns the length of the file
00089 int LoadQuakeFile(quakefile_t *qf, void **bufferptr);
00090 //read part of a Quake file into the buffer
00091 int ReadQuakeFile(quakefile_t *qf, void *buffer, int offset, int length);

Generated on Thu Aug 25 12:37:17 2005 for Quake III Arena by  doxygen 1.3.9.1