]> git.pond.sub.org Git - empserver/blob - src/lib/global/file.c
(ef_init): Remove cadef member from fileinit,
[empserver] / src / lib / global / file.c
1 /*
2  *  Empire - A multi-player, client/server Internet based war game.
3  *  Copyright (C) 1986-2005, Dave Pare, Jeff Bailey, Thomas Ruschak,
4  *                           Ken Stevens, Steve McClure
5  *
6  *  This program is free software; you can redistribute it and/or modify
7  *  it under the terms of the GNU General Public License as published by
8  *  the Free Software Foundation; either version 2 of the License, or
9  *  (at your option) any later version.
10  *
11  *  This program is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *  GNU General Public License for more details.
15  *
16  *  You should have received a copy of the GNU General Public License
17  *  along with this program; if not, write to the Free Software
18  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  *
20  *  ---
21  *
22  *  See the "LEGAL", "LICENSE", "CREDITS" and "README" files for all the
23  *  related information and legal notices. It is expected that any future
24  *  projects/authors will amend these files as needed.
25  *
26  *  ---
27  *
28  *  file.c: Empire game data file descriptions.
29  * 
30  *  Known contributors to this file:
31  *     
32  */
33
34 #include <stddef.h>
35 #include "misc.h"
36 #include "xy.h"
37 #include "loan.h"
38 #include "nsc.h"
39 #include "nuke.h"
40 #include "plane.h"
41 #include "ship.h"
42 #include "land.h"
43 #include "sect.h"
44 #include "trade.h"
45 #include "treaty.h"
46 #include "file.h"
47 #include "power.h"
48 #include "news.h"
49 #include "nat.h"
50 #include "lost.h"
51 #include "product.h"
52
53 #include "gamesdef.h"
54 #include "commodity.h"
55
56 struct empfile empfile[] = {
57     /* Dynamic game data */
58     {"sect", "sector", EFF_XY | EFF_OWNER,
59      0, sizeof(struct sctstr), NULL, NULL, NULL,
60      -1, -1, 0, 0, NULL, 0, sect_ca},
61     {"ship", "ship", EFF_XY | EFF_OWNER | EFF_GROUP,
62      0, sizeof(struct shpstr), NULL, NULL, NULL,
63      -1, -1, 0, 0, NULL, 0, ship_ca},
64     {"plane", "plane", EFF_XY | EFF_OWNER | EFF_GROUP,
65      0, sizeof(struct plnstr), NULL, NULL, NULL,
66      -1, -1, 0, 0, NULL, 0, plane_ca},
67     {"land", "land", EFF_XY | EFF_OWNER | EFF_GROUP,
68      0, sizeof(struct lndstr), NULL, NULL, NULL,
69      -1, -1, 0, 0, NULL, 0, land_ca},
70     {"nuke", "nuke", EFF_XY | EFF_OWNER,
71      0, sizeof(struct nukstr), NULL, NULL, NULL,
72      -1, -1, 0, 0, NULL, 0, nuke_ca},
73     {"news", "news", 0,
74      0, sizeof(struct nwsstr), NULL, NULL, NULL,
75      -1, -1, 0, 0, NULL, 0, news_ca},
76     {"treaty", "treaty", 0,
77      0, sizeof(struct trtstr), NULL, NULL, NULL,
78      -1, -1, 0, 0, NULL, 0, treaty_ca},
79     {"trade", "trade", 0,
80      0, sizeof(struct trdstr), NULL, NULL, NULL,
81      -1, -1, 0, 0, NULL, 0, trade_ca},
82     {"pow", "power", 0,
83      0, sizeof(struct powstr), NULL, NULL, NULL,
84      -1, -1, 0, 0, NULL, 0, NULL},
85     {"nat", "nation", EFF_OWNER,
86      0, sizeof(struct natstr), NULL, NULL, NULL,
87      -1, -1, 0, 0, NULL, 0, nat_ca},
88     {"loan", "loan", 0,
89      0, sizeof(struct lonstr), NULL, NULL, NULL,
90      -1, -1, 0, 0, NULL, 0, loan_ca},
91     {"map", "map", 0,
92      0, DEF_WORLD_X * DEF_WORLD_Y / 2, NULL, NULL, NULL,
93      -1, -1, 0, 0, NULL, 0, NULL},
94     {"bmap", "bmap", 0,
95      0, DEF_WORLD_X * DEF_WORLD_Y / 2, NULL, NULL, NULL,
96      -1, -1, 0, 0, NULL, 0, NULL},
97     {"commodity", "commodity", 0,
98      0, sizeof(struct comstr), NULL, NULL, NULL,
99      -1, -1, 0, 0, NULL, 0, commodity_ca},
100     {"lost", "lostitems", EFF_OWNER,
101      0, sizeof(struct loststr), NULL, NULL, NULL,
102      -1, -1, 0, 0, NULL, 0, lost_ca},
103
104     /* Static game data (configuation) */
105     {"sect chr", NULL, EFF_MEM,
106      0, sizeof(dchr[0]), NULL, NULL, NULL,
107      -1, -1, 0, 0, (char *)dchr, 0, dchr_ca},
108     {"ship chr", NULL, EFF_MEM,
109      0, sizeof(mchr[0]), NULL, NULL, NULL,
110      -1, -1, 0, 0, (char *)mchr, 0, mchr_ca},
111     {"plane chr", NULL, EFF_MEM,
112      0, sizeof(plchr[0]), NULL, NULL, NULL,
113      -1, -1, 0, 0, (char *)plchr, 0, plchr_ca},
114     {"land chr", NULL, EFF_MEM,
115      0, sizeof(lchr[0]), NULL, NULL, NULL,
116      -1, -1, 0, 0, (char *)lchr, 0, lchr_ca},
117     {"nuke chr", NULL, EFF_MEM,
118      0, sizeof(nchr[0]), NULL, NULL, NULL,
119      -1, -1, 0, 0, (char *)nchr, 0, nchr_ca},
120 #if 0
121     /* FIXME rpt[] lacks sentinel, xdchr() doesn't terminate */
122     {"news chr", NULL, EFF_MEM,
123      0, sizeof(rpt[0]), NULL, NULL, NULL,
124      -1, -1, 0, 0, (char *)rpt, 0, rpt_ca},
125 #endif
126     {"treaty chr", NULL, EFF_MEM,
127      0, sizeof(tchr[0]), NULL, NULL, NULL,
128      -1, -1, 0, 0, (char *)tchr, 0, tchr_ca},
129     {"item", NULL, EFF_MEM,
130      0, sizeof(ichr[0]), NULL, NULL, NULL,
131      -1, -1, 0, 0, (char *)ichr, 0, ichr_ca},
132     {"infrastructure", NULL, EFF_MEM,
133      0, sizeof(intrchr[0]), NULL, NULL, NULL,
134      -1, -1, 0, 0, (char *)intrchr, 0, intrchr_ca},
135     {"product", NULL, EFF_MEM,
136      0, sizeof(pchr[0]), NULL, NULL, NULL,
137      -1, -1, 0, 0, (char *)pchr, 0, pchr_ca},
138     {"table", NULL, EFF_MEM,
139      0, sizeof(empfile[0]), NULL, NULL, NULL,
140      -1, -1, 0, 0, (char *)empfile, 0, empfile_ca},
141
142     /* Sentinel */
143     {NULL, NULL, 0,
144      0, 0, NULL, NULL, NULL,
145      -1, -1, 0,0,NULL, 0, NULL}
146 };