summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/H5Pfcpl.c77
-rw-r--r--src/H5Ppublic.h6
2 files changed, 81 insertions, 2 deletions
diff --git a/src/H5Pfcpl.c b/src/H5Pfcpl.c
index 35f3e77..4253f73 100644
--- a/src/H5Pfcpl.c
+++ b/src/H5Pfcpl.c
@@ -34,6 +34,78 @@ static int interface_initialize_g = 0;
/* Static function prototypes */
+#ifdef H5_WANT_H5_V1_6_COMPAT
+
+/*-------------------------------------------------------------------------
+ * Function: H5Pget_version
+ *
+ * Purpose: Retrieves version information for various parts of a file.
+ *
+ * SUPER: The file super block.
+ * HEAP: The global heap.
+ * FREELIST: The global free list.
+ * STAB: The root symbol table entry.
+ * SHHDR: Shared object headers.
+ *
+ * Any (or even all) of the output arguments can be null
+ * pointers.
+ *
+ * Return: Success: Non-negative, version information is returned
+ * through the arguments.
+ *
+ * Failure: Negative
+ *
+ * Programmer: Robb Matzke
+ * Wednesday, January 7, 1998
+ *
+ * Modifications:
+ *
+ * Raymond Lu, Oct 14, 2001
+ * Change to the new generic property list.
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5Pget_version(hid_t plist_id, int *_super/*out*/, int *_freelist/*out*/,
+ int *_stab/*out*/, int *_shhdr/*out*/)
+{
+ unsigned super,freelist,stab,shhdr; /* Unsigned versions to query into */
+ H5P_genplist_t *plist; /* Property list pointer */
+ herr_t ret_value=SUCCEED; /* Return value */
+
+ FUNC_ENTER_API(H5Pget_version, FAIL);
+ H5TRACE5("e","ixxxx",plist_id,super,freelist,stab,shhdr);
+
+ /* Get the plist structure */
+ if(NULL == (plist = H5P_object_verify(plist_id,H5P_FILE_CREATE)))
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID");
+
+ /* Get values */
+ if (_super) {
+ if(H5P_get(plist, H5F_CRT_SUPER_VERS_NAME, &super) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get superblock version");
+ *_super=(int)super;
+ } /* end if */
+ if (_freelist) {
+ if(H5P_get(plist, H5F_CRT_FREESPACE_VERS_NAME, &freelist) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get free-space version");
+ *_freelist=(int)freelist;
+ } /* end if */
+ if (_stab) {
+ if(H5P_get(plist, H5F_CRT_OBJ_DIR_VERS_NAME, &stab) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get object directory version");
+ *_stab=(int)stab;
+ } /* end if */
+ if (_shhdr) {
+ if(H5P_get(plist, H5F_CRT_SHARE_HEAD_VERS_NAME, &shhdr) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get shared-header version");
+ *_shhdr=(int)shhdr;
+ } /* end if */
+
+done:
+ FUNC_LEAVE_API(ret_value);
+}
+#else /* H5_WANT_H5_V1_6_COMPAT */
/*-------------------------------------------------------------------------
* Function: H5Pget_version
@@ -65,8 +137,8 @@ static int interface_initialize_g = 0;
*-------------------------------------------------------------------------
*/
herr_t
-H5Pget_version(hid_t plist_id, int *super/*out*/, int *freelist/*out*/,
- int *stab/*out*/, int *shhdr/*out*/)
+H5Pget_version(hid_t plist_id, unsigned *super/*out*/, unsigned *freelist/*out*/,
+ unsigned *stab/*out*/, unsigned *shhdr/*out*/)
{
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value=SUCCEED; /* Return value */
@@ -95,6 +167,7 @@ H5Pget_version(hid_t plist_id, int *super/*out*/, int *freelist/*out*/,
done:
FUNC_LEAVE_API(ret_value);
}
+#endif /* H5_WANT_H5_V1_6_COMPAT */
/*-------------------------------------------------------------------------
diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h
index d91c1f5..40573ea 100644
--- a/src/H5Ppublic.h
+++ b/src/H5Ppublic.h
@@ -144,9 +144,15 @@ H5_DLL herr_t H5Punregister(hid_t pclass_id, const char *name);
H5_DLL herr_t H5Pclose_class(hid_t plist_id);
H5_DLL herr_t H5Pclose(hid_t plist_id);
H5_DLL hid_t H5Pcopy(hid_t plist_id);
+#ifdef H5_WANT_H5_V1_6_COMPAT
H5_DLL herr_t H5Pget_version(hid_t plist_id, int *boot/*out*/,
int *freelist/*out*/, int *stab/*out*/,
int *shhdr/*out*/);
+#else /* H5_WANT_H5_V1_6_COMPAT */
+H5_DLL herr_t H5Pget_version(hid_t plist_id, unsigned *boot/*out*/,
+ unsigned *freelist/*out*/, unsigned *stab/*out*/,
+ unsigned *shhdr/*out*/);
+#endif /* H5_WANT_H5_V1_6_COMPAT */
H5_DLL herr_t H5Pset_userblock(hid_t plist_id, hsize_t size);
H5_DLL herr_t H5Pget_userblock(hid_t plist_id, hsize_t *size);
H5_DLL herr_t H5Pset_alignment(hid_t fapl_id, hsize_t threshold,