OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
config.h
Go to the documentation of this file.
1 /*
2  * $Header: /disk01/seadas/Repository/seadas/inc/swfinc/config.h,v 1.5 2006/10/06 04:23:23 seadas Exp $
3  * $Log: config.h,v $
4  * Revision 1.5 2006/10/06 04:23:23 seadas
5  * MDM: cleaned up comments
6  *
7  * Revision 1.4 2006/10/06 03:46:38 seadas
8  * ifdef check for __APPLE__
9  *
10  * Revision 1.3 2006/07/14 17:03:53 seadas
11  * MAR: svn update. 7/14/06.
12  *
13  * Revision 4.16 1995/12/07 17:36:11 seawifsd
14  * updated support prototype for IRIX_5
15  *
16  * Revision 4.15 1995/05/31 17:41:39 seawifsd
17  * typo NEED_BLKCKR -> NEED_BLKCLR.
18  *
19  * Revision 4.14 1995/05/12 13:39:49 seawifsd
20  * added '#include <limits.h>' to get SHRT_MAX, SHRT_MIN, ...
21  *
22  * Revision 4.13 1995/05/11 15:57:08 seawifsd
23  * added support that even when the upgraded OS is not been tested, hopefully
24  * code can still be successfully compiled.
25  *
26  * Revision 4.12 1995/05/11 15:51:29 seawifsd
27  * added support for IRIX64_6(64 bit IRIX running IRIX 6.x)
28  *
29  * Revision 4.11 1995/04/03 14:23:32 seawifsd
30  * added support for OSF/1.
31  *
32  * Revision 4.10 1995/01/17 19:59:00 seawifsd
33  * Jan. 17, 1994, V4.10
34  *
35  * Revision 4.1 1995/01/17 14:15:14 seawifsd
36  * Jan. 9, 1994, 4.0
37  *
38  * Revision 3.4 1994/11/29 16:53:09 seawifsd
39  * fixed prototyping of gethostname routine when some macro definitions are
40  * in certain states(_SGI_SOURCE, _POSIX_SOURCE, _XOPEN_SOURCE).
41  *
42  * Revision 3.3 1994/11/08 18:47:15 seawifsd
43  * Nov. 8, 1994, 3.3a3
44  *
45  * Revision 3.3 1994/11/08 15:05:12 seawifsd
46  * Nov. 8, 1994, 3.3a2
47  *
48  */
49 
50 
51 #ifndef CONFIG_H_
52 #define CONFIG_H_
53 
54 #include <stdio.h>
55 #include <limits.h>
56 #include <time.h>
57 #include <stdint.h>
58 
59 typedef uint32_t uaddr;
60 
61 #ifdef IRIX_4
62 
63 #ifdef PROTOTYPE
64 extern char *basename(char *path);
65 extern char *dirname(char *path);
66 extern int gethostname(char *name, int namelen);
67 #else
68 extern char *basename();
69 extern char *dirname();
70 extern int gethostname();
71 #endif /* PROTOTYPE */
72 
73 #endif /* IRIX_4 -> IRIX 4.0.5C */
74 
75 
76 #if (defined(IRIX_5) || defined(IRIX64_6) || (defined(__sgi) && !defined(IRIX_4)))
77 
78 /* basename(),dirname() */
79 #include <libgen.h>
80 #if defined(_SGI_SOURCE) && !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE)
81 /* gethostname() */
82 #include <unistd.h>
83 /* strcasecmp() */
84 #include <string.h>
85 #else
86 extern int gethostname(char *name, int namelen);
87 extern int strcasecmp(const char *, const char *);
88 extern int strncasecmp(const char *, const char *);
89 #endif /* _SGI_SOURCE && !_POSIX_SOURCE && !_XOPEN_SOURCE */
90 
91 #endif /* IRIX_5 || IRIX64_6 || (!IRIX_4 && __sgi))*/
92 
93 
94 #if (defined(IRIX_4) || defined(IRIX_5) || defined(IRIX64_6) || defined(__sgi))
95 /* bzero(),bcopy(),bcmp(),blkclr() */
96 #include <bstring.h>
97 #endif /* IRIX_4 || IRIX_5 || IRIX64_6 || __sgi */
98 
99 #ifdef SunOS_4
100 #endif /* SunOS 4.1.3 */
101 
102 
103 #ifdef SunOS_5
104 /* bzero */
105 extern void bzero(register char *sp, int len);
106 /* bzero only exist in BSD compatible mode */
107 #define NEED_BZERO
108 #define NEED_BLKCLR
109 #define NEED_SETLINEBUF
110 #define NEED_TRUNC
111 #endif /* Solaris -> SunOS 5.3 */
112 
113 #ifdef OSF1_V3
114 #define NEED_CFTIME
115 #define NEED_BLKCLR
116 #define NEED__TIMEZONE
117 #define NEED__ALTZONE
118 #define NEED_ALTZONE
119 #endif /* OSF1_V3 */
120 
121 
122 /* define non-ANSI related */
123 #if (!defined(_POSIX_SOURCE) && !defined(__EXTENSIONS__))
124 
125 /*
126  * ANSI does not define this in limits.h but POSIX do
127  */
128 #ifndef PATH_MAX
129 #define PATH_MAX 1024
130 #endif
131 
132 /*
133  * In 4.0.5C, this is defined in string.h but said that is not in the
134  * standard. In 5.1, this is not defined when you use -ansi
135  */
136 extern char * strdup(const char *);
137 
138 extern void tzset(void);
139 extern int cftime(char *, char *, const time_t *);
140 
141 extern FILE * popen(const char *, const char *);
142 extern int pclose(FILE *);
143 
144 #endif /* !_POSIX_SOURCE && !__EXTENSIONS__ */
145 
146 /*
147  * in SGI 5.2, setlinebuf is defined only when
148  * _SGI_SOURCE && !_POSIX_SOURCE && !_XOPEN_SOURCE
149  *
150  * while in SGI 4.0.5C, setlinebuf is defined when
151  * !_POSIX_SOURCE && __EXTENSIONS__
152  */
153 #if defined(_POSIX_SOURCE) || !defined(__EXTENSION__)
154 
155 /* FILE requires the inclusion of stdio.h */
156 #ifndef OSF1_V3
157 #if defined(LINUX) && !(defined(__APPLE__))
158 extern void setlinebuf(FILE *stream);
159 #else
160 extern int setlinebuf(FILE *stream);
161 #endif
162 #endif /* !OSF1_V3 */
163 
164 /* trunc.h */
165 extern double trunc(double);
166 #ifndef OSF1_V3
167 /* #pragma no side effects (trunc) */
168 #endif /* !OSF1_V3 */
169 
170 #endif /* _POSIX_SOURCE || !__EXTENSION__ */
171 
172 #ifdef NEED_BZERO
173 #define bzero(p,l) {int i; register char *sp; sp = p ; for (i=0; i < l ; i++) {*sp = 0;sp++;}}
174 #endif /* NEED_BZERO */
175 #ifdef NEED_BLKCLR
176 #define blkclr(p,l) bzero(p,l)
177 #endif /* NEED_BLKCLR */
178 #ifdef NEED_SETLINEBUF
179 /*
180 #define setlinebuf(lun) {char buf[BUFSIZ + 8]; setvbuf(lun,buf,_IOLBF,BUFSIZ);}
181  */
182 #define setlinebuf(lun) setvbuf(lun,NULL,_IOLBF,0)
183 #endif /* NEED_SETLINEBUF */
184 #ifdef NEED_TRUNC
185 #define trunc(x) (((x) > 0)?floor(x):ceil(x))
186 #endif /* NEED_TRUNC */
187 #ifdef NEED_CFTIME
188 /*
189  this is not complete correct if s is dynamically declared than sizeof(s)
190  is always 4.
191  */
192 #define cftime(s,fmt,tick) strftime(s,sizeof(s),fmt,localtime(tick))
193 #endif /* NEED_CFTIME */
194 
195 #ifdef NEED__TIMEZONE
196 #define _timezone timezone
197 #endif /* NEED__TIMEZONE */
198 
199 #ifdef NEED__ALTZONE
200 #define _altzone altzone
201 #endif /* NEED__ALTZONE */
202 
203 #ifdef NEED_ALTZONE
204 /* this is not really a fix. But altzone is not used anyway. */
205 #define altzone timezone
206 #endif /* NEED_ALTZONE */
207 
208 #endif /* CONFIG_H_ */
FILE * popen(const char *, const char *)
int cftime(char *, char *, const time_t *)
void bzero()
int setlinebuf(FILE *stream)
int pclose(FILE *)
string path
Definition: color_dtdb.py:221
char * strdup(const char *)
void tzset(void)
#define basename(s)
Definition: l0chunk_modis.c:29
double trunc(double)
uint32_t uaddr
Definition: config.h:59