Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace non-VOL calls with VOL calls - part 5 #4788

Merged
merged 3 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions src/H5Gdeprec.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ H5Gcreate1(hid_t loc_id, const char *name, size_t size_hint)
loc_params.obj_type = H5I_get_type(loc_id);

/* get the location object */
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(loc_id)))
if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "invalid location identifier");

/* Create the group */
Expand Down Expand Up @@ -262,7 +262,7 @@ H5Gopen1(hid_t loc_id, const char *name)
loc_params.obj_type = H5I_get_type(loc_id);

/* get the location object */
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(loc_id)))
if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "invalid location identifier");

/* Open the group */
Expand Down Expand Up @@ -320,7 +320,7 @@ H5Glink(hid_t cur_loc_id, H5G_link_t type, const char *cur_name, const char *new
new_loc_params.loc_data.loc_by_name.lapl_id = H5P_LINK_ACCESS_DEFAULT;

/* Get the location object */
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(cur_loc_id)))
if (NULL == (vol_obj = H5VL_vol_object(cur_loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier");

/* Construct a temporary VOL object */
Expand Down Expand Up @@ -351,7 +351,7 @@ H5Glink(hid_t cur_loc_id, H5G_link_t type, const char *cur_name, const char *new
loc_params.obj_type = H5I_get_type(cur_loc_id);

/* get the location object */
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(cur_loc_id)))
if (NULL == (vol_obj = H5VL_vol_object(cur_loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier");

/* Set up VOL callback arguments */
Expand Down Expand Up @@ -409,9 +409,9 @@ H5Glink2(hid_t cur_loc_id, const char *cur_name, H5G_link_t type, hid_t new_loc_
new_loc_params.loc_data.loc_by_name.lapl_id = H5P_LINK_ACCESS_DEFAULT;

/* Get the location objects */
if (NULL == (vol_obj1 = (H5VL_object_t *)H5I_object(cur_loc_id)))
if (NULL == (vol_obj1 = H5VL_vol_object(cur_loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier");
if (NULL == (vol_obj2 = (H5VL_object_t *)H5I_object(new_loc_id)))
if (NULL == (vol_obj2 = H5VL_vol_object(new_loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier");

/* Set up VOL callback arguments */
Expand Down Expand Up @@ -443,7 +443,7 @@ H5Glink2(hid_t cur_loc_id, const char *cur_name, H5G_link_t type, hid_t new_loc_
loc_params.obj_type = H5I_get_type(new_loc_id);

/* get the location object */
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(new_loc_id)))
if (NULL == (vol_obj = H5VL_vol_object(new_loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier");

/* Set up VOL callback arguments */
Expand Down Expand Up @@ -493,7 +493,7 @@ H5Gmove(hid_t src_loc_id, const char *src_name, const char *dst_name)
loc_params2.loc_data.loc_by_name.lapl_id = H5P_LINK_ACCESS_DEFAULT;

/* get the location object */
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(src_loc_id)))
if (NULL == (vol_obj = H5VL_vol_object(src_loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier");

/* Move the link */
Expand Down Expand Up @@ -541,11 +541,11 @@ H5Gmove2(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, const char *d

if (H5L_SAME_LOC != src_loc_id)
/* get the location object */
if (NULL == (vol_obj1 = (H5VL_object_t *)H5I_object(src_loc_id)))
if (NULL == (vol_obj1 = H5VL_vol_object(src_loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier");
if (H5L_SAME_LOC != dst_loc_id)
/* get the location object */
if (NULL == (vol_obj2 = (H5VL_object_t *)H5I_object(dst_loc_id)))
if (NULL == (vol_obj2 = H5VL_vol_object(dst_loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier");

/* Move the link */
Expand Down Expand Up @@ -588,7 +588,7 @@ H5Gunlink(hid_t loc_id, const char *name)
loc_params.loc_data.loc_by_name.lapl_id = H5P_LINK_ACCESS_DEFAULT;

/* Get the location object */
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(loc_id)))
if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier");

/* Set up VOL callback arguments */
Expand Down Expand Up @@ -635,7 +635,7 @@ H5Gget_linkval(hid_t loc_id, const char *name, size_t size, char *buf /*out*/)
loc_params.loc_data.loc_by_name.lapl_id = H5P_LINK_ACCESS_DEFAULT;

/* Get the location object */
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(loc_id)))
if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier");

/* Set up VOL callback arguments */
Expand Down Expand Up @@ -1167,7 +1167,7 @@ H5Gget_objname_by_idx(hid_t loc_id, hsize_t idx, char *name /*out*/, size_t size
loc_params.obj_type = H5I_get_type(loc_id);

/* Get the location object */
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(loc_id)))
if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, (-1), "invalid location identifier");

/* Set up VOL callback arguments */
Expand Down
27 changes: 13 additions & 14 deletions src/H5M.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,7 @@ H5Mcreate_async(const char *app_file, const char *app_func, unsigned app_line, h
* the in-file datatype for values is defined by VAL_TYPE_ID.
* LOC_ID specifies the file to create the map object, but no
* link to the object is created. Other options can be
* specified through the property lists LCPL_ID, MCPL_ID, and
* MAPL_ID.
* specified through the property lists MCPL_ID and MAPL_ID.
*
* The resulting ID should be linked into the file with
* H5Olink or it will be deleted when closed.
Expand Down Expand Up @@ -397,7 +396,7 @@ H5Mcreate_anon(hid_t loc_id, hid_t key_type_id, hid_t val_type_id, hid_t mcpl_id
HGOTO_ERROR(H5E_MAP, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info");

/* get the location object */
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(loc_id)))
if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "invalid location identifier");

/* Set location parameters */
Expand Down Expand Up @@ -693,7 +692,7 @@ H5Mget_key_type(hid_t map_id)
FUNC_ENTER_API(H5I_INVALID_HID)

/* Check args */
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(map_id, H5I_MAP)))
if (NULL == (vol_obj = H5VL_vol_object_verify(map_id, H5I_MAP)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "invalid map identifier");

/* Set up VOL callback arguments */
Expand Down Expand Up @@ -737,7 +736,7 @@ H5Mget_val_type(hid_t map_id)
FUNC_ENTER_API(H5I_INVALID_HID)

/* Check args */
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(map_id, H5I_MAP)))
if (NULL == (vol_obj = H5VL_vol_object_verify(map_id, H5I_MAP)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "invalid map identifier");

/* Set up VOL callback arguments */
Expand Down Expand Up @@ -781,7 +780,7 @@ H5Mget_create_plist(hid_t map_id)
FUNC_ENTER_API(H5I_INVALID_HID)

/* Check args */
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(map_id, H5I_MAP)))
if (NULL == (vol_obj = H5VL_vol_object_verify(map_id, H5I_MAP)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "invalid map identifier");

/* Set up VOL callback arguments */
Expand Down Expand Up @@ -828,7 +827,7 @@ H5Mget_access_plist(hid_t map_id)
FUNC_ENTER_API(H5I_INVALID_HID)

/* Check args */
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(map_id, H5I_MAP)))
if (NULL == (vol_obj = H5VL_vol_object_verify(map_id, H5I_MAP)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "invalid map identifier");

/* Set up VOL callback arguments */
Expand Down Expand Up @@ -871,7 +870,7 @@ H5Mget_count(hid_t map_id, hsize_t *count /*out*/, hid_t dxpl_id)
FUNC_ENTER_API(H5I_INVALID_HID)

/* Check args */
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(map_id, H5I_MAP)))
if (NULL == (vol_obj = H5VL_vol_object_verify(map_id, H5I_MAP)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "invalid map identifier");

/* Get the default dataset transfer property list if the user didn't provide one */
Expand Down Expand Up @@ -927,7 +926,7 @@ H5M__put_api_common(hid_t map_id, hid_t key_mem_type_id, const void *key, hid_t
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid value memory datatype ID");

/* Get map pointer */
if (NULL == (*vol_obj_ptr = (H5VL_object_t *)H5I_object_verify(map_id, H5I_MAP)))
if (NULL == (*vol_obj_ptr = H5VL_vol_object_verify(map_id, H5I_MAP)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "map_id is not a map ID");

/* Get the default dataset transfer property list if the user didn't provide one */
Expand Down Expand Up @@ -1056,7 +1055,7 @@ H5M__get_api_common(hid_t map_id, hid_t key_mem_type_id, const void *key, hid_t
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid value memory datatype ID");

/* Get map pointer */
if (NULL == (*vol_obj_ptr = (H5VL_object_t *)H5I_object_verify(map_id, H5I_MAP)))
if (NULL == (*vol_obj_ptr = H5VL_vol_object_verify(map_id, H5I_MAP)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "map_id is not a map ID");

/* Get the default dataset transfer property list if the user didn't provide one */
Expand Down Expand Up @@ -1187,7 +1186,7 @@ H5Mexists(hid_t map_id, hid_t key_mem_type_id, const void *key, hbool_t *exists,
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid key memory datatype ID");

/* Get map pointer */
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(map_id, H5I_MAP)))
if (NULL == (vol_obj = H5VL_vol_object_verify(map_id, H5I_MAP)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "map_id is not a map ID");

/* Get the default dataset transfer property list if the user didn't provide one */
Expand Down Expand Up @@ -1263,7 +1262,7 @@ H5Miterate(hid_t map_id, hsize_t *idx, hid_t key_mem_type_id, H5M_iterate_t op,
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no operator specified");

/* Get map pointer */
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(map_id, H5I_MAP)))
if (NULL == (vol_obj = H5VL_vol_object_verify(map_id, H5I_MAP)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "map_id is not a map ID");

/* Get the default dataset transfer property list if the user didn't provide one */
Expand Down Expand Up @@ -1348,7 +1347,7 @@ H5Miterate_by_name(hid_t loc_id, const char *map_name, hsize_t *idx, hid_t key_m
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no operator specified");

/* Get the location object */
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(loc_id)))
if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier");

/* Get the default dataset transfer property list if the user didn't provide one */
Expand Down Expand Up @@ -1412,7 +1411,7 @@ H5Mdelete(hid_t map_id, hid_t key_mem_type_id, const void *key, hid_t dxpl_id)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid key memory datatype ID");

/* Get map pointer */
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(map_id, H5I_MAP)))
if (NULL == (vol_obj = H5VL_vol_object_verify(map_id, H5I_MAP)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "map_id is not a map ID");

/* Get the default dataset transfer property list if the user didn't provide one */
Expand Down
22 changes: 20 additions & 2 deletions src/H5Mpublic.h
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,27 @@ H5_DLL hid_t H5Mcreate_async(hid_t loc_id, const char *name, hid_t key_type_id,
/**
* \ingroup H5M
*
* \brief
* \brief Creates a map object without linking it into a file
*
* \details
* \fgdta_loc_id
* \type_id{key_type_id}
* \type_id{val_type_id}
* \mcpl_id
* \mapl_id
* \return \hid_t{map object}
* The resulting ID should be linked into the file with H5Olink or it
* will be deleted when closed.
*
* \details H5Mcreate_anon() creates a new map object for storing key-value
* pairs. The in-file datatype for keys is defined by \p key_type_id
* and the in-file datatype for values is defined by \p val_type_id. \p
* loc_id specifies the file to create the map object, but no link to
* the object is created. Other options can be specified through the
* property lists \p mcpl_id and \p mapl_id.
*
* The new map should be linked into the group hierarchy before being
* closed or it will be deleted. The dataset should be closed when the
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got this from the source code but wasn't sure about the second sentence. Please advice.

lrknox marked this conversation as resolved.
Show resolved Hide resolved
* caller is no longer interested in it.
lrknox marked this conversation as resolved.
Show resolved Hide resolved
*
* \since 1.12.0
*
Expand Down
Loading