--- ray/src/px/ra_xyze.c 2003/02/22 02:07:28 2.6 +++ ray/src/px/ra_xyze.c 2004/03/28 20:33:14 2.9 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: ra_xyze.c,v 2.6 2003/02/22 02:07:28 greg Exp $"; +static const char RCSid[] = "$Id: ra_xyze.c,v 2.9 2004/03/28 20:33:14 schorsch Exp $"; #endif /* * Program to convert between RADIANCE RGBE and XYZE formats @@ -10,31 +10,30 @@ static const char RCSid[] = "$Id: ra_xyze.c,v 2.6 2003 #include #include #include + +#include "platform.h" #include "color.h" #include "resolu.h" -#ifdef MSDOS -#include -#endif - int rgbinp = -1; /* input is RGBE? */ - int rgbout = 0; /* output should be RGBE? */ - RGBPRIMS inprims = STDPRIMS; /* input primaries */ - RGBPRIMS outprims = STDPRIMS; /* output primaries */ - double expcomp = 1.0; /* exposure compensation */ - int doflat = -1; /* produce flat file? */ - char *progname; +static gethfunc headline; +static void quiterr(char *err); +static void convert(void); -int -headline(s) /* process header line */ -char *s; + + +static int +headline( /* process header line */ + char *s, + void *p +) { char fmt[32]; @@ -56,17 +55,13 @@ char *s; } -main(argc, argv) -int argc; -char *argv[]; +int +main(int argc, char *argv[]) { int i; -#ifdef MSDOS - extern int _fmode; - _fmode = O_BINARY; - setmode(fileno(stdin), O_BINARY); - setmode(fileno(stdout), O_BINARY); -#endif + SET_DEFAULT_BINARY(); + SET_FILE_BINARY(stdin); + SET_FILE_BINARY(stdout); progname = argv[0]; for (i = 1; i < argc; i++) @@ -133,8 +128,10 @@ userr: } -quiterr(err) /* print message and exit */ -char *err; +static void +quiterr( /* print message and exit */ + char *err +) { if (err != NULL) { fprintf(stderr, "%s: %s\n", progname, err); @@ -144,7 +141,8 @@ char *err; } -convert() /* convert to XYZE or RGBE picture */ +static void +convert(void) /* convert to XYZE or RGBE picture */ { int order; int xmax, ymax;