--- ray/src/common/standard.h 1989/07/27 22:41:04 1.2 +++ ray/src/common/standard.h 1991/10/24 08:37:58 1.9 @@ -1,4 +1,4 @@ -/* Copyright (c) 1988 Regents of the University of California */ +/* Copyright (c) 1990 Regents of the University of California */ /* SCCSid "$SunId$ LBL" */ @@ -12,11 +12,18 @@ #include -#include "fvect.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; -#define FHUGE (1e10) /* large real number */ -#define FTINY (1e-6) /* small real number */ - #ifdef M_PI #define PI M_PI #else @@ -41,7 +48,23 @@ extern char errmsg[]; /* global buffer for error me 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(); +extern char *getpath(), *getenv(); extern char *malloc(), *calloc(), *realloc(); extern char *bmalloc(), *savestr(), *savqstr();