Last modified: 30 March 2016
Name: H5Pencode
Signature:
herr_t H5Pencode( hid_t plist_id, void *buf, size_t *nalloc )

Purpose:
Encodes the property values in a property list into a binary buffer.

Motivation:
H5Pencode creates a computer-readable description of a property list that can be passed to another process within an application or to another application. This capability allows an application or a developer to create a property list once and encode it for use elsewhere. The property list can then be decoded with H5Pdecode to replicate the property list in another process or application. Since the binary buffer containing the encoded description is portable, it can be passed across systems.

Description:
H5Pencode encodes the property list plist_id into the binary buffer buf.

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 H5Pencode call.

If the buffer passed in is not big enough to hold the encoded properties, the H5Pencode 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.

Parameters:
hid_t plist_id     IN: Identifier of the property list to be encoded.
void *buf OUT: 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 *nalloc OUT: The size of the required buffer.

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

Fortran90 Interface:
None.

See Also:
H5Pdecode    

History: