diff --git a/doc/xdump b/doc/xdump index 51f4fc9a..6b1d25b8 100644 --- a/doc/xdump +++ b/doc/xdump @@ -256,8 +256,6 @@ of xdump meta T are: * flags: The field's flags, a symbol set. Flags are: - "deity", field visible only to deities - - "extra", field not to be dumped - - "const", field cannot be changed - "bits", field is a symbol set, field type must encode symbol "d", field table must not be -1. - "hidden", field value is masked for contact when option HIDDEN is @@ -298,8 +296,8 @@ in other places as well: for another table (new struct castr member ca_table). The selector code doesn't use that, yet. -* Selector flag NSC_EXTRA to flag redundant selectors, so that xdump - can ignore them. +* Redundant selectors can be marked so that xdump ignores them (new + struct castr member ca_dump). Meta-data is in empfile[] (table meta-data), src/lib/global/nsc.c (selector meta-data), src/lib/global/symbol.c (symbol tables). The @@ -313,12 +311,12 @@ its meta-data, and to make sense of that table, we need meta-meta data. So we start with that: [3:640] Command : xdump meta meta - XDUMP meta meta 1464537892 - "name" 3 4 0 -1 - "type" 8 4 0 33 - "flags" 8 12 0 32 - "len" 7 4 0 -1 - "table" 8 4 0 26 + XDUMP meta meta 1464554085 + "name" 3 0 0 -1 + "type" 8 0 0 33 + "flags" 8 8 0 32 + "len" 7 0 0 -1 + "table" 8 0 0 26 /5 To interpret this table, we have to know the field names and their @@ -342,9 +340,9 @@ know, namely the table of tables. Let's dump that next, starting with its meta-data: [3:640] Command : xdump meta table - XDUMP meta table 1464537892 + XDUMP meta table 1464554085 "uid" 8 0 0 26 - "name" 3 4 0 -1 + "name" 3 0 0 -1 /2 Because xdump table is referenced from elsewhere (xdump meta meta @@ -354,7 +352,7 @@ table itself. Indeed, its value matches the one we got in xdump meta meta. Let's try to dump the table: [5:640] Command : xdump 26 * - XDUMP table 1464537892 + XDUMP table 1464554085 0 "sect" 1 "ship" [...] @@ -373,13 +371,14 @@ Now dump the two symbol tables we postponed. Because xdump accepts table IDs as well as names, we don't have to know their names: [5:640] Command : xdump meta 33 - XDUMP meta meta-type 1464537892 - "value" 8 4 0 -1 - "name" 3 4 0 -1 + xdump meta 33 + XDUMP meta meta-type 1464554085 + "value" 8 0 0 -1 + "name" 3 0 0 -1 /2 [6:640] Command : xdump 33 * - XDUMP meta-type 1464537892 + XDUMP meta-type 1464554085 1 "d" 2 "g" 3 "s" @@ -396,19 +395,17 @@ table IDs as well as names, we don't have to know their names: /13 [7:640] Command : xdump meta 32 - XDUMP meta meta-flags 1464537892 - "value" 8 4 0 -1 - "name" 3 4 0 -1 + XDUMP meta meta-flags 1464554085 + "value" 8 0 0 -1 + "name" 3 0 0 -1 /2 [7:640] Command : xdump 32 * - XDUMP meta-flags 1464537892 + XDUMP meta-flags 1464554085 1 "deity" - 2 "extra" - 4 "const" 8 "bits" 16 "hidden" - /5 + /3 We now have complete meta-meta information: @@ -424,10 +421,10 @@ Dumping the remaining tables is easy: just walk the table of tables. Here's the first one: [7:640] Command : xdump meta 0 - XDUMP meta sect 1464537892 + XDUMP meta sect 1464554085 "owner" 5 0 0 8 - "xloc" 9 4 0 -1 - "yloc" 10 4 0 -1 + "xloc" 9 0 0 -1 + "yloc" 10 0 0 -1 "des" 4 0 0 18 [...] /78 @@ -621,8 +618,9 @@ symbol table packing. Configuration tables contain values that are not meant to be customized. For instance, meta-data and symbol tables reflect the -encoding of C language constructs in the server. Selector flag -NSC_CONST marks them, so that the code can prohibit changes. +encoding of C language constructs in the server. Such selectors are +marked (struct castr member ca_dump), so that the code can prohibit +changes. All tables are checked against meta-data on server startup by ef_verify(). More elaborate checking would be nice, and probably diff --git a/include/nsc.h b/include/nsc.h index 133c861e..2a0aee68 100644 --- a/include/nsc.h +++ b/include/nsc.h @@ -28,7 +28,7 @@ * * Known contributors to this file: * Dave Pare, 1989 - * Markus Armbruster, 2004-2015 + * Markus Armbruster, 2004-2016 */ #ifndef NSC_H @@ -192,12 +192,18 @@ struct symbol { /* Selector flags */ enum { NSC_DEITY = bit(0), /* access restricted to deity */ - NSC_EXTRA = bit(1), /* computable from other selectors */ - NSC_CONST = bit(2), /* field cannot be changed */ NSC_BITS = bit(3), /* value consists of flag bits */ NSC_HIDDEN = bit(4) /* visibility depends on contact */ }; +/* Selector use by xdump and xundump */ +enum ca_dump { + /* order is relevant */ + CA_DUMP, /* xdump and xundump normally */ + CA_DUMP_CONST, /* same, but value can't be changed */ + CA_DUMP_NONE /* do not xdump or xundump */ +}; + /* * Selector descriptor * @@ -217,19 +223,18 @@ enum { * access control (null for none), and CTXO is the context object. * See struct valstr for details. * Because virtual selectors don't have a setter method, xundump must - * be made to ignore them, by setting NSC_EXTRA. - * If flag NSC_DEITY is set, only deities can use this selector. - * If flag NSC_EXTRA is set, xdump and xundump ignore this selector. - * If flag NSC_CONST is set, the datum can't be changed from its - * initial value (xundump obeys that). - * If flag NSC_HIDDEN is set, the selector must be an array of MAXNOC - * elements, indexed by country number, and the context object must be - * EF_NATION. Array elements are masked for contact when opt_HIDDEN - * is on. + * be made to ignore them, by setting @ca_dump to CA_DUMP_NONE. * If @ca_table is not EF_BAD, the datum refers to that Empire table; - * @ca_type must be an integer type. If flag NSC_BITS is set, the - * datum consists of flag bits, and the referred table must be a - * symbol table defining those bits. + * @ca_type must be an integer type. + * If NSC_BITS is set in @ca_flags, the datum consists of flag bits, + * and the referred table must be a symbol table defining those bits. + * If NSC_DEITY is set in @ca_flags, only deities can use this + * selector. + * If NSC_HIDDEN is set in @ca_flags, the selector must be an array of + * MAXNOC elements, indexed by country number, and the context object + * must be EF_NATION. Array elements are masked for contact when + * opt_HIDDEN is on. + * @ca_dump specifies how xdump and xundump are to use the selector. */ struct castr { char *ca_name; @@ -239,6 +244,7 @@ struct castr { void *(*ca_get)(struct valstr *, struct natstr *, void *); int ca_table; int ca_flags; + enum ca_dump ca_dump; }; /* Is CA an array? */ diff --git a/src/lib/commands/xdump.c b/src/lib/commands/xdump.c index f3662f61..f71f2a57 100644 --- a/src/lib/commands/xdump.c +++ b/src/lib/commands/xdump.c @@ -27,7 +27,7 @@ * xdump.c: Extended dump * * Known contributors to this file: - * Markus Armbruster, 2004-2014 + * Markus Armbruster, 2004-2016 */ #include @@ -118,7 +118,7 @@ xdmeta(struct xdstr *xd, int type) for (i = 0; ca[i].ca_name; i++) { if (ca[i].ca_flags & NSC_DEITY && !xd->divine) continue; - if (ca[i].ca_flags & NSC_EXTRA) + if (ca[i].ca_dump == CA_DUMP_NONE) continue; xdflds(xd, mdchr_ca, &ca[i]); xd->pr("\n"); diff --git a/src/lib/common/ef_verify.c b/src/lib/common/ef_verify.c index cc2793f4..eb982434 100644 --- a/src/lib/common/ef_verify.c +++ b/src/lib/common/ef_verify.c @@ -28,7 +28,7 @@ * * Known contributors to this file: * Ron Koenderink, 2005 - * Markus Armbruster, 2006-2015 + * Markus Armbruster, 2006-2016 */ #include @@ -74,13 +74,14 @@ verify_ca(int type) for (i = 0; ca[i].ca_name; i++) { /* - * Virtual selectors must be NSC_EXTRA, because xundump can't - * cope with them without setter methods. Exception: if - * EFF_MEM is not set, xundump doesn't touch the table. + * Virtual selectors can't be used in xundump, since we lack a + * setter to go with ca_get(). Exception: if EFF_MEM is not + * set, xundump doesn't touch the table. */ if (CANT_HAPPEN((ef_flags(type) & EFF_MEM) - && ca[i].ca_get && !(ca[i].ca_flags & NSC_EXTRA))) - ca[i].ca_flags |= NSC_EXTRA; + && ca[i].ca_get + && ca[i].ca_dump <= CA_DUMP_CONST)) + ca[i].ca_dump = CA_DUMP_NONE; } return 0; } diff --git a/src/lib/common/nsc.c b/src/lib/common/nsc.c index e80f363c..f8936bad 100644 --- a/src/lib/common/nsc.c +++ b/src/lib/common/nsc.c @@ -76,7 +76,7 @@ static void *nsc_nws_timestamp(struct valstr *, struct natstr *, void *); #define NSC_IELT(name, pfx, sfx, base, itype) \ {sizeof(sfx) == 1 ? name : pfx sfx, \ ((base) + (itype)*sizeof(short)), \ - NSC_SHORT, 0, NULL, EF_BAD, 0} + NSC_SHORT, 0, NULL, EF_BAD, 0, CA_DUMP} #define NSC_IVEC(base, sfx) \ NSC_IELT("civil", "c", sfx, base, I_CIVIL), \ @@ -96,36 +96,41 @@ NSC_IELT("rad", "r", sfx, base, I_RAD) struct castr ichr_ca[] = { #define CURSTR struct ichrstr - {"uid", fldoff(i_uid), NSC_SITYPE(i_type), 0, NULL, EF_ITEM, 0}, - {"name", fldoff(i_name), NSC_STRING, 0, NULL, EF_BAD, 0}, - {"mnem", fldoff(i_mnem), NSC_STRINGY, 1, NULL, EF_BAD, NSC_CONST}, - {"power", fldoff(i_power), NSC_INT, 0, NULL, EF_BAD, 0}, - {"value", fldoff(i_value), NSC_INT, 0, NULL, EF_BAD, 0}, - {"sell", fldoff(i_sell), NSC_INT, 0, NULL, EF_BAD, 0}, - {"lbs", fldoff(i_lbs), NSC_INT, 0, NULL, EF_BAD, 0}, - {"pkg", fldoff(i_pkg), NSC_INT, NUMPKG, NULL, EF_BAD, 0}, - {"melt_denom", fldoff(i_melt_denom), NSC_INT, 0, NULL, EF_BAD, 0}, - {NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0} + {"uid", fldoff(i_uid), NSC_SITYPE(i_type), 0, NULL, EF_ITEM, 0, + CA_DUMP}, + {"name", fldoff(i_name), NSC_STRING, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"mnem", fldoff(i_mnem), NSC_STRINGY, 1, NULL, EF_BAD, 0, + CA_DUMP_CONST}, + {"power", fldoff(i_power), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"value", fldoff(i_value), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"sell", fldoff(i_sell), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"lbs", fldoff(i_lbs), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"pkg", fldoff(i_pkg), NSC_INT, NUMPKG, NULL, EF_BAD, 0, CA_DUMP}, + {"melt_denom", fldoff(i_melt_denom), NSC_INT, 0, NULL, EF_BAD, 0, + CA_DUMP}, + {NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0, CA_DUMP} #undef CURSTR }; struct castr pchr_ca[] = { #define CURSTR struct pchrstr - {"uid", fldoff(p_uid), NSC_INT, 0, NULL, EF_PRODUCT, 0}, - {"name", fldoff(p_name), NSC_STRING, 0, NULL, EF_BAD, 0}, - {"sname", fldoff(p_sname), NSC_STRING, 0, NULL, EF_BAD, 0}, + {"uid", fldoff(p_uid), NSC_INT, 0, NULL, EF_PRODUCT, 0, CA_DUMP}, + {"name", fldoff(p_name), NSC_STRING, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"sname", fldoff(p_sname), NSC_STRING, 0, NULL, EF_BAD, 0, CA_DUMP}, {"ctype", fldoff(p_ctype), NSC_SITYPE(i_type), MAXPRCON, NULL, - EF_ITEM, 0}, - {"camt", fldoff(p_camt), NSC_USHORT, MAXPRCON, NULL, EF_BAD, 0}, - {"type", fldoff(p_type), NSC_SITYPE(i_type), 0, NULL, EF_ITEM, 0}, - {"level", fldoff(p_level), NSC_INT, 0, NULL, EF_LEVEL, 0}, - {"cost", fldoff(p_cost), NSC_INT, 0, NULL, EF_BAD, 0}, - {"nrndx", fldoff(p_nrndx), NSC_INT, 0, NULL, EF_RESOURCES, 0}, - {"nrdep", fldoff(p_nrdep), NSC_INT, 0, NULL, EF_BAD, 0}, - {"nlndx", fldoff(p_nlndx), NSC_INT, 0, NULL, EF_LEVEL, 0}, - {"nlmin", fldoff(p_nlmin), NSC_INT, 0, NULL, EF_BAD, 0}, - {"nllag", fldoff(p_nllag), NSC_INT, 0, NULL, EF_BAD, 0}, - {NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0} + EF_ITEM, 0, CA_DUMP}, + {"camt", fldoff(p_camt), NSC_USHORT, MAXPRCON, NULL, EF_BAD, 0, + CA_DUMP}, + {"type", fldoff(p_type), NSC_SITYPE(i_type), 0, NULL, EF_ITEM, 0, + CA_DUMP}, + {"level", fldoff(p_level), NSC_INT, 0, NULL, EF_LEVEL, 0, CA_DUMP}, + {"cost", fldoff(p_cost), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"nrndx", fldoff(p_nrndx), NSC_INT, 0, NULL, EF_RESOURCES, 0, CA_DUMP}, + {"nrdep", fldoff(p_nrdep), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"nlndx", fldoff(p_nlndx), NSC_INT, 0, NULL, EF_LEVEL, 0, CA_DUMP}, + {"nlmin", fldoff(p_nlmin), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"nllag", fldoff(p_nllag), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0, CA_DUMP} #undef CURSTR }; @@ -133,324 +138,367 @@ struct castr sect_ca[] = { #define CURSTR struct sctstr /* uid needs to be NSC_DEITY because it discloses true origin */ {"uid", fldoff(sct_uid), NSC_INT, 0, NULL, - EF_SECTOR, NSC_DEITY | NSC_EXTRA}, + EF_SECTOR, NSC_DEITY, CA_DUMP_NONE}, {"timestamp", fldoff(sct_timestamp), NSC_TIME, 0, NULL, - EF_BAD, NSC_EXTRA}, - {"owner", fldoff(sct_own), NSC_NATID, 0, NULL, EF_NATION, 0}, - {"xloc", fldoff(sct_x), NSC_XCOORD, 0, NULL, EF_BAD, NSC_CONST}, - {"yloc", fldoff(sct_y), NSC_YCOORD, 0, NULL, EF_BAD, NSC_CONST}, - {"des", fldoff(sct_type), NSC_CHAR, 0, NULL, EF_SECTOR_CHR, 0}, - {"effic", fldoff(sct_effic), NSC_CHAR, 0, NULL, EF_BAD, 0}, - {"mobil", fldoff(sct_mobil), NSC_CHAR, 0, NULL, EF_BAD, 0}, - {"off", fldoff(sct_off), NSC_UCHAR, 0, NULL, EF_BAD, 0}, - {"loyal", fldoff(sct_loyal), NSC_UCHAR, 0, NULL, EF_BAD, NSC_DEITY}, - {"terr", 0, NSC_UCHAR, 0, nsc_sct_terr, EF_BAD, NSC_EXTRA}, - {"terr0", fldoff(sct_terr), NSC_UCHAR, 0, NULL, EF_BAD, 0}, - {"terr1", fldoff(sct_terr1), NSC_UCHAR, 0, NULL, EF_BAD, 0}, - {"terr2", fldoff(sct_terr2), NSC_UCHAR, 0, NULL, EF_BAD, 0}, - {"terr3", fldoff(sct_terr3), NSC_UCHAR, 0, NULL, EF_BAD, 0}, - {"dterr", fldoff(sct_dterr), NSC_UCHAR, 0, NULL, EF_BAD, NSC_DEITY}, - {"xdist", fldoff(sct_dist_x), NSC_XCOORD, 0, NULL, EF_BAD, 0}, - {"ydist", fldoff(sct_dist_y), NSC_YCOORD, 0, NULL, EF_BAD, 0}, - {"avail", fldoff(sct_avail), NSC_SHORT, 0, NULL, EF_BAD, 0}, - {"elev", fldoff(sct_elev), NSC_SHORT, 0, NULL, EF_BAD, NSC_DEITY}, - {"work", fldoff(sct_work), NSC_UCHAR, 0, NULL, EF_BAD, 0}, - {"coastal", fldoff(sct_coastal), NSC_UCHAR, 0, NULL, EF_BAD, 0}, - {"newdes", fldoff(sct_newtype), NSC_CHAR, 0, NULL, EF_SECTOR_CHR, 0}, - {"min", fldoff(sct_min), NSC_UCHAR, 0, NULL, EF_BAD, 0}, - {"gold", fldoff(sct_gmin), NSC_UCHAR, 0, NULL, EF_BAD, 0}, - {"fert", fldoff(sct_fertil), NSC_UCHAR, 0, NULL, EF_BAD, 0}, - {"ocontent", fldoff(sct_oil), NSC_UCHAR, 0, NULL, EF_BAD, 0}, - {"uran", fldoff(sct_uran), NSC_UCHAR, 0, NULL, EF_BAD, 0}, - {"oldown", fldoff(sct_oldown), NSC_NATID, 0, NULL, EF_NATION, 0}, - {"track", 0, NSC_LONG, 0, nsc_sct_track, EF_BAD, NSC_EXTRA}, + EF_BAD, 0, CA_DUMP_NONE}, + {"owner", fldoff(sct_own), NSC_NATID, 0, NULL, EF_NATION, 0, CA_DUMP}, + {"xloc", fldoff(sct_x), NSC_XCOORD, 0, NULL, EF_BAD, 0, CA_DUMP_CONST}, + {"yloc", fldoff(sct_y), NSC_YCOORD, 0, NULL, EF_BAD, 0, CA_DUMP_CONST}, + {"des", fldoff(sct_type), NSC_CHAR, 0, NULL, EF_SECTOR_CHR, 0, + CA_DUMP}, + {"effic", fldoff(sct_effic), NSC_CHAR, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"mobil", fldoff(sct_mobil), NSC_CHAR, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"off", fldoff(sct_off), NSC_UCHAR, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"loyal", fldoff(sct_loyal), NSC_UCHAR, 0, NULL, EF_BAD, NSC_DEITY, + CA_DUMP}, + {"terr", 0, NSC_UCHAR, 0, nsc_sct_terr, EF_BAD, 0, CA_DUMP_NONE}, + {"terr0", fldoff(sct_terr), NSC_UCHAR, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"terr1", fldoff(sct_terr1), NSC_UCHAR, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"terr2", fldoff(sct_terr2), NSC_UCHAR, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"terr3", fldoff(sct_terr3), NSC_UCHAR, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"dterr", fldoff(sct_dterr), NSC_UCHAR, 0, NULL, EF_BAD, NSC_DEITY, + CA_DUMP}, + {"xdist", fldoff(sct_dist_x), NSC_XCOORD, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"ydist", fldoff(sct_dist_y), NSC_YCOORD, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"avail", fldoff(sct_avail), NSC_SHORT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"elev", fldoff(sct_elev), NSC_SHORT, 0, NULL, EF_BAD, NSC_DEITY, + CA_DUMP}, + {"work", fldoff(sct_work), NSC_UCHAR, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"coastal", fldoff(sct_coastal), NSC_UCHAR, 0, NULL, EF_BAD, 0, + CA_DUMP}, + {"newdes", fldoff(sct_newtype), NSC_CHAR, 0, NULL, EF_SECTOR_CHR, 0, + CA_DUMP}, + {"min", fldoff(sct_min), NSC_UCHAR, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"gold", fldoff(sct_gmin), NSC_UCHAR, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"fert", fldoff(sct_fertil), NSC_UCHAR, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"ocontent", fldoff(sct_oil), NSC_UCHAR, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"uran", fldoff(sct_uran), NSC_UCHAR, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"oldown", fldoff(sct_oldown), NSC_NATID, 0, NULL, EF_NATION, 0, + CA_DUMP}, + {"track", 0, NSC_LONG, 0, nsc_sct_track, EF_BAD, 0, CA_DUMP_NONE}, NSC_IVEC(fldoff(sct_item), ""), NSC_IVEC(fldoff(sct_dist), "_dist"), NSC_IVEC(fldoff(sct_del), "_del"), /* should let old owner access mines, but can't express that: */ - {"mines", fldoff(sct_mines), NSC_SHORT, 0, NULL, EF_BAD, NSC_DEITY}, + {"mines", fldoff(sct_mines), NSC_SHORT, 0, NULL, EF_BAD, NSC_DEITY, + CA_DUMP}, {"pstage", fldoff(sct_pstage), NSC_SHORT, 0, NULL, - EF_PLAGUE_STAGES, NSC_DEITY}, - {"ptime", fldoff(sct_ptime), NSC_SHORT, 0, NULL, EF_BAD, NSC_DEITY}, - {"che", fldoff(sct_che), NSC_UCHAR, 0, NULL, EF_BAD, NSC_DEITY}, + EF_PLAGUE_STAGES, NSC_DEITY, CA_DUMP}, + {"ptime", fldoff(sct_ptime), NSC_SHORT, 0, NULL, EF_BAD, NSC_DEITY, + CA_DUMP}, + {"che", fldoff(sct_che), NSC_UCHAR, 0, NULL, EF_BAD, NSC_DEITY, + CA_DUMP}, {"che_target", fldoff(sct_che_target), NSC_NATID, 0, NULL, - EF_NATION, NSC_DEITY}, - {"fallout", fldoff(sct_fallout), NSC_USHORT, 0, NULL, EF_BAD, 0}, - {"access", fldoff(sct_access), NSC_SHORT, 0, NULL, EF_BAD, 0}, - {"road", fldoff(sct_road), NSC_UCHAR, 0, NULL, EF_BAD, 0}, - {"rail", fldoff(sct_rail), NSC_UCHAR, 0, NULL, EF_BAD, 0}, - {"dfense", fldoff(sct_defense), NSC_UCHAR, 0, NULL, EF_BAD, 0}, - {NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0} + EF_NATION, NSC_DEITY, CA_DUMP}, + {"fallout", fldoff(sct_fallout), NSC_USHORT, 0, NULL, EF_BAD, 0, + CA_DUMP}, + {"access", fldoff(sct_access), NSC_SHORT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"road", fldoff(sct_road), NSC_UCHAR, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"rail", fldoff(sct_rail), NSC_UCHAR, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"dfense", fldoff(sct_defense), NSC_UCHAR, 0, NULL, EF_BAD, 0, + CA_DUMP}, + {NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0, CA_DUMP} #undef CURSTR }; struct castr dchr_ca[] = { #define CURSTR struct dchrstr - {"uid", fldoff(d_uid), NSC_UCHAR, 0, NULL, EF_SECTOR_CHR, 0}, - {"name", fldoff(d_name), NSC_STRING, 0, NULL, EF_BAD, 0}, - {"mnem", fldoff(d_mnem), NSC_STRINGY, 1, NULL, EF_BAD, NSC_CONST}, - {"terrain", fldoff(d_terrain), NSC_UCHAR, 0, NULL, EF_SECTOR_CHR, 0}, - {"prd", fldoff(d_prd), NSC_INT, 0, NULL, EF_PRODUCT, 0}, - {"peffic", fldoff(d_peffic), NSC_INT, 0, NULL, EF_BAD, 0}, - {"mob0", fldoff(d_mob0), NSC_FLOAT, 0, NULL, EF_BAD, 0}, - {"mob1", fldoff(d_mob1), NSC_FLOAT, 0, NULL, EF_BAD, 0}, + {"uid", fldoff(d_uid), NSC_UCHAR, 0, NULL, EF_SECTOR_CHR, 0, CA_DUMP}, + {"name", fldoff(d_name), NSC_STRING, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"mnem", fldoff(d_mnem), NSC_STRINGY, 1, NULL, EF_BAD, 0, + CA_DUMP_CONST}, + {"terrain", fldoff(d_terrain), NSC_UCHAR, 0, NULL, EF_SECTOR_CHR, 0, + CA_DUMP}, + {"prd", fldoff(d_prd), NSC_INT, 0, NULL, EF_PRODUCT, 0, CA_DUMP}, + {"peffic", fldoff(d_peffic), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"mob0", fldoff(d_mob0), NSC_FLOAT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"mob1", fldoff(d_mob1), NSC_FLOAT, 0, NULL, EF_BAD, 0, CA_DUMP}, {"nav", fldoff(d_nav), NSC_SITYPE(enum d_navigation), 0, NULL, - EF_SECTOR_NAVIGATION, 0}, + EF_SECTOR_NAVIGATION, 0, CA_DUMP}, {"pkg", fldoff(d_pkg), NSC_SITYPE(enum i_packing), 0, NULL, - EF_PACKING, 0}, - {"ostr", fldoff(d_ostr), NSC_FLOAT, 0, NULL, EF_BAD, 0}, - {"dstr", fldoff(d_dstr), NSC_FLOAT, 0, NULL, EF_BAD, 0}, - {"value", fldoff(d_value), NSC_INT, 0, NULL, EF_BAD, 0}, - {"cost", fldoff(d_cost), NSC_INT, 0, NULL, EF_BAD, 0}, - {"build", fldoff(d_build), NSC_INT, 0, NULL, EF_BAD, 0}, - {"lcms", fldoff(d_lcms), NSC_INT, 0, NULL, EF_BAD, 0}, - {"hcms", fldoff(d_hcms), NSC_INT, 0, NULL, EF_BAD, 0}, - {"maint", fldoff(d_maint), NSC_INT, 0, NULL, EF_BAD, 0}, - {"maxpop", fldoff(d_maxpop), NSC_INT, 0, NULL, EF_BAD, 0}, - {NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0} + EF_PACKING, 0, CA_DUMP}, + {"ostr", fldoff(d_ostr), NSC_FLOAT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"dstr", fldoff(d_dstr), NSC_FLOAT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"value", fldoff(d_value), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"cost", fldoff(d_cost), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"build", fldoff(d_build), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"lcms", fldoff(d_lcms), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"hcms", fldoff(d_hcms), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"maint", fldoff(d_maint), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"maxpop", fldoff(d_maxpop), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0, CA_DUMP} #undef CURSTR }; #define NSC_GENITEM(ef_type, ef_chr) \ - {"uid", empobjoff(uid), NSC_INT, 0, NULL, ef_type, 0}, \ - {"timestamp", empobjoff(timestamp), NSC_TIME, 0, NULL, EF_BAD, NSC_EXTRA}, \ - {"owner", empobjoff(own), NSC_NATID, 0, NULL, EF_NATION, 0}, \ - {"xloc", empobjoff(x), NSC_XCOORD, 0, NULL, EF_BAD, 0}, \ - {"yloc", empobjoff(y), NSC_YCOORD, 0, NULL, EF_BAD, 0}, \ - {"type", empobjoff(type), NSC_CHAR, 0, NULL, ef_chr, 0}, \ - {"effic", empobjoff(effic), NSC_CHAR, 0, NULL, EF_BAD, 0}, \ - {"mobil", empobjoff(mobil), NSC_CHAR , 0, NULL, EF_BAD, 0}, \ - {"off", empobjoff(off), NSC_UCHAR , 0, NULL, EF_BAD, 0}, \ - {"tech", empobjoff(tech), NSC_SHORT, 0, NULL, EF_BAD, 0}, \ - {"group", empobjoff(group), NSC_STRINGY, 1, NULL, EF_BAD, NSC_EXTRA}, \ - {"opx", empobjoff(opx), NSC_XCOORD, 0, NULL, EF_BAD, 0}, \ - {"opy", empobjoff(opy), NSC_YCOORD, 0, NULL, EF_BAD, 0}, \ - {"mission", empobjoff(mission), NSC_SHORT, 0, NULL, EF_MISSIONS, 0}, \ - {"radius", empobjoff(radius), NSC_SHORT, 0, NULL, EF_BAD, 0} + {"uid", empobjoff(uid), NSC_INT, 0, NULL, ef_type, 0, CA_DUMP}, \ + {"timestamp", empobjoff(timestamp), NSC_TIME, 0, NULL, EF_BAD, 0, \ + CA_DUMP_NONE}, \ + {"owner", empobjoff(own), NSC_NATID, 0, NULL, EF_NATION, 0, CA_DUMP}, \ + {"xloc", empobjoff(x), NSC_XCOORD, 0, NULL, EF_BAD, 0, CA_DUMP}, \ + {"yloc", empobjoff(y), NSC_YCOORD, 0, NULL, EF_BAD, 0, CA_DUMP}, \ + {"type", empobjoff(type), NSC_CHAR, 0, NULL, ef_chr, 0, CA_DUMP}, \ + {"effic", empobjoff(effic), NSC_CHAR, 0, NULL, EF_BAD, 0, CA_DUMP}, \ + {"mobil", empobjoff(mobil), NSC_CHAR , 0, NULL, EF_BAD, 0, CA_DUMP}, \ + {"off", empobjoff(off), NSC_UCHAR , 0, NULL, EF_BAD, 0, CA_DUMP}, \ + {"tech", empobjoff(tech), NSC_SHORT, 0, NULL, EF_BAD, 0, CA_DUMP}, \ + {"group", empobjoff(group), NSC_STRINGY, 1, NULL, EF_BAD, 0, \ + CA_DUMP_NONE}, \ + {"opx", empobjoff(opx), NSC_XCOORD, 0, NULL, EF_BAD, 0, CA_DUMP}, \ + {"opy", empobjoff(opy), NSC_YCOORD, 0, NULL, EF_BAD, 0, CA_DUMP}, \ + {"mission", empobjoff(mission), NSC_SHORT, 0, NULL, EF_MISSIONS, 0, \ + CA_DUMP}, \ + {"radius", empobjoff(radius), NSC_SHORT, 0, NULL, EF_BAD, 0, CA_DUMP} struct castr ship_ca[] = { #define CURSTR struct shpstr NSC_GENITEM(EF_SHIP, EF_SHIP_CHR), - {"fleet", fldoff(shp_fleet), NSC_STRINGY, 1, NULL, EF_BAD, 0}, + {"fleet", fldoff(shp_fleet), NSC_STRINGY, 1, NULL, EF_BAD, 0, CA_DUMP}, NSC_IVEC(fldoff(shp_item), ""), {"pstage", fldoff(shp_pstage), NSC_SHORT, 0, NULL, - EF_PLAGUE_STAGES, NSC_DEITY}, - {"ptime", fldoff(shp_ptime), NSC_SHORT, 0, NULL, EF_BAD, NSC_DEITY}, - {"access", fldoff(shp_access), NSC_SHORT, 0, NULL, EF_BAD, 0}, + EF_PLAGUE_STAGES, NSC_DEITY, CA_DUMP}, + {"ptime", fldoff(shp_ptime), NSC_SHORT, 0, NULL, EF_BAD, NSC_DEITY, + CA_DUMP}, + {"access", fldoff(shp_access), NSC_SHORT, 0, NULL, EF_BAD, 0, CA_DUMP}, {"name", fldoff(shp_name), NSC_STRINGY, MAXSHPNAMLEN, NULL, - EF_BAD, 0}, + EF_BAD, 0, CA_DUMP}, /* should let builder access xbuilt, ybuilt, but can't express that: */ {"xbuilt", fldoff(shp_orig_x), NSC_XCOORD, 0, NULL, - EF_BAD, NSC_DEITY}, + EF_BAD, NSC_DEITY, CA_DUMP}, {"ybuilt", fldoff(shp_orig_y), NSC_YCOORD, 0, NULL, - EF_BAD, NSC_DEITY}, + EF_BAD, NSC_DEITY, CA_DUMP}, {"builder", fldoff(shp_orig_own), NSC_NATID, 0, NULL, - EF_NATION, NSC_DEITY}, + EF_NATION, NSC_DEITY, CA_DUMP}, {"rflags", fldoff(shp_rflags), NSC_INT, 0, NULL, - EF_RETREAT_FLAGS, NSC_BITS}, - {"rpath", fldoff(shp_rpath), NSC_STRINGY, RET_LEN, NULL, EF_BAD, 0}, - {"nplane", 0, NSC_LONG, 0, nsc_cargo_nplane, EF_BAD, NSC_EXTRA}, - {"nchoppers", 0, NSC_LONG, 0, nsc_cargo_nchopper, EF_BAD, NSC_EXTRA}, - {"nxlight", 0, NSC_LONG, 0, nsc_cargo_nxlight, EF_BAD, NSC_EXTRA}, - {"nland", 0, NSC_LONG, 0, nsc_cargo_nland, EF_BAD, NSC_EXTRA}, - {NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0} + EF_RETREAT_FLAGS, NSC_BITS, CA_DUMP}, + {"rpath", fldoff(shp_rpath), NSC_STRINGY, RET_LEN, NULL, EF_BAD, 0, + CA_DUMP}, + {"nplane", 0, NSC_LONG, 0, nsc_cargo_nplane, EF_BAD, 0, CA_DUMP_NONE}, + {"nchoppers", 0, NSC_LONG, 0, nsc_cargo_nchopper, EF_BAD, 0, + CA_DUMP_NONE}, + {"nxlight", 0, NSC_LONG, 0, nsc_cargo_nxlight, EF_BAD, 0, + CA_DUMP_NONE}, + {"nland", 0, NSC_LONG, 0, nsc_cargo_nland, EF_BAD, 0, CA_DUMP_NONE}, + {NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0, CA_DUMP} #undef CURSTR }; struct castr mchr_ca[] = { #define CURSTR struct mchrstr - {"type", fldoff(m_type), NSC_CHAR, 0, NULL, EF_SHIP_CHR, 0}, - {"name", fldoff(m_name), NSC_STRING, 0, NULL, EF_BAD, 0}, + {"type", fldoff(m_type), NSC_CHAR, 0, NULL, EF_SHIP_CHR, 0, CA_DUMP}, + {"name", fldoff(m_name), NSC_STRING, 0, NULL, EF_BAD, 0, CA_DUMP}, NSC_IVEC(fldoff(m_item), ""), - {"l_build", fldoff(m_mat[I_LCM]), NSC_SHORT, 0, NULL, EF_BAD, 0}, - {"h_build", fldoff(m_mat[I_HCM]), NSC_SHORT, 0, NULL, EF_BAD, 0}, - {"armor", fldoff(m_armor), NSC_INT, 0, NULL, EF_BAD, 0}, - {"speed", fldoff(m_speed), NSC_INT, 0, NULL, EF_BAD, 0}, - {"visib", fldoff(m_visib), NSC_INT, 0, NULL, EF_BAD, 0}, - {"vrnge", fldoff(m_vrnge), NSC_INT, 0, NULL, EF_BAD, 0}, - {"frnge", fldoff(m_frnge), NSC_INT, 0, NULL, EF_BAD, 0}, - {"glim", fldoff(m_glim), NSC_INT, 0, NULL, EF_BAD, 0}, - {"nxlight", fldoff(m_nxlight), NSC_UCHAR, 0, NULL, EF_BAD, 0}, - {"nchoppers", fldoff(m_nchoppers), NSC_UCHAR, 0, NULL, EF_BAD, 0}, - {"bwork", fldoff(m_bwork), NSC_INT, 0, NULL, EF_BAD, 0}, - {"tech", fldoff(m_tech), NSC_INT, 0, NULL, EF_BAD, 0}, - {"cost", fldoff(m_cost), NSC_INT, 0, NULL, EF_BAD, 0}, + {"l_build", fldoff(m_mat[I_LCM]), NSC_SHORT, 0, NULL, EF_BAD, 0, + CA_DUMP}, + {"h_build", fldoff(m_mat[I_HCM]), NSC_SHORT, 0, NULL, EF_BAD, 0, + CA_DUMP}, + {"armor", fldoff(m_armor), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"speed", fldoff(m_speed), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"visib", fldoff(m_visib), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"vrnge", fldoff(m_vrnge), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"frnge", fldoff(m_frnge), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"glim", fldoff(m_glim), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"nxlight", fldoff(m_nxlight), NSC_UCHAR, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"nchoppers", fldoff(m_nchoppers), NSC_UCHAR, 0, NULL, EF_BAD, 0, + CA_DUMP}, + {"bwork", fldoff(m_bwork), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"tech", fldoff(m_tech), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"cost", fldoff(m_cost), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, {"flags", fldoff(m_flags), NSC_INT, 0, NULL, - EF_SHIP_CHR_FLAGS, NSC_BITS}, - {"nplanes", fldoff(m_nplanes), NSC_UCHAR, 0, NULL, EF_BAD, 0}, - {"nland", fldoff(m_nland), NSC_UCHAR, 0, NULL, EF_BAD, 0}, - {NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0} + EF_SHIP_CHR_FLAGS, NSC_BITS, CA_DUMP}, + {"nplanes", fldoff(m_nplanes), NSC_UCHAR, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"nland", fldoff(m_nland), NSC_UCHAR, 0, NULL, EF_BAD, 0, CA_DUMP}, + {NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0, CA_DUMP} #undef CURSTR }; struct castr plane_ca[] = { #define CURSTR struct plnstr NSC_GENITEM(EF_PLANE, EF_PLANE_CHR), - {"wing", fldoff(pln_wing), NSC_STRINGY, 1, NULL, EF_BAD, 0}, - {"range", fldoff(pln_range), NSC_UCHAR, 0, NULL, EF_BAD, 0}, - {"harden", fldoff(pln_harden), NSC_CHAR, 0, NULL, EF_BAD, 0}, - {"ship", fldoff(pln_ship), NSC_INT, 0, NULL, EF_SHIP, 0}, - {"land", fldoff(pln_land), NSC_INT, 0, NULL, EF_LAND, 0}, + {"wing", fldoff(pln_wing), NSC_STRINGY, 1, NULL, EF_BAD, 0, CA_DUMP}, + {"range", fldoff(pln_range), NSC_UCHAR, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"harden", fldoff(pln_harden), NSC_CHAR, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"ship", fldoff(pln_ship), NSC_INT, 0, NULL, EF_SHIP, 0, CA_DUMP}, + {"land", fldoff(pln_land), NSC_INT, 0, NULL, EF_LAND, 0, CA_DUMP}, {"flags", fldoff(pln_flags), NSC_INT, 0, NULL, - EF_PLANE_FLAGS, NSC_BITS}, - {"access", fldoff(pln_access), NSC_SHORT, 0, NULL, EF_BAD, 0}, - {"theta", fldoff(pln_theta), NSC_FLOAT, 0, NULL, EF_BAD, 0}, - {"att", 0, NSC_LONG, 0, nsc_pln_att, EF_BAD, NSC_EXTRA}, - {"def", 0, NSC_LONG, 0, nsc_pln_def, EF_BAD, NSC_EXTRA}, - {"nuketype", 0, NSC_LONG, 0, nsc_pln_nuketype, EF_BAD, NSC_EXTRA}, - {NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0} + EF_PLANE_FLAGS, NSC_BITS, CA_DUMP}, + {"access", fldoff(pln_access), NSC_SHORT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"theta", fldoff(pln_theta), NSC_FLOAT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"att", 0, NSC_LONG, 0, nsc_pln_att, EF_BAD, 0, CA_DUMP_NONE}, + {"def", 0, NSC_LONG, 0, nsc_pln_def, EF_BAD, 0, CA_DUMP_NONE}, + {"nuketype", 0, NSC_LONG, 0, nsc_pln_nuketype, EF_BAD, 0, + CA_DUMP_NONE}, + {NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0, CA_DUMP} #undef CURSTR }; struct castr plchr_ca[] = { #define CURSTR struct plchrstr - {"type", fldoff(pl_type), NSC_CHAR, 0, NULL, EF_PLANE_CHR, 0}, - {"name", fldoff(pl_name), NSC_STRING, 0, NULL, EF_BAD, 0}, - {"l_build", fldoff(pl_mat[I_LCM]), NSC_SHORT, 0, NULL, EF_BAD, 0}, - {"h_build", fldoff(pl_mat[I_HCM]), NSC_SHORT, 0, NULL, EF_BAD, 0}, - {"bwork", fldoff(pl_bwork), NSC_INT, 0, NULL, EF_BAD, 0}, - {"tech", fldoff(pl_tech), NSC_INT, 0, NULL, EF_BAD, 0}, - {"cost", fldoff(pl_cost), NSC_INT, 0, NULL, EF_BAD, 0}, - {"acc", fldoff(pl_acc), NSC_INT, 0, NULL, EF_BAD, 0}, - {"load", fldoff(pl_load), NSC_INT, 0, NULL, EF_BAD, 0}, - {"att", fldoff(pl_att), NSC_INT, 0, NULL, EF_BAD, 0}, - {"def", fldoff(pl_def), NSC_INT, 0, NULL, EF_BAD, 0}, - {"range", fldoff(pl_range), NSC_INT, 0, NULL, EF_BAD, 0}, - {"crew", fldoff(pl_mat[I_MILIT]), NSC_SHORT, 0, NULL, EF_BAD, 0}, - {"fuel", fldoff(pl_fuel), NSC_INT, 0, NULL, EF_BAD, 0}, - {"stealth", fldoff(pl_stealth), NSC_INT, 0, NULL, EF_BAD, 0}, + {"type", fldoff(pl_type), NSC_CHAR, 0, NULL, EF_PLANE_CHR, 0, CA_DUMP}, + {"name", fldoff(pl_name), NSC_STRING, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"l_build", fldoff(pl_mat[I_LCM]), NSC_SHORT, 0, NULL, EF_BAD, 0, + CA_DUMP}, + {"h_build", fldoff(pl_mat[I_HCM]), NSC_SHORT, 0, NULL, EF_BAD, 0, + CA_DUMP}, + {"bwork", fldoff(pl_bwork), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"tech", fldoff(pl_tech), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"cost", fldoff(pl_cost), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"acc", fldoff(pl_acc), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"load", fldoff(pl_load), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"att", fldoff(pl_att), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"def", fldoff(pl_def), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"range", fldoff(pl_range), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"crew", fldoff(pl_mat[I_MILIT]), NSC_SHORT, 0, NULL, EF_BAD, 0, + CA_DUMP}, + {"fuel", fldoff(pl_fuel), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"stealth", fldoff(pl_stealth), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, {"flags", fldoff(pl_flags), NSC_INT, 0, NULL, - EF_PLANE_CHR_FLAGS, NSC_BITS}, - {NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0} + EF_PLANE_CHR_FLAGS, NSC_BITS, CA_DUMP}, + {NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0, CA_DUMP} #undef CURSTR }; struct castr land_ca[] = { #define CURSTR struct lndstr NSC_GENITEM(EF_LAND, EF_LAND_CHR), - {"army", fldoff(lnd_army), NSC_STRINGY, 1, NULL, EF_BAD, 0}, - {"ship", fldoff(lnd_ship), NSC_INT, 0, NULL, EF_SHIP, 0}, - {"harden", fldoff(lnd_harden), NSC_CHAR, 0, NULL, EF_BAD, 0}, - {"retreat", fldoff(lnd_retreat), NSC_SHORT, 0, NULL, EF_BAD, 0}, + {"army", fldoff(lnd_army), NSC_STRINGY, 1, NULL, EF_BAD, 0, CA_DUMP}, + {"ship", fldoff(lnd_ship), NSC_INT, 0, NULL, EF_SHIP, 0, CA_DUMP}, + {"harden", fldoff(lnd_harden), NSC_CHAR, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"retreat", fldoff(lnd_retreat), NSC_SHORT, 0, NULL, EF_BAD, 0, + CA_DUMP}, {"rflags", fldoff(lnd_rflags), NSC_INT, 0, NULL, - EF_RETREAT_FLAGS, NSC_BITS}, - {"rpath", fldoff(lnd_rpath), NSC_STRINGY, RET_LEN, NULL, EF_BAD, 0}, + EF_RETREAT_FLAGS, NSC_BITS, CA_DUMP}, + {"rpath", fldoff(lnd_rpath), NSC_STRINGY, RET_LEN, NULL, EF_BAD, 0, + CA_DUMP}, NSC_IVEC(fldoff(lnd_item), ""), {"pstage", fldoff(lnd_pstage), NSC_SHORT, 0, NULL, - EF_PLAGUE_STAGES, NSC_DEITY}, - {"ptime", fldoff(lnd_ptime), NSC_SHORT, 0, NULL, EF_BAD, NSC_DEITY}, - {"land", fldoff(lnd_land), NSC_INT, 0, NULL, EF_LAND, 0}, - {"access", fldoff(lnd_access), NSC_SHORT, 0, NULL, EF_BAD, 0}, - {"att", 0, NSC_DOUBLE, 0, nsc_lnd_att, EF_BAD, NSC_EXTRA}, - {"def", 0, NSC_DOUBLE, 0, nsc_lnd_def, EF_BAD, NSC_EXTRA}, - {"vul", 0, NSC_LONG, 0, nsc_lnd_vul, EF_BAD, NSC_EXTRA}, - {"spd", 0, NSC_LONG, 0, nsc_lnd_spd, EF_BAD, NSC_EXTRA}, - {"vis", 0, NSC_LONG, 0, nsc_lnd_vis, EF_BAD, NSC_EXTRA}, - {"frg", 0, NSC_LONG, 0, nsc_lnd_frg, EF_BAD, NSC_EXTRA}, - {"acc", 0, NSC_LONG, 0, nsc_lnd_acc, EF_BAD, NSC_EXTRA}, - {"dam", 0, NSC_LONG, 0, nsc_lnd_dam, EF_BAD, NSC_EXTRA}, - {"aaf", 0, NSC_LONG, 0, nsc_lnd_aaf, EF_BAD, NSC_EXTRA}, - {"nland", 0, NSC_LONG, 0, nsc_cargo_nland, EF_BAD, NSC_EXTRA}, - {"nxlight", 0, NSC_LONG, 0, nsc_cargo_nxlight, EF_BAD, NSC_EXTRA}, + EF_PLAGUE_STAGES, NSC_DEITY, CA_DUMP}, + {"ptime", fldoff(lnd_ptime), NSC_SHORT, 0, NULL, EF_BAD, NSC_DEITY, + CA_DUMP}, + {"land", fldoff(lnd_land), NSC_INT, 0, NULL, EF_LAND, 0, CA_DUMP}, + {"access", fldoff(lnd_access), NSC_SHORT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"att", 0, NSC_DOUBLE, 0, nsc_lnd_att, EF_BAD, 0, CA_DUMP_NONE}, + {"def", 0, NSC_DOUBLE, 0, nsc_lnd_def, EF_BAD, 0, CA_DUMP_NONE}, + {"vul", 0, NSC_LONG, 0, nsc_lnd_vul, EF_BAD, 0, CA_DUMP_NONE}, + {"spd", 0, NSC_LONG, 0, nsc_lnd_spd, EF_BAD, 0, CA_DUMP_NONE}, + {"vis", 0, NSC_LONG, 0, nsc_lnd_vis, EF_BAD, 0, CA_DUMP_NONE}, + {"frg", 0, NSC_LONG, 0, nsc_lnd_frg, EF_BAD, 0, CA_DUMP_NONE}, + {"acc", 0, NSC_LONG, 0, nsc_lnd_acc, EF_BAD, 0, CA_DUMP_NONE}, + {"dam", 0, NSC_LONG, 0, nsc_lnd_dam, EF_BAD, 0, CA_DUMP_NONE}, + {"aaf", 0, NSC_LONG, 0, nsc_lnd_aaf, EF_BAD, 0, CA_DUMP_NONE}, + {"nland", 0, NSC_LONG, 0, nsc_cargo_nland, EF_BAD, 0, CA_DUMP_NONE}, + {"nxlight", 0, NSC_LONG, 0, nsc_cargo_nxlight, EF_BAD, 0, + CA_DUMP_NONE}, #undef CURSTR #define CURSTR struct lchrstr - {"spy", fldoff(l_spy), NSC_INT, 0, nsc_lchr, EF_BAD, NSC_EXTRA}, - {"rmax", fldoff(l_rad), NSC_INT, 0, nsc_lchr, EF_BAD, NSC_EXTRA}, - {"ammo", fldoff(l_ammo), NSC_INT, 0, nsc_lchr, EF_BAD, NSC_EXTRA}, + {"spy", fldoff(l_spy), NSC_INT, 0, nsc_lchr, EF_BAD, 0, CA_DUMP_NONE}, + {"rmax", fldoff(l_rad), NSC_INT, 0, nsc_lchr, EF_BAD, 0, CA_DUMP_NONE}, + {"ammo", fldoff(l_ammo), NSC_INT, 0, nsc_lchr, EF_BAD, 0, + CA_DUMP_NONE}, {"maxlight", fldoff(l_nxlight), NSC_UCHAR, 0, nsc_lchr, - EF_BAD, NSC_EXTRA}, - {NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0} + EF_BAD, 0, CA_DUMP_NONE}, + {NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0, CA_DUMP} #undef CURSTR }; struct castr lchr_ca[] = { #define CURSTR struct lchrstr - {"type", fldoff(l_type), NSC_CHAR, 0, NULL, EF_LAND_CHR, 0}, - {"name", fldoff(l_name), NSC_STRING, 0, NULL, EF_BAD, 0}, + {"type", fldoff(l_type), NSC_CHAR, 0, NULL, EF_LAND_CHR, 0, CA_DUMP}, + {"name", fldoff(l_name), NSC_STRING, 0, NULL, EF_BAD, 0, CA_DUMP}, NSC_IVEC(fldoff(l_item), ""), - {"l_build", fldoff(l_mat[I_LCM]), NSC_SHORT, 0, NULL, EF_BAD, 0}, - {"h_build", fldoff(l_mat[I_HCM]), NSC_SHORT, 0, NULL, EF_BAD, 0}, - {"bwork", fldoff(l_bwork), NSC_INT, 0, NULL, EF_BAD, 0}, - {"tech", fldoff(l_tech), NSC_INT, 0, NULL, EF_BAD, 0}, - {"cost", fldoff(l_cost), NSC_INT, 0, NULL, EF_BAD, 0}, - {"att", fldoff(l_att), NSC_FLOAT, 0, NULL, EF_BAD, 0}, - {"def", fldoff(l_def), NSC_FLOAT, 0, NULL, EF_BAD, 0}, - {"vul", fldoff(l_vul), NSC_INT, 0, NULL, EF_BAD, 0}, - {"spd", fldoff(l_spd), NSC_INT, 0, NULL, EF_BAD, 0}, - {"vis", fldoff(l_vis), NSC_INT, 0, NULL, EF_BAD, 0}, - {"spy", fldoff(l_spy), NSC_INT, 0, NULL, EF_BAD, 0}, - {"rmax", fldoff(l_rad), NSC_INT, 0, NULL, EF_BAD, 0}, - {"frg", fldoff(l_frg), NSC_INT, 0, NULL, EF_BAD, 0}, - {"acc", fldoff(l_acc), NSC_INT, 0, NULL, EF_BAD, 0}, - {"dam", fldoff(l_dam), NSC_INT, 0, NULL, EF_BAD, 0}, - {"ammo", fldoff(l_ammo), NSC_INT, 0, NULL, EF_BAD, 0}, - {"aaf", fldoff(l_aaf), NSC_INT, 0, NULL, EF_BAD, 0}, + {"l_build", fldoff(l_mat[I_LCM]), NSC_SHORT, 0, NULL, EF_BAD, 0, + CA_DUMP}, + {"h_build", fldoff(l_mat[I_HCM]), NSC_SHORT, 0, NULL, EF_BAD, 0, + CA_DUMP}, + {"bwork", fldoff(l_bwork), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"tech", fldoff(l_tech), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"cost", fldoff(l_cost), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"att", fldoff(l_att), NSC_FLOAT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"def", fldoff(l_def), NSC_FLOAT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"vul", fldoff(l_vul), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"spd", fldoff(l_spd), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"vis", fldoff(l_vis), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"spy", fldoff(l_spy), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"rmax", fldoff(l_rad), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"frg", fldoff(l_frg), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"acc", fldoff(l_acc), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"dam", fldoff(l_dam), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"ammo", fldoff(l_ammo), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"aaf", fldoff(l_aaf), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, {"flags", fldoff(l_flags), NSC_INT, 0, NULL, - EF_LAND_CHR_FLAGS, NSC_BITS}, - {"nxlight", fldoff(l_nxlight), NSC_UCHAR, 0, NULL, EF_BAD, 0}, - {"nland", fldoff(l_nland), NSC_UCHAR, 0, NULL, EF_BAD, 0}, - {NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0} + EF_LAND_CHR_FLAGS, NSC_BITS, CA_DUMP}, + {"nxlight", fldoff(l_nxlight), NSC_UCHAR, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"nland", fldoff(l_nland), NSC_UCHAR, 0, NULL, EF_BAD, 0, CA_DUMP}, + {NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0, CA_DUMP} #undef CURSTR }; struct castr nuke_ca[] = { #define CURSTR struct nukstr NSC_GENITEM(EF_NUKE, EF_NUKE_CHR), - {"stockpile", fldoff(nuk_stockpile), NSC_STRINGY, 1, NULL, EF_BAD, 0}, - {"plane", fldoff(nuk_plane), NSC_INT, 0, NULL, EF_PLANE, 0}, - {NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0} + {"stockpile", fldoff(nuk_stockpile), NSC_STRINGY, 1, NULL, EF_BAD, 0, + CA_DUMP}, + {"plane", fldoff(nuk_plane), NSC_INT, 0, NULL, EF_PLANE, 0, CA_DUMP}, + {NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0, CA_DUMP} #undef CURSTR }; struct castr nchr_ca[] = { #define CURSTR struct nchrstr - {"type", fldoff(n_type), NSC_CHAR, 0, NULL, EF_NUKE_CHR, 0}, - {"name", fldoff(n_name), NSC_STRING, 0, NULL, EF_BAD, 0}, - {"l_build", fldoff(n_mat[I_LCM]), NSC_SHORT, 0, NULL, EF_BAD, 0}, - {"h_build", fldoff(n_mat[I_HCM]), NSC_SHORT, 0, NULL, EF_BAD, 0}, - {"o_build", fldoff(n_mat[I_OIL]), NSC_SHORT, 0, NULL, EF_BAD, 0}, - {"r_build", fldoff(n_mat[I_RAD]), NSC_SHORT, 0, NULL, EF_BAD, 0}, - {"blast", fldoff(n_blast), NSC_INT, 0, NULL, EF_BAD, 0}, - {"dam", fldoff(n_dam), NSC_INT, 0, NULL, EF_BAD, 0}, - {"bwork", fldoff(n_bwork), NSC_INT, 0, NULL, EF_BAD, 0}, - {"tech", fldoff(n_tech), NSC_INT, 0, NULL, EF_BAD, 0}, - {"cost", fldoff(n_cost), NSC_INT, 0, NULL, EF_BAD, 0}, - {"weight", fldoff(n_weight), NSC_INT, 0, NULL, EF_BAD, 0}, + {"type", fldoff(n_type), NSC_CHAR, 0, NULL, EF_NUKE_CHR, 0, CA_DUMP}, + {"name", fldoff(n_name), NSC_STRING, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"l_build", fldoff(n_mat[I_LCM]), NSC_SHORT, 0, NULL, EF_BAD, 0, + CA_DUMP}, + {"h_build", fldoff(n_mat[I_HCM]), NSC_SHORT, 0, NULL, EF_BAD, 0, + CA_DUMP}, + {"o_build", fldoff(n_mat[I_OIL]), NSC_SHORT, 0, NULL, EF_BAD, 0, + CA_DUMP}, + {"r_build", fldoff(n_mat[I_RAD]), NSC_SHORT, 0, NULL, EF_BAD, 0, + CA_DUMP}, + {"blast", fldoff(n_blast), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"dam", fldoff(n_dam), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"bwork", fldoff(n_bwork), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"tech", fldoff(n_tech), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"cost", fldoff(n_cost), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"weight", fldoff(n_weight), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, {"flags", fldoff(n_flags), NSC_INT, 0, NULL, - EF_NUKE_CHR_FLAGS, NSC_BITS}, - {NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0} + EF_NUKE_CHR_FLAGS, NSC_BITS, CA_DUMP}, + {NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0, CA_DUMP} #undef CURSTR }; struct castr loan_ca[] = { #define CURSTR struct lonstr - {"uid", fldoff(l_uid), NSC_INT, 0, NULL, EF_LOAN, 0}, + {"uid", fldoff(l_uid), NSC_INT, 0, NULL, EF_LOAN, 0, CA_DUMP}, {"timestamp", fldoff(l_timestamp), NSC_TIME, 0, NULL, - EF_BAD, NSC_EXTRA}, - {"loaner", fldoff(l_loner), NSC_NATID, 0, NULL, EF_NATION, 0}, - {"loanee", fldoff(l_lonee), NSC_NATID, 0, NULL, EF_NATION, 0}, + EF_BAD, 0, CA_DUMP_NONE}, + {"loaner", fldoff(l_loner), NSC_NATID, 0, NULL, EF_NATION, 0, CA_DUMP}, + {"loanee", fldoff(l_lonee), NSC_NATID, 0, NULL, EF_NATION, 0, CA_DUMP}, {"status", fldoff(l_status), NSC_CHAR, 0, NULL, - EF_AGREEMENT_STATUS, 0}, - {"irate", fldoff(l_irate), NSC_INT, 0, NULL, EF_BAD, 0}, - {"ldur", fldoff(l_ldur), NSC_INT, 0, NULL, EF_BAD, 0}, - {"amtpaid", fldoff(l_amtpaid), NSC_INT, 0, NULL, EF_BAD, 0}, - {"amtdue", fldoff(l_amtdue), NSC_INT, 0, NULL, EF_BAD, 0}, - {"lastpay", fldoff(l_lastpay), NSC_TIME, 0, NULL, EF_BAD, 0}, - {"duedate", fldoff(l_duedate), NSC_TIME, 0, NULL, EF_BAD, 0}, - {NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0} + EF_AGREEMENT_STATUS, 0, CA_DUMP}, + {"irate", fldoff(l_irate), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"ldur", fldoff(l_ldur), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"amtpaid", fldoff(l_amtpaid), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"amtdue", fldoff(l_amtdue), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"lastpay", fldoff(l_lastpay), NSC_TIME, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"duedate", fldoff(l_duedate), NSC_TIME, 0, NULL, EF_BAD, 0, CA_DUMP}, + {NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0, CA_DUMP} #undef CURSTR }; struct castr news_ca[] = { #define CURSTR struct nwsstr - {"timestamp", 0, NSC_LONG, 0, nsc_nws_timestamp, EF_BAD, NSC_EXTRA}, - {"actor", fldoff(nws_ano), NSC_NATID, 0, NULL, EF_NATION, 0}, - {"action", fldoff(nws_vrb), NSC_UCHAR, 0, NULL, EF_NEWS_CHR, 0}, - {"victim", fldoff(nws_vno), NSC_NATID, 0, NULL, EF_NATION, 0}, - {"times", fldoff(nws_ntm), NSC_CHAR, 0, NULL, EF_BAD, 0}, - {"duration", fldoff(nws_duration), NSC_SHORT, 0, NULL, EF_BAD, 0}, - {"time", fldoff(nws_when), NSC_TIME, 0, NULL, EF_BAD, 0}, - {NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0} + {"timestamp", 0, NSC_LONG, 0, nsc_nws_timestamp, EF_BAD, 0, + CA_DUMP_NONE}, + {"actor", fldoff(nws_ano), NSC_NATID, 0, NULL, EF_NATION, 0, CA_DUMP}, + {"action", fldoff(nws_vrb), NSC_UCHAR, 0, NULL, EF_NEWS_CHR, 0, + CA_DUMP}, + {"victim", fldoff(nws_vno), NSC_NATID, 0, NULL, EF_NATION, 0, CA_DUMP}, + {"times", fldoff(nws_ntm), NSC_CHAR, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"duration", fldoff(nws_duration), NSC_SHORT, 0, NULL, EF_BAD, 0, + CA_DUMP}, + {"time", fldoff(nws_when), NSC_TIME, 0, NULL, EF_BAD, 0, CA_DUMP}, + {NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0, CA_DUMP} #undef CURSTR }; @@ -458,54 +506,68 @@ struct castr lost_ca[] = { #define CURSTR struct loststr /* no need for uid as long as it's not referenced from other tables */ {"timestamp", fldoff(lost_timestamp), NSC_TIME, 0, NULL, - EF_BAD, 0}, - {"owner", fldoff(lost_owner), NSC_NATID, 0, NULL, EF_NATION, 0}, - {"type", fldoff(lost_type), NSC_SHORT, 0, NULL, EF_TABLE, 0}, + EF_BAD, 0, CA_DUMP}, + {"owner", fldoff(lost_owner), NSC_NATID, 0, NULL, EF_NATION, 0, + CA_DUMP}, + {"type", fldoff(lost_type), NSC_SHORT, 0, NULL, EF_TABLE, 0, CA_DUMP}, /* id's ca_table given by type, but can't express that: */ - {"id", fldoff(lost_id), NSC_INT, 0, NULL, EF_BAD, 0}, - {"x", fldoff(lost_x), NSC_XCOORD, 0, NULL, EF_BAD, 0}, - {"y", fldoff(lost_y), NSC_YCOORD, 0, NULL, EF_BAD, 0}, - {NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0} + {"id", fldoff(lost_id), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"x", fldoff(lost_x), NSC_XCOORD, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"y", fldoff(lost_y), NSC_YCOORD, 0, NULL, EF_BAD, 0, CA_DUMP}, + {NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0, CA_DUMP} #undef CURSTR }; struct castr commodity_ca[] = { #define CURSTR struct comstr - {"uid", fldoff(com_uid), NSC_INT, 0, NULL, EF_COMM, 0}, + {"uid", fldoff(com_uid), NSC_INT, 0, NULL, EF_COMM, 0, CA_DUMP}, {"timestamp", fldoff(com_timestamp), NSC_TIME, 0, NULL, - EF_BAD, NSC_EXTRA}, - {"owner", fldoff(com_owner), NSC_NATID, 0, NULL, EF_NATION, 0}, - {"type", fldoff(com_type), NSC_SITYPE(i_type), 0, NULL, EF_ITEM, 0}, - {"amount", fldoff(com_amount), NSC_INT, 0, NULL, EF_BAD, 0}, - {"price", fldoff(com_price), NSC_FLOAT, 0, NULL, EF_BAD, 0}, - {"maxbidder", fldoff(com_maxbidder), NSC_INT, 0, NULL, EF_NATION, 0}, - {"markettime", fldoff(com_markettime), NSC_TIME, 0, NULL, EF_BAD, 0}, + EF_BAD, 0, CA_DUMP_NONE}, + {"owner", fldoff(com_owner), NSC_NATID, 0, NULL, EF_NATION, 0, + CA_DUMP}, + {"type", fldoff(com_type), NSC_SITYPE(i_type), 0, NULL, EF_ITEM, 0, + CA_DUMP}, + {"amount", fldoff(com_amount), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"price", fldoff(com_price), NSC_FLOAT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"maxbidder", fldoff(com_maxbidder), NSC_INT, 0, NULL, EF_NATION, 0, + CA_DUMP}, + {"markettime", fldoff(com_markettime), NSC_TIME, 0, NULL, EF_BAD, 0, + CA_DUMP}, /* should let maxbidder access xbuy, ybuy, but can't express that: */ - {"xbuy", fldoff(com_x), NSC_XCOORD, 0, NULL, EF_BAD, NSC_DEITY}, - {"ybuy", fldoff(com_y), NSC_XCOORD, 0, NULL, EF_BAD, NSC_DEITY}, + {"xbuy", fldoff(com_x), NSC_XCOORD, 0, NULL, EF_BAD, NSC_DEITY, + CA_DUMP}, + {"ybuy", fldoff(com_y), NSC_XCOORD, 0, NULL, EF_BAD, NSC_DEITY, + CA_DUMP}, /* should let owner access xsell, ysell, but can't express that: */ - {"xsell", fldoff(sell_x), NSC_XCOORD, 0, NULL, EF_BAD, NSC_DEITY}, - {"ysell", fldoff(sell_y), NSC_YCOORD, 0, NULL, EF_BAD, NSC_DEITY}, - {NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0} + {"xsell", fldoff(sell_x), NSC_XCOORD, 0, NULL, EF_BAD, NSC_DEITY, + CA_DUMP}, + {"ysell", fldoff(sell_y), NSC_YCOORD, 0, NULL, EF_BAD, NSC_DEITY, + CA_DUMP}, + {NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0, CA_DUMP} #undef CURSTR }; struct castr trade_ca[] = { #define CURSTR struct trdstr - {"uid", fldoff(trd_uid), NSC_INT, 0, NULL, EF_TRADE, 0}, + {"uid", fldoff(trd_uid), NSC_INT, 0, NULL, EF_TRADE, 0, CA_DUMP}, {"timestamp", fldoff(trd_timestamp), NSC_TIME, 0, NULL, - EF_BAD, NSC_EXTRA}, - {"owner", fldoff(trd_owner), NSC_NATID, 0, NULL, EF_NATION, 0}, - {"type", fldoff(trd_type), NSC_SHORT, 0, NULL, EF_TABLE, 0}, + EF_BAD, 0, CA_DUMP_NONE}, + {"owner", fldoff(trd_owner), NSC_NATID, 0, NULL, EF_NATION, 0, + CA_DUMP}, + {"type", fldoff(trd_type), NSC_SHORT, 0, NULL, EF_TABLE, 0, CA_DUMP}, /* unitid's ca_table given by type, but can't express that: */ - {"unitid", fldoff(trd_unitid), NSC_INT, 0, NULL, EF_BAD, 0}, - {"price", fldoff(trd_price), NSC_INT, 0, NULL, EF_BAD, 0}, - {"maxbidder", fldoff(trd_maxbidder), NSC_INT, 0, NULL, EF_NATION, 0}, - {"markettime", fldoff(trd_markettime), NSC_TIME, 0, NULL, EF_BAD, 0}, + {"unitid", fldoff(trd_unitid), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"price", fldoff(trd_price), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"maxbidder", fldoff(trd_maxbidder), NSC_INT, 0, NULL, EF_NATION, 0, + CA_DUMP}, + {"markettime", fldoff(trd_markettime), NSC_TIME, 0, NULL, EF_BAD, 0, + CA_DUMP}, /* should let maxbidder access xloc, yloc, but can't express that: */ - {"xloc", fldoff(trd_x), NSC_XCOORD, 0, NULL, EF_BAD, NSC_DEITY}, - {"yloc", fldoff(trd_y), NSC_YCOORD, 0, NULL, EF_BAD, NSC_DEITY}, - {NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0} + {"xloc", fldoff(trd_x), NSC_XCOORD, 0, NULL, EF_BAD, NSC_DEITY, + CA_DUMP}, + {"yloc", fldoff(trd_y), NSC_YCOORD, 0, NULL, EF_BAD, NSC_DEITY, + CA_DUMP}, + {NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0, CA_DUMP} #undef CURSTR }; @@ -516,58 +578,68 @@ struct castr cou_ca[] = { * nation. The public view nat_ca[], which applies to all * nations, has the same selectors with different flags: NSC_DEITY * is set except for cnum (which must come first) and all - * NSC_EXTRA selectors; NSC_EXTRA is cleared except for timestamp - * (which must come second). + * CA_DUMP_NONE selectors; these become CA_DUMP except for + * timestamp (which must come second). * nat_ca[] should also make tech, research, education and * happiness available, but we can't express the obfuscation * necessary for foreign levels. */ - {"cnum", fldoff(nat_cnum), NSC_NATID, 0, NULL, EF_NATION, 0}, + {"cnum", fldoff(nat_cnum), NSC_NATID, 0, NULL, EF_NATION, 0, CA_DUMP}, {"timestamp", fldoff(nat_timestamp), NSC_TIME, 0, NULL, - EF_BAD, NSC_EXTRA}, + EF_BAD, 0, CA_DUMP_NONE}, {"stat", fldoff(nat_stat), NSC_SITYPE(enum nat_status), 0, NULL, - EF_NATION_STATUS, NSC_EXTRA}, + EF_NATION_STATUS, 0, CA_DUMP_NONE}, {"flags", fldoff(nat_flags), NSC_INT, 0, NULL, - EF_NATION_FLAGS, NSC_BITS}, - {"cname", fldoff(nat_cnam), NSC_STRINGY, 20, NULL, EF_BAD, NSC_EXTRA}, + EF_NATION_FLAGS, NSC_BITS, CA_DUMP}, + {"cname", fldoff(nat_cnam), NSC_STRINGY, 20, NULL, EF_BAD, 0, + CA_DUMP_NONE}, {"passwd", fldoff(nat_pnam), NSC_STRINGY, 20, NULL, - EF_BAD, NSC_DEITY | NSC_EXTRA}, - {"ip", fldoff(nat_hostaddr), NSC_STRINGY, 46, NULL, EF_BAD, 0}, - {"hostname", 0, NSC_STRINGY, 0, NULL, EF_BAD, 0}, /* deprecated */ - {"userid", fldoff(nat_userid), NSC_STRINGY, 32, NULL, EF_BAD, 0}, - {"xcap", fldoff(nat_xcap), NSC_XCOORD, 0, NULL, EF_BAD, 0}, - {"ycap", fldoff(nat_ycap), NSC_YCOORD, 0, NULL, EF_BAD, 0}, + EF_BAD, NSC_DEITY, CA_DUMP_NONE}, + {"ip", fldoff(nat_hostaddr), NSC_STRINGY, 46, NULL, EF_BAD, 0, + CA_DUMP}, + {"hostname", 0, NSC_STRINGY, 0, NULL, EF_BAD, 0, CA_DUMP}, /* deprecated */ + {"userid", fldoff(nat_userid), NSC_STRINGY, 32, NULL, EF_BAD, 0, + CA_DUMP}, + {"xcap", fldoff(nat_xcap), NSC_XCOORD, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"ycap", fldoff(nat_ycap), NSC_YCOORD, 0, NULL, EF_BAD, 0, CA_DUMP}, {"xorg", fldoff(nat_xorg), NSC_XCOORD, 0, NULL, - EF_BAD, NSC_DEITY | NSC_EXTRA}, + EF_BAD, NSC_DEITY, CA_DUMP_NONE}, {"yorg", fldoff(nat_yorg), NSC_YCOORD, 0, NULL, - EF_BAD, NSC_DEITY | NSC_EXTRA}, - {"update", fldoff(nat_update), NSC_CHAR, 0, NULL, EF_BAD, 0}, - {"tgms", fldoff(nat_tgms), NSC_USHORT, 0, NULL, EF_BAD, 0}, - {"ann", fldoff(nat_ann), NSC_USHORT, 0, NULL, EF_BAD, 0}, - {"timeused", fldoff(nat_timeused), NSC_INT, 0, NULL, EF_BAD, 0}, - {"btu", fldoff(nat_btu), NSC_SHORT, 0, NULL, EF_BAD, 0}, - {"access", fldoff(nat_access), NSC_SHORT, 0, NULL, EF_BAD, 0}, - {"milreserve", fldoff(nat_reserve), NSC_INT, 0, NULL, EF_BAD, 0}, - {"money", fldoff(nat_money), NSC_INT, 0, NULL, EF_BAD, 0}, - {"login", fldoff(nat_last_login), NSC_TIME, 0, NULL, EF_BAD, 0}, - {"logout", fldoff(nat_last_logout), NSC_TIME, 0, NULL, EF_BAD, 0}, - {"newstim", fldoff(nat_newstim), NSC_TIME, 0, NULL, EF_BAD, 0}, - {"annotim", fldoff(nat_annotim), NSC_TIME, 0, NULL, EF_BAD, 0}, - {"tech", fldoff(nat_level[NAT_TLEV]), NSC_FLOAT, 0, NULL, EF_BAD, 0}, + EF_BAD, NSC_DEITY, CA_DUMP_NONE}, + {"update", fldoff(nat_update), NSC_CHAR, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"tgms", fldoff(nat_tgms), NSC_USHORT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"ann", fldoff(nat_ann), NSC_USHORT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"timeused", fldoff(nat_timeused), NSC_INT, 0, NULL, EF_BAD, 0, + CA_DUMP}, + {"btu", fldoff(nat_btu), NSC_SHORT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"access", fldoff(nat_access), NSC_SHORT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"milreserve", fldoff(nat_reserve), NSC_INT, 0, NULL, EF_BAD, 0, + CA_DUMP}, + {"money", fldoff(nat_money), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"login", fldoff(nat_last_login), NSC_TIME, 0, NULL, EF_BAD, 0, + CA_DUMP}, + {"logout", fldoff(nat_last_logout), NSC_TIME, 0, NULL, EF_BAD, 0, + CA_DUMP}, + {"newstim", fldoff(nat_newstim), NSC_TIME, 0, NULL, EF_BAD, 0, + CA_DUMP}, + {"annotim", fldoff(nat_annotim), NSC_TIME, 0, NULL, EF_BAD, 0, + CA_DUMP}, + {"tech", fldoff(nat_level[NAT_TLEV]), NSC_FLOAT, 0, NULL, EF_BAD, 0, + CA_DUMP}, {"research", fldoff(nat_level[NAT_RLEV]), NSC_FLOAT, 0, NULL, - EF_BAD, 0}, + EF_BAD, 0, CA_DUMP}, {"education", fldoff(nat_level[NAT_ELEV]), NSC_FLOAT, 0, NULL, - EF_BAD, 0}, + EF_BAD, 0, CA_DUMP}, {"happiness", fldoff(nat_level[NAT_HLEV]), NSC_FLOAT, 0, NULL, - EF_BAD, 0}, + EF_BAD, 0, CA_DUMP}, {"relations", fldoff(nat_relate), NSC_UCHAR, MAXNOC, NULL, - EF_NATION_RELATIONS, NSC_EXTRA | NSC_HIDDEN}, + EF_NATION_RELATIONS, NSC_HIDDEN, CA_DUMP_NONE}, /* mortals know there's contact (relations show), but not how strong */ {"contacts", fldoff(nat_contact), NSC_UCHAR, MAXNOC, NULL, - EF_BAD, NSC_DEITY | NSC_EXTRA}, + EF_BAD, NSC_DEITY, CA_DUMP_NONE}, {"rejects", fldoff(nat_rejects), NSC_UCHAR, MAXNOC, NULL, - EF_NATION_REJECTS, NSC_EXTRA | NSC_BITS}, - {NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0} + EF_NATION_REJECTS, NSC_BITS, CA_DUMP_NONE}, + {NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0, CA_DUMP} #undef CURSTR }; @@ -578,14 +650,16 @@ struct castr realm_ca[] = { #define CURSTR struct realmstr /* uid is encoded in cnum, realm */ {"timestamp", fldoff(r_timestamp), NSC_TIME, 0, NULL, - EF_BAD, NSC_EXTRA}, - {"cnum", fldoff(r_cnum), NSC_NATID, 0, NULL, EF_NATION, NSC_CONST}, - {"realm", fldoff(r_realm), NSC_USHORT, 0, NULL, EF_BAD, NSC_CONST}, - {"xl", fldoff(r_xl), NSC_XCOORD, 0, NULL, EF_BAD, 0}, - {"xh", fldoff(r_xh), NSC_XCOORD, 0, NULL, EF_BAD, 0}, - {"yl", fldoff(r_yl), NSC_YCOORD, 0, NULL, EF_BAD, 0}, - {"yh", fldoff(r_yh), NSC_YCOORD, 0, NULL, EF_BAD, 0}, - {NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0} + EF_BAD, 0, CA_DUMP_NONE}, + {"cnum", fldoff(r_cnum), NSC_NATID, 0, NULL, EF_NATION, 0, + CA_DUMP_CONST}, + {"realm", fldoff(r_realm), NSC_USHORT, 0, NULL, EF_BAD, 0, + CA_DUMP_CONST}, + {"xl", fldoff(r_xl), NSC_XCOORD, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"xh", fldoff(r_xh), NSC_XCOORD, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"yl", fldoff(r_yl), NSC_YCOORD, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"yh", fldoff(r_yh), NSC_YCOORD, 0, NULL, EF_BAD, 0, CA_DUMP}, + {NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0, CA_DUMP} #undef CURSTR }; @@ -593,52 +667,55 @@ struct castr game_ca[] = { #define CURSTR struct gamestr /* no need for uid */ {"timestamp", fldoff(game_timestamp), NSC_TIME, 0, NULL, - EF_BAD, NSC_EXTRA}, + EF_BAD, 0, CA_DUMP_NONE}, {"upd_disable", fldoff(game_upd_disable), NSC_CHAR, 0, NULL, - EF_BAD, 0}, - {"down", fldoff(game_down), NSC_CHAR, 0, NULL, EF_BAD, 0}, - {"turn", fldoff(game_turn), NSC_SHORT, 0, NULL, EF_BAD, 0}, - {"tick", fldoff(game_tick), NSC_SHORT, 0, NULL, EF_BAD, NSC_DEITY}, - {"rt", fldoff(game_rt), NSC_TIME, 0, NULL, EF_BAD, NSC_DEITY}, - {NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0} + EF_BAD, 0, CA_DUMP}, + {"down", fldoff(game_down), NSC_CHAR, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"turn", fldoff(game_turn), NSC_SHORT, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"tick", fldoff(game_tick), NSC_SHORT, 0, NULL, EF_BAD, NSC_DEITY, + CA_DUMP}, + {"rt", fldoff(game_rt), NSC_TIME, 0, NULL, EF_BAD, NSC_DEITY, CA_DUMP}, + {NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0, CA_DUMP} #undef CURSTR }; struct castr intrchr_ca[] = { #define CURSTR struct sctintrins /* no need for uid as long as it's not referenced from other tables */ - {"name", fldoff(in_name), NSC_STRING, 0, NULL, EF_BAD, NSC_CONST}, - {"lcms", fldoff(in_lcms), NSC_UCHAR, 0, NULL, EF_BAD, 0}, - {"hcms", fldoff(in_hcms), NSC_UCHAR, 0, NULL, EF_BAD, 0}, - {"dcost", fldoff(in_dcost), NSC_UCHAR, 0, NULL, EF_BAD, 0}, - {"mcost", fldoff(in_mcost), NSC_UCHAR, 0, NULL, EF_BAD, 0}, - {"enable", fldoff(in_enable), NSC_UCHAR, 0, NULL, EF_BAD, 0}, - {NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0} + {"name", fldoff(in_name), NSC_STRING, 0, NULL, EF_BAD, 0, + CA_DUMP_CONST}, + {"lcms", fldoff(in_lcms), NSC_UCHAR, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"hcms", fldoff(in_hcms), NSC_UCHAR, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"dcost", fldoff(in_dcost), NSC_UCHAR, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"mcost", fldoff(in_mcost), NSC_UCHAR, 0, NULL, EF_BAD, 0, CA_DUMP}, + {"enable", fldoff(in_enable), NSC_UCHAR, 0, NULL, EF_BAD, 0, CA_DUMP}, + {NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0, CA_DUMP} #undef CURSTR }; struct castr rpt_ca[] = { #define CURSTR struct rptstr - {"uid", fldoff(r_uid), NSC_CHAR, 0, NULL, EF_NEWS_CHR, 0}, + {"uid", fldoff(r_uid), NSC_CHAR, 0, NULL, EF_NEWS_CHR, 0, CA_DUMP}, {"newstory", fldoff(r_newstory), NSC_STRING, NUM_RPTS, NULL, - EF_BAD, 0}, - {"good_will", fldoff(r_good_will), NSC_INT, 0, NULL, EF_BAD, 0}, + EF_BAD, 0, CA_DUMP}, + {"good_will", fldoff(r_good_will), NSC_INT, 0, NULL, EF_BAD, 0, + CA_DUMP}, {"newspage", fldoff(r_newspage), NSC_INT, 0, NULL, - EF_PAGE_HEADINGS, 0}, - {NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0} + EF_PAGE_HEADINGS, 0, CA_DUMP}, + {NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0, CA_DUMP} #undef CURSTR }; struct castr update_ca[] = { - {"time", 0, NSC_TIME, 0, NULL, EF_BAD, 0}, - {NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0} + {"time", 0, NSC_TIME, 0, NULL, EF_BAD, 0, CA_DUMP}, + {NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0, CA_DUMP} }; struct castr empfile_ca[] = { #define CURSTR struct empfile - {"uid", fldoff(uid), NSC_INT, 0, NULL, EF_TABLE, 0}, - {"name", fldoff(name), NSC_STRING, 0, NULL, EF_BAD, NSC_CONST}, - {NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0} + {"uid", fldoff(uid), NSC_INT, 0, NULL, EF_TABLE, 0, CA_DUMP}, + {"name", fldoff(name), NSC_STRING, 0, NULL, EF_BAD, 0, CA_DUMP_CONST}, + {NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0, CA_DUMP} #undef CURSTR }; @@ -648,9 +725,9 @@ struct castr symbol_ca[] = { * value is is const because it has to match what is compiled into * the server. name is const because clients key on it. */ - {"value", fldoff(value), NSC_INT, 0, NULL, EF_BAD, NSC_CONST}, - {"name", fldoff(name), NSC_STRING, 0, NULL, EF_BAD, NSC_CONST}, - {NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0} + {"value", fldoff(value), NSC_INT, 0, NULL, EF_BAD, 0, CA_DUMP_CONST}, + {"name", fldoff(name), NSC_STRING, 0, NULL, EF_BAD, 0, CA_DUMP_CONST}, + {NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0, CA_DUMP} #undef CURSTR }; @@ -658,14 +735,16 @@ struct castr mdchr_ca[] = { #define CURSTR struct castr /* no need for uid */ /* name must come first, clients may rely on it */ - {"name", fldoff(ca_name), NSC_STRING, 0, NULL, EF_BAD, NSC_CONST}, + {"name", fldoff(ca_name), NSC_STRING, 0, NULL, EF_BAD, 0, + CA_DUMP_CONST}, {"type", fldoff(ca_type), NSC_SITYPE(enum nsc_type), 0, NULL, - EF_META_TYPE, NSC_CONST}, + EF_META_TYPE, 0, CA_DUMP_CONST}, {"flags", fldoff(ca_flags), NSC_INT, 0, NULL, - EF_META_FLAGS, NSC_CONST | NSC_BITS}, - {"len", fldoff(ca_len), NSC_USHORT, 0, NULL, EF_BAD, NSC_CONST}, - {"table", fldoff(ca_table), NSC_INT, 0, NULL, EF_TABLE, NSC_CONST}, - {NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0} + EF_META_FLAGS, NSC_BITS, CA_DUMP_CONST}, + {"len", fldoff(ca_len), NSC_USHORT, 0, NULL, EF_BAD, 0, CA_DUMP_CONST}, + {"table", fldoff(ca_table), NSC_INT, 0, NULL, EF_TABLE, 0, + CA_DUMP_CONST}, + {NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0, CA_DUMP} #undef CURSTR }; @@ -673,15 +752,15 @@ void nsc_init(void) { static struct castr version_ca0 = { - "version", 0, NSC_STRINGY, sizeof(PACKAGE_STRING), NULL, EF_BAD, 0 + "version", 0, NSC_STRINGY, sizeof(PACKAGE_STRING), NULL, EF_BAD, 0, + CA_DUMP }; static struct castr version_ca1 = { - "maxnoc", 0, NSC_LONG, 0, nsc_ver_maxnoc, EF_BAD, 0 + "maxnoc", 0, NSC_LONG, 0, nsc_ver_maxnoc, EF_BAD, 0, CA_DUMP }; static struct castr *ca; struct keymatch *kp; int n, i; - unsigned flags; /* derive empfile[EF_VERSION].cadef from configkeys[] */ n = 0; @@ -710,12 +789,10 @@ nsc_init(void) nat_ca[1] = cou_ca[1]; /* timestamp */ for (i = 2; cou_ca[i].ca_name; i++) { nat_ca[i] = cou_ca[i]; - flags = nat_ca[i].ca_flags; - if (flags & NSC_EXTRA) - flags &= ~NSC_EXTRA; + if (nat_ca[i].ca_dump == CA_DUMP_NONE) + nat_ca[i].ca_dump = CA_DUMP; else - flags |= NSC_DEITY; - nat_ca[i].ca_flags = flags; + nat_ca[i].ca_flags |= NSC_DEITY; } nat_ca[i] = cou_ca[i]; /* sentinel */ } diff --git a/src/lib/common/xdump.c b/src/lib/common/xdump.c index e98e6284..7357a7e4 100644 --- a/src/lib/common/xdump.c +++ b/src/lib/common/xdump.c @@ -27,7 +27,7 @@ * xdump.c: Extended dumps * * Known contributors to this file: - * Markus Armbruster, 2004-2014 + * Markus Armbruster, 2004-2016 */ /* @@ -242,7 +242,7 @@ xdflds(struct xdstr *xd, struct castr ca[], void *ptr) for (i = 0; ca[i].ca_name; ++i) { if (ca[i].ca_flags & NSC_DEITY && !xd->divine) continue; - if (ca[i].ca_flags & NSC_EXTRA) + if (ca[i].ca_dump == CA_DUMP_NONE) continue; n = CA_ARRAY_LEN(&ca[i]); j = 0; @@ -285,7 +285,7 @@ xdcolhdr(struct xdstr *xd, struct castr ca[]) for (i = 0; ca[i].ca_name; ++i) { if (ca[i].ca_flags & NSC_DEITY && !xd->divine) continue; - if (ca[i].ca_flags & NSC_EXTRA) + if (ca[i].ca_dump == CA_DUMP_NONE) continue; n = CA_ARRAY_LEN(&ca[i]); if (n) { diff --git a/src/lib/common/xundump.c b/src/lib/common/xundump.c index 34bf50aa..0021e3b2 100644 --- a/src/lib/common/xundump.c +++ b/src/lib/common/xundump.c @@ -28,7 +28,7 @@ * * Known contributors to this file: * Ron Koenderink, 2005 - * Markus Armbruster, 2005-2014 + * Markus Armbruster, 2005-2016 */ /* @@ -122,7 +122,7 @@ ca0_is_id(int type) { struct castr *ca = ef_cadef(type); - return ca[0].ca_table == type && !(ca[0].ca_flags & NSC_EXTRA); + return ca[0].ca_table == type && ca[0].ca_dump <= CA_DUMP_CONST; } /* @@ -506,7 +506,7 @@ fldval_must_match(int fldno) * it's for a const selector, unless the object is still blank, or * it was already given in a previous part of a split table. */ - return (cur_id < old_nelem && (fldca[fldno]->ca_flags & NSC_CONST)) + return (cur_id < old_nelem && (fldca[fldno]->ca_dump == CA_DUMP_CONST)) || fldidx[fldno] < cafldspp[i]; } @@ -933,7 +933,7 @@ deffld(int fldno, char *name, int idx) return gripe("%s header '%s' in field %d", res == M_NOTUNIQUE ? "ambiguous" : "unknown", name, fldno + 1); - if ((ca[res].ca_flags & NSC_EXTRA) || CANT_HAPPEN(ca[res].ca_get)) + if (ca[res].ca_dump > CA_DUMP_CONST || CANT_HAPPEN(ca[res].ca_get)) return gripe("extraneous header '%s' in field %d", name, fldno + 1); if (CA_IS_ARRAY(&ca[res])) { if (idx < 0) @@ -976,7 +976,7 @@ chkflds(void) /* Check for missing fields */ for (i = 0; ca[i].ca_name; i++) { cafldsmax = MAX(caflds[i], cafldspp[i]); - if (ca[i].ca_flags & NSC_EXTRA) + if (ca[i].ca_dump > CA_DUMP_CONST) continue; len = CA_ARRAY_LEN(&ca[i]); if (!len && !cafldsmax) @@ -1198,7 +1198,7 @@ xufldhdr(FILE *fp, struct castr ca[]) fidx = fldidx; for (i = 0; ca[i].ca_name; i++) { - if ((ca[i].ca_flags & NSC_EXTRA)) + if (ca[i].ca_dump > CA_DUMP_CONST) continue; n = CA_ARRAY_LEN(&ca[i]); j = 0; @@ -1278,7 +1278,7 @@ xundump(FILE *fp, char *file, int *plno, int expected_table) nca = nf = 0; for (i = 0; ca[i].ca_name; i++) { nca++; - if (!(ca[i].ca_flags & NSC_EXTRA)) + if (ca[i].ca_dump <= CA_DUMP_CONST) nf += MAX(1, CA_ARRAY_LEN(&ca[i])); } fldca = malloc(nf * sizeof(*fldca)); diff --git a/src/lib/global/symbol.c b/src/lib/global/symbol.c index ba0dbb0f..7bb0916d 100644 --- a/src/lib/global/symbol.c +++ b/src/lib/global/symbol.c @@ -79,8 +79,6 @@ struct symbol level[] = { struct symbol meta_flags[] = { {NSC_DEITY, "deity"}, - {NSC_EXTRA, "extra"}, - {NSC_CONST, "const"}, {NSC_BITS, "bits"}, {NSC_HIDDEN, "hidden"}, {0, NULL} diff --git a/tests/version/journal.log b/tests/version/journal.log index ec6813d3..1d5e8340 100644 --- a/tests/version/journal.log +++ b/tests/version/journal.log @@ -601,8 +601,8 @@ Play#0 command xdump Play#0 output Play#0 1 XDUMP meta sect 0 Play#0 output Play#0 1 "owner" 5 0 0 8 - Play#0 output Play#0 1 "xloc" 9 4 0 -1 - Play#0 output Play#0 1 "yloc" 10 4 0 -1 + Play#0 output Play#0 1 "xloc" 9 0 0 -1 + Play#0 output Play#0 1 "yloc" 10 0 0 -1 Play#0 output Play#0 1 "des" 4 0 0 18 Play#0 output Play#0 1 "effic" 4 0 0 -1 Play#0 output Play#0 1 "mobil" 4 0 0 -1 @@ -928,8 +928,8 @@ Play#0 input xdump meta 14 Play#0 command xdump Play#0 output Play#0 1 XDUMP meta realm 0 - Play#0 output Play#0 1 "cnum" 5 4 0 8 - Play#0 output Play#0 1 "realm" 7 4 0 -1 + Play#0 output Play#0 1 "cnum" 5 0 0 8 + Play#0 output Play#0 1 "realm" 7 0 0 -1 Play#0 output Play#0 1 "xl" 9 0 0 -1 Play#0 output Play#0 1 "xh" 9 0 0 -1 Play#0 output Play#0 1 "yl" 10 0 0 -1 @@ -951,7 +951,7 @@ Play#0 output Play#0 1 XDUMP meta item 0 Play#0 output Play#0 1 "uid" 4 0 0 16 Play#0 output Play#0 1 "name" 3 0 0 -1 - Play#0 output Play#0 1 "mnem" 13 4 1 -1 + Play#0 output Play#0 1 "mnem" 13 0 1 -1 Play#0 output Play#0 1 "power" 8 0 0 -1 Play#0 output Play#0 1 "value" 8 0 0 -1 Play#0 output Play#0 1 "sell" 8 0 0 -1 @@ -983,7 +983,7 @@ Play#0 output Play#0 1 XDUMP meta sect-chr 0 Play#0 output Play#0 1 "uid" 5 0 0 18 Play#0 output Play#0 1 "name" 3 0 0 -1 - Play#0 output Play#0 1 "mnem" 13 4 1 -1 + Play#0 output Play#0 1 "mnem" 13 0 1 -1 Play#0 output Play#0 1 "terrain" 5 0 0 18 Play#0 output Play#0 1 "prd" 8 0 0 17 Play#0 output Play#0 1 "peffic" 8 0 0 -1 @@ -1131,7 +1131,7 @@ Play#0 input xdump meta 24 Play#0 command xdump Play#0 output Play#0 1 XDUMP meta infrastructure 0 - Play#0 output Play#0 1 "name" 3 4 0 -1 + Play#0 output Play#0 1 "name" 3 0 0 -1 Play#0 output Play#0 1 "lcms" 5 0 0 -1 Play#0 output Play#0 1 "hcms" 5 0 0 -1 Play#0 output Play#0 1 "dcost" 5 0 0 -1 @@ -1149,7 +1149,7 @@ Play#0 command xdump Play#0 output Play#0 1 XDUMP meta table 0 Play#0 output Play#0 1 "uid" 8 0 0 26 - Play#0 output Play#0 1 "name" 3 4 0 -1 + Play#0 output Play#0 1 "name" 3 0 0 -1 Play#0 output Play#0 1 /2 Play#0 output Play#0 6 0 640 Play#0 input xdump meta 27 @@ -1270,151 +1270,151 @@ Play#0 input xdump meta 28 Play#0 command xdump Play#0 output Play#0 1 XDUMP meta meta 0 - Play#0 output Play#0 1 "name" 3 4 0 -1 - Play#0 output Play#0 1 "type" 8 4 0 33 - Play#0 output Play#0 1 "flags" 8 12 0 32 - Play#0 output Play#0 1 "len" 7 4 0 -1 - Play#0 output Play#0 1 "table" 8 4 0 26 + Play#0 output Play#0 1 "name" 3 0 0 -1 + Play#0 output Play#0 1 "type" 8 0 0 33 + Play#0 output Play#0 1 "flags" 8 8 0 32 + Play#0 output Play#0 1 "len" 7 0 0 -1 + Play#0 output Play#0 1 "table" 8 0 0 26 Play#0 output Play#0 1 /5 Play#0 output Play#0 6 0 640 Play#0 input xdump meta 29 Play#0 command xdump Play#0 output Play#0 1 XDUMP meta agreement-status 0 - Play#0 output Play#0 1 "value" 8 4 0 -1 - Play#0 output Play#0 1 "name" 3 4 0 -1 + Play#0 output Play#0 1 "value" 8 0 0 -1 + Play#0 output Play#0 1 "name" 3 0 0 -1 Play#0 output Play#0 1 /2 Play#0 output Play#0 6 0 640 Play#0 input xdump meta 30 Play#0 command xdump Play#0 output Play#0 1 XDUMP meta land-chr-flags 0 - Play#0 output Play#0 1 "value" 8 4 0 -1 - Play#0 output Play#0 1 "name" 3 4 0 -1 + Play#0 output Play#0 1 "value" 8 0 0 -1 + Play#0 output Play#0 1 "name" 3 0 0 -1 Play#0 output Play#0 1 /2 Play#0 output Play#0 6 0 640 Play#0 input xdump meta 31 Play#0 command xdump Play#0 output Play#0 1 XDUMP meta level 0 - Play#0 output Play#0 1 "value" 8 4 0 -1 - Play#0 output Play#0 1 "name" 3 4 0 -1 + Play#0 output Play#0 1 "value" 8 0 0 -1 + Play#0 output Play#0 1 "name" 3 0 0 -1 Play#0 output Play#0 1 /2 Play#0 output Play#0 6 0 640 Play#0 input xdump meta 32 Play#0 command xdump Play#0 output Play#0 1 XDUMP meta meta-flags 0 - Play#0 output Play#0 1 "value" 8 4 0 -1 - Play#0 output Play#0 1 "name" 3 4 0 -1 + Play#0 output Play#0 1 "value" 8 0 0 -1 + Play#0 output Play#0 1 "name" 3 0 0 -1 Play#0 output Play#0 1 /2 Play#0 output Play#0 6 0 640 Play#0 input xdump meta 33 Play#0 command xdump Play#0 output Play#0 1 XDUMP meta meta-type 0 - Play#0 output Play#0 1 "value" 8 4 0 -1 - Play#0 output Play#0 1 "name" 3 4 0 -1 + Play#0 output Play#0 1 "value" 8 0 0 -1 + Play#0 output Play#0 1 "name" 3 0 0 -1 Play#0 output Play#0 1 /2 Play#0 output Play#0 6 0 640 Play#0 input xdump meta 34 Play#0 command xdump Play#0 output Play#0 1 XDUMP meta missions 0 - Play#0 output Play#0 1 "value" 8 4 0 -1 - Play#0 output Play#0 1 "name" 3 4 0 -1 + Play#0 output Play#0 1 "value" 8 0 0 -1 + Play#0 output Play#0 1 "name" 3 0 0 -1 Play#0 output Play#0 1 /2 Play#0 output Play#0 6 0 640 Play#0 input xdump meta 35 Play#0 command xdump Play#0 output Play#0 1 XDUMP meta nation-flags 0 - Play#0 output Play#0 1 "value" 8 4 0 -1 - Play#0 output Play#0 1 "name" 3 4 0 -1 + Play#0 output Play#0 1 "value" 8 0 0 -1 + Play#0 output Play#0 1 "name" 3 0 0 -1 Play#0 output Play#0 1 /2 Play#0 output Play#0 6 0 640 Play#0 input xdump meta 36 Play#0 command xdump Play#0 output Play#0 1 XDUMP meta nation-rejects 0 - Play#0 output Play#0 1 "value" 8 4 0 -1 - Play#0 output Play#0 1 "name" 3 4 0 -1 + Play#0 output Play#0 1 "value" 8 0 0 -1 + Play#0 output Play#0 1 "name" 3 0 0 -1 Play#0 output Play#0 1 /2 Play#0 output Play#0 6 0 640 Play#0 input xdump meta 37 Play#0 command xdump Play#0 output Play#0 1 XDUMP meta nation-relationships 0 - Play#0 output Play#0 1 "value" 8 4 0 -1 - Play#0 output Play#0 1 "name" 3 4 0 -1 + Play#0 output Play#0 1 "value" 8 0 0 -1 + Play#0 output Play#0 1 "name" 3 0 0 -1 Play#0 output Play#0 1 /2 Play#0 output Play#0 6 0 640 Play#0 input xdump meta 38 Play#0 command xdump Play#0 output Play#0 1 XDUMP meta nation-status 0 - Play#0 output Play#0 1 "value" 8 4 0 -1 - Play#0 output Play#0 1 "name" 3 4 0 -1 + Play#0 output Play#0 1 "value" 8 0 0 -1 + Play#0 output Play#0 1 "name" 3 0 0 -1 Play#0 output Play#0 1 /2 Play#0 output Play#0 6 0 640 Play#0 input xdump meta 39 Play#0 command xdump Play#0 output Play#0 1 XDUMP meta nuke-chr-flags 0 - Play#0 output Play#0 1 "value" 8 4 0 -1 - Play#0 output Play#0 1 "name" 3 4 0 -1 + Play#0 output Play#0 1 "value" 8 0 0 -1 + Play#0 output Play#0 1 "name" 3 0 0 -1 Play#0 output Play#0 1 /2 Play#0 output Play#0 6 0 640 Play#0 input xdump meta 40 Play#0 command xdump Play#0 output Play#0 1 XDUMP meta packing 0 - Play#0 output Play#0 1 "value" 8 4 0 -1 - Play#0 output Play#0 1 "name" 3 4 0 -1 + Play#0 output Play#0 1 "value" 8 0 0 -1 + Play#0 output Play#0 1 "name" 3 0 0 -1 Play#0 output Play#0 1 /2 Play#0 output Play#0 6 0 640 Play#0 input xdump meta 41 Play#0 command xdump Play#0 output Play#0 1 XDUMP meta page-headings 0 - Play#0 output Play#0 1 "value" 8 4 0 -1 - Play#0 output Play#0 1 "name" 3 4 0 -1 + Play#0 output Play#0 1 "value" 8 0 0 -1 + Play#0 output Play#0 1 "name" 3 0 0 -1 Play#0 output Play#0 1 /2 Play#0 output Play#0 6 0 640 Play#0 input xdump meta 42 Play#0 command xdump Play#0 output Play#0 1 XDUMP meta plague-stages 0 - Play#0 output Play#0 1 "value" 8 4 0 -1 - Play#0 output Play#0 1 "name" 3 4 0 -1 + Play#0 output Play#0 1 "value" 8 0 0 -1 + Play#0 output Play#0 1 "name" 3 0 0 -1 Play#0 output Play#0 1 /2 Play#0 output Play#0 6 0 640 Play#0 input xdump meta 43 Play#0 command xdump Play#0 output Play#0 1 XDUMP meta plane-chr-flags 0 - Play#0 output Play#0 1 "value" 8 4 0 -1 - Play#0 output Play#0 1 "name" 3 4 0 -1 + Play#0 output Play#0 1 "value" 8 0 0 -1 + Play#0 output Play#0 1 "name" 3 0 0 -1 Play#0 output Play#0 1 /2 Play#0 output Play#0 6 0 640 Play#0 input xdump meta 44 Play#0 command xdump Play#0 output Play#0 1 XDUMP meta plane-flags 0 - Play#0 output Play#0 1 "value" 8 4 0 -1 - Play#0 output Play#0 1 "name" 3 4 0 -1 + Play#0 output Play#0 1 "value" 8 0 0 -1 + Play#0 output Play#0 1 "name" 3 0 0 -1 Play#0 output Play#0 1 /2 Play#0 output Play#0 6 0 640 Play#0 input xdump meta 45 Play#0 command xdump Play#0 output Play#0 1 XDUMP meta resources 0 - Play#0 output Play#0 1 "value" 8 4 0 -1 - Play#0 output Play#0 1 "name" 3 4 0 -1 + Play#0 output Play#0 1 "value" 8 0 0 -1 + Play#0 output Play#0 1 "name" 3 0 0 -1 Play#0 output Play#0 1 /2 Play#0 output Play#0 6 0 640 Play#0 input xdump meta 46 Play#0 command xdump Play#0 output Play#0 1 XDUMP meta retreat-flags 0 - Play#0 output Play#0 1 "value" 8 4 0 -1 - Play#0 output Play#0 1 "name" 3 4 0 -1 + Play#0 output Play#0 1 "value" 8 0 0 -1 + Play#0 output Play#0 1 "name" 3 0 0 -1 Play#0 output Play#0 1 /2 Play#0 output Play#0 6 0 640 Play#0 input xdump meta 47 Play#0 command xdump Play#0 output Play#0 1 XDUMP meta sector-navigation 0 - Play#0 output Play#0 1 "value" 8 4 0 -1 - Play#0 output Play#0 1 "name" 3 4 0 -1 + Play#0 output Play#0 1 "value" 8 0 0 -1 + Play#0 output Play#0 1 "name" 3 0 0 -1 Play#0 output Play#0 1 /2 Play#0 output Play#0 6 0 640 Play#0 input xdump meta 48 Play#0 command xdump Play#0 output Play#0 1 XDUMP meta ship-chr-flags 0 - Play#0 output Play#0 1 "value" 8 4 0 -1 - Play#0 output Play#0 1 "name" 3 4 0 -1 + Play#0 output Play#0 1 "value" 8 0 0 -1 + Play#0 output Play#0 1 "name" 3 0 0 -1 Play#0 output Play#0 1 /2 Play#0 output Play#0 6 0 640 Play#0 input xdump meta 49 @@ -1844,11 +1844,9 @@ Play#0 command xdump Play#0 output Play#0 1 XDUMP meta-flags 0 Play#0 output Play#0 1 1 "deity" - Play#0 output Play#0 1 2 "extra" - Play#0 output Play#0 1 4 "const" Play#0 output Play#0 1 8 "bits" Play#0 output Play#0 1 16 "hidden" - Play#0 output Play#0 1 /5 + Play#0 output Play#0 1 /3 Play#0 output Play#0 6 0 640 Play#0 input xdump meta-type * Play#0 command xdump @@ -2510,11 +2508,9 @@ Play#1 command xdump Play#1 output Play#1 1 XDUMP meta-flags 0 Play#1 output Play#1 1 1 "deity" - Play#1 output Play#1 1 2 "extra" - Play#1 output Play#1 1 4 "const" Play#1 output Play#1 1 8 "bits" Play#1 output Play#1 1 16 "hidden" - Play#1 output Play#1 1 /5 + Play#1 output Play#1 1 /3 Play#1 output Play#1 6 0 0 Play#1 input xdump meta-type * Play#1 command xdump