summaryrefslogtreecommitdiffstats
path: root/src/H5A.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/H5A.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/H5A.c')
-rw-r--r--src/H5A.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/H5A.c b/src/H5A.c
index 678f37e..6703a6f 100644
--- a/src/H5A.c
+++ b/src/H5A.c
@@ -201,6 +201,10 @@ done:
* April 2, 1998
*
* Modifications:
+ *
+ * Pedro Vicente, <pvn@ncsa.uiuc.edu> 22 Aug 2002
+ * Added a deep copy of the symbol table entry
+ *
*-------------------------------------------------------------------------
*/
static hid_t
@@ -240,8 +244,9 @@ H5A_create(const H5G_entry_t *ent, const char *name, const H5T_t *type,
/* Mark it initially set to initialized */
attr->initialized = TRUE; /*for now, set to false later*/
- /* Copy the symbol table entry */
- attr->ent=*ent;
+ /* Deep copy of the symbol table entry */
+ if (H5G_ent_copy(ent,&(attr->ent))<0)
+ HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to copy entry");
/* Compute the internal sizes */
attr->dt_size=(H5O_DTYPE[0].raw_size)(attr->ent.file,type);
@@ -472,6 +477,9 @@ done:
*
* Modifications:
*
+ * Pedro Vicente, <pvn@ncsa.uiuc.edu> 22 Aug 2002
+ * Added a deep copy of the symbol table entry
+ *
*-------------------------------------------------------------------------
*/
static hid_t
@@ -490,9 +498,10 @@ H5A_open(H5G_entry_t *ent, unsigned idx)
if (NULL==(attr=H5O_read(ent, H5O_ATTR, (int)idx, attr)))
HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to load attribute info from dataset header");
attr->initialized=1;
-
- /* Copy the symbol table entry */
- attr->ent=*ent;
+
+ /* Deep copy of the symbol table entry */
+ if (H5G_ent_copy(ent,&(attr->ent))<0)
+ HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to copy entry");
/* Hold the symbol table entry (and file) open */
if (H5O_open(&(attr->ent)) < 0) {