Creates a text description of an HDF5 datatype
Procedure:
H5LT_DTYPE_TO_TEXT (datatype, str, lang_type, len)
Signature:
herr_t H5LTdtype_to_text(hid_t datatype, char* str, H5LT_lang_t lang_type, size_t* len)
Parameters:
hid_t datatype | IN: Identifier of the datatype to be converted |
char* str | OUT: Buffer for the text description of the datatype |
H5LT_lang_t lang_type | IN: The language used to describe the datatype. The currently supported language is H5LT_DDL |
size_t* len | OUT: the size of buffer needed to store the text description |
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; }”
Returns:
Returns non-negative if successful; otherwise returns a negative value.
Example:
--- Last Modified: August 13, 2019 | 01:31 PM