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.9 by greg, Fri Jul 10 19:29:50 1992 UTC vs.
Revision 2.42 by greg, Tue Jan 23 16:27:31 1996 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1992 Regents of the University of California */
1 > /* Copyright (c) 1995 Regents of the University of California */
2  
3   #ifndef lint
4   static char SCCSid[] = "$SunId$ LBL";
# Line 12 | Line 12 | static char SCCSid[] = "$SunId$ LBL";
12  
13   #include  "ray.h"
14  
15 + #include  <sys/types.h>
16 +
17 + #ifndef NIX
18   #ifdef BSD
19   #include  <sys/time.h>
20   #include  <sys/resource.h>
21 + #else
22 + #include  <sys/times.h>
23 + #include  <sys/utsname.h>
24 + #include  <unistd.h>
25   #endif
26 + #endif
27  
28 + extern time_t   time();
29 +
30   #include  <signal.h>
21 #include  <fcntl.h>
31  
32   #include  "view.h"
33  
# Line 26 | Line 35 | static char SCCSid[] = "$SunId$ LBL";
35  
36   #include  "random.h"
37  
38 + #include  "paths.h"
39 +
40 + #define  RFTEMPLATE     "rfXXXXXX"
41 +
42 + #ifndef SIGCONT
43 + #define SIGCONT         SIGIO
44 + #endif
45 +
46   int  dimlist[MAXDIM];                   /* sampling dimensions */
47   int  ndims = 0;                         /* number of sampling dimensions */
48   int  samplendx;                         /* sample index number */
# Line 33 | Line 50 | int  samplendx;                                /* sample index number */
50   VIEW  ourview = STDVIEW;                /* view parameters */
51   int  hresolu = 512;                     /* horizontal resolution */
52   int  vresolu = 512;                     /* vertical resolution */
53 < double  pixaspect = 1.0;                /* pixel aspect ratio */
53 > double  pixaspect = 1.0;                /* pixel aspect ratio */
54  
55   int  psample = 4;                       /* pixel sample size */
56 < double  maxdiff = .05;                  /* max. difference for interpolation */
57 < double  dstrpix = 0.67;                 /* square pixel distribution */
56 > double  maxdiff = .05;                  /* max. difference for interpolation */
57 > double  dstrpix = 0.67;                 /* square pixel distribution */
58  
59 < double  dstrsrc = 0.0;                  /* square source distribution */
60 < double  shadthresh = .05;               /* shadow threshold */
61 < double  shadcert = .5;                  /* shadow certainty */
59 > double  dstrsrc = 0.0;                  /* square source distribution */
60 > double  shadthresh = .05;               /* shadow threshold */
61 > double  shadcert = .5;                  /* shadow certainty */
62   int  directrelay = 1;                   /* number of source relays */
63   int  vspretest = 512;                   /* virtual source pretest density */
64 < int  directinvis = 0;                   /* sources invisible? */
65 < double  srcsizerat = .25;               /* maximum ratio source size/dist. */
64 > int  directvis = 1;                     /* sources visible? */
65 > double  srcsizerat = .25;               /* maximum ratio source size/dist. */
66  
67 < double  specthresh = .15;               /* specular sampling threshold */
68 < double  specjitter = 1.;                /* specular sampling jitter */
67 > COLOR  cextinction = BLKCOLOR;          /* global extinction coefficient */
68 > double  salbedo = 0.;                   /* global scattering albedo */
69 > double  seccg = 0.;                     /* global scattering eccentricity */
70 > double  ssampdist = 0.;                 /* scatter sampling distance */
71  
72 + double  specthresh = .15;               /* specular sampling threshold */
73 + double  specjitter = 1.;                /* specular sampling jitter */
74 +
75 + int  backvis = 1;                       /* back face visibility */
76 +
77   int  maxdepth = 6;                      /* maximum recursion depth */
78 < double  minweight = 5e-3;               /* minimum ray weight */
78 > double  minweight = 5e-3;               /* minimum ray weight */
79  
80   COLOR  ambval = BLKCOLOR;               /* ambient value */
81 < double  ambacc = 0.2;                   /* ambient accuracy */
81 > double  ambacc = 0.2;                   /* ambient accuracy */
82   int  ambres = 32;                       /* ambient resolution */
83   int  ambdiv = 128;                      /* ambient divisions */
84   int  ambssamp = 0;                      /* ambient super-samples */
# Line 62 | Line 86 | int  ambounce = 0;                     /* ambient bounces */
86   char  *amblist[128];                    /* ambient include/exclude list */
87   int  ambincl = -1;                      /* include == 1, exclude == 0 */
88  
89 + #ifdef MSDOS
90 + int  ralrm = 60;                        /* seconds between reports */
91 + #else
92   int  ralrm = 0;                         /* seconds between reports */
93 + #endif
94  
95 < double  pctdone = 0.0;                  /* percentage done */
95 > double  pctdone = 0.0;                  /* percentage done */
96  
97 < long  tlastrept = 0L;                   /* time at last report */
97 > time_t  tlastrept = 0L;                 /* time at last report */
98  
99 < extern long  time();
72 < extern long  tstart;                    /* starting time */
99 > extern time_t  tstart;                  /* starting time */
100  
101 < extern long  nrays;                     /* number of rays traced */
101 > extern unsigned long  nrays;            /* number of rays traced */
102  
103 < #define  MAXDIV         16              /* maximum sample size */
103 > #define  MAXDIV         16              /* maximum sample size */
104  
105 < #define  pixjitter()    (.5+dstrpix*(.5-frandom()))
105 > #define  pixjitter()    (.5+dstrpix*(.5-frandom()))
106  
80 #define  RFTEMPLATE     "rfXXXXXX"
81 #define  HFTEMPLATE     "/tmp/hfXXXXXX"
82
83 static char  *hfname = NULL;            /* header file name */
84 static FILE  *hfp = NULL;               /* header file pointer */
85
107   static int  hres, vres;                 /* resolution for this frame */
108  
109   extern char  *mktemp();
110  
111 < double  pixvalue();
111 > double  pixvalue();
112  
113 + #ifdef NIX
114 + #define  file_exists(f) (access(f,F_OK)==0)
115 + #else
116 + #include  <sys/types.h>
117 + #include  <sys/stat.h>
118 + int
119 + file_exists(fname)                              /* ordinary file exists? */
120 + char  *fname;
121 + {
122 +        struct stat  sbuf;
123 +        if (stat(fname, &sbuf) < 0) return(0);
124 +        return((sbuf.st_mode & S_IFREG) != 0);
125 + }
126 + #endif
127  
128 +
129   quit(code)                      /* quit program */
130   int  code;
131   {
132          if (code)                       /* report status */
133                  report();
134 <        if (hfname != NULL) {           /* delete header file */
135 <                if (hfp != NULL)
100 <                        fclose(hfp);
101 <                unlink(hfname);
102 <        }
134 >        headclean();                    /* delete header file */
135 >        pfclean();                      /* clean up persist files */
136          exit(code);
137   }
138  
139  
140 < #ifdef BSD
140 > #ifndef NIX
141   report()                /* report progress */
142   {
143 +        double  u, s;
144 + #ifdef BSD
145 +        char  hostname[257];
146          struct rusage  rubuf;
147 <        double  t;
147 > #else
148 >        struct tms  tbuf;
149 >        struct utsname  nambuf;
150 >        double  period;
151 > #define hostname  nambuf.nodename
152 > #endif
153  
154 +        tlastrept = time((time_t *)NULL);
155 + #ifdef BSD
156          getrusage(RUSAGE_SELF, &rubuf);
157 <        t = (rubuf.ru_utime.tv_usec + rubuf.ru_stime.tv_usec) / 1e6;
158 <        t += rubuf.ru_utime.tv_sec + rubuf.ru_stime.tv_sec;
157 >        u = rubuf.ru_utime.tv_sec + rubuf.ru_utime.tv_usec/1e6;
158 >        s = rubuf.ru_stime.tv_sec + rubuf.ru_stime.tv_usec/1e6;
159          getrusage(RUSAGE_CHILDREN, &rubuf);
160 <        t += (rubuf.ru_utime.tv_usec + rubuf.ru_stime.tv_usec) / 1e6;
161 <        t += rubuf.ru_utime.tv_sec + rubuf.ru_stime.tv_sec;
160 >        u += rubuf.ru_utime.tv_sec + rubuf.ru_utime.tv_usec/1e6;
161 >        s += rubuf.ru_stime.tv_sec + rubuf.ru_stime.tv_usec/1e6;
162 >        gethostname(hostname, sizeof(hostname));
163 > #else
164 >        times(&tbuf);
165 > #ifdef _SC_CLK_TCK
166 >        period = 1.0 / sysconf(_SC_CLK_TCK);
167 > #else
168 >        period = 1.0 / 60.0;
169 > #endif
170 >        u = ( tbuf.tms_utime + tbuf.tms_cutime ) * period;
171 >        s = ( tbuf.tms_stime + tbuf.tms_cstime ) * period;
172 >        uname(&nambuf);
173 > #endif
174  
175 <        sprintf(errmsg, "%ld rays, %4.2f%% done after %5.4f CPU hours\n",
176 <                        nrays, pctdone, t/3600.0);
175 >        sprintf(errmsg,
176 >                "%lu rays, %4.2f%% after %.3fu %.3fs %.3fr hours on %s\n",
177 >                        nrays, pctdone, u/3600., s/3600.,
178 >                        (tlastrept-tstart)/3600., hostname);
179          eputs(errmsg);
180 <        tlastrept = time((long *)0);
180 > #ifndef BSD
181 >        signal(SIGCONT, report);
182 > #undef hostname
183 > #endif
184   }
185   #else
186   report()                /* report progress */
187   {
188 <        tlastrept = time((long *)0);
189 <        sprintf(errmsg, "%ld rays, %4.2f%% done after %5.4f hours\n",
188 >        tlastrept = time((time_t *)NULL);
189 >        sprintf(errmsg, "%lu rays, %4.2f%% after %5.4f hours\n",
190                          nrays, pctdone, (tlastrept-tstart)/3600.0);
191          eputs(errmsg);
132        signal(SIGALRM, report);
192   }
193   #endif
194  
195  
137 openheader()                    /* save standard output to header file */
138 {
139        hfname = mktemp(HFTEMPLATE);
140        if (freopen(hfname, "w", stdout) == NULL) {
141                sprintf(errmsg, "cannot open header file \"%s\"", hfname);
142                error(SYSTEM, errmsg);
143        }
144 }
145
146
147 closeheader()                   /* done with header output */
148 {
149        if (hfname == NULL)
150                return;
151        if (fflush(stdout) == EOF || (hfp = fopen(hfname, "r")) == NULL)
152                error(SYSTEM, "error reopening header file");
153 }
154
155
156 dupheader()                     /* repeat header on standard output */
157 {
158        register int  c;
159
160        if (fseek(hfp, 0L, 0) < 0)
161                error(SYSTEM, "seek error on header file");
162        while ((c = getc(hfp)) != EOF)
163                putchar(c);
164 }
165
166
196   rpict(seq, pout, zout, prvr)                    /* generate image(s) */
197   int  seq;
198   char  *pout, *zout, *prvr;
# Line 179 | Line 208 | char  *pout, *zout, *prvr;
208   * sequenced file naming.
209   */
210   {
211 <        extern char  *rindex(), *strncpy(), *strcat();
211 >        extern char  *rindex(), *strncpy(), *strcat(), *strcpy();
212          char  fbuf[128], fbuf2[128];
213 +        int  npicts;
214          register char  *cp;
215 <        RESOLU  rs;
216 <        double  pa;
187 <                                        /* finished writing header */
188 <        closeheader();
215 >        RESOLU  rs;
216 >        double  pa;
217                                          /* check sampling */
218          if (psample < 1)
219                  psample = 1;
# Line 209 | Line 237 | char  *pout, *zout, *prvr;
237                                  error(USER, "unexpected EOF on view input");
238                  prvr = fbuf;                    /* mark for renaming */
239          }
240 <        if (pout != NULL) {
240 >        if (pout != NULL & prvr != NULL) {
241                  sprintf(fbuf, pout, seq);
242 <                if (!strcmp(prvr, fbuf)) {      /* rename recover file */
243 <                        fbuf2[0] = '\0';
244 <                        if ((cp = rindex(fbuf, '/')) != NULL)
245 <                                strncpy(fbuf2, fbuf, cp-fbuf+1);
246 <                        strcat(fbuf2, RFTEMPLATE);
242 >                if (!strcmp(prvr, fbuf)) {      /* rename */
243 >                        strcpy(fbuf2, fbuf);
244 >                        for (cp = fbuf2; *cp; cp++)
245 >                                ;
246 >                        while (cp > fbuf2 && !ISDIRSEP(cp[-1]))
247 >                                cp--;
248 >                        strcpy(cp, RFTEMPLATE);
249                          prvr = mktemp(fbuf2);
250 <                        if (rename(fbuf, prvr) < 0 && errno != ENOENT) {
251 <                                sprintf(errmsg,
250 >                        if (rename(fbuf, prvr) < 0)
251 >                                if (errno == ENOENT) {  /* ghost file */
252 >                                        sprintf(errmsg,
253 >                                                "new output file \"%s\"",
254 >                                                fbuf);
255 >                                        error(WARNING, errmsg);
256 >                                        prvr = NULL;
257 >                                } else {                /* serious error */
258 >                                        sprintf(errmsg,
259                                          "cannot rename \"%s\" to \"%s\"",
260                                                  fbuf, prvr);
261 <                                error(SYSTEM, errmsg);
262 <                        }
261 >                                        error(SYSTEM, errmsg);
262 >                                }
263                  }
264          }
265 <                                        /* render sequence */
265 >        npicts = 0;                     /* render sequence */
266          do {
267                  if (seq && nextview(stdin) == EOF)
268                          break;
269 +                pctdone = 0.0;
270                  if (pout != NULL) {
271                          sprintf(fbuf, pout, seq);
272 +                        if (file_exists(fbuf)) {
273 +                                if (prvr != NULL || !strcmp(fbuf, pout)) {
274 +                                        sprintf(errmsg,
275 +                                                "output file \"%s\" exists",
276 +                                                fbuf);
277 +                                        error(USER, errmsg);
278 +                                }
279 +                                continue;               /* don't clobber */
280 +                        }
281                          if (freopen(fbuf, "w", stdout) == NULL) {
282                                  sprintf(errmsg,
283                                          "cannot open output file \"%s\"", fbuf);
284                                  error(SYSTEM, errmsg);
285                          }
286 + #ifdef MSDOS
287 +                        setmode(fileno(stdout), O_BINARY);
288 + #endif
289                          dupheader();
290                  }
291                  hres = hresolu; vres = vresolu; pa = pixaspect;
# Line 255 | Line 305 | char  *pout, *zout, *prvr;
305                  normaspect(viewaspect(&ourview), &pa, &hres, &vres);
306                  if (seq) {
307                          if (ralrm > 0) {
308 <                                sprintf(errmsg, "starting frame %d\n", seq);
309 <                                eputs(errmsg);
308 >                                fprintf(stderr, "FRAME %d:", seq);
309 >                                fprintview(&ourview, stderr);
310 >                                putc('\n', stderr);
311 >                                fflush(stderr);
312                          }
313                          printf("FRAME=%d\n", seq);
314                  }
# Line 273 | Line 325 | char  *pout, *zout, *prvr;
325                          cp = NULL;
326                  render(cp, prvr);
327                  prvr = NULL;
328 +                npicts++;
329          } while (seq++);
330 +                                        /* check that we did something */
331 +        if (npicts == 0)
332 +                error(WARNING, "no output produced");
333   }
334  
335  
# Line 319 | Line 375 | char  *zfile, *oldfile;
375                          sampdens[i] = hstep;
376          } else
377                  sampdens = NULL;
378 <                                        /* open z file */
378 >                                        /* open z-file */
379          if (zfile != NULL) {
380                  if ((zfd = open(zfile, O_WRONLY|O_CREAT, 0666)) == -1) {
381 <                        sprintf(errmsg, "cannot open z file \"%s\"", zfile);
381 >                        sprintf(errmsg, "cannot open z-file \"%s\"", zfile);
382                          error(SYSTEM, errmsg);
383                  }
384 + #ifdef MSDOS
385 +                setmode(zfd, O_BINARY);
386 + #endif
387                  for (i = 0; i <= psample; i++) {
388                          zbar[i] = (float *)malloc(hres*sizeof(float));
389                          if (zbar[i] == NULL)
# Line 339 | Line 398 | char  *zfile, *oldfile;
398          fprtresolu(hres, vres, stdout);
399                                          /* recover file and compute first */
400          i = salvage(oldfile);
401 +        if (i >= vres)
402 +                goto alldone;
403          if (zfd != -1 && i > 0 &&
404                          lseek(zfd, (long)i*hres*sizeof(float), 0) == -1)
405 <                error(SYSTEM, "z file seek error in render");
405 >                error(SYSTEM, "z-file seek error in render");
406          pctdone = 100.0*i/vres;
407          if (ralrm > 0)                  /* report init stats */
408                  report();
409 < #ifndef  BSD
409 > #ifndef  BSD
410          else
411   #endif
412 <        signal(SIGALRM, report);
412 >        signal(SIGCONT, report);
413          ypos = vres-1 - i;
414          fillscanline(scanbar[0], zbar[0], sampdens, hres, ypos, hstep);
415                                                  /* compute scanlines */
# Line 370 | Line 431 | char  *zfile, *oldfile;
431                                                          /* fill bar */
432                  fillscanbar(scanbar, zbar, hres, ypos, ystep);
433                                                          /* write it out */
434 < #ifndef  BSD
435 <                signal(SIGALRM, SIG_IGN);       /* don't interrupt writes */
434 > #ifndef  BSD
435 >                signal(SIGCONT, SIG_IGN);       /* don't interrupt writes */
436   #endif
437                  for (i = ystep; i > 0; i--) {
438                          if (zfd != -1 && write(zfd, (char *)zbar[i],
# Line 385 | Line 446 | char  *zfile, *oldfile;
446                          goto writerr;
447                                                          /* record progress */
448                  pctdone = 100.0*(vres-1-ypos)/vres;
449 <                if (ralrm > 0 && time((long *)0) >= tlastrept+ralrm)
449 >                if (ralrm > 0 && time((time_t *)NULL) >= tlastrept+ralrm)
450                          report();
451 < #ifndef  BSD
451 > #ifndef  BSD
452                  else
453 <                        signal(SIGALRM, report);
453 >                        signal(SIGCONT, report);
454   #endif
455          }
456                                                  /* clean up */
457 <        signal(SIGALRM, SIG_IGN);
458 <        if (zfd != -1) {
398 <                if (write(zfd, (char *)zbar[0], hres*sizeof(float))
457 >        signal(SIGCONT, SIG_IGN);
458 >        if (zfd != -1 && write(zfd, (char *)zbar[0], hres*sizeof(float))
459                                  < hres*sizeof(float))
460 <                        goto writerr;
460 >                goto writerr;
461 >        fwritescan(scanbar[0], hres, stdout);
462 >        if (fflush(stdout) == EOF)
463 >                goto writerr;
464 > alldone:
465 >        if (zfd != -1) {
466                  if (close(zfd) == -1)
467                          goto writerr;
468                  for (i = 0; i <= psample; i++)
469                          free((char *)zbar[i]);
470          }
406        fwritescan(scanbar[0], hres, stdout);
407        if (fflush(stdout) == EOF)
408                goto writerr;
471          for (i = 0; i <= psample; i++)
472                  free((char *)scanbar[i]);
473          if (sampdens != NULL)
474                  free(sampdens);
475          pctdone = 100.0;
476 +        if (ralrm > 0)
477 +                report();
478 +        signal(SIGCONT, SIG_DFL);
479          return;
480   writerr:
481          error(SYSTEM, "write error in render");
# Line 420 | Line 485 | memerr:
485  
486  
487   fillscanline(scanline, zline, sd, xres, y, xstep)       /* fill scan at y */
488 < register COLOR  *scanline;
489 < register float  *zline;
488 > register COLOR  *scanline;
489 > register float  *zline;
490   register char  *sd;
491   int  xres, y, xstep;
492   {
493          static int  nc = 0;             /* number of calls */
494          int  bl = xstep, b = xstep;
495 <        double  z;
495 >        double  z;
496          register int  i;
497          
498          z = pixvalue(scanline[0], 0, y);
# Line 445 | Line 510 | int  xres, y, xstep;
510                          b = fillsample(scanline, zline, 0, y, i, 0, b/2);
511                  else
512                          b = fillsample(scanline+i-xstep,
513 <                                        zline ? zline+i-xstep : NULL,
513 >                                        zline ? zline+i-xstep : (float *)NULL,
514                                          i-xstep, y, xstep, 0, b/2);
515                  if (sd) *sd++ = nc & 1 ? bl : b;
516                  bl = b;
# Line 455 | Line 520 | int  xres, y, xstep;
520  
521  
522   fillscanbar(scanbar, zbar, xres, y, ysize)      /* fill interior */
523 < register COLOR  *scanbar[];
524 < register float  *zbar[];
523 > register COLOR  *scanbar[];
524 > register float  *zbar[];
525   int  xres, y, ysize;
526   {
527          COLOR  vline[MAXDIV+1];
# Line 473 | Line 538 | int  xres, y, ysize;
538                          zline[ysize] = zbar[ysize][i];
539                  }
540                  
541 <                b = fillsample(vline, zbar[0] ? zline : NULL,
541 >                b = fillsample(vline, zbar[0] ? zline : (float *)NULL,
542                                  i, y, 0, ysize, b/2);
543                  
544                  for (j = 1; j < ysize; j++)
# Line 486 | Line 551 | int  xres, y, ysize;
551  
552  
553   int
554 < fillsample(colline, zline, x, y, xlen, ylen, b) /* fill interior points */
555 < register COLOR  *colline;
556 < register float  *zline;
554 > fillsample(colline, zline, x, y, xlen, ylen, b) /* fill interior points */
555 > register COLOR  *colline;
556 > register float  *zline;
557   int  x, y;
558   int  xlen, ylen;
559   int  b;
560   {
561 <        extern double  fabs();
562 <        double  ratio;
498 <        double  z;
561 >        double  ratio;
562 >        double  z;
563          COLOR  ctmp;
564          int  ncut;
565          register int  len;
# Line 532 | Line 596 | int  b;
596                                                          /* recurse */
597          ncut += fillsample(colline, zline, x, y, xlen>>1, ylen>>1, (b-1)/2);
598          
599 <        ncut += fillsample(colline+(len>>1), zline ? zline+(len>>1) : NULL,
599 >        ncut += fillsample(colline+(len>>1),
600 >                        zline ? zline+(len>>1) : (float *)NULL,
601                          x+(xlen>>1), y+(ylen>>1),
602                          xlen-(xlen>>1), ylen-(ylen>>1), b/2);
603  
# Line 547 | Line 612 | int  x, y;                     /* pixel position */
612   {
613          static RAY  thisray;
614  
615 <        if (viewray(thisray.rorg, thisray.rdir, &ourview,
616 <                        (x+pixjitter())/hres, (y+pixjitter())/vres) < 0) {
615 >        if ((thisray.rmax = viewray(thisray.rorg, thisray.rdir, &ourview,
616 >                        (x+pixjitter())/hres, (y+pixjitter())/vres)) < -FTINY) {
617                  setcolor(col, 0.0, 0.0, 0.0);
618                  return(0.0);
619          }
# Line 574 | Line 639 | char  *oldfile;
639          int  x, y;
640  
641          if (oldfile == NULL)
642 <                return(0);
643 <        
642 >                goto gotzip;
643 >
644          if ((fp = fopen(oldfile, "r")) == NULL) {
645                  sprintf(errmsg, "cannot open recover file \"%s\"", oldfile);
646                  error(WARNING, errmsg);
647 <                return(0);
647 >                goto gotzip;
648          }
649 + #ifdef MSDOS
650 +        setmode(fileno(fp), O_BINARY);
651 + #endif
652                                  /* discard header */
653 <        getheader(fp, NULL);
653 >        getheader(fp, NULL, NULL);
654                                  /* get picture size */
655          if (!fscnresolu(&x, &y, fp)) {
656 <                sprintf(errmsg, "bad recover file \"%s\"", oldfile);
656 >                sprintf(errmsg, "bad recover file \"%s\" - not removed",
657 >                                oldfile);
658                  error(WARNING, errmsg);
659                  fclose(fp);
660 <                return(0);
660 >                goto gotzip;
661          }
662  
663          if (x != hres || y != vres) {
# Line 612 | Line 681 | char  *oldfile;
681          fclose(fp);
682          unlink(oldfile);
683          return(y);
684 + gotzip:
685 +        if (fflush(stdout) == EOF)
686 +                error(SYSTEM, "error writing picture header");
687 +        return(0);
688   writerr:
689          sprintf(errmsg, "write error during recovery of \"%s\"", oldfile);
690          error(SYSTEM, errmsg);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines