| 9 |
|
|
| 10 |
|
#include "copyright.h" |
| 11 |
|
|
| 12 |
< |
#include "standard.h" |
| 13 |
< |
|
| 12 |
> |
#include "rtio.h" |
| 13 |
> |
#include "paths.h" |
| 14 |
|
#include "view.h" |
| 15 |
|
|
| 16 |
– |
#include "paths.h" |
| 16 |
|
|
| 17 |
|
#define FEQ(x,y) (fabs((x)-(y)) <= FTINY) |
| 18 |
|
#define VEQ(v,w) (FEQ((v)[0],(w)[0]) && FEQ((v)[1],(w)[1]) \ |
| 20 |
|
|
| 21 |
|
VIEW stdview = STDVIEW; /* default view parameters */ |
| 22 |
|
|
| 23 |
+ |
static gethfunc gethview; |
| 24 |
|
|
| 25 |
+ |
|
| 26 |
|
char * |
| 27 |
|
setview(v) /* set hvec and vvec, return message on error */ |
| 28 |
|
register VIEW *v; |
| 272 |
|
|
| 273 |
|
void |
| 274 |
|
pix2loc(loc, rp, px, py) /* compute image location from pixel pos. */ |
| 275 |
< |
FLOAT loc[2]; |
| 275 |
> |
RREAL loc[2]; |
| 276 |
|
register RESOLU *rp; |
| 277 |
|
int px, py; |
| 278 |
|
{ |
| 395 |
|
int na; |
| 396 |
|
int nvopts = 0; |
| 397 |
|
|
| 398 |
+ |
while (*s == ' ') |
| 399 |
+ |
s++; |
| 400 |
|
if (*s != '-') |
| 401 |
|
s = sskip2(s,1); |
| 402 |
|
while (*s) { |
| 403 |
|
ac = 0; |
| 404 |
|
do { |
| 405 |
< |
av[ac++] = s; |
| 405 |
> |
if (ac || *s == '-') |
| 406 |
> |
av[ac++] = s; |
| 407 |
|
while (*s && *s != ' ') |
| 408 |
|
s++; |
| 409 |
|
while (*s == ' ') |
| 493 |
|
isview(s) /* is this a view string? */ |
| 494 |
|
char *s; |
| 495 |
|
{ |
| 496 |
< |
static char *altname[]={NULL,VIEWSTR,"rpict","rview","pinterp",NULL}; |
| 496 |
> |
static char *altname[]={NULL,VIEWSTR,"rpict","rview","rvu","rpiece","pinterp",NULL}; |
| 497 |
|
extern char *progname; |
| 498 |
|
register char *cp; |
| 499 |
|
register char **an; |
| 525 |
|
|
| 526 |
|
|
| 527 |
|
static int |
| 528 |
< |
gethview(s, v) /* get view from header */ |
| 529 |
< |
char *s; |
| 530 |
< |
register struct myview *v; |
| 528 |
> |
gethview( /* get view from header */ |
| 529 |
> |
char *s, |
| 530 |
> |
void *v |
| 531 |
> |
) |
| 532 |
|
{ |
| 533 |
< |
if (isview(s) && sscanview(v->hv, s) > 0) |
| 534 |
< |
v->ok++; |
| 533 |
> |
if (isview(s) && sscanview(((struct myview*)v)->hv, s) > 0) |
| 534 |
> |
((struct myview*)v)->ok++; |
| 535 |
|
return(0); |
| 536 |
|
} |
| 537 |
|
|
| 553 |
|
mvs.hv = vp; |
| 554 |
|
mvs.ok = 0; |
| 555 |
|
|
| 556 |
< |
getheader(fp, (int (*)(char *, char *))&gethview, (char *)&mvs); |
| 556 |
> |
getheader(fp, gethview, &mvs); |
| 557 |
|
|
| 558 |
|
if (rp != NULL && !fgetsresolu(rp, fp)) |
| 559 |
|
mvs.ok = 0; |