summaryrefslogtreecommitdiffstats
path: root/src/H5VLint.c
diff options
context:
space:
mode:
authorMohamad Chaarawi <chaarawi@hdfgroup.org>2012-06-05 15:13:32 (GMT)
committerMohamad Chaarawi <chaarawi@hdfgroup.org>2012-06-05 15:13:32 (GMT)
commitf38d9a2149d189fa82b5b5d491f7ed10feffc900 (patch)
tree34491ca0d36a6e1ecf259542e809f98048cc72f4 /src/H5VLint.c
parenta3d87651df4a385eb533e1c0a535282552eb40d2 (diff)
downloadhdf5-f38d9a2149d189fa82b5b5d491f7ed10feffc900.zip
hdf5-f38d9a2149d189fa82b5b5d491f7ed10feffc900.tar.gz
hdf5-f38d9a2149d189fa82b5b5d491f7ed10feffc900.tar.bz2
[svn-r22436] add a public routine to get the name of the VOL plugin associated with a File or object
Diffstat (limited to 'src/H5VLint.c')
-rw-r--r--src/H5VLint.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/H5VLint.c b/src/H5VLint.c
index f70e090..00e64c8 100644
--- a/src/H5VLint.c
+++ b/src/H5VLint.c
@@ -260,6 +260,47 @@ done:
/*-------------------------------------------------------------------------
+ * Function: H5VL_get_plugin_name
+ *
+ * Purpose: Private version of H5VLget_plugin_name
+ *
+ * Return: Success: The length of the plugin name
+ * Failure: Negative
+ *
+ * Programmer: Mohamad Chaarawi
+ * June, 2012
+ *
+ *-------------------------------------------------------------------------
+ */
+ssize_t
+H5VL_get_plugin_name(hid_t id, char *name/*out*/, size_t size)
+{
+ H5VL_class_t *vol_plugin; /* VOL structure attached to id */
+ size_t len;
+ ssize_t ret_value;
+
+ FUNC_ENTER_NOAPI(FAIL)
+
+ if (NULL == (vol_plugin = (H5VL_class_t *)H5I_get_aux (id)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "Object/File does not contain VOL information")
+
+ len = HDstrlen(vol_plugin->name);
+
+ if(name) {
+ HDstrncpy(name, vol_plugin->name, MIN(len + 1,size));
+ if(len >= size)
+ name[size-1]='\0';
+ } /* end if */
+
+ /* Set the return value for the API call */
+ ret_value = (ssize_t)len;
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5VL_get_plugin_name() */
+
+
+/*-------------------------------------------------------------------------
* Function: H5VL_attr_create
*
* Purpose: Creates an attribute through the VOL