diff options
Diffstat (limited to 'tools/lib')
-rw-r--r-- | tools/lib/h5tools_dump.c | 60 | ||||
-rw-r--r-- | tools/lib/h5tools_str.c | 14 | ||||
-rw-r--r-- | tools/lib/h5tools_utils.c | 8 |
3 files changed, 46 insertions, 36 deletions
diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index 96545c8..14cb622 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -2099,11 +2099,11 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ if(obj) { if(!obj->recorded) { - char *obj_addr_str = NULL; + char *obj_tok_str = NULL; - H5Otoken_to_str(type, &oinfo.token, &obj_addr_str); - h5tools_str_append(buffer,"\"/#%s\"", obj_addr_str); - H5free_memory(obj_addr_str); + H5Otoken_to_str(type, &oinfo.token, &obj_tok_str); + h5tools_str_append(buffer,"\"/#%s\"", obj_tok_str); + H5free_memory(obj_tok_str); } else h5tools_str_append(buffer, "\"%s\"", obj->objname); @@ -3241,16 +3241,15 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, break; case H5D_CONTIGUOUS: { - int next; + int n_external; - next = H5Pget_external_count(dcpl_id); + n_external = H5Pget_external_count(dcpl_id); - /*------------------------------------------------------------------------- - * EXTERNAL_FILE - *------------------------------------------------------------------------- - */ ctx->indent_level++; - if (next) { + if (n_external) { + + /* EXTERNAL FILE */ + ctx->need_prefix = TRUE; h5tools_str_reset(&buffer); @@ -3264,7 +3263,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t) ncols, (hsize_t) 0, (hsize_t) 0); ctx->indent_level++; - for (j = 0; j < (unsigned) next; j++) { + for (j = 0; j < (unsigned) n_external; j++) { H5Pget_external(dcpl_id, j, sizeof(name), name, &offset, &size); ctx->need_prefix = TRUE; @@ -3285,6 +3284,8 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, else { haddr_t ioffset; + /* NORMAL FILE */ + ctx->need_prefix = TRUE; h5tools_str_reset(&buffer); @@ -3299,9 +3300,18 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, ctx->need_prefix = TRUE; + /* NOTE: H5Dget_offset() is a native VOL connector optional + * API call and will not work with arbitrary VOL + * connectors. When unsupported, it will return + * HADDR_UNDEF and the numerical value of this will + * be printed. + */ h5tools_str_reset(&buffer); ioffset = H5Dget_offset(obj_id); - h5tools_str_append(&buffer, "OFFSET "H5_PRINTF_HADDR_FMT, ioffset); + if (HADDR_UNDEF == ioffset) + h5tools_str_append(&buffer, "OFFSET Undefined (HADDR_UNDEF)"); + else + h5tools_str_append(&buffer, "OFFSET "H5_PRINTF_HADDR_FMT, ioffset); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t) ncols, (hsize_t) 0, (hsize_t) 0); } ctx->indent_level--; @@ -3311,23 +3321,23 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, case H5D_VIRTUAL: { char dsetname[256]; /* virtual datset name */ - size_t vmaps; + size_t n_vmaps; - H5Pget_virtual_count(dcpl_id, &vmaps); + H5Pget_virtual_count(dcpl_id, &n_vmaps); - if (vmaps) { - size_t next; + if (n_vmaps) { + size_t curr_vmap; ssize_t H5_ATTR_NDEBUG_UNUSED ssize_out; ctx->indent_level++; - for (next = 0; next < (unsigned) vmaps; next++) { - hid_t virtual_vspace = H5Pget_virtual_vspace(dcpl_id, next); - hid_t virtual_srcspace = H5Pget_virtual_srcspace(dcpl_id, next); + for (curr_vmap = 0; curr_vmap < n_vmaps; curr_vmap++) { + hid_t virtual_vspace = H5Pget_virtual_vspace(dcpl_id, curr_vmap); + hid_t virtual_srcspace = H5Pget_virtual_srcspace(dcpl_id, curr_vmap); ctx->need_prefix = TRUE; h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "%s %ld %s ", VDS_MAPPING, next, BEGIN); + h5tools_str_append(&buffer, "%s %ld %s ", VDS_MAPPING, curr_vmap, BEGIN); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t) ncols, (hsize_t) 0, (hsize_t) 0); ctx->indent_level++; @@ -3358,14 +3368,14 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, ctx->indent_level++; - ssize_out = H5Pget_virtual_filename(dcpl_id, next, NULL, 0); + ssize_out = H5Pget_virtual_filename(dcpl_id, curr_vmap, NULL, 0); HDassert(ssize_out > 0); HDassert((size_t)ssize_out < sizeof(name)); - H5Pget_virtual_filename(dcpl_id, next, name, sizeof(name)); - ssize_out = H5Pget_virtual_dsetname(dcpl_id, next, NULL, 0); + H5Pget_virtual_filename(dcpl_id, curr_vmap, name, sizeof(name)); + ssize_out = H5Pget_virtual_dsetname(dcpl_id, curr_vmap, NULL, 0); HDassert(ssize_out > 0); HDassert((size_t)ssize_out < sizeof(name)); - H5Pget_virtual_dsetname(dcpl_id, next, dsetname, sizeof(dsetname)); + H5Pget_virtual_dsetname(dcpl_id, curr_vmap, dsetname, sizeof(dsetname)); ctx->need_prefix = TRUE; diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index 6515ecd..5c777a9 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -1101,12 +1101,12 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai { /* Object references -- show the type and OID of the referenced object. */ H5O_info2_t oi; - char *obj_addr_str = NULL; + char *obj_tok_str = NULL; H5TOOLS_DEBUG("ref_type is H5R_OBJECT1"); if((obj = H5Ropen_object(ref_vp, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { H5Oget_info3(obj, &oi, H5O_INFO_BASIC); - H5Otoken_to_str(obj, &oi.token, &obj_addr_str); + H5Otoken_to_str(obj, &oi.token, &obj_tok_str); } else H5TOOLS_ERROR(NULL, "H5Ropen_object H5R_OBJECT1 failed"); @@ -1137,13 +1137,13 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai /* Print OID */ if(info->obj_hidefileno) - h5tools_str_append(str, info->obj_format, obj_addr_str); + h5tools_str_append(str, info->obj_format, obj_tok_str); else - h5tools_str_append(str, info->obj_format, oi.fileno, obj_addr_str); + h5tools_str_append(str, info->obj_format, oi.fileno, obj_tok_str); - if(obj_addr_str) { - H5free_memory(obj_addr_str); - obj_addr_str = NULL; + if(obj_tok_str) { + H5free_memory(obj_tok_str); + obj_tok_str = NULL; } if(obj >= 0) diff --git a/tools/lib/h5tools_utils.c b/tools/lib/h5tools_utils.c index 8a7a4dd..1a1c2db 100644 --- a/tools/lib/h5tools_utils.c +++ b/tools/lib/h5tools_utils.c @@ -648,17 +648,17 @@ static void dump_table(hid_t fid, char* tablename, table_t *table) { unsigned u; - char *obj_addr_str = NULL; + char *obj_tok_str = NULL; PRINTSTREAM(rawoutstream,"%s: # of entries = %d\n", tablename,table->nobjs); for (u = 0; u < table->nobjs; u++) { - H5VLconnector_token_to_str(fid, table->objs[u].obj_token, &obj_addr_str); + H5VLconnector_token_to_str(fid, table->objs[u].obj_token, &obj_tok_str); - PRINTSTREAM(rawoutstream,"%s %s %d %d\n", obj_addr_str, + PRINTSTREAM(rawoutstream,"%s %s %d %d\n", obj_tok_str, table->objs[u].objname, table->objs[u].displayed, table->objs[u].recorded); - H5VLfree_token_str(fid, obj_addr_str); + H5VLfree_token_str(fid, obj_tok_str); } } |