HDF5 documents and links 
Introduction to HDF5 
HDF5 User Guide 
Other High-level API documents
And in this document, the HDF5 Reference Manual  
H5DS   H5IM   H5LT   H5PT   H5TB  
H5   H5A   H5D   H5E   H5F   H5G   H5I   H5L  
H5O   H5P   H5R   H5S   H5T   H5Z   Tools   Datatypes  

H5LT: HDF5 Lite

HDF5 Lite API 

The HDF5 Lite API consists of higher-level functions which do more operations per call than the basic HDF5 interface. The purpose is to wrap intuitive functions around certain sets of features in the existing APIs. This version of the API has two sets of functions: dataset and attribute related functions.

The following functions are part of the HDF5 Lite API. 

The C Interfaces:

Dataset functions

Make dataset functions

Read dataset functions

Query dataset functions

Datatype functions

Datatype translation functions

Attribute functions

Set attribute functions

Get attribute functions

Query attribute functions

The FORTRAN90 Interfaces:
In general, each FORTRAN90 subroutine performs exactly the same task as the corresponding C function. There are four types supported: integer, real, double precision and character array. The <TYPE> notation below is one of these four types. The corresponding C functions are for the int, float, double and string cases.

Dataset functions

Make dataset functions

Read dataset functions

Query dataset functions

Attribute functions

Set attribute functions

Get attribute functions

Query attribute functions

 


Name: H5LTmake_dataset
Signature:
herr_t H5LTmake_dataset ( hid_t loc_id, const char *dset_name, int rank, const hsize_t *dims, hid_t type_id, const void *buffer )

Purpose:
Creates and writes a dataset of a type type_id.

Description:
H5LTmake_dataset creates and writes a dataset named dset_name attached to the object specified by the identifier loc_id.

The parameter type_id can be any valid HDF5 predefined native datatype; For example, setting type_id to H5T_NATIVE_INT will result in a dataset of signed integer datatype.

Parameters:
hid_t loc_id IN: Identifier of the file or group to create the dataset within.
const char *dset_name    IN: The name of the dataset to create.
int rank IN: Number of dimensions of dataspace.
const hsize_t * dims IN: An array of the size of each dimension.
hid_t type_id IN: Identifier of the datatype to use when creating the dataset.
const void * buffer IN: Buffer with data to be written to the dataset.

Returns:
Returns a non-negative value if successful; otherwise returns a negative value.

Fortran90 Interface: h5ltmake_dataset_f
This subroutine can create and write a dataset of up to seven (7) dimensions.
subroutine h5ltmake_dataset_f(loc_id, dset_name, rank, dims, type_id, &
                              buf, errcode)
  implicit none
  integer(HID_T), intent(IN) :: loc_id            ! file or group identifier 
  character(LEN=*), intent(IN) :: dset_name       ! name of the dataset 
  integer, intent(IN) :: rank                     ! rank 
  integer(HSIZE_T), dimension(*), intent(IN) :: dims 
                                                  ! size of the bufffer buf  
  integer(HID_T), intent(IN) :: type_id           ! datatype identifier 
  <TYPE>, intent(IN), dimension(*) :: buf         ! data buffer 
  integer :: errcode                              ! error code
end subroutine h5ltmake_dataset_f                               

History:
Release     Change
1.8.7 Fortran subroutine modified in this release to accomodate arrays with more than three dimensions.

Name: H5LTmake_dataset_char
Signature:
herr_t H5LTmake_dataset_char ( hid_t loc_id, const char *dset_name, int rank, const hsize_t *dims, const char *buffer )

Purpose:
Creates and writes a dataset.

Description:
H5LTmake_dataset_char creates and writes a dataset named dset_name attached to the object specified by the identifier loc_id.

The dataset’s datatype will be character, H5T_NATIVE_CHAR.

Parameters:
hid_t loc_id IN: Identifier of the file or group to create the dataset within.
const char *dset_name    IN: The name of the dataset to create.
int rank IN: Number of dimensions of dataspace.
const hsize_t * dims IN: An array of the size of each dimension.
const char * buffer IN: Buffer with data to be written to the dataset.

Returns:
Returns a non-negative value if successful; otherwise returns a negative value.

Name: H5LTmake_dataset_short
Signature:
herr_t H5LTmake_dataset_short ( hid_t loc_id, const char *dset_name, int rank, const hsize_t *dims, const short *buffer )

Purpose:
Creates and writes a dataset.

Description:
H5LTmake_dataset_short creates and writes a dataset named dset_name attached to the object specified by the identifier loc_id.

The dataset’s datatype will be short signed integer, H5T_NATIVE_SHORT.

Parameters:
hid_t loc_id IN: Identifier of the file or group to create the dataset within.
const char *dset_name    IN: The name of the dataset to create.
int rank IN: Number of dimensions of dataspace.
const hsize_t * dims IN: An array of the size of each dimension.
const short * buffer IN: Buffer with data to be written to the dataset.

Returns:
Returns a non-negative value if successful; otherwise returns a negative value.

Name: H5LTmake_dataset_int
Signature:
herr_t H5LTmake_dataset_int ( hid_t loc_id, const char *dset_name, int rank, const hsize_t *dims, const int *buffer )

Purpose:
Creates and writes a dataset.

Description:
H5LTmake_dataset_int creates and writes a dataset named dset_name attached to the object specified by the identifier loc_id.

The dataset’s datatype will be native signed integer, H5T_NATIVE_INT.

Parameters:
hid_t loc_id
IN: Identifier of the file or group to create the dataset within.
const char *dset_name
IN: The name of the dataset to create.
int rank
IN: Number of dimensions of dataspace.
const hsize_t * dims
IN: An array of the size of each dimension.
const int * buffer
IN: Buffer with data to be written to the dataset.

Returns:
Returns a non-negative value if successful; otherwise returns a negative value.

Fortran90 Interface: h5ltmake_dataset_int_f
This subroutine can create and write a dataset of up to seven (7) dimensions.
subroutine h5ltmake_dataset_int_f(loc_id, dset_name, rank, dims, buf, errcode)
  implicit none
  integer(HID_T), intent(IN) :: loc_id           ! file or group identifier 
  character(LEN=*), intent(IN) :: dset_name      ! name of the dataset 
  integer, intent(IN) :: rank                    ! rank 
  integer(HSIZE_T), dimension(*), intent(IN) :: dims 
                                                 ! size of the buffer buf  
  integer, intent(IN), dimension(*) :: buf       ! data buffer 
  integer :: errcode                             ! error code
