1 |
< |
/* RCSid: $Id$ */ |
1 |
> |
/* RCSid $Id$ */ |
2 |
|
/* |
3 |
|
* Miscellaneous definitions required by many routines. |
4 |
|
*/ |
5 |
+ |
#ifndef _RAD_STANDARD_H_ |
6 |
+ |
#define _RAD_STANDARD_H_ |
7 |
+ |
#ifdef __cplusplus |
8 |
+ |
extern "C" { |
9 |
+ |
#endif |
10 |
|
|
11 |
< |
/* ==================================================================== |
7 |
< |
* The Radiance Software License, Version 1.0 |
8 |
< |
* |
9 |
< |
* Copyright (c) 1990 - 2002 The Regents of the University of California, |
10 |
< |
* through Lawrence Berkeley National Laboratory. All rights reserved. |
11 |
< |
* |
12 |
< |
* Redistribution and use in source and binary forms, with or without |
13 |
< |
* modification, are permitted provided that the following conditions |
14 |
< |
* are met: |
15 |
< |
* |
16 |
< |
* 1. Redistributions of source code must retain the above copyright |
17 |
< |
* notice, this list of conditions and the following disclaimer. |
18 |
< |
* |
19 |
< |
* 2. Redistributions in binary form must reproduce the above copyright |
20 |
< |
* notice, this list of conditions and the following disclaimer in |
21 |
< |
* the documentation and/or other materials provided with the |
22 |
< |
* distribution. |
23 |
< |
* |
24 |
< |
* 3. The end-user documentation included with the redistribution, |
25 |
< |
* if any, must include the following acknowledgment: |
26 |
< |
* "This product includes Radiance software |
27 |
< |
* (http://radsite.lbl.gov/) |
28 |
< |
* developed by the Lawrence Berkeley National Laboratory |
29 |
< |
* (http://www.lbl.gov/)." |
30 |
< |
* Alternately, this acknowledgment may appear in the software itself, |
31 |
< |
* if and wherever such third-party acknowledgments normally appear. |
32 |
< |
* |
33 |
< |
* 4. The names "Radiance," "Lawrence Berkeley National Laboratory" |
34 |
< |
* and "The Regents of the University of California" must |
35 |
< |
* not be used to endorse or promote products derived from this |
36 |
< |
* software without prior written permission. For written |
37 |
< |
* permission, please contact [email protected]. |
38 |
< |
* |
39 |
< |
* 5. Products derived from this software may not be called "Radiance", |
40 |
< |
* nor may "Radiance" appear in their name, without prior written |
41 |
< |
* permission of Lawrence Berkeley National Laboratory. |
42 |
< |
* |
43 |
< |
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED |
44 |
< |
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
45 |
< |
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
46 |
< |
* DISCLAIMED. IN NO EVENT SHALL Lawrence Berkeley National Laboratory OR |
47 |
< |
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
48 |
< |
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
49 |
< |
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF |
50 |
< |
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
51 |
< |
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
52 |
< |
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT |
53 |
< |
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
54 |
< |
* SUCH DAMAGE. |
55 |
< |
* ==================================================================== |
56 |
< |
* |
57 |
< |
* This software consists of voluntary contributions made by many |
58 |
< |
* individuals on behalf of Lawrence Berkeley National Laboratory. For more |
59 |
< |
* information on Lawrence Berkeley National Laboratory, please see |
60 |
< |
* <http://www.lbl.gov/>. |
61 |
< |
*/ |
11 |
> |
#include "copyright.h" |
12 |
|
|
13 |
|
#include <stdio.h> |
64 |
– |
|
14 |
|
#include <sys/types.h> |
66 |
– |
|
15 |
|
#include <fcntl.h> |
68 |
– |
|
16 |
|
#include <math.h> |
70 |
– |
|
17 |
|
#include <errno.h> |
72 |
– |
|
18 |
|
#include <stdlib.h> |
74 |
– |
|
19 |
|
#include <string.h> |
20 |
|
|
21 |
+ |
#include "platform.h" |
22 |
|
#include "mat4.h" |
23 |
+ |
|
24 |
|
/* regular transformation */ |
25 |
|
typedef struct { |
26 |
|
MAT4 xfm; /* transform matrix */ |
88 |
|
#define ttan(x) (tsin(x)/tcos(x)) |
89 |
|
#endif |
90 |
|
/* custom version of assert(3) */ |
91 |
< |
#define CHECK(be,et,em) ((be) ? error(et,em) : 0) |
91 |
> |
#define CHECK(be,et,em) if (be) error(et,em); else |
92 |
|
#ifdef DEBUG |
93 |
|
#define DCHECK CHECK |
94 |
|
#else |
95 |
< |
#define DCHECK(be,et,em) 0 |
95 |
> |
#define DCHECK(be,et,em) (void)0 |
96 |
|
#endif |
97 |
|
/* memory operations */ |
98 |
|
#ifdef NOSTRUCTASS |
99 |
< |
#define copystruct(d,s) bcopy((char *)(s),(char *)(d),sizeof(*(d))) |
99 |
> |
#define copystruct(d,s) bcopy((void *)(s),(void *)(d),sizeof(*(d))) |
100 |
|
#else |
101 |
|
#define copystruct(d,s) (*(d) = *(s)) |
102 |
|
#endif |
117 |
|
#define NIX 1 |
118 |
|
#endif |
119 |
|
|
174 |
– |
#ifdef NOPROTO |
120 |
|
|
176 |
– |
extern int badarg(); |
177 |
– |
extern char *bmalloc(); |
178 |
– |
extern void bfree(); |
179 |
– |
extern void error(); |
180 |
– |
extern int expandarg(); |
181 |
– |
extern time_t fdate(); |
182 |
– |
extern int setfdate(); |
183 |
– |
extern char *fgetline(); |
184 |
– |
extern int fgetval(); |
185 |
– |
extern char *fgetword(); |
186 |
– |
extern void fputword(); |
187 |
– |
extern char *fixargv0(); |
188 |
– |
extern FILE *frlibopen(); |
189 |
– |
extern char *getlibpath(); |
190 |
– |
extern char *getpath(); |
191 |
– |
extern void putstr(); |
192 |
– |
extern void putint(); |
193 |
– |
extern void putflt(); |
194 |
– |
extern char *getstr(); |
195 |
– |
extern long getint(); |
196 |
– |
extern double getflt(); |
197 |
– |
extern int open_process(); |
198 |
– |
extern int process(); |
199 |
– |
extern int close_process(); |
200 |
– |
extern int readbuf(); |
201 |
– |
extern int writebuf(); |
202 |
– |
extern int ecompile(); |
203 |
– |
extern char *expsave(); |
204 |
– |
extern void expset(); |
205 |
– |
extern char *eindex(); |
206 |
– |
extern char *savestr(); |
207 |
– |
extern void freestr(); |
208 |
– |
extern int shash(); |
209 |
– |
extern char *savqstr(); |
210 |
– |
extern void freeqstr(); |
211 |
– |
extern double tcos(); |
212 |
– |
extern int wordfile(); |
213 |
– |
extern int wordstring(); |
214 |
– |
extern char *atos(); |
215 |
– |
extern char *nextword(); |
216 |
– |
extern char *sskip(); |
217 |
– |
extern char *sskip2(); |
218 |
– |
extern char *iskip(); |
219 |
– |
extern char *fskip(); |
220 |
– |
extern int isint(); |
221 |
– |
extern int isintd(); |
222 |
– |
extern int isflt(); |
223 |
– |
extern int isfltd(); |
224 |
– |
extern int xf(); |
225 |
– |
extern int invxf(); |
226 |
– |
extern int fullxf(); |
227 |
– |
extern int quadtratic(); |
228 |
– |
extern void eputs(); |
229 |
– |
extern void wputs(); |
230 |
– |
extern void quit(); |
231 |
– |
|
232 |
– |
#else |
121 |
|
/* defined in badarg.c */ |
122 |
|
extern int badarg(int ac, char **av, char *fl); |
123 |
|
/* defined in bmalloc.c */ |
143 |
|
/* defined in fropen.c */ |
144 |
|
extern FILE *frlibopen(char *fname); |
145 |
|
/* defined in getlibpath.c */ |
146 |
< |
extern char *getlibpath(void); |
146 |
> |
extern char *getrlibpath(void); |
147 |
|
/* defined in getpath.c */ |
148 |
|
extern char *getpath(char *fname, char *searchpath, int mode); |
149 |
|
/* defined in portio.c */ |
162 |
|
extern int writebuf(int fd, char *bpos, int siz); |
163 |
|
/* defined in rexpr.c */ |
164 |
|
extern int ecompile(char *sp, int iflg, int wflag); |
165 |
< |
extern char *expsave(); |
165 |
> |
extern char *expsave(void); |
166 |
|
extern void expset(char *ep); |
167 |
|
extern char *eindex(char *sp); |
168 |
|
/* defined in savestr.c */ |
194 |
|
extern int fullxf(FULLXF *fx, int ac, char *av[]); |
195 |
|
/* defined in zeroes.c */ |
196 |
|
extern int quadtratic(double *r, double a, double b, double c); |
197 |
+ |
/* defined in dircode.c */ |
198 |
+ |
extern int4 encodedir(FVECT dv); |
199 |
+ |
extern void decodedir(FVECT dv, int4 dc); |
200 |
+ |
extern double dir2diff(int4 dc1, int4 dc2); |
201 |
+ |
extern double fdir2diff(int4 dc1, FVECT v2); |
202 |
|
/* miscellaneous */ |
203 |
|
extern void eputs(char *s); |
204 |
|
extern void wputs(char *s); |
205 |
|
extern void quit(int code); |
206 |
|
|
207 |
+ |
|
208 |
+ |
#ifdef __cplusplus |
209 |
+ |
} |
210 |
|
#endif |
211 |
+ |
#endif /* _RAD_STANDARD_H_ */ |
212 |
+ |
|