diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2018-10-25 04:52:47 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2018-10-25 04:52:47 (GMT) |
commit | 0df6e44a6e68da1614cf80b50ed7b208edaa5df7 (patch) | |
tree | f734083b478d38e09b0aecb8e8f3db838cf0b785 /src/H5Ftest.c | |
parent | 1e8ef703cdc057211b3587be776a6e9f62e8f76f (diff) | |
download | hdf5-0df6e44a6e68da1614cf80b50ed7b208edaa5df7.zip hdf5-0df6e44a6e68da1614cf80b50ed7b208edaa5df7.tar.gz hdf5-0df6e44a6e68da1614cf80b50ed7b208edaa5df7.tar.bz2 |
Squashed commit of private branch changes to support stackable VOL plugins.
modified: test/dsets.c
Diffstat (limited to 'src/H5Ftest.c')
-rw-r--r-- | src/H5Ftest.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/H5Ftest.c b/src/H5Ftest.c index 1183284..49a2a22 100644 --- a/src/H5Ftest.c +++ b/src/H5Ftest.c @@ -233,3 +233,37 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F__get_sbe_addr_test() */ + +/*------------------------------------------------------------------------- + * Function: H5F__same_file_test + * + * Purpose: Check if two file IDs refer to the same underlying file. + * + * Return: SUCCEED/FAIL + * + * Programmer: Quincey Koziol + * Oct 13, 2018 + * + *------------------------------------------------------------------------- + */ +htri_t +H5F__same_file_test(hid_t file_id1, hid_t file_id2) +{ + H5F_t *file1, *file2; /* File info */ + htri_t ret_value = FAIL; /* Return value */ + + FUNC_ENTER_PACKAGE + + /* Check arguments */ + if(NULL == (file1 = (H5F_t *)H5VL_object_verify(file_id1, H5I_FILE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file") + if(NULL == (file2 = (H5F_t *)H5VL_object_verify(file_id2, H5I_FILE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file") + + /* If they are using the same underlying "shared" file struct, they are the same file */ + ret_value = (file1->shared == file2->shared); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5F__same_file_test() */ + |