end subroutine h5ltmake_dataset_int_f                                  

History:
Release     Change
1.8.7 Fortran subroutine modified in this release to accomodate arrays with more than three dimensions.

Name: H5LTmake_dataset_long
Signature:
herr_t H5LTmake_dataset_long ( hid_t loc_id, const char *dset_name, int rank, const hsize_t *dims, const long *buffer )

Purpose:
Creates and writes a dataset.

Description:
H5LTmake_dataset creates and writes a dataset named dset_name attached to the object specified by the identifier loc_id.

The dataset’s datatype will be long signed integer, H5T_NATIVE_LONG.

Parameters:
hid_t loc_id
IN: Identifier of the file or group to create the dataset within.
const char *dset_name
IN: The name of the dataset to create.
int rank
IN: Number of dimensions of dataspace.
const hsize_t * dims
IN: An array of the size of each dimension.
const long * buffer
IN: Buffer with data to be written to the dataset.

Returns:
Returns a non-negative value if successful; otherwise returns a negative value.

Name: H5LTmake_dataset_float
Signature:
herr_t H5LTmake_dataset_float ( hid_t loc_id, const char *dset_name, int rank, const hsize_t *dims, const float *buffer )

Purpose:
Creates and writes a dataset.

Description:
H5LTmake_dataset creates and writes a dataset named dset_name attached to the object specified by the identifier loc_id.

The dataset’s datatype will be native floating point, H5T_NATIVE_FLOAT.

Parameters:
hid_t loc_id
IN: Identifier of the file or group to create the dataset within.
const char *dset_name
IN: The name of the dataset to create.
int rank
IN: Number of dimensions of dataspace.
const hsize_t * dims
IN: An array of the size of each dimension.
const float * buffer
IN: Buffer with data to be written to the dataset.

Returns:
Returns a non-negative value if successful; otherwise returns a negative value.

Fortran90 Interface: h5ltmake_dataset_float_f
This subroutine can create and write a dataset of up to seven (7) dimensions.
subroutine h5ltmake_dataset_float_f(loc_id, dset_name, rank, dims, &
                                    buf, errcode)
  implicit none
  integer(HID_T), intent(IN) :: loc_id           ! file or group identifier 
  character(LEN=*), intent(IN) :: dset_name      ! name of the dataset 
  integer, intent(IN) :: rank                    ! rank 
  integer(HSIZE_T), dimension(*), intent(IN) :: dims 
                                                 ! size of the buffer buf  
  real, intent(IN), dimension(*) :: buf          ! data buffer 
  integer :: errcode                             ! error code
end subroutine h5ltmake_dataset_float_f                                

History:
Release     Change
1.8.7 Fortran subroutine modified in this release to accomodate arrays with more than three dimensions.

Name: H5LTmake_dataset_double
Signature:
herr_t H5LTmake_dataset_double ( hid_t loc_id, const char *dset_name, int rank, const hsize_t *dims, const double *buffer )

Purpose:
Creates and writes a dataset.

Description:
H5LTmake_dataset creates and writes a dataset named dset_name attached to the object specified by the identifier loc_id.

The dataset’s datatype will be native floating-point double, H5T_NATIVE_DOUBLE.

Parameters:
hid_t loc_id
IN: Identifier of the file or group to create the dataset within.
const char *dset_name
IN: The name of the dataset to create.
int rank
IN: Number of dimensions of dataspace.
const hsize_t * dims
IN: An array of the size of each dimension.
const double * buffer
IN: Buffer with data to be written to the dataset.

Returns:
Returns a non-negative value if successful; otherwise returns a negative value.

Fortran90 Interface: h5ltmake_dataset_double_f
This subroutine can create and write a dataset of up to seven (7) dimensions.
subroutine h5ltmake_dataset_double_f(loc_id, dset_name, rank, dims, &
                                     buf, errcode)
  implicit none
  integer(HID_T), intent(IN) :: loc_id           ! file or group identifier 
  character(LEN=*), intent(IN) :: dset_name      ! name of the dataset 
  integer, intent(IN) :: rank                    ! rank 
  integer(HSIZE_T), dimension(*), intent(IN) :: dims 
                                                 ! size of the buffer buf  
  double precision, intent(IN), dimension(*) :: buf  
                                                 ! data buffer 
  integer :: errcode                             ! error code
end subroutine h5ltmake_dataset_double_f                              

History:
Release     Change
1.8.7 Fortran subroutine modified in this release to accomodate arrays with more than three dimensions.

Name: H5LTmake_dataset_string
Signature:
herr_t H5LTmake_dataset_string ( hid_t loc_id, const char *dset_name, const char *buffer )

Purpose:
Creates and writes a dataset with string datatype.

Description:
H5LTmake_dataset_string creates and writes a dataset named dset_name attached to the object specified by the identifier loc_id.

The dataset’s datatype will be C string, H5T_C_S1.

Parameters:
hid_t loc_id
IN: Identifier of the file or group to create the dataset within.
const char *dset_name
IN: The name of the dataset to create.
const char * buffer
IN: Buffer with data to be written to the dataset.

Returns:
Returns a non-negative value if successful; otherwise returns a negative value.

Fortran90 Interface: h5ltmake_dataset_string_f
subroutine h5ltmake_dataset_string_f(loc_id, dset_name, buf, errcode)
  implicit none
  integer(HID_T), intent(IN) :: loc_id           ! file or group identifier 
  character(LEN=*), intent(IN) :: dset_name      ! name of the dataset 
  character(LEN=*), intent(IN), dimension(*) :: buf  
                                                 ! data buffer 
  integer :: errcode                             ! error code
end subroutine h5ltmake_dataset_string_f                             

Name: H5LTread_dataset
Signature:
herr_t H5LTread_dataset ( hid_t loc_id, const char *dset_name, hid_t type_id, void *buffer )

Purpose:
Reads a dataset from disk.

Description:
H5LTread_dataset reads a dataset named dset_name attached to the object specified by the identifier loc_id.

