[svn-r3066] Purpose:

Bug Fix.
Description:
    Attributes whose datatype was an object or dataset region reference weren't
    dumping correctly.
Solution:
    Pass along attribute ID to the code which prints the attributes, so the
    reference types can be dereferenced and printed.
Platforms tested:
    FreeBSD 4.2 (hawkwind) & IRIX64 6.5 (modi4)
This commit is contained in:
Quincey Koziol 2000-12-02 10:13:38 -05:00
parent 74d5c6b757
commit afb64c0bac
4 changed files with 8 additions and 10 deletions

View File

@ -1281,7 +1281,6 @@ dump_data(hid_t obj_id, int obj_data)
/* need to call h5dump_mem for the attribute data */
type = H5Aget_type(obj_id);
p_type = h5dump_fixtype(type);
H5Tclose(type);
space = H5Aget_space(obj_id);
ndims = H5Sget_simple_extent_dims(space, size, NULL);
@ -1292,7 +1291,7 @@ dump_data(hid_t obj_id, int obj_data)
assert(buf);
if (H5Aread(obj_id, p_type, buf) >= 0)
d_status = h5dump_mem(stdout, outputformat, p_type, space, buf, depth);
d_status = h5dump_mem(stdout, outputformat, obj_id, p_type, space, buf, depth);
free(buf);
H5Tclose(p_type);

View File

@ -1328,7 +1328,7 @@ list_attr (hid_t obj, const char *attr_name, void UNUSED *op_data)
buf = malloc(need);
assert(buf);
if (H5Aread(attr, p_type, buf)>=0) {
h5dump_mem(stdout, &info, p_type, space, buf,-1);
h5dump_mem(stdout, &info, attr, p_type, space, buf,-1);
}
free(buf);
H5Tclose(p_type);

View File

@ -1081,7 +1081,6 @@ h5dump_sprint(h5dump_str_t *str/*in,out*/, const h5dump_t *info,
H5Tclose(memb);
} else if (H5T_VLEN==H5Tget_class(type)) {
unsigned int i;
hid_t space;
/* Get the VL sequences's base datatype for each element */
memb=H5Tget_super(type);
@ -1619,7 +1618,7 @@ h5dump_simple_dset(FILE *stream, const h5dump_t *info, hid_t dset,
*-------------------------------------------------------------------------
*/
static int
h5dump_simple_mem(FILE *stream, const h5dump_t *info, hid_t type,
h5dump_simple_mem(FILE *stream, const h5dump_t *info, hid_t obj_id, hid_t type,
hid_t space, void *mem, int indentlevel)
{
hsize_t i; /*counters */
@ -1655,7 +1654,7 @@ h5dump_simple_mem(FILE *stream, const h5dump_t *info, hid_t type,
ctx.size_last_dim = ctx.p_max_idx[ctx.ndims - 1];
/* Print it */
h5dump_simple_data(stream, info, -1/*no dataset*/, &ctx,
h5dump_simple_data(stream, info, obj_id, &ctx,
START_OF_DATA|END_OF_DATA, nelmts, type, mem);
/* Terminate the output */
@ -1973,7 +1972,7 @@ done:
*-------------------------------------------------------------------------
*/
int
h5dump_mem(FILE *stream, const h5dump_t *info, hid_t type, hid_t space,
h5dump_mem(FILE *stream, const h5dump_t *info, hid_t obj_id, hid_t type, hid_t space,
void *mem,int indentlevel)
{
h5dump_t info_dflt;
@ -1991,7 +1990,7 @@ h5dump_mem(FILE *stream, const h5dump_t *info, hid_t type, hid_t space,
if (H5Sis_simple(space) <= 0)
return -1;
return h5dump_simple_mem(stream, info, type, space, mem, indentlevel);
return h5dump_simple_mem(stream, info, obj_id, type, space, mem, indentlevel);
}
/*************************************************************************/

View File

@ -369,8 +369,8 @@ typedef struct dump_header{
hid_t h5dump_fixtype(hid_t f_type);
int h5dump_dset(FILE *stream, const h5dump_t *info, hid_t dset, hid_t p_typ,
int indentlevel);
int h5dump_mem(FILE *stream, const h5dump_t *info, hid_t type, hid_t space,
void *mem, int indentlevel);
int h5dump_mem(FILE *stream, const h5dump_t *info, hid_t obj_id, hid_t type,
hid_t space, void *mem, int indentlevel);
hid_t h5dump_fopen(const char *fname, char *drivername, size_t drivername_len);