H5PsetH5P_typeSET_convTYPE_cbCONV_CB sets the user-defined datatype conversion callback function
func in the dataset transfer property list
op_data is a pointer to user-defined input data for the callback function and will be passed through to the callback function.
The callback function
func defines the actions an application is to take when there is an exception during datatype conversion. The function prototype is as follows:
typedef H5T_conv_ret_t (H5T_conv_except_func_t) ( H5T_conv_except_t except_type, hid_t src_id, hid_t dst_id, void *src_buf, void *dst_buf, void *op_data)
except_type indicates what kind of exception has happened,
dst_id are the source and destination datatype identifiers,
dst_buf are the source and destination data buffer, and
op_data is the required input data for this callback function.
Valid values for
except_type are as follows:
H5T_CONV_EXCEPT_RANGE_HI Source value is positive and is too big to the destination. Overflow happens.
H5T_CONV_EXCEPT_RANGE_LOW Source value is negative and its magnitude is too big to the destination. Overflow happens.
H5T_CONV_EXCEPT_TRUNCATE Source is floating-point type and destination is integer. The floating-point number has fractional part.
H5T_CONV_EXCEPT_PRECISION Source is integer and destination is floating-point type. The mantissa of floating-point type is not big enough to hold all the digits of the integer.
H5T_CONV_EXCEPT_PINF Source is floating-point type and the value is positive infinity.
H5T_CONV_EXCEPT_NINF Source is floating-point type and the value is negative infinity.
H5T_CONV_EXCEPT_NAN Source is floating-point type and the value is NaN (not a number, including QNaN and SNaN).
Valid callback function return values are