}
-STATIC bool name_exists(name,endp,endd)
- char *name;
- proc_p endp;
- dblock_p endd;
-{
- /* Search the proctable (from fproc to endp)
- * and the data block table (from fdblock to endd)
- * to see if the name is already in use.
- */
-
- proc_p p;
- dblock_p d;
-
- if (! name) return FALSE; /* HOL blocks don't have names */
- for (p = fproc; p != endp; p = p->p_next) {
- if (strcmp(name,pnames[p->p_id]) == 0) return TRUE;
- }
- for (d = fdblock; d != endd; d = d->d_next) {
- if (dnames[d->d_id] != 0 && /* HOL blocks excluded */
- strcmp(name,dnames[d->d_id]) == 0) return TRUE;
- }
- return FALSE;
-}
-
-
-
-static int nn = 0;
STATIC new_name(s)
char **s;
{
+ static int nn = 0;
char buf[20];
int len = strlen(*s);
}
-
+
STATIC uniq_names()
{
/* The names of all internal procedures and data blocks
dblock_p d;
for (p = fproc; p != (proc_p) 0; p = p->p_next) {
- if (!(p->p_flags1 & PF_EXTERNAL) &&
- name_exists(pnames[p->p_id],p,fdblock)) {
+ if (!(p->p_flags1 & PF_EXTERNAL)) {
new_name(&(pnames[p->p_id]));
}
}
for (d = fdblock; d != (dblock_p) 0; d = d->d_next) {
- if (!(d->d_flags1 & DF_EXTERNAL) &&
- name_exists(dnames[d->d_id],(proc_p) 0,d) ) {
+ if (!(d->d_flags1 & DF_EXTERNAL) && dnames[d->d_id]) {
new_name(&(dnames[d->d_id]));
}
}
}
+
+
main(argc,argv)
int argc;
char *argv[];
* list.
*/
if (strcmp((*spp)->sy_name, name) == 0) {
- /* found */
- lastname = (*spp)->sy_name;
- return ((*spp)->sy_dblock);
+ if (status != DEFINING ||
+ (*spp)->sy_dblock->d_pseudo == DUNKNOWN) {
+ /* found */
+ lastname = (*spp)->sy_name;
+ return ((*spp)->sy_dblock);
+ }
+ break;
} else {
spp = &(*spp)->sy_next;
}
* indicating that we don't need this name.
*/
if (status == IMPORTING) return (dblock_p) 0;
- *spp = sp = newsym();
+ sp = newsym();
+ sp->sy_next = *spp;
+ *spp = sp;
sp->sy_name = (char *) newcore(strlen(name)+1);
strcpy(sp->sy_name, name);
lastname = sp->sy_name; /* quick hack to get at
*/
if (strcmp((*ppp)->pr_name, name) == 0) {
/* found */
- return ((*ppp)->pr_proc);
+ if (status != DEFINING ||
+ ! ((*ppp)->pr_proc->p_flags1 & PF_BODYSEEN)) {
+ return ((*ppp)->pr_proc);
+ }
+ break;
} else {
ppp = &(*ppp)->pr_next;
}
* return 0, indicating we don't want this proc.
*/
if (status == IMPORTING) return (proc_p) 0;
- *ppp = pp = newprc();
+ pp = newprc();
+ pp->pr_next = *ppp;
+ *ppp = pp;
pp->pr_name = (char *) newcore(strlen(name)+1);
strcpy(pp->pr_name, name);
dp = pp->pr_proc = newproc();