Parameters:
hid_t loc_id
IN: Identifier of the file or group to read the dataset within.
const char *dset_name
IN: The name of the dataset to read.
hid_t type_id
IN: Identifier of the datatype to use when reading the dataset.
void * buffer
OUT: Buffer with data.

Returns:
Returns a non-negative value if successful; otherwise returns a negative value.

Fortran90 Interface: h5ltread_dataset_f
This subroutine can read a dataset of up to seven (7) dimensions.
subroutine h5ltread_dataset_f(loc_id, dset_name, type_id, buf, dims, errcode)
  implicit none
  integer(HID_T), intent(IN) :: loc_id               ! file or group identifier 
  character(LEN=*), intent(IN) :: dset_name          ! name of the dataset 
  integer(HID_T), intent(IN) :: type_id              ! datatype identifier 
  integer(HSIZE_T), dimension(*), intent(IN) :: dims ! size of the buffer buf 
  <TYPE>, intent(INOUT), dimension(*) :: buf         ! data buffer 
  integer :: errcode                                 ! error code
end subroutine h5ltread_dataset_f
      

History:
Release     Change
1.8.7 Fortran subroutine modified in this release to accomodate arrays with more than three dimensions.

Name: H5LTread_dataset_char
Signature:
herr_t H5LTread_dataset_char ( hid_t loc_id, const char *dset_name, char *buffer )

Purpose:
Reads a dataset from disk.

Description:
H5LTread_dataset_char reads a dataset named dset_name attached to the object specified by the identifier loc_id. The HDF5 datatype is H5T_NATIVE_CHAR.

Parameters:
hid_t loc_id
IN: Identifier of the file or group to read the dataset within.
const char *dset_name
IN: The name of the dataset to read.
char * buffer
OUT: Buffer with data.

Returns:
Returns a non-negative value if successful; otherwise returns a negative value.

Name: H5LTread_dataset_short
Signature:
herr_t H5LTread_dataset_short ( hid_t loc_id, const char *dset_name, short *buffer )

Purpose:
Reads a dataset from disk.

Description:
H5LTread_dataset_short reads a dataset named dset_name attached to the object specified by the identifier loc_id. The HDF5 datatype is H5T_NATIVE_SHORT.

Parameters:
hid_t loc_id
IN: Identifier of the file or group to read the dataset within.
const char *dset_name
IN: The name of the dataset to read.
short * buffer
OUT: Buffer with data.

Returns:
Returns a non-negative value if successful; otherwise returns a negative value.

Name: H5LTread_dataset_int
Signature:
herr_t H5LTread_dataset_int ( hid_t loc_id, const char *dset_name, int *buffer )

Purpose:
Reads a dataset from disk.

Description:
H5LTread_dataset_int reads a dataset named dset_name attached to the object specified by the identifier loc_id. The HDF5 datatype is H5T_NATIVE_INT.

Parameters:
hid_t loc_id
IN: Identifier of the file or group to read the dataset within.
const char *dset_name
IN: The name of the dataset to read.
int * buffer
OUT: Buffer with data.

Returns:
Returns a non-negative value if successful; otherwise returns a negative value.

Fortran90 Interface: h5ltread_dataset_int_f
This subroutine can read a dataset of up to seven (7) dimensions.
subroutine h5ltread_dataset_int_f(loc_id, dset_name, type_id, buf, &
                                  dims, errcode)
  implicit none
  integer(HID_T), intent(IN) :: loc_id           ! file or group identifier 
  character(LEN=*), intent(IN) :: dset_name      ! name of the dataset 
  integer(HID_T), intent(IN) :: type_id          ! datatype identifier 
  integer(HSIZE_T), dimension(*), intent(IN) :: dims 
                                                 ! size of the buffer buf 
  integer, intent(INOUT), dimension(*) :: buf    ! data buffer 
  integer :: errcode                             ! error code
end subroutine h5ltread_dataset_int_f
      

History:
Release     Change
1.8.7 Fortran subroutine modified in this release to accomodate arrays with more than three dimensions.

Name: H5LTread_dataset_long
Signature:
herr_t H5LTread_dataset_long ( hid_t loc_id, const char *dset_name, long *buffer )

Purpose:
Reads a dataset from disk.

Description:
H5LTread_dataset_long reads a dataset named dset_name attached to the object specified by the identifier loc_id. The HDF5 datatype is H5T_NATIVE_LONG.

Parameters:
hid_t loc_id
IN: Identifier of the file or group to read the dataset within.
const char *dset_name
IN: The name of the dataset to read.
long * buffer
OUT: Buffer with data.

Returns:
Returns a non-negative value if successful; otherwise returns a negative value.

Name: H5LTread_dataset_float
Signature:
herr_t H5LTread_dataset_float ( hid_t loc_id, const char *dset_name, float *buffer )

Purpose:
Reads a dataset from disk.

Description:
H5LTread_dataset reads a dataset named dset_name attached to the object specified by the identifier loc_id. The HDF5 datatype is H5T_NATIVE_FLOAT.

Parameters:
hid_t loc_id
IN: Identifier of the file or group to read the dataset within.
const char *dset_name
IN: The name of the dataset to read.
float * buffer
OUT: Buffer with data.

Returns:
Returns a non-negative value if successful; otherwise returns a negative value.

Fortran90 Interface: h5ltread_dataset_float_f
This subroutine can read a dataset of up to seven (7) dimensions.
subroutine h5ltread_dataset_float_f(loc_id, dset_name, type_id, buf, &
                                    dims, errcode)
  implicit none
  integer(HID_T), intent(IN) :: loc_id               ! file or group identifier 
  character(LEN=*), intent(IN) :: dset_name          ! name of the dataset 
  integer(HID_T), intent(IN) :: type_id              ! datatype identifier 
  integer(HSIZE_T), dimension(*), intent(IN) :: dims ! size of the buffer buf 
  real, intent(INOUT), dimension(*) :: buf           ! data buffer 
  integer :: errcode                                 ! error code
end subroutine h5ltread_dataset_float_f
      

History:
Release     Change
1.8.7 Fortran subroutine modified in this release to accomodate arrays with more than three dimensions.

Name: H5LTread_dataset_double
Signature:
herr_t H5LTread_dataset_double ( hid_t loc_id, const char *dset_name, double *buffer )

Purpose:
Reads a dataset from disk.

Description:
H5LTread_dataset reads a dataset named dset_name attached to the object specified by the identifier loc_id. The HDF5 datatype is H5T_NATIVE_DOUBLE.

Parameters:
hid_t loc_id
IN: Identifier of the file or group to read the dataset within.
const char *dset_name
IN: The name of the dataset to read.
double * buffer
OUT: Buffer with data.

Returns:
Returns a non-negative value if successful; otherwise returns a negative value.

Fortran90 Interface: h5ltread_dataset_double_f
This subroutine can read a dataset of up to seven (7) dimensions.
subroutine h5ltread_dataset_double_f(loc_id, dset_name, type_id, buf, &
                                     dims, errcode)
  implicit none
  integer(HID_T), intent(IN) :: loc_id           ! file or group identifier 
  character(LEN=*), intent(IN) :: dset_name      ! name of the dataset 
  integer(HID_T), intent(IN) :: type_id          ! datatype identifier 
  integer(HSIZE_T), dimension(*), intent(IN) :: dims 
                                                 ! size of the buffer buf 
  double precision, intent(INOUT), dimension(*) :: buf 
                                                 ! data buffer 
  integer :: errcode                             ! error code
end subroutine h5ltread_dataset_double_f
      

History:
Release     Change
1.8.7 Fortran subroutine modified in this release to accomodate arrays with more than three dimensions.

Name: H5LTread_dataset_string
Signature:
herr_t H5LTread_dataset_string ( hid_t loc_id, const char *dset_name, char *buffer )

Purpose:
Reads a dataset from disk.

Description:
H5LTread_dataset_string reads a dataset named dset_name attached to the object specified by the identifier loc_id. The HDF5 datatype is H5T_C_S1.

Parameters:
hid_t loc_id
IN: Identifier of the file or group to read the dataset within.
const char *dset_name
IN: The name of the dataset to read.
double * buffer
OUT: Buffer with data.

Returns:
Returns a non-negative value if successful; otherwise returns a negative value.

Fortran90 Interface: h5ltread_dataset_string_f
subroutine h5ltread_dataset_string_f(loc_id,dset_name,buf,errcode ) 
  implicit none
  integer(hid_t),   intent(in) :: loc_id         ! file or group identifier 
  character(len=*), intent(in) :: dset_name      ! name of the dataset 
  character(len=*), intent(inout) :: buf         ! data buffer
  integer :: errcode                             ! error code
end subroutine h5ltread_dataset_string_f
      

Name: H5LTfind_dataset
Signature:
herr_t H5LTfind_dataset ( hid_t loc_id, const char *dset_name )

Purpose:
Determines whether a dataset exists.

Description:
H5LTfind_dataset determines whether a dataset named dset_name exists in the group specified by loc_id.

loc_id must be a group identifier and dset_name must specify a dataset that is a member of that group.

Parameters:
hid_t loc_id
IN: Identifier of the group containing the dataset.
const char *dset_name
IN: Dataset name.

Returns:
Returns 1 if the dataset exists, returns 0 otherwise.

Fortran90 Interface: h5ltfind_dataset_f
integer function h5ltfind_dataset_f(loc_id, dset_name, errcode)
  implicit none
  integer(HID_T), intent(IN) :: loc_id               ! group identifier 
  character(LEN=*), intent(IN) :: dset_name          ! name of the dataset 
  integer :: errcode                                 ! error code
end function h5ltfind_dataset_f
      

Name: H5LTget_dataset_ndims
Signature:
herr_t H5LTget_dataset_ndims ( hid_t loc_id, const char *dset_name, int *rank )

Purpose:
Gets the dimensionality of a dataset.

Description:
H5LTget_dataset_ndims gets the dimensionality of a dataset named dset_name exists attached to the object loc_id.

Parameters:
hid_t loc_id
IN: Identifier of the object to locate the dataset within.
const char *dset_name
IN: The dataset name.
int * rank
OUT: The dimensionality of the dataset.

Returns:
Returns a non-negative value if successful; otherwise returns a negative value.

Fortran90 Interface: h5ltget_dataset_ndims_f
subroutine h5ltget_dataset_ndims_f(loc_id, dset_name, rank, errcode)
  implicit none
  integer(HID_T), intent(IN) :: loc_id           ! file or group identifier 
  character(LEN=*), intent(IN) :: dset_name      ! name of the dataset 
  integer, intent(INOUT) :: rank                 ! rank 
  integer :: errcode                             ! error code
end subroutine h5ltget_dataset_ndims_f
      

Name: H5LTget_dataset_info
Signature:
herr_t H5LTget_dataset_info ( hid_t loc_id, const char *dset_name, hsize_t *dims, H5T_class_t *class_id, size_t *type_size )

Purpose:
Gets information about a dataset.

Description:
H5LTget_dataset_info gets information about a dataset named dset_name exists attached to the object loc_id.

Parameters:
hid_t loc_id
IN: Identifier of the object to locate the dataset within.
const char *dset_name
IN: The dataset name.
hsize_t * dims
OUT: The dimensions of the dataset.
H5T_class_t * class_id
OUT: The class identifier. To a list of the HDF5 class types please refer to the Datatype Interface API help.
size_t * type_size
OUT: The size of the datatype in bytes.

Returns:
Returns a non-negative value if successful; otherwise returns a negative value.

Fortran90 Interface: h5ltget_dataset_info_f
subroutine h5ltget_dataset_info_f(loc_id, dset_name, dims, type_class, &
                                  type_size, errcode)
  implicit none
  integer(HID_T), intent(IN) :: loc_id           ! file or group identifier 
  character(LEN=*), intent(IN) :: dset_name      ! name of the dataset 
  integer(HSIZE_T),dimension(*),intent(INOUT):: dims 
                                                 ! dimensions 
  integer, intent(INOUT)         :: type_class   ! type class
  integer(SIZE_T), intent(INOUT) :: type_size    ! type size
  integer :: errcode                             ! error code
end subroutine h5ltget_dataset_info_f
      

Name: H5LTset_attribute_string
Signature:
herr_t H5LTset_attribute_string( hid_t loc_id, const char *obj_name, const char *attr_name, const char *attr_data )

Purpose:
Creates and writes a string attribute.

Description:
H5LTattach_attribute creates and writes a string attribute named attr_name and attaches it to the object specified by the name obj_name. If the attribute already exists, it is overwritten.

Parameters:
hid_t loc_id
IN: Identifier of the object (dataset or group) to create the attribute within.
const char *obj_name
IN: The name of the object to attach the attribute.
const char *attr_name
IN: The attribute name.
const char * attr_data
IN: Buffer with data to be written to the attribute.

Returns:
Returns a non-negative value if successful; otherwise returns a negative value.

Fortran90 Interface: h5ltset_attribute_string_f
subroutine h5ltset_attribute_string_f(loc_id, dset_name, attr_name, &
                                      buf, errcode )
  implicit none
  integer(HID_T), intent(IN) :: loc_id           ! file or group identifier 
  character(LEN=*), intent(IN) :: dset_name      ! name of the dataset 
  character(LEN=*), intent(IN) :: attr_name      ! name of the attribute
  integer :: errcode                             ! error code
  character(LEN=*), intent(IN) :: buf            ! data buffer
end subroutine h5ltset_attribute_string_f
      

Name: H5LTset_attribute_char
Signature:
herr_t H5LTset_attribute_char ( hid_t loc_id, const char *obj_name, const char *attr_name, char *buffer, hsize_t size)

Purpose:
Creates and writes an attribute.

Description:
H5LTset_attribute_char creates and writes a numerical attribute named attr_name and attaches it to the object specified by the name obj_name. The attribute has a dimensionality of 1. The HDF5 datatype of the attribute is H5T_NATIVE_CHAR.

Parameters:
hid_t loc_id
IN: Identifier of the object ( dataset or group) to create the attribute within.
const char *obj_name
IN: The name of the object to attach the attribute.
const char *attr_name
IN: The attribute name.
char * buffer
IN: Buffer with data to be written to the attribute.
hsize_t size
IN: The size of the 1D array (one in the case of a scalar attribute). This value is used by H5Screate_simple to create the dataspace.

Returns:
Returns a non-negative value if successful; otherwise returns a negative value.

Name: H5LTset_attribute_uchar

See H5LTset_attribute_char. This function is the unsigned version and it uses the H5T_NATIVE_UCHAR datatype instead.

Name: H5LTset_attribute_short
Signature:
herr_t H5LTset_attribute_short ( hid_t loc_id, const char *obj_name, const char *attr_name, short *buffer, hsize_t size)

Purpose:
Creates and writes an attribute.

Description:
H5LTset_attribute_short creates and writes a numerical attribute named attr_name and attaches it to the object specified by the name obj_name. The attribute has a dimensionality of 1. The HDF5 datatype of the attribute is H5T_NATIVE_SHORT.

Parameters:
hid_t loc_id
IN: Identifier of the object ( dataset or group) to create the attribute within.
const char *obj_name
IN: The name of the object to attach the attribute.
const char *attr_name
IN: The attribute name.
short * buffer
IN: Buffer with data to be written to the attribute.
hsize_t size
IN: The size of the 1D array (one in the case of a scalar attribute). This value is used by H5Screate_simple to create the dataspace.

Returns:
Returns a non-negative value if successful; otherwise returns a negative value.

Name: H5LTset_attribute_ushort

See H5LTset_attribute_short. This function is the unsigned version and it uses the H5T_NATIVE_USHORT datatype instead.

Name: H5LTset_attribute_int
Signature:
herr_t H5LTset_attribute_int( hid_t loc_id, const char *obj_name, const char *attr_name, int *buffer, hsize_t size)

Purpose:
Creates and writes an attribute.

Description:
H5LTset_attribute_int creates and writes a numerical integer attribute named attr_name and attaches it to the object specified by the name obj_name. The attribute has a dimensionality of 1. The HDF5 datatype of the attribute is H5T_NATIVE_INT.

Parameters:
hid_t loc_id
IN: Identifier of the object ( dataset or group) to create the attribute within.
const char *obj_name
IN: The name of the object to attach the attribute.
const char *attr_name
IN: The attribute name.
int * buffer
IN: Buffer with data to be written to the attribute.
hsize_t size
IN: The size of the 1D array (one in the case of a scalar attribute). This value is used by H5Screate_simple to create the dataspace.

Returns:
Returns a non-negative value if successful; otherwise returns a negative value.

Fortran90 Interface: h5ltset_attribute_int_f
subroutine h5ltset_attribute_int_f(loc_id, dset_name, attr_name, buf, &
                                   size, errcode)
  implicit none
  integer(HID_T), intent(IN) :: loc_id         ! file or group identifier 
  character(LEN=*), intent(IN) :: dset_name    ! name of the dataset 
  character(LEN=*), intent(IN) :: attr_name    ! name of the attribute
  integer, intent(IN), dimension(*) :: buf     ! data buffer
  integer(size_t), intent(IN) :: size          ! size of attribute array
  integer :: errcode                           ! error code
end subroutine h5ltset_attribute_int_f
      

Name: H5LTset_attribute_uint

See H5LTset_attribute_int. This function is the unsigned version and it uses the H5T_NATIVE_UINT datatype instead.

Name: H5LTset_attribute_long
Signature:
herr_t H5LTset_attribute_long ( hid_t loc_id, const char *obj_name, const char *attr_name, long *buffer, hsize_t size)

Purpose:
Creates and writes an attribute.

Description:
H5LTset_attribute_long creates and writes a numerical attribute named attr_name and attaches it to the object specified by the name obj_name. The attribute has a dimensionality of 1. The HDF5 datatype of the attribute is H5T_NATIVE_LONG.

Parameters:
hid_t loc_id
IN: Identifier of the object ( dataset or group) to create the attribute within.
const char *obj_name
IN: The name of the object to attach the attribute.
const char *attr_name
IN: The attribute name.
long * buffer
IN: Buffer with data to be written to the attribute.
hsize_t size
IN: The size of the 1D array (one in the case of a scalar attribute). This value is used by H5Screate_simple to create the dataspace.

Returns:
Returns a non-negative value if successful; otherwise returns a negative value.

Name: H5LTset_attribute_long_long
Signature:
herr_t H5LTset_attribute_long_long (hid_t loc_id, const char *obj_name, const char *attr_name, const long_long *data, size_t size)

Purpose:
Creates and writes an attribute.

Description:
H5LTset_attribute_long_long creates and writes a numerical attribute named attr_name and attaches it to the object specified by the name obj_name.

The attribute has a dimensionality of 1 and its HDF5 datatype is H5T_NATIVE_LLONG.

