1 |
< |
/* Copyright (c) 1986 Regents of the University of California */ |
1 |
> |
/* Copyright (c) 1992 Regents of the University of California */ |
2 |
|
|
3 |
|
#ifndef lint |
4 |
|
static char SCCSid[] = "$SunId$ LBL"; |
24 |
|
|
25 |
|
#include <errno.h> |
26 |
|
|
27 |
+ |
#include <math.h> |
28 |
+ |
|
29 |
|
#include "calcomp.h" |
30 |
|
|
31 |
< |
#define MAXLINE 256 /* maximum line length */ |
30 |
< |
#define MAXWORD 64 /* maximum word length */ |
31 |
> |
#define MAXLINE 256 /* maximum line length */ |
32 |
|
|
33 |
< |
#define newnode() (EPNODE *)ecalloc(1, sizeof(EPNODE)) |
33 |
> |
#define newnode() (EPNODE *)ecalloc(1, sizeof(EPNODE)) |
34 |
|
|
35 |
< |
#define isid(c) (isalnum(c) || (c) == '_' || (c) == '.') |
35 |
> |
#define isdecimal(c) (isdigit(c) || (c) == '.') |
36 |
|
|
37 |
< |
#define isdecimal(c) (isdigit(c) || (c) == '.') |
38 |
< |
|
39 |
< |
extern double atof(), pow(); |
37 |
> |
#ifndef atof |
38 |
> |
extern double atof(); |
39 |
> |
#endif |
40 |
|
extern char *fgets(), *savestr(); |
41 |
|
extern char *emalloc(), *ecalloc(); |
42 |
|
extern EPNODE *curfunc; |
44 |
|
static double euminus(), echannel(), eargument(), enumber(); |
45 |
|
static double eadd(), esubtr(), emult(), edivi(), epow(); |
46 |
|
static double ebotch(); |
46 |
– |
extern int errno; |
47 |
|
|
48 |
|
int nextc; /* lookahead character */ |
49 |
|
|
50 |
< |
double (*eoper[])() = { /* expression operations */ |
50 |
> |
double (*eoper[])() = { /* expression operations */ |
51 |
|
ebotch, |
52 |
< |
#ifdef VARIABLE |
52 |
> |
#ifdef VARIABLE |
53 |
|
evariable, |
54 |
|
#else |
55 |
|
ebotch, |
56 |
|
#endif |
57 |
|
enumber, |
58 |
|
euminus, |
59 |
< |
#ifdef INCHAN |
59 |
> |
#ifdef INCHAN |
60 |
|
echannel, |
61 |
|
#else |
62 |
|
ebotch, |
63 |
|
#endif |
64 |
< |
#ifdef FUNCTION |
64 |
> |
#ifdef FUNCTION |
65 |
|
efunc, |
66 |
|
eargument, |
67 |
|
#else |
78 |
|
esubtr, |
79 |
|
0, |
80 |
|
edivi, |
81 |
< |
0,0,0,0,0,0,0,0,0,0,0,0,0, |
81 |
> |
0,0,0,0,0,0,0,0,0,0, |
82 |
|
ebotch, |
83 |
+ |
0,0, |
84 |
+ |
ebotch, |
85 |
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, |
86 |
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, |
87 |
|
epow, |
126 |
|
|
127 |
|
|
128 |
|
epfree(epar) /* free a parse tree */ |
129 |
< |
register EPNODE *epar; |
129 |
> |
register EPNODE *epar; |
130 |
|
{ |
131 |
|
register EPNODE *ep; |
132 |
|
|
136 |
|
case VAR: |
137 |
|
varfree(epar->v.ln); |
138 |
|
break; |
137 |
– |
#endif |
139 |
|
|
140 |
|
case SYM: |
141 |
|
freestr(epar->v.name); |
142 |
|
break; |
143 |
+ |
#endif |
144 |
|
|
145 |
|
case NUM: |
146 |
|
case CHAN: |
149 |
|
break; |
150 |
|
|
151 |
|
default: |
152 |
< |
for (ep = epar->v.kid; ep != NULL; ep = ep->sibling) |
152 |
> |
while ((ep = epar->v.kid) != NULL) { |
153 |
> |
epar->v.kid = ep->sibling; |
154 |
|
epfree(ep); |
155 |
+ |
} |
156 |
|
break; |
157 |
|
|
158 |
|
} |
161 |
|
} |
162 |
|
|
163 |
|
/* the following used to be a switch */ |
164 |
< |
#ifdef FUNCTION |
164 |
> |
#ifdef FUNCTION |
165 |
|
static double |
166 |
|
eargument(ep) |
167 |
< |
EPNODE *ep; |
167 |
> |
EPNODE *ep; |
168 |
|
{ |
169 |
|
return(argument(ep->v.chan)); |
170 |
|
} |
172 |
|
|
173 |
|
static double |
174 |
|
enumber(ep) |
175 |
< |
EPNODE *ep; |
175 |
> |
EPNODE *ep; |
176 |
|
{ |
177 |
|
return(ep->v.num); |
178 |
|
} |
179 |
|
|
180 |
|
static double |
181 |
|
euminus(ep) |
182 |
< |
EPNODE *ep; |
182 |
> |
EPNODE *ep; |
183 |
|
{ |
184 |
|
register EPNODE *ep1 = ep->v.kid; |
185 |
|
|
186 |
|
return(-evalue(ep1)); |
187 |
|
} |
188 |
|
|
189 |
< |
#ifdef INCHAN |
189 |
> |
#ifdef INCHAN |
190 |
|
static double |
191 |
|
echannel(ep) |
192 |
< |
EPNODE *ep; |
192 |
> |
EPNODE *ep; |
193 |
|
{ |
194 |
|
return(chanvalue(ep->v.chan)); |
195 |
|
} |
197 |
|
|
198 |
|
static double |
199 |
|
eadd(ep) |
200 |
< |
EPNODE *ep; |
200 |
> |
EPNODE *ep; |
201 |
|
{ |
202 |
|
register EPNODE *ep1 = ep->v.kid; |
203 |
|
|
206 |
|
|
207 |
|
static double |
208 |
|
esubtr(ep) |
209 |
< |
EPNODE *ep; |
209 |
> |
EPNODE *ep; |
210 |
|
{ |
211 |
|
register EPNODE *ep1 = ep->v.kid; |
212 |
|
|
215 |
|
|
216 |
|
static double |
217 |
|
emult(ep) |
218 |
< |
EPNODE *ep; |
218 |
> |
EPNODE *ep; |
219 |
|
{ |
220 |
|
register EPNODE *ep1 = ep->v.kid; |
221 |
|
|
224 |
|
|
225 |
|
static double |
226 |
|
edivi(ep) |
227 |
< |
EPNODE *ep; |
227 |
> |
EPNODE *ep; |
228 |
|
{ |
229 |
|
register EPNODE *ep1 = ep->v.kid; |
230 |
|
double d; |
240 |
|
|
241 |
|
static double |
242 |
|
epow(ep) |
243 |
< |
EPNODE *ep; |
243 |
> |
EPNODE *ep; |
244 |
|
{ |
245 |
|
register EPNODE *ep1 = ep->v.kid; |
246 |
|
double d; |
247 |
< |
int lasterrno; |
247 |
> |
int lasterrno; |
248 |
|
|
249 |
|
lasterrno = errno; |
250 |
|
errno = 0; |
251 |
|
d = pow(evalue(ep1), evalue(ep1->sibling)); |
252 |
< |
#ifdef IEEE |
252 |
> |
#ifdef IEEE |
253 |
|
if (!finite(d)) |
254 |
|
errno = EDOM; |
255 |
|
#endif |
263 |
|
|
264 |
|
static double |
265 |
|
ebotch(ep) |
266 |
< |
EPNODE *ep; |
266 |
> |
EPNODE *ep; |
267 |
|
{ |
268 |
|
eputs("Bad expression!\n"); |
269 |
|
quit(1); |
272 |
|
|
273 |
|
EPNODE * |
274 |
|
ekid(ep, n) /* return pointer to a node's nth kid */ |
275 |
< |
register EPNODE *ep; |
275 |
> |
register EPNODE *ep; |
276 |
|
register int n; |
277 |
|
{ |
278 |
|
|
286 |
|
|
287 |
|
int |
288 |
|
nekids(ep) /* return # of kids for node ep */ |
289 |
< |
register EPNODE *ep; |
289 |
> |
register EPNODE *ep; |
290 |
|
{ |
291 |
|
register int n = 0; |
292 |
|
|
302 |
|
char *fn; |
303 |
|
int ln; |
304 |
|
{ |
305 |
< |
static char inpbuf[MAXLINE]; |
305 |
> |
static char inpbuf[MAXLINE]; |
306 |
|
|
307 |
|
infp = fp; |
308 |
|
linbuf = inpbuf; |
328 |
|
} |
329 |
|
|
330 |
|
|
331 |
< |
scan() /* scan next character */ |
331 |
> |
getscanpos(fnp, lnp, spp, fpp) /* return current scan position */ |
332 |
> |
char **fnp; |
333 |
> |
int *lnp; |
334 |
> |
char **spp; |
335 |
> |
FILE **fpp; |
336 |
|
{ |
337 |
+ |
if (fnp != NULL) *fnp = infile; |
338 |
+ |
if (lnp != NULL) *lnp = lineno; |
339 |
+ |
if (spp != NULL) *spp = linbuf+linepos; |
340 |
+ |
if (fpp != NULL) *fpp = infp; |
341 |
+ |
} |
342 |
+ |
|
343 |
+ |
|
344 |
+ |
int |
345 |
+ |
scan() /* scan next character, return literal next */ |
346 |
+ |
{ |
347 |
+ |
register int lnext = 0; |
348 |
+ |
|
349 |
|
do { |
350 |
|
if (linbuf[linepos] == '\0') |
351 |
|
if (infp == NULL || fgets(linbuf, MAXLINE, infp) == NULL) |
357 |
|
} |
358 |
|
else |
359 |
|
nextc = linbuf[linepos++]; |
360 |
+ |
if (!lnext) |
361 |
+ |
lnext = nextc; |
362 |
|
if (nextc == '{') { |
363 |
|
scan(); |
364 |
|
while (nextc != '}') |
369 |
|
scan(); |
370 |
|
} |
371 |
|
} while (isspace(nextc)); |
372 |
+ |
return(lnext); |
373 |
|
} |
374 |
|
|
375 |
|
|
376 |
|
char * |
377 |
< |
ltoa(l) /* convert long to ascii */ |
377 |
> |
long2ascii(l) /* convert long to ascii */ |
378 |
|
long l; |
379 |
|
{ |
380 |
< |
static char buf[16]; |
380 |
> |
static char buf[16]; |
381 |
|
register char *cp; |
382 |
< |
int neg = 0; |
382 |
> |
int neg = 0; |
383 |
|
|
384 |
|
if (l == 0) |
385 |
|
return("0"); |
408 |
|
if (infile != NULL) eputs(infile); |
409 |
|
if (lineno != 0) { |
410 |
|
eputs(infile != NULL ? ", line " : "line "); |
411 |
< |
eputs(ltoa((long)lineno)); |
411 |
> |
eputs(long2ascii((long)lineno)); |
412 |
|
} |
413 |
< |
eputs(": syntax error:\n"); |
413 |
> |
eputs(":\n"); |
414 |
|
} |
415 |
|
eputs(linbuf); |
416 |
|
if (linbuf[strlen(linbuf)-1] != '\n') |
425 |
|
|
426 |
|
|
427 |
|
addekid(ep, ekid) /* add a child to ep */ |
428 |
< |
register EPNODE *ep; |
429 |
< |
EPNODE *ekid; |
428 |
> |
register EPNODE *ep; |
429 |
> |
EPNODE *ekid; |
430 |
|
{ |
431 |
|
if (ep->v.kid == NULL) |
432 |
|
ep->v.kid = ekid; |
439 |
|
} |
440 |
|
|
441 |
|
|
442 |
+ |
#if defined(VARIABLE) || defined(FUNCTION) |
443 |
|
char * |
444 |
|
getname() /* scan an identifier */ |
445 |
|
{ |
446 |
< |
static char str[MAXWORD+1]; |
447 |
< |
register int i; |
446 |
> |
static char str[MAXWORD+1]; |
447 |
> |
register int i, lnext; |
448 |
|
|
449 |
< |
for (i = 0; i < MAXWORD && isid(nextc); i++, scan()) |
450 |
< |
str[i] = nextc; |
449 |
> |
lnext = nextc; |
450 |
> |
for (i = 0; i < MAXWORD && isid(lnext); i++, lnext = scan()) |
451 |
> |
str[i] = lnext; |
452 |
|
str[i] = '\0'; |
453 |
+ |
while (isid(lnext)) /* skip rest of name */ |
454 |
+ |
lnext = scan(); |
455 |
|
|
456 |
|
return(str); |
457 |
|
} |
458 |
+ |
#endif |
459 |
|
|
460 |
|
|
461 |
|
int |
462 |
|
getinum() /* scan a positive integer */ |
463 |
|
{ |
464 |
< |
register int n; |
464 |
> |
register int n, lnext; |
465 |
|
|
466 |
|
n = 0; |
467 |
< |
while (isdigit(nextc)) { |
468 |
< |
n = n * 10 + nextc - '0'; |
469 |
< |
scan(); |
467 |
> |
lnext = nextc; |
468 |
> |
while (isdigit(lnext)) { |
469 |
> |
n = n * 10 + lnext - '0'; |
470 |
> |
lnext = scan(); |
471 |
|
} |
472 |
|
return(n); |
473 |
|
} |
476 |
|
double |
477 |
|
getnum() /* scan a positive float */ |
478 |
|
{ |
479 |
< |
register int i; |
479 |
> |
register int i, lnext; |
480 |
|
char str[MAXWORD+1]; |
481 |
|
|
482 |
|
i = 0; |
483 |
< |
while (isdigit(nextc) && i < MAXWORD) { |
484 |
< |
str[i++] = nextc; |
485 |
< |
scan(); |
483 |
> |
lnext = nextc; |
484 |
> |
while (isdigit(lnext) && i < MAXWORD) { |
485 |
> |
str[i++] = lnext; |
486 |
> |
lnext = scan(); |
487 |
|
} |
488 |
< |
if (nextc == '.' && i < MAXWORD) { |
489 |
< |
str[i++] = nextc; |
490 |
< |
scan(); |
491 |
< |
while (isdigit(nextc) && i < MAXWORD) { |
492 |
< |
str[i++] = nextc; |
493 |
< |
scan(); |
488 |
> |
if (lnext == '.' && i < MAXWORD) { |
489 |
> |
str[i++] = lnext; |
490 |
> |
lnext = scan(); |
491 |
> |
while (isdigit(lnext) && i < MAXWORD) { |
492 |
> |
str[i++] = lnext; |
493 |
> |
lnext = scan(); |
494 |
|
} |
495 |
|
} |
496 |
< |
if ((nextc == 'e' || nextc == 'E') && i < MAXWORD) { |
497 |
< |
str[i++] = nextc; |
498 |
< |
scan(); |
499 |
< |
if ((nextc == '-' || nextc == '+') && i < MAXWORD) { |
500 |
< |
str[i++] = nextc; |
501 |
< |
scan(); |
496 |
> |
if ((lnext == 'e' || lnext == 'E') && i < MAXWORD) { |
497 |
> |
str[i++] = lnext; |
498 |
> |
lnext = scan(); |
499 |
> |
if ((lnext == '-' || lnext == '+') && i < MAXWORD) { |
500 |
> |
str[i++] = lnext; |
501 |
> |
lnext = scan(); |
502 |
|
} |
503 |
< |
while (isdigit(nextc) && i < MAXWORD) { |
504 |
< |
str[i++] = nextc; |
505 |
< |
scan(); |
503 |
> |
while (isdigit(lnext) && i < MAXWORD) { |
504 |
> |
str[i++] = lnext; |
505 |
> |
lnext = scan(); |
506 |
|
} |
507 |
|
} |
508 |
|
str[i] = '\0'; |
513 |
|
|
514 |
|
EPNODE * |
515 |
|
getE1() /* E1 -> E1 ADDOP E2 */ |
516 |
< |
/* E2 */ |
516 |
> |
/* E2 */ |
517 |
|
{ |
518 |
|
register EPNODE *ep1, *ep2; |
519 |
|
|
524 |
|
scan(); |
525 |
|
addekid(ep2, ep1); |
526 |
|
addekid(ep2, getE2()); |
527 |
< |
#ifdef RCONST |
527 |
> |
#ifdef RCONST |
528 |
|
if (ep1->type == NUM && ep1->sibling->type == NUM) |
529 |
|
ep2 = rconst(ep2); |
530 |
|
#endif |
536 |
|
|
537 |
|
EPNODE * |
538 |
|
getE2() /* E2 -> E2 MULOP E3 */ |
539 |
< |
/* E3 */ |
539 |
> |
/* E3 */ |
540 |
|
{ |
541 |
|
register EPNODE *ep1, *ep2; |
542 |
|
|
547 |
|
scan(); |
548 |
|
addekid(ep2, ep1); |
549 |
|
addekid(ep2, getE3()); |
550 |
< |
#ifdef RCONST |
550 |
> |
#ifdef RCONST |
551 |
|
if (ep1->type == NUM && ep1->sibling->type == NUM) |
552 |
|
ep2 = rconst(ep2); |
553 |
|
#endif |
559 |
|
|
560 |
|
EPNODE * |
561 |
|
getE3() /* E3 -> E4 ^ E3 */ |
562 |
< |
/* E4 */ |
562 |
> |
/* E4 */ |
563 |
|
{ |
564 |
|
register EPNODE *ep1, *ep2; |
565 |
|
|
570 |
|
scan(); |
571 |
|
addekid(ep2, ep1); |
572 |
|
addekid(ep2, getE3()); |
573 |
< |
#ifdef RCONST |
573 |
> |
#ifdef RCONST |
574 |
|
if (ep1->type == NUM && ep1->sibling->type == NUM) |
575 |
|
ep2 = rconst(ep2); |
576 |
|
#endif |
582 |
|
|
583 |
|
EPNODE * |
584 |
|
getE4() /* E4 -> ADDOP E5 */ |
585 |
< |
/* E5 */ |
585 |
> |
/* E5 */ |
586 |
|
{ |
587 |
|
register EPNODE *ep1, *ep2; |
588 |
|
|
593 |
|
ep2->v.num = -ep2->v.num; |
594 |
|
return(ep2); |
595 |
|
} |
596 |
+ |
if (ep2->type == UMINUS) { /* don't generate -(-E5) */ |
597 |
+ |
efree((char *)ep2); |
598 |
+ |
return(ep2->v.kid); |
599 |
+ |
} |
600 |
|
ep1 = newnode(); |
601 |
|
ep1->type = UMINUS; |
602 |
|
addekid(ep1, ep2); |
610 |
|
|
611 |
|
EPNODE * |
612 |
|
getE5() /* E5 -> (E1) */ |
613 |
< |
/* VAR */ |
614 |
< |
/* NUM */ |
615 |
< |
/* $N */ |
616 |
< |
/* FUNC(E1,..) */ |
617 |
< |
/* ARG */ |
613 |
> |
/* VAR */ |
614 |
> |
/* NUM */ |
615 |
> |
/* $N */ |
616 |
> |
/* FUNC(E1,..) */ |
617 |
> |
/* ARG */ |
618 |
|
{ |
619 |
< |
int i; |
619 |
> |
int i; |
620 |
> |
char *nam; |
621 |
|
register EPNODE *ep1, *ep2; |
622 |
|
|
623 |
|
if (nextc == '(') { |
629 |
|
return(ep1); |
630 |
|
} |
631 |
|
|
632 |
< |
#ifdef INCHAN |
632 |
> |
#ifdef INCHAN |
633 |
|
if (nextc == '$') { |
634 |
|
scan(); |
635 |
|
ep1 = newnode(); |
640 |
|
#endif |
641 |
|
|
642 |
|
#if defined(VARIABLE) || defined(FUNCTION) |
643 |
< |
if (isalpha(nextc)) { |
644 |
< |
ep1 = newnode(); |
610 |
< |
ep1->type = VAR; |
611 |
< |
ep1->v.ln = varinsert(getname()); |
612 |
< |
|
643 |
> |
if (isalpha(nextc) || nextc == CNTXMARK) { |
644 |
> |
nam = getname(); |
645 |
|
#if defined(VARIABLE) && defined(FUNCTION) |
646 |
+ |
ep1 = NULL; |
647 |
|
if (curfunc != NULL) |
648 |
|
for (i = 1, ep2 = curfunc->v.kid->sibling; |
649 |
< |
ep2 != NULL; i++, ep2 = ep2->sibling) |
650 |
< |
if (!strcmp(ep2->v.name, ep1->v.ln->name)) { |
618 |
< |
epfree(ep1); |
649 |
> |
ep2 != NULL; i++, ep2 = ep2->sibling) |
650 |
> |
if (!strcmp(ep2->v.name, nam)) { |
651 |
|
ep1 = newnode(); |
652 |
|
ep1->type = ARG; |
653 |
|
ep1->v.chan = i; |
654 |
|
break; |
655 |
|
} |
656 |
+ |
if (ep1 == NULL) |
657 |
|
#endif |
658 |
< |
#ifdef FUNCTION |
658 |
> |
{ |
659 |
> |
ep1 = newnode(); |
660 |
> |
ep1->type = VAR; |
661 |
> |
ep1->v.ln = varinsert(nam); |
662 |
> |
} |
663 |
> |
#ifdef FUNCTION |
664 |
|
if (nextc == '(') { |
665 |
|
ep2 = newnode(); |
666 |
|
ep2->type = FUNC; |
674 |
|
syntax("')' expected"); |
675 |
|
scan(); |
676 |
|
} |
677 |
< |
#ifndef VARIABLE |
677 |
> |
#ifndef VARIABLE |
678 |
|
else |
679 |
|
syntax("'(' expected"); |
680 |
|
#endif |
681 |
|
#endif |
682 |
+ |
#ifdef RCONST |
683 |
+ |
if (isconstvar(ep1)) |
684 |
+ |
ep1 = rconst(ep1); |
685 |
+ |
#endif |
686 |
|
return(ep1); |
687 |
|
} |
688 |
|
#endif |
697 |
|
} |
698 |
|
|
699 |
|
|
700 |
< |
#ifdef RCONST |
700 |
> |
#ifdef RCONST |
701 |
|
EPNODE * |
702 |
|
rconst(epar) /* reduce a constant expression */ |
703 |
< |
register EPNODE *epar; |
703 |
> |
register EPNODE *epar; |
704 |
|
{ |
705 |
|
register EPNODE *ep; |
706 |
|
|
709 |
|
errno = 0; |
710 |
|
ep->v.num = evalue(epar); |
711 |
|
if (errno) |
712 |
< |
syntax("bad constant expression"); |
712 |
> |
syntax("bad constant expression"); |
713 |
|
epfree(epar); |
714 |
|
|
715 |
|
return(ep); |
716 |
|
} |
717 |
+ |
|
718 |
+ |
|
719 |
+ |
isconstvar(ep) /* is ep linked to a constant expression? */ |
720 |
+ |
register EPNODE *ep; |
721 |
+ |
{ |
722 |
+ |
#ifdef VARIABLE |
723 |
+ |
register EPNODE *ep1; |
724 |
+ |
#ifdef FUNCTION |
725 |
+ |
|
726 |
+ |
if (ep->type == FUNC) { |
727 |
+ |
if (!isconstfun(ep->v.kid)) |
728 |
+ |
return(0); |
729 |
+ |
for (ep1 = ep->v.kid->sibling; ep1 != NULL; ep1 = ep1->sibling) |
730 |
+ |
if (ep1->type != NUM && !isconstfun(ep1)) |
731 |
+ |
return(0); |
732 |
+ |
return(1); |
733 |
+ |
} |
734 |
+ |
#endif |
735 |
+ |
if (ep->type != VAR) |
736 |
+ |
return(0); |
737 |
+ |
ep1 = ep->v.ln->def; |
738 |
+ |
if (ep1 == NULL || ep1->type != ':') |
739 |
+ |
return(0); |
740 |
+ |
#ifdef FUNCTION |
741 |
+ |
if (ep1->v.kid->type != SYM) |
742 |
+ |
return(0); |
743 |
+ |
#endif |
744 |
+ |
return(1); |
745 |
+ |
#else |
746 |
+ |
return(ep->type == FUNC); |
747 |
+ |
#endif |
748 |
+ |
} |
749 |
+ |
|
750 |
+ |
|
751 |
+ |
#if defined(FUNCTION) && defined(VARIABLE) |
752 |
+ |
isconstfun(ep) /* is ep linked to a constant function? */ |
753 |
+ |
register EPNODE *ep; |
754 |
+ |
{ |
755 |
+ |
register EPNODE *dp; |
756 |
+ |
register LIBR *lp; |
757 |
+ |
|
758 |
+ |
if (ep->type != VAR) |
759 |
+ |
return(0); |
760 |
+ |
if ((dp = ep->v.ln->def) != NULL && dp->v.kid->type == FUNC) |
761 |
+ |
return(dp->type == ':'); |
762 |
+ |
if ((lp = ep->v.ln->lib) != NULL) |
763 |
+ |
return(lp->atyp == ':'); |
764 |
+ |
return(0); |
765 |
+ |
} |
766 |
+ |
#endif |
767 |
|
#endif |