Commit graph

294 commits

Author SHA1 Message Date
1e17cc77cb (verify_row): if/else with negated condition is confusing. Negate
condition, swap conditional statements.
2006-02-05 19:13:58 +00:00
b11b81da8f (verify_row): Plug memory leak. 2006-02-05 19:08:49 +00:00
Ron Koenderink
426eece569 Properly parse and validate column headers:
(enum_value, value, xuflds, freeflds): Parse additional syntax:
numeric and symbolic index.
(xucolumnheader): Use it to parse column header line.  Check names
and indexes match meta-data.  Symbolic indexes not yet implemented.
(xuloadrow): Reject the additional syntax.
2006-01-30 22:23:43 +00:00
Ron Koenderink
79f672969b (xuheader): Remove values[], not used. 2006-01-29 19:12:52 +00:00
Ron Koenderink
8900dfaa3d (xuflds): Terminated the value list when a bad separator is found. 2006-01-22 17:37:05 +00:00
4515b84c59 COPYING duplicates information from README. Remove. Move GPL from
LICENSE to COPYING, because that's where it usually is.  Update all
the references to these files.
2006-01-21 19:48:41 +00:00
Ron Koenderink
036a623a40 (xunsymbol): Ensure the table is a symbol table before searching it. 2006-01-21 17:33:02 +00:00
Ron Koenderink
04a8b84592 (ship_bomb, deli, do_demo, fuel, grin, look_ship)
(ltend, multifire, quite_bigdef, mine, landmine)
(do_loan, prod, printdiff, sell, sona, stre)
(tend, fire_dchrg, vers, work, ac_planedamage)
(ac_shipflak, ask_off, get_mine_dsupport, att_fight)
(ask_move_in_off, detonate, sd, land_gun)
(land_unitgun, lnd_fort_interdiction, lnd_fortify)
(perform_mission, pln_mine, pln_mobcost)
(retreat_ship1, retreat_land1, shp_sweep)
(shp_fort_interdiction, shp_missle_defense)
(new_work, growfood, upd_land, land_repair)
(get_materials, do_mob_ship, do_mob_land)
(load_it, unload_it, prod_plane, produce)
(guerrilla, upd_buildeff, spread_fallout)
(upd_ship, ship_repair, min, dmin, MIN):
Remove min() and dmin() functions and replace
with a MIN macro in misc.h.  Remove local MIN
macros and use the new one in misc.h.  This
change removes the need for the special
case for _WIN32.

(fuel, look_ship, multifire, mission, sona)
(plane_sona, ef_open, player_accept, player_main)
(ac_dog, att_get_combat, calc_mobcost)
(ask_move_in_off, intelligence_report)
(build_mission_list_type, perform_mission)
(show_mission, use_supply, dodistribute)
(allocate_memory, max, dmax, MAX):
Remove max() and dmax() functions and replace
with a MAX macro in misc.h.  Remove local MAX
macros and use the new one in misc.h.  This
change removes the need for the special
case for _WIN32.
2006-01-12 14:23:55 +00:00
Ron Koenderink
cf384676e8 (xuloadrow): Add support for NSC_SHORT. 2006-01-08 04:11:15 +00:00
c791849595 (rejectname): Use static storage duration for rejects[]. 2006-01-06 17:58:21 +00:00
3e400c018c Update copyright notice. 2006-01-05 13:36:57 +00:00
8b16c31223 Change nation status from bits to a simple enum:
(nat_status, STAT_UNUSED, STAT_VIS, STAT_ACTIVE): New.
(STAT_NEW, STAT_SANCT, STAT_GOD): Change into nat_status members.
(STAT_INUSE, STAT_NORM): Remove.
(natstr): Use new nat_status for nat_stat.
    New value       Old value
    STAT_UNUSED     0
    STAT_NEW        STAT_INUSE | STAT_NEW
    STAT_VIS        STAT_INUSE
    STAT_SANCT      STAT_INUSE | STAT_SANCT
    STAT_ACTIVE     STAT_INUSE | STAT_NORM
    STAT_GOD        STAT_INUSE | STAT_NORM | STAT_GOD
