diff options
Diffstat (limited to 'tools/src/h5dump/h5dump_ddl.c')
-rw-r--r-- | tools/src/h5dump/h5dump_ddl.c | 128 |
1 files changed, 64 insertions, 64 deletions
diff --git a/tools/src/h5dump/h5dump_ddl.c b/tools/src/h5dump/h5dump_ddl.c index 0c4e105..3b72faa 100644 --- a/tools/src/h5dump/h5dump_ddl.c +++ b/tools/src/h5dump/h5dump_ddl.c @@ -187,15 +187,15 @@ dump_all_cb(hid_t group, const char *name, const H5L_info2_t *linfo, void H5_ATT outputformat = &string_dataformat; /* Build the object's path name */ - obj_path = (char *)malloc(HDstrlen(prefix) + HDstrlen(name) + 2); + obj_path = (char *)malloc(strlen(prefix) + strlen(name) + 2); if (!obj_path) { ret = FAIL; goto done; } - HDstrcpy(obj_path, prefix); - HDstrcat(obj_path, "/"); - HDstrcat(obj_path, name); + strcpy(obj_path, prefix); + strcat(obj_path, "/"); + strcat(obj_path, name); if (linfo->type == H5L_TYPE_HARD) { H5O_info2_t oinfo; @@ -219,7 +219,7 @@ dump_all_cb(hid_t group, const char *name, const H5L_info2_t *linfo, void H5_ATT char *old_prefix; /* Pointer to previous prefix */ /* Keep copy of prefix before iterating into group */ - old_prefix = HDstrdup(prefix); + old_prefix = strdup(prefix); if (old_prefix) { /* Append group name to prefix */ add_prefix(&prefix, &prefix_len, name); @@ -228,7 +228,7 @@ dump_all_cb(hid_t group, const char *name, const H5L_info2_t *linfo, void H5_ATT dump_function_table->dump_group_function(obj, name); /* Restore old prefix name */ - HDstrcpy(prefix, old_prefix); + strcpy(prefix, old_prefix); free(old_prefix); } else @@ -278,13 +278,13 @@ dump_all_cb(hid_t group, const char *name, const H5L_info2_t *linfo, void H5_ATT /* Render the element */ h5tools_str_reset(&buffer); - if (HDstrlen(h5tools_dump_header_format->datasetblockend)) { + if (strlen(h5tools_dump_header_format->datasetblockend)) { h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datasetblockend); - if (HDstrlen(h5tools_dump_header_format->datasetend)) + if (strlen(h5tools_dump_header_format->datasetend)) h5tools_str_append(&buffer, " "); } - if (HDstrlen(h5tools_dump_header_format->datasetend)) + if (strlen(h5tools_dump_header_format->datasetend)) h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datasetend); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); @@ -325,13 +325,13 @@ dump_all_cb(hid_t group, const char *name, const H5L_info2_t *linfo, void H5_ATT /* Render the element */ h5tools_str_reset(&buffer); - if (HDstrlen(h5tools_dump_header_format->datasetblockend)) { + if (strlen(h5tools_dump_header_format->datasetblockend)) { h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datasetblockend); - if (HDstrlen(h5tools_dump_header_format->datasetend)) + if (strlen(h5tools_dump_header_format->datasetend)) h5tools_str_append(&buffer, " "); } - if (HDstrlen(h5tools_dump_header_format->datasetend)) + if (strlen(h5tools_dump_header_format->datasetend)) h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datasetend); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); @@ -426,12 +426,12 @@ dump_all_cb(hid_t group, const char *name, const H5L_info2_t *linfo, void H5_ATT /* Render the element */ h5tools_str_reset(&buffer); - if (HDstrlen(h5tools_dump_header_format->softlinkblockend)) { + if (strlen(h5tools_dump_header_format->softlinkblockend)) { h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->softlinkblockend); - if (HDstrlen(h5tools_dump_header_format->softlinkend)) + if (strlen(h5tools_dump_header_format->softlinkend)) h5tools_str_append(&buffer, " "); } - if (HDstrlen(h5tools_dump_header_format->softlinkend)) + if (strlen(h5tools_dump_header_format->softlinkend)) h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->softlinkend); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); @@ -500,12 +500,12 @@ dump_all_cb(hid_t group, const char *name, const H5L_info2_t *linfo, void H5_ATT /* Render the element */ h5tools_str_reset(&buffer); - if (HDstrlen(h5tools_dump_header_format->extlinkblockend)) { + if (strlen(h5tools_dump_header_format->extlinkblockend)) { h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->extlinkblockend); - if (HDstrlen(h5tools_dump_header_format->extlinkend)) + if (strlen(h5tools_dump_header_format->extlinkend)) h5tools_str_append(&buffer, " "); } - if (HDstrlen(h5tools_dump_header_format->extlinkend)) + if (strlen(h5tools_dump_header_format->extlinkend)) h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->extlinkend); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); @@ -541,12 +541,12 @@ dump_all_cb(hid_t group, const char *name, const H5L_info2_t *linfo, void H5_ATT ctx.need_prefix = true; /* Render the element */ h5tools_str_reset(&buffer); - if (HDstrlen(h5tools_dump_header_format->udlinkblockend)) { + if (strlen(h5tools_dump_header_format->udlinkblockend)) { h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->udlinkblockend); - if (HDstrlen(h5tools_dump_header_format->udlinkend)) + if (strlen(h5tools_dump_header_format->udlinkend)) h5tools_str_append(&buffer, " "); } - if (HDstrlen(h5tools_dump_header_format->udlinkend)) + if (strlen(h5tools_dump_header_format->udlinkend)) h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->udlinkend); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); @@ -730,12 +730,12 @@ dump_named_datatype(hid_t tid, const char *name) done: /* Render the element */ h5tools_str_reset(&buffer); - if (HDstrlen(h5tools_dump_header_format->datatypeblockend)) { + if (strlen(h5tools_dump_header_format->datatypeblockend)) { h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datatypeblockend); - if (HDstrlen(h5tools_dump_header_format->datatypeend)) + if (strlen(h5tools_dump_header_format->datatypeend)) h5tools_str_append(&buffer, " "); } - if (HDstrlen(h5tools_dump_header_format->datatypeend)) + if (strlen(h5tools_dump_header_format->datatypeend)) h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datatypeend); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); @@ -825,7 +825,7 @@ dump_group(hid_t gid, const char *name) ctx.indent_level++; dump_indent += COL; - if (!HDstrcmp(name, "/") && unamedtype) { + if (!strcmp(name, "/") && unamedtype) { unsigned u; /* Local index variable */ /* dump unnamed type in root group */ @@ -837,7 +837,7 @@ dump_group(hid_t gid, const char *name) type = H5Dget_type(dset); H5Otoken_to_str(dset, &type_table->objs[u].obj_token, &obj_tok_str); - HDsnprintf(type_name, sizeof(type_name), "#%s", obj_tok_str); + snprintf(type_name, sizeof(type_name), "#%s", obj_tok_str); H5free_memory(obj_tok_str); dump_function_table->dump_named_datatype_function(type, type_name); @@ -885,12 +885,12 @@ dump_group(hid_t gid, const char *name) /* Render the element */ h5tools_str_reset(&buffer); - if (HDstrlen(h5tools_dump_header_format->groupblockend)) { + if (strlen(h5tools_dump_header_format->groupblockend)) { h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->groupblockend); - if (HDstrlen(h5tools_dump_header_format->groupend)) + if (strlen(h5tools_dump_header_format->groupend)) h5tools_str_append(&buffer, " "); } - if (HDstrlen(h5tools_dump_header_format->groupend)) + if (strlen(h5tools_dump_header_format->groupend)) h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->groupend); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); @@ -1063,12 +1063,12 @@ dump_dataset(hid_t did, const char *name, struct subset_t *sset) /* Render the element */ h5tools_str_reset(&buffer); - if (HDstrlen(h5tools_dump_header_format->datasetblockend)) { + if (strlen(h5tools_dump_header_format->datasetblockend)) { h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datasetblockend); - if (HDstrlen(h5tools_dump_header_format->datasetend)) + if (strlen(h5tools_dump_header_format->datasetend)) h5tools_str_append(&buffer, " "); } - if (HDstrlen(h5tools_dump_header_format->datasetend)) + if (strlen(h5tools_dump_header_format->datasetend)) h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datasetend); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); @@ -1202,25 +1202,25 @@ dump_fcpl(hid_t fid) #ifdef SHOW_FILE_DRIVER if (H5FD_CORE == fdriver) - HDstrcpy(dname, "H5FD_CORE"); + strcpy(dname, "H5FD_CORE"); #ifdef H5_HAVE_DIRECT else if (H5FD_DIRECT == fdriver) - HDstrcpy(dname, "H5FD_DIRECT"); + strcpy(dname, "H5FD_DIRECT"); #endif else if (H5FD_FAMILY == fdriver) - HDstrcpy(dname, "H5FD_FAMILY"); + strcpy(dname, "H5FD_FAMILY"); else if (H5FD_LOG == fdriver) - HDstrcpy(dname, "H5FD_LOG"); + strcpy(dname, "H5FD_LOG"); else if (H5FD_MPIO == fdriver) - HDstrcpy(dname, "H5FD_MPIO"); + strcpy(dname, "H5FD_MPIO"); else if (H5FD_MULTI == fdriver) - HDstrcpy(dname, "H5FD_MULTI"); + strcpy(dname, "H5FD_MULTI"); else if (H5FD_SEC2 == fdriver) - HDstrcpy(dname, "H5FD_SEC2"); + strcpy(dname, "H5FD_SEC2"); else if (H5FD_STDIO == fdriver) - HDstrcpy(dname, "H5FD_STDIO"); + strcpy(dname, "H5FD_STDIO"); else - HDstrcpy(dname, "Unknown driver"); + strcpy(dname, "Unknown driver"); /* Take out this because the driver used can be different from the * standard output. */ @@ -1311,7 +1311,7 @@ attr_search(hid_t oid, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *a const char *buf = attr_data->path; const char *op_name = attr_data->op_name; - j = (int)HDstrlen(op_name) - 1; + j = (int)strlen(op_name) - 1; /* find the last / */ while (j >= 0) { if (op_name[j] == '/' && (j == 0 || (op_name[j - 1] != '\\'))) @@ -1326,12 +1326,12 @@ attr_search(hid_t oid, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *a ret = FAIL; } else { - if (HDstrcmp(attr_name, obj_op_name) == 0) { + if (strcmp(attr_name, obj_op_name) == 0) { size_t u, v, w; /* object name */ - u = HDstrlen(buf); - v = HDstrlen(op_name); + u = strlen(buf); + v = strlen(op_name); w = u + 1 + v + 1 + 2; obj_name = (char *)malloc(w); if (obj_name == NULL) { @@ -1343,16 +1343,16 @@ attr_search(hid_t oid, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *a memset(obj_name, '\0', w); if (op_name[0] != '/') { - HDstrncat(obj_name, buf, buffer_space); + strncat(obj_name, buf, buffer_space); buffer_space -= MIN(buffer_space, u); if (buf[u - 1] != '/') { - HDstrncat(obj_name, "/", buffer_space); + strncat(obj_name, "/", buffer_space); buffer_space -= MIN(buffer_space, 2); } } - HDstrncat(obj_name, op_name, buffer_space); + strncat(obj_name, op_name, buffer_space); buffer_space -= MIN(buffer_space, v); handle_attributes(oid, obj_name, NULL, 0, NULL); @@ -1377,7 +1377,7 @@ obj_search(const char *path, const H5O_info2_t *oi, const char H5_ATTR_UNUSED *a H5Aiterate_by_name(handle_data->fid, path, H5_INDEX_NAME, H5_ITER_INC, NULL, attr_search, (void *)&attr_data, H5P_DEFAULT); - if (HDstrcmp(path, op_name) == 0) { + if (strcmp(path, op_name) == 0) { switch (oi->type) { case H5O_TYPE_GROUP: handle_groups(handle_data->fid, path, NULL, 0, NULL); @@ -1412,7 +1412,7 @@ lnk_search(const char *path, const H5L_info2_t *li, void *_op_data) trav_handle_udata_t *handle_data = (trav_handle_udata_t *)_op_data; const char *op_name = handle_data->op_name; - search_len = HDstrlen(op_name); + search_len = strlen(op_name); if (search_len > 0 && op_name[0] != '/') k = 2; else @@ -1424,14 +1424,14 @@ lnk_search(const char *path, const H5L_info2_t *li, void *_op_data) } else { if (k == 2) { - HDstrcpy(search_name, "/"); - HDstrcat(search_name, op_name); + strcpy(search_name, "/"); + strcat(search_name, op_name); } else - HDstrcpy(search_name, op_name); + strcpy(search_name, op_name); search_name[search_len + k - 1] = '\0'; - if (HDstrcmp(path, search_name) == 0) { + if (strcmp(path, search_name) == 0) { switch (li->type) { case H5L_TYPE_SOFT: case H5L_TYPE_EXTERNAL: @@ -1530,7 +1530,7 @@ handle_attributes(hid_t fid, const char *attr, void H5_ATTR_UNUSED *data, int H5 h5tool_format_t string_dataformat; hsize_t curr_pos = 0; /* total data element position */ - j = (int)HDstrlen(attr) - 1; + j = (int)strlen(attr) - 1; obj_name = (char *)malloc((size_t)j + 2); if (obj_name == NULL) goto error; @@ -1544,9 +1544,9 @@ handle_attributes(hid_t fid, const char *attr, void H5_ATTR_UNUSED *data, int H5 /* object name */ if (j == -1) - HDstrcpy(obj_name, "/"); + strcpy(obj_name, "/"); else { - HDstrncpy(obj_name, attr, (size_t)j + 1); + strncpy(obj_name, attr, (size_t)j + 1); obj_name[j + 1] = '\0'; } /* end else */ @@ -1595,12 +1595,12 @@ handle_attributes(hid_t fid, const char *attr, void H5_ATTR_UNUSED *data, int H5 ctx.need_prefix = true; /* Render the element */ h5tools_str_reset(&buffer); - if (HDstrlen(h5tools_dump_header_format->attributeblockend)) { + if (strlen(h5tools_dump_header_format->attributeblockend)) { h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->attributeblockend); - if (HDstrlen(h5tools_dump_header_format->attributeend)) + if (strlen(h5tools_dump_header_format->attributeend)) h5tools_str_append(&buffer, " "); } - if (HDstrlen(h5tools_dump_header_format->attributeend)) + if (strlen(h5tools_dump_header_format->attributeend)) h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->attributeend); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); @@ -1849,14 +1849,14 @@ handle_groups(hid_t fid, const char *group, void H5_ATTR_UNUSED *data, int pe, c } } else { - size_t new_len = HDstrlen(group) + 1; + size_t new_len = strlen(group) + 1; if (prefix_len <= new_len) { prefix_len = new_len; prefix = (char *)realloc(prefix, prefix_len); } /* end if */ - HDstrcpy(prefix, group); + strcpy(prefix, group); dump_indent += COL; dump_group(gid, real_name); @@ -1978,10 +1978,10 @@ handle_datatypes(hid_t fid, const char *type, void H5_ATTR_UNUSED *data, int pe, /* unnamed datatype */ H5Otoken_to_str(fid, &type_table->objs[idx].obj_token, &obj_tok_str); - HDsnprintf(name, sizeof(name), "/#%s", obj_tok_str); + snprintf(name, sizeof(name), "/#%s", obj_tok_str); H5free_memory(obj_tok_str); - if (!HDstrcmp(name, real_name)) + if (!strcmp(name, real_name)) break; } /* end if */ |