* file.c: Empire game data file descriptions.
*
* Known contributors to this file:
- * Markus Armbruster, 2005-2007
+ * Markus Armbruster, 2005-2008
*/
#include <config.h>
#include "server.h"
#include "trade.h"
#include "treaty.h"
+#include "version.h"
#include "xy.h"
/* Number of elements in ARRAY. */
SZ((array)), 0, SZ((array)) - 1, SZ((array)) - 1, -1, NULL, NULL
/* Common configuration table flags */
-#define EFF_CFG (EFF_PRIVATE | EFF_MEM | EFF_STATIC)
+#define EFF_CFG (EFF_PRIVATE | EFF_MEM | EFF_STATIC | EFF_SENTINEL)
struct empfile empfile[] = {
/*
* that can be changed by users.
*
* Whatever of the above can't be done here must be done in
- * empfile_init() or empfile_fixup().
+ * empfile_init() or empfile_fixup(). Except cadef may be set in
+ * nsc_init() instead.
*/
/*
/*
* Static game data (configuration)
- *
- * These are all empty tables, except for EF_NEWS_CHR and EF_META.
- * Use read_builtin_tables() to fill them. EF_META gets bogus
- * size, cids and fids here. Fixed up by empfile_init().
+ */
+ /*
+ * Characteristics tables. Characteristics with a null file
+ * member are compiled in. The others are empty; use
+ * read_builtin_tables() to fill them.
*/
{EF_ITEM, "item", "item.config", ichr_ca,
ARRAY_CACHE(ichr, EFF_CFG)},
ARRAY_TABLE(rpt, EFF_CFG)},
{EF_INFRASTRUCTURE, "infrastructure", "infra.config", intrchr_ca,
ARRAY_CACHE(intrchr, EFF_CFG)},
+ /*
+ * Update schedule table. Use read_schedule() to fill.
+ */
{EF_UPDATES, "updates", NULL, update_ca,
ARRAY_TABLE(update_time, EFF_CFG)},
+ /*
+ * Special tables. EF_META gets bogus size, cids and fids here.
+ * Fixed up by empfile_init(). EF_VERSION's cadef is set by
+ * nsc_init().
+ */
{EF_TABLE, "table", NULL, empfile_ca,
ARRAY_TABLE(empfile, EFF_CFG)},
+ {EF_VERSION, "version", NULL, NULL,
+ sizeof(PACKAGE_STRING), EFF_STATIC, version, 1, 0, 1, 1, -1,
+ NULL, NULL},
{EF_META, "meta", NULL, mdchr_ca,
PTR_CACHE(mdchr_ca, EFF_CFG)},
/*
* Symbol tables
*
- * These get bogus size, cids and fids here. Fixed up by
+ * These get bogus csize, cids and fids here. Fixed up by
* empfile_init().
*/
#define SYMTAB(type, name, tab) \