59 |
|
static EPNODE *outchan; |
60 |
|
|
61 |
|
EPNODE *curfunc = NULL; |
62 |
– |
#define dname(ep) ((ep)->v.kid->type == SYM ? \ |
63 |
– |
(ep)->v.kid->v.name : \ |
64 |
– |
(ep)->v.kid->v.kid->v.name) |
62 |
|
|
63 |
|
|
64 |
|
void |
75 |
|
eputs(": cannot open\n"); |
76 |
|
quit(1); |
77 |
|
} |
78 |
< |
initfile(fp, fname, 0); |
78 |
> |
#ifdef getc_unlocked /* avoid stupid semaphores */ |
79 |
> |
flockfile(fp); |
80 |
> |
#endif |
81 |
> |
initfile(fp, fname, 0); |
82 |
|
while (nextc != EOF) |
83 |
|
getstatement(); |
84 |
|
if (fname != NULL) |
85 |
|
fclose(fp); |
86 |
+ |
#ifdef getc_unlocked |
87 |
+ |
else |
88 |
+ |
funlockfile(fp); |
89 |
+ |
#endif |
90 |
|
} |
91 |
|
|
92 |
|
|
214 |
|
|
215 |
|
|
216 |
|
char * |
217 |
< |
setcontext( /* set a new context path */ |
217 |
> |
calcontext( /* set a new context path */ |
218 |
|
char *ctx |
219 |
|
) |
220 |
|
{ |
255 |
|
int n; |
256 |
|
|
257 |
|
strcpy(oldcontext, context); /* save old context */ |
258 |
< |
setcontext(ctx); /* set new context */ |
258 |
> |
calcontext(ctx); /* set new context */ |
259 |
|
n = strlen(context); /* tack on old */ |
260 |
|
if (n+strlen(oldcontext) > MAXCNTX) { |
261 |
|
strncpy(context+n, oldcontext, MAXCNTX-n); |
292 |
|
static char nambuf[RMAXWORD+1]; |
293 |
|
char *cp = nambuf, *cpp; |
294 |
|
/* check for explicit local */ |
295 |
< |
if (*nam == CNTXMARK) |
295 |
> |
if (*nam == CNTXMARK) { |
296 |
|
if (lvl > 0) /* only action is to refuse search */ |
297 |
|
return(NULL); |
298 |
< |
else |
299 |
< |
nam++; |
296 |
< |
else if (nam == nambuf) /* check for repeat call */ |
298 |
> |
nam++; |
299 |
> |
} else if (nam == nambuf) /* check for repeat call */ |
300 |
|
return(lvl > 0 ? NULL : nam); |
301 |
|
/* copy name to static buffer */ |
302 |
|
while (*nam) { |
372 |
|
else |
373 |
|
dclear(vp->name); |
374 |
|
} |
375 |
< |
if (lvl >= 1) { |
376 |
< |
for (ep = outchan; ep != NULL; ep = ep->sibling) |
375 |
> |
if (lvl >= 1) |
376 |
> |
while (outchan != NULL) { |
377 |
> |
ep = outchan; |
378 |
> |
outchan = ep->sibling; |
379 |
> |
ep->sibling = NULL; |
380 |
|
epfree(ep); |
381 |
< |
outchan = NULL; |
376 |
< |
} |
381 |
> |
} |
382 |
|
} |
383 |
|
|
384 |
|
|
448 |
|
/* if fn is NULL then relink all */ |
449 |
|
for (i = 0; i < NHASH; i++) |
450 |
|
for (vp = hashtbl[i]; vp != NULL; vp = vp->next) |
451 |
< |
if (vp->lib != NULL || fn == NULL || !strcmp(fn, vp->name)) |
451 |
> |
if ((vp->lib != NULL) | (fn == NULL) || !strcmp(fn, vp->name)) |
452 |
|
vp->lib = liblookup(vp->name); |
453 |
|
} |
454 |
|
|
474 |
|
vp->next = ln->next; |
475 |
|
} |
476 |
|
freestr(ln->name); |
477 |
< |
efree((char *)ln); |
477 |
> |
efree(ln); |
478 |
|
} |
479 |
|
|
480 |
|
|
590 |
|
addchan(ep); |
591 |
|
} else { /* ordinary definition */ |
592 |
|
ep = getdefn(); |
593 |
< |
qname = qualname(dname(ep), 0); |
593 |
> |
qname = qualname(dfn_name(ep), 0); |
594 |
|
if (esupport&E_REDEFW && (vdef = varlookup(qname)) != NULL) { |
595 |
|
if (vdef->def != NULL && epcmp(ep, vdef->def)) { |
596 |
|
wputs(qname); |
626 |
|
{ |
627 |
|
EPNODE *ep1, *ep2; |
628 |
|
|
629 |
< |
if (!isalpha(nextc) && nextc != CNTXMARK) |
629 |
> |
if (!isalpha(nextc) & (nextc != CNTXMARK)) |
630 |
|
syntax("illegal variable name"); |
631 |
|
|
632 |
|
ep1 = newnode(); |
655 |
|
curfunc = ep1; |
656 |
|
} |
657 |
|
|
658 |
< |
if (nextc != '=' && nextc != ':') |
658 |
> |
if ((nextc != '=') & (nextc != ':')) |
659 |
|
syntax("'=' or ':' expected"); |
660 |
|
|
661 |
|
ep2 = newnode(); |