]> git.pond.sub.org Git - empserver/blobdiff - include/file.h
Update copyright notice
[empserver] / include / file.h
index 044418958fc954214924383eccd99ce8016624f9..59a9b7c1d5f20f85cbb1f92aceee838ab682c64e 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2014, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2017, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                Ken Stevens, Steve McClure, Markus Armbruster
  *
  *  Empire is free software: you can redistribute it and/or modify
@@ -27,7 +27,7 @@
  *  file.h: Describes Empire tables (`files' for historical reasons)
  *
  *  Known contributors to this file:
- *     Markus Armbruster, 2005-2012
+ *     Markus Armbruster, 2005-2016
  */
 
 #ifndef FILE_H
@@ -38,7 +38,7 @@
 struct empfile {
     /* Members with immutable values */
     int uid;                   /* Table ID */
-    char *name;                        /* Empire name (e.g., "treaty") */
+    char *name;                        /* Empire name (e.g., "land") */
     char *pretty_name;         /* prettier name, e.g. "land unit" */
     char *file;                        /* file name, relative to gamedir for
                                   game state, to builtindir for config */
@@ -86,7 +86,7 @@ struct empfile {
     void (*onresize)(int type);
 };
 
-struct emptypedstr {
+struct ef_typedstr {
     signed ef_type: 8;
     unsigned seqno: 12;
     unsigned generation: 12;
@@ -100,7 +100,7 @@ struct emptypedstr {
  * The remaining flags record how the table is being used.
  */
 /* Immutable flags, fixed at compile-time */
-/* Dereferencing entry address cast to struct emptypedstr * is safe */
+/* Dereferencing entry address cast to struct ef_typedstr * is safe */
 #define EFF_TYPED      bit(0)
 /*
  * EFF_XY / EFF_OWNER / EFF_GROUP assert that coordinates / owner /
@@ -130,6 +130,12 @@ struct emptypedstr {
 /* Create table file, clobbering any existing file */
 #define EFF_CREATE     bit(16)
 
+/*
+ * A value larger than any struct empfile member size where member
+ * cadef is not null.
+ */
+#define EF_WITH_CADEF_MAX_ENTRY_SIZE 1024
+
 /*
  * Empire `file types'
  * These are really table IDs.  Some tables are backed by files, some
@@ -146,10 +152,12 @@ enum {
     EF_LAND,
     EF_NUKE,
     EF_NEWS,
-    EF_TREATY,
     EF_TRADE,
     EF_POWER,
     EF_NATION,
+    EF_RELAT,
+    EF_CONTACT,
+    EF_REJECT,
     EF_LOAN,
     EF_MAP,
     EF_BMAP,
@@ -193,8 +201,8 @@ enum {
     EF_RESOURCES,
     EF_RETREAT_FLAGS,
     EF_SECTOR_NAVIGATION,
+    EF_SECTOR_CHR_FLAGS,
     EF_SHIP_CHR_FLAGS,
-    EF_TREATY_FLAGS,
     /* Views */
     EF_COUNTRY,
     /* Number of types: */
@@ -219,6 +227,7 @@ extern int ef_flush(int);
 extern void ef_blank(int, int, void *);
 extern int ef_write(int, int, void *);
 extern void ef_set_uid(int, void *, int);
+extern int ef_typedstr_eq(struct ef_typedstr *, struct ef_typedstr *);
 extern int ef_extend(int, int);
 extern int ef_ensure_space(int, int, int);
 extern int ef_id_limit(int);