Registers a conversion function
H5T_REGISTER (type, name, src_id, dst_id, func)
herr_t H5Tregister( H5T_pers_t type, const char * name, hid_t src_id, hid_t dst_id, H5T_conv_t func )
|H5T_pers_t ||IN: Conversion function type:|
|const char * ||IN: Name displayed in diagnostic output|
|hid_t ||IN: Identifier of source datatype|
|hid_t ||IN: Identifier of destination datatype|
|H5T_conv_t ||IN: Function to convert between source and destination datatypes|
type indicates whether a conversion function is hard (
H5T_PERS_HARD) or soft (
H5T_PERS_SOFT). User-defined functions employing compiler casting are designated as hard; other user-defined conversion functions registered with the HDF5 library (with H5T_REGISTER ) are designated as soft. The HDF5 library also has its own hard and soft conversion functions.
A conversion path can have only one hard function. When
func replaces any previous hard function.
H5T_PERS_SOFT, H5T_REGISTER adds 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.
name is used only for debugging and should be a short identifier for the function.
The path is specified by the source and destination datatypes
dst_id. For soft conversion functions, only the class of these types is important.
The type of the conversion function pointer is declared as:
dst_id, H5T_cdata_t *
bkg_stride, void *
buf, void *
H5T_cdata_t struct is declared as:
need_bkg, hbool_t *
recalc, void *
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.
|1.6.3||The following change occurred in the |