Encodes the property values in a property list into a binary buffer


H5P_ENCODE (  plist_id, buf, nalloc )


<pre><code class="language-c">herr_t H5Pencode( hid_t plist_id, void *buf, size_t *nalloc )</code></pre>
<pre><code class="language-c">herr_t H5Pencode ( hid_t plist_id, void *buf, size_t *nalloc, hid_t fapl_id )</code></pre>

<pre><code class="language-fortran">None</code></pre>

hid_t plist_id    IN: Identifier of the property list to be encoded
void *bufOUT: Buffer into which the property list will be encoded
If the provided buffer is NULL, the size of the buffer required is returned through nalloc; the function does nothing more.
size_t *nallocOUT: The size of the required buffer


H5P_ENCODE 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 settingH5P_ENCODE mapping
Global settings:
No compatibility flagH5P_ENCODE2
Enable deprecated symbolsH5P_ENCODE2
Disable deprecated symbols H5P_ENCODE2
Emulate Release 1.10 interface     H5P_ENCODE 1
Function-level macros:
H5Pencode_vers = 2 H5P_ENCODE2
H5Pencode_vers = 1 H5P_ENCODE 1


Returns a non-negative value if successful; otherwise returns a negative value.



Release    Change
1.12.0The function H5Pencode was renamed to H5Pencode1 and deprecated in this release. The macro H5Pencode and H5Pencode2 were introduced in this release.