4 tbl
*keytbl
[TBLSIZE
]; /* key words */
5 tbl
*restbl
[TBLSIZE
]; /* reserved words */
6 tbl
*deftbl
[TBLSIZE
]; /* user-defined names */
40 "pile", COL
, /* synonyms ... */
87 "half", "\\f1\\(12\\fP",
88 "prime", "\\f1\\v'.5m'\\s+3\\(fm\\s-3\\v'-.5m'\\fP",
89 "dollar", "\\f1$\\fP",
94 "approx", "\\v'-.2m'\\z\\(ap\\v'.25m'\\(ap\\v'-.05m'",
95 "cdot", "\\v'-.3m'.\\v'.3m'",
96 "...", "\\v'-.25m'\\ .\\ .\\ .\\ \\v'.25m'",
97 ",...,", "\\f1,\\fP\\ .\\ .\\ .\\ \\f1,\\fP\\|",
146 "and", "\\f1and\\fP",
147 "for", "\\f1for\\fP",
151 "sin", "\\f1sin\\fP",
152 "cos", "\\f1cos\\fP",
153 "tan", "\\f1tan\\fP",
154 "arc", "\\f1arc\\fP",
155 "sinh", "\\f1sinh\\fP",
156 "coth", "\\f1coth\\fP",
157 "tanh", "\\f1tanh\\fP",
158 "cosh", "\\f1cosh\\fP",
159 "lim", "\\f1lim\\fP",
160 "log", "\\f1log\\fP",
162 "max", "\\f1max\\fP",
163 "min", "\\f1min\\fP",
164 "exp", "\\f1exp\\fP",
165 "det", "\\f1det\\fP",
171 register unsigned int h
;
173 for (h
= 0; *s
!= '\0'; )
179 tbl
*lookup(tbl
**tblp
, char *name
) /* find name in tbl */
183 for (p
= tblp
[hash(name
)]; p
!= NULL
; p
= p
->next
)
184 if (strcmp(name
, p
->name
) == 0)
189 void install(tbl
**tblp
, char *name
, char *cval
, int ival
) /* install name, vals in tblp */
194 if ((p
= lookup(tblp
, name
)) == NULL
) {
195 p
= (tbl
*) malloc(sizeof(tbl
));
197 ERROR
"out of space in install" FATAL
;
198 h
= hash(name
); /* bad visibility here */
207 void init_tbl(void) /* initialize tables */
210 extern int init_tune(void);
212 for (i
= 0; keyword
[i
].key
!= NULL
; i
++)
213 install(keytbl
, keyword
[i
].key
, (char *) 0, keyword
[i
].keyval
);
214 for (i
= 0; resword
[i
].res
!= NULL
; i
++)
215 install(restbl
, resword
[i
].res
, resword
[i
].resval
, 0);
216 init_tune(); /* tuning table done in tuning.c */