1 |
|
#ifndef lint |
2 |
< |
static const char RCSid[] = "$Id$"; |
2 |
> |
static const char RCSid[] = "$Id$"; |
3 |
|
#endif |
4 |
|
/* |
5 |
|
* xform.c - program to transform object files. |
34 |
|
|
35 |
|
char *idprefix; /* prefix for object identifiers */ |
36 |
|
|
37 |
< |
#define ALIAS NUMOTYPE /* put alias at end of array */ |
37 |
> |
FUN ofun[NUMOTYPE] = INIT_OTYPE; /* default types and actions */ |
38 |
|
|
39 |
– |
#define NUMTYPES (NUMOTYPE+1) /* total number of object types */ |
40 |
– |
|
41 |
– |
FUN ofun[NUMTYPES] = INIT_OTYPE; /* default types and actions */ |
42 |
– |
|
39 |
|
short tinvers[NUMOTYPE]; /* inverse types for surfaces */ |
40 |
|
|
41 |
|
int nrept = 1; /* number of array repetitions */ |
488 |
|
} |
489 |
|
|
490 |
|
|
495 |
– |
int |
496 |
– |
otype(ofname) /* get object function number from its name */ |
497 |
– |
register char *ofname; |
498 |
– |
{ |
499 |
– |
register int i; |
500 |
– |
|
501 |
– |
for (i = 0; i < NUMTYPES; i++) |
502 |
– |
if (!strcmp(ofun[i].funame, ofname)) |
503 |
– |
return(i); |
504 |
– |
|
505 |
– |
return(-1); /* not found */ |
506 |
– |
} |
507 |
– |
|
508 |
– |
|
491 |
|
alias(fin) /* transfer alias */ |
492 |
|
FILE *fin; |
493 |
|
{ |
824 |
|
|
825 |
|
if (ofun[OBJ_SOURCE].funp == o_source) |
826 |
|
return; /* done already */ |
845 |
– |
/* alias is additional */ |
846 |
– |
ofun[ALIAS].funame = ALIASID; |
847 |
– |
ofun[ALIAS].flags = 0; |
827 |
|
/* functions get new transform */ |
828 |
< |
for (i = 0; i < NUMTYPES; i++) |
828 |
> |
for (i = 0; i < NUMOTYPE; i++) |
829 |
|
if (hasfunc(i)) |
830 |
|
ofun[i].funp = addxform; |
831 |
|
/* special cases */ |
847 |
|
ofun[PAT_CTEXT].funp = |
848 |
|
ofun[PAT_BTEXT].funp = |
849 |
|
ofun[MIX_TEXT].funp = text; |
850 |
< |
ofun[ALIAS].funp = alias; |
850 |
> |
ofun[MOD_ALIAS].funp = alias; |
851 |
|
/* surface inverses */ |
852 |
|
tinvers[OBJ_FACE] = OBJ_FACE; |
853 |
|
tinvers[OBJ_SOURCE] = OBJ_SOURCE; |
930 |
|
} |
931 |
|
strcpy(curfn, iname); /* remember input name */ |
932 |
|
/* get full path for file */ |
933 |
< |
if ((fpath = getpath(iname, getlibpath(), R_OK)) == NULL) { |
933 |
> |
if ((fpath = getpath(iname, getrlibpath(), R_OK)) == NULL) { |
934 |
|
fprintf(stderr, "%s: cannot find file \"%s\"\n", |
935 |
|
progname, iname); |
936 |
|
exit(1); |