SUBROUTINE h5tencode_f(obj_id, buf, nalloc, hdferr)
INTEGER(HID_T), INTENT(IN) :: obj_id ! Identifier of the object to be encoded
CHARACTER(LEN=*), INTENT(OUT) :: buf ! Buffer object to be encoded into
INTEGER(SIZE_T), INTENT(INOUT) :: nalloc
! The size of the allocated buffer
INTEGER, INTENT(OUT) :: hdferr ! Error code
! 0 on success and -1 on failure
END SUBROUTINE h5tencode_f
IN: Identifier of the object to be encoded.
unsigned char *buf
IN/OUT: Buffer for the object to be encoded into. If the provided buffer is NULL, only the size of buffer needed is returned throughnalloc.
IN: The size of the allocated buffer. OUT: The size of the buffer needed.
Given datatype identifier,H5Tencodeconverts a data type description into binary form in a buffer. Using this binary form in the buffer, a datatype object can be reconstructed usingH5Tdecodeto return a new object handle (hid_t) for this datatype.
A preliminaryH5Tencodecall can be made to find out the size of the buffer needed. This value is returned asnalloc. That value can then be assigned tonallocfor a secondH5Tencodecall, which will retrieve the actual encoded object.
If the library finds outnallocis not big enough for the object, it simply returns the size of the buffer needed throughnallocwithout encoding the provided buffer.
Returns a non-negative value if successful; otherwise returns a negative value.