12 |
|
|
13 |
|
#include <stdio.h> |
14 |
|
|
15 |
+ |
#ifdef MSDOS |
16 |
+ |
#include <fcntl.h> |
17 |
+ |
#endif |
18 |
+ |
|
19 |
|
#include "color.h" |
20 |
|
|
21 |
|
#include "ambient.h" |
29 |
|
|
30 |
|
|
31 |
|
main(argc, argv) /* load ambient values from a file */ |
32 |
+ |
int argc; |
33 |
|
char *argv[]; |
34 |
|
{ |
35 |
|
FILE *fp; |
69 |
|
printargs(argc, argv, stdout); |
70 |
|
fputformat(AMBFMT, stdout); |
71 |
|
putchar('\n'); |
72 |
+ |
#ifdef MSDOS |
73 |
+ |
setmode(fileno(stdout), O_BINARY); |
74 |
+ |
#endif |
75 |
|
putambmagic(stdout); |
76 |
|
writamb(fp); |
77 |
|
} else { |
78 |
+ |
#ifdef MSDOS |
79 |
+ |
setmode(fileno(fp), O_BINARY); |
80 |
+ |
#endif |
81 |
|
if (checkheader(fp, AMBFMT, header ? stdout : (FILE *)NULL) < 0) |
82 |
|
goto formaterr; |
83 |
|
if (!hasambmagic(fp)) |