summaryrefslogtreecommitdiffstats
path: root/tools/src/h5dump/h5dump_ddl.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/src/h5dump/h5dump_ddl.c')
-rw-r--r--tools/src/h5dump/h5dump_ddl.c215
1 files changed, 47 insertions, 168 deletions
diff --git a/tools/src/h5dump/h5dump_ddl.c b/tools/src/h5dump/h5dump_ddl.c
index d7c7b1a..bc426f2 100644
--- a/tools/src/h5dump/h5dump_ddl.c
+++ b/tools/src/h5dump/h5dump_ddl.c
@@ -41,11 +41,6 @@ static int dump_extlink(hid_t group, const char *linkname, const char *objn
* atomic datatype or committed/transient datatype.
*
* Return: void
- *
- * Programmer: Ruey-Hsia Li
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
void
@@ -70,11 +65,6 @@ dump_datatype(hid_t type)
* array, or others.
*
* Return: void
- *
- * Programmer: Ruey-Hsia Li
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
void
@@ -97,14 +87,7 @@ dump_dataspace(hid_t space)
* Purpose: attribute function callback called by H5Aiterate2, displays the attribute
*
* Return: Success: SUCCEED
- *
* Failure: FAIL
- *
- * Programmer: Ruey-Hsia Li
- *
- * Modifications: Pedro Vicente, October 4, 2007
- * Added H5A_info_t parameter to conform with H5Aiterate2
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -120,6 +103,8 @@ dump_attr_cb(hid_t oid, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *
HDmemset(&ctx, 0, sizeof(ctx));
ctx.indent_level = dump_indent / COL;
ctx.cur_column = dump_indent;
+ ctx.display_index = display_ai;
+ ctx.display_char = display_char;
attr_id = H5Aopen(oid, attr_name, H5P_DEFAULT);
oid_output = display_oid;
@@ -144,7 +129,7 @@ dump_attr_cb(hid_t oid, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *
outputformat = &string_dataformat;
h5dump_type_table = type_table;
- h5tools_dump_attribute(rawoutstream, outputformat, &ctx, attr_name, attr_id, display_ai, display_char);
+ h5tools_dump_attribute(rawoutstream, outputformat, &ctx, attr_name, attr_id);
h5dump_type_table = NULL;
if(attr_id < 0) {
@@ -163,18 +148,7 @@ dump_attr_cb(hid_t oid, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *
* displays everything in the specified object
*
* Return: Success: SUCCEED
- *
* Failure: FAIL
- *
- * Programmer: Ruey-Hsia Li
- *
- * Modifications:
- * RMcG, November 2000
- * Added XML support. Also, optionally checks the op_data argument
- *
- * PVN, May 2008
- * Dump external links
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -183,12 +157,12 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ATTR
hid_t obj;
hid_t dapl_id = H5P_DEFAULT; /* dataset access property list ID */
herr_t ret = SUCCEED;
- char *obj_path = NULL; /* Full path of object */
- h5tools_str_t buffer; /* string into which to render */
- h5tools_context_t ctx; /* print context */
+ char *obj_path = NULL; /* Full path of object */
+ h5tools_str_t buffer; /* string into which to render */
+ h5tools_context_t ctx; /* print context */
h5tool_format_t *outputformat = &h5tools_dataformat;
h5tool_format_t string_dataformat;
- hsize_t curr_pos = 0; /* total data element position */
+ hsize_t curr_pos = 0; /* total data element position */
/* setup */
HDmemset(&buffer, 0, sizeof(h5tools_str_t));
@@ -584,7 +558,6 @@ done:
* Purpose: Iterate and display attributes within the specified group
*
* Return: void
- *
*-------------------------------------------------------------------------
*/
void
@@ -614,7 +587,6 @@ attr_iteration(hid_t gid, unsigned attr_crt_order_flags)
* Purpose: Iterate and display links within the specified group
*
* Return: void
- *
*-------------------------------------------------------------------------
*/
void
@@ -635,15 +607,6 @@ link_iteration(hid_t gid, unsigned crt_order_flags)
* Purpose: Dump named datatype
*
* Return: void
- *
- * Programmer: Ruey-Hsia Li
- *
- * Modifications:
- * Pedro Vicente, March 27, 2006
- * added display of attributes
- * Pedro Vicente, October 4, 2007, added parameters to H5Aiterate2() to allow for
- * other iteration orders
- *
*-------------------------------------------------------------------------
*/
void
@@ -651,10 +614,10 @@ dump_named_datatype(hid_t tid, const char *name)
{
H5O_info_t oinfo;
unsigned attr_crt_order_flags;
- hid_t tcpl_id = -1; /* datatype creation property list ID */
- hsize_t curr_pos = 0; /* total data element position */
+ hid_t tcpl_id = -1; /* datatype creation property list ID */
+ hsize_t curr_pos = 0; /* total data element position */
h5tools_str_t buffer; /* string into which to render */
- h5tools_context_t ctx; /* print context */
+ h5tools_context_t ctx; /* print context */
h5tool_format_t *outputformat = &h5tools_dataformat;
h5tool_format_t string_dataformat;
@@ -771,16 +734,6 @@ done:
* Purpose: Dump everything within the specified group
*
* Return: void
- *
- * Programmer: Ruey-Hsia Li
- *
- * Modifications:
- *
- * Call to dump_all_cb -- add parameter to select everything.
- *
- * Pedro Vicente, October 1, 2007
- * handle several iteration orders for attributes and groups
- *
*-------------------------------------------------------------------------
*/
void
@@ -793,11 +746,11 @@ dump_group(hid_t gid, const char *name)
unsigned crt_order_flags;
unsigned attr_crt_order_flags;
char type_name[1024];
- h5tools_str_t buffer; /* string into which to render */
- h5tools_context_t ctx; /* print context */
+ h5tools_str_t buffer; /* string into which to render */
+ h5tools_context_t ctx; /* print context */
h5tool_format_t *outputformat = &h5tools_dataformat;
h5tool_format_t string_dataformat;
- hsize_t curr_pos = 0; /* total data element position */
+ hsize_t curr_pos = 0; /* total data element position */
if ((gcpl_id = H5Gget_create_plist(gid)) < 0) {
error_msg("error in getting group creation property list ID\n");
@@ -935,14 +888,6 @@ dump_group(hid_t gid, const char *name)
* Purpose: Dump the specified data set
*
* Return: void
- *
- * Programmer: Ruey-Hsia Li
- *
- * Modifications:
- * Pedro Vicente, 2004, added dataset creation property list display
- * Pedro Vicente, October 4, 2007, added parameters to H5Aiterate2() to allow for
- * other iteration orders
- *
*-------------------------------------------------------------------------
*/
void
@@ -951,11 +896,11 @@ dump_dataset(hid_t did, const char *name, struct subset_t *sset)
h5tools_context_t ctx; /* print context */
h5tool_format_t *outputformat = &h5tools_dataformat;
h5tool_format_t string_dataformat;
- hid_t type, space;
- unsigned attr_crt_order_flags;
- hid_t dcpl_id; /* dataset creation property list ID */
- h5tools_str_t buffer; /* string into which to render */
- hsize_t curr_pos = 0; /* total data element position */
+ hid_t type, space;
+ unsigned attr_crt_order_flags;
+ hid_t dcpl_id; /* dataset creation property list ID */
+ h5tools_str_t buffer; /* string into which to render */
+ hsize_t curr_pos = 0; /* total data element position */
HDmemset(&ctx, 0, sizeof(ctx));
ctx.indent_level = dump_indent / COL;
@@ -1027,6 +972,9 @@ dump_dataset(hid_t did, const char *name, struct subset_t *sset)
}
H5Pclose(dcpl_id);
+ ctx.sset = sset;
+ ctx.display_index = display_ai;
+ ctx.display_char = display_char;
if(display_data) {
unsigned data_loop = 1;
unsigned u;
@@ -1070,7 +1018,7 @@ dump_dataset(hid_t did, const char *name, struct subset_t *sset)
case H5T_VLEN:
case H5T_ARRAY:
{
- h5tools_dump_data(rawoutstream, outputformat, &ctx, did, TRUE, sset, display_ai, display_char);
+ h5tools_dump_data(rawoutstream, outputformat, &ctx, did, TRUE);
}
break;
@@ -1113,13 +1061,6 @@ dump_dataset(hid_t did, const char *name, struct subset_t *sset)
* Purpose: Dump attribute or dataset data
*
* Return: void
- *
- * Programmer: Ruey-Hsia Li
- *
- * Modifications: pvn, print the matrix indices
- * Albert Cheng, 2004/11/18
- * Add --string printing for attributes too.
- *
*-------------------------------------------------------------------------
*/
void
@@ -1150,10 +1091,13 @@ dump_data(hid_t obj_id, int obj_data, struct subset_t *sset, int display_index)
HDmemset(&ctx, 0, sizeof(ctx));
ctx.indent_level = dump_indent / COL;
ctx.cur_column = dump_indent;
+ ctx.sset = sset;
+ ctx.display_index = display_index;
+ ctx.display_char = display_char;
if(obj_data == DATASET_DATA)
print_dataset = TRUE;
- h5tools_dump_data(rawoutstream, outputformat, &ctx, obj_id, print_dataset, sset, display_index, display_char);
+ h5tools_dump_data(rawoutstream, outputformat, &ctx, obj_id, print_dataset);
}
@@ -1163,11 +1107,6 @@ dump_data(hid_t obj_id, int obj_data, struct subset_t *sset, int display_index)
* Purpose: prints file creation property list information
*
* Return: void
- *
- * Programmer: pvn
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
void
@@ -1178,9 +1117,9 @@ dump_fcpl(hid_t fid)
size_t off_size; /* size of offsets in the file */
size_t len_size; /* size of lengths in the file */
H5F_fspace_strategy_t fs_strategy; /* file space strategy */
- hbool_t fs_persist; /* Persisting free-space or not */
- hsize_t fs_threshold; /* free-space section threshold */
- hsize_t fsp_size; /* file space page size */
+ hbool_t fs_persist; /* Persisting free-space or not */
+ hsize_t fs_threshold; /* free-space section threshold */
+ hsize_t fsp_size; /* file space page size */
H5F_info2_t finfo; /* file information */
#ifdef SHOW_FILE_DRIVER
hid_t fapl; /* file access property list ID */
@@ -1261,13 +1200,17 @@ dump_fcpl(hid_t fid)
indentation(dump_indent + COL);
if(fs_strategy == H5F_FSPACE_STRATEGY_FSM_AGGR) {
PRINTSTREAM(rawoutstream, "%s %s\n", "FILE_SPACE_STRATEGY", "H5F_FSPACE_STRATEGY_FSM_AGGR");
- } else if(fs_strategy == H5F_FSPACE_STRATEGY_PAGE) {
+ }
+ else if(fs_strategy == H5F_FSPACE_STRATEGY_PAGE) {
PRINTSTREAM(rawoutstream, "%s %s\n", "FILE_SPACE_STRATEGY", "H5F_FSPACE_STRATEGY_PAGE");
- } else if(fs_strategy == H5F_FSPACE_STRATEGY_AGGR) {
+ }
+ else if(fs_strategy == H5F_FSPACE_STRATEGY_AGGR) {
PRINTSTREAM(rawoutstream, "%s %s\n", "FILE_SPACE_STRATEGY", "H5F_FSPACE_STRATEGY_AGGR");
- } else if(fs_strategy == H5F_FSPACE_STRATEGY_NONE) {
+ }
+ else if(fs_strategy == H5F_FSPACE_STRATEGY_NONE) {
PRINTSTREAM(rawoutstream, "%s %s\n", "FILE_SPACE_STRATEGY", "H5F_FSPACE_STRATEGY_NONE");
- } else
+ }
+ else
PRINTSTREAM(rawoutstream, "%s %s\n", "FILE_SPACE_STRATEGY", "Unknown strategy");
indentation(dump_indent + COL);
PRINTSTREAM(rawoutstream, "%s %s\n","FREE_SPACE_PERSIST", fs_persist ? "TRUE" : "FALSE");
@@ -1296,11 +1239,6 @@ dump_fcpl(hid_t fid)
* Purpose: prints all objects
*
* Return: void
- *
- * Programmer: pvn
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
void
@@ -1472,7 +1410,6 @@ lnk_search(const char *path, const H5L_info_t *li, void *_op_data)
* Purpose: Handle objects from the command.
*
* Return: void
- *
*-------------------------------------------------------------------------
*/
void
@@ -1527,30 +1464,21 @@ handle_paths(hid_t fid, const char *path_name, void H5_ATTR_UNUSED * data, int H
* Purpose: Handle the attributes from the command.
*
* Return: void
- *
- * Programmer: Bill Wendling
- * Tuesday, 9. January 2001
- *
- * Modifications:
- *
- * PVN, May 2008
- * add an extra parameter PE, to allow printing/not printing of error messages
- *
*-------------------------------------------------------------------------
*/
void
-handle_attributes(hid_t fid, const char *attr, void H5_ATTR_UNUSED * data, int H5_ATTR_UNUSED pe, const char H5_ATTR_UNUSED *display_name)
+handle_attributes(hid_t fid, const char *attr, void H5_ATTR_UNUSED *data, int H5_ATTR_UNUSED pe, const char H5_ATTR_UNUSED *display_name)
{
hid_t oid = -1;
hid_t attr_id = -1;
char *obj_name = NULL;
char *attr_name = NULL;
int j;
- h5tools_str_t buffer; /* string into which to render */
- h5tools_context_t ctx; /* print context */
+ h5tools_str_t buffer; /* string into which to render */
+ h5tools_context_t ctx; /* print context */
h5tool_format_t *outputformat = &h5tools_dataformat;
h5tool_format_t string_dataformat;
- hsize_t curr_pos = 0; /* total data element position */
+ hsize_t curr_pos = 0; /* total data element position */
j = (int)HDstrlen(attr) - 1;
obj_name = (char *)HDmalloc((size_t)j + 2);
@@ -1576,6 +1504,8 @@ handle_attributes(hid_t fid, const char *attr, void H5_ATTR_UNUSED * data, int H
HDmemset(&ctx, 0, sizeof(ctx));
ctx.indent_level = dump_indent / COL;
ctx.cur_column = dump_indent;
+ ctx.display_index = display_ai;
+ ctx.display_char = display_char;
string_dataformat = *outputformat;
@@ -1635,7 +1565,7 @@ handle_attributes(hid_t fid, const char *attr, void H5_ATTR_UNUSED * data, int H
attr_data_output = display_attr_data;
h5dump_type_table = type_table;
- h5tools_dump_attribute(rawoutstream, outputformat, &ctx, attr_name, attr_id, display_ai, display_char);
+ h5tools_dump_attribute(rawoutstream, outputformat, &ctx, attr_name, attr_id);
h5dump_type_table = NULL;
if(attr_id < 0) {
@@ -1673,19 +1603,6 @@ error:
* Purpose: Handle the datasets from the command.
*
* Return: void
- *
- * Programmer: Bill Wendling
- * Tuesday, 9. January 2001
- *
- * Modifications:
- * Pedro Vicente, Tuesday, January 15, 2008
- * check for block overlap\
- *
- * Pedro Vicente, May 8, 2008
- * added a flag PE that prints/not prints error messages
- * added for cases of external links not found, to avoid printing of
- * objects not found, since external links are dumped on a trial error basis
- *
*-------------------------------------------------------------------------
*/
void
@@ -1846,18 +1763,6 @@ handle_datasets(hid_t fid, const char *dset, void *data, int pe, const char *dis
* Purpose: Handle the groups from the command.
*
* Return: void
- *
- * Programmer: Bill Wendling
- * Tuesday, 9. January 2001
- *
- * Modifications: Pedro Vicente, September 26, 2007
- * handle creation order
- *
- * Pedro Vicente, May 8, 2008
- * added a flag PE that prints/not prints error messages
- * added for cases of external links not found, to avoid printing of
- * objects not found, since external links are dumped on a trial error basis
- *
*-------------------------------------------------------------------------
*/
void
@@ -1902,12 +1807,6 @@ handle_groups(hid_t fid, const char *group, void H5_ATTR_UNUSED *data, int pe, c
* Purpose: Handle soft or UD links from the command.
*
* Return: void
- *
- * Programmer: Bill Wendling
- * Tuesday, 9. January 2001
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
void
@@ -1988,17 +1887,6 @@ handle_links(hid_t fid, const char *links, void H5_ATTR_UNUSED * data, int H5_AT
* Purpose: Handle the datatypes from the command.
*
* Return: void
- *
- * Programmer: Bill Wendling
- * Tuesday, 9. January 2001
- *
- * Modifications:
- *
- * Pedro Vicente, May 8, 2008
- * added a flag PE that prints/not prints error messages
- * added for cases of external links not found, to avoid printing of
- * objects not found, since external links are dumped on a trial error basis
- *
*-------------------------------------------------------------------------
*/
void
@@ -2063,19 +1951,10 @@ handle_datatypes(hid_t fid, const char *type, void H5_ATTR_UNUSED * data, int pe
/*-------------------------------------------------------------------------
* Function: dump_extlink
*
- * made by: PVN
- *
* Purpose: Dump an external link
- * Since external links are soft links, they are dumped on a trial error
- * basis, attempting to dump as a dataset, as a group and as a named datatype
- * Error messages are supressed
- *
- * Modifications:
- * Neil Fortner
- * 13 October 2008
- * Function basically rewritten. No longer directly opens the target file,
- * now initializes a new set of tables for the external file. No longer
- * dumps on a trial and error basis, but errors are still suppressed.
+ * Function does not directly open the target file,
+ * it initializes a new set of tables for the external file.
+ * Errors are suppressed.
*
*-------------------------------------------------------------------------
*/