Commit graph

36 commits

Author SHA1 Message Date
Ron Koenderink
23f134aa75 (empfile,mission_flags,ship_ca,land_ca,plane_ca): Add mission flags table. 2005-11-06 13:43:09 +00:00
Ron Koenderink
8d03e1ce8e (NSC_BITS): Remove the trailing comma as it is last row. 2005-11-05 20:25:16 +00:00
ae1f461058 (NSC_BITS): New.
(meta_flags): Update for it.
(ship_ca, mchr_ca, plane_ca, plchr_ca, land_ca, lchr_ca, nchr_ca)
treaty_ca, nat_ca, empfile_ca, mdchr_ca): Use it.

(symbol_ca): Move value selector to beginning of array.

(meta_flags): Downcase names.
2005-11-04 19:11:30 +00:00
e612db5cb6 (tchrstr, tchr_ca): Remove, use struct symbol and symbol_ca. Users
changed.
(tchr, treaty_flags): Rename for consistency with other flags.
2005-10-29 14:10:23 +00:00
02ec5df820 (lookup, symbol): Rename. Rename members to match selectors and
better reflect their purpose.  Users changed.
(lookup_ca, symbol_ca): Rename.
2005-10-29 07:46:42 +00:00
Ron Koenderink
445dfec9bc (NSC_CONST,castr,meta_flags): Add new flag NSC_CONST to castr.
(ichr_ca,pchr_ca,intrchr_ca): Use it.
2005-10-28 12:35:36 +00:00
Ron Koenderink
551263cb07 (empfile,mdchr_ca,meta_type,meta_flags):
Add meta table and associated symbol tables.
2005-10-25 00:37:59 +00:00
Ron Koenderink
fcf5c59513 (castr,empfile,ship_chr,plane_chr,land_chr,nuke_chr):
Add table index to castr to create a reference to the symbol table.
Add "ship chr flags" table to empfile.
Add "plane chr flags" table to empfile.
Add "land chr flags" table to empfile.
Add "nuke chr flags" table to empfile.
Add EF_SHIP_CHR_FLAGS reference to ship_chr.
Add EF_PLANE_CHR_FLAGS reference to plane_chr.
Add EF_LAND_CHR_FLAGS reference to land_chr.
Add EF_NUKE_CHR_FLAGS reference to nuke_chr.

(show_ship_capab,show_plane_capab,show_land_capab,
show_nuke_capab,ship_flags,land_flags,plane_flags,nuke_flags):
Move ship_flags nsc.c from show.c
Rename ship_flags to ship_chr_flags.
Move plane_flags nsc.c from show.c
Rename plane_flags to plane_chr_flags.
Move land_flags nsc.c from show.c
Rename land_flags to land_chr_flags.
Move nuke_flags nsc.c from show.c
Rename nuke_flags to nuke_chr_flags.
This is to accomodate future symbol table for EF_PLANE table.
2005-10-22 16:39:45 +00:00
Ron Koenderink
29d21997b9 (empfile[]) Add table of tables to empfile[]. 2005-10-22 12:38:58 +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
03abca9258 Remove leftover declarations that should have been removed along with
the definitions.
2005-09-30 19:40:41 +00:00
b1f973faed Indentation fix. 2005-03-17 21:47:42 +00:00
345ad3dfe0 Update copyright notice. 2005-03-16 22:03:16 +00:00
Ron Koenderink
0b172c6553 (NS_ALL) [_WIN32]: Change NS_EVERYTHING back to NS_ALL, #undef NS_ALL to prevent conflict with winsock2.h 2005-03-08 00:04:43 +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
Ron Koenderink
c99a5b4f43 (tend_nxtitem,nxtitem,sarg_type,snxtitem,snxtitem_all,snxtsct,nxtitemp):
change NS_ALL to NS_EVERYTHING in ns_seltype because of a
conflict with winsock2.h which is used in the WIN32 build.
2004-12-31 20:14:10 +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
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
fac342ed49 Update copyright notice. 2004-09-07 15:07:16 +00:00
dcfd251f95 caddr_t is obsolete. Replace by void *, except for struct empfile
member cache, which becomes char * to keep pointer arithmetic simple.
2004-08-23 18:29:44 +00:00
ba9748027b (NSC_STRINGY): New.
(nstr_promote, nstr_exec_val): Implement.

(nstr_exec_val): Ignored IDX for NSC_STRING values.

(nstr_exec): Implement NSC_STRING.

(ship_ca): New selector name.
2004-08-21 14:09:31 +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
930b30591a (NSC_NATID): New.
(sect_ca, NSC_GENITEM, nuke_ca, treaty_ca, loan_ca, news_ca, lost_ca,
commodity_ca, trade_ca, nat_ca): Use it.  Fixes sector selector
che_target.

