ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/standard.h
(Generate patch)

Comparing ray/src/common/standard.h (file contents):
Revision 2.16 by greg, Sat Feb 22 02:07:22 2003 UTC vs.
Revision 2.23 by schorsch, Thu Jun 5 19:29:34 2003 UTC

# Line 1 | Line 1
1 < /* RCSid: $Id$ */
1 > /* RCSid $Id$ */
2   /*
3   *      Miscellaneous definitions required by many routines.
4   */
5  
6 < /* ====================================================================
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 < */
6 > #ifndef _RAD_STANDARD_H_
7 > #define _RAD_STANDARD_H_
8  
9 < #include  <stdio.h>
9 > #include "copyright.h"
10  
11 + #include  <stdio.h>
12   #include  <sys/types.h>
66
13   #include  <fcntl.h>
68
14   #include  <math.h>
70
15   #include  <errno.h>
72
16   #include  <stdlib.h>
74
17   #include  <string.h>
18  
19 + #include  "platform.h"
20   #include  "mat4.h"
21 +
22                                  /* regular transformation */
23   typedef struct {
24          MAT4  xfm;                              /* transform matrix */
# Line 142 | Line 86 | extern double  tcos();                 /* table-based cosine approxim
86   #define  ttan(x)                (tsin(x)/tcos(x))
87   #endif
88                                          /* custom version of assert(3) */
89 < #define  CHECK(be,et,em)        ((be) ? error(et,em) : 0)
89 > #define  CHECK(be,et,em)        if (be) error(et,em); else
90   #ifdef  DEBUG
91   #define  DCHECK                 CHECK
92   #else
93 < #define  DCHECK(be,et,em)       0
93 > #define  DCHECK(be,et,em)       (void)0
94   #endif
95                                          /* memory operations */
96   #ifdef  NOSTRUCTASS
97 < #define  copystruct(d,s)        bcopy((char *)(s),(char *)(d),sizeof(*(d)))
97 > #define  copystruct(d,s)        bcopy((void *)(s),(void *)(d),sizeof(*(d)))
98   #else
99   #define  copystruct(d,s)        (*(d) = *(s))
100   #endif
# Line 171 | Line 115 | extern off_t  lseek();
115   #define NIX 1
116   #endif
117  
174 #ifdef NOPROTO
118  
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
119                                          /* defined in badarg.c */
120   extern int      badarg(int ac, char **av, char *fl);
121                                          /* defined in bmalloc.c */
# Line 255 | Line 141 | extern char    *fixargv0(char *av0);
141                                          /* defined in fropen.c */
142   extern FILE     *frlibopen(char *fname);
143                                          /* defined in getlibpath.c */
144 < extern char     *getlibpath(void);
144 > extern char     *getrlibpath(void);
145                                          /* defined in getpath.c */
146   extern char     *getpath(char *fname, char *searchpath, int mode);
147                                          /* defined in portio.c */
# Line 274 | Line 160 | extern int     readbuf(int fd, char *bpos, int siz);
160   extern int      writebuf(int fd, char *bpos, int siz);
161                                          /* defined in rexpr.c */
162   extern int      ecompile(char *sp, int iflg, int wflag);
163 < extern char     *expsave();
163 > extern char     *expsave(void);
164   extern void     expset(char *ep);
165   extern char     *eindex(char *sp);
166                                          /* defined in savestr.c */
# Line 306 | Line 192 | extern int     invxf(XF *ret, int ac, char *av[]);
192   extern int      fullxf(FULLXF *fx, int ac, char *av[]);
193                                          /* defined in zeroes.c */
194   extern int      quadtratic(double *r, double a, double b, double c);
195 +                                        /* defined in dircode.c */
196 + extern int4     encodedir(FVECT dv);
197 + extern void     decodedir(FVECT dv, int4 dc);
198 + extern double   dir2diff(int4 dc1, int4 dc2);
199 + extern double   fdir2diff(int4 dc1, FVECT v2);
200                                          /* miscellaneous */
201   extern void     eputs(char *s);
202   extern void     wputs(char *s);
203   extern void     quit(int code);
204  
205 < #endif
205 >
206 > #endif /* _RAD_STANDARD_H_ */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines