summaryrefslogtreecommitdiffstats
path: root/src/H5Gdeprec.c
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2021-05-03 21:55:26 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2021-05-03 21:55:26 (GMT)
commit0ab5dd5e8ea2342ef039f0f79bd76e4ab187dddf (patch)
tree6900490d46d768f991e7cc91d45d4f8dc17985a4 /src/H5Gdeprec.c
parentfca509b7d61b9dffae85be3406ca484c1bf28242 (diff)
downloadhdf5-0ab5dd5e8ea2342ef039f0f79bd76e4ab187dddf.zip
hdf5-0ab5dd5e8ea2342ef039f0f79bd76e4ab187dddf.tar.gz
hdf5-0ab5dd5e8ea2342ef039f0f79bd76e4ab187dddf.tar.bz2
Brings more develop code over, especially Doxygen
Diffstat (limited to 'src/H5Gdeprec.c')
-rw-r--r--src/H5Gdeprec.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/src/H5Gdeprec.c b/src/H5Gdeprec.c
index 87d3fdd..04bd2b5 100644
--- a/src/H5Gdeprec.c
+++ b/src/H5Gdeprec.c
@@ -15,7 +15,7 @@
*
* Created: H5Gdeprec.c
* June 21 2006
- * James Laird <jlaird@ncsa.uiuc.edu>
+ * James Laird
*
* Purpose: Deprecated functions from the H5G interface. These
* functions are here for compatibility purposes and may be
@@ -141,10 +141,10 @@ H5G_map_obj_type(H5O_type_t obj_type)
* specified NAME. The group is opened for write access
* and it's object ID is returned.
*
- * The optional SIZE_HINT specifies how much file space to
- * reserve to store the names that will appear in this
- * group. If a non-positive value is supplied for the SIZE_HINT
- * then a default size is chosen.
+ * The SIZE_HINT parameter specifies how much file space to reserve
+ * to store the names that will appear in this group. This number
+ * must be less than or equal to UINT32_MAX. If zero is supplied
+ * for the SIZE_HINT then a default size is chosen.
*
* Note: Deprecated in favor of H5Gcreate2
*
@@ -174,6 +174,8 @@ H5Gcreate1(hid_t loc_id, const char *name, size_t size_hint)
/* Check arguments */
if (!name || !*name)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "no name given")
+ if (size_hint > UINT32_MAX)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "size_hint cannot be larger than UINT32_MAX")
/* Check if we need to create a non-standard GCPL */
if (size_hint > 0) {
@@ -222,7 +224,7 @@ H5Gcreate1(hid_t loc_id, const char *name, size_t size_hint)
H5P_GROUP_ACCESS_DEFAULT, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL)))
HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, H5I_INVALID_HID, "unable to create group")
- /* Get an atom for the group */
+ /* Get an ID for the group */
if ((ret_value = H5VL_register(H5I_GROUP, grp, vol_obj->connector, TRUE)) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register group")
@@ -283,7 +285,7 @@ H5Gopen1(hid_t loc_id, const char *name)
H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL)))
HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open group")
- /* Get an atom for the group */
+ /* Get an ID for the group */
if ((ret_value = H5VL_register(H5I_GROUP, grp, vol_obj->connector, TRUE)) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register group")
@@ -724,7 +726,7 @@ done:
*-------------------------------------------------------------------------
*/
int
-H5Gget_comment(hid_t loc_id, const char *name, size_t bufsize, char *buf)
+H5Gget_comment(hid_t loc_id, const char *name, size_t bufsize, char *buf /*out*/)
{
H5VL_object_t * vol_obj; /* Object of loc_id */
H5VL_loc_params_t loc_params;
@@ -732,7 +734,7 @@ H5Gget_comment(hid_t loc_id, const char *name, size_t bufsize, char *buf)
int ret_value; /* Return value */
FUNC_ENTER_API(-1)
- H5TRACE4("Is", "i*sz*s", loc_id, name, bufsize, buf);
+ H5TRACE4("Is", "i*szx", loc_id, name, bufsize, buf);
if (!name || !*name)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, -1, "no name specified")
@@ -858,7 +860,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Gget_num_objs(hid_t loc_id, hsize_t *num_objs)
+H5Gget_num_objs(hid_t loc_id, hsize_t *num_objs /*out*/)
{
H5VL_object_t * vol_obj; /* Object of loc_id */
H5I_type_t id_type; /* Type of ID */
@@ -867,7 +869,7 @@ H5Gget_num_objs(hid_t loc_id, hsize_t *num_objs)
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE2("e", "i*h", loc_id, num_objs);
+ H5TRACE2("e", "ix", loc_id, num_objs);
/* Check args */
id_type = H5I_get_type(loc_id);
@@ -971,7 +973,7 @@ H5G__get_objinfo_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc /*in*/, const char *name,
H5G_trav_goi_t *udata = (H5G_trav_goi_t *)_udata; /* User data passed in */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_STATIC;
+ FUNC_ENTER_STATIC
/* Check if the name in this group resolved to a valid link */
if (lnk == NULL && obj_loc == NULL)
@@ -1134,14 +1136,14 @@ done:
*-------------------------------------------------------------------------
*/
ssize_t
-H5Gget_objname_by_idx(hid_t loc_id, hsize_t idx, char *name, size_t size)
+H5Gget_objname_by_idx(hid_t loc_id, hsize_t idx, char *name /*out*/, size_t size)
{
H5VL_object_t * vol_obj; /* Object of loc_id */
H5VL_loc_params_t loc_params;
ssize_t ret_value; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE4("Zs", "ih*sz", loc_id, idx, name, size);
+ H5TRACE4("Zs", "ihxz", loc_id, idx, name, size);
/* Set up collective metadata if appropriate */
if (H5CX_set_loc(loc_id) < 0)