Users changed.
2006-01-04 22:49:42 +00:00
bea83adb93 Some s_char killings. 2006-01-04 21:40:30 +00:00
c53472e2f2 (demand_check): Slight simplification. 2006-01-04 16:48:43 +00:00
c13a592bf5 (STAT_ABS): Only set by files program for country #0. Prevents offset
and origin commands from working.  Remove.
2006-01-04 14:27:10 +00:00
Ron Koenderink
6f51053336 (verify_row): Add cast to an int for a call to sizeof().
This removes a warning.
2006-01-01 19:32:52 +00:00
Ron Koenderink
4871a10a9b (xundump): Add the ability to support the parsing of the human
readable form.

(xucolumnheader): New function.
2006-01-01 03:44:41 +00:00
Ron Koenderink
15e40c55cd (xundump): Move the header parsing into a separate function xuheader().
Move the trailer parsing into a separate function xutrailer().

(xuheader, xutrailer): New functions.
2006-01-01 03:37:36 +00:00
c3900f8424 (empfile, fileinit, lnd_init, lnd_postread, lnd_prewrite, nuk_init)
(nuk_postread, nuk_prewrite, pln_init, pln_postread, pln_prewrite)
(sct_postread, sct_prewrite, shp_init, shp_postread, shp_prewrite)
(ef_extend): Use void * for generic pointer parameter.
2005-12-31 12:52:18 +00:00
686eadad37 (att_mode, xyas, ownxy, prbuf): Get rid of s_char. Users changed.
(ATTRIBUTE): Don't disable use of gcc __attribute__ when s_char is
signed char.  All format strings are now char *.
2005-12-28 22:30:52 +00:00
3aebb68ee7 Include config.h. 2005-12-27 18:04:19 +00:00
a98626df2d Replace the build process. The new one requires GNU Make, Autoconf
and Autoconf macros that come with Automake.  It supports multiple
separate builds of the same source tree, and updates dependencies
automatically.  Targets info, html, install, install-html, uninstall
and dist are not yet implemented.

System configuration is now automatic.  Previously, you had to choose
one of several canned system configurations, defined in Make.sysdefs.
Currently, system configuration always uses UCONTEXT for LWP, and
chooses LWP only if its requirements are met.

Feature configuration changed: instead of editing build.conf (further
processed by doconfig), you pass arguments to configure.  Note that
build.conf settings that can be overridden in econfig have no
configure equivalent; just edit econfig instead.

Because generated headers complicate makefiles, fold gamesdef.h into
its users: path.c and ipglob.c become path.c.in and ipglob.c.in,
constants.c, vers.c, options.h simply hardcode defaults (most of them
are run-time configurable).

Call the client empire instead of emp_client.  This matches what the
old standalone build did.
2005-12-20 20:25:35 +00:00
Ron Koenderink
16d0f5d133 (natstate): Add STAT_SANCT case so the nation report properly
shows SANCTUARY instead of VISITOR for countries in sanctuary.
2005-12-20 01:49:55 +00:00
Ron Koenderink
6157409f20 (influx): Remove carriage return. 2005-12-18 03:53:52 +00:00
Ron Koenderink
5ffef496ea (coun_list, repo_list, nati): Replace in-flux determination code with influx().
(influx): New.
2005-12-17 20:18:54 +00:00
3dc35a77f7 (xundump): Eat whitespace after table, so that caller can check for
trailing junk more easily.  This fixes that check in ef_load().
2005-12-17 15:09:43 +00:00
965bf6dbe4 (xundump): Fix table row counting, broken by rev. 1.23. 2005-12-17 08:25:57 +00:00
e29f288289 Remove silly superflous parenthesis. 2005-12-03 21:14:26 +00:00
2ebc947969 (xundump): Fix rev. 1.19. 2005-12-03 16:15:16 +00:00
86a59e4de4 (xuflds, xunsymbol, xuloadrow): Symbol sets.
(VAL_SYMBOL_SET, getid, xunsymbol1): New.

