Commit graph

93 commits

Author SHA1 Message Date
72127c838f (xuheader): Check for unexpected table before oopsing on !EFF_MEM. 2006-02-08 21:41:48 +00:00
8a6438b4e0 (xufldname, xufld): New, factored out of xuflds and specialized for
headers and for body lines, respectively.
(xflds): Call them through new parameter parse.  Callers changed.
2006-02-08 20:56:39 +00:00
361e33d70f (xucolumnheader): Don't gripe when xuflds() fails, because that one
already griped.
2006-02-08 20:49:47 +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
cf384676e8 (xuloadrow): Add support for NSC_SHORT. 2006-01-08 04:11:15 +00:00
3e400c018c Update copyright notice. 2006-01-05 13:36:57 +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
3aebb68ee7 Include config.h. 2005-12-27 18:04:19 +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
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
ea1e3b6090 (xuflds): Allow multiple spaces to separate fields or symbols in symbol set. 2005-11-30 17:16:02 +00:00
Ron Koenderink
e9ddf6a80b (xunsymbol): Fix formating. 2005-11-30 00:36:35 +00:00
Ron Koenderink
d223865d2b (xuloadrow): Add missing case for VAL_SYMBOL_SET for trailing
junk row check.

(xuskipcommentlines): Make the function static.
2005-11-30 00:33:37 +00:00
Ron Koenderink
bf94174f88 (xuflds, xunsymbol, xuloadrow): Split VAL_SYMBOL into
VAL_SYMBOL and VAL_SYMBOL_SET.  Identify SYMBOL_SET
by the '(' and ')'.  Switch SYMBOL_SET separator from '|' to a space.
2005-11-29 23:55:17 +00:00
Ron Koenderink
125af4b338 (xuskipcommentlines): Include the lines skipped in the line count. 2005-11-29 23:38:32 +00:00
Ron Koenderink
03121d44aa (xundump): Skip lines beginning with '#'.
These lines are considered comments.

(xuskipcommentlines): New.
2005-11-29 21:50:31 +00:00
Ron Koenderink
50e4ef3e39 (xunsymbol): Fix xunsymbol() to parse multiple symbols for a
symbol_set (NSC_BITS).
2005-11-13 01:45:39 +00:00
Ron Koenderink
ede257e8f2 (xundump): Add prototypes.h to get a prototype for
xundump().
2005-11-13 00:34:24 +00:00
Ron Koenderink
d8422caa84 (init_server, ef_load, xundump): Add ability to customize game
configurations.  The custom game configurations are loaded via
text files in the data directory.  Closes #752881.
2005-11-12 16:53:52 +00:00