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

Comparing ray/src/common/image.c (file contents):
Revision 1.14 by greg, Mon Mar 18 13:48:05 1991 UTC vs.
Revision 1.15 by greg, Thu Apr 18 14:52:55 1991 UTC

# Line 332 | Line 332 | FILE  *fp;
332   }
333  
334  
335 static VIEW  *hview;                    /* view from header */
336 static int  gothview;                   /* success indicator */
335   static char  *altname[] = {NULL,"rpict","rview","pinterp",VIEWSTR,NULL};
336  
337 + struct myview {
338 +        VIEW    *hv;
339 +        int     ok;
340 + };
341  
342 +
343   static
344 < gethview(s)                             /* get view from header */
344 > gethview(s, v)                          /* get view from header */
345   char  *s;
346 + register struct myview  *v;
347   {
348          register char  **an;
349  
350          for (an = altname; *an != NULL; an++)
351                  if (!strncmp(*an, s, strlen(*an))) {
352 <                        if (sscanview(hview, s+strlen(*an)) > 0)
353 <                                gothview++;
352 >                        if (sscanview(v->hv, s+strlen(*an)) > 0)
353 >                                v->ok++;
354                          return;
355                  }
356   }
# Line 359 | Line 363 | VIEW  *vp;
363   int  *xp, *yp;
364   {
365          extern char  *progname;
366 +        struct myview   mvs;
367          FILE  *fp;
368  
369          if ((fp = fopen(fname, "r")) == NULL)
370                  return(-1);
371  
372          altname[0] = progname;
373 <        hview = vp;
374 <        gothview = 0;
373 >        mvs.hv = vp;
374 >        mvs.ok = 0;
375  
376 <        getheader(fp, gethview);
376 >        getheader(fp, gethview, &mvs);
377  
378          if (xp != NULL && yp != NULL
379                          && fgetresolu(xp, yp, fp) == -1)
380 <                gothview = 0;
380 >                mvs.ok = 0;
381  
382          fclose(fp);
383  
384 <        return(gothview);
384 >        return(mvs.ok);
385   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines