1 |
< |
/* Copyright (c) 1991 Regents of the University of California */ |
1 |
> |
/* Copyright (c) 1992 Regents of the University of California */ |
2 |
|
|
3 |
|
#ifndef lint |
4 |
|
static char SCCSid[] = "$SunId$ LBL"; |
16 |
|
|
17 |
|
#include "resolu.h" |
18 |
|
|
19 |
+ |
#include "paths.h" |
20 |
+ |
|
21 |
|
VIEW stdview = STDVIEW; /* default view parameters */ |
22 |
|
|
23 |
|
|
339 |
|
int na; |
340 |
|
int nvopts = 0; |
341 |
|
|
342 |
< |
while (*s == ' ') |
343 |
< |
s++; |
342 |
> |
if (*s != '-') |
343 |
> |
s = sskip(s); |
344 |
|
while (*s) { |
345 |
|
ac = 0; |
346 |
|
do { |
374 |
|
} |
375 |
|
|
376 |
|
|
377 |
< |
static char *altname[] = {NULL,"rpict","rview","pinterp",VIEWSTR,NULL}; |
377 |
> |
int |
378 |
> |
isview(s) /* is this a view string? */ |
379 |
> |
char *s; |
380 |
> |
{ |
381 |
> |
static char *altname[]={NULL,"rpict","rview","pinterp",VIEWSTR,NULL}; |
382 |
> |
extern char *progname, *rindex(); |
383 |
> |
register char *cp; |
384 |
> |
register char **an; |
385 |
> |
/* add program name to list */ |
386 |
> |
if (altname[0] == NULL) |
387 |
> |
if ((cp = rindex(progname, DIRSEP)) != NULL) |
388 |
> |
altname[0] = cp+1; |
389 |
> |
else |
390 |
> |
altname[0] = progname; |
391 |
> |
/* skip leading path */ |
392 |
> |
cp = s; |
393 |
> |
while (*cp && *cp != ' ') |
394 |
> |
cp++; |
395 |
> |
while (cp > s && cp[-1] != DIRSEP) |
396 |
> |
cp--; |
397 |
> |
for (an = altname; *an != NULL; an++) |
398 |
> |
if (!strncmp(*an, cp, strlen(*an))) |
399 |
> |
return(1); |
400 |
> |
return(0); |
401 |
> |
} |
402 |
|
|
403 |
+ |
|
404 |
|
struct myview { |
405 |
|
VIEW *hv; |
406 |
|
int ok; |
412 |
|
char *s; |
413 |
|
register struct myview *v; |
414 |
|
{ |
415 |
< |
register char **an; |
416 |
< |
|
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 |
< |
} |
415 |
> |
if (isview(s) && sscanview(v->hv, s) > 0) |
416 |
> |
v->ok++; |
417 |
|
} |
418 |
|
|
419 |
|
|
423 |
|
VIEW *vp; |
424 |
|
RESOLU *rp; |
425 |
|
{ |
405 |
– |
extern char *progname; |
426 |
|
struct myview mvs; |
427 |
|
FILE *fp; |
428 |
|
|
429 |
|
if ((fp = fopen(fname, "r")) == NULL) |
430 |
|
return(-1); |
431 |
|
|
412 |
– |
altname[0] = progname; |
432 |
|
mvs.hv = vp; |
433 |
|
mvs.ok = 0; |
434 |
|
|