diff options
author | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2018-12-23 06:18:42 (GMT) |
---|---|---|
committer | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2018-12-23 06:18:42 (GMT) |
commit | c3f51c52d098d6cd2e6c2955a50140bdb45571c6 (patch) | |
tree | 3fbc8a16ba3140b0f7ed1febfbff9afb511073bd /src/H5Ftest.c | |
parent | 251ba120b5e3277a0e53e9ea2417f6b370cf7d05 (diff) | |
parent | 7d28a4295ebac24dd0a84da9f4b880488d8bd32f (diff) | |
download | hdf5-c3f51c52d098d6cd2e6c2955a50140bdb45571c6.zip hdf5-c3f51c52d098d6cd2e6c2955a50140bdb45571c6.tar.gz hdf5-c3f51c52d098d6cd2e6c2955a50140bdb45571c6.tar.bz2 |
Merge branch 'develop' of https://bitbucket.hdfgroup.org/scm/~bmribler/hdf5_bmr_fixbug into develop
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() */ + |