Commit graph

80 commits

Author SHA1 Message Date
0ab9260151 (empfile, chr_camap): Merge chr_camap[] into empfile[]. No existing
user sees the new elements of empfile[].
(EF_SECTOR_CHR, EF_SHIP_CHR, EF_PLANE_CHR, EF_LAND_CHR, EF_NUKE_CHR)
(EF_TREATY_CHR, EF_ITEM, EF_INFRASTRUCTURE, EF_PRODUCT): New.  Not yet
used.
(my_ef_byname): Replacement for ef_byname() that sees the new
elements.
(xdchr): Work with empfile[] instead of chr_camap[].
(xdump): Use my_ef_byname() instead of ef_byname() and
chridx_by_name().
(camap, chr_camap, chridx_by_name): Remove.
2005-10-21 19:38:37 +00:00
Ron Koenderink
542709fae3 (ichr_ca,pchr_ca,dchr_ca,mchr_ca,plchr_ca,lchr_ca,nchr_ca,
tchr_ca,rpt_ca,intrchr_ca ) Move from src/lib/commands/xdump.c
to src/lib/global/nsc.c; external linkage.  They were created in
xdump.c to minimize initial impact on the source, but they
really belong to nsc.c, where other code can use them as well.
2005-10-18 12:14:10 +00:00
326ac671ba (EFF_OWNER): The assertion that EFF_OWNER implies ef_read() sets
player->owner is no longer used.  Use it to indicate that owner can be
accessed through struct genitem, similar to EFF_XY and EFF_GROUP.
(xdump): Fix ownership checking.  Old version worked only when
nxtitem() set player->owner.

(empfile): Set EFF_OWNER for EF_LOST.  This fixes `xdump lost'
disclosing other countries' losses.
(loststr): Document implications of EFF_OWNER.

(empfile): Set EFF_OWNER for EF_NATION.
(natstr): Rearrange members for EFF_OWNER, document.
(nat_ca): Unused so far.  Clean it up, add most missing selectors.
(fileinit): Use it.  This implements `xdump nation'.

(fileinit): Simplify setting map file size.
2005-05-29 14:14:33 +00:00
Ron Koenderink
953e5f6dc7 (xdprval): Only use of prnf() that is not for telegram text.
Replace by pr() in preparation of output conversion of telegram text
for the UTF-8 option.
2005-03-26 17:21:23 +00:00
345ad3dfe0 Update copyright notice. 2005-03-16 22:03:16 +00:00
58512e4813 First step towards generalizing NSC_TYPEID to arbitrary dictionaries.
(nsc_cat) New category NSC_ID.
(nstr_comp): Resolve identifiers instead of relying on nstr_comp_val()
and nstr_coerce_val().
(valstr, nstr_coerce_val): Remove valstr member val_as_type.
(nstr_parse_val, nstr_match_ca, nstr_match_val, nstr_resolve_id)
(nstr_resolve_sel, nstr_mkselval): New.
(nstr_comp_val): Rewrite using the above.
2005-02-24 16:14:53 +00:00
afa65c8f27 Break inclusion cycles. To simplify the change, move a few
declarations to other, no less sensible places.
2005-02-12 19:26:59 +00:00
858839f063 (dchr_ca): New selector maxpop. 2005-02-12 17:06:21 +00:00
b0ce8c0253 (xdump): Fail unless GUINEA_PIGS is enabled. 2004-12-16 22:05:15 +00:00
Marc Olzheim
d30942632b (I_NONE, I_CIVIL, I_MILIT, I_SHELL, I_GUN, I_PETROL, I_IRON, I_DUST,
I_BAR, I_FOOD, I_OIL, I_LCM, I_HCM, I_UW, I_RAD, I_MAX): Turn macros
into enumeration constants.
(i_type): New.  Use where appropriate.  No functional changes, except
that I_NONE is now catched properly in a few places.
2004-09-16 21:18:01 +00:00
aa6ad9d791 (NSC_SITYPE): New.
(dchr_ca): Use it to fix selector pkg's ca_type.
2004-09-11 15:25:38 +00:00
630e8e105a (valstr, nstr_exec, nstr_comp_val, nstr_exec_val, xdprval): Support
strings with length limit instead of zero termination.
(ship_ca, land_ca): New selectors rflags, rpath.  The latter is such a
string.
2004-09-11 08:45:17 +00:00
d446db0ac1 (mchr_ca, lchr_ca): Fix selector flag's ca_type.
(xdprval): Make sure floating-point numbers always contain a decimal
point, so they're easily distinguished from integers.
2004-09-10 18:58:30 +00:00
fac342ed49 Update copyright notice. 2004-09-07 15:07:16 +00:00
b3730786b5 (mchr_ca): Add missing entry for member `frnge'.
(xdprval): Silence compiler warning.
2004-09-07 06:12:15 +00:00
2dd13e096d (xdprval): Fix escaping of negative characters. 2004-09-04 13:11:02 +00:00
0262aaf464 (xdprval): Escape the space character so that a line can be simply
split into fields at space.
2004-09-04 08:15:33 +00:00
d89c268b8b (keymatch): Replace member km_func by km_type. Initializers adapted.
(emp_config, print_config): Cope with km_type.
(worldxset, intset, floatset, optstrset, doubleset, longset): Unused,
remove.

(emp_config): Fail if specified file can't be read or contains errors.
Used to succeed always, returning RET_OK.  RET_OK is not appropriate,
since this is not a command.  Return 0 on success, -1 on failure.
Callers ignore failure at the moment.  A missing or unreadable econfig
file used to be silently ignored.  It is still ignored, but no longer
silently.  It is questionable whether ignoring is wise, but that's
left for another day.

(emp_config): Improve diagnostic messages.

(set_option): Move diagnostics to caller.

(emp_config): Ignore leading whitespace in `#' comment lines.

