diff options
author | Raymond Lu <songyulu@hdfgroup.org> | 2002-09-30 16:31:55 (GMT) |
---|---|---|
committer | Raymond Lu <songyulu@hdfgroup.org> | 2002-09-30 16:31:55 (GMT) |
commit | d1e26ae3280320dcc7cd286b4ef77be552bfc244 (patch) | |
tree | b0b85f9e029956209be19e9b28f342a59294c260 /src/H5F.c | |
parent | 4cfb158c292f7707a8a87edfd4b525c6ad7bb4b8 (diff) | |
download | hdf5-d1e26ae3280320dcc7cd286b4ef77be552bfc244.zip hdf5-d1e26ae3280320dcc7cd286b4ef77be552bfc244.tar.gz hdf5-d1e26ae3280320dcc7cd286b4ef77be552bfc244.tar.bz2 |
[svn-r5951]
Purpose:
New API functions
Description:
Added API functions to return pointer to low-level file handle
(H5Fget_vfd_handle and H5FDget_vfd_handle) and related property list
setting functions(H5Pset_family_offset and H5Pset_multi_type).
Platforms tested:
Linux 2.2(eirene), Solaris 2.7(arabica), IRIX64 6.5(modi4)
Diffstat (limited to 'src/H5F.c')
-rw-r--r-- | src/H5F.c | 77 |
1 files changed, 77 insertions, 0 deletions
@@ -205,6 +205,8 @@ H5F_init_interface(void) hid_t driver_id = H5F_ACS_FILE_DRV_ID_DEF; void *driver_info = H5F_ACS_FILE_DRV_INFO_DEF; H5F_close_degree_t close_degree = H5F_CLOSE_DEGREE_DEF; + hsize_t family_offset = H5F_ACS_FAMILY_OFFSET_DEF; + H5FD_mem_t mem_type = H5F_ACS_MULTI_TYPE_DEF; /* File mount property class variable. * - Mount property class to modify @@ -385,6 +387,13 @@ H5F_init_interface(void) if(H5P_register(acs_pclass,H5F_CLOSE_DEGREE_NAME,H5F_CLOSE_DEGREE_SIZE, &close_degree,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class"); + /* Register the offset of family driver info */ + if(H5P_register(acs_pclass,H5F_ACS_FAMILY_OFFSET_NAME,H5F_ACS_FAMILY_OFFSET_SIZE, &family_offset,NULL,NULL,NULL,NULL,NULL,NULL)<0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class"); + + /* Register the data type of multi driver info */ + if(H5P_register(acs_pclass,H5F_ACS_MULTI_TYPE_NAME,H5F_ACS_MULTI_TYPE_SIZE, &mem_type,NULL,NULL,NULL,NULL,NULL,NULL)<0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class"); } /* end if */ /* Only register the default property list if it hasn't been created yet */ @@ -1165,6 +1174,74 @@ done: /*------------------------------------------------------------------------- + * Function: H5Fget_vfd_handle + * + * Purpose: Returns a pointer to the file handle of the low-level file + * driver. + * + * Return: Success: non-negative value. + * + * Failture: negative. + * + * Programmer: Raymond Lu + * Sep. 16, 2002 + * + * Modification: + * + *------------------------------------------------------------------------- + */ +herr_t H5Fget_vfd_handle(hid_t file_id, hid_t fapl, void** file_handle) +{ + H5F_t *file=NULL; + herr_t ret_value; + + FUNC_ENTER_API(H5Fget_vfd_handle, NULL); + + /* Check args */ + assert(file_handle); + if(NULL==(file=H5I_object_verify(file_id, H5I_FILE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file id"); + + ret_value=H5F_get_vfd_handle(file, fapl, file_handle); + +done: + FUNC_LEAVE(ret_value); +} + + +/*------------------------------------------------------------------------- + * Function: H5F_get_vfd_handle + * + * Purpose: Returns a pointer to the file handle of the low-level file + * driver. This is the private function for H5Fget_vfd_handle. + * + * Return: Success: Non-negative. + * + * Failture: negative. + * + * Programmer: Raymond Lu + * Sep. 16, 2002 + * + * Modification: + * + *------------------------------------------------------------------------- + */ +herr_t H5F_get_vfd_handle(H5F_t *file, hid_t fapl, void**file_handle) +{ + herr_t ret_value; + + FUNC_ENTER_NOINIT(H5F_get_vfd_handle); + + assert(file_handle); + if((ret_value=H5FD_get_vfd_handle(file->shared->lf, fapl, file_handle)) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get file handle for file driver"); + +done: + FUNC_LEAVE(ret_value); +} + + +/*------------------------------------------------------------------------- * Function: H5F_equal * * Purpose: Compares NEEDLE to a file from the HAYSTACK. |