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 2.2 by greg, Thu Dec 19 14:45:50 1991 UTC vs.
Revision 2.3 by greg, Tue Apr 28 09:36:42 1992 UTC

# Line 337 | Line 337 | register char  *s;
337          int  na;
338          int  nvopts = 0;
339  
340 <        while (*s == ' ')
341 <                s++;
340 >        if (*s != '-')
341 >                s = sskip(s);
342          while (*s) {
343                  ac = 0;
344                  do {
# Line 372 | Line 372 | FILE  *fp;
372   }
373  
374  
375 < static char  *altname[] = {NULL,"rpict","rview","pinterp",VIEWSTR,NULL};
375 > int
376 > isview(s)                               /* is this a view string? */
377 > char  *s;
378 > {
379 >        static char  *altname[]={NULL,"rpict","rview","pinterp",VIEWSTR,NULL};
380 >        extern char  *progname, *rindex();
381 >        register char  *cp;
382 >        register char  **an;
383 >                                        /* add program name to list */
384 >        if (altname[0] == NULL)
385 >                if ((cp = rindex(progname, '/')) != NULL)
386 >                        altname[0] = cp+1;
387 >                else
388 >                        altname[0] = progname;
389 >                                        /* skip leading path */
390 >        cp = s;
391 >        while (*cp && *cp != ' ')
392 >                cp++;
393 >        while (cp > s && cp[-1] != '/')
394 >                cp--;
395 >        for (an = altname; *an != NULL; an++)
396 >                if (!strncmp(*an, cp, strlen(*an)))
397 >                        return(1);
398 >        return(0);
399 > }
400  
401 +
402   struct myview {
403          VIEW    *hv;
404          int     ok;
# Line 385 | Line 410 | gethview(s, v)                         /* get view from header */
410   char  *s;
411   register struct myview  *v;
412   {
413 <        register char  **an;
414 <
390 <        for (an = altname; *an != NULL; an++)
391 <                if (!strncmp(*an, s, strlen(*an))) {
392 <                        if (sscanview(v->hv, s+strlen(*an)) > 0)
393 <                                v->ok++;
394 <                        return;
395 <                }
413 >        if (isview(s) && sscanview(v->hv, s) > 0)
414 >                v->ok++;
415   }
416  
417  
# Line 402 | Line 421 | char  *fname;
421   VIEW  *vp;
422   RESOLU  *rp;
423   {
405        extern char  *progname;
424          struct myview   mvs;
425          FILE  *fp;
426  
427          if ((fp = fopen(fname, "r")) == NULL)
428                  return(-1);
429  
412        altname[0] = progname;
430          mvs.hv = vp;
431          mvs.ok = 0;
432  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines