H5P_ENCODE encodes the property list
plist_id into the binary buffer
If the required buffer size is unknown,
buf can be passed in as
NULL and the function will set the required buffer size in
nalloc. The buffer can then be created and the property list encoded with a subsequent H5P_ENCODE call.
If the buffer passed in is not big enough to hold the encoded properties, the H5P_ENCODE call can be expected to fail with a segmentation fault.
Properties that do not have encode callbacks will be skipped. There is currently no mechanism to register an encode callback for a user-defined property, so user-defined properties cannot currently be encoded.
Some properties cannot be encoded, particularly properties that are reliant on local context.
is a macro that is mapped to either H5P_ENCODE1 or H5P_ENCODE2, depending on the needs of the application.
Such macros are provided to facilitate application compatibility. Their use and mappings are fully described in API Compatibility Macros in HDF5.
When both the HDF5 library and the application are built and installed with no specific compatibility flags, H5P_ENCODE is mapped to the most recent version of the function. If the library and/or application is compiled for Release 1.10 emulation, H5P_ENCODE will be mapped to H5P_ENCODE1. Function-specific flags are available to override these settings on a function-by-function basis when the application is compiled.
Specific compile-time compatibility flags and the resulting mappings are as follows:
|Compatibility setting||H5P_ENCODE mapping|
|No compatibility flag||H5P_ENCODE2|
|Enable deprecated symbols||H5P_ENCODE2|
|Disable deprecated symbols|| H5P_ENCODE2 |
|Emulate Release 1.10 interface|
| H5P_ENCODE 1|
H5Pencode_vers = 2
| H5P_ENCODE2 |
H5Pencode_vers = 1
| H5P_ENCODE 1 |