(empfile,mdchr_ca,meta_type,meta_flags):

Add meta table and associated symbol tables.
This commit is contained in:
Ron Koenderink 2005-10-25 00:37:59 +00:00
parent 527117207b
commit 551263cb07
4 changed files with 47 additions and 0 deletions

View file

@ -124,6 +124,9 @@ struct empfile {
#define EF_PLANE_CHR_FLAGS 26 #define EF_PLANE_CHR_FLAGS 26
#define EF_LAND_CHR_FLAGS 27 #define EF_LAND_CHR_FLAGS 27
#define EF_NUKE_CHR_FLAGS 28 #define EF_NUKE_CHR_FLAGS 28
#define EF_META 29
#define EF_META_TYPE 30
#define EF_META_FLAGS 31
struct fileinit { struct fileinit {
int ef_type; int ef_type;

View file

@ -219,6 +219,9 @@ extern struct lookup ship_chr_flags[];
extern struct lookup plane_chr_flags[]; extern struct lookup plane_chr_flags[];
extern struct lookup land_chr_flags[]; extern struct lookup land_chr_flags[];
extern struct lookup nuke_chr_flags[]; extern struct lookup nuke_chr_flags[];
extern struct castr mdchr_ca[];
extern struct lookup meta_type[];
extern struct lookup meta_flags[];
/* 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

@ -152,6 +152,15 @@ struct empfile empfile[] = {
{EF_NUKE_CHR_FLAGS, "nuke chr flags", NULL, EFF_CFG, {EF_NUKE_CHR_FLAGS, "nuke chr flags", NULL, EFF_CFG,
sizeof(nuke_chr_flags[0]), NULL, NULL, NULL, sizeof(nuke_chr_flags[0]), NULL, NULL, NULL,
-1, -1, 0, 0, (char *)nuke_chr_flags, 0, lookup_ca}, -1, -1, 0, 0, (char *)nuke_chr_flags, 0, lookup_ca},
{EF_META, "meta", NULL, EFF_CFG,
sizeof(mdchr_ca[0]), NULL, NULL, NULL,
-1, -1, 0, 0, (char *)mdchr_ca, 0, mdchr_ca},
{EF_META_TYPE, "meta type", NULL, EFF_CFG,
sizeof(meta_type[0]), NULL, NULL, NULL,
-1, -1, 0, 0, (char *)meta_type, 0, lookup_ca},
{EF_META_FLAGS, "meta flags", NULL, EFF_CFG,
sizeof(meta_flags[0]), NULL, NULL, NULL,
-1, -1, 0, 0, (char *)meta_flags, 0, lookup_ca},
/* Sentinel */ /* Sentinel */
{EF_BAD, NULL, NULL, 0, {EF_BAD, NULL, NULL, 0,

View file

@ -579,3 +579,35 @@ struct lookup nuke_chr_flags[] = {
{0, 0} {0, 0}
}; };
struct castr mdchr_ca[] = {
{NSC_STRING, 0, 0, offsetof(struct castr, ca_name), "name", EF_BAD},
{NSC_CHAR, 0, 0, offsetof(struct castr, ca_type), "type", EF_META_TYPE},
{NSC_UCHAR, 0, 0, offsetof(struct castr, ca_flags), "flags", EF_META_FLAGS},
{NSC_USHORT, 0, 0, offsetof(struct castr, ca_len), "len", EF_BAD},
{NSC_INT, 0, 0, offsetof(struct castr, ca_table), "table", EF_BAD},
{NSC_NOTYPE, 0, 0, 0, NULL, EF_BAD}
};
struct lookup meta_flags[] = {
{NSC_DEITY, "DEITY"},
{NSC_EXTRA, "EXTRA"},
{0, ""}
};
struct lookup meta_type[] = {
{NSC_LONG, "d"},
{NSC_DOUBLE, "g"},
{NSC_STRING, "s"},
{NSC_TYPEID, "d"},
{NSC_CHAR, "d"},
{NSC_UCHAR, "d"},
{NSC_SHORT, "d"},
{NSC_USHORT, "d"},
{NSC_INT, "d"},
{NSC_XCOORD, "d"},
{NSC_YCOORD, "d"},
{NSC_TIME, "t"},
{NSC_FLOAT, "g"},
{NSC_STRINGY,"c"},
{0 ,""}
};