@@ -2,6 +2,8 @@ use std::mem;
22
33pub use self :: H5L_type_t :: * ;
44
5+ #[ cfg( hdf5_1_12_0) ]
6+ use crate :: h5o:: H5O_token_t ;
57use crate :: internal_prelude:: * ;
68
79pub const H5L_MAX_LINK_NAME_LEN : uint32_t = !0 ;
@@ -25,33 +27,33 @@ pub const H5L_TYPE_UD_MIN: H5L_type_t = H5L_TYPE_EXTERNAL;
2527
2628#[ repr( C ) ]
2729#[ derive( Debug , Copy , Clone ) ]
28- pub struct H5L_info_t {
30+ pub struct H5L_info1_t {
2931 pub type_ : H5L_type_t ,
3032 pub corder_valid : hbool_t ,
3133 pub corder : int64_t ,
3234 pub cset : H5T_cset_t ,
33- pub u : H5L_info_t__u ,
35+ pub u : H5L_info1_t__u ,
3436}
3537
36- impl Default for H5L_info_t {
38+ impl Default for H5L_info1_t {
3739 fn default ( ) -> Self {
3840 unsafe { mem:: zeroed ( ) }
3941 }
4042}
4143
4244#[ repr( C ) ]
4345#[ derive( Debug , Copy , Clone ) ]
44- pub struct H5L_info_t__u {
46+ pub struct H5L_info1_t__u {
4547 value : [ u64 ; 1usize ] ,
4648}
4749
48- impl Default for H5L_info_t__u {
50+ impl Default for H5L_info1_t__u {
4951 fn default ( ) -> Self {
5052 unsafe { mem:: zeroed ( ) }
5153 }
5254}
5355
54- impl H5L_info_t__u {
56+ impl H5L_info1_t__u {
5557 pub unsafe fn address ( & mut self ) -> * mut haddr_t {
5658 & self . value as * const [ u64 ; 1 ] as * mut haddr_t
5759 }
@@ -60,6 +62,39 @@ impl H5L_info_t__u {
6062 }
6163}
6264
65+ #[ repr( C ) ]
66+ #[ derive( Debug , Copy , Clone ) ]
67+ #[ cfg( hdf5_1_12_0) ]
68+ pub struct H5L_info2_t {
69+ pub type_ : H5L_type_t ,
70+ pub corder_valid : hbool_t ,
71+ pub corder : int64_t ,
72+ pub cset : H5T_cset_t ,
73+ pub u : H5L_info1_t__u ,
74+ }
75+
76+ #[ cfg( hdf5_1_12_0) ]
77+ impl Default for H5L_info2_t {
78+ fn default ( ) -> Self {
79+ unsafe { mem:: zeroed ( ) }
80+ }
81+ }
82+
83+ #[ repr( C ) ]
84+ #[ derive( Copy , Clone ) ]
85+ #[ cfg( hdf5_1_12_0) ]
86+ pub union H5L_info2_t__u {
87+ token : H5O_token_t ,
88+ val_size : size_t ,
89+ }
90+
91+ #[ cfg( hdf5_1_12_0) ]
92+ impl Default for H5L_info2_t__u {
93+ fn default ( ) -> Self {
94+ unsafe { mem:: zeroed ( ) }
95+ }
96+ }
97+
6398pub type H5L_create_func_t = Option <
6499 extern "C" fn (
65100 link_name : * const c_char ,
@@ -132,11 +167,20 @@ impl Default for H5L_class_t {
132167 }
133168}
134169
135- pub type H5L_iterate_t = Option <
170+ pub type H5L_iterate1_t = Option <
171+ extern "C" fn (
172+ group : hid_t ,
173+ name : * const c_char ,
174+ info : * const H5L_info1_t ,
175+ op_data : * mut c_void ,
176+ ) -> herr_t ,
177+ > ;
178+ #[ cfg( hdf5_1_12_0) ]
179+ pub type H5L_iterate2_t = Option <
136180 extern "C" fn (
137181 group : hid_t ,
138182 name : * const c_char ,
139- info : * const H5L_info_t ,
183+ info : * const H5L_info2_t ,
140184 op_data : * mut c_void ,
141185 ) -> herr_t ,
142186> ;
@@ -182,32 +226,82 @@ extern "C" {
182226 n : hsize_t , buf : * mut c_void , size : size_t , lapl_id : hid_t ,
183227 ) -> herr_t ;
184228 pub fn H5Lexists ( loc_id : hid_t , name : * const c_char , lapl_id : hid_t ) -> htri_t ;
185- pub fn H5Lget_info (
186- loc_id : hid_t , name : * const c_char , linfo : * mut H5L_info_t , lapl_id : hid_t ,
229+ #[ cfg_attr( hdf5_1_12_0, deprecated( note = "deprecated in HDF5 1.12.0, use H5Lget_info2()" ) ) ]
230+ #[ cfg_attr( not( hdf5_1_12_0) , link_name = "H5Lget_info" ) ]
231+ pub fn H5Lget_info1 (
232+ loc_id : hid_t , name : * const c_char , linfo : * mut H5L_info1_t , lapl_id : hid_t ,
233+ ) -> herr_t ;
234+ #[ cfg( hdf5_1_12_0) ]
235+ pub fn H5Lget_info2 (
236+ loc_id : hid_t , name : * const c_char , linfo : * mut H5L_info2_t , lapl_id : hid_t ,
187237 ) -> herr_t ;
238+ #[ cfg_attr(
239+ hdf5_1_12_0,
240+ deprecated( note = "deprecated in HDF5 1.12.0, use H5Lget_info_by_idx2()" )
241+ ) ]
242+ #[ cfg_attr( not( hdf5_1_12_0) , link_name = "H5Lget_info_by_idx" ) ]
188243 pub fn H5Lget_info_by_idx (
189244 loc_id : hid_t , group_name : * const c_char , idx_type : H5_index_t , order : H5_iter_order_t ,
190- n : hsize_t , linfo : * mut H5L_info_t , lapl_id : hid_t ,
245+ n : hsize_t , linfo : * mut H5L_info1_t , lapl_id : hid_t ,
246+ ) -> herr_t ;
247+ #[ cfg( hdf5_1_12_0) ]
248+ pub fn H5Lget_info_by_idx2 (
249+ loc_id : hid_t , group_name : * const c_char , idx_type : H5_index_t , order : H5_iter_order_t ,
250+ n : hsize_t , linfo : * mut H5L_info2_t , lapl_id : hid_t ,
191251 ) -> herr_t ;
192252 pub fn H5Lget_name_by_idx (
193253 loc_id : hid_t , group_name : * const c_char , idx_type : H5_index_t , order : H5_iter_order_t ,
194254 n : hsize_t , name : * mut c_char , size : size_t , lapl_id : hid_t ,
195255 ) -> ssize_t ;
196- pub fn H5Literate (
256+ #[ cfg_attr( hdf5_1_12_0, deprecated( note = "deprecated in HDF5 1.12.0, use H5Literate2()" ) ) ]
257+ #[ cfg_attr( not( hdf5_1_12_0) , link_name = "H5Literate" ) ]
258+ pub fn H5Literate1 (
197259 grp_id : hid_t , idx_type : H5_index_t , order : H5_iter_order_t , idx : * mut hsize_t ,
198- op : H5L_iterate_t , op_data : * mut c_void ,
260+ op : H5L_iterate1_t , op_data : * mut c_void ,
199261 ) -> herr_t ;
200- pub fn H5Literate_by_name (
262+ #[ cfg( hdf5_1_12_0) ]
263+ pub fn H5Literate2 (
264+ grp_id : hid_t , idx_type : H5_index_t , order : H5_iter_order_t , idx : * mut hsize_t ,
265+ op : H5L_iterate2_t , op_data : * mut c_void ,
266+ ) -> herr_t ;
267+ #[ cfg_attr(
268+ hdf5_1_12_0,
269+ deprecated( note = "deprecated in HDF5 1.12.0, use H5Literate_by_name2()" )
270+ ) ]
271+ #[ cfg_attr( not( hdf5_1_12_0) , link_name = "H5Literate_by_name" ) ]
272+ pub fn H5Literate_by_name1 (
201273 loc_id : hid_t , group_name : * const c_char , idx_type : H5_index_t , order : H5_iter_order_t ,
202- idx : * mut hsize_t , op : H5L_iterate_t , op_data : * mut c_void , lapl_id : hid_t ,
274+ idx : * mut hsize_t , op : H5L_iterate1_t , op_data : * mut c_void , lapl_id : hid_t ,
203275 ) -> herr_t ;
204- pub fn H5Lvisit (
205- grp_id : hid_t , idx_type : H5_index_t , order : H5_iter_order_t , op : H5L_iterate_t ,
276+ #[ cfg( hdf5_1_12_0) ]
277+ pub fn H5Literate_by_name2 (
278+ loc_id : hid_t , group_name : * const c_char , idx_type : H5_index_t , order : H5_iter_order_t ,
279+ idx : * mut hsize_t , op : H5L_iterate2_t , op_data : * mut c_void , lapl_id : hid_t ,
280+ ) -> herr_t ;
281+ #[ cfg_attr( hdf5_1_12_0, deprecated( note = "deprecated in HDF5 1.12.0, use H5Lvisit2()" ) ) ]
282+ #[ cfg_attr( not( hdf5_1_12_0) , link_name = "H5Lvisit" ) ]
283+ pub fn H5Lvisit1 (
284+ grp_id : hid_t , idx_type : H5_index_t , order : H5_iter_order_t , op : H5L_iterate1_t ,
206285 op_data : * mut c_void ,
207286 ) -> herr_t ;
208- pub fn H5Lvisit_by_name (
287+ #[ cfg( hdf5_1_12_0) ]
288+ pub fn H5Lvisit2 (
289+ grp_id : hid_t , idx_type : H5_index_t , order : H5_iter_order_t , op : H5L_iterate2_t ,
290+ op_data : * mut c_void ,
291+ ) -> herr_t ;
292+ #[ cfg_attr(
293+ hdf5_1_12_0,
294+ deprecated( note = "deprecated in HDF5 1.12.0, use H5Lvisit_by_name2()" )
295+ ) ]
296+ #[ cfg_attr( not( hdf5_1_12_0) , link_name = "H5Lvisit_by_name" ) ]
297+ pub fn H5Lvisit_by_name1 (
298+ loc_id : hid_t , group_name : * const c_char , idx_type : H5_index_t , order : H5_iter_order_t ,
299+ op : H5L_iterate1_t , op_data : * mut c_void , lapl_id : hid_t ,
300+ ) -> herr_t ;
301+ #[ cfg( hdf5_1_12_0) ]
302+ pub fn H5Lvisit_by_name2 (
209303 loc_id : hid_t , group_name : * const c_char , idx_type : H5_index_t , order : H5_iter_order_t ,
210- op : H5L_iterate_t , op_data : * mut c_void , lapl_id : hid_t ,
304+ op : H5L_iterate2_t , op_data : * mut c_void , lapl_id : hid_t ,
211305 ) -> herr_t ;
212306 pub fn H5Lcreate_ud (
213307 link_loc_id : hid_t , link_name : * const c_char , link_type : H5L_type_t , udata : * const c_void ,
@@ -225,3 +319,12 @@ extern "C" {
225319 link_name : * const c_char , lcpl_id : hid_t , lapl_id : hid_t ,
226320 ) -> herr_t ;
227321}
322+
323+ #[ cfg( not( hdf5_1_12_0) ) ]
324+ pub use self :: {
325+ H5L_info1_t as H5L_info_t , H5L_iterate1_t as H5L_iterate_t , H5Literate1 as H5Literate ,
326+ } ;
327+ #[ cfg( hdf5_1_12_0) ]
328+ pub use self :: {
329+ H5L_info2_t as H5L_info_t , H5L_iterate2_t as H5L_iterate_t , H5Literate2 as H5Literate ,
330+ } ;
0 commit comments