--- ray/src/common/standard.h 2003/02/22 02:07:22 2.16
+++ ray/src/common/standard.h 2003/06/20 00:25:49 2.27
@@ -1,80 +1,27 @@
-/* RCSid: $Id: standard.h,v 2.16 2003/02/22 02:07:22 greg Exp $ */
+/* RCSid $Id: standard.h,v 2.27 2003/06/20 00:25:49 greg Exp $ */
/*
* Miscellaneous definitions required by many routines.
*/
+#ifndef _RAD_STANDARD_H_
+#define _RAD_STANDARD_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
-/* ====================================================================
- * The Radiance Software License, Version 1.0
- *
- * Copyright (c) 1990 - 2002 The Regents of the University of California,
- * through Lawrence Berkeley National Laboratory. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes Radiance software
- * (http://radsite.lbl.gov/)
- * developed by the Lawrence Berkeley National Laboratory
- * (http://www.lbl.gov/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Radiance," "Lawrence Berkeley National Laboratory"
- * and "The Regents of the University of California" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact radiance@radsite.lbl.gov.
- *
- * 5. Products derived from this software may not be called "Radiance",
- * nor may "Radiance" appear in their name, without prior written
- * permission of Lawrence Berkeley National Laboratory.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL Lawrence Berkeley National Laboratory OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of Lawrence Berkeley National Laboratory. For more
- * information on Lawrence Berkeley National Laboratory, please see
- * .
- */
+#include "copyright.h"
#include
-
#include
-
#include
-
#include
-
#include
-
#include
-
#include
+#include "tifftypes.h"
+
#include "mat4.h"
+
/* regular transformation */
typedef struct {
MAT4 xfm; /* transform matrix */
@@ -94,6 +41,7 @@ typedef struct {
#endif
#endif
+/* XXX include paths.h instead */
#ifndef F_OK /* mode bits for access(2) call */
#define R_OK 4 /* readable */
#define W_OK 2 /* writable */
@@ -101,13 +49,6 @@ typedef struct {
#define F_OK 0 /* exists */
#endif
-#ifndef int2
-#define int2 short /* two-byte integer */
-#endif
-#ifndef int4
-#define int4 int /* four-byte integer */
-#endif
-
/* error codes */
#define WARNING 0 /* non-fatal error */
#define USER 1 /* fatal user-caused error */
@@ -142,15 +83,15 @@ extern double tcos(); /* table-based cosine approxim
#define ttan(x) (tsin(x)/tcos(x))
#endif
/* custom version of assert(3) */
-#define CHECK(be,et,em) ((be) ? error(et,em) : 0)
+#define CHECK(be,et,em) if (be) error(et,em); else
#ifdef DEBUG
#define DCHECK CHECK
#else
-#define DCHECK(be,et,em) 0
+#define DCHECK(be,et,em) (void)0
#endif
/* memory operations */
#ifdef NOSTRUCTASS
-#define copystruct(d,s) bcopy((char *)(s),(char *)(d),sizeof(*(d)))
+#define copystruct(d,s) bcopy((void *)(s),(void *)(d),sizeof(*(d)))
#else
#define copystruct(d,s) (*(d) = *(s))
#endif
@@ -164,72 +105,14 @@ extern double tcos(); /* table-based cosine approxim
#endif
extern off_t lseek();
-#ifdef MSDOS
+#ifdef _WIN32
#define NIX 1
#endif
#ifdef AMIGA
#define NIX 1
#endif
-#ifdef NOPROTO
-extern int badarg();
-extern char *bmalloc();
-extern void bfree();
-extern void error();
-extern int expandarg();
-extern time_t fdate();
-extern int setfdate();
-extern char *fgetline();
-extern int fgetval();
-extern char *fgetword();
-extern void fputword();
-extern char *fixargv0();
-extern FILE *frlibopen();
-extern char *getlibpath();
-extern char *getpath();
-extern void putstr();
-extern void putint();
-extern void putflt();
-extern char *getstr();
-extern long getint();
-extern double getflt();
-extern int open_process();
-extern int process();
-extern int close_process();
-extern int readbuf();
-extern int writebuf();
-extern int ecompile();
-extern char *expsave();
-extern void expset();
-extern char *eindex();
-extern char *savestr();
-extern void freestr();
-extern int shash();
-extern char *savqstr();
-extern void freeqstr();
-extern double tcos();
-extern int wordfile();
-extern int wordstring();
-extern char *atos();
-extern char *nextword();
-extern char *sskip();
-extern char *sskip2();
-extern char *iskip();
-extern char *fskip();
-extern int isint();
-extern int isintd();
-extern int isflt();
-extern int isfltd();
-extern int xf();
-extern int invxf();
-extern int fullxf();
-extern int quadtratic();
-extern void eputs();
-extern void wputs();
-extern void quit();
-
-#else
/* defined in badarg.c */
extern int badarg(int ac, char **av, char *fl);
/* defined in bmalloc.c */
@@ -255,7 +138,7 @@ extern char *fixargv0(char *av0);
/* defined in fropen.c */
extern FILE *frlibopen(char *fname);
/* defined in getlibpath.c */
-extern char *getlibpath(void);
+extern char *getrlibpath(void);
/* defined in getpath.c */
extern char *getpath(char *fname, char *searchpath, int mode);
/* defined in portio.c */
@@ -274,7 +157,7 @@ extern int readbuf(int fd, char *bpos, int siz);
extern int writebuf(int fd, char *bpos, int siz);
/* defined in rexpr.c */
extern int ecompile(char *sp, int iflg, int wflag);
-extern char *expsave();
+extern char *expsave(void);
extern void expset(char *ep);
extern char *eindex(char *sp);
/* defined in savestr.c */
@@ -306,9 +189,23 @@ extern int invxf(XF *ret, int ac, char *av[]);
extern int fullxf(FULLXF *fx, int ac, char *av[]);
/* defined in zeroes.c */
extern int quadtratic(double *r, double a, double b, double c);
+ /* defined in dircode.c */
+extern int32 encodedir(FVECT dv);
+extern void decodedir(FVECT dv, int32 dc);
+extern double dir2diff(int32 dc1, int32 dc2);
+extern double fdir2diff(int32 dc1, FVECT v2);
+ /* defined in lamp.c */
+extern float * matchlamp(char *s);
+extern int loadlamps(char *file);
+extern void freelamps(void);
/* miscellaneous */
extern void eputs(char *s);
extern void wputs(char *s);
extern void quit(int code);
+
+#ifdef __cplusplus
+}
#endif
+#endif /* _RAD_STANDARD_H_ */
+