9 |
|
|
10 |
|
#include "copyright.h" |
11 |
|
|
12 |
< |
#include "standard.h" |
13 |
< |
|
12 |
> |
#include "rtio.h" |
13 |
|
#include "view.h" |
14 |
|
|
16 |
– |
#include "paths.h" |
15 |
|
|
16 |
|
#define FEQ(x,y) (fabs((x)-(y)) <= FTINY) |
17 |
|
#define VEQ(v,w) (FEQ((v)[0],(w)[0]) && FEQ((v)[1],(w)[1]) \ |
19 |
|
|
20 |
|
VIEW stdview = STDVIEW; /* default view parameters */ |
21 |
|
|
22 |
+ |
static gethfunc gethview; |
23 |
|
|
24 |
+ |
|
25 |
|
char * |
26 |
|
setview(v) /* set hvec and vvec, return message on error */ |
27 |
|
register VIEW *v; |
401 |
|
while (*s) { |
402 |
|
ac = 0; |
403 |
|
do { |
404 |
< |
av[ac++] = s; |
404 |
> |
if (ac || *s == '-') |
405 |
> |
av[ac++] = s; |
406 |
|
while (*s && *s != ' ') |
407 |
|
s++; |
408 |
|
while (*s == ' ') |
492 |
|
isview(s) /* is this a view string? */ |
493 |
|
char *s; |
494 |
|
{ |
495 |
< |
static char *altname[]={NULL,VIEWSTR,"rpict","rview","pinterp",NULL}; |
495 |
> |
static char *altname[]={NULL,VIEWSTR,"rpict","rview","rvu","rpiece","pinterp",NULL}; |
496 |
|
extern char *progname; |
497 |
|
register char *cp; |
498 |
|
register char **an; |
524 |
|
|
525 |
|
|
526 |
|
static int |
527 |
< |
gethview(s, v) /* get view from header */ |
528 |
< |
char *s; |
529 |
< |
register struct myview *v; |
527 |
> |
gethview( /* get view from header */ |
528 |
> |
char *s, |
529 |
> |
void *v |
530 |
> |
) |
531 |
|
{ |
532 |
< |
if (isview(s) && sscanview(v->hv, s) > 0) |
533 |
< |
v->ok++; |
532 |
> |
if (isview(s) && sscanview(((struct myview*)v)->hv, s) > 0) |
533 |
> |
((struct myview*)v)->ok++; |
534 |
|
return(0); |
535 |
|
} |
536 |
|
|
552 |
|
mvs.hv = vp; |
553 |
|
mvs.ok = 0; |
554 |
|
|
555 |
< |
getheader(fp, (int (*)(char *, char *))&gethview, (char *)&mvs); |
555 |
> |
getheader(fp, gethview, &mvs); |
556 |
|
|
557 |
|
if (rp != NULL && !fgetsresolu(rp, fp)) |
558 |
|
mvs.ok = 0; |