tbl
*keytbl
[TBLSIZE
]; /* key words */
tbl
*restbl
[TBLSIZE
]; /* reserved words */
tbl
*deftbl
[TBLSIZE
]; /* user-defined names */
#ifdef NEQN /* make ndefine synonym for define, tdefine a no-op */
#else /* tdefine = define, ndefine = no-op */
"prime", "\\f1\\(fm\\fP",
"cdot", "\\v'-.5'.\\v'.5'",
"approx", "\\v'-.2m'\\z\\(ap\\v'.25m'\\(ap\\v'-.05m'",
"cdot", "\\v'-.3m'.\\v'.3m'",
"...", "\\v'-.3m'\\ .\\ .\\ .\\ \\v'.3m'",
",...,", ",\\ .\\ .\\ .\\ ,\\|",
tbl
*lookup(tblp
, name
, defn
) /* find name in tbl. if defn non-null, install */
for (h
= 0; *s
!= '\0'; )
for (p
= tblp
[h
]; p
!= NULL
; p
= p
->next
)
if (strcmp(name
, p
->name
) == 0) { /* found it */
p
= (tbl
*) malloc(sizeof (tbl
));
error(FATAL
, "out of space in lookup");
init_tbl() /* initialize all tables */
for (i
= 0; keyword
[i
].key
!= NULL
; i
++)
lookup(keytbl
, keyword
[i
].key
, keyword
[i
].keyval
);
for (i
= 0; resword
[i
].res
!= NULL
; i
++)
lookup(restbl
, resword
[i
].res
, resword
[i
].resval
);