diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2003-08-18 16:29:33 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2003-08-18 16:29:33 (GMT) |
commit | 4105dfedb98236c9e2029ff14b0694161aabfb05 (patch) | |
tree | d14f3427f78754ab46d05732133bd27026dc9fb0 /src/H5Pfcpl.c | |
parent | d99164a9ed4fb031db5d3cf3d3086862f25f48f1 (diff) | |
download | hdf5-4105dfedb98236c9e2029ff14b0694161aabfb05.zip hdf5-4105dfedb98236c9e2029ff14b0694161aabfb05.tar.gz hdf5-4105dfedb98236c9e2029ff14b0694161aabfb05.tar.bz2 |
[svn-r7379] Purpose:
Code cleanup
Description:
Changed version #'s returned from H5Pget_version from 'int *' to
'unsigned *' since we are never going to be using negative version #'s... :-)
Platforms tested:
FreeBSD 4.8 (sleipnir)
too small to need h5committest
Diffstat (limited to 'src/H5Pfcpl.c')
-rw-r--r-- | src/H5Pfcpl.c | 77 |
1 files changed, 75 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 */ /*------------------------------------------------------------------------- |