Parameters:

Returns:
Returns a non-negative value if successful; otherwise returns a negative value.

Name: H5LTset_attribute_ulong

See H5LTset_attribute_long. This function is the unsigned version and it uses the H5T_NATIVE_ULONG datatype instead.

Name: H5LTset_attribute_float
Signature:
herr_t H5LTset_attribute_float( hid_t loc_id, const char *obj_name, const char *attr_name, float *buffer, hsize_t size )

Purpose:
Creates and writes an attribute.

Description:
H5LTset_attribute_float creates and writes a numerical floating point attribute named attr_name and attaches it to the object specified by the name obj_name. The attribute has a dimensionality of 1. The HDF5 datatype of the attribute is H5T_NATIVE_FLOAT.

Parameters:
hid_t loc_id
IN: Identifier of the object ( dataset or group) to create the attribute within.
const char *obj_name
IN: The name of the object to attach the attribute.
const char *attr_name
IN: The attribute name.
float * buffer
IN: Buffer with data to be written to the attribute.
hsize_t size
IN: The size of the 1D array (one in the case of a scalar attribute). This value is used by H5Screate_simple to create the dataspace.

Returns:
Returns a non-negative value if successful; otherwise returns a negative value.

Fortran90 Interface: h5ltset_attribute_float_f
subroutine h5ltset_attribute_float_f(loc_id, dset_name, attr_name, &
                                     buf, size, errcode)
  implicit none
  integer(HID_T), intent(IN) :: loc_id           ! file or group identifier 
  character(LEN=*), intent(IN) :: dset_name      ! name of the dataset 
  character(LEN=*), intent(IN) :: attr_name      ! name of the attribute
  real, intent(INOUT), dimension(*) :: buf       ! data buffer
  integer(size_t),  intent(in) :: size           ! size of attribute array
  integer :: errcode                             ! error code
end subroutine h5ltset_attribute_float_f
      

Name: H5LTset_attribute_double
Signature:
herr_t H5LTset_attribute_double ( hid_t loc_id, const char *obj_name, const char *attr_name, const double *buffer, size_t size )

Purpose:
Creates and writes an attribute.

Description:
H5LTset_attribute_double creates and writes a numerical attribute named attr_name and attaches it to the object specified by the name obj_name. The attribute has a dimensionality of 1. The HDF5 datatype of the attribute is H5T_NATIVE_DOUBLE.

Parameters:
hid_t loc_id
IN: Identifier of the object ( dataset or group) to create the attribute within.
const char *obj_name
IN: The name of the object to attach the attribute.
const char *attr_name
IN: The attribute name.
const double * buffer
IN: Buffer with data to be written to the attribute.
size_t size
IN: The size of the 1D array (one in the case of a scalar attribute). This value is used by H5Screate_simple to create the dataspace.

Returns:
Returns a non-negative value if successful; otherwise returns a negative value.

Fortran90 Interface: h5ltset_attribute_double_f
subroutine h5ltset_attribute_double_f(loc_id, dset_name, attr_name, &
                                      buf, errcode )
  implicit none
  integer(HID_T),   intent(IN) :: loc_id         ! file or group identifier 
  character(LEN=*), intent(IN) :: dset_name      ! name of the dataset 
  character(LEN=*), intent(IN) :: attr_name      ! name of the attribute
  integer(size_t), intent(IN) :: size            ! size of attribute array
  integer :: errcode                             ! error code
  double precision, intent(INOUT), dimension(*) :: buf  
                                                 ! data buffer
end subroutine h5ltset_attribute_double_f
      

Name: H5LTget_attribute
Signature:
herr_t H5LTget_attribute( hid_t loc_id, const char *obj_name, const char *attr_name,  hid_t mem_type_id, void *data )

Purpose:
Reads an attribute from disk.

Description:
H5LTget_attribute reads an attribute named attr_name with the memory type mem_type_id.

Parameters:
hid_t loc_id
IN: Identifier of the object ( dataset or group) to read the attribute from.
const char *obj_name
IN: The name of the object that the attribute is attached to.
const char *attr_name
IN: The attribute name.
hid_t mem_type_id
IN: Identifier of the memory datatype.
void * data
OUT: Buffer with data.

Returns:
Returns a non-negative value if successful; otherwise returns a negative value.

Name: H5LTget_attribute_string
Signature:
herr_t H5LTget_attribute_string( hid_t loc_id, const char *obj_name, const char *attr_name,  char *data )

Purpose:
Reads an attribute from disk.

Description:
H5LTget_attribute reads an attribute named attr_name that is attached to the object specified by the name obj_name.

Parameters:
hid_t loc_id
IN: Identifier of the object ( dataset or group) to read the attribute from.
const char *obj_name
IN: The name of the object that the attribute is attached to.
const char *attr_name
IN: The attribute name.
char * data
OUT: Buffer with data.

Returns:
Returns a non-negative value if successful; otherwise returns a negative value.

Fortran90 Interface: h5ltget_attribute_string_f
subroutine h5ltget_attribute_string_f(loc_id, dset_name, attr_name, &
                                      buf, errcode)
  implicit none
  integer(HID_T), intent(IN) :: loc_id           ! file or group identifier 
  character(LEN=*), intent(IN) :: dset_name      ! name of the dataset 
  character(LEN=*), intent(IN) :: attr_name      ! name of the attribute
  integer :: errcode                             ! error code
  character(LEN=*), intent(INOUT) :: buf         ! data buffer
end subroutine h5ltget_attribute_string_f
      

Name: H5LTget_attribute_char
Signature:
herr_t H5LTget_attribute( hid_t loc_id, const char *obj_name, const char *attr_name,  char *data )

Purpose:
Reads an attribute from disk.

Description:
H5LTget_attribute reads an attribute named attr_name that is attached to the object specified by the name obj_name. The HDF5 datatype of the attribute is H5T_NATIVE_CHAR.

Parameters:
hid_t loc_id
IN: Identifier of the object ( dataset or group) to read the attribute from.
const char *obj_name
IN: The name of the object that the attribute is attached to.
const char *attr_name
IN: The attribute name.
char * data
OUT: Buffer with data.

Returns:
Returns a non-negative value if successful; otherwise returns a negative value.

Name: H5LTget_attribute_uchar

