Skip to content

Commit 7a917de

Browse files
committed
Update h5o bindings
1 parent 3d6fec7 commit 7a917de

File tree

1 file changed

+46
-49
lines changed

1 file changed

+46
-49
lines changed

hdf5-sys/src/h5o.rs

+46-49
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ impl Default for H5O_hdr_info_t__mesg {
126126

127127
#[repr(C)]
128128
#[derive(Debug, Copy, Clone)]
129-
pub struct H5O_info_t {
129+
pub struct H5O_info1_t {
130130
pub fileno: c_ulong,
131131
pub addr: haddr_t,
132132
pub type_: H5O_type_t,
@@ -137,36 +137,36 @@ pub struct H5O_info_t {
137137
pub btime: time_t,
138138
pub num_attrs: hsize_t,
139139
pub hdr: H5O_hdr_info_t,
140-
pub meta_size: H5O_info_t__meta_size,
140+
pub meta_size: H5O_info1_t__meta_size,
141141
}
142142

143-
impl Default for H5O_info_t {
143+
impl Default for H5O_info1_t {
144144
fn default() -> Self {
145145
unsafe { mem::zeroed() }
146146
}
147147
}
148148

149149
#[repr(C)]
150150
#[derive(Debug, Copy, Clone)]
151-
pub struct H5O_info_t__meta_size {
151+
pub struct H5O_info1_t__meta_size {
152152
pub obj: H5_ih_info_t,
153153
pub attr: H5_ih_info_t,
154154
}
155155

156156
#[cfg(not(hdf5_1_12_0))]
157-
impl Default for H5O_info_t__meta_size {
157+
impl Default for H5O_info1_t__meta_size {
158158
fn default() -> Self {
159159
unsafe { mem::zeroed() }
160160
}
161161
}
162162

163163
pub type H5O_msg_crt_idx_t = uint32_t;
164164

165-
pub type H5O_iterate_t = Option<
165+
pub type H5O_iterate1_t = Option<
166166
extern "C" fn(
167167
obj: hid_t,
168168
name: *const c_char,
169-
info: *const H5O_info_t,
169+
info: *const H5O_info1_t,
170170
op_data: *mut c_void,
171171
) -> herr_t,
172172
>;
@@ -193,23 +193,41 @@ pub enum H5O_mcdt_search_ret_t {
193193
pub type H5O_mcdt_search_cb_t =
194194
Option<extern "C" fn(op_data: *mut c_void) -> H5O_mcdt_search_ret_t>;
195195

196-
#[cfg(not(hdf5_1_10_3))]
197196
extern "C" {
198-
pub fn H5Oget_info(loc_id: hid_t, oinfo: *mut H5O_info_t) -> herr_t;
199-
pub fn H5Oget_info_by_name(
200-
loc_id: hid_t, name: *const c_char, oinfo: *mut H5O_info_t, lapl_id: hid_t,
197+
#[cfg_attr(hdf5_1_10_3, deprecated(note = "deprecated in HDF5 1.10.3, use H5Oget_info2()"))]
198+
#[cfg_attr(not(hdf5_1_10_3), link_name = "H5Oget_info")]
199+
pub fn H5Oget_info1(loc_id: hid_t, oinfo: *mut H5O_info1_t) -> herr_t;
200+
#[cfg_attr(
201+
hdf5_1_10_3,
202+
deprecated(note = "deprecated in HDF5 1.10.3, use H5Oget_info_by_name2()")
203+
)]
204+
#[cfg_attr(not(hdf5_1_10_3), link_name = "H5Oget_info_by_name")]
205+
pub fn H5Oget_info_by_name1(
206+
loc_id: hid_t, name: *const c_char, oinfo: *mut H5O_info1_t, lapl_id: hid_t,
201207
) -> herr_t;
202-
pub fn H5Oget_info_by_idx(
208+
#[cfg_attr(
209+
hdf5_1_10_3,
210+
deprecated(note = "deprecated in HDF5 1.10.3, use H5Oget_info_by_idx2()")
211+
)]
212+
#[cfg_attr(not(hdf5_1_10_3), link_name = "H5Oget_info_by_idx")]
213+
pub fn H5Oget_info_by_idx1(
203214
loc_id: hid_t, group_name: *const c_char, idx_type: H5_index_t, order: H5_iter_order_t,
204-
n: hsize_t, oinfo: *mut H5O_info_t, lapl_id: hid_t,
215+
n: hsize_t, oinfo: *mut H5O_info1_t, lapl_id: hid_t,
205216
) -> herr_t;
206-
pub fn H5Ovisit(
207-
obj_id: hid_t, idx_type: H5_index_t, order: H5_iter_order_t, op: H5O_iterate_t,
217+
#[cfg_attr(hdf5_1_10_3, deprecated(note = "deprecated in HDF5 1.10.3, use H5Oget_visit2()"))]
218+
#[cfg_attr(not(hdf5_1_10_3), link_name = "H5Ovisit")]
219+
pub fn H5Ovisit1(
220+
obj_id: hid_t, idx_type: H5_index_t, order: H5_iter_order_t, op: H5O_iterate1_t,
208221
op_data: *mut c_void,
209222
) -> herr_t;
210-
pub fn H5Ovisit_by_name(
223+
#[cfg_attr(
224+
hdf5_1_10_3,
225+
deprecated(note = "deprecated in HDF5 1.10.3, use H5Ovisit_by_name2()")
226+
)]
227+
#[cfg_attr(not(hdf5_1_10_3), link_name = "H5Ovisit_by_name")]
228+
pub fn H5Ovisit_by_name1(
211229
loc_id: hid_t, obj_name: *const c_char, idx_type: H5_index_t, order: H5_iter_order_t,
212-
op: H5O_iterate_t, op_data: *mut c_void, lapl_id: hid_t,
230+
op: H5O_iterate1_t, op_data: *mut c_void, lapl_id: hid_t,
213231
) -> herr_t;
214232
}
215233

@@ -262,47 +280,26 @@ mod hdf5_1_10_3 {
262280
use super::*;
263281

264282
extern "C" {
265-
pub fn H5Oget_info2(loc_id: hid_t, oinfo: *mut H5O_info_t, fields: c_uint) -> herr_t;
283+
pub fn H5Oget_info2(loc_id: hid_t, oinfo: *mut H5O_info1_t, fields: c_uint) -> herr_t;
266284
pub fn H5Oget_info_by_name2(
267-
loc_id: hid_t, name: *const c_char, oinfo: *mut H5O_info_t, fields: c_uint,
285+
loc_id: hid_t, name: *const c_char, oinfo: *mut H5O_info1_t, fields: c_uint,
268286
lapl_id: hid_t,
269287
) -> herr_t;
270288
pub fn H5Oget_info_by_idx2(
271289
loc_id: hid_t, group_name: *const c_char, idx_type: H5_index_t, order: H5_iter_order_t,
272-
n: hsize_t, oinfo: *mut H5O_info_t, fields: c_uint, lapl_id: hid_t,
290+
n: hsize_t, oinfo: *mut H5O_info1_t, fields: c_uint, lapl_id: hid_t,
273291
) -> herr_t;
274292
pub fn H5Ovisit2(
275-
obj_id: hid_t, idx_type: H5_index_t, order: H5_iter_order_t, op: H5O_iterate_t,
293+
obj_id: hid_t, idx_type: H5_index_t, order: H5_iter_order_t, op: H5O_iterate1_t,
276294
op_data: *mut c_void, fields: c_uint,
277295
) -> herr_t;
278296
pub fn H5Ovisit_by_name2(
279297
loc_id: hid_t, obj_name: *const c_char, idx_type: H5_index_t, order: H5_iter_order_t,
280-
op: H5O_iterate_t, op_data: *mut c_void, fields: c_uint, lapl_id: hid_t,
281-
) -> herr_t;
282-
#[deprecated(note = "deprecated in HDF5 1.10.3, use H5Oget_info2()")]
283-
pub fn H5Oget_info1(loc_id: hid_t, oinfo: *mut H5O_info_t) -> herr_t;
284-
#[deprecated(note = "deprecated in HDF5 1.10.3, use H5Oget_info_by_name2()")]
285-
pub fn H5Oget_info_by_name1(
286-
loc_id: hid_t, name: *const c_char, oinfo: *mut H5O_info_t, lapl_id: hid_t,
287-
) -> herr_t;
288-
#[deprecated(note = "deprecated in HDF5 1.10.3, use H5Oget_info_by_idx2()")]
289-
pub fn H5Oget_info_by_idx1(
290-
loc_id: hid_t, group_name: *const c_char, idx_type: H5_index_t, order: H5_iter_order_t,
291-
n: hsize_t, oinfo: *mut H5O_info_t, lapl_id: hid_t,
292-
) -> herr_t;
293-
#[deprecated(note = "deprecated in HDF5 1.10.3, use H5Ovisit2()")]
294-
pub fn H5Ovisit1(
295-
obj_id: hid_t, idx_type: H5_index_t, order: H5_iter_order_t, op: H5O_iterate_t,
296-
op_data: *mut c_void,
297-
) -> herr_t;
298-
#[deprecated(note = "deprecated in HDF5 1.10.3, use H5Ovisit_by_name2()")]
299-
pub fn H5Ovisit_by_name1(
300-
loc_id: hid_t, obj_name: *const c_char, idx_type: H5_index_t, order: H5_iter_order_t,
301-
op: H5O_iterate_t, op_data: *mut c_void, lapl_id: hid_t,
298+
op: H5O_iterate1_t, op_data: *mut c_void, fields: c_uint, lapl_id: hid_t,
302299
) -> herr_t;
303300
}
304301

305-
#[cfg(not(hdf5_1_10_5))]
302+
#[cfg(not(hdf5_1_10_3))]
306303
pub use self::{
307304
H5Oget_info1 as H5Oget_info, H5Oget_info_by_idx1 as H5Oget_info_by_idx,
308305
H5Oget_info_by_name1 as H5Oget_info_by_name, H5Ovisit1 as H5Ovisit,
@@ -319,25 +316,25 @@ extern "C" {
319316
// in 1.10.5 those APIs were copied over to old names in order to be compatible with
320317
// older library versions - so we can link to them directly again.
321318
#[deprecated(note = "deprecated in HDF5 1.10.3, use H5Oget_info2()")]
322-
pub fn H5Oget_info(loc_id: hid_t, oinfo: *mut H5O_info_t) -> herr_t;
319+
pub fn H5Oget_info(loc_id: hid_t, oinfo: *mut H5O_info1_t) -> herr_t;
323320
#[deprecated(note = "deprecated in HDF5 1.10.3, use H5Oget_info_by_name2()")]
324321
pub fn H5Oget_info_by_name(
325-
loc_id: hid_t, name: *const c_char, oinfo: *mut H5O_info_t, lapl_id: hid_t,
322+
loc_id: hid_t, name: *const c_char, oinfo: *mut H5O_info1_t, lapl_id: hid_t,
326323
) -> herr_t;
327324
#[deprecated(note = "deprecated in HDF5 1.10.3, use H5Oget_info_by_idx2()")]
328325
pub fn H5Oget_info_by_idx(
329326
loc_id: hid_t, group_name: *const c_char, idx_type: H5_index_t, order: H5_iter_order_t,
330-
n: hsize_t, oinfo: *mut H5O_info_t, lapl_id: hid_t,
327+
n: hsize_t, oinfo: *mut H5O_info1_t, lapl_id: hid_t,
331328
) -> herr_t;
332329
#[deprecated(note = "deprecated in HDF5 1.10.3, use H5Ovisit2()")]
333330
pub fn H5Ovisit(
334-
obj_id: hid_t, idx_type: H5_index_t, order: H5_iter_order_t, op: H5O_iterate_t,
331+
obj_id: hid_t, idx_type: H5_index_t, order: H5_iter_order_t, op: H5O_iterate1_t,
335332
op_data: *mut c_void,
336333
) -> herr_t;
337334
#[deprecated(note = "deprecated in HDF5 1.10.3, use H5Ovisit_by_name2()")]
338335
pub fn H5Ovisit_by_name(
339336
loc_id: hid_t, obj_name: *const c_char, idx_type: H5_index_t, order: H5_iter_order_t,
340-
op: H5O_iterate_t, op_data: *mut c_void, lapl_id: hid_t,
337+
op: H5O_iterate1_t, op_data: *mut c_void, lapl_id: hid_t,
341338
) -> herr_t;
342339
}
343340

0 commit comments

Comments
 (0)