summaryrefslogtreecommitdiffstats
path: root/tools/h5dump/h5dump.c
diff options
context:
space:
mode:
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;
}