diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2020-04-09 15:30:09 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2020-04-09 15:30:09 (GMT) |
commit | 0fdbbcfc0b7fe08421efe476e7cbe03411774fe0 (patch) | |
tree | c0def524d72df58889daa331a1d0b742fd90f2a9 /src | |
parent | 88ff2b6cb80c66faf5805e1ec0bdcbfda2942a8d (diff) | |
parent | 35c0d5cdfcfaa84f59e1c596ba1ccaeb28e3d83d (diff) | |
download | hdf5-0fdbbcfc0b7fe08421efe476e7cbe03411774fe0.zip hdf5-0fdbbcfc0b7fe08421efe476e7cbe03411774fe0.tar.gz hdf5-0fdbbcfc0b7fe08421efe476e7cbe03411774fe0.tar.bz2 |
Merge pull request #2502 in HDFFV/hdf5 from ~DEROBINS/hdf5_der:develop_minor to develop
* commit '35c0d5cdfcfaa84f59e1c596ba1ccaeb28e3d83d':
Fix for passthrough VOL not passing tools tests due to incorrect optional callback queries.
Diffstat (limited to 'src')
-rw-r--r-- | src/H5VL.c | 37 | ||||
-rw-r--r-- | src/H5VLconnector.h | 18 | ||||
-rw-r--r-- | src/H5VLpublic.h | 20 |
3 files changed, 55 insertions, 20 deletions
@@ -903,7 +903,7 @@ H5VLfree_lib_state(void *state) /* Check args */ if(NULL == state) - HGOTO_ERROR(H5E_VOL, H5E_BADVALUE, FAIL, "invalid state pointer") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid state pointer") /* Free the library state */ if(H5VL_free_lib_state(state) < 0) @@ -913,3 +913,38 @@ done: FUNC_LEAVE_API(ret_value) } /* H5VLfree_lib_state() */ + +/*--------------------------------------------------------------------------- + * Function: H5VLquery_optional + * + * Purpose: Determine if a VOL connector supports a particular optional + * callback operation. + * + * Return: Success: Non-negative + * Failure: Negative + * + *--------------------------------------------------------------------------- + */ +herr_t +H5VLquery_optional(hid_t obj_id, H5VL_subclass_t subcls, int opt_type, hbool_t *supported) +{ + H5VL_object_t *vol_obj = NULL; + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE4("e", "iVSIs*b", obj_id, subcls, opt_type, supported); + + /* Check args */ + if(NULL == supported) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid supported pointer") + if(NULL == (vol_obj = (H5VL_object_t *)H5I_object(obj_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid object identifier") + + /* Query the connector */ + if(H5VL_introspect_opt_query(vol_obj, subcls, opt_type, supported) < 0) + HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "unable to query VOL connector support") + +done: + FUNC_LEAVE_API(ret_value) +} /* H5VLquery_optional() */ + diff --git a/src/H5VLconnector.h b/src/H5VLconnector.h index 7951a32..4a35f22 100644 --- a/src/H5VLconnector.h +++ b/src/H5VLconnector.h @@ -48,24 +48,6 @@ /* Public Typedefs */ /*******************/ -/* Enum type for each VOL subclass */ -/* (Used for various queries, etc) */ -typedef enum H5VL_subclass_t { - H5VL_SUBCLS_NONE, /* Operations outside of a subclass */ - H5VL_SUBCLS_INFO, /* 'Info' subclass */ - H5VL_SUBCLS_WRAP, /* 'Wrap' subclass */ - H5VL_SUBCLS_ATTR, /* 'Attribute' subclass */ - H5VL_SUBCLS_DATASET, /* 'Dataset' subclass */ - H5VL_SUBCLS_DATATYPE, /* 'Named datatype' subclass */ - H5VL_SUBCLS_FILE, /* 'File' subclass */ - H5VL_SUBCLS_GROUP, /* 'Group' subclass */ - H5VL_SUBCLS_LINK, /* 'Link' subclass */ - H5VL_SUBCLS_OBJECT, /* 'Object' subclass */ - H5VL_SUBCLS_REQUEST, /* 'Request' subclass */ - H5VL_SUBCLS_BLOB, /* 'Blob' subclass */ - H5VL_SUBCLS_TOKEN /* 'Token' subclass */ -} H5VL_subclass_t; - /* types for attribute GET callback */ typedef enum H5VL_attr_get_t { H5VL_ATTR_GET_ACPL, /* creation property list */ diff --git a/src/H5VLpublic.h b/src/H5VLpublic.h index 006c3ea..8f79adc 100644 --- a/src/H5VLpublic.h +++ b/src/H5VLpublic.h @@ -48,6 +48,24 @@ typedef int H5VL_class_value_t; +/* Enum type for each VOL subclass */ +/* (Used for various queries, etc) */ +typedef enum H5VL_subclass_t { + H5VL_SUBCLS_NONE, /* Operations outside of a subclass */ + H5VL_SUBCLS_INFO, /* 'Info' subclass */ + H5VL_SUBCLS_WRAP, /* 'Wrap' subclass */ + H5VL_SUBCLS_ATTR, /* 'Attribute' subclass */ + H5VL_SUBCLS_DATASET, /* 'Dataset' subclass */ + H5VL_SUBCLS_DATATYPE, /* 'Named datatype' subclass */ + H5VL_SUBCLS_FILE, /* 'File' subclass */ + H5VL_SUBCLS_GROUP, /* 'Group' subclass */ + H5VL_SUBCLS_LINK, /* 'Link' subclass */ + H5VL_SUBCLS_OBJECT, /* 'Object' subclass */ + H5VL_SUBCLS_REQUEST, /* 'Request' subclass */ + H5VL_SUBCLS_BLOB, /* 'Blob' subclass */ + H5VL_SUBCLS_TOKEN /* 'Token' subclass */ +} H5VL_subclass_t; + /********************/ /* Public Variables */ /********************/ @@ -70,7 +88,7 @@ H5_DLL hid_t H5VLget_connector_id_by_value(H5VL_class_value_t connector_value); H5_DLL ssize_t H5VLget_connector_name(hid_t id, char *name/*out*/, size_t size); H5_DLL herr_t H5VLclose(hid_t connector_id); H5_DLL herr_t H5VLunregister_connector(hid_t connector_id); - +H5_DLL herr_t H5VLquery_optional(hid_t obj_id, H5VL_subclass_t subcls, int opt_type, hbool_t *supported); #ifdef __cplusplus } |