Low-level library bindings

At the lowest level, HDF5.jl operates by calling the public API of the HDF5 shared library through a set of ccall wrapper functions. This page documents the function names and nominal C argument types of the API which have bindings in this package. Note that in many cases, high-level data types are valid arguments through automatic ccall conversions. For instance, HDF5.Datatype objects will be automatically converted to their hid_t ID by Julia's cconvert+unsafe_convert ccall rules.

There are additional helper wrappers (often for out-argument functions) which are not documented here.


H5 — General Library Functions


H5A — Attribute Interface

HDF5.API.h5a_createFunction
h5a_create(loc_id::hid_t, attr_name::Cstring, type_id::hid_t, space_id::hid_t, acpl_id::hid_t, aapl_id::hid_t) -> hid_t

See libhdf5 documentation for H5Acreate2.

source
HDF5.API.h5a_create_by_nameFunction
h5a_create_by_name(loc_id::hid_t, obj_name::Cstring, attr_name::Cstring, type_id::hid_t, space_id::hid_t, acpl_id::hid_t, aapl_id::hid_t, lapl_id::hid_t) -> hid_t

See libhdf5 documentation for H5Acreate_by_name.

source
HDF5.API.h5a_iterateFunction
h5a_iterate(obj_id::hid_t, idx_type::Cint, order::Cint, n::Ptr{hsize_t}, op::Ptr{Cvoid}, op_data::Any)

See libhdf5 documentation for H5Aiterate2.

source
h5a_iterate(f, loc_id, idx_type, order, idx = 0) -> hsize_t

Executes h5a_iterate with the user-provided callback function f, returning the index where iteration ends.

The callback function must correspond to the signature

f(loc::HDF5.API.hid_t, name::Ptr{Cchar}, info::Ptr{HDF5.API.H5A_info_t}) -> Union{Bool, Integer}

where a negative return value halts iteration abnormally (triggering an error), a true or a positive value halts iteration successfully, and false or zero continues iteration.

Examples

julia> HDF5.API.h5a_iterate(obj, HDF5.API.H5_INDEX_NAME, HDF5.API.H5_ITER_INC) do loc, name, info
           println(unsafe_string(name))
           return false
       end
source

H5D — Dataset Interface

HDF5.API.h5d_chunk_iterFunction
h5d_chunk_iter(dset_id::hid_t, dxpl_id::hid_t, cb::Ptr{Nothing}, op_data::Any)

See libhdf5 documentation for H5Dchunk_iter.

source
h5d_chunk_iter(f, dataset, [dxpl_id=H5P_DEFAULT])

Call f(offset::Ptr{hsize_t}, filter_mask::Cuint, addr::haddr_t, size::hsize_t) for each chunk. dataset maybe a HDF5.Dataset or a dataset id. dxpl_id is the the dataset transfer property list and is optional.

Available only for HDF5 1.10.x series for 1.10.9 and greater or for version HDF5 1.12.3 or greater.

source
HDF5.API.h5d_createFunction
h5d_create(loc_id::hid_t, pathname::Cstring, dtype_id::hid_t, space_id::hid_t, lcpl_id::hid_t, dcpl_id::hid_t, dapl_id::hid_t) -> hid_t

See libhdf5 documentation for H5Dcreate2.

source
HDF5.API.h5d_fillFunction
h5d_fill(fill::Ptr{Cvoid}, fill_type_id::hid_t, buf::Ptr{Cvoid}, buf_type_id::hid_t, space_id::hid_t)

See libhdf5 documentation for H5Dfill.

source
HDF5.API.h5d_gatherFunction
h5d_gather(src_space_id::hid_t, src_buf::Ptr{Cvoid}, type_id::hid_t, dst_buf_size::Csize_t, dst_buf::Ptr{Cvoid}, op::Ptr{Cvoid}, op_data::Any)

See libhdf5 documentation for H5Dgather.

source
HDF5.API.h5d_get_chunk_infoFunction
h5d_get_chunk_info(dataset_id::hid_t, fspace_id::hid_t, index::hsize_t, offset::Ptr{hsize_t}, filter_mask::Ptr{Cuint}, addr::Ptr{haddr_t}, size::Ptr{hsize_t})

See libhdf5 documentation for H5Dget_chunk_info.

