ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/standard.h
Revision: 2.6
Committed: Fri Nov 10 17:04:14 1995 UTC (28 years, 5 months ago) by greg
Content type: text/plain
Branch: MAIN
Changes since 2.5: +0 -1 lines
Log Message:
removed memcpy() declaration

File Contents

# User Rev Content
1 greg 2.2 /* Copyright (c) 1992 Regents of the University of California */
2 greg 1.1
3     /* SCCSid "$SunId$ LBL" */
4    
5     /*
6     * Miscellaneous definitions required by many routines.
7     */
8    
9     #include <stdio.h>
10    
11 greg 2.2 #include <fcntl.h>
12    
13 greg 1.1 #include <math.h>
14    
15     #include <errno.h>
16    
17 greg 1.5 #include "mat4.h"
18     /* regular transformation */
19     typedef struct {
20     MAT4 xfm; /* transform matrix */
21 greg 1.8 FLOAT sca; /* scalefactor */
22 greg 1.5 } XF;
23     /* complemetary tranformation */
24     typedef struct {
25     XF f; /* forward */
26     XF b; /* backward */
27     } FULLXF;
28 greg 1.1
29 greg 2.2 #ifdef M_PI
30     #define PI M_PI
31 greg 1.1 #else
32 greg 2.2 #define PI 3.14159265358979323846
33 greg 1.1 #endif
34 greg 1.2
35 greg 2.2 #ifndef F_OK /* mode bits for access(2) call */
36     #define R_OK 4 /* readable */
37     #define W_OK 2 /* writable */
38     #define X_OK 1 /* executable */
39     #define F_OK 0 /* exists */
40 greg 1.2 #endif
41 greg 1.1 /* error codes */
42 greg 2.2 #define WARNING 1 /* non-fatal error */
43     #define USER 2 /* fatal user-caused error */
44     #define SYSTEM 3 /* fatal system-related error */
45     #define INTERNAL 4 /* fatal program-related error */
46     #define CONSISTENCY 5 /* bad consistency check, abort */
47     #define COMMAND 6 /* interactive error */
48 greg 1.1
49     extern char errmsg[]; /* global buffer for error messages */
50    
51 greg 1.3 /* memory operations */
52 greg 2.2 #ifdef NOSTRUCTASS
53     #define copystruct(d,s) bcopy((char *)(s),(char *)(d),sizeof(*(d)))
54 greg 1.9 #else
55 greg 2.2 #define copystruct(d,s) (*(d) = *(s))
56 greg 1.3 #endif
57 greg 1.6
58 greg 2.2 #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     #define index strchr
63     #define rindex strrchr
64 greg 1.3 #endif
65    
66 greg 1.1 extern char *sskip();
67 greg 1.4 extern char *getpath(), *getenv();
68 greg 2.3 #ifndef malloc
69 greg 1.1 extern char *malloc(), *calloc(), *realloc();
70 greg 2.3 #endif
71 greg 1.1 extern char *bmalloc(), *savestr(), *savqstr();
72 greg 2.2
73 greg 2.5 #ifdef DCL_ATOF
74     extern double atof();
75     #endif
76    
77 greg 2.2 #ifdef MSDOS
78     #define NIX 1
79     #endif
80     #ifdef AMIGA
81     #define NIX 1
82     #endif
83