See H5LTget_attribute_char. This function is the unsigned version and it uses the H5T_NATIVE_UCHAR datatype instead.

Name: H5LTget_attribute_short
Signature:
herr_t H5LTget_attribute_short( hid_t loc_id, const char *obj_name, const char *attr_name,  short *data )

Purpose:
Reads an attribute from disk.

Description:
H5LTget_attribute reads an attribute named attr_name that is attached to the object specified by the name obj_name. The HDF5 datatype of the attribute is H5T_NATIVE_SHORT.

Parameters:
hid_t loc_id
IN: Identifier of the object ( dataset or group) to read the attribute from.
const char *obj_name
IN: The name of the object that the attribute is attached to.
const char *attr_name
IN: The attribute name.
short * data
OUT: Buffer with data.

Returns:
Returns a non-negative value if successful; otherwise returns a negative value.

Name: H5LTget_attribute_ushort

See H5LTget_attribute_short. This function is the unsigned version and it uses the H5T_NATIVE_USHORT datatype instead.

Name: H5LTget_attribute_int
Signature:
herr_t H5LTget_attribute_int( hid_t loc_id, const char *obj_name, const char *attr_name,  int *data )

Purpose:
Reads an attribute from disk.

Description:
H5LTget_attribute reads an attribute named attr_name that is attached to the object specified by the name obj_name. The HDF5 datatype of the attribute is H5T_NATIVE_INT.

Parameters:
hid_t loc_id
IN: Identifier of the object ( dataset or group) to read the attribute from.
const char *obj_name
IN: The name of the object that the attribute is attached to.
const char *attr_name
IN: The attribute name.
int * data
OUT: Buffer with data.

Returns:
Returns a non-negative value if successful; otherwise returns a negative value.

Fortran90 Interface: h5ltget_attribute_int_f
subroutine h5ltget_attribute_int_f(loc_id, dset_name, attr_name, buf, errcode)
  implicit none
  integer(HID_T), intent(IN) :: loc_id             ! file or group identifier 
  character(LEN=*), intent(IN) :: dset_name        ! name of the dataset 
  character(LEN=*), intent(IN) :: attr_name        ! name of the attribute
  integer :: errcode                               ! error code
  integer, intent(IN), dimension(*) :: buf         ! data buffer
end subroutine h5ltget_attribute_int_f
      

Name: H5LTget_attribute_uint

See H5LTget_attribute_int. This function is the unsigned version and it uses the H5T_NATIVE_UINT datatype instead.

Name: H5LTget_attribute_long
Signature:
herr_t H5LTget_attribute_long( hid_t loc_id, const char *obj_name, const char *attr_name,  long *data )

Purpose:
Reads an attribute from disk.

Description:
H5LTget_attribute reads an attribute named attr_name that is attached to the object specified by the name obj_name. The HDF5 datatype of the attribute is H5T_NATIVE_LONG.

Parameters:
hid_t loc_id
IN: Identifier of the object ( dataset or group) to read the attribute from.
const char *obj_name
IN: The name of the object that the attribute is attached to.
const char *attr_name
IN: The attribute name.
long * data
OUT: Buffer with data.

Returns:
Returns a non-negative value if successful; otherwise returns a negative value.

Name: H5LTget_attribute_long_long
Signature:
herr_t H5LTget_attribute_long_long (hid_t loc_id, const char *obj_name, const char *attr_name, long_long *data)

Purpose:
Reads a long long attribute.

Description:
H5LTget_attribute_long_long reads the attribute specified by loc_id and obj_name.

Parameters:
hid_t loc_id Location of the object to which the attribute is attached.
const char *obj_name That object's name.
const char *attr_name     Attribute name.
long_long *data Attribute value.

Returns:
Returns a non-negative value if successful; otherwise returns a negative value.

Name: H5LTget_attribute_ulong

See H5LTget_attribute_long. This function is the unsigned version and it uses the H5T_NATIVE_ULONG datatype instead.

Name: H5LTget_attribute_float
Signature:
herr_t H5LTget_attribute_float( hid_t loc_id, const char *obj_name, const char *attr_name,  float *data )

Purpose:
Reads an attribute from disk.

Description:
H5LTget_attribute reads an attribute named attr_name that is attached to the object specified by the name obj_name. The HDF5 datatype of the attribute is H5T_NATIVE_FLOAT.

Parameters:
hid_t loc_id
IN: Identifier of the object ( dataset or group) to read the attribute from.
const char *obj_name
IN: The name of the object that the attribute is attached to.
const char *attr_name
IN: The attribute name.
float * data
OUT: Buffer with data.

Returns:
Returns a non-negative value if successful; otherwise returns a negative value.

Fortran90 Interface: h5ltget_attribute_float_f
subroutine h5ltget_attribute_float_f(loc_id, dset_name, attr_name, &
                                     buf, errcode)
  implicit none
  integer(HID_T), intent(IN) :: loc_id           ! file or group identifier 
  character(LEN=*), intent(IN) :: dset_name      ! name of the dataset 
  character(LEN=*), intent(IN) :: attr_name      ! name of the attribute
  integer :: errcode                             ! error code
  real, intent(IN), dimension(*) :: buf          ! data buffer
end subroutine h5ltget_attribute_float_f
      

Name: H5LTget_attribute_double
Signature:
herr_t H5LTget_attribute_double( hid_t loc_id, const char *obj_name, const char *attr_name,  double *data )

Purpose:
Reads an attribute from disk.

Description:
H5LTget_attribute reads an attribute named attr_name that is attached to the object specified by the name obj_name. The HDF5 datatype of the attribute is H5T_NATIVE_DOUBLE.

Parameters:
hid_t loc_id
IN: Identifier of the object ( dataset or group) to read the attribute from.
const char *obj_name
IN: The name of the object that the attribute is attached to.
const char *attr_name
IN: The attribute name.
double * data
OUT: Buffer with data.

Returns:
Returns a non-negative value if successful; otherwise returns a negative value.

Fortran90 Interface: h5ltget_attribute_double_f
subroutine h5ltget_attribute_double_f(loc_id, dset_name, attr_name, &
                                      buf, errcode)
  implicit none
  integer(HID_T), intent(IN) :: loc_id           ! file or group identifier 
  character(LEN=*), intent(IN) :: dset_name      ! name of the dataset 
  character(LEN=*), intent(IN) :: attr_name      ! name of the attribute
  integer :: errcode                             ! error code
  double precision, intent(IN), dimension(*) :: buf  
                                                 ! data buffer
