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

Comparing ray/src/hd/rholo.c (file contents):
Revision 3.7 by gregl, Thu Nov 6 16:11:48 1997 UTC vs.
Revision 3.8 by gregl, Mon Nov 10 18:05:24 1997 UTC

# Line 33 | Line 33 | time_t starttime;              /* time we got started */
33   time_t  endtime;                /* time we should end by */
34   time_t  reporttime;             /* time for next report */
35  
36 + long    maxdisk;                /* maximum file space (bytes) */
37 +
38   int     rtargc = 1;             /* rtrace command */
39   char    *rtargv[128] = {"rtrace", NULL};
40  
# Line 132 | Line 134 | initrholo()                    /* get our holodeck running */
134                  disp_open(outdev);
135          else if (ncprocs > 0)                   /* else use global ray feed */
136                  init_global();
137 +                                                /* record disk space limit */
138 +        if (!vdef(DISKSPACE))
139 +                maxdisk = 0;
140 +        else
141 +                maxdisk = 1024.*1024.*vflt(DISKSPACE));
142                                                  /* record end time */
143          if (!vdef(TIME) || vflt(TIME) <= FTINY)
144                  endtime = 0;
# Line 198 | Line 205 | rholo()                                /* holodeck main loop */
205          if (ncprocs <= 0)
206                  return(1);
207                                          /* check file size */
208 <        if ((l = 1024.*1024.*vflt(DISKSPACE)) > 0 &&
209 <                        hdfiluse(hdlist[0]->fd, 0) + hdmemuse(0) >= l)
208 >        if (maxdisk > 0 && hdfiluse(hdlist[0]->fd,0)+hdmemuse(0) >= maxdisk) {
209 >                error(WARNING, "file limit exceeded");
210                  return(0);
211 +        }
212                                          /* check time */
213          if (endtime > 0 || reporttime > 0)
214                  t = time(NULL);
215 <        if (endtime > 0 && t >= endtime)
215 >        if (endtime > 0 && t >= endtime) {
216 >                error(WARNING, "time limit exceeded");
217                  return(0);
218 +        }
219          if (reporttime > 0 && t >= reporttime)
220                  report(t);
221                                          /* get packets to process */
# Line 289 | Line 299 | register HDGRID        *gp;
299                          error(SYSTEM, "out of memory");
300                  sprintf(vval(OCTREE), "%s.oct", froot);
301                  vdef(OCTREE)++;
292        }
293        if (!vdef(DISKSPACE)) {
294                sprintf(errmsg,
295                        "no %s setting, assuming 100 Mbytes available",
296                                vnam(DISKSPACE));
297                error(WARNING, errmsg);
298                vval(DISKSPACE) = "100";
299                vdef(DISKSPACE)++;
302          }
303          if (!vdef(OBSTRUCTIONS)) {
304                  vval(OBSTRUCTIONS) = "T";

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines