File: q3maps.h

package info (click to toggle)
xqf 1.0.6-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 4,048 kB
  • sloc: ansic: 31,166; sh: 1,451; xml: 1,039; makefile: 257; perl: 131
file content (75 lines) | stat: -rw-r--r-- 2,678 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/* XQF - Quake server browser and launcher
 * Functions for finding installed q3 maps
 * Copyright (C) 2002 Ludwig Nussel <l-n@users.sourceforge.net>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
 */

#ifndef Q3MAPS_H
#define Q3MAPS_H

#include <glib.h>

/**
 * name is the full path of a file at found at level l
 */
typedef void (*FoundFileFunction)(const char* name, int l, gpointer data);

/**
 * the current directory which is at level l contains directory name.
 * return TRUE if this directory should be visited, false otherwise
 */
typedef gboolean (*FoundDirFunction)(const char* name, int l, gpointer data);

/** free all keys and destroy maphash */
void q3_clear_maps(GHashTable* maphash);

/** create map hash */
GHashTable* q3_init_maphash();

/** return true if mapname is contained in maphash, false otherwise */
gboolean q3_lookup_map(GHashTable* maphash, const char* mapname);

/** return true if mapname is contained in maphash, false otherwise
 * same as q3_lookup_mapshot except operates on basename of mapname
 */
gboolean doom3_lookup_map(GHashTable* maphash, const char* mapname);

/** acquire image data, function allocates space in buf, returns size. buf must
 * be freed by caller */
size_t q3_lookup_mapshot(GHashTable* maphash, const char* mapname, guchar** buf);

/** acquire image data, function allocates space in buf, returns size. buf must
 * be freed by caller
 *
 * same as q3_lookup_mapshot except operates on basename of mapname
 */
size_t doom3_lookup_mapshot(GHashTable* maphash, const char* mapname, guchar** buf);

/**
 * find all maps in .pk3 files one level under startdir
 */
void findq3maps(GHashTable* maphash, const char* startdir);

/**
 * find all maps in .pk4 files one level under startdir
 */
void finddoom3maps(GHashTable* maphash, const char* startdir);
void findquake4maps(GHashTable* maphash, const char* startdir);
void findetqwmaps(GHashTable* maphash, const char* startdir);

void findquakemaps(GHashTable* maphash, const char* startdir);

#endif