summaryrefslogtreecommitdiffstats
path: root/src/H5VLint.c
diff options
context:
space:
mode:
authorMohamad Chaarawi <chaarawi@hdfgroup.org>2012-07-03 20:19:47 (GMT)
committerMohamad Chaarawi <chaarawi@hdfgroup.org>2012-07-03 20:19:47 (GMT)
commit34050a7d9c9ae16326711cfb69c575bfe75e422e (patch)
tree4853ab483660cd6ade4768d95dec53ceb3879cfd /src/H5VLint.c
parent358cac8ec8cd1989bf0b47d255751c6d4130c0fc (diff)
downloadhdf5-34050a7d9c9ae16326711cfb69c575bfe75e422e.zip
hdf5-34050a7d9c9ae16326711cfb69c575bfe75e422e.tar.gz
hdf5-34050a7d9c9ae16326711cfb69c575bfe75e422e.tar.bz2
[svn-r22511] - remove the internal file type and use the file ID created at the API level for the native implementation
- work on fixing the named datatype issue.. still not resolved - branch still not stable and tests do not pass at this point
Diffstat (limited to 'src/H5VLint.c')
-rw-r--r--src/H5VLint.c37
1 files changed, 36 insertions, 1 deletions
diff --git a/src/H5VLint.c b/src/H5VLint.c
index 14f7d98..41d407c 100644
--- a/src/H5VLint.c
+++ b/src/H5VLint.c
@@ -336,7 +336,6 @@ H5VL_object_register(void *obj, H5I_type_t obj_type, H5VL_t *vol_plugin)
HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize datatype handle")
break;
- case H5I_FILE_PRIVATE:
case H5I_UNINIT:
case H5I_BADID:
case H5I_FILE:
@@ -362,6 +361,42 @@ done:
/*-------------------------------------------------------------------------
+ * Function: H5VL_get_object
+ *
+ * Purpose: utility function to return the object pointer associated with
+ * an hid_t. This routine is the same as H5I_object for all types
+ * except for named datatypes, where the vol_obj is returned that
+ * is attached to the H5T_t struct.
+ *
+ * Return: Success: object pointer
+ * Failure: NULL
+ *
+ * Programmer: Mohamad Chaarawi
+ * June, 2012
+ *
+ *-------------------------------------------------------------------------
+ */
+void *
+H5VL_get_object(hid_t id)
+{
+ void *ret_value = NULL;
+
+ FUNC_ENTER_NOAPI(NULL)
+
+ /* get the object */
+ if(NULL == (ret_value = (void *)H5I_object(id)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "invalid file identifier")
+
+ if (H5I_DATATYPE == H5I_get_type(id)) {
+ if (NULL == (ret_value = H5T_get_named_type((H5T_t *)ret_value)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a named datatype")
+ }
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5VL_get_object() */
+
+
+/*-------------------------------------------------------------------------
* Function: H5VL_attr_create
*
* Purpose: Creates an attribute through the VOL