276 |
|
{ |
277 |
|
#define check(c,l) if ((av[0][c]&&av[0][c]!=' ') || \ |
278 |
|
badarg(ac-1,av+1,l)) return(-1) |
279 |
– |
extern double atof(); |
279 |
|
|
280 |
|
if (ac <= 0 || av[0][0] != '-' || av[0][1] != 'v') |
281 |
|
return(-1); |
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 { |
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; |
410 |
|
char *s; |
411 |
|
register struct myview *v; |
412 |
|
{ |
413 |
< |
register char **an; |
414 |
< |
|
391 |
< |
for (an = altname; *an != NULL; an++) |
392 |
< |
if (!strncmp(*an, s, strlen(*an))) { |
393 |
< |
if (sscanview(v->hv, s+strlen(*an)) > 0) |
394 |
< |
v->ok++; |
395 |
< |
return; |
396 |
< |
} |
413 |
> |
if (isview(s) && sscanview(v->hv, s) > 0) |
414 |
> |
v->ok++; |
415 |
|
} |
416 |
|
|
417 |
|
|
421 |
|
VIEW *vp; |
422 |
|
RESOLU *rp; |
423 |
|
{ |
406 |
– |
extern char *progname; |
424 |
|
struct myview mvs; |
425 |
|
FILE *fp; |
426 |
|
|
427 |
|
if ((fp = fopen(fname, "r")) == NULL) |
428 |
|
return(-1); |
429 |
|
|
413 |
– |
altname[0] = progname; |
430 |
|
mvs.hv = vp; |
431 |
|
mvs.ok = 0; |
432 |
|
|