summaryrefslogtreecommitdiffstats
path: root/src/H5I.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@koziol.gov>2019-12-20 04:41:37 (GMT)
committerQuincey Koziol <koziol@koziol.gov>2019-12-20 04:41:37 (GMT)
commit58cf79532129a0df49c5516506cfe8be5e09d3eb (patch)
tree768d5f91c9b821329bd06206b6510b5bf31c9ec7 /src/H5I.c
parentb55a584fd5b3aac6f2514fba41a6182030b497ae (diff)
downloadhdf5-58cf79532129a0df49c5516506cfe8be5e09d3eb.zip
hdf5-58cf79532129a0df49c5516506cfe8be5e09d3eb.tar.gz
hdf5-58cf79532129a0df49c5516506cfe8be5e09d3eb.tar.bz2
Refactor all the 'H5VL_*_optional' callbacks to move the type of operation out
of the va_list, so it's at least possible for another connector to know what the operation is and decide whether to implement it or not. Added a new VOL sub-class called "introspect" where callbacks that report information about the connector or container can be placed. Added an 'opt_query' callback to this sub-class, for a connector to report back to the library whether a particular optional callback operation is supported. Also added a 'get_conn_cls' introspection callback, to retrieve the H5VL_class_t of a connector (either the "current" connector, H5VL_GET_CONN_LVL_CURR, or the terminal connector, H5VL_GET_CONN_LVL_TERM). Moved the "post open" operation from a file 'specific' operation to a file 'optional' operation, now that it's possible to detect (with the 'opt_query' introspection callback) whether a VOL connector implements an optional operation, without just returning an error. Added new internal VOL helper routines: H5VL_object_is_native, to determine if an object is in (or is a) native file, and H5VL_file_is_same, to determine if two objects are in (or are) the same terminal VOL connector's container. (And moved the special handling for FILE_IS_EQUAL operation out of internal VOL callback routine into H5VL_file_is_same) Made new dataset 'get' operation for H5Dvlen_get_buf_size, aligning it better with other 'get' operations in API. Fixed several issues with pass-through connectors, which are now passing the 'make check-passthrough-vol' tests again. A bunch of warning and style cleanups as well.
Diffstat (limited to 'src/H5I.c')
-rw-r--r--src/H5I.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/H5I.c b/src/H5I.c
index c3c2d46..eaa4cdf 100644
--- a/src/H5I.c
+++ b/src/H5I.c
@@ -1235,8 +1235,7 @@ H5I__remove_common(H5I_id_type_t *type_ptr, hid_t id)
if(NULL == (curr_id = (H5I_id_info_t *)H5SL_remove(type_ptr->ids, &id)))
HGOTO_ERROR(H5E_ATOM, H5E_CANTDELETE, NULL, "can't remove ID node from skip list")
- /* (Casting away const OK -QAK) */
- ret_value = (void *)curr_id->obj_ptr;
+ ret_value = (void *)curr_id->obj_ptr; /* (Casting away const OK -QAK) */
curr_id = H5FL_FREE(H5I_id_info_t, curr_id);
/* Decrement the number of IDs in the type */
@@ -2259,8 +2258,8 @@ done:
hid_t
H5Iget_file_id(hid_t obj_id)
{
- H5I_type_t type; /* ID type */
- hid_t ret_value = H5I_INVALID_HID; /* Return value */
+ H5I_type_t type; /* ID type */
+ hid_t ret_value = H5I_INVALID_HID; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE1("i", "i", obj_id);
@@ -2269,15 +2268,15 @@ H5Iget_file_id(hid_t obj_id)
type = H5I_TYPE(obj_id);
/* Call internal function */
- if (H5I_FILE == type || H5I_DATATYPE == type || H5I_GROUP == type || H5I_DATASET == type || H5I_ATTR == type) {
- H5VL_object_t *vol_obj = NULL; /* Object token of obj_id */
+ if(H5I_FILE == type || H5I_DATATYPE == type || H5I_GROUP == type || H5I_DATASET == type || H5I_ATTR == type) {
+ H5VL_object_t *vol_obj; /* Object token of obj_id */
/* Get the VOL object */
if(NULL == (vol_obj = H5VL_vol_object(obj_id)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "invalid location identifier")
+ HGOTO_ERROR(H5E_ATOM, H5E_BADTYPE, H5I_INVALID_HID, "invalid location identifier")
/* Get the file ID */
- if ((ret_value = H5F_get_file_id(vol_obj, type, TRUE)) < 0)
+ if((ret_value = H5F_get_file_id(vol_obj, type, TRUE)) < 0)
HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, H5I_INVALID_HID, "can't retrieve file ID")
} /* end if */
else