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

Comparing ray/src/rt/rpict.c (file contents):
Revision 2.55 by schorsch, Thu Jun 5 19:29:34 2003 UTC vs.
Revision 2.59 by greg, Thu Jul 3 18:03:58 2003 UTC

# Line 11 | Line 11 | static const char RCSid[] = "$Id";
11  
12   #include  <sys/types.h>
13  
14 < #ifndef NIX
14 > #ifndef NON_POSIX
15   #ifdef BSD
16   #include  <sys/time.h>
17   #include  <sys/resource.h>
# Line 33 | Line 33 | static const char RCSid[] = "$Id";
33   #define  RFTEMPLATE     "rfXXXXXX"
34  
35   #ifndef SIGCONT
36 + #ifdef SIGIO     /* XXX can we live without this? */
37   #define SIGCONT         SIGIO
38   #endif
39 + #endif
40  
41   CUBE  thescene;                         /* our scene */
42   OBJECT  nsceneobjs;                     /* number of objects in our scene */
# Line 113 | Line 115 | void  report();
115  
116   double  pixvalue();
117  
118 < #ifdef NIX
117 < #define  file_exists(f) (access(f,F_OK)==0)
118 < #else
118 > #ifdef RHAS_STAT
119   #include  <sys/types.h>
120   #include  <sys/stat.h>
121   int
# Line 126 | Line 126 | char  *fname;
126          if (stat(fname, &sbuf) < 0) return(0);
127          return((sbuf.st_mode & S_IFREG) != 0);
128   }
129 + #else
130 + #define  file_exists(f) (access(f,F_OK)==0)
131   #endif
132  
133  
# Line 135 | Line 137 | int  code;
137   {
138          if (code)                       /* report status */
139                  report();
140 < #ifndef NIX
140 > #ifndef NON_POSIX
141          headclean();                    /* delete header file */
142          pfclean();                      /* clean up persist files */
143   #endif
# Line 143 | Line 145 | int  code;
145   }
146  
147  
148 < #ifndef NIX
148 > #ifndef NON_POSIX
149   void
150   report()                /* report progress */
151   {
# Line 180 | Line 182 | report()               /* report progress */
182                          nrays, pctdone, u/3600., s/3600.,
183                          (tlastrept-tstart)/3600., myhostname());
184          eputs(errmsg);
185 < #ifndef BSD
185 > #ifdef SIGCONT
186          signal(SIGCONT, report);
187   #endif
188   }
# Line 320 | Line 322 | char  *pout, *zout, *prvr;
322                  putchar('\n');
323                  if (pa < .99 || pa > 1.01)
324                          fputaspect(pa, stdout);
325 +                fputnow();
326                  fputformat(COLRFMT, stdout);
327                  putchar('\n');
328                  if (zout != NULL)
# Line 413 | Line 416 | char  *zfile, *oldfile;
416          pctdone = 100.0*i/vres;
417          if (ralrm > 0)                  /* report init stats */
418                  report();
419 < #ifndef  BSD
419 > #ifdef SIGCONT
420          else
418 #endif
421          signal(SIGCONT, report);
422 + #endif
423          ypos = vres-1 - i;                      /* initialize sampling */
424          if (directvis)
425                  init_drawsources(psample);
# Line 442 | Line 445 | char  *zfile, *oldfile;
445                  if (directvis)                          /* add bitty sources */
446                          drawsources(scanbar, zbar, 0, hres, ypos, ystep);
447                                                          /* write it out */
448 < #ifndef  BSD
448 > #ifdef SIGCONT
449                  signal(SIGCONT, SIG_IGN);       /* don't interrupt writes */
450   #endif
451                  for (i = ystep; i > 0; i--) {
# Line 459 | Line 462 | char  *zfile, *oldfile;
462                  pctdone = 100.0*(vres-1-ypos)/vres;
463                  if (ralrm > 0 && time((time_t *)NULL) >= tlastrept+ralrm)
464                          report();
465 < #ifndef  BSD
465 > #ifdef SIGCONT
466                  else
467                          signal(SIGCONT, report);
468   #endif
469          }
470                                                  /* clean up */
471 + #ifdef SIGCONT
472          signal(SIGCONT, SIG_IGN);
473 + #endif
474          if (zfd != -1 && write(zfd, (char *)zbar[0], hres*sizeof(float))
475                                  < hres*sizeof(float))
476                  goto writerr;
# Line 486 | Line 491 | alldone:
491          pctdone = 100.0;
492          if (ralrm > 0)
493                  report();
494 + #ifdef SIGCONT
495          signal(SIGCONT, SIG_DFL);
496 + #endif
497          return;
498   writerr:
499          error(SYSTEM, "write error in render");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines