--- ray/src/gen/xform.c 2003/02/22 02:07:24 2.23 +++ ray/src/gen/xform.c 2003/06/27 22:27:45 2.27 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: xform.c,v 2.23 2003/02/22 02:07:24 greg Exp $"; +static const char RCSid[] = "$Id: xform.c,v 2.27 2003/06/27 22:27:45 greg Exp $"; #endif /* * xform.c - program to transform object files. @@ -9,14 +9,12 @@ static const char RCSid[] = "$Id: xform.c,v 2.23 2003/ * 11/6/86 Finally added error checking! */ -#include "standard.h" - -#include "paths.h" - #include +#include "standard.h" +#include "platform.h" +#include "paths.h" #include "object.h" - #include "otypes.h" int xac; /* global xform argument count */ @@ -34,12 +32,8 @@ char *newmod; /* new modifier for surfaces */ char *idprefix; /* prefix for object identifiers */ -#define ALIAS NUMOTYPE /* put alias at end of array */ +FUN ofun[NUMOTYPE] = INIT_OTYPE; /* default types and actions */ -#define NUMTYPES (NUMOTYPE+1) /* total number of object types */ - -FUN ofun[NUMTYPES] = INIT_OTYPE; /* default types and actions */ - short tinvers[NUMOTYPE]; /* inverse types for surfaces */ int nrept = 1; /* number of array repetitions */ @@ -492,20 +486,6 @@ FILE *fin; } -int -otype(ofname) /* get object function number from its name */ -register char *ofname; -{ - register int i; - - for (i = 0; i < NUMTYPES; i++) - if (!strcmp(ofun[i].funame, ofname)) - return(i); - - return(-1); /* not found */ -} - - alias(fin) /* transfer alias */ FILE *fin; { @@ -842,11 +822,8 @@ initotypes() /* initialize ofun[] array */ if (ofun[OBJ_SOURCE].funp == o_source) return; /* done already */ - /* alias is additional */ - ofun[ALIAS].funame = ALIASID; - ofun[ALIAS].flags = 0; /* functions get new transform */ - for (i = 0; i < NUMTYPES; i++) + for (i = 0; i < NUMOTYPE; i++) if (hasfunc(i)) ofun[i].funp = addxform; /* special cases */ @@ -868,7 +845,7 @@ initotypes() /* initialize ofun[] array */ ofun[PAT_CTEXT].funp = ofun[PAT_BTEXT].funp = ofun[MIX_TEXT].funp = text; - ofun[ALIAS].funp = alias; + ofun[MOD_ALIAS].funp = alias; /* surface inverses */ tinvers[OBJ_FACE] = OBJ_FACE; tinvers[OBJ_SOURCE] = OBJ_SOURCE; @@ -951,7 +928,7 @@ char *iname; } strcpy(curfn, iname); /* remember input name */ /* get full path for file */ - if ((fpath = getpath(iname, getlibpath(), R_OK)) == NULL) { + if ((fpath = getpath(iname, getrlibpath(), R_OK)) == NULL) { fprintf(stderr, "%s: cannot find file \"%s\"\n", progname, iname); exit(1);