summaryrefslogtreecommitdiffstats
path: root/src/H5Gent.c
diff options
context:
space:
mode:
authorPedro Vicente Nunes <pvn@hdfgroup.org>2002-08-28 18:34:12 (GMT)
committerPedro Vicente Nunes <pvn@hdfgroup.org>2002-08-28 18:34:12 (GMT)
commit7bff4eb559d3f28f27ab29ced0d1e46ada1df620 (patch)
tree26415f62114ac52c107ef88cacfb58218facbefa /src/H5Gent.c
parentfc5e3b4897f695b2d61518954047cc783c8baa1d (diff)
downloadhdf5-7bff4eb559d3f28f27ab29ced0d1e46ada1df620.zip
hdf5-7bff4eb559d3f28f27ab29ced0d1e46ada1df620.tar.gz
hdf5-7bff4eb559d3f28f27ab29ced0d1e46ada1df620.tar.bz2
[svn-r5904]
Purpose: Added 'ID to name' support Description: There is a new API function H5Iget_name Most of the changes are on H5G.c , regarding the symbol table entry struct H5G_entry_t which has 2 new fields 'name' and 'old_name' A new private function was introduced H5G_ent_copy, that does a deep copy between 2 symbol table entries The test file is getname.c Platforms tested: windows 2000, Linux, Solaris
Diffstat (limited to 'src/H5Gent.c')
-rw-r--r--src/H5Gent.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/H5Gent.c b/src/H5Gent.c
index bcc40d8..30c082e 100644
--- a/src/H5Gent.c
+++ b/src/H5Gent.c
@@ -337,6 +337,52 @@ done:
FUNC_LEAVE(ret_value);
}
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5G_ent_copy
+ *
+ * Purpose: Do a deep copy of symbol table entries
+ *
+ * Return: Success: 0, Failure: -1
+ *
+ * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+ *
+ * Date: August 2002
+ *
+ * Comments:
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+
+herr_t
+H5G_ent_copy( const H5G_entry_t *src, H5G_entry_t *dst )
+{
+
+ herr_t ret_value=SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(H5G_ent_copy, FAIL);
+
+ assert( src );
+ assert( dst );
+
+ HDmemcpy(dst,src,sizeof(H5G_entry_t));
+
+ if (src->name){
+ dst->name=H5MM_strdup(src->name);
+ }
+ if (src->old_name){
+ dst->old_name=H5MM_strdup(src->old_name);
+ }
+
+
+done:
+ FUNC_LEAVE(SUCCEED);
+}
+
+
/*-------------------------------------------------------------------------
* Function: H5G_ent_debug