ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/standard.h
(Generate patch)

Comparing ray/src/common/standard.h (file contents):
Revision 2.4 by greg, Fri Jun 4 15:02:45 1993 UTC vs.
Revision 2.12 by gwlarson, Wed Jun 17 13:28:16 1998 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1992 Regents of the University of California */
1 > /* Copyright (c) 1997 Silicon Graphics, Inc. */
2  
3 < /* SCCSid "$SunId$ LBL" */
3 > /* SCCSid "$SunId$ SGI" */
4  
5   /*
6   *      Miscellaneous definitions required by many routines.
# Line 8 | Line 8
8  
9   #include  <stdio.h>
10  
11 + #include  <sys/types.h>
12 +
13   #include  <fcntl.h>
14  
15   #include  <math.h>
# Line 26 | Line 28 | typedef struct {
28          XF  b;                                  /* backward */
29   }  FULLXF;
30  
31 + #ifndef  PI
32   #ifdef  M_PI
33 < #define  PI             M_PI
33 > #define  PI             ((double)M_PI)
34   #else
35   #define  PI             3.14159265358979323846
36   #endif
37 + #endif
38  
39   #ifndef  F_OK                   /* mode bits for access(2) call */
40   #define  R_OK           4               /* readable */
# Line 38 | Line 42 | typedef struct {
42   #define  X_OK           1               /* executable */
43   #define  F_OK           0               /* exists */
44   #endif
45 +
46 + extern int  eputs(), wputs();   /* standard error output functions */
47 +
48                                  /* error codes */
49 < #define  WARNING        1               /* non-fatal error */
50 < #define  USER           2               /* fatal user-caused error */
51 < #define  SYSTEM         3               /* fatal system-related error */
52 < #define  INTERNAL       4               /* fatal program-related error */
53 < #define  CONSISTENCY    5               /* bad consistency check, abort */
54 < #define  COMMAND        6               /* interactive error */
49 > #define  WARNING        0               /* non-fatal error */
50 > #define  USER           1               /* fatal user-caused error */
51 > #define  SYSTEM         2               /* fatal system-related error */
52 > #define  INTERNAL       3               /* fatal program-related error */
53 > #define  CONSISTENCY    4               /* bad consistency check, abort */
54 > #define  COMMAND        5               /* interactive error */
55 > #define  NERRS          6
56 >                                /* error struct */
57 > extern struct erract {
58 >        char    pre[16];                /* prefix message */
59 >        int     (*pf)();                /* put function (resettable) */
60 >        int     ec;                     /* exit code (0 means non-fatal) */
61 > } erract[NERRS];        /* list of error actions */
62  
63 + #define  ERRACT_INIT    {       {"warning - ", wputs, 0}, \
64 +                                {"fatal - ", eputs, 1}, \
65 +                                {"system - ", eputs, 2}, \
66 +                                {"internal - ", eputs, 1}, \
67 +                                {"consistency - ", eputs, -1}, \
68 +                                {"", NULL, 0}   }
69 +
70   extern char  errmsg[];                  /* global buffer for error messages */
71  
72                                          /* memory operations */
# Line 55 | Line 76 | extern char  errmsg[];                 /* global buffer for error me
76   #define  copystruct(d,s)        (*(d) = *(s))
77   #endif
78  
79 < #ifndef  BSD
79 > #ifdef   BSD
80 > extern long  lseek();
81 > #else
82   #define  bcopy(s,d,n)           (void)memcpy(d,s,n)
83   #define  bzero(d,n)             (void)memset(d,0,n)
84   #define  bcmp(b1,b2,n)          memcmp(b1,b2,n)
62 extern char  *memcpy(), *memset();
85   #define  index                  strchr
86   #define  rindex                 strrchr
87 + extern off_t  lseek();
88   #endif
89 + extern long  ftell();
90  
91 < extern char  *sskip();
91 > extern char  *sskip(), *sskip2();
92   extern char  *getpath(), *getenv();
93   #ifndef malloc
94   extern char  *malloc(), *calloc(), *realloc();
95   #endif
96   extern char  *bmalloc(), *savestr(), *savqstr();
97 +
98 + #ifdef  DCL_ATOF
99 + extern double  atof();
100 + #endif
101  
102   #ifdef MSDOS
103   #define NIX 1

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines