summaryrefslogtreecommitdiffstats
path: root/src/H5R.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>1999-03-18 01:30:03 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>1999-03-18 01:30:03 (GMT)
commitd8d31596b423c34d96a826f0d82188f55551bb14 (patch)
treea4d4cdb1aabe0e9668b907cfd16ec802b85ce891 /src/H5R.c
parentff5a1a9e29d4e1a6d93b35706e77a511a2fe5532 (diff)
downloadhdf5-d8d31596b423c34d96a826f0d82188f55551bb14.zip
hdf5-d8d31596b423c34d96a826f0d82188f55551bb14.tar.gz
hdf5-d8d31596b423c34d96a826f0d82188f55551bb14.tar.bz2
[svn-r1146] Added support for object references to named datatypes.
Diffstat (limited to 'src/H5R.c')
-rw-r--r--src/H5R.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/H5R.c b/src/H5R.c
index 8662924..447b7cb 100644
--- a/src/H5R.c
+++ b/src/H5R.c
@@ -26,6 +26,7 @@ static char RcsId[] = "@(#)$Revision$";
#include <H5MMprivate.h> /* Memory Management */
#include <H5Rprivate.h> /* References */
#include <H5Sprivate.h> /* Dataspaces */
+#include <H5Tprivate.h> /* Datatypes */
/* Interface initialization */
#define PABLO_MASK H5R_mask
@@ -331,6 +332,7 @@ H5R_dereference(H5D_t *dset, H5R_type_t ref_type, void *_ref)
{
H5D_t *dataset; /* Pointer to dataset to open */
H5G_t *group; /* Pointer to group to open */
+ H5T_t *datatype; /* Pointer to datatype to open */
H5G_entry_t ent; /* Symbol table entry */
uint8_t *p; /* Pointer to OID to store */
intn oid_type; /* type of object being dereferenced */
@@ -415,6 +417,16 @@ H5R_dereference(H5D_t *dset, H5R_type_t ref_type, void *_ref)
break;
case H5G_TYPE:
+ if ((datatype=H5T_open_oid(&ent)) == NULL) {
+ HGOTO_ERROR(H5E_DATATYPE, H5E_NOTFOUND, FAIL, "not found");
+ }
+
+ /* Create an atom for the dataset */
+ if ((ret_value = H5I_register(H5I_DATATYPE, datatype)) < 0) {
+ H5T_close(datatype);
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL,
+ "can't register group");
+ }
break;
case H5G_DATASET: