--- ray/src/common/standard.h 1991/10/24 08:37:58 1.9 +++ ray/src/common/standard.h 2003/06/27 06:53:22 2.31 @@ -1,70 +1,16 @@ -/* Copyright (c) 1990 Regents of the University of California */ - -/* SCCSid "$SunId$ LBL" */ - +/* RCSid $Id: standard.h,v 2.31 2003/06/27 06:53:22 greg Exp $ */ /* - * Miscellaneous definitions required by many routines. + * Collected includes required by many Radiance callers */ +#ifndef _RAD_STANDARD_H_ +#define _RAD_STANDARD_H_ -#include +#include "copyright.h" -#include +#include "rtio.h" +#include "rtmisc.h" +#include "rtmath.h" +#include "rterror.h" -#include +#endif /* _RAD_STANDARD_H_ */ -#include "mat4.h" - /* regular transformation */ -typedef struct { - MAT4 xfm; /* transform matrix */ - FLOAT sca; /* scalefactor */ -} XF; - /* complemetary tranformation */ -typedef struct { - XF f; /* forward */ - XF b; /* backward */ -} FULLXF; - -#ifdef M_PI -#define PI M_PI -#else -#define PI 3.14159265358979323846 -#endif - -#ifndef F_OK /* mode bits for access(2) call */ -#define R_OK 4 /* readable */ -#define W_OK 2 /* writable */ -#define X_OK 1 /* executable */ -#define F_OK 0 /* exists */ -#endif - /* error codes */ -#define WARNING 1 /* non-fatal error */ -#define USER 2 /* fatal user-caused error */ -#define SYSTEM 3 /* fatal system-related error */ -#define INTERNAL 4 /* fatal program-related error */ -#define CONSISTENCY 5 /* bad consistency check, abort */ -#define COMMAND 6 /* interactive error */ - -extern char errmsg[]; /* global buffer for error messages */ - -extern int errno; /* system error number */ - - /* memory operations */ -#ifdef NOSTRUCTASS -#define copystruct(d,s) bcopy((char *)(s),(char *)(d),sizeof(*(d))) -#else -#define copystruct(d,s) (*(d) = *(s)) -#endif - -#ifndef BSD -#define bcopy(s,d,n) (void)memcpy(d,s,n) -#define bzero(d,n) (void)memset(d,0,n) -#define bcmp(b1,b2,n) memcmp(b1,b2,n) -extern char *memcpy(), *memset(); -#define index strchr -#define rindex strrchr -#endif - -extern char *sskip(); -extern char *getpath(), *getenv(); -extern char *malloc(), *calloc(), *realloc(); -extern char *bmalloc(), *savestr(), *savqstr();