diff options
author | Songyu Lu <songyulu@hdfgroup.org> | 2019-04-09 21:20:19 (GMT) |
---|---|---|
committer | Songyu Lu <songyulu@hdfgroup.org> | 2019-04-09 21:20:19 (GMT) |
commit | 477dda3c0daea39cdf409684e7dad0fd9367dd45 (patch) | |
tree | 08f8d1653aec4e356fb069ae3a7d8768009901e2 /src/H5Dint.c | |
parent | d8ff8da46cb49098c41b421427967eb736e15236 (diff) | |
download | hdf5-477dda3c0daea39cdf409684e7dad0fd9367dd45.zip hdf5-477dda3c0daea39cdf409684e7dad0fd9367dd45.tar.gz hdf5-477dda3c0daea39cdf409684e7dad0fd9367dd45.tar.bz2 |
HDFFV-10658 - setting and getting properties in API context:
1. switched to use the existing H5F_prefix_open_t for enum type;
2. put the common private function used by external.c and external_env.c into external_common.c
Diffstat (limited to 'src/H5Dint.c')
-rw-r--r-- | src/H5Dint.c | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/src/H5Dint.c b/src/H5Dint.c index 6ace085..208d879 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -43,12 +43,6 @@ /* Local Typedefs */ /******************/ -/* Type of prefix for file */ -typedef enum { - H5D_PREFIX_TYPE_UNKNOWN=0, - H5D_PREFIX_TYPE_EXT=1, - H5D_PREFIX_TYPE_VDS=2 -} H5D_prefix_type_t; /********************/ /* Local Prototypes */ @@ -60,7 +54,7 @@ static herr_t H5D__init_type(H5F_t *file, const H5D_t *dset, hid_t type_id, cons static herr_t H5D__cache_dataspace_info(const H5D_t *dset); static herr_t H5D__init_space(H5F_t *file, const H5D_t *dset, const H5S_t *space); static herr_t H5D__update_oh_info(H5F_t *file, H5D_t *dset, hid_t dapl_id); -static herr_t H5D__build_file_prefix(const H5D_t *dset, H5D_prefix_type_t prefix_type, char **file_prefix); +static herr_t H5D__build_file_prefix(const H5D_t *dset, H5F_prefix_open_t prefix_type, char **file_prefix); static herr_t H5D__open_oid(H5D_t *dataset, hid_t dapl_id); static herr_t H5D__init_storage(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_t old_dim[]); @@ -1094,7 +1088,7 @@ done: *-------------------------------------------------------------------------- */ static herr_t -H5D__build_file_prefix(const H5D_t *dset, H5D_prefix_type_t prefix_type, char **file_prefix /*out*/) +H5D__build_file_prefix(const H5D_t *dset, H5F_prefix_open_t prefix_type, char **file_prefix /*out*/) { char *prefix = NULL; /* prefix used to look for the file */ char *filepath = NULL; /* absolute path of directory the HDF5 file is in */ @@ -1115,14 +1109,14 @@ H5D__build_file_prefix(const H5D_t *dset, H5D_prefix_type_t prefix_type, char ** /* XXX: Future thread-safety note - getenv is not required * to be reentrant. */ - if(H5D_PREFIX_TYPE_VDS == prefix_type) { + if(H5F_PREFIX_VDS == prefix_type) { prefix = (char *)H5D_prefix_vds_env; if(prefix == NULL || *prefix == '\0') { if(H5CX_get_vds_prefix(&prefix) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get the prefix for vds file") } - } else if(H5D_PREFIX_TYPE_EXT == prefix_type) { + } else if(H5F_PREFIX_EFILE == prefix_type) { prefix = (char *)H5D_prefix_ext_env; if(prefix == NULL || *prefix == '\0') { @@ -1338,11 +1332,11 @@ H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to set up flush append property") /* Set the external file prefix */ - if(H5D__build_file_prefix(new_dset, H5D_PREFIX_TYPE_EXT, &new_dset->shared->extfile_prefix) < 0) + if(H5D__build_file_prefix(new_dset, H5F_PREFIX_EFILE, &new_dset->shared->extfile_prefix) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize external file prefix") /* Set the VDS file prefix */ - if(H5D__build_file_prefix(new_dset, H5D_PREFIX_TYPE_VDS, &new_dset->shared->vds_prefix) < 0) + if(H5D__build_file_prefix(new_dset, H5F_PREFIX_VDS, &new_dset->shared->vds_prefix) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize VDS prefix") /* Add the dataset to the list of opened objects in the file */ @@ -1497,11 +1491,11 @@ H5D_open(const H5G_loc_t *loc, hid_t dapl_id) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, NULL, "can't copy path") /* Get the external file prefix */ - if(H5D__build_file_prefix(dataset, H5D_PREFIX_TYPE_EXT, &extfile_prefix) < 0) + if(H5D__build_file_prefix(dataset, H5F_PREFIX_EFILE, &extfile_prefix) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize external file prefix") /* Get the VDS prefix */ - if(H5D__build_file_prefix(dataset, H5D_PREFIX_TYPE_VDS, &vds_prefix) < 0) + if(H5D__build_file_prefix(dataset, H5F_PREFIX_VDS, &vds_prefix) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize VDS prefix") /* Check if dataset was already open */ |