--- ray/src/px/pextrem.c 1992/08/21 13:48:48 2.1 +++ ray/src/px/pextrem.c 2004/01/02 12:47:01 2.9 @@ -1,15 +1,17 @@ -/* Copyright (c) 1992 Regents of the University of California */ - #ifndef lint -static char SCCSid[] = "$SunId$ LBL"; +static const char RCSid[] = "$Id: pextrem.c,v 2.9 2004/01/02 12:47:01 schorsch Exp $"; #endif - /* * Find extrema points in a Radiance picture. */ #include +#include +#include + +#include "platform.h" #include "color.h" +#include "resolu.h" int orig = 0; @@ -18,9 +20,14 @@ int wrongformat = 0; COLOR expos = WHTCOLOR; +static gethfunc headline; -headline(s) /* check header line */ -char *s; + +static int +headline( /* check header line */ + char *s, + void *p +) { char fmt[32]; double d; @@ -28,10 +35,10 @@ char *s; if (isformat(s)) { /* format */ formatval(fmt, s); - wrongformat = strcmp(fmt, COLRFMT); + wrongformat = !globmatch(PICFMT, fmt); } if (!orig) - return; + return(0); if (isexpos(s)) { /* exposure */ d = exposval(s); scalecolor(expos, d); @@ -39,6 +46,7 @@ char *s; colcorval(ctmp, s); multcolor(expos, ctmp); } + return(0); } @@ -53,7 +61,8 @@ char *argv[]; COLR *scan; COLR cmin, cmax; int xmin, ymin, xmax, ymax; - + SET_DEFAULT_BINARY(); + SET_FILE_BINARY(stdin); for (i = 1; i < argc; i++) /* get options */ if (!strcmp(argv[i], "-o")) orig++; @@ -100,7 +109,7 @@ char *argv[]; } } } - free((char *)scan); + free((void *)scan); printf("%d %d\t%e %e %e\n", xmin, ymin, colrval(cmin,RED)/colval(expos,RED), colrval(cmin,GRN)/colval(expos,GRN),