source
h5d_get_chunk_info(dataset_id, fspace_id, index)
h5d_get_chunk_info(dataset_id, index; fspace_id = HDF5.API.H5S_ALL)

Helper method to retrieve chunk information.

Returns a NamedTuple{(:offset, :filter_mask, :addr, :size), Tuple{HDF5.API.hsize_t, UInt32, HDF5.API.haddr_t, HDF5.API.hsize_t}}.

source
HDF5.API.h5d_get_chunk_info_by_coordFunction
h5d_get_chunk_info_by_coord(dataset_id::hid_t, offset::Ptr{hsize_t}, filter_mask::Ptr{Cuint}, addr::Ptr{haddr_t}, size::Ptr{hsize_t})

See libhdf5 documentation for H5Dget_chunk_info_by_coord.

source
h5d_get_chunk_info_by_coord(dataset_id, offset)

Helper method to read chunk information by coordinate. Returns a NamedTuple{(:filter_mask, :addr, :size), Tuple{UInt32, HDF5.API.haddr_t, HDF5.API.hsize_t}}.

source
HDF5.API.h5d_get_chunk_storage_sizeFunction
h5d_get_chunk_storage_size(dataset_id::hid_t, offset::Ptr{hsize_t}, chunk_nbytes::Ptr{hsize_t})

See libhdf5 documentation for H5Dget_chunk_storage_size.

source
h5d_get_chunk_storage_size(dataset_id, offset)

Helper method to retrieve the chunk storage size in bytes. Returns an integer of type HDF5.API.hsize_t.

source
HDF5.API.h5d_get_space_statusFunction
h5d_get_space_status(dataset_id::hid_t, status::Ref{Cint})

See libhdf5 documentation for H5Dget_space_status.

source
h5d_get_space_status(dataset_id)

Helper method to retrieve the status of the dataset space. Returns a HDF5.API.H5D_space_status_t (Cint) indicating the status, see HDF5.API.H5D_SPACE_STATUS_* constants.

source
HDF5.API.h5d_iterateFunction
h5d_iterate(buf::Ptr{Cvoid}, type_id::hid_t, space_id::hid_t, operator::Ptr{Cvoid}, operator_data::Any)

See libhdf5 documentation for H5Diterate.

source
HDF5.API.h5d_readFunction
h5d_read(dataset_id::hid_t, mem_type_id::hid_t, mem_space_id::hid_t, file_space_id::hid_t, xfer_plist_id::hid_t, buf::Ptr{Cvoid})

See libhdf5 documentation for H5Dread.

source
HDF5.API.h5d_vlen_get_buf_sizeFunction
h5d_vlen_get_buf_size(dset_id::hid_t, type_id::hid_t, space_id::hid_t, buf::Ptr{hsize_t})

See libhdf5 documentation for H5Dvlen_get_buf_size.

source
h5d_vlen_get_buf_size(dataset_id, type_id, space_id)

Helper method to determines the number of bytes required to store the variable length data from the dataset. Returns a value of type HDF5.API.hsize_t.

source
HDF5.API.h5d_writeFunction
h5d_write(dataset_id::hid_t, mem_type_id::hid_t, mem_space_id::hid_t, file_space_id::hid_t, xfer_plist_id::hid_t, buf::Ptr{Cvoid})

See libhdf5 documentation for H5Dwrite.

source

H5E — Error Interface

HDF5.API.h5e_get_msgFunction
h5e_get_msg(mesg_id::hid_t, mesg_type::Ref{Cint}, mesg::Ref{UInt8}, len::Csize_t) -> Cssize_t

See libhdf5 documentation for H5Eget_msg.

source
mesg_type, mesg = h5e_get_msg(meshg_id)
source

H5F — File Interface

HDF5.API.h5f_get_file_imageFunction
h5f_get_file_image(file_id::hid_t, buf_ptr::Ptr{Cvoid}, buf_len::Csize_t) -> Cssize_t

See libhdf5 documentation for H5Fget_file_image.

source
h5f_get_file_image(file_id)

Return a Vector{UInt8} containing the file image. Does not include the user block.

source
h5f_get_file_image(file_id, buffer::Vector{UInt8})

Store the file image in the provided buffer.

source
HDF5.API.h5f_get_free_sectionsFunction
h5f_get_free_sections(file_id::hid_t, type::H5F_mem_t, nsects::Csize_t, sect_info::Ptr{H5F_sect_info_t}) -> Cssize_t

See libhdf5 documentation for H5Fget_free_sections.

source
h5f_get_free_sections(file_id, type, [sect_info::AbstractVector{H5F_sect_info_t}])::AbstractVector{H5F_sect_info_t}

Return an AbstractVector of the free section information. If sect_info is not provided a new Vector will be allocated and returned. If sect_info is provided, a view, a SubArray, will be returned.

source
HDF5.API.h5f_get_mdc_sizeFunction
h5f_get_mdc_size(file_id::hid_t, max_size_ptr::Ptr{Csize_t}, min_clean_size_ptr::Ptr{Csize_t}, cur_size_ptr::Ptr{Csize_t}, cur_num_entries_ptr::Ptr{Cint})

See libhdf5 documentation for H5Fget_mdc_size.

source

H5G — Group Interface

HDF5.API.h5g_createFunction
h5g_create(loc_id::hid_t, pathname::Cstring, lcpl_id::hid_t, gcpl_id::hid_t, gapl_id::hid_t) -> hid_t

See libhdf5 documentation for H5Gcreate2.

source

H5I — Identifier Interface


H5L — Link Interface

HDF5.API.h5l_iterateFunction
h5l_iterate(group_id::hid_t, idx_type::Cint, order::Cint, idx::Ptr{hsize_t}, op::Ptr{Cvoid}, op_data::Any)

See libhdf5 documentation for H5Literate1.

source
h5l_iterate(f, group_id, idx_type, order, idx = 0) -> hsize_t

Executes h5l_iterate with the user-provided callback function f, returning the index where iteration ends.

The callback function must correspond to the signature

f(group::HDF5.API.hid_t, name::Ptr{Cchar}, info::Ptr{HDF5.API.H5L_info_t}) -> Union{Bool, Integer}

where a negative return value halts iteration abnormally, true or a positive value halts iteration successfully, and false or zero continues iteration.

Examples

julia> HDF5.API.h5l_iterate(hfile, HDF5.API.H5_INDEX_NAME, HDF5.API.H5_ITER_INC) do group, name, info
           println(unsafe_string(name))
           return HDF5.API.herr_t(0)
       end
source
HDF5.API.h5l_moveFunction
h5l_move(src_obj_id::hid_t, src_name::Cstring, dest_obj_id::hid_t, dest_name::Cstring, lcpl_id::hid_t, lapl_id::hid_t)

See libhdf5 documentation for H5Lmove.

source

H5O — Object Interface

HDF5.API.h5o_copyFunction
h5o_copy(src_loc_id::hid_t, src_name::Cstring, dst_loc_id::hid_t, dst_name::Cstring, ocpypl_id::hid_t, lcpl_id::hid_t)

See libhdf5 documentation for H5Ocopy.

source
HDF5.API.h5o_get_info_by_idxFunction
h5o_get_info_by_idx(loc_id::hid_t, group_name::Cstring, idx_type::H5_index_t, order::H5_iter_order_t, n::hsize_t, oinfo::Ptr{H5O_info2_t}, fields::Cuint, lapl_id::hid_t)

See libhdf5 documentation for H5Oget_info_by_idx3.

source
HDF5.API.h5o_linkFunction
h5o_link(obj_id::hid_t, new_loc_id::hid_t, new_name::Cstring, lcpl_id::hid_t, lapl_id::hid_t)

See libhdf5 documentation for H5Olink.

source
HDF5.API.h5o_visitFunction
h5o_visit(obj_id::hid_t, idx_type::H5_index_t, order::H5_iter_order_t, op::H5O_iterate2_t, op_data::Ptr{Cvoid}, fields::Cuint)

See libhdf5 documentation for H5Ovisit3.

source
HDF5.API.h5o_visit_by_nameFunction
h5o_visit_by_name(loc_id::hid_t, obj_name::Cstring, idx_type::H5_index_t, order::H5_iter_order_t, op::H5O_iterate2_t, op_data::Ptr{Cvoid}, fields::Cuint, lapl_id::hid_t)

See libhdf5 documentation for H5Ovisit_by_name3.

source

H5PL — Plugin Interface


H5P — Property Interface

