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::Ptr{UInt8}, 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::Ptr{UInt8}, attr_name::Ptr{UInt8}, 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
HDF5.API.h5a_open_by_idxFunction
h5a_open_by_idx(obj_id::hid_t, pathname::Ptr{UInt8}, idx_type::Cint, order::Cint, n::hsize_t, aapl_id::hid_t, lapl_id::hid_t) -> hid_t

See libhdf5 documentation for H5Aopen_by_idx.

source

H5D — Dataset Interface

HDF5.API.h5d_createFunction
h5d_create(loc_id::hid_t, pathname::Ptr{UInt8}, 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_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::Ptr{UInt8}, 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::Ptr{UInt8}, dest_obj_id::hid_t, dest_name::Ptr{UInt8}, 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::Ptr{UInt8}, dst_loc_id::hid_t, dst_name::Ptr{UInt8}, ocpypl_id::hid_t, lcpl_id::hid_t)

See libhdf5 documentation for H5Ocopy.

source

H5PL — Plugin Interface


H5P — Property Interface

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_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::Ptr{Cchar}, 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::Ptr{Cchar}, 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::Ptr{Cchar}, 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::Ptr{Cchar}, 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::Ptr{UInt8}, 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::Ptr{UInt8}, 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


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::Ptr{UInt8}, 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::Ptr{UInt8}, 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::Ptr{UInt8}, loc_id::hid_t, dset_name::Ptr{UInt8}, nfields::hsize_t, nrecords::hsize_t, type_size::Csize_t, field_names::Ptr{Ptr{UInt8}}, 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::Ptr{UInt8}, 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::Ptr{UInt8}, 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::Ptr{UInt8}, start::hsize_t, nrecords::hsize_t, type_size::Csize_t, field_offsets::Ptr{UInt8}, field_sizes::Ptr{UInt8}, data::Ptr{Cvoid})

See libhdf5 documentation for H5TBwrite_records.

source