summaryrefslogtreecommitdiffstats
path: root/tools/src/h5ls
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2020-01-16 21:29:34 (GMT)
committerDavid Young <dyoung@hdfgroup.org>2020-05-20 14:31:50 (GMT)
commit3e6a192e9cef92ee1e0cf1842d05995da83efd27 (patch)
tree3cd0e18b9a50af6fc00a30a7da24d016b07efbb7 /tools/src/h5ls
parent335fc0096c4287c1121c45c85085e67e5735c47d (diff)
downloadhdf5-3e6a192e9cef92ee1e0cf1842d05995da83efd27.zip
hdf5-3e6a192e9cef92ee1e0cf1842d05995da83efd27.tar.gz
hdf5-3e6a192e9cef92ee1e0cf1842d05995da83efd27.tar.bz2
Squashed commit of the token_refactoring branch:
Diffstat (limited to 'tools/src/h5ls')
-rw-r--r--tools/src/h5ls/h5ls.c33
1 files changed, 22 insertions, 11 deletions
diff --git a/tools/src/h5ls/h5ls.c b/tools/src/h5ls/h5ls.c
index 1a49f40..f54e2f3 100644
--- a/tools/src/h5ls/h5ls.c
+++ b/tools/src/h5ls/h5ls.c
@@ -1262,11 +1262,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_info2(type, &oi, H5O_INFO_BASIC) >= 0)
- h5tools_str_append(buffer,"shared-%lu:%" PRIuHADDR " ",
- oi.fileno, oi.addr);
+ if (H5Oget_info3(type, &oi, H5O_INFO_BASIC) >= 0) {
+ char *type_string = NULL;
+
+ H5Otoken_to_str(type, &oi.token, &type_string);
+
+ 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 */
@@ -2289,7 +2295,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;
@@ -2360,6 +2366,7 @@ 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 */
@@ -2368,11 +2375,15 @@ list_obj(const char *name, const H5O_info_t *oinfo, const char *first_seen, void
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:%" PRIuHADDR "\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];
@@ -2447,7 +2458,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;
@@ -2633,7 +2644,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 */
@@ -2645,7 +2656,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;
@@ -3305,7 +3316,7 @@ 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;
@@ -3390,7 +3401,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_id, 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 */