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

Comparing ray/src/rt/rv2.c (file contents):
Revision 1.22 by greg, Fri Apr 19 12:45:34 1991 UTC vs.
Revision 2.16 by greg, Wed Jun 2 21:04:02 1993 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1987 Regents of the University of California */
1 > /* Copyright (c) 1993 Regents of the University of California */
2  
3   #ifndef lint
4   static char SCCSid[] = "$SunId$ LBL";
# Line 18 | Line 18 | static char SCCSid[] = "$SunId$ LBL";
18  
19   #include  "rpaint.h"
20  
21 + #include  "resolu.h"
22 +
23   #include  <ctype.h>
24  
25 < #define  CTRL(c)        ('c'-'@')
25 > #define  CTRL(c)        ((c)-'@')
26  
27 + #ifdef  SMLFLT
28 + #define  sscanvec(s,v)  (sscanf(s,"%f %f %f",v,v+1,v+2)==3)
29 + #else
30 + #define  sscanvec(s,v)  (sscanf(s,"%lf %lf %lf",v,v+1,v+2)==3)
31 + #endif
32 +
33 +
34 + extern char  VersionID[];
35   extern char  *progname;
36 + extern char  *octname;
37  
38  
39   getframe(s)                             /* get a new frame */
# Line 54 | Line 65 | char  *s;
65          int  change = 0;
66          VIEW  nv;
67  
68 +        while (isspace(*s))
69 +                s++;
70 +        if (*s == '-') {                        /* command line parameters */
71 +                copystruct(&nv, &ourview);
72 +                if (sscanview(&nv, s))
73 +                        newview(&nv);
74 +                else
75 +                        error(COMMAND, "bad view option(s)");
76 +                return;
77 +        }
78          if (sscanf(s, "%s", buf) == 1) {        /* write parameters to a file */
79                  if ((fname = getpath(buf, NULL, 0)) == NULL ||
80                                  (fp = fopen(fname, "a")) == NULL) {
# Line 71 | Line 92 | char  *s;
92          sprintf(buf, "view type (%c): ", ourview.type);
93          (*dev->comout)(buf);
94          (*dev->comin)(buf, NULL);
95 <        if (buf[0] == CTRL(C)) return;
95 >        if (buf[0] == CTRL('C')) return;
96          if (buf[0] && buf[0] != ourview.type) {
97                  nv.type = buf[0];
98                  change++;
# Line 81 | Line 102 | char  *s;
102                          ourview.vp[0], ourview.vp[1], ourview.vp[2]);
103          (*dev->comout)(buf);
104          (*dev->comin)(buf, NULL);
105 <        if (buf[0] == CTRL(C)) return;
106 <        if (sscanf(buf, "%lf %lf %lf", &nv.vp[0], &nv.vp[1], &nv.vp[2]) == 3)
105 >        if (buf[0] == CTRL('C')) return;
106 >        if (sscanvec(buf, nv.vp))
107                  change++;
108          else
109                  VCOPY(nv.vp, ourview.vp);
# Line 90 | Line 111 | char  *s;
111                          ourview.vdir[0], ourview.vdir[1], ourview.vdir[2]);
112          (*dev->comout)(buf);
113          (*dev->comin)(buf, NULL);
114 <        if (buf[0] == CTRL(C)) return;
115 <        if (sscanf(buf,"%lf %lf %lf",&nv.vdir[0],&nv.vdir[1],&nv.vdir[2]) == 3)
114 >        if (buf[0] == CTRL('C')) return;
115 >        if (sscanvec(buf, nv.vdir))
116                  change++;
117          else
118                  VCOPY(nv.vdir, ourview.vdir);
# Line 99 | Line 120 | char  *s;
120                          ourview.vup[0], ourview.vup[1], ourview.vup[2]);
121          (*dev->comout)(buf);
122          (*dev->comin)(buf, NULL);
123 <        if (buf[0] == CTRL(C)) return;
124 <        if (sscanf(buf,"%lf %lf %lf",&nv.vup[0],&nv.vup[1],&nv.vup[2]) == 3)
123 >        if (buf[0] == CTRL('C')) return;
124 >        if (sscanvec(buf, nv.vup))
125                  change++;
126          else
127                  VCOPY(nv.vup, ourview.vup);
# Line 108 | Line 129 | char  *s;
129                          ourview.horiz, ourview.vert);
130          (*dev->comout)(buf);
131          (*dev->comin)(buf, NULL);
132 <        if (buf[0] == CTRL(C)) return;
132 >        if (buf[0] == CTRL('C')) return;
133          if (sscanf(buf, "%lf %lf", &nv.horiz, &nv.vert) == 2)
134                  change++;
135          else {
# Line 118 | Line 139 | char  *s;
139                          ourview.hoff, ourview.voff);
140          (*dev->comout)(buf);
141          (*dev->comin)(buf, NULL);
142 <        if (buf[0] == CTRL(C)) return;
142 >        if (buf[0] == CTRL('C')) return;
143          if (sscanf(buf, "%lf %lf", &nv.hoff, &nv.voff) == 2)
144                  change++;
145          else {
# Line 140 | Line 161 | char  *s;
161          if (sscanf(s, "%s", buf) == 1) {        /* get parameters from a file */
162                  copystruct(&nv, &stdview);
163                  if ((fname = getpath(buf, NULL, 0)) == NULL ||
164 <                                (success = viewfile(fname, &nv, 0, 0)) == -1) {
164 >                                (success = viewfile(fname, &nv, NULL)) == -1) {
165                          sprintf(errmsg, "cannot open \"%s\"", buf);
166                          error(COMMAND, errmsg);
167                          return;
# Line 165 | Line 186 | char  *s;
186   getaim(s)                               /* aim camera */
187   char  *s;
188   {
168        extern double  tan(), atan();
189          double  zfact;
190          VIEW  nv;
191  
# Line 196 | Line 216 | char  *s;
216   getrotate(s)                            /* rotate camera */
217   char  *s;
218   {
199        extern double  normalize(), tan(), atan();
219          VIEW  nv;
220          FVECT  v1;
221          double  angle, elev, zfact;
# Line 242 | Line 261 | register char  *s;
261   getexposure(s)                          /* get new exposure */
262   char  *s;
263   {
245        double  atof(), pow(), fabs();
264          char  buf[128];
265          register char  *cp;
248        register PNODE  *p;
266          RECT  r;
267          int  x, y;
268 <        double  e;
269 <
268 >        register PNODE  *p = &ptrunk;
269 >        int  adapt = 0;
270 >        double  e = 1.0;
271 > start:
272          for (cp = s; isspace(*cp); cp++)
273                  ;
274 +        if (*cp == '@') {
275 +                adapt++;
276 +                goto start;
277 +        }
278          if (*cp == '\0') {              /* normalize to point */
279                  if (dev->getcur == NULL)
280                          return;
# Line 261 | Line 284 | char  *s;
284                  r.l = r.d = 0;
285                  r.r = hresolu; r.u = vresolu;
286                  p = findrect(x, y, &ptrunk, &r, -1);
264                e = 1.0;
287          } else {
288                  if (*cp == '=') {       /* absolute setting */
289                          p = NULL;
# Line 269 | Line 291 | char  *s;
291                          for (cp++; isspace(*cp); cp++)
292                                  ;
293                          if (*cp == '\0') {      /* interactive */
294 <                                sprintf(buf, "exposure (%lf): ", exposure);
294 >                                sprintf(buf, "exposure (%f): ", exposure);
295                                  (*dev->comout)(buf);
296                                  (*dev->comin)(buf, NULL);
297                                  for (cp = buf; isspace(*cp); cp++)
# Line 277 | Line 299 | char  *s;
299                                  if (*cp == '\0')
300                                          return;
301                          }
280                } else {                /* normalize to average */
281                        p = &ptrunk;
282                        e = 1.0;
302                  }
303                  if (*cp == '+' || *cp == '-')   /* f-stops */
304                          e *= pow(2.0, atof(cp));
# Line 287 | Line 306 | char  *s;
306                          e *= atof(cp);
307          }
308          if (p != NULL) {                /* relative setting */
309 <                if (bright(p->v) <= FTINY) {
309 >                if (bright(p->v) < 1e-15) {
310                          error(COMMAND, "cannot normalize to zero");
311                          return;
312                  }
313 <                e *= 0.5 / bright(p->v);
313 >                if (adapt)
314 >                        e *= 106./pow(1.219+pow(luminance(p->v)/exposure,.4),2.5)/exposure;
315 >                else
316 >                        e *= 0.5 / bright(p->v);
317          }
318          if (e <= FTINY || fabs(1.0 - e) <= FTINY)
319                  return;
# Line 301 | Line 323 | char  *s;
323   }
324  
325  
326 + getparam(str, dsc, typ, ptr)            /* get variable from user */
327 + char  *str, *dsc;
328 + int  typ;
329 + register union {int i; double d; COLOR C;}  *ptr;
330 + {
331 +        extern char  *index();
332 +        int  i0;
333 +        double  d0, d1, d2;
334 +        char  buf[48];
335 +
336 +        switch (typ) {
337 +        case 'i':                       /* integer */
338 +                if (sscanf(str, "%d", &i0) != 1) {
339 +                        (*dev->comout)(dsc);
340 +                        sprintf(buf, " (%d): ", ptr->i);
341 +                        (*dev->comout)(buf);
342 +                        (*dev->comin)(buf, NULL);
343 +                        if (sscanf(buf, "%d", &i0) != 1)
344 +                                return(0);
345 +                }
346 +                ptr->i = i0;
347 +                return(1);
348 +        case 'r':                       /* real */
349 +                if (sscanf(str, "%lf", &d0) != 1) {
350 +                        (*dev->comout)(dsc);
351 +                        sprintf(buf, " (%.6g): ", ptr->d);
352 +                        (*dev->comout)(buf);
353 +                        (*dev->comin)(buf, NULL);
354 +                        if (sscanf(buf, "%lf", &d0) != 1)
355 +                                return(0);
356 +                }
357 +                ptr->d = d0;
358 +                return(1);
359 +        case 'b':                       /* boolean */
360 +                if (sscanf(str, "%1s", buf) != 1) {
361 +                        (*dev->comout)(dsc);
362 +                        sprintf(buf, "? (%c): ", ptr->i ? 'y' : 'n');
363 +                        (*dev->comout)(buf);
364 +                        (*dev->comin)(buf, NULL);
365 +                        if (buf[0] == '\0' ||
366 +                                        index("yY+1tTnN-0fF", buf[0]) == NULL)
367 +                                return(0);
368 +                }
369 +                ptr->i = index("yY+1tT", buf[0]) != NULL;
370 +                return(1);
371 +        case 'C':                       /* color */
372 +                if (sscanf(str, "%lf %lf %lf", &d0, &d1, &d2) != 3) {
373 +                        (*dev->comout)(dsc);
374 +                        sprintf(buf, " (%.6g %.6g %.6g): ",
375 +                                        colval(ptr->C,RED),
376 +                                        colval(ptr->C,GRN),
377 +                                        colval(ptr->C,BLU));
378 +                        (*dev->comout)(buf);
379 +                        (*dev->comin)(buf, NULL);
380 +                        if (sscanf(buf, "%lf %lf %lf", &d0, &d1, &d2) != 3)
381 +                                return(0);
382 +                }
383 +                setcolor(ptr->C, d0, d1, d2);
384 +                return(1);
385 +        }
386 + }
387 +
388 +
389   setparam(s)                             /* get/set program parameter */
390   register char  *s;
391   {
# Line 313 | Line 398 | register char  *s;
398          extern double  shadcert;
399          extern COLOR  ambval;
400          extern double  ambacc;
316        extern double  minarad;
401          extern int  ambres;
402          extern int  ambdiv;
403          extern int  ambssamp;
404          extern int  ambounce;
405 <        int  i0;
406 <        double  d0, d1, d2;
405 >        extern int  directvis;
406 >        extern double  srcsizerat;
407 >        extern int  do_irrad;
408 >        extern double  specjitter;
409 >        extern double  specthresh;
410          char  buf[128];
411          
412          if (s[0] == '\0') {
413 <                (*dev->comout)("aa ab ad ar as av dc dj dt lr lw sp st: ");
413 >                (*dev->comout)(
414 >                "aa ab ad ar as av b dc di dj ds dt i lr lw ps pt sj st: ");
415                  (*dev->comin)(buf, NULL);
416                  s = buf;
417          }
# Line 331 | Line 419 | register char  *s;
419          case 'l':                       /* limit */
420                  switch (s[1]) {
421                  case 'w':                       /* weight */
422 <                        if (sscanf(s+2, "%lf", &d0) != 1) {
335 <                                sprintf(buf, "limit weight (%.6g): ",
336 <                                                minweight);
337 <                                (*dev->comout)(buf);
338 <                                (*dev->comin)(buf, NULL);
339 <                                if (sscanf(buf, "%lf", &d0) != 1)
340 <                                        break;
341 <                        }
342 <                        minweight = d0;
422 >                        getparam(s+2, "limit weight", 'r', &minweight);
423                          break;
424                  case 'r':                       /* reflection */
425 <                        if (sscanf(s+2, "%d", &i0) != 1) {
346 <                                sprintf(buf, "limit reflection (%d): ",
347 <                                                maxdepth);
348 <                                (*dev->comout)(buf);
349 <                                (*dev->comin)(buf, NULL);
350 <                                if (sscanf(buf, "%d", &i0) != 1)
351 <                                        break;
352 <                        }
353 <                        maxdepth = i0;
425 >                        getparam(s+2, "limit reflection", 'i', &maxdepth);
426                          break;
427                  default:
428                          goto badparam;
# Line 359 | Line 431 | register char  *s;
431          case 'd':                       /* direct */
432                  switch (s[1]) {
433                  case 'j':                       /* jitter */
434 <                        if (sscanf(s+2, "%lf", &d0) != 1) {
363 <                                sprintf(buf, "direct jitter (%.6g): ",
364 <                                                dstrsrc);
365 <                                (*dev->comout)(buf);
366 <                                (*dev->comin)(buf, NULL);
367 <                                if (sscanf(buf, "%lf", &d0) != 1)
368 <                                        break;
369 <                        }
370 <                        dstrsrc = d0;
434 >                        getparam(s+2, "direct jitter", 'r', &dstrsrc);
435                          break;
436                  case 'c':                       /* certainty */
437 <                        if (sscanf(s+2, "%lf", &d0) != 1) {
374 <                                sprintf(buf, "direct certainty (%.6g): ",
375 <                                                shadcert);
376 <                                (*dev->comout)(buf);
377 <                                (*dev->comin)(buf, NULL);
378 <                                if (sscanf(buf, "%lf", &d0) != 1)
379 <                                        break;
380 <                        }
381 <                        shadcert = d0;
437 >                        getparam(s+2, "direct certainty", 'r', &shadcert);
438                          break;
439                  case 't':                       /* threshold */
440 <                        if (sscanf(s+2, "%lf", &d0) != 1) {
385 <                                sprintf(buf, "direct threshold (%.6g): ",
386 <                                                shadthresh);
387 <                                (*dev->comout)(buf);
388 <                                (*dev->comin)(buf, NULL);
389 <                                if (sscanf(buf, "%lf", &d0) != 1)
390 <                                        break;
391 <                        }
392 <                        shadthresh = d0;
440 >                        getparam(s+2, "direct threshold", 'r', &shadthresh);
441                          break;
442 +                case 'v':                       /* visibility */
443 +                        getparam(s+2, "direct visibility",
444 +                                        'b', &directvis);
445 +                        break;
446 +                case 's':                       /* sampling */
447 +                        getparam(s+2, "direct sampling", 'r', &srcsizerat);
448 +                        break;
449                  default:
450                          goto badparam;
451                  }
452                  break;
453 +        case 'b':                       /* black and white */
454 +                getparam(s+1, "black and white", 'b', &greyscale);
455 +                break;
456 +        case 'i':                       /* irradiance */
457 +                getparam(s+1, "irradiance", 'b', &do_irrad);
458 +                break;
459          case 'a':                       /* ambient */
460                  switch (s[1]) {
461                  case 'v':                       /* value */
462 <                        if (sscanf(s+2, "%lf %lf %lf", &d0, &d1, &d2) != 3) {
402 <                                sprintf(buf,
403 <                                        "ambient value (%.6g %.6g %.6g): ",
404 <                                                colval(ambval,RED),
405 <                                                colval(ambval,GRN),
406 <                                                colval(ambval,BLU));
407 <                                (*dev->comout)(buf);
408 <                                (*dev->comin)(buf, NULL);
409 <                                if (sscanf(buf, "%lf %lf %lf",
410 <                                                &d0, &d1, &d2) != 3)
411 <                                        break;
412 <                        }
413 <                        setcolor(ambval, d0, d1, d2);
462 >                        getparam(s+2, "ambient value", 'C', (COLOR *)ambval);
463                          break;
464                  case 'a':                       /* accuracy */
465 <                        if (sscanf(s+2, "%lf", &d0) != 1) {
417 <                                sprintf(buf, "ambient accuracy (%.6g): ",
418 <                                                ambacc);
419 <                                (*dev->comout)(buf);
420 <                                (*dev->comin)(buf, NULL);
421 <                                if (sscanf(buf, "%lf", &d0) != 1)
422 <                                        break;
423 <                        }
424 <                        ambacc = d0;
465 >                        getparam(s+2, "ambient accuracy", 'r', &ambacc);
466                          break;
467                  case 'd':                       /* divisions */
468 <                        if (sscanf(s+2, "%d", &i0) != 1) {
428 <                                sprintf(buf, "ambient divisions (%d): ",
429 <                                                ambdiv);
430 <                                (*dev->comout)(buf);
431 <                                (*dev->comin)(buf, NULL);
432 <                                if (sscanf(buf, "%d", &i0) != 1)
433 <                                        break;
434 <                        }
435 <                        ambdiv = i0;
468 >                        getparam(s+2, "ambient divisions", 'i', &ambdiv);
469                          break;
470                  case 's':                       /* samples */
471 <                        if (sscanf(s+2, "%d", &i0) != 1) {
439 <                                sprintf(buf, "ambient super-samples (%d): ",
440 <                                                ambssamp);
441 <                                (*dev->comout)(buf);
442 <                                (*dev->comin)(buf, NULL);
443 <                                if (sscanf(buf, "%d", &i0) != 1)
444 <                                        break;
445 <                        }
446 <                        ambssamp = i0;
471 >                        getparam(s+2, "ambient super-samples", 'i', &ambssamp);
472                          break;
473                  case 'b':                       /* bounces */
474 <                        if (sscanf(s+2, "%d", &i0) != 1) {
450 <                                sprintf(buf, "ambient bounces (%d): ",
451 <                                                ambounce);
452 <                                (*dev->comout)(buf);
453 <                                (*dev->comin)(buf, NULL);
454 <                                if (sscanf(buf, "%d", &i0) != 1)
455 <                                        break;
456 <                        }
457 <                        ambounce = i0;
474 >                        getparam(s+2, "ambient bounces", 'i', &ambounce);
475                          break;
476                  case 'r':
477 <                        if (sscanf(s+2, "%d", &i0) != 1) {
478 <                                sprintf(buf, "ambient resolution (%d): ",
462 <                                                ambres);
463 <                                (*dev->comout)(buf);
464 <                                (*dev->comin)(buf, NULL);
465 <                                if (sscanf(buf, "%d", &i0) != 1)
466 <                                        break;
467 <                        }
468 <                        ambres = i0;
469 <                        minarad = ambres > 0 ? thescene.cusize/ambres : 0.0;
477 >                        if (getparam(s+2, "ambient resolution", 'i', &ambres))
478 >                                setambres(ambres);
479                          break;
480                  default:
481                          goto badparam;
482                  }
483                  break;
484 <        case 's':                       /* sample */
484 >        case 'p':                       /* pixel */
485                  switch (s[1]) {
486 <                case 'p':                       /* pixel */
487 <                        if (sscanf(s+2, "%d", &i0) != 1) {
488 <                                sprintf(buf, "sample pixel (%d): ", psample);
480 <                                (*dev->comout)(buf);
481 <                                (*dev->comin)(buf, NULL);
482 <                                if (sscanf(buf, "%d", &i0) != 1)
483 <                                        break;
484 <                        }
485 <                        psample = i0;
486 <                        pdepth = 0;
486 >                case 's':                       /* sample */
487 >                        if (getparam(s+2, "pixel sample", 'i', &psample))
488 >                                pdepth = 0;
489                          break;
490                  case 't':                       /* threshold */
491 <                        if (sscanf(s+2, "%lf", &d0) != 1) {
492 <                                sprintf(buf, "sample threshold (%.6g): ",
491 <                                                maxdiff);
492 <                                (*dev->comout)(buf);
493 <                                (*dev->comin)(buf, NULL);
494 <                                if (sscanf(buf, "%lf", &d0) != 1)
495 <                                        break;
496 <                        }
497 <                        maxdiff = d0;
498 <                        pdepth = 0;
491 >                        if (getparam(s+2, "pixel threshold", 'r', &maxdiff))
492 >                                pdepth = 0;
493                          break;
494                  default:
495                          goto badparam;
496                  }
497                  break;
498 +        case 's':                       /* specular */
499 +                switch (s[1]) {
500 +                case 'j':                       /* jitter */
501 +                        getparam(s+2, "specular jitter", 'r', &specjitter);
502 +                        break;
503 +                case 't':                       /* threshold */
504 +                        getparam(s+2, "specular threshold", 'r', &specthresh);
505 +                        break;
506 +                default:
507 +                        goto badparam;
508 +                }
509 +                break;
510          case '\0':                      /* nothing */
511                  break;
512          default:;
513   badparam:
514 +                *sskip(s) = '\0';
515                  sprintf(errmsg, "%s: unknown variable", s);
516                  error(COMMAND, errmsg);
517                  break;
# Line 519 | Line 526 | char  *s;
526          int  x, y;
527          RAY  thisray;
528  
529 <        if (sscanf(s, "%lf %lf %lf %lf %lf %lf",
530 <                &thisray.rorg[0], &thisray.rorg[1], &thisray.rorg[2],
524 <                &thisray.rdir[0], &thisray.rdir[1], &thisray.rdir[2]) != 6) {
529 >        if (!sscanvec(s, thisray.rorg) ||
530 >                        !sscanvec(sskip(sskip(sskip(s))), thisray.rdir)) {
531  
532                  if (dev->getcur == NULL)
533                          return;
# Line 561 | Line 567 | char  *s;
567                          (*dev->comout)(buf);
568                  }
569                  (*dev->comin)(buf, NULL);
570 <                sprintf(buf, "with value (%.6g %.6g %.6g)",
570 >                sprintf(buf, "value (%.5g %.5g %.5g) (%.1fL)",
571                                  colval(thisray.rcol,RED),
572                                  colval(thisray.rcol,GRN),
573 <                                colval(thisray.rcol,BLU));
573 >                                colval(thisray.rcol,BLU),
574 >                                luminance(thisray.rcol));
575                  (*dev->comout)(buf);
576          }
577          (*dev->comin)(buf, NULL);
# Line 590 | Line 597 | char  *s;
597                  error(COMMAND, errmsg);
598                  return;
599          }
600 + #ifdef MSDOS
601 +        setmode(fileno(fp), O_BINARY);
602 + #endif
603          (*dev->comout)("writing \"");
604          (*dev->comout)(fname);
605          (*dev->comout)("\"...\n");
606                                                  /* write header */
607          fputs(progname, fp);
608          fprintview(&ourview, fp);
609 <        putc('\n', fp);
609 >        if (octname != NULL)
610 >                fprintf(fp, " %s\n", octname);
611 >        else
612 >                putc('\n', fp);
613 >        fprintf(fp, "SOFTWARE= %s\n", VersionID);
614          if (exposure != 1.0)
615                  fputexpos(exposure, fp);
616          if (dev->pixaspect != 1.0)
617                  fputaspect(dev->pixaspect, fp);
618          fputformat(COLRFMT, fp);
619          putc('\n', fp);
620 <        fputresolu(YMAJOR|YDECR, hresolu, vresolu, fp);
620 >        fprtresolu(hresolu, vresolu, fp);
621  
622          scanline = (COLR *)malloc(hresolu*sizeof(COLR));
623 <        if (scanline == NULL)
624 <                error(SYSTEM, "out of memory in writepict");
623 >        if (scanline == NULL) {
624 >                error(COMMAND, "not enough memory!");
625 >                fclose(fp);
626 >                unlink(fname);
627 >                return;
628 >        }
629          for (y = vresolu-1; y >= 0; y--) {
630                  getpictcolrs(y, scanline, &ptrunk, hresolu, vresolu);
631                  if (fwritecolrs(scanline, hresolu, fp) < 0)
632                          break;
633          }
634 +        free((char *)scanline);
635          if (fclose(fp) < 0)
636                  error(COMMAND, "write error");
618        free((char *)scanline);
637   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines