-
-
Notifications
You must be signed in to change notification settings - Fork 265
/
H5T.c
6290 lines (5468 loc) · 253 KB
/
H5T.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
* If you do not have access to either file, you may request a copy from *
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
* Module Info: This module contains most of the "core" functionality of
* the H5T interface, including the API initialization code, etc.
* Many routines that are infrequently used, or are specialized for
* one particular datatype class are in another module.
*/
/****************/
/* Module Setup */
/****************/
#include "H5Tmodule.h" /* This source code file is part of the H5T module */
/***********/
/* Headers */
/***********/
#include "H5private.h" /* Generic Functions */
#include "H5ACprivate.h" /* Metadata cache */
#include "H5CXprivate.h" /* API Contexts */
#include "H5Dprivate.h" /* Datasets */
#include "H5Eprivate.h" /* Error handling */
#include "H5Fprivate.h" /* Files */
#include "H5FLprivate.h" /* Free Lists */
#include "H5FOprivate.h" /* File objects */
#include "H5Gprivate.h" /* Groups */
#include "H5Iprivate.h" /* IDs */
#include "H5MMprivate.h" /* Memory management */
#include "H5Pprivate.h" /* Property lists */
#include "H5Tpkg.h" /* Datatypes */
#include "H5VLprivate.h" /* Virtual Object Layer */
/****************/
/* Local Macros */
/****************/
#define H5T_ENCODE_VERSION 0
/*
* Type initialization macros
*
* These use the "template macro" technique to reduce the amount of gratuitous
* duplicated code when initializing the datatypes for the library. The main
* template macro is the H5T_INIT_TYPE() macro below.
*
*/
/* Define the code template for bitfields for the "GUTS" in the H5T_INIT_TYPE macro */
#define H5T_INIT_TYPE_BITFIELD_CORE \
{ \
dt->shared->type = H5T_BITFIELD; \
}
#define H5T_INIT_TYPE_BITFIELD_COMMON(ENDIANNESS) \
{ \
H5T_INIT_TYPE_NUM_COMMON(ENDIANNESS) \
H5T_INIT_TYPE_BITFIELD_CORE; \
}
#define H5T_INIT_TYPE_BITFIELDLE_CORE \
{ \
H5T_INIT_TYPE_BITFIELD_COMMON(H5T_ORDER_LE) \
}
#define H5T_INIT_TYPE_BITFIELDBE_CORE \
{ \
H5T_INIT_TYPE_BITFIELD_COMMON(H5T_ORDER_BE) \
}
/* Define the code template for times for the "GUTS" in the H5T_INIT_TYPE macro */
#define H5T_INIT_TYPE_TIME_CORE \
{ \
dt->shared->type = H5T_TIME; \
}
/* Define the code template for types which reset the offset for the "GUTS" in the H5T_INIT_TYPE macro */
#define H5T_INIT_TYPE_OFFSET_CORE \
{ \
dt->shared->u.atomic.offset = 0; \
}
/* Define common code for all numeric types (floating-point & int, signed & unsigned) */
#define H5T_INIT_TYPE_NUM_COMMON(ENDIANNESS) \
{ \
dt->shared->u.atomic.order = ENDIANNESS; \
dt->shared->u.atomic.offset = 0; \
dt->shared->u.atomic.lsb_pad = H5T_PAD_ZERO; \
dt->shared->u.atomic.msb_pad = H5T_PAD_ZERO; \
}
/* Define the code templates for standard floats for the "GUTS" in the H5T_INIT_TYPE macro */
#define H5T_INIT_TYPE_FLOAT_COMMON(ENDIANNESS) \
{ \
H5T_INIT_TYPE_NUM_COMMON(ENDIANNESS) \
dt->shared->u.atomic.u.f.sign = 31; \
dt->shared->u.atomic.u.f.epos = 23; \
dt->shared->u.atomic.u.f.esize = 8; \
dt->shared->u.atomic.u.f.ebias = 0x7f; \
dt->shared->u.atomic.u.f.mpos = 0; \
dt->shared->u.atomic.u.f.msize = 23; \
dt->shared->u.atomic.u.f.norm = H5T_NORM_IMPLIED; \
dt->shared->u.atomic.u.f.pad = H5T_PAD_ZERO; \
}
#define H5T_INIT_TYPE_FLOATLE_CORE \
{ \
H5T_INIT_TYPE_FLOAT_COMMON(H5T_ORDER_LE) \
}
#define H5T_INIT_TYPE_FLOATBE_CORE \
{ \
H5T_INIT_TYPE_FLOAT_COMMON(H5T_ORDER_BE) \
}
/* Define the code templates for standard doubles for the "GUTS" in the H5T_INIT_TYPE macro */
#define H5T_INIT_TYPE_DOUBLE_COMMON(ENDIANNESS) \
{ \
H5T_INIT_TYPE_NUM_COMMON(ENDIANNESS) \
dt->shared->u.atomic.u.f.sign = 63; \
dt->shared->u.atomic.u.f.epos = 52; \
dt->shared->u.atomic.u.f.esize = 11; \
dt->shared->u.atomic.u.f.ebias = 0x03ff; \
dt->shared->u.atomic.u.f.mpos = 0; \
dt->shared->u.atomic.u.f.msize = 52; \
dt->shared->u.atomic.u.f.norm = H5T_NORM_IMPLIED; \
dt->shared->u.atomic.u.f.pad = H5T_PAD_ZERO; \
}
#define H5T_INIT_TYPE_DOUBLELE_CORE \
{ \
H5T_INIT_TYPE_DOUBLE_COMMON(H5T_ORDER_LE) \
}
#define H5T_INIT_TYPE_DOUBLEBE_CORE \
{ \
H5T_INIT_TYPE_DOUBLE_COMMON(H5T_ORDER_BE) \
}
/* Define the code templates for VAX float for the "GUTS" in the H5T_INIT_TYPE macro */
#define H5T_INIT_TYPE_FLOATVAX_CORE \
{ \
H5T_INIT_TYPE_NUM_COMMON(H5T_ORDER_VAX) \
dt->shared->u.atomic.u.f.sign = 31; \
dt->shared->u.atomic.u.f.epos = 23; \
dt->shared->u.atomic.u.f.esize = 8; \
dt->shared->u.atomic.u.f.ebias = 0x81; \
dt->shared->u.atomic.u.f.mpos = 0; \
dt->shared->u.atomic.u.f.msize = 23; \
dt->shared->u.atomic.u.f.norm = H5T_NORM_IMPLIED; \
dt->shared->u.atomic.u.f.pad = H5T_PAD_ZERO; \
dt->shared->version = H5O_DTYPE_VERSION_3; \
}
/* Define the code templates for VAX double for the "GUTS" in the H5T_INIT_TYPE macro */
#define H5T_INIT_TYPE_DOUBLEVAX_CORE \
{ \
H5T_INIT_TYPE_NUM_COMMON(H5T_ORDER_VAX) \
dt->shared->u.atomic.u.f.sign = 63; \
dt->shared->u.atomic.u.f.epos = 52; \
dt->shared->u.atomic.u.f.esize = 11; \
dt->shared->u.atomic.u.f.ebias = 0x0401; \
dt->shared->u.atomic.u.f.mpos = 0; \
dt->shared->u.atomic.u.f.msize = 52; \
dt->shared->u.atomic.u.f.norm = H5T_NORM_IMPLIED; \
dt->shared->u.atomic.u.f.pad = H5T_PAD_ZERO; \
dt->shared->version = H5O_DTYPE_VERSION_3; \
}
/* Define the code templates for standard signed integers for the "GUTS" in the H5T_INIT_TYPE macro */
#define H5T_INIT_TYPE_SINT_COMMON(ENDIANNESS) \
{ \
H5T_INIT_TYPE_NUM_COMMON(ENDIANNESS) \
dt->shared->u.atomic.u.i.sign = H5T_SGN_2; \
}
#define H5T_INIT_TYPE_SINTLE_CORE \
{ \
H5T_INIT_TYPE_SINT_COMMON(H5T_ORDER_LE) \
}
#define H5T_INIT_TYPE_SINTBE_CORE \
{ \
H5T_INIT_TYPE_SINT_COMMON(H5T_ORDER_BE) \
}
/* Define the code templates for standard unsigned integers for the "GUTS" in the H5T_INIT_TYPE macro */
#define H5T_INIT_TYPE_UINT_COMMON(ENDIANNESS) \
{ \
H5T_INIT_TYPE_NUM_COMMON(ENDIANNESS) \
dt->shared->u.atomic.u.i.sign = H5T_SGN_NONE; \
}
#define H5T_INIT_TYPE_UINTLE_CORE \
{ \
H5T_INIT_TYPE_UINT_COMMON(H5T_ORDER_LE) \
}
#define H5T_INIT_TYPE_UINTBE_CORE \
{ \
H5T_INIT_TYPE_UINT_COMMON(H5T_ORDER_BE) \
}
/* Define a macro for common code for all newly allocate datatypes */
#define H5T_INIT_TYPE_ALLOC_COMMON(TYPE) \
{ \
dt->sh_loc.type = H5O_SHARE_TYPE_UNSHARED; \
dt->shared->type = TYPE; \
}
/* Define the code templates for opaque for the "GUTS" in the H5T_INIT_TYPE macro */
#define H5T_INIT_TYPE_OPAQ_CORE \
{ \
H5T_INIT_TYPE_ALLOC_COMMON(H5T_OPAQUE) \
dt->shared->u.opaque.tag = H5MM_xstrdup(""); \
}
/* Define the code templates for strings for the "GUTS" in the H5T_INIT_TYPE macro */
#define H5T_INIT_TYPE_STRING_COMMON \
{ \
H5T_INIT_TYPE_ALLOC_COMMON(H5T_STRING) \
H5T_INIT_TYPE_NUM_COMMON(H5T_ORDER_NONE) \
dt->shared->u.atomic.u.s.cset = H5F_DEFAULT_CSET; \
}
#define H5T_INIT_TYPE_CSTRING_CORE \
{ \
H5T_INIT_TYPE_STRING_COMMON \
dt->shared->u.atomic.u.s.pad = H5T_STR_NULLTERM; \
}
#define H5T_INIT_TYPE_FORSTRING_CORE \
{ \
H5T_INIT_TYPE_STRING_COMMON \
dt->shared->u.atomic.u.s.pad = H5T_STR_SPACEPAD; \
}
/* Define the code templates for references for the "GUTS" in the H5T_INIT_TYPE macro */
#define H5T_INIT_TYPE_REF_COMMON \
{ \
H5T_INIT_TYPE_ALLOC_COMMON(H5T_REFERENCE) \
H5T_INIT_TYPE_NUM_COMMON(H5T_ORDER_NONE) \
dt->shared->force_conv = TRUE; \
dt->shared->u.atomic.u.r.file = NULL; \
dt->shared->u.atomic.u.r.loc = H5T_LOC_BADLOC; \
dt->shared->u.atomic.u.r.cls = NULL; \
}
#define H5T_INIT_TYPE_OBJREF_CORE \
{ \
H5T_INIT_TYPE_REF_COMMON \
dt->shared->u.atomic.u.r.rtype = H5R_OBJECT1; \
dt->shared->u.atomic.u.r.opaque = FALSE; \
dt->shared->u.atomic.u.r.version = 0; \
}
#define H5T_INIT_TYPE_REGREF_CORE \
{ \
H5T_INIT_TYPE_REF_COMMON \
dt->shared->u.atomic.u.r.rtype = H5R_DATASET_REGION1; \
dt->shared->u.atomic.u.r.opaque = FALSE; \
dt->shared->u.atomic.u.r.version = 0; \
}
/* rtype value is only used as a placeholder to differentiate the type from
* other types, any opaque (i.e. "new") reference type could be used.
*/
#define H5T_INIT_TYPE_REF_CORE \
{ \
H5T_INIT_TYPE_REF_COMMON \
dt->shared->u.atomic.u.r.rtype = H5R_OBJECT2; \
dt->shared->u.atomic.u.r.opaque = TRUE; \
dt->shared->u.atomic.u.r.version = H5R_ENCODE_VERSION; \
dt->shared->version = H5O_DTYPE_VERSION_4; \
}
/* Define the code templates for the "SIZE_TMPL" in the H5T_INIT_TYPE macro */
#define H5T_INIT_TYPE_SET_SIZE(SIZE) \
{ \
dt->shared->size = SIZE; \
dt->shared->u.atomic.prec = 8 * SIZE; \
}
#define H5T_INIT_TYPE_NOSET_SIZE(SIZE) \
{ \
}
/* Define the code templates for the "CRT_TMPL" in the H5T_INIT_TYPE macro */
#define H5T_INIT_TYPE_COPY_CREATE(BASE) \
{ \
/* Base off of existing datatype */ \
if (NULL == (dt = H5T_copy(BASE, H5T_COPY_TRANSIENT))) \
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, FAIL, "duplicating base type failed") \
}
#define H5T_INIT_TYPE_ALLOC_CREATE(BASE) \
{ \
/* Allocate new datatype info */ \
if (NULL == (dt = H5T__alloc())) \
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTALLOC, FAIL, "memory allocation failed") \
}
#define H5T_INIT_TYPE(GUTS, GLOBAL, CRT_TMPL, BASE, SIZE_TMPL, SIZE) \
{ \
/* Get new datatype struct */ \
H5_GLUE3(H5T_INIT_TYPE_, CRT_TMPL, _CREATE) \
(BASE) \
\
/* Adjust information for all types */ \
dt->shared->state = H5T_STATE_IMMUTABLE; \
H5_GLUE3(H5T_INIT_TYPE_, SIZE_TMPL, _SIZE) \
(SIZE) \
\
/* Adjust information for this type */ \
H5_GLUE3(H5T_INIT_TYPE_, GUTS, _CORE) \
\
/* Atomize result */ \
if ((GLOBAL = H5I_register(H5I_DATATYPE, dt, FALSE)) < 0) \
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register datatype atom") \
}
/******************/
/* Local Typedefs */
/******************/
/* Typedef for recursive const-correct datatype copying routines */
typedef H5T_t *(*H5T_copy_func_t)(H5T_t *old_dt);
/********************/
/* Local Prototypes */
/********************/
static herr_t H5T__register_int(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst,
H5T_lib_conv_t func);
static herr_t H5T__register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, H5T_conv_func_t *conv);
static herr_t H5T__unregister(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, H5T_conv_t func);
static htri_t H5T__compiler_conv(H5T_t *src, H5T_t *dst);
static herr_t H5T__set_size(H5T_t *dt, size_t size);
static herr_t H5T__close_cb(H5T_t *dt);
static H5T_path_t *H5T__path_find_real(const H5T_t *src, const H5T_t *dst, const char *name,
H5T_conv_func_t *conv);
static hbool_t H5T__detect_vlen_ref(const H5T_t *dt);
static H5T_t * H5T__initiate_copy(const H5T_t *old_dt);
static H5T_t * H5T__copy_transient(H5T_t *old_dt);
static H5T_t * H5T__copy_all(H5T_t *old_dt);
static herr_t H5T__complete_copy(H5T_t *new_dt, const H5T_t *old_dt, H5T_shared_t *reopened_fo,
hbool_t set_memory_type, H5T_copy_func_t copyfn);
/*****************************/
/* Library Private Variables */
/*****************************/
/* The native endianness of the platform */
H5T_order_t H5T_native_order_g = H5T_ORDER_ERROR;
/*********************/
/* Package Variables */
/*********************/
/* Package initialization variable */
hbool_t H5_PKG_INIT_VAR = FALSE;
/*
* Predefined data types. These are initialized at runtime in H5Tinit.c and
* by H5T__init_package() in this source file.
*
* If more of these are added, the new ones must be added to the list of
* types to reset in H5T_term_package().
*/
hid_t H5T_IEEE_F32BE_g = FAIL;
hid_t H5T_IEEE_F32LE_g = FAIL;
hid_t H5T_IEEE_F64BE_g = FAIL;
hid_t H5T_IEEE_F64LE_g = FAIL;
hid_t H5T_VAX_F32_g = FAIL;
hid_t H5T_VAX_F64_g = FAIL;
hid_t H5T_STD_I8BE_g = FAIL;
hid_t H5T_STD_I8LE_g = FAIL;
hid_t H5T_STD_I16BE_g = FAIL;
hid_t H5T_STD_I16LE_g = FAIL;
hid_t H5T_STD_I32BE_g = FAIL;
hid_t H5T_STD_I32LE_g = FAIL;
hid_t H5T_STD_I64BE_g = FAIL;
hid_t H5T_STD_I64LE_g = FAIL;
hid_t H5T_STD_U8BE_g = FAIL;
hid_t H5T_STD_U8LE_g = FAIL;
hid_t H5T_STD_U16BE_g = FAIL;
hid_t H5T_STD_U16LE_g = FAIL;
hid_t H5T_STD_U32BE_g = FAIL;
hid_t H5T_STD_U32LE_g = FAIL;
hid_t H5T_STD_U64BE_g = FAIL;
hid_t H5T_STD_U64LE_g = FAIL;
hid_t H5T_STD_B8BE_g = FAIL;
hid_t H5T_STD_B8LE_g = FAIL;
hid_t H5T_STD_B16BE_g = FAIL;
hid_t H5T_STD_B16LE_g = FAIL;
hid_t H5T_STD_B32BE_g = FAIL;
hid_t H5T_STD_B32LE_g = FAIL;
hid_t H5T_STD_B64BE_g = FAIL;
hid_t H5T_STD_B64LE_g = FAIL;
hid_t H5T_STD_REF_OBJ_g = FAIL;
hid_t H5T_STD_REF_DSETREG_g = FAIL;
hid_t H5T_STD_REF_g = FAIL;
hid_t H5T_UNIX_D32BE_g = FAIL;
hid_t H5T_UNIX_D32LE_g = FAIL;
hid_t H5T_UNIX_D64BE_g = FAIL;
hid_t H5T_UNIX_D64LE_g = FAIL;
hid_t H5T_C_S1_g = FAIL;
hid_t H5T_FORTRAN_S1_g = FAIL;
hid_t H5T_NATIVE_SCHAR_g = FAIL;
hid_t H5T_NATIVE_UCHAR_g = FAIL;
hid_t H5T_NATIVE_SHORT_g = FAIL;
hid_t H5T_NATIVE_USHORT_g = FAIL;
hid_t H5T_NATIVE_INT_g = FAIL;
hid_t H5T_NATIVE_UINT_g = FAIL;
hid_t H5T_NATIVE_LONG_g = FAIL;
hid_t H5T_NATIVE_ULONG_g = FAIL;
hid_t H5T_NATIVE_LLONG_g = FAIL;
hid_t H5T_NATIVE_ULLONG_g = FAIL;
hid_t H5T_NATIVE_FLOAT_g = FAIL;
hid_t H5T_NATIVE_DOUBLE_g = FAIL;
#if H5_SIZEOF_LONG_DOUBLE != 0
hid_t H5T_NATIVE_LDOUBLE_g = FAIL;
#endif
hid_t H5T_NATIVE_B8_g = FAIL;
hid_t H5T_NATIVE_B16_g = FAIL;
hid_t H5T_NATIVE_B32_g = FAIL;
hid_t H5T_NATIVE_B64_g = FAIL;
hid_t H5T_NATIVE_OPAQUE_g = FAIL;
hid_t H5T_NATIVE_HADDR_g = FAIL;
hid_t H5T_NATIVE_HSIZE_g = FAIL;
hid_t H5T_NATIVE_HSSIZE_g = FAIL;
hid_t H5T_NATIVE_HERR_g = FAIL;
hid_t H5T_NATIVE_HBOOL_g = FAIL;
hid_t H5T_NATIVE_INT8_g = FAIL;
hid_t H5T_NATIVE_UINT8_g = FAIL;
hid_t H5T_NATIVE_INT_LEAST8_g = FAIL;
hid_t H5T_NATIVE_UINT_LEAST8_g = FAIL;
hid_t H5T_NATIVE_INT_FAST8_g = FAIL;
hid_t H5T_NATIVE_UINT_FAST8_g = FAIL;
hid_t H5T_NATIVE_INT16_g = FAIL;
hid_t H5T_NATIVE_UINT16_g = FAIL;
hid_t H5T_NATIVE_INT_LEAST16_g = FAIL;
hid_t H5T_NATIVE_UINT_LEAST16_g = FAIL;
hid_t H5T_NATIVE_INT_FAST16_g = FAIL;
hid_t H5T_NATIVE_UINT_FAST16_g = FAIL;
hid_t H5T_NATIVE_INT32_g = FAIL;
hid_t H5T_NATIVE_UINT32_g = FAIL;
hid_t H5T_NATIVE_INT_LEAST32_g = FAIL;
hid_t H5T_NATIVE_UINT_LEAST32_g = FAIL;
hid_t H5T_NATIVE_INT_FAST32_g = FAIL;
hid_t H5T_NATIVE_UINT_FAST32_g = FAIL;
hid_t H5T_NATIVE_INT64_g = FAIL;
hid_t H5T_NATIVE_UINT64_g = FAIL;
hid_t H5T_NATIVE_INT_LEAST64_g = FAIL;
hid_t H5T_NATIVE_UINT_LEAST64_g = FAIL;
hid_t H5T_NATIVE_INT_FAST64_g = FAIL;
hid_t H5T_NATIVE_UINT_FAST64_g = FAIL;
/*
* Alignment constraints for native types. These are initialized at run time
* in H5Tinit.c. These alignments are mainly for offsets in HDF5 compound
* datatype or C structures, which are different from the alignments for memory
* address below this group of variables.
*/
size_t H5T_NATIVE_SCHAR_COMP_ALIGN_g = 0;
size_t H5T_NATIVE_UCHAR_COMP_ALIGN_g = 0;
size_t H5T_NATIVE_SHORT_COMP_ALIGN_g = 0;
size_t H5T_NATIVE_USHORT_COMP_ALIGN_g = 0;
size_t H5T_NATIVE_INT_COMP_ALIGN_g = 0;
size_t H5T_NATIVE_UINT_COMP_ALIGN_g = 0;
size_t H5T_NATIVE_LONG_COMP_ALIGN_g = 0;
size_t H5T_NATIVE_ULONG_COMP_ALIGN_g = 0;
size_t H5T_NATIVE_LLONG_COMP_ALIGN_g = 0;
size_t H5T_NATIVE_ULLONG_COMP_ALIGN_g = 0;
size_t H5T_NATIVE_FLOAT_COMP_ALIGN_g = 0;
size_t H5T_NATIVE_DOUBLE_COMP_ALIGN_g = 0;
#if H5_SIZEOF_LONG_DOUBLE != 0
size_t H5T_NATIVE_LDOUBLE_COMP_ALIGN_g = 0;
#endif
size_t H5T_POINTER_COMP_ALIGN_g = 0;
size_t H5T_HVL_COMP_ALIGN_g = 0;
size_t H5T_HOBJREF_COMP_ALIGN_g = 0;
size_t H5T_HDSETREGREF_COMP_ALIGN_g = 0;
size_t H5T_REF_COMP_ALIGN_g = 0;
/*
* Alignment constraints for native types. These are initialized at run time
* in H5Tinit.c
*/
size_t H5T_NATIVE_SCHAR_ALIGN_g = 0;
size_t H5T_NATIVE_UCHAR_ALIGN_g = 0;
size_t H5T_NATIVE_SHORT_ALIGN_g = 0;
size_t H5T_NATIVE_USHORT_ALIGN_g = 0;
size_t H5T_NATIVE_INT_ALIGN_g = 0;
size_t H5T_NATIVE_UINT_ALIGN_g = 0;
size_t H5T_NATIVE_LONG_ALIGN_g = 0;
size_t H5T_NATIVE_ULONG_ALIGN_g = 0;
size_t H5T_NATIVE_LLONG_ALIGN_g = 0;
size_t H5T_NATIVE_ULLONG_ALIGN_g = 0;
size_t H5T_NATIVE_FLOAT_ALIGN_g = 0;
size_t H5T_NATIVE_DOUBLE_ALIGN_g = 0;
#if H5_SIZEOF_LONG_DOUBLE != 0
size_t H5T_NATIVE_LDOUBLE_ALIGN_g = 0;
#endif
/*
* Alignment constraints for C9x types. These are initialized at run time in
* H5Tinit.c if the types are provided by the system. Otherwise we set their
* values to 0 here (no alignment calculated).
*/
size_t H5T_NATIVE_INT8_ALIGN_g = 0;
size_t H5T_NATIVE_UINT8_ALIGN_g = 0;
size_t H5T_NATIVE_INT_LEAST8_ALIGN_g = 0;
size_t H5T_NATIVE_UINT_LEAST8_ALIGN_g = 0;
size_t H5T_NATIVE_INT_FAST8_ALIGN_g = 0;
size_t H5T_NATIVE_UINT_FAST8_ALIGN_g = 0;
size_t H5T_NATIVE_INT16_ALIGN_g = 0;
size_t H5T_NATIVE_UINT16_ALIGN_g = 0;
size_t H5T_NATIVE_INT_LEAST16_ALIGN_g = 0;
size_t H5T_NATIVE_UINT_LEAST16_ALIGN_g = 0;
size_t H5T_NATIVE_INT_FAST16_ALIGN_g = 0;
size_t H5T_NATIVE_UINT_FAST16_ALIGN_g = 0;
size_t H5T_NATIVE_INT32_ALIGN_g = 0;
size_t H5T_NATIVE_UINT32_ALIGN_g = 0;
size_t H5T_NATIVE_INT_LEAST32_ALIGN_g = 0;
size_t H5T_NATIVE_UINT_LEAST32_ALIGN_g = 0;
size_t H5T_NATIVE_INT_FAST32_ALIGN_g = 0;
size_t H5T_NATIVE_UINT_FAST32_ALIGN_g = 0;
size_t H5T_NATIVE_INT64_ALIGN_g = 0;
size_t H5T_NATIVE_UINT64_ALIGN_g = 0;
size_t H5T_NATIVE_INT_LEAST64_ALIGN_g = 0;
size_t H5T_NATIVE_UINT_LEAST64_ALIGN_g = 0;
size_t H5T_NATIVE_INT_FAST64_ALIGN_g = 0;
size_t H5T_NATIVE_UINT_FAST64_ALIGN_g = 0;
/* Useful floating-point values for conversion routines */
/* (+/- Inf for all floating-point types) */
float H5T_NATIVE_FLOAT_POS_INF_g = 0.0f;
float H5T_NATIVE_FLOAT_NEG_INF_g = 0.0f;
double H5T_NATIVE_DOUBLE_POS_INF_g = (double)0.0f;
double H5T_NATIVE_DOUBLE_NEG_INF_g = (double)0.0f;
/* Declare the free list for H5T_t's and H5T_shared_t's */
H5FL_DEFINE(H5T_t);
H5FL_DEFINE(H5T_shared_t);
/* Format version bounds for datatype */
const unsigned H5O_dtype_ver_bounds[] = {
H5O_DTYPE_VERSION_1, /* H5F_LIBVER_EARLIEST */
H5O_DTYPE_VERSION_3, /* H5F_LIBVER_V18 */
H5O_DTYPE_VERSION_3, /* H5F_LIBVER_V110 */
H5O_DTYPE_VERSION_LATEST /* H5F_LIBVER_LATEST */
};
/*******************/
/* Local Variables */
/*******************/
/*
* The path database. Each path has a source and destination data type pair
* which is used as the key by which the `entries' array is sorted.
*/
static struct {
int npaths; /*number of paths defined */
size_t apaths; /*number of paths allocated */
H5T_path_t **path; /*sorted array of path pointers */
int nsoft; /*number of soft conversions defined */
size_t asoft; /*number of soft conversions allocated */
H5T_soft_t * soft; /*unsorted array of soft conversions */
} H5T_g;
/* Declare the free list for H5T_path_t's */
H5FL_DEFINE_STATIC(H5T_path_t);
/* Datatype ID class */
static const H5I_class_t H5I_DATATYPE_CLS[1] = {{
H5I_DATATYPE, /* ID class value */
0, /* Class flags */
8, /* # of reserved IDs for class */
(H5I_free_t)H5T__close_cb /* Callback routine for closing objects of this class */
}};
/* Flag indicating "top" of interface has been initialized */
static hbool_t H5T_top_package_initialize_s = FALSE;
/*-------------------------------------------------------------------------
* Function: H5T_init
*
* Purpose: Initialize the interface from some other package.
*
* Return: Success: non-negative
* Failure: negative
*
* Programmer: Robb Matzke
* Wednesday, December 16, 1998
*
*-------------------------------------------------------------------------
*/
herr_t
H5T_init(void)
{
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* FUNC_ENTER() does all the work */
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T_init() */
/*-------------------------------------------------------------------------
* Function: H5T__init_inf
*
* Purpose: Initialize the +/- Infinity floating-poing values for type
* conversion.
*
* Return: Success: non-negative
* Failure: negative
*
* Programmer: Quincey Koziol
* Saturday, November 22, 2003
*
*-------------------------------------------------------------------------
*/
static herr_t
H5T__init_inf(void)
{
H5T_t * dst_p; /* Datatype type operate on */
H5T_atomic_t *dst; /* Datatype's atomic info */
uint8_t * d; /* Pointer to value to set */
size_t half_size; /* Half the type size */
size_t u; /* Local index value */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
/* Get the float datatype */
if (NULL == (dst_p = (H5T_t *)H5I_object(H5T_NATIVE_FLOAT_g)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype")
dst = &dst_p->shared->u.atomic;
/* Check that we can re-order the bytes correctly */
if (H5T_ORDER_LE != H5T_native_order_g && H5T_ORDER_BE != H5T_native_order_g)
HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "unsupported byte order")
/* +Inf */
d = (uint8_t *)&H5T_NATIVE_FLOAT_POS_INF_g;
H5T__bit_set(d, dst->u.f.sign, (size_t)1, FALSE);
H5T__bit_set(d, dst->u.f.epos, dst->u.f.esize, TRUE);
H5T__bit_set(d, dst->u.f.mpos, dst->u.f.msize, FALSE);
/* Swap the bytes if the machine architecture is big-endian */
if (H5T_ORDER_BE == H5T_native_order_g) {
half_size = dst_p->shared->size / 2;
for (u = 0; u < half_size; u++) {
uint8_t tmp = d[dst_p->shared->size - (u + 1)];
d[dst_p->shared->size - (u + 1)] = d[u];
d[u] = tmp;
} /* end for */
} /* end if */
/* -Inf */
d = (uint8_t *)&H5T_NATIVE_FLOAT_NEG_INF_g;
H5T__bit_set(d, dst->u.f.sign, (size_t)1, TRUE);
H5T__bit_set(d, dst->u.f.epos, dst->u.f.esize, TRUE);
H5T__bit_set(d, dst->u.f.mpos, dst->u.f.msize, FALSE);
/* Swap the bytes if the machine architecture is big-endian */
if (H5T_ORDER_BE == H5T_native_order_g) {
half_size = dst_p->shared->size / 2;
for (u = 0; u < half_size; u++) {
uint8_t tmp = d[dst_p->shared->size - (u + 1)];
d[dst_p->shared->size - (u + 1)] = d[u];
d[u] = tmp;
} /* end for */
} /* end if */
/* Get the double datatype */
if (NULL == (dst_p = (H5T_t *)H5I_object(H5T_NATIVE_DOUBLE_g)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype")
dst = &dst_p->shared->u.atomic;
/* Check that we can re-order the bytes correctly */
if (H5T_ORDER_LE != H5T_native_order_g && H5T_ORDER_BE != H5T_native_order_g)
HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "unsupported byte order")
/* +Inf */
d = (uint8_t *)&H5T_NATIVE_DOUBLE_POS_INF_g;
H5T__bit_set(d, dst->u.f.sign, (size_t)1, FALSE);
H5T__bit_set(d, dst->u.f.epos, dst->u.f.esize, TRUE);
H5T__bit_set(d, dst->u.f.mpos, dst->u.f.msize, FALSE);
/* Swap the bytes if the machine architecture is big-endian */
if (H5T_ORDER_BE == H5T_native_order_g) {
half_size = dst_p->shared->size / 2;
for (u = 0; u < half_size; u++) {
uint8_t tmp = d[dst_p->shared->size - (u + 1)];
d[dst_p->shared->size - (u + 1)] = d[u];
d[u] = tmp;
} /* end for */
} /* end if */
/* -Inf */
d = (uint8_t *)&H5T_NATIVE_DOUBLE_NEG_INF_g;
H5T__bit_set(d, dst->u.f.sign, (size_t)1, TRUE);
H5T__bit_set(d, dst->u.f.epos, dst->u.f.esize, TRUE);
H5T__bit_set(d, dst->u.f.mpos, dst->u.f.msize, FALSE);
/* Swap the bytes if the machine architecture is big-endian */
if (H5T_ORDER_BE == H5T_native_order_g) {
half_size = dst_p->shared->size / 2;
for (u = 0; u < half_size; u++) {
uint8_t tmp = d[dst_p->shared->size - (u + 1)];
d[dst_p->shared->size - (u + 1)] = d[u];
d[u] = tmp;
} /* end for */
} /* end if */
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T__init_inf() */
/*--------------------------------------------------------------------------
NAME
H5T__init_package -- Initialize interface-specific information
USAGE
herr__t H5T_init_package()
RETURNS
Non-negative on success/Negative on failure
DESCRIPTION
Initializes any interface-specific data or routines.
--------------------------------------------------------------------------*/
herr_t
H5T__init_package(void)
{
H5T_t *native_schar = NULL; /* Datatype structure for native signed char */
H5T_t *native_uchar = NULL; /* Datatype structure for native unsigned char */
H5T_t *native_short = NULL; /* Datatype structure for native short */
H5T_t *native_ushort = NULL; /* Datatype structure for native unsigned short */
H5T_t *native_int = NULL; /* Datatype structure for native int */
H5T_t *native_uint = NULL; /* Datatype structure for native unsigned int */
H5T_t *native_long = NULL; /* Datatype structure for native long */
H5T_t *native_ulong = NULL; /* Datatype structure for native unsigned long */
H5T_t *native_llong = NULL; /* Datatype structure for native long long */
H5T_t *native_ullong = NULL; /* Datatype structure for native unsigned long long */
H5T_t *native_float = NULL; /* Datatype structure for native float */
H5T_t *native_double = NULL; /* Datatype structure for native double */
#if H5_SIZEOF_LONG_DOUBLE != 0
H5T_t *native_ldouble = NULL; /* Datatype structure for native long double */
#endif
H5T_t * std_u8le = NULL; /* Datatype structure for unsigned 8-bit little-endian integer */
H5T_t * std_u8be = NULL; /* Datatype structure for unsigned 8-bit big-endian integer */
H5T_t * std_u16le = NULL; /* Datatype structure for unsigned 16-bit little-endian integer */
H5T_t * std_u16be = NULL; /* Datatype structure for unsigned 16-bit big-endian integer */
H5T_t * std_u32le = NULL; /* Datatype structure for unsigned 32-bit little-endian integer */
H5T_t * std_u32be = NULL; /* Datatype structure for unsigned 32-bit big-endian integer */
H5T_t * std_u64le = NULL; /* Datatype structure for unsigned 64-bit little-endian integer */
H5T_t * std_u64be = NULL; /* Datatype structure for unsigned 64-bit big-endian integer */
H5T_t * dt = NULL;
H5T_t * fixedpt = NULL; /* Datatype structure for native int */
H5T_t * floatpt = NULL; /* Datatype structure for native float */
H5T_t * string = NULL; /* Datatype structure for C string */
H5T_t * bitfield = NULL; /* Datatype structure for bitfield */
H5T_t * compound = NULL; /* Datatype structure for compound objects */
H5T_t * enum_type = NULL; /* Datatype structure for enum objects */
H5T_t * vlen = NULL; /* Datatype structure for vlen objects */
H5T_t * array = NULL; /* Datatype structure for array objects */
H5T_t * objref = NULL; /* Datatype structure for deprecated reference objects */
H5T_t * regref = NULL; /* Datatype structure for deprecated region references */
H5T_t * ref = NULL; /* Datatype structure for opaque references */
hsize_t dim[1] = {1}; /* Dimension info for array datatype */
herr_t status;
hbool_t copied_dtype =
TRUE; /* Flag to indicate whether datatype was copied or allocated (for error cleanup) */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
/* Initialize the atom group for the file IDs */
if (H5I_register_type(H5I_DATATYPE_CLS) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to initialize interface")
/* Make certain there aren't too many classes of datatypes defined */
/* Only 16 (numbered 0-15) are supported in the current file format */
HDcompile_assert(H5T_NCLASSES < 16);
/*
* Initialize pre-defined native datatypes from code generated during
* the library configuration by H5detect.
*/
if (H5T__init_native() < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to initialize interface")
/* Get the atomic datatype structures needed by the initialization code below */
if (NULL == (native_schar = (H5T_t *)H5I_object(H5T_NATIVE_SCHAR_g)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object")
if (NULL == (native_uchar = (H5T_t *)H5I_object(H5T_NATIVE_UCHAR_g)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object")
if (NULL == (native_short = (H5T_t *)H5I_object(H5T_NATIVE_SHORT_g)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object")
if (NULL == (native_ushort = (H5T_t *)H5I_object(H5T_NATIVE_USHORT_g)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object")
if (NULL == (native_int = (H5T_t *)H5I_object(H5T_NATIVE_INT_g)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object")
if (NULL == (native_uint = (H5T_t *)H5I_object(H5T_NATIVE_UINT_g)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object")
if (NULL == (native_long = (H5T_t *)H5I_object(H5T_NATIVE_LONG_g)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object")
if (NULL == (native_ulong = (H5T_t *)H5I_object(H5T_NATIVE_ULONG_g)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object")
if (NULL == (native_llong = (H5T_t *)H5I_object(H5T_NATIVE_LLONG_g)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object")
if (NULL == (native_ullong = (H5T_t *)H5I_object(H5T_NATIVE_ULLONG_g)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object")
if (NULL == (native_float = (H5T_t *)H5I_object(H5T_NATIVE_FLOAT_g)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object")
if (NULL == (native_double = (H5T_t *)H5I_object(H5T_NATIVE_DOUBLE_g)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object")
#if H5_SIZEOF_LONG_DOUBLE != 0
if (NULL == (native_ldouble = (H5T_t *)H5I_object(H5T_NATIVE_LDOUBLE_g)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object")
#endif
/*------------------------------------------------------------
* Derived native types
*------------------------------------------------------------
*/
/* 1-byte bit field */
H5T_INIT_TYPE(BITFIELD, H5T_NATIVE_B8_g, COPY, native_uint, SET, 1)
/* 2-byte bit field */
H5T_INIT_TYPE(BITFIELD, H5T_NATIVE_B16_g, COPY, native_uint, SET, 2)
/* 4-byte bit field */
H5T_INIT_TYPE(BITFIELD, H5T_NATIVE_B32_g, COPY, native_uint, SET, 4)
/* 8-byte bit field */
H5T_INIT_TYPE(BITFIELD, H5T_NATIVE_B64_g, COPY, native_uint, SET, 8)
/* haddr_t */
H5T_INIT_TYPE(OFFSET, H5T_NATIVE_HADDR_g, COPY, native_uint, SET, sizeof(haddr_t))
/* hsize_t */
H5T_INIT_TYPE(OFFSET, H5T_NATIVE_HSIZE_g, COPY, native_uint, SET, sizeof(hsize_t))
/* hssize_t */
H5T_INIT_TYPE(OFFSET, H5T_NATIVE_HSSIZE_g, COPY, native_int, SET, sizeof(hssize_t))
/* herr_t */
H5T_INIT_TYPE(OFFSET, H5T_NATIVE_HERR_g, COPY, native_int, SET, sizeof(herr_t))
/* hbool_t */
H5T_INIT_TYPE(OFFSET, H5T_NATIVE_HBOOL_g, COPY, native_uint, SET, sizeof(hbool_t))
/*------------------------------------------------------------
* IEEE Types
*------------------------------------------------------------
*/
/* IEEE 4-byte little-endian float */
H5T_INIT_TYPE(FLOATLE, H5T_IEEE_F32LE_g, COPY, native_double, SET, 4)
/* IEEE 4-byte big-endian float */
H5T_INIT_TYPE(FLOATBE, H5T_IEEE_F32BE_g, COPY, native_double, SET, 4)
/* IEEE 8-byte little-endian float */
H5T_INIT_TYPE(DOUBLELE, H5T_IEEE_F64LE_g, COPY, native_double, SET, 8)
/* IEEE 8-byte big-endian float */
H5T_INIT_TYPE(DOUBLEBE, H5T_IEEE_F64BE_g, COPY, native_double, SET, 8)
/*------------------------------------------------------------
* VAX Types
*------------------------------------------------------------
*/
/* VAX 4-byte float */
H5T_INIT_TYPE(FLOATVAX, H5T_VAX_F32_g, COPY, native_double, SET, 4)
/* VAX 8-byte double */
H5T_INIT_TYPE(DOUBLEVAX, H5T_VAX_F64_g, COPY, native_double, SET, 8)
/*------------------------------------------------------------
* C99 types
*------------------------------------------------------------
*/
/* 1-byte little-endian (endianness is irrelevant) signed integer */
H5T_INIT_TYPE(SINTLE, H5T_STD_I8LE_g, COPY, native_int, SET, 1)
/* 1-byte big-endian (endianness is irrelevant) signed integer */
H5T_INIT_TYPE(SINTBE, H5T_STD_I8BE_g, COPY, native_int, SET, 1)
/* 2-byte little-endian signed integer */
H5T_INIT_TYPE(SINTLE, H5T_STD_I16LE_g, COPY, native_int, SET, 2)
/* 2-byte big-endian signed integer */
H5T_INIT_TYPE(SINTBE, H5T_STD_I16BE_g, COPY, native_int, SET, 2)
/* 4-byte little-endian signed integer */
H5T_INIT_TYPE(SINTLE, H5T_STD_I32LE_g, COPY, native_int, SET, 4)
/* 4-byte big-endian signed integer */
H5T_INIT_TYPE(SINTBE, H5T_STD_I32BE_g, COPY, native_int, SET, 4)
/* 8-byte little-endian signed integer */
H5T_INIT_TYPE(SINTLE, H5T_STD_I64LE_g, COPY, native_int, SET, 8)
/* 8-byte big-endian signed integer */
H5T_INIT_TYPE(SINTBE, H5T_STD_I64BE_g, COPY, native_int, SET, 8)
/* 1-byte little-endian (endianness is irrelevant) unsigned integer */
H5T_INIT_TYPE(UINTLE, H5T_STD_U8LE_g, COPY, native_uint, SET, 1)
std_u8le = dt; /* Keep type for later */
/* 1-byte big-endian (endianness is irrelevant) unsigned integer */
H5T_INIT_TYPE(UINTBE, H5T_STD_U8BE_g, COPY, native_uint, SET, 1)
std_u8be = dt; /* Keep type for later */
/* 2-byte little-endian unsigned integer */
H5T_INIT_TYPE(UINTLE, H5T_STD_U16LE_g, COPY, native_uint, SET, 2)
std_u16le = dt; /* Keep type for later */
/* 2-byte big-endian unsigned integer */
H5T_INIT_TYPE(UINTBE, H5T_STD_U16BE_g, COPY, native_uint, SET, 2)
std_u16be = dt; /* Keep type for later */
/* 4-byte little-endian unsigned integer */
H5T_INIT_TYPE(UINTLE, H5T_STD_U32LE_g, COPY, native_uint, SET, 4)
std_u32le = dt; /* Keep type for later */
/* 4-byte big-endian unsigned integer */
H5T_INIT_TYPE(UINTBE, H5T_STD_U32BE_g, COPY, native_uint, SET, 4)
std_u32be = dt; /* Keep type for later */
/* 8-byte little-endian unsigned integer */
H5T_INIT_TYPE(UINTLE, H5T_STD_U64LE_g, COPY, native_uint, SET, 8)
std_u64le = dt; /* Keep type for later */
/* 8-byte big-endian unsigned integer */
H5T_INIT_TYPE(UINTBE, H5T_STD_U64BE_g, COPY, native_uint, SET, 8)
std_u64be = dt; /* Keep type for later */
/*------------------------------------------------------------
* Native, Little- & Big-endian bitfields
*------------------------------------------------------------
*/
/* little-endian (order is irrelevant) 8-bit bitfield */
H5T_INIT_TYPE(BITFIELDLE, H5T_STD_B8LE_g, COPY, std_u8le, NOSET, -)
bitfield = dt; /* Keep type for later */
/* big-endian (order is irrelevant) 8-bit bitfield */
H5T_INIT_TYPE(BITFIELDBE, H5T_STD_B8BE_g, COPY, std_u8be, NOSET, -)
/* Little-endian 16-bit bitfield */
H5T_INIT_TYPE(BITFIELDLE, H5T_STD_B16LE_g, COPY, std_u16le, NOSET, -)
/* Big-endian 16-bit bitfield */
H5T_INIT_TYPE(BITFIELDBE, H5T_STD_B16BE_g, COPY, std_u16be, NOSET, -)
/* Little-endian 32-bit bitfield */
H5T_INIT_TYPE(BITFIELDLE, H5T_STD_B32LE_g, COPY, std_u32le, NOSET, -)
/* Big-endian 32-bit bitfield */
H5T_INIT_TYPE(BITFIELDBE, H5T_STD_B32BE_g, COPY, std_u32be, NOSET, -)
/* Little-endian 64-bit bitfield */
H5T_INIT_TYPE(BITFIELDLE, H5T_STD_B64LE_g, COPY, std_u64le, NOSET, -)
/* Big-endian 64-bit bitfield */
H5T_INIT_TYPE(BITFIELDBE, H5T_STD_B64BE_g, COPY, std_u64be, NOSET, -)
/*------------------------------------------------------------