(empfile[]) Add table of tables to empfile[].

This commit is contained in:
Ron Koenderink 2005-10-22 12:38:58 +00:00
parent c4c46190bf
commit 29d21997b9
4 changed files with 13 additions and 0 deletions

View file

@ -107,6 +107,7 @@ struct empfile {
#define EF_ITEM 21 #define EF_ITEM 21
#define EF_INFRASTRUCTURE 22 #define EF_INFRASTRUCTURE 22
#define EF_PRODUCT 23 #define EF_PRODUCT 23
#define EF_TABLE 24
#define EF_NMAP 222 /* Kinda bogus, but used to describe a newdesmap #define EF_NMAP 222 /* Kinda bogus, but used to describe a newdesmap
instead of bmap or map. */ instead of bmap or map. */

View file

@ -204,6 +204,7 @@ extern struct castr trade_ca[];
extern struct castr nat_ca[]; extern struct castr nat_ca[];
extern struct castr intrchr_ca[]; extern struct castr intrchr_ca[];
extern struct castr rpt_ca[]; extern struct castr rpt_ca[];
extern struct castr empfile_ca[];
/* src/lib/subs/nstr.c */ /* src/lib/subs/nstr.c */
extern int nstr_comp(struct nscstr *np, int len, int type, char *str); extern int nstr_comp(struct nscstr *np, int len, int type, char *str);

View file

@ -135,6 +135,9 @@ struct empfile empfile[] = {
{"product", NULL, EFF_MEM, {"product", NULL, EFF_MEM,
0, sizeof(pchr[0]), NULL, NULL, NULL, 0, sizeof(pchr[0]), NULL, NULL, NULL,
-1, -1, 0, 0, (char *)pchr, 0, pchr_ca}, -1, -1, 0, 0, (char *)pchr, 0, pchr_ca},
{"table", NULL, EFF_MEM,
0, sizeof(empfile[0]), NULL, NULL, NULL,
-1, -1, 0, 0, (char *)empfile, 0, empfile_ca},
/* Sentinel */ /* Sentinel */
{NULL, NULL, 0, {NULL, NULL, 0,

View file

@ -51,6 +51,7 @@
#include "commodity.h" #include "commodity.h"
#include "lost.h" #include "lost.h"
#include "product.h" #include "product.h"
#include "file.h"
#define fldoff(str, fld) offsetof(struct str, fld) #define fldoff(str, fld) offsetof(struct str, fld)
@ -495,3 +496,10 @@ struct castr rpt_ca[] = {
{NSC_NOTYPE, 0, 0, 0, NULL} {NSC_NOTYPE, 0, 0, 0, NULL}
}; };
struct castr empfile_ca[] = {
{NSC_STRING, 0, 0, offsetof(struct empfile, name), "name"},
{NSC_STRING, 0, 0, offsetof(struct empfile, file), "file_name"},
{NSC_INT, 0, 0, offsetof(struct empfile, flags), "flags"},
{NSC_NOTYPE, 0, 0, 0, NULL}
};