summaryrefslogtreecommitdiffstats
path: root/src/H5Pfapl.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2006-09-11 17:30:24 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2006-09-11 17:30:24 (GMT)
commit5e7ab927c6c48edf51d5e190d0f8c9ab9c151a56 (patch)
tree1cfbd1759bba28b81ad1f81246bf03a2bbb5e040 /src/H5Pfapl.c
parente5cad0ef24543e55d164a26dd42a0cc1ba5c2cbe (diff)
downloadhdf5-5e7ab927c6c48edf51d5e190d0f8c9ab9c151a56.zip
hdf5-5e7ab927c6c48edf51d5e190d0f8c9ab9c151a56.tar.gz
hdf5-5e7ab927c6c48edf51d5e190d0f8c9ab9c151a56.tar.bz2
[svn-r12656] Description:
Add "use the latest version of the file format" flag to the file access property list and internal file data structures. Fix bug where metadata block size was retrieved instead of the small data block size. Categorize property list routine prototypes in the public header file. Tested on: Mac OS/PPC 10.4 (amazon) Linux/32 2.6 (chicago) Linux/64 2.6 (chicago2)
Diffstat (limited to 'src/H5Pfapl.c')
-rw-r--r--src/H5Pfapl.c75
1 files changed, 74 insertions, 1 deletions
diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c
index 0a9e29e..e05b983 100644
--- a/src/H5Pfapl.c
+++ b/src/H5Pfapl.c
@@ -1462,7 +1462,7 @@ H5Pget_small_data_block_size(hid_t plist_id, hsize_t *size/*out*/)
/* Get values */
if (size) {
- if(H5P_get(plist, H5F_ACS_META_BLOCK_SIZE_NAME, size) < 0)
+ if(H5P_get(plist, H5F_ACS_SDATA_BLOCK_SIZE_NAME, size) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get 'small data' block size");
} /* end if */
@@ -1470,3 +1470,76 @@ done:
FUNC_LEAVE_API(ret_value);
} /* end H5Pget_small_data_block_size() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5Pset_latest_format
+ *
+ * Purpose: Indicates that the library should always use the latest version
+ * of the file format when creating objects. If this flag is not set,
+ * the library will always use the most backwardly compatibly format
+ * possible that can store the information about an object.
+ *
+ * The default value is set to FALSE (creating backwardly compatible files)
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Quincey Koziol
+ * Friday, September 9, 2006
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5Pset_latest_format(hid_t plist_id, hbool_t latest)
+{
+ H5P_genplist_t *plist; /* Property list pointer */
+ herr_t ret_value = SUCCEED; /* return value */
+
+ FUNC_ENTER_API(H5Pset_latest_format, FAIL)
+
+ /* Get the plist structure */
+ if(NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS)))
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+
+ /* Set values */
+ if(H5P_set(plist, H5F_ACS_LATEST_FORMAT_NAME, &latest) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set 'latest format' flag")
+
+done:
+ FUNC_LEAVE_API(ret_value)
+} /* end H5Pset_latest_format() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5Pget_latest_format
+ *
+ * Purpose: Returns the current settings for the 'latest format' flag
+ * from a file access property list.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Quincey Koziol
+ * Friday, September 9, 2006
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5Pget_latest_format(hid_t plist_id, hbool_t *latest/*out*/)
+{
+ H5P_genplist_t *plist; /* Property list pointer */
+ herr_t ret_value = SUCCEED; /* return value */
+
+ FUNC_ENTER_API(H5Pget_latest_format, FAIL)
+
+ /* Get the plist structure */
+ if(NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS)))
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+
+ /* Get value */
+ if(latest)
+ if(H5P_get(plist, H5F_ACS_LATEST_FORMAT_NAME, latest) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get 'latest format' flag")
+
+done:
+ FUNC_LEAVE_API(ret_value)
+} /* end H5Pget_latest_format() */
+