--- ray/src/common/image.c 2003/08/29 23:03:13 2.20 +++ ray/src/common/image.c 2004/01/02 11:36:26 2.26 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: image.c,v 2.20 2003/08/29 23:03:13 greg Exp $"; +static const char RCSid[] = "$Id: image.c,v 2.26 2004/01/02 11:36:26 schorsch Exp $"; #endif /* * image.c - routines for image generation. @@ -9,11 +9,9 @@ static const char RCSid[] = "$Id: image.c,v 2.20 2003/ #include "copyright.h" -#include "standard.h" - +#include "rtio.h" #include "view.h" -#include "paths.h" #define FEQ(x,y) (fabs((x)-(y)) <= FTINY) #define VEQ(v,w) (FEQ((v)[0],(w)[0]) && FEQ((v)[1],(w)[1]) \ @@ -21,7 +19,9 @@ static const char RCSid[] = "$Id: image.c,v 2.20 2003/ VIEW stdview = STDVIEW; /* default view parameters */ +static gethfunc gethview; + char * setview(v) /* set hvec and vvec, return message on error */ register VIEW *v; @@ -401,7 +401,8 @@ register char *s; while (*s) { ac = 0; do { - av[ac++] = s; + if (ac || *s == '-') + av[ac++] = s; while (*s && *s != ' ') s++; while (*s == ' ') @@ -491,7 +492,7 @@ int isview(s) /* is this a view string? */ char *s; { - static char *altname[]={NULL,VIEWSTR,"rpict","rview","pinterp",NULL}; + static char *altname[]={NULL,VIEWSTR,"rpict","rview","rvu","rpiece","pinterp",NULL}; extern char *progname; register char *cp; register char **an; @@ -523,12 +524,13 @@ struct myview { static int -gethview(s, v) /* get view from header */ -char *s; -register struct myview *v; +gethview( /* get view from header */ + char *s, + void *v +) { - if (isview(s) && sscanview(v->hv, s) > 0) - v->ok++; + if (isview(s) && sscanview(((struct myview*)v)->hv, s) > 0) + ((struct myview*)v)->ok++; return(0); } @@ -550,7 +552,7 @@ RESOLU *rp; mvs.hv = vp; mvs.ok = 0; - getheader(fp, (int (*)(char *, char *))&gethview, (char *)&mvs); + getheader(fp, gethview, &mvs); if (rp != NULL && !fgetsresolu(rp, fp)) mvs.ok = 0;