Skip to content

Commit

Permalink
Correct property cb signatures in docs (HDFGroup#4554)
Browse files Browse the repository at this point in the history
* Correct property cb signatures in docs
* Correct delete callback type name in docs
* add missing word to H5P__free_prop doc
  • Loading branch information
mattjala authored and byrnHDF committed Jun 26, 2024
1 parent 9d2a23b commit 3fc58a3
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 37 deletions.
8 changes: 4 additions & 4 deletions src/H5P.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,8 @@ H5Pcreate(hid_t cls_id)
routine returns an error value.
The 'delete' callback is called when a property is deleted from a
property list. H5P_prp_del_func_t is defined as:
typedef herr_t (*H5P_prp_del_func_t)(hid_t prop_id, const char *name,
property list. H5P_prp_delete_func_t is defined as:
typedef herr_t (*H5P_prp_delete_func_t)(hid_t prop_id, const char *name,
size_t size, void *value);
where the parameters to the callback function are:
hid_t prop_id; IN: The ID of the property list the property is deleted from.
Expand Down Expand Up @@ -502,8 +502,8 @@ H5Pregister2(hid_t cls_id, const char *name, size_t size, void *def_value, H5P_p
routine returns an error value.
The 'delete' callback is called when a property is deleted from a
property list. H5P_prp_del_func_t is defined as:
typedef herr_t (*H5P_prp_del_func_t)(hid_t prop_id, const char *name,
property list. H5P_prp_delete_func_t is defined as:
typedef herr_t (*H5P_prp_delete_func_t)(hid_t prop_id, const char *name,
size_t size, void *value);
where the parameters to the callback function are:
hid_t prop_id; IN: The ID of the property list the property is deleted from.
Expand Down
8 changes: 4 additions & 4 deletions src/H5Pdeprec.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@
routine returns an error value.
The 'delete' callback is called when a property is deleted from a
property list. H5P_prp_del_func_t is defined as:
typedef herr_t (*H5P_prp_del_func_t)(hid_t prop_id, const char *name,
property list. H5P_prp_delete_func_t is defined as:
typedef herr_t (*H5P_prp_delete_func_t)(hid_t prop_id, const char *name,
size_t size, void *value);
where the parameters to the callback function are:
hid_t prop_id; IN: The ID of the property list the property is deleted from.
Expand Down Expand Up @@ -314,8 +314,8 @@ H5Pregister1(hid_t cls_id, const char *name, size_t size, void *def_value, H5P_p
routine returns an error value.
The 'delete' callback is called when a property is deleted from a
property list. H5P_prp_del_func_t is defined as:
typedef herr_t (*H5P_prp_del_func_t)(hid_t prop_id, const char *name,
property list. H5P_prp_delete_func_t is defined as:
typedef herr_t (*H5P_prp_delete_func_t)(hid_t prop_id, const char *name,
size_t size, void *value);
where the parameters to the callback function are:
hid_t prop_id; IN: The ID of the property list the property is deleted from.
Expand Down
49 changes: 21 additions & 28 deletions src/H5Pint.c
Original file line number Diff line number Diff line change
Expand Up @@ -1475,7 +1475,7 @@ H5P__free_prop(H5P_genprop_t *prop)
NAME
H5P__free_prop_cb
PURPOSE
Internal routine to properties from a property skip list
Internal routine to free properties from a property skip list
USAGE
herr_t H5P__free_prop_cb(item, key, op_data)
void *item; IN/OUT: Pointer to property
Expand Down Expand Up @@ -2048,13 +2048,11 @@ H5P_create_id(H5P_genclass_t *pclass, bool app_ref)
The 'create' callback is called when a new property list with this
property is being created. H5P_prp_create_func_t is defined as:
typedef herr_t (*H5P_prp_create_func_t)(hid_t prop_id, const char *name,
size_t size, void *initial_value);
typedef herr_t (*H5P_prp_create_func_t)(const char *name, size_t size, void *value);
where the parameters to the callback function are:
hid_t prop_id; IN: The ID of the property list being created.
const char *name; IN: The name of the property being modified.
size_t size; IN: The size of the property value
void *initial_value; IN/OUT: The initial value for the property being created.
void *value; IN/OUT: The initial value for the property being created.
(The 'default' value passed to H5Pregister2)
The 'create' routine may modify the value to be set and those changes will
be stored as the initial value of the property. If the 'create' routine
Expand All @@ -2069,7 +2067,7 @@ H5P_create_id(H5P_genclass_t *pclass, bool app_ref)
hid_t prop_id; IN: The ID of the property list being modified.
const char *name; IN: The name of the property being modified.
size_t size; IN: The size of the property value
void *new_value; IN/OUT: The value being set for the property.
void *value; IN/OUT: The value being set for the property.
The 'set' routine may modify the value to be set and those changes will be
stored as the value of the property. If the 'set' routine returns a
negative value, the new property value is not copied into the property and
Expand All @@ -2090,8 +2088,8 @@ H5P_create_id(H5P_genclass_t *pclass, bool app_ref)
routine returns an error value.
The 'delete' callback is called when a property is deleted from a
property list. H5P_prp_del_func_t is defined as:
typedef herr_t (*H5P_prp_del_func_t)(hid_t prop_id, const char *name,
property list. H5P_prp_delete_func_t is defined as:
typedef herr_t (*H5P_prp_delete_func_t)(hid_t prop_id, const char *name,
size_t size, void *value);
where the parameters to the callback function are:
hid_t prop_id; IN: The ID of the property list the property is deleted from.
Expand Down Expand Up @@ -2119,7 +2117,7 @@ H5P_create_id(H5P_genclass_t *pclass, bool app_ref)
The 'compare' callback is called when a property list with this
property is compared to another property list. H5P_prp_compare_func_t is
defined as:
typedef int (*H5P_prp_compare_func_t)( void *value1, void *value2,
typedef int (*H5P_prp_compare_func_t)(const void *value1, const void *value2,
size_t size);
where the parameters to the callback function are:
const void *value1; IN: The value of the first property being compared.
Expand All @@ -2145,30 +2143,25 @@ H5P_create_id(H5P_genclass_t *pclass, bool app_ref)
The 'encode' callback is called when a property list with this
property is being encoded. H5P_prp_encode_func_t is defined as:
typedef herr_t (*H5P_prp_encode_func_t)(void *f, size_t *size,
void *value, void *plist, uint8_t **buf);
typedef herr_t (*H5P_prp_encode_func_t)(const void *value, void **buf, size_t *size);
where the parameters to the callback function are:
void *f; IN: A fake file structure used to encode.
size_t *size; IN/OUT: The size of the buffer to encode the property.
void *value; IN: The value of the property being encoded.
void *plist; IN: The property list structure.
uint8_t **buf; OUT: The buffer that holds the encoded property;
void **buf; OUT: Pointer to encoding buffer pointer.
size_t *size; IN/OUT: The size of the buffer needed to encode the property.
The 'encode' routine returns the size needed to encode the property value
if the buffer passed in is NULL or the size is zero. Otherwise it encodes
the property value into binary in buf.
the property value as binary in *buf.
The 'decode' callback is called when a property list with this
property is being decoded. H5P_prp_encode_func_t is defined as:
typedef herr_t (*H5P_prp_encode_func_t)(void *f, size_t *size,
void *value, void *plist, uint8_t **buf);
typedef herr_t (*H5P_prp_encode_func_t)(const void **buf, void *value);
where the parameters to the callback function are:
void *f; IN: A fake file structure used to decode.
size_t *size; IN: H5_ATTR_UNUSED
void *value; IN: H5_ATTR_UNUSED
void *plist; IN: The property list structure.
uint8_t **buf; IN: The buffer that holds the binary encoded property;
void **buf; IN: Pointer to encoded buffer pointer.
void *value; OUT: The buffer the property value is decoded into.
The 'decode' routine decodes the binary buffer passed in and transforms it into
corresponding property values that are set in the property list passed in.
After the value is decoded, (*buf) must be incremented
by the size of the encoded value.
GLOBAL VARIABLES
COMMENTS, BUGS, ASSUMPTIONS
Expand Down Expand Up @@ -2346,8 +2339,8 @@ H5P__register_real(H5P_genclass_t *pclass, const char *name, size_t size, const
corresponding property values that are set in the property list passed in.
The 'delete' callback is called when a property is deleted from a
property list. H5P_prp_del_func_t is defined as:
typedef herr_t (*H5P_prp_del_func_t)(hid_t prop_id, const char *name,
property list. H5P_prp_delete_func_t is defined as:
typedef herr_t (*H5P_prp_delete_func_t)(hid_t prop_id, const char *name,
size_t size, void *value);
where the parameters to the callback function are:
hid_t prop_id; IN: The ID of the property list the property is deleted from.
Expand Down Expand Up @@ -2584,8 +2577,8 @@ H5P__register(H5P_genclass_t **ppclass, const char *name, size_t size, const voi
corresponding property values that are set in the property list passed in.
The 'delete' callback is called when a property is deleted from a
property list. H5P_prp_del_func_t is defined as:
typedef herr_t (*H5P_prp_del_func_t)(hid_t prop_id, const char *name,
property list. H5P_prp_delete_func_t is defined as:
typedef herr_t (*H5P_prp_delete_func_t)(hid_t prop_id, const char *name,
size_t size, void *value);
where the parameters to the callback function are:
hid_t prop_id; IN: The ID of the property list the property is deleted from.
Expand Down Expand Up @@ -2613,7 +2606,7 @@ H5P__register(H5P_genclass_t **ppclass, const char *name, size_t size, const voi
The 'compare' callback is called when a property list with this
property is compared to another property list. H5P_prp_compare_func_t is
defined as:
typedef int (*H5P_prp_compare_func_t)( void *value1, void *value2,
typedef int (*H5P_prp_compare_func_t)(void *value1, void *value2,
size_t size);
where the parameters to the callback function are:
const void *value1; IN: The value of the first property being compared.
Expand Down
2 changes: 1 addition & 1 deletion src/H5Ppublic.h
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ typedef H5P_prp_cb2_t H5P_prp_get_func_t;
* \brief Callback function for encoding property values
*
* \param[in] value The property value to be encoded
* \param[out] buf The encoded property value
* \param[out] buf Pointer to encoding buffer pointer
* \param[out] size The size of \p buf
* \return \herr_t
*
Expand Down

0 comments on commit 3fc58a3

Please sign in to comment.