51 |
|
#ifdef BIGLIB |
52 |
|
/* functions must be listed alphabetically */ |
53 |
|
static LIBR library[MAXLIB] = { |
54 |
< |
{ "acos", 1, l_acos }, |
55 |
< |
{ "asin", 1, l_asin }, |
56 |
< |
{ "atan", 1, l_atan }, |
57 |
< |
{ "atan2", 2, l_atan2 }, |
58 |
< |
{ "ceil", 1, l_ceil }, |
59 |
< |
{ "cos", 1, l_cos }, |
60 |
< |
{ "exp", 1, l_exp }, |
61 |
< |
{ "floor", 1, l_floor }, |
62 |
< |
{ "if", 3, l_if }, |
63 |
< |
{ "log", 1, l_log }, |
64 |
< |
{ "log10", 1, l_log10 }, |
65 |
< |
{ "rand", 1, l_rand }, |
66 |
< |
{ "select", 1, l_select }, |
67 |
< |
{ "sin", 1, l_sin }, |
68 |
< |
{ "sqrt", 1, l_sqrt }, |
69 |
< |
{ "tan", 1, l_tan }, |
54 |
> |
{ "acos", 1, ':', l_acos }, |
55 |
> |
{ "asin", 1, ':', l_asin }, |
56 |
> |
{ "atan", 1, ':', l_atan }, |
57 |
> |
{ "atan2", 2, ':', l_atan2 }, |
58 |
> |
{ "ceil", 1, ':', l_ceil }, |
59 |
> |
{ "cos", 1, ':', l_cos }, |
60 |
> |
{ "exp", 1, ':', l_exp }, |
61 |
> |
{ "floor", 1, ':', l_floor }, |
62 |
> |
{ "if", 3, ':', l_if }, |
63 |
> |
{ "log", 1, ':', l_log }, |
64 |
> |
{ "log10", 1, ':', l_log10 }, |
65 |
> |
{ "rand", 1, ':', l_rand }, |
66 |
> |
{ "select", 1, ':', l_select }, |
67 |
> |
{ "sin", 1, ':', l_sin }, |
68 |
> |
{ "sqrt", 1, ':', l_sqrt }, |
69 |
> |
{ "tan", 1, ':', l_tan }, |
70 |
|
}; |
71 |
|
|
72 |
|
static int libsize = 16; |
74 |
|
#else |
75 |
|
/* functions must be listed alphabetically */ |
76 |
|
static LIBR library[MAXLIB] = { |
77 |
< |
{ "ceil", 1, l_ceil }, |
78 |
< |
{ "floor", 1, l_floor }, |
79 |
< |
{ "if", 3, l_if }, |
80 |
< |
{ "rand", 1, l_rand }, |
81 |
< |
{ "select", 1, l_select }, |
77 |
> |
{ "ceil", 1, ':', l_ceil }, |
78 |
> |
{ "floor", 1, ':', l_floor }, |
79 |
> |
{ "if", 3, ':', l_if }, |
80 |
> |
{ "rand", 1, ':', l_rand }, |
81 |
> |
{ "select", 1, ':', l_select }, |
82 |
|
}; |
83 |
|
|
84 |
|
static int libsize = 5; |
145 |
|
} |
146 |
|
|
147 |
|
|
148 |
< |
funset(fname, nargs, fptr) /* set a library function */ |
148 |
> |
funset(fname, nargs, assign, fptr) /* set a library function */ |
149 |
|
char *fname; |
150 |
|
int nargs; |
151 |
+ |
int assign; |
152 |
|
double (*fptr)(); |
153 |
|
{ |
154 |
|
register LIBR *lp; |
162 |
|
if (strcmp(lp[-1].fname, fname) > 0) { |
163 |
|
lp[0].fname = lp[-1].fname; |
164 |
|
lp[0].nargs = lp[-1].nargs; |
165 |
+ |
lp[0].atyp = lp[-1].atyp; |
166 |
|
lp[0].f = lp[-1].f; |
167 |
|
} else |
168 |
|
break; |
170 |
|
} |
171 |
|
lp[0].fname = savestr(fname); |
172 |
|
lp[0].nargs = nargs; |
173 |
+ |
lp[0].atyp = assign; |
174 |
|
lp[0].f = fptr; |
175 |
|
} |
176 |
|
|