Last modified: 10 April 2013
Name: H5Oget_comment
Signature:
ssize_t H5Oget_comment( hid_t object_id, char *comment, size_t bufsize )

Purpose:
Retrieves comment for specified object.

Description:
H5Oget_comment retrieves the comment for the specified object in the buffer comment.

The target object is specified by an identifier, object_id.

The size in bytes of the buffer comment, including the NULL terminator, is specified in bufsize. If bufsize is unknown, a preliminary H5Oget_comment call with the pointer comment set to NULL will return the size of the comment without the NULL terminator.

If bufsize is set to a smaller value than described above, only bufsize bytes of the comment, without a NULL terminator, are returned in comment.

If an object does not have a comment, the empty string is returned in comment.

Parameters:
hid_t object_id     IN: Identifier for the target object.
char *comment OUT: The comment.
size_t bufsize IN: Anticipated required size of the comment buffer.

Returns:
Upon success, returns the number of characters in the comment, not including the NULL terminator, or zero (0) if the object has no comment. The value returned may be larger than bufsize. Otherwise returns a negative value.

Fortran90 Interface: h5oget_comment_f

History:
Release     C
1.8.11 Fortran subroutine introduced in this release.
1.8.0 Function introduced in this release.