Page tree

 

JAVA

FORTRAN

C++

C

 

Link

H5T_SET_OFFSET

Sets the bit offset of the first significant bit

Procedure:

H5T_SET_OFFSET (dtype_id, offset)

Signature:

herr_t H5Tset_offset( hid_t dtype_id, size_t offset )

SUBROUTINE h5tset_offset_f(type_id, offset, hdferr) 
  IMPLICIT NONE
  INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier 
  INTEGER(SIZE_T), INTENT(IN) :: offset ! Datatype bit offset of 
                                        ! the first significant bit
  INTEGER, INTENT(OUT) :: hdferr        ! Error code
END SUBROUTINE h5tset_offset_f

Parameters:
hid_t dtype_id    IN: Identifier of datatype to set
size_t offsetIN: Offset of first significant bit

Description:

 H5T_SET_OFFSET sets the bit offset of the first significant bit. The significant bits of an atomic datum can be offset from the beginning of the memory for that datum by an amount of padding. The offset property specifies the number of bits of padding that appear “to the right of” the value. That is, if we have a 32-bit datum with 16-bits of precision having the value 0x1122, then it will be laid out in memory as (from small byte address toward larger byte addresses): 

Byte PositionBig-Endian Offset=0Big-Endian Offset=16Little-Endian Offset=0Little-Endian Offset=16
0[ pad][0x11][0x22][ pad]
1[ pad][0x22][0x11][ pad]
2[0x11][ pad][ pad][0x22]
3[0x22][ pad][ pad][0x11]

If the offset is incremented then the total size is incremented also if necessary to prevent significant bits of the value from hanging over the edge of the datatype.

The offset of an H5T_STRING cannot be set to anything but zero.

Returns:

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

Example:

Coming Soon!

--- Last Modified: May 23, 2019 | 03:37 PM