HDF5.API.h5p_create_classFunction
h5p_create_class(parent::hid_t, name::Cstring, create::H5P_cls_create_func_t, create_data::Ptr{Cvoid}, copy::H5P_cls_copy_func_t, copy_data::Ptr{Cvoid}, close::H5P_cls_close_func_t, close_data::Ptr{Cvoid}) -> hid_t

See libhdf5 documentation for H5Pcreate_class.

source
HDF5.API.h5p_encodeFunction
h5p_encode(plist_id::hid_t, buf::Ptr{Cvoid}, nalloc::Ptr{Csize_t})

See libhdf5 documentation for H5Pencode1.

source
h5p_encode(plist_id::hid_t, buf::Ptr{Cvoid}, nalloc::Ptr{Csize_t}, fapl_id::hid_t)

See libhdf5 documentation for H5Pencode2.

source
HDF5.API.h5p_get_cacheFunction
h5p_get_cache(plist_id::hid_t, mdc_nelmts::Ptr{Cint}, rdcc_nslots::Ptr{Csize_t}, rdcc_nbytes::Ptr{Csize_t}, rdcc_w0::Ptr{Cdouble})

See libhdf5 documentation for H5Pget_cache.

source
HDF5.API.h5p_get_fapl_multiFunction
h5p_get_fapl_multi(fapl_id::hid_t, memb_map::Ptr{H5FD_mem_t}, memb_fapl::Ptr{hid_t}, memb_name::Ptr{Ptr{Cchar}}, memb_addr::Ptr{haddr_t}, relax::Ptr{hbool_t})

See libhdf5 documentation for H5Pget_fapl_multi.

source
HDF5.API.h5p_get_file_imageFunction
h5p_get_file_image(fapl_id::hid_t, buf_ptr_ptr::Ptr{Ptr{Cvoid}}, buf_len_ptr::Ptr{Csize_t})

See libhdf5 documentation for H5Pget_file_image.

source
h5p_get_file_image(fapl_id)::Vector{UInt8}

Retrieve a file image of the appropriate size in a Vector{UInt8}.

source
HDF5.API.h5p_get_filterFunction
h5p_get_filter(plist_id::hid_t, idx::Cuint, flags::Ptr{Cuint}, cd_nemlts::Ref{Csize_t}, cd_values::Ptr{Cuint}, namelen::Csize_t, name::Ptr{Cchar}, filter_config::Ptr{Cuint}) -> H5Z_filter_t

See libhdf5 documentation for H5Pget_filter2.

source
HDF5.API.h5p_get_filter_by_idFunction
h5p_get_filter_by_id(plist_id::hid_t, filter_id::H5Z_filter_t, flags::Ref{Cuint}, cd_nelmts::Ref{Csize_t}, cd_values::Ptr{Cuint}, namelen::Csize_t, name::Ptr{UInt8}, filter_config::Ptr{Cuint})

See libhdf5 documentation for H5Pget_filter_by_id2.

source
HDF5.API.h5p_insertFunction
h5p_insert(plist_id::hid_t, name::Cstring, size::Csize_t, value::Ptr{Cvoid}, prp_set::H5P_prp_set_func_t, prp_get::H5P_prp_get_func_t, prp_delete::H5P_prp_delete_func_t, prp_copy::H5P_prp_copy_func_t, prp_close::H5P_prp_close_func_t)

See libhdf5 documentation for H5Pinsert1.

source
h5p_insert(plist_id::hid_t, name::Cstring, size::Csize_t, value::Ptr{Cvoid}, set::H5P_prp_set_func_t, get::H5P_prp_get_func_t, prp_del::H5P_prp_delete_func_t, copy::H5P_prp_copy_func_t, compare::H5P_prp_compare_func_t, close::H5P_prp_close_func_t)

See libhdf5 documentation for H5Pinsert2.

source
HDF5.API.h5p_registerFunction
h5p_register(cls_id::hid_t, name::Cstring, size::Csize_t, def_value::Ptr{Cvoid}, prp_create::H5P_prp_create_func_t, prp_set::H5P_prp_set_func_t, prp_get::H5P_prp_get_func_t, prp_del::H5P_prp_delete_func_t, prp_copy::H5P_prp_copy_func_t, prp_close::H5P_prp_close_func_t)

See libhdf5 documentation for H5Pregister1.

