diff options
Diffstat (limited to 'src/H5Ddeprec.c')
-rw-r--r-- | src/H5Ddeprec.c | 96 |
1 files changed, 10 insertions, 86 deletions
diff --git a/src/H5Ddeprec.c b/src/H5Ddeprec.c index dd02907..f5e3996 100644 --- a/src/H5Ddeprec.c +++ b/src/H5Ddeprec.c @@ -31,10 +31,7 @@ /* Module Setup */ /****************/ -#define H5D_PACKAGE /*suppress error about including H5Dpkg */ - -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5D__init_deprec_interface +#include "H5Dmodule.h" /* This source code file is part of the H5D module */ /***********/ @@ -85,51 +82,6 @@ static herr_t H5D__extend(H5D_t *dataset, const hsize_t *size, hid_t dxpl_id); /*******************/ - -/*-------------------------------------------------------------------------- -NAME - H5D__init_deprec_interface -- Initialize interface-specific information -USAGE - herr_t H5D__init_deprec_interface() -RETURNS - Non-negative on success/Negative on failure -DESCRIPTION - Initializes any interface-specific data or routines. (Just calls - H5D_init() currently). - ---------------------------------------------------------------------------*/ -static herr_t -H5D__init_deprec_interface(void) -{ - FUNC_ENTER_STATIC_NOERR - - FUNC_LEAVE_NOAPI(H5D_init()) -} /* H5D__init_deprec_interface() */ - - -/*-------------------------------------------------------------------------- -NAME - H5D__term_deprec_interface -- Terminate interface -USAGE - herr_t H5D__term_deprec_interface() -RETURNS - Non-negative on success/Negative on failure -DESCRIPTION - Terminates interface. (Just resets H5_interface_initialize_g - currently). - ---------------------------------------------------------------------------*/ -herr_t -H5D__term_deprec_interface(void) -{ - FUNC_ENTER_PACKAGE_NOERR - - /* Mark closed */ - H5_interface_initialize_g = 0; - - FUNC_LEAVE_NOAPI(0) -} /* H5D__term_deprec_interface() */ - #ifndef H5_NO_DEPRECATED_SYMBOLS /*------------------------------------------------------------------------- @@ -227,15 +179,10 @@ hid_t H5Dopen1(hid_t loc_id, const char *name) { H5D_t *dset = NULL; - H5G_loc_t loc; /* Object location of group */ - H5G_loc_t dset_loc; /* Object location of dataset */ - H5G_name_t path; /* Dataset group hier. path */ - H5O_loc_t oloc; /* Dataset object location */ - H5O_type_t obj_type; /* Type of object at location */ - hbool_t loc_found = FALSE; /* Location at 'name' found */ - hid_t dapl_id = H5P_DATASET_ACCESS_DEFAULT; /* dapl to use to open dataset */ - hid_t dxpl_id = H5AC_ind_dxpl_id; /* dxpl to use to open datset */ - hid_t ret_value; + H5G_loc_t loc; /* Object location of group */ + hid_t dapl_id = H5P_DATASET_ACCESS_DEFAULT; /* dapl to use to open dataset */ + hid_t dxpl_id = H5AC_ind_dxpl_id; /* dxpl to use to open datset */ + hid_t ret_value; FUNC_ENTER_API(FAIL) H5TRACE2("i", "i*s", loc_id, name); @@ -246,41 +193,18 @@ H5Dopen1(hid_t loc_id, const char *name) if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") - /* Set up dataset location to fill in */ - dset_loc.oloc = &oloc; - dset_loc.path = &path; - H5G_loc_reset(&dset_loc); - - /* Find the dataset object */ - if(H5G_loc_find(&loc, name, &dset_loc, H5P_DEFAULT, dxpl_id) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_NOTFOUND, FAIL, "not found") - loc_found = TRUE; - - /* Check that the object found is the correct type */ - if(H5O_obj_type(&oloc, &obj_type, dxpl_id) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get object type") - if(obj_type != H5O_TYPE_DATASET) - HGOTO_ERROR(H5E_DATASET, H5E_BADTYPE, FAIL, "not a dataset") - /* Open the dataset */ - if(NULL == (dset = H5D_open(&dset_loc, dapl_id, dxpl_id))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't open dataset") + if(NULL == (dset = H5D__open_name(&loc, name, dapl_id, dxpl_id))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "unable to open dataset") /* Register an atom for the dataset */ if((ret_value = H5I_register(H5I_DATASET, dset, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "can't register dataset atom") done: - if(ret_value < 0) { - if(dset != NULL) { - if(H5D_close(dset) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataset") - } /* end if */ - else { - if(loc_found && H5G_loc_free(&dset_loc) < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "can't free location") - } /* end else */ - } /* end if */ + if(ret_value < 0) + if(dset && H5D_close(dset) < 0) + HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataset") FUNC_LEAVE_API(ret_value) } /* end H5Dopen1() */ |