summaryrefslogtreecommitdiffstats
path: root/tools/lib/h5tools_dump.c
diff options
context:
space:
mode:
authorJordan Henderson <jhenderson@hdfgroup.org>2019-12-28 05:02:26 (GMT)
committerJordan Henderson <jhenderson@hdfgroup.org>2019-12-28 20:08:04 (GMT)
commit2cbf31cb3ad8032fb1915c783dc52a2050aaf7da (patch)
treed88ce3a7584792894bd073df1f2290f22eb69daa /tools/lib/h5tools_dump.c
parent34a68acc934800d6b8c9a51c2ce91155b3178111 (diff)
downloadhdf5-2cbf31cb3ad8032fb1915c783dc52a2050aaf7da.zip
hdf5-2cbf31cb3ad8032fb1915c783dc52a2050aaf7da.tar.gz
hdf5-2cbf31cb3ad8032fb1915c783dc52a2050aaf7da.tar.bz2
Refactor tools library error handling macros
Diffstat (limited to 'tools/lib/h5tools_dump.c')
-rw-r--r--tools/lib/h5tools_dump.c319
1 files changed, 162 insertions, 157 deletions
diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c
index eb73431..ada7ae8 100644
--- a/tools/lib/h5tools_dump.c
+++ b/tools/lib/h5tools_dump.c
@@ -274,11 +274,11 @@ h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, hid_t contai
* to the ctx->size_last_dim. */
H5TOOLS_PUSH_STACK();
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "enter file=%p", (void*)stream);
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "rawdata file=%p", (void*)rawdatastream);
+ H5TOOLS_DEBUG("enter file=%p", (void*)stream);
+ H5TOOLS_DEBUG("rawdata file=%p", (void*)rawdatastream);
/* binary dump */
if (bin_output && (rawdatastream != NULL)) {
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "render_bin_output");
+ H5TOOLS_DEBUG("render_bin_output");
if (render_bin_output(rawdatastream, container, type, _mem, nelmts) < 0) {
PRINTVALSTREAM(rawoutstream, "\nError in writing binary stream\n");
}
@@ -287,7 +287,7 @@ h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, hid_t contai
/* setup */
HDmemset(&buffer, 0, sizeof(h5tools_str_t));
size = H5Tget_size(type);
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "type size is %ld", size);
+ H5TOOLS_DEBUG("type size is %ld", size);
if (info->line_ncols > 0)
ncols = info->line_ncols;
@@ -298,7 +298,7 @@ h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, hid_t contai
*/
curr_pos = ctx->sm_pos;
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "data render start:%ld", nelmts);
+ H5TOOLS_DEBUG("data render start:%ld", nelmts);
for (i = 0; i < nelmts; i++, ctx->cur_elmt++, elmt_counter++) {
void* memref = mem + i * size;
@@ -315,12 +315,12 @@ h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, hid_t contai
if(FALSE == dimension_break)
elmt_counter = 0;
} /* end for (i = 0; i < nelmts... */
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "data render finish");
+ H5TOOLS_DEBUG("data render finish");
h5tools_str_close(&buffer);
}/* else bin */
- H5TOOLS_ENDDEBUG(H5E_tools_min_dbg_id_g, "exit");
+ H5TOOLS_ENDDEBUG("exit");
H5TOOLS_POP_STACK();
return ret_value;
}
@@ -376,8 +376,8 @@ h5tools_dump_region_attribute(hid_t region_id,
outputformat.idx_sep = "";
outputformat.line_pre = "";
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "enter file=%p", (void*)stream);
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "rawdata file=%p", (void*)rawdatastream);
+ H5TOOLS_DEBUG("enter file=%p", (void*)stream);
+ H5TOOLS_DEBUG("rawdata file=%p", (void*)rawdatastream);
/* Render the region { element begin */
h5tools_str_reset(buffer);
@@ -387,11 +387,11 @@ h5tools_dump_region_attribute(hid_t region_id,
/* Render the region { element end */
if((region_space = H5Aget_space(region_id)) < 0)
- H5TOOLS_GOTO_ERROR(dimension_break, H5E_tools_min_id_g, "H5Aget_space failed");
+ H5TOOLS_GOTO_ERROR(dimension_break, "H5Aget_space failed");
if((atype = H5Aget_type(region_id)) < 0)
- H5TOOLS_GOTO_ERROR(dimension_break, H5E_tools_min_id_g, "H5Aget_type failed");
+ H5TOOLS_GOTO_ERROR(dimension_break, "H5Aget_type failed");
if((type_id = H5Tget_native_type(atype, H5T_DIR_DEFAULT)) < 0)
- H5TOOLS_GOTO_ERROR(dimension_break, H5E_tools_min_id_g, "H5Tget_native_type failed");
+ H5TOOLS_GOTO_ERROR(dimension_break, "H5Tget_native_type failed");
ctx->indent_level++;
ctx->need_prefix = TRUE;
@@ -442,13 +442,13 @@ h5tools_dump_region_attribute(hid_t region_id,
h5tools_dump_data(stream, &outputformat, ctx, region_id, FALSE);
}
- done:
+done:
if(H5Tclose(type_id) < 0)
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed");
+ H5TOOLS_ERROR(dimension_break, "H5Tclose failed");
if(H5Tclose(atype) < 0)
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed");
+ H5TOOLS_ERROR(dimension_break, "H5Tclose failed");
ctx->indent_level--;
ctx->need_prefix = TRUE;
@@ -463,7 +463,7 @@ h5tools_dump_region_attribute(hid_t region_id,
CATCH
- H5TOOLS_ENDDEBUG(H5E_tools_min_dbg_id_g, "exit");
+ H5TOOLS_ENDDEBUG("exit");
H5TOOLS_POP_STACK();
return ret_value;
@@ -521,18 +521,18 @@ h5tools_print_region_data_blocks(hid_t region_id,
HDmemset(&ctx, 0, sizeof(ctx));
H5TOOLS_PUSH_STACK();
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "enter");
+ H5TOOLS_DEBUG("enter");
if((type_size = H5Tget_size(type_id)) == 0)
H5TOOLS_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_size failed");
/* Get the dataspace of the dataset */
if((sid1 = H5Dget_space(region_id)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_space failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Dget_space failed");
/* Allocate space for the dimension array */
if((dims1 = (hsize_t *) HDmalloc((size_t)(sizeof(hsize_t) * ndims))) == NULL)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "Could not allocate buffer for dims");
+ H5TOOLS_GOTO_ERROR(FAIL, "Could not allocate buffer for dims");
/* find the dimensions of each data space from the block coordinates */
numelem = 1;
@@ -543,18 +543,18 @@ h5tools_print_region_data_blocks(hid_t region_id,
/* Create dataspace for reading buffer */
if((mem_space = H5Screate_simple((int)ndims, dims1, NULL)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Screate_simple failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Screate_simple failed");
if((region_buf = HDmalloc(type_size * (size_t)numelem)) == NULL)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "Could not allocate region buffer");
+ H5TOOLS_GOTO_ERROR(FAIL, "Could not allocate region buffer");
/* Select (x , x , ..., x ) x (y , y , ..., y ) hyperslab for reading memory dataset */
/* 1 2 n 1 2 n */
if((start = (hsize_t *) HDmalloc(sizeof(hsize_t) * ndims)) == NULL)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "Could not allocate buffer for start");
+ H5TOOLS_GOTO_ERROR(FAIL, "Could not allocate buffer for start");
if((count = (hsize_t *) HDmalloc(sizeof(hsize_t) * ndims)) == NULL)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "Could not allocate buffer for count");
+ H5TOOLS_GOTO_ERROR(FAIL, "Could not allocate buffer for count");
curr_pos = 0;
ctx.indent_level = cur_ctx->indent_level;
@@ -592,7 +592,7 @@ h5tools_print_region_data_blocks(hid_t region_id,
h5tools_region_simple_prefix(stream, info, &ctx, curr_pos, ptdata, 0);
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "data render start:%ld", numelem);
+ H5TOOLS_DEBUG("data render start:%ld", numelem);
elmtno = 0;
for (numindex = 0; numindex < numelem; numindex++, elmtno++, ctx.cur_elmt++) {
/* Render the region data element begin */
@@ -614,16 +614,17 @@ h5tools_print_region_data_blocks(hid_t region_id,
} /* end for (numindex = 0; numindex < numelem; numindex++, elmtno++, ctx.cur_elmt++) */
}
else {
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Sget_simple_extent_dims failed");
+ ctx.indent_level--;
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Sget_simple_extent_dims failed");
}
ctx.indent_level--;
}
else {
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Dread failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Dread failed");
}
}
else {
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Sselect_hyperslab failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Sselect_hyperslab failed");
}
} /* end for (blkndx = 0; blkndx < nblocks; blkndx++) */
@@ -635,11 +636,11 @@ done:
HDfree(dims1);
if(H5Sclose(mem_space) < 0)
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Sclose failed");
+ H5TOOLS_ERROR(FAIL, "H5Sclose failed");
if(H5Sclose(sid1) < 0)
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Sclose failed");
+ H5TOOLS_ERROR(FAIL, "H5Sclose failed");
CATCH
- H5TOOLS_ENDDEBUG(H5E_tools_min_dbg_id_g, "exit");
+ H5TOOLS_ENDDEBUG("exit");
H5TOOLS_POP_STACK();
return ret_value;
@@ -711,7 +712,7 @@ h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id,
H5TOOLS_THROW(dimension_break, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed");
ndims = (unsigned)sndims;
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "enter ndims=%d", ndims);
+ H5TOOLS_DEBUG("enter ndims=%d", ndims);
/* Render the region { element begin */
h5tools_str_reset(buffer);
@@ -730,10 +731,10 @@ h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id,
alloc_size = nblocks * ndims * 2 * sizeof(ptdata[0]);
HDassert(alloc_size == (hsize_t) ((size_t) alloc_size)); /*check for overflow*/
if((ptdata = (hsize_t*) HDmalloc((size_t) alloc_size)) == NULL)
- H5TOOLS_GOTO_ERROR(dimension_break, H5E_tools_min_id_g, "Could not allocate buffer for ptdata");
+ H5TOOLS_GOTO_ERROR(dimension_break, "Could not allocate buffer for ptdata");
if(H5Sget_select_hyper_blocklist(region_space, (hsize_t)0, nblocks, ptdata) < 0)
- H5TOOLS_GOTO_ERROR(dimension_break, H5E_tools_min_id_g, "H5Rget_select_hyper_blocklist failed");
+ H5TOOLS_GOTO_ERROR(dimension_break, "H5Rget_select_hyper_blocklist failed");
for(indx = 0; indx < nblocks; indx++) {
unsigned loop_indx;
@@ -759,9 +760,9 @@ h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id,
ctx->need_prefix = TRUE;
if((dtype = H5Dget_type(region_id)) < 0)
- H5TOOLS_GOTO_ERROR(dimension_break, H5E_tools_min_id_g, "H5Dget_type failed");
+ H5TOOLS_GOTO_ERROR(dimension_break, "H5Dget_type failed");
if((type_id = H5Tget_native_type(dtype, H5T_DIR_DEFAULT)) < 0)
- H5TOOLS_GOTO_ERROR(dimension_break, H5E_tools_min_id_g, "H5Tget_native_type failed");
+ H5TOOLS_GOTO_ERROR(dimension_break, "H5Tget_native_type failed");
/* Render the datatype element begin */
h5tools_str_reset(buffer);
@@ -818,14 +819,15 @@ h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id,
h5tools_print_region_data_blocks(region_id, rawdatastream, info, ctx, buffer, ncols, ndims, type_id, nblocks, ptdata);
}
- done:
+
+done:
HDfree(ptdata);
if(type_id > 0 && H5Tclose(type_id) < 0)
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed");
+ H5TOOLS_ERROR(dimension_break, "H5Tclose failed");
if(dtype > 0 && H5Tclose(dtype) < 0)
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed");
+ H5TOOLS_ERROR(dimension_break, "H5Tclose failed");
if (region_output) {
ctx->need_prefix = TRUE;
@@ -858,7 +860,7 @@ h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id,
CATCH
- H5TOOLS_ENDDEBUG(H5E_tools_min_dbg_id_g, "exit");
+ H5TOOLS_ENDDEBUG("exit");
H5TOOLS_POP_STACK();
return ret_value;
@@ -909,7 +911,7 @@ h5tools_print_region_data_points(hid_t region_space, hid_t region_id,
HDassert(ndims > 0);
H5TOOLS_PUSH_STACK();
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "enter");
+ H5TOOLS_DEBUG("enter");
HDmemset(&ctx, 0, sizeof(ctx));
/* Allocate space for the dimension array */
@@ -935,9 +937,9 @@ h5tools_print_region_data_points(hid_t region_space, hid_t region_id,
ctx.ndims = ndims;
if(H5Dread(region_id, type_id, mem_space, region_space, H5P_DEFAULT, region_buf) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Dread failed");
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "data render start:%ld", npoints);
+ H5TOOLS_DEBUG("data render start:%ld", npoints);
elmtno = 0;
for (jndx = 0; jndx < npoints; jndx++, elmtno++) {
ctx.need_prefix = TRUE;
@@ -984,7 +986,8 @@ h5tools_print_region_data_points(hid_t region_space, hid_t region_id,
elmtno = 0;
}
else {
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Sget_simple_extent_dims failed");
+ ctx.indent_level--;
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Sget_simple_extent_dims failed");
}
ctx.indent_level--;
} /* end for (jndx = 0; jndx < npoints; jndx++, elmtno++) */
@@ -995,9 +998,9 @@ CATCH
HDfree(dims1);
if(H5Sclose(mem_space) < 0)
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Sclose failed");
+ H5TOOLS_ERROR(FAIL, "H5Sclose failed");
- H5TOOLS_ENDDEBUG(H5E_tools_min_dbg_id_g, "exit");
+ H5TOOLS_ENDDEBUG("exit");
H5TOOLS_POP_STACK();
return ret_value;
@@ -1066,7 +1069,7 @@ h5tools_dump_region_data_points(hid_t region_space, hid_t region_id,
H5TOOLS_THROW(dimension_break, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed");
ndims = (unsigned)sndims;
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "enter ndims=%d", ndims);
+ H5TOOLS_DEBUG("enter ndims=%d", ndims);
/* Render the region { element begin */
h5tools_str_reset(buffer);
@@ -1085,10 +1088,10 @@ h5tools_dump_region_data_points(hid_t region_space, hid_t region_id,
alloc_size = npoints * ndims * sizeof(ptdata[0]);
HDassert(alloc_size == (hsize_t) ((size_t) alloc_size)); /*check for overflow*/
if(NULL == (ptdata = (hsize_t *)HDmalloc((size_t) alloc_size)))
- H5TOOLS_GOTO_ERROR(dimension_break, H5E_tools_min_id_g, "Could not allocate buffer for ptdata");
+ H5TOOLS_GOTO_ERROR(dimension_break, "Could not allocate buffer for ptdata");
if(H5Sget_select_elem_pointlist(region_space, (hsize_t) 0, npoints, ptdata) < 0)
- H5TOOLS_GOTO_ERROR(dimension_break, H5E_tools_min_id_g, "H5Sget_select_elem_pointlist failed");
+ H5TOOLS_GOTO_ERROR(dimension_break, "H5Sget_select_elem_pointlist failed");
for (indx = 0; indx < npoints; indx++) {
unsigned loop_indx;
@@ -1109,9 +1112,9 @@ h5tools_dump_region_data_points(hid_t region_space, hid_t region_id,
ctx->need_prefix = TRUE;
if((dtype = H5Dget_type(region_id)) < 0)
- H5TOOLS_GOTO_ERROR(dimension_break, H5E_tools_min_id_g, "H5Dget_type failed");
+ H5TOOLS_GOTO_ERROR(dimension_break, "H5Dget_type failed");
if((type_id = H5Tget_native_type(dtype, H5T_DIR_DEFAULT)) < 0)
- H5TOOLS_GOTO_ERROR(dimension_break, H5E_tools_min_id_g, "H5Tget_native_type failed");
+ H5TOOLS_GOTO_ERROR(dimension_break, "H5Tget_native_type failed");
/* Render the datatype element begin */
h5tools_str_reset(buffer);
@@ -1170,14 +1173,14 @@ h5tools_dump_region_data_points(hid_t region_space, hid_t region_id,
h5tools_print_region_data_points(region_space, region_id, rawdatastream, info, ctx, buffer, ncols, ndims, type_id, npoints, ptdata);
}
- done:
+done:
HDfree(ptdata);
if(type_id > 0 && H5Tclose(type_id) < 0)
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed");
+ H5TOOLS_ERROR(dimension_break, "H5Tclose failed");
if(dtype > 0 && H5Tclose(dtype) < 0)
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed");
+ H5TOOLS_ERROR(dimension_break, "H5Tclose failed");
if (region_output) {
ctx->need_prefix = TRUE;
@@ -1210,7 +1213,7 @@ h5tools_dump_region_data_points(hid_t region_space, hid_t region_id,
H5_LEAVE(dimension_break)
CATCH
- H5TOOLS_ENDDEBUG(H5E_tools_min_dbg_id_g, "exit");
+ H5TOOLS_ENDDEBUG("exit");
H5TOOLS_POP_STACK();
return ret_value;
@@ -1378,7 +1381,7 @@ h5tools_print_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_c
ctx->need_prefix = TRUE;
if(h5tools_dump_simple_data(stream, info, dset, ctx, flags, sm_nelmts, p_type, sm_buf) < 0)
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "h5tools_dump_simple_data failed");
+ H5TOOLS_THROW(FAIL, H5E_tools_min_id_g, "h5tools_dump_simple_data failed");
/* Reclaim any VL memory, if necessary */
if (vl_data)
@@ -1401,7 +1404,7 @@ CATCH
if(sm_buf)
HDfree(sm_buf);
- H5TOOLS_ENDDEBUG(H5E_tools_min_dbg_id_g, "exit");
+ H5TOOLS_ENDDEBUG("exit");
H5TOOLS_POP_STACK();
return ret_value;
}
@@ -1614,7 +1617,7 @@ CATCH
if(f_space >= 0 && H5Sclose(f_space) < 0)
H5TOOLS_THROW(FAIL, H5E_tools_min_id_g, "H5Sclose failed");
- H5TOOLS_ENDDEBUG(H5E_tools_min_dbg_id_g, "exit");
+ H5TOOLS_ENDDEBUG("exit");
H5TOOLS_POP_STACK();
return ret_value;
}
@@ -1668,18 +1671,18 @@ h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, h5tools_cont
unsigned int vl_data = 0; /* contains VL datatypes */
H5TOOLS_PUSH_STACK();
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "enter");
+ H5TOOLS_DEBUG("enter");
if (FAIL == (f_space = H5Dget_space(dset)))
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_space failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Dget_space failed");
sndims = H5Sget_simple_extent_ndims(f_space);
if(sndims < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_simple_extent_ndims failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Dget_simple_extent_ndims failed");
ctx->ndims = (unsigned)sndims;
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "sndims:%d", sndims);
+ H5TOOLS_DEBUG("sndims:%d", sndims);
if ((size_t)ctx->ndims > NELMTS(sm_size))
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "ctx->ndims > NELMTS(sm_size) failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "ctx->ndims > NELMTS(sm_size) failed");
/* Assume entire data space to be printed */
if (ctx->ndims > 0)
@@ -1726,22 +1729,22 @@ h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, h5tools_cont
HDassert(sm_nbytes == (hsize_t)((size_t)sm_nbytes)); /*check for overflow*/
if (NULL != (sm_buf = (unsigned char *)HDmalloc((size_t)sm_nbytes))) {
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "stripmine size:%ld", sm_nbytes);
+ H5TOOLS_DEBUG("stripmine size:%ld", sm_nbytes);
sm_nelmts = sm_nbytes / p_type_nbytes;
sm_space = H5Screate_simple(1, &sm_nelmts, NULL);
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "sm_nelmts size:%ld", sm_nelmts);
+ H5TOOLS_DEBUG("sm_nelmts size:%ld", sm_nelmts);
if (ctx->ndims > 0)
init_acc_pos(ctx, total_size);
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "ctx->ndims:%d", ctx->ndims);
+ H5TOOLS_DEBUG("ctx->ndims:%d", ctx->ndims);
/* The stripmine loop */
HDmemset(hs_offset, 0, sizeof hs_offset);
HDmemset(zero, 0, sizeof zero);
for (elmtno = 0; elmtno < p_nelmts; elmtno += hs_nelmts) {
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "stripmine read loop:%d", i);
+ H5TOOLS_DEBUG("stripmine read loop:%d", i);
/* Calculate the hyperslab size */
if (ctx->ndims > 0) {
for (i = 0, hs_nelmts = 1; i < ctx->ndims; i++) {
@@ -1751,19 +1754,19 @@ h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, h5tools_cont
}
if (H5Sselect_hyperslab(f_space, H5S_SELECT_SET, hs_offset, NULL, hs_size, NULL) < 0)
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Sselect_hyperslab hs_offset failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Sselect_hyperslab hs_offset failed");
if (H5Sselect_hyperslab(sm_space, H5S_SELECT_SET, zero, NULL, &hs_nelmts, NULL) < 0)
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Sselect_hyperslab zero failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Sselect_hyperslab zero failed");
}
else {
if (H5Sselect_all(f_space) < 0)
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Sselect_all f_space failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Sselect_all f_space failed");
if (H5Sselect_all(sm_space) < 0)
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Sselect_all sm_space failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Sselect_all sm_space failed");
hs_nelmts = 1;
}
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "Read the data");
+ H5TOOLS_DEBUG("Read the data");
/* Read the data */
if (H5Dread(dset, p_type, sm_space, f_space, H5P_DEFAULT, sm_buf) >= 0) {
/* Print the data */
@@ -1775,13 +1778,13 @@ h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, h5tools_cont
ctx->sm_pos = elmtno;
if(h5tools_dump_simple_data(stream, info, dset, ctx, flags, hs_nelmts, p_type, sm_buf) < 0)
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "h5tools_dump_simple_data failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "h5tools_dump_simple_data failed");
/* Reclaim any VL memory, if necessary */
if (vl_data)
H5Treclaim(p_type, sm_space, H5P_DEFAULT, sm_buf);
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "Calculate the next hyperslab offset");
+ H5TOOLS_DEBUG("Calculate the next hyperslab offset");
/* Calculate the next hyperslab offset */
for (i = ctx->ndims, carry = 1; i > 0 && carry; --i) {
ctx->p_min_idx[i - 1] = ctx->p_max_idx[i - 1];
@@ -1794,20 +1797,21 @@ h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, h5tools_cont
}
}
else
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Dread failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Dread failed");
ctx->continuation++;
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "stripmine read loop:%d complete", i);
+ H5TOOLS_DEBUG("stripmine read loop:%d complete", i);
}
HDfree(sm_buf);
} /* if (NULL != (sm_buf...)) */
+
done:
if(sm_space >= 0 && H5Sclose(sm_space) < 0)
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Sclose failed");
+ H5TOOLS_ERROR(FAIL, "H5Sclose failed");
if(f_space >= 0 && H5Sclose(f_space) < 0)
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Sclose failed");
+ H5TOOLS_ERROR(FAIL, "H5Sclose failed");
CATCH
- H5TOOLS_ENDDEBUG(H5E_tools_min_dbg_id_g, "exit");
+ H5TOOLS_ENDDEBUG("exit");
H5TOOLS_POP_STACK();
return ret_value;
}
@@ -1839,15 +1843,15 @@ h5tools_dump_simple_mem(FILE *stream, const h5tool_format_t *info, h5tools_conte
unsigned int vl_data = 0; /* contains VL datatypes */
H5TOOLS_PUSH_STACK();
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "enter");
+ H5TOOLS_DEBUG("enter");
if (FAIL == (f_space = H5Aget_space(attr_id)))
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_space failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Dget_space failed");
sndims = H5Sget_simple_extent_ndims(f_space);
if(sndims < 0)
H5TOOLS_THROW(FAIL, H5E_tools_min_id_g, "H5Dget_simple_extent_ndims failed");
ctx->ndims = (unsigned)sndims;
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "sndims:%d", sndims);
+ H5TOOLS_DEBUG("sndims:%d", sndims);
if ((size_t) ctx->ndims > NELMTS(ctx->p_min_idx))
H5TOOLS_THROW(FAIL, H5E_tools_min_id_g, "ctx->ndims > NELMTS(ctx->p_min_idx) failed");
@@ -1882,27 +1886,27 @@ h5tools_dump_simple_mem(FILE *stream, const h5tool_format_t *info, h5tools_conte
if (NULL != (buf = (unsigned char *)HDmalloc((size_t)alloc_size))) {
if (ctx->ndims > 0)
init_acc_pos(ctx, total_size);
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "ctx->ndims:%d", ctx->ndims);
+ H5TOOLS_DEBUG("ctx->ndims:%d", ctx->ndims);
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "Read the data");
+ H5TOOLS_DEBUG("Read the data");
/* Read the data */
if (H5Aread(attr_id, p_type, buf) >= 0) {
if(h5tools_dump_simple_data(stream, info, attr_id, ctx, START_OF_DATA | END_OF_DATA, p_nelmts, p_type, buf) < 0)
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "h5tools_dump_simple_data failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "h5tools_dump_simple_data failed");
/* Reclaim any VL memory, if necessary */
if (vl_data)
H5Treclaim(p_type, f_space, H5P_DEFAULT, buf);
}
else
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Aread failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Aread failed");
HDfree(buf);
} /* if (NULL != (buf...)) */
done:
if(f_space >= 0 && H5Sclose(f_space) < 0)
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Sclose failed");
+ H5TOOLS_ERROR(FAIL, "H5Sclose failed");
CATCH
- H5TOOLS_ENDDEBUG(H5E_tools_min_dbg_id_g, "exit");
+ H5TOOLS_ENDDEBUG("exit");
H5TOOLS_POP_STACK();
return ret_value;
}
@@ -1985,7 +1989,7 @@ done:
if (f_space > 0)
H5Sclose(f_space);
- H5TOOLS_ENDDEBUG(H5E_tools_min_dbg_id_g, "exit");
+ H5TOOLS_ENDDEBUG("exit");
H5TOOLS_POP_STACK();
return ret_value;
}
@@ -2043,7 +2047,7 @@ h5tools_dump_mem(FILE *stream, const h5tool_format_t *info, h5tools_context_t *c
/* Check the data space */
if (H5Sis_simple(f_space) <= 0) {
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Sis_simple failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Sis_simple failed");
}
else {
ret_value = h5tools_dump_simple_mem(rawattrstream, info, ctx, attr_id, p_type);
@@ -2056,7 +2060,7 @@ done:
if (f_space > 0)
H5Sclose(f_space);
- H5TOOLS_ENDDEBUG(H5E_tools_min_dbg_id_g, "exit");
+ H5TOOLS_ENDDEBUG("exit");
H5TOOLS_POP_STACK();
return ret_value;
}
@@ -2391,11 +2395,11 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_
order = H5Tget_order(tmp_type);
if(order == H5T_ORDER_LE) {
if(H5Tset_order(str_type, H5T_ORDER_LE) < 0)
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tset_order failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Tset_order failed");
} /* end if */
else if(order == H5T_ORDER_BE) {
if(H5Tset_order(str_type, H5T_ORDER_BE) < 0)
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tset_order failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Tset_order failed");
} /* end if */
if(H5Tequal(tmp_type, str_type)) {
@@ -2405,7 +2409,7 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_
/* If not equal to C variable-length string, check Fortran type. */
if(H5Tclose(str_type) < 0)
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Tclose failed");
str_type = H5Tcopy(H5T_FORTRAN_S1);
H5Tset_cset(str_type, cset);
@@ -2422,11 +2426,11 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_
order = H5Tget_order(tmp_type);
if(order == H5T_ORDER_LE) {
if(H5Tset_order(str_type, H5T_ORDER_LE) < 0)
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tset_order failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Tset_order failed");
} /* end if */
else if(order == H5T_ORDER_BE) {
if(H5Tset_order(str_type, H5T_ORDER_BE) < 0)
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tset_order failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Tset_order failed");
} /* end if */
if(H5Tequal(tmp_type, str_type)) {
@@ -2445,9 +2449,9 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_
h5tools_str_reset(buffer);
if(H5Tclose(str_type) < 0)
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Tclose failed");
if(H5Tclose(tmp_type) < 0)
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Tclose failed");
h5tools_str_append(buffer, "%s", h5tools_dump_header_format->strblockend);
break;
@@ -2527,10 +2531,10 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_
h5tools_str_append(buffer, " \"%s\";", mname);
h5tools_render_element(stream, info, ctx, buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0);
if(H5Tclose(mtype) < 0)
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Tclose failed");
}
else
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tget_member_type failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Tget_member_type failed");
H5free_memory(mname);
}
ctx->indent_level--;
@@ -2571,7 +2575,7 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_
h5tools_print_datatype(stream, buffer, info, ctx, super, TRUE);
if(H5Tclose(super) < 0)
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Tclose failed");
h5tools_str_append(buffer, ";");
h5tools_render_element(stream, info, ctx, buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0);
@@ -2596,7 +2600,7 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_
h5tools_print_datatype(stream, buffer, info, ctx, super, TRUE);
if(H5Tclose(super) < 0)
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Tclose failed");
h5tools_str_append(buffer, "%s", h5tools_dump_header_format->vlenblockend);
@@ -2617,10 +2621,10 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_
h5tools_str_append(buffer, " ");
}
else
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tget_array_dims2 failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Tget_array_dims2 failed");
}
else
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tget_array_ndims failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Tget_array_ndims failed");
/* Get array base type */
if((super = H5Tget_super(type)) >= 0) {
@@ -2628,10 +2632,10 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_
h5tools_print_datatype(stream, buffer, info, ctx, super, TRUE);
/* Close array base type */
if(H5Tclose(super) < 0)
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Tclose failed");
}
else
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tget_super failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Tget_super failed");
h5tools_str_append(buffer, " }");
@@ -2644,8 +2648,10 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_
break;
}
+done:
+
CATCH
- H5TOOLS_ENDDEBUG(H5E_tools_min_dbg_id_g, "exit");
+ H5TOOLS_ENDDEBUG("exit");
H5TOOLS_POP_STACK();
return ret_value;
}
@@ -2723,7 +2729,7 @@ h5tools_print_dataspace(h5tools_str_t *buffer, hid_t space)
} /* end switch */
CATCH
- H5TOOLS_ENDDEBUG(H5E_tools_min_dbg_id_g, "exit");
+ H5TOOLS_ENDDEBUG("exit");
H5TOOLS_POP_STACK();
return ret_value;
}
@@ -2870,7 +2876,7 @@ CATCH
if(0 == nmembs)
h5tools_str_append(buffer, "\n<empty>");
- H5TOOLS_ENDDEBUG(H5E_tools_min_dbg_id_g, "exit");
+ H5TOOLS_ENDDEBUG("exit");
H5TOOLS_POP_STACK();
return ret_value;
}
@@ -4006,8 +4012,8 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
H5R_ref_t *ref_buf = NULL;
H5TOOLS_PUSH_STACK();
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "enter file=%p", (void*)stream);
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "rawdata file=%p", (void*)rawdatastream);
+ H5TOOLS_DEBUG("enter file=%p", (void*)stream);
+ H5TOOLS_DEBUG("rawdata file=%p", (void*)rawdatastream);
/* setup */
HDmemset(&buffer, 0, sizeof(h5tools_str_t));
if (info->line_ncols > 0)
@@ -4019,12 +4025,12 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
string_dataformat.pindex = ctx->display_index;
if(obj_data) {
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "dataset");
+ H5TOOLS_DEBUG("dataset");
f_type = H5Dget_type(obj_id);
space = H5Dget_space(obj_id);
}
else {
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "attribute");
+ H5TOOLS_DEBUG("attribute");
f_type = H5Aget_type(obj_id);
space = H5Aget_space(obj_id);
}
@@ -4052,13 +4058,13 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
if (H5Tget_class(f_type) == H5T_REFERENCE) {
ctx->indent_level++;
datactx = *ctx;
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "reference class type");
+ 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)) {
- HGOTO_DONE(SUCCEED);
+ H5TOOLS_GOTO_DONE(SUCCEED);
}
ndims = (int)H5Sget_simple_extent_npoints(space);
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "ndims=%d - datactx.ndims=%d", ndims, datactx.ndims);
+ H5TOOLS_DEBUG("ndims=%d - datactx.ndims=%d", ndims, datactx.ndims);
/* Assume entire data space to be printed */
if (datactx.ndims > 0)
@@ -4074,31 +4080,31 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
if(obj_data) {
if(H5Dread(obj_id, H5T_STD_REF, H5S_ALL, H5S_ALL, H5P_DEFAULT, ref_buf) < 0) {
HDfree(ref_buf);
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread reference failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Dread reference failed");
}
}
else {
if(H5Aread(obj_id, H5T_STD_REF, ref_buf) < 0) {
HDfree(ref_buf);
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aread reference failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Aread reference failed");
}
}
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(H5E_tools_min_dbg_id_g, "reference loop:%d with curr_pos=%ld", i, curr_pos);
+ H5TOOLS_DEBUG("reference loop:%d with curr_pos=%ld", i, curr_pos);
datactx.need_prefix = TRUE;
h5tools_str_reset(&buffer);
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "reference loop - h5tools_str_sprint with H5T_STD_REF:%d", i);
+ H5TOOLS_DEBUG("reference loop - h5tools_str_sprint with H5T_STD_REF:%d", i);
h5tools_str_sprint(&buffer, &outputformat, obj_id, H5T_STD_REF, &ref_buf[i], &datactx);
h5tools_render_element(stream, &outputformat, &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(H5E_tools_min_dbg_id_g, "ref_type is 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:
@@ -4107,12 +4113,12 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
h5tools_dump_data(stream, &outputformat, &datactx, new_obj_id, TRUE);
datactx.indent_level--;
if(H5Dclose(new_obj_id) < 0)
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Dclose H5R_OBJECT1:H5O_TYPE_DATASET failed");
+ H5TOOLS_ERROR(FAIL, "H5Dclose H5R_OBJECT1:H5O_TYPE_DATASET failed");
if(H5Rdestroy(&ref_buf[i]) < 0)
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Rdestroy H5R_OBJECT1:H5O_TYPE_DATASET failed");
+ H5TOOLS_ERROR(FAIL, "H5Rdestroy H5R_OBJECT1:H5O_TYPE_DATASET failed");
}
else
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Ropen_object H5R_OBJECT1:H5O_TYPE_DATASET failed");
+ H5TOOLS_ERROR(FAIL, "H5Ropen_object H5R_OBJECT1:H5O_TYPE_DATASET failed");
break;
case H5O_TYPE_GROUP:
@@ -4125,24 +4131,24 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
} /* end switch */
}
else
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Rget_obj_type3 H5R_OBJECT1 failed");
+ H5TOOLS_ERROR(FAIL, "H5Rget_obj_type3 H5R_OBJECT1 failed");
break;
case H5R_DATASET_REGION1:
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "ref_type is 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_data(stream, &outputformat, &datactx, new_obj_id, TRUE);
datactx.indent_level--;
if(H5Dclose(new_obj_id) < 0)
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Dclose H5R_DATASET_REGION1 failed");
+ H5TOOLS_ERROR(FAIL, "H5Dclose H5R_DATASET_REGION1 failed");
if(H5Rdestroy(&ref_buf[i]) < 0)
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Rdestroy H5R_DATASET_REGION1 failed");
+ H5TOOLS_ERROR(FAIL, "H5Rdestroy H5R_DATASET_REGION1 failed");
}
else
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Ropen_object H5R_DATASET_REGION1 failed");
+ H5TOOLS_ERROR(FAIL, "H5Ropen_object H5R_DATASET_REGION1 failed");
break;
case H5R_OBJECT2:
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "ref_type is 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:
@@ -4154,12 +4160,12 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
h5tools_dump_data(stream, &outputformat, &datactx, new_obj_id, TRUE);
datactx.indent_level--;
if(H5Oclose(new_obj_id) < 0)
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Oclose H5R_OBJECT2 failed");
+ H5TOOLS_ERROR(FAIL, "H5Oclose H5R_OBJECT2 failed");
if(H5Rdestroy(&ref_buf[i]) < 0)
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Rdestroy H5R_OBJECT2 failed");
+ H5TOOLS_ERROR(FAIL, "H5Rdestroy H5R_OBJECT2 failed");
}
else
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Ropen_object H5R_OBJECT2 failed");
+ H5TOOLS_ERROR(FAIL, "H5Ropen_object H5R_OBJECT2 failed");
break;
case H5O_TYPE_NAMED_DATATYPE:
@@ -4173,22 +4179,21 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
} /* end switch */
}
else
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Rget_obj_type3 H5R_OBJECT2 failed");
+ H5TOOLS_ERROR(FAIL, "H5Rget_obj_type3 H5R_OBJECT2 failed");
break;
case H5R_DATASET_REGION2:
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "ref_type is H5R_DATASET_REGION2");
+ H5TOOLS_DEBUG("ref_type is H5R_DATASET_REGION2");
if (outputformat.line_ncols > 0)
ncols = outputformat.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)
- H5Epush2(H5tools_ERR_STACK_g, __FILE__, FUNC, __LINE__, H5tools_ERR_CLS_g, H5E_tools_g, H5E_tools_min_id_g,
- "H5Ropen_object H5R_DATASET_REGION2 failed");
+ H5TOOLS_ERROR(FAIL, "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(H5E_tools_min_dbg_id_g, "NULL H5R_DATASET_REGION2");
+ H5TOOLS_DEBUG("NULL H5R_DATASET_REGION2");
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, " {");
@@ -4214,42 +4219,42 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
region_type = H5Sget_select_type(new_obj_sid);
if(region_type == H5S_SEL_POINTS) {
/* Print point information */
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "H5S_SEL_POINTS H5R_DATASET_REGION2");
+ H5TOOLS_DEBUG("H5S_SEL_POINTS H5R_DATASET_REGION2");
h5tools_dump_region_data_points(new_obj_sid, new_obj_id, stream, &outputformat, &datactx,
&buffer, &curr_pos, ncols, i, elmt_counter);
}
else if(region_type == H5S_SEL_HYPERSLABS) {
/* Print block information */
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "H5S_SEL_HYPERSLABS H5R_DATASET_REGION2");
+ H5TOOLS_DEBUG("H5S_SEL_HYPERSLABS H5R_DATASET_REGION2");
h5tools_dump_region_data_blocks(new_obj_sid, new_obj_id, stream, &outputformat, &datactx,
&buffer, &curr_pos, ncols, i, elmt_counter);
}
else
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "invalid region type");
+ H5TOOLS_ERROR(FAIL, "invalid region type");
} /* end else to if (h5tools_is_zero(... */
if(H5Sclose(new_obj_sid) < 0)
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Sclose H5R_DATASET_REGION2 failed");
+ H5TOOLS_ERROR(FAIL, "H5Sclose H5R_DATASET_REGION2 failed");
}
else
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Ropen_region H5R_DATASET_REGION2 failed");
+ H5TOOLS_ERROR(FAIL, "H5Ropen_region H5R_DATASET_REGION2 failed");
if(H5Dclose(new_obj_id) < 0)
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Dclose H5R_DATASET_REGION2 failed");
+ H5TOOLS_ERROR(FAIL, "H5Dclose H5R_DATASET_REGION2 failed");
if(H5Rdestroy(&ref_buf[i]) < 0)
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Rdestroy H5R_DATASET_REGION2 failed");
+ H5TOOLS_ERROR(FAIL, "H5Rdestroy H5R_DATASET_REGION2 failed");
}
break;
case H5R_ATTR:
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "ref_type is 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, &outputformat, &datactx,
&buffer, &curr_pos, ncols, i, elmt_counter);
if(H5Aclose(new_obj_id) < 0)
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Aclose H5R_ATTR failed");
+ H5TOOLS_ERROR(FAIL, "H5Aclose H5R_ATTR failed");
if(H5Rdestroy(&ref_buf[i]) < 0)
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Rdestroy H5R_ATTR failed");
+ H5TOOLS_ERROR(FAIL, "H5Rdestroy H5R_ATTR failed");
}
else {
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "NULL H5R_ATTR");
+ H5TOOLS_DEBUG("NULL H5R_ATTR");
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, " {");
@@ -4271,7 +4276,7 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
h5tools_str_append(&buffer, "}");
h5tools_render_element(stream, &outputformat, &datactx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0);
- H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Ropen_attr H5R_ATTR failed");
+ H5TOOLS_ERROR(FAIL, "H5Ropen_attr H5R_ATTR failed");
}
break;
case H5R_BADTYPE:
@@ -4280,18 +4285,18 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
break;
} /* end switch */
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "finished reference loop:%d",i);
+ H5TOOLS_DEBUG("finished reference loop:%d",i);
} /* end for(i = 0; i < ndims; i++, datactx->cur_elmt++, elmt_counter++) */
HDfree(ref_buf);
}
ctx->indent_level--;
}
else {
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "Print all the values");
+ H5TOOLS_DEBUG("Print all the values");
datactx = *ctx;
string_dataformat = *info;
if((datactx.display_char && H5Tget_size(f_type) == 1) && (H5Tget_class(f_type) == H5T_INTEGER)) {
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "Print 1-byte integer data as an ASCII character string");
+ H5TOOLS_DEBUG("Print 1-byte integer data as an ASCII character string");
/*
* Print 1-byte integer data as an ASCII character string
* instead of integers if the `-r' or `--string' command-line
@@ -4318,7 +4323,7 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
/* Print all the values. */
if(obj_data) {
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "h5tools_dump_dset");
+ H5TOOLS_DEBUG("h5tools_dump_dset");
status = h5tools_dump_dset(stream, &string_dataformat, &datactx, obj_id);
}
else {
@@ -4328,12 +4333,12 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
status = SUCCEED;
}
else {
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "call h5tools_dump_mem");
+ H5TOOLS_DEBUG("call h5tools_dump_mem");
status = h5tools_dump_mem(stream, &string_dataformat, &datactx, obj_id);
}
}
if (datactx.display_char && H5Tget_size(f_type) == 1 && H5Tget_class(f_type) == H5T_INTEGER) {
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "Print 1-byte integer data as an ASCII character string eol=%s",string_dataformat.line_suf);
+ H5TOOLS_DEBUG("Print 1-byte integer data as an ASCII character string eol=%s",string_dataformat.line_suf);
datactx.need_prefix = FALSE;
string_dataformat.arr_linebreak = 0;
string_dataformat.idx_fmt = "";
@@ -4343,7 +4348,7 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
h5tools_str_append(&buffer, "\"");
h5tools_render_element(stream, &string_dataformat, &datactx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0);
}
- H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "Print all the values Complete");
+ H5TOOLS_DEBUG("Print all the values Complete");
if (status == FAIL) {
error_msg("unable to print data\n");
@@ -4386,7 +4391,7 @@ done:
}
h5tools_str_close(&buffer);
- H5TOOLS_ENDDEBUG(H5E_tools_min_dbg_id_g, "exit");
+ H5TOOLS_ENDDEBUG("exit");
H5TOOLS_POP_STACK();
}