summaryrefslogtreecommitdiffstats
path: root/src/H5T.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/H5T.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/H5T.c')
-rw-r--r--src/H5T.c43
1 files changed, 39 insertions, 4 deletions
diff --git a/src/H5T.c b/src/H5T.c
index 746afa6..28fe21c 100644
--- a/src/H5T.c
+++ b/src/H5T.c
@@ -4197,6 +4197,7 @@ H5T_isa(H5G_entry_t *ent)
* Monday, June 1, 1998
*
* Modifications:
+ * Changed to use H5T_open_oid - QAK - 3/17/99
*
*-------------------------------------------------------------------------
*/
@@ -4217,23 +4218,57 @@ H5T_open (H5G_entry_t *loc, const char *name)
if (H5G_find (loc, name, NULL, &ent/*out*/)<0) {
HRETURN_ERROR (H5E_DATATYPE, H5E_NOTFOUND, NULL, "not found");
}
- if (H5O_open (&ent)<0) {
+ /* Open the datatype object */
+ if ((dt=H5T_open_oid(&ent)) ==NULL) {
+ HRETURN_ERROR(H5E_DATATYPE, H5E_NOTFOUND, NULL, "not found");
+ }
+
+ FUNC_LEAVE (dt);
+}
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5T_open_oid
+ *
+ * Purpose: Open a named data type.
+ *
+ * Return: Success: Ptr to a new data type.
+ *
+ * Failure: NULL
+ *
+ * Programmer: Quincey Koziol
+ * Wednesday, March 17, 1999
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+H5T_t *
+H5T_open_oid (H5G_entry_t *ent)
+{
+ H5T_t *dt = NULL;
+
+ FUNC_ENTER (H5T_open_oid, NULL);
+ assert (ent);
+
+ if (H5O_open (ent)<0) {
HRETURN_ERROR (H5E_DATATYPE, H5E_CANTOPENOBJ, NULL,
"unable to open named data type");
}
- if (NULL==(dt=H5O_read (&ent, H5O_DTYPE, 0, NULL))) {
- H5O_close(&ent);
+ if (NULL==(dt=H5O_read (ent, H5O_DTYPE, 0, NULL))) {
+ H5O_close(ent);
HRETURN_ERROR (H5E_DATATYPE, H5E_CANTINIT, NULL,
"unable to load type message from object header");
}
/* Mark the type as named and open */
dt->state = H5T_STATE_OPEN;
- dt->ent = ent;
+ dt->ent = *ent;
FUNC_LEAVE (dt);
}
+
/*-------------------------------------------------------------------------
* Function: H5T_copy