MISR Toolkit  1.5.1
hdfi.h
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2  * Copyright by The HDF Group. *
3  * Copyright by the Board of Trustees of the University of Illinois. *
4  * All rights reserved. *
5  * *
6  * This file is part of HDF. The full HDF copyright notice, including *
7  * terms governing use, modification, and redistribution, is contained in *
8  * the files COPYING and Copyright.html. COPYING can be found at the root *
9  * of the source code distribution tree; Copyright.html can be found at *
10  * http://hdfgroup.org/products/hdf4/doc/Copyright.html. If you do not have *
11  * access to either file, you may request a copy from help@hdfgroup.org. *
12  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
13 
14 /* $Id: hdfi.h 5443 2010-08-24 20:52:13Z byrn $ */
15 
16 #ifndef HDFI_H
17 #define HDFI_H
18 
19 #ifdef GOT_MACHINE
20 #undef GOT_MACHINE
21 #endif
22 
23 /*--------------------------------------------------------------------------*/
24 /* MT/NT constants */
25 /* Four MT nibbles represent double, float, int, uchar (from most */
26 /* significant to least significant). */
27 /* Each "column" in the "table" below is essentially independant of the */
28 /* other "columns", for example the CONVEXNATIVE entry means that the */
29 /* floating point formats are in Convex native format but the integers */
30 /* are big-endian and standard sizes */
31 /* If you add another value to this "table", you need to add another */
32 /* DFNTF_xxx entry in hntdefs.h */
33 /* The values for each nibble are: */
34 /* 1 - Big Endian */
35 /* (i.e. Big-Endian, 32-bit architecture w/IEEE Floats) */
36 /* 2 - VAX */
37 /* (i.e. Middle-Endian, 32-bit architecture w/VAX Floats) */
38 /* 3 - Cray */
39 /* (i.e. Big-Endian, all 64-bit architecture w/Cray Floats) */
40 /* 4 - Little Endian */
41 /* (i.e. Little-Endian, 32-bit architecture w/IEEE Floats) */
42 /* 5 - Convex */
43 /* (i.e. Big-Endian, 32-bit architecture w/Convex Native Floats) */
44 /* 6 - Fujitsu VP */
45 /* (i.e. Big-Endian, 32-bit architecture w/Fujitsu Native Floats) */
46 /* 7 - Cray MPP */
47 /* (i.e. Big-Endian, 32-bit architecture w/IEEE Floats, but no 16-bit type) */
48 /* 8 - Cray IEEE */
49 /* (i.e. Big-Endian, all 64-bit architecture w/IEEE Floats) */
50 /*--------------------------------------------------------------------------*/
51 #define DFMT_SUN 0x1111
52 #define DFMT_SUN_INTEL 0x4441
53 #define DFMT_ALLIANT 0x1111
54 #define DFMT_IRIX 0x1111
55 #define DFMT_APOLLO 0x1111
56 #define DFMT_IBM6000 0x1111
57 #define DFMT_HP9000 0x1111
58 #define DFMT_CONVEXNATIVE 0x5511
59 #define DFMT_CONVEX 0x1111
60 #define DFMT_UNICOS 0x3331
61 #define DFMT_UNICOSIEEE 0x1831
62 #define DFMT_CTSS 0x3331
63 #define DFMT_VAX 0x2221
64 #define DFMT_MIPSEL 0x4441
65 #define DFMT_PC 0x4441
66 #define DFMT_APPLE 0x1111
67 #define DFMT_APPLE_INTEL 0x4441
68 #define DFMT_MAC 0x1111
69 #define DFMT_SUN386 0x4441
70 #define DFMT_NEXT 0x1111
71 #define DFMT_MOTOROLA 0x1111
72 #define DFMT_ALPHA 0x4441
73 #define DFMT_VP 0x6611
74 #define DFMT_I860 0x4441
75 #define DFMT_CRAYMPP 0x1171
76 #define DFMT_IA64 0x4441
77 #define DFMT_LINUX64 0x4441
78 #define DFMT_POWERPC64 0x1111
79 
80 /* I/O library constants */
81 #define UNIXUNBUFIO 1
82 #define UNIXBUFIO 2
83 #define MACIO 3
84 
85 
86 /* Standard header files needed all the time */
87 #include <stdio.h>
88 #include <stdlib.h>
89 #include <limits.h>
90 #include <string.h>
91 
92 #include "H4api_adpt.h"
93 
94 
95 /*-------------------------------------------------------------------------
96  * Define options for each platform
97  *-------------------------------------------------------------------------*/
98 
99 /*
100  * Meaning of each defined macros (not completed yet)
101  *
102  * BIG_LONGS--Define when long is not "equal" to int32. True in cases
103  * where (int32 *) is not compatible with (long *). Should
104  * be renamed as LONGNEINT32.
105  */
106 
107 #if (defined(SUN) || defined(sun) || defined(__sun__) || defined(__SUNPRO_C)) & !defined(__i386)
108 #ifdef __STDC__
109 #define ANSISUN
110 #else /* __STDC__ */
111 #define KNRSUN
112 #endif /* __STDC__ */
113 #endif /* SUN || sun */
114 
115 #if defined(ANSISUN)
116 
117 #if !defined(SUN)
118 #define SUN
119 #endif
120 
121 #ifdef GOT_MACHINE
122 If you get an error on this line more than one machine type has been defined.
123 Please check your Makefile.
124 #endif
125 #define GOT_MACHINE
126 
127 #include <unistd.h> /* for some file I/O stuff */
128 #include <sys/time.h>
129 #include <sys/file.h> /* for unbuffered i/o stuff */
130 #include <sys/stat.h>
131 #if (defined __sun) && (defined __amd64 || defined __i386) /* SunOS on Intel; 32 and 64-bit modes */
132 #define DF_MT DFMT_SUN_INTEL
133 #else
134 #define DF_MT DFMT_SUN
135 #endif /* __sun */
136 typedef void VOID;
137 typedef void *VOIDP;
138 typedef char *_fcd;
139 typedef char char8;
140 typedef unsigned char uchar8;
141 typedef char int8;
142 typedef unsigned char uint8;
143 typedef short int int16;
144 typedef unsigned short int uint16;
145 #ifdef _LP64 /* 64-bit environment */
146 typedef int int32;
147 typedef unsigned int uint32;
148 #else /* 32-bit environment */
149 typedef long int int32;
150 typedef unsigned long int uint32;
151 #endif
152 typedef int intn;
153 typedef unsigned int uintn;
154 typedef int intf; /* size of INTEGERs in Fortran compiler */
155 typedef float float32;
156 typedef double float64;
157 #ifdef _LP64 /* 64-bit environment */
158 typedef long hdf_pint_t; /* an integer the same size as a pointer */
159 #else /* 32-bit environment */
160 typedef int hdf_pint_t; /* an integer the same size as a pointer */
161 #endif
162 #define FNAME_POST_UNDERSCORE
163 #define _fcdtocp(desc) (desc)
164 #define FILELIB UNIXBUFIO
165 
166 /* JPEG #define's - Look in the JPEG docs before changing - (Q) */
167 
168 /* Determine the memory manager we are going to use. Valid values are: */
169 /* MEM_DOS, MEM_ANSI, MEM_NAME, MEM_NOBS. See the JPEG docs for details on */
170 /* what each does */
171 #define JMEMSYS MEM_ANSI
172 #define HAVE_STDC
173 #define INCLUDES_ARE_ANSI
174 
175 #endif /* ANSISUN */
176 
177 #if defined(KNRSUN)
178 
179 #if !defined(SUN)
180 #define SUN
181 #endif
182 
183 #ifdef GOT_MACHINE
184 If you get an error on this line more than one machine type has been defined.
185 Please check your Makefile.
186 #endif
187 #define GOT_MACHINE
188 
189 # define BSD
190 #define DUMBCC /* because it is. for later use in macros */
191 #ifndef __GNUC__
192 #include <memory.h>
193 #endif /* __GNUC__ */
194 #include <unistd.h>
195 #include <sys/file.h> /* for unbuffered i/o stuff */
196 #include <sys/stat.h>
197 #define DF_MT DFMT_SUN
198 typedef void VOID;
199 typedef char *VOIDP;
200 typedef char *_fcd;
201 typedef char char8;
202 typedef unsigned char uchar8;
203 typedef char int8;
204 typedef unsigned char uint8;
205 typedef short int int16;
206 typedef unsigned short int uint16;
207 typedef long int int32;
208 typedef unsigned long int uint32;
209 typedef int intn;
210 typedef unsigned int uintn;
211 typedef int intf; /* size of INTEGERs in Fortran compiler */
212 typedef float float32;
213 typedef double float64;
214 typedef int hdf_pint_t; /* an integer the same size as a pointer */
215 #define FNAME_POST_UNDERSCORE
216 #define _fcdtocp(desc) (desc)
217 #define FILELIB UNIXBUFIO
218 
219 /* JPEG #define's - Look in the JPEG docs before changing - (Q) */
220 
221 /* Determine the memory manager we are going to use. Valid values are: */
222 /* MEM_DOS, MEM_ANSI, MEM_NAME, MEM_NOBS. See the JPEG docs for details on */
223 /* what each does */
224 #define JMEMSYS MEM_ANSI
225 
226 #ifdef __GNUC__
227 #define HAVE_STDC
228 #define INCLUDES_ARE_ANSI
229 #endif
230 
231 #endif /* SUN */
232 
233 
234 #if defined(IBM6000) || defined(_AIX)
235 
236 #ifndef IBM6000
237 #define IBM6000
238 #endif
239 
240 #ifdef GOT_MACHINE
241 If you get an error on this line more than one machine type has been defined.
242 Please check your Makefile.
243 #endif
244 #define GOT_MACHINE
245 
246 # define BSD
247 
248 #ifndef __GNUC__
249 #include <memory.h>
250 #endif /* __GNUC__ */
251 #include <sys/file.h> /* for unbuffered i/o stuff */
252 #include <sys/stat.h>
253 #define DF_MT DFMT_IBM6000
254 typedef void VOID;
255 typedef void *VOIDP;
256 typedef char *_fcd;
257 #ifndef _ALL_SOURCE
258 typedef char int8;
259 typedef short int int16;
260 typedef int int32;
261 #endif
262 typedef char char8;
263 typedef unsigned char uchar8;
264 typedef unsigned char uint8;
265 typedef unsigned short int uint16;
266 typedef unsigned int uint32;
267 typedef int intn;
268 typedef unsigned int uintn;
269 typedef float float32;
270 typedef double float64;
271 typedef int intf; /* size of INTEGERs in Fortran compiler */
272 #ifdef AIX5L64
273 typedef long hdf_pint_t; /* an integer the same size as a pointer */
274 #else /*AIX5L64 */
275 typedef int hdf_pint_t; /* an integer the same size as a pointer */
276 #endif /*AIX5L64 */
277 #define _fcdtocp(desc) (desc)
278 #define FILELIB UNIXBUFIO
279 
280 /* JPEG #define's - Look in the JPEG docs before changing - (Q) */
281 
282 /* Determine the memory manager we are going to use. Valid values are: */
283 /* MEM_DOS, MEM_ANSI, MEM_NAME, MEM_NOBS. See the JPEG docs for details on */
284 /* what each does */
285 #define JMEMSYS MEM_ANSI
286 
287 #define HAVE_STDC
288 #define INCLUDES_ARE_ANSI
289 
290 #endif /* IBM6000 */
291 
292 #if defined(HP9000) || (!defined(__convexc__) && (defined(hpux) || defined(__hpux)))
293 
294 #ifndef HP9000
295 #define HP9000
296 #endif
297 
298 #ifdef GOT_MACHINE
299 If you get an error on this line more than one machine type has been defined.
300 Please check your Makefile.
301 #endif
302 #define GOT_MACHINE
303 
304 #ifndef HAVE_UNISTD_H
305 #define HAVE_UNISTD_H /* unistd.h - close, fork,..etc */
306 #endif
307 
308 # define BSD
309 #ifndef __GNUC__
310 #include <memory.h>
311 #endif /* __GNUC__ */
312 #include <sys/file.h> /* for unbuffered i/o stuff */
313 #include <sys/stat.h>
314 #define DF_MT DFMT_HP9000
315 typedef void VOID;
316 typedef void *VOIDP;
317 typedef char *_fcd;
318 typedef char char8;
319 typedef unsigned char uchar8;
320 typedef char int8;
321 typedef unsigned char uint8;
322 typedef short int int16;
323 typedef unsigned short int uint16;
324 #ifdef _LP64 /* 64-bit environment */
325 typedef int int32;
326 typedef unsigned int uint32;
327 #else /* 32-bit environment */
328 typedef long int int32;
329 typedef unsigned long int uint32;
330 #endif
331 typedef int intn;
332 typedef unsigned int uintn;
333 typedef float float32;
334 typedef double float64;
335 typedef int intf; /* size of INTEGERs in Fortran compiler */
336 #ifdef _LP64 /* 64-bit environment */
337 typedef long hdf_pint_t; /* an integer the same size as a pointer */
338 #else /* 32-bit environment */
339 typedef int hdf_pint_t; /* an integer the same size as a pointer */
340 #endif
341 #define _fcdtocp(desc) (desc)
342 #define FILELIB UNIXBUFIO
343 
344 /* JPEG #define's - Look in the JPEG docs before changing - (Q) */
345 
346 /* Determine the memory manager we are going to use. Valid values are: */
347 /* MEM_DOS, MEM_ANSI, MEM_NAME, MEM_NOBS. See the JPEG docs for details on */
348 /* what each does */
349 #define JMEMSYS MEM_ANSI
350 
351 #endif /* HP9000 */
352 
353 
354 #if defined(IRIX) || defined(IRIS4) || defined(sgi) || defined(__sgi__) || defined(__sgi)
355 
356 #ifndef IRIX
357 #define IRIX
358 #endif
359 
360 #if (_MIPS_SZLONG == 64)
361 /* IRIX 64 bits objects. It is nearly the same as the conventional
362  * 32 bits objects. Let them share IRIX definitions for now.
363  */
364 #define IRIX64
365 #endif
366 
367 
368 #ifdef GOT_MACHINE
369 If you get an error on this line more than one machine type has been defined.
370 Please check your Makefile.
371 #endif
372 #define GOT_MACHINE 1
373 
374 /*
375  * BSD was originally defined with no value. But some newer SGI system
376  * header files (e.g., resolv.h) assume it has a value and evaluate it
377  * in expressions, thus causing compiling errors. This has been reported
378  * to SGI as bug #781568. SGI could not provide a list of the semantics
379  * of BSD values and suggested a work around of setting BSD to 1.
380  */
381 # define BSD 1
382 #ifndef __GNUC__
383 #include <memory.h>
384 #endif /* __GNUC__ */
385 #include <sys/file.h> /* for unbuffered i/o stuff */
386 #include <sys/stat.h>
387 #define DF_MT DFMT_IRIX
388 typedef void VOID;
389 typedef void *VOIDP;
390 typedef char *_fcd;
391 typedef signed char char8;
392 typedef unsigned char uchar8;
393 typedef signed char int8;
394 typedef unsigned char uint8;
395 typedef short int int16;
396 typedef unsigned short int uint16;
397 typedef int int32;
398 typedef unsigned int uint32;
399 typedef int intn;
400 typedef unsigned int uintn;
401 typedef float float32;
402 typedef double float64;
403 typedef int intf; /* size of INTEGERs in Fortran compiler */
404 typedef long hdf_pint_t; /* an integer the same size as a pointer */
405 #define FNAME_POST_UNDERSCORE
406 #define _fcdtocp(desc) (desc)
407 #define FILELIB UNIXBUFIO
408 /*
409 #ifdef IRIX64
410 #define BIG_LONGS
411 #endif
412 */
413 
414 
415 /* JPEG #define's - Look in the JPEG docs before changing - (Q) */
416 
417 /* Determine the memory manager we are going to use. Valid values are: */
418 /* MEM_DOS, MEM_ANSI, MEM_NAME, MEM_NOBS. See the JPEG docs for details on */
419 /* what each does */
420 #define JMEMSYS MEM_ANSI
421 
422 #define HAVE_STDC
423 #define INCLUDES_ARE_ANSI
424 
425 #endif /* IRIX */
426 
427 #if (defined(UNICOS) || defined(_UNICOS)) && !defined(_CRAYMPP)
428 
429 #ifndef UNICOS
430 #define UNICOS
431 #endif
432 
433 #ifdef GOT_MACHINE
434 If you get an error on this line more than one machine type has been defined.
435 Please check your Makefile.
436 #endif
437 #define GOT_MACHINE 1
438 
439 #include <memory.h>
440 #include <fortran.h>
441 #ifndef O_RDONLY
442 #include <fcntl.h> /* for unbuffered i/o stuff */
443 #define L_INCR 1
444 #include <sys/stat.h>
445 #endif /*O_RDONLY*/
446 
447 #ifdef _CRAYIEEE
448 #define DF_MT DFMT_UNICOSIEEE
449 #else
450 #define DF_MT DFMT_UNICOS
451 #endif
452 typedef void VOID;
453 typedef void *VOIDP;
454 #ifdef OLD_WAY /* May need to be included on other machines than the C-90 */
455 typedef char *_fcd;
456 #endif /* OLD_WAY */
457 typedef signed char char8;
458 typedef unsigned char uchar8;
459 typedef signed char int8;
460 typedef unsigned char uint8;
461 typedef int int16;
462 typedef unsigned int uint16;
463 typedef int int32;
464 typedef unsigned int uint32;
465 typedef int intn;
466 typedef unsigned int uintn;
467 typedef float float32;
468 typedef double float64;
469 typedef int intf; /* size of INTEGERs in Fortran compiler */
470 typedef int hdf_pint_t; /* an integer the same size as a pointer */
471 
472 #define DF_CAPFNAMES /* fortran names are in all caps */
473 #define FILELIB UNIXBUFIO
474 
475 /* JPEG #define's - Look in the JPEG docs before changing - (Q) */
476 
477 /* Determine the memory manager we are going to use. Valid values are: */
478 /* MEM_DOS, MEM_ANSI, MEM_NAME, MEM_NOBS. See the JPEG docs for details on */
479 /* what each does */
480 #define JMEMSYS MEM_ANSI
481 #define RIGHT_SHIFT_IS_UNSIGNED
482 #define CHAR_IS_UNSIGNED
483 
484 #endif /* UNICOS */
485 
486 #if defined(_CRAYMPP)
487 
488 #ifndef CRAYMPP
489 #define CRAYMPP
490 #endif
491 
492 #ifdef GOT_MACHINE
493 If you get an error on this line more than one machine type has been defined.
494 Please check your Makefile.
495 #endif
496 #define GOT_MACHINE 1
497 
498 #include <string.h>
499 #include <limits.h>
500 #include <memory.h>
501 #include <fortran.h>
502 #ifndef O_RDONLY
503 #include <fcntl.h> /* for unbuffered i/o stuff */
504 #define L_INCR 1
505 #include <sys/stat.h>
506 #endif /*O_RDONLY*/
507 
508 #define DF_MT DFMT_CRAYMPP
509 typedef void VOID;
510 typedef void *VOIDP;
511 #ifdef OLD_WAY /* May need to be included on other machines than the C-90 */
512 typedef char *_fcd;
513 #endif /* OLD_WAY */
514 typedef signed char char8;
515 typedef unsigned char uchar8;
516 typedef signed char int8;
517 typedef unsigned char uint8;
518 typedef short int16;
519 typedef unsigned short uint16;
520 typedef short int32;
521 typedef unsigned short uint32;
522 typedef int intn;
523 typedef unsigned int uintn;
524 typedef float float32;
525 typedef double float64;
526 typedef int intf; /* size of INTEGERs in Fortran compiler */
527 typedef int hdf_pint_t; /* an integer the same size as a pointer */
528 
529 #define _HUGE /* This should only be defined to a value on the PC */
530 #define DF_CAPFNAMES /* fortran names are in all caps */
531 #define FILELIB UNIXBUFIO
532 
533 /* JPEG #define's - Look in the JPEG docs before changing - (Q) */
534 
535 /* Determine the memory manager we are going to use. Valid values are: */
536 /* MEM_DOS, MEM_ANSI, MEM_NAME, MEM_NOBS. See the JPEG docs for details on */
537 /* what each does */
538 #define JMEMSYS MEM_ANSI
539 #define RIGHT_SHIFT_IS_UNSIGNED
540 #define CHAR_IS_UNSIGNED
541 
542 #endif /* CRAYMPP */
543 
544 /* CRAY XT3
545  * Note from RedStorm helpdesk,
546  * When I compile a C code with the '-v' option, it indicates that the compile
547  * is done with the macros __QK_USER__ and __LIBCATAMOUNT__ defined. In
548  * addition, there are other macros like __x86_64__ defined as well, to
549  * indicate processor type. __QK_USER__ might be a good check for Catamount,
550  * and __x86_64__ might be good for Opteron node. You might try something
551  * like the following in a header file:
552  */
553 #if ((defined(__QK_USER__)) && (defined(__x86_64__)))
554 #define __CRAY_XT3__
555 #endif
556 
557 #if defined(VMS) || defined(vms)
558 
559 #ifdef GOT_MACHINE
560 If you get an error on this line more than one machine type has been defined.
561 Please check your Makefile.
562 #endif
563 #define GOT_MACHINE 1
564 #include <file.h> /* for unbuffered i/o stuff */
565 #include <sys/stat.h>
566 #define DF_MT DFMT_VAX
567 typedef void VOID;
568 typedef void *VOIDP;
569 typedef char *_fcd;
570 typedef char char8;
571 typedef unsigned char uchar8;
572 typedef char int8;
573 typedef unsigned char uint8;
574 typedef short int int16;
575 typedef unsigned short int uint16;
576 #ifdef __alpha
577 typedef int int32;
578 typedef unsigned int uint32;
579 typedef long hdf_pint_t; /* an integer the same size as a pointer */
580 #else
581 typedef long int int32;
582 typedef unsigned long int uint32;
583 typedef int hdf_pint_t; /* an integer the same size as a pointer */
584 #endif
585 typedef int intn;
586 typedef unsigned int uintn;
587 typedef float float32;
588 typedef double float64;
589 typedef int intf; /* size of INTEGERs in Fortran compiler */
590 #define _fcdtocp(desc) ((char *) *((char **) &desc[4]))
591 
592 /*
593  Redef a couple of C routine names to avoid conflicts
594  since the VMS link command is case-insensitive
595 */
596 #define FILELIB UNIXBUFIO
597 #define DF_CAPFNAMES /* fortran names are in all caps */
598 #include "dfivms.h"
599 
600 
601 /* JPEG #define's - Look in the JPEG docs before changing - (Q) */
602 
603 /* Determine the memory manager we are going to use. Valid values are: */
604 /* MEM_DOS, MEM_ANSI, MEM_NAME, MEM_NOBS. See the JPEG docs for details on */
605 /* what each does */
606 #define JMEMSYS MEM_ANSI
607 
608 #endif /* VMS */
609 
610 #if defined(CONVEX) || defined(CONVEXNATIVE) || defined(__convexc__)
611 
612 #ifndef CONVEX
613 #define CONVEX
614 #endif
615 
616 #ifdef GOT_MACHINE
617 If you get an error on this line more than one machine type has been defined.
618 Please check your Makefile.
619 #endif
620 #define GOT_MACHINE
621 
622 #include <sys/types.h>
623 #include <sys/stat.h>
624 /* For Convex machines with native format floats */
625 #ifdef CONVEXNATIVE
626 #define DF_MT DFMT_CONVEXNATIVE
627 #else
628 #define DF_MT DFMT_CONVEX
629 #endif
630 typedef void VOID;
631 typedef void *VOIDP;
632 typedef char *_fcd;
633 typedef char char8;
634 typedef unsigned char uchar8;
635 typedef char int8;
636 typedef unsigned char uint8;
637 typedef short int int16;
638 typedef unsigned short int uint16;
639 typedef long int int32;
640 typedef unsigned long int uint32;
641 typedef int intn;
642 typedef unsigned int uintn;
643 typedef float float32;
644 typedef double float64;
645 typedef int intf; /* size of INTEGERs in Fortran compiler */
646 typedef int hdf_pint_t; /* an integer the same size as a pointer */
647 #define _fcdtocp(desc) (desc)
648 #define FILELIB UNIXBUFIO
649 
650 /* JPEG #define's - Look in the JPEG docs before changing - (Q) */
651 
652 /* Determine the memory manager we are going to use. Valid values are: */
653 /* MEM_DOS, MEM_ANSI, MEM_NAME, MEM_NOBS. See the JPEG docs for details on */
654 /* what each does */
655 #define JMEMSYS MEM_ANSI
656 #define RIGHT_SHIFT_IS_UNSIGNED
657 #define INCLUDES_ARE_ANSI
658 #define HAVE_STDC
659 
660 #endif /* CONVEX */
661 
662 
663 #if defined (__APPLE__)
664 
665 #ifndef __APPLE__
666 #define __APPLE__
667 #endif
668 #ifdef __LITTLE_ENDIAN__
669 #define DF_MT DFMT_APPLE_INTEL
670 #else
671 #define DF_MT DFMT_APPLE
672 #endif
673 #ifdef GOT_MACHINE
674 If you get an error on this line more than one machine type has been defined.
675 Please check your Makefile.
676 #endif
677 #define GOT_MACHINE 1
678 
679 #ifndef __GNUC__
680 #define DUMBCC /* because it is. for later use in macros */
681 #endif /* __GNUC__ */
682 
683 #include <sys/types.h>
684 #include <sys/file.h> /* for unbuffered i/o stuff */
685 #include <sys/stat.h>
686 #ifdef __i386
687 #ifndef INTEL86
688 #define INTEL86 /* we need this Intel define or bad things happen later */
689 #endif /* INTEL86 */
690 #endif /* __i386 */
691 
692 typedef void VOID;
693 typedef void *VOIDP;
694 typedef char *_fcd;
695 typedef char char8;
696 typedef unsigned char uchar8;
697 typedef char int8;
698 typedef unsigned char uint8;
699 typedef short int16;
700 typedef unsigned short uint16;
701 typedef int int32;
702 typedef unsigned int uint32;
703 typedef int intn;
704 typedef unsigned int uintn;
705 typedef float float32;
706 typedef double float64;
707 typedef int intf; /* size of INTEGERs in Fortran compiler */
708 typedef long hdf_pint_t; /* an integer the same size as a pointer */
709 #define _fcdtocp(desc) (desc)
710 #define FILELIB UNIXBUFIO
711 
712 /* JPEG #define's - Look in the JPEG docs before changing - (Q) */
713 
714 /* Determine the memory manager we are going to use. Valid values are: */
715 /* MEM_DOS, MEM_ANSI, MEM_NAME, MEM_NOBS. See the JPEG docs for details on */
716 /* what each does */
717 #define JMEMSYS MEM_ANSI
718 
719 #endif /* __APPLE__ */
720 
721 #if defined(MIPSEL) || ((defined(mips) || defined(__mips)) && (defined(ultrix) || defined(__ultrix)))
722 
723 #ifndef MIPSEL
724 #define MIPSEL
725 #endif
726 
727 #ifdef GOT_MACHINE
728 If you get an error on this line more than one machine type has been defined.
729 Please check your Makefile.
730 #endif
731 #define GOT_MACHINE 1
732 
733 #ifndef __GNUC__
734 #define DUMBCC /* because it is. for later use in macros */
735 #endif /* __GNUC__ */
736 
737 #include <sys/types.h>
738 #include <sys/file.h> /* for unbuffered i/o stuff */
739 #include <sys/stat.h>
740 #define DF_MT DFMT_MIPSEL
741 typedef void VOID;
742 typedef void *VOIDP;
743 typedef char *_fcd;
744 typedef char char8;
745 typedef unsigned char uchar8;
746 typedef char int8;
747 typedef unsigned char uint8;
748 typedef short int16;
749 typedef unsigned short uint16;
750 typedef int int32;
751 typedef unsigned int uint32;
752 typedef int intn;
753 typedef unsigned int uintn;
754 typedef float float32;
755 typedef double float64;
756 typedef int intf; /* size of INTEGERs in Fortran compiler */
757 typedef int hdf_pint_t; /* an integer the same size as a pointer */
758 #define _fcdtocp(desc) (desc)
759 #define FNAME_POST_UNDERSCORE
760 #define FILELIB UNIXBUFIO
761 
762 /* JPEG #define's - Look in the JPEG docs before changing - (Q) */
763 
764 /* Determine the memory manager we are going to use. Valid values are: */
765 /* MEM_DOS, MEM_ANSI, MEM_NAME, MEM_NOBS. See the JPEG docs for details on */
766 /* what each does */
767 #define JMEMSYS MEM_ANSI
768 
769 #endif /* MIPSEL */
770 
771 #if defined(MAC) || defined(macintosh) || defined (SYMANTEC_C)
772 
773 #ifdef GOT_MACHINE
774 If you get an error on this line more than one machine type has been defined.
775 Please check your Makefile.
776 #endif
777 #define GOT_MACHINE 1
778 
779 #include <memory.h> /* malloc stuff for MPW */
780 #include <fcntl.h> /* unbuffered I/O stuff for MPW */
781 #ifdef __MWERKS__ /* Metrowerks */
782 #include <sioux.h>
783 #include <console.h>
784 #endif
785 #ifdef SYMANTEC_C /* for SYMANTEC C */
786 #include <unix.h>
787 #define isascii(c) (isprint(c) || iscntrl(c))
788 #else /* MPW, possibly others */
789 #include <Files.h> /* for unbuffered I/O stuff */
790 #endif /* SYMANTEC_C*/
791 #ifndef ABSOFT
792 #define DF_CAPFNAMES /* fortran names are in all caps */
793 #endif /* ABSOFT */
794 #define DF_DYNAMIC /* use dynamic allocation */
795 #define DF_MT DFMT_MAC
796 
797 typedef void VOID;
798 typedef void *VOIDP;
799 typedef char *_fcd;
800 typedef char char8;
801 typedef unsigned char uchar8;
802 typedef char int8;
803 typedef unsigned char uint8;
804 typedef short int int16;
805 typedef unsigned short int uint16;
806 typedef long int int32;
807 typedef unsigned long int uint32;
808 typedef int intn;
809 typedef unsigned int uintn;
810 typedef float float32;
811 typedef double float64;
812 typedef int intf; /* size of INTEGERs in Fortran compiler */
813 typedef int hdf_pint_t; /* an integer the same size as a pointer */
814 #define _fcdtocp(desc) (desc)
815 void exit(int status);
816 
817 #define FILELIB MACIO
818 
819 /* JPEG #define's - Look in the JPEG docs before changing - (Q) */
820 
821 /* Determine the memory manager we are going to use. Valid values are: */
822 /* MEM_DOS, MEM_ANSI, MEM_NAME, MEM_NOBS. See the JPEG docs for details on */
823 /* what each does */
824 #define JMEMSYS MEM_ANSI
825 
826 #endif /*MAC*/
827 
828 /* Metrowerks Mac compiler defines some PC stuff so need to exclude this on the Mac */
829 #if !(defined(macintosh) || defined(MAC) || defined (__APPLE__))
830 
831 #if defined _M_ALPHA || defined _M_X64 || defined _M_IA64 || defined _M_IX86 || defined INTEL86 || defined M_I86 || defined M_I386 || defined DOS386 || defined __i386 || defined UNIX386 || defined i386
832 #ifndef INTEL86
833 #define INTEL86
834 #endif /* INTEL86 */
835 
836 #if !defined UNIX386 && (defined unix || defined __unix)
837 #define UNIX386
838 #endif /* UNIX386 */
839 
840 #if !defined DOS386 && defined M_I386
841 #define DOS386
842 #endif /* M_I386 && !DOS386 */
843 
844 #if defined _WINDOWS || defined _WIN32
845 #define WIN386
846 #endif /* _WINDOWS | _WIN32 */
847 
848 #if defined WIN386 || defined DOS386 || defined UNIX386
849 #define INTEL386
850 #endif /* WIN386 | DOS386 | UNIX386 */
851 
852 #ifdef GOT_MACHINE
853 If you get an error on this line more than one machine type has been defined.
854 Please check your Makefile.
855 #endif
856 #define GOT_MACHINE 1
857 
858 #if defined _WINDOWS || defined _WIN32
859 #pragma comment( lib, "oldnames" )
860 #endif
861 
862 #include <fcntl.h>
863 #ifdef UNIX386
864 #include <sys/types.h> /* for unbuffered file I/O */
865 #include <sys/stat.h>
866 #include <unistd.h>
867 #else /* !UNIX386 */
868 #include <sys\types.h> /* for unbuffered file I/O */
869 #include <sys\stat.h>
870 #include <io.h>
871 #include <conio.h> /* for debugging getch() calls */
872 #include <malloc.h>
873 #endif /* UNIX386 */
874 #include <ctype.h> /* for character macros */
875 #ifdef __WATCOMC__
876 #include <stddef.h> /* for the 'fortran' pragma */
877 #endif
878 
879 
880 #if defined WIN386
881 #ifndef GMEM_MOVEABLE /* check if windows header is already included */
882 #include <windows.h> /* include the windows headers */
883 #include <winnt.h>
884 #define HAVE_BOOLEAN
885 #endif /* GMEM_MOVEABLE */
886 #endif /* WIN386 */
887 
888 #define DF_MT DFMT_PC
889 
890 #ifndef VOID /* The stupid windows.h header file uses a #define instead of a typedef */
891 typedef void VOID;
892 #endif /* end VOID */
893 typedef void * VOIDP;
894 typedef char * _fcd;
895 typedef char char8;
896 typedef unsigned char uchar8;
897 typedef char int8;
898 typedef unsigned char uint8;
899 typedef short int int16;
900 typedef unsigned short int uint16;
901 typedef long int int32;
902 typedef unsigned long int uint32;
903 typedef int intn;
904 typedef unsigned int uintn;
905 typedef float float32;
906 typedef double float64;
907 typedef long intf; /* size of INTEGERs in Fortran compiler */
908 #ifdef _WIN64
909 typedef long long hdf_pint_t; /* 8-byte pointer */
910 #else
911 typedef int hdf_pint_t; /* 4-byte pointer */
912 #endif /* _WIN64 */
913 
914 #if defined _M_ALPHA
915 #define FNAME_PRE_UNDERSCORE
916 #endif
917 
918 #if defined UNIX386
919 #ifdef H4_ABSOFT
920 #define FNAME(x) x
921 #define DF_CAPFNAMES
922 #else
923 #define FNAME_POST_UNDERSCORE
924 #endif
925 #elif defined INTEL386
926 #define DF_CAPFNAMES
927 #endif
928 #define _fcdtocp(desc) (desc)
929 
930 #define FILELIB UNIXBUFIO
931 
932 /* JPEG #define's - Look in the JPEG docs before changing - (Q) */
933 
934 /* Determine the memory manager we are going to use. Valid values are: */
935 /* MEM_DOS, MEM_ANSI, MEM_NAME, MEM_NOBS. See the JPEG docs for details on */
936 /* what each does */
937 #define JMEMSYS MEM_ANSI
938 #define HAVE_STDC
939 #define INCLUDES_ARE_ANSI
940 
941 #endif /* INTEL86 */
942 #endif /* !(defined(macintosh) || defined(MAC)) */
943 
944 /*-----------------------------------------------------*/
945 #if defined(NEXT) || defined(NeXT)
946 
947 #ifndef NEXT
948 #define NEXT
949 #endif
950 
951 #ifdef GOT_MACHINE
952 If you get an error on this line more than one machine type has been defined.
953 Please check your Makefile.
954 #endif
955 #define GOT_MACHINE
956 
957 #define isascii(c) (isprint(c) || iscntrl(c))
958 #ifndef __GNUC__
959 #include <memory.h>
960 #endif /* __GNUC__ */
961 #include <sys/file.h> /* for unbuffered i/o stuff */
962 #include <sys/stat.h>
963 #define DF_MT DFMT_NEXT
964 typedef void VOID;
965 typedef void *VOIDP;
966 typedef char *_fcd;
967 typedef char char8;
968 typedef unsigned char uchar8;
969 typedef char int8;
970 typedef unsigned char uint8;
971 typedef short int int16;
972 typedef unsigned short int uint16;
973 typedef long int int32;
974 typedef unsigned long int uint32;
975 typedef int intn;
976 typedef unsigned int uintn;
977 typedef int intf; /* size of INTEGERs in Fortran compiler */
978 typedef float float32;
979 typedef double float64;
980 typedef int hdf_pint_t; /* an integer the same size as a pointer */
981 #define FNAME_POST_UNDERSCORE
982 #define _fcdtocp(desc) (desc)
983 #define FILELIB UNIXBUFIO
984 
985 /* JPEG #define's - Look in the JPEG docs before changing - (Q) */
986 
987 /* Determine the memory manager we are going to use. Valid values are: */
988 /* MEM_DOS, MEM_ANSI, MEM_NAME, MEM_NOBS. See the JPEG docs for details on */
989 /* what each does */
990 #define JMEMSYS MEM_ANSI
991 
992 #define HAVE_STDC
993 #define INCLUDES_ARE_ANSI
994 
995 #endif /* NEXT */
996 
997 /*-----------------------------------------------------*/
998 #if defined(MOTOROLA) || defined(m88k)
999 
1000 #ifdef GOT_MACHINE
1001 If you get an error on this line more than one machine type has been defined.
1002 Please check your Makefile.
1003 #endif
1004 #define GOT_MACHINE
1005 
1006 #ifndef __GNUC__
1007 #include <memory.h>
1008 #endif /* __GNUC__ */
1009 #include <unistd.h>
1010 #include <sys/file.h> /* for unbuffered i/o stuff */
1011 #include <sys/stat.h>
1012 #ifndef O_RDONLY
1013 #include <fcntl.h> /* for unbuffered i/o stuff */
1014 #endif /*O_RDONLY*/
1015 #define DF_MT DFMT_MOTOROLA
1016 typedef void VOID;
1017 typedef void *VOIDP;
1018 typedef char *_fcd;
1019 typedef char char8;
1020 typedef unsigned char uchar8;
1021 typedef char int8;
1022 typedef unsigned char uint8;
1023 typedef short int int16;
1024 typedef unsigned short int uint16;
1025 typedef long int int32;
1026 typedef unsigned long int uint32;
1027 typedef int intn;
1028 typedef unsigned int uintn;
1029 typedef int intf; /* size of INTEGERs in Fortran compiler */
1030 typedef float float32;
1031 typedef double float64;
1032 typedef int hdf_pint_t; /* an integer the same size as a pointer */
1033 #define FNAME_POST_UNDERSCORE
1034 #define _fcdtocp(desc) (desc)
1035 #define FILELIB UNIXBUFIO
1036 
1037 /* JPEG #define's - Look in the JPEG docs before changing - (Q) */
1038 
1039 /* Determine the memory manager we are going to use. Valid values are: */
1040 /* MEM_DOS, MEM_ANSI, MEM_NAME, MEM_NOBS. See the JPEG docs for details on */
1041 /* what each does */
1042 #define JMEMSYS MEM_ANSI
1043 
1044 #endif /* MOTOROLA */
1045 
1046 /*-----------------------------------------------------*/
1047 #if defined DEC_ALPHA || (defined __alpha && defined __unix__)
1048 
1049 #ifndef DEC_ALPHA
1050 #define DEC_ALPHA
1051 #endif
1052 
1053 #ifdef GOT_MACHINE
1054 If you get an error on this line more than one machine type has been defined.
1055 Please check your Makefile.
1056 #endif
1057 #define GOT_MACHINE
1058 
1059 #include <sys/file.h> /* for unbuffered i/o stuff */
1060 #include <sys/stat.h>
1061 #define DF_MT DFMT_ALPHA
1062 typedef void VOID;
1063 typedef void *VOIDP;
1064 typedef char *_fcd;
1065 typedef char char8;
1066 typedef unsigned char uchar8;
1067 typedef char int8;
1068 typedef unsigned char uint8;
1069 typedef short int int16;
1070 typedef unsigned short int uint16;
1071 #ifndef __rpc_types_h
1072 typedef int int32;
1073 typedef unsigned int uint32;
1074 #endif /* __rpc_types_h */
1075 typedef int intn;
1076 typedef unsigned int uintn;
1077 typedef int intf; /* size of INTEGERs in Fortran compiler */
1078 typedef float float32;
1079 typedef double float64;
1080 typedef long hdf_pint_t; /* an integer the same size as a pointer */
1081 #define FNAME_POST_UNDERSCORE
1082 #define _fcdtocp(desc) (desc)
1083 #define FILELIB UNIXBUFIO
1084 
1085 /* JPEG #define's - Look in the JPEG docs before changing - (Q) */
1086 
1087 /* Determine the memory manager we are going to use. Valid values are: */
1088 /* MEM_DOS, MEM_ANSI, MEM_NAME, MEM_NOBS. See the JPEG docs for details on */
1089 /* what each does */
1090 #define JMEMSYS MEM_ANSI
1091 
1092 #ifdef __GNUC__
1093 #define HAVE_STDC
1094 #define INCLUDES_ARE_ANSI
1095 #endif
1096 
1097 #endif /* DEC_ALPHA */
1098 
1099 /*-----------------------------------------------------*/
1100 #if defined VP | defined __uxpm__
1101 
1102 #ifndef VP
1103 #define VP
1104 #endif
1105 
1106 #ifdef GOT_MACHINE
1107 If you get an error on this line more than one machine type has been defined.
1108 Please check your Makefile.
1109 #endif
1110 #define GOT_MACHINE 1
1111 
1112 #include <memory.h>
1113 #include <sys/types.h>
1114 #include <sys/stat.h>
1115 #define DF_MT DFMT_VP
1116 typedef void VOID;
1117 typedef void *VOIDP;
1118 typedef char *_fcd;
1119 typedef char char8;
1120 typedef unsigned char uchar8;
1121 typedef char int8;
1122 typedef unsigned char uint8;
1123 typedef short int int16;
1124 typedef unsigned short int uint16;
1125 typedef long int int32;
1126 typedef unsigned long int uint32;
1127 typedef int intn;
1128 typedef unsigned int uintn;
1129 typedef int intf; /* size of INTEGERs in Fortran compiler */
1130 typedef float float32;
1131 typedef double float64;
1132 typedef int hdf_pint_t; /* an integer the same size as a pointer */
1133 #define FNAME_POST_UNDERSCORE
1134 #define _fcdtocp(desc) (desc)
1135 #define FILELIB UNIXBUFIO
1136 
1137 /* JPEG #define's - Look in the JPEG docs before changing - (Q) */
1138 
1139 /* Determine the memory manager we are going to use. Valid values are: */
1140 /* MEM_DOS, MEM_ANSI, MEM_NAME, MEM_NOBS. See the JPEG docs for details on */
1141 /* what each does */
1142 #define JMEMSYS MEM_ANSI
1143 
1144 #endif /* VP */
1145 
1146 /*-----------------------------------------------------*/
1147 #if defined I860 | defined i860
1148 
1149 #ifndef I860
1150 #define I860
1151 #endif
1152 
1153 #ifdef GOT_MACHINE
1154 If you get an error on this line more than one machine type has been defined.
1155 Please check your Makefile.
1156 #endif
1157 #define GOT_MACHINE 1
1158 
1159 #include <sys/types.h>
1160 #include <sys/file.h> /* for unbuffered i/o stuff */
1161 #include <sys/stat.h>
1162 #include <unistd.h> /* mis-using def. for SEEK_SET, but oh well */
1163 #define DF_MT DFMT_I860
1164 typedef void VOID;
1165 typedef void *VOIDP;
1166 typedef char *_fcd;
1167 typedef char char8;
1168 typedef unsigned char uchar8;
1169 typedef char int8;
1170 typedef unsigned char uint8;
1171 typedef short int16;
1172 typedef unsigned short uint16;
1173 typedef int int32;
1174 typedef unsigned int uint32;
1175 typedef int intn;
1176 typedef unsigned int uintn;
1177 typedef float float32;
1178 typedef double float64;
1179 typedef int intf; /* size of INTEGERs in Fortran compiler */
1180 typedef int hdf_pint_t; /* an integer the same size as a pointer */
1181 #define _fcdtocp(desc) (desc)
1182 #define FNAME_POST_UNDERSCORE
1183 #define FILELIB UNIXBUFIO
1184 
1185 /* JPEG #define's - Look in the JPEG docs before changing - (Q) */
1186 
1187 /* Determine the memory manager we are going to use. Valid values are: */
1188 /* MEM_DOS, MEM_ANSI, MEM_NAME, MEM_NOBS. See the JPEG docs for details on */
1189 /* what each does */
1190 #define JMEMSYS MEM_ANSI
1191 
1192 #endif /* I860 */
1193 
1194 
1195 /*-----------------------------------------------------*/
1196 /* Power PC 5 64 */
1197 #if defined __powerpc64__
1198 
1199 #ifdef GOT_MACHINE
1200 If you get an error on this line more than one machine type has been defined.
1201 Please check your Makefile.
1202 #endif
1203 #define GOT_MACHINE
1204 
1205 #include <sys/file.h> /* for unbuffered i/o stuff */
1206 #include <sys/stat.h>
1207 #define DF_MT DFMT_POWERPC64
1208 typedef void VOID;
1209 typedef void *VOIDP;
1210 typedef char *_fcd;
1211 typedef char char8;
1212 typedef unsigned char uchar8;
1213 typedef char int8;
1214 typedef unsigned char uint8;
1215 typedef short int int16;
1216 typedef unsigned short int uint16;
1217 typedef int int32;
1218 typedef unsigned int uint32;
1219 typedef int intn;
1220 typedef unsigned int uintn;
1221 typedef int intf; /* size of INTEGERs in Fortran compiler */
1222 typedef float float32;
1223 typedef double float64;
1224 typedef long hdf_pint_t; /* an integer the same size as a pointer */
1225 #if defined __GNUC__
1226 #define FNAME_POST_UNDERSCORE
1227 #endif
1228 #define _fcdtocp(desc) (desc)
1229 #define FILELIB UNIXBUFIO
1230 
1231 /* JPEG #define's - Look in the JPEG docs before changing - (Q) */
1232 
1233 /* Determine the memory manager we are going to use. Valid values are: */
1234 /* MEM_DOS, MEM_ANSI, MEM_NAME, MEM_NOBS. See the JPEG docs for details on */
1235 /* what each does */
1236 #define JMEMSYS MEM_ANSI
1237 
1238 #ifdef __GNUC__
1239 #define HAVE_STDC
1240 #define INCLUDES_ARE_ANSI
1241 #endif
1242 
1243 /*-----------------------------------------------------*/
1244 #endif /*power PC 5 64 */
1245 /* Linux 64 */
1246 #if defined(__linux__) && defined __x86_64__ && !(defined SUN) /* i.e. 64-bit Linux but not SunOS on Intel */
1247 
1248 #ifdef GOT_MACHINE
1249 If you get an error on this line more than one machine type has been defined.
1250 Please check your Makefile.
1251 #endif
1252 #define GOT_MACHINE
1253 
1254 #include <sys/file.h> /* for unbuffered i/o stuff */
1255 #include <sys/stat.h>
1256 #define DF_MT DFMT_LINUX64
1257 typedef void VOID;
1258 typedef void *VOIDP;
1259 typedef char *_fcd;
1260 typedef char char8;
1261 typedef unsigned char uchar8;
1262 typedef char int8;
1263 typedef unsigned char uint8;
1264 typedef short int int16;
1265 typedef unsigned short int uint16;
1266 typedef int int32;
1267 typedef unsigned int uint32;
1268 typedef int intn;
1269 typedef unsigned int uintn;
1270 typedef int intf; /* size of INTEGERs in Fortran compiler */
1271 typedef float float32;
1272 typedef double float64;
1273 typedef long hdf_pint_t; /* an integer the same size as a pointer */
1274 #define FNAME_POST_UNDERSCORE
1275 #define _fcdtocp(desc) (desc)
1276 #define FILELIB UNIXBUFIO
1277 
1278 /* JPEG #define's - Look in the JPEG docs before changing - (Q) */
1279 
1280 /* Determine the memory manager we are going to use. Valid values are: */
1281 /* MEM_DOS, MEM_ANSI, MEM_NAME, MEM_NOBS. See the JPEG docs for details on */
1282 /* what each does */
1283 #define JMEMSYS MEM_ANSI
1284 
1285 #ifdef __GNUC__
1286 #define HAVE_STDC
1287 #define INCLUDES_ARE_ANSI
1288 #endif
1289 
1290 #endif /*Linux 64 */
1291 
1292 /*-----------------------------------------------------*/
1293 /* 64-bit Free BSD */
1294 
1295 #if defined __FreeBSD__ && defined __x86_64__
1296 
1297 #ifdef GOT_MACHINE
1298 If you get an error on this line more than one machine type has been defined.
1299 Please check your Makefile.
1300 #endif
1301 #define GOT_MACHINE
1302 
1303 #include <sys/file.h> /* for unbuffered i/o stuff */
1304 #include <sys/stat.h>
1305 #define DF_MT DFMT_LINUX64
1306 typedef void VOID;
1307 typedef void *VOIDP;
1308 typedef char *_fcd;
1309 typedef char char8;
1310 typedef unsigned char uchar8;
1311 typedef char int8;
1312 typedef unsigned char uint8;
1313 typedef short int int16;
1314 typedef unsigned short int uint16;
1315 typedef int int32;
1316 typedef unsigned int uint32;
1317 typedef int intn;
1318 typedef unsigned int uintn;
1319 typedef int intf; /* size of INTEGERs in Fortran compiler */
1320 typedef float float32;
1321 typedef double float64;
1322 typedef long hdf_pint_t; /* an integer the same size as a pointer */
1323 #define FNAME_POST_UNDERSCORE
1324 #define _fcdtocp(desc) (desc)
1325 #define FILELIB UNIXBUFIO
1326 
1327 /* JPEG #define's - Look in the JPEG docs before changing - (Q) */
1328 
1329 /* Determine the memory manager we are going to use. Valid values are: */
1330 /* MEM_DOS, MEM_ANSI, MEM_NAME, MEM_NOBS. See the JPEG docs for details on */
1331 /* what each does */
1332 #define JMEMSYS MEM_ANSI
1333 
1334 #ifdef __GNUC__
1335 #define HAVE_STDC
1336 #define INCLUDES_ARE_ANSI
1337 #endif
1338 
1339 #endif /*64-bit FreeBSD */
1340 
1341 /*-----------------------------------------------------*/
1342 
1343 /* IA64 running Linux */
1344 #if defined __ia64 && !(defined(hpux) || defined(__hpux))
1345 
1346 #ifdef GOT_MACHINE
1347 If you get an error on this line more than one machine type has been defined.
1348 Please check your Makefile.
1349 #endif
1350 #define GOT_MACHINE
1351 
1352 #include <sys/file.h> /* for unbuffered i/o stuff */
1353 #include <sys/stat.h>
1354 #define DF_MT DFMT_IA64
1355 typedef void VOID;
1356 typedef void *VOIDP;
1357 typedef char *_fcd;
1358 typedef char char8;
1359 typedef unsigned char uchar8;
1360 typedef char int8;
1361 typedef unsigned char uint8;
1362 typedef short int int16;
1363 typedef unsigned short int uint16;
1364 typedef int int32;
1365 typedef unsigned int uint32;
1366 typedef int intn;
1367 typedef unsigned int uintn;
1368 typedef int intf; /* size of INTEGERs in Fortran compiler */
1369 typedef float float32;
1370 typedef double float64;
1371 typedef long hdf_pint_t; /* an integer the same size as a pointer */
1372 #define FNAME_POST_UNDERSCORE
1373 #define _fcdtocp(desc) (desc)
1374 #define FILELIB UNIXBUFIO
1375 
1376 /* JPEG #define's - Look in the JPEG docs before changing - (Q) */
1377 
1378 /* Determine the memory manager we are going to use. Valid values are: */
1379 /* MEM_DOS, MEM_ANSI, MEM_NAME, MEM_NOBS. See the JPEG docs for details on */
1380 /* what each does */
1381 #define JMEMSYS MEM_ANSI
1382 
1383 #ifdef __GNUC__
1384 #define HAVE_STDC
1385 #define INCLUDES_ARE_ANSI
1386 #endif
1387 
1388 #endif /* IA64 */
1389 
1390 #ifndef GOT_MACHINE
1391 No machine type has been defined. Your Makefile needs to have someing like
1392 -DSUN or -DUNICOS in order for the HDF internal structures to be defined
1393 correctly.
1394 #endif
1395 
1396 /*-----------------------------------------------------*/
1397 /* encode and decode macros */
1398 /*-----------------------------------------------------*/
1399 
1400 # define INT16ENCODE(p, i) \
1401 { *(p) = (uint8)(((uintn)(i) >> 8) & 0xff); (p)++; \
1402  *(p) = (uint8)((uintn)(i) & 0xff); (p)++; }
1403 
1404 # define UINT16ENCODE(p, i) \
1405 { *(p) = (uint8)(((uintn)(i) >> 8) & 0xff); (p)++; *(p) = (uint8)((i) & 0xff); (p)++; }
1406 
1407 # define INT32ENCODE(p, i) \
1408 { *(p) = (uint8)(((uint32)(i) >> 24) & 0xff); (p)++; \
1409  *(p) = (uint8)(((uint32)(i) >> 16) & 0xff); (p)++; \
1410  *(p) = (uint8)(((uint32)(i) >> 8) & 0xff); (p)++; \
1411  *(p) = (uint8)((uint32)(i) & 0xff); (p)++; }
1412 
1413 # define UINT32ENCODE(p, i) \
1414 { *(p) = (uint8)(((i) >> 24) & 0xff); (p)++; \
1415  *(p) = (uint8)(((i) >> 16) & 0xff); (p)++; \
1416  *(p) = (uint8)(((i) >> 8) & 0xff); (p)++; \
1417  *(p) = (uint8)((i) & 0xff); (p)++; }
1418 
1419 # define NBYTEENCODE(d, s, n) \
1420 { HDmemcpy(d,s,n); p+=n }
1421 
1422 /* DECODE converts big endian bytes pointed by p to integer values and store
1423  * it in i. For signed values, need to do sign-extension when converting
1424  * the 1st byte which carries the sign bit.
1425  * The macros does not require i be of a certain byte sizes. It just requires
1426  * i be big enough to hold the intended value range. E.g. INT16DECODE works
1427  * correctly even if i is actually a 64bit int like in a Cray.
1428  */
1429 
1430 # define INT16DECODE(p, i) \
1431 { (i) = ((*(p) & 0x80) ? ~0xffff : 0x00) | ((int16)(*(p) & 0xff) << 8); (p)++; \
1432  (i) |= (int16)((*(p) & 0xff)); (p)++; }
1433 
1434 # define UINT16DECODE(p, i) \
1435 { (i) = (uint16)((*(p) & 0xff) << 8); (p)++; \
1436  (i) |= (uint16)(*(p) & 0xff); (p)++; }
1437 
1438 # define INT32DECODE(p, i) \
1439 { (i) = ((*(p) & 0x80) ? ~0xffffffff : 0x00) | ((int32)(*(p) & 0xff) << 24); (p)++; \
1440  (i) |= ((int32)(*(p) & 0xff) << 16); (p)++; \
1441  (i) |= ((int32)(*(p) & 0xff) << 8); (p)++; \
1442  (i) |= (*(p) & 0xff); (p)++; }
1443 
1444 # define UINT32DECODE(p, i) \
1445 { (i) = ((uint32)(*(p) & 0xff) << 24); (p)++; \
1446  (i) |= ((uint32)(*(p) & 0xff) << 16); (p)++; \
1447  (i) |= ((uint32)(*(p) & 0xff) << 8); (p)++; \
1448  (i) |= (uint32)(*(p) & 0xff); (p)++; }
1449 
1450 /* Note! the NBYTEDECODE macro is backwards from the memcpy() routine, */
1451 /* in the spirit of the other DECODE macros */
1452 # define NBYTEDECODE(s, d, n) \
1453 { HDmemcpy(d,s,n); p+=n }
1454 
1455 /*----------------------------------------------------------------
1456 ** MACRO FCALLKEYW for any special fortran-C stub keyword
1457 **
1458 ** MacIntosh MPW LS-fortran needs pascal since it can interface
1459 ** best with pascal functions.
1460 ** Microsoft C and Fortran need __fortran for Fortran callable C
1461 ** routines.
1462 **
1463 ** MACRO FRETVAL for any return value from a fortran-C stub function
1464 ** Replaces the older FCALLKEYW macro.
1465 **---------------------------------------------------------------*/
1466 #ifdef FRETVAL
1467 #undef FRETVAL
1468 #endif
1469 
1470 #if defined(MAC) /* with LS FORTRAN */
1471 #ifndef ABSOFT
1472 # define FCALLKEYW pascal
1473 # define FRETVAL(x) pascal x
1474 #endif /* ABSOFT */
1475 #endif
1476 
1477 #ifndef FRETVAL /* !MAC */
1478 # define FCALLKEYW /*NONE*/
1479 # define FRETVAL(x) x
1480 #endif
1481 
1482 
1483 /*----------------------------------------------------------------
1484 ** MACRO FNAME for any fortran callable routine name.
1485 **
1486 ** This macro prepends, appends, or does not modify a name
1487 ** passed as a macro parameter to it based on the FNAME_PRE_UNDERSCORE,
1488 ** FNAME_POST_UNDERSCORE macros set for a specific system.
1489 **
1490 **---------------------------------------------------------------*/
1491 #if defined(FNAME_PRE_UNDERSCORE) && defined(FNAME_POST_UNDERSCORE)
1492 # define FNAME(x) _##x##_
1493 #endif
1494 #if defined(FNAME_PRE_UNDERSCORE) && !defined(FNAME_POST_UNDERSCORE)
1495 # define FNAME(x) _##x
1496 #endif
1497 #if !defined(FNAME_PRE_UNDERSCORE) && defined(FNAME_POST_UNDERSCORE)
1498 # define FNAME(x) x##_
1499 #endif
1500 #if !defined(FNAME_PRE_UNDERSCORE) && !defined(FNAME_POST_UNDERSCORE)
1501 # define FNAME(x) x
1502 #endif
1503 
1504 /**************************************************************************
1505 * Generally useful macro definitions
1506 **************************************************************************/
1507 #ifndef MIN
1508 #define MIN(a,b) (((a)<(b)) ? (a) : (b))
1509 #endif
1510 #ifndef MAX
1511 #define MAX(a,b) (((a)>(b)) ? (a) : (b))
1512 #endif
1513 
1514 /**************************************************************************
1515 * Debugging Allocation functions
1516 **************************************************************************/
1517 #ifdef MALDEBUG
1518 #include "maldebug.h"
1519 #endif
1520 
1521 /**************************************************************************
1522 * Macros to work around ANSI C portability problems.
1523 **************************************************************************/
1524 #ifdef DUMBCC
1525 #define CONSTR(v,s) char *v=s
1526 #else
1527 #define CONSTR(v,s) static const char v[]=s
1528 #endif
1529 
1530 /* Old-style memory allocation function aliases -QAK */
1531 #define HDgetspace HDmalloc
1532 #define HDclearspace HDcalloc
1533 #define HDregetspace HDrealloc
1534 #define HDfreespace HDfree
1535 
1536 /**************************************************************************
1537 * Allocation functions defined differently
1538 **************************************************************************/
1539 #if !defined(MALLOC_CHECK)
1540 # define HDmalloc(s) (malloc((size_t)s))
1541 # define HDcalloc(a,b) (calloc((size_t)a,(size_t)b))
1542 # define HDfree(p) (free((void*)p))
1543 # define HDrealloc(p,s) (realloc((void*)p,(size_t)s))
1544 #endif /* !defined MALLOC_CHECK */
1545 /* Macro to free space and clear pointer to NULL */
1546 #define HDfreenclear(p) { if((p)!=NULL) HDfree(p); p=NULL; }
1547 
1548 /**************************************************************************
1549 * String functions defined differently
1550 **************************************************************************/
1551 
1552 # define HDstrcat(s1,s2) (strcat((s1),(s2)))
1553 # define HDstrcmp(s,t) (strcmp((s),(t)))
1554 # define HDstrcpy(s,d) (strcpy((s),(d)))
1555 # define HDstrlen(s) (strlen((const char *)(s)))
1556 # define HDstrncmp(s1,s2,n) (strncmp((s1),(s2),(n)))
1557 # define HDstrncpy(s1,s2,n) (strncpy((s1),(s2),(n)))
1558 # define HDstrchr(s,c) (strchr((s),(c)))
1559 # define HDstrrchr(s,c) (strrchr((s),(c)))
1560 # define HDstrtol(s,e,b) (strtol((s),(e),(b)))
1561 /* non-standard function, not defined on the following machines - */
1562 #if !(defined VMS || defined macintosh || defined MAC || defined SYMANTEC_C || defined MIPSEL || defined NEXT || defined CONVEX || defined IBM6000 || defined ANSISUN || defined IRIX )
1563 # define HDstrdup(s) ((char *)strdup((const char *)(s)))
1564 #endif /* !(VMS | etc..) */
1565 
1566 
1567 /**************************************************************************
1568 * Memory functions defined differently
1569 **************************************************************************/
1570 
1571 # define HDmemcpy(dst,src,n) (memcpy((void *)(dst),(const void *)(src),(size_t)(n)))
1572 # define HDmemset(dst,c,n) (memset((void *)(dst),(intn)(c),(size_t)(n)))
1573 # define HDmemcmp(dst,src,n) (memcmp((const void *)(dst),(const void *)(src),(size_t)(n)))
1574 
1575 
1576 /**************************************************************************
1577 * Misc. functions
1578 **************************************************************************/
1579 #if defined (MAC) || defined (macintosh) || defined (SYMANTEC_C)
1580 #define HDstat(path, result) (mstat(path))
1581 #else /* !macintosh */
1582 #define HDstat(path, result) (stat(path, result))
1583 #endif /* !macintosh */
1584 #define HDgetenv(s1) (getenv(s1))
1585 #define HDputenv(s1) (putenv(s1))
1586 #define HDltoa(v) (ltoa(v))
1587 #if defined (SUN) && defined(__GNUC__)
1588 #define HDatexit(f) (0) /* we punt on the SUN using gcc */
1589 #else /* !SUN & GCC */
1590 #define HDatexit(f) (atexit(f))
1591 #endif /* !SUN & GCC */
1592 
1593 /* Compatibility #define for V3.3, should be taken out by v4.0 - QAK */
1594 #define DFSDnumber DFSDndatasets
1595 
1596 #endif /* HDFI_H */
1597 
char * _fcd
Definition: H5f90i.h:37
#define intf
Definition: cdeflate.h:31
HDFFCLIBAPI _fcd intf intf * order
#define HDF
Definition: mfhdf.h:20
HDFFCLIBAPI intf intf intf * type

MISR Toolkit - Copyright © 2005 - 2020 Jet Propulsion Laboratory
Generated on Fri Jun 19 2020 22:49:52