summaryrefslogtreecommitdiffstats
path: root/src/H5Fdeprec.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2018-03-18 23:36:49 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2018-03-18 23:36:49 (GMT)
commitf38864920d4e0bc8adaf9a23fd3f775ad90cb3f7 (patch)
treeb5f709e5415db2f1a9287b43565fea826b3018f5 /src/H5Fdeprec.c
parent4a17aff4085ad6ee265b95730aca3f493056dec8 (diff)
parent7aa4eb1b04014f1ad7e1c857ca6509aeeb6c0ae7 (diff)
downloadhdf5-f38864920d4e0bc8adaf9a23fd3f775ad90cb3f7.zip
hdf5-f38864920d4e0bc8adaf9a23fd3f775ad90cb3f7.tar.gz
hdf5-f38864920d4e0bc8adaf9a23fd3f775ad90cb3f7.tar.bz2
Merge branch 'develop' of https://bitbucket.hdfgroup.org/scm/hdffv/hdf5 into merge_func_enter_vol
Plus initial steps toward merging API context push into FUNC_ENTER_API* macros
Diffstat (limited to 'src/H5Fdeprec.c')
-rw-r--r--src/H5Fdeprec.c62
1 files changed, 62 insertions, 0 deletions
diff --git a/src/H5Fdeprec.c b/src/H5Fdeprec.c
index cbbd16f..74507f0 100644
--- a/src/H5Fdeprec.c
+++ b/src/H5Fdeprec.c
@@ -150,5 +150,67 @@ if(api_ctx_pushed && H5CX_pop() < 0)
FUNC_LEAVE_API(ret_value)
} /* end H5Fget_info1() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5Fset_latest_format
+ *
+ * Purpose: Enable switching between latest or non-latest format while
+ * a file is open.
+ * This is deprecated starting release 1.10.2 and is modified
+ * to call the private H5F_set_libver_bounds() to set the
+ * bounds.
+ *
+ * Before release 1.10.2, the library supports only two
+ * combinations of low/high bounds:
+ * (earliest, latest)
+ * (latest, latest)
+ * Thus, this public routine does the job in switching
+ * between the two combinations listed above.
+ *
+ * Starting release 1.10.2, we add v18 to the enumerated
+ * define H5F_libver_t and the library supports five combinations
+ * as below:
+ * (earliest, v18)
+ * (earliest, v10)
+ * (v18, v18)
+ * (v18, v10)
+ * (v10, v10)
+ * So we introduce the new public routine H5Fset_libver_bounds()
+ * in place of H5Fset_latest_format().
+ * See also RFC: Setting Bounds for Object Creation in HDF5 1.10.0.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Vailin Choi; December 2017
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5Fset_latest_format(hid_t file_id, hbool_t latest_format)
+{
+ H5F_t *f; /* File */
+ H5F_libver_t low = H5F_LIBVER_LATEST; /* Low bound */
+ H5F_libver_t high = H5F_LIBVER_LATEST; /* High bound */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_API(FAIL)
+ H5TRACE2("e", "ib", file_id, latest_format);
+
+ /* Check args */
+ if(NULL == (f = (H5F_t *)H5I_object_verify(file_id, H5I_FILE)))
+ HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "not a file ID")
+
+ /* 'low' and 'high' are both initialized to LATEST.
+ If latest format is not expected, set 'low' to EARLIEST */
+ if(!latest_format)
+ low = H5F_LIBVER_EARLIEST;
+
+ /* Call private set_libver_bounds function to set the bounds */
+ if(H5F__set_libver_bounds(f, low, high) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "cannot set low/high bounds")
+
+done:
+ FUNC_LEAVE_API(ret_value)
+} /* end H5Fset_latest_format() */
#endif /* H5_NO_DEPRECATED_SYMBOLS */