Retrieves comment for specified object


H5O_GET_COMMENT(object_id, comment, bufsize)


<pre><code class="language-c">ssize_t H5Oget_comment( hid_t object_id, char *comment, size_t bufsize )</code></pre>

<pre><code class="language-fortran">  SUBROUTINE h5oget_comment_f(obj_id, comment,        &
        hdferr, bufsize)
    INTEGER(HID_T)   , INTENT(IN)            :: obj_id
    CHARACTER(LEN=*) , INTENT(OUT)           :: comment
    INTEGER          , INTENT(OUT)           :: hdferr
    INTEGER(HSSIZE_T), INTENT(OUT), OPTIONAL :: bufsize</code></pre>

hid_t object_id    IN: Identifier for the target object; may be a file, group, dataset, named datatype or attribute identifier
char *commentOUT: The comment
size_t bufsizeIN: Anticipated required size of the comment buffer


H5O_GET_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 H5O_GET_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.


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.


Coming Soon!

Release    Change
1.8.11Fortran subroutine introduced in this release.
1.8.0Function introduced in this release.