diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2000-12-02 15:13:38 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2000-12-02 15:13:38 (GMT) |
commit | afb64c0bac1527046047f704000cf68ff023740f (patch) | |
tree | 148ed4d9fe1b2e198234af8787119cc532a1b54c /tools | |
parent | 74d5c6b757d6d10673f8da11b383074482868410 (diff) | |
download | hdf5-afb64c0bac1527046047f704000cf68ff023740f.zip hdf5-afb64c0bac1527046047f704000cf68ff023740f.tar.gz hdf5-afb64c0bac1527046047f704000cf68ff023740f.tar.bz2 |
[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)
Diffstat (limited to 'tools')
-rw-r--r-- | tools/h5dump.c | 3 | ||||
-rw-r--r-- | tools/h5ls.c | 2 | ||||
-rw-r--r-- | tools/h5tools.c | 9 | ||||
-rw-r--r-- | tools/h5tools.h | 4 |
4 files changed, 8 insertions, 10 deletions
diff --git a/tools/h5dump.c b/tools/h5dump.c index c22944d..c45f8a9 100644 --- a/tools/h5dump.c +++ b/tools/h5dump.c @@ -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); diff --git a/tools/h5ls.c b/tools/h5ls.c index f792a19..56c9821 100644 --- a/tools/h5ls.c +++ b/tools/h5ls.c @@ -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); diff --git a/tools/h5tools.c b/tools/h5tools.c index 4e8290b..978f30b 100644 --- a/tools/h5tools.c +++ b/tools/h5tools.c @@ -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); } /*************************************************************************/ diff --git a/tools/h5tools.h b/tools/h5tools.h index f133774..e9638a5 100644 --- a/tools/h5tools.h +++ b/tools/h5tools.h @@ -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); |