*/
-STATIC char **newnametab(tablen,namelen)
- short tablen,namelen;
-{
- register char **np, **tab;
-
- tab = (char **) newmap(tablen);
- for (np = &tab[1]; np <= &tab[tablen]; np++) {
- *np = (char *) newcore(namelen);
- }
- return tab;
-}
-
STATIC line_p get_ca_lines(lf,p_out)
FILE *lf;
*/
char str[IDL+1];
- char *s;
int id;
- register int i;
- dnames = (char **) newnametab(dlength,IDL);
+ dnames = (char **) newmap(dlength);
for (;;) {
if (fscanf(dumpd,"%d %s",&id,str) == EOF) return;
assert(id <= dlength);
- s = dnames[id];
- for (i = 0; i < IDL; i++) {
- *s++ = str[i];
- }
+ dnames[id] = (char *) newcore(strlen(str)+1);
+ strcpy(dnames[id], str);
}
}
*/
char str[IDL+1];
- char *s;
int id;
- register int i;
- pnames = (char **) newnametab(plength,IDL);
+ pnames = (char **) newmap(plength);
for (;;) {
if (fscanf(dumpp,"%d %s",&id,str) == EOF) return;
assert(id <= plength);
- s = pnames[id];
- for (i = 0; i < IDL; i++) {
- *s++ = str[i];
- }
+ pnames[id] = (char *) newcore(strlen(str)+1);
+ strcpy(pnames[id], str);
}
}
dblock_p d;
for (p = fproc; p != endp; p = p->p_next) {
- if (strncmp(name,pnames[p->p_id],IDL) == 0) return TRUE;
+ if (strcmp(name,pnames[p->p_id]) == 0) return TRUE;
}
for (d = fdblock; d != endd; d = d->d_next) {
- if (strncmp(name,dnames[d->d_id],IDL) == 0) return TRUE;
+ if (strcmp(name,dnames[d->d_id]) == 0) return TRUE;
}
return FALSE;
}
struct sym {
sym_p sy_next; /* link */
- char sy_name[IDL]; /* name of the symbol */
+ char *sy_name; /* name of the symbol */
dblock_p sy_dblock; /* pointer to dblock struct */
};
struct prc {
prc_p pr_next; /* link */
- char pr_name[IDL]; /* name of the procedure */
+ char *pr_name; /* name of the procedure */
proc_p pr_proc; /* pointer tto proc struct */
};
* hash values). Try to find 'name' in its
* list.
*/
- if (strncmp((*spp)->sy_name, name, IDL) == 0) {
+ if (strcmp((*spp)->sy_name, name) == 0) {
/* found */
return ((*spp)->sy_dblock);
} else {
*/
if (status == IMPORTING) return (dblock_p) 0;
*spp = sp = newsym();
- strncpy(sp->sy_name, name, IDL);
+ sp->sy_name = (char *) newcore(strlen(name)+1);
+ strcpy(sp->sy_name, name);
dp = sp->sy_dblock = newdblock();
}
if (fdblock == (dblock_p) 0) {
* hash values). Try to find 'name' in its
* list.
*/
- if (strncmp((*ppp)->pr_name, name, IDL) == 0) {
+ if (strcmp((*ppp)->pr_name, name) == 0) {
/* found */
return ((*ppp)->pr_proc);
} else {
*/
if (status == IMPORTING) return (proc_p) 0;
*ppp = pp = newprc();
- strncpy(pp->pr_name, name, IDL);
+ pp->pr_name = (char *) newcore(strlen(name)+1);
+ strcpy(pp->pr_name, name);
dp = pp->pr_proc = newproc();
if (fproc == (proc_p) 0) {
fproc = dp; /* first proc */
register prc_p *pp, ph;
proc_p p;
- char str[IDL+1];
register int i;
#define PF_WRITTEN 01
p = ph->pr_proc;
if ((p->p_flags2 & PF_WRITTEN) == 0) {
/* not been written yet */
- for(i = 0; i < IDL; i++) {
- str[i] = ph->pr_name[i];
- }
- str[IDL] = '\0';
- fprintf(f,"%d %s\n",p->p_id, str);
+ fprintf(f,"%d %s\n",p->p_id, ph->pr_name);
p->p_flags2 |= PF_WRITTEN;
}
}
register sym_p *sp, sh;
dblock_p d;
- char str[IDL+1];
register int i;
#define DF_WRITTEN 01
d = sh->sy_dblock;
if ((d->d_flags2 & DF_WRITTEN) == 0) {
/* not been written yet */
- for (i = 0; i < IDL; i++) {
- str[i] = sh->sy_name[i];
- str[IDL] = '\0';
- }
- fprintf(f,"%d %s\n",d->d_id, str);
+ fprintf(f,"%d %s\n",d->d_id, sh->sy_name);
d->d_flags2 |= DF_WRITTEN;
}
}