--- ray/src/common/standard.h 1989/02/02 10:34:23 1.1 +++ ray/src/common/standard.h 1990/12/15 15:01:35 1.5 @@ -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,7 +12,17 @@ #include -#include "fvect.h" +#include "mat4.h" + /* regular transformation */ +typedef struct { + MAT4 xfm; /* transform matrix */ + double 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 */ @@ -22,6 +32,13 @@ #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 */ @@ -34,7 +51,20 @@ extern char errmsg[]; /* global buffer for error me extern int errno; /* system error number */ + /* memory operations */ +#ifdef STRUCTASSIGN +#define copystruct(d,s) (*(d) = *(s)) +#else +#define copystruct(d,s) bcopy((char *)(s),(char *)(d),sizeof(*(d))) +#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(); +#endif + extern char *sskip(); -extern char *getpath(); +extern char *getpath(), *getenv(); extern char *malloc(), *calloc(), *realloc(); extern char *bmalloc(), *savestr(), *savqstr();