summaryrefslogtreecommitdiffstats
path: root/src/H5Oattr.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2005-12-04 02:27:37 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2005-12-04 02:27:37 (GMT)
commit8d344f96bcd012742c55e668d6a6b3d81d1c39ee (patch)
tree918447ffaa4d7a81b921dac1a9a0d9a4f380760d /src/H5Oattr.c
parent4620776d72dc398dd134f4b266a38350d6cb7f60 (diff)
downloadhdf5-8d344f96bcd012742c55e668d6a6b3d81d1c39ee.zip
hdf5-8d344f96bcd012742c55e668d6a6b3d81d1c39ee.tar.gz
hdf5-8d344f96bcd012742c55e668d6a6b3d81d1c39ee.tar.bz2
[svn-r11758] Purpose:
New feature Description: Add in a combination of Peter's & my code to support copying variable-length data from one file to another, although currently only supported with contiguous data storage. Platforms tested: FreeBSD 4.11 (sleipnir) h5committest
Diffstat (limited to 'src/H5Oattr.c')
-rw-r--r--src/H5Oattr.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/H5Oattr.c b/src/H5Oattr.c
index 4d97b12..406c486 100644
--- a/src/H5Oattr.c
+++ b/src/H5Oattr.c
@@ -40,8 +40,8 @@ static void *H5O_attr_copy_file(H5F_t *file_src, void *native_src,
static herr_t H5O_attr_debug (H5F_t *f, hid_t dxpl_id, const void *_mesg,
FILE * stream, int indent, int fwidth);
-/* This message derives from H5O */
-const H5O_class_t H5O_ATTR[1] = {{
+/* This message derives from H5O message class */
+const H5O_msg_class_t H5O_MSG_ATTR[1] = {{
H5O_ATTR_ID, /* message id number */
"attribute", /* message name for debugging */
sizeof(H5A_t), /* native message size */
@@ -55,6 +55,7 @@ const H5O_class_t H5O_ATTR[1] = {{
H5O_attr_link, /* link method */
NULL, /* get share method */
NULL, /* set share method */
+ NULL, /* pre copy native value to file */
H5O_attr_copy_file, /* copy native value to file */
NULL, /* post copy native value to file */
H5O_attr_debug /* debug the message */
@@ -155,18 +156,18 @@ H5O_attr_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p)
H5O_shared_t *shared; /* Shared information */
/* Get the shared information */
- if (NULL == (shared = (H5O_SHARED->decode) (f, dxpl_id, p)))
+ if (NULL == (shared = (H5O_MSG_SHARED->decode) (f, dxpl_id, p)))
HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, NULL, "unable to decode shared message");
/* Get the actual datatype information */
- if((attr->dt= H5O_shared_read(f, dxpl_id, shared, H5O_DTYPE, NULL))==NULL)
+ if((attr->dt= H5O_shared_read(f, dxpl_id, shared, H5O_MSG_DTYPE, NULL))==NULL)
HGOTO_ERROR(H5E_ATTR, H5E_CANTDECODE, NULL, "can't decode attribute datatype");
/* Free the shared information */
- H5O_free_real(H5O_SHARED, shared);
+ H5O_free_real(H5O_MSG_SHARED, shared);
} /* end if */
else {
- if((attr->dt=(H5O_DTYPE->decode)(f,dxpl_id,p))==NULL)
+ if((attr->dt=(H5O_MSG_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 +179,7 @@ H5O_attr_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p)
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)
+ if((extent=(H5O_MSG_SDSPACE->decode)(f,dxpl_id,p))==NULL)
HGOTO_ERROR(H5E_ATTR, H5E_CANTDECODE, NULL, "can't decode attribute dataspace");
/* Copy the extent information */
@@ -311,16 +312,16 @@ H5O_attr_encode(H5F_t *f, uint8_t *p, const void *mesg)
HDmemset(&sh_mesg,0,sizeof(H5O_shared_t));
/* Get shared message information from datatype */
- if ((H5O_DTYPE->get_share)(f, attr->dt, &sh_mesg/*out*/)<0)
+ if ((H5O_MSG_DTYPE->get_share)(f, attr->dt, &sh_mesg/*out*/)<0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTENCODE, FAIL, "can't encode shared attribute datatype");
/* Encode shared message information for datatype */
- if((H5O_SHARED->encode)(f,p,&sh_mesg)<0)
+ if((H5O_MSG_SHARED->encode)(f,p,&sh_mesg)<0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTENCODE, FAIL, "can't encode shared attribute datatype");
} /* end if */
else {
/* Encode datatype information */
- if((H5O_DTYPE->encode)(f,p,attr->dt)<0)
+ if((H5O_MSG_DTYPE->encode)(f,p,attr->dt)<0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTENCODE, FAIL, "can't encode attribute datatype");
} /* end else */
if(version < H5O_ATTR_VERSION_NEW) {
@@ -331,7 +332,7 @@ H5O_attr_encode(H5F_t *f, uint8_t *p, const void *mesg)
p += attr->dt_size;
/* encode the attribute dataspace */
- if((H5O_SDSPACE->encode)(f,p,&(attr->ds->extent))<0)
+ if((H5O_MSG_SDSPACE->encode)(f,p,&(attr->ds->extent))<0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTENCODE, FAIL, "can't encode attribute dataspace");
if(version < H5O_ATTR_VERSION_NEW) {
HDmemset(p+attr->ds_size, 0, H5O_ALIGN(attr->ds_size)-attr->ds_size);
@@ -745,14 +746,14 @@ H5O_attr_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE * stream, int in
HDmemset(&sh_mesg,0,sizeof(H5O_shared_t));
/* Get shared message information from datatype */
- if ((H5O_DTYPE->get_share)(f, mesg->dt, &sh_mesg/*out*/)<0)
+ if ((H5O_MSG_DTYPE->get_share)(f, mesg->dt, &sh_mesg/*out*/)<0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTENCODE, FAIL, "can't retrieve shared message information");
- debug=H5O_SHARED->debug;
+ debug=H5O_MSG_SHARED->debug;
dt_mesg=&sh_mesg;
} /* end if */
else {
- debug=H5O_DTYPE->debug;
+ debug=H5O_MSG_DTYPE->debug;
dt_mesg=mesg->dt;
} /* end else */
if(debug)