Last modified: 23 August 2012
Name: H5Tset_size
Signature:
herr_t H5Tset_size( hid_t dtype_id, size_tsize )

Purpose:
Sets the total size for an atomic datatype.

Description:
H5Tset_size sets the total size in bytes, size, for a datatype.

If the datatype is atomic and size is decreased so that the significant bits of the datatype extend beyond the edge of the new size, then the offset property is decreased toward zero. If the offset becomes zero and the significant bits of the datatype still hang over the edge of the new size, then the number of significant bits is decreased.

The size set for a string should include space for the null-terminator character, otherwise it will not be stored on (or retrieved from) disk. Adjusting the size of a string automatically sets the precision to 8*size.

If dtype_id is a variable-length string, size must normally be set to H5T_VARIABLE. See “Creating variable-length string datatypes.”

A compound datatype may increase or decrease in size as long as its member field is not trailed.

All datatypes must have a positive size.

Parameters:
hid_t dtype_id     IN: Identifier of datatype to change size.
size_t size IN: Size in bytes to modify datatype.

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

See Also:
Creating variable-length string datatypes

Fortran90 Interface: h5tset_size_f
SUBROUTINE h5tset_size_f(type_id, size, hdferr) 
  IMPLICIT NONE
  INTEGER(HID_T), INTENT(IN) :: type_id  ! Datatype identifier 
  INTEGER(SIZE_T), INTENT(IN) :: size    ! Datatype size
  INTEGER, INTENT(OUT) :: hdferr         ! Error code
                                         ! 0 on success and -1 on failure
END SUBROUTINE h5tset_size_f