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

Comparing ray/src/cv/ies2rad.c (file contents):
Revision 2.3 by greg, Thu May 21 09:56:36 1992 UTC vs.
Revision 2.4 by greg, Tue Sep 8 10:06:29 1992 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1990 Regents of the University of California */
1 > /* Copyright (c) 1992 Regents of the University of California */
2  
3   #ifndef lint
4   static char SCCSid[] = "$SunId$ LBL";
# Line 13 | Line 13 | static char SCCSid[] = "$SunId$ LBL";
13   #include <stdio.h>
14   #include <ctype.h>
15   #include "color.h"
16 + #include "paths.h"
17  
18   #define PI              3.14159265358979323846
19                                          /* floating comparisons */
# Line 35 | Line 36 | static char SCCSid[] = "$SunId$ LBL";
36                                          /* string lengths */
37   #define MAXLINE         132
38   #define MAXWORD         76
38 #define MAXPATH         128
39                                          /* file types */
40   #define T_RAD           ".rad"
41   #define T_DST           ".dat"
# Line 49 | Line 49 | static char SCCSid[] = "$SunId$ LBL";
49  
50   #define F_M             .3048           /* feet to meters */
51  
52 < #define abspath(p)      ((p)[0] == '/' || (p)[0] == '.')
52 > #define abspath(p)      (ISDIRSEP((p)[0]) || (p)[0] == '.')
53  
54   static char     default_name[] = "default";
55  
# Line 64 | Line 64 | float  defcolor[3] = {1.,1.,1.};       /* default lamp color
64   float   *lampcolor = defcolor;          /* pointer to current lamp color */
65   double  multiplier = 1.0;               /* multiplier for all light sources */
66   char    units[64] = "meters";           /* output units */
67 double  minaspect = 0.0;                /* minimum allowed aspect ratio */
68 int     maxemitters = 1;                /* maximum emitters per hemisphere */
67   double  illumrad = 0.0;                 /* radius for illum sphere */
68  
69   typedef struct {
# Line 156 | Line 154 | char   *argv[];
154                  case 'o':               /* output file name */
155                          outfile = argv[++i];
156                          break;
159                case 's':               /* square emitters */
160                        minaspect = .6;
161                        if (argv[i][2] == '/') {
162                                maxemitters = atoi(argv[i]+3);
163                                if (maxemitters < 1)
164                                        goto badopt;
165                        }
166                        break;
157                  case 'i':               /* illum */
158                          illumrad = atof(argv[++i]);
159                          if (illumrad < MINDIM)
# Line 284 | Line 274 | char   *path, *fname, *suffix;
274          else if (abspath(fname))
275                  strcpy(stradd(path, fname, 0), suffix);
276          else
277 <                libname(stradd(path, libdir, '/'), fname, suffix);
277 >                libname(stradd(path, libdir, DIRSEP), fname, suffix);
278  
279          return(path);
280   }
# Line 297 | Line 287 | char   *path, *fname, *suffix;
287          if (abspath(fname))
288                  strcpy(stradd(path, fname, 0), suffix);
289          else
290 <                strcpy(stradd(stradd(path, prefdir, '/'), fname, 0), suffix);
290 >                strcpy(stradd(stradd(path, prefdir, DIRSEP), fname, 0), suffix);
291  
292          return(path);
293   }
# Line 310 | Line 300 | register char  *path;
300          register char   *cp;
301  
302          for (cp = path; *path; path++)
303 <                if (*path == '/')
303 >                if (ISDIRSEP(*path))
304                          cp = path+1;
305          return(cp);
306   }
# Line 323 | Line 313 | char   *path;
313          register char   *p1, *p2;
314  
315          for (p1 = p2 = path; *p2; p2++)
316 <                if (*p2 == '/')
316 >                if (ISDIRSEP(*p2))
317                          p1 = p2;
318          *p1 = '\0';
319          return(path);
# Line 457 | Line 447 | char   *dir, *tltspec, *dfltname, *tltid;
447                  datin = in;
448                  strcpy(tltname, dfltname);
449          } else {
450 <                if (tltspec[0] == '/')
450 >                if (ISDIRSEP(tltspec[0]))
451                          strcpy(buf, tltspec);
452                  else
453 <                        strcpy(stradd(buf, dir, '/'), tltspec);
453 >                        strcpy(stradd(buf, dir, DIRSEP), tltspec);
454                  if ((datin = fopen(buf, "r")) == NULL) {
455                          perror(buf);
456                          return(-1);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines