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