IN: Conversion function type: H5T_PERS_HARDfor hard conversion functions H5T_PERS_SOFTfor soft conversion functions
const char *name
IN: Name displayed in diagnostic output
IN: Identifier of source datatype
IN: Identifier of destination datatype
IN: Function to convert between source and destination datatypes
H5Tregisterregisters a hard or soft conversion function for a datatype conversion path.
The parametertypeindicates whether a conversion function ishard(H5T_PERS_HARD) orsoft(H5T_PERS_SOFT). User-defined functions employing compiler casting are designated ashard; other user-defined conversion functions registered with the HDF5 Library (withH5Tregister) are designated assoft. The HDF5 Library also has its ownhardandsoftconversion functions.
A conversion path can have only one hard function. WhentypeisH5T_PERS_HARD,funcreplaces any previous hard function.
WhentypeisH5T_PERS_SOFT,H5Tregisteradds the function to the end of the master soft list and replaces the soft function in all applicable existing conversion paths. Soft functions are used when determining which conversion function is appropriate for this path.
Thenameis used only for debugging and should be a short identifier for the function.
The path is specified by the source and destination datatypessrc_idanddst_id. For soft conversion functions, only the class of these types is important.
The type of the conversion function pointer is declared as:
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 asH5Pset_elink_cbandH5Pset_type_conv_cband functions such asH5TconvertandH5Ewalk2.
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.
The following change occurred in theH5Tconv_tfunction: nelmtsparameter type changed tosize_t.