ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/gen/xform.c
(Generate patch)

Comparing ray/src/gen/xform.c (file contents):
Revision 2.23 by greg, Sat Feb 22 02:07:24 2003 UTC vs.
Revision 2.27 by greg, Fri Jun 27 22:27:45 2003 UTC

# Line 1 | Line 1
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.
# Line 9 | Line 9 | static const char      RCSid[] = "$Id$";
9   *     11/6/86          Finally added error checking!
10   */
11  
12 #include  "standard.h"
13
14 #include  "paths.h"
15
12   #include  <ctype.h>
13  
14 + #include  "standard.h"
15 + #include  "platform.h"
16 + #include  "paths.h"
17   #include  "object.h"
19
18   #include  "otypes.h"
19  
20   int  xac;                               /* global xform argument count */
# Line 34 | Line 32 | char  *newmod;                         /* new modifier for surfaces */
32  
33   char  *idprefix;                        /* prefix for object identifiers */
34  
35 < #define  ALIAS          NUMOTYPE        /* put alias at end of array */
35 > FUN  ofun[NUMOTYPE] = INIT_OTYPE;       /* default types and actions */
36  
39 #define  NUMTYPES       (NUMOTYPE+1)    /* total number of object types */
40
41 FUN  ofun[NUMTYPES] = INIT_OTYPE;       /* default types and actions */
42
37   short  tinvers[NUMOTYPE];               /* inverse types for surfaces */
38  
39   int  nrept = 1;                         /* number of array repetitions */
# Line 492 | Line 486 | FILE  *fin;
486   }
487  
488  
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
489   alias(fin)                      /* transfer alias */
490   FILE  *fin;
491   {
# Line 842 | Line 822 | initotypes()                   /* initialize ofun[] array */
822  
823          if (ofun[OBJ_SOURCE].funp == o_source)
824                  return;                 /* done already */
845                                        /* alias is additional */
846        ofun[ALIAS].funame = ALIASID;
847        ofun[ALIAS].flags = 0;
825                                          /* functions get new transform */
826 <        for (i = 0; i < NUMTYPES; i++)
826 >        for (i = 0; i < NUMOTYPE; i++)
827                  if (hasfunc(i))
828                          ofun[i].funp = addxform;
829                                          /* special cases */
# Line 868 | Line 845 | initotypes()                   /* initialize ofun[] array */
845          ofun[PAT_CTEXT].funp =
846          ofun[PAT_BTEXT].funp =
847          ofun[MIX_TEXT].funp = text;
848 <        ofun[ALIAS].funp = alias;
848 >        ofun[MOD_ALIAS].funp = alias;
849                                          /* surface inverses */
850          tinvers[OBJ_FACE] = OBJ_FACE;
851          tinvers[OBJ_SOURCE] = OBJ_SOURCE;
# Line 951 | Line 928 | char  *iname;
928          }
929          strcpy(curfn, iname);                   /* remember input name */
930                                                  /* get full path for file */
931 <        if ((fpath = getpath(iname, getlibpath(), R_OK)) == NULL) {
931 >        if ((fpath = getpath(iname, getrlibpath(), R_OK)) == NULL) {
932                  fprintf(stderr, "%s: cannot find file \"%s\"\n",
933                                  progname, iname);
934                  exit(1);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines