diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2012-03-21 15:10:17 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2012-03-21 15:10:17 (GMT) |
commit | eb89d7b53ab95623ab454186a602e1cafc7391f0 (patch) | |
tree | ceafe458b3011e38853e765352d3c7e59bbecce1 /src/H5Rdeprec.c | |
parent | 3e468e6ff65d540a439e99ea568a6bff7add7cea (diff) | |
download | hdf5-eb89d7b53ab95623ab454186a602e1cafc7391f0.zip hdf5-eb89d7b53ab95623ab454186a602e1cafc7391f0.tar.gz hdf5-eb89d7b53ab95623ab454186a602e1cafc7391f0.tar.bz2 |
[svn-r22105] Description:
Bring r20557:22085 from trunk to this branch, also fixing some other
issues/failures in the branch simultaneously. The h5repack tests are still
failing, but Neil will be checking into those, so the branch can be fully
functional again.
Tested on:
Mac OSX/64 10.7.3 (amazon) w/debug
Diffstat (limited to 'src/H5Rdeprec.c')
-rw-r--r-- | src/H5Rdeprec.c | 58 |
1 files changed, 55 insertions, 3 deletions
diff --git a/src/H5Rdeprec.c b/src/H5Rdeprec.c index 0e2acc8..d0c79a8 100644 --- a/src/H5Rdeprec.c +++ b/src/H5Rdeprec.c @@ -46,7 +46,7 @@ #include "H5Gprivate.h" /* Groups */ #include "H5Oprivate.h" /* Object headers */ #include "H5Rpkg.h" /* References */ - +#include "H5Ppublic.h" /* for using H5P_DATASET_ACCESS_DEFAULT */ #ifndef H5_NO_DEPRECATED_SYMBOLS /****************/ @@ -100,7 +100,7 @@ DESCRIPTION static herr_t H5R_init_deprec_interface(void) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5R_init_deprec_interface) + FUNC_ENTER_NOAPI_NOINIT_NOERR FUNC_LEAVE_NOAPI(H5R_init()) } /* H5R_init_deprec_interface() */ @@ -136,7 +136,7 @@ H5Rget_obj_type1(hid_t id, H5R_type_t ref_type, const void *ref) H5O_type_t obj_type; /* Object type */ H5G_obj_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Rget_obj_type1, H5G_UNKNOWN) + FUNC_ENTER_API(H5G_UNKNOWN) H5TRACE3("Go", "iRt*x", id, ref_type, ref); /* Check args */ @@ -158,5 +158,57 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Rget_obj_type1() */ + +/*-------------------------------------------------------------------------- + NAME + H5Rdereference1 + PURPOSE + Opens the HDF5 object referenced. + USAGE + hid_t H5Rdereference1(ref) + hid_t id; IN: Dataset reference object is in or location ID of + object that the dataset is located within. + H5R_type_t ref_type; IN: Type of reference to create + void *ref; IN: Reference to open. + + RETURNS + Valid ID on success, Negative on failure + DESCRIPTION + Given a reference to some object, open that object and return an ID for + that object. + GLOBAL VARIABLES + COMMENTS, BUGS, ASSUMPTIONS + EXAMPLES + REVISION LOG +--------------------------------------------------------------------------*/ +hid_t +H5Rdereference1(hid_t obj_id, H5R_type_t ref_type, const void *_ref) +{ + H5G_loc_t loc; /* Group location */ + H5F_t *file = NULL; /* File object */ + hid_t ret_value; + + FUNC_ENTER_API(FAIL) + H5TRACE3("i", "iRt*x", obj_id, ref_type, _ref); + + /* Check args */ + if(H5G_loc(obj_id, &loc) < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + if(ref_type <= H5R_BADTYPE || ref_type >= H5R_MAXTYPE) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid reference type") + if(_ref == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid reference pointer") + + /* Get the file pointer from the entry */ + file = loc.oloc->file; + + /* Create reference */ + if((ret_value = H5R_dereference(file, H5P_DATASET_ACCESS_DEFAULT, H5AC_dxpl_id, ref_type, _ref, TRUE)) < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, FAIL, "unable dereference object") + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Rdereference1() */ + #endif /* H5_NO_DEPRECATED_SYMBOLS */ |