end subroutine h5ltget_attribute_double_f
      

Name: H5LTfind_attribute
Signature:
herr_t H5LTfind_attribute ( hid_t loc_id, const char *attr_name )

Purpose:
Determines whether an attribute exists.

Description:
H5LTfind_attribute determines whether an attribute named attr_name exists attached to the object specified by loc_id.

loc_id must be an object identifier and attr_name must specify an attribute that is expected to be attached to that object.

Parameters:
hid_t loc_id
IN: Identifier of the object to which the attribute is expected to be attached.
const char *attr_name
IN: Attribute name.

Returns:
Returns 1 if the attribute exists; returns 0 otherwise.

Fortran90 Interface:
None.

Name: H5LTget_attribute_ndims
Signature:
herr_t H5LTget_attribute_ndims( hid_t loc_id, const char *obj_name, const char *attr_name,  int *rank )

Purpose:
Gets the dimensionality of an attribute.

Description:
H5LTget_attribute_ndims gets the dimensionality of an attribute named attr_name that is attached to the object specified by the name obj_name.

Parameters:
hid_t loc_id
IN: Identifier of the object ( dataset or group) to read the attribute from.
const char *obj_name
IN: The name of the object that the attribute is attached to.
const char *attr_name
IN: The attribute name.
int * rank
OUT: The dimensionality of the attribute.

Returns:
Returns a non-negative value if successful; otherwise returns a negative value.

Fortran90 Interface: h5ltget_attribute_ndims_f
subroutine h5ltget_attribute_ndims_f(loc_id, dset_name, attr_name, &
                                     rank, errcode)
  implicit none
  integer(HID_T), intent(IN) :: loc_id           ! file or group identifier 
  character(LEN=*), intent(IN) :: dset_name      ! name of the dataset 
  character(LEN=*), intent(IN) :: attr_name      ! name of the attribute
  integer, intent(INOUT) :: rank                 ! rank 
  integer :: errcode                             ! error code
  integer :: namelen                             ! name length
  integer :: attrlen                             ! name length
end subroutine h5ltget_attribute_ndims_f
      

Name: H5LTget_attribute_info
Signature:
herr_t H5LTget_attribute_info( hid_t loc_id, const char *obj_name, const char *attr_name,  hsize_t *dims, H5T_class_t *type_class, size_t *type_size )

Purpose:
Gets information about an attribute.

Description:
H5LTget_attribute_info gets information about an attribute named attr_name attached to the object specified by the name obj_name.

Parameters:
hid_t loc_id
IN: Identifier of the object ( dataset or group) to read the attribute from.
const char *obj_name
IN: The name of the object that the attribute is attached to.
const char *attr_name
IN: The attribute name.
hsize_t * dims
OUT: The dimensions of the attribute.
H5T_class_t * type_class
OUT: The class identifier. To a list of the HDF5 class types please refer to the Datatype Interface API help.
size_t * type_size
OUT: The size of the datatype in bytes.

Returns:
Returns a non-negative value if successful; otherwise returns a negative value.

Fortran90 Interface: h5ltget_attribute_info_f
subroutine h5ltget_attribute_info_f(loc_id, dset_name, attr_name, &
                                    dims, type_class, type_size, errcode)
  implicit none
  integer(HID_T), intent(IN) :: loc_id             ! file or group identifier 
  character(LEN=*), intent(IN) :: dset_name        ! name of the dataset 
  character(LEN=*), intent(IN) :: attr_name        ! name of the attribute
  integer(HSIZE_T),dimension(*),intent(INOUT):: dims 
                                                   ! dimensions 
  integer, intent(INOUT)         :: type_class     ! type class
  integer(SIZE_T), intent(INOUT) :: type_size      ! type size
  integer :: errcode                               ! error code
end subroutine h5ltget_attribute_info_f
      

Name: H5LTtext_to_dtype
Signature:
hid_t H5LTtext_to_dtype( const char *text, H5LT_lang_t lang_type)

Purpose:
Creates an HDF5 datatype given a text description.

Description:
Given a text description of a datatype, this function creates an HDF5 datatype and returns the datatype identifier. The text description of the datatype has to comply with the lang_type definition of HDF5 datatypes. Currently, only the DDL(H5LT_DDL) is supported. The complete DDL definition of HDF5 datatypes can be found in the last chapter of the HDF5 User’s Guide.

An example of DDL definition of enum type is shown as follows.

“H5T_ENUM { H5T_NATIVE_INT; 
            “Bob”        0;
            “Elena”      1;
            “Quincey”    2;      
            “Frank”      3;      }”

Parameters:

Returns:
Returns the datatype identifier(non-negative) if successful; otherwise returns a negative value.

Name: H5LTdtype_to_text
Signature:
herr_t H5LTdtype_to_text(hid_t datatype, char* str, H5LT_lang_t lang_type, size_t* len)

Purpose:
Creates a text description of an HDF5 datatype.

Description:
Given an HDF5 datatype identifier, this function creates a description of this datatype in lang_type language format.

A preliminary H5LTdtype_to_text call can be made to determine the size of the buffer needed with a NULL passed in for str. This value is returned as len. That value can then be assigned to len for a second H5Ttype_to_text call, which will retrieve the actual text description for the datatype.

If len is not big enough for the description, the text description will be truncated to fit in the buffer.

Currently only DDL (H5LT_DDL) is supported for lang_type. The complete DDL definition of HDF5 data types can be found in the last chapter of the HDF5 User’s Guide. An example of DDL definition of enum type is shown as follows.

“H5T_ENUM { H5T_NATIVE_INT; 
            “Bob”        0;
            “Elena”      1;
            “Quincey”    2;      
            “Frank”      3;      }”

Parameters:

Returns:
Returns non-negative if successful; otherwise returns a negative value.

HDF5 documents and links 
Introduction to HDF5 
HDF5 User Guide 
Other High-level API documents
And in this document, the HDF5 Reference Manual  
H5DS   H5IM   H5LT   H5PT   H5TB  
H5   H5A   H5D   H5E   H5F   H5G   H5I   H5L  
H5O   H5P   H5R   H5S   H5T   H5Z   Tools   Datatypes