1 // Emacs style mode select -*- C++ -*-
2 //-----------------------------------------------------------------------------
4 // Copyright(C) 2005 Simon Howard
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
21 //-----------------------------------------------------------------------------
23 // Dehacked "mapping" code
24 // Allows the fields in structures to be mapped out and accessed by
27 //-----------------------------------------------------------------------------
36 #define DEH_BEGIN_MAPPING(mapping_name, structname) \
37 static structname deh_mapping_base; \
38 static deh_mapping_t mapping_name = \
43 #define DEH_MAPPING(deh_name, fieldname) \
44 {deh_name, &deh_mapping_base.fieldname, \
45 sizeof(deh_mapping_base.fieldname)},
47 #define DEH_UNSUPPORTED_MAPPING(deh_name) \
50 #define DEH_END_MAPPING \
57 #define MAX_MAPPING_ENTRIES 32
59 typedef struct deh_mapping_s deh_mapping_t
;
60 typedef struct deh_mapping_entry_s deh_mapping_entry_t
;
62 struct deh_mapping_entry_s
68 // location relative to the base in the deh_mapping_t struct
69 // If this is NULL, it is an unsupported mapping
81 deh_mapping_entry_t entries
[MAX_MAPPING_ENTRIES
];
84 boolean
DEH_SetMapping(deh_context_t
*context
, deh_mapping_t
*mapping
,
85 void *structptr
, char *name
, int value
);
86 void DEH_StructMD5Sum(md5_context_t
*context
, deh_mapping_t
*mapping
,
89 #endif /* #ifndef DEH_MAPPING_H */