--- ray/src/rt/lookamb.c 1994/02/27 10:17:33 2.6 +++ ray/src/rt/lookamb.c 2004/03/30 16:13:01 2.10 @@ -1,24 +1,16 @@ -/* Copyright (c) 1991 Regents of the University of California */ - #ifndef lint -static char SCCSid[] = "$SunId$ LBL"; +static const char RCSid[] = "$Id: lookamb.c,v 2.10 2004/03/30 16:13:01 schorsch Exp $"; #endif - /* * lookamb.c - program to examine ambient components. - * - * 10/8/86 */ -#include +#include "copyright.h" -#ifdef MSDOS -#include -#endif - -#include "color.h" - +#include "platform.h" +#include "ray.h" #include "ambient.h" +#include "resolu.h" int dataonly = 0; @@ -28,9 +20,11 @@ int reverse = 0; AMBVAL av; -main(argc, argv) /* load ambient values from a file */ -int argc; -char *argv[]; +int +main( /* load ambient values from a file */ + int argc, + char *argv[] +) { FILE *fp; int i; @@ -71,15 +65,11 @@ char *argv[]; } fputformat(AMBFMT, stdout); putchar('\n'); -#ifdef MSDOS - setmode(fileno(stdout), O_BINARY); -#endif + SET_FILE_BINARY(stdout); putambmagic(stdout); writamb(fp); } else { -#ifdef MSDOS - setmode(fileno(fp), O_BINARY); -#endif + SET_FILE_BINARY(fp); if (checkheader(fp, AMBFMT, header ? stdout : (FILE *)NULL) < 0) goto formaterr; if (!hasambmagic(fp)) @@ -98,8 +88,10 @@ formaterr: } -lookamb(fp) /* get ambient values from a file */ -FILE *fp; +extern void +lookamb( /* get ambient values from a file */ + FILE *fp +) { while (readambval(&av, fp)) { if (dataonly) { @@ -133,8 +125,10 @@ FILE *fp; } -writamb(fp) /* write binary ambient values */ -FILE *fp; +extern void +writamb( /* write binary ambient values */ + FILE *fp +) { for ( ; ; ) { if (!dataonly)