![]() |
HDF5
1.13.2-1
|
Functions | |
| herr_t | H5Lregister (const H5L_class_t *cls) |
| Registers a user-defined link class or changes behavior of an existing class. More... | |
| herr_t | H5Lunregister (H5L_type_t id) |
| Unregisters a class of user-defined links. More... | |
| htri_t | H5Lis_registered (H5L_type_t id) |
| Determines whether a class of user-defined links is registered. More... | |
| htri_t H5Lis_registered | ( | H5L_type_t | id | ) |
Determines whether a class of user-defined links is registered.
| [in] | id | User-defined link class identifier |
H5Lis_registered() tests whether a user-defined link class is currently registered, either by the HDF5 library or by the user through the use of H5Lregister().
| herr_t H5Lregister | ( | const H5L_class_t * | cls | ) |
Registers a user-defined link class or changes behavior of an existing class.
| [in] | cls | Pointer to a buffer containing the struct describing the user-defined link class |
H5Lregister() registers a class of user-defined links, or changes the behavior of an existing class.
cls is a pointer to a buffer containing a copy of the H5L_class_t struct. This struct is defined in H5Lpublic.h as follows:
The class definition passed with cls must include at least the following:
class_id trav_func Remaining struct members are optional and may be passed as NULL.
The link class passed in class_id must be in the user-definable range between H5L_TYPE_UD_MIN and H5L_TYPE_UD_MAX (see the table below) and will override any existing link class with that identifier.
As distributed, valid values of class_id used in HDF5 include the following (defined in H5Lpublic.h):
| H5L_TYPE_HARD | Hard link |
| H5L_TYPE_SOFT | Soft link |
| H5L_TYPE_EXTERNAL | External link |
| H5L_TYPE_ERROR | Error |
The hard and soft link class identifiers cannot be modified or reassigned, but the external link class is implemented as an example in the user-definable link class identifier range. H5Lregister() is used to register additional link classes. It could also be used to modify the behavior of the external link class, though that is not recommended.
The following table summarizes existing link types and values and the reserved and user-definable link class identifier value ranges.
| Link class identifier or Value range | Description | Link class or label |
|---|---|---|
| 0 to 63 | Reserved range | |
| 64 to 255 | User-definable range | |
| 64 | Minimum user-defined value | H5L_TYPE_UD_MIN |
| 64 | External link | H5L_TYPE_EXTERNAL |
| 255 | Maximum user-defined value | H5L_TYPE_UD_MAX |
| 255 | Maximum value | H5L_TYPE_MAX |
| -1 | Error | H5L_TYPE_ERROR |
Note that HDF5 internally registers user-defined link classes only by the numeric value of the link class identifier. An application, on the other hand, will generally use a name for a user-defined class, if for no other purpose than as a variable name. Assume, for example, that a complex link type is registered with the link class identifier 73 and that the code includes the following assignment:
The application can refer to the link class with a term, H5L_TYPE_COMPLEX_A, that conveys meaning to a human reviewing the code, while HDF5 recognizes it by the more cryptic numeric identifier, 73.
class_id values. See below. class_id in the H5L_class_t struct must not equal H5L_TYPE_UD_MIN unless you intend to overwrite or modify the behavior of external links. class_id values and to help coordinate the use of specialized link classes.| herr_t H5Lunregister | ( | H5L_type_t | id | ) |
Unregisters a class of user-defined links.
| [in] | id | User-defined link class identifier |
H5Lunregister() unregisters a class of user-defined links, preventing them from being traversed, queried, moved, etc.