where except_type indicates what kind of exception has happened, src_id and dst_id are the source and destination datatype identifiers, src_buf and 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 H5T_CONV_ABORT, H5T_CONV_UNHANDLED and H5T_CONV_HANDLED.
Programming Note for C++ Developers Using C Functions:
If a C routine that takes a function pointer as an argument is called from within C++ code, the C routine should be returned from normally.
Examples of this kind of routine include callbacks such as H5P_SET_ELINK_CB and H5P_SET_TYPE_CONV_CB and functions such as H5T_CONVERT and H5E_WALK2.
Exiting the routine in its normal fashion allows the HDF5 C library to clean up its work properly. In other words, if the C++ application jumps out of the routine back to the C++ “catch” statement, the library is not given the opportunity to close any temporary data structures that were set up when the routine was called. The C++ application should save some state as the routine is started so that any problem that occurs might be diagnosed.
Returns a non-negative value if successful; otherwise returns a negative value.