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