(print_config): Simplify printing of km_comment.

(set_option): New parameter val, so it can set and clear options.
(delete_option): Remove.

(KM_ALLOC): Turn macro into enumeration constant.

(KM_INTERNAL): New.
(xdump, xdver): New version dump.

(keymatch, infodir, datadir, teldir, upfil, downfil, disablefil,
telfil, annfil, banfil, timestampfil, privname, privlog, update_times,
update_demandtimes, game_days, game_hours): Use plain char * instead
of s_char * for strings, void * for generic pointers.
2004-09-04 08:07:51 +00:00
4798d1466b (xdprval): Fix for strings containing backslashes. 2004-08-31 17:53:34 +00:00
5346422665 (xdprval): Fix for strings with characters printed as escapes. Print
null pointer as `nil' to distinguish it from empty string.
2004-08-31 17:45:45 +00:00
549347defa (xdump): New options dump.
(xdopt): New.
(xdhdr1): New, factored out of xdhdr().
2004-08-30 16:49:58 +00:00
8db5a84a8f (ship_ca): Fix selector name's ca_len.
(xflds): Ignore ca_len for NSC_STRINGY.
2004-08-30 16:20:05 +00:00
498fe97332 (chr_camap): Make table names differ from file empfile[] names, so
that they properly identify the dump.
2004-08-24 18:29:09 +00:00
083ce69713 (dchr_ca, intrchr_ca, rpt_ca, tchr_ca): New.
(chr_camap): Use them, but disable rpt_ca[], since rpt[] lacks a
sentinel.

(xhdr): Print `XDUMP' rather than `DUMP' to avoid confusion with old
dumps.  Don't print human readable timestamp.
2004-08-24 15:31:56 +00:00
3e5c0643db (NSC_EXTRA): New.
(sect_ca, NSC_GENITEM, plane_ca, land_ca): Use it for aliases and
cached functions of tech.
(xdflds, xdfldnam): Skip NSC_EXTRA fields.
2004-08-21 12:36:13 +00:00
0bd79fe5f3 (xdeval): Use NSC_NOTYPE instead of 0.
(xdprval): Cope with NSC_TYPEID.  Check for bad types.
2004-08-21 11:48:59 +00:00
5e381b6c57 (PLANENAMES, opt_PLANENAMES, Options, plchrstr, plchr_ca, plchr,
main): Remove nooption PLANENAMES.
2004-08-21 06:48:34 +00:00
914e21cdfd (xdprval): Passed ptrdiff_t as field width. 2004-08-21 06:20:25 +00:00
19f567bccf Comments, cosmetics. 2004-08-20 13:18:28 +00:00
fe50838824 (xdump): New command xdump (experimental).
(player_coms): Add xdump under #if 0.
2004-08-20 12:39:16 +00:00