summaryrefslogtreecommitdiffstats
path: root/src/H5Oattr.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2005-11-15 02:55:39 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2005-11-15 02:55:39 (GMT)
commita1708eb023f2c8f8ac6c2c17bf1e598c8dff956e (patch)
tree34c87a3753b36c4c8d689d58bf456eaf261cd235 /src/H5Oattr.c
parentbea1e576c5ef5500678f7ce913d835341b625e8f (diff)
downloadhdf5-a1708eb023f2c8f8ac6c2c17bf1e598c8dff956e.zip
hdf5-a1708eb023f2c8f8ac6c2c17bf1e598c8dff956e.tar.gz
hdf5-a1708eb023f2c8f8ac6c2c17bf1e598c8dff956e.tar.bz2
[svn-r11712] Purpose:
New feature Description: Check in baseline for compact group revisions, which radically revises the source code for managing groups and object headers. WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! This initiates the "unstable" phase of the 1.7.x branch, leading up to the 1.8.0 release. Please test this code, but do _NOT_ keep files created with it - the format will change again before the release and you will not be able to read your old files!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! Solution: There's too many changes to really describe them all, but some of them include: - Stop abusing the H5G_entry_t structure and split it into two separate structures for non-symbol table node use within the library: H5O_loc_t for object locations in a file and H5G_name_t to store the path to an opened object. H5G_entry_t is now only used for storing symbol table entries on disk. - Retire H5G_namei() in favor of a more general mechanism for traversing group paths and issuing callbacks on objects located. This gets us out of the business of hacking H5G_namei() for new features, generally. - Revised H5O* routines to take a H5O_loc_t instead of H5G_entry_t - Lots more... Platforms tested: h5committested and maybe another dozen configurations.... :-)
Diffstat (limited to 'src/H5Oattr.c')
-rw-r--r--src/H5Oattr.c47
1 files changed, 24 insertions, 23 deletions
diff --git a/src/H5Oattr.c b/src/H5Oattr.c
index 9ac5570..4d97b12 100644
--- a/src/H5Oattr.c
+++ b/src/H5Oattr.c
@@ -28,7 +28,7 @@
/* PRIVATE PROTOTYPES */
static herr_t H5O_attr_encode (H5F_t *f, uint8_t *p, const void *mesg);
-static void *H5O_attr_decode (H5F_t *f, hid_t dxpl_id, const uint8_t *p, H5O_shared_t *sh);
+static void *H5O_attr_decode (H5F_t *f, hid_t dxpl_id, const uint8_t *p);
static void *H5O_attr_copy (const void *_mesg, void *_dest, unsigned update_flags);
static size_t H5O_attr_size (const H5F_t *f, const void *_mesg);
static herr_t H5O_attr_reset (void *_mesg);
@@ -105,7 +105,7 @@ H5FL_EXTERN(H5S_extent_t);
*
--------------------------------------------------------------------------*/
static void *
-H5O_attr_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p, H5O_shared_t UNUSED *sh)
+H5O_attr_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p)
{
H5A_t *attr = NULL;
H5S_extent_t *extent; /*extent dimensionality information */
@@ -155,7 +155,7 @@ H5O_attr_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p, H5O_shared_t UNUSED *
H5O_shared_t *shared; /* Shared information */
/* Get the shared information */
- if (NULL == (shared = (H5O_SHARED->decode) (f, dxpl_id, p, NULL)))
+ if (NULL == (shared = (H5O_SHARED->decode) (f, dxpl_id, p)))
HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, NULL, "unable to decode shared message");
/* Get the actual datatype information */
@@ -166,7 +166,7 @@ H5O_attr_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p, H5O_shared_t UNUSED *
H5O_free_real(H5O_SHARED, shared);
} /* end if */
else {
- if((attr->dt=(H5O_DTYPE->decode)(f,dxpl_id,p,NULL))==NULL)
+ if((attr->dt=(H5O_DTYPE->decode)(f,dxpl_id,p))==NULL)
HGOTO_ERROR(H5E_ATTR, H5E_CANTDECODE, NULL, "can't decode attribute datatype");
} /* end else */
if(version < H5O_ATTR_VERSION_NEW)
@@ -178,7 +178,7 @@ H5O_attr_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p, H5O_shared_t UNUSED *
if (NULL==(attr->ds = H5FL_CALLOC(H5S_t)))
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed");
- if((extent=(H5O_SDSPACE->decode)(f,dxpl_id,p,NULL))==NULL)
+ if((extent=(H5O_SDSPACE->decode)(f,dxpl_id,p))==NULL)
HGOTO_ERROR(H5E_ATTR, H5E_CANTDECODE, NULL, "can't decode attribute dataspace");
/* Copy the extent information */
@@ -629,9 +629,10 @@ H5O_attr_copy_file(H5F_t UNUSED *file_src, void *native_src,
/* Copy the top level of the attribute */
*attr_dst = *attr_src;
- /* Don't have an opened group entry for copy */
- H5G_ent_reset(&(attr_dst->ent));
- attr_dst->ent_opened = 0;
+ /* Don't have an opened group location for copy */
+ H5O_loc_reset(&(attr_dst->oloc));
+ H5G_name_reset(&(attr_dst->path));
+ attr_dst->obj_opened = 0;
/* Copy attribute's name */
attr_dst->name = H5MM_strdup(attr_src->name);
@@ -642,21 +643,21 @@ H5O_attr_copy_file(H5F_t UNUSED *file_src, void *native_src,
/* Check for named datatype being copied */
if(H5T_committed(attr_src->dt)) {
- H5G_entry_t *ent_src; /* Pointer to source datatype's group entry */
- H5G_entry_t *ent_dst; /* Pointer to dest. datatype's group entry */
+ H5O_loc_t *src_oloc; /* Pointer to source datatype's object location */
+ H5O_loc_t *dst_oloc; /* Pointer to dest. datatype's object location */
/* Get group entries for source & destination */
- ent_src = H5T_entof(attr_src->dt);
- HDassert(ent_src);
- ent_dst = H5T_entof(attr_dst->dt);
- HDassert(ent_dst);
+ src_oloc = H5T_oloc(attr_src->dt);
+ HDassert(src_oloc);
+ dst_oloc = H5T_oloc(attr_dst->dt);
+ HDassert(dst_oloc);
- /* Reset group entry for new object */
- H5G_ent_reset(ent_dst);
- ent_dst->file = file_dst;
+ /* Reset object location for new object */
+ H5O_loc_reset(dst_oloc);
+ dst_oloc->file = file_dst;
/* Copy the shared object from source to destination */
- if(H5O_copy_header_map(ent_src, ent_dst, dxpl_id, map_list) < 0)
+ if(H5O_copy_header_map(src_oloc, dst_oloc, dxpl_id, map_list) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, NULL, "unable to copy object")
} /* end if */
@@ -725,11 +726,11 @@ H5O_attr_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE * stream, int in
"Initialized:",
(unsigned int)mesg->initialized);
fprintf(stream, "%*s%-*s %u\n", indent, "", fwidth,
- "Opened:",
- (unsigned int)mesg->ent_opened);
- fprintf(stream, "%*sSymbol table entry...\n", indent, "");
- H5G_ent_debug(f, dxpl_id, &(mesg->ent), stream, indent+3, MAX(0, fwidth-3),
- HADDR_UNDEF);
+ "Object opened:",
+ (unsigned int)mesg->obj_opened);
+ HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth,
+ "Object:",
+ mesg->oloc.addr);
fprintf(stream, "%*sData type...\n", indent, "");
fprintf(stream, "%*s%-*s %lu\n", indent+3, "", MAX(0,fwidth-3),