| 1 |
– |
/* Copyright (c) 1993 Regents of the University of California */ |
| 2 |
– |
|
| 1 |
|
#ifndef lint |
| 2 |
< |
static char SCCSid[] = "$SunId$ LBL"; |
| 2 |
> |
static const char RCSid[] = "$Id$"; |
| 3 |
|
#endif |
| 6 |
– |
|
| 4 |
|
/* |
| 5 |
|
* pcompos.c - program to composite pictures. |
| 6 |
|
* |
| 8 |
|
*/ |
| 9 |
|
|
| 10 |
|
#include <stdio.h> |
| 14 |
– |
|
| 11 |
|
#include <math.h> |
| 12 |
+ |
#include <time.h> |
| 13 |
+ |
#include <string.h> |
| 14 |
|
|
| 15 |
< |
#ifdef MSDOS |
| 18 |
< |
#include <fcntl.h> |
| 19 |
< |
#endif |
| 15 |
> |
#include "copyright.h" |
| 16 |
|
|
| 17 |
+ |
#include "platform.h" |
| 18 |
|
#include "color.h" |
| 22 |
– |
|
| 19 |
|
#include "resolu.h" |
| 20 |
|
|
| 21 |
|
#define MAXFILE 64 |
| 57 |
|
char ourfmt[LPICFMT+1] = PICFMT; |
| 58 |
|
int wrongformat = 0; |
| 59 |
|
|
| 60 |
< |
FILE *popen(), *lblopen(); |
| 60 |
> |
FILE *lblopen(); |
| 61 |
> |
void quit(); |
| 62 |
|
|
| 66 |
– |
extern char *malloc(); |
| 63 |
|
|
| 68 |
– |
|
| 64 |
|
tabputs(s) /* print line preceded by a tab */ |
| 65 |
|
char *s; |
| 66 |
|
{ |
| 67 |
|
char fmt[32]; |
| 68 |
|
|
| 69 |
|
if (isheadid(s)) |
| 70 |
< |
return; |
| 70 |
> |
return(0); |
| 71 |
|
if (formatval(fmt, s)) { |
| 72 |
|
if (globmatch(ourfmt, fmt)) { |
| 73 |
|
wrongformat = 0; |
| 78 |
|
putc('\t', stdout); |
| 79 |
|
fputs(s, stdout); |
| 80 |
|
} |
| 81 |
+ |
return(0); |
| 82 |
|
} |
| 83 |
|
|
| 84 |
|
|
| 92 |
|
int xsgn, ysgn; |
| 93 |
|
char *thislabel; |
| 94 |
|
int an; |
| 95 |
< |
#ifdef MSDOS |
| 96 |
< |
extern int _fmode; |
| 97 |
< |
_fmode = O_BINARY; |
| 102 |
< |
setmode(fileno(stdin), O_BINARY); |
| 103 |
< |
setmode(fileno(stdout), O_BINARY); |
| 104 |
< |
#endif |
| 95 |
> |
SET_DEFAULT_BINARY(); |
| 96 |
> |
SET_FILE_BINARY(stdin); |
| 97 |
> |
SET_FILE_BINARY(stdout); |
| 98 |
|
progname = argv[0]; |
| 99 |
|
|
| 100 |
|
for (an = 1; an < argc && argv[an][0] == '-'; an++) |
| 143 |
|
} |
| 144 |
|
dofiles: |
| 145 |
|
newheader("RADIANCE", stdout); |
| 146 |
+ |
fputnow(stdout); |
| 147 |
|
for (nfile = 0; an < argc; nfile++) { |
| 148 |
|
if (nfile >= MAXFILE) |
| 149 |
|
goto toomany; |
| 221 |
|
printf("%s:\n", input[nfile].name); |
| 222 |
|
getheader(input[nfile].fp, tabputs, NULL); |
| 223 |
|
if (wrongformat) { |
| 224 |
< |
fprintf(stderr, "%s: bad Radiance input file\n", |
| 224 |
> |
fprintf(stderr, "%s: incompatible input format\n", |
| 225 |
|
input[nfile].name); |
| 226 |
|
quit(1); |
| 227 |
|
} |
| 409 |
|
} |
| 410 |
|
|
| 411 |
|
|
| 412 |
+ |
void |
| 413 |
|
quit(code) /* exit gracefully */ |
| 414 |
|
int code; |
| 415 |
|
{ |