--- ray/src/px/pcompos.c 1998/10/27 09:08:25 2.20 +++ ray/src/px/pcompos.c 2003/07/03 22:41:44 2.23 @@ -1,9 +1,6 @@ -/* Copyright (c) 1993 Regents of the University of California */ - #ifndef lint -static char SCCSid[] = "$SunId$ LBL"; +static const char RCSid[] = "$Id: pcompos.c,v 2.23 2003/07/03 22:41:44 schorsch Exp $"; #endif - /* * pcompos.c - program to composite pictures. * @@ -11,15 +8,14 @@ static char SCCSid[] = "$SunId$ LBL"; */ #include - #include +#include +#include -#ifdef MSDOS -#include -#endif +#include "copyright.h" +#include "platform.h" #include "color.h" - #include "resolu.h" #define MAXFILE 64 @@ -61,11 +57,10 @@ int nfile; /* number of files */ char ourfmt[LPICFMT+1] = PICFMT; int wrongformat = 0; -FILE *popen(), *lblopen(); +FILE *lblopen(); +void quit(); -extern char *malloc(); - tabputs(s) /* print line preceded by a tab */ char *s; { @@ -97,12 +92,9 @@ char *argv[]; int xsgn, ysgn; char *thislabel; int an; -#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 (an = 1; an < argc && argv[an][0] == '-'; an++) @@ -151,6 +143,7 @@ char *argv[]; } dofiles: newheader("RADIANCE", stdout); + fputnow(stdout); for (nfile = 0; an < argc; nfile++) { if (nfile >= MAXFILE) goto toomany; @@ -228,7 +221,7 @@ getfile: printf("%s:\n", input[nfile].name); getheader(input[nfile].fp, tabputs, NULL); if (wrongformat) { - fprintf(stderr, "%s: bad Radiance input file\n", + fprintf(stderr, "%s: incompatible input format\n", input[nfile].name); quit(1); } @@ -416,6 +409,7 @@ err: } +void quit(code) /* exit gracefully */ int code; {