]> git.pond.sub.org Git - empserver/blob - src/lib/global/nsc.c
(ship_chr_flags): Add internal flags (M_XLIGHT, M_CHOPPER, M_UNIT)
[empserver] / src / lib / global / nsc.c
1 /*
2  *  Empire - A multi-player, client/server Internet based war game.
3  *  Copyright (C) 1986-2005, Dave Pare, Jeff Bailey, Thomas Ruschak,
4  *                           Ken Stevens, Steve McClure
5  *
6  *  This program is free software; you can redistribute it and/or modify
7  *  it under the terms of the GNU General Public License as published by
8  *  the Free Software Foundation; either version 2 of the License, or
9  *  (at your option) any later version.
10  *
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.
15  *
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  02111-1307  USA
19  *
20  *  ---
21  *
22  *  See the "LEGAL", "LICENSE", "CREDITS" and "README" files for all the
23  *  related information and legal notices. It is expected that any future
24  *  projects/authors will amend these files as needed.
25  *
26  *  ---
27  *
28  *  nsc.c: Empire selection global structures
29  * 
30  *  Known contributors to this file:
31  *     Markus Armbruster, 2004
32  *  
33  */
34
35 #include <stddef.h>
36 #include "misc.h"
37 #include "xy.h"
38 #include "loan.h"
39 #include "nsc.h"
40 #include "news.h"
41 #include "nuke.h"
42 #include "plane.h"
43 #include "ship.h"
44 #include "land.h"
45 #include "sect.h"
46 #include "trade.h"
47 #include "treaty.h"
48 #include "genitem.h"
49 #include "nat.h"
50 #include "map.h"
51 #include "commodity.h"
52 #include "lost.h"
53 #include "product.h"
54 #include "file.h"
55 #include "mission.h"
56 #include "plague.h"
57
58 #define fldoff(str, fld) offsetof(struct str, fld)
59
60 #define NSC_IELT(name, pfx, sfx, base, itype)           \
61 {NSC_SHORT, 0, 0, ((base) + (itype)*sizeof(u_short)),   \
62 sizeof(sfx) == 1 ? name : pfx sfx, EF_BAD}
63
64 #define NSC_IVEC(base, sfx)             \
65 NSC_IELT("civil", "c", sfx, base, I_CIVIL),     \
66 NSC_IELT("milit", "m", sfx, base, I_MILIT),     \
67 NSC_IELT("shell", "s", sfx, base, I_SHELL),     \
68 NSC_IELT("gun", "g", sfx, base, I_GUN),         \
69 NSC_IELT("petrol", "p", sfx, base, I_PETROL),   \
70 NSC_IELT("iron", "i", sfx, base, I_IRON),       \
71 NSC_IELT("dust", "d", sfx, base, I_DUST),       \
72 NSC_IELT("bar", "b", sfx, base, I_BAR),         \
73 NSC_IELT("food", "f", sfx, base, I_FOOD),       \
74 NSC_IELT("oil", "o", sfx, base, I_OIL),         \
75 NSC_IELT("lcm", "l", sfx, base, I_LCM),         \
76 NSC_IELT("hcm", "h", sfx, base, I_HCM),         \
77 NSC_IELT("uw", "u", sfx, base, I_UW),           \
78 NSC_IELT("rad", "r", sfx, base, I_RAD)
79
80 struct castr ichr_ca[] = {
81     {NSC_SITYPE(i_type), 0, 0, offsetof(struct ichrstr, i_vtype), "vtype",
82      EF_ITEM},
83     {NSC_STRING, 0, 0, offsetof(struct ichrstr, i_name), "name", EF_BAD},
84     {NSC_INT, NSC_CONST, 0, offsetof(struct ichrstr, i_mnem), "mnem", EF_BAD},
85     {NSC_INT, 0, 0, offsetof(struct ichrstr, i_value), "value", EF_BAD},
86     {NSC_INT, 0, 0, offsetof(struct ichrstr, i_sell), "sell", EF_BAD},
87     {NSC_INT, 0, 0, offsetof(struct ichrstr, i_lbs), "lbs", EF_BAD},
88     {NSC_INT, 0, NUMPKG, offsetof(struct ichrstr, i_pkg), "pkg", EF_BAD},
89     {NSC_NOTYPE, 0, 0, 0, NULL, EF_BAD}
90 };
91
92 struct castr pchr_ca[] = {
93     {NSC_INT, 0, 0, offsetof(struct pchrstr, p_uid), "uid", EF_PRODUCT},
94     {NSC_STRING, 0, 0, offsetof(struct pchrstr, p_name), "name", EF_BAD},
95     {NSC_STRING, NSC_CONST, 0, offsetof(struct pchrstr, p_sname), "sname",
96      EF_BAD},
97     {NSC_SITYPE(i_type), 0, MAXPRCON, offsetof(struct pchrstr, p_ctype),
98      "ctype", EF_ITEM},
99     {NSC_USHORT, 0, MAXPRCON, offsetof(struct pchrstr, p_camt), "camt",
100      EF_BAD},
101     {NSC_SITYPE(i_type), 0, 0, offsetof(struct pchrstr, p_type), "type",
102      EF_ITEM},
103     {NSC_INT, 0, 0, offsetof(struct pchrstr, p_level), "level", EF_LEVEL},
104     {NSC_INT, 0, 0, offsetof(struct pchrstr, p_cost), "cost", EF_BAD},
105     {NSC_INT, 0, 0, offsetof(struct pchrstr, p_nrndx), "nrndx", EF_BAD},
106     {NSC_INT, 0, 0, offsetof(struct pchrstr, p_nrdep), "nrdep", EF_BAD},
107     {NSC_INT, 0, 0, offsetof(struct pchrstr, p_nlndx), "nlndx", EF_BAD},
108     {NSC_INT, 0, 0, offsetof(struct pchrstr, p_nlmin), "nlmin", EF_BAD},
109     {NSC_INT, 0, 0, offsetof(struct pchrstr, p_nllag), "nllag", EF_BAD},
110     {NSC_INT, 0, 0, offsetof(struct pchrstr, p_effic), "effic", EF_BAD},
111     {NSC_NOTYPE, 0, 0, 0, NULL, EF_BAD}
112 };
113
114 struct castr sect_ca[] = {
115     {NSC_NATID, 0, 0, fldoff(sctstr, sct_own), "owner", EF_NATION},
116     {NSC_XCOORD, 0, 0, fldoff(sctstr, sct_x), "xloc", EF_BAD},
117     {NSC_YCOORD, 0, 0, fldoff(sctstr, sct_y), "yloc", EF_BAD},
118     {NSC_TYPEID, 0, 0, fldoff(sctstr, sct_type), "des", EF_SECTOR_CHR},
119     {NSC_UCHAR, 0, 0, fldoff(sctstr, sct_effic), "effic", EF_BAD},
120     {NSC_SHORT, 0, 0, fldoff(sctstr, sct_mobil), "mobil", EF_BAD},
121     {NSC_UCHAR, NSC_DEITY, 0, fldoff(sctstr, sct_loyal), "loyal", EF_BAD},
122     {NSC_UCHAR, 0, 0, fldoff(sctstr, sct_terr), "terr", EF_BAD},
123     {NSC_UCHAR, NSC_EXTRA, 0, fldoff(sctstr, sct_terr), "terr0", EF_BAD},
124     {NSC_UCHAR, 0, 0, fldoff(sctstr, sct_terr1), "terr1", EF_BAD},
125     {NSC_UCHAR, 0, 0, fldoff(sctstr, sct_terr2), "terr2", EF_BAD},
126     {NSC_UCHAR, 0, 0, fldoff(sctstr, sct_terr3), "terr3", EF_BAD},
127     {NSC_XCOORD, 0, 0, fldoff(sctstr, sct_dist_x), "xdist", EF_BAD},
128     {NSC_YCOORD, 0, 0, fldoff(sctstr, sct_dist_y), "ydist", EF_BAD},
129     {NSC_SHORT, 0, 0, fldoff(sctstr, sct_avail), "avail", EF_BAD},
130     {NSC_UCHAR, 0, 0, fldoff(sctstr, sct_work), "work", EF_BAD},
131     {NSC_UCHAR, NSC_EXTRA, 0, fldoff(sctstr, sct_coastal), "coastal", EF_BAD},
132     {NSC_TYPEID, 0, 0, fldoff(sctstr, sct_newtype), "newdes", EF_SECTOR_CHR},
133     {NSC_UCHAR, 0, 0, fldoff(sctstr, sct_min), "min", EF_BAD},
134     {NSC_UCHAR, 0, 0, fldoff(sctstr, sct_gmin), "gold", EF_BAD},
135     {NSC_UCHAR, 0, 0, fldoff(sctstr, sct_fertil), "fert", EF_BAD},
136     {NSC_UCHAR, 0, 0, fldoff(sctstr, sct_oil), "ocontent", EF_BAD},
137     {NSC_UCHAR, 0, 0, fldoff(sctstr, sct_uran), "uran", EF_BAD},
138     {NSC_NATID, 0, 0, fldoff(sctstr, sct_oldown), "oldown", EF_NATION},
139     {NSC_UCHAR, 0, 0, fldoff(sctstr, sct_off), "off", EF_BAD},
140     NSC_IVEC(fldoff(sctstr, sct_item), ""),
141     NSC_IVEC(fldoff(sctstr, sct_dist), "_dist"),
142     NSC_IVEC(fldoff(sctstr, sct_del), "_del"),
143     {NSC_SHORT, NSC_DEITY, 0, fldoff(sctstr, sct_mines), "mines", EF_BAD},
144     {NSC_SHORT, NSC_DEITY, 0, fldoff(sctstr, sct_pstage), "pstage",
145      EF_PLAGUE_STAGES},
146     {NSC_SHORT, NSC_DEITY, 0, fldoff(sctstr, sct_ptime), "ptime", EF_BAD},
147     {NSC_UCHAR, NSC_DEITY, 0, fldoff(sctstr, sct_che), "che", EF_BAD},
148     {NSC_NATID, NSC_DEITY, 0, fldoff(sctstr, sct_che_target), "che_target",
149      EF_NATION},
150     {NSC_USHORT, 0, 0, fldoff(sctstr, sct_fallout), "fallout", EF_BAD},
151     {NSC_TIME, 0, 0, fldoff(sctstr, sct_access), "access", EF_BAD},
152     {NSC_UCHAR, 0, 0, fldoff(sctstr, sct_road), "road", EF_BAD},
153     {NSC_UCHAR, 0, 0, fldoff(sctstr, sct_rail), "rail", EF_BAD},
154     {NSC_UCHAR, 0, 0, fldoff(sctstr, sct_defense), "dfense", EF_BAD},
155     {NSC_TIME, NSC_EXTRA, 0, fldoff(sctstr, sct_timestamp), "timestamp",
156      EF_BAD},
157     {NSC_NOTYPE, 0, 0, 0, NULL, EF_BAD}
158 };
159
160 struct castr dchr_ca[] = {
161     {NSC_UCHAR, 0, 0, offsetof(struct dchrstr, d_uid), "uid", EF_SECTOR_CHR},
162     {NSC_STRING, 0, 0, offsetof(struct dchrstr, d_name), "name", EF_BAD},
163     {NSC_INT, NSC_CONST, 0, offsetof(struct dchrstr, d_mnem), "mnem", EF_BAD},
164     {NSC_INT, 0, 0, offsetof(struct dchrstr, d_prd), "prd", EF_PRODUCT},
165     {NSC_INT, 0, 0, offsetof(struct dchrstr, d_mcst), "mcst", EF_BAD},
166     {NSC_INT, 0, 0, offsetof(struct dchrstr, d_flg), "flg", EF_BAD},
167     {NSC_SITYPE(i_packing), 0, 0, offsetof(struct dchrstr, d_pkg), "pkg",
168      EF_PACKING},
169     {NSC_FLOAT, 0, 0, offsetof(struct dchrstr, d_ostr), "ostr", EF_BAD},
170     {NSC_FLOAT, 0, 0, offsetof(struct dchrstr, d_dstr), "dstr", EF_BAD},
171     {NSC_INT, 0, 0, offsetof(struct dchrstr, d_value), "value", EF_BAD},
172     {NSC_INT, 0, 0, offsetof(struct dchrstr, d_cost), "cost", EF_BAD},
173     {NSC_INT, 0, 0, offsetof(struct dchrstr, d_build), "build", EF_BAD},
174     {NSC_INT, 0, 0, offsetof(struct dchrstr, d_lcms), "lcms", EF_BAD},
175     {NSC_INT, 0, 0, offsetof(struct dchrstr, d_hcms), "hcms", EF_BAD},
176     {NSC_INT, 0, 0, offsetof(struct dchrstr, d_maxpop), "maxpop", EF_BAD},
177     {NSC_NOTYPE, 0, 0, 0, NULL, EF_BAD}
178 };
179
180 #define NSC_GENITEM(ef_type, ef_chr)                                    \
181 { NSC_SHORT, 0, 0, fldoff(genitem, uid), "uid", ef_type},               \
182 { NSC_NATID, 0, 0, fldoff(genitem, own), "owner", EF_NATION},           \
183 { NSC_XCOORD, 0, 0, fldoff(genitem, x), "xloc", EF_BAD},                \
184 { NSC_YCOORD, 0, 0, fldoff(genitem, y), "yloc", EF_BAD},                \
185 { NSC_TYPEID, 0, 0, fldoff(genitem, type), "type", ef_chr},             \
186 { NSC_CHAR, 0, 0, fldoff(genitem, effic), "effic", EF_BAD},             \
187 { NSC_CHAR , 0, 0, fldoff(genitem, mobil), "mobil", EF_BAD},            \
188 { NSC_SHORT, 0, 0, fldoff(genitem, tech), "tech", EF_BAD},              \
189 { NSC_CHAR, NSC_EXTRA, 0, fldoff(genitem, group), "group", EF_BAD},     \
190 { NSC_XCOORD, 0, 0, fldoff(genitem, opx), "opx", EF_BAD},               \
191 { NSC_YCOORD, 0, 0, fldoff(genitem, opy), "opy", EF_BAD},               \
192 { NSC_SHORT, 0, 0, fldoff(genitem, mission), "mission", EF_MISSIONS},   \
193 { NSC_SHORT, 0, 0, fldoff(genitem, radius), "radius", EF_BAD}
194
195 struct castr ship_ca[] = {
196     NSC_GENITEM(EF_SHIP, EF_SHIP_CHR),
197     {NSC_CHAR, 0, 0, fldoff(shpstr, shp_fleet), "fleet", EF_BAD},
198     {NSC_UCHAR, NSC_EXTRA, 0, fldoff(shpstr, shp_nplane), "nplane", EF_BAD},
199     {NSC_UCHAR, NSC_EXTRA, 0, fldoff(shpstr, shp_nland), "nland", EF_BAD},
200     {NSC_XCOORD, 0, 0, fldoff(shpstr, shp_destx[0]), "xstart", EF_BAD},
201     {NSC_XCOORD, 0, 0, fldoff(shpstr, shp_destx[1]), "xend", EF_BAD},
202     {NSC_YCOORD, 0, 0, fldoff(shpstr, shp_desty[0]), "ystart", EF_BAD},
203     {NSC_YCOORD, 0, 0, fldoff(shpstr, shp_desty[1]), "yend", EF_BAD},
204     {NSC_SITYPE(i_type), 0, TMAX, fldoff(shpstr, shp_tstart), "cargostart",
205      EF_ITEM},
206     {NSC_SITYPE(i_type), 0, TMAX, fldoff(shpstr, shp_tend), "cargoend",
207      EF_ITEM},
208     {NSC_SHORT, 0, TMAX, fldoff(shpstr, shp_lstart), "amtstart", EF_BAD},
209     {NSC_SHORT, 0, TMAX, fldoff(shpstr, shp_lend), "amtend", EF_BAD},
210     {NSC_UCHAR, 0, 0, fldoff(shpstr, shp_autonav), "autonav", EF_BAD},
211     NSC_IVEC(fldoff(shpstr, shp_item), ""),
212     {NSC_SHORT, NSC_DEITY, 0, fldoff(shpstr, shp_pstage), "pstage",
213      EF_PLAGUE_STAGES},
214     {NSC_SHORT, NSC_DEITY, 0, fldoff(shpstr, shp_ptime), "ptime", EF_BAD},
215     {NSC_TIME, 0, 0, fldoff(shpstr, shp_access), "access", EF_BAD},
216     {NSC_TIME, NSC_EXTRA, 0, fldoff(shpstr, shp_timestamp), "timestamp",
217      EF_BAD},
218     {NSC_UCHAR, 0, 0, fldoff(shpstr, shp_mobquota), "mquota", EF_BAD},
219     {NSC_STRINGY, 0, MAXSHPPATH, fldoff(shpstr, shp_path), "path", EF_BAD},
220     {NSC_SHORT, 0, 0, fldoff(shpstr, shp_follow), "follow", EF_BAD},
221     {NSC_STRINGY, 0, MAXSHPNAMLEN, fldoff(shpstr, shp_name), "name", EF_BAD},
222     {NSC_UCHAR, 0, 0, fldoff(shpstr, shp_fuel), "fuel", EF_BAD},
223     {NSC_UCHAR, NSC_EXTRA, 0, fldoff(shpstr, shp_nchoppers), "nchoppers",
224      EF_BAD},
225     {NSC_UCHAR, NSC_EXTRA, 0, fldoff(shpstr, shp_nxlight), "nxlight", EF_BAD},
226     /* could let builder access these, but we can't express that yet: */
227     {NSC_XCOORD, NSC_DEITY, 0, fldoff(shpstr, shp_orig_x), "xbuilt", EF_BAD},
228     {NSC_YCOORD, NSC_DEITY, 0, fldoff(shpstr, shp_orig_y), "ybuilt", EF_BAD},
229     {NSC_NATID, NSC_DEITY, 0, fldoff(shpstr, shp_orig_own), "builder",
230      EF_NATION},
231     {NSC_INT, NSC_BITS, 0, fldoff(shpstr, shp_rflags), "rflags",
232      EF_RETREAT_FLAGS},
233     {NSC_STRINGY, 0, RET_LEN, fldoff(shpstr, shp_rpath), "rpath", EF_BAD},
234     {NSC_NOTYPE, 0, 0, 0, NULL, EF_BAD}
235 };
236
237 struct castr mchr_ca[] = {
238     {NSC_STRING, 0, 0, offsetof(struct mchrstr, m_name), "name", EF_BAD},
239     {NSC_USHORT, 0, I_MAX+1, offsetof(struct mchrstr, m_item), "item", EF_BAD},
240     {NSC_INT, 0, 0, offsetof(struct mchrstr, m_lcm), "lcm", EF_BAD},
241     {NSC_INT, 0, 0, offsetof(struct mchrstr, m_hcm), "hcm", EF_BAD},
242     {NSC_INT, 0, 0, offsetof(struct mchrstr, m_armor), "armor", EF_BAD},
243     {NSC_INT, 0, 0, offsetof(struct mchrstr, m_speed), "speed", EF_BAD},
244     {NSC_INT, 0, 0, offsetof(struct mchrstr, m_visib), "visib", EF_BAD},
245     {NSC_INT, 0, 0, offsetof(struct mchrstr, m_vrnge), "vrnge", EF_BAD},
246     {NSC_INT, 0, 0, offsetof(struct mchrstr, m_frnge), "frnge", EF_BAD},
247     {NSC_INT, 0, 0, offsetof(struct mchrstr, m_glim), "glim", EF_BAD},
248     {NSC_UCHAR, 0, 0, offsetof(struct mchrstr, m_nxlight), "nxlight", EF_BAD},
249     {NSC_UCHAR, 0, 0, offsetof(struct mchrstr, m_nchoppers), "nchoppers",
250      EF_BAD},
251     {NSC_UCHAR, 0, 0, offsetof(struct mchrstr, m_fuelc), "fuelc", EF_BAD},
252     {NSC_UCHAR, 0, 0, offsetof(struct mchrstr, m_fuelu), "fuelu", EF_BAD},
253     {NSC_INT, 0, 0, offsetof(struct mchrstr, m_tech), "tech", EF_BAD},
254     {NSC_INT, 0, 0, offsetof(struct mchrstr, m_cost), "cost", EF_BAD},
255     {NSC_LONG, NSC_BITS, 0, offsetof(struct mchrstr, m_flags), "flags",
256      EF_SHIP_CHR_FLAGS},
257     {NSC_UCHAR, 0, 0, offsetof(struct mchrstr, m_nplanes), "nplanes", EF_BAD},
258     {NSC_UCHAR, 0, 0, offsetof(struct mchrstr, m_nland), "nland", EF_BAD},
259     {NSC_NOTYPE, 0, 0, 0, NULL, EF_BAD}
260 };
261
262 struct castr plane_ca[] = {
263     NSC_GENITEM(EF_PLANE, EF_PLANE_CHR),
264     {NSC_CHAR, 0, 0, fldoff(plnstr, pln_wing), "wing", EF_BAD},
265     {NSC_UCHAR, 0, 0, fldoff(plnstr, pln_range), "range", EF_BAD},
266     {NSC_SHORT, 0, 0, fldoff(plnstr, pln_ship), "ship", EF_BAD},
267     {NSC_SHORT, 0, 0, fldoff(plnstr, pln_land), "land", EF_BAD},
268     {NSC_INT, NSC_EXTRA, 0, fldoff(plnstr, pln_att), "att", EF_BAD},
269     {NSC_INT, NSC_EXTRA, 0, fldoff(plnstr, pln_def), "def", EF_BAD},
270     {NSC_CHAR, 0, 0, fldoff(plnstr, pln_harden), "harden", EF_BAD},
271     {NSC_CHAR, 0, 0, fldoff(plnstr, pln_nuketype), "nuketype", EF_BAD},
272     {NSC_CHAR, NSC_BITS, 0, fldoff(plnstr, pln_flags), "flags",
273      EF_PLANE_FLAGS},
274     {NSC_TIME, 0, 0, fldoff(plnstr, pln_access), "access", EF_BAD},
275     {NSC_TIME, NSC_EXTRA, 0, fldoff(plnstr, pln_timestamp), "timestamp",
276      EF_BAD},
277     {NSC_FLOAT, 0, 0, fldoff(plnstr, pln_theta), "theta", EF_BAD},
278     {NSC_NOTYPE, 0, 0, 0, NULL, EF_BAD}
279 };
280
281 struct castr plchr_ca[] = {
282     {NSC_STRING, 0, 0, offsetof(struct plchrstr, pl_name), "name", EF_BAD},
283     {NSC_INT, 0, 0, offsetof(struct plchrstr, pl_lcm), "lcm", EF_BAD},
284     {NSC_INT, 0, 0, offsetof(struct plchrstr, pl_hcm), "hcm", EF_BAD},
285     {NSC_INT, 0, 0, offsetof(struct plchrstr, pl_cost), "cost", EF_BAD},
286     {NSC_INT, 0, 0, offsetof(struct plchrstr, pl_tech), "tech", EF_BAD},
287     {NSC_INT, 0, 0, offsetof(struct plchrstr, pl_acc), "acc", EF_BAD},
288     {NSC_INT, 0, 0, offsetof(struct plchrstr, pl_load), "load", EF_BAD},
289     {NSC_INT, 0, 0, offsetof(struct plchrstr, pl_att), "att", EF_BAD},
290     {NSC_INT, 0, 0, offsetof(struct plchrstr, pl_def), "def", EF_BAD},
291     {NSC_INT, 0, 0, offsetof(struct plchrstr, pl_range), "range", EF_BAD},
292     {NSC_INT, 0, 0, offsetof(struct plchrstr, pl_crew), "crew", EF_BAD},
293     {NSC_INT, 0, 0, offsetof(struct plchrstr, pl_fuel), "fuel", EF_BAD},
294     {NSC_INT, 0, 0, offsetof(struct plchrstr, pl_stealth), "stealth", EF_BAD},
295     {NSC_INT, NSC_BITS, 0, offsetof(struct plchrstr, pl_flags), "flags",
296      EF_PLANE_CHR_FLAGS},
297     {NSC_NOTYPE, 0, 0, 0, NULL, EF_BAD}
298 };
299
300 struct castr land_ca[] = {
301     NSC_GENITEM(EF_LAND, EF_LAND_CHR),
302     {NSC_CHAR, 0, 0, fldoff(lndstr, lnd_army), "army", EF_BAD},
303     {NSC_SHORT, 0, 0, fldoff(lndstr, lnd_ship), "ship", EF_BAD},
304     {NSC_CHAR, 0, 0, fldoff(lndstr, lnd_harden), "harden", EF_BAD},
305     {NSC_SHORT, 0, 0, fldoff(lndstr, lnd_retreat), "retreat", EF_BAD},
306     {NSC_UCHAR, 0, 0, fldoff(lndstr, lnd_fuel), "fuel", EF_BAD},
307     {NSC_UCHAR, NSC_EXTRA, 0, fldoff(lndstr, lnd_nxlight), "nxlight", EF_BAD},
308     {NSC_INT, NSC_BITS, 0, fldoff(lndstr, lnd_rflags), "rflags",
309      EF_RETREAT_FLAGS},
310     {NSC_STRINGY, 0, RET_LEN, fldoff(lndstr, lnd_rpath), "rpath", EF_BAD},
311     {NSC_UCHAR, 0, 0, fldoff(lndstr, lnd_rad_max), "react", EF_BAD},
312     NSC_IVEC(fldoff(lndstr, lnd_item), ""),
313     {NSC_SHORT, NSC_DEITY, 0, fldoff(lndstr, lnd_pstage), "pstage",
314      EF_PLAGUE_STAGES},
315     {NSC_SHORT, NSC_DEITY, 0, fldoff(lndstr, lnd_ptime), "ptime", EF_BAD},
316     {NSC_SHORT, 0, 0, fldoff(lndstr, lnd_land), "land", EF_BAD},
317     {NSC_UCHAR, NSC_EXTRA, 0, fldoff(lndstr, lnd_nland), "nland", EF_BAD},
318     {NSC_TIME, 0, 0, fldoff(lndstr, lnd_access), "access", EF_BAD},
319     {NSC_FLOAT, NSC_EXTRA, 0, fldoff(lndstr, lnd_att), "att", EF_BAD},
320     {NSC_FLOAT, NSC_EXTRA, 0, fldoff(lndstr, lnd_def), "def", EF_BAD},
321     {NSC_INT, NSC_EXTRA, 0, fldoff(lndstr, lnd_vul), "vul", EF_BAD},
322     {NSC_INT, NSC_EXTRA, 0, fldoff(lndstr, lnd_spd), "spd", EF_BAD},
323     {NSC_INT, NSC_EXTRA, 0, fldoff(lndstr, lnd_vis), "vis", EF_BAD},
324     {NSC_INT, NSC_EXTRA, 0, fldoff(lndstr, lnd_spy), "spy", EF_BAD},
325     {NSC_INT, NSC_EXTRA, 0, fldoff(lndstr, lnd_rad), "rmax", EF_BAD},
326     {NSC_INT, NSC_EXTRA, 0, fldoff(lndstr, lnd_frg), "frg", EF_BAD},
327     {NSC_INT, NSC_EXTRA, 0, fldoff(lndstr, lnd_acc), "acc", EF_BAD},
328     {NSC_INT, NSC_EXTRA, 0, fldoff(lndstr, lnd_dam), "dam", EF_BAD},
329     {NSC_INT, NSC_EXTRA, 0, fldoff(lndstr, lnd_ammo), "ammo", EF_BAD},
330     {NSC_INT, NSC_EXTRA, 0, fldoff(lndstr, lnd_aaf), "aaf", EF_BAD},
331     {NSC_UCHAR, NSC_EXTRA, 0, fldoff(lndstr, lnd_fuelc), "fuelc", EF_BAD},
332     {NSC_UCHAR, NSC_EXTRA, 0, fldoff(lndstr, lnd_fuelu), "fuelu", EF_BAD},
333     {NSC_UCHAR, NSC_EXTRA, 0, fldoff(lndstr, lnd_maxlight), "maxlight",
334      EF_BAD},
335     {NSC_TIME, NSC_EXTRA, 0, fldoff(lndstr, lnd_timestamp), "timestamp",
336      EF_BAD},
337     {NSC_NOTYPE, 0, 0, 0, NULL, EF_BAD}
338 };
339
340 struct castr lchr_ca[] = {
341     {NSC_STRING, 0, 0, offsetof(struct lchrstr, l_name), "name", EF_BAD},
342     {NSC_USHORT, 0, I_MAX+1, offsetof(struct mchrstr, m_item), "item", EF_BAD},
343     {NSC_INT, 0, 0, offsetof(struct lchrstr, l_lcm), "lcm", EF_BAD},
344     {NSC_INT, 0, 0, offsetof(struct lchrstr, l_hcm), "hcm", EF_BAD},
345     {NSC_INT, 0, 0, offsetof(struct lchrstr, l_gun), "gun", EF_BAD},
346     {NSC_INT, 0, 0, offsetof(struct lchrstr, l_shell), "shell", EF_BAD},
347     {NSC_INT, 0, 0, offsetof(struct lchrstr, l_tech), "tech", EF_BAD},
348     {NSC_INT, 0, 0, offsetof(struct lchrstr, l_cost), "cost", EF_BAD},
349     {NSC_FLOAT, 0, 0, offsetof(struct lchrstr, l_att), "att", EF_BAD},
350     {NSC_FLOAT, 0, 0, offsetof(struct lchrstr, l_def), "def", EF_BAD},
351     {NSC_INT, 0, 0, offsetof(struct lchrstr, l_vul), "vul", EF_BAD},
352     {NSC_INT, 0, 0, offsetof(struct lchrstr, l_spd), "spd", EF_BAD},
353     {NSC_INT, 0, 0, offsetof(struct lchrstr, l_vis), "vis", EF_BAD},
354     {NSC_INT, 0, 0, offsetof(struct lchrstr, l_spy), "spy", EF_BAD},
355     {NSC_INT, 0, 0, offsetof(struct lchrstr, l_rad), "rad", EF_BAD},
356     {NSC_INT, 0, 0, offsetof(struct lchrstr, l_frg), "frg", EF_BAD},
357     {NSC_INT, 0, 0, offsetof(struct lchrstr, l_acc), "acc", EF_BAD},
358     {NSC_INT, 0, 0, offsetof(struct lchrstr, l_dam), "dam", EF_BAD},
359     {NSC_INT, 0, 0, offsetof(struct lchrstr, l_ammo), "ammo", EF_BAD},
360     {NSC_INT, 0, 0, offsetof(struct lchrstr, l_aaf), "aaf", EF_BAD},
361     {NSC_UCHAR, 0, 0, offsetof(struct lchrstr, l_fuelc), "fuelc", EF_BAD},
362     {NSC_UCHAR, 0, 0, offsetof(struct lchrstr, l_fuelu), "fuelu", EF_BAD},
363     {NSC_UCHAR, 0, 0, offsetof(struct lchrstr, l_nxlight), "nxlight", EF_BAD},
364     {NSC_UCHAR, 0, 0, offsetof(struct lchrstr, l_mxland), "mxland", EF_BAD},
365     {NSC_LONG, NSC_BITS, 0, offsetof(struct lchrstr, l_flags), "flags",
366      EF_LAND_CHR_FLAGS},
367     {NSC_NOTYPE, 0, 0, 0, NULL, EF_BAD}
368 };
369
370 struct castr nuke_ca[] = {
371     {NSC_SHORT, 0, 0, fldoff(nukstr, nuk_uid), "uid", EF_NUKE},
372     {NSC_NATID, 0, 0, fldoff(nukstr, nuk_own), "owner", EF_NATION},
373     {NSC_XCOORD, 0, 0, fldoff(nukstr, nuk_x), "xloc", EF_BAD},
374     {NSC_YCOORD, 0, 0, fldoff(nukstr, nuk_y), "yloc", EF_BAD},
375     {NSC_CHAR, 0, 0, fldoff(nukstr, nuk_n), "number", EF_BAD},
376     {NSC_SHORT, 0, N_MAXNUKE, fldoff(nukstr, nuk_types), "types", EF_NUKE_CHR},
377     {NSC_TIME, NSC_EXTRA, 0, fldoff(nukstr, nuk_timestamp), "timestamp",
378      EF_BAD},
379     {NSC_NOTYPE, 0, 0, 0, NULL, EF_BAD}
380 };
381
382 struct castr nchr_ca[] = {
383     {NSC_STRING, 0, 0, offsetof(struct nchrstr, n_name), "name", EF_BAD},
384     {NSC_INT, 0, 0, offsetof(struct nchrstr, n_lcm), "lcm", EF_BAD},
385     {NSC_INT, 0, 0, offsetof(struct nchrstr, n_hcm), "hcm", EF_BAD},
386     {NSC_INT, 0, 0, offsetof(struct nchrstr, n_oil), "oil", EF_BAD},
387     {NSC_INT, 0, 0, offsetof(struct nchrstr, n_rad), "rad", EF_BAD},
388     {NSC_INT, 0, 0, offsetof(struct nchrstr, n_blast), "blast", EF_BAD},
389     {NSC_INT, 0, 0, offsetof(struct nchrstr, n_dam), "dam", EF_BAD},
390     {NSC_INT, 0, 0, offsetof(struct nchrstr, n_cost), "cost", EF_BAD},
391     {NSC_INT, 0, 0, offsetof(struct nchrstr, n_tech), "tech", EF_BAD},
392     {NSC_INT, 0, 0, offsetof(struct nchrstr, n_weight), "weight", EF_BAD},
393     {NSC_INT, NSC_BITS, 0, offsetof(struct nchrstr, n_flags), "flags",
394      EF_NUKE_CHR_FLAGS},
395     {NSC_NOTYPE, 0, 0, 0, NULL, EF_BAD}
396 };
397
398 struct castr treaty_ca[] = {
399     {NSC_SHORT, 0, 0, fldoff(trtstr, trt_uid), "uid", EF_TREATY},
400     {NSC_NATID, 0, 0, fldoff(trtstr, trt_cna), "cna", EF_NATION},
401     {NSC_NATID, 0, 0, fldoff(trtstr, trt_cnb), "cnb", EF_NATION},
402     {NSC_CHAR, 0, 0, fldoff(trtstr, trt_status), "status",
403      EF_AGREEMENT_STATUS},
404     {NSC_SHORT, NSC_BITS, 0, fldoff(trtstr, trt_acond), "acond",
405      EF_TREATY_FLAGS},
406     {NSC_SHORT, NSC_BITS, 0, fldoff(trtstr, trt_bcond), "bcond",
407      EF_TREATY_FLAGS},
408     {NSC_TIME, 0, 0, fldoff(trtstr, trt_exp), "exp", EF_BAD},
409     {NSC_NOTYPE, 0, 0, 0, NULL, EF_BAD}
410 };
411
412 struct castr loan_ca[] = {
413     {NSC_SHORT, 0, 0, fldoff(lonstr, l_uid), "uid", EF_LOAN},
414     {NSC_NATID, 0, 0, fldoff(lonstr, l_loner), "loaner", EF_NATION},
415     {NSC_NATID, 0, 0, fldoff(lonstr, l_lonee), "loanee", EF_NATION},
416     {NSC_CHAR, 0, 0, fldoff(lonstr, l_status), "status",
417      EF_AGREEMENT_STATUS},
418     {NSC_INT, 0, 0, fldoff(lonstr, l_irate), "irate", EF_BAD},
419     {NSC_INT, 0, 0, fldoff(lonstr, l_ldur), "ldur", EF_BAD},
420     {NSC_LONG, 0, 0, fldoff(lonstr, l_amtpaid), "amtpaid", EF_BAD},
421     {NSC_LONG, 0, 0, fldoff(lonstr, l_amtdue), "amtdue", EF_BAD},
422     {NSC_TIME, 0, 0, fldoff(lonstr, l_lastpay), "lastpay", EF_BAD},
423     {NSC_TIME, 0, 0, fldoff(lonstr, l_duedate), "duedate", EF_BAD},
424     {NSC_NOTYPE, 0, 0, 0, NULL, EF_BAD}
425 };
426
427 struct castr news_ca[] = {
428     {NSC_SHORT, 0, 0, fldoff(nwsstr, nws_uid), "uid", EF_NEWS},
429     {NSC_NATID, 0, 0, fldoff(nwsstr, nws_ano), "actor", EF_NATION},
430     {NSC_CHAR, 0, 0, fldoff(nwsstr, nws_vrb), "action", EF_NEWS_CHR},
431     {NSC_NATID, 0, 0, fldoff(nwsstr, nws_vno), "victim", EF_NATION},
432     {NSC_CHAR, 0, 0, fldoff(nwsstr, nws_ntm), "times", EF_BAD},
433     {NSC_TIME, 0, 0, fldoff(nwsstr, nws_when), "time", EF_BAD},
434     {NSC_NOTYPE, 0, 0, 0, NULL, EF_BAD}
435 };
436
437 struct castr lost_ca[] = {
438     {NSC_INT, 0, 0, fldoff(loststr, lost_uid), "uid", EF_LOST},
439     {NSC_NATID, 0, 0, fldoff(loststr, lost_owner), "owner", EF_NATION},
440     {NSC_CHAR, 0, 0, fldoff(loststr, lost_type), "type", EF_BAD},
441     {NSC_SHORT, 0, 0, fldoff(loststr, lost_id), "id", EF_BAD},
442     {NSC_XCOORD, 0, 0, fldoff(loststr, lost_x), "x", EF_BAD},
443     {NSC_YCOORD, 0, 0, fldoff(loststr, lost_y), "y", EF_BAD},
444     {NSC_TIME, 0, 0, fldoff(loststr, lost_timestamp), "timestamp", EF_BAD},
445     {NSC_NOTYPE, 0, 0, 0, NULL, EF_BAD}
446 };
447
448 struct castr commodity_ca[] = {
449     {NSC_SHORT, 0, 0, fldoff(comstr, com_uid), "uid", EF_COMM},
450     {NSC_NATID, 0, 0, fldoff(comstr, com_owner), "owner", EF_NATION},
451     {NSC_SITYPE(i_type), 0, 0, fldoff(comstr, com_type), "type", EF_ITEM},
452     {NSC_INT, 0, 0, fldoff(comstr, com_amount), "amount", EF_BAD},
453     {NSC_INT, 0, 0, fldoff(comstr, com_maxbidder), "maxbidder", EF_NATION},
454     {NSC_TIME, 0, 0, fldoff(comstr, com_markettime), "markettime", EF_BAD},
455     /* could let maxbidder access these, but we can't express that yet: */
456     {NSC_XCOORD, NSC_DEITY, 0, fldoff(comstr, com_x), "xbuy", EF_BAD},
457     {NSC_XCOORD, NSC_DEITY, 0, fldoff(comstr, com_y), "ybuy", EF_BAD},
458     /* could let the owner access these, but we can't express that yet: */
459     {NSC_XCOORD, NSC_DEITY, 0, fldoff(comstr, sell_x), "xsell", EF_BAD},
460     {NSC_YCOORD, NSC_DEITY, 0, fldoff(comstr, sell_y), "ysell", EF_BAD},
461     {NSC_FLOAT, 0, 0, fldoff(comstr, com_price), "price", EF_BAD},
462     {NSC_NOTYPE, 0, 0, 0, NULL, EF_BAD}
463 };
464
465 struct castr trade_ca[] = {
466     {NSC_SHORT, 0, 0, fldoff(trdstr, trd_uid), "uid", EF_TRADE},
467     {NSC_NATID, 0, 0, fldoff(trdstr, trd_owner), "owner", EF_NATION},
468     {NSC_CHAR, 0, 0, fldoff(trdstr, trd_type), "type", EF_BAD},
469     {NSC_SHORT, 0, 0, fldoff(trdstr, trd_unitid), "unitid", EF_BAD},
470     {NSC_LONG, 0, 0, fldoff(trdstr, trd_price), "price", EF_BAD},
471     {NSC_INT, 0, 0, fldoff(trdstr, trd_maxbidder), "maxbidder", EF_NATION},
472     {NSC_TIME, 0, 0, fldoff(trdstr, trd_markettime), "markettime", EF_BAD},
473     /* could let the owner access these, but we can't express that yet: */
474     {NSC_XCOORD, NSC_DEITY, 0, fldoff(trdstr, trd_x), "xloc", EF_BAD},
475     {NSC_YCOORD, NSC_DEITY, 0, fldoff(trdstr, trd_y), "yloc", EF_BAD},
476     {NSC_NOTYPE, 0, 0, 0, NULL, EF_BAD}
477 };
478
479 struct castr nat_ca[] = {
480     {NSC_NATID, 0, 0, fldoff(natstr, nat_cnum), "cnum", EF_NATION},
481     {NSC_CHAR, NSC_BITS, 0, fldoff(natstr, nat_stat), "stat", EF_BAD},
482     {NSC_STRINGY, 0, 20, fldoff(natstr, nat_cnam), "cname", EF_BAD},
483     {NSC_STRINGY, NSC_DEITY, 20, fldoff(natstr, nat_pnam), "passwd", EF_BAD},
484     {NSC_STRINGY, 0, 32, fldoff(natstr, nat_hostaddr), "ip", EF_BAD},
485     {NSC_STRINGY, 0, 512, fldoff(natstr, nat_hostname), "hostname", EF_BAD},
486     {NSC_STRINGY, 0, 32, fldoff(natstr, nat_userid), "userid", EF_BAD},
487     {NSC_XCOORD, 0, 0, fldoff(natstr, nat_xstart), "xstart", EF_BAD},
488     {NSC_YCOORD, 0, 0, fldoff(natstr, nat_ystart), "ystart", EF_BAD},
489     {NSC_XCOORD, 0, 0, fldoff(natstr, nat_xcap), "xcap", EF_BAD},
490     {NSC_YCOORD, 0, 0, fldoff(natstr, nat_ycap), "ycap", EF_BAD},
491     {NSC_XCOORD, NSC_DEITY, 0, fldoff(natstr, nat_xorg), "xorg", EF_BAD},
492     {NSC_YCOORD, NSC_DEITY, 0, fldoff(natstr, nat_yorg), "yorg", EF_BAD},
493     {NSC_CHAR, 0, 0, fldoff(natstr, nat_update), "update", EF_BAD},
494     {NSC_UCHAR, 0, 0, fldoff(natstr, nat_missed), "missed", EF_BAD},
495     {NSC_USHORT, 0, 0, fldoff(natstr, nat_tgms), "tgms", EF_BAD},
496     {NSC_USHORT, 0, 0, fldoff(natstr, nat_ann), "ann", EF_BAD},
497     {NSC_USHORT, 0, 0, fldoff(natstr, nat_minused), "minused", EF_BAD},
498     {NSC_SHORT, 0, 0, fldoff(natstr, nat_btu), "btu", EF_BAD},
499     {NSC_LONG, 0, 0, fldoff(natstr, nat_reserve), "milreserve", EF_BAD},
500     {NSC_LONG, 0, 0, fldoff(natstr, nat_money), "money", EF_BAD},
501     {NSC_TIME, 0, 0, fldoff(natstr, nat_last_login), "login", EF_BAD},
502     {NSC_TIME, 0, 0, fldoff(natstr, nat_last_logout), "logout", EF_BAD},
503     {NSC_TIME, 0, 0, fldoff(natstr, nat_newstim), "newstim", EF_BAD},
504     {NSC_TIME, 0, 0, fldoff(natstr, nat_annotim), "annotim", EF_BAD},
505     {NSC_FLOAT, 0, 0, fldoff(natstr, nat_level[NAT_TLEV]), "tech", EF_BAD},
506     {NSC_FLOAT, 0, 0, fldoff(natstr, nat_level[NAT_RLEV]), "research", EF_BAD},
507     {NSC_FLOAT, 0, 0, fldoff(natstr, nat_level[NAT_ELEV]), "education",
508      EF_BAD},
509     {NSC_FLOAT, 0, 0, fldoff(natstr, nat_level[NAT_HLEV]), "happiness",
510      EF_BAD},
511     /* FIXME nat_b[], nat_rejects[], nat_priorities[] */
512     {NSC_UCHAR, NSC_DEITY, MAXNOC, fldoff(natstr, nat_contact), "contacts",
513      EF_BAD},
514     {NSC_SHORT, 0, MAXNOC, fldoff(natstr, nat_relate), "relations",
515      EF_NATION_RELATIONS},
516     {NSC_LONG, NSC_BITS, 0, fldoff(natstr, nat_flags),"flags",
517      EF_NATION_FLAGS},
518     {NSC_NOTYPE, 0, 0, 0, NULL, EF_BAD}
519 };
520
521 struct castr intrchr_ca[] = {
522     {NSC_STRING, NSC_CONST, 0, offsetof(struct sctintrins, in_name), "name",
523      EF_BAD},
524     {NSC_UCHAR, 0, 0, offsetof(struct sctintrins, in_lcms), "lcms", EF_BAD},
525     {NSC_UCHAR, 0, 0, offsetof(struct sctintrins, in_hcms), "hcms", EF_BAD},
526     {NSC_UCHAR, 0, 0, offsetof(struct sctintrins, in_dcost), "dcost", EF_BAD},
527     {NSC_UCHAR, 0, 0, offsetof(struct sctintrins, in_mcost), "mcost", EF_BAD},
528     {NSC_NOTYPE, 0, 0, 0, NULL, EF_BAD}
529 };
530
531 struct castr rpt_ca[] = {
532     {NSC_CHAR, 0, 0, offsetof(struct rptstr, r_uid), "uid", EF_NEWS_CHR},
533     {NSC_STRING, 0, NUM_RPTS, offsetof(struct rptstr, r_newstory), "newstory",
534      EF_BAD},
535     {NSC_INT, 0, 0, offsetof(struct rptstr, r_good_will), "good_will", EF_BAD},
536     {NSC_INT, 0, 0, offsetof(struct rptstr, r_newspage), "newspage", EF_BAD},
537     {NSC_NOTYPE, 0, 0, 0, NULL, EF_BAD}
538 };
539
540 struct castr empfile_ca[] = {
541     {NSC_INT, 0, 0, offsetof(struct empfile, uid), "uid", EF_TABLE},
542     {NSC_STRING, 0, 0, offsetof(struct empfile, name), "name", EF_BAD},
543     {NSC_NOTYPE, 0, 0, 0, NULL, EF_BAD}
544 };
545
546 struct castr symbol_ca[] = {
547     {NSC_INT, 0, 0, offsetof(struct symbol, value), "value", EF_BAD},
548     {NSC_STRING, 0, 0, offsetof(struct symbol, name), "name", EF_BAD},
549     {NSC_NOTYPE, 0, 0, 0, NULL, EF_BAD}
550 };
551
552 struct symbol ship_chr_flags[] = {
553     {M_FOOD, "fish"},
554     {M_TORP, "torp"},
555     {M_DCH, "dchrg"},
556     {M_FLY, "plane"},
557     {M_MSL, "miss"},
558     {M_OIL, "oil"},
559     {M_SONAR, "sonar"},
560     {M_MINE, "mine"},
561     {M_SWEEP, "sweep"},
562     {M_SUB, "sub"},
563     {M_SPY, "spy"},
564     {M_LAND, "land"},
565     {M_SUBT, "sub-torp"},
566     {M_TRADE, "trade"},
567     {M_SEMILAND, "semi-land"},
568     {M_XLIGHT, "xlight"},
569     {M_CHOPPER, "chopper"},
570     {M_OILER, "oiler"},
571     {M_SUPPLY, "supply"},
572     {M_UNIT, "unit"},
573     {M_ANTIMISSILE, "anti-missile"},
574     {0, NULL}
575 };
576
577 struct symbol land_chr_flags[] = {
578     {L_XLIGHT, "xlight"},
579     {L_ENGINEER, "engineer"},
580     {L_SUPPLY, "supply"},
581     {L_SECURITY, "security"},
582     {L_LIGHT, "light"},
583     {L_MARINE, "marine"},
584     {L_RECON, "recon"},
585     {L_RADAR, "radar"},
586     {L_ASSAULT, "assault"},
587     {L_FLAK, "flak"},
588     {L_SPY, "spy"},
589     {L_TRAIN, "train"},
590     {L_HEAVY, "heavy"},
591     {0, NULL}
592 };
593
594 struct symbol plane_chr_flags[] = {
595     {P_T, "tactical"},
596     {P_B, "bomber"},
597     {P_F, "intercept"},
598     {P_C, "cargo"},
599     {P_V, "VTOL"},
600     {P_M, "missile"},
601     {P_L, "light"},
602     {P_S, "spy"},
603     {P_I, "image"},
604     {P_O, "satellite"},
605     {P_X, "stealth"},
606     {P_N, "SDI"},
607     {P_H, "half-stealth"},
608     {P_E, "x-light"},
609     {P_K, "helo"},
610     {P_A, "ASW"},
611     {P_P, "para"},
612     {P_ESC, "escort"},
613     {P_MINE, "mine"},
614     {P_SWEEP, "sweep"},
615     {P_MAR, "marine"},
616     {0, NULL}
617 };
618
619 struct symbol nuke_chr_flags[] = {
620     {N_NEUT, "neutron"},
621     {0, NULL}
622 };
623
624 struct castr mdchr_ca[] = {
625     {NSC_STRING, 0, 0, offsetof(struct castr, ca_name), "name", EF_BAD},
626     {NSC_CHAR, 0, 0, offsetof(struct castr, ca_type), "type", EF_META_TYPE},
627     {NSC_UCHAR, NSC_BITS, 0, offsetof(struct castr, ca_flags), "flags",
628      EF_META_FLAGS},
629     {NSC_USHORT, 0, 0, offsetof(struct castr, ca_len), "len", EF_BAD},
630     {NSC_INT, 0, 0, offsetof(struct castr, ca_table), "table", EF_BAD},
631     {NSC_NOTYPE, 0, 0, 0, NULL, EF_BAD}
632 };
633
634 struct symbol meta_flags[] = {
635     {NSC_DEITY, "deity"},
636     {NSC_EXTRA, "extra"},
637     {NSC_CONST, "const"},
638     {NSC_BITS, "bits"},
639     {0, NULL}
640 };
641
642 struct symbol meta_type[]  = {
643     {NSC_LONG, "d"},
644     {NSC_DOUBLE, "g"},
645     {NSC_STRING, "s"},
646     {NSC_TYPEID, "d"},
647     {NSC_CHAR, "d"},
648     {NSC_UCHAR, "d"},
649     {NSC_SHORT, "d"},
650     {NSC_USHORT, "d"},
651     {NSC_INT, "d"},
652     {NSC_XCOORD, "d"},
653     {NSC_YCOORD, "d"},
654     {NSC_TIME, "t"},
655     {NSC_FLOAT, "g"},
656     {NSC_STRINGY,"c"},
657     {NSC_NOTYPE, NULL}
658 };
659
660 struct symbol missions[] = {
661     {MI_INTERDICT, "interdiction"},
662     {MI_SUPPORT, "support"},
663     {MI_RESERVE, "reserve"},
664     {MI_ESCORT, "escort"},
665     {MI_AIR_DEFENSE, "air defense"},
666     {MI_DSUPPORT, "defensive support"},
667     {MI_OSUPPORT, "offensive support"},
668     {0, NULL}
669 };
670
671 struct symbol plane_flags[] = {
672     {PLN_LAUNCHED, "launched"},
673     {PLN_SYNCHRONOUS, "synchronous"},
674     {PLN_AIRBURST, "airbust"},
675     {0, NULL}
676 };
677
678 struct symbol retreat_flags[] = {
679     {RET_GROUP, "group"},
680     {RET_INJURED, "injured"},
681     {RET_TORPED, "torped"},
682     {RET_SONARED, "sonared"},
683     {RET_HELPLESS, "helpless"},
684     {RET_BOMBED, "bombed"},
685     {RET_DCHRGED, "depth-charged"},
686     {RET_BOARDED, "boarded"},
687     {0, NULL}
688 };
689
690 struct symbol nation_flags[] = {
691     {NF_INFORM, "inform"},
692     {NF_FLASH, "flash"},
693     {NF_BEEP, "beep"},
694     {NF_COASTWATCH, "coastwatch"},
695     {NF_SONAR, "sonar"},
696     {NF_TECHLISTS, "techlists"},
697     {NF_SACKED, "sacked"},
698     {0, NULL}
699 };
700
701 struct symbol nation_relations[] = {
702     {AT_WAR, "at-war"},
703     {SITZKRIEG, "sitzkrieg"},
704     {MOBILIZATION, "mobilization"},
705     {HOSTILE, "hostile"},
706     {NEUTRAL, "neutral"},
707     {FRIENDLY, "friendly"},
708     {ALLIED, "allied"},
709     {0, NULL}
710 };
711
712 struct symbol level[] = {
713     {NAT_TLEV, "technology"},
714     {NAT_RLEV, "research"},
715     {NAT_ELEV, "education"},
716     {NAT_HLEV, "happiness"},
717     {0, NULL}
718 };
719
720 struct symbol agreement_statuses[] = {
721     {AGREE_FREE, "free"},
722     {AGREE_PROPOSED, "proposed"},
723     {AGREE_SIGNED, "signed"},
724     {0, NULL}
725 };
726
727 struct symbol plague_stages[] = {
728     {PLG_HEALTHY, "healthy"},
729     {PLG_DYING, "dying"},
730     {PLG_INFECT, "infect"},
731     {PLG_INCUBATE, "incubate"},
732     {PLG_EXPOSED, "exposed"},
733     {0, NULL}
734 };
735
736 struct symbol packing[] = {
737     {IPKG, "inefficient"},
738     {NPKG, "normal"},
739     {WPKG, "warehouse"},
740     {UPKG, "urban"},
741     {BPKG, "bank"},
742     {0, NULL}
743 };