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 HDF5.  The full HDF5 copyright notice, including     *
7  * terms governing use, modification, and redistribution, is contained in    *
8  * the COPYING file, which can be found at the root of the source code       *
9  * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.  *
10  * If you do not have access to either file, you may request a copy from     *
11  * help@hdfgroup.org.                                                        *
12  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
13 
14 /*
15  * This file contains public declarations for the H5T module.
16  */
17 #ifndef _H5Tpublic_H
18 #define _H5Tpublic_H
19 
20 /* Public headers needed by this file */
21 #include "H5public.h"
22 #include "H5Ipublic.h"
23 
24 #define HOFFSET(S,M)    (offsetof(S,M))
25 
26 /* These are the various classes of datatypes */
27 /* If this goes over 16 types (0-15), the file format will need to change) */
28 typedef enum H5T_class_t {
29     H5T_NO_CLASS         = -1,  /*error                                      */
30     H5T_INTEGER          = 0,   /*integer types                              */
31     H5T_FLOAT            = 1,   /*floating-point types                       */
32     H5T_TIME             = 2,   /*date and time types                        */
33     H5T_STRING           = 3,   /*character string types                     */
34     H5T_BITFIELD         = 4,   /*bit field types                            */
35     H5T_OPAQUE           = 5,   /*opaque types                               */
36     H5T_COMPOUND         = 6,   /*compound types                             */
37     H5T_REFERENCE        = 7,   /*reference types                            */
38     H5T_ENUM		 = 8,	/*enumeration types                          */
39     H5T_VLEN		 = 9,	/*Variable-Length types                      */
40     H5T_ARRAY	         = 10,	/*Array types                                */
41 
42     H5T_NCLASSES                /*this must be last                          */
43 } H5T_class_t;
44 
45 /* Byte orders */
46 typedef enum H5T_order_t {
47     H5T_ORDER_ERROR      = -1,  /*error                                      */
48     H5T_ORDER_LE         = 0,   /*little endian                              */
49     H5T_ORDER_BE         = 1,   /*bit endian                                 */
50     H5T_ORDER_VAX        = 2,   /*VAX mixed endian                           */
51     H5T_ORDER_MIXED      = 3,   /*Compound type with mixed member orders     */
52     H5T_ORDER_NONE       = 4    /*no particular order (strings, bits,..)     */
53     /*H5T_ORDER_NONE must be last */
54 } H5T_order_t;
55 
56 /* Types of integer sign schemes */
57 typedef enum H5T_sign_t {
58     H5T_SGN_ERROR        = -1,  /*error                                      */
59     H5T_SGN_NONE         = 0,   /*this is an unsigned type                   */
60     H5T_SGN_2            = 1,   /*two's complement                           */
61 
62     H5T_NSGN             = 2    /*this must be last!                         */
63 } H5T_sign_t;
64 
65 /* Floating-point normalization schemes */
66 typedef enum H5T_norm_t {
67     H5T_NORM_ERROR       = -1,  /*error                                      */
68     H5T_NORM_IMPLIED     = 0,   /*msb of mantissa isn't stored, always 1     */
69     H5T_NORM_MSBSET      = 1,   /*msb of mantissa is always 1                */
70     H5T_NORM_NONE        = 2    /*not normalized                             */
71     /*H5T_NORM_NONE must be last */
72 } H5T_norm_t;
73 
74 /*
75  * Character set to use for text strings.  Do not change these values since
76  * they appear in HDF5 files!
77  */
78 typedef enum H5T_cset_t {
79     H5T_CSET_ERROR       = -1,  /*error                                      */
80     H5T_CSET_ASCII       = 0,   /*US ASCII                                   */
81     H5T_CSET_UTF8        = 1,   /*UTF-8 Unicode encoding		     */
82     H5T_CSET_RESERVED_2  = 2,   /*reserved for later use		     */
83     H5T_CSET_RESERVED_3  = 3,   /*reserved for later use		     */
84     H5T_CSET_RESERVED_4  = 4,   /*reserved for later use		     */
85     H5T_CSET_RESERVED_5  = 5,   /*reserved for later use		     */
86     H5T_CSET_RESERVED_6  = 6,   /*reserved for later use		     */
87     H5T_CSET_RESERVED_7  = 7,   /*reserved for later use		     */
88     H5T_CSET_RESERVED_8  = 8,   /*reserved for later use		     */
89     H5T_CSET_RESERVED_9  = 9,   /*reserved for later use		     */
90     H5T_CSET_RESERVED_10 = 10,  /*reserved for later use		     */
91     H5T_CSET_RESERVED_11 = 11,  /*reserved for later use		     */
92     H5T_CSET_RESERVED_12 = 12,  /*reserved for later use		     */
93     H5T_CSET_RESERVED_13 = 13,  /*reserved for later use		     */
94     H5T_CSET_RESERVED_14 = 14,  /*reserved for later use		     */
95     H5T_CSET_RESERVED_15 = 15   /*reserved for later use		     */
96 } H5T_cset_t;
97 #define H5T_NCSET H5T_CSET_RESERVED_2    		/*Number of character sets actually defined  */
98 
99 /*
100  * Type of padding to use in character strings.  Do not change these values
101  * since they appear in HDF5 files!
102  */
103 typedef enum H5T_str_t {
104     H5T_STR_ERROR        = -1,  /*error                                      */
105     H5T_STR_NULLTERM     = 0,   /*null terminate like in C                   */
106     H5T_STR_NULLPAD      = 1,   /*pad with nulls                             */
107     H5T_STR_SPACEPAD     = 2,   /*pad with spaces like in Fortran            */
108     H5T_STR_RESERVED_3   = 3,   /*reserved for later use		     */
109     H5T_STR_RESERVED_4   = 4,   /*reserved for later use		     */
110     H5T_STR_RESERVED_5   = 5,   /*reserved for later use		     */
111     H5T_STR_RESERVED_6   = 6,   /*reserved for later use		     */
112     H5T_STR_RESERVED_7   = 7,   /*reserved for later use		     */
113     H5T_STR_RESERVED_8   = 8,   /*reserved for later use		     */
114     H5T_STR_RESERVED_9   = 9,   /*reserved for later use		     */
115     H5T_STR_RESERVED_10  = 10,  /*reserved for later use		     */
116     H5T_STR_RESERVED_11  = 11,  /*reserved for later use		     */
117     H5T_STR_RESERVED_12  = 12,  /*reserved for later use		     */
118     H5T_STR_RESERVED_13  = 13,  /*reserved for later use		     */
119     H5T_STR_RESERVED_14  = 14,  /*reserved for later use		     */
120     H5T_STR_RESERVED_15  = 15   /*reserved for later use		     */
121 } H5T_str_t;
122 #define H5T_NSTR H5T_STR_RESERVED_3		/*num H5T_str_t types actually defined	     */
123 
124 /* Type of padding to use in other atomic types */
125 typedef enum H5T_pad_t {
126     H5T_PAD_ERROR        = -1,  /*error                                      */
127     H5T_PAD_ZERO         = 0,   /*always set to zero                         */
128     H5T_PAD_ONE          = 1,   /*always set to one                          */
129     H5T_PAD_BACKGROUND   = 2,   /*set to background value                    */
130 
131     H5T_NPAD             = 3    /*THIS MUST BE LAST                          */
132 } H5T_pad_t;
133 
134 /* Commands sent to conversion functions */
135 typedef enum H5T_cmd_t {
136     H5T_CONV_INIT	= 0,	/*query and/or initialize private data	     */
137     H5T_CONV_CONV	= 1, 	/*convert data from source to dest datatype */
138     H5T_CONV_FREE	= 2	/*function is being removed from path	     */
139 } H5T_cmd_t;
140 
141 /* How is the `bkg' buffer used by the conversion function? */
142 typedef enum H5T_bkg_t {
143     H5T_BKG_NO		= 0, 	/*background buffer is not needed, send NULL */
144     H5T_BKG_TEMP	= 1,	/*bkg buffer used as temp storage only       */
145     H5T_BKG_YES		= 2	/*init bkg buf with data before conversion   */
146 } H5T_bkg_t;
147 
148 /* Type conversion client data */
149 typedef struct H5T_cdata_t {
150     H5T_cmd_t		command;/*what should the conversion function do?    */
151     H5T_bkg_t		need_bkg;/*is the background buffer needed?	     */
152     hbool_t		recalc;	/*recalculate private data		     */
153     void		*priv;	/*private data				     */
154 } H5T_cdata_t;
155 
156 /* Conversion function persistence */
157 typedef enum H5T_pers_t {
158     H5T_PERS_DONTCARE	= -1, 	/*wild card				     */
159     H5T_PERS_HARD	= 0,	/*hard conversion function		     */
160     H5T_PERS_SOFT	= 1 	/*soft conversion function		     */
161 } H5T_pers_t;
162 
163 /* The order to retrieve atomic native datatype */
164 typedef enum H5T_direction_t {
165     H5T_DIR_DEFAULT     = 0,    /*default direction is inscendent            */
166     H5T_DIR_ASCEND      = 1,    /*in inscendent order                        */
167     H5T_DIR_DESCEND     = 2     /*in descendent order                        */
168 } H5T_direction_t;
169 
170 /* The exception type passed into the conversion callback function */
171 typedef enum H5T_conv_except_t {
172     H5T_CONV_EXCEPT_RANGE_HI       = 0,   /*source value is greater than destination's range */
173     H5T_CONV_EXCEPT_RANGE_LOW      = 1,   /*source value is less than destination's range    */
174     H5T_CONV_EXCEPT_PRECISION      = 2,   /*source value loses precision in destination      */
175     H5T_CONV_EXCEPT_TRUNCATE       = 3,   /*source value is truncated in destination         */
176     H5T_CONV_EXCEPT_PINF           = 4,   /*source value is positive infinity(floating number) */
177     H5T_CONV_EXCEPT_NINF           = 5,   /*source value is negative infinity(floating number) */
178     H5T_CONV_EXCEPT_NAN            = 6    /*source value is NaN(floating number)             */
179 } H5T_conv_except_t;
180 
181 /* The return value from conversion callback function H5T_conv_except_func_t */
182 typedef enum H5T_conv_ret_t {
183     H5T_CONV_ABORT      = -1,   /*abort conversion                           */
184     H5T_CONV_UNHANDLED  = 0,    /*callback function failed to handle the exception      */
185     H5T_CONV_HANDLED    = 1     /*callback function handled the exception successfully  */
186 } H5T_conv_ret_t;
187 
188 /* Variable Length Datatype struct in memory */
189 /* (This is only used for VL sequences, not VL strings, which are stored in char *'s) */
190 typedef struct {
191     size_t len; /* Length of VL data (in base type units) */
192     void *p;    /* Pointer to VL data */
193 } hvl_t;
194 
195 /* Variable Length String information */
196 #define H5T_VARIABLE    ((size_t)(-1))  /* Indicate that a string is variable length (null-terminated in C, instead of fixed length) */
197 
198 /* Opaque information */
199 #define H5T_OPAQUE_TAG_MAX      256     /* Maximum length of an opaque tag */
200                                         /* This could be raised without too much difficulty */
201 
202 #ifdef __cplusplus
203 extern "C" {
204 #endif
205 
206 /* All datatype conversion functions are... */
207 typedef herr_t (*H5T_conv_t) (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
208       size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf,
209       void *bkg, hid_t dset_xfer_plist);
210 
211 /* Exception handler.  If an exception like overflow happenes during conversion,
212  * this function is called if it's registered through H5Pset_type_conv_cb.
213  */
214 typedef H5T_conv_ret_t (*H5T_conv_except_func_t)(H5T_conv_except_t except_type,
215     hid_t src_id, hid_t dst_id, void *src_buf, void *dst_buf, void *user_data);
216 
217 /* When this header is included from a private header, don't make calls to H5open() */
218 #undef H5OPEN
219 #ifndef _H5private_H
220 #define H5OPEN          H5open(),
221 #else   /* _H5private_H */
222 #define H5OPEN
223 #endif  /* _H5private_H */
224 
225 /*
226  * The IEEE floating point types in various byte orders.
227  */
228 #define H5T_IEEE_F32BE		(H5OPEN H5T_IEEE_F32BE_g)
229 #define H5T_IEEE_F32LE		(H5OPEN H5T_IEEE_F32LE_g)
230 #define H5T_IEEE_F64BE		(H5OPEN H5T_IEEE_F64BE_g)
231 #define H5T_IEEE_F64LE		(H5OPEN H5T_IEEE_F64LE_g)
232 H5_DLLVAR hid_t H5T_IEEE_F32BE_g;
233 H5_DLLVAR hid_t H5T_IEEE_F32LE_g;
234 H5_DLLVAR hid_t H5T_IEEE_F64BE_g;
235 H5_DLLVAR hid_t H5T_IEEE_F64LE_g;
236 
237 /*
238  * These are "standard" types.  For instance, signed (2's complement) and
239  * unsigned integers of various sizes and byte orders.
240  */
241 #define H5T_STD_I8BE		(H5OPEN H5T_STD_I8BE_g)
242 #define H5T_STD_I8LE		(H5OPEN H5T_STD_I8LE_g)
243 #define H5T_STD_I16BE		(H5OPEN H5T_STD_I16BE_g)
244 #define H5T_STD_I16LE		(H5OPEN H5T_STD_I16LE_g)
245 #define H5T_STD_I32BE		(H5OPEN H5T_STD_I32BE_g)
246 #define H5T_STD_I32LE		(H5OPEN H5T_STD_I32LE_g)
247 #define H5T_STD_I64BE		(H5OPEN H5T_STD_I64BE_g)
248 #define H5T_STD_I64LE		(H5OPEN H5T_STD_I64LE_g)
249 #define H5T_STD_U8BE		(H5OPEN H5T_STD_U8BE_g)
250 #define H5T_STD_U8LE		(H5OPEN H5T_STD_U8LE_g)
251 #define H5T_STD_U16BE		(H5OPEN H5T_STD_U16BE_g)
252 #define H5T_STD_U16LE		(H5OPEN H5T_STD_U16LE_g)
253 #define H5T_STD_U32BE		(H5OPEN H5T_STD_U32BE_g)
254 #define H5T_STD_U32LE		(H5OPEN H5T_STD_U32LE_g)
255 #define H5T_STD_U64BE		(H5OPEN H5T_STD_U64BE_g)
256 #define H5T_STD_U64LE		(H5OPEN H5T_STD_U64LE_g)
257 #define H5T_STD_B8BE		(H5OPEN H5T_STD_B8BE_g)
258 #define H5T_STD_B8LE		(H5OPEN H5T_STD_B8LE_g)
259 #define H5T_STD_B16BE		(H5OPEN H5T_STD_B16BE_g)
260 #define H5T_STD_B16LE		(H5OPEN H5T_STD_B16LE_g)
261 #define H5T_STD_B32BE		(H5OPEN H5T_STD_B32BE_g)
262 #define H5T_STD_B32LE		(H5OPEN H5T_STD_B32LE_g)
263 #define H5T_STD_B64BE		(H5OPEN H5T_STD_B64BE_g)
264 #define H5T_STD_B64LE		(H5OPEN H5T_STD_B64LE_g)
265 #define H5T_STD_REF_OBJ	        (H5OPEN H5T_STD_REF_OBJ_g)
266 #define H5T_STD_REF_DSETREG     (H5OPEN H5T_STD_REF_DSETREG_g)
267 H5_DLLVAR hid_t H5T_STD_I8BE_g;
268 H5_DLLVAR hid_t H5T_STD_I8LE_g;
269 H5_DLLVAR hid_t H5T_STD_I16BE_g;
270 H5_DLLVAR hid_t H5T_STD_I16LE_g;
271 H5_DLLVAR hid_t H5T_STD_I32BE_g;
272 H5_DLLVAR hid_t H5T_STD_I32LE_g;
273 H5_DLLVAR hid_t H5T_STD_I64BE_g;
274 H5_DLLVAR hid_t H5T_STD_I64LE_g;
275 H5_DLLVAR hid_t H5T_STD_U8BE_g;
276 H5_DLLVAR hid_t H5T_STD_U8LE_g;
277 H5_DLLVAR hid_t H5T_STD_U16BE_g;
278 H5_DLLVAR hid_t H5T_STD_U16LE_g;
279 H5_DLLVAR hid_t H5T_STD_U32BE_g;
280 H5_DLLVAR hid_t H5T_STD_U32LE_g;
281 H5_DLLVAR hid_t H5T_STD_U64BE_g;
282 H5_DLLVAR hid_t H5T_STD_U64LE_g;
283 H5_DLLVAR hid_t H5T_STD_B8BE_g;
284 H5_DLLVAR hid_t H5T_STD_B8LE_g;
285 H5_DLLVAR hid_t H5T_STD_B16BE_g;
286 H5_DLLVAR hid_t H5T_STD_B16LE_g;
287 H5_DLLVAR hid_t H5T_STD_B32BE_g;
288 H5_DLLVAR hid_t H5T_STD_B32LE_g;
289 H5_DLLVAR hid_t H5T_STD_B64BE_g;
290 H5_DLLVAR hid_t H5T_STD_B64LE_g;
291 H5_DLLVAR hid_t H5T_STD_REF_OBJ_g;
292 H5_DLLVAR hid_t H5T_STD_REF_DSETREG_g;
293 
294 /*
295  * Types which are particular to Unix.
296  */
297 #define H5T_UNIX_D32BE		(H5OPEN H5T_UNIX_D32BE_g)
298 #define H5T_UNIX_D32LE		(H5OPEN H5T_UNIX_D32LE_g)
299 #define H5T_UNIX_D64BE		(H5OPEN H5T_UNIX_D64BE_g)
300 #define H5T_UNIX_D64LE		(H5OPEN H5T_UNIX_D64LE_g)
301 H5_DLLVAR hid_t H5T_UNIX_D32BE_g;
302 H5_DLLVAR hid_t H5T_UNIX_D32LE_g;
303 H5_DLLVAR hid_t H5T_UNIX_D64BE_g;
304 H5_DLLVAR hid_t H5T_UNIX_D64LE_g;
305 
306 /*
307  * Types particular to the C language.  String types use `bytes' instead
308  * of `bits' as their size.
309  */
310 #define H5T_C_S1		(H5OPEN H5T_C_S1_g)
311 H5_DLLVAR hid_t H5T_C_S1_g;
312 
313 /*
314  * Types particular to Fortran.
315  */
316 #define H5T_FORTRAN_S1		(H5OPEN H5T_FORTRAN_S1_g)
317 H5_DLLVAR hid_t H5T_FORTRAN_S1_g;
318 
319 /*
320  * These types are for Intel CPU's.  They are little endian with IEEE
321  * floating point.
322  */
323 #define H5T_INTEL_I8		H5T_STD_I8LE
324 #define H5T_INTEL_I16		H5T_STD_I16LE
325 #define H5T_INTEL_I32		H5T_STD_I32LE
326 #define H5T_INTEL_I64		H5T_STD_I64LE
327 #define H5T_INTEL_U8		H5T_STD_U8LE
328 #define H5T_INTEL_U16		H5T_STD_U16LE
329 #define H5T_INTEL_U32		H5T_STD_U32LE
330 #define H5T_INTEL_U64		H5T_STD_U64LE
331 #define H5T_INTEL_B8		H5T_STD_B8LE
332 #define H5T_INTEL_B16		H5T_STD_B16LE
333 #define H5T_INTEL_B32		H5T_STD_B32LE
334 #define H5T_INTEL_B64		H5T_STD_B64LE
335 #define H5T_INTEL_F32		H5T_IEEE_F32LE
336 #define H5T_INTEL_F64		H5T_IEEE_F64LE
337 
338 /*
339  * These types are for DEC Alpha CPU's.  They are little endian with IEEE
340  * floating point.
341  */
342 #define H5T_ALPHA_I8		H5T_STD_I8LE
343 #define H5T_ALPHA_I16		H5T_STD_I16LE
344 #define H5T_ALPHA_I32		H5T_STD_I32LE
345 #define H5T_ALPHA_I64		H5T_STD_I64LE
346 #define H5T_ALPHA_U8		H5T_STD_U8LE
347 #define H5T_ALPHA_U16		H5T_STD_U16LE
348 #define H5T_ALPHA_U32		H5T_STD_U32LE
349 #define H5T_ALPHA_U64		H5T_STD_U64LE
350 #define H5T_ALPHA_B8		H5T_STD_B8LE
351 #define H5T_ALPHA_B16		H5T_STD_B16LE
352 #define H5T_ALPHA_B32		H5T_STD_B32LE
353 #define H5T_ALPHA_B64		H5T_STD_B64LE
354 #define H5T_ALPHA_F32		H5T_IEEE_F32LE
355 #define H5T_ALPHA_F64		H5T_IEEE_F64LE
356 
357 /*
358  * These types are for MIPS cpu's commonly used in SGI systems. They are big
359  * endian with IEEE floating point.
360  */
361 #define H5T_MIPS_I8		H5T_STD_I8BE
362 #define H5T_MIPS_I16		H5T_STD_I16BE
363 #define H5T_MIPS_I32		H5T_STD_I32BE
364 #define H5T_MIPS_I64		H5T_STD_I64BE
365 #define H5T_MIPS_U8		H5T_STD_U8BE
366 #define H5T_MIPS_U16		H5T_STD_U16BE
367 #define H5T_MIPS_U32		H5T_STD_U32BE
368 #define H5T_MIPS_U64		H5T_STD_U64BE
369 #define H5T_MIPS_B8		H5T_STD_B8BE
370 #define H5T_MIPS_B16		H5T_STD_B16BE
371 #define H5T_MIPS_B32		H5T_STD_B32BE
372 #define H5T_MIPS_B64		H5T_STD_B64BE
373 #define H5T_MIPS_F32		H5T_IEEE_F32BE
374 #define H5T_MIPS_F64		H5T_IEEE_F64BE
375 
376 /*
377  * The VAX floating point types (i.e. in VAX byte order)
378  */
379 #define H5T_VAX_F32		(H5OPEN H5T_VAX_F32_g)
380 #define H5T_VAX_F64		(H5OPEN H5T_VAX_F64_g)
381 H5_DLLVAR hid_t H5T_VAX_F32_g;
382 H5_DLLVAR hid_t H5T_VAX_F64_g;
383 
384 /*
385  * The predefined native types. These are the types detected by H5detect and
386  * they violate the naming scheme a little.  Instead of a class name,
387  * precision and byte order as the last component, they have a C-like type
388  * name.  If the type begins with `U' then it is the unsigned version of the
389  * integer type; other integer types are signed.  The type LLONG corresponds
390  * to C's `long long' and LDOUBLE is `long double' (these types might be the
391  * same as `LONG' and `DOUBLE' respectively).
392  */
393 #define H5T_NATIVE_CHAR		(CHAR_MIN?H5T_NATIVE_SCHAR:H5T_NATIVE_UCHAR)
394 #define H5T_NATIVE_SCHAR        (H5OPEN H5T_NATIVE_SCHAR_g)
395 #define H5T_NATIVE_UCHAR        (H5OPEN H5T_NATIVE_UCHAR_g)
396 #define H5T_NATIVE_SHORT        (H5OPEN H5T_NATIVE_SHORT_g)
397 #define H5T_NATIVE_USHORT       (H5OPEN H5T_NATIVE_USHORT_g)
398 #define H5T_NATIVE_INT          (H5OPEN H5T_NATIVE_INT_g)
399 #define H5T_NATIVE_UINT         (H5OPEN H5T_NATIVE_UINT_g)
400 #define H5T_NATIVE_LONG         (H5OPEN H5T_NATIVE_LONG_g)
401 #define H5T_NATIVE_ULONG        (H5OPEN H5T_NATIVE_ULONG_g)
402 #define H5T_NATIVE_LLONG        (H5OPEN H5T_NATIVE_LLONG_g)
403 #define H5T_NATIVE_ULLONG       (H5OPEN H5T_NATIVE_ULLONG_g)
404 #define H5T_NATIVE_FLOAT        (H5OPEN H5T_NATIVE_FLOAT_g)
405 #define H5T_NATIVE_DOUBLE       (H5OPEN H5T_NATIVE_DOUBLE_g)
406 #if H5_SIZEOF_LONG_DOUBLE !=0
407 #define H5T_NATIVE_LDOUBLE	(H5OPEN H5T_NATIVE_LDOUBLE_g)
408 #endif
409 #define H5T_NATIVE_B8		(H5OPEN H5T_NATIVE_B8_g)
410 #define H5T_NATIVE_B16		(H5OPEN H5T_NATIVE_B16_g)
411 #define H5T_NATIVE_B32		(H5OPEN H5T_NATIVE_B32_g)
412 #define H5T_NATIVE_B64		(H5OPEN H5T_NATIVE_B64_g)
413 #define H5T_NATIVE_OPAQUE       (H5OPEN H5T_NATIVE_OPAQUE_g)
414 #define H5T_NATIVE_HADDR	(H5OPEN H5T_NATIVE_HADDR_g)
415 #define H5T_NATIVE_HSIZE	(H5OPEN H5T_NATIVE_HSIZE_g)
416 #define H5T_NATIVE_HSSIZE	(H5OPEN H5T_NATIVE_HSSIZE_g)
417 #define H5T_NATIVE_HERR		(H5OPEN H5T_NATIVE_HERR_g)
418 #define H5T_NATIVE_HBOOL	(H5OPEN H5T_NATIVE_HBOOL_g)
419 H5_DLLVAR hid_t H5T_NATIVE_SCHAR_g;
420 H5_DLLVAR hid_t H5T_NATIVE_UCHAR_g;
421 H5_DLLVAR hid_t H5T_NATIVE_SHORT_g;
422 H5_DLLVAR hid_t H5T_NATIVE_USHORT_g;
423 H5_DLLVAR hid_t H5T_NATIVE_INT_g;
424 H5_DLLVAR hid_t H5T_NATIVE_UINT_g;
425 H5_DLLVAR hid_t H5T_NATIVE_LONG_g;
426 H5_DLLVAR hid_t H5T_NATIVE_ULONG_g;
427 H5_DLLVAR hid_t H5T_NATIVE_LLONG_g;
428 H5_DLLVAR hid_t H5T_NATIVE_ULLONG_g;
429 H5_DLLVAR hid_t H5T_NATIVE_FLOAT_g;
430 H5_DLLVAR hid_t H5T_NATIVE_DOUBLE_g;
431 #if H5_SIZEOF_LONG_DOUBLE !=0
432 H5_DLLVAR hid_t H5T_NATIVE_LDOUBLE_g;
433 #endif
434 H5_DLLVAR hid_t H5T_NATIVE_B8_g;
435 H5_DLLVAR hid_t H5T_NATIVE_B16_g;
436 H5_DLLVAR hid_t H5T_NATIVE_B32_g;
437 H5_DLLVAR hid_t H5T_NATIVE_B64_g;
438 H5_DLLVAR hid_t H5T_NATIVE_OPAQUE_g;
439 H5_DLLVAR hid_t H5T_NATIVE_HADDR_g;
440 H5_DLLVAR hid_t H5T_NATIVE_HSIZE_g;
441 H5_DLLVAR hid_t H5T_NATIVE_HSSIZE_g;
442 H5_DLLVAR hid_t H5T_NATIVE_HERR_g;
443 H5_DLLVAR hid_t H5T_NATIVE_HBOOL_g;
444 
445 /* C9x integer types */
446 #define H5T_NATIVE_INT8			(H5OPEN H5T_NATIVE_INT8_g)
447 #define H5T_NATIVE_UINT8		(H5OPEN H5T_NATIVE_UINT8_g)
448 #define H5T_NATIVE_INT_LEAST8		(H5OPEN H5T_NATIVE_INT_LEAST8_g)
449 #define H5T_NATIVE_UINT_LEAST8		(H5OPEN H5T_NATIVE_UINT_LEAST8_g)
450 #define H5T_NATIVE_INT_FAST8 		(H5OPEN H5T_NATIVE_INT_FAST8_g)
451 #define H5T_NATIVE_UINT_FAST8		(H5OPEN H5T_NATIVE_UINT_FAST8_g)
452 H5_DLLVAR hid_t H5T_NATIVE_INT8_g;
453 H5_DLLVAR hid_t H5T_NATIVE_UINT8_g;
454 H5_DLLVAR hid_t H5T_NATIVE_INT_LEAST8_g;
455 H5_DLLVAR hid_t H5T_NATIVE_UINT_LEAST8_g;
456 H5_DLLVAR hid_t H5T_NATIVE_INT_FAST8_g;
457 H5_DLLVAR hid_t H5T_NATIVE_UINT_FAST8_g;
458 
459 #define H5T_NATIVE_INT16		(H5OPEN H5T_NATIVE_INT16_g)
460 #define H5T_NATIVE_UINT16		(H5OPEN H5T_NATIVE_UINT16_g)
461 #define H5T_NATIVE_INT_LEAST16		(H5OPEN H5T_NATIVE_INT_LEAST16_g)
462 #define H5T_NATIVE_UINT_LEAST16		(H5OPEN H5T_NATIVE_UINT_LEAST16_g)
463 #define H5T_NATIVE_INT_FAST16		(H5OPEN H5T_NATIVE_INT_FAST16_g)
464 #define H5T_NATIVE_UINT_FAST16		(H5OPEN H5T_NATIVE_UINT_FAST16_g)
465 H5_DLLVAR hid_t H5T_NATIVE_INT16_g;
466 H5_DLLVAR hid_t H5T_NATIVE_UINT16_g;
467 H5_DLLVAR hid_t H5T_NATIVE_INT_LEAST16_g;
468 H5_DLLVAR hid_t H5T_NATIVE_UINT_LEAST16_g;
469 H5_DLLVAR hid_t H5T_NATIVE_INT_FAST16_g;
470 H5_DLLVAR hid_t H5T_NATIVE_UINT_FAST16_g;
471 
472 #define H5T_NATIVE_INT32		(H5OPEN H5T_NATIVE_INT32_g)
473 #define H5T_NATIVE_UINT32		(H5OPEN H5T_NATIVE_UINT32_g)
474 #define H5T_NATIVE_INT_LEAST32		(H5OPEN H5T_NATIVE_INT_LEAST32_g)
475 #define H5T_NATIVE_UINT_LEAST32		(H5OPEN H5T_NATIVE_UINT_LEAST32_g)
476 #define H5T_NATIVE_INT_FAST32		(H5OPEN H5T_NATIVE_INT_FAST32_g)
477 #define H5T_NATIVE_UINT_FAST32		(H5OPEN H5T_NATIVE_UINT_FAST32_g)
478 H5_DLLVAR hid_t H5T_NATIVE_INT32_g;
479 H5_DLLVAR hid_t H5T_NATIVE_UINT32_g;
480 H5_DLLVAR hid_t H5T_NATIVE_INT_LEAST32_g;
481 H5_DLLVAR hid_t H5T_NATIVE_UINT_LEAST32_g;
482 H5_DLLVAR hid_t H5T_NATIVE_INT_FAST32_g;
483 H5_DLLVAR hid_t H5T_NATIVE_UINT_FAST32_g;
484 
485 #define H5T_NATIVE_INT64		(H5OPEN H5T_NATIVE_INT64_g)
486 #define H5T_NATIVE_UINT64		(H5OPEN H5T_NATIVE_UINT64_g)
487 #define H5T_NATIVE_INT_LEAST64		(H5OPEN H5T_NATIVE_INT_LEAST64_g)
488 #define H5T_NATIVE_UINT_LEAST64 	(H5OPEN H5T_NATIVE_UINT_LEAST64_g)
489 #define H5T_NATIVE_INT_FAST64		(H5OPEN H5T_NATIVE_INT_FAST64_g)
490 #define H5T_NATIVE_UINT_FAST64		(H5OPEN H5T_NATIVE_UINT_FAST64_g)
491 H5_DLLVAR hid_t H5T_NATIVE_INT64_g;
492 H5_DLLVAR hid_t H5T_NATIVE_UINT64_g;
493 H5_DLLVAR hid_t H5T_NATIVE_INT_LEAST64_g;
494 H5_DLLVAR hid_t H5T_NATIVE_UINT_LEAST64_g;
495 H5_DLLVAR hid_t H5T_NATIVE_INT_FAST64_g;
496 H5_DLLVAR hid_t H5T_NATIVE_UINT_FAST64_g;
497 
498 /* Operations defined on all datatypes */
499 H5_DLL hid_t H5Tcreate(H5T_class_t type, size_t size);
500 H5_DLL hid_t H5Tcopy(hid_t type_id);
501 H5_DLL herr_t H5Tclose(hid_t type_id);
502 H5_DLL htri_t H5Tequal(hid_t type1_id, hid_t type2_id);
503 H5_DLL herr_t H5Tlock(hid_t type_id);
504 H5_DLL herr_t H5Tcommit2(hid_t loc_id, const char *name, hid_t type_id,
505     hid_t lcpl_id, hid_t tcpl_id, hid_t tapl_id);
506 H5_DLL hid_t H5Topen2(hid_t loc_id, const char *name, hid_t tapl_id);
507 H5_DLL herr_t H5Tcommit_anon(hid_t loc_id, hid_t type_id, hid_t tcpl_id, hid_t tapl_id);
508 H5_DLL hid_t H5Tget_create_plist(hid_t type_id);
509 H5_DLL htri_t H5Tcommitted(hid_t type_id);
510 H5_DLL herr_t H5Tencode(hid_t obj_id, void *buf, size_t *nalloc);
511 H5_DLL hid_t H5Tdecode(const void *buf);
512 
513 /* Operations defined on compound datatypes */
514 H5_DLL herr_t H5Tinsert(hid_t parent_id, const char *name, size_t offset,
515 			 hid_t member_id);
516 H5_DLL herr_t H5Tpack(hid_t type_id);
517 
518 /* Operations defined on enumeration datatypes */
519 H5_DLL hid_t H5Tenum_create(hid_t base_id);
520 H5_DLL herr_t H5Tenum_insert(hid_t type, const char *name, const void *value);
521 H5_DLL herr_t H5Tenum_nameof(hid_t type, const void *value, char *name/*out*/,
522 			     size_t size);
523 H5_DLL herr_t H5Tenum_valueof(hid_t type, const char *name,
524 			      void *value/*out*/);
525 
526 /* Operations defined on variable-length datatypes */
527 H5_DLL hid_t H5Tvlen_create(hid_t base_id);
528 
529 /* Operations defined on array datatypes */
530 H5_DLL hid_t H5Tarray_create2(hid_t base_id, unsigned ndims,
531             const hsize_t dim[/* ndims */]);
532 H5_DLL int H5Tget_array_ndims(hid_t type_id);
533 H5_DLL int H5Tget_array_dims2(hid_t type_id, hsize_t dims[]);
534 
535 /* Operations defined on opaque datatypes */
536 H5_DLL herr_t H5Tset_tag(hid_t type, const char *tag);
537 H5_DLL char *H5Tget_tag(hid_t type);
538 
539 /* Querying property values */
540 H5_DLL hid_t H5Tget_super(hid_t type);
541 H5_DLL H5T_class_t H5Tget_class(hid_t type_id);
542 H5_DLL htri_t H5Tdetect_class(hid_t type_id, H5T_class_t cls);
543 H5_DLL size_t H5Tget_size(hid_t type_id);
544 H5_DLL H5T_order_t H5Tget_order(hid_t type_id);
545 H5_DLL size_t H5Tget_precision(hid_t type_id);
546 H5_DLL int H5Tget_offset(hid_t type_id);
547 H5_DLL herr_t H5Tget_pad(hid_t type_id, H5T_pad_t *lsb/*out*/,
548 			  H5T_pad_t *msb/*out*/);
549 H5_DLL H5T_sign_t H5Tget_sign(hid_t type_id);
550 H5_DLL herr_t H5Tget_fields(hid_t type_id, size_t *spos/*out*/,
551 			     size_t *epos/*out*/, size_t *esize/*out*/,
552 			     size_t *mpos/*out*/, size_t *msize/*out*/);
553 H5_DLL size_t H5Tget_ebias(hid_t type_id);
554 H5_DLL H5T_norm_t H5Tget_norm(hid_t type_id);
555 H5_DLL H5T_pad_t H5Tget_inpad(hid_t type_id);
556 H5_DLL H5T_str_t H5Tget_strpad(hid_t type_id);
557 H5_DLL int H5Tget_nmembers(hid_t type_id);
558 H5_DLL char *H5Tget_member_name(hid_t type_id, unsigned membno);
559 H5_DLL int H5Tget_member_index(hid_t type_id, const char *name);
560 H5_DLL size_t H5Tget_member_offset(hid_t type_id, unsigned membno);
561 H5_DLL H5T_class_t H5Tget_member_class(hid_t type_id, unsigned membno);
562 H5_DLL hid_t H5Tget_member_type(hid_t type_id, unsigned membno);
563 H5_DLL herr_t H5Tget_member_value(hid_t type_id, unsigned membno, void *value/*out*/);
564 H5_DLL H5T_cset_t H5Tget_cset(hid_t type_id);
565 H5_DLL htri_t H5Tis_variable_str(hid_t type_id);
566 H5_DLL hid_t H5Tget_native_type(hid_t type_id, H5T_direction_t direction);
567 
568 /* Setting property values */
569 H5_DLL herr_t H5Tset_size(hid_t type_id, size_t size);
570 H5_DLL herr_t H5Tset_order(hid_t type_id, H5T_order_t order);
571 H5_DLL herr_t H5Tset_precision(hid_t type_id, size_t prec);
572 H5_DLL herr_t H5Tset_offset(hid_t type_id, size_t offset);
573 H5_DLL herr_t H5Tset_pad(hid_t type_id, H5T_pad_t lsb, H5T_pad_t msb);
574 H5_DLL herr_t H5Tset_sign(hid_t type_id, H5T_sign_t sign);
575 H5_DLL herr_t H5Tset_fields(hid_t type_id, size_t spos, size_t epos,
576 			     size_t esize, size_t mpos, size_t msize);
577 H5_DLL herr_t H5Tset_ebias(hid_t type_id, size_t ebias);
578 H5_DLL herr_t H5Tset_norm(hid_t type_id, H5T_norm_t norm);
579 H5_DLL herr_t H5Tset_inpad(hid_t type_id, H5T_pad_t pad);
580 H5_DLL herr_t H5Tset_cset(hid_t type_id, H5T_cset_t cset);
581 H5_DLL herr_t H5Tset_strpad(hid_t type_id, H5T_str_t strpad);
582 
583 /* Type conversion database */
584 H5_DLL herr_t H5Tregister(H5T_pers_t pers, const char *name, hid_t src_id,
585 			   hid_t dst_id, H5T_conv_t func);
586 H5_DLL herr_t H5Tunregister(H5T_pers_t pers, const char *name, hid_t src_id,
587 			     hid_t dst_id, H5T_conv_t func);
588 H5_DLL H5T_conv_t H5Tfind(hid_t src_id, hid_t dst_id, H5T_cdata_t **pcdata);
589 H5_DLL htri_t H5Tcompiler_conv(hid_t src_id, hid_t dst_id);
590 H5_DLL herr_t H5Tconvert(hid_t src_id, hid_t dst_id, size_t nelmts,
591 			  void *buf, void *background, hid_t plist_id);
592 
593 /* Symbols defined for compatibility with previous versions of the HDF5 API.
594  *
595  * Use of these symbols is deprecated.
596  */
597 #ifndef H5_NO_DEPRECATED_SYMBOLS
598 
599 /* Macros */
600 
601 
602 /* Typedefs */
603 
604 
605 /* Function prototypes */
606 H5_DLL herr_t H5Tcommit1(hid_t loc_id, const char *name, hid_t type_id);
607 H5_DLL hid_t H5Topen1(hid_t loc_id, const char *name);
608 H5_DLL hid_t H5Tarray_create1(hid_t base_id, int ndims,
609             const hsize_t dim[/* ndims */],
610             const int perm[/* ndims */]);
611 H5_DLL int H5Tget_array_dims1(hid_t type_id, hsize_t dims[], int perm[]);
612 
613 #endif /* H5_NO_DEPRECATED_SYMBOLS */
614 
615 #ifdef __cplusplus
616 }
617 #endif
618 #endif /* _H5Tpublic_H */
619 
620