summaryrefslogtreecommitdiffstats
path: root/src/H5Fdeprec.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2018-03-15 21:54:30 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2018-03-15 21:54:30 (GMT)
commit4a17aff4085ad6ee265b95730aca3f493056dec8 (patch)
tree8bfb665c6d95a2e3520fa1bb0ff54d95aff3923f /src/H5Fdeprec.c
parent853ae26333592faf69cd8c454ef92ffea8549df5 (diff)
downloadhdf5-4a17aff4085ad6ee265b95730aca3f493056dec8.zip
hdf5-4a17aff4085ad6ee265b95730aca3f493056dec8.tar.gz
hdf5-4a17aff4085ad6ee265b95730aca3f493056dec8.tar.bz2
Add API context interface and use it throughout the library.
Diffstat (limited to 'src/H5Fdeprec.c')
-rw-r--r--src/H5Fdeprec.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/src/H5Fdeprec.c b/src/H5Fdeprec.c
index 03f5df8..cbbd16f 100644
--- a/src/H5Fdeprec.c
+++ b/src/H5Fdeprec.c
@@ -36,6 +36,7 @@
/* Headers */
/***********/
#include "H5private.h" /* Generic Functions */
+#include "H5CXprivate.h" /* API Contexts */
#include "H5Eprivate.h" /* Error handling */
#include "H5Fpkg.h" /* File access */
#include "H5Iprivate.h" /* IDs */
@@ -100,6 +101,8 @@ herr_t
H5Fget_info1(hid_t obj_id, H5F_info1_t *finfo)
{
H5F_t *f; /* Top file in mount hierarchy */
+ H5F_info2_t finfo2; /* Current file info struct */
+hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -127,19 +130,23 @@ H5Fget_info1(hid_t obj_id, H5F_info1_t *finfo)
} /* end else */
HDassert(f->shared);
- /* Reset file info struct */
- HDmemset(finfo, 0, sizeof(*finfo));
+/* Set API context */
+if(H5CX_push() < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context")
+api_ctx_pushed = TRUE;
- /* Get the size of the superblock extension */
- if(H5F__super_size(f, H5AC_ind_read_dxpl_id, NULL, &finfo->super_ext_size) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "Unable to retrieve superblock extension size")
+ /* Get the current file info */
+ if(H5F__get_info(f, &finfo2) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to retrieve file info")
- /* Check for SOHM info */
- if(H5F_addr_defined(f->shared->sohm_addr))
- if(H5SM_ih_size(f, H5AC_ind_read_dxpl_id, &finfo->sohm.hdr_size, &finfo->sohm.msgs_info) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "Unable to retrieve SOHM index & heap storage info")
+ /* Copy the compatible fields into the older struct */
+ finfo->super_ext_size = finfo2.super.super_ext_size;
+ finfo->sohm.hdr_size = finfo2.sohm.hdr_size;
+ finfo->sohm.msgs_info = finfo2.sohm.msgs_info;
done:
+if(api_ctx_pushed && H5CX_pop() < 0)
+ HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context")
FUNC_LEAVE_API(ret_value)
} /* end H5Fget_info1() */