(NSC_IELT, NSC_GENITEM, ship_ca, plane_ca, nuke_ca, treaty_ca,
news_ca, lost_ca, commodity_ca, trade_ca, nat_ca): Fix initializers
for ca_type.  Harmless signed/unsigned mismatches, except for plane
selectors att, def, nuke selector types, treaty selector exp, news
selector time, commodity selectors type, xbuy, ybuy.

(commodity_ca): Remove NSC_DEITY from selector price.
2004-08-21 11:59:23 +00:00
612f2dadb8 (valstr): Replace member val_as.off by val_as.sym, which contains
offset and index.  This is for the new dumps; conditions can't use it,
yet.
(nstr_comp_val): Zero index.
(nstr_exec_val): Implement index.

(nstr_exec_val): Simplify coercion to WANT.
2004-08-20 12:21:04 +00:00
543b0cba4f (NS_UNDEF, NS_LIST, NS_DIST, NS_AREA, NS_ALL, NS_XY, NS_GROUP): Turn
macros into enumeration constants.
(ns_seltype): New.  Use where appropriate.
2004-04-06 21:37:52 +00:00
4366c5ac6e Selector rewrite: values other than long, interpret identifiers
according to context, to make `lstat * ?type#spy&spy>1' work.  Closes
bug#825363, #905809, #905814 and #922968.
(nsc_type, packed_nsc_type, nsc_cat, packed_nsc_cat, nsc_flags): New.
(valstr): New.  Old code encoded values in type long, which was
somewhat hard to read and could only support signed integer values.
(nscstr): Redesign.  Use valstr.  Typed operator.
(castr): Split ca_code into ca_type, ca_flags, ca_off.  Tables
changed.
(nstr_comp, nstr_exec): Redesign and rewrite.  Callers changed.  They
used the old design incorrectly, which let players smash the stack
by supplying more than NCOND conditions.
(encode, nstr_comp_val, decode, nstr_exec_val): Rename, redesign, and
rewrite.  Callers changed.
(nstr_coerce_val): New.
(var_ca, sect_ca, ship_ca, land_ca): Checking both var_ca[] and the
object's ca complicates proper recognition of unique abbreviations.
Copy contents of var_ca[] into the ca of objects, remove var_ca[].

(surv): Reject values with category other than NSC_OFF and types that
can't be coerced to NSC_LONG.  Old code happily passed values with
category NSC_VAL to code_char().  The previous version interpreted
them correctly, but earlier versions interpreted them as NSC_OFF, then
logged `bad type in decode: 0' and evaluated them into zero.

(code_char): Used to test category NSC_VAR to decide whether to
display tens or hundreds.  NSC_VAR no longer exists.  Test type
instead.  Makes more sense anyway.
2004-04-02 19:02:12 +00:00
97e221baae Remove some unused stuff, mostly Empire 3 leftovers. 2004-02-28 09:45:10 +00:00
3d0178b994 (NSC_OPMASK, NSC_ISNUM1, NSC_ISNUM2, nscstr, nstr_comp, nstr_exec):
Simplify encoding of struct ncstr member oper.
2004-02-28 08:49:39 +00:00
bd54488715 (NSC_ROUND): No effect, remove. 2004-02-28 08:40:53 +00:00
d2e0c8224b Delete dead code, fix indentation, spelling, obvious warning
avoidance, doc fixes.  No functional changes.
2004-02-27 20:13:28 +00:00
c1be5d8657 Don't declare things in more than one place. Move some declarations
between headers.  Code is now fully prototyped and compiles cleanly
with gcc -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs
-Wredundant-decls.  Closes #723788.
2004-02-20 20:45:18 +00:00
4a3f0b8146 Add some missing declarations to headers. Remove some redundant
declarations elsewhere.  Change linkage of some functions to static.
2004-02-20 10:51:03 +00:00
237baffca9 Supply prototypes where possible. This uncovered type errors with
thread entrypoints:
(lwpSelect, shutdown_sequence): Parameters didn't match thread entry
point prototype.
(lwpEntryPoint): Arguments didn't match thread entry point prototype.

Change linkage of functions without prototype declaration to static
where possible.

Remove some superflous declarations, replace others by suitable
includes.
2004-02-17 17:59:30 +00:00
0992747d62 (ca): Unused, remove. 2004-02-06 23:02:05 +00:00
9b7adfbecc Indented with src/scripts/indent-emp. 2003-09-02 20:48:48 +00:00
d8b7fdfae1 Import of Empire 4.2.12 2003-08-23 12:23:04 +00:00