| 1 |
– |
/* Copyright (c) 1991 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 |
|
* lookamb.c - program to examine ambient components. |
| 9 |
– |
* |
| 10 |
– |
* 10/8/86 |
| 6 |
|
*/ |
| 7 |
|
|
| 8 |
< |
#include <stdio.h> |
| 8 |
> |
#include "copyright.h" |
| 9 |
|
|
| 10 |
< |
#ifdef MSDOS |
| 11 |
< |
#include <fcntl.h> |
| 17 |
< |
#endif |
| 18 |
< |
|
| 19 |
< |
#include "color.h" |
| 20 |
< |
|
| 10 |
> |
#include "platform.h" |
| 11 |
> |
#include "ray.h" |
| 12 |
|
#include "ambient.h" |
| 13 |
|
|
| 14 |
|
|
| 62 |
|
} |
| 63 |
|
fputformat(AMBFMT, stdout); |
| 64 |
|
putchar('\n'); |
| 65 |
< |
#ifdef MSDOS |
| 75 |
< |
setmode(fileno(stdout), O_BINARY); |
| 76 |
< |
#endif |
| 65 |
> |
SET_FILE_BINARY(stdout); |
| 66 |
|
putambmagic(stdout); |
| 67 |
|
writamb(fp); |
| 68 |
|
} else { |
| 69 |
< |
#ifdef MSDOS |
| 81 |
< |
setmode(fileno(fp), O_BINARY); |
| 82 |
< |
#endif |
| 69 |
> |
SET_FILE_BINARY(fp); |
| 70 |
|
if (checkheader(fp, AMBFMT, header ? stdout : (FILE *)NULL) < 0) |
| 71 |
|
goto formaterr; |
| 72 |
|
if (!hasambmagic(fp)) |
| 85 |
|
} |
| 86 |
|
|
| 87 |
|
|
| 88 |
+ |
void |
| 89 |
|
lookamb(fp) /* get ambient values from a file */ |
| 90 |
|
FILE *fp; |
| 91 |
|
{ |
| 121 |
|
} |
| 122 |
|
|
| 123 |
|
|
| 124 |
+ |
void |
| 125 |
|
writamb(fp) /* write binary ambient values */ |
| 126 |
|
FILE *fp; |
| 127 |
|
{ |