source
h5p_register(cls_id::hid_t, name::Cstring, size::Csize_t, def_value::Ptr{Cvoid}, create::H5P_prp_create_func_t, set::H5P_prp_set_func_t, get::H5P_prp_get_func_t, prp_del::H5P_prp_delete_func_t, copy::H5P_prp_copy_func_t, compare::H5P_prp_compare_func_t, close::H5P_prp_close_func_t)

See libhdf5 documentation for H5Pregister2.

source

H5R — Reference Interface

HDF5.API.h5r_createFunction
h5r_create(ref::Ptr{Cvoid}, loc_id::hid_t, pathname::Cstring, ref_type::Cint, space_id::hid_t)

See libhdf5 documentation for H5Rcreate.

source

H5S — Dataspace Interface


H5T — Datatype Interface

HDF5.API.h5t_commitFunction
h5t_commit(loc_id::hid_t, name::Cstring, dtype_id::hid_t, lcpl_id::hid_t, tcpl_id::hid_t, tapl_id::hid_t)

See libhdf5 documentation for H5Tcommit2.

source
HDF5.API.h5t_get_fieldsFunction
h5t_get_fields(dtype_id::hid_t, spos::Ref{Csize_t}, epos::Ref{Csize_t}, esize::Ref{Csize_t}, mpos::Ref{Csize_t}, msize::Ref{Csize_t})

See libhdf5 documentation for H5Tget_fields.

source

H5Z — Filter Interface


H5FD — File Drivers


H5DO — Optimized Functions Interface

HDF5.API.h5do_appendFunction
h5do_append(dset_id::hid_t, dxpl_id::hid_t, index::Cuint, num_elem::hsize_t, memtype::hid_t, buffer::Ptr{Cvoid})

See libhdf5 documentation for H5DOappend.

source

H5DS — Dimension Scale Interface


H5LT — Lite Interface


H5TB — Table Interface

HDF5.API.h5tb_append_recordsFunction
h5tb_append_records(loc_id::hid_t, dset_name::Cstring, nrecords::hsize_t, type_size::Csize_t, field_offset::Ptr{Csize_t}, field_sizes::Ptr{Csize_t}, data::Ptr{Cvoid})

See libhdf5 documentation for H5TBappend_records.

source
HDF5.API.h5tb_get_field_infoFunction
h5tb_get_field_info(loc_id::hid_t, table_name::Cstring, field_names::Ptr{Ptr{UInt8}}, field_sizes::Ptr{Csize_t}, field_offsets::Ptr{Csize_t}, type_size::Ptr{Csize_t})

See libhdf5 documentation for H5TBget_field_info.

source
HDF5.API.h5tb_make_tableFunction
h5tb_make_table(table_title::Cstring, loc_id::hid_t, dset_name::Cstring, nfields::hsize_t, nrecords::hsize_t, type_size::Csize_t, field_names::Ptr{Cstring}, field_offset::Ptr{Csize_t}, field_types::Ptr{hid_t}, chunk_size::hsize_t, fill_data::Ptr{Cvoid}, compress::Cint, data::Ptr{Cvoid})

See libhdf5 documentation for H5TBmake_table.

source
HDF5.API.h5tb_read_recordsFunction
h5tb_read_records(loc_id::hid_t, table_name::Cstring, start::hsize_t, nrecords::hsize_t, type_size::Csize_t, field_offsets::Ptr{Csize_t}, dst_sizes::Ptr{Csize_t}, data::Ptr{Cvoid})

See libhdf5 documentation for H5TBread_records.

source
HDF5.API.h5tb_read_tableFunction
h5tb_read_table(loc_id::hid_t, table_name::Cstring, dst_size::Csize_t, dst_offset::Ptr{Csize_t}, dst_sizes::Ptr{Csize_t}, dst_buf::Ptr{Cvoid})

See libhdf5 documentation for H5TBread_table.

source
HDF5.API.h5tb_write_recordsFunction
h5tb_write_records(loc_id::hid_t, table_name::Cstring, start::hsize_t, nrecords::hsize_t, type_size::Csize_t, field_offsets::Ptr{Csize_t}, field_sizes::Ptr{Csize_t}, data::Ptr{Cvoid})

See libhdf5 documentation for H5TBwrite_records.

source