HDF5  1.12.0
H5Tprivate.h
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2  * Copyright by The HDF Group. *
3  * Copyright by the Board of Trustees of the University of Illinois. *
4  * All rights reserved. *
5  * *
6  * This file is part of 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 private information about the H5T module
16  */
17 #ifndef _H5Tprivate_H
18 #define _H5Tprivate_H
19 
20 /* Early typedefs to avoid circular dependencies */
21 typedef struct H5T_t H5T_t;
22 
23 /* Get package's public header */
24 #include "H5Tpublic.h"
25 
26 /* Other public headers needed by this file */
27 #include "H5MMpublic.h" /* Memory management */
28 
29 /* Private headers needed by this file */
30 #include "H5private.h" /* Generic Functions */
31 #include "H5Gprivate.h" /* Groups */
32 #include "H5Rprivate.h" /* References */
33 #include "H5VLprivate.h" /* VOL Drivers */
34 
35 /* Macro for size of temporary buffers to contain a single element */
36 #define H5T_ELEM_BUF_SIZE 256
37 
38 /* If the module using this macro is allowed access to the private variables, access them directly */
39 #ifdef H5T_MODULE
40 #define H5T_GET_SIZE(T) ((T)->shared->size)
41 #define H5T_GET_SHARED(T) ((T)->shared)
42 #define H5T_GET_MEMBER_OFFSET(T, I) ((T)->u.compnd.memb[I].offset)
43 #define H5T_GET_MEMBER_SIZE(T, I) ((T)->u.compnd.memb[I].shared->size)
44 #else /* H5T_MODULE */
45 #define H5T_GET_SIZE(T) (H5T_get_size(T))
46 #define H5T_GET_SHARED(T) (H5T_get_shared(T))
47 #define H5T_GET_MEMBER_OFFSET(T, I) (H5T_get_member_offset((T), (I)))
48 #define H5T_GET_MEMBER_SIZE(T, I) (H5T_get_member_size((T), (I)))
49 #endif /* H5T_MODULE */
50 
51 /* Forward references of package typedefs (declared in H5Tpkg.h) */
52 typedef struct H5T_stats_t H5T_stats_t;
53 typedef struct H5T_path_t H5T_path_t;
54 
55 /* Forward reference of H5S_t */
56 struct H5S_t;
57 
58 /* How to copy a datatype */
59 typedef enum H5T_copy_t {
63 
64 /* Location of datatype information */
65 typedef enum {
66  H5T_LOC_BADLOC = 0, /* invalid datatype location */
67  H5T_LOC_MEMORY, /* data stored in memory */
68  H5T_LOC_DISK, /* data stored on disk */
69  H5T_LOC_MAXLOC /* highest value (Invalid as true value) */
71 
72 /* VL allocation information */
73 typedef struct {
74  H5MM_allocate_t alloc_func; /* Allocation function */
75  void *alloc_info; /* Allocation information */
76  H5MM_free_t free_func; /* Free function */
77  void *free_info; /* Free information */
79 
80 /* Structure for conversion callback property */
81 typedef struct H5T_conv_cb_t {
83  void* user_data;
85 
86 /* Values for the optimization of compound data reading and writing. They indicate
87  * whether the fields of the source and destination are subset of each other and
88  * there is no conversion needed.
89  */
90 typedef enum {
91  H5T_SUBSET_BADVALUE = -1, /* Invalid value */
92  H5T_SUBSET_FALSE = 0, /* Source and destination aren't subset of each other */
93  H5T_SUBSET_SRC, /* Source is the subset of dest and no conversion is needed */
94  H5T_SUBSET_DST, /* Dest is the subset of source and no conversion is needed */
95  H5T_SUBSET_CAP /* Must be the last value */
97 
98 typedef struct H5T_subset_info_t {
99  H5T_subset_t subset; /* See above */
100  size_t copy_size; /* Size in bytes, to copy for each element */
102 
103 /* Forward declarations for prototype arguments */
104 struct H5O_shared_t;
105 
106 /* The native endianness of the platform */
108 
109 /* Private functions */
110 H5_DLL herr_t H5T_init(void);
111 H5_DLL H5T_t *H5T_copy(const H5T_t *old_dt, H5T_copy_t method);
113 H5_DLL herr_t H5T_lock(H5T_t *dt, hbool_t immutable);
116 H5_DLL H5T_t *H5T_get_super(const H5T_t *dt);
117 H5_DLL H5T_class_t H5T_get_class(const H5T_t *dt, htri_t internal);
118 H5_DLL htri_t H5T_detect_class(const H5T_t *dt, H5T_class_t cls, hbool_t from_api);
119 H5_DLL size_t H5T_get_size(const H5T_t *dt);
120 H5_DLL int H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset);
121 H5_DLL herr_t H5T_encode(H5T_t *obj, unsigned char *buf, size_t *nalloc);
122 H5_DLL H5T_t *H5T_decode(size_t buf_size, const unsigned char *buf);
123 H5_DLL herr_t H5T_debug(const H5T_t *dt, FILE * stream);
124 H5_DLL struct H5O_loc_t *H5T_oloc(H5T_t *dt);
125 H5_DLL H5G_name_t *H5T_nameof(const H5T_t *dt);
127 H5_DLL htri_t H5T_is_named(const H5T_t *dt);
130 H5_DLL H5T_path_t *H5T_path_find(const H5T_t *src, const H5T_t *dst);
134 H5_DLL herr_t H5T_convert(H5T_path_t *tpath, hid_t src_id, hid_t dst_id,
135  size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg);
136 H5_DLL herr_t H5T_reclaim(hid_t type_id, struct H5S_t *space, void *buf);
137 H5_DLL herr_t H5T_reclaim_cb(void *elem, const H5T_t *dt, unsigned ndim, const hsize_t *point, void *op_data);
138 H5_DLL herr_t H5T_ref_reclaim(void *elem, const H5T_t *dt);
139 H5_DLL herr_t H5T_vlen_reclaim(void *elem, const H5T_t *dt, H5T_vlen_alloc_info_t *alloc_info);
140 H5_DLL herr_t H5T_vlen_reclaim_elmt(void *elem, H5T_t *dt);
152 H5_DLL herr_t H5T_save_refresh_state(hid_t tid, struct H5O_shared_t *cached_H5O_shared);
153 H5_DLL herr_t H5T_restore_refresh_state(hid_t tid, struct H5O_shared_t *cached_H5O_shared);
156 
157 /* Reference specific functions */
159 
160 /* Operations on named datatypes */
161 H5_DLL H5T_t *H5T_open(const H5G_loc_t *loc);
162 H5_DLL int H5T_link(const H5T_t *type, int adjust);
164 
165 /* Field functions (for both compound & enumerated types) */
166 H5_DLL int H5T_get_nmembers(const H5T_t *dt);
167 H5_DLL H5T_t *H5T_get_member_type(const H5T_t *dt, unsigned membno);
168 H5_DLL size_t H5T_get_member_offset(const H5T_t *dt, unsigned membno);
169 
170 /* Atomic functions */
172 H5_DLL size_t H5T_get_precision(const H5T_t *dt);
173 H5_DLL int H5T_get_offset(const H5T_t *dt);
174 
175 /* Fixed-point functions */
177 
178 #endif /* _H5Tprivate_H */
179 
H5T_get_ref_type
H5_DLL H5R_type_t H5T_get_ref_type(const H5T_t *dt)
Definition: H5T.c:5514
H5T_vlen_alloc_info_t::alloc_func
H5MM_allocate_t alloc_func
Definition: H5Tprivate.h:74
H5O_loc_t
Definition: H5Oprivate.h:152
H5T_is_named
H5_DLL htri_t H5T_is_named(const H5T_t *dt)
Definition: H5T.c:5426
H5T_COPY_ALL
@ H5T_COPY_ALL
Definition: H5Tprivate.h:61
H5T_SUBSET_FALSE
@ H5T_SUBSET_FALSE
Definition: H5Tprivate.h:92
H5T_sign_t
H5T_sign_t
Definition: H5Tpublic.h:57
H5T_conv_cb_t::func
H5T_conv_except_func_t func
Definition: H5Tprivate.h:82
H5T_get_member_offset
H5_DLL size_t H5T_get_member_offset(const H5T_t *dt, unsigned membno)
Definition: H5Tcompound.c:143
H5T_convert_committed_datatype
H5_DLL herr_t H5T_convert_committed_datatype(H5T_t *dt, H5F_t *f)
Definition: H5T.c:5461
f
hdr f
Definition: H5EA.c:755
H5O_shared_t
Definition: H5Oprivate.h:268
H5T_path_noop
H5_DLL hbool_t H5T_path_noop(const H5T_path_t *p)
Definition: H5T.c:5144
H5T_convert
H5_DLL herr_t H5T_convert(H5T_path_t *tpath, hid_t src_id, hid_t dst_id, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg)
Definition: H5T.c:5270
H5T_conv_cb_t
Definition: H5Tprivate.h:81
H5VL_object_t
Definition: H5VLprivate.h:39
H5Gprivate.h
H5T_conv_except_func_t
H5T_conv_ret_t(* H5T_conv_except_func_t)(H5T_conv_except_t except_type, hid_t src_id, hid_t dst_id, void *src_buf, void *dst_buf, void *user_data)
Definition: H5Tpublic.h:214
H5T_subset_t
H5T_subset_t
Definition: H5Tprivate.h:90
uint32_t
uint32_t
Definition: H5overflow.txt:38
H5T_copy
H5_DLL H5T_t * H5T_copy(const H5T_t *old_dt, H5T_copy_t method)
Definition: H5T.c:3630
H5T_construct_datatype
H5_DLL H5T_t * H5T_construct_datatype(H5VL_object_t *dt_obj)
Definition: H5Tcommit.c:1095
H5T_is_sensible
H5_DLL htri_t H5T_is_sensible(const H5T_t *dt)
Definition: H5T.c:5545
H5T_path_find
H5_DLL H5T_path_t * H5T_path_find(const H5T_t *src, const H5T_t *dst)
Definition: H5T.c:4796
H5T_hash
H5_DLL uint32_t H5T_hash(H5F_t *file, const H5T_t *dt)
H5T_LOC_BADLOC
@ H5T_LOC_BADLOC
Definition: H5Tprivate.h:66
H5T_subset_info_t
Definition: H5Tprivate.h:98
H5T_get_offset
H5_DLL int H5T_get_offset(const H5T_t *dt)
Definition: H5Toffset.c:113
H5T_encode
H5_DLL herr_t H5T_encode(H5T_t *obj, unsigned char *buf, size_t *nalloc)
Definition: H5T.c:3089
H5T_get_sign
H5_DLL H5T_sign_t H5T_get_sign(H5T_t const *dt)
Definition: H5Tfixed.c:83
H5T_update_shared
H5_DLL herr_t H5T_update_shared(H5T_t *type)
Definition: H5Tcommit.c:1071
H5VLprivate.h
H5T_get_super
H5_DLL H5T_t * H5T_get_super(const H5T_t *dt)
Definition: H5T.c:2338
H5T_patch_vlen_file
H5_DLL herr_t H5T_patch_vlen_file(H5T_t *dt, H5VL_object_t *file)
Definition: H5T.c:6076
H5T_get_actual_type
H5_DLL H5T_t * H5T_get_actual_type(H5T_t *dt)
Definition: H5Tcommit.c:1168
H5T_vlen_alloc_info_t
Definition: H5Tprivate.h:73
H5T_patch_file
H5_DLL herr_t H5T_patch_file(H5T_t *dt, H5F_t *f)
Definition: H5T.c:6043
H5Tpublic.h
H5T_reclaim
H5_DLL herr_t H5T_reclaim(hid_t type_id, struct H5S_t *space, void *buf)
Definition: H5Tconv.c:9527
H5_DLLVAR
#define H5_DLLVAR
Definition: H5api_adpt.h:235
H5G_loc_t
Definition: H5Gprivate.h:144
H5MM_free_t
void(* H5MM_free_t)(void *mem, void *free_info)
Definition: H5MMpublic.h:35
H5T_subset_info_t::subset
H5T_subset_t subset
Definition: H5Tprivate.h:99
H5T_path_bkg
H5_DLL H5T_bkg_t H5T_path_bkg(const H5T_path_t *p)
Definition: H5T.c:5210
H5T_save_refresh_state
H5_DLL herr_t H5T_save_refresh_state(hid_t tid, struct H5O_shared_t *cached_H5O_shared)
Definition: H5Tcommit.c:1194
H5T_get_size
H5_DLL size_t H5T_get_size(const H5T_t *dt)
Definition: H5T.c:4319
H5T_vlen_alloc_info_t::alloc_info
void * alloc_info
Definition: H5Tprivate.h:75
H5T_debug
H5_DLL herr_t H5T_debug(const H5T_t *dt, FILE *stream)
Definition: H5Tdbg.c:150
htri_t
int htri_t
Definition: H5public.h:160
H5T_set_version
H5_DLL herr_t H5T_set_version(H5F_t *f, H5T_t *dt)
Definition: H5T.c:6000
H5T_copy_t
H5T_copy_t
Definition: H5Tprivate.h:59
H5T_subset_info_t
struct H5T_subset_info_t H5T_subset_info_t
H5MMpublic.h
H5T_path_t
Definition: H5Tpkg.h:172
H5T_SUBSET_DST
@ H5T_SUBSET_DST
Definition: H5Tprivate.h:94
H5T_set_loc
H5_DLL htri_t H5T_set_loc(H5T_t *dt, H5VL_object_t *file, H5T_loc_t loc)
Definition: H5T.c:5614
H5T_lock
H5_DLL herr_t H5T_lock(H5T_t *dt, hbool_t immutable)
Definition: H5T.c:3809
H5T_close_real
H5_DLL herr_t H5T_close_real(H5T_t *dt)
Definition: H5T.c:3990
H5T_get_member_type
H5_DLL H5T_t * H5T_get_member_type(const H5T_t *dt, unsigned membno)
Definition: H5Tcompound.c:263
hid_t
int64_t hid_t
Definition: H5Ipublic.h:55
H5T_subset_info_t::copy_size
size_t copy_size
Definition: H5Tprivate.h:100
H5T_vlen_reclaim
H5_DLL herr_t H5T_vlen_reclaim(void *elem, const H5T_t *dt, H5T_vlen_alloc_info_t *alloc_info)
Definition: H5Tvlen.c:1052
H5T_order_t
H5T_order_t
Definition: H5Tpublic.h:46
H5T_t
Definition: H5Tpkg.h:350
H5T_open
H5_DLL H5T_t * H5T_open(const H5G_loc_t *loc)
Definition: H5Tcommit.c:897
H5T_vlen_alloc_info_t::free_func
H5MM_free_t free_func
Definition: H5Tprivate.h:76
FILE
Invalid arguments to routine Resource unavailable Internal File accessibility Low level I O Function entry exit Object atom Object cache Links B Tree node Symbol table Heap Object header Datatype Dataspace Dataset Data storage Property lists Attribute Data filters External file list References Virtual File Layer Virtual Object Layer Ternary Search Trees Reference Counted Strings Error API Skip Lists Free Space Manager Shared Object Header Messages Extensible Array Fixed Array Plugin for dynamically loaded library Page Buffering API Context Map No error Argument errors Resource errors File accessibility errors FILE
Definition: H5err.txt:88
H5T_vlen_reclaim_elmt
H5_DLL herr_t H5T_vlen_reclaim_elmt(void *elem, H5T_t *dt)
Definition: H5Tvlen.c:1179
H5T_get_class
H5_DLL H5T_class_t H5T_get_class(const H5T_t *dt, htri_t internal)
Definition: H5T.c:1998
H5T_get_order
H5_DLL H5T_order_t H5T_get_order(const H5T_t *dt)
Definition: H5Torder.c:128
H5T_is_variable_str
H5_DLL htri_t H5T_is_variable_str(const H5T_t *dt)
Definition: H5T.c:2181
H5T_cmp
H5_DLL int H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset)
Definition: H5T.c:4348
H5T_ref_reclaim
H5_DLL herr_t H5T_ref_reclaim(void *elem, const H5T_t *dt)
Definition: H5Tref.c:1202
H5S_t
Definition: H5Spkg.h:317
H5T_stats_t
Definition: H5Tpkg.h:152
H5T_get_named_type
H5_DLL H5VL_object_t * H5T_get_named_type(const H5T_t *dt)
Definition: H5Tcommit.c:1142
H5T_native_order_g
H5_DLLVAR H5T_order_t H5T_native_order_g
Definition: H5Tprivate.h:104
H5T_SUBSET_CAP
@ H5T_SUBSET_CAP
Definition: H5Tprivate.h:95
H5Rprivate.h
H5O_loc_t::file
H5F_t * file
Definition: H5Oprivate.h:153
H5T_COPY_TRANSIENT
@ H5T_COPY_TRANSIENT
Definition: H5Tprivate.h:60
H5T_already_vol_managed
H5_DLL hbool_t H5T_already_vol_managed(const H5T_t *dt)
Definition: H5Tcommit.c:1276
H5T_get_nmembers
H5_DLL int H5T_get_nmembers(const H5T_t *dt)
Definition: H5Tfields.c:91
H5T_SUBSET_BADVALUE
@ H5T_SUBSET_BADVALUE
Definition: H5Tprivate.h:91
H5T_restore_refresh_state
H5_DLL herr_t H5T_restore_refresh_state(hid_t tid, struct H5O_shared_t *cached_H5O_shared)
Definition: H5Tcommit.c:1235
H5G_name_t
Definition: H5Gprivate.h:130
H5T_is_relocatable
H5_DLL htri_t H5T_is_relocatable(const H5T_t *dt)
Definition: H5T.c:5771
H5T_get_precision
H5_DLL size_t H5T_get_precision(const H5T_t *dt)
Definition: H5Tprecis.c:94
H5T_close
H5_DLL herr_t H5T_close(H5T_t *dt)
Definition: H5T.c:4032
H5T_LOC_MAXLOC
@ H5T_LOC_MAXLOC
Definition: H5Tprivate.h:69
H5_DLL
#define H5_DLL
Definition: H5api_adpt.h:234
H5T_oloc
H5_DLL struct H5O_loc_t * H5T_oloc(H5T_t *dt)
Definition: H5T.c:5319
H5T_nameof
H5_DLL H5G_name_t * H5T_nameof(const H5T_t *dt)
Definition: H5T.c:5360
H5T_LOC_DISK
@ H5T_LOC_DISK
Definition: H5Tprivate.h:68
H5T_path_compound_subset
H5_DLL H5T_subset_info_t * H5T_path_compound_subset(const H5T_path_t *p)
Definition: H5T.c:5183
H5T_vlen_alloc_info_t::free_info
void * free_info
Definition: H5Tprivate.h:77
H5T_LOC_MEMORY
@ H5T_LOC_MEMORY
Definition: H5Tprivate.h:67
H5R_type_t
H5R_type_t
Definition: H5Rpublic.h:48
H5T_reclaim_cb
H5_DLL herr_t H5T_reclaim_cb(void *elem, const H5T_t *dt, unsigned ndim, const hsize_t *point, void *op_data)
H5T_bkg_t
H5T_bkg_t
Definition: H5Tpublic.h:142
H5T_is_vl_storage
H5_DLL htri_t H5T_is_vl_storage(const H5T_t *dt)
Definition: H5T.c:5873
H5F_t
Definition: H5Fpkg.h:374
nelmts
hdr stats stored nelmts
Definition: H5EAdblock.c:214
H5T_is_immutable
H5_DLL htri_t H5T_is_immutable(const H5T_t *dt)
Definition: H5T.c:5400
H5T_detect_class
H5_DLL htri_t H5T_detect_class(const H5T_t *dt, H5T_class_t cls, hbool_t from_api)
Definition: H5T.c:2072
herr_t
int herr_t
Definition: H5public.h:128
H5T_decode
H5_DLL H5T_t * H5T_decode(size_t buf_size, const unsigned char *buf)
Definition: H5T.c:3145
hbool_t
bool hbool_t
Definition: H5public.h:159
H5T_link
H5_DLL int H5T_link(const H5T_t *type, int adjust)
Definition: H5Tcommit.c:538
H5T_own_vol_obj
H5_DLL herr_t H5T_own_vol_obj(H5T_t *dt, H5VL_object_t *vol_obj)
Definition: H5T.c:6104
H5T_conv_cb_t::user_data
void * user_data
Definition: H5Tprivate.h:83
H5T_init
H5_DLL herr_t H5T_init(void)
Definition: H5T.c:595
H5T_copy_reopen
H5_DLL H5T_t * H5T_copy_reopen(H5T_t *old_dt)
Definition: H5T.c:3705
hsize_t
hsize_t
Definition: H5overflow.txt:44
H5T_conv_cb_t
struct H5T_conv_cb_t H5T_conv_cb_t
H5T_loc_t
H5T_loc_t
Definition: H5Tprivate.h:65
H5T_SUBSET_SRC
@ H5T_SUBSET_SRC
Definition: H5Tprivate.h:93
H5T_class_t
H5T_class_t
Definition: H5Tpublic.h:28
H5MM_allocate_t
void *(* H5MM_allocate_t)(size_t size, void *alloc_info)
Definition: H5MMpublic.h:34
H5private.h