summaryrefslogtreecommitdiffstats
path: root/tools/h5dump/h5dump.c
diff options
context:
space:
mode:
authorPedro Vicente Nunes <pvn@hdfgroup.org>2004-06-29 17:42:09 (GMT)
committerPedro Vicente Nunes <pvn@hdfgroup.org>2004-06-29 17:42:09 (GMT)
commitd4eec2cb073e4e9f02ca990cbd93480e526a130e (patch)
tree41fceceb69736cd18354a986d2d34544b55c4ffc /tools/h5dump/h5dump.c
parent3edde57e73c43474ee146b0c8073fba4eafe9e34 (diff)
downloadhdf5-d4eec2cb073e4e9f02ca990cbd93480e526a130e.zip
hdf5-d4eec2cb073e4e9f02ca990cbd93480e526a130e.tar.gz
hdf5-d4eec2cb073e4e9f02ca990cbd93480e526a130e.tar.bz2
[svn-r8758] Purpose:
h5dump new feature, bug fix Description: added the dump of unmamed types to the file contents fixed a bug in the type array, it was printing invalid characters with the array indices option on Solution: Platforms tested: linux AIX solaris Misc. update:
Diffstat (limited to 'tools/h5dump/h5dump.c')
-rw-r--r--tools/h5dump/h5dump.c35
1 files changed, 29 insertions, 6 deletions
diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c
index 163bad8..06c6b95 100644
--- a/tools/h5dump/h5dump.c
+++ b/tools/h5dump/h5dump.c
@@ -476,7 +476,7 @@ static void dump_data(hid_t, int, struct subset_t *, int);
static void dump_dcpl(hid_t dcpl, hid_t type_id, hid_t obj_id);
static void dump_comment(hid_t obj_id);
static void dump_fcpl(hid_t fid);
-static void dump_list(hid_t fid);
+static void dump_fcontents(hid_t fid);
/* XML format: same interface, alternative output */
@@ -1949,11 +1949,11 @@ dump_data(hid_t obj_id, int obj_data, struct subset_t *sset, int pindex)
}
- /* print the matrix indices */
+ /* print the matrix indices */
outputformat->pindex=pindex;
if (outputformat->pindex)
{
- outputformat->idx_fmt = "(%s),";
+ outputformat->idx_fmt = "(%s):";
outputformat->idx_n_fmt = "%lu";
outputformat->idx_sep = ",";
outputformat->line_pre = " %s ";
@@ -2544,7 +2544,7 @@ dump_fcpl(hid_t fid)
}
/*-------------------------------------------------------------------------
- * Function: dump_list
+ * Function: dump_fcontents
*
* Purpose: prints all objects
*
@@ -2556,10 +2556,32 @@ dump_fcpl(hid_t fid)
*
*-------------------------------------------------------------------------
*/
-static void dump_list(hid_t fid)
+
+static void dump_fcontents(hid_t fid)
{
+ hid_t did, tid, gid;
+ char type_name[1024];
+ int i;
+
printf("%s %s\n",FILE_CONTENTS, BEGIN);
+ /* special case of unamed types in root group */
+ if (unamedtype)
+ {
+ gid=H5Gopen(fid,"/");
+ for (i = 0; i < type_table->nobjs; i++)
+ if (!type_table->objs[i].recorded)
+ {
+ did = H5Dopen(gid, type_table->objs[i].objname);
+ tid = H5Dget_type(did);
+ sprintf(type_name, "/#"H5_PRINTF_HADDR_FMT, type_table->objs[i].objno);
+ H5Tclose(tid);
+ H5Dclose(did);
+ printf(" %-10s %s\n", "datatype", type_name );
+ }
+ H5Gclose(gid);
+ }
+
/* print objects in the files */
h5trav_getinfo(fid, NULL, 1);
@@ -2570,6 +2592,7 @@ static void dump_list(hid_t fid)
+
/*-------------------------------------------------------------------------
* Function: set_output_file
*
@@ -3540,7 +3563,7 @@ main(int argc, const char *argv[])
{
if (display_fi)
{
- dump_list(fid);
+ dump_fcontents(fid);
end_obj(dump_header_format->fileend,dump_header_format->fileblockend);
goto done;
}