]> de.git.xonotic.org Git - xonotic/netradiant.git/blob - include/ieclass.h
eol style
[xonotic/netradiant.git] / include / ieclass.h
1 /*
2 Copyright (C) 1999-2007 id Software, Inc. and contributors.
3 For a list of contributors, see the accompanying CONTRIBUTORS file.
4
5 This file is part of GtkRadiant.
6
7 GtkRadiant is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
11
12 GtkRadiant is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GtkRadiant; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
20 */
21
22 /*! \file ieclass.h
23     \brief entity files loader API
24     this describes the APIs involved when loading entity description files
25     (initially, .def and .fgd)
26 */
27
28 #ifndef _IECLASS_H_
29 #define _IECLASS_H_
30
31 #define ECLASS_MAJOR "eclass"
32
33 typedef void (* PFN_ECLASS_SCANFILE) (char *filename);
34 typedef const char*       (* PFN_ECLASS_GETEXTENSION)     ();
35
36 struct _EClassTable
37 {
38   int m_nSize;
39   PFN_ECLASS_SCANFILE m_pfnScanFile;
40   PFN_ECLASS_GETEXTENSION       m_pfnGetExtension;
41 };
42
43 #ifdef USE_ECLASSTABLE_DEFINE
44 #ifndef __ECLASSTABLENAME
45 #define __ECLASSTABLENAME g_EClassTable
46 #endif
47 #define EClass_ScanFile __ECLASSTABLENAME.m_pfnEClass_ScanFile
48 #define EClass_GetExtension __ECLASSTABLENAME.m_pfnEClass_GetExtension
49 #endif
50
51 #define ECLASSMANAGER_MAJOR "eclassmanager"
52
53 typedef void (* PFN_ECLASS_INSERTALPHABETIZED) (eclass_t *e);
54 typedef eclass_t** (* PFN_GET_ECLASS_E) ();
55 typedef void (* PFN_SET_ECLASS_FOUND) (qboolean);
56 typedef qboolean (* PFN_GET_PARSING_SINGLE) ();
57 typedef eclass_t* (* PFN_ECLASS_CREATE) (const char *name, float col1, float col2, float col3, const vec3_t *mins, const vec3_t *maxs, const char *comments);
58 typedef eclass_t* (* PFN_ECLASS_FORNAME) (const char* name, qboolean has_brushes);
59
60 struct _EClassManagerTable
61 {
62   int m_nSize;
63   PFN_ECLASS_INSERTALPHABETIZED m_pfnEclass_InsertAlphabetized;
64   PFN_GET_ECLASS_E m_pfnGet_Eclass_E;
65   PFN_SET_ECLASS_FOUND m_pfnSet_Eclass_Found;
66   PFN_GET_PARSING_SINGLE m_pfnGet_Parsing_Single;
67   PFN_ECLASS_CREATE m_pfnEClass_Create;
68   PFN_ECLASS_FORNAME m_pfnEclass_ForName;
69 };
70
71 #ifdef USE_ECLASSMANAGER_DEFINE
72 #ifndef __ECLASSMANAGERTABLENAME
73 #define __ECLASSMANAGERTABLENAME g_EClassManagerTable
74 #endif
75 #define Eclass_InsertAlphabetized __ECLASSMANAGERTABLENAME.m_pfnEclass_InsertAlphabetized
76 #define Get_Eclass_E __ECLASSMANAGERTABLENAME.m_pfnGet_Eclass_E
77 #define Set_Eclass_Found __ECLASSMANAGERTABLENAME.m_pfnSet_Eclass_Found
78 #define Get_Parsing_Single __ECLASSMANAGERTABLENAME.m_pfnGet_Parsing_Single
79 #define EClass_Create __ECLASSMANAGERTABLENAME.m_pfnEClass_Create
80 #define Eclass_ForName __ECLASSMANAGERTABLENAME.m_pfnEclass_ForName
81 #endif
82
83 #endif
84