diff options
author | Quincey Koziol <koziol@koziol.gov> | 2019-08-23 21:54:52 (GMT) |
---|---|---|
committer | Jerome Soumagne <jsoumagne@hdfgroup.org> | 2019-10-08 20:18:42 (GMT) |
commit | b571cf6c3851357d86cd5a231351d75177af29a4 (patch) | |
tree | c45720e47289f2ccf585119c8335148712304468 /src/H5VLnative_file.c | |
parent | 1b766420f1c5064b0ad2f126c6d62cba8373564f (diff) | |
download | hdf5-b571cf6c3851357d86cd5a231351d75177af29a4.zip hdf5-b571cf6c3851357d86cd5a231351d75177af29a4.tar.gz hdf5-b571cf6c3851357d86cd5a231351d75177af29a4.tar.bz2 |
Adapt Jerome's "file info" H5VL 'get' query to retrieve container token info.
Remove "by address" location for VOL operations. (Switching to "by token")
Diffstat (limited to 'src/H5VLnative_file.c')
-rw-r--r-- | src/H5VLnative_file.c | 86 |
1 files changed, 49 insertions, 37 deletions
diff --git a/src/H5VLnative_file.c b/src/H5VLnative_file.c index 0ac70e3..9afb718 100644 --- a/src/H5VLnative_file.c +++ b/src/H5VLnative_file.c @@ -129,6 +129,18 @@ H5VL__native_file_get(void *obj, H5VL_file_get_t get_type, FUNC_ENTER_PACKAGE switch(get_type) { + /* "get container info" */ + case H5VL_FILE_GET_CONT_INFO: + { + H5VL_file_cont_info_t *info = HDva_arg(arguments, H5VL_file_cont_info_t *); + + /* Retrieve the file's container info */ + if(H5F__get_cont_info((H5F_t *)obj, info) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get file container info") + + break; + } + /* H5Fget_access_plist */ case H5VL_FILE_GET_FAPL: { @@ -139,7 +151,7 @@ H5VL__native_file_get(void *obj, H5VL_file_get_t get_type, /* Retrieve the file's access property list */ if((*plist_id = H5F_get_access_plist(f, TRUE)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get file access property list") + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get file access property list") if(NULL == (new_plist = (H5P_genplist_t *)H5I_object(*plist_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list") @@ -163,42 +175,6 @@ H5VL__native_file_get(void *obj, H5VL_file_get_t get_type, break; } - /* H5Fget_obj_count */ - case H5VL_FILE_GET_OBJ_COUNT: - { - unsigned types = HDva_arg(arguments, unsigned); - ssize_t *ret = HDva_arg(arguments, ssize_t *); - size_t obj_count = 0; /* Number of opened objects */ - - f = (H5F_t *)obj; - /* Perform the query */ - if(H5F_get_obj_count(f, types, TRUE, &obj_count) < 0) - HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "H5F_get_obj_count failed") - - /* Set the return value */ - *ret = (ssize_t)obj_count; - break; - } - - /* H5Fget_obj_ids */ - case H5VL_FILE_GET_OBJ_IDS: - { - unsigned types = HDva_arg(arguments, unsigned); - size_t max_objs = HDva_arg(arguments, size_t); - hid_t *oid_list = HDva_arg(arguments, hid_t *); - ssize_t *ret = HDva_arg(arguments, ssize_t *); - size_t obj_count = 0; /* Number of opened objects */ - - f = (H5F_t *)obj; - /* Perform the query */ - if(H5F_get_obj_ids(f, types, max_objs, oid_list, TRUE, &obj_count) < 0) - HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "H5F_get_obj_ids failed") - - /* Set the return value */ - *ret = (ssize_t)obj_count; - break; - } - /* H5Fget_intent */ case H5VL_FILE_GET_INTENT: { @@ -266,6 +242,42 @@ H5VL__native_file_get(void *obj, H5VL_file_get_t get_type, break; } + /* H5Fget_obj_count */ + case H5VL_FILE_GET_OBJ_COUNT: + { + unsigned types = HDva_arg(arguments, unsigned); + ssize_t *ret = HDva_arg(arguments, ssize_t *); + size_t obj_count = 0; /* Number of opened objects */ + + f = (H5F_t *)obj; + /* Perform the query */ + if(H5F_get_obj_count(f, types, TRUE, &obj_count) < 0) + HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "H5F_get_obj_count failed") + + /* Set the return value */ + *ret = (ssize_t)obj_count; + break; + } + + /* H5Fget_obj_ids */ + case H5VL_FILE_GET_OBJ_IDS: + { + unsigned types = HDva_arg(arguments, unsigned); + size_t max_objs = HDva_arg(arguments, size_t); + hid_t *oid_list = HDva_arg(arguments, hid_t *); + ssize_t *ret = HDva_arg(arguments, ssize_t *); + size_t obj_count = 0; /* Number of opened objects */ + + f = (H5F_t *)obj; + /* Perform the query */ + if(H5F_get_obj_ids(f, types, max_objs, oid_list, TRUE, &obj_count) < 0) + HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "H5F_get_obj_ids failed") + + /* Set the return value */ + *ret = (ssize_t)obj_count; + break; + } + default: HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't get this type of information") } /* end switch */ |