| 1 | < | /* Copyright (c) 1990 Regents of the University of California */ | 
| 2 | < |  | 
| 3 | < | /* SCCSid "$SunId$ LBL" */ | 
| 4 | < |  | 
| 1 | > | /* RCSid $Id$ */ | 
| 2 |  | /* | 
| 3 | < | *      Miscellaneous definitions required by many routines. | 
| 3 | > | *      Collected includes required by many Radiance callers | 
| 4 |  | */ | 
| 5 | + | #ifndef _RAD_STANDARD_H_ | 
| 6 | + | #define _RAD_STANDARD_H_ | 
| 7 |  |  | 
| 8 | < | #include  <stdio.h> | 
| 8 | > | #include  "copyright.h" | 
| 9 |  |  | 
| 10 | < | #include  <math.h> | 
| 10 | > | #include  "rtio.h" | 
| 11 | > | #include  "rtmisc.h" | 
| 12 | > | #include  "rtmath.h" | 
| 13 | > | #include  "rterror.h" | 
| 14 |  |  | 
| 15 | < | #include  <errno.h> | 
| 15 | > | #endif /* _RAD_STANDARD_H_ */ | 
| 16 |  |  | 
| 15 | – | #include  "mat4.h" | 
| 16 | – | /* regular transformation */ | 
| 17 | – | typedef struct { | 
| 18 | – | MAT4  xfm;                              /* transform matrix */ | 
| 19 | – | FLOAT  sca;                             /* scalefactor */ | 
| 20 | – | }  XF; | 
| 21 | – | /* complemetary tranformation */ | 
| 22 | – | typedef struct { | 
| 23 | – | XF  f;                                  /* forward */ | 
| 24 | – | XF  b;                                  /* backward */ | 
| 25 | – | }  FULLXF; | 
| 26 | – |  | 
| 27 | – | #ifdef  M_PI | 
| 28 | – | #define  PI             M_PI | 
| 29 | – | #else | 
| 30 | – | #define  PI             3.14159265358979323846 | 
| 31 | – | #endif | 
| 32 | – |  | 
| 33 | – | #ifndef  F_OK                   /* mode bits for access(2) call */ | 
| 34 | – | #define  R_OK           4               /* readable */ | 
| 35 | – | #define  W_OK           2               /* writable */ | 
| 36 | – | #define  X_OK           1               /* executable */ | 
| 37 | – | #define  F_OK           0               /* exists */ | 
| 38 | – | #endif | 
| 39 | – | /* error codes */ | 
| 40 | – | #define  WARNING        1               /* non-fatal error */ | 
| 41 | – | #define  USER           2               /* fatal user-caused error */ | 
| 42 | – | #define  SYSTEM         3               /* fatal system-related error */ | 
| 43 | – | #define  INTERNAL       4               /* fatal program-related error */ | 
| 44 | – | #define  CONSISTENCY    5               /* bad consistency check, abort */ | 
| 45 | – | #define  COMMAND        6               /* interactive error */ | 
| 46 | – |  | 
| 47 | – | extern char  errmsg[];                  /* global buffer for error messages */ | 
| 48 | – |  | 
| 49 | – | extern int  errno;                      /* system error number */ | 
| 50 | – |  | 
| 51 | – | /* memory operations */ | 
| 52 | – | #ifdef  NOSTRUCTASS | 
| 53 | – | #define  copystruct(d,s)        bcopy((char *)(s),(char *)(d),sizeof(*(d))) | 
| 54 | – | #else | 
| 55 | – | #define  copystruct(d,s)        (*(d) = *(s)) | 
| 56 | – | #endif | 
| 57 | – |  | 
| 58 | – | #ifndef  BSD | 
| 59 | – | #define  bcopy(s,d,n)           (void)memcpy(d,s,n) | 
| 60 | – | #define  bzero(d,n)             (void)memset(d,0,n) | 
| 61 | – | #define  bcmp(b1,b2,n)          memcmp(b1,b2,n) | 
| 62 | – | extern char  *memcpy(), *memset(); | 
| 63 | – | #define  index                  strchr | 
| 64 | – | #define  rindex                 strrchr | 
| 65 | – | #endif | 
| 66 | – |  | 
| 67 | – | extern char  *sskip(); | 
| 68 | – | extern char  *getpath(), *getenv(); | 
| 69 | – | extern char  *malloc(), *calloc(), *realloc(); | 
| 70 | – | extern char  *bmalloc(), *savestr(), *savqstr(); |