MISR Toolkit  1.5.1
hconv.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: hconv.h 4932 2007-09-07 17:17:23Z bmribler $ */
15 
16 /*-----------------------------------------------------------------------------
17  * File: hconv.h
18  * Purpose: header file for data conversion information & structures
19  * Invokes:
20  * Contents:
21  * Structure definitions:
22  * Constant definitions: lots...
23  *---------------------------------------------------------------------------*/
24 
25 /* avoid re-inclusion */
26 #ifndef _HCONV_H
27 #define _HCONV_H
28 
29 #ifndef VMS
30 #define DUFF
31 #else
32 #ifdef DUFF
33 #undef DUFF
34 #endif
35 #endif
36 #ifdef DUFF
37 #define DUFF_sb4b
38 
39 #define DUFF_ui2i
40 #define DUFF_ui2s
41 #define DUFF_uo2i
42 #define DUFF_ui4i
43 #define DUFF_ui4s
44 #define DUFF_uo4i
45 #define DUFF_ui4f
46 #define DUFF_uo4f
47 #define DUFF_ui8f
48 #define DUFF_uo8f
49 
50 #define DUFF_lui2i
51 #define DUFF_lui2s
52 #define DUFF_luo2i
53 #define DUFF_lui4i
54 #define DUFF_lui4s
55 #define DUFF_luo4i
56 #define DUFF_lui4f
57 #define DUFF_luo4f
58 #define DUFF_lui8f
59 #define DUFF_luo8f
60 #endif
61 
62 /*****************************************************************************/
63 /* CONSTANT DEFINITIONS */
64 /*****************************************************************************/
65 /* Generally Big-Endian machines */
66 #if !defined(VMS) && !defined(INTEL86) && !defined(MIPSEL) && !defined(DEC_ALPHA) && !defined(I860) && !defined(SUN386) && !(defined(__ia64) && !(defined(hpux) || defined(__hpux))) && !defined(__x86_64__)
67 # if !defined(UNICOS)
68 # define UI8_IN DFKnb1b /* Unsigned Integer, 8 bits */
69 # define UI8_OUT DFKnb1b
70 # if defined(CRAYMPP)
71 # define SI16_IN DFKmi2s
72 # define SI16_OUT DFKmo2b
73 # define UI16_IN DFKmi2i
74 # define UI16_OUT DFKmo2b
75 # else
76 # define SI16_IN DFKnb2b /* S = Signed */
77 # define SI16_OUT DFKnb2b
78 # define UI16_IN DFKnb2b
79 # define UI16_OUT DFKnb2b
80 # endif
81 # define SI32_IN DFKnb4b
82 # define SI32_OUT DFKnb4b
83 # define UI32_IN DFKnb4b
84 # define UI32_OUT DFKnb4b
85 # if defined(CONVEXNATIVE)
86 # define F32_IN DFKci4f /* CONVEX stuff */
87 # define F32_OUT DFKco4f
88 # define F64_IN DFKci8f
89 # define F64_OUT DFKco8f
90 # elif defined(VP)
91 # define F32_IN DFKpi4f /* Fujitsu VP stuff */
92 # define F32_OUT DFKpo4f
93 # define F64_IN DFKpi8f
94 # define F64_OUT DFKpo8f
95 # else /* !CONVEXNATIVE */
96 # define F32_IN DFKnb4b /* Float, 32 bits */
97 # define F32_OUT DFKnb4b
98 # define F64_IN DFKnb8b
99 # define F64_OUT DFKnb8b
100 # endif /* CONVEXNATIVE */
101 
102 # define LUI8_IN DFKnb1b /* Little Endian Unsigned Integer, 8 bits */
103 # define LUI8_OUT DFKnb1b
104 # if defined(CRAYMPP)
105 # define LSI16_IN DFKlmi2s
106 # define LSI16_OUT DFKlmo2b
107 # define LUI16_IN DFKlmi2i
108 # define LUI16_OUT DFKlmo2b
109 # else
110 # define LSI16_IN DFKsb2b
111 # define LSI16_OUT DFKsb2b
112 # define LUI16_IN DFKsb2b
113 # define LUI16_OUT DFKsb2b
114 # endif
115 # define LSI32_IN DFKsb4b
116 # define LSI32_OUT DFKsb4b
117 # define LUI32_IN DFKsb4b
118 # define LUI32_OUT DFKsb4b
119 # if defined(CONVEXNATIVE)
120 # define LF32_IN DFKlci4f /* CONVEX little-endian routines */
121 # define LF32_OUT DFKlco4f
122 # define LF64_IN DFKlci8f
123 # define LF64_OUT DFKlco8f
124 # elif defined(VP)
125 # define LF32_IN DFKlpi4f /* Fujitsu VP little-endian routines */
126 # define LF32_OUT DFKlpo4f
127 # define LF64_IN DFKlpi8f
128 # define LF64_OUT DFKlpo8f
129 # else /* !CONVEXNATIVE */
130 # define LF32_IN DFKsb4b
131 # define LF32_OUT DFKsb4b
132 # define LF64_IN DFKsb8b
133 # define LF64_OUT DFKsb8b
134 # endif /* CONVEXNATIVE */
135 
136 # else /* UNICOS */
137 # define UI8_IN DFKnb1b /* Big-Endian IEEE support */
138 # define UI8_OUT DFKnb1b
139 # define SI16_IN DFKui2s
140 # define SI16_OUT DFKuo2s
141 # define UI16_IN DFKui2i
142 # define UI16_OUT DFKuo2i
143 # define SI32_IN DFKui4s
144 # define SI32_OUT DFKuo4s
145 # define UI32_IN DFKui4i
146 # define UI32_OUT DFKuo4i
147 # define F32_IN DFKui4f
148 # define F32_OUT DFKuo4f
149 # define F64_IN DFKui8f
150 # define F64_OUT DFKuo8f
151 
152 # define LUI8_IN DFKnb1b /* Little-endian IEEE support */
153 # define LUI8_OUT DFKnb1b
154 # define LSI16_IN DFKlui2s
155 # define LSI16_OUT DFKluo2s
156 # define LUI16_IN DFKlui2i
157 # define LUI16_OUT DFKluo2i
158 # define LSI32_IN DFKlui4s
159 # define LSI32_OUT DFKluo4s
160 # define LUI32_IN DFKlui4i
161 # define LUI32_OUT DFKluo4i
162 # define LF32_IN DFKlui4f
163 # define LF32_OUT DFKluo4f
164 # define LF64_IN DFKlui8f
165 # define LF64_OUT DFKluo8f
166 
167 # endif /* !UNICOS */
168 #else /* must be VMS || INTEL86 || MIPSEL || DEC_ALPHA || I860 || SUN386 || IA64 || Linux64 (Generally, little-endian machines */
169 # define UI8_IN DFKnb1b /* Big-Endian IEEE support */
170 # define UI8_OUT DFKnb1b /* The s in DFKsb2b is for swap */
171 # define SI16_IN DFKsb2b
172 # define SI16_OUT DFKsb2b
173 # define UI16_IN DFKsb2b
174 # define UI16_OUT DFKsb2b
175 # define SI32_IN DFKsb4b
176 # define SI32_OUT DFKsb4b
177 # define UI32_IN DFKsb4b
178 # define UI32_OUT DFKsb4b
179 # if defined(VMS)
180 # define F32_IN DFKvi4f
181 # define F32_OUT DFKvo4f
182 # define F64_IN DFKvi8f
183 # define F64_OUT DFKvo8f
184 # else /* !VMS */
185 # define F32_IN DFKsb4b
186 # define F32_OUT DFKsb4b
187 # define F64_IN DFKsb8b
188 # define F64_OUT DFKsb8b
189 # endif /* VMS */
190 
191 # define LUI8_IN DFKnb1b /* Little-Endian IEEE support */
192 # define LUI8_OUT DFKnb1b
193 # define LSI16_IN DFKnb2b
194 # define LSI16_OUT DFKnb2b
195 # define LUI16_IN DFKnb2b
196 # define LUI16_OUT DFKnb2b
197 # define LSI32_IN DFKnb4b
198 # define LSI32_OUT DFKnb4b
199 # define LUI32_IN DFKnb4b
200 # define LUI32_OUT DFKnb4b
201 # if defined(VMS)
202 # define LF32_IN DFKlvi4f
203 # define LF32_OUT DFKlvo4f
204 # define LF64_IN DFKlvi8f
205 # define LF64_OUT DFKlvo8f
206 # else /* !VMS */
207 # define LF32_IN DFKnb4b
208 # define LF32_OUT DFKnb4b
209 # define LF64_IN DFKnb8b
210 # define LF64_OUT DFKnb8b
211 # endif /* VMS */
212 
213 #endif /* !VMS && !INTEL86 && !MIPS && !DEC_ALPHA && !I860 && !SUN386 && !IA64 && !Linux64*/
214 
215 /* All Machines (except the Cray) currently use the same routines */
216 /* for Native mode "conversions" */
217 #ifndef UNICOS
218 # define NUI8_IN DFKnb1b
219 # define NUI8_OUT DFKnb1b
220 # if defined(CRAYMPP)
221 # define NSI16_IN DFKmi2s
222 # define NSI16_OUT DFKmo2b
223 # define NUI16_IN DFKmi2i
224 # define NUI16_OUT DFKmo2b
225 # else
226 # define NSI16_IN DFKnb2b
227 # define NSI16_OUT DFKnb2b
228 # define NUI16_IN DFKnb2b
229 # define NUI16_OUT DFKnb2b
230 # endif
231 # define NSI32_IN DFKnb4b
232 # define NSI32_OUT DFKnb4b
233 # define NUI32_IN DFKnb4b
234 # define NUI32_OUT DFKnb4b
235 # define NF32_IN DFKnb4b
236 # define NF32_OUT DFKnb4b
237 # define NF64_IN DFKnb8b
238 # define NF64_OUT DFKnb8b
239 #else /* UNICOS */
240 # define NUI8_IN DFKnb1b
241 # define NUI8_OUT DFKnb1b
242 # define NSI16_IN DFKnb8b
243 # define NSI16_OUT DFKnb8b
244 # define NUI16_IN DFKnb8b
245 # define NUI16_OUT DFKnb8b
246 # define NSI32_IN DFKnb8b
247 # define NSI32_OUT DFKnb8b
248 # define NUI32_IN DFKnb8b
249 # define NUI32_OUT DFKnb8b
250 # define NF32_IN DFKnb8b
251 # define NF32_OUT DFKnb8b
252 # define NF64_IN DFKnb8b
253 # define NF64_OUT DFKnb8b
254 #endif /* UNICOS */
255 
256 /*****************************************************************************/
257 /* STRUCTURE DEFINTIONS */
258 /*****************************************************************************/
259 union fpx
260  {
261  float f;
262  long l;
263  };
264 
266  {
267  float32 f;
268  int32 i;
269  unsigned char c[4];
270  };
271 
272 #endif /* _HCONV_H */
float f
Definition: hconv.h:261
long l
Definition: hconv.h:262
float32 f
Definition: hconv.h:267
Definition: hconv.h:259

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