HDF5 Extras  0.0.1
Convenience Functions for using HDF5 Better
globals.h
Go to the documentation of this file.
1 #ifndef GLOBALS_H_
2 #define GLOBALS_H_
3 
4 #include <sys/types.h>
5 #include <limits.h>
6 #include <float.h>
7 #include <math.h>
8 #include <complex.h>
9 
10 
11 #include "gmalloc.h"
12 #include "bstrlib.h"
13 
14 #include "hdf5mine.h"
15 
19 #define TRUE 1
20 #define FALSE 0
21 #define ERROR -1
22 
23 
24 
25 
26 
27 
28  //globals for IFiles:
29 extern bstring status_string;
30 extern bstring error_string;
31 
32 
33 
34 extern bstring file_metadata_name;
35 
36 
37 
176 // geoscipy data types:
177 #define GS_DATATYPE_UNK 0
178 #define GS_DATATYPE_UI1 1
179 #define GS_DATATYPE_UI8 2
180 #define GS_DATATYPE_SI8 3
181 #define GS_DATATYPE_CI8 4
182 #define GS_DATATYPE_UI16 5
183 #define GS_DATATYPE_SI16 6
184 #define GS_DATATYPE_CI16 7
185 #define GS_DATATYPE_UI32 8
186 #define GS_DATATYPE_SI32 9
187 #define GS_DATATYPE_CI32 10
188 #define GS_DATATYPE_CI64 11
189 #define GS_DATATYPE_R32 12
190 #define GS_DATATYPE_R64 13
191 #define GS_DATATYPE_C64 14
192 #define GS_DATATYPE_C128 15
193 #define GS_DATATYPE_UI64 16
194 #define GS_DATATYPE_SI64 17
195 #define GS_DATATYPE_MAX 17
196 
197 
198 
199 /* -------------------------------------------------------------------- */
200 /* Useful macros. Note that MAX and MIN may evaluate */
201 /* their arguments more than once! */
202 /* -------------------------------------------------------------------- */
203 #ifndef MAX
204 # define MIN(a,b) ((a<b) ? a : b)
205 # define MAX(a,b) ((a>b) ? a : b)
206 #endif
207 
208 #ifndef ABS
209 # define ABS(x) ((x<0) ? (-1*(x)) : x)
210 #endif
211 
212 // case-insensitive comparison funcs for bstrings:
213 #ifndef EQUALN
214 #define EQUALN(a,b,n) (bstrnicmp(a,b,n)==0)
215 #endif
216 
217 #ifndef EQUAL
218 #define EQUAL(a,b) (bstricmp(a,b)==0)
219 #endif
220 
221 #ifndef EQUALC
222 #define EQUALC(a,b) (strcasecmp(a,b)==0)
223 #endif
224 
225 #define ByteCopy(s,d,n) bcopy((char *) (s),(char *) (d), n)
226 #define BstringCopy(s,d,n) bassignblk((bstring)(d), (char *)(s), n)
227 
228 
229 
230 
231 #endif
232 
Definition: bstrlib.h:200