--- ray/src/px/pcompos.c 1995/10/16 11:40:09 2.19 +++ 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,18 +57,17 @@ 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; { char fmt[32]; if (isheadid(s)) - return; + return(0); if (formatval(fmt, s)) { if (globmatch(ourfmt, fmt)) { wrongformat = 0; @@ -83,6 +78,7 @@ char *s; putc('\t', stdout); fputs(s, stdout); } + return(0); } @@ -96,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++) @@ -150,6 +143,7 @@ char *argv[]; } dofiles: newheader("RADIANCE", stdout); + fputnow(stdout); for (nfile = 0; an < argc; nfile++) { if (nfile >= MAXFILE) goto toomany; @@ -227,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); } @@ -415,6 +409,7 @@ err: } +void quit(code) /* exit gracefully */ int code; {