(xunsymbol): New argument n for more useful diagnostics.

(xuloadrow): Remove redundant semantic check.
2005-12-03 14:14:44 +00:00
739f346584 (xunsymbol): Fix design flaw: negative symbol values were interpreted
as failure.
2005-12-03 13:38:52 +00:00
b7eb39ebef (xuflds): Allow unescaped space and tab in strings. Also fix the
previous revision, which broke '#' in strings.
2005-12-03 11:36:55 +00:00
1eb7d1795c (xuloadrow): Fix crash. 2005-12-03 11:19:20 +00:00
0a7291eb37 Less rigid field separators, support comments:
(skipfs): New.
(xuflds, xundump): Use it.  Update field scanf stop-sets accordingly.
(xuflds): Update test for good field separator.

(xundump): Fail silently if nothing can be read and no specific table
is expected.
2005-12-03 11:04:44 +00:00
8ca219819c (xuloadrow): Obey NSC_EXTRA.
(xuloadrow): Remove redundant `not supported' check.
2005-12-03 10:15:57 +00:00
29c83d1511 (ef_init_srv): Call ef_init() before ef_load().
(xundump): Set empfile member cids in addition to fids.

(xundump): Clarify shortcomings: requires EFF_MEM, appends sentinel
always, can't grow dynamic cache.

(xundump): Return table type on success.
2005-12-03 10:09:53 +00:00
b8befab521 (xuloadrow): Fix rev. 1.11. 2005-12-03 09:17:30 +00:00
e1420d2a14 (xundump): Fix parsing of XDUMP header (really!) and footer. 2005-12-02 19:22:27 +00:00
b2e18c5125 (xuflds): The way field separators were parsed lead to confusing
diagnostics on EOF.  Fix.  Also simplify treatment of newline.

(xuflds): Require identifiers to start with a letter.
2005-12-02 18:57:55 +00:00
1e4ecda185 (xundump): Fix parsing of XDUMP header. 2005-12-02 17:27:19 +00:00
aa63e64107 (xuflds): Test for no fields was off by one. Remove it; let caller
deal with missing fields.
2005-12-02 17:08:36 +00:00
f6bec2c3f7 (xuflds): Simplify test for space in values[]. 2005-12-02 17:05:25 +00:00
8d0ec9db08 (xundump): Improve diagnostics. Remove superflous check for
unexpected EOF.
2005-12-02 16:06:24 +00:00
8e6baf0bcb (xundump): Table names no longer contain whitespace. Simplify. 2005-12-01 20:00:15 +00:00
95a2523b9f (xuflds): Fix confusing diagnostics on unexpected EOF. 2005-12-01 19:28:31 +00:00
656b726a24 Plug memory leaks:
(freeflds): New.
(xundump): Call it.
(xuloadrow): Leave freeing storage to freeflds().
(xuflds): Ensure values[] is terminated with a VAL_NOTUSED element
even on error.
2005-12-01 19:12:54 +00:00
33912952bb Roll back to rev. 1.3 in preparation of a re-engineering of the
changes since then.
2005-12-01 18:56:41 +00:00
Ron Koenderink
65cda58286 (verify_row): Remove // comment.
Change %d to %ld when printing a long.
2005-12-01 00:39:05 +00:00
Ron Koenderink
40c821d28b (ef_init_srv): Add a call ef_verify() to verify game data and game
configuration consistency.

(ef_verify): New.  Verifies game data and game
configuration consistency.
2005-11-30 19:17:58 +00:00
Ron Koenderink
ea1e3b6090 (xuflds): Allow multiple spaces to separate fields or symbols in symbol set. 2005-11-30 17:16:02 +00:00