4 tbl
*keytbl
[TBLSIZE
]; /* key words */
5 tbl
*restbl
[TBLSIZE
]; /* reserved words */
6 tbl
*deftbl
[TBLSIZE
]; /* user-defined names */
40 "pile", COL
, /* synonyms ... */
89 "half", "\\f1\\(12\\fP",
90 "prime", "\\f1\\v'.5m'\\s+3\\(fm\\s-3\\v'-.5m'\\fP",
91 "dollar", "\\f1$\\fP",
96 "approx", "\\v'-.2m'\\z\\(ap\\v'.25m'\\(ap\\v'-.05m'",
97 "cdot", "\\v'-.3m'.\\v'.3m'",
98 "...", "\\v'-.25m'\\ .\\ .\\ .\\ \\v'.25m'",
99 ",...,", "\\f1,\\fP\\ .\\ .\\ .\\ \\f1,\\fP\\|",
148 "and", "\\f1and\\fP",
149 "for", "\\f1for\\fP",
153 "sin", "\\f1sin\\fP",
154 "cos", "\\f1cos\\fP",
155 "tan", "\\f1tan\\fP",
156 "arc", "\\f1arc\\fP",
157 "sinh", "\\f1sinh\\fP",
158 "coth", "\\f1coth\\fP",
159 "tanh", "\\f1tanh\\fP",
160 "cosh", "\\f1cosh\\fP",
161 "lim", "\\f1lim\\fP",
162 "log", "\\f1log\\fP",
164 "max", "\\f1max\\fP",
165 "min", "\\f1min\\fP",
166 "exp", "\\f1exp\\fP",
167 "det", "\\f1det\\fP",
173 register unsigned int h
;
175 for (h
= 0; *s
!= '\0'; )
181 tbl
*lookup(tbl
**tblp
, char *name
) /* find name in tbl */
185 for (p
= tblp
[hash(name
)]; p
!= NULL
; p
= p
->next
)
186 if (strcmp(name
, p
->name
) == 0)
191 void install(tbl
**tblp
, char *name
, char *cval
, int ival
) /* install name, vals in tblp */
196 if ((p
= lookup(tblp
, name
)) == NULL
) {
197 p
= (tbl
*) malloc(sizeof(tbl
));
199 ERROR
"out of space in install" FATAL
;
200 h
= hash(name
); /* bad visibility here */
209 void init_tbl(void) /* initialize tables */
212 extern int init_tune(void);
214 for (i
= 0; keyword
[i
].key
!= NULL
; i
++)
215 install(keytbl
, keyword
[i
].key
, (char *) 0, keyword
[i
].keyval
);
216 for (i
= 0; resword
[i
].res
!= NULL
; i
++)
217 install(restbl
, resword
[i
].res
, resword
[i
].resval
, 0);
218 init_tune(); /* tuning table done in tuning.c */