[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:
This commit is contained in:
Pedro Vicente Nunes
2004-06-29 12:42:09 -05:00
parent 3edde57e73
commit d4eec2cb07
44 changed files with 1430 additions and 1391 deletions

View File

@@ -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;
}