summaryrefslogtreecommitdiffstats
path: root/tools/src/h5ls/h5ls.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/src/h5ls/h5ls.c')
-rw-r--r--tools/src/h5ls/h5ls.c702
1 files changed, 559 insertions, 143 deletions
diff --git a/tools/src/h5ls/h5ls.c b/tools/src/h5ls/h5ls.c
index 3b0001d..f3f9ede 100644
--- a/tools/src/h5ls/h5ls.c
+++ b/tools/src/h5ls/h5ls.c
@@ -91,7 +91,7 @@ static h5tool_format_t ls_dataformat = {
"", /*line_suf */
"", /*line_sep */
1, /*line_multi_new */
- "", /*line_indent */
+ " ", /*line_indent */
0, /*skip_first */
@@ -132,7 +132,6 @@ static hbool_t no_dangling_link_g = FALSE; /* treat dangling link is error */
static hbool_t follow_elink_g = FALSE; /* follow external links */
static hbool_t grp_literal_g = FALSE; /* list group, not contents */
static hbool_t hexdump_g = FALSE; /* show data as raw hexadecimal */
-static hbool_t show_errors_g = FALSE; /* print HDF5 error messages */
static hbool_t simple_output_g = FALSE; /* make output more machine-readable */
static hbool_t show_file_name_g = FALSE; /* show file name for full names */
static hbool_t no_line_wrap_g = FALSE; /* show data content without line wrap */
@@ -193,7 +192,7 @@ usage (void)
PRINTVALSTREAM(rawoutstream, " --no-dangling-links\n");
PRINTVALSTREAM(rawoutstream, " Must be used with --follow-symlinks option;\n");
PRINTVALSTREAM(rawoutstream, " otherwise, h5ls shows error message and returns an exit\n");
- PRINTVALSTREAM(rawoutstream, " code of 1. \n");
+ PRINTVALSTREAM(rawoutstream, " code of 1.\n");
PRINTVALSTREAM(rawoutstream, " Check for any symbolic links (soft links or external links)\n");
PRINTVALSTREAM(rawoutstream, " that do not resolve to an existing object (dataset, group,\n");
PRINTVALSTREAM(rawoutstream, " or named datatype).\n");
@@ -228,11 +227,8 @@ usage (void)
PRINTVALSTREAM(rawoutstream, " \"%%05d\" to open a file family.\n");
PRINTVALSTREAM(rawoutstream, "\n");
PRINTVALSTREAM(rawoutstream, " Deprecated Options\n");
- PRINTVALSTREAM(rawoutstream, " The following options have been deprecated in HDF5. While they remain\n");
- PRINTVALSTREAM(rawoutstream, " available, they have been superseded as indicated and may be removed\n");
- PRINTVALSTREAM(rawoutstream, " from HDF5 in the future. Use the indicated replacement option in all\n");
- PRINTVALSTREAM(rawoutstream, " new work; where possible, existing scripts, et cetera, should also be\n");
- PRINTVALSTREAM(rawoutstream, " updated to use the replacement option.\n");
+ PRINTVALSTREAM(rawoutstream, " The following options have been removed in HDF5 1.12. Use the indicated\n");
+ PRINTVALSTREAM(rawoutstream, " replacement option in all work.\n");
PRINTVALSTREAM(rawoutstream, "\n");
PRINTVALSTREAM(rawoutstream, " -E or --external Follow external links.\n");
PRINTVALSTREAM(rawoutstream, " Replaced by --follow-symlinks.\n");
@@ -883,7 +879,7 @@ print_enum_type(h5tools_str_t *buffer, hid_t type, int ind)
if (nmembs > 0) {
char **name; /* member names */
unsigned char *value; /* value array */
- hid_t native = -1; /* native integer data type */
+ hid_t native = H5I_INVALID_HID; /* native integer data type */
size_t dst_size; /* destination value type size */
unsigned i; /* miscellaneous counters */
@@ -918,6 +914,7 @@ print_enum_type(h5tools_str_t *buffer, hid_t type, int ind)
H5free_memory(name[i]);
HDfree(name);
HDfree(value);
+ H5Tclose(super);
return FALSE;
}
@@ -1082,7 +1079,10 @@ print_reference_type(h5tools_str_t *buffer, hid_t type, int H5_ATTR_UNUSED ind)
if (H5T_REFERENCE != H5Tget_class(type))
return FALSE;
- if (H5Tequal(type, H5T_STD_REF_OBJ) == TRUE) {
+ if (H5Tequal(type, H5T_STD_REF) == TRUE) {
+ h5tools_str_append(buffer, "standard reference");
+ }
+ else if (H5Tequal(type, H5T_STD_REF_OBJ) == TRUE) {
h5tools_str_append(buffer, "object reference");
}
else if (H5Tequal(type, H5T_STD_REF_DSETREG) == TRUE) {
@@ -1260,10 +1260,17 @@ print_type(h5tools_str_t *buffer, hid_t type, int ind)
/* Shared? If so then print the type's OID */
if (H5Tcommitted(type)) {
- H5O_info_t oi;
+ H5O_info2_t oi;
+
+ if (H5Oget_info3(type, &oi, H5O_INFO_BASIC) >= 0) {
+ char *type_string = NULL;
+
+ H5Otoken_to_str(type, &oi.token, &type_string);
- if (H5Oget_info2(type, &oi, H5O_INFO_BASIC) >= 0)
- h5tools_str_append(buffer,"shared-%lu:"H5_PRINTF_HADDR_FMT" ", oi.fileno, oi.addr);
+ h5tools_str_append(buffer,"shared-%lu:%s", oi.fileno, type_string);
+
+ H5free_memory(type_string);
+ } /* end if */
else
h5tools_str_append(buffer,"shared ");
} /* end if */
@@ -1285,6 +1292,229 @@ print_type(h5tools_str_t *buffer, hid_t type, int ind)
h5tools_str_append(buffer,"%lu-byte class-%u unknown", (unsigned long)H5Tget_size(type), (unsigned)data_class);
}
+/*
+ *
+ */
+static void
+dump_reference(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, hid_t container, H5R_ref_t *ref_buf, int ndims)
+{
+ hid_t new_obj_id = H5I_INVALID_HID;
+ hid_t new_obj_sid = H5I_INVALID_HID;
+ hsize_t elmt_counter = 0; /*counts the # elements printed. */
+ size_t ncols = 80; /* available output width */
+ int i;
+ hsize_t curr_pos = 0; /* total data element position */
+ h5tools_str_t buffer; /* string into which to render */
+ h5tools_context_t datactx; /* print context */
+
+ H5TOOLS_START_DEBUG("");
+
+ datactx = *ctx; /* print context */
+ /* Assume entire data space to be printed */
+ if (datactx.ndims > 0)
+ for (i = 0; (unsigned)i < datactx.ndims; i++)
+ datactx.p_min_idx[i] = 0;
+ datactx.need_prefix = TRUE;
+
+ HDmemset(&buffer, 0, sizeof(h5tools_str_t));
+ for(i = 0; i < ndims; i++, datactx.cur_elmt++, elmt_counter++) {
+ H5O_type_t obj_type = -1; /* Object type */
+ H5R_type_t ref_type; /* Reference type */
+
+ H5TOOLS_DEBUG("reference loop:%d with curr_pos=%ld", i, curr_pos);
+
+ datactx.need_prefix = TRUE;
+ h5tools_str_reset(&buffer);
+ H5TOOLS_DEBUG("reference loop - h5tools_str_sprint with H5T_STD_REF:%d", i);
+ h5tools_str_sprint(&buffer, info, container, H5T_STD_REF, &ref_buf[i], &datactx);
+ h5tools_render_element(stream, info, &datactx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)i, (hsize_t)ndims);
+
+ ref_type = H5Rget_type((const H5R_ref_t *)&ref_buf[i]);
+ switch (ref_type) {
+ case H5R_OBJECT1:
+ H5TOOLS_DEBUG("ref_type is H5R_OBJECT1");
+ if (H5Rget_obj_type3((const H5R_ref_t *)&ref_buf[i], H5P_DEFAULT, &obj_type) >= 0) {
+ switch (obj_type) {
+ case H5O_TYPE_DATASET:
+ if((new_obj_id = H5Ropen_object((const H5R_ref_t *)&ref_buf[i], H5P_DEFAULT, H5P_DEFAULT)) >= 0) {
+ datactx.indent_level++;
+ h5tools_dump_dset(stream, info, &datactx, new_obj_id);
+ datactx.indent_level--;
+ if(H5Dclose(new_obj_id) < 0)
+ H5TOOLS_INFO("H5Dclose H5R_OBJECT1:H5O_TYPE_DATASET failed");
+ if(H5Rdestroy(&ref_buf[i]) < 0)
+ H5TOOLS_INFO("H5Rdestroy H5R_OBJECT1:H5O_TYPE_DATASET failed");
+ }
+ else
+ H5TOOLS_INFO("H5Ropen_object H5R_OBJECT1:H5O_TYPE_DATASET failed");
+ break;
+
+ case H5O_TYPE_GROUP:
+ case H5O_TYPE_NAMED_DATATYPE:
+ case H5O_TYPE_MAP:
+ case H5O_TYPE_UNKNOWN:
+ case H5O_TYPE_NTYPES:
+ default:
+ break;
+ } /* end switch */
+ }
+ else
+ H5TOOLS_INFO("H5Rget_obj_type3 H5R_OBJECT1 failed");
+ break;
+ case H5R_DATASET_REGION1:
+ H5TOOLS_DEBUG("ref_type is H5R_DATASET_REGION1");
+ if((new_obj_id = H5Ropen_object((const H5R_ref_t *)&ref_buf[i], H5P_DEFAULT, H5P_DEFAULT)) >= 0) {
+ datactx.indent_level++;
+ h5tools_dump_dset(stream, info, &datactx, new_obj_id);
+ datactx.indent_level--;
+ if(H5Dclose(new_obj_id) < 0)
+ H5TOOLS_INFO("H5Dclose H5R_DATASET_REGION1 failed");
+ if(H5Rdestroy(&ref_buf[i]) < 0)
+ H5TOOLS_INFO("H5Rdestroy H5R_DATASET_REGION1 failed");
+ }
+ else
+ H5TOOLS_INFO("H5Ropen_object H5R_DATASET_REGION1 failed");
+ break;
+ case H5R_OBJECT2:
+ H5TOOLS_DEBUG("ref_type is H5R_OBJECT2");
+ if (H5Rget_obj_type3((const H5R_ref_t *)&ref_buf[i], H5P_DEFAULT, &obj_type) >= 0) {
+ switch (obj_type) {
+ case H5O_TYPE_GROUP:
+ break;
+
+ case H5O_TYPE_DATASET:
+ if((new_obj_id = H5Ropen_object((const H5R_ref_t *)&ref_buf[i], H5P_DEFAULT, H5P_DEFAULT)) >= 0) {
+ datactx.indent_level++;
+ h5tools_dump_dset(stream, info, &datactx, new_obj_id);
+ datactx.indent_level--;
+ if(H5Oclose(new_obj_id) < 0)
+ H5TOOLS_INFO("H5Oclose H5R_OBJECT2 failed");
+ if(H5Rdestroy(&ref_buf[i]) < 0)
+ H5TOOLS_INFO("H5Rdestroy H5R_OBJECT2 failed");
+ }
+ else
+ H5TOOLS_INFO("H5Ropen_object H5R_OBJECT2 failed");
+ break;
+
+ case H5O_TYPE_NAMED_DATATYPE:
+ break;
+
+ case H5O_TYPE_MAP:
+ case H5O_TYPE_UNKNOWN:
+ case H5O_TYPE_NTYPES:
+ default:
+ break;
+ } /* end switch */
+ }
+ else
+ H5TOOLS_INFO("H5Rget_obj_type3 H5R_OBJECT2 failed");
+ break;
+ case H5R_DATASET_REGION2:
+ H5TOOLS_DEBUG("ref_type is H5R_DATASET_REGION2");
+
+ if (info->line_ncols > 0)
+ ncols = info->line_ncols;
+
+ /* if (new_obj_id < 0) - could mean that no reference was written do not throw failure */
+ if((new_obj_id = H5Ropen_object((const H5R_ref_t *)&ref_buf[i], H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ H5TOOLS_INFO("H5Ropen_object H5R_DATASET_REGION2 failed");
+ else {
+ if((new_obj_sid = H5Ropen_region((const H5R_ref_t *)&ref_buf[i], H5P_DEFAULT, H5P_DEFAULT)) >= 0) {
+ if (h5tools_is_zero(&ref_buf[i], H5Tget_size(H5T_STD_REF))) {
+ H5TOOLS_DEBUG("NULL H5R_DATASET_REGION2");
+
+ h5tools_str_reset(&buffer);
+ h5tools_str_append(&buffer, " {");
+ h5tools_render_element(stream, info, &datactx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0);
+
+ datactx.need_prefix = TRUE;
+ datactx.indent_level++;
+ h5tools_str_reset(&buffer);
+ h5tools_str_append(&buffer, "NULL");
+ h5tools_render_element(stream, info, &datactx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0);
+ datactx.indent_level--;
+ datactx.need_prefix = TRUE;
+
+ h5tools_str_reset(&buffer);
+ h5tools_str_append(&buffer, "}");
+ h5tools_render_element(stream, info, &datactx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0);
+ }
+ else {
+ H5S_sel_type region_type;
+
+ region_type = H5Sget_select_type(new_obj_sid);
+ if(region_type == H5S_SEL_POINTS) {
+ /* Print point information */
+ H5TOOLS_DEBUG("H5S_SEL_POINTS H5R_DATASET_REGION2");
+ h5tools_dump_region_data_points(new_obj_sid, new_obj_id, stream, info, &datactx,
+ &buffer, &curr_pos, ncols, (hsize_t)i, elmt_counter);
+ }
+ else if(region_type == H5S_SEL_HYPERSLABS) {
+ /* Print block information */
+ H5TOOLS_DEBUG("H5S_SEL_HYPERSLABS H5R_DATASET_REGION2");
+ h5tools_dump_region_data_blocks(new_obj_sid, new_obj_id, stream, info, &datactx,
+ &buffer, &curr_pos, ncols, (hsize_t)i, elmt_counter);
+ }
+ else
+ H5TOOLS_INFO("invalid region type");
+ } /* end else to if (h5tools_is_zero(... */
+ if(H5Sclose(new_obj_sid) < 0)
+ H5TOOLS_INFO("H5Sclose H5R_DATASET_REGION2 failed");
+ }
+ else
+ H5TOOLS_INFO("H5Ropen_region H5R_DATASET_REGION2 failed");
+ if(H5Dclose(new_obj_id) < 0)
+ H5TOOLS_INFO("H5Dclose H5R_DATASET_REGION2 failed");
+ if(H5Rdestroy(&ref_buf[i]) < 0)
+ H5TOOLS_INFO("H5Rdestroy H5R_DATASET_REGION2 failed");
+ }
+ break;
+ case H5R_ATTR:
+ H5TOOLS_DEBUG("ref_type is H5R_ATTR");
+ if((new_obj_id = H5Ropen_attr((const H5R_ref_t *)&ref_buf[i], H5P_DEFAULT, H5P_DEFAULT)) >= 0) {
+ h5tools_dump_region_attribute(new_obj_id, stream, info, &datactx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0);
+ if(H5Aclose(new_obj_id) < 0)
+ H5TOOLS_INFO("H5Aclose H5R_ATTR failed");
+ if(H5Rdestroy(&ref_buf[i]) < 0)
+ H5TOOLS_INFO("H5Rdestroy H5R_ATTR failed");
+ }
+ else {
+ H5TOOLS_DEBUG("NULL H5R_ATTR");
+
+ h5tools_str_reset(&buffer);
+ h5tools_str_append(&buffer, " {");
+ h5tools_render_element(stream, info, &datactx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0);
+
+ datactx.need_prefix = TRUE;
+ datactx.indent_level++;
+ h5tools_str_reset(&buffer);
+ h5tools_str_append(&buffer, "NULL");
+ h5tools_render_element(stream, info, &datactx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0);
+ datactx.indent_level--;
+ datactx.need_prefix = TRUE;
+
+ h5tools_str_reset(&buffer);
+ h5tools_str_append(&buffer, "}");
+ h5tools_render_element(stream, info, &datactx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0);
+
+ H5TOOLS_INFO("H5Ropen_attr H5R_ATTR failed");
+ }
+ break;
+ case H5R_BADTYPE:
+ case H5R_MAXTYPE:
+ default:
+ break;
+ } /* end switch */
+
+ H5TOOLS_DEBUG("finished reference loop:%d",i);
+ } /* end for(i = 0; i < ndims; i++, ctx->cur_elmt++, elmt_counter++) */
+
+ h5tools_str_close(&buffer);
+
+ PRINTVALSTREAM(stream, "\n");
+
+ H5TOOLS_ENDDEBUG("");
+}
/*-------------------------------------------------------------------------
* Function: dump_dataset_values
@@ -1297,6 +1527,11 @@ print_type(h5tools_str_t *buffer, hid_t type, int ind)
static void
dump_dataset_values(hid_t dset)
{
+ hid_t f_type = H5I_INVALID_HID;
+ hid_t space = H5I_INVALID_HID;
+ hsize_t total_size[H5S_MAX_RANK];
+ int ndims;
+ size_t i;
char string_prefix[64];
static char fmt_double[16];
static char fmt_float[16];
@@ -1305,15 +1540,19 @@ dump_dataset_values(hid_t dset)
h5tools_context_t ctx; /* print context */
h5tool_format_t outputformat;
h5tool_format_t *info = &ls_dataformat;
+ H5R_ref_t *ref_buf = NULL;
+
+ H5TOOLS_START_DEBUG("");
- hid_t f_type = H5Dget_type(dset);
- size_t size = H5Tget_size(f_type);
+ f_type = H5Dget_type(dset);
+ space = H5Dget_space(dset);
HDmemset(&ctx, 0, sizeof(ctx));
HDmemset(&buffer, 0, sizeof(h5tools_str_t));
outputformat = *info;
outputformat.line_1st = NULL;
+ outputformat.idx_fmt = "";
if (simple_output_g) {
outputformat.idx_fmt = "";
outputformat.line_per_line = 1;
@@ -1345,9 +1584,10 @@ dump_dataset_values(hid_t dset)
else {
outputformat.line_ncols = (unsigned)width_g;
}
- if (label_g) outputformat.cmpd_name = "%s=";
+ if (label_g)
+ outputformat.cmpd_name = "%s=";
outputformat.line_pre = " %s ";
- outputformat.line_cont = " %s ";
+ outputformat.line_cont = " %s ";
outputformat.str_repeat = 8;
outputformat.arr_pre = NULL;
@@ -1375,7 +1615,7 @@ dump_dataset_values(hid_t dset)
* command line switch was given. */
outputformat.raw = TRUE;
}
- else if (string_g && 1 == size && H5T_INTEGER == H5Tget_class(f_type)) {
+ else if (string_g && H5Tget_size(f_type) == 1 && (H5Tget_class(f_type) == H5T_INTEGER)) {
/* Print 1-byte integer data as an ASCI character string instead of
* integers if the `-s' or `--string' command-line option was given. */
outputformat.ascii = TRUE;
@@ -1387,29 +1627,242 @@ dump_dataset_values(hid_t dset)
}
info = &outputformat;
- ctx.indent_level = 2;
+ ctx.indent_level = 1;
ctx.cur_column = (size_t)curr_pos;
/* Print all the values. */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, " Data:\n");
+
h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, (size_t)info->line_ncols, (hsize_t)0, (hsize_t)0);
+
ctx.need_prefix = TRUE;
ctx.cur_column = (size_t)curr_pos;
- if (h5tools_dump_dset(rawoutstream, info, &ctx, dset, NULL) < 0) {
- h5tools_str_reset(&buffer);
- h5tools_str_append(&buffer, " Unable to print data.");
- h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, (size_t)info->line_ncols, (hsize_t)0, (hsize_t)0);
+ if (H5Tget_class(f_type) == H5T_REFERENCE) {
+ H5TOOLS_DEBUG("reference class type");
+ if (!H5Tequal(f_type, H5T_STD_REF) && !H5Tequal(f_type, H5T_STD_REF_DSETREG) && !H5Tequal(f_type, H5T_STD_REF_OBJ)) {
+ H5TOOLS_GOTO_DONE_NO_RET();
+ }
+
+ ndims = (int)H5Sget_simple_extent_npoints(space);
+ H5TOOLS_DEBUG("ndims=%d - ctx.ndims=%d", ndims, ctx.ndims);
+
+ /* Assume entire data space to be printed */
+ if (ctx.ndims > 0)
+ for (i = 0; i < (size_t)ctx.ndims; i++)
+ ctx.p_min_idx[i] = 0;
+
+ H5Sget_simple_extent_dims(space, total_size, NULL);
+ if (ctx.ndims > 0)
+ init_acc_pos(&ctx, total_size);
+ ctx.need_prefix = TRUE;
+
+ if (NULL != (ref_buf = (H5R_ref_t *)HDcalloc(MAX(sizeof(unsigned), sizeof(H5R_ref_t)), (size_t)ndims))) {
+ H5TOOLS_DEBUG("H5Dread reference read");
+ if(H5Dread(dset, H5T_STD_REF, H5S_ALL, H5S_ALL, H5P_DEFAULT, ref_buf) < 0) {
+ HDfree(ref_buf);
+ H5TOOLS_INFO("H5Dread reference failed");
+ H5TOOLS_GOTO_DONE_NO_RET();
+ }
+ dump_reference(rawoutstream, info, &ctx, dset, ref_buf, ndims);
+ HDfree(ref_buf);
+ }
}
-
+ else {
+ if (h5tools_dump_dset(rawoutstream, info, &ctx, dset) < 0) {
+ h5tools_str_reset(&buffer);
+ h5tools_str_append(&buffer, " Unable to print data.");
+ h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, (size_t)info->line_ncols, (hsize_t)0, (hsize_t)0);
+ }
+ }
+done:
+ H5Sclose(space);
H5Tclose(f_type);
h5tools_str_close(&buffer);
PRINTVALSTREAM(rawoutstream, "\n");
+
+ H5TOOLS_ENDDEBUG("");
}
/*-------------------------------------------------------------------------
+ * Function: dump_attribute_values
+ *
+ * Purpose: Prints all values of a attribute.
+ *
+ * Return: void
+ *-------------------------------------------------------------------------
+ */
+static void
+dump_attribute_values(hid_t attr)
+{
+ hid_t f_type = H5I_INVALID_HID;
+ hid_t space = H5I_INVALID_HID;
+ hsize_t total_size[H5S_MAX_RANK];
+ int ndims;
+ size_t i;
+ char string_prefix[64];
+ static char fmt_double[16];
+ static char fmt_float[16];
+ hsize_t curr_pos = 0; /* total data element position */
+ h5tools_str_t buffer; /* string into which to render */
+ h5tools_context_t ctx; /* print context */
+ h5tool_format_t outputformat;
+ h5tool_format_t *info = &ls_dataformat;
+ H5R_ref_t *ref_buf = NULL;
+
+ H5TOOLS_START_DEBUG("");
+
+ f_type = H5Aget_type(attr);
+ space = H5Aget_space(attr);
+
+ HDmemset(&ctx, 0, sizeof(ctx));
+ HDmemset(&buffer, 0, sizeof(h5tools_str_t));
+
+ outputformat = *info;
+ outputformat.line_1st = NULL;
+ outputformat.idx_fmt = "";
+ if (simple_output_g) {
+ outputformat.idx_fmt = "";
+ outputformat.line_per_line = 1;
+ outputformat.line_multi_new = 0;
+ outputformat.line_pre = " ";
+ outputformat.line_cont = " ";
+
+ outputformat.arr_pre = "";
+ outputformat.arr_suf = "";
+ outputformat.arr_sep = " ";
+
+ if (!label_g) {
+ outputformat.cmpd_pre = "";
+ outputformat.cmpd_suf = "";
+ }
+ outputformat.cmpd_sep = " ";
+
+ if (label_g)
+ outputformat.cmpd_name = "%s=";
+
+ outputformat.elmt_suf1 = " ";
+ outputformat.str_locale = ESCAPE_HTML;
+
+ }
+ else {
+ if (no_line_wrap_g) {
+ outputformat.line_per_line = 1;
+ }
+ else {
+ outputformat.line_ncols = (unsigned)width_g;
+ }
+ if (label_g)
+ outputformat.cmpd_name = "%s=";
+ outputformat.line_pre = " %s ";
+ outputformat.line_cont = " %s ";
+ outputformat.str_repeat = 8;
+
+ outputformat.arr_pre = NULL;
+ outputformat.arr_suf = NULL;
+ outputformat.arr_sep = NULL;
+
+ outputformat.cmpd_pre = NULL;
+ outputformat.cmpd_suf = NULL;
+ outputformat.cmpd_sep = NULL;
+
+ outputformat.vlen_sep = NULL;
+ outputformat.vlen_pre = NULL;
+ outputformat.vlen_suf = NULL;
+ outputformat.vlen_end = NULL;
+ }
+ outputformat.arr_linebreak = 0;
+ /* Floating point types should display full precision */
+ HDsnprintf(fmt_float, sizeof(fmt_float), "%%1.%dg", FLT_DIG);
+ outputformat.fmt_float = fmt_float;
+ HDsnprintf(fmt_double, sizeof(fmt_double), "%%1.%dg", DBL_DIG);
+ outputformat.fmt_double = fmt_double;
+
+ if (hexdump_g) {
+ /* Print all data in hexadecimal format if the `-x' or `--hexdump'
+ * command line switch was given. */
+ outputformat.raw = TRUE;
+ }
+ else if (string_g && H5Tget_size(f_type) == 1 && (H5Tget_class(f_type) == H5T_INTEGER)) {
+ /* Print 1-byte integer data as an ASCI character string instead of
+ * integers if the `-s' or `--string' command-line option was given. */
+ outputformat.ascii = TRUE;
+ outputformat.elmt_suf1 = "";
+ outputformat.elmt_suf2 = "";
+ HDsnprintf(string_prefix, sizeof(string_prefix), "%s\"", outputformat.line_pre);
+ outputformat.line_pre = string_prefix;
+ outputformat.line_suf = "\"";
+ }
+ info = &outputformat;
+
+ ctx.indent_level = 2;
+ ctx.cur_column = (size_t)curr_pos;
+
+ /* Print all the values. */
+ h5tools_str_reset(&buffer);
+ h5tools_str_append(&buffer, " Data:\n");
+
+ h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, (size_t)info->line_ncols, (hsize_t)0, (hsize_t)0);
+
+ ctx.need_prefix = TRUE;
+ ctx.cur_column = (size_t)curr_pos;
+ if (H5Tget_class(f_type) == H5T_REFERENCE) {
+ H5TOOLS_DEBUG("reference class type");
+ if (!H5Tequal(f_type, H5T_STD_REF) && !H5Tequal(f_type, H5T_STD_REF_DSETREG) && !H5Tequal(f_type, H5T_STD_REF_OBJ)) {
+ H5TOOLS_GOTO_DONE_NO_RET();
+ }
+
+ ndims = (int)H5Sget_simple_extent_npoints(space);
+ H5TOOLS_DEBUG("ndims=%d - ctx.ndims=%d", ndims, ctx.ndims);
+
+ /* Assume entire data space to be printed */
+ if (ctx.ndims > 0)
+ for (i = 0; i < (size_t)ctx.ndims; i++)
+ ctx.p_min_idx[i] = 0;
+
+ H5Sget_simple_extent_dims(space, total_size, NULL);
+ if (ctx.ndims > 0)
+ init_acc_pos(&ctx, total_size);
+ ctx.need_prefix = TRUE;
+
+ if (NULL != (ref_buf = (H5R_ref_t *)HDcalloc(MAX(sizeof(unsigned), sizeof(H5R_ref_t)), (size_t)ndims))) {
+ H5TOOLS_DEBUG("H5Aread reference read");
+ if(H5Aread(attr, H5T_STD_REF, ref_buf) < 0) {
+ HDfree(ref_buf);
+ H5TOOLS_INFO("H5Aread reference failed");
+ H5TOOLS_GOTO_DONE_NO_RET();
+ }
+ ctx.indent_level++;
+ dump_reference(rawoutstream, info, &ctx, attr, ref_buf, ndims);
+ ctx.indent_level--;
+ HDfree(ref_buf);
+ }
+ }
+ else {
+ H5TOOLS_DEBUG("Attribute data read");
+ ctx.indent_level++;
+ if (h5tools_dump_mem(rawoutstream, info, &ctx, attr) < 0) {
+ h5tools_str_reset(&buffer);
+ h5tools_str_append(&buffer, " Unable to print data.");
+ h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, (size_t)info->line_ncols, (hsize_t)0, (hsize_t)0);
+ }
+ ctx.indent_level--;
+ H5TOOLS_DEBUG("Attribute data read complete");
+ }
+done:
+ H5Sclose(space);
+ H5Tclose(f_type);
+
+ h5tools_str_close(&buffer);
+
+ PRINTVALSTREAM(rawoutstream, "\n");
+
+ H5TOOLS_ENDDEBUG("");
+}
+
+/*-------------------------------------------------------------------------
* Function: list_attr
*
* Purpose: Prints information about attributes.
@@ -1425,36 +1878,38 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *ain
hid_t attr = H5I_INVALID_HID;
hid_t space = H5I_INVALID_HID;
hid_t type = H5I_INVALID_HID;
- hid_t p_type = H5I_INVALID_HID;
hsize_t size[H5S_MAX_RANK];
hsize_t nelmts = 1;
- hsize_t temp_need;
- size_t need;
int ndims;
int i;
- void *buf;
H5S_class_t space_type;
hsize_t curr_pos = 0; /* total data element position */
h5tools_str_t buffer; /* string into which to render */
h5tools_context_t ctx; /* print context */
h5tool_format_t *info = &ls_dataformat;
- h5tool_format_t outputformat;
+
+ H5TOOLS_START_DEBUG("");
HDmemset(&ctx, 0, sizeof(ctx));
HDmemset(&buffer, 0, sizeof(h5tools_str_t));
+ ctx.indent_level = 2;
+ ctx.cur_column = (size_t)curr_pos;
+
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, " Attribute: ");
print_string(&buffer, attr_name, TRUE);
- if ((attr = H5Aopen(obj, attr_name, H5P_DEFAULT))) {
+ H5TOOLS_DEBUG("Attribute name:%s", attr_name);
+ if ((attr = H5Aopen(obj, attr_name, H5P_DEFAULT)) >= 0) {
space = H5Aget_space(attr);
type = H5Aget_type(attr);
/* Data space */
ndims = H5Sget_simple_extent_dims(space, size, NULL);
space_type = H5Sget_simple_extent_type(space);
+ H5TOOLS_DEBUG("Attribute ndims:%d", ndims);
switch(space_type) {
case H5S_SCALAR:
/* scalar dataspace */
@@ -1489,100 +1944,25 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *ain
/* Data type */
h5tools_str_reset(&buffer);
- h5tools_str_append(&buffer, " Type: ");
+ h5tools_str_append(&buffer, " %-10s ", "Type:");
print_type(&buffer, type, 15);
h5tools_str_append(&buffer, "\n");
h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, (size_t)info->line_ncols, (hsize_t)0, (hsize_t)0);
- /* Data */
- outputformat = *info;
-
- if (nelmts < 5) {
- outputformat.idx_fmt = "";
- outputformat.line_1st = " Data: ";
- outputformat.line_pre = " ";
- outputformat.line_cont = " ";
- outputformat.str_repeat = 8;
-
- }
- else {
- h5tools_str_reset(&buffer);
- h5tools_str_append(&buffer, " Data:\n");
- h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, (size_t)info->line_ncols, (hsize_t)0, (hsize_t)0);
- outputformat.line_1st = NULL;
- outputformat.line_pre = " %s ";
- outputformat.line_cont = " %s ";
- outputformat.str_repeat = 8;
- }
-
- outputformat.line_ncols = (unsigned)width_g;
- if (label_g)
- outputformat.cmpd_name = "%s=";
- if (string_g && 1 == H5Tget_size(type) && H5T_INTEGER == H5Tget_class(type)) {
- outputformat.ascii = TRUE;
- outputformat.elmt_suf1 = "";
- outputformat.elmt_suf2 = "";
- outputformat.line_pre = " %s \"";
- outputformat.line_suf = "\"";
- } /* end if */
-
-
- outputformat.arr_pre = NULL;
- outputformat.arr_suf = NULL;
- outputformat.arr_sep = NULL;
-
- outputformat.cmpd_pre = NULL;
- outputformat.cmpd_suf = NULL;
- outputformat.cmpd_sep = NULL;
-
- outputformat.vlen_sep = NULL;
- outputformat.vlen_pre = NULL;
- outputformat.vlen_suf = NULL;
- outputformat.vlen_end = NULL;
-
- info = &outputformat;
-
- if (space_type != H5S_NULL && space_type != H5S_NO_CLASS) {
- if (hexdump_g)
- p_type = H5Tcopy(type);
- else
- p_type = H5Tget_native_type(type, H5T_DIR_DEFAULT);
-
- if (p_type >= 0) {
- /* VL data special information */
- unsigned int vl_data = 0; /* contains VL datatypes */
-
- /* Check if we have VL data in the dataset's datatype */
- if (h5tools_detect_vlen(p_type) == TRUE)
- vl_data = TRUE;
-
- temp_need = nelmts * MAX(H5Tget_size(type), H5Tget_size(p_type));
- need = (size_t)temp_need;
- if((buf = HDmalloc(need)) != NULL) {
- if(H5Aread(attr, p_type, buf) >= 0) {
- ctx.need_prefix = TRUE;
- ctx.indent_level = 2;
- ctx.cur_column = (size_t)curr_pos;
- h5tools_dump_mem(rawoutstream, info, &ctx, attr, p_type, space, buf);
- }
-
- /* Reclaim any VL memory, if necessary */
- if (vl_data)
- H5Dvlen_reclaim(p_type, space, H5P_DEFAULT, buf);
-
- HDfree(buf);
- }
- H5Tclose(p_type);
- } /* end if */
- }
-
H5Sclose(space);
H5Tclose(type);
+
+ h5tools_str_close(&buffer);
+
+ if (data_g)
+ dump_attribute_values(attr);
H5Aclose(attr);
}
- h5tools_str_close(&buffer);
-
- PRINTVALSTREAM(rawoutstream, "\n");
+ else {
+ H5TOOLS_DEBUG("Attribute open failed");
+ h5tools_str_close(&buffer);
+ }
+ H5TOOLS_ENDDEBUG("");
return 0;
}
@@ -1796,7 +2176,10 @@ dataset_list2(hid_t dset, const char H5_ATTR_UNUSED *name)
break;
case H5T_REFERENCE:
- if (H5Tequal(type, H5T_STD_REF_DSETREG)) {
+ if (H5Tequal(dset, H5T_STD_REF)) {
+ h5tools_str_append(&buffer, "reference information not available");
+ }
+ else if (H5Tequal(dset, H5T_STD_REF_DSETREG)) {
h5tools_str_append(&buffer, "information not available");
}
break;
@@ -1835,8 +2218,10 @@ dataset_list2(hid_t dset, const char H5_ATTR_UNUSED *name)
h5tools_str_append(&buffer, "}\n");
} /* end for */
} /* end if */
+ h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, (size_t)info->line_ncols, (hsize_t)0, (hsize_t)0);
/* Print data type */
+ h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, " %-10s ", "Type:");
print_type(&buffer, type, 15);
h5tools_str_append(&buffer, "\n");
@@ -1906,7 +2291,7 @@ datatype_list2(hid_t type, const char H5_ATTR_UNUSED *name)
*-------------------------------------------------------------------------
*/
static herr_t
-list_obj(const char *name, const H5O_info_t *oinfo, const char *first_seen, void *_iter)
+list_obj(const char *name, const H5O_info2_t *oinfo, const char *first_seen, void *_iter)
{
H5O_type_t obj_type = oinfo->type; /* Type of the object */
iter_t *iter = (iter_t*)_iter;
@@ -1915,11 +2300,14 @@ list_obj(const char *name, const H5O_info_t *oinfo, const char *first_seen, void
h5tools_context_t ctx; /* print context */
h5tool_format_t *info = &ls_dataformat;
+ H5TOOLS_START_DEBUG("");
+
HDmemset(&ctx, 0, sizeof(ctx));
HDmemset(&buffer, 0, sizeof(h5tools_str_t));
h5tools_str_reset(&buffer);
+ H5TOOLS_DEBUG("Object name:%s", name);
/* Print the link's name, either full name or base name */
if (!iter->symlink_target)
print_obj_name(&buffer, iter, name, "");
@@ -1951,6 +2339,7 @@ list_obj(const char *name, const H5O_info_t *oinfo, const char *first_seen, void
/* Open the object. Not all objects can be opened. If this is the case
* then return right away.
*/
+ H5TOOLS_DEBUG("Open object name=%s", name);
if (obj_type >= 0 && (obj = H5Oopen(iter->fid, name, H5P_DEFAULT)) < 0) {
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, " *ERROR*\n");
@@ -1959,6 +2348,7 @@ list_obj(const char *name, const H5O_info_t *oinfo, const char *first_seen, void
} /* end if */
/* List the first line of information for the object. */
+ H5TOOLS_DEBUG("Object type:%d", obj_type);
if (obj_type >= 0 && dispatch_g[obj_type].list1)
(dispatch_g[obj_type].list1)(obj);
if (!iter->symlink_target || (verbose_g > 0)) {
@@ -1972,18 +2362,24 @@ list_obj(const char *name, const H5O_info_t *oinfo, const char *first_seen, void
if (verbose_g > 0) {
size_t buf_size = 0;
char* comment = NULL;
+ char* obj_addr_str = NULL;
ssize_t cmt_bufsize = -1;
/* Display attributes */
+ H5TOOLS_DEBUG("Display attributes");
if (obj_type >= 0)
H5Aiterate2(obj, H5_INDEX_NAME, H5_ITER_INC, NULL, list_attr, NULL);
/* Object location & reference count */
+ H5Otoken_to_str(obj, &oinfo->token, &obj_addr_str);
+
h5tools_str_reset(&buffer);
- h5tools_str_append(&buffer, " %-10s %lu:"H5_PRINTF_HADDR_FMT"\n", "Location:", oinfo->fileno, oinfo->addr);
+ h5tools_str_append(&buffer, " %-10s %lu:%s\n", "Location:", oinfo->fileno, obj_addr_str);
h5tools_str_append(&buffer, " %-10s %u\n", "Links:", (unsigned)oinfo->rc);
h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, (size_t)info->line_ncols, (hsize_t)0, (hsize_t)0);
+ H5free_memory(obj_addr_str);
+
/* Modification time */
if (oinfo->mtime > 0) {
char buf[256];
@@ -2042,6 +2438,8 @@ done:
}
h5tools_str_close(&buffer);
+ H5TOOLS_ENDDEBUG("");
+
return 0;
} /* end list_obj() */
@@ -2056,7 +2454,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-list_lnk(const char *name, const H5L_info_t *linfo, void *_iter)
+list_lnk(const char *name, const H5L_info2_t *linfo, void *_iter)
{
char *buf = NULL;
iter_t *iter = (iter_t*)_iter;
@@ -2242,7 +2640,7 @@ static herr_t
visit_obj(hid_t file, const char *oname, iter_t *iter)
{
int retval = 0;
- H5O_info_t oi; /* Information for object */
+ H5O_info2_t oi; /* Information for object */
hsize_t curr_pos = 0; /* total data element position */
h5tools_str_t buffer; /* string into which to render */
h5tools_context_t ctx; /* print context */
@@ -2254,7 +2652,7 @@ visit_obj(hid_t file, const char *oname, iter_t *iter)
h5tools_str_reset(&buffer);
/* Retrieve info for object to list */
- if (H5Oget_info_by_name2(file, oname, &oi, H5O_INFO_BASIC|H5O_INFO_TIME, H5P_DEFAULT) < 0) {
+ if (H5Oget_info_by_name3(file, oname, &oi, H5O_INFO_BASIC|H5O_INFO_TIME, H5P_DEFAULT) < 0) {
if (iter->symlink_target) {
h5tools_str_append(&buffer, "{**NOT FOUND**}\n");
iter->symlink_target = FALSE;
@@ -2435,7 +2833,7 @@ leave(int ret)
int
main(int argc, const char *argv[])
{
- hid_t file = H5I_INVALID_HID;
+ hid_t file_id = H5I_INVALID_HID;
char *fname = NULL, *oname = NULL, *x;
const char *s = NULL;
char *rest;
@@ -2445,6 +2843,10 @@ main(int argc, const char *argv[])
const char *preferred_driver = NULL;
int err_exit = 0;
hid_t fapl_id = H5P_DEFAULT;
+ H5E_auto2_t func;
+ H5E_auto2_t tools_func;
+ void *edata;
+ void *tools_edata;
#ifdef H5_HAVE_ROS3_VFD
/* default "anonymous" s3 configuration */
@@ -2472,9 +2874,17 @@ main(int argc, const char *argv[])
h5tools_setprogname(PROGRAMNAME);
h5tools_setstatus(EXIT_SUCCESS);
+ /* Disable error reporting */
+ H5Eget_auto2(H5E_DEFAULT, &func, &edata);
+ H5Eset_auto2(H5E_DEFAULT, NULL, NULL);
+
/* Initialize h5tools lib */
h5tools_init();
+ /* Disable tools error reporting */
+ H5Eget_auto2(H5tools_ERR_STACK_g, &tools_func, &tools_edata);
+ H5Eset_auto2(H5tools_ERR_STACK_g, NULL, NULL);
+
/* Build object display table */
DISPATCH(H5O_TYPE_GROUP, "Group", NULL, NULL);
DISPATCH(H5O_TYPE_DATASET, "Dataset", dataset_list1, dataset_list2);
@@ -2501,11 +2911,11 @@ main(int argc, const char *argv[])
data_g = TRUE;
}
else if (!HDstrcmp(argv[argno], "--enable-error-stack")) {
- show_errors_g = TRUE;
+ enable_error_stack = 1;
/* deprecated --errors */
}
else if (!HDstrcmp(argv[argno], "--errors")) {
- show_errors_g = TRUE;
+ enable_error_stack = 1;
}
else if (!HDstrcmp(argv[argno], "--follow-symlinks")) {
follow_symlink_g = TRUE;
@@ -2754,7 +3164,7 @@ main(int argc, const char *argv[])
/* deprecated -e */
case 'e': /* --errors */
- show_errors_g = TRUE;
+ enable_error_stack = 1;
break;
case 'E': /* --external */
@@ -2862,10 +3272,10 @@ main(int argc, const char *argv[])
}
} /* preferred_driver defined */
- /* Turn off HDF5's automatic error printing unless you're debugging h5ls */
- if(!show_errors_g)
- H5Eset_auto2(H5E_DEFAULT, NULL, NULL);
-
+ if (enable_error_stack > 0) {
+ H5Eset_auto2(H5E_DEFAULT, func, edata);
+ H5Eset_auto2(H5tools_ERR_STACK_g, tools_func, tools_edata);
+ }
/* Each remaining argument is an hdf5 file followed by an optional slash
* and object name.
@@ -2881,24 +3291,24 @@ main(int argc, const char *argv[])
* doesn't exist). */
show_file_name_g = (argc-argno > 1); /*show file names if more than one*/
while(argno < argc) {
- H5L_info_t li;
+ H5L_info2_t li;
iter_t iter;
symlink_trav_t symlink_list;
size_t u;
fname = HDstrdup(argv[argno++]);
oname = NULL;
- file = -1;
+ file_id = H5I_INVALID_HID;
while (fname && *fname) {
if (fapl_id != H5P_DEFAULT) {
- file = H5Fopen(fname, H5F_ACC_RDONLY, fapl_id);
+ file_id = H5Fopen(fname, H5F_ACC_RDONLY, fapl_id);
}
else {
- file = h5tools_fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT, preferred_driver, drivername, sizeof drivername);
+ file_id = h5tools_fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT, preferred_driver, drivername, sizeof drivername);
}
- if (file >= 0) {
+ if (file_id >= 0) {
if (verbose_g)
PRINTSTREAM(rawoutstream, "Opened \"%s\" with %s driver.\n", fname, drivername);
break; /*success*/
@@ -2914,7 +3324,7 @@ main(int argc, const char *argv[])
*oname = '\0';
} /* end while */
- if (file < 0) {
+ if (file_id < 0) {
HDfprintf(rawerrorstream, "%s: unable to open file\n", argv[argno-1]);
HDfree(fname);
err_exit = 1;
@@ -2929,6 +3339,7 @@ main(int argc, const char *argv[])
x = oname;
if (NULL == (oname = HDstrdup(oname))) {
HDfprintf(rawerrorstream, "memory allocation failed\n");
+ H5Eset_auto2(H5E_DEFAULT, func, edata);
leave(EXIT_FAILURE);
}
*x = '\0';
@@ -2948,8 +3359,8 @@ main(int argc, const char *argv[])
/* Remember the file information for later */
iter.fname = fname;
- iter.fid = file;
- iter.gid = -1;
+ iter.fid = file_id;
+ iter.gid = H5I_INVALID_HID;
iter.symlink_target = FALSE;
iter.symlink_list = &symlink_list;
iter.symlink_list->dangle_link = FALSE;
@@ -2961,7 +3372,7 @@ main(int argc, const char *argv[])
/* Check for root group as object name */
if (HDstrcmp(oname, root_name)) {
/* Check the type of link given */
- if (H5Lget_info(file, oname, &li, H5P_DEFAULT) < 0) {
+ if (H5Lget_info2(file_id, oname, &li, H5P_DEFAULT) < 0) {
hsize_t curr_pos = 0; /* total data element position */
h5tools_str_t buffer; /* string into which to render */
h5tools_context_t ctx; /* print context */
@@ -2973,6 +3384,7 @@ main(int argc, const char *argv[])
h5tools_str_reset(&buffer);
print_obj_name(&buffer, &iter, oname, "**NOT FOUND**");
h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, (size_t)info->line_ncols, (hsize_t)0, (hsize_t)0);
+ H5Eset_auto2(H5E_DEFAULT, func, edata);
leave(EXIT_FAILURE);
} /* end if */
} /* end if */
@@ -2981,16 +3393,18 @@ main(int argc, const char *argv[])
/* Open the object and display it's information */
if (li.type == H5L_TYPE_HARD) {
- if (visit_obj(file, oname, &iter) < 0)
+ if (visit_obj(file_id, oname, &iter) < 0) {
+ H5Eset_auto2(H5E_DEFAULT, func, edata);
leave(EXIT_FAILURE);
+ }
} /* end if(li.type == H5L_TYPE_HARD) */
else {
/* Specified name is not for object -- list that link */
- /* Use file ID for root group ID */
- iter.gid = file;
+ /* Use file_id ID for root group ID */
+ iter.gid = file_id;
list_lnk(oname, &li, &iter);
}
- H5Fclose(file);
+ H5Fclose(file_id);
HDfree(fname);
if (x)
HDfree(oname);
@@ -3011,10 +3425,12 @@ main(int argc, const char *argv[])
if (fapl_id != H5P_DEFAULT) {
if (0 < H5Pclose(fapl_id)) {
HDfprintf(rawerrorstream, "Error: Unable to set close fapl entry\n\n");
+ H5Eset_auto2(H5E_DEFAULT, func, edata);
leave(EXIT_FAILURE);
}
}
+ H5Eset_auto2(H5E_DEFAULT, func, edata);
if (err_exit)
leave(EXIT_FAILURE);
else