summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2020-03-30 08:51:36 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2020-03-30 08:51:36 (GMT)
commit36e8e2be4bcb55dc0569a1ce502b055d3ed380f8 (patch)
tree63401e4a46d60483d257dfc84a799528f3451e34 /tools
parentf5cb547825e462c3299b6f41d03a71aa6faef950 (diff)
downloadhdf5-36e8e2be4bcb55dc0569a1ce502b055d3ed380f8.zip
hdf5-36e8e2be4bcb55dc0569a1ce502b055d3ed380f8.tar.gz
hdf5-36e8e2be4bcb55dc0569a1ce502b055d3ed380f8.tar.bz2
Misc changes for h5dump VOL changes.
Diffstat (limited to 'tools')
-rw-r--r--tools/lib/h5tools_dump.c60
-rw-r--r--tools/lib/h5tools_str.c14
-rw-r--r--tools/lib/h5tools_utils.c8
-rw-r--r--tools/src/h5ls/h5ls.c8
-rw-r--r--tools/src/h5repack/h5repack.c4
-rw-r--r--tools/testfiles/tgrpnullspace.ddl2
6 files changed, 53 insertions, 43 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);
}
}
diff --git a/tools/src/h5ls/h5ls.c b/tools/src/h5ls/h5ls.c
index 6c48d6e..a18b6c6 100644
--- a/tools/src/h5ls/h5ls.c
+++ b/tools/src/h5ls/h5ls.c
@@ -2362,7 +2362,7 @@ list_obj(const char *name, const H5O_info2_t *oinfo, const char *first_seen, voi
if (verbose_g > 0) {
size_t buf_size = 0;
char* comment = NULL;
- char* obj_addr_str = NULL;
+ char* obj_tok_str = NULL;
ssize_t cmt_bufsize = -1;
/* Display attributes */
@@ -2371,14 +2371,14 @@ list_obj(const char *name, const H5O_info2_t *oinfo, const char *first_seen, voi
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);
+ H5Otoken_to_str(obj, &oinfo->token, &obj_tok_str);
h5tools_str_reset(&buffer);
- h5tools_str_append(&buffer, " %-10s %lu:%s\n", "Location:", oinfo->fileno, obj_addr_str);
+ h5tools_str_append(&buffer, " %-10s %lu:%s\n", "Location:", oinfo->fileno, obj_tok_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);
+ H5free_memory(obj_tok_str);
/* Modification time */
if (oinfo->mtime > 0) {
diff --git a/tools/src/h5repack/h5repack.c b/tools/src/h5repack/h5repack.c
index 081bdcd..b2cb02b 100644
--- a/tools/src/h5repack/h5repack.c
+++ b/tools/src/h5repack/h5repack.c
@@ -259,7 +259,7 @@ copy_named_datatype(hid_t type_in, hid_t fidout, named_dt_t **named_dt_head_p, t
dt->next = *named_dt_head_p;
*named_dt_head_p = dt;
- /* Update the address and id */
+ /* Update the token/address and id */
HDmemcpy(&dt->obj_token, &travt->objs[i].obj_token, sizeof(H5O_token_t));
dt->id_out = H5I_INVALID_HID;
@@ -282,7 +282,7 @@ copy_named_datatype(hid_t type_in, hid_t fidout, named_dt_t **named_dt_head_p, t
dt_ret->next = *named_dt_head_p;
*named_dt_head_p = dt_ret;
- /* Update the address and id */
+ /* Update the token/address and id */
HDmemcpy(&dt_ret->obj_token, &oinfo.token, sizeof(H5O_token_t));
dt_ret->id_out = H5I_INVALID_HID;
} /* end if requested datatype not found */
diff --git a/tools/testfiles/tgrpnullspace.ddl b/tools/testfiles/tgrpnullspace.ddl
index 2b91527..df4b2cc 100644
--- a/tools/testfiles/tgrpnullspace.ddl
+++ b/tools/testfiles/tgrpnullspace.ddl
@@ -13,7 +13,7 @@ GROUP "/" {
STORAGE_LAYOUT {
CONTIGUOUS
SIZE 0
- OFFSET 18446744073709551615
+ OFFSET Undefined (HADDR_UNDEF)
}
FILTERS {
NONE