summaryrefslogtreecommitdiffstats
path: root/src/H5Fdeprec.c
diff options
context:
space:
mode:
authorVailin Choi <vchoi@hdfgroup.org>2018-02-14 01:15:40 (GMT)
committerVailin Choi <vchoi@hdfgroup.org>2018-02-14 01:15:40 (GMT)
commit66ea3b8fb9fdff0a0ffa6ffd318ad5fc2c9a8f4b (patch)
tree380fd687260c0d0aff9c3dc04be70afa63b9e296 /src/H5Fdeprec.c
parent20332fac0ead66b7fc90858b209b33fbd6a75d57 (diff)
parentb4294d8d3e5937527e9814f23d04df412ebbe770 (diff)
downloadhdf5-66ea3b8fb9fdff0a0ffa6ffd318ad5fc2c9a8f4b.zip
hdf5-66ea3b8fb9fdff0a0ffa6ffd318ad5fc2c9a8f4b.tar.gz
hdf5-66ea3b8fb9fdff0a0ffa6ffd318ad5fc2c9a8f4b.tar.bz2
Merge pull request #876 in HDFFV/hdf5 from ~VCHOI/my_hdf5_fork:bugfix/version_bounds to develop
* commit 'b4294d8d3e5937527e9814f23d04df412ebbe770': Added comment for clarification about latest as 1.10. Platforms tested: Linux/64 (jelly) Linux/32 (jam) Fixed typos Platforms tested: Linux/32 (jam) Additional tests Description: - Revised and add more variety to version bound tests per review - Revised gen_bounds.c per review Platforms tested: Linux/64 (jelly) Linux/32 (jam) Darwin (osx1010test) Added gen_bounds Cleaned up per comments in PR# 876 Modifications made based on comments from pull request. Added gen_bounds.c Added gen_bounds.c Fix bounds check for the generation of cache image. Modify usage description for -j and -k options so that it is more informative. Modify h5repack usage so that it is more descriptive. Changes made based on code reviews. Further improvement Fixed comment. Adding data file generator Description: Added gen_bounds.c to generate the following files: - bounds_earliest_latest.h5 - bounds_earliest_v18.h5 - bounds_latest_latest.h5 - bounds_v18_latest.h5 - bounds_v18_v18.h5 for testing the version bounds fix in 1.8 and 1.6. Initial checkin for library version bounds Code changes to provide versioning support when adding to the enumerated defines for H5F_libver_t.
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 03f5df8..a9ffa43 100644
--- a/src/H5Fdeprec.c
+++ b/src/H5Fdeprec.c
@@ -143,5 +143,67 @@ done:
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 */