From b2ec30bfe350f37fcd69d97f8a7cdd7367d06b6a Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 24 Feb 2012 08:29:03 -0500 Subject: [svn-r21978] undo HD prefix --- tools/h5stat/h5stat_gentest.c | 50 +++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/tools/h5stat/h5stat_gentest.c b/tools/h5stat/h5stat_gentest.c index 7384963..e333128 100644 --- a/tools/h5stat/h5stat_gentest.c +++ b/tools/h5stat/h5stat_gentest.c @@ -26,12 +26,12 @@ #include #include "hdf5.h" -#define FILE "h5stat_newgrat.h5" -#define DATASET_NAME "DATASET_NAME" -#define GROUP_NAME "GROUP" -#define ATTR_NAME "ATTR" -#define NUM_GRPS 35000 -#define NUM_ATTRS 100 +#define FILE "h5stat_newgrat.h5" +#define DATASET_NAME "DATASET_NAME" +#define GROUP_NAME "GROUP" +#define ATTR_NAME "ATTR" +#define NUM_GRPS 35000 +#define NUM_ATTRS 100 /* * Generate 1.8 HDF5 file @@ -40,27 +40,27 @@ */ static void gen_file(void) { - hid_t fcpl; /* File creation property */ - hid_t fapl; /* File access property */ - hid_t file; /* File id */ - hid_t gid; /* Group id */ - hid_t type_id; /* Datatype id */ - hid_t space_id; /* Dataspace id */ - hid_t attr_id; /* Attribute id */ - hid_t dset_id; /* Dataset id */ - char name[30]; /* Group name */ - char attrname[30]; /* Attribute name */ - int ret; /* Return value */ - int i; /* Local index variable */ + hid_t fcpl; /* File creation property */ + hid_t fapl; /* File access property */ + hid_t file; /* File id */ + hid_t gid; /* Group id */ + hid_t type_id; /* Datatype id */ + hid_t space_id; /* Dataspace id */ + hid_t attr_id; /* Attribute id */ + hid_t dset_id; /* Dataset id */ + char name[30]; /* Group name */ + char attrname[30]; /* Attribute name */ + int ret; /* Return value */ + int i; /* Local index variable */ fapl = H5Pcreate(H5P_FILE_ACCESS); ret = H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST); - HDassert(ret >= 0); + assert(ret >= 0); /* Set file space handling strategy */ fcpl = H5Pcreate(H5P_FILE_CREATE); ret = H5Pset_file_space(fcpl, H5F_FILE_SPACE_ALL_PERSIST, (hsize_t)0); - HDassert(ret >= 0); + assert(ret >= 0); /* Create dataset */ file = H5Fcreate(FILE, H5F_ACC_TRUNC, fcpl, fapl); @@ -82,17 +82,17 @@ static void gen_file(void) sprintf(attrname, "%s%d", ATTR_NAME,i); attr_id = H5Acreate2(dset_id, attrname, type_id, space_id, H5P_DEFAULT, H5P_DEFAULT); ret = H5Aclose(attr_id); - HDassert(ret >= 0); + assert(ret >= 0); } /* end for */ ret = H5Dclose(dset_id); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Sclose(space_id); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(type_id); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Fclose(file); - HDassert(ret >= 0); + assert(ret >= 0); } int main(void) -- cgit v0.12 From 944f2cdf8d7f3d665ac9e72fe2267826e8abb047 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 24 Feb 2012 09:27:57 -0500 Subject: [svn-r21979] Correct HD prefix in tools for strlen and memcpy Checked for HD support. --- tools/h5diff/h5diff_common.c | 6 +- tools/h5dump/h5dump_ddl.c | 54 ++++---- tools/h5dump/h5dump_xml.c | 64 +++++----- tools/h5dump/h5dumpgentest.c | 4 +- tools/h5repack/h5repack_parse.c | 4 +- tools/lib/h5diff.c | 6 +- tools/lib/h5diff_array.c | 272 ++++++++++++++++++++-------------------- tools/lib/h5diff_util.c | 2 +- tools/lib/h5tools_str.c | 2 +- 9 files changed, 207 insertions(+), 207 deletions(-) diff --git a/tools/h5diff/h5diff_common.c b/tools/h5diff/h5diff_common.c index f7532f2..35c3956 100644 --- a/tools/h5diff/h5diff_common.c +++ b/tools/h5diff/h5diff_common.c @@ -355,7 +355,7 @@ check_n_input( const char *str ) unsigned i; char c; - for ( i = 0; i < strlen(str); i++) + for ( i = 0; i < HDstrlen(str); i++) { c = str[i]; if ( i==0 ) @@ -394,7 +394,7 @@ check_p_input( const char *str ) the atof return value on a hexadecimal input is different on some systems; we do a character check for this */ - if (strlen(str)>2 && str[0]=='0' && str[1]=='x') + if (HDstrlen(str)>2 && str[0]=='0' && str[1]=='x') return -1; x=atof(str); @@ -428,7 +428,7 @@ check_d_input( const char *str ) the atof return value on a hexadecimal input is different on some systems; we do a character check for this */ - if (strlen(str)>2 && str[0]=='0' && str[1]=='x') + if (HDstrlen(str)>2 && str[0]=='0' && str[1]=='x') return -1; x=atof(str); diff --git a/tools/h5dump/h5dump_ddl.c b/tools/h5dump/h5dump_ddl.c index c9e5571..f53a9d2 100644 --- a/tools/h5dump/h5dump_ddl.c +++ b/tools/h5dump/h5dump_ddl.c @@ -280,12 +280,12 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNUSED /* Render the element */ h5tools_str_reset(&buffer); - if(strlen(h5tools_dump_header_format->datasetblockend)) { + if(HDstrlen(h5tools_dump_header_format->datasetblockend)) { h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datasetblockend); - if(strlen(h5tools_dump_header_format->datasetend)) + if(HDstrlen(h5tools_dump_header_format->datasetend)) h5tools_str_append(&buffer, " "); } - if(strlen(h5tools_dump_header_format->datasetend)) + if(HDstrlen(h5tools_dump_header_format->datasetend)) h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datasetend); h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); @@ -323,12 +323,12 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNUSED /* Render the element */ h5tools_str_reset(&buffer); - if(strlen(h5tools_dump_header_format->datasetblockend)) { + if(HDstrlen(h5tools_dump_header_format->datasetblockend)) { h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datasetblockend); - if(strlen(h5tools_dump_header_format->datasetend)) + if(HDstrlen(h5tools_dump_header_format->datasetend)) h5tools_str_append(&buffer, " "); } - if(strlen(h5tools_dump_header_format->datasetend)) + if(HDstrlen(h5tools_dump_header_format->datasetend)) h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datasetend); h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); @@ -411,12 +411,12 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNUSED /* Render the element */ h5tools_str_reset(&buffer); - if(strlen(h5tools_dump_header_format->softlinkblockend)) { + if(HDstrlen(h5tools_dump_header_format->softlinkblockend)) { h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->softlinkblockend); - if(strlen(h5tools_dump_header_format->softlinkend)) + if(HDstrlen(h5tools_dump_header_format->softlinkend)) h5tools_str_append(&buffer, " "); } - if(strlen(h5tools_dump_header_format->softlinkend)) + if(HDstrlen(h5tools_dump_header_format->softlinkend)) h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->softlinkend); h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); @@ -482,12 +482,12 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNUSED /* Render the element */ h5tools_str_reset(&buffer); - if(strlen(h5tools_dump_header_format->extlinkblockend)) { + if(HDstrlen(h5tools_dump_header_format->extlinkblockend)) { h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->extlinkblockend); - if(strlen(h5tools_dump_header_format->extlinkend)) + if(HDstrlen(h5tools_dump_header_format->extlinkend)) h5tools_str_append(&buffer, " "); } - if(strlen(h5tools_dump_header_format->extlinkend)) + if(HDstrlen(h5tools_dump_header_format->extlinkend)) h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->extlinkend); h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); @@ -520,12 +520,12 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNUSED h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); - if(strlen(h5tools_dump_header_format->udlinkblockend)) { + if(HDstrlen(h5tools_dump_header_format->udlinkblockend)) { h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->udlinkblockend); - if(strlen(h5tools_dump_header_format->udlinkend)) + if(HDstrlen(h5tools_dump_header_format->udlinkend)) h5tools_str_append(&buffer, " "); } - if(strlen(h5tools_dump_header_format->udlinkend)) + if(HDstrlen(h5tools_dump_header_format->udlinkend)) h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->udlinkend); h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); @@ -680,12 +680,12 @@ dump_named_datatype(hid_t tid, const char *name) done: /* Render the element */ h5tools_str_reset(&buffer); - if(strlen(h5tools_dump_header_format->datatypeblockend)) { + if(HDstrlen(h5tools_dump_header_format->datatypeblockend)) { h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datatypeblockend); - if(strlen(h5tools_dump_header_format->datatypeend)) + if(HDstrlen(h5tools_dump_header_format->datatypeend)) h5tools_str_append(&buffer, " "); } - if(strlen(h5tools_dump_header_format->datatypeend)) + if(HDstrlen(h5tools_dump_header_format->datatypeend)) h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datatypeend); h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); @@ -886,12 +886,12 @@ dump_group(hid_t gid, const char *name) /* Render the element */ h5tools_str_reset(&buffer); - if(strlen(h5tools_dump_header_format->groupblockend)) { + if(HDstrlen(h5tools_dump_header_format->groupblockend)) { h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->groupblockend); - if(strlen(h5tools_dump_header_format->groupend)) + if(HDstrlen(h5tools_dump_header_format->groupend)) h5tools_str_append(&buffer, " "); } - if(strlen(h5tools_dump_header_format->groupend)) + if(HDstrlen(h5tools_dump_header_format->groupend)) h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->groupend); h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); @@ -1073,12 +1073,12 @@ dump_dataset(hid_t did, const char *name, struct subset_t *sset) /* Render the element */ h5tools_str_reset(&buffer); - if(strlen(h5tools_dump_header_format->datasetblockend)) { + if(HDstrlen(h5tools_dump_header_format->datasetblockend)) { h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datasetblockend); - if(strlen(h5tools_dump_header_format->datasetend)) + if(HDstrlen(h5tools_dump_header_format->datasetend)) h5tools_str_append(&buffer, " "); } - if(strlen(h5tools_dump_header_format->datasetend)) + if(HDstrlen(h5tools_dump_header_format->datasetend)) h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datasetend); h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); @@ -1395,12 +1395,12 @@ handle_attributes(hid_t fid, const char *attr, void UNUSED * data, int UNUSED pe h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); - if(strlen(h5tools_dump_header_format->attributeblockend)) { + if(HDstrlen(h5tools_dump_header_format->attributeblockend)) { h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->attributeblockend); - if(strlen(h5tools_dump_header_format->attributeend)) + if(HDstrlen(h5tools_dump_header_format->attributeend)) h5tools_str_append(&buffer, " "); } - if(strlen(h5tools_dump_header_format->attributeend)) + if(HDstrlen(h5tools_dump_header_format->attributeend)) h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->attributeend); h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); diff --git a/tools/h5dump/h5dump_xml.c b/tools/h5dump/h5dump_xml.c index 5b6cba1..934682c 100644 --- a/tools/h5dump/h5dump_xml.c +++ b/tools/h5dump/h5dump_xml.c @@ -172,12 +172,12 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNU /* Render the element */ h5tools_str_reset(&buffer); - if(strlen(h5tools_dump_header_format->datasetblockend)) { + if(HDstrlen(h5tools_dump_header_format->datasetblockend)) { h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datasetblockend); - if(strlen(h5tools_dump_header_format->datasetend)) + if(HDstrlen(h5tools_dump_header_format->datasetend)) h5tools_str_append(&buffer, " "); } - if(strlen(h5tools_dump_header_format->datasetend)) + if(HDstrlen(h5tools_dump_header_format->datasetend)) h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datasetend); h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); @@ -567,24 +567,24 @@ xml_escape_the_name(const char *str) return NULL; cp = str; - len = strlen(str); + len = HDstrlen(str); extra = 0; for (i = 0; i < len; i++) { if (*cp == '\"') { - extra += (strlen(quote) - 1); + extra += (HDstrlen(quote) - 1); } else if (*cp == '\'') { - extra += (strlen(apos) - 1); + extra += (HDstrlen(apos) - 1); } else if (*cp == '<') { - extra += (strlen(lt) - 1); + extra += (HDstrlen(lt) - 1); } else if (*cp == '>') { - extra += (strlen(gt) - 1); + extra += (HDstrlen(gt) - 1); } else if (*cp == '&') { - extra += (strlen(amp) - 1); + extra += (HDstrlen(amp) - 1); } cp++; @@ -601,28 +601,28 @@ xml_escape_the_name(const char *str) for (i = 0; i < len; i++) { if (*cp == '\'') { - strncpy(ncp, apos, strlen(apos)); - ncp += strlen(apos); + strncpy(ncp, apos, HDstrlen(apos)); + ncp += HDstrlen(apos); cp++; } else if (*cp == '<') { - strncpy(ncp, lt, strlen(lt)); - ncp += strlen(lt); + strncpy(ncp, lt, HDstrlen(lt)); + ncp += HDstrlen(lt); cp++; } else if (*cp == '>') { - strncpy(ncp, gt, strlen(gt)); - ncp += strlen(gt); + strncpy(ncp, gt, HDstrlen(gt)); + ncp += HDstrlen(gt); cp++; } else if (*cp == '\"') { - strncpy(ncp, quote, strlen(quote)); - ncp += strlen(quote); + strncpy(ncp, quote, HDstrlen(quote)); + ncp += HDstrlen(quote); cp++; } else if (*cp == '&') { - strncpy(ncp, amp, strlen(amp)); - ncp += strlen(amp); + strncpy(ncp, amp, HDstrlen(amp)); + ncp += HDstrlen(amp); cp++; } else { @@ -664,7 +664,7 @@ xml_escape_the_string(const char *str, int slen) cp = str; if (slen < 0) - len = strlen(str); + len = HDstrlen(str); else len = slen; @@ -678,16 +678,16 @@ xml_escape_the_string(const char *str, int slen) extra++; } else if (*cp == '\'') { - extra += (strlen(apos) - 1); + extra += (HDstrlen(apos) - 1); } else if (*cp == '<') { - extra += (strlen(lt) - 1); + extra += (HDstrlen(lt) - 1); } else if (*cp == '>') { - extra += (strlen(gt) - 1); + extra += (HDstrlen(gt) - 1); } else if (*cp == '&') { - extra += (strlen(amp) - 1); + extra += (HDstrlen(amp) - 1); } cp++; } @@ -708,23 +708,23 @@ xml_escape_the_string(const char *str, int slen) *ncp++ = *cp++; } else if (*cp == '\'') { - strncpy(ncp, apos, strlen(apos)); - ncp += strlen(apos); + strncpy(ncp, apos, HDstrlen(apos)); + ncp += HDstrlen(apos); cp++; } else if (*cp == '<') { - strncpy(ncp, lt, strlen(lt)); - ncp += strlen(lt); + strncpy(ncp, lt, HDstrlen(lt)); + ncp += HDstrlen(lt); cp++; } else if (*cp == '>') { - strncpy(ncp, gt, strlen(gt)); - ncp += strlen(gt); + strncpy(ncp, gt, HDstrlen(gt)); + ncp += HDstrlen(gt); cp++; } else if (*cp == '&') { - strncpy(ncp, amp, strlen(amp)); - ncp += strlen(amp); + strncpy(ncp, amp, HDstrlen(amp)); + ncp += HDstrlen(amp); cp++; } else { diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c index f87f93a..5b97434 100644 --- a/tools/h5dump/h5dumpgentest.c +++ b/tools/h5dump/h5dumpgentest.c @@ -3528,7 +3528,7 @@ void gent_split_file(void) root = H5Gopen2(fid, "/", H5P_DEFAULT); atype = H5Tcopy(H5T_C_S1); - H5Tset_size(atype, strlen(meta) + 1); + H5Tset_size(atype, HDstrlen(meta) + 1); H5Tset_strpad(atype, H5T_STR_NULLTERM); dims[0] = 1; @@ -3729,7 +3729,7 @@ static void gent_char(void) hid_t sid1; /* Dataspace ID */ hsize_t dims1[1]; - dims1[0] = strlen(wdata); + dims1[0] = HDstrlen(wdata); /* Create file */ fid1 = H5Fcreate(FILE39, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); diff --git a/tools/h5repack/h5repack_parse.c b/tools/h5repack/h5repack_parse.c index 5258c4e..6fab819 100644 --- a/tools/h5repack/h5repack_parse.c +++ b/tools/h5repack/h5repack_parse.c @@ -52,7 +52,7 @@ obj_list_t* parse_filter(const char *str, { unsigned i, u; char c; - size_t len=strlen(str); + size_t len=HDstrlen(str); int j, m, n, k, l, end_obj=-1, no_param=0; char sobj[MAX_NC_NAME]; char scomp[10]; @@ -479,7 +479,7 @@ obj_list_t* parse_layout(const char *str, obj_list_t* obj_list=NULL; unsigned i; char c; - size_t len=strlen(str); + size_t len=HDstrlen(str); int j, n, k, end_obj=-1, c_index; char sobj[MAX_NC_NAME]; char sdim[10]; diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index 4ffee2b..53688d9 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -274,7 +274,7 @@ static int is_exclude_path (char * path, h5trav_type_t type, diff_opt_t *options if (exclude_path_ptr->obj_type == H5TRAV_TYPE_GROUP) { ret_cmp = HDstrncmp(exclude_path_ptr->obj_path, path, - strlen(exclude_path_ptr->obj_path)); + HDstrlen(exclude_path_ptr->obj_path)); if (ret_cmp == 0) { /* check if given path belong to an excluding group, if so @@ -1180,12 +1180,12 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, { objtype = table->objs[i].type; /* make full path for obj1 */ - obj1_fullpath = (char*)HDcalloc (strlen(grp1_path) + strlen (table->objs[i].name) + 1, sizeof (char)); + obj1_fullpath = (char*)HDcalloc (HDstrlen(grp1_path) + strlen (table->objs[i].name) + 1, sizeof (char)); HDstrcpy(obj1_fullpath, grp1_path); HDstrcat(obj1_fullpath, table->objs[i].name); /* make full path for obj2 */ - obj2_fullpath = (char*)HDcalloc (strlen(grp2_path) + strlen (table->objs[i].name) + 1, sizeof (char)); + obj2_fullpath = (char*)HDcalloc (HDstrlen(grp2_path) + strlen (table->objs[i].name) + 1, sizeof (char)); HDstrcpy(obj2_fullpath, grp2_path); HDstrcat(obj2_fullpath, table->objs[i].name); diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index 6437809..172986d 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -898,8 +898,8 @@ hsize_t diff_datum(void *_mem1, char temp1_char; char temp2_char; HDassert(type_size==sizeof(char)); - memcpy(&temp1_char, mem1, sizeof(char)); - memcpy(&temp2_char, mem2, sizeof(char)); + HDmemcpy(&temp1_char, mem1, sizeof(char)); + HDmemcpy(&temp2_char, mem2, sizeof(char)); /* -d and !-p */ if (options->d && !options->p) { @@ -995,8 +995,8 @@ hsize_t diff_datum(void *_mem1, unsigned char temp2_uchar; HDassert(type_size==sizeof(unsigned char)); - memcpy(&temp1_uchar, mem1, sizeof(unsigned char)); - memcpy(&temp2_uchar, mem2, sizeof(unsigned char)); + HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); + HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); /* -d and !-p */ if (options->d && !options->p) { @@ -1094,8 +1094,8 @@ hsize_t diff_datum(void *_mem1, short temp2_short; HDassert(type_size==sizeof(short)); - memcpy(&temp1_short, mem1, sizeof(short)); - memcpy(&temp2_short, mem2, sizeof(short)); + HDmemcpy(&temp1_short, mem1, sizeof(short)); + HDmemcpy(&temp2_short, mem2, sizeof(short)); /* -d and !-p */ if (options->d && !options->p) { @@ -1193,8 +1193,8 @@ hsize_t diff_datum(void *_mem1, unsigned short temp2_ushort; HDassert(type_size==sizeof(short)); - memcpy(&temp1_ushort, mem1, sizeof(unsigned short)); - memcpy(&temp2_ushort, mem2, sizeof(unsigned short)); + HDmemcpy(&temp1_ushort, mem1, sizeof(unsigned short)); + HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short)); /* -d and !-p */ if (options->d && !options->p) { @@ -1293,8 +1293,8 @@ hsize_t diff_datum(void *_mem1, int temp2_int; HDassert(type_size==sizeof(int)); - memcpy(&temp1_int, mem1, sizeof(int)); - memcpy(&temp2_int, mem2, sizeof(int)); + HDmemcpy(&temp1_int, mem1, sizeof(int)); + HDmemcpy(&temp2_int, mem2, sizeof(int)); /* -d and !-p */ if (options->d && !options->p) { @@ -1391,8 +1391,8 @@ hsize_t diff_datum(void *_mem1, unsigned int temp2_uint; HDassert(type_size==sizeof(int)); - memcpy(&temp1_uint, mem1, sizeof(unsigned int)); - memcpy(&temp2_uint, mem2, sizeof(unsigned int)); + HDmemcpy(&temp1_uint, mem1, sizeof(unsigned int)); + HDmemcpy(&temp2_uint, mem2, sizeof(unsigned int)); /* -d and !-p */ if (options->d && !options->p) { @@ -1489,8 +1489,8 @@ hsize_t diff_datum(void *_mem1, long temp2_long; HDassert(type_size==sizeof(long)); - memcpy(&temp1_long, mem1, sizeof(long)); - memcpy(&temp2_long, mem2, sizeof(long)); + HDmemcpy(&temp1_long, mem1, sizeof(long)); + HDmemcpy(&temp2_long, mem2, sizeof(long)); /* -d and !-p */ if (options->d && !options->p) { @@ -1589,8 +1589,8 @@ hsize_t diff_datum(void *_mem1, unsigned long temp2_ulong; HDassert(type_size==sizeof(unsigned long)); - memcpy(&temp1_ulong, mem1, sizeof(unsigned long)); - memcpy(&temp2_ulong, mem2, sizeof(unsigned long)); + HDmemcpy(&temp1_ulong, mem1, sizeof(unsigned long)); + HDmemcpy(&temp2_ulong, mem2, sizeof(unsigned long)); /* -d and !-p */ if (options->d && !options->p) { @@ -1688,8 +1688,8 @@ hsize_t diff_datum(void *_mem1, long long temp2_llong; HDassert(type_size==sizeof(long long)); - memcpy(&temp1_llong, mem1, sizeof(long long)); - memcpy(&temp2_llong, mem2, sizeof(long long)); + HDmemcpy(&temp1_llong, mem1, sizeof(long long)); + HDmemcpy(&temp2_llong, mem2, sizeof(long long)); /* -d and !-p */ if (options->d && !options->p) { @@ -1786,8 +1786,8 @@ hsize_t diff_datum(void *_mem1, unsigned long long temp2_ullong; HDassert(type_size==sizeof(unsigned long long)); - memcpy(&temp1_ullong, mem1, sizeof(unsigned long long)); - memcpy(&temp2_ullong, mem2, sizeof(unsigned long long)); + HDmemcpy(&temp1_ullong, mem1, sizeof(unsigned long long)); + HDmemcpy(&temp2_ullong, mem2, sizeof(unsigned long long)); /* -d and !-p */ if (options->d && !options->p) { @@ -1906,8 +1906,8 @@ hsize_t diff_datum(void *_mem1, HDassert(type_size==sizeof(float)); - memcpy(&temp1_float, mem1, sizeof(float)); - memcpy(&temp2_float, mem2, sizeof(float)); + HDmemcpy(&temp1_float, mem1, sizeof(float)); + HDmemcpy(&temp2_float, mem2, sizeof(float)); /* logic for detecting NaNs is different with options -d, -p and no options */ @@ -2119,8 +2119,8 @@ hsize_t diff_datum(void *_mem1, HDassert(type_size==sizeof(double)); - memcpy(&temp1_double, mem1, sizeof(double)); - memcpy(&temp2_double, mem2, sizeof(double)); + HDmemcpy(&temp1_double, mem1, sizeof(double)); + HDmemcpy(&temp2_double, mem2, sizeof(double)); /* logic for detecting NaNs is different with options -d, -p and no options */ @@ -2334,8 +2334,8 @@ hsize_t diff_datum(void *_mem1, HDassert(type_size==sizeof(long double)); - memcpy(&temp1_double, mem1, sizeof(long double)); - memcpy(&temp2_double, mem2, sizeof(long double)); + HDmemcpy(&temp1_double, mem1, sizeof(long double)); + HDmemcpy(&temp2_double, mem2, sizeof(long double)); /* logic for detecting NaNs is different with options -d, -p and no options */ @@ -2820,8 +2820,8 @@ hsize_t character_compare(unsigned char *mem1, unsigned char temp1_uchar; unsigned char temp2_uchar; - memcpy(&temp1_uchar, mem1, sizeof(unsigned char)); - memcpy(&temp2_uchar, mem2, sizeof(unsigned char)); + HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); + HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); if (temp1_uchar != temp2_uchar) { @@ -2869,8 +2869,8 @@ hsize_t character_compare_opt(unsigned char *mem1, double per; int both_zero; - memcpy(&temp1_uchar, mem1, sizeof(unsigned char)); - memcpy(&temp2_uchar, mem2, sizeof(unsigned char)); + HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); + HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); /* -d and !-p */ @@ -2975,8 +2975,8 @@ hsize_t diff_float(unsigned char *mem1, { for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_float, mem1, sizeof(float)); - memcpy(&temp2_float, mem2, sizeof(float)); + HDmemcpy(&temp1_float, mem1, sizeof(float)); + HDmemcpy(&temp2_float, mem2, sizeof(float)); /*------------------------------------------------------------------------- * detect NaNs @@ -3029,8 +3029,8 @@ hsize_t diff_float(unsigned char *mem1, { for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_float, mem1, sizeof(float)); - memcpy(&temp2_float, mem2, sizeof(float)); + HDmemcpy(&temp1_float, mem1, sizeof(float)); + HDmemcpy(&temp2_float, mem2, sizeof(float)); /*------------------------------------------------------------------------- * detect NaNs @@ -3102,8 +3102,8 @@ hsize_t diff_float(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_float, mem1, sizeof(float)); - memcpy(&temp2_float, mem2, sizeof(float)); + HDmemcpy(&temp1_float, mem1, sizeof(float)); + HDmemcpy(&temp2_float, mem2, sizeof(float)); /*------------------------------------------------------------------------- * detect NaNs @@ -3176,8 +3176,8 @@ hsize_t diff_float(unsigned char *mem1, { for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_float, mem1, sizeof(float)); - memcpy(&temp2_float, mem2, sizeof(float)); + HDmemcpy(&temp1_float, mem1, sizeof(float)); + HDmemcpy(&temp2_float, mem2, sizeof(float)); if (equal_float(temp1_float,temp2_float,options)==FALSE) { @@ -3248,8 +3248,8 @@ hsize_t diff_double(unsigned char *mem1, { for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_double, mem1, sizeof(double)); - memcpy(&temp2_double, mem2, sizeof(double)); + HDmemcpy(&temp1_double, mem1, sizeof(double)); + HDmemcpy(&temp2_double, mem2, sizeof(double)); /*------------------------------------------------------------------------- * detect NaNs @@ -3302,8 +3302,8 @@ hsize_t diff_double(unsigned char *mem1, { for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_double, mem1, sizeof(double)); - memcpy(&temp2_double, mem2, sizeof(double)); + HDmemcpy(&temp1_double, mem1, sizeof(double)); + HDmemcpy(&temp2_double, mem2, sizeof(double)); /*------------------------------------------------------------------------- * detect NaNs @@ -3375,8 +3375,8 @@ hsize_t diff_double(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_double, mem1, sizeof(double)); - memcpy(&temp2_double, mem2, sizeof(double)); + HDmemcpy(&temp1_double, mem1, sizeof(double)); + HDmemcpy(&temp2_double, mem2, sizeof(double)); /*------------------------------------------------------------------------- * detect NaNs @@ -3452,8 +3452,8 @@ hsize_t diff_double(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_double, mem1, sizeof(double)); - memcpy(&temp2_double, mem2, sizeof(double)); + HDmemcpy(&temp1_double, mem1, sizeof(double)); + HDmemcpy(&temp2_double, mem2, sizeof(double)); if (equal_double(temp1_double,temp2_double,options)==FALSE) @@ -3531,8 +3531,8 @@ hsize_t diff_ldouble(unsigned char *mem1, { for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_double, mem1, sizeof(long double)); - memcpy(&temp2_double, mem2, sizeof(long double)); + HDmemcpy(&temp1_double, mem1, sizeof(long double)); + HDmemcpy(&temp2_double, mem2, sizeof(long double)); /*------------------------------------------------------------------------- * detect NaNs @@ -3585,8 +3585,8 @@ hsize_t diff_ldouble(unsigned char *mem1, { for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_double, mem1, sizeof(long double)); - memcpy(&temp2_double, mem2, sizeof(long double)); + HDmemcpy(&temp1_double, mem1, sizeof(long double)); + HDmemcpy(&temp2_double, mem2, sizeof(long double)); /*------------------------------------------------------------------------- * detect NaNs @@ -3658,8 +3658,8 @@ hsize_t diff_ldouble(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_double, mem1, sizeof(long double)); - memcpy(&temp2_double, mem2, sizeof(long double)); + HDmemcpy(&temp1_double, mem1, sizeof(long double)); + HDmemcpy(&temp2_double, mem2, sizeof(long double)); /*------------------------------------------------------------------------- * detect NaNs @@ -3735,8 +3735,8 @@ hsize_t diff_ldouble(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_double, mem1, sizeof(long double)); - memcpy(&temp2_double, mem2, sizeof(long double)); + HDmemcpy(&temp1_double, mem1, sizeof(long double)); + HDmemcpy(&temp2_double, mem2, sizeof(long double)); if (equal_ldouble(temp1_double,temp2_double,options)==FALSE) @@ -3809,8 +3809,8 @@ hsize_t diff_schar(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_char, mem1, sizeof(char)); - memcpy(&temp2_char, mem2, sizeof(char)); + HDmemcpy(&temp1_char, mem1, sizeof(char)); + HDmemcpy(&temp2_char, mem2, sizeof(char)); if (ABS(temp1_char-temp2_char) > options->delta) { @@ -3835,8 +3835,8 @@ hsize_t diff_schar(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_char, mem1, sizeof(char)); - memcpy(&temp2_char, mem2, sizeof(char)); + HDmemcpy(&temp1_char, mem1, sizeof(char)); + HDmemcpy(&temp2_char, mem2, sizeof(char)); PER(temp1_char,temp2_char); @@ -3879,8 +3879,8 @@ hsize_t diff_schar(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_char, mem1, sizeof(char)); - memcpy(&temp2_char, mem2, sizeof(char)); + HDmemcpy(&temp1_char, mem1, sizeof(char)); + HDmemcpy(&temp2_char, mem2, sizeof(char)); PER(temp1_char,temp2_char); @@ -3922,8 +3922,8 @@ hsize_t diff_schar(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_char, mem1, sizeof(char)); - memcpy(&temp2_char, mem2, sizeof(char)); + HDmemcpy(&temp1_char, mem1, sizeof(char)); + HDmemcpy(&temp2_char, mem2, sizeof(char)); if (temp1_char != temp2_char) { @@ -3986,8 +3986,8 @@ hsize_t diff_uchar(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_uchar, mem1, sizeof(unsigned char)); - memcpy(&temp2_uchar, mem2, sizeof(unsigned char)); + HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); + HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); if ( PDIFF(temp1_uchar,temp2_uchar) > options->delta) { @@ -4013,8 +4013,8 @@ hsize_t diff_uchar(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_uchar, mem1, sizeof(unsigned char)); - memcpy(&temp2_uchar, mem2, sizeof(unsigned char)); + HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); + HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); PER_UNSIGN(signed char,temp1_uchar,temp2_uchar); @@ -4057,8 +4057,8 @@ hsize_t diff_uchar(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_uchar, mem1, sizeof(unsigned char)); - memcpy(&temp2_uchar, mem2, sizeof(unsigned char)); + HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); + HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); PER_UNSIGN(signed char,temp1_uchar,temp2_uchar); @@ -4100,8 +4100,8 @@ hsize_t diff_uchar(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_uchar, mem1, sizeof(unsigned char)); - memcpy(&temp2_uchar, mem2, sizeof(unsigned char)); + HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); + HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); if (temp1_uchar != temp2_uchar) { @@ -4161,8 +4161,8 @@ hsize_t diff_short(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_short, mem1, sizeof(short)); - memcpy(&temp2_short, mem2, sizeof(short)); + HDmemcpy(&temp1_short, mem1, sizeof(short)); + HDmemcpy(&temp2_short, mem2, sizeof(short)); if (ABS(temp1_short-temp2_short) > options->delta) { @@ -4188,8 +4188,8 @@ hsize_t diff_short(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_short, mem1, sizeof(short)); - memcpy(&temp2_short, mem2, sizeof(short)); + HDmemcpy(&temp1_short, mem1, sizeof(short)); + HDmemcpy(&temp2_short, mem2, sizeof(short)); PER(temp1_short,temp2_short); @@ -4234,8 +4234,8 @@ hsize_t diff_short(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_short, mem1, sizeof(short)); - memcpy(&temp2_short, mem2, sizeof(short)); + HDmemcpy(&temp1_short, mem1, sizeof(short)); + HDmemcpy(&temp2_short, mem2, sizeof(short)); PER(temp1_short,temp2_short); @@ -4277,8 +4277,8 @@ hsize_t diff_short(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_short, mem1, sizeof(short)); - memcpy(&temp2_short, mem2, sizeof(short)); + HDmemcpy(&temp1_short, mem1, sizeof(short)); + HDmemcpy(&temp2_short, mem2, sizeof(short)); if (temp1_short != temp2_short) { @@ -4339,8 +4339,8 @@ hsize_t diff_ushort(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_ushort, mem1, sizeof(unsigned short)); - memcpy(&temp2_ushort, mem2, sizeof(unsigned short)); + HDmemcpy(&temp1_ushort, mem1, sizeof(unsigned short)); + HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short)); if ( PDIFF(temp1_ushort,temp2_ushort) > options->delta) { @@ -4366,8 +4366,8 @@ hsize_t diff_ushort(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_ushort, mem1, sizeof(unsigned short)); - memcpy(&temp2_ushort, mem2, sizeof(unsigned short)); + HDmemcpy(&temp1_ushort, mem1, sizeof(unsigned short)); + HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short)); PER_UNSIGN(signed short,temp1_ushort,temp2_ushort); @@ -4412,8 +4412,8 @@ hsize_t diff_ushort(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_ushort, mem1, sizeof(unsigned short)); - memcpy(&temp2_ushort, mem2, sizeof(unsigned short)); + HDmemcpy(&temp1_ushort, mem1, sizeof(unsigned short)); + HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short)); PER_UNSIGN(signed short,temp1_ushort,temp2_ushort); @@ -4455,8 +4455,8 @@ hsize_t diff_ushort(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_ushort, mem1, sizeof(unsigned short)); - memcpy(&temp2_ushort, mem2, sizeof(unsigned short)); + HDmemcpy(&temp1_ushort, mem1, sizeof(unsigned short)); + HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short)); if (temp1_ushort != temp2_ushort) { @@ -4518,8 +4518,8 @@ hsize_t diff_int(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_int, mem1, sizeof(int)); - memcpy(&temp2_int, mem2, sizeof(int)); + HDmemcpy(&temp1_int, mem1, sizeof(int)); + HDmemcpy(&temp2_int, mem2, sizeof(int)); if (ABS(temp1_int-temp2_int) > options->delta) { @@ -4545,8 +4545,8 @@ hsize_t diff_int(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_int, mem1, sizeof(int)); - memcpy(&temp2_int, mem2, sizeof(int)); + HDmemcpy(&temp1_int, mem1, sizeof(int)); + HDmemcpy(&temp2_int, mem2, sizeof(int)); PER(temp1_int,temp2_int); @@ -4591,8 +4591,8 @@ hsize_t diff_int(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_int, mem1, sizeof(int)); - memcpy(&temp2_int, mem2, sizeof(int)); + HDmemcpy(&temp1_int, mem1, sizeof(int)); + HDmemcpy(&temp2_int, mem2, sizeof(int)); PER(temp1_int,temp2_int); @@ -4634,8 +4634,8 @@ hsize_t diff_int(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_int, mem1, sizeof(int)); - memcpy(&temp2_int, mem2, sizeof(int)); + HDmemcpy(&temp1_int, mem1, sizeof(int)); + HDmemcpy(&temp2_int, mem2, sizeof(int)); if (temp1_int != temp2_int) { @@ -4697,8 +4697,8 @@ hsize_t diff_uint(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_uint, mem1, sizeof(unsigned int)); - memcpy(&temp2_uint, mem2, sizeof(unsigned int)); + HDmemcpy(&temp1_uint, mem1, sizeof(unsigned int)); + HDmemcpy(&temp2_uint, mem2, sizeof(unsigned int)); if ( PDIFF(temp1_uint,temp2_uint) > options->delta) { @@ -4724,8 +4724,8 @@ hsize_t diff_uint(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_uint, mem1, sizeof(unsigned int)); - memcpy(&temp2_uint, mem2, sizeof(unsigned int)); + HDmemcpy(&temp1_uint, mem1, sizeof(unsigned int)); + HDmemcpy(&temp2_uint, mem2, sizeof(unsigned int)); PER_UNSIGN(signed int,temp1_uint,temp2_uint); @@ -4769,8 +4769,8 @@ hsize_t diff_uint(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_uint, mem1, sizeof(unsigned int)); - memcpy(&temp2_uint, mem2, sizeof(unsigned int)); + HDmemcpy(&temp1_uint, mem1, sizeof(unsigned int)); + HDmemcpy(&temp2_uint, mem2, sizeof(unsigned int)); PER_UNSIGN(signed int,temp1_uint,temp2_uint); @@ -4811,8 +4811,8 @@ hsize_t diff_uint(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_uint, mem1, sizeof(unsigned int)); - memcpy(&temp2_uint, mem2, sizeof(unsigned int)); + HDmemcpy(&temp1_uint, mem1, sizeof(unsigned int)); + HDmemcpy(&temp2_uint, mem2, sizeof(unsigned int)); if (temp1_uint != temp2_uint) { @@ -4877,8 +4877,8 @@ hsize_t diff_long(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_long, mem1, sizeof(long)); - memcpy(&temp2_long, mem2, sizeof(long)); + HDmemcpy(&temp1_long, mem1, sizeof(long)); + HDmemcpy(&temp2_long, mem2, sizeof(long)); if (ABS(temp1_long-temp2_long) > options->delta) { @@ -4904,8 +4904,8 @@ hsize_t diff_long(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_long, mem1, sizeof(long)); - memcpy(&temp2_long, mem2, sizeof(long)); + HDmemcpy(&temp1_long, mem1, sizeof(long)); + HDmemcpy(&temp2_long, mem2, sizeof(long)); PER(temp1_long,temp2_long); @@ -4950,8 +4950,8 @@ hsize_t diff_long(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_long, mem1, sizeof(long)); - memcpy(&temp2_long, mem2, sizeof(long)); + HDmemcpy(&temp1_long, mem1, sizeof(long)); + HDmemcpy(&temp2_long, mem2, sizeof(long)); PER(temp1_long,temp2_long); @@ -4993,8 +4993,8 @@ hsize_t diff_long(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_long, mem1, sizeof(long)); - memcpy(&temp2_long, mem2, sizeof(long)); + HDmemcpy(&temp1_long, mem1, sizeof(long)); + HDmemcpy(&temp2_long, mem2, sizeof(long)); if (temp1_long != temp2_long) { @@ -5061,8 +5061,8 @@ hsize_t diff_ulong(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_ulong, mem1, sizeof(unsigned long)); - memcpy(&temp2_ulong, mem2, sizeof(unsigned long)); + HDmemcpy(&temp1_ulong, mem1, sizeof(unsigned long)); + HDmemcpy(&temp2_ulong, mem2, sizeof(unsigned long)); if ( PDIFF(temp1_ulong,temp2_ulong) > options->delta) { @@ -5090,8 +5090,8 @@ hsize_t diff_ulong(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_ulong, mem1, sizeof(unsigned long)); - memcpy(&temp2_ulong, mem2, sizeof(unsigned long)); + HDmemcpy(&temp1_ulong, mem1, sizeof(unsigned long)); + HDmemcpy(&temp2_ulong, mem2, sizeof(unsigned long)); PER_UNSIGN(signed long,temp1_ulong,temp2_ulong); @@ -5135,8 +5135,8 @@ hsize_t diff_ulong(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_ulong, mem1, sizeof(unsigned long)); - memcpy(&temp2_ulong, mem2, sizeof(unsigned long)); + HDmemcpy(&temp1_ulong, mem1, sizeof(unsigned long)); + HDmemcpy(&temp2_ulong, mem2, sizeof(unsigned long)); PER_UNSIGN(signed long,temp1_ulong,temp2_ulong); @@ -5177,8 +5177,8 @@ hsize_t diff_ulong(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_ulong, mem1, sizeof(unsigned long)); - memcpy(&temp2_ulong, mem2, sizeof(unsigned long)); + HDmemcpy(&temp1_ulong, mem1, sizeof(unsigned long)); + HDmemcpy(&temp2_ulong, mem2, sizeof(unsigned long)); if (temp1_ulong != temp2_ulong) { @@ -5240,8 +5240,8 @@ hsize_t diff_llong(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_llong, mem1, sizeof(long long)); - memcpy(&temp2_llong, mem2, sizeof(long long)); + HDmemcpy(&temp1_llong, mem1, sizeof(long long)); + HDmemcpy(&temp2_llong, mem2, sizeof(long long)); if (ABS( temp1_llong-temp2_llong) > options->delta) { @@ -5267,8 +5267,8 @@ hsize_t diff_llong(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_llong, mem1, sizeof(long long)); - memcpy(&temp2_llong, mem2, sizeof(long long)); + HDmemcpy(&temp1_llong, mem1, sizeof(long long)); + HDmemcpy(&temp2_llong, mem2, sizeof(long long)); PER(temp1_llong,temp2_llong); @@ -5310,8 +5310,8 @@ hsize_t diff_llong(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_llong, mem1, sizeof(long long)); - memcpy(&temp2_llong, mem2, sizeof(long long)); + HDmemcpy(&temp1_llong, mem1, sizeof(long long)); + HDmemcpy(&temp2_llong, mem2, sizeof(long long)); PER(temp1_llong,temp2_llong); @@ -5350,8 +5350,8 @@ hsize_t diff_llong(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_llong, mem1, sizeof(long long)); - memcpy(&temp2_llong, mem2, sizeof(long long)); + HDmemcpy(&temp1_llong, mem1, sizeof(long long)); + HDmemcpy(&temp2_llong, mem2, sizeof(long long)); if (temp1_llong != temp2_llong) { @@ -5414,8 +5414,8 @@ hsize_t diff_ullong(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_ullong, mem1, sizeof(unsigned long long)); - memcpy(&temp2_ullong, mem2, sizeof(unsigned long long)); + HDmemcpy(&temp1_ullong, mem1, sizeof(unsigned long long)); + HDmemcpy(&temp2_ullong, mem2, sizeof(unsigned long long)); if ( PDIFF(temp1_ullong,temp2_ullong) > (unsigned long long) options->delta) { @@ -5441,8 +5441,8 @@ hsize_t diff_ullong(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_ullong, mem1, sizeof(unsigned long long)); - memcpy(&temp2_ullong, mem2, sizeof(unsigned long long)); + HDmemcpy(&temp1_ullong, mem1, sizeof(unsigned long long)); + HDmemcpy(&temp2_ullong, mem2, sizeof(unsigned long long)); ull2float(temp1_ullong,&f1); ull2float(temp2_ullong,&f2); @@ -5486,8 +5486,8 @@ hsize_t diff_ullong(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_ullong, mem1, sizeof(unsigned long long)); - memcpy(&temp2_ullong, mem2, sizeof(unsigned long long)); + HDmemcpy(&temp1_ullong, mem1, sizeof(unsigned long long)); + HDmemcpy(&temp2_ullong, mem2, sizeof(unsigned long long)); ull2float(temp1_ullong,&f1); ull2float(temp2_ullong,&f2); @@ -5528,8 +5528,8 @@ hsize_t diff_ullong(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_ullong, mem1, sizeof(unsigned long long)); - memcpy(&temp2_ullong, mem2, sizeof(unsigned long long)); + HDmemcpy(&temp1_ullong, mem1, sizeof(unsigned long long)); + HDmemcpy(&temp2_ullong, mem2, sizeof(unsigned long long)); if (temp1_ullong != temp2_ullong) { @@ -5582,13 +5582,13 @@ int ull2float(unsigned long long ull_value, float *f_value) dst_size = H5Tget_size(H5T_NATIVE_FLOAT); buf = (unsigned char*)calloc(1, MAX(src_size, dst_size)); - memcpy(buf, &ull_value, src_size); + HDmemcpy(buf, &ull_value, src_size); /* do conversion */ if(H5Tconvert(H5T_NATIVE_ULLONG, H5T_NATIVE_FLOAT, 1, buf, NULL, dxpl_id)<0) goto error; - memcpy(f_value, buf, dst_size); + HDmemcpy(f_value, buf, dst_size); if(buf) HDfree(buf); diff --git a/tools/lib/h5diff_util.c b/tools/lib/h5diff_util.c index dfdc8b3..0d476b6 100644 --- a/tools/lib/h5diff_util.c +++ b/tools/lib/h5diff_util.c @@ -183,7 +183,7 @@ diff_basename(const char *name) return NULL; /* Find the end of the base name */ - i = strlen(name); + i = HDstrlen(name); while (i>0 && '/'==name[i-1]) --i; diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index c3fbb1b..846c01b 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -157,7 +157,7 @@ h5tools_str_append(h5tools_str_t *str/*in,out*/, const char *fmt, ...) */ if (nchars < 0 #ifndef H5_VSNPRINTF_WORKS - && (strlen(str->s) < str->nalloc) + && (HDstrlen(str->s) < str->nalloc) #endif ) { /* failure, such as bad format */ -- cgit v0.12 From 5b1c9ffe2d7ba0dd906836cb844c7504aa96aa58 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 24 Feb 2012 09:39:17 -0500 Subject: [svn-r21980] Correct HD prefix in tools for *alloc Checked for HD support. --- tools/h5dump/h5dump.c | 8 ++++---- tools/h5dump/h5dump_ddl.c | 8 ++++---- tools/h5dump/h5dump_xml.c | 12 ++++++------ tools/h5jam/h5jamgentest.c | 4 ++-- tools/h5ls/h5ls.c | 8 ++++---- tools/h5repack/h5repack_opttable.c | 6 +++--- tools/h5repack/h5repack_parse.c | 4 ++-- tools/h5stat/h5stat.c | 14 +++++++------- tools/lib/h5diff_array.c | 2 +- 9 files changed, 33 insertions(+), 33 deletions(-) diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c index 09dead0..ac9d1d3 100644 --- a/tools/h5dump/h5dump.c +++ b/tools/h5dump/h5dump.c @@ -642,7 +642,7 @@ parse_hsize_list(const char *h_list, subset_d *d) return; /* allocate an array for the integers in the list */ - p_list = (hsize_t *)calloc(size_count, sizeof(hsize_t)); + p_list = (hsize_t *)HDcalloc(size_count, sizeof(hsize_t)); for (ptr = h_list; i < size_count && ptr && *ptr && *ptr != ';' && *ptr != ']'; ptr++) if(isdigit(*ptr)) { @@ -684,7 +684,7 @@ parse_subset_params(char *dset) if (!disable_compact_subset && ((brace = strrchr(dset, '[')) != NULL)) { *brace++ = '\0'; - s = (struct subset_t *)calloc(1, sizeof(struct subset_t)); + s = (struct subset_t *)HDcalloc(1, sizeof(struct subset_t)); parse_hsize_list(brace, &s->start); while (*brace && *brace != ';') @@ -906,7 +906,7 @@ parse_command_line(int argc, const char *argv[]) } /* this will be plenty big enough to hold the info */ - if((hand = (struct handler_t *)calloc((size_t)argc, sizeof(struct handler_t)))==NULL) { + if((hand = (struct handler_t *)HDcalloc((size_t)argc, sizeof(struct handler_t)))==NULL) { goto error; } @@ -1163,7 +1163,7 @@ parse_start: s = last_dset->subset_info; } else { - last_dset->subset_info = s = (struct subset_t *)calloc(1, sizeof(struct subset_t)); + last_dset->subset_info = s = (struct subset_t *)HDcalloc(1, sizeof(struct subset_t)); } /* diff --git a/tools/h5dump/h5dump_ddl.c b/tools/h5dump/h5dump_ddl.c index f53a9d2..8117238 100644 --- a/tools/h5dump/h5dump_ddl.c +++ b/tools/h5dump/h5dump_ddl.c @@ -1502,26 +1502,26 @@ handle_datasets(hid_t fid, const char *dset, void *data, int pe, const char *dis * dimensions */ if(!sset->start.data) { /* default to (0, 0, ...) for the start coord */ - sset->start.data = (hsize_t *)calloc((size_t)ndims, sizeof(hsize_t)); + sset->start.data = (hsize_t *)HDcalloc((size_t)ndims, sizeof(hsize_t)); sset->start.len = ndims; } if(!sset->stride.data) { - sset->stride.data = (hsize_t *)calloc((size_t)ndims, sizeof(hsize_t)); + sset->stride.data = (hsize_t *)HDcalloc((size_t)ndims, sizeof(hsize_t)); sset->stride.len = ndims; for (i = 0; i < ndims; i++) sset->stride.data[i] = 1; } if(!sset->count.data) { - sset->count.data = (hsize_t *)calloc((size_t)ndims, sizeof(hsize_t)); + sset->count.data = (hsize_t *)HDcalloc((size_t)ndims, sizeof(hsize_t)); sset->count.len = ndims; for (i = 0; i < ndims; i++) sset->count.data[i] = 1; } if(!sset->block.data) { - sset->block.data = (hsize_t *)calloc((size_t)ndims, sizeof(hsize_t)); + sset->block.data = (hsize_t *)HDcalloc((size_t)ndims, sizeof(hsize_t)); sset->block.len = ndims; for (i = 0; i < ndims; i++) sset->block.data[i] = 1; diff --git a/tools/h5dump/h5dump_xml.c b/tools/h5dump/h5dump_xml.c index 934682c..b92ccdb 100644 --- a/tools/h5dump/h5dump_xml.c +++ b/tools/h5dump/h5dump_xml.c @@ -693,7 +693,7 @@ xml_escape_the_string(const char *str, int slen) } cp = str; - rcp = ncp = (char *) calloc((len + extra + 1), sizeof(char)); + rcp = ncp = (char *) HDcalloc((len + extra + 1), sizeof(char)); if (ncp == NULL) return NULL; /* ?? */ @@ -2899,7 +2899,7 @@ xml_print_refs(hid_t did, int source) if ((tsiz = H5Tget_size(type)) == 0) goto error; - buf = (char *) calloc((size_t)(ssiz * tsiz), sizeof(char)); + buf = (char *) HDcalloc((size_t)(ssiz * tsiz), sizeof(char)); if (buf == NULL) goto error; e = H5Dread(did, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); @@ -2915,7 +2915,7 @@ xml_print_refs(hid_t did, int source) if ((tsiz = H5Tget_size(type)) == 0) goto error; - buf = (char *) calloc((size_t)(ssiz * tsiz), sizeof(char)); + buf = (char *) HDcalloc((size_t)(ssiz * tsiz), sizeof(char)); if (buf == NULL) { goto error; } @@ -3085,7 +3085,7 @@ xml_print_strs(hid_t did, int source) bp = (char*) buf; if (!is_vlstr) - onestring = (char *) calloc(tsiz, sizeof(char)); + onestring = (char *) HDcalloc(tsiz, sizeof(char)); /* setup */ HDmemset(&buffer, 0, sizeof(h5tools_str_t)); @@ -4355,8 +4355,8 @@ xml_print_enum(hid_t type) } /* Get the names and raw values of all members */ - name = (char **)calloc(nmembs, sizeof(char *)); - value = (unsigned char *)calloc(nmembs, MAX(H5Tget_size(type), dst_size)); + name = (char **)HDcalloc(nmembs, sizeof(char *)); + value = (unsigned char *)HDcalloc(nmembs, MAX(H5Tget_size(type), dst_size)); for (i = 0; i < nmembs; i++) { name[i] = H5Tget_member_name(type, i); diff --git a/tools/h5jam/h5jamgentest.c b/tools/h5jam/h5jamgentest.c index c64053c..ca3d86c 100644 --- a/tools/h5jam/h5jamgentest.c +++ b/tools/h5jam/h5jamgentest.c @@ -335,7 +335,7 @@ create_textfile(const char *name, size_t size) fd = HDcreat(name,0777); HDassert(fd >= 0); - buf = calloc(size, (size_t)1); + buf = HDcalloc(size, (size_t)1); HDassert(buf); /* fill buf with pattern */ @@ -363,7 +363,7 @@ create_binfile(char *name, off_t size) fd = creat(name,0777); HDassert(fd >= 0); - buf = calloc(size,1); + buf = HDcalloc(size,1); HDassert(buf); /* fill buf with pattern */ diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c index 9766170..b06f302 100644 --- a/tools/h5ls/h5ls.c +++ b/tools/h5ls/h5ls.c @@ -897,8 +897,8 @@ display_enum_type(hid_t type, int ind) } /* Get the names and raw values of all members */ - name = calloc(nmembs, sizeof(char*)); - value = (unsigned char *)calloc(nmembs, MAX(H5Tget_size(type), dst_size)); + name = HDcalloc(nmembs, sizeof(char*)); + value = (unsigned char *)HDcalloc(nmembs, MAX(H5Tget_size(type), dst_size)); for (i=0; isize += n_objs; - table->objs = (pack_info_t*)realloc(table->objs, table->size * sizeof(pack_info_t)); + table->objs = (pack_info_t*)HDrealloc(table->objs, table->size * sizeof(pack_info_t)); if (table->objs==NULL) { error_msg("not enough memory for options table\n"); return -1; @@ -147,7 +147,7 @@ int options_table_init( pack_opttbl_t **tbl ) unsigned int i; pack_opttbl_t *table; - if(NULL == (table = (pack_opttbl_t *)malloc(sizeof(pack_opttbl_t)))) + if(NULL == (table = (pack_opttbl_t *)HDmalloc(sizeof(pack_opttbl_t)))) { error_msg("not enough memory for options table\n"); return -1; @@ -155,7 +155,7 @@ int options_table_init( pack_opttbl_t **tbl ) table->size = 30; table->nelems = 0; - if(NULL == (table->objs = (pack_info_t*)malloc(table->size * sizeof(pack_info_t)))) + if(NULL == (table->objs = (pack_info_t*)HDmalloc(table->size * sizeof(pack_info_t)))) { error_msg("not enough memory for options table\n"); HDfree(table); diff --git a/tools/h5repack/h5repack_parse.c b/tools/h5repack/h5repack_parse.c index 6fab819..5cdf9d2 100644 --- a/tools/h5repack/h5repack_parse.c +++ b/tools/h5repack/h5repack_parse.c @@ -88,7 +88,7 @@ obj_list_t* parse_filter(const char *str, } n++; - obj_list = (obj_list_t*) malloc(n*sizeof(obj_list_t)); + obj_list = (obj_list_t*) HDmalloc(n*sizeof(obj_list_t)); if (obj_list==NULL) { error_msg("could not allocate object list\n"); @@ -509,7 +509,7 @@ obj_list_t* parse_layout(const char *str, } n++; - obj_list = (obj_list_t*) malloc(n*sizeof(obj_list_t)); + obj_list = (obj_list_t*) HDmalloc(n*sizeof(obj_list_t)); if (obj_list==NULL) { error_msg("could not allocate object list\n"); diff --git a/tools/h5stat/h5stat.c b/tools/h5stat/h5stat.c index 2155f95..f6ed4b8 100644 --- a/tools/h5stat/h5stat.c +++ b/tools/h5stat/h5stat.c @@ -318,7 +318,7 @@ attribute_stats(iter_t *iter, const H5O_info_t *oi) /* Add attribute count to proper bin */ bin = ceil_log10((unsigned long)oi->num_attrs); if((bin + 1) > iter->attr_nbins) { - iter->attr_bins = (unsigned long *)realloc(iter->attr_bins, (bin + 1) * sizeof(unsigned long)); + iter->attr_bins = (unsigned long *)HDrealloc(iter->attr_bins, (bin + 1) * sizeof(unsigned long)); HDassert(iter->attr_bins); /* Initialize counts for intermediate bins */ @@ -390,7 +390,7 @@ group_stats(iter_t *iter, const char *name, const H5O_info_t *oi) bin = ceil_log10((unsigned long)ginfo.nlinks); if((bin + 1) > iter->group_nbins) { /* Allocate more storage for info about dataset's datatype */ - iter->group_bins = (unsigned long *)realloc(iter->group_bins, (bin + 1) * sizeof(unsigned long)); + iter->group_bins = (unsigned long *)HDrealloc(iter->group_bins, (bin + 1) * sizeof(unsigned long)); HDassert(iter->group_bins); /* Initialize counts for intermediate bins */ @@ -521,7 +521,7 @@ dataset_stats(iter_t *iter, const char *name, const H5O_info_t *oi) bin = ceil_log10((unsigned long)dims[0]); if((bin + 1) > iter->dset_dim_nbins) { /* Allocate more storage for info about dataset's datatype */ - iter->dset_dim_bins = (unsigned long *)realloc(iter->dset_dim_bins, (bin + 1) * sizeof(unsigned long)); + iter->dset_dim_bins = (unsigned long *)HDrealloc(iter->dset_dim_bins, (bin + 1) * sizeof(unsigned long)); HDassert(iter->dset_dim_bins); /* Initialize counts for intermediate bins */ @@ -558,7 +558,7 @@ dataset_stats(iter_t *iter, const char *name, const H5O_info_t *oi) iter->dset_ntypes++; /* Allocate more storage for info about dataset's datatype */ - iter->dset_type_info = (dtype_info_t *)realloc(iter->dset_type_info, iter->dset_ntypes * sizeof(dtype_info_t)); + iter->dset_type_info = (dtype_info_t *)HDrealloc(iter->dset_type_info, iter->dset_ntypes * sizeof(dtype_info_t)); HDassert(iter->dset_type_info); /* Initialize information about datatype */ @@ -741,7 +741,7 @@ freespace_stats(hid_t fid, iter_t *iter) if((nsects = H5Fget_free_sections(fid, H5FD_MEM_DEFAULT, 0, NULL)) < 0) return(FAIL); else if(nsects) { - if(NULL == (sect_info = (H5F_sect_info_t *)calloc((size_t)nsects, sizeof(H5F_sect_info_t)))) + if(NULL == (sect_info = (H5F_sect_info_t *)HDcalloc((size_t)nsects, sizeof(H5F_sect_info_t)))) return(FAIL); nsects = H5Fget_free_sections(fid, H5FD_MEM_DEFAULT, (size_t)nsects, sect_info); HDassert(nsects); @@ -757,7 +757,7 @@ freespace_stats(hid_t fid, iter_t *iter) bin = ceil_log10((unsigned long)sect_info[u].size); if(bin >= iter->sect_nbins) { /* Allocate more storage for section info */ - iter->sect_bins = (unsigned long *)realloc(iter->sect_bins, (bin + 1) * sizeof(unsigned long)); + iter->sect_bins = (unsigned long *)HDrealloc(iter->sect_bins, (bin + 1) * sizeof(unsigned long)); HDassert(iter->sect_bins); /* Initialize counts for intermediate bins */ @@ -805,7 +805,7 @@ parse_command_line(int argc, const char *argv[]) struct handler_t *hand = NULL; /* Allocate space to hold the command line info */ - if((hand = (struct handler_t *)calloc((size_t)argc, sizeof(struct handler_t)))==NULL) { + if((hand = (struct handler_t *)HDcalloc((size_t)argc, sizeof(struct handler_t)))==NULL) { error_msg("unable to parse command line arguments \n"); goto error; } diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index 172986d..604a825 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -5580,7 +5580,7 @@ int ull2float(unsigned long long ull_value, float *f_value) src_size = H5Tget_size(H5T_NATIVE_ULLONG); dst_size = H5Tget_size(H5T_NATIVE_FLOAT); - buf = (unsigned char*)calloc(1, MAX(src_size, dst_size)); + buf = (unsigned char*)HDcalloc(1, MAX(src_size, dst_size)); HDmemcpy(buf, &ull_value, src_size); -- cgit v0.12 From cec338c647aa3dc46f93800c1263f6a75b2c6728 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 24 Feb 2012 10:32:36 -0500 Subject: [svn-r21981] Correct HD prefix in tools for fprintf Checked for HD support. --- tools/h5copy/h5copy.c | 2 +- tools/h5diff/h5diff_common.c | 6 +- tools/h5dump/h5dump.c | 182 ++++----- tools/h5dump/h5dump_xml.c | 18 +- tools/h5import/h5import.c | 850 +++++++++++++++++++++---------------------- tools/h5ls/h5ls.c | 38 +- tools/h5stat/h5stat.c | 30 +- tools/lib/h5diff.c | 14 +- tools/misc/h5debug.c | 224 ++++++------ tools/misc/h5mkgrp.c | 6 +- 10 files changed, 685 insertions(+), 685 deletions(-) diff --git a/tools/h5copy/h5copy.c b/tools/h5copy/h5copy.c index fb8bb81..dcc21ee 100644 --- a/tools/h5copy/h5copy.c +++ b/tools/h5copy/h5copy.c @@ -75,7 +75,7 @@ leave(int ret) static void usage (void) { - fprintf(stdout, "\ + HDfprintf(stdout, "\ usage: h5copy [OPTIONS] [OBJECTS...]\n\ OBJECTS\n\ -i, --input input file name\n\ diff --git a/tools/h5diff/h5diff_common.c b/tools/h5diff/h5diff_common.c index 35c3956..f7532f2 100644 --- a/tools/h5diff/h5diff_common.c +++ b/tools/h5diff/h5diff_common.c @@ -355,7 +355,7 @@ check_n_input( const char *str ) unsigned i; char c; - for ( i = 0; i < HDstrlen(str); i++) + for ( i = 0; i < strlen(str); i++) { c = str[i]; if ( i==0 ) @@ -394,7 +394,7 @@ check_p_input( const char *str ) the atof return value on a hexadecimal input is different on some systems; we do a character check for this */ - if (HDstrlen(str)>2 && str[0]=='0' && str[1]=='x') + if (strlen(str)>2 && str[0]=='0' && str[1]=='x') return -1; x=atof(str); @@ -428,7 +428,7 @@ check_d_input( const char *str ) the atof return value on a hexadecimal input is different on some systems; we do a character check for this */ - if (HDstrlen(str)>2 && str[0]=='0' && str[1]=='x') + if (strlen(str)>2 && str[0]=='0' && str[1]=='x') return -1; x=atof(str); diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c index ac9d1d3..80351d1 100644 --- a/tools/h5dump/h5dump.c +++ b/tools/h5dump/h5dump.c @@ -231,34 +231,34 @@ static void usage(const char *prog) { fflush(stdout); - fprintf(stdout, "usage: %s [OPTIONS] file\n", prog); - fprintf(stdout, " OPTIONS\n"); - fprintf(stdout, " -h, --help Print a usage message and exit\n"); - fprintf(stdout, " -n, --contents Print a list of the file contents and exit\n"); - fprintf(stdout, " -B, --superblock Print the content of the super block\n"); - fprintf(stdout, " -H, --header Print the header only; no data is displayed\n"); - fprintf(stdout, " -A, --onlyattr Print the header and value of attributes\n"); - fprintf(stdout, " -i, --object-ids Print the object ids\n"); - fprintf(stdout, " -r, --string Print 1-byte integer datasets as ASCII\n"); - fprintf(stdout, " -e, --escape Escape non printing characters\n"); - fprintf(stdout, " -V, --version Print version number and exit\n"); - fprintf(stdout, " -a P, --attribute=P Print the specified attribute\n"); - fprintf(stdout, " -d P, --dataset=P Print the specified dataset\n"); - fprintf(stdout, " -y, --noindex Do not print array indices with the data\n"); - fprintf(stdout, " -p, --properties Print dataset filters, storage layout and fill value\n"); - fprintf(stdout, " -f D, --filedriver=D Specify which driver to open the file with\n"); - fprintf(stdout, " -g P, --group=P Print the specified group and all members\n"); - fprintf(stdout, " -l P, --soft-link=P Print the value(s) of the specified soft link\n"); - fprintf(stdout, " -o F, --output=F Output raw data into file F\n"); - fprintf(stdout, " -b B, --binary=B Binary file output, of form B\n"); - fprintf(stdout, " -t P, --datatype=P Print the specified named datatype\n"); - fprintf(stdout, " -w N, --width=N Set the number of columns of output. A value of 0 (zero)\n"); - fprintf(stdout, " sets the number of columns to the maximum (65535).\n"); - fprintf(stdout, " Default width is 80 columns.\n"); - fprintf(stdout, " -m T, --format=T Set the floating point output format\n"); - fprintf(stdout, " -q Q, --sort_by=Q Sort groups and attributes by index Q\n"); - fprintf(stdout, " -z Z, --sort_order=Z Sort groups and attributes by order Z\n"); - fprintf(stdout, + HDfprintf(stdout, "usage: %s [OPTIONS] file\n", prog); + HDfprintf(stdout, " OPTIONS\n"); + HDfprintf(stdout, " -h, --help Print a usage message and exit\n"); + HDfprintf(stdout, " -n, --contents Print a list of the file contents and exit\n"); + HDfprintf(stdout, " -B, --superblock Print the content of the super block\n"); + HDfprintf(stdout, " -H, --header Print the header only; no data is displayed\n"); + HDfprintf(stdout, " -A, --onlyattr Print the header and value of attributes\n"); + HDfprintf(stdout, " -i, --object-ids Print the object ids\n"); + HDfprintf(stdout, " -r, --string Print 1-byte integer datasets as ASCII\n"); + HDfprintf(stdout, " -e, --escape Escape non printing characters\n"); + HDfprintf(stdout, " -V, --version Print version number and exit\n"); + HDfprintf(stdout, " -a P, --attribute=P Print the specified attribute\n"); + HDfprintf(stdout, " -d P, --dataset=P Print the specified dataset\n"); + HDfprintf(stdout, " -y, --noindex Do not print array indices with the data\n"); + HDfprintf(stdout, " -p, --properties Print dataset filters, storage layout and fill value\n"); + HDfprintf(stdout, " -f D, --filedriver=D Specify which driver to open the file with\n"); + HDfprintf(stdout, " -g P, --group=P Print the specified group and all members\n"); + HDfprintf(stdout, " -l P, --soft-link=P Print the value(s) of the specified soft link\n"); + HDfprintf(stdout, " -o F, --output=F Output raw data into file F\n"); + HDfprintf(stdout, " -b B, --binary=B Binary file output, of form B\n"); + HDfprintf(stdout, " -t P, --datatype=P Print the specified named datatype\n"); + HDfprintf(stdout, " -w N, --width=N Set the number of columns of output. A value of 0 (zero)\n"); + HDfprintf(stdout, " sets the number of columns to the maximum (65535).\n"); + HDfprintf(stdout, " Default width is 80 columns.\n"); + HDfprintf(stdout, " -m T, --format=T Set the floating point output format\n"); + HDfprintf(stdout, " -q Q, --sort_by=Q Sort groups and attributes by index Q\n"); + HDfprintf(stdout, " -z Z, --sort_order=Z Sort groups and attributes by order Z\n"); + HDfprintf(stdout, " -M L, --packedbits=L Print packed bits as unsigned integers, using mask\n" " format L for an integer dataset specified with\n" " option -d. L is a list of offset,length values,\n" @@ -266,69 +266,69 @@ usage(const char *prog) " the data value and length is the number of bits of\n" " the mask.\n" ); - fprintf(stdout, " -R, --region Print dataset pointed by region references\n"); - fprintf(stdout, " -x, --xml Output in XML using Schema\n"); - fprintf(stdout, " -u, --use-dtd Output in XML using DTD\n"); - fprintf(stdout, " -D U, --xml-dtd=U Use the DTD or schema at U\n"); - fprintf(stdout, " -X S, --xml-ns=S (XML Schema) Use qualified names n the XML\n"); - fprintf(stdout, " \":\": no namespace, default: \"hdf5:\"\n"); - fprintf(stdout, " E.g., to dump a file called `-f', use h5dump -- -f\n"); - fprintf(stdout, " --enable-error-stack Prints messages from the HDF5 error stack as they\n"); - fprintf(stdout, " occur.\n"); - fprintf(stdout, " --no-compact-subset Disable compact form of subsetting and allow the use\n"); - fprintf(stdout, " of \"[\" in datset names.\n"); - fprintf(stdout, "\n"); - fprintf(stdout, " Subsetting is available by using the following options with a dataset\n"); - fprintf(stdout, " attribute. Subsetting is done by selecting a hyperslab from the data.\n"); - fprintf(stdout, " Thus, the options mirror those for performing a hyperslab selection.\n"); - fprintf(stdout, " One of the START, COUNT, STRIDE, or BLOCK parameters are mandatory if you do subsetting.\n"); - fprintf(stdout, " The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in\n"); - fprintf(stdout, " each dimension. START is optional and will default to 0 in each dimension.\n"); - fprintf(stdout, "\n"); - fprintf(stdout, " -s START, --start=START Offset of start of subsetting selection\n"); - fprintf(stdout, " -S STRIDE, --stride=STRIDE Hyperslab stride\n"); - fprintf(stdout, " -c COUNT, --count=COUNT Number of blocks to include in selection\n"); - fprintf(stdout, " -k BLOCK, --block=BLOCK Size of block in hyperslab\n"); - fprintf(stdout, " START, COUNT, STRIDE, and BLOCK - is a list of integers the number of which are equal to the\n"); - fprintf(stdout, " number of dimensions in the dataspace being queried\n"); - fprintf(stdout, "\n"); - fprintf(stdout, " D - is the file driver to use in opening the file. Acceptable values\n"); - fprintf(stdout, " are \"sec2\", \"family\", \"split\", \"multi\", \"direct\", and \"stream\". Without\n"); - fprintf(stdout, " the file driver flag, the file will be opened with each driver in\n"); - fprintf(stdout, " turn and in the order specified above until one driver succeeds\n"); - fprintf(stdout, " in opening the file.\n"); - fprintf(stdout, " F - is a filename.\n"); - fprintf(stdout, " P - is the full path from the root group to the object.\n"); - fprintf(stdout, " N - is an integer greater than 1.\n"); - fprintf(stdout, " T - is a string containing the floating point format, e.g '%%.3f'\n"); - fprintf(stdout, " U - is a URI reference (as defined in [IETF RFC 2396],\n"); - fprintf(stdout, " updated by [IETF RFC 2732])\n"); - fprintf(stdout, " B - is the form of binary output: NATIVE for a memory type, FILE for the\n"); - fprintf(stdout, " file type, LE or BE for pre-existing little or big endian types.\n"); - fprintf(stdout, " Must be used with -o (output file) and it is recommended that\n"); - fprintf(stdout, " -d (dataset) is used. B is an optional argument, defaults to NATIVE\n"); - fprintf(stdout, " Q - is the sort index type. It can be \"creation_order\" or \"name\" (default)\n"); - fprintf(stdout, " Z - is the sort order type. It can be \"descending\" or \"ascending\" (default)\n"); - fprintf(stdout, "\n"); - fprintf(stdout, " Examples:\n"); - fprintf(stdout, "\n"); - fprintf(stdout, " 1) Attribute foo of the group /bar_none in file quux.h5\n"); - fprintf(stdout, "\n"); - fprintf(stdout, " h5dump -a /bar_none/foo quux.h5\n"); - fprintf(stdout, "\n"); - fprintf(stdout, " 2) Selecting a subset from dataset /foo in file quux.h5\n"); - fprintf(stdout, "\n"); - fprintf(stdout, " h5dump -d /foo -s \"0,1\" -S \"1,1\" -c \"2,3\" -k \"2,2\" quux.h5\n"); - fprintf(stdout, "\n"); - fprintf(stdout, " 3) Saving dataset 'dset' in file quux.h5 to binary file 'out.bin'\n"); - fprintf(stdout, " using a little-endian type\n"); - fprintf(stdout, "\n"); - fprintf(stdout, " h5dump -d /dset -b LE -o out.bin quux.h5\n"); - fprintf(stdout, "\n"); - fprintf(stdout, " 4) Display two packed bits (bits 0-1 and bits 4-6) in the dataset /dset\n"); - fprintf(stdout, "\n"); - fprintf(stdout, " h5dump -d /dset -M 0,1,4,3 quux.h5\n"); - fprintf(stdout, "\n"); + HDfprintf(stdout, " -R, --region Print dataset pointed by region references\n"); + HDfprintf(stdout, " -x, --xml Output in XML using Schema\n"); + HDfprintf(stdout, " -u, --use-dtd Output in XML using DTD\n"); + HDfprintf(stdout, " -D U, --xml-dtd=U Use the DTD or schema at U\n"); + HDfprintf(stdout, " -X S, --xml-ns=S (XML Schema) Use qualified names n the XML\n"); + HDfprintf(stdout, " \":\": no namespace, default: \"hdf5:\"\n"); + HDfprintf(stdout, " E.g., to dump a file called `-f', use h5dump -- -f\n"); + HDfprintf(stdout, " --enable-error-stack Prints messages from the HDF5 error stack as they\n"); + HDfprintf(stdout, " occur.\n"); + HDfprintf(stdout, " --no-compact-subset Disable compact form of subsetting and allow the use\n"); + HDfprintf(stdout, " of \"[\" in datset names.\n"); + HDfprintf(stdout, "\n"); + HDfprintf(stdout, " Subsetting is available by using the following options with a dataset\n"); + HDfprintf(stdout, " attribute. Subsetting is done by selecting a hyperslab from the data.\n"); + HDfprintf(stdout, " Thus, the options mirror those for performing a hyperslab selection.\n"); + HDfprintf(stdout, " One of the START, COUNT, STRIDE, or BLOCK parameters are mandatory if you do subsetting.\n"); + HDfprintf(stdout, " The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in\n"); + HDfprintf(stdout, " each dimension. START is optional and will default to 0 in each dimension.\n"); + HDfprintf(stdout, "\n"); + HDfprintf(stdout, " -s START, --start=START Offset of start of subsetting selection\n"); + HDfprintf(stdout, " -S STRIDE, --stride=STRIDE Hyperslab stride\n"); + HDfprintf(stdout, " -c COUNT, --count=COUNT Number of blocks to include in selection\n"); + HDfprintf(stdout, " -k BLOCK, --block=BLOCK Size of block in hyperslab\n"); + HDfprintf(stdout, " START, COUNT, STRIDE, and BLOCK - is a list of integers the number of which are equal to the\n"); + HDfprintf(stdout, " number of dimensions in the dataspace being queried\n"); + HDfprintf(stdout, "\n"); + HDfprintf(stdout, " D - is the file driver to use in opening the file. Acceptable values\n"); + HDfprintf(stdout, " are \"sec2\", \"family\", \"split\", \"multi\", \"direct\", and \"stream\". Without\n"); + HDfprintf(stdout, " the file driver flag, the file will be opened with each driver in\n"); + HDfprintf(stdout, " turn and in the order specified above until one driver succeeds\n"); + HDfprintf(stdout, " in opening the file.\n"); + HDfprintf(stdout, " F - is a filename.\n"); + HDfprintf(stdout, " P - is the full path from the root group to the object.\n"); + HDfprintf(stdout, " N - is an integer greater than 1.\n"); + HDfprintf(stdout, " T - is a string containing the floating point format, e.g '%%.3f'\n"); + HDfprintf(stdout, " U - is a URI reference (as defined in [IETF RFC 2396],\n"); + HDfprintf(stdout, " updated by [IETF RFC 2732])\n"); + HDfprintf(stdout, " B - is the form of binary output: NATIVE for a memory type, FILE for the\n"); + HDfprintf(stdout, " file type, LE or BE for pre-existing little or big endian types.\n"); + HDfprintf(stdout, " Must be used with -o (output file) and it is recommended that\n"); + HDfprintf(stdout, " -d (dataset) is used. B is an optional argument, defaults to NATIVE\n"); + HDfprintf(stdout, " Q - is the sort index type. It can be \"creation_order\" or \"name\" (default)\n"); + HDfprintf(stdout, " Z - is the sort order type. It can be \"descending\" or \"ascending\" (default)\n"); + HDfprintf(stdout, "\n"); + HDfprintf(stdout, " Examples:\n"); + HDfprintf(stdout, "\n"); + HDfprintf(stdout, " 1) Attribute foo of the group /bar_none in file quux.h5\n"); + HDfprintf(stdout, "\n"); + HDfprintf(stdout, " h5dump -a /bar_none/foo quux.h5\n"); + HDfprintf(stdout, "\n"); + HDfprintf(stdout, " 2) Selecting a subset from dataset /foo in file quux.h5\n"); + HDfprintf(stdout, "\n"); + HDfprintf(stdout, " h5dump -d /foo -s \"0,1\" -S \"1,1\" -c \"2,3\" -k \"2,2\" quux.h5\n"); + HDfprintf(stdout, "\n"); + HDfprintf(stdout, " 3) Saving dataset 'dset' in file quux.h5 to binary file 'out.bin'\n"); + HDfprintf(stdout, " using a little-endian type\n"); + HDfprintf(stdout, "\n"); + HDfprintf(stdout, " h5dump -d /dset -b LE -o out.bin quux.h5\n"); + HDfprintf(stdout, "\n"); + HDfprintf(stdout, " 4) Display two packed bits (bits 0-1 and bits 4-6) in the dataset /dset\n"); + HDfprintf(stdout, "\n"); + HDfprintf(stdout, " h5dump -d /dset -M 0,1,4,3 quux.h5\n"); + HDfprintf(stdout, "\n"); } diff --git a/tools/h5dump/h5dump_xml.c b/tools/h5dump/h5dump_xml.c index b92ccdb..94e4d28 100644 --- a/tools/h5dump/h5dump_xml.c +++ b/tools/h5dump/h5dump_xml.c @@ -601,27 +601,27 @@ xml_escape_the_name(const char *str) for (i = 0; i < len; i++) { if (*cp == '\'') { - strncpy(ncp, apos, HDstrlen(apos)); + HDstrncpy(ncp, apos, HDstrlen(apos)); ncp += HDstrlen(apos); cp++; } else if (*cp == '<') { - strncpy(ncp, lt, HDstrlen(lt)); + HDstrncpy(ncp, lt, HDstrlen(lt)); ncp += HDstrlen(lt); cp++; } else if (*cp == '>') { - strncpy(ncp, gt, HDstrlen(gt)); + HDstrncpy(ncp, gt, HDstrlen(gt)); ncp += HDstrlen(gt); cp++; } else if (*cp == '\"') { - strncpy(ncp, quote, HDstrlen(quote)); + HDstrncpy(ncp, quote, HDstrlen(quote)); ncp += HDstrlen(quote); cp++; } else if (*cp == '&') { - strncpy(ncp, amp, HDstrlen(amp)); + HDstrncpy(ncp, amp, HDstrlen(amp)); ncp += HDstrlen(amp); cp++; } @@ -708,22 +708,22 @@ xml_escape_the_string(const char *str, int slen) *ncp++ = *cp++; } else if (*cp == '\'') { - strncpy(ncp, apos, HDstrlen(apos)); + HDstrncpy(ncp, apos, HDstrlen(apos)); ncp += HDstrlen(apos); cp++; } else if (*cp == '<') { - strncpy(ncp, lt, HDstrlen(lt)); + HDstrncpy(ncp, lt, HDstrlen(lt)); ncp += HDstrlen(lt); cp++; } else if (*cp == '>') { - strncpy(ncp, gt, HDstrlen(gt)); + HDstrncpy(ncp, gt, HDstrlen(gt)); ncp += HDstrlen(gt); cp++; } else if (*cp == '&') { - strncpy(ncp, amp, HDstrlen(amp)); + HDstrncpy(ncp, amp, HDstrlen(amp)); ncp += HDstrlen(amp); cp++; } diff --git a/tools/h5import/h5import.c b/tools/h5import/h5import.c index 232f3c1..31d44de 100755 --- a/tools/h5import/h5import.c +++ b/tools/h5import/h5import.c @@ -65,7 +65,7 @@ int main(int argc, char *argv[]) * validate the number of command line arguments */ if (argc < 2) { - (void) fprintf(stderr, err1, argc); + (void) HDfprintf(stderr, err1, argc); usage(argv[0]); goto err; } @@ -95,7 +95,7 @@ int main(int argc, char *argv[]) opt.fcount++; } else { - (void) fprintf(stderr, err9, argv[i]); + (void) HDfprintf(stderr, err9, argv[i]); goto err; } @@ -127,7 +127,7 @@ int main(int argc, char *argv[]) case 8: /* read dimensions */ if (parseDimensions(in, argv[i]) == -1) { - (void) fprintf(stderr, err6, argv[i]); + (void) HDfprintf(stderr, err6, argv[i]); goto err; } break; @@ -137,7 +137,7 @@ int main(int argc, char *argv[]) case 10: /* read path name */ if (parsePathInfo(&in->path, argv[i]) == -1) { - (void) fprintf(stderr, err5, argv[i]); + (void) HDfprintf(stderr, err5, argv[i]); goto err; } break; @@ -147,7 +147,7 @@ int main(int argc, char *argv[]) case 12: /* read data type */ if (getInputClass(in, argv[i]) == -1) { - (void) fprintf(stderr, err7, argv[i]); + (void) HDfprintf(stderr, err7, argv[i]); goto err; } @@ -164,7 +164,7 @@ int main(int argc, char *argv[]) case 14: /* read data size */ if (getInputSize(in, (int) HDstrtol(argv[i], NULL, BASE_10)) == -1) { - (void) fprintf(stderr, err8, argv[i]); + (void) HDfprintf(stderr, err8, argv[i]); goto err; } /*set default value for output-size */ @@ -173,14 +173,14 @@ int main(int argc, char *argv[]) case ERR: /* command syntax error */ default: - (void) fprintf(stderr, "%s", err2); + (void) HDfprintf(stderr, "%s", err2); usage(argv[0]); goto err; } } if (FALSE == outfile_named) { - (void) fprintf(stderr, "%s", err3); + (void) HDfprintf(stderr, "%s", err3); usage(argv[0]); goto err; } @@ -204,7 +204,7 @@ int main(int argc, char *argv[]) return (EXIT_SUCCESS); err: - (void) fprintf(stderr, "%s", err4); + (void) HDfprintf(stderr, "%s", err4); for (i = 0; i < opt.fcount; i++) { in = &(opt.infiles[i].in); if (in->sizeOfDimension) @@ -272,7 +272,7 @@ static int gtoken(char *s) } if (token == ERR) - (void) fprintf(stderr, err1, s); + (void) HDfprintf(stderr, err1, s); } else { /* filename */ token = FILNAME; @@ -318,7 +318,7 @@ static int processDataFile(char *infile, struct Input *in, hid_t file_id) if (in->inputClass == 4 /* "IN" */|| in->inputClass == 3 /* "FP" */|| in->inputClass == 7 /* "UIN" */) { if ((strm = HDfopen(infile, READ_OPEN_FLAGS)) == NULL) { - (void) fprintf(stderr, err1, infile); + (void) HDfprintf(stderr, err1, infile); return (-1); } } @@ -328,7 +328,7 @@ static int processDataFile(char *infile, struct Input *in, hid_t file_id) */ else { if ((strm = HDfopen(infile, "r")) == NULL) { - (void) fprintf(stderr, err1, infile); + (void) HDfprintf(stderr, err1, infile); return (-1); } } @@ -337,13 +337,13 @@ static int processDataFile(char *infile, struct Input *in, hid_t file_id) case 0: /* TEXTIN */ case 4: /* IN */ if (allocateIntegerStorage(in) == -1) { - (void) fprintf(stderr, err2, infile); + (void) HDfprintf(stderr, err2, infile); HDfclose(strm); return (-1); } if (readIntegerData(strm, in) == -1) { - (void) fprintf(stderr, err4, infile); + (void) HDfprintf(stderr, err4, infile); HDfclose(strm); return (-1); } @@ -353,14 +353,14 @@ static int processDataFile(char *infile, struct Input *in, hid_t file_id) case 2: /* TEXTFPE */ case 3: /* FP */ if (allocateFloatStorage(in) == -1) { - (void) fprintf(stderr, err3, infile); + (void) HDfprintf(stderr, err3, infile); HDfclose(strm); return (-1); } if (readFloatData(strm, in) == -1) { - (void) fprintf(stderr, err5, infile); + (void) HDfprintf(stderr, err5, infile); HDfclose(strm); return (-1); } @@ -369,7 +369,7 @@ static int processDataFile(char *infile, struct Input *in, hid_t file_id) case 5: /* STR */ if (processStrData(strm, in, file_id) == -1) { - (void) fprintf(stderr, err11, infile); + (void) HDfprintf(stderr, err11, infile); HDfclose(strm); return (-1); } @@ -379,19 +379,19 @@ static int processDataFile(char *infile, struct Input *in, hid_t file_id) case 6: /* TEXTUIN */ case 7: /* UIN */ if (allocateUIntegerStorage(in) == -1) { - (void) fprintf(stderr, err6, infile); + (void) HDfprintf(stderr, err6, infile); HDfclose(strm); return (-1); } if (readUIntegerData(strm, in) == -1) { - (void) fprintf(stderr, err7, infile); + (void) HDfprintf(stderr, err7, infile); HDfclose(strm); return (-1); } break; default: - (void) fprintf(stderr, "%s", err10); + (void) HDfprintf(stderr, "%s", err10); HDfclose(strm); return (-1); } @@ -427,7 +427,7 @@ static int readIntegerData(FILE *strm, struct Input *in) in08 = (H5DT_INT8 *) in->data; for (i = 0; i < len; i++, in08++) { if (fscanf(strm, "%hd", &temp) != 1) { - (void) fprintf(stderr, "%s", err1); + (void) HDfprintf(stderr, "%s", err1); return (-1); } (*in08) = (H5DT_INT8) temp; @@ -438,14 +438,14 @@ static int readIntegerData(FILE *strm, struct Input *in) in08 = (H5DT_INT8 *) in->data; for (i = 0; i < len; i++, in08++) { if (HDfread((char *) in08, sizeof(H5DT_INT8), 1, strm) != 1) { - (void) fprintf(stderr, "%s", err1); + (void) HDfprintf(stderr, "%s", err1); return (-1); } } break; default: - (void) fprintf(stderr, "%s", err2); + (void) HDfprintf(stderr, "%s", err2); return (-1); } break; @@ -456,7 +456,7 @@ static int readIntegerData(FILE *strm, struct Input *in) case 0: /* TEXTIN */ for (i = 0; i < len; i++, in16++) { if (fscanf(strm, "%hd", in16) != 1) { - (void) fprintf(stderr, "%s", err1); + (void) HDfprintf(stderr, "%s", err1); return (-1); } } @@ -466,14 +466,14 @@ static int readIntegerData(FILE *strm, struct Input *in) case 4: /* IN */ for (i = 0; i < len; i++, in16++) { if (HDfread((char *) in16, sizeof(H5DT_INT16), 1, strm) != 1) { - (void) fprintf(stderr, "%s", err1); + (void) HDfprintf(stderr, "%s", err1); return (-1); } } break; default: - (void) fprintf(stderr, "%s", err2); + (void) HDfprintf(stderr, "%s", err2); return (-1); } break; @@ -484,7 +484,7 @@ static int readIntegerData(FILE *strm, struct Input *in) case 0: /* TEXTIN */ for (i = 0; i < len; i++, in32++) { if (fscanf(strm, "%d", in32) != 1) { - (void) fprintf(stderr, "%s", err1); + (void) HDfprintf(stderr, "%s", err1); return (-1); } } @@ -493,14 +493,14 @@ static int readIntegerData(FILE *strm, struct Input *in) case 4: /* IN */ for (i = 0; i < len; i++, in32++) { if (HDfread((char *) in32, sizeof(H5DT_INT32), 1, strm) != 1) { - (void) fprintf(stderr, "%s", err1); + (void) HDfprintf(stderr, "%s", err1); return (-1); } } break; default: - (void) fprintf(stderr, "%s", err2); + (void) HDfprintf(stderr, "%s", err2); return (-1); } break; @@ -512,7 +512,7 @@ static int readIntegerData(FILE *strm, struct Input *in) case 0: /* TEXTIN */ for (i = 0; i < len; i++, in64++) { if (fscanf(strm, "%s", buffer) < 1) { - (void) fprintf(stderr, "%s", err1); + (void) HDfprintf(stderr, "%s", err1); return (-1); } *in64 = (H5DT_INT64) HDstrtoll(buffer, NULL, 10); @@ -522,21 +522,21 @@ static int readIntegerData(FILE *strm, struct Input *in) case 4: /* IN */ for (i = 0; i < len; i++, in64++) { if (HDfread((char *) in64, sizeof(H5DT_INT64), 1, strm) != 1) { - (void) fprintf(stderr, "%s", err1); + (void) HDfprintf(stderr, "%s", err1); return (-1); } } break; default: - (void) fprintf(stderr, "%s", err2); + (void) HDfprintf(stderr, "%s", err2); return (-1); } break; #endif /* ifdef H5_SIZEOF_LONG_LONG */ default: - (void) fprintf(stderr, "%s", err3); + (void) HDfprintf(stderr, "%s", err3); break; } return (0); @@ -569,7 +569,7 @@ static int readUIntegerData(FILE *strm, struct Input *in) in08 = (H5DT_UINT8 *) in->data; for (i = 0; i < len; i++, in08++) { if (fscanf(strm, "%hu", &temp) != 1) { - (void) fprintf(stderr, "%s", err1); + (void) HDfprintf(stderr, "%s", err1); return (-1); } (*in08) = (H5DT_UINT8) temp; @@ -580,14 +580,14 @@ static int readUIntegerData(FILE *strm, struct Input *in) in08 = (H5DT_UINT8 *) in->data; for (i = 0; i < len; i++, in08++) { if (HDfread((char *) in08, sizeof(H5DT_UINT8), 1, strm) != 1) { - (void) fprintf(stderr, "%s", err1); + (void) HDfprintf(stderr, "%s", err1); return (-1); } } break; default: - (void) fprintf(stderr, "%s", err2); + (void) HDfprintf(stderr, "%s", err2); return (-1); } break; @@ -598,7 +598,7 @@ static int readUIntegerData(FILE *strm, struct Input *in) case 6: /* TEXTUIN */ for (i = 0; i < len; i++, in16++) { if (fscanf(strm, "%hu", in16) != 1) { - (void) fprintf(stderr, "%s", err1); + (void) HDfprintf(stderr, "%s", err1); return (-1); } } @@ -607,14 +607,14 @@ static int readUIntegerData(FILE *strm, struct Input *in) case 7: /* UIN */ for (i = 0; i < len; i++, in16++) { if (HDfread((char *) in16, sizeof(H5DT_UINT16), 1, strm) != 1) { - (void) fprintf(stderr, "%s", err1); + (void) HDfprintf(stderr, "%s", err1); return (-1); } } break; default: - (void) fprintf(stderr, "%s", err2); + (void) HDfprintf(stderr, "%s", err2); return (-1); } break; @@ -625,7 +625,7 @@ static int readUIntegerData(FILE *strm, struct Input *in) case 6: /* TEXTUIN */ for (i = 0; i < len; i++, in32++) { if (fscanf(strm, "%u", in32) != 1) { - (void) fprintf(stderr, "%s", err1); + (void) HDfprintf(stderr, "%s", err1); return (-1); } } @@ -634,14 +634,14 @@ static int readUIntegerData(FILE *strm, struct Input *in) case 7: /* UIN */ for (i = 0; i < len; i++, in32++) { if (HDfread((char *) in32, sizeof(H5DT_UINT32), 1, strm) != 1) { - (void) fprintf(stderr, "%s", err1); + (void) HDfprintf(stderr, "%s", err1); return (-1); } } break; default: - (void) fprintf(stderr, "%s", err2); + (void) HDfprintf(stderr, "%s", err2); return (-1); } break; @@ -653,7 +653,7 @@ static int readUIntegerData(FILE *strm, struct Input *in) case 6: /* TEXTUIN */ for (i = 0; i < len; i++, in64++) { if (fscanf(strm, "%s", buffer) < 1) { - (void) fprintf(stderr, "%s", err1); + (void) HDfprintf(stderr, "%s", err1); return (-1); } *in64 = (H5DT_UINT64) HDstrtoll(buffer, NULL, 10); @@ -663,21 +663,21 @@ static int readUIntegerData(FILE *strm, struct Input *in) case 7: /* UIN */ for (i = 0; i < len; i++, in64++) { if (HDfread((char *) in64, sizeof(H5DT_UINT64), 1, strm) != 1) { - (void) fprintf(stderr, "%s", err1); + (void) HDfprintf(stderr, "%s", err1); return (-1); } } break; default: - (void) fprintf(stderr, "%s", err2); + (void) HDfprintf(stderr, "%s", err2); return (-1); } break; #endif /* ifdef H5_SIZEOF_LONG_LONG */ default: - (void) fprintf(stderr, "%s", err3); + (void) HDfprintf(stderr, "%s", err3); break; } return (0); @@ -705,7 +705,7 @@ static int readFloatData(FILE *strm, struct Input *in) case 1: /* TEXTFP */ for (i = 0; i < len; i++, fp32++) { if (fscanf(strm, "%f", fp32) != 1) { - (void) fprintf(stderr, "%s", err1); + (void) HDfprintf(stderr, "%s", err1); return (-1); } } @@ -718,7 +718,7 @@ static int readFloatData(FILE *strm, struct Input *in) for (i = 0; i < len; i++, fp32++) { if (fscanf(strm, "%f", fp32) != 1) { - (void) fprintf(stderr, "%s", err1); + (void) HDfprintf(stderr, "%s", err1); return (-1); } } @@ -729,14 +729,14 @@ static int readFloatData(FILE *strm, struct Input *in) case 3: /* FP */ for (i = 0; i < len; i++, fp32++) { if (HDfread((char *) fp32, sizeof(H5DT_FLOAT32), 1, strm) != 1) { - (void) fprintf(stderr, "%s", err1); + (void) HDfprintf(stderr, "%s", err1); return (-1); } } break; default: - (void) fprintf(stderr, "%s", err2); + (void) HDfprintf(stderr, "%s", err2); return (-1); } break; @@ -747,7 +747,7 @@ static int readFloatData(FILE *strm, struct Input *in) case 1: /* TEXTFP */ for (i = 0; i < len; i++, fp64++) { if (fscanf(strm, "%lf", fp64) != 1) { - (void) fprintf(stderr, "%s", err1); + (void) HDfprintf(stderr, "%s", err1); return (-1); } } @@ -760,7 +760,7 @@ static int readFloatData(FILE *strm, struct Input *in) for (i = 0; i < len; i++, fp64++) { if (fscanf(strm, "%lf", fp64) != 1) { - (void) fprintf(stderr, "%s", err1); + (void) HDfprintf(stderr, "%s", err1); return (-1); } } @@ -771,20 +771,20 @@ static int readFloatData(FILE *strm, struct Input *in) case 3: /* FP */ for (i = 0; i < len; i++, fp64++) { if (HDfread((char *) fp64, sizeof(H5DT_FLOAT64), 1, strm) != 1) { - (void) fprintf(stderr, "%s", err1); + (void) HDfprintf(stderr, "%s", err1); return (-1); } } break; default: - (void) fprintf(stderr, "%s", err2); + (void) HDfprintf(stderr, "%s", err2); return (-1); } break; default: - (void) fprintf(stderr, "%s", err3); + (void) HDfprintf(stderr, "%s", err3); break; } return (0); @@ -953,34 +953,34 @@ static int allocateIntegerStorage(struct Input *in) switch (in->inputSize) { case 8: if ((in->data = (VOIDP) HDmalloc((size_t) len * sizeof(H5DT_INT8))) == NULL) { - (void) fprintf(stderr, "%s", err1); + (void) HDfprintf(stderr, "%s", err1); return (-1); } break; case 16: if ((in->data = (VOIDP) HDmalloc((size_t) len * sizeof(H5DT_INT16))) == NULL) { - (void) fprintf(stderr, "%s", err1); + (void) HDfprintf(stderr, "%s", err1); return (-1); } break; case 32: if ((in->data = (VOIDP) HDmalloc((size_t) len * sizeof(H5DT_INT32))) == NULL) { - (void) fprintf(stderr, "%s", err1); + (void) HDfprintf(stderr, "%s", err1); return (-1); } break; case 64: if ((in->data = (VOIDP) HDmalloc((size_t) len * sizeof(H5DT_INT64))) == NULL) { - (void) fprintf(stderr, "%s", err1); + (void) HDfprintf(stderr, "%s", err1); return (-1); } break; default: - (void) fprintf(stderr, "%s", err2); + (void) HDfprintf(stderr, "%s", err2); break; } return (0); @@ -999,34 +999,34 @@ static int allocateUIntegerStorage(struct Input *in) switch (in->inputSize) { case 8: if ((in->data = (VOIDP) HDmalloc((size_t) len * sizeof(H5DT_UINT8))) == NULL) { - (void) fprintf(stderr, "%s", err1); + (void) HDfprintf(stderr, "%s", err1); return (-1); } break; case 16: if ((in->data = (VOIDP) HDmalloc((size_t) len * sizeof(H5DT_UINT16))) == NULL) { - (void) fprintf(stderr, "%s", err1); + (void) HDfprintf(stderr, "%s", err1); return (-1); } break; case 32: if ((in->data = (VOIDP) HDmalloc((size_t) len * sizeof(H5DT_UINT32))) == NULL) { - (void) fprintf(stderr, "%s", err1); + (void) HDfprintf(stderr, "%s", err1); return (-1); } break; case 64: if ((in->data = (VOIDP) HDmalloc((size_t) len * sizeof(H5DT_UINT64))) == NULL) { - (void) fprintf(stderr, "%s", err1); + (void) HDfprintf(stderr, "%s", err1); return (-1); } break; default: - (void) fprintf(stderr, "%s", err2); + (void) HDfprintf(stderr, "%s", err2); break; } return (0); @@ -1045,20 +1045,20 @@ static int allocateFloatStorage(struct Input *in) switch (in->inputSize) { case 32: if ((in->data = (VOIDP) HDmalloc((size_t) len * sizeof(H5DT_FLOAT32))) == NULL) { - (void) fprintf(stderr, "%s", err1); + (void) HDfprintf(stderr, "%s", err1); return (-1); } break; case 64: if ((in->data = (VOIDP) HDmalloc((size_t) len * sizeof(H5DT_FLOAT64))) == NULL) { - (void) fprintf(stderr, "%s", err1); + (void) HDfprintf(stderr, "%s", err1); return (-1); } break; default: - (void) fprintf(stderr, "%s", err2); + (void) HDfprintf(stderr, "%s", err2); break; } return (0); @@ -1116,30 +1116,30 @@ static int processConfigurationFile(char *infile, struct Input *in) */ if ((strm = HDfopen(infile, "r")) == NULL) { - (void) fprintf(stderr, err1, infile); + (void) HDfprintf(stderr, err1, infile); return (-1); } while (fscanf(strm, "%s", key) == 1) { if ((kindex = mapKeywordToIndex(key)) == -1) { - (void) fprintf(stderr, err2, infile); + (void) HDfprintf(stderr, err2, infile); HDfclose(strm); return (-1); } switch (kindex) { case 0: /* PATH */ if (in->configOptionVector[PATH] == 1) { - (void) fprintf(stderr, err3a, infile); + (void) HDfprintf(stderr, err3a, infile); HDfclose(strm); return (-1); } if (fscanf(strm, "%s", temp) != 1) { - (void) fprintf(stderr, "%s", err18); + (void) HDfprintf(stderr, "%s", err18); HDfclose(strm); return (-1); } if (parsePathInfo(&in->path, temp) == -1) { - (void) fprintf(stderr, err3b, infile); + (void) HDfprintf(stderr, err3b, infile); HDfclose(strm); return (-1); } @@ -1148,18 +1148,18 @@ static int processConfigurationFile(char *infile, struct Input *in) case 1: /* INPUT-CLASS */ if (in->configOptionVector[INPUT_CLASS] == 1) { - (void) fprintf(stderr, err4a, infile); + (void) HDfprintf(stderr, err4a, infile); HDfclose(strm); return (-1); } if (fscanf(strm, "%s", temp) != 1) { - (void) fprintf(stderr, "%s", err18); + (void) HDfprintf(stderr, "%s", err18); HDfclose(strm); return (-1); } if (getInputClass(in, temp) == -1) { - (void) fprintf(stderr, err4b, infile); + (void) HDfprintf(stderr, err4b, infile); HDfclose(strm); return (-1); } @@ -1180,17 +1180,17 @@ static int processConfigurationFile(char *infile, struct Input *in) case 2: /* INPUT-SIZE */ if (in->configOptionVector[INPUT_SIZE] == 1) { - (void) fprintf(stderr, err5a, infile); + (void) HDfprintf(stderr, err5a, infile); HDfclose(strm); return (-1); } if (fscanf(strm, "%d", (&ival)) != 1) { - (void) fprintf(stderr, "%s", err19); + (void) HDfprintf(stderr, "%s", err19); HDfclose(strm); return (-1); } if (getInputSize(in, ival) == -1) { - (void) fprintf(stderr, err5b, infile); + (void) HDfprintf(stderr, err5b, infile); HDfclose(strm); return (-1); } @@ -1203,13 +1203,13 @@ static int processConfigurationFile(char *infile, struct Input *in) case 3: /* RANK */ if (in->configOptionVector[RANK] == 1) { - (void) fprintf(stderr, err6a, infile); + (void) HDfprintf(stderr, err6a, infile); HDfclose(strm); return (-1); } if (getRank(in, strm) == -1) { - (void) fprintf(stderr, err6b, infile); + (void) HDfprintf(stderr, err6b, infile); HDfclose(strm); return (-1); } @@ -1218,18 +1218,18 @@ static int processConfigurationFile(char *infile, struct Input *in) case 4: /* DIMENSION-SIZES */ if (in->configOptionVector[DIM] == 1) { - (void) fprintf(stderr, err7a, infile); + (void) HDfprintf(stderr, err7a, infile); HDfclose(strm); return (-1); } if (in->configOptionVector[RANK] == 0) { - (void) fprintf(stderr, err7b, infile); + (void) HDfprintf(stderr, err7b, infile); HDfclose(strm); return (-1); } if (getDimensionSizes(in, strm) == -1) { - (void) fprintf(stderr, err7c, infile); + (void) HDfprintf(stderr, err7c, infile); HDfclose(strm); return (-1); } @@ -1238,13 +1238,13 @@ static int processConfigurationFile(char *infile, struct Input *in) case 5: /* OUTPUT-CLASS */ if (in->configOptionVector[OUTPUT_CLASS] == 1) { - (void) fprintf(stderr, err8a, infile); + (void) HDfprintf(stderr, err8a, infile); HDfclose(strm); return (-1); } if (getOutputClass(in, strm) == -1) { - (void) fprintf(stderr, err8b, infile); + (void) HDfprintf(stderr, err8b, infile); HDfclose(strm); return (-1); } @@ -1253,13 +1253,13 @@ static int processConfigurationFile(char *infile, struct Input *in) case 6: /* OUTPUT-SIZE */ if (in->configOptionVector[OUTPUT_SIZE] == 1) { - (void) fprintf(stderr, err9a, infile); + (void) HDfprintf(stderr, err9a, infile); HDfclose(strm); return (-1); } if (getOutputSize(in, strm) == -1) { - (void) fprintf(stderr, err9b, infile); + (void) HDfprintf(stderr, err9b, infile); HDfclose(strm); return (-1); } @@ -1268,13 +1268,13 @@ static int processConfigurationFile(char *infile, struct Input *in) case 7: /* OUTPUT-ARCHITECTURE */ if (in->configOptionVector[OUTPUT_ARCH] == 1) { - (void) fprintf(stderr, err10a, infile); + (void) HDfprintf(stderr, err10a, infile); HDfclose(strm); return (-1); } if (getOutputArchitecture(in, strm) == -1) { - (void) fprintf(stderr, err10b, infile); + (void) HDfprintf(stderr, err10b, infile); HDfclose(strm); return (-1); } @@ -1283,13 +1283,13 @@ static int processConfigurationFile(char *infile, struct Input *in) case 8: /* OUTPUT-BYTE-ORDER */ if (in->configOptionVector[OUTPUT_B_ORDER] == 1) { - (void) fprintf(stderr, err11a, infile); + (void) HDfprintf(stderr, err11a, infile); HDfclose(strm); return (-1); } if (getOutputByteOrder(in, strm) == -1) { - (void) fprintf(stderr, err11b, infile); + (void) HDfprintf(stderr, err11b, infile); HDfclose(strm); return (-1); } @@ -1298,19 +1298,19 @@ static int processConfigurationFile(char *infile, struct Input *in) case 9: /* CHUNKED-DIMENSION-SIZES */ if (in->configOptionVector[CHUNK] == 1) { - (void) fprintf(stderr, err12a, infile); + (void) HDfprintf(stderr, err12a, infile); HDfclose(strm); return (-1); } /* cant appear before dimension sizes have been provided */ if (in->configOptionVector[DIM] == 0) { - (void) fprintf(stderr, err12b, infile); + (void) HDfprintf(stderr, err12b, infile); HDfclose(strm); return (-1); } if (getChunkedDimensionSizes(in, strm) == -1) { - (void) fprintf(stderr, err12c, infile); + (void) HDfprintf(stderr, err12c, infile); HDfclose(strm); return (-1); } @@ -1319,13 +1319,13 @@ static int processConfigurationFile(char *infile, struct Input *in) case 10: /* COMPRESSION-TYPE */ if (in->configOptionVector[COMPRESS] == 1) { - (void) fprintf(stderr, err13a, infile); + (void) HDfprintf(stderr, err13a, infile); HDfclose(strm); return (-1); } if (getCompressionType(in, strm) == -1) { - (void) fprintf(stderr, err13b, infile); + (void) HDfprintf(stderr, err13b, infile); HDfclose(strm); return (-1); } @@ -1339,13 +1339,13 @@ static int processConfigurationFile(char *infile, struct Input *in) case 11: /* COMPRESSION-PARAM */ if (in->configOptionVector[COMPRESS_PARAM] == 1) { - (void) fprintf(stderr, err14a, infile); + (void) HDfprintf(stderr, err14a, infile); HDfclose(strm); return (-1); } if (getCompressionParameter(in, strm) == -1) { - (void) fprintf(stderr, err14b, infile); + (void) HDfprintf(stderr, err14b, infile); HDfclose(strm); return (-1); } @@ -1359,13 +1359,13 @@ static int processConfigurationFile(char *infile, struct Input *in) case 12: /* EXTERNAL-STORAGE */ if (in->configOptionVector[EXTERNAL] == 1) { - (void) fprintf(stderr, err15a, infile); + (void) HDfprintf(stderr, err15a, infile); HDfclose(strm); return (-1); } if (getExternalFilename(in, strm) == -1) { - (void) fprintf(stderr, err15b, infile); + (void) HDfprintf(stderr, err15b, infile); HDfclose(strm); return (-1); } @@ -1374,18 +1374,18 @@ static int processConfigurationFile(char *infile, struct Input *in) case 13: /* MAXIMUM-DIMENSIONS */ if (in->configOptionVector[EXTEND] == 1) { - (void) fprintf(stderr, err16a, infile); + (void) HDfprintf(stderr, err16a, infile); HDfclose(strm); return (-1); } /* cant appear before dimension sizes have been provided */ if (in->configOptionVector[DIM] == 0) { - (void) fprintf(stderr, err16b, infile); + (void) HDfprintf(stderr, err16b, infile); HDfclose(strm); return (-1); } if (getMaximumDimensionSizes(in, strm) == -1) { - (void) fprintf(stderr, err16c, infile); + (void) HDfprintf(stderr, err16c, infile); HDfclose(strm); return (-1); } @@ -1402,7 +1402,7 @@ static int processConfigurationFile(char *infile, struct Input *in) */ if (validateConfigurationParameters(in) == -1) { - (void) fprintf(stderr, err17, infile); + (void) HDfprintf(stderr, err17, infile); HDfclose(strm); return (-1); } @@ -1428,20 +1428,20 @@ static int validateConfigurationParameters(struct Input *in) return (0); if ((in->configOptionVector[DIM] != 1) || (in->configOptionVector[RANK] != 1)) { - (void) fprintf(stderr, "%s", err1); + (void) HDfprintf(stderr, "%s", err1); return (-1); } if (in->configOptionVector[EXTERNAL] == 1) { if ((in->configOptionVector[COMPRESS] == 1) || (in->configOptionVector[CHUNK] == 1) || (in->configOptionVector[EXTEND] == 1)) { - (void) fprintf(stderr, "%s", err2); + (void) HDfprintf(stderr, "%s", err2); return (-1); } } if ((in->configOptionVector[COMPRESS] == 1) || (in->configOptionVector[EXTEND] == 1)) { if (in->configOptionVector[CHUNK] != 1) { - (void) fprintf(stderr, "%s", err3); + (void) HDfprintf(stderr, "%s", err3); return (-1); } } @@ -1449,26 +1449,26 @@ static int validateConfigurationParameters(struct Input *in) /* Arch cant be STD if O/p class is FP */ if (in->outputArchitecture == 1) if (in->outputClass == 1) { - (void) fprintf(stderr, "%s", err4a); + (void) HDfprintf(stderr, "%s", err4a); return (-1); } /* Arch cant be IEEE if O/p class is IN */ if (in->outputArchitecture == 2) if (in->outputClass == 0) { - (void) fprintf(stderr, "%s", err4b); + (void) HDfprintf(stderr, "%s", err4b); return (-1); } if (in->outputClass == 1) if (in->outputSize != 32 && in->outputSize != 64) { - (void) fprintf(stderr, "%s", err5); + (void) HDfprintf(stderr, "%s", err5); return (-1); } #ifndef H5_SIZEOF_LONG_LONG if (in->inputSize == 64 && (in->inputClass == 0 || in->inputClass == 4 || in->inputClass == 6 || in->inputClass == 7) ) { - (void) fprintf(stderr, "%s", err6); + (void) HDfprintf(stderr, "%s", err6); return -1; } #endif @@ -1494,7 +1494,7 @@ static int parsePathInfo(struct path_info *path, char *temp) token = HDstrtok (temp, delimiter); if (HDstrlen(token) >= MAX_PATH_NAME_LENGTH) { - (void) fprintf(stderr, err1); + (void) HDfprintf(stderr, err1); return (-1); } HDstrcpy(path->group[i++],token); @@ -1504,7 +1504,7 @@ static int parsePathInfo(struct path_info *path, char *temp) if (token == NULL) break; if (HDstrlen(token) >= MAX_PATH_NAME_LENGTH) { - (void) fprintf(stderr, err1); + (void) HDfprintf(stderr, err1); return (-1); } HDstrcpy(path->group[i++],token); @@ -1533,7 +1533,7 @@ static int parseDimensions(struct Input *in, char *strm) } in->rank = i + 1; if ((in->sizeOfDimension = (hsize_t *) HDmalloc ((size_t) in->rank * sizeof(hsize_t))) == NULL) { - (void) fprintf(stderr, "%s", err1); + (void) HDfprintf(stderr, "%s", err1); return (-1); } @@ -1560,12 +1560,12 @@ static int getOutputClass(struct Input *in, FILE *strm) const char *err2 = "Invalid value for output class.\n"; if (fscanf(strm, "%s", temp) != 1) { - (void) fprintf(stderr, "%s", err1); + (void) HDfprintf(stderr, "%s", err1); return (-1); } if ((kindex = OutputClassStrToInt(temp)) == -1) { - (void) fprintf(stderr, "%s", err2); + (void) HDfprintf(stderr, "%s", err2); return (-1); } @@ -1593,7 +1593,7 @@ static int getOutputSize(struct Input *in, FILE *strm) const char *err2 = "Invalid value for output size.\n"; if (fscanf(strm, "%d", (&ival)) != 1) { - (void) fprintf(stderr, "%s", err1); + (void) HDfprintf(stderr, "%s", err1); return (-1); } @@ -1602,7 +1602,7 @@ static int getOutputSize(struct Input *in, FILE *strm) in->outputSize = ival; return (0); } - (void) fprintf(stderr, "%s", err2); + (void) HDfprintf(stderr, "%s", err2); return (-1); } @@ -1612,7 +1612,7 @@ static int getInputClass(struct Input *in, char * temp) const char *err1 = "Invalid value for input class.\n"; if ((kindex = InputClassStrToInt(temp)) == -1) { - (void) fprintf(stderr, "%s", err1); + (void) HDfprintf(stderr, "%s", err1); return (-1); } @@ -1642,7 +1642,7 @@ static int getInputSize(struct Input *in, int ival) in->inputSize = ival; return (0); } - (void) fprintf(stderr, "%s", err1); + (void) HDfprintf(stderr, "%s", err1); return (-1); } @@ -1654,7 +1654,7 @@ static int getRank(struct Input *in, FILE *strm) const char *err2 = "Invalid value for rank.\n"; if (fscanf(strm, "%d", (&ival)) != 1) { - (void) fprintf(stderr, "%s", err1); + (void) HDfprintf(stderr, "%s", err1); return (-1); } if (ival >= MIN_NUM_DIMENSION && ival <= MAX_NUM_DIMENSION) { @@ -1662,7 +1662,7 @@ static int getRank(struct Input *in, FILE *strm) return (0); } - (void) fprintf(stderr, "%s", err2); + (void) HDfprintf(stderr, "%s", err2); return (-1); } @@ -1676,7 +1676,7 @@ static int getDimensionSizes(struct Input *in, FILE *strm) const char *err2 = "No. of dimensions for which dimension sizes provided is not equal to provided rank.\n"; if ((in->sizeOfDimension = (hsize_t *) HDmalloc ((size_t) in->rank * sizeof(hsize_t))) == NULL) { - (void) fprintf(stderr, "%s", err1); + (void) HDfprintf(stderr, "%s", err1); return (-1); } @@ -1684,7 +1684,7 @@ static int getDimensionSizes(struct Input *in, FILE *strm) in->sizeOfDimension[i++] = ival; if (in->rank != i) { - (void) fprintf(stderr, "%s", err2); + (void) HDfprintf(stderr, "%s", err2); return (-1); } return (0); @@ -1700,7 +1700,7 @@ static int getChunkedDimensionSizes(struct Input *in, FILE *strm) const char *err3 = "The CHUNKED-DIMENSION-SIZES cannot exceed the sizes of DIMENSION-SIZES\n"; if ((in->sizeOfChunk = (hsize_t *) HDmalloc ((size_t) in->rank * sizeof(hsize_t))) == NULL) { - (void) fprintf(stderr, "%s", err1); + (void) HDfprintf(stderr, "%s", err1); return (-1); } @@ -1708,13 +1708,13 @@ static int getChunkedDimensionSizes(struct Input *in, FILE *strm) in->sizeOfChunk[i++] = ival; if (in->rank != i) { - (void) fprintf(stderr, "%s", err2); + (void) HDfprintf(stderr, "%s", err2); return (-1); } for (i = 0; i < in->rank; i++) if (in->sizeOfChunk[i] > in->sizeOfDimension[i]) { - (void) fprintf(stderr, "%s", err3); + (void) HDfprintf(stderr, "%s", err3); return (-1); } return (0); @@ -1730,7 +1730,7 @@ static int getMaximumDimensionSizes(struct Input *in, FILE *strm) const char *err3 = "The MAXIMUM-DIMENSIONS cannot be less than the sizes of DIMENSION-SIZES. Exception: can be -1 to indicate unlimited size\n"; if ((in->maxsizeOfDimension = (hsize_t *) HDmalloc ((size_t) in->rank * sizeof(hsize_t))) == NULL) { - (void) fprintf(stderr, "%s", err1); + (void) HDfprintf(stderr, "%s", err1); return (-1); } @@ -1742,14 +1742,14 @@ static int getMaximumDimensionSizes(struct Input *in, FILE *strm) } if (in->rank != i) { - (void) fprintf(stderr, "%s", err2); + (void) HDfprintf(stderr, "%s", err2); return (-1); } for (i = 0; i < in->rank; i++) { if (in->maxsizeOfDimension[i] != H5S_UNLIMITED) if (in->maxsizeOfDimension[i] < in->sizeOfDimension[i]) { - (void) fprintf(stderr, "%s", err3); + (void) HDfprintf(stderr, "%s", err3); return (-1); } } @@ -1764,12 +1764,12 @@ static int getOutputArchitecture(struct Input *in, FILE *strm) const char *err2 = "Invalid value for output architecture.\n"; if (fscanf(strm, "%s", temp) != 1) { - (void) fprintf(stderr, "%s", err1); + (void) HDfprintf(stderr, "%s", err1); return (-1); } if ((kindex = OutputArchStrToInt(temp)) == -1) { - (void) fprintf(stderr, "%s", err2); + (void) HDfprintf(stderr, "%s", err2); return (-1); } @@ -1796,12 +1796,12 @@ static int getOutputByteOrder(struct Input *in, FILE *strm) const char *err2 = "Invalid value for output byte-order.\n"; if (fscanf(strm, "%s", temp) != 1) { - (void) fprintf(stderr, "%s", err1); + (void) HDfprintf(stderr, "%s", err1); return (-1); } if ((kindex = OutputByteOrderStrToInt(temp)) == -1) { - (void) fprintf(stderr, "%s", err2); + (void) HDfprintf(stderr, "%s", err2); return (-1); } @@ -1827,12 +1827,12 @@ static int getCompressionType(struct Input *in, FILE *strm) const char *err2 = "Invalid value for compression.\n"; if (fscanf(strm, "%s", temp) != 1) { - (void) fprintf(stderr, "%s", err1); + (void) HDfprintf(stderr, "%s", err1); return (-1); } if ((kindex = CompressionTypeStrToInt(temp)) == -1) { - (void) fprintf(stderr, "%s", err2); + (void) HDfprintf(stderr, "%s", err2); return (-1); } @@ -1868,19 +1868,19 @@ static int getCompressionParameter(struct Input *in, FILE *strm) switch (in->compressionType) { case 0: /* GZIP */ if (fscanf(strm, "%d", (&ival)) != 1) { - (void) fprintf(stderr, "%s", err1); + (void) HDfprintf(stderr, "%s", err1); return (-1); } if (ival < 0 || ival > 9) { - (void) fprintf(stderr, "%s", err2); + (void) HDfprintf(stderr, "%s", err2); return (-1); } in->compressionParam = ival; return (0); default: - (void) fprintf(stderr, "%s", err3); + (void) HDfprintf(stderr, "%s", err3); return (-1); } } @@ -1891,7 +1891,7 @@ static int getExternalFilename(struct Input *in, FILE *strm) const char *err1 = "Unable to get 'string' value.\n"; if (fscanf(strm, "%s", temp) != 1) { - (void) fprintf(stderr, "%s", err1); + (void) HDfprintf(stderr, "%s", err1); return (-1); } @@ -2183,7 +2183,7 @@ hid_t createOutputDataType(struct Input *in) break; default: - (void) fprintf(stderr, "%s", err1); + (void) HDfprintf(stderr, "%s", err1); return (-1); } return new_type; @@ -2255,7 +2255,7 @@ hid_t createInputDataType(struct Input *in) break; default: - (void) fprintf(stderr, "%s", err1); + (void) HDfprintf(stderr, "%s", err1); return (-1); } return new_type; @@ -2288,7 +2288,7 @@ static int process(struct Options *opt) { if ((file_id = H5Fopen(opt->outfile, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) { if ((file_id = H5Fcreate(opt->outfile, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) == FAIL) { - (void) fprintf(stderr, err1, opt->outfile); + (void) HDfprintf(stderr, err1, opt->outfile); return (-1); } } @@ -2299,13 +2299,13 @@ static int process(struct Options *opt) in = &(opt->infiles[k].in); if (opt->infiles[k].config == 1) { if (processConfigurationFile(opt->infiles[k].configfile, in) == -1) { - (void) fprintf(stderr, err2, opt->infiles[k].configfile); + (void) HDfprintf(stderr, err2, opt->infiles[k].configfile); return (-1); } } if (processDataFile(opt->infiles[k].datafile, in, file_id) == -1) { - (void) fprintf(stderr, err3, opt->infiles[k].datafile); + (void) HDfprintf(stderr, err3, opt->infiles[k].datafile); return (-1); } @@ -2360,7 +2360,7 @@ static int process(struct Options *opt) if (in->configOptionVector[EXTERNAL] == 1) { /* creating the external file if it doesnt exist */ if ((extfile = HDfopen(in->externFilename, "ab")) == NULL) { - (void) fprintf(stderr, "%s", err4); + (void) HDfprintf(stderr, "%s", err4); H5Pclose(proplist); H5Sclose(dataspace); H5Fclose(file_id); @@ -2381,7 +2381,7 @@ static int process(struct Options *opt) { /* create data set */ if ((dataset = H5Dcreate2(handle, in->path.group[j], outtype, dataspace, H5P_DEFAULT, proplist, H5P_DEFAULT)) < 0) { - (void) fprintf(stderr, "%s", err5); + (void) HDfprintf(stderr, "%s", err5); H5Pclose(proplist); H5Sclose(dataspace); H5Fclose(file_id); @@ -2394,7 +2394,7 @@ static int process(struct Options *opt) /* write dataset */ if (H5Dwrite(dataset, intype, H5S_ALL, H5S_ALL, H5P_DEFAULT, (VOIDP) in->data) < 0) { - (void) fprintf(stderr, "%s", err6); + (void) HDfprintf(stderr, "%s", err6); H5Dclose(dataset); H5Pclose(proplist); H5Sclose(dataspace); @@ -2423,405 +2423,405 @@ static int process(struct Options *opt) void help(char *name) { - (void) fprintf(stdout, "Name:\n\n"); - (void) fprintf(stdout, "\t%s\n\n", name); - (void) fprintf(stdout, "\t TOOL NAME:\n"); - (void) fprintf(stdout, "\t %s\n", name); - (void) fprintf(stdout, "\t SYNTAX:\n"); - (void) fprintf(stdout, "\t %s -h[elp], OR\n", name); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "Name:\n\n"); + (void) HDfprintf(stdout, "\t%s\n\n", name); + (void) HDfprintf(stdout, "\t TOOL NAME:\n"); + (void) HDfprintf(stdout, "\t %s\n", name); + (void) HDfprintf(stdout, "\t SYNTAX:\n"); + (void) HDfprintf(stdout, "\t %s -h[elp], OR\n", name); + (void) HDfprintf(stdout, "\t %s -c[onfig] [ -c[config] ...]", name); - (void) fprintf(stdout, "\t\t\t\t -o[utfile] \n\n"); - (void) fprintf(stdout, "\t PURPOSE:\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t\t\t\t -o[utfile] \n\n"); + (void) HDfprintf(stdout, "\t PURPOSE:\n"); + (void) HDfprintf(stdout, "\t To convert data stored in one or more ASCII or binary files\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t into one or more datasets (in accordance with the \n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t user-specified type and storage properties) in an existing \n"); - (void) fprintf(stdout, "\t or new HDF5 file.\n\n"); - (void) fprintf(stdout, "\t DESCRIPTION:\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t or new HDF5 file.\n\n"); + (void) HDfprintf(stdout, "\t DESCRIPTION:\n"); + (void) HDfprintf(stdout, "\t The primary objective of the utility is to convert floating\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t point or integer data stored in ASCII text or binary form \n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t into a data-set according to the type and storage properties\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t specified by the user. The utility can also accept ASCII\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t text files and store the contents in a compact form as an\n"); - (void) fprintf(stdout, "\t array of one-dimensional strings.\n\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t array of one-dimensional strings.\n\n"); + (void) HDfprintf(stdout, "\t The input data to be written as a data-set can be provided\n"); - (void) fprintf(stdout, "\t to the utility in one of the following forms:\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t to the utility in one of the following forms:\n"); + (void) HDfprintf(stdout, "\t 1. ASCII text file with numeric data (floating point or \n"); - (void) fprintf(stdout, "\t integer data). \n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t integer data). \n"); + (void) HDfprintf(stdout, "\t 2. Binary file with native floating point data (32-bit or \n"); - (void) fprintf(stdout, "\t 64-bit) \n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t 64-bit) \n"); + (void) HDfprintf(stdout, "\t 3. Binary file with native integer (signed or unsigned)\n"); - (void) fprintf(stdout, "\t data (8-bit or 16-bit or 32-bit or 64-bit). \n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t data (8-bit or 16-bit or 32-bit or 64-bit). \n"); + (void) HDfprintf(stdout, "\t 4. ASCII text file containing strings (text data).\n"); - (void) fprintf(stdout, "\t \n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t \n"); + (void) HDfprintf(stdout, "\t Every input file is associated with a configuration file \n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t also provided as an input to the utility. (See Section \n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t \"CONFIGURATION FILE\" to know how it is to be organized).\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t The class, size and dimensions of the input data is \n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t specified in this configuration file. A point to note is\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t that the floating point data in the ASCII text file may be\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t organized in the fixed floating form (for example 323.56)\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t or in a scientific notation (for example 3.23E+02). A \n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t different input-class specification is to be used for both\n"); - (void) fprintf(stdout, "\t forms.\n\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t forms.\n\n"); + (void) HDfprintf(stdout, "\t The utility extracts the input data from the input file \n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t according to the specified parameters and saves it into \n"); - (void) fprintf(stdout, "\t an H5 dataset. \n\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t an H5 dataset. \n\n"); + (void) HDfprintf(stdout, "\t The user can specify output type and storage properties in \n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t the configuration file. The user is requited to specify the \n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t path of the dataset. If the groups in the path leading to \n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t the data-set do not exist, the groups will be created by the\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t utility. If no group is specified, the dataset will be\n"); - (void) fprintf(stdout, "\t created under the root group.\n\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t created under the root group.\n\n"); + (void) HDfprintf(stdout, "\t In addition to the name, the user is also required to \n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t provide the class and size of output data to be written to \n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t the dataset and may optionally specify the output-architecure,\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t and the output-byte-order. If output-architecture is not \n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t specified the default is NATIVE. Output-byte-orders are fixed\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t for some architectures and may be specified only if output-\n"); - (void) fprintf(stdout, "\t architecture is IEEE, UNIX or STD.\n\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t architecture is IEEE, UNIX or STD.\n\n"); + (void) HDfprintf(stdout, "\t Also, layout and other storage properties such as \n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t compression, external storage and extendible data-sets may be\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t optionally specified. The layout and storage properties \n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t denote how raw data is to be organized on the disk. If these \n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t options are not specified the default is Contiguous layout \n"); - (void) fprintf(stdout, "\t and storage.\n\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t and storage.\n\n"); + (void) HDfprintf(stdout, "\t The dataset can be organized in any of the following ways:\n"); - (void) fprintf(stdout, "\t 1. Contiguous.\n"); - (void) fprintf(stdout, "\t 2. Chunked.\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t 1. Contiguous.\n"); + (void) HDfprintf(stdout, "\t 2. Chunked.\n"); + (void) HDfprintf(stdout, "\t 3. External Storage File (has to be contiguous)\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t 4. Extendible data sets (has to be chunked)\n"); - (void) fprintf(stdout, "\t 5. Compressed. (has to be chunked)\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t 5. Compressed. (has to be chunked)\n"); + (void) HDfprintf(stdout, "\t 6. Compressed & Extendible (has to be chunked)\n\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t If the user wants to store raw data in a non-HDF file then \n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t the external storage file option is to be used and the name \n"); - (void) fprintf(stdout, "\t of the file is to be specified. \n\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t of the file is to be specified. \n\n"); + (void) HDfprintf(stdout, "\t If the user wants the dimensions of the data-set to be\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t unlimited, the extendible data set option can be chosen. \n\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t The user may also specify the type of compression and the \n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t level to which the data set must be compresses by setting \n"); - (void) fprintf(stdout, "\t the compressed option.\n\n"); - (void) fprintf(stdout, "\t SYNOPSIS:\n"); - (void) fprintf(stdout, "\t h5import -h[elp], OR\n"); - (void) fprintf( stdout, + (void) HDfprintf(stdout, "\t the compressed option.\n\n"); + (void) HDfprintf(stdout, "\t SYNOPSIS:\n"); + (void) HDfprintf(stdout, "\t h5import -h[elp], OR\n"); + (void) HDfprintf( stdout, "\t h5import -c[onfig] \ [ -c[config] ...] -o[utfile] \n\n"); - (void) fprintf(stdout, "\t -h[elp]:\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t -h[elp]:\n"); + (void) HDfprintf(stdout, "\t Prints this summary of usage, and exits.\n\n"); - (void) fprintf(stdout, "\t :\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t :\n"); + (void) HDfprintf(stdout, "\t Name of the Input file(s), containing a \n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t single n-dimensional floating point or integer array \n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t in either ASCII text, native floating point(32-bit \n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t or 64-bit) or native integer(8-bit or 16-bit or \n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t 32-bit or 64-bit). Data to be specified in the order\n"); - (void) fprintf(stdout, "\t of fastest changing dimensions first.\n\n"); - (void) fprintf(stdout, "\t -c[config] :\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t of fastest changing dimensions first.\n\n"); + (void) HDfprintf(stdout, "\t -c[config] :\n"); + (void) HDfprintf(stdout, "\t Every input file should be associated with a \n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t configuration file and this is done by the -c option.\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t is the name of the configuration file.\n"); - (void) fprintf(stdout, "\t (See Section \"CONFIGURATION FILE\")\n\n"); - (void) fprintf(stdout, "\t -o[utfile] :\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t (See Section \"CONFIGURATION FILE\")\n\n"); + (void) HDfprintf(stdout, "\t -o[utfile] :\n"); + (void) HDfprintf(stdout, "\t Name of the HDF5 output file. Data from one or more \n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t input files are stored as one or more data sets in \n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t . The output file may be an existing file or \n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t it maybe new in which case it will be created.\n\n\n"); - (void) fprintf(stdout, "\t CONFIGURATION FILE:\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t CONFIGURATION FILE:\n"); + (void) HDfprintf(stdout, "\t The configuration file is an ASCII text file and must be \n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t organized as \"CONFIG-KEYWORD VALUE\" pairs, one pair on each \n"); - (void) fprintf(stdout, "\t line.\n\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t line.\n\n"); + (void) HDfprintf(stdout, "\t The configuration file may have the following keywords each \n"); - (void) fprintf(stdout, "\t followed by an acceptable value.\n\n"); - (void) fprintf(stdout, "\t Required KEYWORDS:\n"); - (void) fprintf(stdout, "\t PATH\n"); - (void) fprintf(stdout, "\t INPUT-CLASS\n"); - (void) fprintf(stdout, "\t INPUT-SIZE\n"); - (void) fprintf(stdout, "\t RANK\n"); - (void) fprintf(stdout, "\t DIMENSION-SIZES\n"); - (void) fprintf(stdout, "\t OUTPUT-CLASS\n"); - (void) fprintf(stdout, "\t OUTPUT-SIZE\n\n"); - (void) fprintf(stdout, "\t Optional KEYWORDS:\n"); - (void) fprintf(stdout, "\t OUTPUT-ARCHITECTURE\n"); - (void) fprintf(stdout, "\t OUTPUT-BYTE-ORDER\n"); - (void) fprintf(stdout, "\t CHUNKED-DIMENSION-SIZES\n"); - (void) fprintf(stdout, "\t COMPRESSION-TYPE\n"); - (void) fprintf(stdout, "\t COMPRESSION-PARAM\n"); - (void) fprintf(stdout, "\t EXTERNAL-STORAGE\n"); - (void) fprintf(stdout, "\t MAXIMUM-DIMENSIONS\n\n\n"); - (void) fprintf(stdout, "\t Values for keywords:\n"); - (void) fprintf(stdout, "\t PATH:\n"); - (void) fprintf(stdout, "\t Strings separated by spaces to represent\n"); - (void) fprintf(stdout, "\t the path of the data-set. If the groups in\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t followed by an acceptable value.\n\n"); + (void) HDfprintf(stdout, "\t Required KEYWORDS:\n"); + (void) HDfprintf(stdout, "\t PATH\n"); + (void) HDfprintf(stdout, "\t INPUT-CLASS\n"); + (void) HDfprintf(stdout, "\t INPUT-SIZE\n"); + (void) HDfprintf(stdout, "\t RANK\n"); + (void) HDfprintf(stdout, "\t DIMENSION-SIZES\n"); + (void) HDfprintf(stdout, "\t OUTPUT-CLASS\n"); + (void) HDfprintf(stdout, "\t OUTPUT-SIZE\n\n"); + (void) HDfprintf(stdout, "\t Optional KEYWORDS:\n"); + (void) HDfprintf(stdout, "\t OUTPUT-ARCHITECTURE\n"); + (void) HDfprintf(stdout, "\t OUTPUT-BYTE-ORDER\n"); + (void) HDfprintf(stdout, "\t CHUNKED-DIMENSION-SIZES\n"); + (void) HDfprintf(stdout, "\t COMPRESSION-TYPE\n"); + (void) HDfprintf(stdout, "\t COMPRESSION-PARAM\n"); + (void) HDfprintf(stdout, "\t EXTERNAL-STORAGE\n"); + (void) HDfprintf(stdout, "\t MAXIMUM-DIMENSIONS\n\n\n"); + (void) HDfprintf(stdout, "\t Values for keywords:\n"); + (void) HDfprintf(stdout, "\t PATH:\n"); + (void) HDfprintf(stdout, "\t Strings separated by spaces to represent\n"); + (void) HDfprintf(stdout, "\t the path of the data-set. If the groups in\n"); + (void) HDfprintf(stdout, "\t the path do no exist, they will be created. \n"); - (void) fprintf(stdout, "\t For example,\n"); - (void) fprintf(stdout, "\t PATH grp1/grp2/dataset1\n"); - (void) fprintf(stdout, "\t PATH: keyword\n"); - (void) fprintf(stdout, "\t grp1: group under the root. If\n"); - (void) fprintf(stdout, "\t non-existent will be created.\n"); - (void) fprintf(stdout, "\t grp2: group under grp1. If \n"); - (void) fprintf(stdout, "\t non-existent will be created \n"); - (void) fprintf(stdout, "\t under grp1.\n"); - (void) fprintf(stdout, "\t dataset1: the name of the data-set \n"); - (void) fprintf(stdout, "\t to be created.\n\n"); - (void) fprintf(stdout, "\t INPUT-CLASS:\n"); - (void) fprintf(stdout, "\t String denoting the type of input data.\n"); - (void) fprintf(stdout, "\t (\"TEXTIN\", \"TEXTFP\", \"FP\", \"IN\", \n"); - (void) fprintf(stdout, "\t \"STR\", \"TEXTUIN\", \"UIN\"). \n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t For example,\n"); + (void) HDfprintf(stdout, "\t PATH grp1/grp2/dataset1\n"); + (void) HDfprintf(stdout, "\t PATH: keyword\n"); + (void) HDfprintf(stdout, "\t grp1: group under the root. If\n"); + (void) HDfprintf(stdout, "\t non-existent will be created.\n"); + (void) HDfprintf(stdout, "\t grp2: group under grp1. If \n"); + (void) HDfprintf(stdout, "\t non-existent will be created \n"); + (void) HDfprintf(stdout, "\t under grp1.\n"); + (void) HDfprintf(stdout, "\t dataset1: the name of the data-set \n"); + (void) HDfprintf(stdout, "\t to be created.\n\n"); + (void) HDfprintf(stdout, "\t INPUT-CLASS:\n"); + (void) HDfprintf(stdout, "\t String denoting the type of input data.\n"); + (void) HDfprintf(stdout, "\t (\"TEXTIN\", \"TEXTFP\", \"FP\", \"IN\", \n"); + (void) HDfprintf(stdout, "\t \"STR\", \"TEXTUIN\", \"UIN\"). \n"); + (void) HDfprintf(stdout, "\t INPUT-CLASS \"TEXTIN\" denotes an ASCII text \n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t file with signed integer data in ASCII form,\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t INPUT-CLASS \"TEXTUIN\" denotes an ASCII text \n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t file with unsigned integer data in ASCII form,\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t \"TEXTFP\" denotes an ASCII text file containing\n"); - (void) fprintf(stdout, "\t floating point data in the fixed notation\n"); - (void) fprintf(stdout, "\t (325.34),\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t floating point data in the fixed notation\n"); + (void) HDfprintf(stdout, "\t (325.34),\n"); + (void) HDfprintf(stdout, "\t \"FP\" denotes a floating point binary file,\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t \"IN\" denotes a signed integer binary file,\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t \"UIN\" denotes an unsigned integer binary file,\n"); - (void) fprintf(stdout, "\t & \"STR\" denotes an ASCII text file the \n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t & \"STR\" denotes an ASCII text file the \n"); + (void) HDfprintf(stdout, "\t contents of which should be stored as an 1-D \n"); - (void) fprintf(stdout, "\t array of strings.\n"); - (void) fprintf(stdout, "\t If INPUT-CLASS is \"STR\", then RANK, \n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t array of strings.\n"); + (void) HDfprintf(stdout, "\t If INPUT-CLASS is \"STR\", then RANK, \n"); + (void) HDfprintf(stdout, "\t DIMENSION-SIZES, OUTPUT-CLASS, OUTPUT-SIZE, \n"); - (void) fprintf(stdout, "\t OUTPUT-ARCHITECTURE and OUTPUT-BYTE-ORDER \n"); - (void) fprintf(stdout, "\t will be ignored.\n\n\n"); - (void) fprintf(stdout, "\t INPUT-SIZE:\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t OUTPUT-ARCHITECTURE and OUTPUT-BYTE-ORDER \n"); + (void) HDfprintf(stdout, "\t will be ignored.\n\n\n"); + (void) HDfprintf(stdout, "\t INPUT-SIZE:\n"); + (void) HDfprintf(stdout, "\t Integer denoting the size of the input data \n"); - (void) fprintf(stdout, "\t (8, 16, 32, 64). \n\n"); - (void) fprintf(stdout, "\t For floating point,\n"); - (void) fprintf(stdout, "\t INPUT-SIZE can be 32 or 64.\n"); - (void) fprintf(stdout, "\t For integers (signed and unsigned)\n"); - (void) fprintf(stdout, "\t INPUT-SIZE can be 8, 16, 32 or 64.\n\n"); - (void) fprintf(stdout, "\t RANK:\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t (8, 16, 32, 64). \n\n"); + (void) HDfprintf(stdout, "\t For floating point,\n"); + (void) HDfprintf(stdout, "\t INPUT-SIZE can be 32 or 64.\n"); + (void) HDfprintf(stdout, "\t For integers (signed and unsigned)\n"); + (void) HDfprintf(stdout, "\t INPUT-SIZE can be 8, 16, 32 or 64.\n\n"); + (void) HDfprintf(stdout, "\t RANK:\n"); + (void) HDfprintf(stdout, "\t Integer denoting the number of dimensions.\n\n"); - (void) fprintf(stdout, "\t DIMENSION-SIZES:\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t DIMENSION-SIZES:\n"); + (void) HDfprintf(stdout, "\t Integers separated by spaces to denote the \n"); - (void) fprintf(stdout, "\t dimension sizes for the no. of dimensions \n"); - (void) fprintf(stdout, "\t determined by rank.\n\n"); - (void) fprintf(stdout, "\t OUTPUT-CLASS:\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t dimension sizes for the no. of dimensions \n"); + (void) HDfprintf(stdout, "\t determined by rank.\n\n"); + (void) HDfprintf(stdout, "\t OUTPUT-CLASS:\n"); + (void) HDfprintf(stdout, "\t String dentoting data type of the dataset to \n"); - (void) fprintf(stdout, "\t be written (\"IN\",\"FP\", \"UIN\")\n\n"); - (void) fprintf(stdout, "\t OUTPUT-SIZE:\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t be written (\"IN\",\"FP\", \"UIN\")\n\n"); + (void) HDfprintf(stdout, "\t OUTPUT-SIZE:\n"); + (void) HDfprintf(stdout, "\t Integer denoting the size of the data in the \n"); - (void) fprintf(stdout, "\t output dataset to be written.\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t output dataset to be written.\n"); + (void) HDfprintf(stdout, "\t If OUTPUT-CLASS is \"FP\", OUTPUT-SIZE can be \n"); - (void) fprintf(stdout, "\t 32 or 64.\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t 32 or 64.\n"); + (void) HDfprintf(stdout, "\t If OUTPUT-CLASS is \"IN\" or \"UIN\", OUTPUT-SIZE\n"); - (void) fprintf(stdout, "\t can be 8, 16, 32 or 64.\n\n"); - (void) fprintf(stdout, "\t OUTPUT-ARCHITECTURE:\n"); - (void) fprintf(stdout, "\t STRING denoting the type of output \n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t can be 8, 16, 32 or 64.\n\n"); + (void) HDfprintf(stdout, "\t OUTPUT-ARCHITECTURE:\n"); + (void) HDfprintf(stdout, "\t STRING denoting the type of output \n"); + (void) HDfprintf(stdout, "\t architecture. Can accept the following values\n"); - (void) fprintf(stdout, "\t STD\n"); - (void) fprintf(stdout, "\t IEEE\n"); - (void) fprintf(stdout, "\t INTEL\n"); - (void) fprintf(stdout, "\t CRAY\n"); - (void) fprintf(stdout, "\t MIPS\n"); - (void) fprintf(stdout, "\t ALPHA\n"); - (void) fprintf(stdout, "\t NATIVE (default)\n"); - (void) fprintf(stdout, "\t UNIX\n\n"); - (void) fprintf(stdout, "\t OUTPUT-BYTE-ORDER:\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t STD\n"); + (void) HDfprintf(stdout, "\t IEEE\n"); + (void) HDfprintf(stdout, "\t INTEL\n"); + (void) HDfprintf(stdout, "\t CRAY\n"); + (void) HDfprintf(stdout, "\t MIPS\n"); + (void) HDfprintf(stdout, "\t ALPHA\n"); + (void) HDfprintf(stdout, "\t NATIVE (default)\n"); + (void) HDfprintf(stdout, "\t UNIX\n\n"); + (void) HDfprintf(stdout, "\t OUTPUT-BYTE-ORDER:\n"); + (void) HDfprintf(stdout, "\t String denoting the output-byte-order. Ignored\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t if the OUTPUT-ARCHITECTURE is not specified or\n"); - (void) fprintf(stdout, "\t if it is IEEE, UNIX or STD. Can accept the \n"); - (void) fprintf(stdout, "\t following values.\n"); - (void) fprintf(stdout, "\t BE (default)\n"); - (void) fprintf(stdout, "\t LE\n\n"); - (void) fprintf(stdout, "\t CHUNKED-DIMENSION-SIZES:\n"); - (void) fprintf(stdout, "\t Integers separated by spaces to denote the \n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t if it is IEEE, UNIX or STD. Can accept the \n"); + (void) HDfprintf(stdout, "\t following values.\n"); + (void) HDfprintf(stdout, "\t BE (default)\n"); + (void) HDfprintf(stdout, "\t LE\n\n"); + (void) HDfprintf(stdout, "\t CHUNKED-DIMENSION-SIZES:\n"); + (void) HDfprintf(stdout, "\t Integers separated by spaces to denote the \n"); + (void) HDfprintf(stdout, "\t dimension sizes of the chunk for the no. of \n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t dimensions determined by rank. Required field\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t to denote that the dataset will be stored with\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t chunked storage. If this field is absent the\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t dataset will be stored with contiguous storage.\n\n"); - (void) fprintf(stdout, "\t COMPRESSION-TYPE:\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t COMPRESSION-TYPE:\n"); + (void) HDfprintf(stdout, "\t String denoting the type of compression to be\n"); - (void) fprintf(stdout, "\t used with the chunked storage. Requires the\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t used with the chunked storage. Requires the\n"); + (void) HDfprintf(stdout, "\t CHUNKED-DIMENSION-SIZES to be specified. The only \n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t currently supported compression method is GZIP. \n"); - (void) fprintf(stdout, "\t Will accept the following value\n"); - (void) fprintf(stdout, "\t GZIP\n\n"); - (void) fprintf(stdout, "\t COMPRESSION-PARAM:\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t Will accept the following value\n"); + (void) HDfprintf(stdout, "\t GZIP\n\n"); + (void) HDfprintf(stdout, "\t COMPRESSION-PARAM:\n"); + (void) HDfprintf(stdout, "\t Integer used to denote compression level and \n"); - (void) fprintf(stdout, "\t this option is to be always specified when \n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t this option is to be always specified when \n"); + (void) HDfprintf(stdout, "\t the COMPRESSION-TYPE option is specified. The\n"); - (void) fprintf(stdout, "\t values are applicable only to GZIP \n"); - (void) fprintf(stdout, "\t compression.\n"); - (void) fprintf(stdout, "\t Value 1-9: The level of Compression. \n"); - (void) fprintf(stdout, "\t 1 will result in the fastest \n"); - (void) fprintf(stdout, "\t compression while 9 will result in \n"); - (void) fprintf(stdout, "\t the best compression ratio. The default\n"); - (void) fprintf(stdout, "\t level of compression is 6.\n\n"); - (void) fprintf(stdout, "\t EXTERNAL-STORAGE:\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t values are applicable only to GZIP \n"); + (void) HDfprintf(stdout, "\t compression.\n"); + (void) HDfprintf(stdout, "\t Value 1-9: The level of Compression. \n"); + (void) HDfprintf(stdout, "\t 1 will result in the fastest \n"); + (void) HDfprintf(stdout, "\t compression while 9 will result in \n"); + (void) HDfprintf(stdout, "\t the best compression ratio. The default\n"); + (void) HDfprintf(stdout, "\t level of compression is 6.\n\n"); + (void) HDfprintf(stdout, "\t EXTERNAL-STORAGE:\n"); + (void) HDfprintf(stdout, "\t String to denote the name of the non-HDF5 file \n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t to store data to. Cannot be used if CHUNKED-\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t DIMENSIONS or COMPRESSION-TYPE or EXTENDIBLE-\n"); - (void) fprintf(stdout, "\t DATASET is specified.\n"); - (void) fprintf(stdout, "\t Value : the name of the \n"); - (void) fprintf(stdout, "\t external file as a string to be used.\n\n"); - (void) fprintf(stdout, "\t MAXIMUM-DIMENSIONS:\n"); - (void) fprintf(stdout, "\t Integers separated by spaces to denote the \n"); - (void) fprintf(stdout, "\t maximum dimension sizes of all the \n"); - (void) fprintf(stdout, "\t dimensions determined by rank. Requires the\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t DATASET is specified.\n"); + (void) HDfprintf(stdout, "\t Value : the name of the \n"); + (void) HDfprintf(stdout, "\t external file as a string to be used.\n\n"); + (void) HDfprintf(stdout, "\t MAXIMUM-DIMENSIONS:\n"); + (void) HDfprintf(stdout, "\t Integers separated by spaces to denote the \n"); + (void) HDfprintf(stdout, "\t maximum dimension sizes of all the \n"); + (void) HDfprintf(stdout, "\t dimensions determined by rank. Requires the\n"); + (void) HDfprintf(stdout, "\t CHUNKED-DIMENSION-SIZES to be specified. A value of \n"); - (void) fprintf(stdout, "\t -1 for any dimension implies UNLIMITED \n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t -1 for any dimension implies UNLIMITED \n"); + (void) HDfprintf(stdout, "\t DIMENSION size for that particular dimension.\n\n"); - (void) fprintf(stdout, "\t EXAMPLES:\n"); - (void) fprintf(stdout, "\t 1. Configuration File may look like:\n\n"); - (void) fprintf(stdout, "\t PATH work h5 pkamat First-set\n"); - (void) fprintf(stdout, "\t INPUT-CLASS TEXTFP\n"); - (void) fprintf(stdout, "\t RANK 3\n"); - (void) fprintf(stdout, "\t DIMENSION-SIZES 5 2 4\n"); - (void) fprintf(stdout, "\t OUTPUT-CLASS FP\n"); - (void) fprintf(stdout, "\t OUTPUT-SIZE 64\n"); - (void) fprintf(stdout, "\t OUTPUT-ARCHITECTURE IEEE\n"); - (void) fprintf(stdout, "\t OUTPUT-BYTE-ORDER LE\n"); - (void) fprintf(stdout, "\t CHUNKED-DIMENSION-SIZES 2 2 2 \n\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t EXAMPLES:\n"); + (void) HDfprintf(stdout, "\t 1. Configuration File may look like:\n\n"); + (void) HDfprintf(stdout, "\t PATH work h5 pkamat First-set\n"); + (void) HDfprintf(stdout, "\t INPUT-CLASS TEXTFP\n"); + (void) HDfprintf(stdout, "\t RANK 3\n"); + (void) HDfprintf(stdout, "\t DIMENSION-SIZES 5 2 4\n"); + (void) HDfprintf(stdout, "\t OUTPUT-CLASS FP\n"); + (void) HDfprintf(stdout, "\t OUTPUT-SIZE 64\n"); + (void) HDfprintf(stdout, "\t OUTPUT-ARCHITECTURE IEEE\n"); + (void) HDfprintf(stdout, "\t OUTPUT-BYTE-ORDER LE\n"); + (void) HDfprintf(stdout, "\t CHUNKED-DIMENSION-SIZES 2 2 2 \n\n"); + (void) HDfprintf(stdout, "\t The above configuration will accept a floating point array \n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t (5 x 2 x 4) in an ASCII file with the rank and dimension sizes \n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t specified and will save it in a chunked data-set (of pattern \n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t 2 X 2 X 2) of 64-bit floating point in the little-endian order \n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t and IEEE architecture. The dataset will be stored at\n"); - (void) fprintf(stdout, "\t \"/work/h5/pkamat/First-set\"\n\n"); - (void) fprintf(stdout, "\t 2. Another configuration could be:\n\n"); - (void) fprintf(stdout, "\t PATH Second-set\n"); - (void) fprintf(stdout, "\t INPUT-CLASS IN \n"); - (void) fprintf(stdout, "\t RANK 5\n"); - (void) fprintf(stdout, "\t DIMENSION-SIZES 6 3 5 2 4\n"); - (void) fprintf(stdout, "\t OUTPUT-CLASS IN\n"); - (void) fprintf(stdout, "\t OUTPUT-SIZE 32\n"); - (void) fprintf(stdout, "\t CHUNKED-DIMENSION-SIZES 2 2 2 2 2\n"); - (void) fprintf(stdout, "\t EXTENDIBLE-DATASET 1 3 \n"); - (void) fprintf(stdout, "\t COMPRESSION-TYPE GZIP\n"); - (void) fprintf(stdout, "\t COMPRESSION-PARAM 7\n\n\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t \"/work/h5/pkamat/First-set\"\n\n"); + (void) HDfprintf(stdout, "\t 2. Another configuration could be:\n\n"); + (void) HDfprintf(stdout, "\t PATH Second-set\n"); + (void) HDfprintf(stdout, "\t INPUT-CLASS IN \n"); + (void) HDfprintf(stdout, "\t RANK 5\n"); + (void) HDfprintf(stdout, "\t DIMENSION-SIZES 6 3 5 2 4\n"); + (void) HDfprintf(stdout, "\t OUTPUT-CLASS IN\n"); + (void) HDfprintf(stdout, "\t OUTPUT-SIZE 32\n"); + (void) HDfprintf(stdout, "\t CHUNKED-DIMENSION-SIZES 2 2 2 2 2\n"); + (void) HDfprintf(stdout, "\t EXTENDIBLE-DATASET 1 3 \n"); + (void) HDfprintf(stdout, "\t COMPRESSION-TYPE GZIP\n"); + (void) HDfprintf(stdout, "\t COMPRESSION-PARAM 7\n\n\n"); + (void) HDfprintf(stdout, "\t The above configuration will accept an integer array \n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t (6 X 3 X 5 x 2 x 4) in a binary file with the rank and \n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t dimension sizes specified and will save it in a chunked data-set\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t (of pattern 2 X 2 X 2 X 2 X 2) of 32-bit floating point in \n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t native format (as output-architecture is not specified). The \n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t first and the third dimension will be defined as unlimited. The \n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t data-set will be compressed using GZIP and a compression level \n"); - (void) fprintf(stdout, "\t of 7.\n"); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\t of 7.\n"); + (void) HDfprintf(stdout, "\t The dataset will be stored at \"/Second-set\"\n\n"); return; } void usage(char *name) { - (void) fprintf(stdout, "\nUsage:\t%s -h[elp], OR\n", name); - (void) fprintf(stdout, + (void) HDfprintf(stdout, "\nUsage:\t%s -h[elp], OR\n", name); + (void) HDfprintf(stdout, "\t%s -c[onfig] \ [ -c[config] ...] -o[utfile] \n\n", name); return; diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c index b06f302..b51c7e1 100644 --- a/tools/h5ls/h5ls.c +++ b/tools/h5ls/h5ls.c @@ -176,7 +176,7 @@ static herr_t visit_obj(hid_t file, const char *oname, iter_t *iter); static void usage (void) { - fprintf(stderr, "\ + HDfprintf(stderr, "\ usage: %s [OPTIONS] [OBJECTS...]\n\ OPTIONS\n\ -h, -?, --help Print a usage message and exit\n\ @@ -263,39 +263,39 @@ display_string(FILE *stream, const char *s, hbool_t escape_spaces) for (/*void*/; s && *s; s++) { switch (*s) { case '"': - if (stream) fprintf(stream, "\\\""); + if (stream) HDfprintf(stream, "\\\""); nprint += 2; break; case '\\': - if (stream) fprintf(stream, "\\\\"); + if (stream) HDfprintf(stream, "\\\\"); nprint += 2; break; case '\b': - if (stream) fprintf(stream, "\\b"); + if (stream) HDfprintf(stream, "\\b"); nprint += 2; break; case '\f': - if (stream) fprintf(stream, "\\f"); + if (stream) HDfprintf(stream, "\\f"); nprint += 2; break; case '\n': - if (stream) fprintf(stream, "\\n"); + if (stream) HDfprintf(stream, "\\n"); nprint += 2; break; case '\r': - if (stream) fprintf(stream, "\\r"); + if (stream) HDfprintf(stream, "\\r"); nprint += 2; break; case '\t': - if (stream) fprintf(stream, "\\t"); + if (stream) HDfprintf(stream, "\\t"); nprint += 2; break; case ' ': if (escape_spaces) { - if (stream) fprintf(stream, "\\ "); + if (stream) HDfprintf(stream, "\\ "); nprint += 2; } else { - if (stream) fprintf(stream, " "); + if (stream) HDfprintf(stream, " "); nprint++; } break; @@ -305,7 +305,7 @@ display_string(FILE *stream, const char *s, hbool_t escape_spaces) nprint++; } else { if (stream) { - fprintf(stream, "\\%03o", *((const unsigned char*)s)); + HDfprintf(stream, "\\%03o", *((const unsigned char*)s)); } nprint += 4; } @@ -2515,7 +2515,7 @@ dump_dataset_values(hid_t dset) H5Tclose(f_type); - fprintf(stdout, "\n"); + HDfprintf(stdout, "\n"); h5tools_str_close(&buffer); } @@ -2694,14 +2694,14 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t UNUSED *ainfo, HDfree(buf); H5Tclose(p_type); } /* end if */ - fprintf(stdout, "\n"); + HDfprintf(stdout, "\n"); H5Sclose(space); H5Tclose(type); H5Aclose(attr); } else { - fprintf(stdout, "\n"); + HDfprintf(stdout, "\n"); } h5tools_str_close(&buffer); @@ -3296,7 +3296,7 @@ visit_obj(hid_t file, const char *oname, iter_t *iter) if(H5O_TYPE_GROUP == oi.type && !grp_literal_g) { /* Get ID for group */ if(!iter->symlink_target && (iter->gid = H5Gopen2(file, oname, H5P_DEFAULT)) < 0) { - fprintf(stderr, "%s: unable to open '%s' as group\n", iter->fname, oname); + HDfprintf(stderr, "%s: unable to open '%s' as group\n", iter->fname, oname); return 0; /* Previously "continue", when this code was in main(). * We don't "continue" here in order to close the file * and free the file name properly. */ @@ -3424,14 +3424,14 @@ is_valid_args(void) if(recursive_g && grp_literal_g) { - fprintf(stderr, "Error: 'recursive' option not compatible with 'group info' option!\n\n"); + HDfprintf(stderr, "Error: 'recursive' option not compatible with 'group info' option!\n\n"); ret = FALSE; goto out; } if(no_dangling_link_g && !follow_symlink_g) { - fprintf(stderr, "Error: --no-dangling-links must be used along with --follow-symlinks option!\n\n"); + HDfprintf(stderr, "Error: --no-dangling-links must be used along with --follow-symlinks option!\n\n"); ret = FALSE; goto out; } @@ -3727,7 +3727,7 @@ main(int argc, const char *argv[]) } /* end while */ if(file < 0) { - fprintf(stderr, "%s: unable to open file\n", argv[argno-1]); + HDfprintf(stderr, "%s: unable to open file\n", argv[argno-1]); HDfree(fname); err_exit = 1; continue; @@ -3740,7 +3740,7 @@ main(int argc, const char *argv[]) iter.base_len -= oname[iter.base_len-1] == '/'; x = oname; if(NULL == (oname = HDstrdup(oname))) { - fprintf(stderr, "memory allocation failed\n"); + HDfprintf(stderr, "memory allocation failed\n"); leave(EXIT_FAILURE); } *x = '\0'; diff --git a/tools/h5stat/h5stat.c b/tools/h5stat/h5stat.c index f6ed4b8..dd7adf9 100644 --- a/tools/h5stat/h5stat.c +++ b/tools/h5stat/h5stat.c @@ -239,21 +239,21 @@ leave(int ret) static void usage(const char *prog) { fflush(stdout); - fprintf(stdout, "Usage: %s [OPTIONS] file\n", prog); - fprintf(stdout, "\n"); - fprintf(stdout, " OPTIONS\n"); - fprintf(stdout, " -h, --help Print a usage message and exit\n"); - fprintf(stdout, " -V, --version Print version number and exit\n"); - fprintf(stdout, " -f, --file Print file information\n"); - fprintf(stdout, " -F, --filemetadata Print file space information for file's metadata\n"); - fprintf(stdout, " -g, --group Print group information\n"); - fprintf(stdout, " -G, --groupmetadata Print file space information for groups' metadata\n"); - fprintf(stdout, " -d, --dset Print dataset information\n"); - fprintf(stdout, " -D, --dsetmetadata Print file space information for datasets' metadata\n"); - fprintf(stdout, " -T, --dtypemetadata Print datasets' datatype information\n"); - fprintf(stdout, " -A, --attribute Print attribute information\n"); - fprintf(stdout, " -s, --freespace Print free space information\n"); - fprintf(stdout, " -S, --summary Print summary of file space information\n"); + HDfprintf(stdout, "Usage: %s [OPTIONS] file\n", prog); + HDfprintf(stdout, "\n"); + HDfprintf(stdout, " OPTIONS\n"); + HDfprintf(stdout, " -h, --help Print a usage message and exit\n"); + HDfprintf(stdout, " -V, --version Print version number and exit\n"); + HDfprintf(stdout, " -f, --file Print file information\n"); + HDfprintf(stdout, " -F, --filemetadata Print file space information for file's metadata\n"); + HDfprintf(stdout, " -g, --group Print group information\n"); + HDfprintf(stdout, " -G, --groupmetadata Print file space information for groups' metadata\n"); + HDfprintf(stdout, " -d, --dset Print dataset information\n"); + HDfprintf(stdout, " -D, --dsetmetadata Print file space information for datasets' metadata\n"); + HDfprintf(stdout, " -T, --dtypemetadata Print datasets' datatype information\n"); + HDfprintf(stdout, " -A, --attribute Print attribute information\n"); + HDfprintf(stdout, " -s, --freespace Print free space information\n"); + HDfprintf(stdout, " -S, --summary Print summary of file space information\n"); } diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index 53688d9..7376642 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -25,11 +25,11 @@ * Debug printf macros. The prefix allows output filtering by test scripts. */ #ifdef H5DIFF_DEBUG -#define h5diffdebug(x) fprintf(stderr, "h5diff debug: " x) -#define h5diffdebug2(x1, x2) fprintf(stderr, "h5diff debug: " x1, x2) -#define h5diffdebug3(x1, x2, x3) fprintf(stderr, "h5diff debug: " x1, x2, x3) -#define h5diffdebug4(x1, x2, x3, x4) fprintf(stderr, "h5diff debug: " x1, x2, x3, x4) -#define h5diffdebug5(x1, x2, x3, x4, x5) fprintf(stderr, "h5diff debug: " x1, x2, x3, x4, x5) +#define h5diffdebug(x) HDfprintf(stderr, "h5diff debug: " x) +#define h5diffdebug2(x1, x2) HDfprintf(stderr, "h5diff debug: " x1, x2) +#define h5diffdebug3(x1, x2, x3) HDfprintf(stderr, "h5diff debug: " x1, x2, x3) +#define h5diffdebug4(x1, x2, x3, x4) HDfprintf(stderr, "h5diff debug: " x1, x2, x3, x4) +#define h5diffdebug5(x1, x2, x3, x4, x5) HDfprintf(stderr, "h5diff debug: " x1, x2, x3, x4, x5) #else #define h5diffdebug(x) #define h5diffdebug2(x1, x2) @@ -159,7 +159,7 @@ void print_manager_output(void) } else if( (outBuffOffset>0) && !g_Parallel) { - fprintf(stderr, "h5diff error: outBuffOffset>0, but we're not in parallel!\n"); + HDfprintf(stderr, "h5diff error: outBuffOffset>0, but we're not in parallel!\n"); } } @@ -995,7 +995,7 @@ hsize_t h5diff(const char *fname1, if((HDstrlen(fname1) > MAX_FILENAME) || (HDstrlen(fname2) > MAX_FILENAME)) { - fprintf(stderr, "The parallel diff only supports path names up to %d characters\n", MAX_FILENAME); + HDfprintf(stderr, "The parallel diff only supports path names up to %d characters\n", MAX_FILENAME); MPI_Abort(MPI_COMM_WORLD, 0); } /* end if */ diff --git a/tools/misc/h5debug.c b/tools/misc/h5debug.c index 7b4215a..021cfcd 100644 --- a/tools/misc/h5debug.c +++ b/tools/misc/h5debug.c @@ -23,34 +23,34 @@ * *------------------------------------------------------------------------- */ -#define H5A_PACKAGE /*suppress error about including H5Apkg */ -#define H5B2_PACKAGE /*suppress error about including H5B2pkg */ -#define H5B2_TESTING /*suppress warning about H5B2 testing funcs*/ -#define H5EA_PACKAGE /*suppress error about including H5EApkg */ -#define H5EA_TESTING /*suppress warning about H5EA testing funcs*/ -#define H5FA_PACKAGE /*suppress error about including H5FApkg */ -#define H5FA_TESTING /*suppress warning about H5FA testing funcs*/ -#define H5F_PACKAGE /*suppress error about including H5Fpkg */ -#define H5G_PACKAGE /*suppress error about including H5Gpkg */ -#define H5HF_PACKAGE /*suppress error about including H5HFpkg */ -#define H5O_PACKAGE /*suppress error about including H5Opkg */ -#define H5SM_PACKAGE /*suppress error about including H5SMpkg */ - -#include "H5private.h" /* Generic Functions */ -#include "H5Apkg.h" /* Attributes */ -#include "H5B2pkg.h" /* v2 B-trees */ -#include "H5Dprivate.h" /* Datasets */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5EApkg.h" /* Extensible Arrays */ -#include "H5FApkg.h" /* Fixed Arrays */ -#include "H5Fpkg.h" /* File access */ -#include "H5FSprivate.h" /* Free space manager */ -#include "H5Gpkg.h" /* Groups */ -#include "H5HFpkg.h" /* Fractal heaps */ -#include "H5HGprivate.h" /* Global Heaps */ -#include "H5Iprivate.h" /* IDs */ -#include "H5Opkg.h" /* Object headers */ -#include "H5SMpkg.h" /* Implicitly shared messages */ +#define H5A_PACKAGE /*suppress error about including H5Apkg */ +#define H5B2_PACKAGE /*suppress error about including H5B2pkg */ +#define H5B2_TESTING /*suppress warning about H5B2 testing funcs*/ +#define H5EA_PACKAGE /*suppress error about including H5EApkg */ +#define H5EA_TESTING /*suppress warning about H5EA testing funcs*/ +#define H5FA_PACKAGE /*suppress error about including H5FApkg */ +#define H5FA_TESTING /*suppress warning about H5FA testing funcs*/ +#define H5F_PACKAGE /*suppress error about including H5Fpkg */ +#define H5G_PACKAGE /*suppress error about including H5Gpkg */ +#define H5HF_PACKAGE /*suppress error about including H5HFpkg */ +#define H5O_PACKAGE /*suppress error about including H5Opkg */ +#define H5SM_PACKAGE /*suppress error about including H5SMpkg */ + +#include "H5private.h" /* Generic Functions */ +#include "H5Apkg.h" /* Attributes */ +#include "H5B2pkg.h" /* v2 B-trees */ +#include "H5Dprivate.h" /* Datasets */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5EApkg.h" /* Extensible Arrays */ +#include "H5FApkg.h" /* Fixed Arrays */ +#include "H5Fpkg.h" /* File access */ +#include "H5FSprivate.h" /* Free space manager */ +#include "H5Gpkg.h" /* Groups */ +#include "H5HFpkg.h" /* Fractal heaps */ +#include "H5HGprivate.h" /* Global Heaps */ +#include "H5Iprivate.h" /* IDs */ +#include "H5Opkg.h" /* Object headers */ +#include "H5SMpkg.h" /* Implicitly shared messages */ /* File drivers */ #include "H5FDfamily.h" @@ -61,15 +61,15 @@ /*------------------------------------------------------------------------- * Function: get_H5B2_class * - * Purpose: Determine the v2 B-tree class from the buffer read in. + * Purpose: Determine the v2 B-tree class from the buffer read in. * B-trees are debugged through the B-tree subclass. The subclass * identifier is two bytes after the B-tree signature. * - * Return: Non-NULL on success/NULL on failure + * Return: Non-NULL on success/NULL on failure * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Sep 11 2008 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * Sep 11 2008 * *------------------------------------------------------------------------- */ @@ -121,7 +121,7 @@ get_H5B2_class(const uint8_t *sig) break; default: - fprintf(stderr, "Unknown B-tree subtype %u\n", (unsigned)(subtype)); + HDfprintf(stderr, "Unknown B-tree subtype %u\n", (unsigned)(subtype)); HDexit(4); } /* end switch */ @@ -132,15 +132,15 @@ get_H5B2_class(const uint8_t *sig) /*------------------------------------------------------------------------- * Function: get_H5EA_class * - * Purpose: Determine the extensible array class from the buffer read in. + * Purpose: Determine the extensible array class from the buffer read in. * Extensible arrays are debugged through the array subclass. * The subclass identifier is two bytes after the signature. * - * Return: Non-NULL on success/NULL on failure + * Return: Non-NULL on success/NULL on failure * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Sep 11 2008 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * Sep 11 2008 * *------------------------------------------------------------------------- */ @@ -156,7 +156,7 @@ get_H5EA_class(const uint8_t *sig) break; default: - fprintf(stderr, "Unknown array class %u\n", (unsigned)(clsid)); + HDfprintf(stderr, "Unknown array class %u\n", (unsigned)(clsid)); HDexit(4); } /* end switch */ @@ -167,15 +167,15 @@ get_H5EA_class(const uint8_t *sig) /*------------------------------------------------------------------------- * Function: get_H5FA_class * - * Purpose: Determine the fixed array class from the buffer read in. + * Purpose: Determine the fixed array class from the buffer read in. * Extensible arrays are debugged through the array subclass. * The subclass identifier is two bytes after the signature. * - * Return: Non-NULL on success/NULL on failure + * Return: Non-NULL on success/NULL on failure * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Sep 11 2008 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * Sep 11 2008 * *------------------------------------------------------------------------- */ @@ -191,7 +191,7 @@ get_H5FA_class(const uint8_t *sig) break; default: - fprintf(stderr, "Unknown array class %u\n", (unsigned)(clsid)); + HDfprintf(stderr, "Unknown array class %u\n", (unsigned)(clsid)); HDexit(4); } /* end switch */ @@ -217,7 +217,7 @@ get_H5FA_class(const uint8_t *sig) int main(int argc, char *argv[]) { - hid_t fid, fapl, dxpl; + hid_t fid, fapl, dxpl; H5F_t *f; haddr_t addr = 0, extra = 0, extra2 = 0, extra3 = 0, extra4 = 0; uint8_t sig[H5F_SIGNATURE_LEN]; @@ -225,13 +225,13 @@ main(int argc, char *argv[]) herr_t status = SUCCEED; if(argc == 1) { - fprintf(stderr, "Usage: %s filename [signature-addr [extra]]\n", argv[0]); - HDexit(1); + HDfprintf(stderr, "Usage: %s filename [signature-addr [extra]]\n", argv[0]); + HDexit(1); } /* end if */ /* Initialize the library */ if(H5open() < 0) { - fprintf(stderr, "cannot initialize the library\n"); + HDfprintf(stderr, "cannot initialize the library\n"); HDexit(1); } /* end if */ @@ -239,27 +239,27 @@ main(int argc, char *argv[]) * Open the file and get the file descriptor. */ if((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) { - fprintf(stderr, "cannot create dataset transfer property list\n"); + HDfprintf(stderr, "cannot create dataset transfer property list\n"); HDexit(1); } /* end if */ if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) { - fprintf(stderr, "cannot create file access property list\n"); + HDfprintf(stderr, "cannot create file access property list\n"); HDexit(1); } /* end if */ if(strchr(argv[1], '%')) - H5Pset_fapl_family (fapl, (hsize_t)0, H5P_DEFAULT); + H5Pset_fapl_family (fapl, (hsize_t)0, H5P_DEFAULT); if((fid = H5Fopen(argv[1], H5F_ACC_RDONLY, fapl)) < 0) { - fprintf(stderr, "cannot open file\n"); + HDfprintf(stderr, "cannot open file\n"); HDexit(1); } /* end if */ if(NULL == (f = (H5F_t *)H5I_object(fid))) { - fprintf(stderr, "cannot obtain H5F_t pointer\n"); + HDfprintf(stderr, "cannot obtain H5F_t pointer\n"); HDexit(2); } /* end if */ /* Ignore metadata tags while using h5debug */ if(H5AC_ignore_tags(f) < 0) { - fprintf(stderr, "cannot ignore metadata tags\n"); + HDfprintf(stderr, "cannot ignore metadata tags\n"); HDexit(1); } @@ -282,7 +282,7 @@ main(int argc, char *argv[]) */ HDfprintf(stdout, "Reading signature at address %a (rel)\n", addr); if(H5F_block_read(f, H5FD_MEM_SUPER, addr, sizeof(sig), dxpl, sig) < 0) { - fprintf(stderr, "cannot read signature\n"); + HDfprintf(stderr, "cannot read signature\n"); HDexit(3); } if(!HDmemcmp(sig, H5F_SIGNATURE, (size_t)H5F_SIGNATURE_LEN)) { @@ -298,10 +298,10 @@ main(int argc, char *argv[]) status = H5HL_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL); } else if(!HDmemcmp (sig, H5HG_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { - /* - * Debug a global heap collection. - */ - status = H5HG_debug (f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL); + /* + * Debug a global heap collection. + */ + status = H5HG_debug (f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL); } else if(!HDmemcmp(sig, H5G_NODE_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* @@ -310,9 +310,9 @@ main(int argc, char *argv[]) /* Check for extra parameters */ if(extra == 0) { - fprintf(stderr, "\nWarning: Providing the group's local heap address will give more information\n"); - fprintf(stderr, "Symbol table node usage:\n"); - fprintf(stderr, "\th5debug
\n\n"); + HDfprintf(stderr, "\nWarning: Providing the group's local heap address will give more information\n"); + HDfprintf(stderr, "Symbol table node usage:\n"); + HDfprintf(stderr, "\th5debug
\n\n"); } /* end if */ status = H5G_node_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, extra); @@ -330,9 +330,9 @@ main(int argc, char *argv[]) case H5B_SNODE_ID: /* Check for extra parameters */ if(extra == 0) { - fprintf(stderr, "\nWarning: Providing the group's local heap address will give more information\n"); - fprintf(stderr, "B-tree symbol table node usage:\n"); - fprintf(stderr, "\th5debug
\n\n"); + HDfprintf(stderr, "\nWarning: Providing the group's local heap address will give more information\n"); + HDfprintf(stderr, "B-tree symbol table node usage:\n"); + HDfprintf(stderr, "\th5debug
\n\n"); } /* end if */ status = H5G_node_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, extra); @@ -341,9 +341,9 @@ main(int argc, char *argv[]) case H5B_CHUNK_ID: /* Check for extra parameters */ if(extra == 0) { - fprintf(stderr, "ERROR: Need number of dimensions of chunk in order to dump chunk B-tree node\n"); - fprintf(stderr, "B-tree chunked storage node usage:\n"); - fprintf(stderr, "\th5debug <# of dimensions>\n"); + HDfprintf(stderr, "ERROR: Need number of dimensions of chunk in order to dump chunk B-tree node\n"); + HDfprintf(stderr, "B-tree chunked storage node usage:\n"); + HDfprintf(stderr, "\th5debug <# of dimensions>\n"); HDexit(4); } /* end if */ @@ -352,7 +352,7 @@ main(int argc, char *argv[]) break; default: - fprintf(stderr, "Unknown B-tree subtype %u\n", (unsigned)(subtype)); + HDfprintf(stderr, "Unknown B-tree subtype %u\n", (unsigned)(subtype)); HDexit(4); } @@ -374,10 +374,10 @@ main(int argc, char *argv[]) /* Check for enough valid parameters */ if(extra == 0 || extra2 == 0 || extra3 == 0) { - fprintf(stderr, "ERROR: Need v2 B-tree header address and the node's number of records and depth in order to dump internal node\n"); - fprintf(stderr, "NOTE: Leaf nodes are depth 0, the internal nodes above them are depth 1, etc.\n"); - fprintf(stderr, "v2 B-tree internal node usage:\n"); - fprintf(stderr, "\th5debug \n"); + HDfprintf(stderr, "ERROR: Need v2 B-tree header address and the node's number of records and depth in order to dump internal node\n"); + HDfprintf(stderr, "NOTE: Leaf nodes are depth 0, the internal nodes above them are depth 1, etc.\n"); + HDfprintf(stderr, "v2 B-tree internal node usage:\n"); + HDfprintf(stderr, "\th5debug \n"); HDexit(4); } /* end if */ @@ -392,9 +392,9 @@ main(int argc, char *argv[]) /* Check for enough valid parameters */ if(extra == 0 || extra2 == 0) { - fprintf(stderr, "ERROR: Need v2 B-tree header address and number of records in order to dump leaf node\n"); - fprintf(stderr, "v2 B-tree leaf node usage:\n"); - fprintf(stderr, "\th5debug \n"); + HDfprintf(stderr, "ERROR: Need v2 B-tree header address and number of records in order to dump leaf node\n"); + HDfprintf(stderr, "v2 B-tree leaf node usage:\n"); + HDfprintf(stderr, "\th5debug \n"); HDexit(4); } /* end if */ @@ -413,9 +413,9 @@ main(int argc, char *argv[]) /* Check for enough valid parameters */ if(extra == 0 || extra2 == 0) { - fprintf(stderr, "ERROR: Need fractal heap header address and size of direct block in order to dump direct block\n"); - fprintf(stderr, "Fractal heap direct block usage:\n"); - fprintf(stderr, "\th5debug \n"); + HDfprintf(stderr, "ERROR: Need fractal heap header address and size of direct block in order to dump direct block\n"); + HDfprintf(stderr, "Fractal heap direct block usage:\n"); + HDfprintf(stderr, "\th5debug \n"); HDexit(4); } /* end if */ @@ -428,9 +428,9 @@ main(int argc, char *argv[]) /* Check for enough valid parameters */ if(extra == 0 || extra2 == 0) { - fprintf(stderr, "ERROR: Need fractal heap header address and number of rows in order to dump indirect block\n"); - fprintf(stderr, "Fractal heap indirect block usage:\n"); - fprintf(stderr, "\th5debug \n"); + HDfprintf(stderr, "ERROR: Need fractal heap header address and number of rows in order to dump indirect block\n"); + HDfprintf(stderr, "Fractal heap indirect block usage:\n"); + HDfprintf(stderr, "\th5debug \n"); HDexit(4); } /* end if */ @@ -450,9 +450,9 @@ main(int argc, char *argv[]) /* Check for enough valid parameters */ if(extra == 0 || extra2 == 0) { - fprintf(stderr, "ERROR: Need free space header address and client address in order to dump serialized sections\n"); - fprintf(stderr, "Free space serialized sections usage:\n"); - fprintf(stderr, "\th5debug \n"); + HDfprintf(stderr, "ERROR: Need free space header address and client address in order to dump serialized sections\n"); + HDfprintf(stderr, "Free space serialized sections usage:\n"); + HDfprintf(stderr, "\th5debug \n"); HDexit(4); } /* end if */ @@ -472,9 +472,9 @@ main(int argc, char *argv[]) /* Check for enough valid parameters */ if(extra2 == 0) { - fprintf(stderr, "ERROR: Need list format version and number of messages in order to shared message list\n"); - fprintf(stderr, "Shared message list usage:\n"); - fprintf(stderr, "\th5debug \n"); + HDfprintf(stderr, "ERROR: Need list format version and number of messages in order to shared message list\n"); + HDfprintf(stderr, "Shared message list usage:\n"); + HDfprintf(stderr, "\th5debug \n"); HDexit(4); } /* end if */ @@ -487,11 +487,11 @@ main(int argc, char *argv[]) const H5EA_class_t *cls = get_H5EA_class(sig); HDassert(cls); - /* Check for enough valid parameters */ + /* Check for enough valid parameters */ if(extra == 0) { - fprintf(stderr, "ERROR: Need object header address containing the layout message in order to dump header\n"); - fprintf(stderr, "Extensible array header block usage:\n"); - fprintf(stderr, "\th5debug \n"); + HDfprintf(stderr, "ERROR: Need object header address containing the layout message in order to dump header\n"); + HDfprintf(stderr, "Extensible array header block usage:\n"); + HDfprintf(stderr, "\th5debug \n"); HDexit(4); } /* end if */ @@ -506,9 +506,9 @@ main(int argc, char *argv[]) /* Check for enough valid parameters */ if(extra == 0 || extra2 == 0) { - fprintf(stderr, "ERROR: Need extensible array header address and object header address containing the layout message in order to dump index block\n"); - fprintf(stderr, "Extensible array index block usage:\n"); - fprintf(stderr, "\th5debug \n"); + HDfprintf(stderr, "ERROR: Need extensible array header address, super block index and object header address containing the layout message in order to dump super block\n"); + HDfprintf(stderr, "Extensible array super block usage:\n"); + HDfprintf(stderr, "\th5debug \n"); HDexit(4); } /* end if */ @@ -540,9 +540,9 @@ main(int argc, char *argv[]) /* Check for enough valid parameters */ if(extra == 0 || extra2 == 0 || extra3 == 0) { - fprintf(stderr, "ERROR: Need extensible array header address, # of elements in data block and object header address containing the layout message in order to dump data block\n"); - fprintf(stderr, "Extensible array data block usage:\n"); - fprintf(stderr, "\th5debug <# of elements in data block> <# of elements in data block> \n"); + HDfprintf(stderr, "ERROR: Need object header address containing the layout message in order to dump header\n"); + HDfprintf(stderr, "Fixed array header block usage:\n"); + HDfprintf(stderr, "\th5debug \n"); HDexit(4); } /* end if */ @@ -574,9 +574,9 @@ main(int argc, char *argv[]) /* Check for enough valid parameters */ if(extra == 0 || extra2 == 0) { - fprintf(stderr, "ERROR: Need fixed array header address and object header address containing the layout message in order to dump data block\n"); - fprintf(stderr, "fixed array data block usage:\n"); - fprintf(stderr, "\th5debug \n"); + HDfprintf(stderr, "ERROR: Need fixed array header address and object header address containing the layout message in order to dump data block\n"); + HDfprintf(stderr, "fixed array data block usage:\n"); + HDfprintf(stderr, "\th5debug \n"); HDexit(4); } /* end if */ @@ -612,13 +612,13 @@ main(int argc, char *argv[]) } HDputchar('\n'); - fprintf(stderr, "unknown signature\n"); + HDfprintf(stderr, "unknown signature\n"); HDexit(4); } /* end else */ /* Check for an error when dumping information */ if(status < 0) { - fprintf(stderr, "An error occurred!\n"); + HDfprintf(stderr, "An error occurred!\n"); H5Eprint2(H5E_DEFAULT, stderr); HDexit(5); } /* end if */ diff --git a/tools/misc/h5mkgrp.c b/tools/misc/h5mkgrp.c index 09f23ef..b5c69e8 100644 --- a/tools/misc/h5mkgrp.c +++ b/tools/misc/h5mkgrp.c @@ -81,7 +81,7 @@ leave(int ret) static void usage(void) { - fprintf(stdout, "\ + HDfprintf(stdout, "\ usage: h5mkgrp [OPTIONS] FILE GROUP...\n\ OPTIONS\n\ -h, --help Print a usage message and exit\n\ @@ -97,8 +97,8 @@ usage: h5mkgrp [OPTIONS] FILE GROUP...\n\ * * Purpose: Parses command line and sets up global variable to control output * - * Return: Success: 0 - * Failure: -1 + * Return: Success: 0 + * Failure: -1 * * Programmer: Quincey Koziol, 2/13/2007 * -- cgit v0.12 From 827cbbba318e64d81c60647c815c46d18dc529e1 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 24 Feb 2012 10:45:54 -0500 Subject: [svn-r21982] Correct HD prefix in tools for exit Checked for HD support. --- tools/h5copy/h5copy.c | 2 +- tools/h5dump/h5dump.c | 2 +- tools/h5import/h5import.c | 4 ++-- tools/h5jam/h5jam.c | 2 +- tools/h5jam/h5unjam.c | 4 ++-- tools/h5ls/h5ls.c | 2 +- tools/h5repack/h5repack.c | 2 +- tools/h5repack/h5repack_main.c | 32 +++++++++++++------------- tools/h5repack/h5repack_opttable.c | 2 +- tools/h5repack/h5repack_parse.c | 46 +++++++++++++++++++------------------- tools/h5stat/h5stat.c | 2 +- tools/lib/h5tools_utils.c | 2 +- tools/misc/h5mkgrp.c | 2 +- 13 files changed, 52 insertions(+), 52 deletions(-) diff --git a/tools/h5copy/h5copy.c b/tools/h5copy/h5copy.c index dcc21ee..71bde66 100644 --- a/tools/h5copy/h5copy.c +++ b/tools/h5copy/h5copy.c @@ -55,7 +55,7 @@ static void leave(int ret) { h5tools_close(); - exit(ret); + HDexit(ret); } diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c index 80351d1..8d20b8d 100644 --- a/tools/h5dump/h5dump.c +++ b/tools/h5dump/h5dump.c @@ -210,7 +210,7 @@ leave(int ret) { h5tools_close(); - exit(ret); + HDexit(ret); } diff --git a/tools/h5import/h5import.c b/tools/h5import/h5import.c index 31d44de..b80cfe3 100755 --- a/tools/h5import/h5import.c +++ b/tools/h5import/h5import.c @@ -58,7 +58,7 @@ int main(int argc, char *argv[]) if (argv[1] && (HDstrcmp("-V", argv[1]) == 0)) { print_version(PROGRAMNAME); - exit(EXIT_SUCCESS); + HDexit(EXIT_SUCCESS); } /* @@ -119,7 +119,7 @@ int main(int argc, char *argv[]) case 6: /* -h found; help, then exit */ help(argv[0]); - exit(EXIT_SUCCESS); + HDexit(EXIT_SUCCESS); break; case 7: /* -d found; look for dimensions */ diff --git a/tools/h5jam/h5jam.c b/tools/h5jam/h5jam.c index 5520dc7..2bc3462 100644 --- a/tools/h5jam/h5jam.c +++ b/tools/h5jam/h5jam.c @@ -139,7 +139,7 @@ leave(int ret) h5tools_close(); - exit(ret); + HDexit(ret); } /*------------------------------------------------------------------------- diff --git a/tools/h5jam/h5unjam.c b/tools/h5jam/h5unjam.c index 14ed651..1dfdfc7 100644 --- a/tools/h5jam/h5unjam.c +++ b/tools/h5jam/h5unjam.c @@ -142,7 +142,7 @@ leave(int ret) h5tools_close(); - exit(ret); + HDexit(ret); } /*------------------------------------------------------------------------- @@ -199,7 +199,7 @@ parse_command_line(int argc, const char *argv[]) if (argc <= opt_ind+2) { error_msg("missing file name\n"); usage(h5tools_getprogname()); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } */ } diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c index b51c7e1..905f10c 100644 --- a/tools/h5ls/h5ls.c +++ b/tools/h5ls/h5ls.c @@ -3460,7 +3460,7 @@ leave(int ret) { h5tools_close(); - exit(ret); + HDexit(ret); } diff --git a/tools/h5repack/h5repack.c b/tools/h5repack/h5repack.c index 3b00327..b36eb37 100644 --- a/tools/h5repack/h5repack.c +++ b/tools/h5repack/h5repack.c @@ -1002,7 +1002,7 @@ static const char* get_sfilter(H5Z_filter_t filtn) return "SOFF"; else { error_msg("input error in filter type\n"); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } } diff --git a/tools/h5repack/h5repack_main.c b/tools/h5repack/h5repack_main.c index 010d9f2..f0094d5 100644 --- a/tools/h5repack/h5repack_main.c +++ b/tools/h5repack/h5repack_main.c @@ -108,7 +108,7 @@ int main(int argc, const char **argv) /* update hyperslab buffer size from H5TOOLS_BUFSIZE env if exist */ if ( h5tools_getenv_update_hyperslab_bufsize() < 0) - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); /* initialize options */ h5repack_init(&options, 0, 0, (hsize_t)0); @@ -128,7 +128,7 @@ int main(int argc, const char **argv) { error_msg("file names cannot be the same\n"); usage(h5tools_getprogname()); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } } @@ -137,7 +137,7 @@ int main(int argc, const char **argv) { error_msg("file names missing\n"); usage(h5tools_getprogname()); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } } @@ -320,10 +320,10 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options) case 'h': usage(h5tools_getprogname()); - exit(EXIT_SUCCESS); + HDexit(EXIT_SUCCESS); case 'V': print_version(h5tools_getprogname()); - exit(EXIT_SUCCESS); + HDexit(EXIT_SUCCESS); case 'v': options->verbose = 1; break; @@ -333,7 +333,7 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options) if (h5repack_addfilter( opt_arg, options)<0) { error_msg("in parsing filter\n"); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } break; case 'l': @@ -342,7 +342,7 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options) if (h5repack_addlayout( opt_arg, options)<0) { error_msg("in parsing layout\n"); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } break; @@ -353,7 +353,7 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options) if ((int)options->min_comp<=0) { error_msg("invalid minimum compress size <%s>\n", opt_arg ); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } break; @@ -446,12 +446,12 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options) if ( options->alignment < 1 ) { error_msg("invalid alignment size\n", opt_arg ); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } break; case 'S': - { + { char strategy[MAX_NC_NAME]; HDstrcpy(strategy, opt_arg); @@ -465,7 +465,7 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options) options->fs_strategy = H5F_FILE_SPACE_VFD; else { error_msg("invalid file space management strategy\n", opt_arg ); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } break; } @@ -486,7 +486,7 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options) { error_msg("missing file names\n"); usage(h5tools_getprogname()); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } } @@ -519,7 +519,7 @@ void read_info(const char *filename, if ((fp = fopen(filename, "r")) == (FILE *)NULL) { error_msg("cannot open options file %s\n", filename); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } /* cycle until end of file reached */ @@ -556,7 +556,7 @@ void read_info(const char *filename, if (h5repack_addfilter(comp_info,options)==-1){ error_msg("could not add compression option\n"); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } } /*------------------------------------------------------------------------- @@ -586,7 +586,7 @@ void read_info(const char *filename, if (h5repack_addlayout(comp_info,options)==-1){ error_msg("could not add chunck option\n"); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } } /*------------------------------------------------------------------------- @@ -595,7 +595,7 @@ void read_info(const char *filename, */ else { error_msg("bad file format for %s", filename); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } } diff --git a/tools/h5repack/h5repack_opttable.c b/tools/h5repack/h5repack_opttable.c index 9d225b5..b1a3469 100644 --- a/tools/h5repack/h5repack_opttable.c +++ b/tools/h5repack/h5repack_opttable.c @@ -229,7 +229,7 @@ int options_add_layout( obj_list_t *obj_list, if (table->objs[i].chunk.rank>0) { error_msg("chunk information already inserted for <%s>\n",obj_list[j].obj); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } /* insert the layout info */ else diff --git a/tools/h5repack/h5repack_parse.c b/tools/h5repack/h5repack_parse.c index 5cdf9d2..910b182 100644 --- a/tools/h5repack/h5repack_parse.c +++ b/tools/h5repack/h5repack_parse.c @@ -115,7 +115,7 @@ obj_list_t* parse_filter(const char *str, { if (obj_list) HDfree(obj_list); error_msg("input Error: Invalid compression type in <%s>\n",str); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } @@ -153,7 +153,7 @@ obj_list_t* parse_filter(const char *str, if (!isdigit(c) && l==-1){ if (obj_list) HDfree(obj_list); error_msg("compression parameter not digit in <%s>\n",str); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } if (l==-1) stype[m]=c; @@ -173,7 +173,7 @@ obj_list_t* parse_filter(const char *str, else { error_msg("szip mask must be 'NN' or 'EC' \n"); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } @@ -213,7 +213,7 @@ obj_list_t* parse_filter(const char *str, if (!isdigit(c) && l==-1){ if (obj_list) HDfree(obj_list); error_msg("compression parameter is not a digit in <%s>\n",str); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } if (l==-1) stype[m]=c; @@ -233,7 +233,7 @@ obj_list_t* parse_filter(const char *str, else { error_msg("scale type must be 'IN' or 'DS' \n"); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } } @@ -257,7 +257,7 @@ obj_list_t* parse_filter(const char *str, if (!isdigit(c)){ if (obj_list) HDfree(obj_list); error_msg("compression parameter is not a digit in <%s>\n",str); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } stype[m]=c; } /* u */ @@ -303,7 +303,7 @@ obj_list_t* parse_filter(const char *str, { /*no more parameters, GZIP must have parameter */ if (obj_list) HDfree(obj_list); error_msg("missing compression parameter in <%s>\n",str); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } } @@ -319,7 +319,7 @@ obj_list_t* parse_filter(const char *str, { /*no more parameters, SZIP must have parameter */ if (obj_list) HDfree(obj_list); error_msg("missing compression parameter in <%s>\n",str); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } } @@ -335,7 +335,7 @@ obj_list_t* parse_filter(const char *str, { /*shuffle does not have parameter */ if (obj_list) HDfree(obj_list); error_msg("extra parameter in SHUF <%s>\n",str); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } } /*------------------------------------------------------------------------- @@ -350,7 +350,7 @@ obj_list_t* parse_filter(const char *str, { /*shuffle does not have parameter */ if (obj_list) HDfree(obj_list); error_msg("extra parameter in FLET <%s>\n",str); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } } /*------------------------------------------------------------------------- @@ -365,7 +365,7 @@ obj_list_t* parse_filter(const char *str, { /*nbit does not have parameter */ if (obj_list) HDfree(obj_list); error_msg("extra parameter in NBIT <%s>\n",str); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } } /*------------------------------------------------------------------------- @@ -380,13 +380,13 @@ obj_list_t* parse_filter(const char *str, { /*no more parameters, SOFF must have parameter */ if (obj_list) HDfree(obj_list); error_msg("missing compression parameter in <%s>\n",str); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } } else { if (obj_list) HDfree(obj_list); error_msg("invalid filter type in <%s>\n",str); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } } } /*i*/ @@ -409,7 +409,7 @@ obj_list_t* parse_filter(const char *str, { if (obj_list) HDfree(obj_list); error_msg("invalid compression parameter in <%s>\n",str); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } break; @@ -424,19 +424,19 @@ obj_list_t* parse_filter(const char *str, { if (obj_list) HDfree(obj_list); error_msg("pixels_per_block is not even in <%s>\n",str); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } if (pixels_per_block>H5_SZIP_MAX_PIXELS_PER_BLOCK) { if (obj_list) HDfree(obj_list); error_msg("pixels_per_block is too large in <%s>\n",str); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } if ( (HDstrcmp(smask,"NN")!=0) && (HDstrcmp(smask,"EC")!=0) ) { if (obj_list) HDfree(obj_list); error_msg("szip mask must be 'NN' or 'EC' \n"); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } break; default: @@ -537,7 +537,7 @@ obj_list_t* parse_layout(const char *str, { if (obj_list) HDfree(obj_list); error_msg("in parse layout, no characters after : in <%s>\n",str); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } /* get layout info */ @@ -554,7 +554,7 @@ obj_list_t* parse_layout(const char *str, pack->layout=H5D_CHUNKED; else { error_msg("in parse layout, not a valid layout in <%s>\n",str); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } } else @@ -578,7 +578,7 @@ obj_list_t* parse_layout(const char *str, { if (obj_list) HDfree(obj_list); error_msg("in parse layout, <%s> Chunk dimensions missing\n",str); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } for ( i=j, c_index=0; i Not a valid character in <%s>\n", sdim,str); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } if ( c=='x' || i==len-1) @@ -606,7 +606,7 @@ obj_list_t* parse_layout(const char *str, if (obj_list) HDfree(obj_list); error_msg("in parse layout, <%s> conversion to number in <%s>\n", sdim,str); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } c_index++; } @@ -624,7 +624,7 @@ obj_list_t* parse_layout(const char *str, if (obj_list) HDfree(obj_list); error_msg("in parse layout, <%s> conversion to number in <%s>\n", sdim,str); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } pack->chunk.rank=c_index+1; } diff --git a/tools/h5stat/h5stat.c b/tools/h5stat/h5stat.c index dd7adf9..1fc19c7 100644 --- a/tools/h5stat/h5stat.c +++ b/tools/h5stat/h5stat.c @@ -232,7 +232,7 @@ static void leave(int ret) { h5tools_close(); - exit(ret); + HDexit(ret); } diff --git a/tools/lib/h5tools_utils.c b/tools/lib/h5tools_utils.c index a1fe7c6..dbe1875 100644 --- a/tools/lib/h5tools_utils.c +++ b/tools/lib/h5tools_utils.c @@ -389,7 +389,7 @@ indentation(int x) } else { HDfprintf(stderr, "error: the indentation exceeds the number of cols.\n"); - exit(1); + HDexit(1); } } diff --git a/tools/misc/h5mkgrp.c b/tools/misc/h5mkgrp.c index b5c69e8..b4ac6f6 100644 --- a/tools/misc/h5mkgrp.c +++ b/tools/misc/h5mkgrp.c @@ -63,7 +63,7 @@ static void leave(int ret) { h5tools_close(); - exit(ret); + HDexit(ret); } /* end leave() */ -- cgit v0.12 From 67a1e576db7e4e1075b3f181fe40abff8c73b095 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 24 Feb 2012 10:53:42 -0500 Subject: [svn-r21983] Correct HD prefix in tools Checked for HD support. --- tools/h5ls/h5ls.c | 4 ++-- tools/misc/h5debug.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c index 905f10c..6337231 100644 --- a/tools/h5ls/h5ls.c +++ b/tools/h5ls/h5ls.c @@ -3352,8 +3352,8 @@ get_width(void) /* Try to get it from the COLUMNS environment variable first since it's * value is sometimes wrong. */ - if ((s=getenv("COLUMNS")) && *s && isdigit((int)*s)) - width = (int)strtol(s, NULL, 0); + if ((s=HDgetenv("COLUMNS")) && *s && isdigit((int)*s)) + width = (int)HDstrtol(s, NULL, 0); #if defined(H5_HAVE_STRUCT_VIDEOCONFIG) && defined(H5_HAVE__GETVIDEOCONFIG) { diff --git a/tools/misc/h5debug.c b/tools/misc/h5debug.c index 021cfcd..30d5d3b 100644 --- a/tools/misc/h5debug.c +++ b/tools/misc/h5debug.c @@ -246,7 +246,7 @@ main(int argc, char *argv[]) HDfprintf(stderr, "cannot create file access property list\n"); HDexit(1); } /* end if */ - if(strchr(argv[1], '%')) + if(HDstrchr(argv[1], '%')) H5Pset_fapl_family (fapl, (hsize_t)0, H5P_DEFAULT); if((fid = H5Fopen(argv[1], H5F_ACC_RDONLY, fapl)) < 0) { HDfprintf(stderr, "cannot open file\n"); -- cgit v0.12 From 2dffa66ef78426ea1eef3aaa2d5abcb11d0c26f8 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 24 Feb 2012 11:03:17 -0500 Subject: [svn-r21984] Correct HD prefix in tools Checked for HD support. --- tools/h5dump/h5dump.c | 2 +- tools/h5stat/h5stat.c | 2 +- tools/lib/h5diff.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c index 8d20b8d..90bbfec 100644 --- a/tools/h5dump/h5dump.c +++ b/tools/h5dump/h5dump.c @@ -230,7 +230,7 @@ leave(int ret) static void usage(const char *prog) { - fflush(stdout); + HDfflush(stdout); HDfprintf(stdout, "usage: %s [OPTIONS] file\n", prog); HDfprintf(stdout, " OPTIONS\n"); HDfprintf(stdout, " -h, --help Print a usage message and exit\n"); diff --git a/tools/h5stat/h5stat.c b/tools/h5stat/h5stat.c index 1fc19c7..21f77f2 100644 --- a/tools/h5stat/h5stat.c +++ b/tools/h5stat/h5stat.c @@ -238,7 +238,7 @@ leave(int ret) static void usage(const char *prog) { - fflush(stdout); + HDfflush(stdout); HDfprintf(stdout, "Usage: %s [OPTIONS] file\n", prog); HDfprintf(stdout, "\n"); HDfprintf(stdout, " OPTIONS\n"); diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index 7376642..f86e914 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -153,7 +153,7 @@ void print_manager_output(void) overflow_file = NULL; } - fflush(stdout); + HDfflush(stdout); HDmemset(outBuff, 0, OUTBUFF_SIZE); outBuffOffset = 0; } -- cgit v0.12 From 202c36682b47239079f547f274fe5d4e9f78f27b Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 24 Feb 2012 16:14:47 -0500 Subject: [svn-r21985] Tools must call h5tools_init before command_line parsing or using tools_mesg functions. Tools library uses alais variables for stdout, stderr and tools library uses HDfprintf() functions. Tested: local linux --- perform/pio_perf.c | 37 +- perform/sio_perf.c | 35 +- tools/h5copy/h5copy.c | 1 + tools/h5diff/h5diff_main.c | 5 +- tools/h5dump/h5dump.c | 281 +++++++++------ tools/h5dump/h5dump_ddl.c | 212 +++++------ tools/h5dump/h5dump_defines.h | 10 +- tools/h5dump/h5dump_xml.c | 794 ++++++++++++++++++++--------------------- tools/h5import/h5import.c | 3 + tools/h5jam/h5jam.c | 3 + tools/h5repack/h5repack_main.c | 3 + tools/h5stat/h5stat.c | 1 + tools/lib/h5tools.c | 22 +- tools/lib/h5tools.h | 4 +- tools/lib/h5tools_dump.c | 6 +- tools/lib/h5tools_utils.c | 39 +- 16 files changed, 783 insertions(+), 673 deletions(-) diff --git a/perform/pio_perf.c b/perform/pio_perf.c index 411fb12..9cbd65d 100644 --- a/perform/pio_perf.c +++ b/perform/pio_perf.c @@ -288,14 +288,14 @@ struct options { unsigned interleaved; /* Interleaved vs. contiguous blocks */ unsigned collective; /* Collective vs. independent I/O */ unsigned dim2d; /* 1D vs. 2D geometry */ - int print_times; /* print times as well as throughputs */ - int print_raw; /* print raw data throughput info */ + int print_times; /* print times as well as throughputs */ + int print_raw; /* print raw data throughput info */ off_t h5_alignment; /* alignment in HDF5 file */ off_t h5_threshold; /* threshold for alignment in HDF5 file */ - int h5_use_chunks; /* Make HDF5 dataset chunked */ - int h5_write_only; /* Perform the write tests only */ + int h5_use_chunks; /* Make HDF5 dataset chunked */ + int h5_write_only; /* Perform the write tests only */ unsigned h5_use_mpi_posix; /* Use MPI-posix VFD for HDF5 I/O (instead of MPI-I/O VFD) */ - int verify; /* Verify data correctness */ + int verify; /* Verify data correctness */ }; typedef struct _minmax { @@ -339,6 +339,11 @@ main(int argc, char **argv) int exit_value = EXIT_SUCCESS; struct options *opts = NULL; +#ifndef STANDALONE + /* Initialize h5tools lib */ + h5tools_init(); +#endif + output = stdout; /* initialize MPI and get the maximum num of processors we started with */ @@ -678,7 +683,7 @@ run_test(iotype iot, parameters parms, struct options *opts) /* * Show various statistics */ - /* Write statistics */ + /* Write statistics */ /* Print the raw data throughput if desired */ if (opts->print_raw) { /* accumulate and output the max, min, and average "raw write" times */ @@ -744,7 +749,7 @@ run_test(iotype iot, parameters parms, struct options *opts) } if (!parms.h5_write_only) { - /* Read statistics */ + /* Read statistics */ /* Print the raw data throughput if desired */ if (opts->print_raw) { /* accumulate and output the max, min, and average "raw read" times */ @@ -1098,10 +1103,10 @@ print_indent(register int indent) MPI_Comm_rank(pio_comm_g, &myrank); if (myrank == 0) { - indent *= TAB_SPACE; + indent *= TAB_SPACE; - for (; indent > 0; --indent) - fputc(' ', output); + for (; indent > 0; --indent) + fputc(' ', output); } } @@ -1126,11 +1131,11 @@ static void print_io_api(long io_types) { if (io_types & PIO_POSIX) - HDfprintf(output, "posix "); + HDfprintf(output, "posix "); if (io_types & PIO_MPI) - HDfprintf(output, "mpiio "); + HDfprintf(output, "mpiio "); if (io_types & PIO_HDF5) - HDfprintf(output, "phdf5 "); + HDfprintf(output, "phdf5 "); HDfprintf(output, "\n"); } @@ -1139,7 +1144,7 @@ report_parameters(struct options *opts) { int rank = comm_world_rank_g; - print_version("HDF5 Library"); /* print library version */ + print_version("HDF5 Library"); /* print library version */ HDfprintf(output, "rank %d: ==== Parameters ====\n", rank); HDfprintf(output, "rank %d: IO API=", rank); @@ -1560,7 +1565,7 @@ parse_size_directive(const char *size) * Return: Nothing * Programmer: Bill Wendling, 31. October 2001 * Modifications: - * Added 2D testing (Christian Chilan, 10. August 2005) + * Added 2D testing (Christian Chilan, 10. August 2005) */ static void usage(const char *prog) @@ -1570,7 +1575,7 @@ usage(const char *prog) MPI_Comm_rank(pio_comm_g, &myrank); if (myrank == 0) { - print_version(prog); + print_version(prog); printf("usage: %s [OPTIONS]\n", prog); printf(" OPTIONS\n"); printf(" -h, --help Print a usage message and exit\n"); diff --git a/perform/sio_perf.c b/perform/sio_perf.c index d852a45..8900e2e 100644 --- a/perform/sio_perf.c +++ b/perform/sio_perf.c @@ -295,15 +295,15 @@ struct options { int buf_rank; /* Rank */ int order_rank; /* Rank */ int chk_rank; /* Rank */ - int print_times; /* print times as well as throughputs */ - int print_raw; /* print raw data throughput info */ + int print_times; /* print times as well as throughputs */ + int print_raw; /* print raw data throughput info */ off_t h5_alignment; /* alignment in HDF5 file */ off_t h5_threshold; /* threshold for alignment in HDF5 file */ - int h5_use_chunks; /* Make HDF5 dataset chunked */ - int h5_write_only; /* Perform the write tests only */ - int h5_extendable; /* Perform the write tests only */ + int h5_use_chunks; /* Make HDF5 dataset chunked */ + int h5_write_only; /* Perform the write tests only */ + int h5_extendable; /* Perform the write tests only */ unsigned h5_use_mpi_posix; /* Use MPI-posix VFD for HDF5 I/O (instead of MPI-I/O VFD) */ - int verify; /* Verify data correctness */ + int verify; /* Verify data correctness */ vfdtype vfd; /* File driver */ }; @@ -343,6 +343,11 @@ main(int argc, char **argv) int exit_value = EXIT_SUCCESS; struct options *opts = NULL; +#ifndef STANDALONE + /* Initialize h5tools lib */ + h5tools_init(); +#endif + output = stdout; opts = parse_command_line(argc, argv); @@ -553,7 +558,7 @@ run_test(iotype iot, parameters parms, struct options *opts) /* * Show various statistics */ - /* Write statistics */ + /* Write statistics */ /* Print the raw data throughput if desired */ if (opts->print_raw) { /* accumulate and output the max, min, and average "raw write" times */ @@ -599,7 +604,7 @@ run_test(iotype iot, parameters parms, struct options *opts) output_results(opts,"Write Open-Close",write_gross_mm_table,parms.num_iters,raw_size); if (!parms.h5_write_only) { - /* Read statistics */ + /* Read statistics */ /* Print the raw data throughput if desired */ if (opts->print_raw) { /* accumulate and output the max, min, and average "raw read" times */ @@ -810,10 +815,10 @@ output_report(const char *fmt, ...) static void print_indent(register int indent) { - indent *= TAB_SPACE; + indent *= TAB_SPACE; - for (; indent > 0; --indent) - fputc(' ', output); + for (; indent > 0; --indent) + fputc(' ', output); } static void @@ -837,9 +842,9 @@ static void print_io_api(long io_types) { if (io_types & SIO_POSIX) - HDfprintf(output, "posix "); + HDfprintf(output, "posix "); if (io_types & SIO_HDF5) - HDfprintf(output, "hdf5 "); + HDfprintf(output, "hdf5 "); HDfprintf(output, "\n"); } @@ -849,7 +854,7 @@ report_parameters(struct options *opts) int i, rank; rank = opts->dset_rank; - print_version("HDF5 Library"); /* print library version */ + print_version("HDF5 Library"); /* print library version */ HDfprintf(output, "==== Parameters ====\n"); HDfprintf(output, "IO API="); @@ -1343,7 +1348,7 @@ parse_size_directive(const char *size) static void usage(const char *prog) { - print_version(prog); + print_version(prog); printf("usage: %s [OPTIONS]\n", prog); printf(" OPTIONS\n"); printf(" -h Print an usage message and exit\n"); diff --git a/tools/h5copy/h5copy.c b/tools/h5copy/h5copy.c index 71bde66..1a9a8eb 100644 --- a/tools/h5copy/h5copy.c +++ b/tools/h5copy/h5copy.c @@ -219,6 +219,7 @@ main (int argc, const char *argv[]) h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); + /* initialize h5tools lib */ h5tools_init(); diff --git a/tools/h5diff/h5diff_main.c b/tools/h5diff/h5diff_main.c index a014a9e..51a49c2 100644 --- a/tools/h5diff/h5diff_main.c +++ b/tools/h5diff/h5diff_main.c @@ -81,11 +81,14 @@ int main(int argc, const char *argv[]) h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); + + /* Initialize h5tools lib */ + h5tools_init(); + /*------------------------------------------------------------------------- * process the command-line *------------------------------------------------------------------------- */ - parse_command_line(argc, argv, &fname1, &fname2, &objname1, &objname2, &options); /*------------------------------------------------------------------------- diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c index 90bbfec..73bfd13 100644 --- a/tools/h5dump/h5dump.c +++ b/tools/h5dump/h5dump.c @@ -230,35 +230,35 @@ leave(int ret) static void usage(const char *prog) { - HDfflush(stdout); - HDfprintf(stdout, "usage: %s [OPTIONS] file\n", prog); - HDfprintf(stdout, " OPTIONS\n"); - HDfprintf(stdout, " -h, --help Print a usage message and exit\n"); - HDfprintf(stdout, " -n, --contents Print a list of the file contents and exit\n"); - HDfprintf(stdout, " -B, --superblock Print the content of the super block\n"); - HDfprintf(stdout, " -H, --header Print the header only; no data is displayed\n"); - HDfprintf(stdout, " -A, --onlyattr Print the header and value of attributes\n"); - HDfprintf(stdout, " -i, --object-ids Print the object ids\n"); - HDfprintf(stdout, " -r, --string Print 1-byte integer datasets as ASCII\n"); - HDfprintf(stdout, " -e, --escape Escape non printing characters\n"); - HDfprintf(stdout, " -V, --version Print version number and exit\n"); - HDfprintf(stdout, " -a P, --attribute=P Print the specified attribute\n"); - HDfprintf(stdout, " -d P, --dataset=P Print the specified dataset\n"); - HDfprintf(stdout, " -y, --noindex Do not print array indices with the data\n"); - HDfprintf(stdout, " -p, --properties Print dataset filters, storage layout and fill value\n"); - HDfprintf(stdout, " -f D, --filedriver=D Specify which driver to open the file with\n"); - HDfprintf(stdout, " -g P, --group=P Print the specified group and all members\n"); - HDfprintf(stdout, " -l P, --soft-link=P Print the value(s) of the specified soft link\n"); - HDfprintf(stdout, " -o F, --output=F Output raw data into file F\n"); - HDfprintf(stdout, " -b B, --binary=B Binary file output, of form B\n"); - HDfprintf(stdout, " -t P, --datatype=P Print the specified named datatype\n"); - HDfprintf(stdout, " -w N, --width=N Set the number of columns of output. A value of 0 (zero)\n"); - HDfprintf(stdout, " sets the number of columns to the maximum (65535).\n"); - HDfprintf(stdout, " Default width is 80 columns.\n"); - HDfprintf(stdout, " -m T, --format=T Set the floating point output format\n"); - HDfprintf(stdout, " -q Q, --sort_by=Q Sort groups and attributes by index Q\n"); - HDfprintf(stdout, " -z Z, --sort_order=Z Sort groups and attributes by order Z\n"); - HDfprintf(stdout, + HDfflush(rawoutstream); + HDfprintf(rawoutstream, "usage: %s [OPTIONS] file\n", prog); + HDfprintf(rawoutstream, " OPTIONS\n"); + HDfprintf(rawoutstream, " -h, --help Print a usage message and exit\n"); + HDfprintf(rawoutstream, " -n, --contents Print a list of the file contents and exit\n"); + HDfprintf(rawoutstream, " -B, --superblock Print the content of the super block\n"); + HDfprintf(rawoutstream, " -H, --header Print the header only; no data is displayed\n"); + HDfprintf(rawoutstream, " -A, --onlyattr Print the header and value of attributes\n"); + HDfprintf(rawoutstream, " -i, --object-ids Print the object ids\n"); + HDfprintf(rawoutstream, " -r, --string Print 1-byte integer datasets as ASCII\n"); + HDfprintf(rawoutstream, " -e, --escape Escape non printing characters\n"); + HDfprintf(rawoutstream, " -V, --version Print version number and exit\n"); + HDfprintf(rawoutstream, " -a P, --attribute=P Print the specified attribute\n"); + HDfprintf(rawoutstream, " -d P, --dataset=P Print the specified dataset\n"); + HDfprintf(rawoutstream, " -y, --noindex Do not print array indices with the data\n"); + HDfprintf(rawoutstream, " -p, --properties Print dataset filters, storage layout and fill value\n"); + HDfprintf(rawoutstream, " -f D, --filedriver=D Specify which driver to open the file with\n"); + HDfprintf(rawoutstream, " -g P, --group=P Print the specified group and all members\n"); + HDfprintf(rawoutstream, " -l P, --soft-link=P Print the value(s) of the specified soft link\n"); + HDfprintf(rawoutstream, " -o F, --output=F Output raw data into file F\n"); + HDfprintf(rawoutstream, " -b B, --binary=B Binary file output, of form B\n"); + HDfprintf(rawoutstream, " -t P, --datatype=P Print the specified named datatype\n"); + HDfprintf(rawoutstream, " -w N, --width=N Set the number of columns of output. A value of 0 (zero)\n"); + HDfprintf(rawoutstream, " sets the number of columns to the maximum (65535).\n"); + HDfprintf(rawoutstream, " Default width is 80 columns.\n"); + HDfprintf(rawoutstream, " -m T, --format=T Set the floating point output format\n"); + HDfprintf(rawoutstream, " -q Q, --sort_by=Q Sort groups and attributes by index Q\n"); + HDfprintf(rawoutstream, " -z Z, --sort_order=Z Sort groups and attributes by order Z\n"); + HDfprintf(rawoutstream, " -M L, --packedbits=L Print packed bits as unsigned integers, using mask\n" " format L for an integer dataset specified with\n" " option -d. L is a list of offset,length values,\n" @@ -266,69 +266,69 @@ usage(const char *prog) " the data value and length is the number of bits of\n" " the mask.\n" ); - HDfprintf(stdout, " -R, --region Print dataset pointed by region references\n"); - HDfprintf(stdout, " -x, --xml Output in XML using Schema\n"); - HDfprintf(stdout, " -u, --use-dtd Output in XML using DTD\n"); - HDfprintf(stdout, " -D U, --xml-dtd=U Use the DTD or schema at U\n"); - HDfprintf(stdout, " -X S, --xml-ns=S (XML Schema) Use qualified names n the XML\n"); - HDfprintf(stdout, " \":\": no namespace, default: \"hdf5:\"\n"); - HDfprintf(stdout, " E.g., to dump a file called `-f', use h5dump -- -f\n"); - HDfprintf(stdout, " --enable-error-stack Prints messages from the HDF5 error stack as they\n"); - HDfprintf(stdout, " occur.\n"); - HDfprintf(stdout, " --no-compact-subset Disable compact form of subsetting and allow the use\n"); - HDfprintf(stdout, " of \"[\" in datset names.\n"); - HDfprintf(stdout, "\n"); - HDfprintf(stdout, " Subsetting is available by using the following options with a dataset\n"); - HDfprintf(stdout, " attribute. Subsetting is done by selecting a hyperslab from the data.\n"); - HDfprintf(stdout, " Thus, the options mirror those for performing a hyperslab selection.\n"); - HDfprintf(stdout, " One of the START, COUNT, STRIDE, or BLOCK parameters are mandatory if you do subsetting.\n"); - HDfprintf(stdout, " The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in\n"); - HDfprintf(stdout, " each dimension. START is optional and will default to 0 in each dimension.\n"); - HDfprintf(stdout, "\n"); - HDfprintf(stdout, " -s START, --start=START Offset of start of subsetting selection\n"); - HDfprintf(stdout, " -S STRIDE, --stride=STRIDE Hyperslab stride\n"); - HDfprintf(stdout, " -c COUNT, --count=COUNT Number of blocks to include in selection\n"); - HDfprintf(stdout, " -k BLOCK, --block=BLOCK Size of block in hyperslab\n"); - HDfprintf(stdout, " START, COUNT, STRIDE, and BLOCK - is a list of integers the number of which are equal to the\n"); - HDfprintf(stdout, " number of dimensions in the dataspace being queried\n"); - HDfprintf(stdout, "\n"); - HDfprintf(stdout, " D - is the file driver to use in opening the file. Acceptable values\n"); - HDfprintf(stdout, " are \"sec2\", \"family\", \"split\", \"multi\", \"direct\", and \"stream\". Without\n"); - HDfprintf(stdout, " the file driver flag, the file will be opened with each driver in\n"); - HDfprintf(stdout, " turn and in the order specified above until one driver succeeds\n"); - HDfprintf(stdout, " in opening the file.\n"); - HDfprintf(stdout, " F - is a filename.\n"); - HDfprintf(stdout, " P - is the full path from the root group to the object.\n"); - HDfprintf(stdout, " N - is an integer greater than 1.\n"); - HDfprintf(stdout, " T - is a string containing the floating point format, e.g '%%.3f'\n"); - HDfprintf(stdout, " U - is a URI reference (as defined in [IETF RFC 2396],\n"); - HDfprintf(stdout, " updated by [IETF RFC 2732])\n"); - HDfprintf(stdout, " B - is the form of binary output: NATIVE for a memory type, FILE for the\n"); - HDfprintf(stdout, " file type, LE or BE for pre-existing little or big endian types.\n"); - HDfprintf(stdout, " Must be used with -o (output file) and it is recommended that\n"); - HDfprintf(stdout, " -d (dataset) is used. B is an optional argument, defaults to NATIVE\n"); - HDfprintf(stdout, " Q - is the sort index type. It can be \"creation_order\" or \"name\" (default)\n"); - HDfprintf(stdout, " Z - is the sort order type. It can be \"descending\" or \"ascending\" (default)\n"); - HDfprintf(stdout, "\n"); - HDfprintf(stdout, " Examples:\n"); - HDfprintf(stdout, "\n"); - HDfprintf(stdout, " 1) Attribute foo of the group /bar_none in file quux.h5\n"); - HDfprintf(stdout, "\n"); - HDfprintf(stdout, " h5dump -a /bar_none/foo quux.h5\n"); - HDfprintf(stdout, "\n"); - HDfprintf(stdout, " 2) Selecting a subset from dataset /foo in file quux.h5\n"); - HDfprintf(stdout, "\n"); - HDfprintf(stdout, " h5dump -d /foo -s \"0,1\" -S \"1,1\" -c \"2,3\" -k \"2,2\" quux.h5\n"); - HDfprintf(stdout, "\n"); - HDfprintf(stdout, " 3) Saving dataset 'dset' in file quux.h5 to binary file 'out.bin'\n"); - HDfprintf(stdout, " using a little-endian type\n"); - HDfprintf(stdout, "\n"); - HDfprintf(stdout, " h5dump -d /dset -b LE -o out.bin quux.h5\n"); - HDfprintf(stdout, "\n"); - HDfprintf(stdout, " 4) Display two packed bits (bits 0-1 and bits 4-6) in the dataset /dset\n"); - HDfprintf(stdout, "\n"); - HDfprintf(stdout, " h5dump -d /dset -M 0,1,4,3 quux.h5\n"); - HDfprintf(stdout, "\n"); + HDfprintf(rawoutstream, " -R, --region Print dataset pointed by region references\n"); + HDfprintf(rawoutstream, " -x, --xml Output in XML using Schema\n"); + HDfprintf(rawoutstream, " -u, --use-dtd Output in XML using DTD\n"); + HDfprintf(rawoutstream, " -D U, --xml-dtd=U Use the DTD or schema at U\n"); + HDfprintf(rawoutstream, " -X S, --xml-ns=S (XML Schema) Use qualified names n the XML\n"); + HDfprintf(rawoutstream, " \":\": no namespace, default: \"hdf5:\"\n"); + HDfprintf(rawoutstream, " E.g., to dump a file called `-f', use h5dump -- -f\n"); + HDfprintf(rawoutstream, " --enable-error-stack Prints messages from the HDF5 error stack as they\n"); + HDfprintf(rawoutstream, " occur.\n"); + HDfprintf(rawoutstream, " --no-compact-subset Disable compact form of subsetting and allow the use\n"); + HDfprintf(rawoutstream, " of \"[\" in datset names.\n"); + HDfprintf(rawoutstream, "\n"); + HDfprintf(rawoutstream, " Subsetting is available by using the following options with a dataset\n"); + HDfprintf(rawoutstream, " attribute. Subsetting is done by selecting a hyperslab from the data.\n"); + HDfprintf(rawoutstream, " Thus, the options mirror those for performing a hyperslab selection.\n"); + HDfprintf(rawoutstream, " One of the START, COUNT, STRIDE, or BLOCK parameters are mandatory if you do subsetting.\n"); + HDfprintf(rawoutstream, " The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in\n"); + HDfprintf(rawoutstream, " each dimension. START is optional and will default to 0 in each dimension.\n"); + HDfprintf(rawoutstream, "\n"); + HDfprintf(rawoutstream, " -s START, --start=START Offset of start of subsetting selection\n"); + HDfprintf(rawoutstream, " -S STRIDE, --stride=STRIDE Hyperslab stride\n"); + HDfprintf(rawoutstream, " -c COUNT, --count=COUNT Number of blocks to include in selection\n"); + HDfprintf(rawoutstream, " -k BLOCK, --block=BLOCK Size of block in hyperslab\n"); + HDfprintf(rawoutstream, " START, COUNT, STRIDE, and BLOCK - is a list of integers the number of which are equal to the\n"); + HDfprintf(rawoutstream, " number of dimensions in the dataspace being queried\n"); + HDfprintf(rawoutstream, "\n"); + HDfprintf(rawoutstream, " D - is the file driver to use in opening the file. Acceptable values\n"); + HDfprintf(rawoutstream, " are \"sec2\", \"family\", \"split\", \"multi\", \"direct\", and \"stream\". Without\n"); + HDfprintf(rawoutstream, " the file driver flag, the file will be opened with each driver in\n"); + HDfprintf(rawoutstream, " turn and in the order specified above until one driver succeeds\n"); + HDfprintf(rawoutstream, " in opening the file.\n"); + HDfprintf(rawoutstream, " F - is a filename.\n"); + HDfprintf(rawoutstream, " P - is the full path from the root group to the object.\n"); + HDfprintf(rawoutstream, " N - is an integer greater than 1.\n"); + HDfprintf(rawoutstream, " T - is a string containing the floating point format, e.g '%%.3f'\n"); + HDfprintf(rawoutstream, " U - is a URI reference (as defined in [IETF RFC 2396],\n"); + HDfprintf(rawoutstream, " updated by [IETF RFC 2732])\n"); + HDfprintf(rawoutstream, " B - is the form of binary output: NATIVE for a memory type, FILE for the\n"); + HDfprintf(rawoutstream, " file type, LE or BE for pre-existing little or big endian types.\n"); + HDfprintf(rawoutstream, " Must be used with -o (output file) and it is recommended that\n"); + HDfprintf(rawoutstream, " -d (dataset) is used. B is an optional argument, defaults to NATIVE\n"); + HDfprintf(rawoutstream, " Q - is the sort index type. It can be \"creation_order\" or \"name\" (default)\n"); + HDfprintf(rawoutstream, " Z - is the sort order type. It can be \"descending\" or \"ascending\" (default)\n"); + HDfprintf(rawoutstream, "\n"); + HDfprintf(rawoutstream, " Examples:\n"); + HDfprintf(rawoutstream, "\n"); + HDfprintf(rawoutstream, " 1) Attribute foo of the group /bar_none in file quux.h5\n"); + HDfprintf(rawoutstream, "\n"); + HDfprintf(rawoutstream, " h5dump -a /bar_none/foo quux.h5\n"); + HDfprintf(rawoutstream, "\n"); + HDfprintf(rawoutstream, " 2) Selecting a subset from dataset /foo in file quux.h5\n"); + HDfprintf(rawoutstream, "\n"); + HDfprintf(rawoutstream, " h5dump -d /foo -s \"0,1\" -S \"1,1\" -c \"2,3\" -k \"2,2\" quux.h5\n"); + HDfprintf(rawoutstream, "\n"); + HDfprintf(rawoutstream, " 3) Saving dataset 'dset' in file quux.h5 to binary file 'out.bin'\n"); + HDfprintf(rawoutstream, " using a little-endian type\n"); + HDfprintf(rawoutstream, "\n"); + HDfprintf(rawoutstream, " h5dump -d /dset -b LE -o out.bin quux.h5\n"); + HDfprintf(rawoutstream, "\n"); + HDfprintf(rawoutstream, " 4) Display two packed bits (bits 0-1 and bits 4-6) in the dataset /dset\n"); + HDfprintf(rawoutstream, "\n"); + HDfprintf(rawoutstream, " h5dump -d /dset -M 0,1,4,3 quux.h5\n"); + HDfprintf(rawoutstream, "\n"); } @@ -454,9 +454,8 @@ table_list_free(void) table_list.nalloc = table_list.nused = 0; } /* end table_list_free() */ - /*------------------------------------------------------------------------- - * Function: set_output_file + * Function: set_data_output_file * * Purpose: Open fname as the output file for dataset raw data. * Set rawdatastream as its file stream. @@ -472,7 +471,7 @@ table_list_free(void) *------------------------------------------------------------------------- */ static int -set_output_file(const char *fname, int is_bin) +set_data_output_file(const char *fname, int is_bin) { FILE *f; /* temporary holding place for the stream pointer * so that rawdatastream is changed only when succeeded */ @@ -502,6 +501,70 @@ set_output_file(const char *fname, int is_bin) } /*------------------------------------------------------------------------- + * Function: set_output_file + * + * Purpose: Open fname as the output file for raw output. + * Set rawoutstream as its file stream. + * + * Return: 0 -- succeeded + * negative -- failed + * + *------------------------------------------------------------------------- + */ +static int +set_output_file(const char *fname) +{ + FILE *f; /* temporary holding place for the stream pointer + * so that rawoutstream is changed only when succeeded */ + + if (rawoutstream && rawoutstream != stdout) { + if (fclose(rawoutstream)) + perror("closing rawoutstream"); + else + rawoutstream = NULL; + } + + if ((f = fopen(fname, "w")) != NULL) { + rawoutstream = f; + return 0; + } + + return -1; +} + +/*------------------------------------------------------------------------- + * Function: set_error_file + * + * Purpose: Open fname as the error output file for dataset raw error. + * Set rawerrorstream as its file stream. + * + * Return: 0 -- succeeded + * negative -- failed + * + *------------------------------------------------------------------------- + */ +static int +set_error_file(const char *fname) +{ + FILE *f; /* temporary holding place for the stream pointer + * so that rawerrorstream is changed only when succeeded */ + + if (rawerrorstream && rawerrorstream != stderr) { + if (fclose(rawerrorstream)) + perror("closing rawerrorstream"); + else + rawerrorstream = NULL; + } + + if ((f = fopen(fname, "w")) != NULL) { + rawerrorstream = f; + return 0; + } + + return -1; +} + +/*------------------------------------------------------------------------- * Function: set_binary_form * * Purpose: set the binary form of output by translating from a string input @@ -1031,13 +1094,13 @@ parse_start: case 'o': if ( bin_output ) { - if (set_output_file(opt_arg, 1) < 0) { + if (set_data_output_file(opt_arg, 1) < 0) { usage(h5tools_getprogname()); goto error; } } else { - if (set_output_file(opt_arg, 0) < 0) { + if (set_data_output_file(opt_arg, 0) < 0) { usage(h5tools_getprogname()); goto error; } @@ -1058,7 +1121,7 @@ parse_start: } bin_output = TRUE; if (outfname!=NULL) { - if (set_output_file(outfname, 1) < 0) { + if (set_data_output_file(outfname, 1) < 0) { /* failed to set output file */ usage(h5tools_getprogname()); goto error; @@ -1448,12 +1511,12 @@ main(int argc, const char *argv[]) begin_obj(h5tools_dump_header_format->filebegin, fname, h5tools_dump_header_format->fileblockbegin); } else { - HDfprintf(stdout, "\n"); + HDfprintf(rawoutstream, "\n"); /* alternative first element, depending on schema or DTD. */ if (useschema) { if (strcmp(xmlnsprefix,"") == 0) { - HDfprintf(stdout, "\n", + HDfprintf(rawoutstream, "\n", xml_dtd_uri); } else { @@ -1465,7 +1528,7 @@ main(int argc, const char *argv[]) indx = strrchr(ns,(int)':'); if (indx) *indx = '\0'; - HDfprintf(stdout, "<%sHDF5-File xmlns:%s=\"http://hdfgroup.org/HDF5/XML/schema/HDF5-File\" " + HDfprintf(rawoutstream, "<%sHDF5-File xmlns:%s=\"http://hdfgroup.org/HDF5/XML/schema/HDF5-File\" " "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " "xsi:schemaLocation=\"http://hdfgroup.org/HDF5/XML/schema/HDF5-File " "http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd\">\n",xmlnsprefix,ns); @@ -1473,17 +1536,17 @@ main(int argc, const char *argv[]) } } else { - HDfprintf(stdout, "\n", xml_dtd_uri); - HDfprintf(stdout, "\n"); + HDfprintf(rawoutstream, "\n", xml_dtd_uri); + HDfprintf(rawoutstream, "\n"); } } if (!doxml) { if (display_fi) { - HDfprintf(stdout, "\n"); + HDfprintf(rawoutstream, "\n"); dump_fcontents(fid); end_obj(h5tools_dump_header_format->fileend,h5tools_dump_header_format->fileblockend); - HDfprintf(stdout, "\n"); + HDfprintf(rawoutstream, "\n"); goto done; } @@ -1502,7 +1565,7 @@ main(int argc, const char *argv[]) dump_function_table->dump_group_function(gid, "/" ); if (!doxml) dump_indent -= COL; - HDfprintf(stdout, "\n"); + HDfprintf(rawoutstream, "\n"); } if(H5Gclose(gid) < 0) { @@ -1524,15 +1587,15 @@ main(int argc, const char *argv[]) hand[i].func(fid, hand[i].obj, hand[i].subset_info, 1, NULL); } } - HDfprintf(stdout, "\n"); + HDfprintf(rawoutstream, "\n"); } if (!doxml) { end_obj(h5tools_dump_header_format->fileend, h5tools_dump_header_format->fileblockend); - HDfprintf(stdout, "\n"); + HDfprintf(rawoutstream, "\n"); } else { - HDfprintf(stdout, "\n", xmlnsprefix); + HDfprintf(rawoutstream, "\n", xmlnsprefix); } done: diff --git a/tools/h5dump/h5dump_ddl.c b/tools/h5dump/h5dump_ddl.c index 8117238..d00b9e8 100644 --- a/tools/h5dump/h5dump_ddl.c +++ b/tools/h5dump/h5dump_ddl.c @@ -49,7 +49,7 @@ dump_datatype(hid_t type) ctx.cur_column = dump_indent; h5dump_type_table = type_table; - h5tools_dump_datatype(stdout, outputformat, &ctx, type); + h5tools_dump_datatype(rawoutstream, outputformat, &ctx, type); h5dump_type_table = NULL; } @@ -77,7 +77,7 @@ dump_dataspace(hid_t space) ctx.indent_level = dump_indent/COL; ctx.cur_column = dump_indent; - h5tools_dump_dataspace(stdout, outputformat, &ctx, space); + h5tools_dump_dataspace(rawoutstream, outputformat, &ctx, space); } @@ -134,7 +134,7 @@ dump_attr_cb(hid_t oid, const char *attr_name, const H5A_info_t UNUSED *info, vo outputformat = &string_dataformat; h5dump_type_table = type_table; - h5tools_dump_attribute(stdout, outputformat, &ctx, oid, attr_name, attr_id, display_ai, display_char); + h5tools_dump_attribute(rawoutstream, outputformat, &ctx, oid, attr_name, attr_id, display_ai, display_char); h5dump_type_table = NULL; if(attr_id < 0) { @@ -264,19 +264,19 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNUSED ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s \"%s\" %s", h5tools_dump_header_format->datasetbegin, name, h5tools_dump_header_format->datasetblockbegin); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -287,7 +287,7 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNUSED } if(HDstrlen(h5tools_dump_header_format->datasetend)) h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datasetend); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level--; @@ -298,14 +298,14 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNUSED } else if(found_obj->displayed) { ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s \"%s\" %s", h5tools_dump_header_format->datasetbegin, name, h5tools_dump_header_format->datasetblockbegin); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level++; @@ -314,12 +314,12 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNUSED /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s \"%s\"", HARDLINK, found_obj->objname); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -330,7 +330,7 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNUSED } if(HDstrlen(h5tools_dump_header_format->datasetend)) h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datasetend); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); H5Dclose(obj); goto done; @@ -383,7 +383,7 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNUSED h5tools_str_append(&buffer, "%s \"%s\" %s", h5tools_dump_header_format->softlinkbegin, name, h5tools_dump_header_format->softlinkblockbegin); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level++; @@ -396,18 +396,18 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNUSED /* print the value of a soft link */ /* Standard DDL: no modification */ ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "LINKTARGET \"%s\"", targbuf); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); } ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -418,7 +418,7 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNUSED } if(HDstrlen(h5tools_dump_header_format->softlinkend)) h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->softlinkend); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); HDfree(targbuf); break; @@ -428,14 +428,14 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNUSED HDassert(targbuf); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s \"%s\" %s", h5tools_dump_header_format->extlinkbegin, name, h5tools_dump_header_format->extlinkblockbegin); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); if(H5Lget_val(group, name, targbuf, linfo->u.val_size, H5P_DEFAULT) < 0) { indentation(dump_indent); @@ -457,20 +457,20 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNUSED ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "TARGETFILE \"%s\"", filename); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "TARGETPATH \"%s\"", targname); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); /* dump the external link */ dump_extlink(group, name, targname); @@ -478,7 +478,7 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNUSED } /* end else */ } /* end else */ ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -489,35 +489,35 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNUSED } if(HDstrlen(h5tools_dump_header_format->extlinkend)) h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->extlinkend); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); HDfree(targbuf); break; default: ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s \"%s\" %s", h5tools_dump_header_format->udlinkbegin, name, h5tools_dump_header_format->udlinkblockbegin); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "LINKCLASS %d", linfo->type); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); if(HDstrlen(h5tools_dump_header_format->udlinkblockend)) { @@ -527,7 +527,7 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNUSED } if(HDstrlen(h5tools_dump_header_format->udlinkend)) h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->udlinkend); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); break; } /* end switch */ @@ -618,7 +618,7 @@ dump_named_datatype(hid_t tid, const char *name) h5tools_str_append(&buffer, "%s \"%s\" %s", h5tools_dump_header_format->datatypebegin, name, h5tools_dump_header_format->datatypeblockbegin); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); H5Oget_info(tid, &oinfo); @@ -639,7 +639,7 @@ dump_named_datatype(hid_t tid, const char *name) /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s \"%s\"", HARDLINK, found_obj->objname); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); goto done; } else @@ -648,13 +648,13 @@ dump_named_datatype(hid_t tid, const char *name) /* Render the element */ h5tools_str_reset(&buffer); - h5tools_print_datatype(stdout, &buffer, outputformat, &ctx, tid, FALSE); + h5tools_print_datatype(rawoutstream, &buffer, outputformat, &ctx, tid, FALSE); if(H5Tget_class(tid) != H5T_COMPOUND) { h5tools_str_append(&buffer, ";"); } - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); /* print attributes */ dump_indent += COL; @@ -687,7 +687,7 @@ done: } if(HDstrlen(h5tools_dump_header_format->datatypeend)) h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datatypeend); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); h5tools_str_close(&buffer); } @@ -779,7 +779,7 @@ dump_group(hid_t gid, const char *name) h5tools_str_append(&buffer, "%s \"%s\" %s", h5tools_dump_header_format->groupbegin, name, h5tools_dump_header_format->groupblockbegin); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level++; dump_indent += COL; @@ -800,10 +800,10 @@ dump_group(hid_t gid, const char *name) } /* end if */ if(display_oid) { - h5tools_dump_oid(stdout, outputformat, &ctx, gid); + h5tools_dump_oid(rawoutstream, outputformat, &ctx, gid); } - h5tools_dump_comment(stdout, outputformat, &ctx, gid); + h5tools_dump_comment(rawoutstream, outputformat, &ctx, gid); H5Oget_info(gid, &oinfo); @@ -825,7 +825,7 @@ dump_group(hid_t gid, const char *name) /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s \"%s\"", HARDLINK, found_obj->objname); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); } else { found_obj->displayed = TRUE; @@ -882,7 +882,7 @@ dump_group(hid_t gid, const char *name) ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -893,7 +893,7 @@ dump_group(hid_t gid, const char *name) } if(HDstrlen(h5tools_dump_header_format->groupend)) h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->groupend); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); h5tools_str_close(&buffer); } @@ -962,36 +962,36 @@ dump_dataset(hid_t did, const char *name, struct subset_t *sset) HDmemset(&buffer, 0, sizeof(h5tools_str_t)); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s \"%s\" %s", h5tools_dump_header_format->datasetbegin, name, h5tools_dump_header_format->datasetblockbegin); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); - h5tools_dump_comment(stdout, outputformat, &ctx, did); + h5tools_dump_comment(rawoutstream, outputformat, &ctx, did); dump_indent += COL; ctx.indent_level++; type = H5Dget_type(did); h5dump_type_table = type_table; - h5tools_dump_datatype(stdout, outputformat, &ctx, type); + h5tools_dump_datatype(rawoutstream, outputformat, &ctx, type); h5dump_type_table = NULL; space = H5Dget_space(did); - h5tools_dump_dataspace(stdout, outputformat, &ctx, space); + h5tools_dump_dataspace(rawoutstream, outputformat, &ctx, space); H5Sclose(space); if(display_oid) { - h5tools_dump_oid(stdout, outputformat, &ctx, did); + h5tools_dump_oid(rawoutstream, outputformat, &ctx, did); } if(display_dcpl) { h5dump_type_table = type_table; - h5tools_dump_dcpl(stdout, outputformat, &ctx, dcpl_id, type, did); + h5tools_dump_dcpl(rawoutstream, outputformat, &ctx, dcpl_id, type, did); h5dump_type_table = NULL; } H5Pclose(dcpl_id); @@ -1004,25 +1004,25 @@ dump_dataset(hid_t did, const char *name, struct subset_t *sset) for(i=0; iline_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); } switch(H5Tget_class(type)) { case H5T_TIME: ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "DATA{ not yet implemented.}"); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level--; break; @@ -1038,7 +1038,7 @@ dump_dataset(hid_t did, const char *name, struct subset_t *sset) case H5T_VLEN: case H5T_ARRAY: { - h5tools_dump_data(stdout, outputformat, &ctx, did, TRUE, sset, display_ai, display_char); + h5tools_dump_data(rawoutstream, outputformat, &ctx, did, TRUE, sset, display_ai, display_char); } break; @@ -1069,7 +1069,7 @@ dump_dataset(hid_t did, const char *name, struct subset_t *sset) dump_indent -= COL; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1080,7 +1080,7 @@ dump_dataset(hid_t did, const char *name, struct subset_t *sset) } if(HDstrlen(h5tools_dump_header_format->datasetend)) h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datasetend); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); h5tools_str_close(&buffer); } @@ -1131,7 +1131,7 @@ dump_data(hid_t obj_id, int obj_data, struct subset_t *sset, int display_index) if(obj_data == DATASET_DATA) print_dataset = TRUE; - h5tools_dump_data(stdout, outputformat, &ctx, obj_id, print_dataset, sset, display_index, display_char); + h5tools_dump_data(rawoutstream, outputformat, &ctx, obj_id, print_dataset, sset, display_index, display_char); } @@ -1185,23 +1185,23 @@ dump_fcpl(hid_t fid) * SUPER_BLOCK *------------------------------------------------------------------------- */ - HDfprintf(stdout, "\n%s %s\n",SUPER_BLOCK, BEGIN); + HDfprintf(rawoutstream, "\n%s %s\n",SUPER_BLOCK, BEGIN); indentation(dump_indent + COL); - HDfprintf(stdout, "%s %u\n","SUPERBLOCK_VERSION", finfo.super.version); + HDfprintf(rawoutstream, "%s %u\n","SUPERBLOCK_VERSION", finfo.super.version); indentation(dump_indent + COL); - HDfprintf(stdout, "%s %u\n","FREELIST_VERSION", finfo.free.version); + HDfprintf(rawoutstream, "%s %u\n","FREELIST_VERSION", finfo.free.version); indentation(dump_indent + COL); - HDfprintf(stdout, "%s %u\n","SYMBOLTABLE_VERSION", 0); /* Retain this for backward compatibility, for now (QAK) */ + HDfprintf(rawoutstream, "%s %u\n","SYMBOLTABLE_VERSION", 0); /* Retain this for backward compatibility, for now (QAK) */ indentation(dump_indent + COL); - HDfprintf(stdout, "%s %u\n","OBJECTHEADER_VERSION", finfo.sohm.version); + HDfprintf(rawoutstream, "%s %u\n","OBJECTHEADER_VERSION", finfo.sohm.version); indentation(dump_indent + COL); - HDfprintf(stdout,"%s %Hd\n","OFFSET_SIZE", (long long)off_size); + HDfprintf(rawoutstream,"%s %Hd\n","OFFSET_SIZE", (long long)off_size); indentation(dump_indent + COL); - HDfprintf(stdout,"%s %Hd\n","LENGTH_SIZE", (long long)len_size); + HDfprintf(rawoutstream,"%s %Hd\n","LENGTH_SIZE", (long long)len_size); indentation(dump_indent + COL); - HDfprintf(stdout, "%s %u\n","BTREE_RANK", sym_ik); + HDfprintf(rawoutstream, "%s %u\n","BTREE_RANK", sym_ik); indentation(dump_indent + COL); - HDfprintf(stdout, "%s %d\n","BTREE_LEAF", sym_lk); + HDfprintf(rawoutstream, "%s %d\n","BTREE_LEAF", sym_lk); #ifdef SHOW_FILE_DRIVER if (H5FD_CORE==fdriver) @@ -1232,37 +1232,37 @@ dump_fcpl(hid_t fid) /* Take out this because the driver used can be different from the * standard output. */ /*indentation(dump_indent + COL); - HDfprintf(stdout, "%s %s\n","FILE_DRIVER", dname);*/ + HDfprintf(rawoutstream, "%s %s\n","FILE_DRIVER", dname);*/ #endif indentation(dump_indent + COL); - HDfprintf(stdout, "%s %u\n","ISTORE_K", istore_ik); + HDfprintf(rawoutstream, "%s %u\n","ISTORE_K", istore_ik); indentation(dump_indent + COL); if(fs_strategy == H5F_FILE_SPACE_ALL_PERSIST) - HDfprintf(stdout, "%s %s\n", "FILE_SPACE_STRATEGY", "H5F_FILE_SPACE_ALL_PERSIST"); + HDfprintf(rawoutstream, "%s %s\n", "FILE_SPACE_STRATEGY", "H5F_FILE_SPACE_ALL_PERSIST"); else if(fs_strategy == H5F_FILE_SPACE_ALL) - HDfprintf(stdout, "%s %s\n", "FILE_SPACE_STRATEGY", "H5F_FILE_SPACE_ALL"); + HDfprintf(rawoutstream, "%s %s\n", "FILE_SPACE_STRATEGY", "H5F_FILE_SPACE_ALL"); else if(fs_strategy == H5F_FILE_SPACE_AGGR_VFD) - HDfprintf(stdout, "%s %s\n", "FILE_SPACE_STRATEGY", "H5F_FILE_SPACE_AGGR_VFD"); + HDfprintf(rawoutstream, "%s %s\n", "FILE_SPACE_STRATEGY", "H5F_FILE_SPACE_AGGR_VFD"); else if(fs_strategy == H5F_FILE_SPACE_VFD) - HDfprintf(stdout, "%s %s\n", "FILE_SPACE_STRATEGY", "H5F_FILE_SPACE_VFD"); + HDfprintf(rawoutstream, "%s %s\n", "FILE_SPACE_STRATEGY", "H5F_FILE_SPACE_VFD"); else - HDfprintf(stdout, "%s %s\n", "FILE_SPACE_STRATEGY", "Unknown strategy"); + HDfprintf(rawoutstream, "%s %s\n", "FILE_SPACE_STRATEGY", "Unknown strategy"); indentation(dump_indent + COL); - HDfprintf(stdout, "%s %Hu\n","FREE_SPACE_THRESHOLD", fs_threshold); + HDfprintf(rawoutstream, "%s %Hu\n","FREE_SPACE_THRESHOLD", fs_threshold); /*------------------------------------------------------------------------- * USER_BLOCK *------------------------------------------------------------------------- */ indentation(dump_indent + COL); - HDfprintf(stdout, "USER_BLOCK %s\n",BEGIN); + HDfprintf(rawoutstream, "USER_BLOCK %s\n",BEGIN); indentation(dump_indent + COL + COL); - HDfprintf(stdout,"%s %Hu\n","USERBLOCK_SIZE", userblock); + HDfprintf(rawoutstream,"%s %Hu\n","USERBLOCK_SIZE", userblock); indentation(dump_indent + COL); - HDfprintf(stdout, "%s\n",END); + HDfprintf(rawoutstream, "%s\n",END); - HDfprintf(stdout, "%s",END); + HDfprintf(rawoutstream, "%s",END); } /*------------------------------------------------------------------------- @@ -1281,7 +1281,7 @@ dump_fcpl(hid_t fid) void dump_fcontents(hid_t fid) { - HDfprintf(stdout, "%s %s\n",FILE_CONTENTS, BEGIN); + HDfprintf(rawoutstream, "%s %s\n",FILE_CONTENTS, BEGIN); /* special case of unamed types in root group */ if (unamedtype) { @@ -1289,14 +1289,14 @@ dump_fcontents(hid_t fid) for (u = 0; u < type_table->nobjs; u++) { if (!type_table->objs[u].recorded) - HDfprintf(stdout, " %-10s /#"H5_PRINTF_HADDR_FMT"\n", "datatype", type_table->objs[u].objno); + HDfprintf(rawoutstream, " %-10s /#"H5_PRINTF_HADDR_FMT"\n", "datatype", type_table->objs[u].objno); } } /* print objects in the files */ h5trav_print(fid); - HDfprintf(stdout, " %s\n",END); + HDfprintf(rawoutstream, " %s\n",END); } /*------------------------------------------------------------------------- @@ -1380,19 +1380,19 @@ handle_attributes(hid_t fid, const char *attr, void UNUSED * data, int UNUSED pe HDmemset(&buffer, 0, sizeof(h5tools_str_t)); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s \"%s\" %s", h5tools_dump_header_format->attributebegin, attr, h5tools_dump_header_format->attributeblockbegin); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); error_msg("unable to open object \"%s\"\n", obj_name); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); if(HDstrlen(h5tools_dump_header_format->attributeblockend)) { @@ -1402,7 +1402,7 @@ handle_attributes(hid_t fid, const char *attr, void UNUSED * data, int UNUSED pe } if(HDstrlen(h5tools_dump_header_format->attributeend)) h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->attributeend); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); h5tools_str_close(&buffer); @@ -1415,7 +1415,7 @@ handle_attributes(hid_t fid, const char *attr, void UNUSED * data, int UNUSED pe attr_data_output = display_attr_data; h5dump_type_table = type_table; - h5tools_dump_attribute(stdout, outputformat, &ctx, oid, attr, attr_id, display_ai, display_char); + h5tools_dump_attribute(rawoutstream, outputformat, &ctx, oid, attr, attr_id, display_ai, display_char); h5dump_type_table = NULL; if(attr_id < 0) { @@ -1474,9 +1474,9 @@ handle_datasets(hid_t fid, const char *dset, void *data, int pe, const char *dis if((dsetid = H5Dopen2(fid, dset, H5P_DEFAULT)) < 0) { if (pe) { - HDfprintf(stdout, "\n"); + HDfprintf(rawoutstream, "\n"); begin_obj(h5tools_dump_header_format->datasetbegin, real_name, h5tools_dump_header_format->datasetblockbegin); - HDfprintf(stdout, "\n"); + HDfprintf(rawoutstream, "\n"); indentation(COL); error_msg("unable to open dataset \"%s\"\n", real_name); end_obj(h5tools_dump_header_format->datasetend, h5tools_dump_header_format->datasetblockend); @@ -1577,12 +1577,12 @@ handle_datasets(hid_t fid, const char *dset, void *data, int pe, const char *dis if(found_obj) { if (found_obj->displayed) { - HDfprintf(stdout, "\n"); + HDfprintf(rawoutstream, "\n"); indentation(dump_indent); begin_obj(h5tools_dump_header_format->datasetbegin, real_name, h5tools_dump_header_format->datasetblockbegin); - HDfprintf(stdout, "\n"); + HDfprintf(rawoutstream, "\n"); indentation(dump_indent + COL); - HDfprintf(stdout, "%s \"%s\"\n", HARDLINK, found_obj->objname); + HDfprintf(rawoutstream, "%s \"%s\"\n", HARDLINK, found_obj->objname); indentation(dump_indent); end_obj(h5tools_dump_header_format->datasetend, h5tools_dump_header_format->datasetblockend); } @@ -1634,9 +1634,9 @@ handle_groups(hid_t fid, const char *group, void UNUSED *data, int pe, const cha if((gid = H5Gopen2(fid, group, H5P_DEFAULT)) < 0) { if (pe) { - HDfprintf(stdout, "\n"); + HDfprintf(rawoutstream, "\n"); begin_obj(h5tools_dump_header_format->groupbegin, real_name, h5tools_dump_header_format->groupblockbegin); - HDfprintf(stdout, "\n"); + HDfprintf(rawoutstream, "\n"); indentation(COL); error_msg("unable to open group \"%s\"\n", real_name); end_obj(h5tools_dump_header_format->groupend, h5tools_dump_header_format->groupblockend); @@ -1691,15 +1691,15 @@ handle_links(hid_t fid, const char *links, void UNUSED * data, int UNUSED pe, co } else { char *buf = (char *)HDmalloc(linfo.u.val_size); - HDfprintf(stdout, "\n"); + HDfprintf(rawoutstream, "\n"); switch(linfo.type) { case H5L_TYPE_SOFT: /* Soft link */ begin_obj(h5tools_dump_header_format->softlinkbegin, links, h5tools_dump_header_format->softlinkblockbegin); - HDfprintf(stdout, "\n"); + HDfprintf(rawoutstream, "\n"); indentation(COL); if(H5Lget_val(fid, links, buf, linfo.u.val_size, H5P_DEFAULT) >= 0) - HDfprintf(stdout, "LINKTARGET \"%s\"\n", buf); + HDfprintf(rawoutstream, "LINKTARGET \"%s\"\n", buf); else { error_msg("h5dump error: unable to get link value for \"%s\"\n", links); h5tools_setstatus(EXIT_FAILURE); @@ -1709,21 +1709,21 @@ handle_links(hid_t fid, const char *links, void UNUSED * data, int UNUSED pe, co case H5L_TYPE_EXTERNAL: begin_obj(h5tools_dump_header_format->udlinkbegin, links, h5tools_dump_header_format->udlinkblockbegin); - HDfprintf(stdout, "\n"); + HDfprintf(rawoutstream, "\n"); indentation(COL); begin_obj(h5tools_dump_header_format->extlinkbegin, links, h5tools_dump_header_format->extlinkblockbegin); - HDfprintf(stdout, "\n"); + HDfprintf(rawoutstream, "\n"); if(H5Lget_val(fid, links, buf, linfo.u.val_size, H5P_DEFAULT) >= 0) { const char *elink_file; const char *elink_path; if(H5Lunpack_elink_val(buf, linfo.u.val_size, NULL, &elink_file, &elink_path)>=0) { indentation(COL); - HDfprintf(stdout, "LINKCLASS %d\n", linfo.type); + HDfprintf(rawoutstream, "LINKCLASS %d\n", linfo.type); indentation(COL); - HDfprintf(stdout, "TARGETFILE \"%s\"\n", elink_file); + HDfprintf(rawoutstream, "TARGETFILE \"%s\"\n", elink_file); indentation(COL); - HDfprintf(stdout, "TARGETPATH \"%s\"\n", elink_path); + HDfprintf(rawoutstream, "TARGETPATH \"%s\"\n", elink_path); } else { error_msg("h5dump error: unable to unpack external link value for \"%s\"\n", links); @@ -1739,12 +1739,12 @@ handle_links(hid_t fid, const char *links, void UNUSED * data, int UNUSED pe, co default: begin_obj(h5tools_dump_header_format->udlinkbegin, links, h5tools_dump_header_format->udlinkblockbegin); - HDfprintf(stdout, "\n"); + HDfprintf(rawoutstream, "\n"); indentation(COL); begin_obj(h5tools_dump_header_format->udlinkbegin, links, h5tools_dump_header_format->udlinkblockbegin); - HDfprintf(stdout, "\n"); + HDfprintf(rawoutstream, "\n"); indentation(COL); - HDfprintf(stdout, "LINKCLASS %d\n", linfo.type); + HDfprintf(rawoutstream, "LINKCLASS %d\n", linfo.type); end_obj(h5tools_dump_header_format->udlinkend, h5tools_dump_header_format->udlinkblockend); break; } /* end switch */ @@ -1798,9 +1798,9 @@ handle_datatypes(hid_t fid, const char *type, void UNUSED * data, int pe, const if(idx == type_table->nobjs) { if (pe) { /* unknown type */ - HDfprintf(stdout, "\n"); + HDfprintf(rawoutstream, "\n"); begin_obj(h5tools_dump_header_format->datatypebegin, real_name, h5tools_dump_header_format->datatypeblockbegin); - HDfprintf(stdout, "\n"); + HDfprintf(rawoutstream, "\n"); indentation(COL); error_msg("unable to open datatype \"%s\"\n", real_name); end_obj(h5tools_dump_header_format->datatypeend, h5tools_dump_header_format->datatypeblockend); diff --git a/tools/h5dump/h5dump_defines.h b/tools/h5dump/h5dump_defines.h index a801cac..4af5360 100644 --- a/tools/h5dump/h5dump_defines.h +++ b/tools/h5dump/h5dump_defines.h @@ -26,20 +26,20 @@ #define begin_obj(obj,name,begin) \ do { \ if (name) \ - HDfprintf(stdout, "%s \"%s\" %s", (obj), (name), (begin)); \ + HDfprintf(rawoutstream, "%s \"%s\" %s", (obj), (name), (begin)); \ else \ - HDfprintf(stdout, "%s %s", (obj), (begin)); \ + HDfprintf(rawoutstream, "%s %s", (obj), (begin)); \ } while(0); #define end_obj(obj,end) \ do { \ if(HDstrlen(end)) { \ - HDfprintf(stdout, "%s", end); \ + HDfprintf(rawoutstream, "%s", end); \ if(HDstrlen(obj)) \ - HDfprintf(stdout, " "); \ + HDfprintf(rawoutstream, " "); \ } \ if(HDstrlen(obj)) \ - HDfprintf(stdout, "%s", obj); \ + HDfprintf(rawoutstream, "%s", obj); \ } while(0); diff --git a/tools/h5dump/h5dump_xml.c b/tools/h5dump/h5dump_xml.c index 94e4d28..e6f8043 100644 --- a/tools/h5dump/h5dump_xml.c +++ b/tools/h5dump/h5dump_xml.c @@ -156,19 +156,19 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNU ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s \"%s\" %s", h5tools_dump_header_format->datasetbegin, name, h5tools_dump_header_format->datasetblockbegin); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -179,7 +179,7 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNU } if(HDstrlen(h5tools_dump_header_format->datasetend)) h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datasetend); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level--; @@ -203,7 +203,7 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNU xml_name_to_XID(prefix, parentxid, sizeof(parentxid), 1); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -216,31 +216,31 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNU t_obj_path, /* H5Path */ parentxid, /* Parents */ t_prefix); /* H5ParentPaths */ - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); xml_name_to_XID(found_obj->objname, pointerxid, sizeof(pointerxid), 1); ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sDatasetPtr OBJ-XID=\"%s\" H5Path=\"%s\"/>", xmlnsprefix, pointerxid,t_objname); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); HDfree(t_name); HDfree(t_obj_path); @@ -326,7 +326,7 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNU if (res == 0) { /* target obj found */ ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -343,12 +343,12 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNU targetxid, /* TargetObj */ parentxid, /* Parents */ t_prefix); /* H5ParentPaths */ - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); } else { /* dangling link -- omit from xml attributes */ ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -364,7 +364,7 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNU t_targbuf, /* TargetPath */ parentxid, /* Parents */ t_prefix); /* H5ParentPaths */ - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); } HDfree(t_prefix); @@ -409,7 +409,7 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNU xml_name_to_XID(prefix, parentxid, sizeof(parentxid), 1); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -427,7 +427,7 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNU targname, /* TargetPath*/ parentxid, /* Parents */ t_prefix); /* H5ParentPaths */ - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); HDfree(t_prefix); HDfree(t_name); @@ -452,7 +452,7 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNU xml_name_to_XID(prefix, parentxid, sizeof(parentxid), 1); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -468,7 +468,7 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNU linfo->type, /* LinkClass */ parentxid, /* Parents */ t_prefix); /* H5ParentPaths */ - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); HDfree(t_prefix); HDfree(t_name); @@ -828,38 +828,38 @@ xml_print_datatype(hid_t type, unsigned in_group) as it's name. */ ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sNamedDataTypePtr OBJ-XID=\"/%s\"/>", xmlnsprefix, dtxid); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); } else { /* point to the NDT by name */ char *t_objname = xml_escape_the_name(found_obj->objname); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sNamedDataTypePtr OBJ-XID=\"%s\" H5Path=\"%s\"/>", xmlnsprefix, dtxid, t_objname); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); HDfree(t_objname); } HDfree(dtxid); } else { ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, ""); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); h5tools_setstatus(EXIT_FAILURE); } } @@ -868,12 +868,12 @@ xml_print_datatype(hid_t type, unsigned in_group) switch (H5Tget_class(type)) { case H5T_INTEGER: ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sAtomicType>",xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level++; /* */ @@ -881,7 +881,7 @@ xml_print_datatype(hid_t type, unsigned in_group) sgn = H5Tget_sign(type); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -915,16 +915,16 @@ xml_print_datatype(hid_t type, unsigned in_group) sz = H5Tget_size(type); h5tools_str_append(&buffer, "%lu", (unsigned long)sz); h5tools_str_append(&buffer, "\" />"); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "",xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); break; case H5T_FLOAT: @@ -935,16 +935,16 @@ xml_print_datatype(hid_t type, unsigned in_group) ord = H5Tget_order(type); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sAtomicType>",xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -971,45 +971,45 @@ xml_print_datatype(hid_t type, unsigned in_group) h5tools_str_append(&buffer, "\" SignBitLocation=\"%lu\" ", (unsigned long)spos); h5tools_str_append(&buffer, "ExponentBits=\"%lu\" ExponentLocation=\"%lu\" ", (unsigned long)esize, (unsigned long)epos); h5tools_str_append(&buffer, "MantissaBits=\"%lu\" MantissaLocation=\"%lu\" />", (unsigned long)msize, (unsigned long)mpos); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "",xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); break; case H5T_TIME: ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sAtomicType>",xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sTimeType />",xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); h5tools_str_append(&buffer, ""); ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "",xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); break; case H5T_STRING: @@ -1020,17 +1020,17 @@ xml_print_datatype(hid_t type, unsigned in_group) is_vlstr = H5Tis_variable_str(type); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sAtomicType>",xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1057,16 +1057,16 @@ xml_print_datatype(hid_t type, unsigned in_group) else { h5tools_str_append(&buffer, "H5T_STR_ERROR\"/>"); } - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "",xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); break; case H5T_BITFIELD: @@ -1074,16 +1074,16 @@ xml_print_datatype(hid_t type, unsigned in_group) ord = H5Tget_order(type); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sAtomicType>",xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1103,33 +1103,33 @@ xml_print_datatype(hid_t type, unsigned in_group) size = H5Tget_size(type); h5tools_str_append(&buffer, "\" Size=\"%lu\"/>", (unsigned long)size); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "",xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); break; case H5T_OPAQUE: /* */ ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sAtomicType>",xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level++; mname = H5Tget_tag(type); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -1137,16 +1137,16 @@ xml_print_datatype(hid_t type, unsigned in_group) HDfree(mname); size = H5Tget_size(type); h5tools_str_append(&buffer, "Size=\"%lu\"/>", (unsigned long)size); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "",xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); break; case H5T_COMPOUND: @@ -1156,12 +1156,12 @@ xml_print_datatype(hid_t type, unsigned in_group) nmembers = H5Tget_nmembers(type); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sCompoundType>",xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); /* List each member Field of the type */ /* */ @@ -1176,12 +1176,12 @@ xml_print_datatype(hid_t type, unsigned in_group) t_fname = xml_escape_the_name(mname); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sField FieldName=\"%s\">",xmlnsprefix, t_fname); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); HDfree(mname); HDfree(t_fname); @@ -1189,12 +1189,12 @@ xml_print_datatype(hid_t type, unsigned in_group) ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sDataType>",xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level++; dump_indent += COL; xml_print_datatype(mtype,0); @@ -1202,80 +1202,80 @@ xml_print_datatype(hid_t type, unsigned in_group) ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "",xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); dump_indent -= COL; ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "",xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); } dump_indent -= COL; ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "",xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); break; case H5T_REFERENCE: ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sAtomicType>",xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level++; /* Only Object references supported at this time */ ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sReferenceType>",xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sObjectReferenceType />",xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "",xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "",xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); break; case H5T_ENUM: @@ -1283,62 +1283,62 @@ xml_print_datatype(hid_t type, unsigned in_group) nmembs = H5Tget_nmembers(type); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sAtomicType>",xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); dump_indent += COL; ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sEnumType Nelems=\"%d\">",xmlnsprefix, nmembs); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); xml_print_enum(type); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "",xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); dump_indent -= COL; ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "",xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); break; case H5T_VLEN: ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sVLType>",xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); super = H5Tget_super(type); dump_indent += COL; ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sDataType>",xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); dump_indent += COL; ctx.indent_level++; xml_print_datatype(super,0); @@ -1346,22 +1346,22 @@ xml_print_datatype(hid_t type, unsigned in_group) ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "",xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); dump_indent -= COL; ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "",xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); H5Tclose(super); break; @@ -1372,14 +1372,14 @@ xml_print_datatype(hid_t type, unsigned in_group) /* Print lead-in */ ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sArrayType Ndims=\"",xmlnsprefix); ndims = H5Tget_array_ndims(type); h5tools_str_append(&buffer, "%u\">", ndims); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); /* Get array information */ H5Tget_array_dims2(type, dims); @@ -1388,12 +1388,12 @@ xml_print_datatype(hid_t type, unsigned in_group) ctx.indent_level++; for (i = 0; i < ndims; i++) { ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sArrayDimension DimSize=\"%u\"/>", xmlnsprefix, (int) dims[i]); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); } ctx.indent_level--; @@ -1401,12 +1401,12 @@ xml_print_datatype(hid_t type, unsigned in_group) ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sDataType>",xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); dump_indent += COL; ctx.indent_level++; xml_print_datatype(super,0); @@ -1414,34 +1414,34 @@ xml_print_datatype(hid_t type, unsigned in_group) ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "",xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); dump_indent -= COL; ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "",xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); /* Close array base type */ H5Tclose(super); break; default: ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, ""); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); h5tools_setstatus(EXIT_FAILURE); break; } @@ -1521,48 +1521,48 @@ xml_dump_datatype(hid_t type) */ ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sNamedDataTypePtr OBJ-XID=\"%s\"/>", xmlnsprefix, dtxid); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); } else { /* pointer to a named datatype already in XML */ char *t_objname = xml_escape_the_name(found_obj->objname); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sNamedDataTypePtr OBJ-XID=\"%s\" H5Path=\"%s\" />", xmlnsprefix, dtxid, t_objname); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); HDfree(t_objname); } HDfree(dtxid); } else { ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, ""); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); } } else { ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sDataType>", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level++; dump_indent += COL; xml_print_datatype(type, 0); @@ -1570,12 +1570,12 @@ xml_dump_datatype(hid_t type) dump_indent -= COL; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); } ctx.indent_level--; dump_indent -= COL; @@ -1638,12 +1638,12 @@ xml_dump_dataspace(hid_t space) ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sDataspace>", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level++; switch (space_type) { @@ -1651,12 +1651,12 @@ xml_dump_dataspace(hid_t space) /* scalar dataspace (just a tag, no XML attrs. defined */ ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sScalarDataspace />",xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); break; case H5S_SIMPLE: @@ -1664,56 +1664,56 @@ xml_dump_dataspace(hid_t space) /* */ ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sSimpleDataspace Ndims=\"%d\">",xmlnsprefix, ndims); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); /* print the elements */ ctx.indent_level++; for (i = 0; i < ndims; i++) { if (maxsize[i] == H5S_UNLIMITED) { ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sDimension DimSize=\"%" H5_PRINTF_LL_WIDTH "u\" MaxDimSize=\"UNLIMITED\"/>", xmlnsprefix,size[i]); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); } else if (maxsize[i] == (hsize_t) 0) { ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sDimension DimSize=\"%" H5_PRINTF_LL_WIDTH "u\" MaxDimSize=\"%" H5_PRINTF_LL_WIDTH "u\"/>", xmlnsprefix,size[i], size[i]); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); } else { ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sDimension DimSize=\"%" H5_PRINTF_LL_WIDTH "u\" MaxDimSize=\"%" H5_PRINTF_LL_WIDTH "u\"/>", xmlnsprefix, size[i], maxsize[i]); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); } } ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "", xmlnsprefix ); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); break; #ifdef TMP @@ -1722,35 +1722,35 @@ xml_dump_dataspace(hid_t space) /* null dataspace (just a tag, no XML attrs. defined */ ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sNullDataspace />",xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); break; #endif /* TMP */ case H5S_NO_CLASS: default: ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, ""); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); } ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level--; h5tools_str_close(&buffer); @@ -1821,22 +1821,22 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t UNUSED * sset, int UNU outputformat = &string_dataformat; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sData>", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sDataFromFile>", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level--; @@ -1857,7 +1857,7 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t UNUSED * sset, int UNU datactx.need_prefix = TRUE; datactx.indent_level = ctx.indent_level; datactx.cur_column = ctx.cur_column; - status = h5tools_dump_dset(stdout, outputformat, &datactx, obj_id, -1, NULL); + status = h5tools_dump_dset(rawoutstream, outputformat, &datactx, obj_id, -1, NULL); } } else { @@ -1906,7 +1906,7 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t UNUSED * sset, int UNU datactx.need_prefix = TRUE; datactx.indent_level = ctx.indent_level; datactx.cur_column = ctx.cur_column; - status = h5tools_dump_mem(stdout, outputformat, &datactx, obj_id, p_type, space, buf); + status = h5tools_dump_mem(rawoutstream, outputformat, &datactx, obj_id, p_type, space, buf); } /* Reclaim any VL memory, if necessary */ if (vl_data) @@ -1923,12 +1923,12 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t UNUSED * sset, int UNU ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "Unable to print data."); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level--; @@ -1944,17 +1944,17 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t UNUSED * sset, int UNU /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "",xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); h5tools_str_close(&buffer); } @@ -2013,12 +2013,12 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t UNUSED *info, outputformat = &string_dataformat; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sAttribute Name=\"%s\">", xmlnsprefix, t_aname); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); HDfree(t_aname); if ((attr_id = H5Aopen(attr, attr_name, H5P_DEFAULT)) >= 0) { @@ -2049,44 +2049,44 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t UNUSED *info, dump_indent += COL; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sData>", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, ""); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sNoData/>", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, ""); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level--; dump_indent -= COL; @@ -2094,112 +2094,112 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t UNUSED *info, case H5T_COMPOUND: ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, ""); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); dump_function_table->dump_data_function(attr_id, ATTRIBUTE_DATA, NULL, 0); break; case H5T_REFERENCE: ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sData>", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); if (!H5Tequal(type, H5T_STD_REF_OBJ)) { ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, ""); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sNoData />", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); } else { ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sDataFromFile>", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); xml_print_refs(attr_id, ATTRIBUTE_DATA); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); } ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); break; case H5T_VLEN: ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, ""); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); dump_function_table->dump_data_function(attr_id, ATTRIBUTE_DATA, NULL, 0); break; default: ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sData>", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "", H5Tget_class(type)); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sNoData/>", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); break; } } @@ -2207,32 +2207,32 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t UNUSED *info, /* The case of an attribute never yet written ?? * Or dataspace is H5S_NULL. */ ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sData>", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sNoData/>", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); } ctx.indent_level--; dump_indent -= COL; @@ -2242,12 +2242,12 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t UNUSED *info, H5Aclose(attr_id); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); h5tools_str_close(&buffer); return SUCCEED; @@ -2257,22 +2257,22 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t UNUSED *info, ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, ""); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); h5tools_str_close(&buffer); @@ -2357,7 +2357,7 @@ xml_dump_named_datatype(hid_t type, const char *name) */ ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2366,13 +2366,13 @@ xml_dump_named_datatype(hid_t type, const char *name) xmlnsprefix, name, dtxid, parentxid, HDstrcmp(prefix,"") ? t_prefix : "/"); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); } else { H5O_info_t oinfo; /* Object info */ ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2381,7 +2381,7 @@ xml_dump_named_datatype(hid_t type, const char *name) xmlnsprefix, t_name, dtxid, t_tmp, parentxid, (HDstrcmp(prefix, "") ? t_prefix : "/")); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); /* Check uniqueness of named datatype */ H5Oget_info(type, &oinfo); @@ -2409,22 +2409,22 @@ xml_dump_named_datatype(hid_t type, const char *name) xml_name_to_XID(found_obj->objname, pointerxid, sizeof(pointerxid), 1); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sNamedDatatypePtr OBJ-XID=\"%s\" H5Path=\"%s\"/>", xmlnsprefix, pointerxid, t_objname); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); HDfree(t_objname); goto done; } @@ -2437,12 +2437,12 @@ xml_dump_named_datatype(hid_t type, const char *name) dump_indent += COL; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sDataType>",xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level++; dump_indent += COL; @@ -2451,23 +2451,23 @@ xml_dump_named_datatype(hid_t type, const char *name) dump_indent -= COL; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "",xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level--; dump_indent -= COL; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "",xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); done: @@ -2607,13 +2607,13 @@ xml_dump_group(hid_t gid, const char *name) xml_name_to_XID("/", grpxid, 100, 1); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sRootGroup OBJ-XID=\"%s\" H5Path=\"%s\">", xmlnsprefix, grpxid, "/"); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); } else { t_objname = xml_escape_the_name(found_obj->objname); @@ -2622,7 +2622,7 @@ xml_dump_group(hid_t gid, const char *name) xml_name_to_XID(par, parentxid, 100, 1); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2630,7 +2630,7 @@ xml_dump_group(hid_t gid, const char *name) "Parents=\"%s\" H5ParentPaths=\"%s\">", xmlnsprefix,t_name, grpxid, get_next_xid(), t_objname, parentxid, par_name); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); HDfree(t_objname); HDfree(par_name); @@ -2642,7 +2642,7 @@ xml_dump_group(hid_t gid, const char *name) xml_name_to_XID(par, parentxid, 100, 1); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2650,7 +2650,7 @@ xml_dump_group(hid_t gid, const char *name) "Parents=\"%s\" H5ParentPaths=\"%s\" />", xmlnsprefix, ptrstr, t_objname, parentxid, par_name); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level--; @@ -2666,13 +2666,13 @@ xml_dump_group(hid_t gid, const char *name) xml_name_to_XID("/", grpxid, 100, 1); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sRootGroup OBJ-XID=\"%s\" H5Path=\"%s\">", xmlnsprefix, grpxid, "/"); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); } else { char *t_tmp = xml_escape_the_name(tmp); @@ -2682,14 +2682,14 @@ xml_dump_group(hid_t gid, const char *name) xml_name_to_XID(par, parentxid, 100, 1); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sGroup Name=\"%s\" OBJ-XID=\"%s\" H5Path=\"%s\" " "Parents=\"%s\" H5ParentPaths=\"%s\" >", xmlnsprefix,t_name, grpxid, t_tmp, parentxid, par_name); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); HDfree(t_tmp); HDfree(par_name); @@ -2752,7 +2752,7 @@ xml_dump_group(hid_t gid, const char *name) char *parentxid = (char *)HDmalloc(100); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2773,7 +2773,7 @@ xml_dump_group(hid_t gid, const char *name) HDfree(t_tmp); HDfree(par_name); } - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); HDfree(t_name); HDfree(grpxid); @@ -2825,7 +2825,7 @@ xml_dump_group(hid_t gid, const char *name) } ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -2833,7 +2833,7 @@ xml_dump_group(hid_t gid, const char *name) h5tools_str_append(&buffer, "", xmlnsprefix); else h5tools_str_append(&buffer, "", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); h5tools_str_close(&buffer); @@ -2958,23 +2958,23 @@ xml_print_refs(hid_t did, int source) if (!path) { ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "\"%s\"", "NULL"); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); } else { char *t_path = xml_escape_the_string(path, -1); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "\"%s\"", t_path); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); HDfree(t_path); } ctx.indent_level--; @@ -3124,23 +3124,23 @@ xml_print_strs(hid_t did, int source) if (!onestring) { ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "NULL"); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); } else { char *t_onestring = xml_escape_the_string(onestring, (int) str_size); if (t_onestring) { ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "\"%s\"", t_onestring); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); HDfree(t_onestring); } } @@ -3235,7 +3235,7 @@ check_filters(hid_t dcpl) if (filter == H5Z_FILTER_DEFLATE) { ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3248,36 +3248,36 @@ check_filters(hid_t dcpl) h5tools_str_append(&buffer, "%d", cd_values[0]); } h5tools_str_append(&buffer, "\"/>"); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level--; } else if (filter == H5Z_FILTER_FLETCHER32) { ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sFletcher32 />", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level--; } else if (filter == H5Z_FILTER_SHUFFLE) { ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sShuffle />", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level--; } else if (filter == H5Z_FILTER_SZIP) { ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3318,7 +3318,7 @@ check_filters(hid_t dcpl) h5tools_str_append(&buffer, "Header=\"Raw\""); } h5tools_str_append(&buffer, "/>"); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level--; } else { @@ -3371,12 +3371,12 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) dump_indent += COL; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sData>", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level++; dump_indent += COL; @@ -3389,126 +3389,126 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) const char * path = lookup_ref_path(*(hobj_ref_t *) buf); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sDataFromFile>", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); if (!path) { ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "\"%s\"", "NULL"); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); } else { char *t_path = xml_escape_the_string(path, -1); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "\"%s\"", t_path); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); HDfree(t_path); } ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); } else if (H5Tget_class(type) == H5T_STRING) { /* ????? */ ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, ""); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sNoData />", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); } else { /* all other data */ switch (H5Tget_class(type)) { case H5T_INTEGER: ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sDataFromFile>", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "\"%d\"", *(int *) buf); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); break; case H5T_FLOAT: ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sDataFromFile>", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "\"%f\"", *(float *) buf); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); break; case H5T_BITFIELD: case H5T_OPAQUE: ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sDataFromFile>", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); sz = H5Tget_size(type); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3518,126 +3518,126 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) buf = (char *) buf + sizeof(unsigned int); } h5tools_str_append(&buffer, "\""); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); break; case H5T_ENUM: ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sDataFromFile>", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); name = H5Tget_member_name(type, *(unsigned *) buf); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "\"%s\"", name); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); break; case H5T_ARRAY: ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, ""); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sNoData />", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); break; case H5T_TIME: ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, ""); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sNoData />", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); break; case H5T_COMPOUND: ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, ""); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sNoData />", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); break; case H5T_VLEN: ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, ""); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sNoData />", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); break; default: ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "", H5Tget_class(type)); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sNoData/>", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); break; } } @@ -3646,12 +3646,12 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) dump_indent -= COL; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level--; dump_indent -= COL; @@ -3738,14 +3738,14 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t UNUSED * sset) xml_name_to_XID(prefix, pstr, 100, 1); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sDataset Name=\"%s\" OBJ-XID=\"%s\" H5Path= \"%s\" Parents=\"%s\" H5ParentPaths=\"%s\">", xmlnsprefix, t_name, rstr, t_tmp, pstr, strcmp(prefix, "") ? t_prefix : "/"); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); HDfree(t_name); HDfree(t_tmp); @@ -3769,24 +3769,24 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t UNUSED * sset) dump_indent += COL; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sStorageLayout>", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level++; dump_indent += COL; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sChunkedLayout ", xmlnsprefix); ndims = H5Pget_chunk(dcpl, maxdims, chsize); h5tools_str_append(&buffer, "Ndims=\"%d\">", ndims); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level++; dump_indent += COL; @@ -3794,21 +3794,21 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t UNUSED * sset) for (i = 0; i < ndims; i++) { ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sChunkDimension DimSize=\"%" H5_PRINTF_LL_WIDTH "u\" />", xmlnsprefix, chsize[i]); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); } ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sRequiredFilter>", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level++; dump_indent += COL; @@ -3817,33 +3817,33 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t UNUSED * sset) dump_indent -= COL; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level--; dump_indent -= COL; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level--; dump_indent -= COL; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level--; dump_indent -= COL; HDfree(chsize); @@ -3852,60 +3852,60 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t UNUSED * sset) ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sStorageLayout>", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sContiguousLayout/>", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level--; } else if (H5D_COMPACT == H5Pget_layout(dcpl)) { ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sStorageLayout>", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sCompactLayout/>", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level--; } /* and check for external.... ?? */ @@ -3916,7 +3916,7 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t UNUSED * sset) dump_indent += COL; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -3957,30 +3957,30 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t UNUSED * sset) } h5tools_str_append(&buffer, "\""); h5tools_str_append(&buffer, ">"); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level++; dump_indent += COL; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sFillValue>", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); H5Pfill_value_defined(dcpl, &fvstatus); if (fvstatus == H5D_FILL_VALUE_UNDEFINED || (fvstatus == H5D_FILL_VALUE_DEFAULT && ft == H5D_FILL_TIME_IFSET)) { ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sNoFill/>", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level--; } else { @@ -3988,23 +3988,23 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t UNUSED * sset) } ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level--; dump_indent -= COL; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level--; dump_indent -= COL; @@ -4052,48 +4052,48 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t UNUSED * sset) ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sData>", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, ""); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sNoData />", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sData>", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level--; break; case H5T_COMPOUND: ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, ""); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level++; dump_indent += COL; @@ -4104,68 +4104,68 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t UNUSED * sset) case H5T_REFERENCE: ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sData>", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); if (!H5Tequal(type, H5T_STD_REF_OBJ)) { ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, ""); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sNoData />", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); } else { ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sDataFromFile>", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); xml_print_refs(did, DATASET_DATA); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); } ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); break; case H5T_VLEN: ctx.indent_level--; dump_indent -= COL; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, ""); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level++; dump_indent += COL; @@ -4177,36 +4177,36 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t UNUSED * sset) break; default: ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sData>", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "", H5Tget_class(type)); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sNoData/>", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); break; } } @@ -4215,30 +4215,30 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t UNUSED * sset) ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sData>", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sNoData/>", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level--; } @@ -4247,12 +4247,12 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t UNUSED * sset) H5Pclose(dcpl); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "", xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); h5tools_str_close(&buffer); } @@ -4316,22 +4316,22 @@ xml_print_enum(hid_t type) super = H5Tget_super(type); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sDataType>",xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); xml_print_datatype(super,0); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "",xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); /* * Determine what datatype to use for the native values. To simplify @@ -4377,41 +4377,41 @@ xml_print_enum(hid_t type) char *t_name = xml_escape_the_name(name[i]); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sEnumElement>",xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s", t_name); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); HDfree(t_name); ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "",xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sEnumValue>",xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level++; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); @@ -4429,16 +4429,16 @@ xml_print_enum(hid_t type) h5tools_str_append(&buffer,"%" H5_PRINTF_LL_WIDTH "d", *((long long *) ((void *) (value + i * dst_size)))); } - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); ctx.indent_level--; ctx.need_prefix = TRUE; - h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0); + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "",xmlnsprefix); - h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); } ctx.indent_level--; dump_indent -= COL; diff --git a/tools/h5import/h5import.c b/tools/h5import/h5import.c index b80cfe3..89701bd 100755 --- a/tools/h5import/h5import.c +++ b/tools/h5import/h5import.c @@ -53,6 +53,9 @@ int main(int argc, char *argv[]) h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); + /* Initialize h5tools lib */ + h5tools_init(); + (void) HDsetvbuf(stderr, (char *) NULL, _IOLBF, 0); (void) HDsetvbuf(stdout, (char *) NULL, _IOLBF, 0); diff --git a/tools/h5jam/h5jam.c b/tools/h5jam/h5jam.c index 2bc3462..923bc5a 100644 --- a/tools/h5jam/h5jam.c +++ b/tools/h5jam/h5jam.c @@ -237,6 +237,9 @@ main (int argc, const char *argv[]) H5Eget_auto2(H5E_DEFAULT, &func, &edata); H5Eset_auto2(H5E_DEFAULT, NULL, NULL); + /* Initialize h5tools lib */ + h5tools_init(); + parse_command_line (argc, argv); if (ub_file == NULL) { diff --git a/tools/h5repack/h5repack_main.c b/tools/h5repack/h5repack_main.c index f0094d5..15b57b0 100644 --- a/tools/h5repack/h5repack_main.c +++ b/tools/h5repack/h5repack_main.c @@ -106,6 +106,9 @@ int main(int argc, const char **argv) h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); + /* Initialize h5tools lib */ + h5tools_init(); + /* update hyperslab buffer size from H5TOOLS_BUFSIZE env if exist */ if ( h5tools_getenv_update_hyperslab_bufsize() < 0) HDexit(EXIT_FAILURE); diff --git a/tools/h5stat/h5stat.c b/tools/h5stat/h5stat.c index 21f77f2..e206f4f 100644 --- a/tools/h5stat/h5stat.c +++ b/tools/h5stat/h5stat.c @@ -1631,6 +1631,7 @@ main(int argc, const char *argv[]) /* Initialize h5tools lib */ h5tools_init(); + if((hand = parse_command_line(argc, argv))==NULL) { goto done; } diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index ef32cde..30b8f33 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -40,6 +40,8 @@ hid_t H5E_tools_g = -1; hid_t H5E_tools_min_id_g = -1; int compound_data; FILE *rawdatastream; /* should initialize to stdout but gcc moans about it */ +FILE *rawoutstream; /* should initialize to stdout but gcc moans about it */ +FILE *rawerrorstream; /* should initialize to stderr but gcc moans about it */ int bin_output; /* binary output */ int bin_form; /* binary form */ int region_output; /* region output */ @@ -117,6 +119,10 @@ h5tools_init(void) if (!rawdatastream) rawdatastream = stdout; + if (!rawoutstream) + rawoutstream = stdout; + if (!rawerrorstream) + rawerrorstream = stderr; h5tools_dump_init(); @@ -150,6 +156,18 @@ h5tools_close(void) else rawdatastream = NULL; } + if (rawoutstream && rawoutstream != stdout) { + if (fclose(rawoutstream)) + perror("closing rawoutstream"); + else + rawoutstream = NULL; + } + if (rawerrorstream && rawerrorstream != stderr) { + if (fclose(rawerrorstream)) + perror("closing rawerrorstream"); + else + rawerrorstream = NULL; + } /* Clean up the reference path table, if it's been used */ term_ref_path_table(); @@ -1047,7 +1065,7 @@ init_acc_pos(h5tools_context_t *ctx, hsize_t *dims) *------------------------------------------------------------------------- */ int -do_bin_output(FILE *stream, hid_t container, hsize_t nelmts, hid_t tid, void *_mem) +do_bin_output(FILE *stream, FILE *err_stream, hid_t container, hsize_t nelmts, hid_t tid, void *_mem) { HERR_INIT(int, SUCCEED) unsigned char *mem = (unsigned char*)_mem; @@ -1059,7 +1077,7 @@ do_bin_output(FILE *stream, hid_t container, hsize_t nelmts, hid_t tid, void *_m for (i = 0; i < nelmts; i++) { if (render_bin_output(stream, container, tid, mem + i * size) < 0) { - printf("\nError in writing binary stream\n"); + HDfprintf(err_stream,"\nError in writing binary stream\n"); return FAIL; } } diff --git a/tools/lib/h5tools.h b/tools/lib/h5tools.h index a8f43b3..0f4b271 100644 --- a/tools/lib/h5tools.h +++ b/tools/lib/h5tools.h @@ -525,6 +525,8 @@ H5TOOLS_DLLVAR int packed_data_offset; /* offset of packed bits to display H5TOOLS_DLLVAR int packed_data_length; /* lengtht of packed bits to display */ H5TOOLS_DLLVAR unsigned long long packed_data_mask; /* mask in which packed bits to display */ H5TOOLS_DLLVAR FILE *rawdatastream; /* output stream for raw data */ +H5TOOLS_DLLVAR FILE *rawoutstream; /* output stream for raw output */ +H5TOOLS_DLLVAR FILE *rawerrorstream; /* output stream for raw error */ H5TOOLS_DLLVAR int bin_output; /* binary output */ H5TOOLS_DLLVAR int bin_form; /* binary form */ H5TOOLS_DLLVAR int region_output; /* region output */ @@ -558,7 +560,7 @@ H5TOOLS_DLL void h5tools_simple_prefix(FILE *stream, const h5tool_format_t *i H5TOOLS_DLL void h5tools_region_simple_prefix(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, hsize_t elmtno, hsize_t *ptdata, int secnum); -H5TOOLS_DLL int do_bin_output(FILE *stream, hid_t container, hsize_t nelmts, hid_t tid, void *_mem); +H5TOOLS_DLL int do_bin_output(FILE *stream, FILE *err_stream, hid_t container, hsize_t nelmts, hid_t tid, void *_mem); H5TOOLS_DLL int render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem); H5TOOLS_DLL int render_bin_output_region_data_blocks(hid_t region_id, FILE *stream, hid_t container, int ndims, hid_t type_id, hssize_t nblocks, hsize_t *ptdata); diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index 98945aa..9657b50 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -297,7 +297,7 @@ h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, hid_t contai /* binary dump */ if (bin_output) { - do_bin_output(rawdatastream, container, nelmts, type, _mem); + do_bin_output(rawdatastream, rawoutstream, container, nelmts, type, _mem); } /* end if */ else { /* setup */ @@ -1754,7 +1754,7 @@ h5tools_dump_dset(FILE *stream, const h5tool_format_t *info, h5tools_context_t * h5tool_format_t info_dflt; /* Use default values */ if (!stream) - stream = stdout; + stream = rawoutstream; if (!info) { HDmemset(&info_dflt, 0, sizeof info_dflt); @@ -1826,7 +1826,7 @@ h5tools_dump_mem(FILE *stream, const h5tool_format_t *info, h5tools_context_t *c /* Use default values */ if (!stream) - stream = stdout; + stream = rawoutstream; if (!info) { HDmemset(&info_dflt, 0, sizeof(info_dflt)); diff --git a/tools/lib/h5tools_utils.c b/tools/lib/h5tools_utils.c index dbe1875..4505609 100644 --- a/tools/lib/h5tools_utils.c +++ b/tools/lib/h5tools_utils.c @@ -28,6 +28,7 @@ #include #include +#include "h5tools.h" #include "h5tools_utils.h" #include "H5private.h" #include "h5trav.h" @@ -115,7 +116,7 @@ void parallel_print(const char* format, ...) overflow_file = HDtmpfile(); if(overflow_file == NULL) - HDfprintf(stderr, "warning: could not create overflow file. Output may be truncated.\n"); + HDfprintf(rawerrorstream, "warning: could not create overflow file. Output may be truncated.\n"); else bytes_written = HDvfprintf(overflow_file, format, ap); } @@ -151,9 +152,10 @@ error_msg(const char *fmt, ...) va_list ap; HDva_start(ap, fmt); - HDfflush(stdout); - HDfprintf(stderr, "%s error: ", h5tools_getprogname()); - HDvfprintf(stderr, fmt, ap); + HDfflush(rawdatastream); + HDfflush(rawoutstream); + HDfprintf(rawerrorstream, "%s error: ", h5tools_getprogname()); + HDvfprintf(rawerrorstream, fmt, ap); HDva_end(ap); } @@ -180,9 +182,10 @@ warn_msg(const char *fmt, ...) va_list ap; HDva_start(ap, fmt); - HDfflush(stdout); - HDfprintf(stderr, "%s warning: ", h5tools_getprogname()); - HDvfprintf(stderr, fmt, ap); + HDfflush(rawdatastream); + HDfflush(rawoutstream); + HDfprintf(rawerrorstream, "%s warning: ", h5tools_getprogname()); + HDvfprintf(rawerrorstream, fmt, ap); HDva_end(ap); } @@ -266,7 +269,7 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti } else if (l_opts[i].has_arg == require_arg) { if (opt_err) - HDfprintf(stderr, + HDfprintf(rawerrorstream, "%s: option required for \"--%s\" flag\n", argv[0], arg); @@ -276,7 +279,7 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti else { if (arg[len] == '=') { if (opt_err) - HDfprintf(stderr, + HDfprintf(rawerrorstream, "%s: no option required for \"%s\" flag\n", argv[0], arg); @@ -291,7 +294,7 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti if (l_opts[i].name == NULL) { /* exhausted all of the l_opts we have and still didn't match */ if (opt_err) - HDfprintf(stderr, "%s: unknown option \"%s\"\n", argv[0], arg); + HDfprintf(rawerrorstream, "%s: unknown option \"%s\"\n", argv[0], arg); opt_opt = '?'; } @@ -307,7 +310,7 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti if (opt_opt == ':' || (cp = HDstrchr(opts, opt_opt)) == 0) { if (opt_err) - HDfprintf(stderr, "%s: unknown option \"%c\"\n", + HDfprintf(rawerrorstream, "%s: unknown option \"%c\"\n", argv[0], opt_opt); /* if no chars left in this token, move to next token */ @@ -326,7 +329,7 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti } else if (++opt_ind >= argc) { if (opt_err) - HDfprintf(stderr, + HDfprintf(rawerrorstream, "%s: value expected for option \"%c\"\n", argv[0], opt_opt); @@ -385,10 +388,10 @@ indentation(int x) { if (x < h5tools_nCols) { while (x-- > 0) - printf(" "); + HDfprintf(rawoutstream, " "); } else { - HDfprintf(stderr, "error: the indentation exceeds the number of cols.\n"); + HDfprintf(rawerrorstream, "error: the indentation exceeds the number of cols.\n"); HDexit(1); } } @@ -411,7 +414,7 @@ indentation(int x) void print_version(const char *progname) { - printf("%s: Version %u.%u.%u%s%s\n", + HDfprintf(rawoutstream, "%s: Version %u.%u.%u%s%s\n", progname, H5_VERS_MAJOR, H5_VERS_MINOR, H5_VERS_RELEASE, ((char *)H5_VERS_SUBRELEASE)[0] ? "-" : "", H5_VERS_SUBRELEASE); } @@ -491,9 +494,9 @@ dump_table(char* tablename, table_t *table) { unsigned u; - printf("%s: # of entries = %d\n", tablename,table->nobjs); + HDfprintf(rawoutstream,"%s: # of entries = %d\n", tablename,table->nobjs); for (u = 0; u < table->nobjs; u++) - HDfprintf(stdout,"%a %s %d %d\n", table->objs[u].objno, + HDfprintf(rawoutstream,"%a %s %d %d\n", table->objs[u].objno, table->objs[u].objname, table->objs[u].displayed, table->objs[u].recorded); } @@ -914,7 +917,7 @@ int h5tools_getenv_update_hyperslab_bufsize(void) { /* TODO: later when pubilshed - printf("Error: Invalid environment variable \"H5TOOLS_BUFSIZE\" : %s\n", env_str); + HDfprintf(rawerrorstream,"Error: Invalid environment variable \"H5TOOLS_BUFSIZE\" : %s\n", env_str); */ goto error; -- cgit v0.12 From 840540021390d563573c5ad6a62c74668a0b798b Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 24 Feb 2012 18:27:42 -0500 Subject: [svn-r21986] Updated haddr_t format for print of STORAGE_LAYOUT - linew 32 issue --- tools/lib/h5tools_dump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index 9657b50..d97f96a 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -3069,7 +3069,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); - h5tools_str_append(&buffer,"OFFSET %u", ioffset); + h5tools_str_append(&buffer,"OFFSET "H5_PRINTF_HADDR_FMT, ioffset); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); ctx->indent_level--; -- cgit v0.12 From 3d3bf48b9a3cc6f72d122a57c403bd1df9cc1e7d Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 27 Feb 2012 09:42:48 -0500 Subject: [svn-r21987] Remove unnecessary dependancies on tools library for h5 file gentests. Tested: local linux --- tools/h5copy/CMakeLists.txt | 2 +- tools/h5copy/h5copygentest.c | 11 ++--------- tools/h5diff/CMakeLists.txt | 2 +- tools/h5diff/h5diffgentest.c | 16 +++++++++++----- tools/h5jam/CMakeLists.txt | 2 +- tools/h5stat/CMakeLists.txt | 2 +- 6 files changed, 17 insertions(+), 18 deletions(-) diff --git a/tools/h5copy/CMakeLists.txt b/tools/h5copy/CMakeLists.txt index b0b9aa8..7006283 100644 --- a/tools/h5copy/CMakeLists.txt +++ b/tools/h5copy/CMakeLists.txt @@ -27,7 +27,7 @@ IF (BUILD_TESTING) IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) ADD_EXECUTABLE (h5copygentest ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/h5copygentest.c) TARGET_NAMING (h5copygentest ${LIB_TYPE}) - TARGET_LINK_LIBRARIES (h5copygentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + TARGET_LINK_LIBRARIES (h5copygentest ${HDF5_LIB_TARGET}) SET_TARGET_PROPERTIES (h5copygentest PROPERTIES FOLDER generator/tools) #ADD_TEST (NAME h5copygentest COMMAND $) diff --git a/tools/h5copy/h5copygentest.c b/tools/h5copy/h5copygentest.c index 85bcb29..e658e92 100644 --- a/tools/h5copy/h5copygentest.c +++ b/tools/h5copy/h5copygentest.c @@ -19,10 +19,6 @@ #include #include "hdf5.h" #include "H5private.h" -#include "h5tools.h" - -/* Name of tool */ -#define PROGRAMNAME "h5copygentest" /* HDF file names */ #define HDF_FILE1 "h5copytst.h5" @@ -365,7 +361,7 @@ static void gent_empty_group(hid_t loc_id) * Function: gent_nested_datasets * * Purpose: Generate a group in a location and populate it with the "standard" - * datasets + * datasets * *------------------------------------------------------------------------- */ @@ -387,7 +383,7 @@ static void gent_nested_datasets(hid_t loc_id) * Function: gent_nested_group * * Purpose: Generate a group in a location and populate it with another group - * containing the "standard" datasets + * containing the "standard" datasets * *------------------------------------------------------------------------- */ @@ -891,9 +887,6 @@ out: int main(void) { - h5tools_setprogname(PROGRAMNAME); - h5tools_setstatus(EXIT_SUCCESS); - Test_Obj_Copy(); Test_Ref_Copy(); Test_Extlink_Copy(); diff --git a/tools/h5diff/CMakeLists.txt b/tools/h5diff/CMakeLists.txt index 1fa1cf3..3f73bd7 100644 --- a/tools/h5diff/CMakeLists.txt +++ b/tools/h5diff/CMakeLists.txt @@ -43,7 +43,7 @@ IF (BUILD_TESTING) IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) ADD_EXECUTABLE (h5diffgentest ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/h5diffgentest.c) TARGET_NAMING (h5diffgentest ${LIB_TYPE}) - TARGET_LINK_LIBRARIES (h5diffgentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + TARGET_LINK_LIBRARIES (h5diffgentest ${HDF5_LIB_TARGET}) SET_TARGET_PROPERTIES (h5diffgentest PROPERTIES FOLDER generator/tools) #ADD_TEST (NAME h5diffgentest COMMAND $) diff --git a/tools/h5diff/h5diffgentest.c b/tools/h5diff/h5diffgentest.c index b29ed41..d58e1b4 100644 --- a/tools/h5diff/h5diffgentest.c +++ b/tools/h5diff/h5diffgentest.c @@ -17,12 +17,18 @@ #include #include "hdf5.h" #include "H5private.h" -#include "h5tools.h" -#include "h5tools_utils.h" - -/* Name of tool */ -#define PROGRAMNAME "h5diffgentest" +/* + * The output functions need a temporary buffer to hold a piece of the + * dataset while it's being printed. This constant sets the limit on the + * size of that temporary buffer in bytes. For efficiency's sake, choose the + * largest value suitable for your machine (for testing use a small value). + */ +/* Maximum size used in a call to malloc for a dataset + * NOTE: this value should stay in sync with the value defined in the tools + * library file: h5tools_utils.h + */ +hsize_t H5TOOLS_MALLOCSIZE = (128 * 1024 * 1024); /*------------------------------------------------------------------------- * Program: h5diffgentest diff --git a/tools/h5jam/CMakeLists.txt b/tools/h5jam/CMakeLists.txt index e5caa11..9a74ebc 100644 --- a/tools/h5jam/CMakeLists.txt +++ b/tools/h5jam/CMakeLists.txt @@ -50,7 +50,7 @@ IF (BUILD_TESTING) IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) ADD_EXECUTABLE (h5jamgentest ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/h5jamgentest.c) TARGET_NAMING (h5jamgentest ${LIB_TYPE}) - TARGET_LINK_LIBRARIES (h5jamgentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + TARGET_LINK_LIBRARIES (h5jamgentest ${HDF5_LIB_TARGET}) SET_TARGET_PROPERTIES (h5jamgentest PROPERTIES FOLDER generator/tools) #ADD_TEST (NAME h5jamgentest COMMAND $) diff --git a/tools/h5stat/CMakeLists.txt b/tools/h5stat/CMakeLists.txt index 5613826..b0984a6 100644 --- a/tools/h5stat/CMakeLists.txt +++ b/tools/h5stat/CMakeLists.txt @@ -30,7 +30,7 @@ IF (BUILD_TESTING) IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) ADD_EXECUTABLE (h5stat_gentest ${HDF5_TOOLS_H5STAT_SOURCE_DIR}/h5stat_gentest.c) TARGET_NAMING (h5stat_gentest ${LIB_TYPE}) - TARGET_LINK_LIBRARIES (h5stat_gentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + TARGET_LINK_LIBRARIES (h5stat_gentest ${HDF5_LIB_TARGET}) SET_TARGET_PROPERTIES (h5stat_gentest PROPERTIES FOLDER generator/tools) #ADD_TEST (NAME h5stat_gentest COMMAND $) -- cgit v0.12 From fb6eace96045e35caf229ebc91ce1ea0a536ead9 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 27 Feb 2012 09:50:27 -0500 Subject: [svn-r21988] Tools must call h5tools_init before command_line parsing or using tools_mesg functions. Tools library uses alias variables for stdout, stderr and tools library uses HDfprintf() functions. --- tools/h5diff/ph5diff_main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/h5diff/ph5diff_main.c b/tools/h5diff/ph5diff_main.c index 67b0c92..5bd5567 100644 --- a/tools/h5diff/ph5diff_main.c +++ b/tools/h5diff/ph5diff_main.c @@ -68,6 +68,9 @@ int main(int argc, const char *argv[]) h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); + /* Initialize h5tools lib */ + h5tools_init(); + outBuffOffset = 0; g_Parallel = 1; -- cgit v0.12 From c8458f779cc3dc97e2692009c7d22b3df71a1c92 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 27 Feb 2012 11:56:09 -0500 Subject: [svn-r21990] Tools library uses alais variables for stdout, stderr and tools library uses HDfprintf() functions. Tested: local linux, jam-pp --- tools/h5ls/h5ls.c | 386 +++++++++++++++++++++++++++--------------------------- 1 file changed, 192 insertions(+), 194 deletions(-) diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c index 6337231..3e335e9 100644 --- a/tools/h5ls/h5ls.c +++ b/tools/h5ls/h5ls.c @@ -176,7 +176,7 @@ static herr_t visit_obj(hid_t file, const char *oname, iter_t *iter); static void usage (void) { - HDfprintf(stderr, "\ + HDfprintf(rawerrorstream, "\ usage: %s [OPTIONS] [OBJECTS...]\n\ OPTIONS\n\ -h, -?, --help Print a usage message and exit\n\ @@ -301,7 +301,7 @@ display_string(FILE *stream, const char *s, hbool_t escape_spaces) break; default: if (isprint((int)*s)) { - if (stream) putc(*s, stream); + if (stream) HDfputc(*s, stream); nprint++; } else { if (stream) { @@ -359,7 +359,7 @@ display_obj_name(FILE *stream, const iter_t *iter, const char *oname, } /* end else */ n = display_string(stream, last_sep, TRUE); } /* end else */ - printf("%*s ", MAX(0, (24 - n)), s); + HDfprintf(rawoutstream, "%*s ", MAX(0, (24 - n)), s); return TRUE; } @@ -388,97 +388,97 @@ static hbool_t display_native_type(hid_t type, int UNUSED ind) { if (H5Tequal(type, H5T_NATIVE_SCHAR)==TRUE) { - printf("native signed char"); + HDfprintf(rawoutstream, "native signed char"); } else if (H5Tequal(type, H5T_NATIVE_UCHAR)==TRUE) { - printf("native unsigned char"); + HDfprintf(rawoutstream, "native unsigned char"); } else if (H5Tequal(type, H5T_NATIVE_INT)==TRUE) { - printf("native int"); + HDfprintf(rawoutstream, "native int"); } else if (H5Tequal(type, H5T_NATIVE_UINT)==TRUE) { - printf("native unsigned int"); + HDfprintf(rawoutstream, "native unsigned int"); } else if (H5Tequal(type, H5T_NATIVE_SHORT)==TRUE) { - printf("native short"); + HDfprintf(rawoutstream, "native short"); } else if (H5Tequal(type, H5T_NATIVE_USHORT)==TRUE) { - printf("native unsigned short"); + HDfprintf(rawoutstream, "native unsigned short"); } else if (H5Tequal(type, H5T_NATIVE_LONG)==TRUE) { - printf("native long"); + HDfprintf(rawoutstream, "native long"); } else if (H5Tequal(type, H5T_NATIVE_ULONG)==TRUE) { - printf("native unsigned long"); + HDfprintf(rawoutstream, "native unsigned long"); } else if (H5Tequal(type, H5T_NATIVE_LLONG)==TRUE) { - printf("native long long"); + HDfprintf(rawoutstream, "native long long"); } else if (H5Tequal(type, H5T_NATIVE_ULLONG)==TRUE) { - printf("native unsigned long long"); + HDfprintf(rawoutstream, "native unsigned long long"); } else if (H5Tequal(type, H5T_NATIVE_FLOAT)==TRUE) { - printf("native float"); + HDfprintf(rawoutstream, "native float"); } else if (H5Tequal(type, H5T_NATIVE_DOUBLE)==TRUE) { - printf("native double"); + HDfprintf(rawoutstream, "native double"); #if H5_SIZEOF_LONG_DOUBLE !=0 } else if (H5Tequal(type, H5T_NATIVE_LDOUBLE)==TRUE) { - printf("native long double"); + HDfprintf(rawoutstream, "native long double"); #endif } else if (H5Tequal(type, H5T_NATIVE_INT8)==TRUE) { - printf("native int8_t"); + HDfprintf(rawoutstream, "native int8_t"); } else if (H5Tequal(type, H5T_NATIVE_UINT8)==TRUE) { - printf("native uint8_t"); + HDfprintf(rawoutstream, "native uint8_t"); } else if (H5Tequal(type, H5T_NATIVE_INT16)==TRUE) { - printf("native int16_t"); + HDfprintf(rawoutstream, "native int16_t"); } else if (H5Tequal(type, H5T_NATIVE_UINT16)==TRUE) { - printf("native uint16_t"); + HDfprintf(rawoutstream, "native uint16_t"); } else if (H5Tequal(type, H5T_NATIVE_INT32)==TRUE) { - printf("native int32_t"); + HDfprintf(rawoutstream, "native int32_t"); } else if (H5Tequal(type, H5T_NATIVE_UINT32)==TRUE) { - printf("native uint32_t"); + HDfprintf(rawoutstream, "native uint32_t"); } else if (H5Tequal(type, H5T_NATIVE_INT64)==TRUE) { - printf("native int64_t"); + HDfprintf(rawoutstream, "native int64_t"); } else if (H5Tequal(type, H5T_NATIVE_UINT64)==TRUE) { - printf("native uint64_t"); + HDfprintf(rawoutstream, "native uint64_t"); } else if (H5Tequal(type, H5T_NATIVE_INT_LEAST8)==TRUE) { - printf("native int_least8_t"); + HDfprintf(rawoutstream, "native int_least8_t"); } else if (H5Tequal(type, H5T_NATIVE_UINT_LEAST8)==TRUE) { - printf("native uint_least8_t"); + HDfprintf(rawoutstream, "native uint_least8_t"); } else if (H5Tequal(type, H5T_NATIVE_INT_LEAST16)==TRUE) { - printf("native int_least16_t"); + HDfprintf(rawoutstream, "native int_least16_t"); } else if (H5Tequal(type, H5T_NATIVE_UINT_LEAST16)==TRUE) { - printf("native uint_least16_t"); + HDfprintf(rawoutstream, "native uint_least16_t"); } else if (H5Tequal(type, H5T_NATIVE_INT_LEAST32)==TRUE) { - printf("native int_least32_t"); + HDfprintf(rawoutstream, "native int_least32_t"); } else if (H5Tequal(type, H5T_NATIVE_UINT_LEAST32)==TRUE) { - printf("native uint_least32_t"); + HDfprintf(rawoutstream, "native uint_least32_t"); } else if (H5Tequal(type, H5T_NATIVE_INT_LEAST64)==TRUE) { - printf("native int_least64_t"); + HDfprintf(rawoutstream, "native int_least64_t"); } else if (H5Tequal(type, H5T_NATIVE_UINT_LEAST64)==TRUE) { - printf("native uint_least64_t"); + HDfprintf(rawoutstream, "native uint_least64_t"); } else if (H5Tequal(type, H5T_NATIVE_INT_FAST8)==TRUE) { - printf("native int_fast8_t"); + HDfprintf(rawoutstream, "native int_fast8_t"); } else if (H5Tequal(type, H5T_NATIVE_UINT_FAST8)==TRUE) { - printf("native uint_fast8_t"); + HDfprintf(rawoutstream, "native uint_fast8_t"); } else if (H5Tequal(type, H5T_NATIVE_INT_FAST16)==TRUE) { - printf("native int_fast16_t"); + HDfprintf(rawoutstream, "native int_fast16_t"); } else if (H5Tequal(type, H5T_NATIVE_UINT_FAST16)==TRUE) { - printf("native uint_fast16_t"); + HDfprintf(rawoutstream, "native uint_fast16_t"); } else if (H5Tequal(type, H5T_NATIVE_INT_FAST32)==TRUE) { - printf("native int_fast32_t"); + HDfprintf(rawoutstream, "native int_fast32_t"); } else if (H5Tequal(type, H5T_NATIVE_UINT_FAST32)==TRUE) { - printf("native uint_fast32_t"); + HDfprintf(rawoutstream, "native uint_fast32_t"); } else if (H5Tequal(type, H5T_NATIVE_INT_FAST64)==TRUE) { - printf("native int_fast64_t"); + HDfprintf(rawoutstream, "native int_fast64_t"); } else if (H5Tequal(type, H5T_NATIVE_UINT_FAST64)==TRUE) { - printf("native uint_fast64_t"); + HDfprintf(rawoutstream, "native uint_fast64_t"); } else if (H5Tequal(type, H5T_NATIVE_B8)==TRUE) { - printf("native 8-bit field"); + HDfprintf(rawoutstream, "native 8-bit field"); } else if (H5Tequal(type, H5T_NATIVE_B16)==TRUE) { - printf("native 16-bit field"); + HDfprintf(rawoutstream, "native 16-bit field"); } else if (H5Tequal(type, H5T_NATIVE_B32)==TRUE) { - printf("native 32-bit field"); + HDfprintf(rawoutstream, "native 32-bit field"); } else if (H5Tequal(type, H5T_NATIVE_B64)==TRUE) { - printf("native 64-bit field"); + HDfprintf(rawoutstream, "native 64-bit field"); } else if (H5Tequal(type, H5T_NATIVE_HSIZE)==TRUE) { - printf("native hsize_t"); + HDfprintf(rawoutstream, "native hsize_t"); } else if (H5Tequal(type, H5T_NATIVE_HSSIZE)==TRUE) { - printf("native hssize_t"); + HDfprintf(rawoutstream, "native hssize_t"); } else if (H5Tequal(type, H5T_NATIVE_HERR)==TRUE) { - printf("native herr_t"); + HDfprintf(rawoutstream, "native herr_t"); } else if (H5Tequal(type, H5T_NATIVE_HBOOL)==TRUE) { - printf("native hbool_t"); + HDfprintf(rawoutstream, "native hbool_t"); } else { return FALSE; } @@ -506,13 +506,13 @@ static hbool_t display_ieee_type(hid_t type, int UNUSED ind) { if (H5Tequal(type, H5T_IEEE_F32BE)==TRUE) { - printf("IEEE 32-bit big-endian float"); + HDfprintf(rawoutstream, "IEEE 32-bit big-endian float"); } else if (H5Tequal(type, H5T_IEEE_F32LE)==TRUE) { - printf("IEEE 32-bit little-endian float"); + HDfprintf(rawoutstream, "IEEE 32-bit little-endian float"); } else if (H5Tequal(type, H5T_IEEE_F64BE)==TRUE) { - printf("IEEE 64-bit big-endian float"); + HDfprintf(rawoutstream, "IEEE 64-bit big-endian float"); } else if (H5Tequal(type, H5T_IEEE_F64LE)==TRUE) { - printf("IEEE 64-bit little-endian float"); + HDfprintf(rawoutstream, "IEEE 64-bit little-endian float"); } else { return FALSE; } @@ -549,7 +549,7 @@ display_precision(hid_t type, int ind) * and offset on the following line. Also display the padding * information. */ if (8*H5Tget_size(type)!=(prec=H5Tget_precision(type))) { - printf("\n%*s(%lu bit%s of precision beginning at bit %lu)", + HDfprintf(rawoutstream, "\n%*s(%lu bit%s of precision beginning at bit %lu)", ind, "", (unsigned long)prec, 1==prec?"":"s", (unsigned long)H5Tget_offset(type)); @@ -595,20 +595,20 @@ display_precision(hid_t type, int ind) } } if (plsb_s || pmsb_s) { - printf("\n%*s(", ind, ""); + HDfprintf(rawoutstream, "\n%*s(", ind, ""); if (plsb_s) { nbits = H5Tget_offset(type); - printf("%lu %s bit%s at bit 0", + HDfprintf(rawoutstream, "%lu %s bit%s at bit 0", (unsigned long)nbits, plsb_s, 1==nbits?"":"s"); } - if (plsb_s && pmsb_s) printf(", "); + if (plsb_s && pmsb_s) HDfprintf(rawoutstream, ", "); if (pmsb_s) { nbits = 8*H5Tget_size(type)-(H5Tget_offset(type)+prec); - printf("%lu %s bit%s at bit %lu", + HDfprintf(rawoutstream, "%lu %s bit%s at bit %lu", (unsigned long)nbits, pmsb_s, 1==nbits?"":"s", (unsigned long)(8*H5Tget_size(type)-nbits)); } - printf(")"); + HDfprintf(rawoutstream, ")"); } } } @@ -674,7 +674,7 @@ display_int_type(hid_t type, int ind) /* Print size, order, and sign on first line, precision and padding * information on the subsequent lines */ - printf("%lu-bit%s%s integer", + HDfprintf(rawoutstream, "%lu-bit%s%s integer", (unsigned long)(8*H5Tget_size(type)), order_s, sign_s); display_precision(type, ind); return TRUE; @@ -731,7 +731,7 @@ display_float_type(hid_t type, int ind) /* Print size and byte order on first line, precision and padding on * subsequent lines. */ - printf("%lu-bit%s floating-point", + HDfprintf(rawoutstream, "%lu-bit%s floating-point", (unsigned long)(8*H5Tget_size(type)), order_s); display_precision(type, ind); @@ -756,13 +756,13 @@ display_float_type(hid_t type, int ind) ; break; } - printf("\n%*s(significant for %lu bit%s at bit %lu%s)", ind, "", + HDfprintf(rawoutstream, "\n%*s(significant for %lu bit%s at bit %lu%s)", ind, "", (unsigned long)msize, 1==msize?"":"s", (unsigned long)mpos, norm_s); - printf("\n%*s(exponent for %lu bit%s at bit %lu, bias is 0x%lx)", + HDfprintf(rawoutstream, "\n%*s(exponent for %lu bit%s at bit %lu, bias is 0x%lx)", ind, "", (unsigned long)esize, 1==esize?"":"s", (unsigned long)epos, (unsigned long)ebias); - printf("\n%*s(sign bit at %lu)", ind, "", (unsigned long)spos); + HDfprintf(rawoutstream, "\n%*s(sign bit at %lu)", ind, "", (unsigned long)spos); /* Display internal padding */ if (1+esize+msize0); super = H5Tget_super(type); - printf("enum "); + HDfprintf(rawoutstream, "enum "); display_type(super, ind+4); - printf(" {"); + HDfprintf(rawoutstream, " {"); /* Determine what data type to use for the native values. To simplify * things we entertain three possibilities: @@ -912,25 +912,25 @@ display_enum_type(hid_t type, int ind) /* Print members */ for (i=0; i", ind+4, ""); - printf("\n%*s}", ind, ""); + if (0==nmembs) HDfprintf(rawoutstream, "\n%*s ", ind+4, ""); + HDfprintf(rawoutstream, "\n%*s}", ind, ""); return TRUE; } @@ -1038,11 +1038,11 @@ display_string_type(hid_t type, int UNUSED ind) } if (H5Tis_variable_str(type)) { - printf("variable-length"); + HDfprintf(rawoutstream, "variable-length"); } else { - printf("%lu-byte", (unsigned long)H5Tget_size(type)); + HDfprintf(rawoutstream, "%lu-byte", (unsigned long)H5Tget_size(type)); } - printf(" %s %s string", pad_s, cset_s); + HDfprintf(rawoutstream, " %s %s string", pad_s, cset_s); return TRUE; } @@ -1071,11 +1071,11 @@ display_reference_type(hid_t type, int UNUSED ind) if (H5T_REFERENCE!=H5Tget_class(type)) return FALSE; if (H5Tequal(type, H5T_STD_REF_OBJ)==TRUE) { - printf("object reference"); + HDfprintf(rawoutstream, "object reference"); } else if (H5Tequal(type, H5T_STD_REF_DSETREG)==TRUE) { - printf("dataset region reference"); + HDfprintf(rawoutstream, "dataset region reference"); } else { - printf("%lu-byte unknown reference", + HDfprintf(rawoutstream, "%lu-byte unknown reference", (unsigned long)H5Tget_size(type)); } @@ -1108,11 +1108,11 @@ display_opaque_type(hid_t type, int ind) if (H5T_OPAQUE!=H5Tget_class(type)) return FALSE; size = H5Tget_size(type); - printf("%lu-byte opaque type", (unsigned long)size); + HDfprintf(rawoutstream, "%lu-byte opaque type", (unsigned long)size); if ((tag=H5Tget_tag(type))) { - printf("\n%*s(tag = \"", ind, ""); - display_string(stdout, tag, FALSE); - printf("\")"); + HDfprintf(rawoutstream, "\n%*s(tag = \"", ind, ""); + display_string(rawoutstream, tag, FALSE); + HDfprintf(rawoutstream, "\")"); HDfree(tag); } return TRUE; @@ -1141,7 +1141,7 @@ display_vlen_type(hid_t type, int ind) if (H5T_VLEN!=H5Tget_class(type)) return FALSE; - printf("variable length of\n%*s", ind+4, ""); + HDfprintf(rawoutstream, "variable length of\n%*s", ind+4, ""); super = H5Tget_super(type); display_type(super, ind+4); H5Tclose(super); @@ -1177,17 +1177,17 @@ display_array_type(hid_t type, int ind) /* Print dimensions */ for (i=0; i"); + HDfprintf(rawoutstream, ""); return; } @@ -1278,10 +1278,10 @@ display_type(hid_t type, int ind) H5O_info_t oi; if(H5Oget_info(type, &oi) >= 0) - printf("shared-%lu:"H5_PRINTF_HADDR_FMT" ", + HDfprintf(rawoutstream, "shared-%lu:"H5_PRINTF_HADDR_FMT" ", oi.fileno, oi.addr); else - printf("shared "); + HDfprintf(rawoutstream, "shared "); } /* end if */ /* Print the type */ @@ -1300,7 +1300,7 @@ display_type(hid_t type, int ind) return; /* Unknown type */ - printf("%lu-byte class-%u unknown", + HDfprintf(rawoutstream, "%lu-byte class-%u unknown", (unsigned long)H5Tget_size(type), (unsigned)data_class); } @@ -2267,7 +2267,7 @@ print_array_type(h5tools_str_t *buffer, hid_t type, int ind) HDfree(dims); } else { - h5tools_str_append(buffer, " [SCALAR]\n", stdout); + h5tools_str_append(buffer, " [SCALAR]\n", rawoutstream); } @@ -2504,18 +2504,18 @@ dump_dataset_values(hid_t dset) /* Print all the values. */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, " Data:\n"); - h5tools_render_element(stdout, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); ctx.need_prefix = TRUE; ctx.cur_column = curr_pos; - if (h5tools_dump_dset(stdout, info, &ctx, dset, -1, NULL) < 0) { + if (h5tools_dump_dset(rawoutstream, info, &ctx, dset, -1, NULL) < 0) { h5tools_str_reset(&buffer); h5tools_str_append(&buffer, " Unable to print data."); - h5tools_render_element(stdout, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); } H5Tclose(f_type); - HDfprintf(stdout, "\n"); + HDfprintf(rawoutstream, "\n"); h5tools_str_close(&buffer); } @@ -2579,7 +2579,7 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t UNUSED *ainfo, case H5S_SCALAR: /* scalar dataspace */ h5tools_str_append(&buffer, " scalar\n"); - h5tools_render_element(stdout, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); break; case H5S_SIMPLE: @@ -2590,19 +2590,19 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t UNUSED *ainfo, nelmts *= size[i]; } h5tools_str_append(&buffer, "}\n"); - h5tools_render_element(stdout, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); break; case H5S_NULL: /* null dataspace */ h5tools_str_append(&buffer, " null\n"); - h5tools_render_element(stdout, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); break; default: /* Unknown dataspace type */ h5tools_str_append(&buffer, " unknown\n"); - h5tools_render_element(stdout, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); break; } /* end switch */ @@ -2611,7 +2611,7 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t UNUSED *ainfo, h5tools_str_append(&buffer, " Type: "); print_type(&buffer, type, 15); h5tools_str_append(&buffer, "\n"); - h5tools_render_element(stdout, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); /* Data */ outputformat = *info; @@ -2627,7 +2627,7 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t UNUSED *ainfo, else { h5tools_str_reset(&buffer); h5tools_str_append(&buffer, " Data:\n"); - h5tools_render_element(stdout, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); + h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); outputformat.line_1st = NULL; outputformat.line_pre = " %s "; outputformat.line_cont = " %s "; @@ -2684,7 +2684,7 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t UNUSED *ainfo, ctx.need_prefix = TRUE; ctx.indent_level = 2; ctx.cur_column = curr_pos; - h5tools_dump_mem(stdout, info, &ctx, attr, p_type, space, buf); + h5tools_dump_mem(rawoutstream, info, &ctx, attr, p_type, space, buf); } /* Reclaim any VL memory, if necessary */ @@ -2694,14 +2694,14 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t UNUSED *ainfo, HDfree(buf); H5Tclose(p_type); } /* end if */ - HDfprintf(stdout, "\n"); + HDfprintf(rawoutstream, "\n"); H5Sclose(space); H5Tclose(type); H5Aclose(attr); } else { - HDfprintf(stdout, "\n"); + HDfprintf(rawoutstream, "\n"); } h5tools_str_close(&buffer); @@ -2746,16 +2746,16 @@ dataset_list1(hid_t dset) ndims = H5Sget_simple_extent_dims(space, cur_size, max_size); printf (" {"); for (i=0; i0) { - HDfprintf(stdout, "/%Hu", max_size[i]); + HDfprintf(rawoutstream, "/%Hu", max_size[i]); } } - if (space_type==H5S_SCALAR) printf("SCALAR"); - else if (space_type==H5S_NULL) printf("NULL"); - putchar('}'); + if (space_type==H5S_SCALAR) HDfprintf(rawoutstream, "SCALAR"); + else if (space_type==H5S_NULL) HDfprintf(rawoutstream, "NULL"); + HDfputc('}', rawoutstream); H5Sclose (space); return 0; @@ -2812,48 +2812,46 @@ dataset_list2(hid_t dset, const char UNUSED *name) hsize_t chsize[64]; /* chunk size in elements */ ndims = H5Pget_chunk(dcpl, NELMTS(chsize), chsize/*out*/); - printf(" %-10s {", "Chunks:"); + HDfprintf(rawoutstream, " %-10s {", "Chunks:"); total = H5Tget_size(type); for (i=0; i0) { utilization = (total*100.0)/used; - printf(", %1.2f%% utilization", utilization); + HDfprintf(rawoutstream, ", %1.2f%% utilization", utilization); } - } - - putchar('\n'); + HDfputc('\n', rawoutstream); /* Print information about external strorage */ if((nf = H5Pget_external_count(dcpl)) > 0) { @@ -2862,37 +2860,37 @@ dataset_list2(hid_t dset, const char UNUSED *name) n = display_string(NULL, f_name, TRUE); max_len = MAX(max_len, n); } /* end for */ - printf(" %-10s %d external file%s\n", + HDfprintf(rawoutstream, " %-10s %d external file%s\n", "Extern:", nf, 1==nf?"":"s"); - printf(" %4s %10s %10s %10s %s\n", + HDfprintf(rawoutstream, " %4s %10s %10s %10s %s\n", "ID", "DSet-Addr", "File-Addr", "Bytes", "File"); - printf(" %4s %10s %10s %10s ", + HDfprintf(rawoutstream, " %4s %10s %10s %10s ", "----", "----------", "----------", "----------"); - for (i=0; i0) { - printf(" %-10s ", "Type:"); + HDfprintf(rawoutstream, " %-10s ", "Type:"); display_type(type, 15); - printf("\n"); + HDfprintf(rawoutstream, "\n"); } return 0; } @@ -2986,24 +2984,24 @@ list_obj(const char *name, const H5O_info_t *oinfo, const char *first_seen, void /* Print the link's name, either full name or base name */ if(!iter->symlink_target) - display_obj_name(stdout, iter, name, ""); + display_obj_name(rawoutstream, iter, name, ""); /* Check object information */ if(oinfo->type < 0 || oinfo->type >= H5O_TYPE_NTYPES) { - printf("Unknown type(%d)", (int)oinfo->type); + HDfprintf(rawoutstream, "Unknown type(%d)", (int)oinfo->type); obj_type = H5O_TYPE_UNKNOWN; } if(iter->symlink_target) - fputc('{', stdout); + HDfputc('{', rawoutstream); if(obj_type >= 0 && dispatch_g[obj_type].name) - fputs(dispatch_g[obj_type].name, stdout); + HDfputs(dispatch_g[obj_type].name, rawoutstream); /* Check if we've seen this object before */ if(first_seen) { - printf(", same as "); - display_string(stdout, first_seen, TRUE); + HDfprintf(rawoutstream, ", same as "); + display_string(rawoutstream, first_seen, TRUE); if(!iter->symlink_target) - printf("\n"); + HDfprintf(rawoutstream, "\n"); } /* end if */ else { hid_t obj = (-1); /* ID of object opened */ @@ -3012,7 +3010,7 @@ list_obj(const char *name, const H5O_info_t *oinfo, const char *first_seen, void * then return right away. */ if(obj_type >= 0 && (obj = H5Oopen(iter->fid, name, H5P_DEFAULT)) < 0) { - printf(" *ERROR*\n"); + HDfprintf(rawoutstream, " *ERROR*\n"); goto done; } /* end if */ @@ -3020,7 +3018,7 @@ list_obj(const char *name, const H5O_info_t *oinfo, const char *first_seen, void if(obj_type >= 0 && dispatch_g[obj_type].list1) (dispatch_g[obj_type].list1)(obj); if(!iter->symlink_target || (verbose_g > 0)) - putchar('\n'); + HDfputc('\n', rawoutstream); /* Show detailed information about the object, beginning with information * which is common to all objects. */ @@ -3034,8 +3032,8 @@ 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 */ - printf(" %-10s %lu:"H5_PRINTF_HADDR_FMT"\n", "Location:", oinfo->fileno, oinfo->addr); - printf(" %-10s %u\n", "Links:", (unsigned)oinfo->rc); + HDfprintf(rawoutstream, " %-10s %lu:"H5_PRINTF_HADDR_FMT"\n", "Location:", oinfo->fileno, oinfo->addr); + HDfprintf(rawoutstream, " %-10s %u\n", "Links:", (unsigned)oinfo->rc); /* Modification time */ if(oinfo->mtime > 0) { @@ -3048,7 +3046,7 @@ list_obj(const char *name, const H5O_info_t *oinfo, const char *first_seen, void tm = HDlocaltime(&(oinfo->mtime)); if(tm) { HDstrftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S %Z", tm); - printf(" %-10s %s\n", "Modified:", buf); + HDfprintf(rawoutstream, " %-10s %s\n", "Modified:", buf); } /* end if */ } /* end if */ @@ -3064,9 +3062,9 @@ list_obj(const char *name, const H5O_info_t *oinfo, const char *first_seen, void cmt_bufsize = H5Oget_comment(obj, comment, cmt_bufsize); if(cmt_bufsize > 0) { comment[cmt_bufsize] = 0; - printf(" %-10s \"", "Comment:"); - display_string(stdout, comment, FALSE); - puts("\""); + HDfprintf(rawoutstream, " %-10s \"", "Comment:"); + display_string(rawoutstream, comment, FALSE); + HDfputs("\"\n", rawoutstream); } /* end if */ HDfree(comment); } @@ -3084,7 +3082,7 @@ list_obj(const char *name, const H5O_info_t *oinfo, const char *first_seen, void done: if(iter->symlink_target) { - fputs("}\n", stdout); + HDfputs("}\n", rawoutstream); iter->symlink_target = FALSE; } return 0; @@ -3122,7 +3120,7 @@ list_lnk(const char *name, const H5L_info_t *linfo, void *_iter) lnk_info.opt.msg_mode=1; /* Print the link's name, either full name or base name */ - display_obj_name(stdout, iter, name, ""); + display_obj_name(rawoutstream, iter, name, ""); switch(linfo->type) { case H5L_TYPE_SOFT: @@ -3137,18 +3135,18 @@ list_lnk(const char *name, const H5L_info_t *linfo, void *_iter) else if (no_dangling_link_g && ret == 0) iter->symlink_list->dangle_link = TRUE; - HDfputs("Soft Link {", stdout); - HDfputs(buf, stdout); - HDfputc('}', stdout); + HDfputs("Soft Link {", rawoutstream); + HDfputs(buf, rawoutstream); + HDfputc('}', rawoutstream); if(follow_symlink_g) { hbool_t orig_grp_literal = grp_literal_g; - HDfputc(' ', stdout); + HDfputc(' ', rawoutstream); /* Check if we have already seen this softlink */ if(symlink_is_visited(iter->symlink_list, linfo->type, NULL, buf)) { - HDfputs("{Already Visited}\n", stdout); + HDfputs("{Already Visited}\n", rawoutstream); goto done; } @@ -3174,7 +3172,7 @@ list_lnk(const char *name, const H5L_info_t *linfo, void *_iter) grp_literal_g = orig_grp_literal; } else - HDfputc('\n', stdout); + HDfputc('\n', rawoutstream); break; @@ -3198,25 +3196,25 @@ list_lnk(const char *name, const H5L_info_t *linfo, void *_iter) if(H5Lunpack_elink_val(buf, linfo->u.val_size, NULL, &filename, &path) < 0) goto done; - HDfputs("External Link {", stdout); - HDfputs(filename, stdout); - HDfputc('/', stdout); + HDfputs("External Link {", rawoutstream); + HDfputs(filename, rawoutstream); + HDfputc('/', rawoutstream); if(*path != '/') - HDfputc('/', stdout); - HDfputs(path, stdout); - HDfputc('}', stdout); + HDfputc('/', rawoutstream); + HDfputs(path, rawoutstream); + HDfputc('}', rawoutstream); /* Recurse through the external link */ /* keep the follow_elink_g for backward compatibility with -E */ if(follow_link) { hbool_t orig_grp_literal = grp_literal_g; - HDfputc(' ', stdout); + HDfputc(' ', rawoutstream); /* Check if we have already seen this elink */ if(symlink_is_visited(iter->symlink_list, linfo->type, filename, path)) { - HDfputs("{Already Visited}\n", stdout); + HDfputs("{Already Visited}\n", rawoutstream); goto done; } @@ -3244,13 +3242,13 @@ list_lnk(const char *name, const H5L_info_t *linfo, void *_iter) grp_literal_g = orig_grp_literal; } else - HDfputc('\n', stdout); + HDfputc('\n', rawoutstream); } break; default: - HDfputs("UD Link {cannot follow UD links}\n", stdout); + HDfputs("UD Link {cannot follow UD links}\n", rawoutstream); break; } /* end switch */ @@ -3284,11 +3282,11 @@ visit_obj(hid_t file, const char *oname, iter_t *iter) /* Retrieve info for object to list */ if(H5Oget_info_by_name(file, oname, &oi, H5P_DEFAULT) < 0) { if(iter->symlink_target) { - HDfputs("{**NOT FOUND**}\n", stdout); + HDfputs("{**NOT FOUND**}\n", rawoutstream); iter->symlink_target = FALSE; } else - display_obj_name(stdout, iter, oname, "**NOT FOUND**"); + display_obj_name(rawoutstream, iter, oname, "**NOT FOUND**"); return -1; } /* end if */ @@ -3296,7 +3294,7 @@ visit_obj(hid_t file, const char *oname, iter_t *iter) if(H5O_TYPE_GROUP == oi.type && !grp_literal_g) { /* Get ID for group */ if(!iter->symlink_target && (iter->gid = H5Gopen2(file, oname, H5P_DEFAULT)) < 0) { - HDfprintf(stderr, "%s: unable to open '%s' as group\n", iter->fname, oname); + HDfprintf(rawerrorstream, "%s: unable to open '%s' as group\n", iter->fname, oname); return 0; /* Previously "continue", when this code was in main(). * We don't "continue" here in order to close the file * and free the file name properly. */ @@ -3424,14 +3422,14 @@ is_valid_args(void) if(recursive_g && grp_literal_g) { - HDfprintf(stderr, "Error: 'recursive' option not compatible with 'group info' option!\n\n"); + HDfprintf(rawerrorstream, "Error: 'recursive' option not compatible with 'group info' option!\n\n"); ret = FALSE; goto out; } if(no_dangling_link_g && !follow_symlink_g) { - HDfprintf(stderr, "Error: --no-dangling-links must be used along with --follow-symlinks option!\n\n"); + HDfprintf(rawerrorstream, "Error: --no-dangling-links must be used along with --follow-symlinks option!\n\n"); ret = FALSE; goto out; } @@ -3712,7 +3710,7 @@ main(int argc, const char *argv[]) if(file >= 0) { if(verbose_g) - printf("Opened \"%s\" with %s driver.\n", fname, drivername); + HDfprintf(rawoutstream, "Opened \"%s\" with %s driver.\n", fname, drivername); break; /*success*/ } /* end if */ @@ -3727,7 +3725,7 @@ main(int argc, const char *argv[]) } /* end while */ if(file < 0) { - HDfprintf(stderr, "%s: unable to open file\n", argv[argno-1]); + HDfprintf(rawerrorstream, "%s: unable to open file\n", argv[argno-1]); HDfree(fname); err_exit = 1; continue; @@ -3740,7 +3738,7 @@ main(int argc, const char *argv[]) iter.base_len -= oname[iter.base_len-1] == '/'; x = oname; if(NULL == (oname = HDstrdup(oname))) { - HDfprintf(stderr, "memory allocation failed\n"); + HDfprintf(rawerrorstream, "memory allocation failed\n"); leave(EXIT_FAILURE); } *x = '\0'; @@ -3774,7 +3772,7 @@ main(int argc, const char *argv[]) if(HDstrcmp(oname, root_name)) { /* Check the type of link given */ if(H5Lget_info(file, oname, &li, H5P_DEFAULT) < 0) { - display_obj_name(stdout, &iter, oname, "**NOT FOUND**"); + display_obj_name(rawoutstream, &iter, oname, "**NOT FOUND**"); leave(EXIT_FAILURE); } /* end if */ } /* end if */ -- cgit v0.12 From 6765de0c65a11fe6d039812255a0160b56c2bd8b Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 27 Feb 2012 14:25:22 -0500 Subject: [svn-r21991] Cleanup minor issues found during 518 merge --- tools/h5dump/CMakeLists.txt | 3 -- tools/h5dump/testh5dump.sh.in | 3 +- tools/h5stat/h5stat_gentest.c | 4 +- tools/lib/h5diff_dset.c | 2 +- tools/misc/h5debug.c | 14 +++---- tools/testfiles/tnofilename.ddl | 86 ----------------------------------------- 6 files changed, 11 insertions(+), 101 deletions(-) delete mode 100644 tools/testfiles/tnofilename.ddl diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt index 652fe83..f77d6a5 100644 --- a/tools/h5dump/CMakeLists.txt +++ b/tools/h5dump/CMakeLists.txt @@ -131,7 +131,6 @@ IF (BUILD_TESTING) tnamed_dtype_attr.ddl tnestcomp-1.ddl tnbit.ddl - tnofilename.ddl tno-subset.ddl tnullspace.ddl zerodim.ddl @@ -838,8 +837,6 @@ IF (BUILD_TESTING) tnestcomp-1.out.err tnbit.out tnbit.out.err - tnofilename.out - tnofilename.out.err tno-subset.out tno-subset.out.err tnullspace.out diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in index ee91880..57168e0 100644 --- a/tools/h5dump/testh5dump.sh.in +++ b/tools/h5dump/testh5dump.sh.in @@ -247,7 +247,6 @@ $SRC_H5DUMP_TESTFILES/tmulti.ddl $SRC_H5DUMP_TESTFILES/tnamed_dtype_attr.ddl $SRC_H5DUMP_TESTFILES/tnestcomp-1.ddl $SRC_H5DUMP_TESTFILES/tnbit.ddl -$SRC_H5DUMP_TESTFILES/tnofilename.ddl $SRC_H5DUMP_TESTFILES/tno-subset.ddl $SRC_H5DUMP_TESTFILES/tnullspace.ddl $SRC_H5DUMP_TESTFILES/zerodim.ddl @@ -881,7 +880,7 @@ TOOLTEST texceedsubcount.ddl -d 1d -c 1,3 taindices.h5 TOOLTEST texceedsubstride.ddl -d 1d -S 1,3 taindices.h5 TOOLTEST texceedsubblock.ddl -d 1d -k 1,3 taindices.h5 -###### 2/17 SKIP tests because compression values are different ############ + # tests for filters # SZIP option="-H -p -d szip tfilters.h5" diff --git a/tools/h5stat/h5stat_gentest.c b/tools/h5stat/h5stat_gentest.c index e333128..a7bb4b0 100644 --- a/tools/h5stat/h5stat_gentest.c +++ b/tools/h5stat/h5stat_gentest.c @@ -42,7 +42,7 @@ static void gen_file(void) { hid_t fcpl; /* File creation property */ hid_t fapl; /* File access property */ - hid_t file; /* File id */ + hid_t file; /* File id */ hid_t gid; /* Group id */ hid_t type_id; /* Datatype id */ hid_t space_id; /* Dataspace id */ @@ -50,7 +50,7 @@ static void gen_file(void) hid_t dset_id; /* Dataset id */ char name[30]; /* Group name */ char attrname[30]; /* Attribute name */ - int ret; /* Return value */ + int ret; /* Return value */ int i; /* Local index variable */ fapl = H5Pcreate(H5P_FILE_ACCESS); diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c index bfb8429..c1ed429 100644 --- a/tools/lib/h5diff_dset.c +++ b/tools/lib/h5diff_dset.c @@ -409,7 +409,7 @@ hsize_t diff_datasetid( hid_t did1, options, name1, name2, m_tid1, did1, did2); /* reclaim any VL memory, if necessary */ - if(vl_data) { + if(vl_data) { H5Dvlen_reclaim(m_tid1, sid1, H5P_DEFAULT, buf1); H5Dvlen_reclaim(m_tid2, sid2, H5P_DEFAULT, buf2); } /* end if */ diff --git a/tools/misc/h5debug.c b/tools/misc/h5debug.c index 30d5d3b..f24fbba 100644 --- a/tools/misc/h5debug.c +++ b/tools/misc/h5debug.c @@ -225,8 +225,8 @@ main(int argc, char *argv[]) herr_t status = SUCCEED; if(argc == 1) { - HDfprintf(stderr, "Usage: %s filename [signature-addr [extra]]\n", argv[0]); - HDexit(1); + HDfprintf(stderr, "Usage: %s filename [signature-addr [extra]]\n", argv[0]); + HDexit(1); } /* end if */ /* Initialize the library */ @@ -247,7 +247,7 @@ main(int argc, char *argv[]) HDexit(1); } /* end if */ if(HDstrchr(argv[1], '%')) - H5Pset_fapl_family (fapl, (hsize_t)0, H5P_DEFAULT); + H5Pset_fapl_family (fapl, (hsize_t)0, H5P_DEFAULT); if((fid = H5Fopen(argv[1], H5F_ACC_RDONLY, fapl)) < 0) { HDfprintf(stderr, "cannot open file\n"); HDexit(1); @@ -298,10 +298,10 @@ main(int argc, char *argv[]) status = H5HL_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL); } else if(!HDmemcmp (sig, H5HG_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { - /* - * Debug a global heap collection. - */ - status = H5HG_debug (f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL); + /* + * Debug a global heap collection. + */ + status = H5HG_debug (f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL); } else if(!HDmemcmp(sig, H5G_NODE_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* diff --git a/tools/testfiles/tnofilename.ddl b/tools/testfiles/tnofilename.ddl deleted file mode 100644 index f9bd972..0000000 --- a/tools/testfiles/tnofilename.ddl +++ /dev/null @@ -1,86 +0,0 @@ -usage: h5dump [OPTIONS] file - OPTIONS - -h, --help Print a usage message and exit - -n, --contents Print a list of the file contents and exit - -B, --superblock Print the content of the super block - -H, --header Print the header only; no data is displayed - -A, --onlyattr Print the header and value of attributes - -i, --object-ids Print the object ids - -r, --string Print 1-byte integer datasets as ASCII - -e, --escape Escape non printing characters - -V, --version Print version number and exit - -a P, --attribute=P Print the specified attribute - -d P, --dataset=P Print the specified dataset - -y, --noindex Do not print array indices with the data - -p, --properties Print dataset filters, storage layout and fill value - -f D, --filedriver=D Specify which driver to open the file with - -g P, --group=P Print the specified group and all members - -l P, --soft-link=P Print the value(s) of the specified soft link - -o F, --output=F Output raw data into file F - -b B, --binary=B Binary file output, of form B - -t P, --datatype=P Print the specified named datatype - -w N, --width=N Set the number of columns of output. A value of 0 (zero) - sets the number of columns to the maximum (65535). - Default width is 80 columns. - -m T, --format=T Set the floating point output format - -q Q, --sort_by=Q Sort groups and attributes by index Q - -z Z, --sort_order=Z Sort groups and attributes by order Z - -R, --region Print dataset pointed by region references - -x, --xml Output in XML using Schema - -u, --use-dtd Output in XML using DTD - -D U, --xml-dtd=U Use the DTD or schema at U - -X S, --xml-ns=S (XML Schema) Use qualified names n the XML - ":": no namespace, default: "hdf5:" - E.g., to dump a file called `-f', use h5dump -- -f - --enable-error-stack Prints messages from the HDF5 error stack as they - occur. - --no-compact-subset Disable compact form of subsetting and allow the use - of "[" in datset names. - - Subsetting is available by using the following options with a dataset - attribute. Subsetting is done by selecting a hyperslab from the data. - Thus, the options mirror those for performing a hyperslab selection. - One of the START, COUNT, STRIDE, or BLOCK parameters are mandatory if you do subsetting. - The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in - each dimension. START is optional and will default to 0 in each dimension. - - -s START, --start=START Offset of start of subsetting selection - -S STRIDE, --stride=STRIDE Hyperslab stride - -c COUNT, --count=COUNT Number of blocks to include in selection - -k BLOCK, --block=BLOCK Size of block in hyperslab - START, COUNT, STRIDE, and BLOCK - is a list of integers the number of which are equal to the - number of dimensions in the dataspace being queried - - D - is the file driver to use in opening the file. Acceptable values - are "sec2", "family", "split", "multi", "direct", and "stream". Without - the file driver flag, the file will be opened with each driver in - turn and in the order specified above until one driver succeeds - in opening the file. - F - is a filename. - P - is the full path from the root group to the object. - N - is an integer greater than 1. - T - is a string containing the floating point format, e.g '%.3f' - U - is a URI reference (as defined in [IETF RFC 2396], - updated by [IETF RFC 2732]) - B - is the form of binary output: NATIVE for a memory type, FILE for the - file type, LE or BE for pre-existing little or big endian types. - Must be used with -o (output file) and it is recommended that - -d (dataset) is used. B is an optional argument, defaults to NATIVE - Q - is the sort index type. It can be "creation_order" or "name" (default) - Z - is the sort order type. It can be "descending" or "ascending" (default) - - Examples: - - 1) Attribute foo of the group /bar_none in file quux.h5 - - h5dump -a /bar_none/foo quux.h5 - - 2) Selecting a subset from dataset /foo in file quux.h5 - - h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5 - - 3) Saving dataset 'dset' in file quux.h5 to binary file 'out.bin' - using a little-endian type - - h5dump -d /dset -b LE -o out.bin quux.h5 - -- cgit v0.12 From deec94bf4a42759eef091f16e71135bfc2615988 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 27 Feb 2012 14:41:27 -0500 Subject: [svn-r21992] Remove old testfile --- MANIFEST | 1 - 1 file changed, 1 deletion(-) diff --git a/MANIFEST b/MANIFEST index b201902..d7ad86c 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1411,7 +1411,6 @@ ./tools/testfiles/tnbit.ddl ./tools/testfiles/tnestcomp-1.ddl ./tools/testfiles/tnestedcomp.h5 -./tools/testfiles/tnofilename.ddl ./tools/testfiles/tno-subset.h5 ./tools/testfiles/tno-subset.ddl ./tools/testfiles/tnullspace.h5 -- cgit v0.12 From 3a713f80759f030279fce816b524880dd5c77752 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 27 Feb 2012 15:05:23 -0500 Subject: [svn-r21993] Add tools_init to main --- tools/h5repack/testh5repack_detect_szip.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/h5repack/testh5repack_detect_szip.c b/tools/h5repack/testh5repack_detect_szip.c index 332fcc5..0a6a77a 100644 --- a/tools/h5repack/testh5repack_detect_szip.c +++ b/tools/h5repack/testh5repack_detect_szip.c @@ -47,6 +47,9 @@ int main(void) h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); + /* Initialize h5tools lib */ + h5tools_init(); + #ifdef H5_HAVE_FILTER_SZIP if (h5tools_can_encode(H5Z_FILTER_SZIP) == 1) { printf("yes\n"); -- cgit v0.12 From 009522483ee23aabc44ca5bed03ff5288ea7048c Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 27 Feb 2012 15:10:18 -0500 Subject: [svn-r21994] Add tools_init to main --- tools/h5jam/getub.c | 27 +++++++++++++++------------ tools/h5jam/tellub.c | 25 ++++++++++++++----------- tools/h5repack/h5repacktst.c | 5 +++++ 3 files changed, 34 insertions(+), 23 deletions(-) diff --git a/tools/h5jam/getub.c b/tools/h5jam/getub.c index 293aa17..39a78ae 100644 --- a/tools/h5jam/getub.c +++ b/tools/h5jam/getub.c @@ -32,9 +32,9 @@ void parse_command_line (int argc, const char *argv[]); #define PROGRAMNAME "getub" char *nbytes = NULL; -static const char *s_opts = "c:"; /* add more later ? */ +static const char *s_opts = "c:"; /* add more later ? */ static struct long_options l_opts[] = { - {"c", require_arg, 'c'}, /* input file */ + {"c", require_arg, 'c'}, /* input file */ {NULL, 0, '\0'} }; @@ -84,15 +84,15 @@ parse_command_line (int argc, const char *argv[]) while ((opt = get_option (argc, argv, s_opts, l_opts)) != EOF) { switch ((char) opt) - { - case 'c': - nbytes = HDstrdup (opt_arg); - break; - case '?': - default: - usage (h5tools_getprogname()); - exit (EXIT_FAILURE); - } + { + case 'c': + nbytes = HDstrdup (opt_arg); + break; + case '?': + default: + usage (h5tools_getprogname()); + exit (EXIT_FAILURE); + } } if (argc <= opt_ind) @@ -115,6 +115,9 @@ main (int argc, const char *argv[]) h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); + /* Initialize h5tools lib */ + h5tools_init(); + parse_command_line (argc, argv); if (nbytes == NULL) @@ -161,7 +164,7 @@ main (int argc, const char *argv[]) if (res < (long)size) { if (buf) - free (buf); + free (buf); HDclose (fd); exit (EXIT_FAILURE); } diff --git a/tools/h5jam/tellub.c b/tools/h5jam/tellub.c index f1b6756..2ffcbda 100644 --- a/tools/h5jam/tellub.c +++ b/tools/h5jam/tellub.c @@ -60,7 +60,7 @@ usage (const char *prog) fflush (stdout); fprintf (stdout, "usage: %s h5_file\n", prog); fprintf (stdout, - " Check that h5_fil is HDF5 file and print size of user block \n"); + " Check that h5_fil is HDF5 file and print size of user block \n"); fprintf (stdout, " %s -h\n", prog); fprintf (stdout, " Print a usage message and exit\n"); } @@ -90,15 +90,15 @@ parse_command_line (int argc, const char *argv[]) while ((opt = get_option (argc, argv, s_opts, l_opts)) != EOF) { switch ((char) opt) - { - case 'h': - usage (h5tools_getprogname()); - exit (EXIT_SUCCESS); - case '?': - default: - usage (h5tools_getprogname()); - exit (EXIT_FAILURE); - } + { + case 'h': + usage (h5tools_getprogname()); + exit (EXIT_SUCCESS); + case '?': + default: + usage (h5tools_getprogname()); + exit (EXIT_FAILURE); + } } /* check for file name to be processed */ @@ -139,6 +139,9 @@ main (int argc, const char *argv[]) h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); + /* Initialize h5tools lib */ + h5tools_init(); + /* Disable error reporting */ H5Eget_auto2(H5E_DEFAULT, &func, &edata); H5Eset_auto2(H5E_DEFAULT, NULL, NULL); @@ -174,7 +177,7 @@ main (int argc, const char *argv[]) if (plist < 0) { error_msg("Can't get file creation plist for file \"%s\"\n", - ifname); + ifname); return (EXIT_FAILURE); } diff --git a/tools/h5repack/h5repacktst.c b/tools/h5repack/h5repacktst.c index 156038c..0ea70ae 100644 --- a/tools/h5repack/h5repacktst.c +++ b/tools/h5repack/h5repacktst.c @@ -168,6 +168,11 @@ static int make_complex_attr_references(hid_t loc_id); int main (void) { + h5tools_setprogname(PROGRAMNAME); + h5tools_setstatus(EXIT_SUCCESS); + + /* Initialize h5tools lib */ + h5tools_init(); pack_opt_t pack_options; diff_opt_t diff_options; hsize_t fs_size = 0; /* free space section threshold */ -- cgit v0.12 From 9ae8cffe920d5f63f163b46fe226812bd4d0fedd Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 27 Feb 2012 15:18:51 -0500 Subject: [svn-r21995] Updated changes to h5dump fix --- release_docs/RELEASE.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index eb3dfb0..6b45d7b 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -643,7 +643,8 @@ Bug Fixes since HDF5-1.8.0 release ----- - h5dump: Refactored code to remove duplicated functions. Split XML functions from DDL functions. Corrected indentation and formatting - errors. Also fixed subsetting counting overflow (HDFFV-5874). + errors. Also fixed subsetting counting overflow (HDFFV-5874). Verified + all tools call tools_init() in main. HDFFV-7560 (ADB 2012/02/17) - h5diff: fixed to prevent from displaying error stack message when comparing the two dangling symlinks with follow-symlinks option. -- cgit v0.12 From fc48c675e152200ca68b620de052b84a24cc8494 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 27 Feb 2012 15:26:55 -0500 Subject: [svn-r21996] Add tools_init to main --- hl/tools/gif2h5/gif2hdf.c | 3 +++ hl/tools/gif2h5/hdf2gif.c | 3 +++ perform/zip_perf.c | 3 +++ 3 files changed, 9 insertions(+) diff --git a/hl/tools/gif2h5/gif2hdf.c b/hl/tools/gif2h5/gif2hdf.c index 1225613..d5d169e 100644 --- a/hl/tools/gif2h5/gif2hdf.c +++ b/hl/tools/gif2h5/gif2hdf.c @@ -49,6 +49,9 @@ main(int argv , char *argc[]) GifMemoryStruct.GifApplicationExtension = NULL; GifMemoryStruct.GifCommentExtension = NULL; + /* Initialize h5tools lib */ + h5tools_init(); + if ( argc[1] && (strcmp("-V",argc[1])==0) ) { print_version("gif2h5"); diff --git a/hl/tools/gif2h5/hdf2gif.c b/hl/tools/gif2h5/hdf2gif.c index cc8e864..a193240 100644 --- a/hl/tools/gif2h5/hdf2gif.c +++ b/hl/tools/gif2h5/hdf2gif.c @@ -70,6 +70,9 @@ int main(int argc , char **argv) char *image_name = NULL; int idx; + /* Initialize h5tools lib */ + h5tools_init(); + if ( argv[1] && (strcmp("-V",argv[1])==0) ) { print_version("gif2h5"); diff --git a/perform/zip_perf.c b/perform/zip_perf.c index 897fc7e..4e1f043 100644 --- a/perform/zip_perf.c +++ b/perform/zip_perf.c @@ -573,6 +573,9 @@ main(int argc, char **argv) int opt; prog = argv[0]; + + /* Initialize h5tools lib */ + h5tools_init(); while ((opt = get_option(argc, (const char **)argv, s_opts, l_opts)) > 0) { switch ((char)opt) { -- cgit v0.12 From 2ac614f94decfff417beece73441fb80acba64f6 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Tue, 28 Feb 2012 07:32:22 -0500 Subject: [svn-r21997] Feature: HDFFV-7793: AIX Fortran and C++ Compiler version information Added code to display the version information of XL fortran and C++ compiler version information. (This is just a quick fix for the AIX XL compilers. The overall algorithm of compilers version information needs an overhaul.) Tested: ADA machine. (No committest because the changes applied to AIX XL compilers only.) --- config/ibm-aix | 74 +++++++++++++++++++++++++++----------------------------- config/ibm-flags | 32 ++++++++++++++++++++++-- 2 files changed, 66 insertions(+), 40 deletions(-) diff --git a/config/ibm-aix b/config/ibm-aix index ff541bc..c8b1fc3 100644 --- a/config/ibm-aix +++ b/config/ibm-aix @@ -39,6 +39,42 @@ if test "X-$enable_parallel" = "X-yes" -o X-$CC_BASENAME = X-mpcc_r; then RUNPARALLEL=${RUNPARALLEL="env MP_PROCS=\$\${NPROCS:=6} MP_TASKS_PER_NODE=\$\${NPROCS:=6} poe"} fi +# The default Fortran 90 compiler + +if test "X-" = "X-$FC"; then + if test "X-$enable_parallel" = "X-yes"; then + FC=mpxlf90_r + else + FC=xlf90 + fi +fi + +# While we try to avoid setting FCFLAGS directly for use in compilation, in +# this case we need the -k flag present for some configure checks. As such, +# the configure script saves the user's set FCFLAGS before running, and +# restores them when complete. We must then set up both FCFLAGS and H5_FCFLAGS +# to ensure the flag is present for both configure as well as for the build. +if test "X-" = "X-$f9x_flags_set"; then + F9XSUFFIXFLAG="-qsuffix=f=f90" + FCFLAGS="$FCFLAGS -O ${F9XSUFFIXFLAG}" + H5_FCFLAGS="$H5_FCFLAGS -O ${F9XSUFFIXFLAG}" + FSEARCH_DIRS="-I./ -I../src" + DEBUG_FCFLAGS="-O" + PROD_FCFLAGS="-O" + PROFILE_FCFLAGS="-O" + f9x_flags_set=yes +fi + +# The default C++ compiler + +# Use AIX supplied C++ compiler by default. +CXX=${CXX=xlC} + +# Added -qweaksymbol to suppress linker messages warning of duplicate +# symbols; these warnings are harmless. - BMR +H5_CXXFLAGS="$H5_CXXFLAGS -qweaksymbol" +AM_CXXFLAGS="$AM_CXXFLAGS" + #---------------------------------------------------------------------------- # Compiler flags. The CPPFLAGS values should not include package debug @@ -112,41 +148,3 @@ ac_cv_sizeof_uint_fast64_t=${ac_cv_sizeof_uint_fast64_t=8} # Don't cache long since it varies between 32 and 64 bits #ac_cv_sizeof_long=${ac_cv_sizeof_long=4} - -# The default Fortran 90 compiler - -if test "X-" = "X-$FC"; then - if test "X-$enable_parallel" = "X-yes"; then - FC=mpxlf90_r - else - FC=xlf90 - fi -fi - -# While we try to avoid setting FCFLAGS directly for use in compilation, in -# this case we need the -k flag present for some configure checks. As such, -# the configure script saves the user's set FCFLAGS before running, and -# restores them when complete. We must then set up both FCFLAGS and H5_FCFLAGS -# to ensure the flag is present for both configure as well as for the build. -if test "X-" = "X-$f9x_flags_set"; then - F9XSUFFIXFLAG="-qsuffix=f=f90" - FCFLAGS="$FCFLAGS -O ${F9XSUFFIXFLAG}" - H5_FCFLAGS="$H5_FCFLAGS -O ${F9XSUFFIXFLAG}" - FSEARCH_DIRS="-I./ -I../src" - DEBUG_FCFLAGS="-O" - PROD_FCFLAGS="-O" - PROFILE_FCFLAGS="-O" - f9x_flags_set=yes -fi - -# The default C++ compiler - -# Use AIX supplied C++ compiler by default. -CXX=${CXX=xlC} - -# Added -qweaksymbol to suppress linker messages warning of duplicate -# symbols; these warnings are harmless. - BMR -H5_CXXFLAGS="$H5_CXXFLAGS -qweaksymbol" -AM_CXXFLAGS="$AM_CXXFLAGS" - - diff --git a/config/ibm-flags b/config/ibm-flags index 5e092b8..a1dfa2a 100644 --- a/config/ibm-flags +++ b/config/ibm-flags @@ -19,8 +19,8 @@ # if the compiler is not IBM; otherwise `cc_flags_set' is set to `yes' # -# Get the compiler version in a way that works for pgcc -# pgcc unless a compiler version is already known +# Get the compiler version in a way that works for XL compiler +# unless a compiler version is already defined. # # cc_vendor: The compiler product name: XL # cc_version: Version number: 10.1 @@ -75,3 +75,31 @@ if test "X-$cc_flags_set" = "X-"; then cc_version= cc_version_info= fi + + +# get fortran version info +if test X != X$FC; then + # Verify this is an IBM XL compiler + fc_version="`$FC $FCFLAGS -qversion 2>&1 | grep 'IBM XL Fortran'`" + if test X != "X$fc_version"; then + fc_vendor="XL" + fc_version="`$FC $FCFLAGS -qversion 2>&1 | sed -n 's/Version: \([0-9\.]*\).*/\1/p'`" + fc_version_info="IBM XL Fortran $fc_version" + echo "compiler '$FC' is IBM $fc_vendor-$fc_version" + + fi +fi + + +# get c++ version info +if test X != X$CXX; then + # Verify this is an IBM XL compiler + cxx_version="`$CXX $CXXFLAGS -qversion 2>&1 | grep 'IBM XL C/C++'`" + if test X != "X$cxx_version"; then + cxx_vendor="XL" + cxx_version="`$CXX $CXXFLAGS -qversion 2>&1 | sed -n 's/Version: \([0-9\.]*\).*/\1/p'`" + cxx_version_info="IBM XL C/C++ $cxx_version" + echo "compiler '$CXX' is IBM $cxx_vendor-$cxx_version" + + fi +fi -- cgit v0.12 From 9423da6a4d53cb2eb6c48a9e0d254307bbf8ae9b Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Tue, 28 Feb 2012 07:45:45 -0500 Subject: [svn-r21999] Updated for the changes made to IBM configure. Also update the IBM tested platform information. --- release_docs/RELEASE.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 6b45d7b..b9b28d1 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -39,6 +39,8 @@ New Features Configuration: ------------- + - Added code to display the version information of XL fortran and C++ + in the summary of configure. (AKC - 2012/02/28 - HDFFV-7793) - Configure now generates Makefiles that build in "silent make mode" by default in which compile and link lines are significantly simplified for clarity. To override this and view actual compile and @@ -892,6 +894,10 @@ Bug Fixes since HDF5-1.8.0 release Platforms Tested ================ + AIX 5.3 xlc 10.1.0.5 + (NASA G-ADA) xlC 10.1.0.5 + xlf90 12.1.0.6 + FreeBSD 8.2-STABLE i386 gcc 4.2.1 [FreeBSD] 20070719 (loyalty) g++ 4.2.1 [FreeBSD] 20070719 gcc 4.6.1 20110422 -- cgit v0.12 From df6c92e506a81ed0ede7dacc1269d21ae3e0f411 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 28 Feb 2012 13:26:34 -0500 Subject: [svn-r22004] Reduced warnings and fixed conflicts resulting from including h5tools.h Tested: local linux --- hl/tools/gif2h5/gif2hdf.c | 1 + hl/tools/gif2h5/gif2mem.c | 2 +- hl/tools/gif2h5/hdf2gif.c | 1 + perform/pio_engine.c | 42 +++--- perform/pio_perf.c | 32 ++-- perform/pio_perf.h | 1 + perform/pio_timer.c | 66 ++++---- perform/pio_timer.h | 4 +- perform/sio_engine.c | 28 ++-- perform/sio_perf.c | 30 ++-- perform/sio_perf.h | 29 ++-- perform/sio_timer.c | 36 ++--- perform/sio_timer.h | 6 +- perform/zip_perf.c | 1 + tools/h5copy/h5copy.c | 4 +- tools/h5diff/h5diff_common.c | 5 +- tools/h5diff/h5diff_main.c | 1 + tools/h5diff/ph5diff_main.c | 1 + tools/h5import/h5import.c | 9 +- tools/h5import/h5import.h | 2 +- tools/h5jam/getub.c | 1 + tools/h5jam/h5jam.c | 1 + tools/h5jam/h5unjam.c | 1 + tools/h5jam/tellub.c | 1 + tools/h5ls/h5ls.c | 4 +- tools/h5repack/h5repack.c | 30 ++-- tools/h5repack/h5repack_main.c | 1 + tools/h5repack/h5repack_opttable.c | 1 + tools/h5repack/h5repack_parse.c | 1 + tools/h5repack/h5repack_refs.c | 242 +++++++++++++++--------------- tools/h5repack/h5repack_verify.c | 15 +- tools/h5repack/testh5repack_detect_szip.c | 1 + tools/lib/h5diff.c | 44 +++--- 33 files changed, 331 insertions(+), 313 deletions(-) diff --git a/hl/tools/gif2h5/gif2hdf.c b/hl/tools/gif2h5/gif2hdf.c index d5d169e..810be78 100644 --- a/hl/tools/gif2h5/gif2hdf.c +++ b/hl/tools/gif2h5/gif2hdf.c @@ -17,6 +17,7 @@ #include #include "gif.h" +#include "h5tools.h" #include "h5tools_utils.h" diff --git a/hl/tools/gif2h5/gif2mem.c b/hl/tools/gif2h5/gif2mem.c index 907fb80..7995bb4 100644 --- a/hl/tools/gif2h5/gif2mem.c +++ b/hl/tools/gif2h5/gif2mem.c @@ -37,7 +37,7 @@ #include "gif.h" -#define VERSION "1.00" +#define GIF2VERSION "1.00" GIFTOMEM Gif2Mem(BYTE *MemGif) diff --git a/hl/tools/gif2h5/hdf2gif.c b/hl/tools/gif2h5/hdf2gif.c index a193240..090d657 100644 --- a/hl/tools/gif2h5/hdf2gif.c +++ b/hl/tools/gif2h5/hdf2gif.c @@ -17,6 +17,7 @@ #include #include "gif.h" #include "H5IMpublic.h" +#include "h5tools.h" #include "h5tools_utils.h" diff --git a/perform/pio_engine.c b/perform/pio_engine.c index abb72fa..0e3190c 100644 --- a/perform/pio_engine.c +++ b/perform/pio_engine.c @@ -320,22 +320,22 @@ do_pio(parameters param) /* Need barrier to make sure everyone starts at the same time */ MPI_Barrier(pio_comm_g); - set_time(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS, START); + set_time(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS, TSTART); hrc = do_fopen(¶m, fname, &fd, PIO_CREATE | PIO_WRITE); VRFY((hrc == SUCCESS), "do_fopen failed"); - set_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS, START); + set_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS, TSTART); hrc = do_write(&res, &fd, ¶m, ndsets, nbytes, buf_size, buffer); hrc == SUCCESS; - set_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS, STOP); + set_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS, TSTOP); VRFY((hrc == SUCCESS), "do_write failed"); /* Close file for write */ hrc = do_fclose(iot, &fd); - set_time(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS, STOP); + set_time(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS, TSTOP); VRFY((hrc == SUCCESS), "do_fclose failed"); if (!param.h5_write_only) { @@ -349,20 +349,20 @@ do_pio(parameters param) MPI_Barrier(pio_comm_g); /* Open file for read */ - set_time(res.timers, HDF5_GROSS_READ_FIXED_DIMS, START); + set_time(res.timers, HDF5_GROSS_READ_FIXED_DIMS, TSTART); hrc = do_fopen(¶m, fname, &fd, PIO_READ); VRFY((hrc == SUCCESS), "do_fopen failed"); - set_time(res.timers, HDF5_FINE_READ_FIXED_DIMS, START); + set_time(res.timers, HDF5_FINE_READ_FIXED_DIMS, TSTART); hrc = do_read(&res, &fd, ¶m, ndsets, nbytes, buf_size, buffer); - set_time(res.timers, HDF5_FINE_READ_FIXED_DIMS, STOP); + set_time(res.timers, HDF5_FINE_READ_FIXED_DIMS, TSTOP); VRFY((hrc == SUCCESS), "do_read failed"); /* Close file for read */ hrc = do_fclose(iot, &fd); - set_time(res.timers, HDF5_GROSS_READ_FIXED_DIMS, STOP); + set_time(res.timers, HDF5_GROSS_READ_FIXED_DIMS, TSTOP); VRFY((hrc == SUCCESS), "do_fclose failed"); } @@ -413,7 +413,7 @@ done: static char * pio_create_filename(iotype iot, const char *base_name, char *fullname, size_t size) { - const char *prefix, *suffix=""; + const char *prefix, *suffix = ""; char *ptr, last = '\0'; size_t i, j; @@ -968,7 +968,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, } /* end else */ /* Start "raw data" write timer */ - set_time(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, START); + set_time(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, TSTART); while (nbytes_xfer < bytes_count){ /* Write */ @@ -1399,7 +1399,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, } /* end while */ /* Stop "raw data" write timer */ - set_time(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, STOP); + set_time(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, TSTOP); /* Calculate write time */ @@ -1899,7 +1899,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, } /* end else */ /* Start "raw data" read timer */ - set_time(res->timers, HDF5_RAW_READ_FIXED_DIMS, START); + set_time(res->timers, HDF5_RAW_READ_FIXED_DIMS, TSTART); while (nbytes_xfer < bytes_count){ /* Read */ @@ -2354,7 +2354,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, } /* end while */ /* Stop "raw data" read timer */ - set_time(res->timers, HDF5_RAW_READ_FIXED_DIMS, STOP); + set_time(res->timers, HDF5_RAW_READ_FIXED_DIMS, TSTOP); /* Calculate read time */ @@ -3115,9 +3115,9 @@ int MPI_File_read_at(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Status *status) { int err; - set_time(timer_g, HDF5_MPI_READ, START); + set_time(timer_g, HDF5_MPI_READ, TSTART); err=PMPI_File_read_at(fh, offset, buf, count, datatype, status); - set_time(timer_g, HDF5_MPI_READ, STOP); + set_time(timer_g, HDF5_MPI_READ, TSTOP); return err; } @@ -3126,9 +3126,9 @@ int MPI_File_read_at_all(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Status *status) { int err; - set_time(timer_g, HDF5_MPI_READ, START); + set_time(timer_g, HDF5_MPI_READ, TSTART); err=PMPI_File_read_at_all(fh, offset, buf, count, datatype, status); - set_time(timer_g, HDF5_MPI_READ, STOP); + set_time(timer_g, HDF5_MPI_READ, TSTOP); return err; } @@ -3136,9 +3136,9 @@ int MPI_File_write_at(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Status *status) { int err; - set_time(timer_g, HDF5_MPI_WRITE, START); + set_time(timer_g, HDF5_MPI_WRITE, TSTART); err=PMPI_File_write_at(fh, offset, buf, count, datatype, status); - set_time(timer_g, HDF5_MPI_WRITE, STOP); + set_time(timer_g, HDF5_MPI_WRITE, TSTOP); return err; } @@ -3146,9 +3146,9 @@ int MPI_File_write_at_all(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Status *status) { int err; - set_time(timer_g, HDF5_MPI_WRITE, START); + set_time(timer_g, HDF5_MPI_WRITE, TSTART); err=PMPI_File_write_at_all(fh, offset, buf, count, datatype, status); - set_time(timer_g, HDF5_MPI_WRITE, STOP); + set_time(timer_g, HDF5_MPI_WRITE, TSTOP); return err; } diff --git a/perform/pio_perf.c b/perform/pio_perf.c index 9cbd65d..337e982 100644 --- a/perform/pio_perf.c +++ b/perform/pio_perf.c @@ -288,14 +288,14 @@ struct options { unsigned interleaved; /* Interleaved vs. contiguous blocks */ unsigned collective; /* Collective vs. independent I/O */ unsigned dim2d; /* 1D vs. 2D geometry */ - int print_times; /* print times as well as throughputs */ - int print_raw; /* print raw data throughput info */ + int print_times; /* print times as well as throughputs */ + int print_raw; /* print raw data throughput info */ off_t h5_alignment; /* alignment in HDF5 file */ off_t h5_threshold; /* threshold for alignment in HDF5 file */ - int h5_use_chunks; /* Make HDF5 dataset chunked */ - int h5_write_only; /* Perform the write tests only */ + int h5_use_chunks; /* Make HDF5 dataset chunked */ + int h5_write_only; /* Perform the write tests only */ unsigned h5_use_mpi_posix; /* Use MPI-posix VFD for HDF5 I/O (instead of MPI-I/O VFD) */ - int verify; /* Verify data correctness */ + int verify; /* Verify data correctness */ }; typedef struct _minmax { @@ -683,7 +683,7 @@ run_test(iotype iot, parameters parms, struct options *opts) /* * Show various statistics */ - /* Write statistics */ + /* Write statistics */ /* Print the raw data throughput if desired */ if (opts->print_raw) { /* accumulate and output the max, min, and average "raw write" times */ @@ -749,7 +749,7 @@ run_test(iotype iot, parameters parms, struct options *opts) } if (!parms.h5_write_only) { - /* Read statistics */ + /* Read statistics */ /* Print the raw data throughput if desired */ if (opts->print_raw) { /* accumulate and output the max, min, and average "raw read" times */ @@ -1103,10 +1103,10 @@ print_indent(register int indent) MPI_Comm_rank(pio_comm_g, &myrank); if (myrank == 0) { - indent *= TAB_SPACE; + indent *= TAB_SPACE; - for (; indent > 0; --indent) - fputc(' ', output); + for (; indent > 0; --indent) + fputc(' ', output); } } @@ -1131,11 +1131,11 @@ static void print_io_api(long io_types) { if (io_types & PIO_POSIX) - HDfprintf(output, "posix "); + HDfprintf(output, "posix "); if (io_types & PIO_MPI) - HDfprintf(output, "mpiio "); + HDfprintf(output, "mpiio "); if (io_types & PIO_HDF5) - HDfprintf(output, "phdf5 "); + HDfprintf(output, "phdf5 "); HDfprintf(output, "\n"); } @@ -1144,7 +1144,7 @@ report_parameters(struct options *opts) { int rank = comm_world_rank_g; - print_version("HDF5 Library"); /* print library version */ + print_version("HDF5 Library"); /* print library version */ HDfprintf(output, "rank %d: ==== Parameters ====\n", rank); HDfprintf(output, "rank %d: IO API=", rank); @@ -1565,7 +1565,7 @@ parse_size_directive(const char *size) * Return: Nothing * Programmer: Bill Wendling, 31. October 2001 * Modifications: - * Added 2D testing (Christian Chilan, 10. August 2005) + * Added 2D testing (Christian Chilan, 10. August 2005) */ static void usage(const char *prog) @@ -1575,7 +1575,7 @@ usage(const char *prog) MPI_Comm_rank(pio_comm_g, &myrank); if (myrank == 0) { - print_version(prog); + print_version(prog); printf("usage: %s [OPTIONS]\n", prog); printf(" OPTIONS\n"); printf(" -h, --help Print a usage message and exit\n"); diff --git a/perform/pio_perf.h b/perform/pio_perf.h index 6f510ca..094b31d 100644 --- a/perform/pio_perf.h +++ b/perform/pio_perf.h @@ -19,6 +19,7 @@ #ifndef STANDALONE #include "H5private.h" #include "h5test.h" +#include "h5tools.h" #include "h5tools_utils.h" #else #include "pio_standalone.h" diff --git a/perform/pio_timer.c b/perform/pio_timer.c index 9c8abb7..aba219e 100644 --- a/perform/pio_timer.c +++ b/perform/pio_timer.c @@ -43,15 +43,15 @@ pio_time *timer_g; /* timer: global for stub functions */ * Function: sub_time * Purpose: Struct two time values, and return the difference, in microseconds * - * Note that the function assumes that a > b + * Note that the function assumes that a > b * Programmer: Leon Arber, 1/27/06 */ static double sub_time(struct timeval* a, struct timeval* b) { return (((double)a->tv_sec + ((double)a->tv_usec) / MICROSECOND) - - ((double)b->tv_sec + - ((double)b->tv_usec) / MICROSECOND)); + ((double)b->tv_sec + + ((double)b->tv_usec) / MICROSECOND)); } @@ -89,7 +89,7 @@ pio_time_new(clock_type type) void pio_time_destroy(pio_time *pt) { - free(pt); + HDfree(pt); /* reset the global timer pointer too. */ timer_g = NULL; } @@ -134,37 +134,37 @@ set_time(pio_time *pt, timer_type t, int start_stop) { if (pt) { if (pt->type == MPI_TIMER) { - if (start_stop == START) { + if (start_stop == TSTART) { pt->mpi_timer[t] = MPI_Wtime(); - /* When we start the timer for HDF5_FINE_WRITE_FIXED_DIMS or HDF5_FINE_READ_FIXED_DIMS - * we compute the time it took to only open the file */ - if(t == HDF5_FINE_WRITE_FIXED_DIMS) - pt->total_time[HDF5_FILE_WRITE_OPEN] += pt->mpi_timer[t] - pt->mpi_timer[HDF5_GROSS_WRITE_FIXED_DIMS]; - else if(t == HDF5_FINE_READ_FIXED_DIMS) - pt->total_time[HDF5_FILE_READ_OPEN] += pt->mpi_timer[t] - pt->mpi_timer[HDF5_GROSS_READ_FIXED_DIMS]; + /* When we start the timer for HDF5_FINE_WRITE_FIXED_DIMS or HDF5_FINE_READ_FIXED_DIMS + * we compute the time it took to only open the file */ + if(t == HDF5_FINE_WRITE_FIXED_DIMS) + pt->total_time[HDF5_FILE_WRITE_OPEN] += pt->mpi_timer[t] - pt->mpi_timer[HDF5_GROSS_WRITE_FIXED_DIMS]; + else if(t == HDF5_FINE_READ_FIXED_DIMS) + pt->total_time[HDF5_FILE_READ_OPEN] += pt->mpi_timer[t] - pt->mpi_timer[HDF5_GROSS_READ_FIXED_DIMS]; } else { pt->total_time[t] += MPI_Wtime() - pt->mpi_timer[t]; - pt->mpi_timer[t] = MPI_Wtime(); - - /* When we stop the timer for HDF5_GROSS_WRITE_FIXED_DIMS or HDF5_GROSS_READ_FIXED_DIMS - * we compute the time it took to close the file after the last read/write finished */ - if(t == HDF5_GROSS_WRITE_FIXED_DIMS) - pt->total_time[HDF5_FILE_WRITE_CLOSE] += pt->mpi_timer[t] - pt->mpi_timer[HDF5_FINE_WRITE_FIXED_DIMS]; - else if(t == HDF5_GROSS_READ_FIXED_DIMS) - pt->total_time[HDF5_FILE_READ_CLOSE] += pt->mpi_timer[t] - pt->mpi_timer[HDF5_FINE_READ_FIXED_DIMS]; + pt->mpi_timer[t] = MPI_Wtime(); + + /* When we stop the timer for HDF5_GROSS_WRITE_FIXED_DIMS or HDF5_GROSS_READ_FIXED_DIMS + * we compute the time it took to close the file after the last read/write finished */ + if(t == HDF5_GROSS_WRITE_FIXED_DIMS) + pt->total_time[HDF5_FILE_WRITE_CLOSE] += pt->mpi_timer[t] - pt->mpi_timer[HDF5_FINE_WRITE_FIXED_DIMS]; + else if(t == HDF5_GROSS_READ_FIXED_DIMS) + pt->total_time[HDF5_FILE_READ_CLOSE] += pt->mpi_timer[t] - pt->mpi_timer[HDF5_FINE_READ_FIXED_DIMS]; } } else { - if (start_stop == START) { + if (start_stop == TSTART) { HDgettimeofday(&pt->sys_timer[t], NULL); - /* When we start the timer for HDF5_FINE_WRITE_FIXED_DIMS or HDF5_FINE_READ_FIXED_DIMS - * we compute the time it took to only open the file */ - if(t == HDF5_FINE_WRITE_FIXED_DIMS) - pt->total_time[HDF5_FILE_WRITE_OPEN] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_GROSS_WRITE_FIXED_DIMS])); - else if(t == HDF5_FINE_READ_FIXED_DIMS) - pt->total_time[HDF5_FILE_READ_OPEN] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_GROSS_READ_FIXED_DIMS])); + /* When we start the timer for HDF5_FINE_WRITE_FIXED_DIMS or HDF5_FINE_READ_FIXED_DIMS + * we compute the time it took to only open the file */ + if(t == HDF5_FINE_WRITE_FIXED_DIMS) + pt->total_time[HDF5_FILE_WRITE_OPEN] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_GROSS_WRITE_FIXED_DIMS])); + else if(t == HDF5_FINE_READ_FIXED_DIMS) + pt->total_time[HDF5_FILE_READ_OPEN] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_GROSS_READ_FIXED_DIMS])); } else { @@ -178,12 +178,12 @@ set_time(pio_time *pt, timer_type t, int start_stop) ((double)pt->sys_timer[t].tv_sec + ((double)pt->sys_timer[t].tv_usec) / MICROSECOND);*/ - /* When we stop the timer for HDF5_GROSS_WRITE_FIXED_DIMS or HDF5_GROSS_READ_FIXED_DIMS - * we compute the time it took to close the file after the last read/write finished */ - if(t == HDF5_GROSS_WRITE_FIXED_DIMS) - pt->total_time[HDF5_FILE_WRITE_CLOSE] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_FINE_WRITE_FIXED_DIMS])); - else if(t == HDF5_GROSS_READ_FIXED_DIMS) - pt->total_time[HDF5_FILE_READ_CLOSE] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_FINE_READ_FIXED_DIMS])); + /* When we stop the timer for HDF5_GROSS_WRITE_FIXED_DIMS or HDF5_GROSS_READ_FIXED_DIMS + * we compute the time it took to close the file after the last read/write finished */ + if(t == HDF5_GROSS_WRITE_FIXED_DIMS) + pt->total_time[HDF5_FILE_WRITE_CLOSE] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_FINE_WRITE_FIXED_DIMS])); + else if(t == HDF5_GROSS_READ_FIXED_DIMS) + pt->total_time[HDF5_FILE_READ_CLOSE] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_FINE_READ_FIXED_DIMS])); } } @@ -231,7 +231,7 @@ set_time(pio_time *pt, timer_type t, int start_stop) } fprintf(output, " Proc %d: %s %s: %.2f\n", myrank, msg, - (start_stop == START ? "Start" : "Stop"), + (start_stop == TSTART ? "Start" : "Stop"), pt->total_time[t]); } } diff --git a/perform/pio_timer.h b/perform/pio_timer.h index 943521a..a5ee6d7 100644 --- a/perform/pio_timer.h +++ b/perform/pio_timer.h @@ -53,8 +53,8 @@ typedef enum clock_type_ { /* Miscellaneous identifiers */ enum { - START, /* Start a specified timer */ - STOP /* Stop a specified timer */ + TSTART, /* Start a specified timer */ + TSTOP /* Stop a specified timer */ }; /* The performance time structure */ diff --git a/perform/sio_engine.c b/perform/sio_engine.c index e892bcc..df2e21e 100644 --- a/perform/sio_engine.c +++ b/perform/sio_engine.c @@ -22,7 +22,7 @@ #include #include #ifdef H5_HAVE_UNISTD_H -# include +# include #endif #include @@ -233,18 +233,18 @@ do_sio(parameters param) HDfprintf(output, "data filename=%s\n", fname); - set_time(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS, START); + set_time(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS, TSTART); hrc = do_fopen(¶m, fname, &fd, SIO_CREATE | SIO_WRITE); VRFY((hrc == SUCCESS), "do_fopen failed"); - set_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS, START); + set_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS, TSTART); hrc = do_write(&res, &fd, ¶m, buffer); - set_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS, STOP); + set_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS, TSTOP); VRFY((hrc == SUCCESS), "do_write failed"); /* Close file for write */ hrc = do_fclose(iot, &fd); - set_time(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS, STOP); + set_time(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS, TSTOP); VRFY((hrc == SUCCESS), "do_fclose failed"); if (!param.h5_write_only) { @@ -253,19 +253,19 @@ do_sio(parameters param) */ /* Open file for read */ - set_time(res.timers, HDF5_GROSS_READ_FIXED_DIMS, START); + set_time(res.timers, HDF5_GROSS_READ_FIXED_DIMS, TSTART); hrc = do_fopen(¶m, fname, &fd, SIO_READ); VRFY((hrc == SUCCESS), "do_fopen failed"); - set_time(res.timers, HDF5_FINE_READ_FIXED_DIMS, START); + set_time(res.timers, HDF5_FINE_READ_FIXED_DIMS, TSTART); hrc = do_read(&res, &fd, ¶m, buffer); - set_time(res.timers, HDF5_FINE_READ_FIXED_DIMS, STOP); + set_time(res.timers, HDF5_FINE_READ_FIXED_DIMS, TSTOP); VRFY((hrc == SUCCESS), "do_read failed"); /* Close file for read */ hrc = do_fclose(iot, &fd); - set_time(res.timers, HDF5_GROSS_READ_FIXED_DIMS, STOP); + set_time(res.timers, HDF5_GROSS_READ_FIXED_DIMS, TSTOP); VRFY((hrc == SUCCESS), "do_fclose failed"); } @@ -551,7 +551,7 @@ do_write(results *res, file_descr *fd, parameters *parms, void *buffer) } /* Start "raw data" write timer */ - set_time(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, START); + set_time(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, TSTART); /* Perform write */ hrc = dset_write(rank-1, fd, parms, buffer); @@ -563,7 +563,7 @@ do_write(results *res, file_descr *fd, parameters *parms, void *buffer) /* Stop "raw data" write timer */ - set_time(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, STOP); + set_time(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, TSTOP); /* Calculate write time */ @@ -628,7 +628,7 @@ static herr_t dset_write(int local_dim, file_descr *fd, parameters *parms, void int cur_dim = order[local_dim]-1; int ret_code = SUCCESS; int k; - hsize_t dims[MAX_DIMS], maxdims[MAX_DIMS]; + hsize_t dims[MAX_DIMS], maxdims[MAX_DIMS]; long i,j; herr_t hrc; @@ -855,7 +855,7 @@ do_read(results *res, file_descr *fd, parameters *parms, void *buffer) } /* end switch */ /* Start "raw data" read timer */ - set_time(res->timers, HDF5_RAW_READ_FIXED_DIMS, START); + set_time(res->timers, HDF5_RAW_READ_FIXED_DIMS, TSTART); hrc = dset_read(rank-1, fd, parms, buffer, buffer2); if (hrc < 0) { @@ -864,7 +864,7 @@ do_read(results *res, file_descr *fd, parameters *parms, void *buffer) } /* Stop "raw data" read timer */ - set_time(res->timers, HDF5_RAW_READ_FIXED_DIMS, STOP); + set_time(res->timers, HDF5_RAW_READ_FIXED_DIMS, TSTOP); /* Calculate read time */ diff --git a/perform/sio_perf.c b/perform/sio_perf.c index 8900e2e..16e1750 100644 --- a/perform/sio_perf.c +++ b/perform/sio_perf.c @@ -295,15 +295,15 @@ struct options { int buf_rank; /* Rank */ int order_rank; /* Rank */ int chk_rank; /* Rank */ - int print_times; /* print times as well as throughputs */ - int print_raw; /* print raw data throughput info */ + int print_times; /* print times as well as throughputs */ + int print_raw; /* print raw data throughput info */ off_t h5_alignment; /* alignment in HDF5 file */ off_t h5_threshold; /* threshold for alignment in HDF5 file */ - int h5_use_chunks; /* Make HDF5 dataset chunked */ - int h5_write_only; /* Perform the write tests only */ - int h5_extendable; /* Perform the write tests only */ + int h5_use_chunks; /* Make HDF5 dataset chunked */ + int h5_write_only; /* Perform the write tests only */ + int h5_extendable; /* Perform the write tests only */ unsigned h5_use_mpi_posix; /* Use MPI-posix VFD for HDF5 I/O (instead of MPI-I/O VFD) */ - int verify; /* Verify data correctness */ + int verify; /* Verify data correctness */ vfdtype vfd; /* File driver */ }; @@ -558,7 +558,7 @@ run_test(iotype iot, parameters parms, struct options *opts) /* * Show various statistics */ - /* Write statistics */ + /* Write statistics */ /* Print the raw data throughput if desired */ if (opts->print_raw) { /* accumulate and output the max, min, and average "raw write" times */ @@ -604,7 +604,7 @@ run_test(iotype iot, parameters parms, struct options *opts) output_results(opts,"Write Open-Close",write_gross_mm_table,parms.num_iters,raw_size); if (!parms.h5_write_only) { - /* Read statistics */ + /* Read statistics */ /* Print the raw data throughput if desired */ if (opts->print_raw) { /* accumulate and output the max, min, and average "raw read" times */ @@ -815,10 +815,10 @@ output_report(const char *fmt, ...) static void print_indent(register int indent) { - indent *= TAB_SPACE; + indent *= TAB_SPACE; - for (; indent > 0; --indent) - fputc(' ', output); + for (; indent > 0; --indent) + fputc(' ', output); } static void @@ -842,9 +842,9 @@ static void print_io_api(long io_types) { if (io_types & SIO_POSIX) - HDfprintf(output, "posix "); + HDfprintf(output, "posix "); if (io_types & SIO_HDF5) - HDfprintf(output, "hdf5 "); + HDfprintf(output, "hdf5 "); HDfprintf(output, "\n"); } @@ -854,7 +854,7 @@ report_parameters(struct options *opts) int i, rank; rank = opts->dset_rank; - print_version("HDF5 Library"); /* print library version */ + print_version("HDF5 Library"); /* print library version */ HDfprintf(output, "==== Parameters ====\n"); HDfprintf(output, "IO API="); @@ -1348,7 +1348,7 @@ parse_size_directive(const char *size) static void usage(const char *prog) { - print_version(prog); + print_version(prog); printf("usage: %s [OPTIONS]\n", prog); printf(" OPTIONS\n"); printf(" -h Print an usage message and exit\n"); diff --git a/perform/sio_perf.h b/perform/sio_perf.h index 2417b6f..3e4456a 100644 --- a/perform/sio_perf.h +++ b/perform/sio_perf.h @@ -19,6 +19,7 @@ #ifndef STANDALONE #include "H5private.h" #include "h5test.h" +#include "h5tools.h" #include "h5tools_utils.h" #else #include "sio_standalone.h" @@ -49,24 +50,24 @@ typedef enum vfdtype_ { } vfdtype; typedef struct parameters_ { - iotype io_type; /* The type of IO test to perform */ + iotype io_type; /* The type of IO test to perform */ vfdtype vfd; - long num_files; /* Number of files to create */ - long num_dsets; /* Number of datasets to create */ - off_t num_bytes; /* Number of bytes in each dset */ + long num_files; /* Number of files to create */ + long num_dsets; /* Number of datasets to create */ + off_t num_bytes; /* Number of bytes in each dset */ int num_iters; /* Number of times to loop doing the IO */ int rank; /* Rank of dataset */ - off_t dset_size[MAX_DIMS]; /* Dataset size */ - size_t buf_size[MAX_DIMS]; /* Buffer size */ - size_t chk_size[MAX_DIMS]; /* Chunk size */ - int order[MAX_DIMS]; /* Buffer size */ - hsize_t h5_align; /* HDF5 object alignment */ - hsize_t h5_thresh; /* HDF5 object alignment threshold */ - int h5_use_chunks; /* Make HDF5 dataset chunked */ - int h5_extendable; /* Make HDF5 dataset chunked */ - int h5_write_only; /* Perform the write tests only */ + off_t dset_size[MAX_DIMS]; /* Dataset size */ + size_t buf_size[MAX_DIMS]; /* Buffer size */ + size_t chk_size[MAX_DIMS]; /* Chunk size */ + int order[MAX_DIMS]; /* Buffer size */ + hsize_t h5_align; /* HDF5 object alignment */ + hsize_t h5_thresh; /* HDF5 object alignment threshold */ + int h5_use_chunks; /* Make HDF5 dataset chunked */ + int h5_extendable; /* Make HDF5 dataset chunked */ + int h5_write_only; /* Perform the write tests only */ unsigned h5_use_mpi_posix; /* VFD for HDF5 I/O */ - int verify; /* Verify data correctness */ + int verify; /* Verify data correctness */ } parameters; typedef struct results_ { diff --git a/perform/sio_timer.c b/perform/sio_timer.c index f188a10..f233de3 100644 --- a/perform/sio_timer.c +++ b/perform/sio_timer.c @@ -39,15 +39,15 @@ sio_time *timer_g; /* timer: global for stub functions */ * Function: sub_time * Purpose: Struct two time values, and return the difference, in microseconds * - * Note that the function assumes that a > b + * Note that the function assumes that a > b * Programmer: Leon Arber, 1/27/06 */ static double sub_time(struct timeval* a, struct timeval* b) { return (((double)a->tv_sec + ((double)a->tv_usec) / MICROSECOND) - - ((double)b->tv_sec + - ((double)b->tv_usec) / MICROSECOND)); + ((double)b->tv_sec + + ((double)b->tv_usec) / MICROSECOND)); } @@ -82,7 +82,7 @@ sio_time_new(void) void sio_time_destroy(sio_time *pt) { - free(pt); + HDfree(pt); /* reset the global timer pointer too. */ timer_g = NULL; } @@ -100,15 +100,15 @@ sio_time * set_time(sio_time *pt, timer_type t, int start_stop) { if (pt) { - if (start_stop == START) { + if (start_stop == TSTART) { HDgettimeofday(&pt->sys_timer[t], NULL); - /* When we start the timer for HDF5_FINE_WRITE_FIXED_DIMS or HDF5_FINE_READ_FIXED_DIMS - * we compute the time it took to only open the file */ - if(t == HDF5_FINE_WRITE_FIXED_DIMS) - pt->total_time[HDF5_FILE_WRITE_OPEN] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_GROSS_WRITE_FIXED_DIMS])); - else if(t == HDF5_FINE_READ_FIXED_DIMS) - pt->total_time[HDF5_FILE_READ_OPEN] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_GROSS_READ_FIXED_DIMS])); + /* When we start the timer for HDF5_FINE_WRITE_FIXED_DIMS or HDF5_FINE_READ_FIXED_DIMS + * we compute the time it took to only open the file */ + if(t == HDF5_FINE_WRITE_FIXED_DIMS) + pt->total_time[HDF5_FILE_WRITE_OPEN] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_GROSS_WRITE_FIXED_DIMS])); + else if(t == HDF5_FINE_READ_FIXED_DIMS) + pt->total_time[HDF5_FILE_READ_OPEN] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_GROSS_READ_FIXED_DIMS])); } else { @@ -122,12 +122,12 @@ set_time(sio_time *pt, timer_type t, int start_stop) ((double)pt->sys_timer[t].tv_sec + ((double)pt->sys_timer[t].tv_usec) / MICROSECOND);*/ - /* When we stop the timer for HDF5_GROSS_WRITE_FIXED_DIMS or HDF5_GROSS_READ_FIXED_DIMS - * we compute the time it took to close the file after the last read/write finished */ - if(t == HDF5_GROSS_WRITE_FIXED_DIMS) - pt->total_time[HDF5_FILE_WRITE_CLOSE] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_FINE_WRITE_FIXED_DIMS])); - else if(t == HDF5_GROSS_READ_FIXED_DIMS) - pt->total_time[HDF5_FILE_READ_CLOSE] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_FINE_READ_FIXED_DIMS])); + /* When we stop the timer for HDF5_GROSS_WRITE_FIXED_DIMS or HDF5_GROSS_READ_FIXED_DIMS + * we compute the time it took to close the file after the last read/write finished */ + if(t == HDF5_GROSS_WRITE_FIXED_DIMS) + pt->total_time[HDF5_FILE_WRITE_CLOSE] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_FINE_WRITE_FIXED_DIMS])); + else if(t == HDF5_GROSS_READ_FIXED_DIMS) + pt->total_time[HDF5_FILE_READ_CLOSE] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_FINE_READ_FIXED_DIMS])); } @@ -171,7 +171,7 @@ set_time(sio_time *pt, timer_type t, int start_stop) } fprintf(output, " %s %s: %.2f\n", msg, - (start_stop == START ? "Start" : "Stop"), + (start_stop == TSTART ? "Start" : "Stop"), pt->total_time[t]); } } diff --git a/perform/sio_timer.h b/perform/sio_timer.h index 1fa880d..04432af 100644 --- a/perform/sio_timer.h +++ b/perform/sio_timer.h @@ -27,7 +27,7 @@ #endif #ifdef H5_HAVE_WINSOCK_H -# include +# include #endif /* H5_HAVE_WINSOCK_H */ /* The different types of timers we can have */ @@ -52,8 +52,8 @@ typedef enum timer_type_ { /* Miscellaneous identifiers */ enum { - START, /* Start a specified timer */ - STOP /* Stop a specified timer */ + TSTART, /* Start a specified timer */ + TSTOP /* Stop a specified timer */ }; /* The performance time structure */ diff --git a/perform/zip_perf.c b/perform/zip_perf.c index 4e1f043..585dc13 100644 --- a/perform/zip_perf.c +++ b/perform/zip_perf.c @@ -23,6 +23,7 @@ /* our header files */ #include "h5test.h" +#include "h5tools.h" #include "h5tools_utils.h" #ifdef H5_HAVE_FILTER_DEFLATE diff --git a/tools/h5copy/h5copy.c b/tools/h5copy/h5copy.c index 1a9a8eb..574ba94 100644 --- a/tools/h5copy/h5copy.c +++ b/tools/h5copy/h5copy.c @@ -465,7 +465,7 @@ main (int argc, const char *argv[]) /* free link info path */ if (linkinfo.trg_path) - HDfree(linkinfo.trg_path); + HDfree((char*)linkinfo.trg_path); /* close propertis */ if(H5Pclose(ocpl_id)<0) @@ -497,7 +497,7 @@ error: /* free link info path */ if (linkinfo.trg_path) - HDfree(linkinfo.trg_path); + HDfree((char*)linkinfo.trg_path); H5E_BEGIN_TRY { H5Pclose(ocpl_id); diff --git a/tools/h5diff/h5diff_common.c b/tools/h5diff/h5diff_common.c index f7532f2..b8e46f3 100644 --- a/tools/h5diff/h5diff_common.c +++ b/tools/h5diff/h5diff_common.c @@ -17,6 +17,7 @@ #include #include "h5diff.h" #include "h5diff_common.h" +#include "h5tools.h" #include "h5tools_utils.h" static int check_n_input( const char* ); @@ -53,7 +54,7 @@ static struct long_options l_opts[] = { * *------------------------------------------------------------------------- */ -static check_options(diff_opt_t* options) +static void check_options(diff_opt_t* options) { /*-------------------------------------------------------------- * check for mutually exclusive options @@ -179,7 +180,7 @@ void parse_command_line(int argc, } /* init */ - exclude_node->obj_path = opt_arg; + exclude_node->obj_path = (char*)opt_arg; exclude_node->obj_type = H5TRAV_TYPE_UNKNOWN; exclude_prev = exclude_head; diff --git a/tools/h5diff/h5diff_main.c b/tools/h5diff/h5diff_main.c index 51a49c2..607d58e 100644 --- a/tools/h5diff/h5diff_main.c +++ b/tools/h5diff/h5diff_main.c @@ -18,6 +18,7 @@ #include #include "h5diff.h" #include "h5diff_common.h" +#include "h5tools.h" #include "h5tools_utils.h" diff --git a/tools/h5diff/ph5diff_main.c b/tools/h5diff/ph5diff_main.c index 5bd5567..1fc563b 100644 --- a/tools/h5diff/ph5diff_main.c +++ b/tools/h5diff/ph5diff_main.c @@ -19,6 +19,7 @@ #include #include #include "h5diff_common.h" +#include "h5tools.h" #include "h5tools_utils.h" /* Name of tool */ diff --git a/tools/h5import/h5import.c b/tools/h5import/h5import.c index 89701bd..56dc5ab 100755 --- a/tools/h5import/h5import.c +++ b/tools/h5import/h5import.c @@ -20,6 +20,7 @@ #include #include #include "h5import.h" +#include "h5tools.h" #include "h5tools_utils.h" /* Name of tool */ @@ -1361,7 +1362,7 @@ static int processConfigurationFile(char *infile, struct Input *in) break; case 12: /* EXTERNAL-STORAGE */ - if (in->configOptionVector[EXTERNAL] == 1) { + if (in->configOptionVector[EXTERNALSTORE] == 1) { (void) HDfprintf(stderr, err15a, infile); HDfclose(strm); return (-1); @@ -1372,7 +1373,7 @@ static int processConfigurationFile(char *infile, struct Input *in) HDfclose(strm); return (-1); } - in->configOptionVector[EXTERNAL] = 1; + in->configOptionVector[EXTERNALSTORE] = 1; break; case 13: /* MAXIMUM-DIMENSIONS */ @@ -1435,7 +1436,7 @@ static int validateConfigurationParameters(struct Input *in) return (-1); } - if (in->configOptionVector[EXTERNAL] == 1) { + if (in->configOptionVector[EXTERNALSTORE] == 1) { if ((in->configOptionVector[COMPRESS] == 1) || (in->configOptionVector[CHUNK] == 1) || (in->configOptionVector[EXTEND] == 1)) { (void) HDfprintf(stderr, "%s", err2); return (-1); @@ -2360,7 +2361,7 @@ static int process(struct Options *opt) H5Pset_deflate(proplist, (unsigned) in->compressionParam); } - if (in->configOptionVector[EXTERNAL] == 1) { + if (in->configOptionVector[EXTERNALSTORE] == 1) { /* creating the external file if it doesnt exist */ if ((extfile = HDfopen(in->externFilename, "ab")) == NULL) { (void) HDfprintf(stderr, "%s", err4); diff --git a/tools/h5import/h5import.h b/tools/h5import/h5import.h index 05de476..dbc6844 100755 --- a/tools/h5import/h5import.h +++ b/tools/h5import/h5import.h @@ -47,7 +47,7 @@ #define CHUNK 0 #define COMPRESS 1 #define EXTEND 2 -#define EXTERNAL 3 +#define EXTERNALSTORE 3 #define DIM 4 #define RANK 5 #define PATH 6 diff --git a/tools/h5jam/getub.c b/tools/h5jam/getub.c index 39a78ae..f536605 100644 --- a/tools/h5jam/getub.c +++ b/tools/h5jam/getub.c @@ -21,6 +21,7 @@ #endif #include "H5private.h" +#include "h5tools.h" #include "h5tools_utils.h" void parse_command_line (int argc, const char *argv[]); diff --git a/tools/h5jam/h5jam.c b/tools/h5jam/h5jam.c index 923bc5a..981eead 100644 --- a/tools/h5jam/h5jam.c +++ b/tools/h5jam/h5jam.c @@ -15,6 +15,7 @@ #include "hdf5.h" #include "H5private.h" +#include "h5tools.h" #include "h5tools_utils.h" /* Name of tool */ diff --git a/tools/h5jam/h5unjam.c b/tools/h5jam/h5unjam.c index 1dfdfc7..4751dad 100644 --- a/tools/h5jam/h5unjam.c +++ b/tools/h5jam/h5unjam.c @@ -15,6 +15,7 @@ #include "hdf5.h" #include "H5private.h" +#include "h5tools.h" #include "h5tools_utils.h" /* Name of tool */ diff --git a/tools/h5jam/tellub.c b/tools/h5jam/tellub.c index 2ffcbda..0169d71 100644 --- a/tools/h5jam/tellub.c +++ b/tools/h5jam/tellub.c @@ -21,6 +21,7 @@ #include "hdf5.h" #include "H5private.h" +#include "h5tools.h" #include "h5tools_utils.h" #define TRUE 1 diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c index 3e335e9..7315796 100644 --- a/tools/h5ls/h5ls.c +++ b/tools/h5ls/h5ls.c @@ -3127,7 +3127,7 @@ list_lnk(const char *name, const H5L_info_t *linfo, void *_iter) ret = H5tools_get_symlink_info(iter->fid, name, &lnk_info, follow_symlink_g); /* lnk_info.trg_path is malloced in H5tools_get_symlink_info() * so it will be freed via buf later */ - buf = lnk_info.trg_path; + buf = (char*)lnk_info.trg_path; /* error */ if (ret < 0) goto done; @@ -3185,7 +3185,7 @@ list_lnk(const char *name, const H5L_info_t *linfo, void *_iter) ret = H5tools_get_symlink_info(iter->fid, name, &lnk_info, follow_link); /* lnk_info.trg_path is malloced in H5tools_get_symlink_info() * so it will be freed via buf later */ - buf = lnk_info.trg_path; + buf = (char*)lnk_info.trg_path; /* error */ if (ret < 0) goto done; diff --git a/tools/h5repack/h5repack.c b/tools/h5repack/h5repack.c index b36eb37..28d66c5 100644 --- a/tools/h5repack/h5repack.c +++ b/tools/h5repack/h5repack.c @@ -493,24 +493,24 @@ int copy_attr(hid_t loc_in, type_class = H5Tget_class(wtype_id); is_ref = (type_class == H5T_REFERENCE); if (type_class == H5T_VLEN ||type_class == H5T_ARRAY ) { - hid_t base_type = -1; - base_type = H5Tget_super(ftype_id); - is_ref = (is_ref || (H5Tget_class(base_type)==H5T_REFERENCE)); - H5Tclose(base_type); + hid_t base_type = -1; + base_type = H5Tget_super(ftype_id); + is_ref = (is_ref || (H5Tget_class(base_type)==H5T_REFERENCE)); + H5Tclose(base_type); } if (type_class == H5T_COMPOUND) { - int nmembers = H5Tget_nmembers(wtype_id) ; - for (j=0; j 0); if (!(is_ref || is_ref_vlen || is_ref_array || is_ref_comp)) { - H5Tclose(mtype_id); - H5Tclose(ftype_id); - H5Aclose(attr_id); - continue; + H5Tclose(mtype_id); + H5Tclose(ftype_id); + H5Aclose(attr_id); + continue; } /* get name */ @@ -584,18 +584,18 @@ static int copy_refs_attr(hid_t loc_in, nelmts *= dims[j]; if (is_ref_array) { - unsigned array_rank = 0; - hsize_t array_size = 1; - hsize_t array_dims[H5S_MAX_RANK]; - hid_t base_type = -1; - base_type = H5Tget_super(ftype_id); - msize = H5Tget_size(base_type); - H5Tclose(base_type); - - array_rank = H5Tget_array_ndims(mtype_id); - H5Tget_array_dims2(mtype_id, array_dims); + unsigned array_rank = 0; + hsize_t array_size = 1; + hsize_t array_dims[H5S_MAX_RANK]; + hid_t base_type = -1; + base_type = H5Tget_super(ftype_id); + msize = H5Tget_size(base_type); + H5Tclose(base_type); + + array_rank = H5Tget_array_ndims(mtype_id); + H5Tget_array_dims2(mtype_id, array_dims); for(j = 0; j verbose) printf("object <%s> reference created to <%s>\n", name, refname); } /* k */ @@ -657,13 +657,13 @@ static int copy_refs_attr(hid_t loc_in, for(i = 0; i < (unsigned)nelmts; i++) { if (update_ref_value(attr_id, H5R_DATASET_REGION, &((hdset_reg_ref_t *)buf)[i], fidout, &((hdset_reg_ref_t *)refbuf)[i], travt)<0) - continue; + continue; if(options->verbose) printf("object <%s> region reference created to <%s>\n", name, refname); } } /* H5T_STD_REF_DSETREG */ else if (is_ref_vlen) { - /* handle VLEN of references */ + /* handle VLEN of references */ buf = (hvl_t *)HDmalloc((unsigned)(nelmts * sizeof(hvl_t))); refbuf = buf; /* reuse the read buffer for write */ @@ -677,31 +677,31 @@ static int copy_refs_attr(hid_t loc_in, if(H5Aread(attr_id, mtype_id, buf) < 0) goto error; - if (H5R_OBJ_REF_BUF_SIZE==msize) { - hobj_ref_t ref_out; - for (i=0; i<(unsigned)nelmts; i++) { - hobj_ref_t *ptr = (hobj_ref_t *)((hvl_t *)buf)[i].p; - for (j=0; j<((hvl_t *)buf)[i].len; j++ ) { - if (update_ref_value(attr_id, H5R_OBJECT, &(ptr[j]), fidout, &ref_out, travt)<0) - continue; - HDmemcpy(&(ptr[j]), &ref_out, msize); - } - } /* for (i=0; i #include "h5repack.h" #include "h5tools.h" +#include "h5tools_utils.h" #include "h5test.h" diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index f86e914..bc8acd5 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -614,7 +614,7 @@ static herr_t trav_grp_symlinks(const char *path, const H5L_info_t *linfo, done: if (lnk_info.trg_path) - HDfree(lnk_info.trg_path); + HDfree((char *)lnk_info.trg_path); return 0; } @@ -728,25 +728,25 @@ hsize_t h5diff(const char *fname1, /* make the given object1 fullpath, start with "/" */ if (HDstrncmp(objname1, "/", 1)) { - HDstrcpy(obj1fullname, "/"); - HDstrcat(obj1fullname, objname1); + HDstrcpy((char *)obj1fullname, "/"); + HDstrcat((char *)obj1fullname, objname1); } else - HDstrcpy(obj1fullname, objname1); + HDstrcpy((char *)obj1fullname, objname1); /* make the given object2 fullpath, start with "/" */ if (HDstrncmp(objname2, "/", 1)) { - HDstrcpy(obj2fullname, "/"); - HDstrcat(obj2fullname, objname2); + HDstrcpy((char *)obj2fullname, "/"); + HDstrcat((char *)obj2fullname, objname2); } else - HDstrcpy(obj2fullname, objname2); + HDstrcpy((char *)obj2fullname, objname2); /*---------------------------------------------------------- * check if obj1 is root, group, single object or symlink */ - if(!HDstrcmp(obj1fullname, "/")) + if(!HDstrcmp((char *)obj1fullname, "/")) { obj1type = H5TRAV_TYPE_GROUP; } @@ -856,9 +856,9 @@ hsize_t h5diff(const char *fname1, { /* set root group */ obj1fullname = (char*)HDcalloc(2, sizeof(char)); - HDstrcat(obj1fullname, "/"); + HDstrcat((char *)obj1fullname, "/"); obj2fullname = (char*)HDcalloc(2, sizeof(char)); - HDstrcat(obj2fullname, "/"); + HDstrcat((char *)obj2fullname, "/"); } @@ -1045,15 +1045,15 @@ out: /* free buffers */ if (obj1fullname) - HDfree(obj1fullname); + HDfree((char *)obj1fullname); if (obj2fullname) - HDfree(obj2fullname); + HDfree((char *)obj2fullname); /* free link info buffer */ if (trg_linfo1.trg_path) - HDfree(trg_linfo1.trg_path); + HDfree((char *)trg_linfo1.trg_path); if (trg_linfo2.trg_path) - HDfree(trg_linfo2.trg_path); + HDfree((char *)trg_linfo2.trg_path); /* close */ H5E_BEGIN_TRY @@ -1112,9 +1112,9 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, * make full path */ if (HDstrcmp (grp1, "/")) - grp1_path = grp1; + grp1_path = (char *)grp1; if (HDstrcmp (grp2, "/")) - grp2_path = grp2; + grp2_path = (char *)grp2; /*------------------------------------------------------------------------- * regarding the return value of h5diff (0, no difference in files, 1 difference ) @@ -1769,9 +1769,9 @@ out: /* free link info buffer */ if (linkinfo1.trg_path) - HDfree(linkinfo1.trg_path); + HDfree((char *)linkinfo1.trg_path); if (linkinfo2.trg_path) - HDfree(linkinfo2.trg_path); + HDfree((char *)linkinfo2.trg_path); return nfound; } @@ -2163,9 +2163,9 @@ hsize_t diff(hid_t file1_id, /* free link info buffer */ if (linkinfo1.trg_path) - HDfree(linkinfo1.trg_path); + HDfree((char *)linkinfo1.trg_path); if (linkinfo2.trg_path) - HDfree(linkinfo2.trg_path); + HDfree((char *)linkinfo2.trg_path); return nfound; @@ -2206,9 +2206,9 @@ out2: /* free link info buffer */ if (linkinfo1.trg_path) - HDfree(linkinfo1.trg_path); + HDfree((char *)linkinfo1.trg_path); if (linkinfo2.trg_path) - HDfree(linkinfo2.trg_path); + HDfree((char *)linkinfo2.trg_path); /* close */ /* disable error reporting */ -- cgit v0.12 From e53a56af532e4c63872f5b8bc4b40d71600011dc Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 29 Feb 2012 09:04:51 -0500 Subject: [svn-r22005] function calls must be after assignments on windows --- tools/h5repack/h5repacktst.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/h5repack/h5repacktst.c b/tools/h5repack/h5repacktst.c index 0ea70ae..17a6190 100644 --- a/tools/h5repack/h5repacktst.c +++ b/tools/h5repack/h5repacktst.c @@ -168,11 +168,6 @@ static int make_complex_attr_references(hid_t loc_id); int main (void) { - h5tools_setprogname(PROGRAMNAME); - h5tools_setstatus(EXIT_SUCCESS); - - /* Initialize h5tools lib */ - h5tools_init(); pack_opt_t pack_options; diff_opt_t diff_options; hsize_t fs_size = 0; /* free space section threshold */ @@ -181,6 +176,12 @@ int main (void) int szip_can_encode = 0; #endif + h5tools_setprogname(PROGRAMNAME); + h5tools_setstatus(EXIT_SUCCESS); + + /* Initialize h5tools lib */ + h5tools_init(); + /* initialize */ HDmemset(&diff_options, 0, sizeof (diff_opt_t)); HDmemset(&pack_options, 0, sizeof (pack_opt_t)); -- cgit v0.12 From e49c1ba04e9ec224771e9c7e528def4fc8245d87 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 29 Feb 2012 12:51:24 -0500 Subject: [svn-r22007] Remove duplicated functions by using h5tools library calls HDFFV-7949 Tested: local linux and h5committest --- tools/h5ls/h5ls.c | 1411 +++++++++-------------------------------------------- 1 file changed, 235 insertions(+), 1176 deletions(-) diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c index 7315796..2171682 100644 --- a/tools/h5ls/h5ls.c +++ b/tools/h5ls/h5ls.c @@ -239,1071 +239,6 @@ usage: %s [OPTIONS] [OBJECTS...]\n\ } -/*------------------------------------------------------------------------- - * Function: display_string - * - * Purpose: Print a string value by escaping unusual characters. If - * STREAM is null then we only count how large the output would - * be. - * - * Return: Number of characters printed. - * - * Programmer: Robb Matzke - * Thursday, November 5, 1998 - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -static int -display_string(FILE *stream, const char *s, hbool_t escape_spaces) -{ - int nprint=0; - - for (/*void*/; s && *s; s++) { - switch (*s) { - case '"': - if (stream) HDfprintf(stream, "\\\""); - nprint += 2; - break; - case '\\': - if (stream) HDfprintf(stream, "\\\\"); - nprint += 2; - break; - case '\b': - if (stream) HDfprintf(stream, "\\b"); - nprint += 2; - break; - case '\f': - if (stream) HDfprintf(stream, "\\f"); - nprint += 2; - break; - case '\n': - if (stream) HDfprintf(stream, "\\n"); - nprint += 2; - break; - case '\r': - if (stream) HDfprintf(stream, "\\r"); - nprint += 2; - break; - case '\t': - if (stream) HDfprintf(stream, "\\t"); - nprint += 2; - break; - case ' ': - if (escape_spaces) { - if (stream) HDfprintf(stream, "\\ "); - nprint += 2; - } else { - if (stream) HDfprintf(stream, " "); - nprint++; - } - break; - default: - if (isprint((int)*s)) { - if (stream) HDfputc(*s, stream); - nprint++; - } else { - if (stream) { - HDfprintf(stream, "\\%03o", *((const unsigned char*)s)); - } - nprint += 4; - } - break; - } - } - return nprint; -} - - -/*------------------------------------------------------------------------- - * Function: display_obj_name - * - * Purpose: Print an object name and another string. - * - * Return: Success: TRUE - * - * Failure: FALSE, nothing printed - * - * Programmer: Quincey Koziol - * Tuesday, November 6, 2007 - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -static int -display_obj_name(FILE *stream, const iter_t *iter, const char *oname, - const char *s) -{ - static char fullname[NAME_BUF_SIZE]; /* Buffer for file and/or object name */ - const char *name = fullname; /* Pointer to buffer for printing */ - int n; - - if(show_file_name_g) - sprintf(fullname, "%s/%s", iter->fname, oname + iter->name_start); - else - name = oname + iter->name_start; - - /* Print the object name, either full name or base name */ - if(fullname_g) - n = display_string(stream, name, TRUE); - else { - const char *last_sep; /* The location of the last group separator */ - - /* Find the last component of the path name */ - if(NULL == (last_sep = HDstrrchr(name, '/'))) - last_sep = name; - else { - last_sep++; - } /* end else */ - n = display_string(stream, last_sep, TRUE); - } /* end else */ - HDfprintf(rawoutstream, "%*s ", MAX(0, (24 - n)), s); - - return TRUE; -} - - -/*------------------------------------------------------------------------- - * Function: display_native_type - * - * Purpose: Prints the name of a native C data type. - * - * Return: Success: TRUE - * - * Failure: FALSE, nothing printed. - * - * Programmer: Robb Matzke - * Thursday, November 5, 1998 - * - * Modifications: - * Robb Matzke, 1999-06-11 - * Added the C9x types, but we still prefer to display the types - * from the C language itself (like `int' vs. `int32_t'). - * - *------------------------------------------------------------------------- - */ -static hbool_t -display_native_type(hid_t type, int UNUSED ind) -{ - if (H5Tequal(type, H5T_NATIVE_SCHAR)==TRUE) { - HDfprintf(rawoutstream, "native signed char"); - } else if (H5Tequal(type, H5T_NATIVE_UCHAR)==TRUE) { - HDfprintf(rawoutstream, "native unsigned char"); - } else if (H5Tequal(type, H5T_NATIVE_INT)==TRUE) { - HDfprintf(rawoutstream, "native int"); - } else if (H5Tequal(type, H5T_NATIVE_UINT)==TRUE) { - HDfprintf(rawoutstream, "native unsigned int"); - } else if (H5Tequal(type, H5T_NATIVE_SHORT)==TRUE) { - HDfprintf(rawoutstream, "native short"); - } else if (H5Tequal(type, H5T_NATIVE_USHORT)==TRUE) { - HDfprintf(rawoutstream, "native unsigned short"); - } else if (H5Tequal(type, H5T_NATIVE_LONG)==TRUE) { - HDfprintf(rawoutstream, "native long"); - } else if (H5Tequal(type, H5T_NATIVE_ULONG)==TRUE) { - HDfprintf(rawoutstream, "native unsigned long"); - } else if (H5Tequal(type, H5T_NATIVE_LLONG)==TRUE) { - HDfprintf(rawoutstream, "native long long"); - } else if (H5Tequal(type, H5T_NATIVE_ULLONG)==TRUE) { - HDfprintf(rawoutstream, "native unsigned long long"); - } else if (H5Tequal(type, H5T_NATIVE_FLOAT)==TRUE) { - HDfprintf(rawoutstream, "native float"); - } else if (H5Tequal(type, H5T_NATIVE_DOUBLE)==TRUE) { - HDfprintf(rawoutstream, "native double"); -#if H5_SIZEOF_LONG_DOUBLE !=0 - } else if (H5Tequal(type, H5T_NATIVE_LDOUBLE)==TRUE) { - HDfprintf(rawoutstream, "native long double"); -#endif - } else if (H5Tequal(type, H5T_NATIVE_INT8)==TRUE) { - HDfprintf(rawoutstream, "native int8_t"); - } else if (H5Tequal(type, H5T_NATIVE_UINT8)==TRUE) { - HDfprintf(rawoutstream, "native uint8_t"); - } else if (H5Tequal(type, H5T_NATIVE_INT16)==TRUE) { - HDfprintf(rawoutstream, "native int16_t"); - } else if (H5Tequal(type, H5T_NATIVE_UINT16)==TRUE) { - HDfprintf(rawoutstream, "native uint16_t"); - } else if (H5Tequal(type, H5T_NATIVE_INT32)==TRUE) { - HDfprintf(rawoutstream, "native int32_t"); - } else if (H5Tequal(type, H5T_NATIVE_UINT32)==TRUE) { - HDfprintf(rawoutstream, "native uint32_t"); - } else if (H5Tequal(type, H5T_NATIVE_INT64)==TRUE) { - HDfprintf(rawoutstream, "native int64_t"); - } else if (H5Tequal(type, H5T_NATIVE_UINT64)==TRUE) { - HDfprintf(rawoutstream, "native uint64_t"); - } else if (H5Tequal(type, H5T_NATIVE_INT_LEAST8)==TRUE) { - HDfprintf(rawoutstream, "native int_least8_t"); - } else if (H5Tequal(type, H5T_NATIVE_UINT_LEAST8)==TRUE) { - HDfprintf(rawoutstream, "native uint_least8_t"); - } else if (H5Tequal(type, H5T_NATIVE_INT_LEAST16)==TRUE) { - HDfprintf(rawoutstream, "native int_least16_t"); - } else if (H5Tequal(type, H5T_NATIVE_UINT_LEAST16)==TRUE) { - HDfprintf(rawoutstream, "native uint_least16_t"); - } else if (H5Tequal(type, H5T_NATIVE_INT_LEAST32)==TRUE) { - HDfprintf(rawoutstream, "native int_least32_t"); - } else if (H5Tequal(type, H5T_NATIVE_UINT_LEAST32)==TRUE) { - HDfprintf(rawoutstream, "native uint_least32_t"); - } else if (H5Tequal(type, H5T_NATIVE_INT_LEAST64)==TRUE) { - HDfprintf(rawoutstream, "native int_least64_t"); - } else if (H5Tequal(type, H5T_NATIVE_UINT_LEAST64)==TRUE) { - HDfprintf(rawoutstream, "native uint_least64_t"); - } else if (H5Tequal(type, H5T_NATIVE_INT_FAST8)==TRUE) { - HDfprintf(rawoutstream, "native int_fast8_t"); - } else if (H5Tequal(type, H5T_NATIVE_UINT_FAST8)==TRUE) { - HDfprintf(rawoutstream, "native uint_fast8_t"); - } else if (H5Tequal(type, H5T_NATIVE_INT_FAST16)==TRUE) { - HDfprintf(rawoutstream, "native int_fast16_t"); - } else if (H5Tequal(type, H5T_NATIVE_UINT_FAST16)==TRUE) { - HDfprintf(rawoutstream, "native uint_fast16_t"); - } else if (H5Tequal(type, H5T_NATIVE_INT_FAST32)==TRUE) { - HDfprintf(rawoutstream, "native int_fast32_t"); - } else if (H5Tequal(type, H5T_NATIVE_UINT_FAST32)==TRUE) { - HDfprintf(rawoutstream, "native uint_fast32_t"); - } else if (H5Tequal(type, H5T_NATIVE_INT_FAST64)==TRUE) { - HDfprintf(rawoutstream, "native int_fast64_t"); - } else if (H5Tequal(type, H5T_NATIVE_UINT_FAST64)==TRUE) { - HDfprintf(rawoutstream, "native uint_fast64_t"); - } else if (H5Tequal(type, H5T_NATIVE_B8)==TRUE) { - HDfprintf(rawoutstream, "native 8-bit field"); - } else if (H5Tequal(type, H5T_NATIVE_B16)==TRUE) { - HDfprintf(rawoutstream, "native 16-bit field"); - } else if (H5Tequal(type, H5T_NATIVE_B32)==TRUE) { - HDfprintf(rawoutstream, "native 32-bit field"); - } else if (H5Tequal(type, H5T_NATIVE_B64)==TRUE) { - HDfprintf(rawoutstream, "native 64-bit field"); - } else if (H5Tequal(type, H5T_NATIVE_HSIZE)==TRUE) { - HDfprintf(rawoutstream, "native hsize_t"); - } else if (H5Tequal(type, H5T_NATIVE_HSSIZE)==TRUE) { - HDfprintf(rawoutstream, "native hssize_t"); - } else if (H5Tequal(type, H5T_NATIVE_HERR)==TRUE) { - HDfprintf(rawoutstream, "native herr_t"); - } else if (H5Tequal(type, H5T_NATIVE_HBOOL)==TRUE) { - HDfprintf(rawoutstream, "native hbool_t"); - } else { - return FALSE; - } - return TRUE; -} - - -/*------------------------------------------------------------------------- - * Function: display_ieee_type - * - * Purpose: Print the name of an IEEE floating-point data type. - * - * Return: Success: TRUE - * - * Failure: FALSE, nothing printed - * - * Programmer: Robb Matzke - * Thursday, November 5, 1998 - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -static hbool_t -display_ieee_type(hid_t type, int UNUSED ind) -{ - if (H5Tequal(type, H5T_IEEE_F32BE)==TRUE) { - HDfprintf(rawoutstream, "IEEE 32-bit big-endian float"); - } else if (H5Tequal(type, H5T_IEEE_F32LE)==TRUE) { - HDfprintf(rawoutstream, "IEEE 32-bit little-endian float"); - } else if (H5Tequal(type, H5T_IEEE_F64BE)==TRUE) { - HDfprintf(rawoutstream, "IEEE 64-bit big-endian float"); - } else if (H5Tequal(type, H5T_IEEE_F64LE)==TRUE) { - HDfprintf(rawoutstream, "IEEE 64-bit little-endian float"); - } else { - return FALSE; - } - return TRUE; -} - - -/*------------------------------------------------------------------------- - * Function: display_precision - * - * Purpose: Prints information on the next line about precision and - * padding if the precision is less than the total data type - * size. - * - * Return: void - * - * Programmer: Robb Matzke - * Thursday, November 5, 1998 - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -static void -display_precision(hid_t type, int ind) -{ - size_t prec; /* precision */ - H5T_pad_t plsb, pmsb; /* lsb and msb padding */ - const char *plsb_s=NULL; /* lsb padding string */ - const char *pmsb_s=NULL; /* msb padding string */ - size_t nbits; /* number of bits */ - - /* If the precision is less than the total size then show the precision - * and offset on the following line. Also display the padding - * information. */ - if (8*H5Tget_size(type)!=(prec=H5Tget_precision(type))) { - HDfprintf(rawoutstream, "\n%*s(%lu bit%s of precision beginning at bit %lu)", - ind, "", (unsigned long)prec, 1==prec?"":"s", - (unsigned long)H5Tget_offset(type)); - - H5Tget_pad(type, &plsb, &pmsb); - if (H5Tget_offset(type)>0) { - switch (plsb) { - case H5T_PAD_ZERO: - plsb_s = "zero"; - break; - case H5T_PAD_ONE: - plsb_s = "one"; - break; - case H5T_PAD_BACKGROUND: - plsb_s = "bkg"; - break; - case H5T_PAD_ERROR: - case H5T_NPAD: - plsb_s = "unknown"; - break; - default: - ; - break; - } - } - if (H5Tget_offset(type)+prec<8*H5Tget_size(type)) { - switch (pmsb) { - case H5T_PAD_ZERO: - pmsb_s = "zero"; - break; - case H5T_PAD_ONE: - pmsb_s = "one"; - break; - case H5T_PAD_BACKGROUND: - pmsb_s = "bkg"; - break; - case H5T_PAD_ERROR: - case H5T_NPAD: - pmsb_s = "unknown"; - break; - default: - ; - break; - } - } - if (plsb_s || pmsb_s) { - HDfprintf(rawoutstream, "\n%*s(", ind, ""); - if (plsb_s) { - nbits = H5Tget_offset(type); - HDfprintf(rawoutstream, "%lu %s bit%s at bit 0", - (unsigned long)nbits, plsb_s, 1==nbits?"":"s"); - } - if (plsb_s && pmsb_s) HDfprintf(rawoutstream, ", "); - if (pmsb_s) { - nbits = 8*H5Tget_size(type)-(H5Tget_offset(type)+prec); - HDfprintf(rawoutstream, "%lu %s bit%s at bit %lu", - (unsigned long)nbits, pmsb_s, 1==nbits?"":"s", - (unsigned long)(8*H5Tget_size(type)-nbits)); - } - HDfprintf(rawoutstream, ")"); - } - } -} - - -/*------------------------------------------------------------------------- - * Function: display_int_type - * - * Purpose: Print the name of an integer data type. Common information - * like number of bits, byte order, and sign scheme appear on - * the first line. Additional information might appear in - * parentheses on the following lines. - * - * Return: Success: TRUE - * - * Failure: FALSE, nothing printed - * - * Programmer: Robb Matzke - * Thursday, November 5, 1998 - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -static hbool_t -display_int_type(hid_t type, int ind) -{ - H5T_order_t order; /* byte order value */ - const char *order_s=NULL; /* byte order string */ - H5T_sign_t sign; /* sign scheme value */ - const char *sign_s=NULL; /* sign scheme string */ - - if (H5T_INTEGER!=H5Tget_class(type)) return FALSE; - - /* Byte order */ - if (H5Tget_size(type)>1) { - order = H5Tget_order(type); - if (H5T_ORDER_LE==order) { - order_s = " little-endian"; - } else if (H5T_ORDER_BE==order) { - order_s = " big-endian"; - } else if (H5T_ORDER_VAX==order) { - order_s = " mixed-endian"; - } else { - order_s = " unknown-byte-order"; - } - } else { - order_s = ""; - } - - /* Sign */ - if ((sign=H5Tget_sign(type))>=0) { - if (H5T_SGN_NONE==sign) { - sign_s = " unsigned"; - } else if (H5T_SGN_2==sign) { - sign_s = ""; - } else { - sign_s = " unknown-sign"; - } - } else { - sign_s = " unknown-sign"; - } - - /* Print size, order, and sign on first line, precision and padding - * information on the subsequent lines */ - HDfprintf(rawoutstream, "%lu-bit%s%s integer", - (unsigned long)(8*H5Tget_size(type)), order_s, sign_s); - display_precision(type, ind); - return TRUE; -} - - -/*------------------------------------------------------------------------- - * Function: display_float_type - * - * Purpose: Print info about a floating point data type. - * - * Return: Success: TRUE - * - * Failure: FALSE, nothing printed - * - * Programmer: Robb Matzke - * Thursday, November 5, 1998 - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -static hbool_t -display_float_type(hid_t type, int ind) -{ - H5T_order_t order; /* byte order value */ - const char *order_s=NULL; /* byte order string */ - size_t spos; /* sign bit position */ - size_t esize, epos; /* exponent size and position */ - size_t msize, mpos; /* significand size and position */ - size_t ebias; /* exponent bias */ - H5T_norm_t norm; /* significand normalization */ - const char *norm_s=NULL; /* normalization string */ - H5T_pad_t pad; /* internal padding value */ - const char *pad_s=NULL; /* internal padding string */ - - if (H5T_FLOAT!=H5Tget_class(type)) return FALSE; - - /* Byte order */ - if (H5Tget_size(type)>1) { - order = H5Tget_order(type); - if (H5T_ORDER_LE==order) { - order_s = " little-endian"; - } else if (H5T_ORDER_BE==order) { - order_s = " big-endian"; - } else if (H5T_ORDER_VAX==order) { - order_s = " mixed-endian"; - } else { - order_s = " unknown-byte-order"; - } - } else { - order_s = ""; - } - - /* Print size and byte order on first line, precision and padding on - * subsequent lines. */ - HDfprintf(rawoutstream, "%lu-bit%s floating-point", - (unsigned long)(8*H5Tget_size(type)), order_s); - display_precision(type, ind); - - /* Print sizes, locations, and other information about each field */ - H5Tget_fields (type, &spos, &epos, &esize, &mpos, &msize); - ebias = H5Tget_ebias(type); - norm = H5Tget_norm(type); - switch (norm) { - case H5T_NORM_IMPLIED: - norm_s = ", msb implied"; - break; - case H5T_NORM_MSBSET: - norm_s = ", msb always set"; - break; - case H5T_NORM_NONE: - norm_s = ", no normalization"; - break; - case H5T_NORM_ERROR: - norm_s = ", unknown normalization"; - break; - default: - ; - break; - } - HDfprintf(rawoutstream, "\n%*s(significant for %lu bit%s at bit %lu%s)", ind, "", - (unsigned long)msize, 1==msize?"":"s", (unsigned long)mpos, - norm_s); - HDfprintf(rawoutstream, "\n%*s(exponent for %lu bit%s at bit %lu, bias is 0x%lx)", - ind, "", (unsigned long)esize, 1==esize?"":"s", - (unsigned long)epos, (unsigned long)ebias); - HDfprintf(rawoutstream, "\n%*s(sign bit at %lu)", ind, "", (unsigned long)spos); - - /* Display internal padding */ - if (1+esize+msize0); - super = H5Tget_super(type); - HDfprintf(rawoutstream, "enum "); - display_type(super, ind+4); - HDfprintf(rawoutstream, " {"); - - /* Determine what data type to use for the native values. To simplify - * things we entertain three possibilities: - * 1. long long -- the largest native signed integer - * 2. unsigned long long -- the largest native unsigned integer - * 3. raw format */ - if (H5Tget_size(type)<=sizeof(long long)) { - dst_size = sizeof(long long); - if (H5T_SGN_NONE==H5Tget_sign(type)) { - native = H5T_NATIVE_ULLONG; - } else { - native = H5T_NATIVE_LLONG; - } - } else { - dst_size = H5Tget_size(type); - } - - /* Get the names and raw values of all members */ - name = HDcalloc(nmembs, sizeof(char*)); - value = (unsigned char *)HDcalloc(nmembs, MAX(H5Tget_size(type), dst_size)); - for (i=0; i0) H5Tconvert(super, native, nmembs, value, NULL, H5P_DEFAULT); - - /* Sort members by increasing value */ - /*not implemented yet*/ - - /* Print members */ - for (i=0; i", ind+4, ""); - HDfprintf(rawoutstream, "\n%*s}", ind, ""); - return TRUE; -} - - -/*------------------------------------------------------------------------- - * Function: display_string_type - * - * Purpose: Print information about a string data type. - * - * Return: Success: TRUE - * - * Failure: FALSE, nothing printed - * - * Programmer: Robb Matzke - * Thursday, November 5, 1998 - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -static hbool_t -display_string_type(hid_t type, int UNUSED ind) -{ - H5T_str_t pad; - const char *pad_s=NULL; - H5T_cset_t cset; - const char *cset_s=NULL; - - if (H5T_STRING!=H5Tget_class(type)) return FALSE; - - /* Padding */ - pad = H5Tget_strpad(type); - switch (pad) { - case H5T_STR_NULLTERM: - pad_s = "null-terminated"; - break; - case H5T_STR_NULLPAD: - pad_s = "null-padded"; - break; - case H5T_STR_SPACEPAD: - pad_s = "space-padded"; - break; - case H5T_STR_RESERVED_3: - case H5T_STR_RESERVED_4: - case H5T_STR_RESERVED_5: - case H5T_STR_RESERVED_6: - case H5T_STR_RESERVED_7: - case H5T_STR_RESERVED_8: - case H5T_STR_RESERVED_9: - case H5T_STR_RESERVED_10: - case H5T_STR_RESERVED_11: - case H5T_STR_RESERVED_12: - case H5T_STR_RESERVED_13: - case H5T_STR_RESERVED_14: - case H5T_STR_RESERVED_15: - case H5T_STR_ERROR: - pad_s = "unknown-format"; - break; - default: - ; - break; - } - - /* Character set */ - cset = H5Tget_cset(type); - switch (cset) { - case H5T_CSET_ASCII: - cset_s = "ASCII"; - break; - case H5T_CSET_UTF8: - cset_s = "UTF-8"; - break; - case H5T_CSET_RESERVED_2: - case H5T_CSET_RESERVED_3: - case H5T_CSET_RESERVED_4: - case H5T_CSET_RESERVED_5: - case H5T_CSET_RESERVED_6: - case H5T_CSET_RESERVED_7: - case H5T_CSET_RESERVED_8: - case H5T_CSET_RESERVED_9: - case H5T_CSET_RESERVED_10: - case H5T_CSET_RESERVED_11: - case H5T_CSET_RESERVED_12: - case H5T_CSET_RESERVED_13: - case H5T_CSET_RESERVED_14: - case H5T_CSET_RESERVED_15: - case H5T_CSET_ERROR: - cset_s = "unknown-character-set"; - break; - default: - ; - break; - } - - if (H5Tis_variable_str(type)) { - HDfprintf(rawoutstream, "variable-length"); - } else { - HDfprintf(rawoutstream, "%lu-byte", (unsigned long)H5Tget_size(type)); - } - HDfprintf(rawoutstream, " %s %s string", pad_s, cset_s); - return TRUE; -} - - -/*------------------------------------------------------------------------- - * Function: display_reference_type - * - * Purpose: Prints information about a reference data type. - * - * Return: Success: TRUE - * - * Failure: FALSE, nothing printed - * - * Programmer: Robb Matzke - * Thursday, November 5, 1998 - * - * Modifications: - * Robb Matzke, 1999-06-04 - * Knows about object and dataset region references. - * - *------------------------------------------------------------------------- - */ -static hbool_t -display_reference_type(hid_t type, int UNUSED ind) -{ - if (H5T_REFERENCE!=H5Tget_class(type)) return FALSE; - - if (H5Tequal(type, H5T_STD_REF_OBJ)==TRUE) { - HDfprintf(rawoutstream, "object reference"); - } else if (H5Tequal(type, H5T_STD_REF_DSETREG)==TRUE) { - HDfprintf(rawoutstream, "dataset region reference"); - } else { - HDfprintf(rawoutstream, "%lu-byte unknown reference", - (unsigned long)H5Tget_size(type)); - } - - return TRUE; -} - - -/*------------------------------------------------------------------------- - * Function: display_opaque_type - * - * Purpose: Prints information about an opaque data type. - * - * Return: Success: TRUE - * - * Failure: FALSE, nothing printed - * - * Programmer: Robb Matzke - * Monday, June 7, 1999 - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -static hbool_t -display_opaque_type(hid_t type, int ind) -{ - char *tag; - size_t size; - - if (H5T_OPAQUE!=H5Tget_class(type)) return FALSE; - - size = H5Tget_size(type); - HDfprintf(rawoutstream, "%lu-byte opaque type", (unsigned long)size); - if ((tag=H5Tget_tag(type))) { - HDfprintf(rawoutstream, "\n%*s(tag = \"", ind, ""); - display_string(rawoutstream, tag, FALSE); - HDfprintf(rawoutstream, "\")"); - HDfree(tag); - } - return TRUE; -} - - -/*------------------------------------------------------------------------- - * Function: display_vlen_type - * - * Purpose: Print information about a variable-length type - * - * Return: Success: TRUE - * - * Failure: FALSE - * - * Programmer: Robb Matzke - * Friday, December 1, 2000 - * - * Modifications: - *------------------------------------------------------------------------- - */ -static hbool_t -display_vlen_type(hid_t type, int ind) -{ - hid_t super; - - if (H5T_VLEN!=H5Tget_class(type)) return FALSE; - - HDfprintf(rawoutstream, "variable length of\n%*s", ind+4, ""); - super = H5Tget_super(type); - display_type(super, ind+4); - H5Tclose(super); - return TRUE; -} - - -/*--------------------------------------------------------------------------- - * Purpose: Print information about an array type - * - * Return: Success: TRUE - * - * Failure: FALSE - * - * Programmer: Robb Matzke - * Thursday, January 31, 2002 - * - * Modifications: - *--------------------------------------------------------------------------- - */ -static hbool_t -display_array_type(hid_t type, int ind) -{ - hid_t super; - int ndims, i; - hsize_t *dims=NULL; - - if (H5T_ARRAY!=H5Tget_class(type)) return FALSE; - ndims = H5Tget_array_ndims(type); - if (ndims) { - dims = (hsize_t *)HDmalloc(ndims*sizeof(dims[0])); - H5Tget_array_dims2(type, dims); - - /* Print dimensions */ - for (i=0; i1) { - order = H5Tget_order(type); - if (H5T_ORDER_LE==order) { - order_s = " little-endian"; - } else if (H5T_ORDER_BE==order) { - order_s = " big-endian"; - } else if (H5T_ORDER_VAX==order) { - order_s = " mixed-endian"; - } else { - order_s = "unknown-byte-order"; - } - } else { - order_s = ""; - } - - HDfprintf(rawoutstream, "%lu-bit%s bitfield", - (unsigned long)(8*H5Tget_size(type)), order_s); - display_precision(type, ind); - return TRUE; -} - - -/*------------------------------------------------------------------------- - * Function: display_type - * - * Purpose: Prints a data type definition. The definition is printed - * without any leading space or trailing line-feed (although - * there might be line-feeds inside the type definition). The - * first line is assumed to have IND characters before it on - * the same line (printed by the caller). - * - * Return: void - * - * Programmer: Robb Matzke - * Thursday, November 5, 1998 - * - * Modifications: - * Robb Matzke, 1999-06-11 - * Prints the OID of shared data types. - * - *------------------------------------------------------------------------- - */ -static void -display_type(hid_t type, int ind) -{ - H5T_class_t data_class = H5Tget_class(type); - - /* Bad data type */ - if (type<0) { - HDfprintf(rawoutstream, ""); - return; - } - - /* Shared? If so then print the type's OID */ - if(H5Tcommitted(type)) { - H5O_info_t oi; - - if(H5Oget_info(type, &oi) >= 0) - HDfprintf(rawoutstream, "shared-%lu:"H5_PRINTF_HADDR_FMT" ", - oi.fileno, oi.addr); - else - HDfprintf(rawoutstream, "shared "); - } /* end if */ - - /* Print the type */ - if((!simple_output_g && display_native_type(type, ind)) || - display_ieee_type(type, ind) || - display_int_type(type, ind) || - display_float_type(type, ind) || - display_cmpd_type(type, ind) || - display_enum_type(type, ind) || - display_string_type(type, ind) || - display_reference_type(type, ind) || - display_vlen_type(type, ind) || - display_array_type(type, ind) || - display_opaque_type(type, ind) || - display_bitfield_type(type, ind)) - return; - - /* Unknown type */ - HDfprintf(rawoutstream, "%lu-byte class-%u unknown", - (unsigned long)H5Tget_size(type), (unsigned)data_class); -} - /*------------------------------------------------------------------------- * Function: print_string @@ -1329,49 +264,50 @@ print_string(h5tools_str_t *buffer, const char *s, hbool_t escape_spaces) for (/*void*/; s && *s; s++) { switch (*s) { case '"': - h5tools_str_append(buffer, "\\\""); + if (buffer) h5tools_str_append(buffer, "\\\""); nprint += 2; break; case '\\': - h5tools_str_append(buffer, "\\\\"); + if (buffer) h5tools_str_append(buffer, "\\\\"); nprint += 2; break; case '\b': - h5tools_str_append(buffer, "\\b"); + if (buffer) h5tools_str_append(buffer, "\\b"); nprint += 2; break; case '\f': - h5tools_str_append(buffer, "\\f"); + if (buffer) h5tools_str_append(buffer, "\\f"); nprint += 2; break; case '\n': - h5tools_str_append(buffer, "\\n"); + if (buffer) h5tools_str_append(buffer, "\\n"); nprint += 2; break; case '\r': - h5tools_str_append(buffer, "\\r"); + if (buffer) h5tools_str_append(buffer, "\\r"); nprint += 2; break; case '\t': - h5tools_str_append(buffer, "\\t"); + if (buffer) h5tools_str_append(buffer, "\\t"); nprint += 2; break; case ' ': if (escape_spaces) { - h5tools_str_append(buffer, "\\ "); + if (buffer) h5tools_str_append(buffer, "\\ "); nprint += 2; } else { - h5tools_str_append(buffer, " "); + if (buffer) h5tools_str_append(buffer, " "); nprint++; } break; default: if (isprint((int)*s)) { - h5tools_str_append(buffer, "%c", *s); + if (buffer) h5tools_str_append(buffer, "%c", *s); nprint++; - } else { - h5tools_str_append(buffer, "\\%03o", *((const unsigned char*)s)); + } + else { + if (buffer) h5tools_str_append(buffer, "\\%03o", *((const unsigned char*)s)); nprint += 4; } break; @@ -2514,10 +1450,10 @@ dump_dataset_values(hid_t dset) } H5Tclose(f_type); - - HDfprintf(rawoutstream, "\n"); h5tools_str_close(&buffer); + + HDfprintf(rawoutstream, "\n"); } @@ -2694,18 +1630,15 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t UNUSED *ainfo, HDfree(buf); H5Tclose(p_type); } /* end if */ - HDfprintf(rawoutstream, "\n"); H5Sclose(space); H5Tclose(type); H5Aclose(attr); } - else { - HDfprintf(rawoutstream, "\n"); - } - h5tools_str_close(&buffer); + HDfprintf(rawoutstream, "\n"); + return 0; } @@ -2738,26 +1671,41 @@ dataset_list1(hid_t dset) int ndims; /* dimensionality */ H5S_class_t space_type; /* type of dataspace */ int i; + hsize_t curr_pos = 0; /* total data element position */ + h5tool_link_info_t lnk_info; + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ + h5tool_format_t *info = &ls_dataformat; + h5tool_format_t outputformat; + + HDmemset(&ctx, 0, sizeof(ctx)); + HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + + h5tools_str_reset(&buffer); /* Information that goes on the same row as the name. The name has * already been printed. */ space = H5Dget_space(dset); space_type = H5Sget_simple_extent_type(space); ndims = H5Sget_simple_extent_dims(space, cur_size, max_size); - printf (" {"); + h5tools_str_append(&buffer, " {"); for (i=0; i0) { - HDfprintf(rawoutstream, "/%Hu", max_size[i]); + h5tools_str_append(&buffer, "/%s", "Inf"); + } + else if (max_size[i]!=cur_size[i] || verbose_g>0) { + h5tools_str_append(&buffer, "/"HSIZE_T_FORMAT, max_size[i]); } } - if (space_type==H5S_SCALAR) HDfprintf(rawoutstream, "SCALAR"); - else if (space_type==H5S_NULL) HDfprintf(rawoutstream, "NULL"); - HDfputc('}', rawoutstream); + if (space_type==H5S_SCALAR) h5tools_str_append(&buffer, "SCALAR"); + else if (space_type==H5S_NULL) h5tools_str_append(&buffer, "NULL"); + h5tools_str_append(&buffer, "}"); + h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); H5Sclose (space); + h5tools_str_close(&buffer); + return 0; } @@ -2801,6 +1749,16 @@ dataset_list2(hid_t dset, const char UNUSED *name) double utilization; /* percent utilization of storage */ H5T_class_t tclass; /* datatype class identifier */ int i; + hsize_t curr_pos = 0; /* total data element position */ + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ + h5tool_format_t *info = &ls_dataformat; + h5tool_format_t outputformat; + + HDmemset(&ctx, 0, sizeof(ctx)); + HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + + h5tools_str_reset(&buffer); if(verbose_g > 0) { dcpl = H5Dget_create_plist(dset); @@ -2812,85 +1770,87 @@ dataset_list2(hid_t dset, const char UNUSED *name) hsize_t chsize[64]; /* chunk size in elements */ ndims = H5Pget_chunk(dcpl, NELMTS(chsize), chsize/*out*/); - HDfprintf(rawoutstream, " %-10s {", "Chunks:"); + h5tools_str_append(&buffer, " %-10s {", "Chunks:"); total = H5Tget_size(type); for (i=0; i0) { utilization = (total*100.0)/used; - HDfprintf(rawoutstream, ", %1.2f%% utilization", utilization); + h5tools_str_append(&buffer, ", %1.2f%% utilization", utilization); } } - HDfputc('\n', rawoutstream); + h5tools_str_append(&buffer, "\n"); /* Print information about external strorage */ if((nf = H5Pget_external_count(dcpl)) > 0) { for(i = 0, max_len = 0; i < nf; i++) { H5Pget_external(dcpl, (unsigned)i, sizeof(f_name), f_name, NULL, NULL); - n = display_string(NULL, f_name, TRUE); + n = print_string(NULL, f_name, TRUE); max_len = MAX(max_len, n); } /* end for */ - HDfprintf(rawoutstream, " %-10s %d external file%s\n", + h5tools_str_append(&buffer, " %-10s %d external file%s\n", "Extern:", nf, 1==nf?"":"s"); - HDfprintf(rawoutstream, " %4s %10s %10s %10s %s\n", + h5tools_str_append(&buffer, " %4s %10s %10s %10s %s\n", "ID", "DSet-Addr", "File-Addr", "Bytes", "File"); - HDfprintf(rawoutstream, " %4s %10s %10s %10s ", + h5tools_str_append(&buffer, " %4s %10s %10s %10s ", "----", "----------", "----------", "----------"); - for (i=0; iline_ncols, 0, 0); /* Print address information */ if(address_g) @@ -2926,6 +1887,8 @@ dataset_list2(hid_t dset, const char UNUSED *name) H5Pclose(dcpl); } /* end if */ + h5tools_str_close(&buffer); + if(data_g) dump_dataset_values(dset); @@ -2954,9 +1917,23 @@ static herr_t datatype_list2(hid_t type, const char UNUSED *name) { if (verbose_g>0) { - HDfprintf(rawoutstream, " %-10s ", "Type:"); - display_type(type, 15); - HDfprintf(rawoutstream, "\n"); + hsize_t curr_pos = 0; /* total data element position */ + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ + h5tool_format_t *info = &ls_dataformat; + h5tool_format_t outputformat; + + HDmemset(&ctx, 0, sizeof(ctx)); + HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + + h5tools_str_reset(&buffer); + + h5tools_str_append(&buffer, " %-10s ", "Type:"); + print_type(&buffer, type, 15); + h5tools_str_append(&buffer, "\n"); + h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); + + h5tools_str_close(&buffer); } return 0; } @@ -2979,29 +1956,43 @@ datatype_list2(hid_t type, const char UNUSED *name) static herr_t list_obj(const char *name, const H5O_info_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; + H5O_type_t obj_type = oinfo->type; /* Type of the object */ + iter_t *iter = (iter_t*)_iter; + hsize_t curr_pos = 0; /* total data element position */ + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ + h5tool_format_t *info = &ls_dataformat; + h5tool_format_t outputformat; + + HDmemset(&ctx, 0, sizeof(ctx)); + HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + + h5tools_str_reset(&buffer); /* Print the link's name, either full name or base name */ if(!iter->symlink_target) - display_obj_name(rawoutstream, iter, name, ""); + print_obj_name(&buffer, iter, name, ""); /* Check object information */ if(oinfo->type < 0 || oinfo->type >= H5O_TYPE_NTYPES) { - HDfprintf(rawoutstream, "Unknown type(%d)", (int)oinfo->type); + h5tools_str_append(&buffer, "Unknown type(%d)", (int)oinfo->type); obj_type = H5O_TYPE_UNKNOWN; } if(iter->symlink_target) - HDfputc('{', rawoutstream); + h5tools_str_append(&buffer, "{"); if(obj_type >= 0 && dispatch_g[obj_type].name) - HDfputs(dispatch_g[obj_type].name, rawoutstream); + h5tools_str_append(&buffer, "%s", dispatch_g[obj_type].name); + h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); /* Check if we've seen this object before */ if(first_seen) { - HDfprintf(rawoutstream, ", same as "); - display_string(rawoutstream, first_seen, TRUE); - if(!iter->symlink_target) - HDfprintf(rawoutstream, "\n"); + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, ", same as "); + print_string(&buffer, first_seen, TRUE); + if(!iter->symlink_target) { + h5tools_str_append(&buffer, "\n"); + } + h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); } /* end if */ else { hid_t obj = (-1); /* ID of object opened */ @@ -3010,15 +2001,20 @@ list_obj(const char *name, const H5O_info_t *oinfo, const char *first_seen, void * then return right away. */ if(obj_type >= 0 && (obj = H5Oopen(iter->fid, name, H5P_DEFAULT)) < 0) { - HDfprintf(rawoutstream, " *ERROR*\n"); + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, " *ERROR*\n"); + h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); goto done; } /* end if */ /* List the first line of information for the object. */ if(obj_type >= 0 && dispatch_g[obj_type].list1) (dispatch_g[obj_type].list1)(obj); - if(!iter->symlink_target || (verbose_g > 0)) - HDfputc('\n', rawoutstream); + if(!iter->symlink_target || (verbose_g > 0)) { + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "\n"); + h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); + } /* Show detailed information about the object, beginning with information * which is common to all objects. */ @@ -3032,8 +2028,10 @@ 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 */ - HDfprintf(rawoutstream, " %-10s %lu:"H5_PRINTF_HADDR_FMT"\n", "Location:", oinfo->fileno, oinfo->addr); - HDfprintf(rawoutstream, " %-10s %u\n", "Links:", (unsigned)oinfo->rc); + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, " %-10s %lu:"H5_PRINTF_HADDR_FMT"\n", "Location:", oinfo->fileno, oinfo->addr); + h5tools_str_append(&buffer, " %-10s %u\n", "Links:", (unsigned)oinfo->rc); + h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); /* Modification time */ if(oinfo->mtime > 0) { @@ -3046,7 +2044,9 @@ list_obj(const char *name, const H5O_info_t *oinfo, const char *first_seen, void tm = HDlocaltime(&(oinfo->mtime)); if(tm) { HDstrftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S %Z", tm); - HDfprintf(rawoutstream, " %-10s %s\n", "Modified:", buf); + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, " %-10s %s\n", "Modified:", buf); + h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); } /* end if */ } /* end if */ @@ -3062,9 +2062,11 @@ list_obj(const char *name, const H5O_info_t *oinfo, const char *first_seen, void cmt_bufsize = H5Oget_comment(obj, comment, cmt_bufsize); if(cmt_bufsize > 0) { comment[cmt_bufsize] = 0; - HDfprintf(rawoutstream, " %-10s \"", "Comment:"); - display_string(rawoutstream, comment, FALSE); - HDfputs("\"\n", rawoutstream); + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, " %-10s \"", "Comment:"); + print_string(&buffer, comment, FALSE); + h5tools_str_append(&buffer, "\"\n"); + h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); } /* end if */ HDfree(comment); } @@ -3082,9 +2084,13 @@ list_obj(const char *name, const H5O_info_t *oinfo, const char *first_seen, void done: if(iter->symlink_target) { - HDfputs("}\n", rawoutstream); + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "}\n"); + h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); iter->symlink_target = FALSE; } + h5tools_str_close(&buffer); + return 0; } /* end list_obj() */ @@ -3110,7 +2116,17 @@ list_lnk(const char *name, const H5L_info_t *linfo, void *_iter) char *buf=NULL; iter_t *iter = (iter_t*)_iter; int ret; + hsize_t curr_pos = 0; /* total data element position */ h5tool_link_info_t lnk_info; + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ + h5tool_format_t *info = &ls_dataformat; + h5tool_format_t outputformat; + + HDmemset(&ctx, 0, sizeof(ctx)); + HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + + h5tools_str_reset(&buffer); /* init linkinfo struct */ HDmemset(&lnk_info, 0, sizeof(h5tool_link_info_t)); @@ -3120,7 +2136,7 @@ list_lnk(const char *name, const H5L_info_t *linfo, void *_iter) lnk_info.opt.msg_mode=1; /* Print the link's name, either full name or base name */ - display_obj_name(rawoutstream, iter, name, ""); + print_obj_name(&buffer, iter, name, ""); switch(linfo->type) { case H5L_TYPE_SOFT: @@ -3135,20 +2151,24 @@ list_lnk(const char *name, const H5L_info_t *linfo, void *_iter) else if (no_dangling_link_g && ret == 0) iter->symlink_list->dangle_link = TRUE; - HDfputs("Soft Link {", rawoutstream); - HDfputs(buf, rawoutstream); - HDfputc('}', rawoutstream); + h5tools_str_append(&buffer, "Soft Link {"); + h5tools_str_append(&buffer, buf); + h5tools_str_append(&buffer, "}"); + h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); if(follow_symlink_g) { hbool_t orig_grp_literal = grp_literal_g; - HDfputc(' ', rawoutstream); + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, " "); /* Check if we have already seen this softlink */ if(symlink_is_visited(iter->symlink_list, linfo->type, NULL, buf)) { - HDfputs("{Already Visited}\n", rawoutstream); + h5tools_str_append(&buffer, "{Already Visited}\n"); + h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); goto done; } + h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); /* Add this link to the list of seen softlinks */ if(symlink_visit_add(iter->symlink_list, linfo->type, NULL, buf) < 0) @@ -3171,8 +2191,11 @@ list_lnk(const char *name, const H5L_info_t *linfo, void *_iter) grp_literal_g = orig_grp_literal; } - else - HDfputc('\n', rawoutstream); + else { + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "\n"); + h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); + } break; @@ -3196,27 +2219,31 @@ list_lnk(const char *name, const H5L_info_t *linfo, void *_iter) if(H5Lunpack_elink_val(buf, linfo->u.val_size, NULL, &filename, &path) < 0) goto done; - HDfputs("External Link {", rawoutstream); - HDfputs(filename, rawoutstream); - HDfputc('/', rawoutstream); + h5tools_str_append(&buffer, "External Link {"); + h5tools_str_append(&buffer, filename); + h5tools_str_append(&buffer, "/"); if(*path != '/') - HDfputc('/', rawoutstream); - HDfputs(path, rawoutstream); - HDfputc('}', rawoutstream); + h5tools_str_append(&buffer, "/"); + h5tools_str_append(&buffer, path); + h5tools_str_append(&buffer, "}"); + h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); /* Recurse through the external link */ /* keep the follow_elink_g for backward compatibility with -E */ if(follow_link) { hbool_t orig_grp_literal = grp_literal_g; - HDfputc(' ', rawoutstream); + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, " "); /* Check if we have already seen this elink */ if(symlink_is_visited(iter->symlink_list, linfo->type, filename, path)) { - HDfputs("{Already Visited}\n", rawoutstream); + h5tools_str_append(&buffer, "{Already Visited}\n"); + h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); goto done; } + h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); /* Add this link to the list of seen elinks */ if(symlink_visit_add(iter->symlink_list, linfo->type, filename, path) < 0) @@ -3242,17 +2269,19 @@ list_lnk(const char *name, const H5L_info_t *linfo, void *_iter) grp_literal_g = orig_grp_literal; } else - HDfputc('\n', rawoutstream); - + HDfprintf(rawoutstream, "\n"); } break; default: - HDfputs("UD Link {cannot follow UD links}\n", rawoutstream); + h5tools_str_append(&buffer, "UD Link {cannot follow UD links}\n"); + h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); break; } /* end switch */ done: + h5tools_str_close(&buffer); + if (buf) HDfree(buf); return 0; @@ -3277,25 +2306,40 @@ done: static herr_t visit_obj(hid_t file, const char *oname, iter_t *iter) { + int retval = 0; H5O_info_t oi; /* Information for object */ + hsize_t curr_pos = 0; /* total data element position */ + h5tool_link_info_t lnk_info; + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ + h5tool_format_t *info = &ls_dataformat; + h5tool_format_t outputformat; + + HDmemset(&ctx, 0, sizeof(ctx)); + HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + + h5tools_str_reset(&buffer); /* Retrieve info for object to list */ if(H5Oget_info_by_name(file, oname, &oi, H5P_DEFAULT) < 0) { if(iter->symlink_target) { - HDfputs("{**NOT FOUND**}\n", rawoutstream); + h5tools_str_append(&buffer, "{**NOT FOUND**}\n"); iter->symlink_target = FALSE; } else - display_obj_name(rawoutstream, iter, oname, "**NOT FOUND**"); - return -1; + print_obj_name(&buffer, iter, oname, "**NOT FOUND**"); + h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); + retval = -1; + goto done; } /* end if */ /* Check for group iteration */ if(H5O_TYPE_GROUP == oi.type && !grp_literal_g) { /* Get ID for group */ if(!iter->symlink_target && (iter->gid = H5Gopen2(file, oname, H5P_DEFAULT)) < 0) { - HDfprintf(rawerrorstream, "%s: unable to open '%s' as group\n", iter->fname, oname); - return 0; /* Previously "continue", when this code was in main(). + h5tools_str_append(&buffer, "%s: unable to open '%s' as group\n", iter->fname, oname); + h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); + goto done; /* Previously "continue", when this code was in main(). * We don't "continue" here in order to close the file * and free the file name properly. */ } /* end if */ @@ -3319,7 +2363,10 @@ visit_obj(hid_t file, const char *oname, iter_t *iter) list_obj(oname, &oi, NULL, iter); } /* end else */ - return 0; +done: + h5tools_str_close(&buffer); + + return retval; } @@ -3772,7 +2819,19 @@ main(int argc, const char *argv[]) if(HDstrcmp(oname, root_name)) { /* Check the type of link given */ if(H5Lget_info(file, oname, &li, H5P_DEFAULT) < 0) { - display_obj_name(rawoutstream, &iter, oname, "**NOT FOUND**"); + hsize_t curr_pos = 0; /* total data element position */ + h5tool_link_info_t lnk_info; + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ + h5tool_format_t *info = &ls_dataformat; + h5tool_format_t outputformat; + + HDmemset(&ctx, 0, sizeof(ctx)); + HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + + h5tools_str_reset(&buffer); + print_obj_name(&buffer, &iter, oname, "**NOT FOUND**"); + h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); leave(EXIT_FAILURE); } /* end if */ } /* end if */ -- cgit v0.12 From 196080ac0fd0df2417bf79481e1ffd47d1b86e89 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 1 Mar 2012 15:34:32 -0500 Subject: [svn-r22010] Variable used to determine if the MS Visual Studio compiler is being used incorrectly limited setting the H5_HAVE_VISUAL_STUDIO define to only when the IDE was being used to build on Windows. Tested: windows --- config/cmake/ConfigureChecks.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index 8f9ffb9..963152c 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -132,9 +132,9 @@ IF (WIN32) SET (H5_HAVE_WIN32_API 1) IF (NOT UNIX AND NOT CYGWIN AND NOT MINGW) SET (WINDOWS 1) - IF (MSVC_IDE) + IF (MSVC) SET (H5_HAVE_VISUAL_STUDIO 1) - ENDIF (MSVC_IDE) + ENDIF (MSVC) ENDIF (NOT UNIX AND NOT CYGWIN AND NOT MINGW) ENDIF (WIN32) -- cgit v0.12 From b994a10148512b6f0ea570818f7273f6322dfde3 Mon Sep 17 00:00:00 2001 From: Jonathan Kim Date: Thu, 1 Mar 2012 17:59:46 -0500 Subject: [svn-r22012] Purpose: Task for HDFFV-7862 - Select data by chunk direction to improve performance in h5repack Description: h5repack sometimes became very slow when handling big chunked datasets in certain cases. (when chunk boundary doesn't match with a hyperslab boundary.) The main issue was from figuring out a hypeslab without considering chunk boundary to read from and write to such datasets. The update was made to figure out a better hyperslab unit with considering chunk boundary to improve performance for such cases prior to the update. Tested: jam (linux32-LE), koala (linux64-LE), ostrich (linuxppc64-BE), tejeda (mac32-LE), linew (solaris-BE), Windows --- release_docs/RELEASE.txt | 6 + tools/h5repack/h5repack_copy.c | 326 ++++++++++++++++++++++++++------ tools/lib/h5tools_utils.c | 4 +- tools/testfiles/thyperslab.ddl | 412 ++++++++++++++++++++--------------------- 4 files changed, 483 insertions(+), 265 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index b9b28d1..b4c09f5 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -241,6 +241,12 @@ New Features Tools: ------ + - h5repack: Improved performance for hanlding big chunked dataset + (size > 128MB). It would perform much better prior to the + improvement, especially for cases that chunk dimentions + looks like "1024x5x1" (compare to "1x5x1024"). When bigger numbers + are toward front and smaller number is toward back in chunk + dimentions. - h5dump: Added new option --no-compact-subset. This option will not interpret the '[' character as starting the compact form of subsetting. This is useful when the "h5dump error: unable to diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c index d96e08b..55cf932 100644 --- a/tools/h5repack/h5repack_copy.c +++ b/tools/h5repack/h5repack_copy.c @@ -53,6 +53,7 @@ * local functions *------------------------------------------------------------------------- */ +static int Get_hyperslab (hid_t dcpl_id, int rank_dset, hsize_t dims_dset[], size_t size_datum, hsize_t dims_hslab[], hsize_t * hslab_nbytes_p); static void print_dataset_info(hid_t dcpl_id,char *objname,double per, int pr); static int do_copy_objects(hid_t fidin,hid_t fidout,trav_table_t *travt,pack_opt_t *options); static int copy_user_block(const char *infile, const char *outfile, hsize_t size); @@ -491,6 +492,184 @@ out: } /*------------------------------------------------------------------------- +* Function: Get_hyperslab +* +* Purpose: Calulate a hyperslab from a dataset for higher performance. +* The size of hyperslab is limitted by H5TOOLS_BUFSIZE. +* Return the hyperslab dimentions and size in byte. +* +* Return: 0 - SUCCEED, -1 FAILED +* +* Parameters: +* dcpl_id : [IN] dataset creation property. +* rank_dset : [IN] dataset rank +* dims_dset[] : [IN] dataset dimentions +* size_datum : [IN] size of a data element in byte +* dims_hslab[] : [OUT] calculated hyperslab dimentions +* * hslab_nbytes_p : [OUT] total byte of the hyperslab +* +* Programmer: Jonathan Kim +* Date: Feburary, 2012 +* Update: +* The hyperslab calucation would be depend on if the dataset is chunked +* or not. +* +* There care 3 conditions to cover: +* 1. If chunked and a chunk fits in buffer, each chunk would be a unit of +* collection and the boundary would be dataset's dims. +* 2. If chunked but a chunk doesn't fit in buffer, each data element would +* be a unit of collection and the boundary would be the chunk itself. +* 3. If not chunked, each data element would be a unit of collection and +* the boundary would be dataset's dims. +* +* The calulation starts from the last dimention (h5dump dims output). +* +* Note: +* Added for JIRA HDFFV-7862. +*-----------------------------------------*/ + +int Get_hyperslab (hid_t dcpl_id, int rank_dset, hsize_t dims_dset[], + size_t size_datum, + hsize_t dims_hslab[], hsize_t * hslab_nbytes_p) +{ + int status = 0; + int k; + H5D_layout_t dset_layout; + int rank_chunk; + hsize_t dims_chunk[H5S_MAX_RANK]; + hsize_t size_chunk=1; + hsize_t nchunk_fit; /* number of chunks that fits in hyperslab buffer (H5TOOLS_BUFSIZE) */ + hsize_t ndatum_fit; /* number of dataum that fits in hyperslab buffer (H5TOOLS_BUFSIZE) */ + hsize_t chunk_dims_map[H5S_MAX_RANK]; /* mapped chunk dimentions */ + hsize_t hs_dims_map[H5S_MAX_RANK]; /* mapped hyperslab dimentions */ + hsize_t hslab_nbytes; /* size of hyperslab in byte */ + + /* init to set as size of a data element */ + hslab_nbytes = size_datum; + + /* get layout of dataset */ + dset_layout = H5Pget_layout(dcpl_id); + + /* if dataset is chunked */ + if ( dset_layout == H5D_CHUNKED ) + { + /* get chunk dims */ + rank_chunk = H5Pget_chunk(dcpl_id, rank_dset, dims_chunk); + if (rank_chunk < 0) + { + status = -1; + goto out; + } + + for (k = rank_dset; k > 0; --k) + size_chunk *= dims_chunk[k-1]; + + /* figure out how many chunks can fit in the hyperslab buffer */ + nchunk_fit = (H5TOOLS_BUFSIZE / size_datum) / size_chunk; + + + /* 1. if a chunk fit in hyperslab buffer */ + if (nchunk_fit >= 1) + { + /* Calulate a hyperslab that contains as many chunks that can fit + * in hyperslab buffer. Hyperslab will be increased starting from + * the last dimention of the dataset (see h5dump's dims output). + * The calculation boundary is dataset dims. + * In the loop, used mapping from a datum to a chunk to figure out + * chunk based hyperslab. + */ + for (k = rank_dset; k > 0; --k) + { + /* map dataset dimentions with a chunk dims */ + chunk_dims_map[k-1]= dims_dset[k-1] / dims_chunk[k-1]; + + /* if reminder exist, increse by 1 to cover partial edge chunks */ + if (dims_dset[k-1] % dims_chunk[k-1] > 0) + chunk_dims_map[k-1]++; + + /* get mapped hyperslab dims */ + hs_dims_map[k-1] = MIN (nchunk_fit, chunk_dims_map[k-1]); + + /* prepare next round */ + nchunk_fit = nchunk_fit / chunk_dims_map[k-1]; + /* if a chunk is bigger than the rest of buffer */ + if (nchunk_fit == 0) + nchunk_fit=1; + + /* get hyperslab dimentions as unmapping to actual size */ + dims_hslab[k-1] = MIN( (hs_dims_map[k-1] * dims_chunk[k-1]), dims_dset[k-1]); + + /* calculate total size for the hyperslab */ + hslab_nbytes *= dims_hslab[k-1]; + } + } + /* 2. if a chunk is bigger than hyperslab buffer */ + else + { + /* Calulate a hyperslab that contains as many data elements that + * can fit in hyperslab buffer. Hyperslab will be increased + * starting from the last dimention of the chunk (see h5dump's dims + * output). + * The calculation boundary is a chunk dims. + */ + for (k = rank_dset; k > 0; --k) + { + ndatum_fit = H5TOOLS_BUFSIZE / hslab_nbytes; + + /* if a datum is bigger than rest of buffer */ + if ( ndatum_fit == 0) + ndatum_fit = 1; + /* get hyperslab dimentions within a chunk boundary */ + dims_hslab[k - 1] = MIN (dims_chunk[k-1], ndatum_fit); + + /* calculate total size for the hyperslab */ + hslab_nbytes *= dims_hslab[k - 1]; + + if (hslab_nbytes <= 0) + { + status = -1; + goto out; + } + } + } + } + /* 3. if dataset is not chunked */ + else + { + /* Calulate a hyperslab that contains as many data elements that can + * fit in hyperslab buffer. Hyperslab will be increased starting from + * the last dimention of the dataset (see h5dump's dims output). + * The calculation boundary is dataset dims. + */ + for (k = rank_dset; k > 0; --k) + { + ndatum_fit = H5TOOLS_BUFSIZE / hslab_nbytes; + + /* if a datum is bigger than rest of buffer */ + if ( ndatum_fit == 0) + ndatum_fit = 1; + /* get hyperslab dimentions within dataset boundary */ + dims_hslab[k - 1] = MIN(dims_dset[k - 1], ndatum_fit); + + /* calculate total size for the hyperslab */ + hslab_nbytes *= dims_hslab[k - 1]; + + if (hslab_nbytes <= 0) + { + status = -1; + goto out; + } + } + } + + /* pass out the hyperslab size*/ + *hslab_nbytes_p = hslab_nbytes; + +out: + return status; +} + +/*------------------------------------------------------------------------- * Function: do_copy_objects * * Purpose: duplicate all HDF5 objects in the file @@ -557,6 +736,30 @@ out: * * May, 1, 2008: Add a printing of the compression ratio of old size / new size * +* Feburary 2012: improve Read/Write by hyperslabs for big datasets. +* Programmer: Jonathan Kim +* +* A threshold of H5TOOLS_MALLOCSIZE is the limit upon which I/O hyperslab is done +* i.e., if the memory needed to read a dataset is greater than this limit, +* then hyperslab I/O is done instead of one operation I/O +* For each dataset, the memory needed is calculated according to +* +* memory needed = number of elements * size of each element +* +* if the memory needed is lower than H5TOOLS_MALLOCSIZE, then the following operations +* are done +* +* H5Dread( input_dataset ) +* H5Dwrite( output_dataset ) +* +* with all elements in the datasets selected. If the memory needed is greater than +* H5TOOLS_MALLOCSIZE, then the following operations are done instead: +* +* 1. figure out a hyperslab (dimentions) and size (refer to Get_hyperslab()). +* 2. Calculate the hyperslab selections as the selection is moving forward. +* Selection would be same as the hyperslab except for the remaining edge portion +* of the dataset. The code take care of the remaining portion if exist. +* *------------------------------------------------------------------------- */ @@ -573,7 +776,7 @@ int do_copy_objects(hid_t fidin, hid_t gcpl_out = -1; /* group creation property list */ hid_t type_in = -1; /* named type ID */ hid_t type_out = -1; /* named type ID */ - hid_t dcpl_id = -1; /* dataset creation property list ID */ + hid_t dcpl_in = -1; /* dataset creation property list ID */ hid_t dcpl_out = -1; /* dataset creation property list ID */ hid_t f_space_id = -1; /* file space ID */ hid_t ftype_id = -1; /* file type ID */ @@ -589,7 +792,7 @@ int do_copy_objects(hid_t fidin, int apply_s; /* flag for apply filter to small dataset sizes */ int apply_f; /* flag for apply filter to return error on H5Dcreate */ void *buf=NULL; /* buffer for raw data */ - void *sm_buf=NULL; /* buffer for raw data */ + void *hslab_buf=NULL; /* hyperslab buffer for raw data */ int has_filter; /* current object has a filter */ int req_filter; /* there was a request for a filter */ unsigned crt_order_flags; /* group creation order flag */ @@ -598,6 +801,7 @@ int do_copy_objects(hid_t fidin, int is_ref=0; htri_t is_named; + /*------------------------------------------------------------------------- * copy the suppplied object list *------------------------------------------------------------------------- @@ -760,9 +964,9 @@ int do_copy_objects(hid_t fidin, goto error; if((ftype_id = H5Dget_type(dset_in)) < 0) goto error; - if((dcpl_id = H5Dget_create_plist(dset_in)) < 0) + if((dcpl_in = H5Dget_create_plist(dset_in)) < 0) goto error; - if((dcpl_out = H5Pcopy(dcpl_id)) < 0) + if((dcpl_out = H5Pcopy(dcpl_in)) < 0) goto error; if((rank = H5Sget_simple_extent_ndims(f_space_id)) < 0) goto error; @@ -795,7 +999,7 @@ int do_copy_objects(hid_t fidin, * 2) the internal filters might be turned off *------------------------------------------------------------------------- */ - if (h5tools_canreadf((travt->objs[i].name),dcpl_id)==1) + if (h5tools_canreadf((travt->objs[i].name),dcpl_in)==1) { apply_s=1; apply_f=1; @@ -855,7 +1059,7 @@ int do_copy_objects(hid_t fidin, printf(" warning: could not create dataset <%s>. Applying original settings\n", travt->objs[i].name); - if((dset_out = H5Dcreate2(fidout, travt->objs[i].name, wtype_id, f_space_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT)) < 0) + if((dset_out = H5Dcreate2(fidout, travt->objs[i].name, wtype_id, f_space_id, H5P_DEFAULT, dcpl_in, H5P_DEFAULT)) < 0) goto error; apply_f = 0; } @@ -886,100 +1090,108 @@ int do_copy_objects(hid_t fidin, else /* possibly not enough memory, read/write by hyperslabs */ { size_t p_type_nbytes = msize; /*size of memory type */ - hsize_t p_nelmts = nelmts; /*total selected elmts */ + hsize_t p_nelmts = nelmts; /*total elements */ hsize_t elmtno; /*counter */ int carry; /*counter carry value */ unsigned int vl_data = 0; /*contains VL datatypes */ - /* stripmine info */ - hsize_t sm_size[H5S_MAX_RANK]; /*stripmine size */ - hsize_t sm_nbytes; /*bytes per stripmine */ - hsize_t sm_nelmts; /*elements per stripmine*/ - hid_t sm_space; /*stripmine data space */ - /* hyperslab info */ - hsize_t hs_offset[H5S_MAX_RANK];/*starting offset */ - hsize_t hs_size[H5S_MAX_RANK]; /*size this pass */ - hsize_t hs_nelmts; /*elements in request */ + hsize_t hslab_dims[H5S_MAX_RANK]; /*hyperslab dims */ + hsize_t hslab_nbytes; /*bytes per hyperslab */ + hsize_t hslab_nelmts; /*elements per hyperslab*/ + hid_t hslab_space; /*hyperslab data space */ + + /* hyperslab selection info */ + hsize_t hs_sel_offset[H5S_MAX_RANK];/* selection offset */ + hsize_t hs_sel_count[H5S_MAX_RANK]; /* selection count */ + hsize_t hs_select_nelmts; /* selected elements */ hsize_t zero[8]; /*vector of zeros */ int k; + H5D_layout_t dset_layout; + hid_t dcpl_tmp = -1; /* dataset creation property list ID */ /* check if we have VL data in the dataset's datatype */ if (H5Tdetect_class(wtype_id, H5T_VLEN) == TRUE) vl_data = TRUE; - /* - * determine the strip mine size and allocate a buffer. The strip mine is - * a hyperslab whose size is manageable. - */ - sm_nbytes = p_type_nbytes; - for (k = rank; k > 0; --k) + /* check first if writing dataset is chunked, + * if so use its chunk layout for better performance. */ + dset_layout = H5Pget_layout(dcpl_out); + if (dset_layout == H5D_CHUNKED) + dcpl_tmp = dcpl_out; /* writing dataset */ + else /* if reading dataset is chunked */ { - hsize_t size = H5TOOLS_BUFSIZE / sm_nbytes; - if ( size == 0) /* datum size > H5TOOLS_BUFSIZE */ - size = 1; - sm_size[k - 1] = MIN(dims[k - 1], size); - sm_nbytes *= sm_size[k - 1]; - HDassert(sm_nbytes > 0); + dset_layout = H5Pget_layout(dcpl_in); + if (dset_layout == H5D_CHUNKED) + dcpl_tmp = dcpl_in; /* reading dataset */ } - sm_buf = HDmalloc((size_t)sm_nbytes); - sm_nelmts = sm_nbytes / p_type_nbytes; - sm_space = H5Screate_simple(1, &sm_nelmts, NULL); + /* get hyperslab dims and size in byte */ + if(Get_hyperslab(dcpl_tmp, rank, dims, p_type_nbytes, hslab_dims, &hslab_nbytes) < 0) + goto error; + + hslab_buf = HDmalloc((size_t)hslab_nbytes); + + hslab_nelmts = hslab_nbytes / p_type_nbytes; + hslab_space = H5Screate_simple(1, &hslab_nelmts, NULL); - /* the stripmine loop */ - HDmemset(hs_offset, 0, sizeof hs_offset); + /* the hyperslab selection loop */ + HDmemset(hs_sel_offset, 0, sizeof hs_sel_offset); HDmemset(zero, 0, sizeof zero); - for (elmtno = 0; elmtno < p_nelmts; elmtno += hs_nelmts) + for (elmtno = 0; elmtno < p_nelmts; elmtno += hs_select_nelmts) { - /* calculate the hyperslab size */ if (rank > 0) { - for (k = 0, hs_nelmts = 1; k < rank; k++) + /* calculate the hyperslab selections. The selection would be same as the hyperslab except for remaining edge portion of the dataset which is smaller then the hyperslab. + */ + for (k = 0, hs_select_nelmts = 1; k < rank; k++) { - hs_size[k] = MIN(dims[k] - hs_offset[k], sm_size[k]); - hs_nelmts *= hs_size[k]; + /* MIN() is used to get the remaining edge portion if exist. + * "dims[k] - hs_sel_offset[k]" is remaining edge portion that is smaller then the hyperslab.*/ + hs_sel_count[k] = MIN(dims[k] - hs_sel_offset[k], hslab_dims[k]); + hs_select_nelmts *= hs_sel_count[k]; } - if (H5Sselect_hyperslab(f_space_id, H5S_SELECT_SET, hs_offset, NULL, hs_size, NULL) < 0) + if (H5Sselect_hyperslab(f_space_id, H5S_SELECT_SET, hs_sel_offset, NULL, hs_sel_count, NULL) < 0) goto error; - if (H5Sselect_hyperslab(sm_space, H5S_SELECT_SET, zero, NULL, &hs_nelmts, NULL) < 0) + if (H5Sselect_hyperslab(hslab_space, H5S_SELECT_SET, zero, NULL, &hs_select_nelmts, NULL) < 0) goto error; } else { H5Sselect_all(f_space_id); - H5Sselect_all(sm_space); - hs_nelmts = 1; + H5Sselect_all(hslab_space); + hs_select_nelmts = 1; } /* rank */ /* read/write: use the macro to check error, e.g. memory allocation error inside the library. */ - CHECK_H5DRW_ERROR(H5Dread, dset_in, wtype_id, sm_space, f_space_id, H5P_DEFAULT, sm_buf); - CHECK_H5DRW_ERROR(H5Dwrite, dset_out, wtype_id, sm_space, f_space_id, H5P_DEFAULT, sm_buf); + CHECK_H5DRW_ERROR(H5Dread, dset_in, wtype_id, hslab_space, f_space_id, H5P_DEFAULT, hslab_buf); + CHECK_H5DRW_ERROR(H5Dwrite, dset_out, wtype_id, hslab_space, f_space_id, H5P_DEFAULT, hslab_buf); /* reclaim any VL memory, if necessary */ if(vl_data) - H5Dvlen_reclaim(wtype_id, sm_space, H5P_DEFAULT, sm_buf); + H5Dvlen_reclaim(wtype_id, hslab_space, H5P_DEFAULT, hslab_buf); /* calculate the next hyperslab offset */ for (k = rank, carry = 1; k > 0 && carry; --k) { - hs_offset[k - 1] += hs_size[k - 1]; - if (hs_offset[k - 1] == dims[k - 1]) - hs_offset[k - 1] = 0; + hs_sel_offset[k - 1] += hs_sel_count[k - 1]; + /* if reached the end of a dim */ + if (hs_sel_offset[k - 1] == dims[k - 1]) + hs_sel_offset[k - 1] = 0; else carry = 0; } /* k */ } /* elmtno */ - H5Sclose(sm_space); + H5Sclose(hslab_space); /* free */ - if (sm_buf!=NULL) + if (hslab_buf!=NULL) { - HDfree(sm_buf); - sm_buf=NULL; + HDfree(hslab_buf); + hslab_buf=NULL; } } /* hyperslab read */ } /* if (nelmts>0 && space_status==H5D_SPACE_STATUS_NOT_ALLOCATED) */ @@ -1005,7 +1217,7 @@ int do_copy_objects(hid_t fidin, print_dataset_info(dcpl_out,travt->objs[i].name,ratio,1); } else - print_dataset_info(dcpl_id,travt->objs[i].name,ratio,0); + print_dataset_info(dcpl_in,travt->objs[i].name,ratio,0); /* print a message that the filter was not applied (in case there was a filter) @@ -1044,7 +1256,7 @@ int do_copy_objects(hid_t fidin, goto error; if (H5Tclose(wtype_id) < 0) goto error; - if (H5Pclose(dcpl_id) < 0) + if (H5Pclose(dcpl_in) < 0) goto error; if (H5Pclose(dcpl_out) < 0) goto error; @@ -1199,7 +1411,7 @@ error: H5E_BEGIN_TRY { H5Gclose(grp_in); H5Gclose(grp_out); - H5Pclose(dcpl_id); + H5Pclose(dcpl_in); H5Pclose(gcpl_in); H5Pclose(gcpl_out); H5Sclose(f_space_id); @@ -1214,8 +1426,8 @@ error: /* free */ if (buf!=NULL) HDfree(buf); - if (sm_buf!=NULL) - HDfree(sm_buf); + if (hslab_buf!=NULL) + HDfree(hslab_buf); return -1; } diff --git a/tools/lib/h5tools_utils.c b/tools/lib/h5tools_utils.c index 4505609..11ab5f3 100644 --- a/tools/lib/h5tools_utils.c +++ b/tools/lib/h5tools_utils.c @@ -49,9 +49,9 @@ static const char *h5tools_progname = "h5tools"; * largest value suitable for your machine (for testing use a small value). */ /* Maximum size used in a call to malloc for a dataset */ -hsize_t H5TOOLS_MALLOCSIZE = (128 * 1024 * 1024); +hsize_t H5TOOLS_MALLOCSIZE = (256 * 1024 * 1024); /* 256 MB */ /* size of hyperslab buffer when a dataset is bigger than H5TOOLS_MALLOCSIZE */ -hsize_t H5TOOLS_BUFSIZE = (1024 * 1024); +hsize_t H5TOOLS_BUFSIZE = ( 32 * 1024 * 1024); /* 32 MB */ /* ``parallel_print'' variables */ diff --git a/tools/testfiles/thyperslab.ddl b/tools/testfiles/thyperslab.ddl index cfebd14..2f4a118 100644 --- a/tools/testfiles/thyperslab.ddl +++ b/tools/testfiles/thyperslab.ddl @@ -6338,212 +6338,212 @@ GROUP "/" { (30,4025): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, (30,4045): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, (30,4065): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (30,4085): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,8): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,29): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,50): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,71): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,92): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,113): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,133): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,153): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,173): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,193): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,213): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,233): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,253): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,273): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,293): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,313): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,333): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,353): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,373): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,393): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,413): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,433): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,453): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,473): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,493): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,513): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,533): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,553): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,573): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,593): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,613): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,633): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,653): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,673): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,693): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,713): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,733): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,753): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,773): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,793): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,813): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,833): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,853): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,873): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,893): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,913): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,933): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,953): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,973): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,993): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1013): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1033): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1053): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1073): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1093): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1113): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1133): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1153): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1173): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1193): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1213): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1233): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1253): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1273): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1293): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1313): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1333): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1353): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1373): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1393): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1413): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1433): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1453): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1473): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1493): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1513): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1533): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1553): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1573): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1593): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1613): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1633): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1653): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1673): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1693): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1713): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1733): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1753): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1773): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1793): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1813): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1833): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1853): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1873): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1893): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1913): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1933): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1953): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1973): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1993): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2013): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2033): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2053): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2073): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2093): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2113): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2133): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2153): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2173): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2193): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2213): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2233): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2253): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2273): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2293): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2313): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2333): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2353): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2373): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2393): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2413): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2433): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2453): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2473): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2493): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2513): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2533): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2553): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2573): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2593): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2613): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2633): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2653): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2673): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2693): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2713): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2733): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2753): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2773): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2793): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2813): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2833): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2853): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2873): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2893): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2913): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2933): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2953): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2973): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2993): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3013): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3033): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3053): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3073): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3093): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3113): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3133): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3153): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3173): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3193): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3213): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3233): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3253): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3273): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3293): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3313): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3333): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3353): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3373): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3393): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3413): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3433): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3453): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3473): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3493): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3513): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3533): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3553): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3573): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3593): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3613): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3633): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3653): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3673): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3693): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3713): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3733): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3753): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3773): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3793): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3813): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3833): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3853): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3873): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3893): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3913): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3933): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3953): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3973): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3993): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,4013): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,4033): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,4053): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,4073): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,4093): 1, 1, 1, 1 + (30,4085): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,0): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,21): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,42): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,63): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,84): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,105): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,125): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,145): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,165): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,185): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,205): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,225): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,245): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,265): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,285): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,305): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,325): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,345): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,365): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,385): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,405): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,425): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,445): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,465): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,485): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,505): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,525): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,545): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,565): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,585): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,605): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,625): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,645): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,665): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,685): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,705): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,725): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,745): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,765): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,785): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,805): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,825): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,845): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,865): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,885): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,905): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,925): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,945): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,965): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,985): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1005): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1025): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1045): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1065): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1085): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1105): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1125): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1145): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1165): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1185): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1205): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1225): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1245): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1265): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1285): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1305): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1325): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1345): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1365): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1385): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1405): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1425): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1445): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1465): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1485): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1505): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1525): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1545): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1565): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1585): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1605): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1625): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1645): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1665): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1685): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1705): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1725): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1745): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1765): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1785): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1805): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1825): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1845): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1865): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1885): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1905): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1925): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1945): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1965): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1985): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2005): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2025): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2045): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2065): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2085): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2105): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2125): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2145): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2165): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2185): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2205): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2225): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2245): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2265): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2285): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2305): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2325): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2345): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2365): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2385): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2405): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2425): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2445): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2465): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2485): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2505): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2525): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2545): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2565): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2585): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2605): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2625): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2645): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2665): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2685): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2705): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2725): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2745): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2765): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2785): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2805): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2825): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2845): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2865): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2885): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2905): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2925): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2945): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2965): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2985): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3005): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3025): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3045): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3065): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3085): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3105): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3125): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3145): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3165): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3185): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3205): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3225): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3245): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3265): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3285): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3305): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3325): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3345): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3365): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3385): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3405): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3425): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3445): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3465): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3485): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3505): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3525): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3545): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3565): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3585): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3605): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3625): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3645): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3665): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3685): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3705): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3725): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3745): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3765): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3785): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3805): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3825): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3845): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3865): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3885): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3905): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3925): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3945): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3965): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3985): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,4005): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,4025): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,4045): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,4065): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,4085): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } } } -- cgit v0.12 From f99cdd5afe2f86c83b502ca7b27e293d3a17eb45 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 2 Mar 2012 16:30:30 -0500 Subject: [svn-r22019] Cleanup warnings from compiles Tested: local linux --- tools/h5dump/h5dump.c | 54 ++++++++++++++++++++++++------------------------ tools/lib/h5tools_dump.c | 16 -------------- tools/lib/h5tools_str.c | 9 +++----- tools/lib/h5trav.c | 6 +++--- 4 files changed, 33 insertions(+), 52 deletions(-) diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c index 73bfd13..64c5e7c 100644 --- a/tools/h5dump/h5dump.c +++ b/tools/h5dump/h5dump.c @@ -477,21 +477,21 @@ set_data_output_file(const char *fname, int is_bin) * so that rawdatastream is changed only when succeeded */ if (rawdatastream && rawdatastream != stdout) { - if (fclose(rawdatastream)) - perror("closing rawdatastream"); + if (HDfclose(rawdatastream)) + HDperror("closing rawdatastream"); else rawdatastream = NULL; } /* binary output */ if (is_bin) { - if ((f = fopen(fname, "wb")) != NULL) { + if ((f = HDfopen(fname, "wb")) != NULL) { rawdatastream = f; return 0; } } else { - if ((f = fopen(fname, "w")) != NULL) { + if ((f = HDfopen(fname, "w")) != NULL) { rawdatastream = f; return 0; } @@ -518,13 +518,13 @@ set_output_file(const char *fname) * so that rawoutstream is changed only when succeeded */ if (rawoutstream && rawoutstream != stdout) { - if (fclose(rawoutstream)) - perror("closing rawoutstream"); + if (HDfclose(rawoutstream)) + HDperror("closing rawoutstream"); else rawoutstream = NULL; } - if ((f = fopen(fname, "w")) != NULL) { + if ((f = HDfopen(fname, "w")) != NULL) { rawoutstream = f; return 0; } @@ -550,13 +550,13 @@ set_error_file(const char *fname) * so that rawerrorstream is changed only when succeeded */ if (rawerrorstream && rawerrorstream != stderr) { - if (fclose(rawerrorstream)) - perror("closing rawerrorstream"); + if (HDfclose(rawerrorstream)) + HDperror("closing rawerrorstream"); else rawerrorstream = NULL; } - if ((f = fopen(fname, "w")) != NULL) { + if ((f = HDfopen(fname, "w")) != NULL) { rawerrorstream = f; return 0; } @@ -584,15 +584,15 @@ set_binary_form(const char *form) { int bform = -1; - if (strcmp(form,"NATIVE") == 0 || strcmp(form,"MEMORY") == 0) { + if (HDstrcmp(form,"NATIVE") == 0 || HDstrcmp(form,"MEMORY") == 0) { /* native form */ bform = 0; } - else if (strcmp(form,"FILE") == 0) /* file type form */ + else if (HDstrcmp(form,"FILE") == 0) /* file type form */ bform = 1; - else if (strcmp(form,"LE") == 0) /* convert to little endian */ + else if (HDstrcmp(form,"LE") == 0) /* convert to little endian */ bform = 2; - else if (strcmp(form,"BE") == 0) /* convert to big endian */ + else if (HDstrcmp(form,"BE") == 0) /* convert to big endian */ bform = 3; return bform; @@ -619,9 +619,9 @@ set_sort_by(const char *form) { H5_index_t idx_type = H5_INDEX_UNKNOWN; - if (strcmp(form,"name")==0) /* H5_INDEX_NAME */ + if (HDstrcmp(form,"name")==0) /* H5_INDEX_NAME */ idx_type = H5_INDEX_NAME; - else if (strcmp(form,"creation_order")==0) /* H5_INDEX_CRT_ORDER */ + else if (HDstrcmp(form,"creation_order")==0) /* H5_INDEX_CRT_ORDER */ idx_type = H5_INDEX_CRT_ORDER; return idx_type; @@ -648,9 +648,9 @@ set_sort_order(const char *form) { H5_iter_order_t iter_order = H5_ITER_UNKNOWN; - if (strcmp(form,"ascending")==0) /* H5_ITER_INC */ + if (HDstrcmp(form,"ascending")==0) /* H5_ITER_INC */ iter_order = H5_ITER_INC; - else if (strcmp(form,"descending")==0) /* H5_ITER_DEC */ + else if (HDstrcmp(form,"descending")==0) /* H5_ITER_DEC */ iter_order = H5_ITER_DEC; return iter_order; @@ -689,7 +689,7 @@ parse_hsize_list(const char *h_list, subset_d *d) /* count how many integers do we have */ for (ptr = h_list; ptr && *ptr && *ptr != ';' && *ptr != ']'; ptr++) - if (isdigit(*ptr)) { + if (HDisdigit(*ptr)) { if (!last_digit) /* the last read character wasn't a digit */ size_count++; @@ -708,11 +708,11 @@ parse_hsize_list(const char *h_list, subset_d *d) p_list = (hsize_t *)HDcalloc(size_count, sizeof(hsize_t)); for (ptr = h_list; i < size_count && ptr && *ptr && *ptr != ';' && *ptr != ']'; ptr++) - if(isdigit(*ptr)) { + if(HDisdigit(*ptr)) { /* we should have an integer now */ - p_list[i++] = (hsize_t)atof(ptr); + p_list[i++] = (hsize_t)HDatof(ptr); - while (isdigit(*ptr)) + while (HDisdigit(*ptr)) /* scroll to end of integer */ ptr++; } @@ -744,7 +744,7 @@ parse_subset_params(char *dset) struct subset_t *s = NULL; register char *brace; - if (!disable_compact_subset && ((brace = strrchr(dset, '[')) != NULL)) { + if (!disable_compact_subset && ((brace = HDstrrchr(dset, '[')) != NULL)) { *brace++ = '\0'; s = (struct subset_t *)HDcalloc(1, sizeof(struct subset_t)); @@ -1196,7 +1196,7 @@ parse_start: usage(h5tools_getprogname()); goto error; } - if (strcmp(opt_arg,":") == 0) { + if (HDstrcmp(opt_arg,":") == 0) { xmlnsprefix = ""; } else { @@ -1474,7 +1474,7 @@ main(int argc, const char *argv[]) } } else { - if (useschema && strcmp(xmlnsprefix,"")) { + if (useschema && HDstrcmp(xmlnsprefix,"")) { error_msg("Cannot set Schema URL for a qualified namespace--use -X or -U option with -D \n"); h5tools_setstatus(EXIT_FAILURE); goto done; @@ -1515,7 +1515,7 @@ main(int argc, const char *argv[]) /* alternative first element, depending on schema or DTD. */ if (useschema) { - if (strcmp(xmlnsprefix,"") == 0) { + if (HDstrcmp(xmlnsprefix,"") == 0) { HDfprintf(rawoutstream, "\n", xml_dtd_uri); } @@ -1525,7 +1525,7 @@ main(int argc, const char *argv[]) char *indx; ns = HDstrdup(xmlnsprefix); - indx = strrchr(ns,(int)':'); + indx = HDstrrchr(ns,(int)':'); if (indx) *indx = '\0'; HDfprintf(rawoutstream, "<%sHDF5-File xmlns:%s=\"http://hdfgroup.org/HDF5/XML/schema/HDF5-File\" " diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index d97f96a..2a2267e 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -189,22 +189,6 @@ const h5tools_dump_header_t* h5tools_dump_header_format; table_t *h5dump_type_table = NULL; /*type table reference for datatype dump */ /* local prototypes */ - -hbool_t h5tools_render_element(FILE *stream, const h5tool_format_t *info, - h5tools_context_t *ctx/*in,out*/, - h5tools_str_t *buffer/*string into which to render */, - hsize_t *curr_pos/*total data element position*/, - size_t ncols, hsize_t local_elmt_counter/*element counter*/, - hsize_t elmt_counter); - -hbool_t h5tools_render_region_element(FILE *stream, const h5tool_format_t *info, - h5tools_context_t *ctx/*in,out*/, - h5tools_str_t *buffer/*string into which to render */, - hsize_t *curr_pos/*total data element position*/, - size_t ncols, hsize_t *ptdata, - hsize_t local_elmt_counter/*element counter*/, - hsize_t elmt_counter); - static int h5tools_print_region_data_blocks(hid_t region_id, FILE *stream, const h5tool_format_t *info, h5tools_context_t *cur_ctx, h5tools_str_t *buffer/*string into which to render */, size_t ncols, diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index 846c01b..b0a3ed8 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -173,7 +173,7 @@ h5tools_str_append(h5tools_str_t *str/*in,out*/, const char *fmt, ...) */ size_t newsize = MAX(str->len + nchars + 1, 2 * str->nalloc); HDassert(newsize > str->nalloc); /*overflow*/ - str->s = HDrealloc(str->s, newsize); + str->s = (char*)HDrealloc(str->s, newsize); HDassert(str->s); str->nalloc = newsize; } @@ -209,7 +209,7 @@ h5tools_str_reset(h5tools_str_t *str/*in,out*/) { if (!str->s || str->nalloc <= 0) { str->nalloc = STR_INIT_LEN; - str->s = HDmalloc(str->nalloc); + str->s = (char*)HDmalloc(str->nalloc); HDassert(str->s); } @@ -282,7 +282,7 @@ h5tools_str_fmt(h5tools_str_t *str/*in,out*/, size_t start, const char *fmt) size_t n = sizeof(_temp); if (str->len - start + 1 > n) { n = str->len - start + 1; - temp = HDmalloc(n); + temp = (char*)HDmalloc(n); HDassert(temp); } @@ -1114,8 +1114,6 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai h5tools_str_append(str, "%s", OPT(info->arr_sep, "," OPTIONAL_LINE_BREAK)); if (info->arr_linebreak && i && i % dims[ndims - 1] == 0) { - int x; - h5tools_str_append(str, "%s", "\n"); h5tools_str_indent(str, info, ctx); @@ -1123,7 +1121,6 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai else if (i && info->arr_sep) { /* if next element begin, add next line with indent */ if (is_next_arry_elmt) { - int x; is_next_arry_elmt = 0; h5tools_str_append(str, "%s", "\n "); diff --git a/tools/lib/h5trav.c b/tools/lib/h5trav.c index 3bb8b3f..ad8b9fe 100644 --- a/tools/lib/h5trav.c +++ b/tools/lib/h5trav.c @@ -151,7 +151,7 @@ traverse_cb(hid_t loc_id, const char *path, const H5L_info_t *linfo, size_t base_len = HDstrlen(udata->base_grp_name); size_t add_slash = base_len ? ((udata->base_grp_name)[base_len-1] != '/') : 1; - if(NULL == (new_name = HDmalloc(base_len + add_slash + HDstrlen(path) + 1))) + if(NULL == (new_name = (char*)HDmalloc(base_len + add_slash + HDstrlen(path) + 1))) return(H5_ITER_ERROR); HDstrcpy(new_name, udata->base_grp_name); if (add_slash) @@ -895,7 +895,7 @@ trav_print_visit_lnk(const char *path, const H5L_info_t *linfo, void *udata) switch(linfo->type) { case H5L_TYPE_SOFT: if(linfo->u.val_size > 0) { - char *targbuf = HDmalloc(linfo->u.val_size + 1); + char *targbuf = (char*)HDmalloc(linfo->u.val_size + 1); HDassert(targbuf); H5Lget_val(print_udata->fid, path, targbuf, linfo->u.val_size + 1, H5P_DEFAULT); @@ -912,7 +912,7 @@ trav_print_visit_lnk(const char *path, const H5L_info_t *linfo, void *udata) const char *filename; const char *objname; - targbuf = HDmalloc(linfo->u.val_size + 1); + targbuf = (char*)HDmalloc(linfo->u.val_size + 1); HDassert(targbuf); H5Lget_val(print_udata->fid, path, targbuf, linfo->u.val_size + 1, H5P_DEFAULT); -- cgit v0.12 From cfc1dffd1489353c0fedf8d45df6579c73ddeb2c Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Sat, 3 Mar 2012 00:00:33 -0500 Subject: [svn-r22020] Fix for HDFFV-7878. gnu-flags Don't add gcc flags for intel compiler even though its version display includes "gcc". intel-flags Extend intel version to include icc-12*. --- config/gnu-flags | 8 +++++++- config/intel-flags | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/config/gnu-flags b/config/gnu-flags index 1222c87..38ea4e4 100644 --- a/config/gnu-flags +++ b/config/gnu-flags @@ -28,8 +28,14 @@ if test X = "X$cc_flags_set"; then # PathScale compiler spits out gcc version string too. Need to # filter it out. + # icc beginning with version 12 includes a "gcc version compatiblilty" + # string, causing the gcc H5_CFLAGS to be erroneously added. The line + # "grep -v 'icc version'" causes the discarding of any output + # containing 'icc version'. The cc_version for icc is correctly determined + # and flags added in the intel-flags script. cc_version="`$CC $CFLAGS $H5_CFLAGS -v 2>&1 | grep -v 'PathScale' |\ - grep 'gcc version' | sed 's/.*gcc version \([-a-z0-9\.]*\).*/\1/'`" + grep -v 'icc version' |\ + grep 'gcc version' | sed 's/.*gcc version \([-a-z0-9\.]*\).*/\1/'`" cc_vendor=`echo $cc_version |sed 's/\([a-z]*\).*/\1/'` cc_version=`echo $cc_version |sed 's/[-a-z]//g'` if test X = "X$cc_vendor" -a X != "X$cc_version"; then diff --git a/config/intel-flags b/config/intel-flags index e6a9c31..1d01d7f 100644 --- a/config/intel-flags +++ b/config/intel-flags @@ -93,7 +93,7 @@ fi # Please follow the pattern below by adding new versions at the top, copying # the information from the previous version and adding modifications to that. case "$cc_vendor-$cc_version" in - icc-11*) + icc-11* | icc-12*) # -s became obsolete; we also fixed bugs that allow us to enable higher level # of optimization starting with 1.8.7 PROD_CFLAGS="-O3" -- cgit v0.12 From e7bbbd07df4c551292ba4677e295596216bace15 Mon Sep 17 00:00:00 2001 From: HDF Tester Date: Sun, 4 Mar 2012 09:34:49 -0500 Subject: [svn-r22022] Snapshot version 1.9 release 109 --- README.txt | 2 +- c++/src/Makefile.in | 2 +- config/lt_vers.am | 2 +- configure | 22 +++++++++++----------- configure.in | 2 +- fortran/src/Makefile.in | 2 +- hl/c++/src/Makefile.in | 2 +- hl/fortran/src/Makefile.in | 2 +- hl/src/Makefile.in | 2 +- release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 ++-- src/Makefile.in | 2 +- vms/src/h5pubconf.h | 6 +++--- windows/src/H5pubconf.h | 6 +++--- 14 files changed, 29 insertions(+), 29 deletions(-) diff --git a/README.txt b/README.txt index 369b851..269829a 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.109 currently under development +HDF5 version 1.9.110 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index 3724120..1903667 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -431,7 +431,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 99 +LT_VERS_REVISION = 100 LT_VERS_AGE = 0 # Include src directory diff --git a/config/lt_vers.am b/config/lt_vers.am index 1f30524..4528e68 100644 --- a/config/lt_vers.am +++ b/config/lt_vers.am @@ -17,7 +17,7 @@ # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 99 +LT_VERS_REVISION = 100 LT_VERS_AGE = 0 ## If the API changes *at all*, increment LT_VERS_INTERFACE and diff --git a/configure b/configure index 0a33f2c..4b4c7a6 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh # From configure.in Id: configure.in 21910 2012-02-05 15:51:01Z hdftest . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for HDF5 1.9.109. +# Generated by GNU Autoconf 2.68 for HDF5 1.9.110. # # Report bugs to . # @@ -571,8 +571,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.9.109' -PACKAGE_STRING='HDF5 1.9.109' +PACKAGE_VERSION='1.9.110' +PACKAGE_STRING='HDF5 1.9.110' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1463,7 +1463,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures HDF5 1.9.109 to adapt to many kinds of systems. +\`configure' configures HDF5 1.9.110 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1533,7 +1533,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.9.109:";; + short | recursive ) echo "Configuration of HDF5 1.9.110:";; esac cat <<\_ACEOF @@ -1726,7 +1726,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.9.109 +HDF5 configure 1.9.110 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -2815,7 +2815,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by HDF5 $as_me 1.9.109, which was +It was created by HDF5 $as_me 1.9.110, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -3636,7 +3636,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.9.109' + VERSION='1.9.110' cat >>confdefs.h <<_ACEOF @@ -30611,7 +30611,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.9.109, which was +This file was extended by HDF5 $as_me 1.9.110, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -30677,7 +30677,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.9.109 +HDF5 config.status 1.9.110 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" @@ -33471,7 +33471,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.9.109 +HDF5 config.lt 1.9.110 configured by $0, generated by GNU Autoconf 2.68. Copyright (C) 2010 Free Software Foundation, Inc. diff --git a/configure.in b/configure.in index 6dfab74..799d290 100644 --- a/configure.in +++ b/configure.in @@ -26,7 +26,7 @@ dnl dnl NOTE: Don't forget to change the version number here when we do a dnl release!!! dnl -AC_INIT([HDF5], [1.9.109], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.9.110], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AM_CONFIG_HEADER([src/H5config.h]) diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index ca2c624..ca53252 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -478,7 +478,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 99 +LT_VERS_REVISION = 100 LT_VERS_AGE = 0 # Include src directory in both Fortran and C flags (C compiler is used diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index 3a34444..eba4308 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -421,7 +421,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 99 +LT_VERS_REVISION = 100 LT_VERS_AGE = 0 # Include src directory diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index d02f832..bbe420c 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -436,7 +436,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 99 +LT_VERS_REVISION = 100 LT_VERS_AGE = 0 INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/hl/src -I$(top_builddir)/hl/src \ -I$(top_srcdir)/fortran/src -I$(top_builddir)/fortran/src diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index 337f34f..0509b75 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -420,7 +420,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 99 +LT_VERS_REVISION = 100 LT_VERS_AGE = 0 # This library is our main target. diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index b4c09f5..baf9f50 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.109 currently under development +HDF5 version 1.9.110 currently under development ================================================================================ diff --git a/src/H5public.h b/src/H5public.h index 634decc..562dd5e 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -75,10 +75,10 @@ extern "C" { /* Version numbers */ #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 9 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 109 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 110 /* For tweaks, bug-fixes, or development */ #define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.9.109" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.9.110" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) diff --git a/src/Makefile.in b/src/Makefile.in index df447ce..8a616bb 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -484,7 +484,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 99 +LT_VERS_REVISION = 100 LT_VERS_AGE = 0 H5detect_CFLAGS = -g $(AM_CFLAGS) diff --git a/vms/src/h5pubconf.h b/vms/src/h5pubconf.h index cef6266..b8afa43 100644 --- a/vms/src/h5pubconf.h +++ b/vms/src/h5pubconf.h @@ -502,7 +502,7 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.109" +#define H5_PACKAGE_STRING "HDF5 1.9.110" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" @@ -511,7 +511,7 @@ #define H5_PACKAGE_URL "" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.109" +#define H5_PACKAGE_VERSION "1.9.110" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "ll" @@ -674,7 +674,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.109" +#define H5_VERSION "1.9.110" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ diff --git a/windows/src/H5pubconf.h b/windows/src/H5pubconf.h index 6054e42..448c0a7 100644 --- a/windows/src/H5pubconf.h +++ b/windows/src/H5pubconf.h @@ -527,7 +527,7 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.109" +#define H5_PACKAGE_STRING "HDF5 1.9.110" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" @@ -536,7 +536,7 @@ #define H5_PACKAGE_URL "" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.109" +#define H5_PACKAGE_VERSION "1.9.110" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "I64" @@ -707,7 +707,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.109" +#define H5_VERSION "1.9.110" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ -- cgit v0.12 From 058f9c205676a487d8fb37ff3874176eee7807d3 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 5 Mar 2012 09:17:14 -0500 Subject: [svn-r22024] Add HD prefix to tools library based tests. Cleaned allocation/free in tests. Tested: local linux/ changes h5committetest against 1.8 version --- hl/test/test_ds.c | 826 ++++++++++++++++++++--------------------- hl/test/test_image.c | 54 +-- hl/test/test_lite.c | 196 ++++++---- hl/test/test_packet.c | 14 +- hl/test/test_table.c | 56 +-- test/big.c | 578 ++++++++++++++-------------- test/tmisc.c | 78 ++-- tools/h5repack/h5repack_main.c | 30 +- 8 files changed, 925 insertions(+), 907 deletions(-) diff --git a/hl/test/test_ds.c b/hl/test/test_ds.c index 2be3d60..e290bbb 100644 --- a/hl/test/test_ds.c +++ b/hl/test/test_ds.c @@ -219,9 +219,9 @@ static hid_t create_test_file(const char *fileext) { char filename[65]; - strcpy(filename, FILENAME); - strcat(filename, fileext); - strcat(filename, FILEEXT); + HDstrcpy(filename, FILENAME); + HDstrcat(filename, fileext); + HDstrcat(filename, FILEEXT); return H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); } @@ -229,9 +229,9 @@ static hid_t open_test_file(const char *fileext) { char filename[65]; - strcpy(filename, FILENAME); - strcat(filename, fileext); - strcat(filename, FILEEXT); + HDstrcpy(filename, FILENAME); + HDstrcat(filename, fileext); + HDstrcat(filename, FILEEXT); return H5Fopen(filename, H5F_ACC_RDWR, H5P_DEFAULT); } @@ -260,8 +260,8 @@ herr_t create_char_dataset(hid_t fid, const char *dsidx, int fulldims) char s33_wbuf[DIM3_SIZE] = {6,6,6,12,12,12,53,53,53,120,120,120}; char name[32]; - strcpy(name, DATASET_NAME); - strcat(name, dsidx); + HDstrcpy(name, DATASET_NAME); + HDstrcat(name, dsidx); /* make a dataset */ if(H5LTmake_dataset_char(fid, name, rank, dims, buf) >= 0) { if(fulldims==0) { @@ -313,8 +313,8 @@ herr_t create_short_dataset(hid_t fid, const char *dsidx, int fulldims) short s33_wbuf[DIM3_SIZE] = {6,6,6,12,12,12,53,53,53,140,140,140}; char name[32]; - strcpy(name, DATASET_NAME); - strcat(name, dsidx); + HDstrcpy(name, DATASET_NAME); + HDstrcat(name, dsidx); /* make a dataset */ if(H5LTmake_dataset_short(fid, name, rank, dims, buf) >= 0) { @@ -362,8 +362,8 @@ herr_t create_int_dataset(hid_t fid, const char *dsidx, int fulldims) int s22_wbuf[DIM2_SIZE] = {5,10,50,300}; char name[32]; - strcpy(name, DATASET_NAME); - strcat(name, dsidx); + HDstrcpy(name, DATASET_NAME); + HDstrcat(name, dsidx); /* make a dataset */ if(H5LTmake_dataset_int(fid, name, rank, dims, buf) >= 0) { @@ -415,7 +415,7 @@ herr_t create_long_dataset(hid_t fid, const char *dsname, const char *dsidx, int long s44_wbuf[DIM4_SIZE] = {280,280}; char name[32]; - strcpy(name, dsname); + HDstrcpy(name, dsname); /* make a dataset */ if(H5LTmake_dataset_long(fid, name, rank, dims, buf) >= 0) { @@ -470,8 +470,8 @@ herr_t create_float_dataset(hid_t fid, const char *dsidx, int fulldims) float s22_wbuf[DIM2_SIZE] = {5,10,50,300}; char name[32]; - strcpy(name, DATASET_NAME); - strcat(name, dsidx); + HDstrcpy(name, DATASET_NAME); + HDstrcat(name, dsidx); /* make a dataset */ if(H5LTmake_dataset_float(fid, name, rank, dims, buf) >= 0) { @@ -505,15 +505,15 @@ herr_t create_DS1_char_datasets(hid_t fid, const char *dsidx, int rankds, hsize_ { char name[32]; - strcpy(name, DS_1_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_1_NAME); + HDstrcat(name, dsidx); /* make a DS dataset for the first dimension */ if(H5LTmake_dataset_char(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if(s1_wbuf!=NULL) { - strcpy(name, DS_11_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_11_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the first dimension */ if(H5LTmake_dataset_char(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; @@ -530,23 +530,23 @@ herr_t create_DS2_char_datasets(hid_t fid, const char *dsidx, int rankds, hsize_ { char name[32]; - strcpy(name, DS_2_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_2_NAME); + HDstrcat(name, dsidx); /* make a DS dataset for the second dimension */ if(H5LTmake_dataset_char(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if(s1_wbuf!=NULL) { - strcpy(name, DS_21_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_21_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_char(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; } if(s2_wbuf!=NULL) { - strcpy(name, DS_22_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_22_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_char(fid, name, rankds, s_dim, s2_wbuf) < 0) return FAIL; @@ -563,31 +563,31 @@ herr_t create_DS3_char_datasets(hid_t fid, const char *dsidx, int rankds, hsize_ { char name[32]; - strcpy(name, DS_3_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_3_NAME); + HDstrcat(name, dsidx); /* make a DS dataset for the first dimension */ if(H5LTmake_dataset_char(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if(s1_wbuf!=NULL) { - strcpy(name, DS_31_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_31_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_char(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; } if(s2_wbuf!=NULL) { - strcpy(name, DS_32_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_32_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_char(fid, name, rankds, s_dim, s2_wbuf) < 0) return FAIL; } if(s3_wbuf!=NULL) { - strcpy(name, DS_33_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_33_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_char(fid, name, rankds, s_dim, s3_wbuf) < 0) return FAIL; @@ -604,15 +604,15 @@ herr_t create_DS1_short_datasets(hid_t fid, const char *dsidx, int rankds, hsize { char name[32]; - strcpy(name, DS_1_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_1_NAME); + HDstrcat(name, dsidx); /* make a DS dataset for the first dimension */ if(H5LTmake_dataset_short(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if(s1_wbuf!=NULL) { - strcpy(name, DS_11_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_11_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the first dimension */ if(H5LTmake_dataset_short(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; @@ -629,24 +629,24 @@ herr_t create_DS2_short_datasets(hid_t fid, const char *dsidx, int rankds, hsize { char name[32]; - strcpy(name, DS_2_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_2_NAME); + HDstrcat(name, dsidx); /* make a DS dataset for the second dimension */ if(H5LTmake_dataset_short(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if(s1_wbuf!=NULL) { - strcpy(name, DS_21_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_21_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_short(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; } if(s2_wbuf!=NULL) { - strcpy(name, DS_22_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_22_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_short(fid, name, rankds, s_dim, s2_wbuf) < 0) return FAIL; @@ -663,32 +663,32 @@ herr_t create_DS3_short_datasets(hid_t fid, const char *dsidx, int rankds, hsize { char name[32]; - strcpy(name, DS_3_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_3_NAME); + HDstrcat(name, dsidx); /* make a DS dataset for the first dimension */ if(H5LTmake_dataset_short(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if(s1_wbuf!=NULL) { - strcpy(name, DS_31_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_31_NAME); + HDstrcat(name, dsidx); /* make a DS dataset for the first dimension */ if(H5LTmake_dataset_short(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; } if(s2_wbuf!=NULL) { - strcpy(name, DS_32_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_32_NAME); + HDstrcat(name, dsidx); /* make a DS dataset for the first dimension */ if(H5LTmake_dataset_short(fid, name, rankds, s_dim, s2_wbuf) < 0) return FAIL; } if(s3_wbuf!=NULL) { - strcpy(name, DS_33_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_33_NAME); + HDstrcat(name, dsidx); /* make a DS dataset for the first dimension */ if(H5LTmake_dataset_short(fid, name, rankds, s_dim, s3_wbuf) < 0) return FAIL; @@ -705,16 +705,16 @@ herr_t create_DS1_int_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t { char name[32]; - strcpy(name, DS_1_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_1_NAME); + HDstrcat(name, dsidx); /* make a DS dataset for the first dimension */ if(H5LTmake_dataset_int(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if(s1_wbuf!=NULL) { - strcpy(name, DS_11_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_11_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the first dimension */ if(H5LTmake_dataset_int(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; @@ -731,24 +731,24 @@ herr_t create_DS2_int_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t { char name[32]; - strcpy(name, DS_2_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_2_NAME); + HDstrcat(name, dsidx); /* make a DS dataset for the second dimension */ if(H5LTmake_dataset_int(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if(s1_wbuf!=NULL) { - strcpy(name, DS_21_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_21_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_int(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; } if(s2_wbuf!=NULL) { - strcpy(name, DS_22_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_22_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_int(fid, name, rankds, s_dim, s2_wbuf) < 0) return FAIL; @@ -765,32 +765,32 @@ herr_t create_DS3_int_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t { char name[32]; - strcpy(name, DS_3_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_3_NAME); + HDstrcat(name, dsidx); /* make a DS dataset for the first dimension */ if(H5LTmake_dataset_int(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if(s1_wbuf!=NULL) { - strcpy(name, DS_31_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_31_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the first dimension */ if(H5LTmake_dataset_int(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; } if(s2_wbuf!=NULL) { - strcpy(name, DS_32_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_32_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the first dimension */ if(H5LTmake_dataset_int(fid, name, rankds, s_dim, s2_wbuf) < 0) return FAIL; } if(s3_wbuf!=NULL) { - strcpy(name, DS_33_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_33_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the first dimension */ if(H5LTmake_dataset_int(fid, name, rankds, s_dim, s3_wbuf) < 0) return FAIL; @@ -807,16 +807,16 @@ herr_t create_DS1_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_ { char name[32]; - strcpy(name, DS_1_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_1_NAME); + HDstrcat(name, dsidx); /* make a DS dataset for the first dimension */ if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if(s1_wbuf!=NULL) { - strcpy(name, DS_11_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_11_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the first dimension */ if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; @@ -833,24 +833,24 @@ herr_t create_DS2_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_ { char name[32]; - strcpy(name, DS_2_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_2_NAME); + HDstrcat(name, dsidx); /* make a DS dataset for the second dimension */ if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if(s1_wbuf!=NULL) { - strcpy(name, DS_21_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_21_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; } if(s2_wbuf!=NULL) { - strcpy(name, DS_22_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_22_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s2_wbuf) < 0) return FAIL; @@ -867,32 +867,32 @@ herr_t create_DS3_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_ { char name[32]; - strcpy(name, DS_3_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_3_NAME); + HDstrcat(name, dsidx); /* make a DS dataset for the first dimension */ if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if(s1_wbuf!=NULL) { - strcpy(name, DS_31_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_31_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; } if(s2_wbuf!=NULL) { - strcpy(name, DS_32_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_32_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s2_wbuf) < 0) return FAIL; } if(s3_wbuf!=NULL) { - strcpy(name, DS_33_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_33_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s3_wbuf) < 0) return FAIL; @@ -909,40 +909,40 @@ herr_t create_DS4_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_ { char name[32]; - strcpy(name, DS_4_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_4_NAME); + HDstrcat(name, dsidx); /* make a DS dataset for the first dimension */ if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if(s1_wbuf!=NULL) { - strcpy(name, DS_41_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_41_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; } if(s2_wbuf!=NULL) { - strcpy(name, DS_42_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_42_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s2_wbuf) < 0) return FAIL; } if(s3_wbuf!=NULL) { - strcpy(name, DS_43_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_43_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s3_wbuf) < 0) return FAIL; } if(s4_wbuf!=NULL) { - strcpy(name, DS_44_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_44_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s4_wbuf) < 0) return FAIL; @@ -959,16 +959,16 @@ herr_t create_DS1_float_datasets(hid_t fid, const char *dsidx, int rankds, hsize { char name[32]; - strcpy(name, DS_1_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_1_NAME); + HDstrcat(name, dsidx); /* make a DS dataset for the first dimension */ if(H5LTmake_dataset_float(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if(s1_wbuf!=NULL) { - strcpy(name, DS_11_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_11_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the first dimension */ if(H5LTmake_dataset_float(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; @@ -985,24 +985,24 @@ herr_t create_DS2_float_datasets(hid_t fid, const char *dsidx, int rankds, hsize { char name[32]; - strcpy(name, DS_2_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_2_NAME); + HDstrcat(name, dsidx); /* make a DS dataset for the second dimension */ if(H5LTmake_dataset_float(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if(s1_wbuf!=NULL) { - strcpy(name, DS_21_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_21_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_float(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; } if(s2_wbuf!=NULL) { - strcpy(name, DS_22_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_22_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_float(fid, name, rankds, s_dim, s2_wbuf) < 0) return FAIL; @@ -1019,32 +1019,32 @@ herr_t create_DS3_float_datasets(hid_t fid, const char *dsidx, int rankds, hsize { char name[32]; - strcpy(name, DS_3_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_3_NAME); + HDstrcat(name, dsidx); /* make a DS dataset for the first dimension */ if(H5LTmake_dataset_float(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if(s1_wbuf!=NULL) { - strcpy(name, DS_31_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_31_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_float(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; } if(s2_wbuf!=NULL) { - strcpy(name, DS_32_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_32_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_float(fid, name, rankds, s_dim, s2_wbuf) < 0) return FAIL; } if(s3_wbuf!=NULL) { - strcpy(name, DS_33_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_33_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_float(fid, name, rankds, s_dim, s3_wbuf) < 0) return FAIL; @@ -1127,13 +1127,13 @@ herr_t test_cmp_scalename(hid_t fid, hid_t did, const char *name, const char *sc if((dsid = H5Dopen2(fid, name, H5P_DEFAULT)) >= 0) { if(H5DSis_attached(did, dsid, idx) == 1) { if((name_len=H5DSget_scale_name(dsid,NULL,(size_t)0)) > 0) { - name_out = (char*)malloc(name_len * sizeof (char)); + name_out = (char*)HDmalloc(name_len * sizeof (char)); if(name_out != NULL) { if(H5DSget_scale_name(dsid, name_out, (size_t)name_len) >= 0) { - if(strcmp(scalename,name_out)==0) { + if(HDstrcmp(scalename,name_out)==0) { ret_value = SUCCEED; } - free(name_out); + HDfree(name_out); name_out=NULL; } } @@ -1294,8 +1294,8 @@ static int test_char_attachscales(const char *fileext) hid_t did = -1; char dsname[32]; char scalename[32]; - strcpy(dsname, DATASET_NAME); - strcat(dsname, "ac"); + HDstrcpy(dsname, DATASET_NAME); + HDstrcat(dsname, "ac"); TESTING2("test_char_attachscales"); @@ -1307,18 +1307,18 @@ static int test_char_attachscales(const char *fileext) goto out; if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - strcpy(scalename, DS_1_NAME); - strcat(scalename, "ac"); + HDstrcpy(scalename, DS_1_NAME); + HDstrcat(scalename, "ac"); if(test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - strcpy(scalename, DS_2_NAME); - strcat(scalename, "ac"); + HDstrcpy(scalename, DS_2_NAME); + HDstrcat(scalename, "ac"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - strcpy(scalename, DS_3_NAME); - strcat(scalename, "ac"); + HDstrcpy(scalename, DS_3_NAME); + HDstrcat(scalename, "ac"); if(test_attach_scale(fid, did, scalename, DIM2) < 0) goto out; @@ -1350,8 +1350,8 @@ static int test_short_attachscales(const char *fileext) hid_t did = -1; char dsname[32]; char scalename[32]; - strcpy(dsname, DATASET_NAME); - strcat(dsname, "as"); + HDstrcpy(dsname, DATASET_NAME); + HDstrcat(dsname, "as"); TESTING2("test_short_attachscales"); @@ -1363,48 +1363,48 @@ static int test_short_attachscales(const char *fileext) goto out; if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - strcpy(scalename, DS_1_NAME); - strcat(scalename, "as"); + HDstrcpy(scalename, DS_1_NAME); + HDstrcat(scalename, "as"); if(test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - strcpy(scalename, DS_11_NAME); - strcat(scalename, "as"); + HDstrcpy(scalename, DS_11_NAME); + HDstrcat(scalename, "as"); if(test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - strcpy(scalename, DS_2_NAME); - strcat(scalename, "as"); + HDstrcpy(scalename, DS_2_NAME); + HDstrcat(scalename, "as"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - strcpy(scalename, DS_21_NAME); - strcat(scalename, "as"); + HDstrcpy(scalename, DS_21_NAME); + HDstrcat(scalename, "as"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - strcpy(scalename, DS_22_NAME); - strcat(scalename, "as"); + HDstrcpy(scalename, DS_22_NAME); + HDstrcat(scalename, "as"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - strcpy(scalename, DS_3_NAME); - strcat(scalename, "as"); + HDstrcpy(scalename, DS_3_NAME); + HDstrcat(scalename, "as"); if(test_attach_scale(fid, did, scalename, DIM2) < 0) goto out; - strcpy(scalename, DS_31_NAME); - strcat(scalename, "as"); + HDstrcpy(scalename, DS_31_NAME); + HDstrcat(scalename, "as"); if(test_attach_scale(fid, did, scalename, DIM2) < 0) goto out; - strcpy(scalename, DS_32_NAME); - strcat(scalename, "as"); + HDstrcpy(scalename, DS_32_NAME); + HDstrcat(scalename, "as"); if(test_attach_scale(fid, did, scalename, DIM2) < 0) goto out; - strcpy(scalename, DS_33_NAME); - strcat(scalename, "as"); + HDstrcpy(scalename, DS_33_NAME); + HDstrcat(scalename, "as"); if(test_attach_scale(fid, did, scalename, DIM2) < 0) goto out; @@ -1436,8 +1436,8 @@ static int test_int_attachscales(const char *fileext) hid_t did = -1; char dsname[32]; char scalename[32]; - strcpy(dsname, DATASET_NAME); - strcat(dsname, "a"); + HDstrcpy(dsname, DATASET_NAME); + HDstrcat(dsname, "a"); TESTING2("test_int_attachscales"); @@ -1449,28 +1449,28 @@ static int test_int_attachscales(const char *fileext) goto out; if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - strcpy(scalename, DS_1_NAME); - strcat(scalename, "a"); + HDstrcpy(scalename, DS_1_NAME); + HDstrcat(scalename, "a"); if(test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - strcpy(scalename, DS_11_NAME); - strcat(scalename, "a"); + HDstrcpy(scalename, DS_11_NAME); + HDstrcat(scalename, "a"); if(test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - strcpy(scalename, DS_2_NAME); - strcat(scalename, "a"); + HDstrcpy(scalename, DS_2_NAME); + HDstrcat(scalename, "a"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - strcpy(scalename, DS_21_NAME); - strcat(scalename, "a"); + HDstrcpy(scalename, DS_21_NAME); + HDstrcat(scalename, "a"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - strcpy(scalename, DS_22_NAME); - strcat(scalename, "a"); + HDstrcpy(scalename, DS_22_NAME); + HDstrcat(scalename, "a"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; @@ -1502,8 +1502,8 @@ static int test_long_attachscales(const char *fileext) hid_t did = -1; char dsname[32]; char scalename[32]; - strcpy(dsname, DATASET_NAME); - strcat(dsname, "al"); + HDstrcpy(dsname, DATASET_NAME); + HDstrcat(dsname, "al"); TESTING2("test_long_attachscales"); @@ -1515,23 +1515,23 @@ static int test_long_attachscales(const char *fileext) goto out; if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - strcpy(scalename, DS_1_NAME); - strcat(scalename, "al"); + HDstrcpy(scalename, DS_1_NAME); + HDstrcat(scalename, "al"); if(test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - strcpy(scalename, DS_2_NAME); - strcat(scalename, "al"); + HDstrcpy(scalename, DS_2_NAME); + HDstrcat(scalename, "al"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - strcpy(scalename, DS_3_NAME); - strcat(scalename, "al"); + HDstrcpy(scalename, DS_3_NAME); + HDstrcat(scalename, "al"); if(test_attach_scale(fid, did, scalename, DIM2) < 0) goto out; - strcpy(scalename, DS_4_NAME); - strcat(scalename, "al"); + HDstrcpy(scalename, DS_4_NAME); + HDstrcat(scalename, "al"); if(test_attach_scale(fid, did, scalename, DIM3) < 0) goto out; @@ -1563,8 +1563,8 @@ static int test_duplicatelong_attachscales(const char *fileext) hid_t did = -1; char dsname[32]; char scalename[32]; - strcpy(dsname, DATASET_NAME); - strcat(dsname, "al2"); + HDstrcpy(dsname, DATASET_NAME); + HDstrcat(dsname, "al2"); TESTING2("test_duplicatelong_attachscales"); @@ -1576,23 +1576,23 @@ static int test_duplicatelong_attachscales(const char *fileext) goto out; if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - strcpy(scalename, DS_1_NAME); - strcat(scalename, "al"); + HDstrcpy(scalename, DS_1_NAME); + HDstrcat(scalename, "al"); if(test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - strcpy(scalename, DS_2_NAME); - strcat(scalename, "al"); + HDstrcpy(scalename, DS_2_NAME); + HDstrcat(scalename, "al"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - strcpy(scalename, DS_3_NAME); - strcat(scalename, "al"); + HDstrcpy(scalename, DS_3_NAME); + HDstrcat(scalename, "al"); if(test_attach_scale(fid, did, scalename, DIM2) < 0) goto out; - strcpy(scalename, DS_4_NAME); - strcat(scalename, "al"); + HDstrcpy(scalename, DS_4_NAME); + HDstrcat(scalename, "al"); if(test_attach_scale(fid, did, scalename, DIM3) < 0) goto out; @@ -1624,8 +1624,8 @@ static int test_float_attachscales(const char *fileext) hid_t did = -1; char dsname[32]; char scalename[32]; - strcpy(dsname, DATASET_NAME); - strcat(dsname, "af"); + HDstrcpy(dsname, DATASET_NAME); + HDstrcat(dsname, "af"); TESTING2("test_float_attachscales"); @@ -1637,28 +1637,28 @@ static int test_float_attachscales(const char *fileext) goto out; if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - strcpy(scalename, DS_1_NAME); - strcat(scalename, "af"); + HDstrcpy(scalename, DS_1_NAME); + HDstrcat(scalename, "af"); if(test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - strcpy(scalename, DS_11_NAME); - strcat(scalename, "af"); + HDstrcpy(scalename, DS_11_NAME); + HDstrcat(scalename, "af"); if(test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - strcpy(scalename, DS_2_NAME); - strcat(scalename, "af"); + HDstrcpy(scalename, DS_2_NAME); + HDstrcat(scalename, "af"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - strcpy(scalename, DS_21_NAME); - strcat(scalename, "af"); + HDstrcpy(scalename, DS_21_NAME); + HDstrcat(scalename, "af"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - strcpy(scalename, DS_22_NAME); - strcat(scalename, "af"); + HDstrcpy(scalename, DS_22_NAME); + HDstrcat(scalename, "af"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; @@ -1691,8 +1691,8 @@ static int test_numberofscales(const char *fileext) int nscales; /* number of scales in DIM */ char dsname[32]; char scalename[32]; - strcpy(dsname, DATASET_NAME); - strcat(dsname, "a"); + HDstrcpy(dsname, DATASET_NAME); + HDstrcat(dsname, "a"); TESTING2("test_numberofscales"); @@ -1718,8 +1718,8 @@ static int test_numberofscales(const char *fileext) else goto out; - strcpy(dsname, DATASET_NAME); - strcat(dsname, "b"); + HDstrcpy(dsname, DATASET_NAME); + HDstrcat(dsname, "b"); /* make a dataset */ if(create_int_dataset(fid, "b", 1) < 0) @@ -1727,8 +1727,8 @@ static int test_numberofscales(const char *fileext) /* make a DS dataset for the first dimension */ if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - strcpy(scalename, DS_1_NAME); - strcat(scalename, "b"); + HDstrcpy(scalename, DS_1_NAME); + HDstrcat(scalename, "b"); if(test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; @@ -1772,38 +1772,38 @@ static int test_char_scalenames(const char *fileext) { char dsname[32]; char scalename[32]; char name[32]; - strcpy(dsname, DATASET_NAME); - strcat(dsname, "ac"); + HDstrcpy(dsname, DATASET_NAME); + HDstrcat(dsname, "ac"); if((fid = open_test_file(fileext)) < 0) goto out; TESTING2("set char scale/cmp scale name"); if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - strcpy(scalename, DS_1_NAME); - strcat(scalename, "ac"); - strcpy(name, SCALE_1_NAME); - strcat(name, "ac"); + HDstrcpy(scalename, DS_1_NAME); + HDstrcat(scalename, "ac"); + HDstrcpy(name, SCALE_1_NAME); + HDstrcat(name, "ac"); if(test_set_scalename(fid, did, scalename, name, DIM0) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - strcpy(scalename, DS_2_NAME); - strcat(scalename, "ac"); - strcpy(name, SCALE_2_NAME); - strcat(name, "ac"); + HDstrcpy(scalename, DS_2_NAME); + HDstrcat(scalename, "ac"); + HDstrcpy(name, SCALE_2_NAME); + HDstrcat(name, "ac"); if(test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - strcpy(scalename, DS_3_NAME); - strcat(scalename, "ac"); - strcpy(name, SCALE_3_NAME); - strcat(name, "ac"); + HDstrcpy(scalename, DS_3_NAME); + HDstrcat(scalename, "ac"); + HDstrcpy(name, SCALE_3_NAME); + HDstrcat(name, "ac"); if(test_set_scalename(fid, did, scalename, name, DIM2) < 0) goto out; @@ -1838,98 +1838,98 @@ static int test_short_scalenames(const char *fileext) { char dsname[32]; char scalename[32]; char name[32]; - strcpy(dsname, DATASET_NAME); - strcat(dsname, "as"); + HDstrcpy(dsname, DATASET_NAME); + HDstrcat(dsname, "as"); if((fid = open_test_file(fileext)) < 0) goto out; TESTING2("set short scale/cmp scale name"); if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - strcpy(scalename, DS_1_NAME); - strcat(scalename, "as"); - strcpy(name, SCALE_1_NAME); - strcat(name, "as"); + HDstrcpy(scalename, DS_1_NAME); + HDstrcat(scalename, "as"); + HDstrcpy(name, SCALE_1_NAME); + HDstrcat(name, "as"); if(test_set_scalename(fid, did, scalename, name, DIM0) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - strcpy(scalename, DS_11_NAME); - strcat(scalename, "as"); - strcpy(name, SCALE_11_NAME); - strcat(name, "as"); + HDstrcpy(scalename, DS_11_NAME); + HDstrcat(scalename, "as"); + HDstrcpy(name, SCALE_11_NAME); + HDstrcat(name, "as"); if(test_set_scalename(fid, did, scalename, name, DIM0) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - strcpy(scalename, DS_2_NAME); - strcat(scalename, "as"); - strcpy(name, SCALE_2_NAME); - strcat(name, "as"); + HDstrcpy(scalename, DS_2_NAME); + HDstrcat(scalename, "as"); + HDstrcpy(name, SCALE_2_NAME); + HDstrcat(name, "as"); if(test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - strcpy(scalename, DS_21_NAME); - strcat(scalename, "as"); - strcpy(name, SCALE_21_NAME); - strcat(name, "as"); + HDstrcpy(scalename, DS_21_NAME); + HDstrcat(scalename, "as"); + HDstrcpy(name, SCALE_21_NAME); + HDstrcat(name, "as"); if(test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - strcpy(scalename, DS_22_NAME); - strcat(scalename, "as"); - strcpy(name, SCALE_22_NAME); - strcat(name, "as"); + HDstrcpy(scalename, DS_22_NAME); + HDstrcat(scalename, "as"); + HDstrcpy(name, SCALE_22_NAME); + HDstrcat(name, "as"); if(test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - strcpy(scalename, DS_3_NAME); - strcat(scalename, "as"); - strcpy(name, SCALE_3_NAME); - strcat(name, "as"); + HDstrcpy(scalename, DS_3_NAME); + HDstrcat(scalename, "as"); + HDstrcpy(name, SCALE_3_NAME); + HDstrcat(name, "as"); if(test_set_scalename(fid, did, scalename, name, DIM2) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM2) < 0) goto out; - strcpy(scalename, DS_31_NAME); - strcat(scalename, "as"); - strcpy(name, SCALE_31_NAME); - strcat(name, "as"); + HDstrcpy(scalename, DS_31_NAME); + HDstrcat(scalename, "as"); + HDstrcpy(name, SCALE_31_NAME); + HDstrcat(name, "as"); if(test_set_scalename(fid, did, scalename, name, DIM2) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM2) < 0) goto out; - strcpy(scalename, DS_32_NAME); - strcat(scalename, "as"); - strcpy(name, SCALE_32_NAME); - strcat(name, "as"); + HDstrcpy(scalename, DS_32_NAME); + HDstrcat(scalename, "as"); + HDstrcpy(name, SCALE_32_NAME); + HDstrcat(name, "as"); if(test_set_scalename(fid, did, scalename, name, DIM2) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM2) < 0) goto out; - strcpy(scalename, DS_33_NAME); - strcat(scalename, "as"); - strcpy(name, SCALE_33_NAME); - strcat(name, "as"); + HDstrcpy(scalename, DS_33_NAME); + HDstrcat(scalename, "as"); + HDstrcpy(name, SCALE_33_NAME); + HDstrcat(name, "as"); if(test_set_scalename(fid, did, scalename, name, DIM2) < 0) goto out; @@ -1964,58 +1964,58 @@ static int test_int_scalenames(const char *fileext) { char dsname[32]; char scalename[32]; char name[32]; - strcpy(dsname, DATASET_NAME); - strcat(dsname, "a"); + HDstrcpy(dsname, DATASET_NAME); + HDstrcat(dsname, "a"); if((fid = open_test_file(fileext)) < 0) goto out; TESTING2("set int scale/cmp scale name"); if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - strcpy(scalename, DS_1_NAME); - strcat(scalename, "a"); - strcpy(name, SCALE_1_NAME); - strcat(name, "a"); + HDstrcpy(scalename, DS_1_NAME); + HDstrcat(scalename, "a"); + HDstrcpy(name, SCALE_1_NAME); + HDstrcat(name, "a"); if(test_set_scalename(fid, did, scalename, name, DIM0) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - strcpy(scalename, DS_11_NAME); - strcat(scalename, "a"); - strcpy(name, SCALE_11_NAME); - strcat(name, "a"); + HDstrcpy(scalename, DS_11_NAME); + HDstrcat(scalename, "a"); + HDstrcpy(name, SCALE_11_NAME); + HDstrcat(name, "a"); if(test_set_scalename(fid, did, scalename, name, DIM0) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - strcpy(scalename, DS_2_NAME); - strcat(scalename, "a"); - strcpy(name, SCALE_2_NAME); - strcat(name, "a"); + HDstrcpy(scalename, DS_2_NAME); + HDstrcat(scalename, "a"); + HDstrcpy(name, SCALE_2_NAME); + HDstrcat(name, "a"); if(test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - strcpy(scalename, DS_21_NAME); - strcat(scalename, "a"); - strcpy(name, SCALE_21_NAME); - strcat(name, "a"); + HDstrcpy(scalename, DS_21_NAME); + HDstrcat(scalename, "a"); + HDstrcpy(name, SCALE_21_NAME); + HDstrcat(name, "a"); if(test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - strcpy(scalename, DS_22_NAME); - strcat(scalename, "a"); - strcpy(name, SCALE_22_NAME); - strcat(name, "a"); + HDstrcpy(scalename, DS_22_NAME); + HDstrcat(scalename, "a"); + HDstrcpy(name, SCALE_22_NAME); + HDstrcat(name, "a"); if(test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; @@ -2050,48 +2050,48 @@ static int test_long_scalenames(const char *fileext) { char dsname[32]; char scalename[32]; char name[32]; - strcpy(dsname, DATASET_NAME); - strcat(dsname, "al"); + HDstrcpy(dsname, DATASET_NAME); + HDstrcat(dsname, "al"); if((fid = open_test_file(fileext)) < 0) goto out; TESTING2("set long scale/cmp scale name"); if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - strcpy(scalename, DS_1_NAME); - strcat(scalename, "al"); - strcpy(name, SCALE_1_NAME); - strcat(name, "al"); + HDstrcpy(scalename, DS_1_NAME); + HDstrcat(scalename, "al"); + HDstrcpy(name, SCALE_1_NAME); + HDstrcat(name, "al"); if(test_set_scalename(fid, did, scalename, name, DIM0) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - strcpy(scalename, DS_2_NAME); - strcat(scalename, "al"); - strcpy(name, SCALE_2_NAME); - strcat(name, "al"); + HDstrcpy(scalename, DS_2_NAME); + HDstrcat(scalename, "al"); + HDstrcpy(name, SCALE_2_NAME); + HDstrcat(name, "al"); if(test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - strcpy(scalename, DS_3_NAME); - strcat(scalename, "al"); - strcpy(name, SCALE_3_NAME); - strcat(name, "al"); + HDstrcpy(scalename, DS_3_NAME); + HDstrcat(scalename, "al"); + HDstrcpy(name, SCALE_3_NAME); + HDstrcat(name, "al"); if(test_set_scalename(fid, did, scalename, name, DIM2) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM2) < 0) goto out; - strcpy(scalename, DS_4_NAME); - strcat(scalename, "al"); - strcpy(name, SCALE_4_NAME); - strcat(name, "al"); + HDstrcpy(scalename, DS_4_NAME); + HDstrcat(scalename, "al"); + HDstrcpy(name, SCALE_4_NAME); + HDstrcat(name, "al"); if(test_set_scalename(fid, did, scalename, name, DIM3) < 0) goto out; @@ -2126,48 +2126,48 @@ static int test_samelong_scalenames(const char *fileext) { char dsname[32]; char scalename[32]; char name[32]; - strcpy(dsname, DATASET_NAME); - strcat(dsname, "al2"); + HDstrcpy(dsname, DATASET_NAME); + HDstrcat(dsname, "al2"); if((fid = open_test_file(fileext)) < 0) goto out; TESTING2("set same long scale/cmp scale name"); if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - strcpy(scalename, DS_1_NAME); - strcat(scalename, "al"); - strcpy(name, DS_1_NAME); - strcat(name, "al"); + HDstrcpy(scalename, DS_1_NAME); + HDstrcat(scalename, "al"); + HDstrcpy(name, DS_1_NAME); + HDstrcat(name, "al"); if(test_set_scalename(fid, did, scalename, name, DIM0) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - strcpy(scalename, DS_2_NAME); - strcat(scalename, "al"); - strcpy(name, DS_2_NAME); - strcat(name, "al"); + HDstrcpy(scalename, DS_2_NAME); + HDstrcat(scalename, "al"); + HDstrcpy(name, DS_2_NAME); + HDstrcat(name, "al"); if(test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - strcpy(scalename, DS_3_NAME); - strcat(scalename, "al"); - strcpy(name, DS_3_NAME); - strcat(name, "al"); + HDstrcpy(scalename, DS_3_NAME); + HDstrcat(scalename, "al"); + HDstrcpy(name, DS_3_NAME); + HDstrcat(name, "al"); if(test_set_scalename(fid, did, scalename, name, DIM2) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM2) < 0) goto out; - strcpy(scalename, DS_4_NAME); - strcat(scalename, "al"); - strcpy(name, DS_4_NAME); - strcat(name, "al"); + HDstrcpy(scalename, DS_4_NAME); + HDstrcat(scalename, "al"); + HDstrcpy(name, DS_4_NAME); + HDstrcat(name, "al"); if(test_set_scalename(fid, did, scalename, name, DIM3) < 0) goto out; @@ -2202,58 +2202,58 @@ static int test_float_scalenames(const char *fileext) { char dsname[32]; char scalename[32]; char name[32]; - strcpy(dsname, DATASET_NAME); - strcat(dsname, "af"); + HDstrcpy(dsname, DATASET_NAME); + HDstrcat(dsname, "af"); if((fid = open_test_file(fileext)) < 0) goto out; TESTING2("set float scale/cmp scale name"); if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - strcpy(scalename, DS_1_NAME); - strcat(scalename, "af"); - strcpy(name, SCALE_1_NAME); - strcat(name, "af"); + HDstrcpy(scalename, DS_1_NAME); + HDstrcat(scalename, "af"); + HDstrcpy(name, SCALE_1_NAME); + HDstrcat(name, "af"); if(test_set_scalename(fid, did, scalename, name, DIM0) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - strcpy(scalename, DS_11_NAME); - strcat(scalename, "af"); - strcpy(name, SCALE_11_NAME); - strcat(name, "af"); + HDstrcpy(scalename, DS_11_NAME); + HDstrcat(scalename, "af"); + HDstrcpy(name, SCALE_11_NAME); + HDstrcat(name, "af"); if(test_set_scalename(fid, did, scalename, name, DIM0) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - strcpy(scalename, DS_2_NAME); - strcat(scalename, "af"); - strcpy(name, SCALE_2_NAME); - strcat(name, "af"); + HDstrcpy(scalename, DS_2_NAME); + HDstrcat(scalename, "af"); + HDstrcpy(name, SCALE_2_NAME); + HDstrcat(name, "af"); if(test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - strcpy(scalename, DS_21_NAME); - strcat(scalename, "af"); - strcpy(name, SCALE_21_NAME); - strcat(name, "af"); + HDstrcpy(scalename, DS_21_NAME); + HDstrcat(scalename, "af"); + HDstrcpy(name, SCALE_21_NAME); + HDstrcat(name, "af"); if(test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - strcpy(scalename, DS_22_NAME); - strcat(scalename, "af"); - strcpy(name, SCALE_22_NAME); - strcat(name, "af"); + HDstrcpy(scalename, DS_22_NAME); + HDstrcat(scalename, "af"); + HDstrcpy(name, SCALE_22_NAME); + HDstrcat(name, "af"); if(test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; @@ -3046,13 +3046,11 @@ static int test_simple(void) *------------------------------------------------------------------------- */ - for(i=0; i<5; i++) - { + for(i=0; i<5; i++) { sprintf(dname,"dset_%d",i); if((did = H5Dopen2(gid,dname, H5P_DEFAULT)) < 0) goto out; - for(j=0; j<5; j++) - { + for(j=0; j<5; j++) { sprintf(sname,"ds_%d",j); if((dsid = H5Dopen2(gid,sname, H5P_DEFAULT)) < 0) goto out; @@ -3099,15 +3097,12 @@ static int test_simple(void) /* try to detach all dimensions. for dimensions 0 and 2, it is an error */ - for(i=0; i 4 ) + if ( HDstrlen( buffer ) > 4 ) { - fclose(file); + HDfclose(file); return -1; } if (sscanf(buffer, "%u", &nentries) != 1) { - fclose(file); + HDfclose(file); return -1; } /* ensure there are a sensible number of colors in the palette */ if ((nentries > 256) || (nentries > palette_size)) { - fclose(file); + HDfclose(file); return(-1); } @@ -867,7 +867,7 @@ static int read_palette(const char* fname, /* extract the red, green and blue color components. */ if (fscanf(file, "%u %u %u", &red, &green, &blue) != 3) { - fclose(file); + HDfclose(file); return -1; } /* store this palette entry */ @@ -877,7 +877,7 @@ static int read_palette(const char* fname, } /* close file */ - fclose(file); + HDfclose(file); return nentries; } diff --git a/hl/test/test_lite.c b/hl/test/test_lite.c index c7232e2a..4944143 100644 --- a/hl/test/test_lite.c +++ b/hl/test/test_lite.c @@ -367,7 +367,7 @@ static int test_dsets( void ) if ( H5LTread_dataset_string(file_id,DSET7_NAME,data_string_out) < 0 ) goto out; - if ( strcmp(data_string_in,data_string_out) != 0 ) + if ( HDstrcmp(data_string_in,data_string_out) != 0 ) goto out; @@ -536,7 +536,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name ) if ( H5LTget_attribute_string( loc_id, obj_name, ATTR1_NAME, attr_str_out ) < 0 ) return -1; - if ( strcmp( attr_str_in, attr_str_out ) != 0 ) + if ( HDstrcmp( attr_str_in, attr_str_out ) != 0 ) { return -1; } @@ -1015,25 +1015,25 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name ) TESTING("H5LTget_attribute_info"); - dims_out = (hsize_t*) malloc( sizeof(hsize_t) * rank_out ); + if(NULL==(dims_out = (hsize_t*) HDmalloc( sizeof(hsize_t) * rank_out ))) return -1; - if ( H5LTget_attribute_info( loc_id, obj_name, ATTR2_NAME, dims_out, &type_class, - &type_size) < 0 ) + if ( H5LTget_attribute_info( loc_id, obj_name, ATTR2_NAME, dims_out, &type_class, &type_size) < 0 ) { + HDfree( dims_out ); return -1; - - for (i = 0; i < rank_out; i++) - { + } + + for (i = 0; i < rank_out; i++) { if ( dims_out[i] != 5 ) { + HDfree( dims_out ); return -1; } } if ( type_class != H5T_INTEGER ) { + HDfree( dims_out ); return -1; } - - if ( dims_out ) - free( dims_out ); + HDfree( dims_out ); PASSED(); @@ -1066,12 +1066,18 @@ static int test_integers(void) if(H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len)<0) goto out; - dt_str = (char*)calloc(str_len, sizeof(char)); - if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) + + if(NULL==(dt_str = (char*)HDcalloc(str_len, sizeof(char)))) + goto out; + if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) { + HDfree(dt_str); goto out; - if(strcmp(dt_str, "H5T_STD_I8BE")) + } + if(HDstrcmp(dt_str, "H5T_STD_I8BE")) { + HDfree(dt_str); goto out; - free(dt_str); + } + HDfree(dt_str); if(H5Tclose(dtype)<0) goto out; @@ -1117,12 +1123,18 @@ static int test_fps(void) if(H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len)<0) goto out; - dt_str = (char*)calloc(str_len, sizeof(char)); - if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) + + if(NULL==(dt_str = (char*)HDcalloc(str_len, sizeof(char)))) + goto out; + if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) { + HDfree(dt_str); goto out; - if(strcmp(dt_str, "H5T_IEEE_F32BE")) + } + if(HDstrcmp(dt_str, "H5T_IEEE_F32BE")) { + HDfree(dt_str); goto out; - free(dt_str); + } + HDfree(dt_str); if(H5Tclose(dtype)<0) goto out; @@ -1180,14 +1192,18 @@ static int test_strings(void) if(H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len)<0) goto out; - dt_str = (char*)calloc(str_len, sizeof(char)); - if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) + if(NULL==(dt_str = (char*)HDcalloc(str_len, sizeof(char)))) goto out; - if(strcmp(dt_str, "H5T_STRING {\n STRSIZE 13;\n STRPAD H5T_STR_NULLTERM;\n CSET H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }")) { + if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) { + HDfree(dt_str); + goto out; + } + if(HDstrcmp(dt_str, "H5T_STRING {\n STRSIZE 13;\n STRPAD H5T_STR_NULLTERM;\n CSET H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }")) { printf("dt=\n%s\n", dt_str); + HDfree(dt_str); goto out; } - free(dt_str); + HDfree(dt_str); if(H5Tclose(dtype)<0) goto out; @@ -1208,14 +1224,18 @@ static int test_strings(void) if(H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len)<0) goto out; - dt_str = (char*)calloc(str_len, sizeof(char)); - if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) + if(NULL==(dt_str = (char*)HDcalloc(str_len, sizeof(char)))) goto out; - if(strcmp(dt_str, "H5T_STRING {\n STRSIZE H5T_VARIABLE;\n STRPAD H5T_STR_NULLPAD;\n CSET H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }")) { + if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) { + HDfree(dt_str); + goto out; + } + if(HDstrcmp(dt_str, "H5T_STRING {\n STRSIZE H5T_VARIABLE;\n STRPAD H5T_STR_NULLPAD;\n CSET H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }")) { printf("dt=\n%s\n", dt_str); + HDfree(dt_str); goto out; } - free(dt_str); + HDfree(dt_str); if(H5Tclose(dtype)<0) goto out; @@ -1257,14 +1277,18 @@ static int test_opaques(void) if(H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len)<0) goto out; - dt_str = (char*)calloc(str_len, sizeof(char)); - if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) + if(NULL==(dt_str = (char*)HDcalloc(str_len, sizeof(char)))) goto out; - if(strcmp(dt_str, "H5T_OPAQUE {\n OPQ_SIZE 19;\n OPQ_TAG \"This is a tag for opaque type\";\n }")) { + if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) { + HDfree(dt_str); + goto out; + } + if(HDstrcmp(dt_str, "H5T_OPAQUE {\n OPQ_SIZE 19;\n OPQ_TAG \"This is a tag for opaque type\";\n }")) { printf("dt=\n%s\n", dt_str); + HDfree(dt_str); goto out; } - free(dt_str); + HDfree(dt_str); if(H5Tclose(dtype)<0) goto out; @@ -1311,7 +1335,7 @@ static int test_enums(void) if(H5Tenum_nameof(dtype, &value1, name1, size)<0) goto out; - if(strcmp(name1, "BLUE")) + if(HDstrcmp(name1, "BLUE")) goto out; if(H5Tenum_valueof(dtype, name2, &value2)<0) @@ -1328,16 +1352,20 @@ static int test_enums(void) if(H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len)<0) goto out; - dt_str = (char*)calloc(str_len, sizeof(char)); - if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) + if(NULL==(dt_str = (char*)HDcalloc(str_len, sizeof(char)))) + goto out; + if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) { + HDfree(dt_str); goto out; - if(strcmp(dt_str, "H5T_ENUM {\n H5T_STD_I32LE;\n \"RED\" 5;\n \"GREEN\" 6;\n \"BLUE\" 7;\n \"WHITE\" 8;\n }")) { + } + if(HDstrcmp(dt_str, "H5T_ENUM {\n H5T_STD_I32LE;\n \"RED\" 5;\n \"GREEN\" 6;\n \"BLUE\" 7;\n \"WHITE\" 8;\n }")) { printf("dt=\n%s\n", dt_str); + HDfree(dt_str); goto out; } - free(dt_str); + HDfree(dt_str); if(H5Tclose(dtype)<0) goto out; @@ -1385,14 +1413,18 @@ static int test_variables(void) if(H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len)<0) goto out; - dt_str = (char*)calloc(str_len, sizeof(char)); - if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) + if(NULL==(dt_str = (char*)HDcalloc(str_len, sizeof(char)))) + goto out; + if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) { + HDfree(dt_str); goto out; - if(strcmp(dt_str, "H5T_VLEN {\n H5T_VLEN {\n H5T_STD_I32BE\n }\n }")) { + } + if(HDstrcmp(dt_str, "H5T_VLEN {\n H5T_VLEN {\n H5T_STD_I32BE\n }\n }")) { printf("dt=\n%s\n", dt_str); + HDfree(dt_str); goto out; } - free(dt_str); + HDfree(dt_str); if(H5Tclose(dtype)<0) goto out; @@ -1440,15 +1472,19 @@ static int test_arrays(void) if(H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len)<0) goto out; - dt_str = (char*)calloc(str_len, sizeof(char)); - if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) + if(NULL==(dt_str = (char*)HDcalloc(str_len, sizeof(char)))) + goto out; + if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) { + HDfree(dt_str); goto out; - if(strcmp(dt_str, "H5T_ARRAY {\n [5][7][13] H5T_ARRAY {\n [17][19] H5T_COMPOUND {\n H5T_STD_I8BE \"arr_compound_1\" : 0;\n H5T_STD_I32BE \"arr_compound_2\" : 1;\n }\n }\n }")) { + } + if(HDstrcmp(dt_str, "H5T_ARRAY {\n [5][7][13] H5T_ARRAY {\n [17][19] H5T_COMPOUND {\n H5T_STD_I8BE \"arr_compound_1\" : 0;\n H5T_STD_I32BE \"arr_compound_2\" : 1;\n }\n }\n }")) { printf("dt=\n%s\n", dt_str); + HDfree(dt_str); goto out; } - free(dt_str); + HDfree(dt_str); if(H5Tclose(dtype)<0) goto out; @@ -1492,14 +1528,18 @@ static int test_compounds(void) if(H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len)<0) goto out; - dt_str = (char*)calloc(str_len, sizeof(char)); - if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) + if(NULL==(dt_str = (char*)HDcalloc(str_len, sizeof(char)))) + goto out; + if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) { + HDfree(dt_str); goto out; - if(strcmp(dt_str, "H5T_COMPOUND {\n H5T_STD_I16BE \"one_field\" : 2;\n H5T_STD_U8LE \"two_field\" : 6;\n }")) { + } + if(HDstrcmp(dt_str, "H5T_COMPOUND {\n H5T_STD_I16BE \"one_field\" : 2;\n H5T_STD_U8LE \"two_field\" : 6;\n }")) { printf("dt=\n%s\n", dt_str); + HDfree(dt_str); goto out; } - free(dt_str); + HDfree(dt_str); if(H5Tclose(dtype)<0) goto out; @@ -1509,9 +1549,11 @@ static int test_compounds(void) if((memb_name = H5Tget_member_name(dtype, 1)) == NULL) goto out; - if(strcmp(memb_name, "i16_field")) + if(HDstrcmp(memb_name, "i16_field")) { + HDfree(memb_name); goto out; - free(memb_name); + } + HDfree(memb_name); if((memb_class = H5Tget_member_class(dtype, 2))<0) goto out; @@ -1575,17 +1617,22 @@ static int test_compound_bug(void) if((memb_name = H5Tget_member_name(dtype, 2)) == NULL) goto out; - if(strcmp(memb_name, "sub")) + if(HDstrcmp(memb_name, "sub")) { + HDfree(memb_name); goto out; - free(memb_name); + } + HDfree(memb_name); if(H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len)<0) goto out; - dt_str = (char*)calloc(str_len, sizeof(char)); - if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) + if(NULL==(dt_str = (char*)HDcalloc(str_len, sizeof(char)))) + goto out; + if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) { + HDfree(dt_str); goto out; - free(dt_str); + } + HDfree(dt_str); if(H5Tclose(dtype)<0) goto out; @@ -1607,18 +1654,23 @@ static int test_compound_bug(void) if((memb_name = H5Tget_member_name(dtype, 1)) == NULL) goto out; - if(strcmp(memb_name, "desc_________________________________________________________________________________________")) + if(HDstrcmp(memb_name, "desc_________________________________________________________________________________________")) { + HDfree(memb_name); goto out; - free(memb_name); + } + HDfree(memb_name); if(H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len)<0) goto out; - dt_str = (char*)calloc(str_len, sizeof(char)); - if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) + if(NULL==(dt_str = (char*)HDcalloc(str_len, sizeof(char)))) goto out; + if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) { + HDfree(dt_str); + goto out; + } - free(dt_str); + HDfree(dt_str); if(H5Tclose(dtype)<0) goto out; @@ -1648,7 +1700,7 @@ static int test_complicated_compound(void) TESTING3(" text for complicated compound types"); /* Open input file */ - fp = fopen(filename, "r"); + fp = HDfopen(filename, "r"); if(fp == NULL) { printf( "Could not find file %s. Try set $srcdir \n", filename); goto out; @@ -1658,23 +1710,23 @@ static int test_complicated_compound(void) * Library has convenient function getline() but isn't available on * all machines. */ - if((line = (char*)calloc(size, sizeof(char)))==NULL) + if((line = (char*)HDcalloc(size, sizeof(char)))==NULL) goto out; - if(fgets(line, (int)size, fp)==NULL) + if(HDfgets(line, (int)size, fp)==NULL) goto out; - while(strlen(line)==size-1) { + while(HDstrlen(line)==size-1) { size *= 2; if(line) - free(line); - if((line = (char*)calloc(size, sizeof(char)))==NULL) + HDfree(line); + if((line = (char*)HDcalloc(size, sizeof(char)))==NULL) goto out; - if(fseek(fp, 0L, SEEK_SET)!=0) + if(HDfseek(fp, 0L, SEEK_SET)!=0) goto out; - if(fgets(line, (int)size, fp)==NULL) + if(HDfgets(line, (int)size, fp)==NULL) goto out; } - fclose(fp); + HDfclose(fp); fp = NULL; if((dtype = H5LTtext_to_dtype(line, H5LT_DDL))<0) @@ -1692,7 +1744,7 @@ static int test_complicated_compound(void) goto out; if(line) - free(line); + HDfree(line); PASSED(); return 0; @@ -1700,9 +1752,9 @@ static int test_complicated_compound(void) out: if(line) - free(line); + HDfree(line); if(fp) - fclose(fp); + HDfclose(fp); H5_FAILED(); return -1; diff --git a/hl/test/test_packet.c b/hl/test/test_packet.c index 3c258c1..9d3074d 100644 --- a/hl/test/test_packet.c +++ b/hl/test/test_packet.c @@ -72,7 +72,7 @@ static particle_t testPart[NRECORDS] = { */ static int cmp_par(size_t i, size_t j, particle_t *rbuf, particle_t *wbuf ) { - if ( ( strcmp( rbuf[i].name, wbuf[j].name ) != 0 ) || + if ( ( HDstrcmp( rbuf[i].name, wbuf[j].name ) != 0 ) || rbuf[i].lati != wbuf[j].lati || rbuf[i].longi != wbuf[j].longi || rbuf[i].pressure != wbuf[j].pressure || @@ -127,7 +127,7 @@ static int create_hl_table(hid_t fid) /* Define field information */ const char *field_names[NFIELDS] = - { "Name","Latitude", "Longitude", "Pressure", "Temperature" }; + { "Name","Latitude", "Longitude", "Pressure", "Temperature" }; hid_t field_type[NFIELDS]; hid_t string_type; hsize_t chunk_size = 10; @@ -182,7 +182,7 @@ static int test_create_close(hid_t fid) /* Create a datatype for the particle struct */ part_t = make_particle_type(); - assert(part_t != -1); + HDassert(part_t != -1); /* Create the table */ table = H5PTcreate_fl(fid, PT_NAME, part_t, (hsize_t)100, -1); @@ -460,7 +460,7 @@ static int test_big_table(hid_t fid) /* Create a datatype for the particle struct */ part_t = make_particle_type(); - assert(part_t != -1); + HDassert(part_t != -1); /* Create a new table */ table = H5PTcreate_fl(fid, "Packet Test Dataset2", part_t, (hsize_t)33, -1); @@ -712,7 +712,7 @@ static int test_opaque(hid_t fid) if ((part_t = H5Tcreate (H5T_OPAQUE, sizeof(particle_t) )) < 0 ) return -1; - assert(part_t != -1); + HDassert(part_t != -1); /* Tag the opaque datatype */ if ( H5Tset_tag(part_t, "Opaque Particle" ) < 0) @@ -787,7 +787,7 @@ test_compress(void) /* Create a datatype for the particle struct */ part_t = make_particle_type(); - assert(part_t != -1); + HDassert(part_t != -1); /* Create a new table with compression level 8 */ table = H5PTcreate_fl(fid1, "Compressed Test Dataset", part_t, (hsize_t)80, 8); @@ -1059,7 +1059,7 @@ int main(void) /* create a file using default properties */ fid=H5Fcreate(TEST_FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - puts("Testing packet table"); + HDputs("Testing packet table"); /* run tests */ if ( test_packet_table(fid) < 0) diff --git a/hl/test/test_table.c b/hl/test/test_table.c index 0fc4c84..e3e040e 100644 --- a/hl/test/test_table.c +++ b/hl/test/test_table.c @@ -129,8 +129,8 @@ static hid_t h5file_open(const char *fname, unsigned flags) /* open */ if ((fid = H5Fopen(data_file,flags,H5P_DEFAULT))<0) { - fprintf(stderr,"Error: Cannot open file <%s>\n",data_file ); - exit(1); + HDfprintf(stderr,"Error: Cannot open file <%s>\n",data_file ); + HDexit(1); } return fid; @@ -142,16 +142,16 @@ static hid_t h5file_open(const char *fname, unsigned flags) */ static int cmp_par(hsize_t i, hsize_t j, particle_t *rbuf, particle_t *wbuf ) { - if ( ( strcmp( rbuf[i].name, wbuf[j].name ) != 0 ) || + if ( ( HDstrcmp( rbuf[i].name, wbuf[j].name ) != 0 ) || rbuf[i].lati != wbuf[j].lati || rbuf[i].longi != wbuf[j].longi || rbuf[i].pressure != wbuf[j].pressure || rbuf[i].temperature != wbuf[j].temperature ) { - fprintf(stderr,"read and write buffers have differences\n"); - fprintf(stderr,"%s %ld %f %f %d\n", + HDfprintf(stderr,"read and write buffers have differences\n"); + HDfprintf(stderr,"%s %ld %f %f %d\n", rbuf[i].name,rbuf[i].longi,rbuf[i].pressure,rbuf[i].temperature,rbuf[i].lati); - fprintf(stderr,"%s %ld %f %f %d\n", + HDfprintf(stderr,"%s %ld %f %f %d\n", wbuf[j].name,wbuf[j].longi,wbuf[j].pressure,wbuf[j].temperature,wbuf[j].lati); return -1; } @@ -495,9 +495,9 @@ static int test_table(hid_t fid, int do_write) *------------------------------------------------------------------------- */ if(do_write) - strcpy(tname,"table2"); + HDstrcpy(tname,"table2"); else - strcpy(tname,"table1"); + HDstrcpy(tname,"table1"); rstart=0; rrecords=8; @@ -645,7 +645,7 @@ static int test_table(hid_t fid, int do_write) wbufd[i].longi = wbuf[i].longi; wbufd[i].pressure = wbuf[i].pressure; wbufd[i].temperature = wbuf[i].temperature; - strcpy(wbufd[i].name, wbuf[i].name ); + HDstrcpy(wbufd[i].name, wbuf[i].name ); } @@ -1027,9 +1027,9 @@ static int test_table(hid_t fid, int do_write) rbuf[i].longi != position_in[i-NRECORDS_ADD+1].longi || rbuf[i].pressure != pressure_in[i-NRECORDS_ADD+1] ) { - fprintf(stderr,"%ld %f %d\n", + HDfprintf(stderr,"%ld %f %d\n", rbuf[i].longi,rbuf[i].pressure,rbuf[i].lati); - fprintf(stderr,"%ld %f %d\n", + HDfprintf(stderr,"%ld %f %d\n", position_in[i].longi,pressure_in[i],position_in[i].lati); goto out; } @@ -1144,7 +1144,7 @@ static int test_table(hid_t fid, int do_write) /* Compare the extracted table with the initial values */ for( i = 0; i < NRECORDS; i++ ) { - if ( ( strcmp( namepre_out[i].name, namepre_in[i].name ) != 0 ) || + if ( ( HDstrcmp( namepre_out[i].name, namepre_in[i].name ) != 0 ) || namepre_out[i].pressure != namepre_in[i].pressure ) { goto out; } @@ -1153,7 +1153,7 @@ static int test_table(hid_t fid, int do_write) /* reset buffer */ for( i = 0; i < NRECORDS; i++ ) { - strcpy( namepre_out[i].name, "\0" ); + HDstrcpy( namepre_out[i].name, "\0" ); namepre_out[i].pressure = -1; } @@ -1173,7 +1173,7 @@ static int test_table(hid_t fid, int do_write) for( i = 0; i < 3; i++ ) { hsize_t iistart = start; - if ( ( strcmp( namepre_out[i].name, namepre_in[iistart+i].name ) != 0 ) || + if ( ( HDstrcmp( namepre_out[i].name, namepre_in[iistart+i].name ) != 0 ) || namepre_out[i].pressure != namepre_in[iistart+i].pressure ) { goto out; } @@ -1351,7 +1351,7 @@ static int test_table(hid_t fid, int do_write) /* compare the extracted table with the initial values */ for( i = 0; i < NRECORDS; i++ ) { - if ( ( strcmp( namepre_out[i].name, namepre_in[i].name ) != 0 ) || + if ( ( HDstrcmp( namepre_out[i].name, namepre_in[i].name ) != 0 ) || namepre_out[i].pressure != namepre_in[i].pressure ) { goto out; } @@ -1360,7 +1360,7 @@ static int test_table(hid_t fid, int do_write) /* reset buffer */ for( i = 0; i < NRECORDS; i++ ) { - strcpy( namepre_out[i].name, "\0" ); + HDstrcpy( namepre_out[i].name, "\0" ); namepre_out[i].pressure = -1; } @@ -1382,7 +1382,7 @@ static int test_table(hid_t fid, int do_write) for( i = 0; i < 3; i++ ) { int iistart = (int) start; - if ( ( strcmp( namepre_out[i].name, wbuf[iistart+i].name ) != 0 ) || + if ( ( HDstrcmp( namepre_out[i].name, wbuf[iistart+i].name ) != 0 ) || namepre_out[i].pressure != wbuf[iistart+i].pressure ) { goto out; } @@ -1423,7 +1423,7 @@ static int test_table(hid_t fid, int do_write) /* compare the extracted table with the original array */ for( i = 0; i < NRECORDS; i++ ) { - if ( ( strcmp( rbuf2[i].name, wbuf[i].name ) != 0 ) || + if ( ( HDstrcmp( rbuf2[i].name, wbuf[i].name ) != 0 ) || rbuf2[i].lati != wbuf[i].lati || rbuf2[i].longi != wbuf[i].longi || rbuf2[i].pressure != wbuf[i].pressure || @@ -1464,7 +1464,7 @@ static int test_table(hid_t fid, int do_write) /* compare the extracted table with the original array */ for( i = 0; i < NRECORDS; i++ ) { - if ( ( strcmp( rbuf3[i].name, wbuf[i].name ) != 0 ) || + if ( ( HDstrcmp( rbuf3[i].name, wbuf[i].name ) != 0 ) || rbuf3[i].lati != wbuf[i].lati || rbuf3[i].longi != wbuf[i].longi || rbuf3[i].temperature != wbuf[i].temperature ) { @@ -1509,10 +1509,10 @@ static int test_table(hid_t fid, int do_write) TESTING2("getting field info"); /* alocate */ - names_out = (char**) malloc( sizeof(char*) * (size_t)NFIELDS ); + names_out = (char**) HDmalloc( sizeof(char*) * (size_t)NFIELDS ); for ( i = 0; i < NFIELDS; i++) { - names_out[i] = (char*) malloc( sizeof(char) * 255 ); + names_out[i] = (char*) HDmalloc( sizeof(char) * 255 ); } /* Get field info */ @@ -1521,7 +1521,7 @@ static int test_table(hid_t fid, int do_write) for ( i = 0; i < NFIELDS; i++) { - if ( (strcmp( field_names[i], names_out[i] ) != 0)) { + if ( (HDstrcmp( field_names[i], names_out[i] ) != 0)) { goto out; } } @@ -1529,9 +1529,9 @@ static int test_table(hid_t fid, int do_write) /* release */ for ( i = 0; i < NFIELDS; i++) { - free ( names_out[i] ); + HDfree ( names_out[i] ); } - free ( names_out ); + HDfree ( names_out ); PASSED(); @@ -1564,7 +1564,7 @@ int main(void) /* create a file using default properties */ fid=H5Fcreate("test_table.h5",H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT); - puts("Testing table with file creation mode (read/write in native architecture):"); + HDputs("Testing table with file creation mode (read/write in native architecture):"); /* test, do write */ if (test_table(fid,1)<0) @@ -1577,7 +1577,7 @@ int main(void) * test2: open a file written in test1 on a big-endian machine *------------------------------------------------------------------------- */ - puts("Testing table with file open mode (read big-endian data):"); + HDputs("Testing table with file open mode (read big-endian data):"); fid=h5file_open(TEST_FILE_BE,flags); @@ -1592,7 +1592,7 @@ int main(void) * test3: open a file written in test1 on a little-endian machine *------------------------------------------------------------------------- */ - puts("Testing table with file open mode (read little-endian data):"); + HDputs("Testing table with file open mode (read little-endian data):"); fid=h5file_open(TEST_FILE_LE,flags); @@ -1607,7 +1607,7 @@ int main(void) * test4: open a file written in test1 on the Cray T3 machine *------------------------------------------------------------------------- */ - puts("Testing table with file open mode (read Cray data):"); + HDputs("Testing table with file open mode (read Cray data):"); fid=h5file_open(TEST_FILE_CRAY,flags); diff --git a/test/big.c b/test/big.c index 24b2d25..dffbbeb 100644 --- a/test/big.c +++ b/test/big.c @@ -22,14 +22,14 @@ /* * The purpose of this test is to verify if a virtual file driver can handle: * a. Large file (2GB) - * This should exceed 32bits I/O system since offset is a signed - * integral type (in order to support negative offset with respect to - * end of file). + * This should exceed 32bits I/O system since offset is a signed + * integral type (in order to support negative offset with respect to + * end of file). * b. Extra Large file (4GB) - * This definite exceeds 32bit I/O and file systems. + * This definite exceeds 32bit I/O and file systems. * c. Huge file (tens of GB) - * This verifies the HDF5 library handles big logical file size - * correctly. + * This verifies the HDF5 library handles big logical file size + * correctly. * In practice, if a VFD can handle a big file size, there is no need to * test the smaller file sizes. E.g., If it can handle the Huge file, * there is no need to test the Extra large or Large files. Therefore the @@ -81,15 +81,15 @@ typedef enum vfd_t { SEC2_VFD, STDIO_VFD, FAMILY_VFD } vfd_t; fsizes_t file_size= NOFILE; const char *FILENAME[] = { - "big", - "sec2", - "stdio", - NULL + "big", + "sec2", + "stdio", + NULL }; -int cflag=1; /* check file system before test */ -int sparse_support=0; /* sparse file supported, default false */ -int have_space=0; /* enough space for huge file test, default false */ -hsize_t family_size_def=FAMILY_SIZE; /* default family file size */ +int cflag=1; /* check file system before test */ +int sparse_support=0; /* sparse file supported, default false */ +int have_space=0; /* enough space for huge file test, default false */ +hsize_t family_size_def=FAMILY_SIZE; /* default family file size */ /* Protocols */ static void usage(void); @@ -216,55 +216,55 @@ supports_big(vfd_t vfd) case FAMILY_VFD: case SEC2_VFD: case STDIO_VFD: - if ((fd=HDopen("y.h5", O_RDWR|O_TRUNC|O_CREAT, 0666)) < 0) - goto error; - - /* Write a few byte at the beginning */ - if (5!=HDwrite(fd, "hello", (size_t)5)) - goto quit; - fsize = SFILE; - - /* Write a few bytes at 2GB */ - if (HDlseek(fd, 2*GB, SEEK_SET)!=2*GB) - goto quit; - if (5!=HDwrite(fd, "hello", (size_t)5)) - goto quit; - fsize = LFILE; - - /* Write a few bytes at 4GB */ - if (HDlseek(fd, 4*GB, SEEK_SET) != 4*GB) - goto quit; - if (5!=HDwrite(fd, "hello", (size_t)5)) - goto quit; - fsize = XLFILE; - - /* If this supports sparse_file, write a few bytes at 32GB */ - if (!sparse_support) - goto quit; - if (HDlseek(fd, 32*GB, SEEK_SET) != 32*GB) - goto quit; - if (5!=HDwrite(fd, "hello", (size_t)5)) - goto quit; - fsize = HUGEFILE; - - break; + if ((fd=HDopen("y.h5", O_RDWR|O_TRUNC|O_CREAT, 0666)) < 0) + goto error; + + /* Write a few byte at the beginning */ + if (5!=HDwrite(fd, "hello", (size_t)5)) + goto quit; + fsize = SFILE; + + /* Write a few bytes at 2GB */ + if (HDlseek(fd, 2*GB, SEEK_SET)!=2*GB) + goto quit; + if (5!=HDwrite(fd, "hello", (size_t)5)) + goto quit; + fsize = LFILE; + + /* Write a few bytes at 4GB */ + if (HDlseek(fd, 4*GB, SEEK_SET) != 4*GB) + goto quit; + if (5!=HDwrite(fd, "hello", (size_t)5)) + goto quit; + fsize = XLFILE; + + /* If this supports sparse_file, write a few bytes at 32GB */ + if (!sparse_support) + goto quit; + if (HDlseek(fd, 32*GB, SEEK_SET) != 32*GB) + goto quit; + if (5!=HDwrite(fd, "hello", (size_t)5)) + goto quit; + fsize = HUGEFILE; + + break; default: - /* unknown or unsupported VFD */ - goto error; - break; + /* unknown or unsupported VFD */ + goto error; + break; } - + quit: if (HDclose(fd) < 0) - goto error; + goto error; if (HDremove("y.h5") < 0) - goto error; + goto error; return(fsize); error: if (fd >= 0){ - HDclose(fd); - HDremove("y.h5"); + HDclose(fd); + HDremove("y.h5"); } return (fsize); } @@ -300,30 +300,30 @@ enough_room(hid_t fapl) for (i=0; i=0; i++) { - HDsnprintf(name, sizeof name, filename, i); - if(HDclose(fd[i]) < 0) + HDsnprintf(name, sizeof name, filename, i); + if(HDclose(fd[i]) < 0) ret_value=0; - HDremove(name); + HDremove(name); } return ret_value; @@ -356,43 +356,43 @@ writer (char* filename, hid_t fapl, fsizes_t testsize, int wrt_n) hsize_t hs_start[1]; hsize_t hs_size[1]; hid_t file=-1, space1=-1, space2=-1, mem_space=-1, d1=-1, d2=-1; - int *buf = (int*)malloc (sizeof(int) * WRT_SIZE); + int *buf = (int*)HDmalloc (sizeof(int) * WRT_SIZE); int i, j; - FILE *out = fopen(DNAME, "w"); + FILE *out = HDfopen(DNAME, "w"); hid_t dcpl; switch(testsize){ case LFILE: - TESTING("Large dataset write(2GB)"); - /* reduce size1 to produce a 2GB dataset */ - size1[1] = 1024/16; - size2[0] /= 16; - break; + TESTING("Large dataset write(2GB)"); + /* reduce size1 to produce a 2GB dataset */ + size1[1] = 1024/16; + size2[0] /= 16; + break; case XLFILE: - TESTING("Extra large dataset write(4GB)"); - /* reduce size1 to produce a 4GB dataset */ - size1[1] = 1024/8; - size2[0] /= 8; - break; + TESTING("Extra large dataset write(4GB)"); + /* reduce size1 to produce a 4GB dataset */ + size1[1] = 1024/8; + size2[0] /= 8; + break; case HUGEFILE: - TESTING("Huge dataset write"); - /* Leave size1 as 32GB */ - break; + TESTING("Huge dataset write"); + /* Leave size1 as 32GB */ + break; case SFILE: - TESTING("small dataset write(1GB)"); - /* reduce size1 to produce a 1GB dataset */ - size1[1] = 1024/32; - size2[0] /= 32; - break; + TESTING("small dataset write(1GB)"); + /* reduce size1 to produce a 1GB dataset */ + size1[1] = 1024/32; + size2[0] /= 32; + break; case NOFILE: - /* what to do?? */ - HDfprintf(stdout, "Unexpected file size of NOFILE\n"); - goto error; - break; + /* what to do?? */ + HDfprintf(stdout, "Unexpected file size of NOFILE\n"); + goto error; + break; } /* @@ -400,30 +400,30 @@ writer (char* filename, hid_t fapl, fsizes_t testsize, int wrt_n) * which is a family of files. Each member of the family will be 1GB */ if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) { - goto error; + goto error; } /* Create simple data spaces according to the size specified above. */ if ((space1 = H5Screate_simple (4, size1, size1)) < 0 || - (space2 = H5Screate_simple (1, size2, size2)) < 0) { - goto error; + (space2 = H5Screate_simple (1, size2, size2)) < 0) { + goto error; } /* Create the datasets */ -/* - * The fix below is provided for bug#921 - * H5Dcreate with H5P_DEFAULT creation properties - * will create a set of solid 1GB files; test will crash if quotas are enforced - * or it will take some time to write a file. - * We should create a dataset allocating space late and never writing fill values. - * EIP 4/8/03 -*/ + /* + * The fix below is provided for bug#921 + * H5Dcreate with H5P_DEFAULT creation properties + * will create a set of solid 1GB files; test will crash if quotas are enforced + * or it will take some time to write a file. + * We should create a dataset allocating space late and never writing fill values. + * EIP 4/8/03 + */ dcpl = H5Pcreate(H5P_DATASET_CREATE); H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_LATE); H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER); if((d1 = H5Dcreate2(file, "d1", H5T_NATIVE_INT, space1, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0 || - (d2 = H5Dcreate2(file, "d2", H5T_NATIVE_INT, space2, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) { - goto error; + (d2 = H5Dcreate2(file, "d2", H5T_NATIVE_INT, space2, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) { + goto error; } @@ -431,15 +431,15 @@ writer (char* filename, hid_t fapl, fsizes_t testsize, int wrt_n) hs_size[0] = WRT_SIZE; if ((mem_space = H5Screate_simple (1, hs_size, hs_size)) < 0) goto error; for (i=0; i}\n" - "\t-h\tPrint the help page\n" - "\t-c\tFile system Checking skipped. Caution: this test generates\n" - "\t\tmany big files and may fill up the file system.\n" - "\t-fsize\tChange family size default to where is\n" - "\t\ta positive float point number. Default value is %Hu.\n" - "Examples:\n" - "\tbig -fsize 2.1e9 \t# test with file size just under 2GB\n" - "\tbig -fsize 2.2e9 \t# test with file size just above 2GB\n" - "\tBe sure the file system can support the file size requested\n" - , (hsize_t)FAMILY_SIZE); + "Usage: big [-h] [-c] [-fsize }\n" + "\t-h\tPrint the help page\n" + "\t-c\tFile system Checking skipped. Caution: this test generates\n" + "\t\tmany big files and may fill up the file system.\n" + "\t-fsize\tChange family size default to where is\n" + "\t\ta positive float point number. Default value is %Hu.\n" + "Examples:\n" + "\tbig -fsize 2.1e9 \t# test with file size just under 2GB\n" + "\tbig -fsize 2.2e9 \t# test with file size just above 2GB\n" + "\tBe sure the file system can support the file size requested\n" + , (hsize_t)FAMILY_SIZE); } - + /* Flush stdout at the end of this test routine to ensure later output to */ /* stderr will not come out before it.*/ int testvfd(vfd_t vfd) @@ -611,107 +611,107 @@ int testvfd(vfd_t vfd) switch(vfd){ case FAMILY_VFD: - /* Test huge file with the family driver */ - puts("Testing big file with the Family Driver "); - if ((fapl=H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto error; - - if (H5Pset_fapl_family(fapl, family_size_def, H5P_DEFAULT) < 0) - goto error; - - if (cflag){ - /* - * We shouldn't run this test if the file system doesn't support holes - * because we would generate multi-gigabyte files. - */ - puts("Checking if file system is adequate for this test..."); - if (sizeof(long long)<8 || 0==GB8LL) { - puts("Test skipped because sizeof(long long) is too small. This"); - puts("hardware apparently doesn't support 64-bit integer types."); - usage(); - goto quit; - } - if (!sparse_support) { - puts("Test skipped because file system does not support holes."); - usage(); - goto quit; - } - if (!enough_room(fapl)) { - puts("Test skipped because of quota (file size or num open files)."); - usage(); - goto quit; - } - } - - /* Do the test with the Family Driver */ - h5_fixname(FILENAME[0], fapl, filename, sizeof filename); - - if (writer(filename, fapl, HUGEFILE, WRT_N)) goto error; - if (reader(filename, fapl)) goto error; - - puts("Test passed with the Family Driver."); - break; + /* Test huge file with the family driver */ + HDputs("Testing big file with the Family Driver "); + if ((fapl=H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto error; + + if (H5Pset_fapl_family(fapl, family_size_def, H5P_DEFAULT) < 0) + goto error; + + if (cflag){ + /* + * We shouldn't run this test if the file system doesn't support holes + * because we would generate multi-gigabyte files. + */ + HDputs("Checking if file system is adequate for this test..."); + if (sizeof(long long)<8 || 0==GB8LL) { + HDputs("Test skipped because sizeof(long long) is too small. This"); + HDputs("hardware apparently doesn't support 64-bit integer types."); + usage(); + goto quit; + } + if (!sparse_support) { + HDputs("Test skipped because file system does not support holes."); + usage(); + goto quit; + } + if (!enough_room(fapl)) { + HDputs("Test skipped because of quota (file size or num open files)."); + usage(); + goto quit; + } + } + + /* Do the test with the Family Driver */ + h5_fixname(FILENAME[0], fapl, filename, sizeof filename); + + if (writer(filename, fapl, HUGEFILE, WRT_N)) goto error; + if (reader(filename, fapl)) goto error; + + HDputs("Test passed with the Family Driver."); + break; case SEC2_VFD: - testsize = supports_big(SEC2_VFD); - if (testsize == NOFILE) { - HDfprintf(stdout, "Test for sec2 is skipped because file system does not support big files.\n"); - goto quit; - } - /* Test big file with the SEC2 driver */ - puts("Testing big file with the SEC2 Driver "); + testsize = supports_big(SEC2_VFD); + if (testsize == NOFILE) { + HDfprintf(stdout, "Test for sec2 is skipped because file system does not support big files.\n"); + goto quit; + } + /* Test big file with the SEC2 driver */ + HDputs("Testing big file with the SEC2 Driver "); - if ((fapl=H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto error; - if(H5Pset_fapl_sec2(fapl) < 0) - goto error; + if ((fapl=H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto error; + if(H5Pset_fapl_sec2(fapl) < 0) + goto error; - h5_fixname(FILENAME[1], fapl, filename, sizeof filename); + h5_fixname(FILENAME[1], fapl, filename, sizeof filename); - if (writer(filename, fapl, testsize, WRT_N)) goto error; - if (reader(filename, fapl)) goto error; + if (writer(filename, fapl, testsize, WRT_N)) goto error; + if (reader(filename, fapl)) goto error; - puts("Test passed with the SEC2 Driver."); - break; + HDputs("Test passed with the SEC2 Driver."); + break; case STDIO_VFD: - testsize = supports_big(STDIO_VFD); - if (testsize == NOFILE) { - HDfprintf(stdout, "Test for stdio is skipped because file system does not support big files.\n"); - goto quit; - } - puts("\nTesting big file with the STDIO Driver "); + testsize = supports_big(STDIO_VFD); + if (testsize == NOFILE) { + HDfprintf(stdout, "Test for stdio is skipped because file system does not support big files.\n"); + goto quit; + } + HDputs("\nTesting big file with the STDIO Driver "); - if ((fapl=H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto error; - if(H5Pset_fapl_stdio(fapl) < 0) - goto error; + if ((fapl=H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto error; + if(H5Pset_fapl_stdio(fapl) < 0) + goto error; - h5_fixname(FILENAME[2], fapl, filename, sizeof filename); + h5_fixname(FILENAME[2], fapl, filename, sizeof filename); - if (writer(filename, fapl, testsize, WRT_N)) goto error; - if (reader(filename, fapl)) goto error; - puts("Test passed with the STDIO Driver."); - break; + if (writer(filename, fapl, testsize, WRT_N)) goto error; + if (reader(filename, fapl)) goto error; + HDputs("Test passed with the STDIO Driver."); + break; default: - puts("Unsupprted VFD"); - usage(); - goto error;; + HDputs("Unsupprted VFD"); + usage(); + goto error;; } /* end of switch (vfd) */ quit: /* End with normal return code */ /* Clean up the test file */ if (h5_cleanup(FILENAME, fapl)) HDremove(DNAME); - fflush(stdout); + HDfflush(stdout); return 0; error: if (fapl>=0) H5Pclose(fapl); - puts("*** TEST FAILED ***"); - fflush(stdout); + HDputs("*** TEST FAILED ***"); + HDfflush(stdout); return 1; } @@ -748,58 +748,58 @@ main (int ac, char **av) /* parameters setup */ while (--ac > 0){ - av++; - if (strcmp("-fsize", *av)==0){ - /* specify a different family file size */ - ac--; av++; - if (ac > 0) { - family_size_def = (hsize_t)HDstrtoull(*av, NULL, 0); - } - else{ - printf("***Missing fsize value***\n"); - usage(); - return 1; - } - } - else if (strcmp("-c", *av)==0){ - /* turn off file system check before test */ - cflag=0; - } - else if (strcmp("-h", *av)==0){ - usage(); - return 0; - }else{ - usage(); - return 1; - } + av++; + if (HDstrcmp("-fsize", *av)==0){ + /* specify a different family file size */ + ac--; av++; + if (ac > 0) { + family_size_def = (hsize_t)HDstrtoull(*av, NULL, 0); + } + else{ + printf("***Missing fsize value***\n"); + usage(); + return 1; + } + } + else if (HDstrcmp("-c", *av)==0){ + /* turn off file system check before test */ + cflag=0; + } + else if (HDstrcmp("-h", *av)==0){ + usage(); + return 0; + }else{ + usage(); + return 1; + } } /* check sparse file support unless cflag is not set. */ if (cflag) - sparse_support = is_sparse(); + sparse_support = is_sparse(); /* Choose random # seed */ seed = (unsigned long)HDtime(NULL); #ifdef QAK -/* seed = (unsigned long)1155438845; */ -HDfprintf(stderr, "Random # seed was: %lu\n", seed); + /* seed = (unsigned long)1155438845; */ + HDfprintf(stderr, "Random # seed was: %lu\n", seed); #endif /* QAK */ HDsrandom(seed); -/*=================================================*/ + /*=================================================*/ if (testvfd(FAMILY_VFD) != 0) - goto error; + goto error; if (testvfd(SEC2_VFD) != 0) - goto error; + goto error; if (testvfd(STDIO_VFD) != 0) - goto error; + goto error; /* End with normal exit code */ return 0; error: - puts("*** TEST FAILED ***"); + HDputs("*** TEST FAILED ***"); return 1; } diff --git a/test/tmisc.c b/test/tmisc.c index cb61eaa..5539cee 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -15,7 +15,7 @@ /*********************************************************** * -* Test program: tmisc +* Test program: tmisc * * Test miscellaneous features not tested elsewhere. Generally * regression tests for bugs that are reported and don't @@ -23,7 +23,7 @@ * *************************************************************/ -#define H5D_PACKAGE /*suppress error about including H5Dpkg */ +#define H5D_PACKAGE /*suppress error about including H5Dpkg */ /* Define this macro to indicate that the testing APIs should be available */ #define H5D_TESTING @@ -31,10 +31,10 @@ #include "hdf5.h" #include "testhdf5.h" #include "H5srcdir.h" -#include "H5Dpkg.h" /* Datasets */ +#include "H5Dpkg.h" /* Datasets */ /* Definitions for misc. test #1 */ -#define MISC1_FILE "tmisc1.h5" +#define MISC1_FILE "tmisc1.h5" #define MISC1_VAL (13417386) /* 0xccbbaa */ #define MISC1_VAL2 (15654348) /* 0xeeddcc */ #define MISC1_DSET_NAME "/scalar_set" @@ -166,8 +166,8 @@ typedef struct /* Definitions for misc. test #12 */ #define MISC12_FILE "tmisc12.h5" #define MISC12_DSET_NAME "Dataset" -#define MISC12_SPACE1_RANK 1 -#define MISC12_SPACE1_DIM1 4 +#define MISC12_SPACE1_RANK 1 +#define MISC12_SPACE1_DIM1 4 #define MISC12_CHUNK_SIZE 2 #define MISC12_APPEND_SIZE 5 @@ -453,7 +453,7 @@ static void test_misc2_write_attribute(void) ret = H5Aread(att1, type, &data_check); CHECK(ret, FAIL, "H5Aread"); - free(data_check.string); + HDfree(data_check.string); ret = H5Aclose(att1); CHECK(ret, FAIL, "HAclose"); @@ -464,8 +464,6 @@ static void test_misc2_write_attribute(void) ret = H5Fclose(file1); CHECK(ret, FAIL, "H5Fclose"); - - root2 = H5Gopen2(file2, "/", H5P_DEFAULT); CHECK(root2, FAIL, "H5Gopen2"); @@ -480,7 +478,7 @@ static void test_misc2_write_attribute(void) ret = H5Aread(att2, type, &data_check); CHECK(ret, FAIL, "H5Aread"); - free(data_check.string); + HDfree(data_check.string); ret = H5Aclose(att2); CHECK(ret, FAIL, "HAclose"); @@ -497,8 +495,8 @@ static void test_misc2_write_attribute(void) ret = H5Fclose(file2); CHECK(ret, FAIL, "H5Fclose"); - free(string_att1); - free(string_att2); + HDfree(string_att1); + HDfree(string_att2); return; } @@ -524,7 +522,7 @@ static void test_misc2_read_attribute(const char *filename, const char *att_name ret = H5Aread(att, type, &data_check); CHECK(ret, FAIL, "H5Aread"); - free(data_check.string); + HDfree(data_check.string); ret = H5Aclose(att); CHECK(ret, FAIL, "H5Aclose"); @@ -732,7 +730,7 @@ delete_struct3(misc5_struct3_hndl *str3hndl) ret=H5Tclose(str3hndl->st3h_base); CHECK(ret,FAIL,"H5Tclose"); - free(str3hndl); + HDfree(str3hndl); } static void @@ -783,7 +781,7 @@ delete_struct2(misc5_struct2_hndl *str2hndl) H5Tclose(str2hndl->st2h_base); CHECK(ret,FAIL,"H5Tclose"); - free(str2hndl); + HDfree(str2hndl); } static void @@ -794,7 +792,7 @@ set_struct2(misc5_struct2 *buf) buf->st2_el1=MISC5_DBGELVAL2; buf->st2_el2.len=MISC5_DBGNELM3; - buf->st2_el2.p=malloc((buf->st2_el2.len)*sizeof(misc5_struct3)); + buf->st2_el2.p=HDmalloc((buf->st2_el2.len)*sizeof(misc5_struct3)); CHECK(buf->st2_el2.p,NULL,"malloc"); for(i=0; i<(buf->st2_el2.len); i++) @@ -804,7 +802,7 @@ set_struct2(misc5_struct2 *buf) static void clear_struct2(misc5_struct2 *buf) { - free(buf->st2_el2.p); + HDfree(buf->st2_el2.p); } /*********************** struct1 ***********************/ @@ -849,7 +847,7 @@ delete_struct1(misc5_struct1_hndl *str1hndl) ret=H5Tclose(str1hndl->st1h_base); CHECK(ret,FAIL,"H5Tclose"); - free(str1hndl); + HDfree(str1hndl); } static void @@ -860,7 +858,7 @@ set_struct1(misc5_struct1 *buf) buf->st1_el1=MISC5_DBGELVAL1; buf->st1_el2.len=MISC5_DBGNELM2; - buf->st1_el2.p=malloc((buf->st1_el2.len)*sizeof(misc5_struct2)); + buf->st1_el2.p=HDmalloc((buf->st1_el2.len)*sizeof(misc5_struct2)); CHECK(buf->st1_el2.p,NULL,"malloc"); for(i=0; i<(buf->st1_el2.len); i++) @@ -874,7 +872,7 @@ clear_struct1(misc5_struct1 *buf) for(i=0;ist1_el2.len;i++) clear_struct2(&((( misc5_struct2 *)(buf->st1_el2.p))[i])); - free(buf->st1_el2.p); + HDfree(buf->st1_el2.p); } static void @@ -910,7 +908,7 @@ test_misc5(void) /* Create the variable-length buffer */ buf.len = MISC5_DBGNELM1; - buf.p = malloc((buf.len) * sizeof(misc5_struct1)); + buf.p = HDmalloc((buf.len) * sizeof(misc5_struct1)); CHECK(buf.p, NULL, "malloc"); /* Create the top-level VL information */ @@ -926,7 +924,7 @@ test_misc5(void) clear_struct1(&(((misc5_struct1 *)(buf.p))[j])); /* Free the variable-length buffer */ - free(buf.p); + HDfree(buf.p); /* Close dataset */ ret = H5Dclose(dataset_id); @@ -1236,10 +1234,10 @@ test_misc8(void) MESSAGE(5, ("Testing dataset storage sizes\n")); /* Allocate space for the data to write & read */ - wdata=malloc(sizeof(int)*MISC8_DIM0*MISC8_DIM1); + wdata=HDmalloc(sizeof(int)*MISC8_DIM0*MISC8_DIM1); CHECK(wdata,NULL,"malloc"); #ifdef VERIFY_DATA - rdata=malloc(sizeof(int)*MISC8_DIM0*MISC8_DIM1); + rdata=HDmalloc(sizeof(int)*MISC8_DIM0*MISC8_DIM1); CHECK(rdata,NULL,"malloc"); #endif /* VERIFY_DATA */ @@ -1677,7 +1675,7 @@ test_misc8(void) CHECK(ret, FAIL, "H5Fclose"); /* Free the read & write buffers */ - free(wdata); + HDfree(wdata); #ifdef VERIFY_DATA free(rdata); #endif /* VERIFY_DATA */ @@ -1800,10 +1798,10 @@ test_misc11(void) unsigned sym_ik; /* Symbol table B-tree initial 'K' value */ unsigned istore_ik; /* Indexed storage B-tree initial 'K' value */ unsigned sym_lk; /* Symbol table B-tree leaf 'K' value */ - unsigned nindexes; /* Shared message number of indexes */ - H5F_info2_t finfo; /* global information about file */ - H5F_file_space_type_t strategy; /* File/free space strategy */ - hsize_t threshold; /* Free-space section threshold */ + unsigned nindexes; /* Shared message number of indexes */ + H5F_info2_t finfo; /* global information about file */ + H5F_file_space_type_t strategy; /* File/free space strategy */ + hsize_t threshold; /* Free-space section threshold */ herr_t ret; /* Generic return value */ /* Output message about test being performed */ @@ -1958,10 +1956,10 @@ test_misc12(void) hsize_t dimsn[] = {MISC12_APPEND_SIZE}; hsize_t maxdims1[1] = {H5S_UNLIMITED}; hsize_t chkdims1[1] = {MISC12_CHUNK_SIZE}; - hsize_t newsize[1] = {MISC12_SPACE1_DIM1+MISC12_APPEND_SIZE}; - hsize_t offset[1] = {MISC12_SPACE1_DIM1}; - hsize_t count[1] = {MISC12_APPEND_SIZE}; - int i; /* counting variable */ + hsize_t newsize[1] = {MISC12_SPACE1_DIM1+MISC12_APPEND_SIZE}; + hsize_t offset[1] = {MISC12_SPACE1_DIM1}; + hsize_t count[1] = {MISC12_APPEND_SIZE}; + int i; /* counting variable */ herr_t ret; /* Generic return value */ /* Output message about test being performed */ @@ -2215,7 +2213,7 @@ create_hdf_file(const char *name) /* Close the file */ ret = H5Fclose(fid); - assert(ret >= 0); + HDassert(ret >= 0); CHECK(ret, FAIL, "H5Fclose"); } @@ -2245,7 +2243,7 @@ insert_user_block(const char *old_name, const char *new_name,const char *str,siz VERIFY(written, size, "HDfwrite"); /* Open the old file */ - old_fp=fopen(old_name,"rb"); + old_fp=HDfopen(old_name,"rb"); CHECK(old_fp, NULL, "HDfopen"); /* Allocate space for the copy buffer */ @@ -2268,10 +2266,10 @@ insert_user_block(const char *old_name, const char *new_name,const char *str,siz VERIFY(ret, 0, "HDfclose"); /* Free the copy buffer */ - free(copy_buf); + HDfree(copy_buf); /* Free the user block */ - free(user_block); + HDfree(user_block); } static void @@ -4452,7 +4450,6 @@ test_misc25a(void) CHECK(ret, FAIL, "H5Fclose"); - /* Re-open file */ fid = H5Fopen(MISC25A_FILE, H5F_ACC_RDWR, H5P_DEFAULT); CHECK(fid, FAIL, "H5Fopen"); @@ -4496,7 +4493,6 @@ test_misc25a(void) CHECK(ret, FAIL, "H5Fclose"); - /* Re-open file */ fid = H5Fopen(MISC25A_FILE, H5F_ACC_RDWR, H5P_DEFAULT); CHECK(fid, FAIL, "H5Fopen"); @@ -5125,7 +5121,7 @@ test_misc30_get_info_cb(hid_t loc_id, const char *name, const H5L_info_t UNUSED { H5O_info_t object_info; - return H5Oget_info_by_name(loc_id, name, &object_info, H5P_DEFAULT); + return H5Oget_info_by_name(loc_id, name, &object_info, H5P_DEFAULT); } static int @@ -5174,7 +5170,7 @@ test_misc30(void) CHECK(fid, FAIL, "H5Fopen"); if(get_info) { - ret = test_misc30_get_info(fid); + ret = test_misc30_get_info(fid); CHECK(ret, FAIL, "test_misc30_get_info"); } diff --git a/tools/h5repack/h5repack_main.c b/tools/h5repack/h5repack_main.c index 720e8d6..e1697ab 100644 --- a/tools/h5repack/h5repack_main.c +++ b/tools/h5repack/h5repack_main.c @@ -353,7 +353,7 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options) case 'm': - options->min_comp = atoi( opt_arg ); + options->min_comp = HDatoi( opt_arg ); if ((int)options->min_comp<=0) { error_msg("invalid minimum compress size <%s>\n", opt_arg ); @@ -375,7 +375,7 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options) case 'c': - options->grp_compact = atoi( opt_arg ); + options->grp_compact = HDatoi( opt_arg ); if (options->grp_compact>0) options->latest = 1; /* must use latest format */ break; @@ -383,7 +383,7 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options) case 'd': - options->grp_indexed = atoi( opt_arg ); + options->grp_indexed = HDatoi( opt_arg ); if (options->grp_indexed>0) options->latest = 1; /* must use latest format */ break; @@ -398,7 +398,7 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options) options->latest = 1; /* must use latest format */ if (msgPtr == NULL) { - ssize = atoi( opt_arg ); + ssize = HDatoi( opt_arg ); for (idx=0; idx<5; idx++) options->msg_size[idx] = ssize; } @@ -407,7 +407,7 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options) char msgType[10]; HDstrcpy(msgType, msgPtr+1); msgPtr[0] = '\0'; - ssize = atoi( opt_arg ); + ssize = HDatoi( opt_arg ); if (HDstrncmp(msgType, "dspace",6) == 0) { options->msg_size[0] = ssize; } @@ -436,17 +436,17 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options) case 'b': - options->ublock_size = (hsize_t)atol( opt_arg ); + options->ublock_size = (hsize_t)HDatol( opt_arg ); break; case 't': - options->threshold = (hsize_t)atol( opt_arg ); + options->threshold = (hsize_t)HDatol( opt_arg ); break; case 'a': - options->alignment = atol( opt_arg ); + options->alignment = HDatol( opt_arg ); if ( options->alignment < 1 ) { error_msg("invalid alignment size\n", opt_arg ); @@ -476,7 +476,7 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options) case 'T': - options->fs_threshold = (hsize_t)atol( opt_arg ); + options->fs_threshold = (hsize_t)HDatol( opt_arg ); break; } /* switch */ @@ -521,7 +521,7 @@ void read_info(const char *filename, char c; int i, rc=1; - if ((fp = fopen(filename, "r")) == (FILE *)NULL) { + if ((fp = HDfopen(filename, "r")) == (FILE *)NULL) { error_msg("cannot open options file %s\n", filename); HDexit(EXIT_FAILURE); } @@ -544,7 +544,7 @@ void read_info(const char *filename, while( c!=' ' ) { fscanf(fp, "%c", &c); - if (feof(fp)) break; + if (HDfeof(fp)) break; } c='0'; /* go until end */ @@ -553,7 +553,7 @@ void read_info(const char *filename, fscanf(fp, "%c", &c); comp_info[i]=c; i++; - if (feof(fp)) break; + if (HDfeof(fp)) break; if (c==10 /*eol*/) break; } comp_info[i-1]='\0'; /*cut the last " */ @@ -574,7 +574,7 @@ void read_info(const char *filename, while( c!=' ' ) { fscanf(fp, "%c", &c); - if (feof(fp)) break; + if (HDfeof(fp)) break; } c='0'; /* go until end */ @@ -583,7 +583,7 @@ void read_info(const char *filename, fscanf(fp, "%c", &c); comp_info[i]=c; i++; - if (feof(fp)) break; + if (HDfeof(fp)) break; if (c==10 /*eol*/) break; } comp_info[i-1]='\0'; /*cut the last " */ @@ -603,6 +603,6 @@ void read_info(const char *filename, } } - fclose(fp); + HDfclose(fp); return; } -- cgit v0.12 From 386b3e971b91580fad6c97cbdf95219097945ddf Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 5 Mar 2012 14:33:30 -0500 Subject: [svn-r22027] HDFFV-7839: Dangling link should not display error If a link is specified on the command with the -d option, call the handle_links function on error from the H5Dopen command. Updated test file results with error stack when link not found. Tested: local linux and jam --- tools/h5dump/CMakeLists.txt | 6 ++++-- tools/h5dump/h5dump_ddl.c | 8 +------- tools/h5dump/testh5dump.sh.in | 6 ++++-- tools/testfiles/tdset-2.ddl | 36 +++++++++++++++++++++++++++++++++--- tools/testfiles/tperror.ddl | 36 +++++++++++++++++++++++++++++++++--- tools/testfiles/tslink-D.ddl | 30 ++++++++++++++++++++++++++++++ 6 files changed, 105 insertions(+), 17 deletions(-) create mode 100644 tools/testfiles/tslink-D.ddl diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt index f77d6a5..b6f98d6 100644 --- a/tools/h5dump/CMakeLists.txt +++ b/tools/h5dump/CMakeLists.txt @@ -928,7 +928,7 @@ IF (BUILD_TESTING) # test for displaying simple space datasets ADD_H5_TEST (tdset-1 0 --enable-error-stack tdset.h5) # test for displaying selected datasets - ADD_H5_TEST (tdset-2 1 -H -d dset1 -d /dset2 --dataset=dset3 tdset.h5) + ADD_H5_MASK_TEST (tdset-2 1 --enable-error-stack -H -d dset1 -d /dset2 --dataset=dset3 tdset.h5) # test for displaying attributes ADD_H5_TEST (tattr-1 0 --enable-error-stack tattr.h5) @@ -947,6 +947,8 @@ IF (BUILD_TESTING) # test for displaying the selected link ADD_H5_TEST (tslink-2 0 --enable-error-stack -l slink2 tslink.h5) ADD_H5_TEST (tudlink-2 0 --enable-error-stack -l udlink2 tudlink.h5) + # test for displaying dangling soft links + ADD_H5_MASK_TEST (tslink-D 0 --enable-error-stack -d /slink1 tslink.h5) # tests for hard links ADD_H5_TEST (thlink-1 0 --enable-error-stack thlink.h5) @@ -1045,7 +1047,7 @@ IF (BUILD_TESTING) ADD_H5_TEST (file_space 0 --enable-error-stack -B file_space.h5) # test -p with a non existing dataset - ADD_H5_TEST (tperror 1 -p -d bogus tfcontents1.h5) + ADD_H5_MASK_TEST (tperror 1 --enable-error-stack -p -d bogus tfcontents1.h5) # test for file contents ADD_H5_TEST (tcontents 0 --enable-error-stack -n tfcontents1.h5) diff --git a/tools/h5dump/h5dump_ddl.c b/tools/h5dump/h5dump_ddl.c index d00b9e8..be56c9b 100644 --- a/tools/h5dump/h5dump_ddl.c +++ b/tools/h5dump/h5dump_ddl.c @@ -1474,13 +1474,7 @@ handle_datasets(hid_t fid, const char *dset, void *data, int pe, const char *dis if((dsetid = H5Dopen2(fid, dset, H5P_DEFAULT)) < 0) { if (pe) { - HDfprintf(rawoutstream, "\n"); - begin_obj(h5tools_dump_header_format->datasetbegin, real_name, h5tools_dump_header_format->datasetblockbegin); - HDfprintf(rawoutstream, "\n"); - indentation(COL); - error_msg("unable to open dataset \"%s\"\n", real_name); - end_obj(h5tools_dump_header_format->datasetend, h5tools_dump_header_format->datasetblockend); - h5tools_setstatus(EXIT_FAILURE); + handle_links(fid, dset, data, pe, display_name); } return; } /* end if */ diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in index 57168e0..4b18574 100644 --- a/tools/h5dump/testh5dump.sh.in +++ b/tools/h5dump/testh5dump.sh.in @@ -712,7 +712,7 @@ TOOLTEST tgroup-2.ddl --group=/g2 --group / -g /y tgroup.h5 # test for displaying simple space datasets TOOLTEST tdset-1.ddl --enable-error-stack tdset.h5 # test for displaying selected datasets -TOOLTEST tdset-2.ddl -H -d dset1 -d /dset2 --dataset=dset3 tdset.h5 +TOOLTEST3 tdset-2.ddl --enable-error-stack -H -d dset1 -d /dset2 --dataset=dset3 tdset.h5 # test for displaying attributes TOOLTEST tattr-1.ddl --enable-error-stack tattr.h5 @@ -731,6 +731,8 @@ TOOLTEST tudlink-1.ddl --enable-error-stack tudlink.h5 # test for displaying the selected link TOOLTEST tslink-2.ddl --enable-error-stack -l slink2 tslink.h5 TOOLTEST tudlink-2.ddl --enable-error-stack -l udlink2 tudlink.h5 +# test for displaying dangling soft links +TOOLTEST3 tslink-D.ddl --enable-error-stack -d /slink1 tslink.h5 # tests for hard links TOOLTEST thlink-1.ddl --enable-error-stack thlink.h5 @@ -830,7 +832,7 @@ TOOLTEST tboot2.ddl --enable-error-stack -B tfcontents2.h5 TOOLTEST file_space.ddl --enable-error-stack -B file_space.h5 # test -p with a non existing dataset -TOOLTEST tperror.ddl -p -d bogus tfcontents1.h5 +TOOLTEST3 tperror.ddl --enable-error-stack -p -d bogus tfcontents1.h5 # test for file contents TOOLTEST tcontents.ddl --enable-error-stack -n tfcontents1.h5 diff --git a/tools/testfiles/tdset-2.ddl b/tools/testfiles/tdset-2.ddl index def68c3..2034a43 100644 --- a/tools/testfiles/tdset-2.ddl +++ b/tools/testfiles/tdset-2.ddl @@ -7,7 +7,37 @@ DATASET "/dset2" { DATATYPE H5T_IEEE_F64BE DATASPACE SIMPLE { ( 30, 20 ) / ( 30, 20 ) } } -DATASET "dset3" { - } } -h5dump error: unable to open dataset "dset3" +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Dopen2(): not found + major: Dataset + minor: Object not found + #001: (file name) line (number) in H5G_loc_find(): can't find object + major: Symbol table + minor: Object not found + #002: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #003: (file name) line (number) in H5G_traverse_real(): traversal operator failed + major: Symbol table + minor: Callback failed + #004: (file name) line (number) in H5G_loc_find_cb(): object 'dset3' doesn't exist + major: Symbol table + minor: Object not found +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Lget_info(): unable to get link info + major: Symbol table + minor: Object not found + #001: (file name) line (number) in H5L_get_info(): name doesn't exist + major: Symbol table + minor: Object already exists + #002: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #003: (file name) line (number) in H5G_traverse_real(): traversal operator failed + major: Symbol table + minor: Callback failed + #004: (file name) line (number) in H5L_get_info_cb(): name doesn't exist + major: Symbol table + minor: Object not found +h5dump error: unable to get link info from "dset3" diff --git a/tools/testfiles/tperror.ddl b/tools/testfiles/tperror.ddl index 76988c8..16a7d8e 100644 --- a/tools/testfiles/tperror.ddl +++ b/tools/testfiles/tperror.ddl @@ -1,5 +1,35 @@ HDF5 "tfcontents1.h5" { -DATASET "bogus" { - } } -h5dump error: unable to open dataset "bogus" +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Dopen2(): not found + major: Dataset + minor: Object not found + #001: (file name) line (number) in H5G_loc_find(): can't find object + major: Symbol table + minor: Object not found + #002: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #003: (file name) line (number) in H5G_traverse_real(): traversal operator failed + major: Symbol table + minor: Callback failed + #004: (file name) line (number) in H5G_loc_find_cb(): object 'bogus' doesn't exist + major: Symbol table + minor: Object not found +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Lget_info(): unable to get link info + major: Symbol table + minor: Object not found + #001: (file name) line (number) in H5L_get_info(): name doesn't exist + major: Symbol table + minor: Object already exists + #002: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #003: (file name) line (number) in H5G_traverse_real(): traversal operator failed + major: Symbol table + minor: Callback failed + #004: (file name) line (number) in H5L_get_info_cb(): name doesn't exist + major: Symbol table + minor: Object not found +h5dump error: unable to get link info from "bogus" diff --git a/tools/testfiles/tslink-D.ddl b/tools/testfiles/tslink-D.ddl new file mode 100644 index 0000000..a1d999a --- /dev/null +++ b/tools/testfiles/tslink-D.ddl @@ -0,0 +1,30 @@ +HDF5 "tslink.h5" { +SOFTLINK "/slink1" { + LINKTARGET "somevalue" +} +} +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Dopen2(): not found + major: Dataset + minor: Object not found + #001: (file name) line (number) in H5G_loc_find(): can't find object + major: Symbol table + minor: Object not found + #002: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #003: (file name) line (number) in H5G_traverse_real(): special link traversal failed + major: Links + minor: Link traversal failure + #004: (file name) line (number) in H5G__traverse_special(): symbolic link traversal failed + major: Links + minor: Link traversal failure + #005: (file name) line (number) in H5G_traverse_slink(): unable to follow symbolic link + major: Symbol table + minor: Object not found + #006: (file name) line (number) in H5G_traverse_real(): traversal operator failed + major: Symbol table + minor: Callback failed + #007: (file name) line (number) in H5G_traverse_slink_cb(): component not found + major: Symbol table + minor: Object not found -- cgit v0.12 From 7149676a0b7d5cec6ccbc96d714db9869243ed06 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 5 Mar 2012 14:41:11 -0500 Subject: [svn-r22028] add new test file --- MANIFEST | 1 + 1 file changed, 1 insertion(+) diff --git a/MANIFEST b/MANIFEST index d7ad86c..0cccbad 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1422,6 +1422,7 @@ ./tools/testfiles/tscaleoffset.ddl ./tools/testfiles/tslink-1.ddl ./tools/testfiles/tslink-2.ddl +./tools/testfiles/tslink-D.ddl ./tools/testfiles/tslink.h5 ./tools/testfiles/tsplit_file-m.h5 ./tools/testfiles/tsplit_file-r.h5 -- cgit v0.12 From 5ee3764068f93cab6ab9518a8b0ff64ee5d62178 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 6 Mar 2012 08:35:27 -0500 Subject: [svn-r22029] Add reference file to test list Add error-stack to tests Tested: local linux --- tools/h5dump/CMakeLists.txt | 52 +++++++++++++----------- tools/h5dump/testh5dump.sh.in | 41 ++++++++++--------- tools/testfiles/tattr-3.ddl | 7 ++++ tools/testfiles/textlink.ddl | 50 +++++++++++++++++++++++ tools/testfiles/tnofilename-with-packed-bits.ddl | 1 + 5 files changed, 108 insertions(+), 43 deletions(-) diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt index b6f98d6..a5432c4 100644 --- a/tools/h5dump/CMakeLists.txt +++ b/tools/h5dump/CMakeLists.txt @@ -150,6 +150,7 @@ IF (BUILD_TESTING) tshuffle.ddl tslink-1.ddl tslink-2.ddl + tslink-D.ddl tsplit_file.ddl tstr-1.ddl tstr-2.ddl @@ -875,6 +876,8 @@ IF (BUILD_TESTING) tslink-1.out.err tslink-2.out tslink-2.out.err + tslink-D.out + tslink-D.out.err tsplit_file.out tsplit_file.out.err tstr-1.out @@ -923,6 +926,8 @@ IF (BUILD_TESTING) # test for displaying groups ADD_H5_TEST (tgroup-1 0 --enable-error-stack tgroup.h5) # test for displaying the selected groups + # JIRA HDFFV-7936 ADD_H5_MASK_TEST (tgroup-2 1 --enable-error-stack --group=/g2 --group / -g /y tgroup.h5) + # cannot use TEST_MASK_ERROR and --enable-error-stack on this test because group names are similar to version numbers ADD_H5_TEST (tgroup-2 1 --group=/g2 --group / -g /y tgroup.h5) # test for displaying simple space datasets @@ -935,7 +940,7 @@ IF (BUILD_TESTING) # test for displaying the selected attributes of string type and scalar space ADD_H5_TEST (tattr-2 0 --enable-error-stack -a /attr1 --attribute /attr4 --attribute=/attr5 tattr.h5) # test for header and error messages - ADD_H5_TEST (tattr-3 1 --header -a /attr2 --attribute=/attr tattr.h5) + ADD_H5_MASK_TEST (tattr-3 1 --enable-error-stack --header -a /attr2 --attribute=/attr tattr.h5) # test for displaying attributes in shared datatype (also in group and dataset) ADD_H5_TEST (tnamed_dtype_attr 0 --enable-error-stack tnamed_dtype_attr.h5) # test for displaying at least 9 attributes on root from a be machine @@ -971,7 +976,8 @@ IF (BUILD_TESTING) ADD_H5_TEST (tnestcomp-1 0 --enable-error-stack tnestedcomp.h5) # test for options - # JIRA HDFFV-7936 ADD_H5_TEST (tall-1 0 --enable-error-stack tall.h5) + # JIRA HDFFV-7936 ADD_H5_MASK_TEST (tall-1 0 --enable-error-stack tall.h5) + # cannot use TEST_MASK_ERROR and --enable-error-stack on this test because group/dataset names are similar to version numbers ADD_H5_TEST (tall-1 0 tall.h5) ADD_H5_TEST (tall-2 0 --enable-error-stack --header -g /g1/g1.1 -a attr2 tall.h5) ADD_H5_TEST (tall-3 0 --enable-error-stack -d /g2/dset2.1 -l /g1/g1.2/g1.2.1/slink tall.h5) @@ -1024,7 +1030,8 @@ IF (BUILD_TESTING) ADD_H5_TEST (tlarge_objname 0 --enable-error-stack -w157 tlarge_objname.h5) # test '-A' to suppress data but print attr's - # JIRA HDFFV-7936 ADD_H5_TEST (tall-2A 0 --enable-error-stack -A tall.h5) + # JIRA HDFFV-7936 ADD_H5_MASK_TEST (tall-2A 0 --enable-error-stack -A tall.h5) + # cannot use TEST_MASK_ERROR and --enable-error-stack on this test because group/dataset names are similar to version numbers ADD_H5_TEST (tall-2A 0 -A tall.h5) # test '-r' to print attributes in ASCII instead of decimal @@ -1092,10 +1099,10 @@ IF (BUILD_TESTING) ADD_H5_TEST (tindicessub4 0 --enable-error-stack -d 4d -s 0,0,1,2 -c 2,2,3,2 -S 1,1,3,3 -k 1,1,2,2 taindices.h5) # Exceed the dimensions for subsetting - ADD_H5_TEST (texceedsubstart 1 -d 1d -s 1,3 taindices.h5) - ADD_H5_TEST (texceedsubcount 1 -d 1d -c 1,3 taindices.h5) - ADD_H5_TEST (texceedsubstride 1 -d 1d -S 1,3 taindices.h5) - ADD_H5_TEST (texceedsubblock 1 -d 1d -k 1,3 taindices.h5) + ADD_H5_TEST (texceedsubstart 1 --enable-error-stack -d 1d -s 1,3 taindices.h5) + ADD_H5_TEST (texceedsubcount 1 --enable-error-stack -d 1d -c 1,3 taindices.h5) + ADD_H5_TEST (texceedsubstride 1 --enable-error-stack -d 1d -S 1,3 taindices.h5) + ADD_H5_TEST (texceedsubblock 1 --enable-error-stack -d 1d -k 1,3 taindices.h5) # tests for filters # SZIP @@ -1103,49 +1110,49 @@ IF (BUILD_TESTING) IF (NOT USE_FILTER_SZIP) SET (TESTTYPE "SKIP") ENDIF (NOT USE_FILTER_SZIP) - ADD_SKIP_H5_TEST (tszip 0 ${TESTTYPE} -H -p -d szip tfilters.h5) + ADD_SKIP_H5_TEST (tszip 0 ${TESTTYPE} --enable-error-stack -H -p -d szip tfilters.h5) # deflate SET (TESTTYPE "TEST") IF (NOT USE_FILTER_DEFLATE) SET (TESTTYPE "SKIP") ENDIF (NOT USE_FILTER_DEFLATE) - ADD_SKIP_H5_TEST (tdeflate 0 ${TESTTYPE} -H -p -d deflate tfilters.h5) + ADD_SKIP_H5_TEST (tdeflate 0 ${TESTTYPE} --enable-error-stack -H -p -d deflate tfilters.h5) # shuffle SET (TESTTYPE "TEST") IF (NOT USE_FILTER_SHUFFLE) SET (TESTTYPE "SKIP") ENDIF (NOT USE_FILTER_SHUFFLE) - ADD_SKIP_H5_TEST (tshuffle 0 ${TESTTYPE} -H -p -d shuffle tfilters.h5) + ADD_SKIP_H5_TEST (tshuffle 0 ${TESTTYPE} --enable-error-stack -H -p -d shuffle tfilters.h5) # fletcher32 SET (TESTTYPE "TEST") IF (NOT USE_FILTER_FLETCHER32) SET (TESTTYPE "SKIP") ENDIF (NOT USE_FILTER_FLETCHER32) - ADD_SKIP_H5_TEST (tfletcher32 0 ${TESTTYPE} -H -p -d fletcher32 tfilters.h5) + ADD_SKIP_H5_TEST (tfletcher32 0 ${TESTTYPE} --enable-error-stack -H -p -d fletcher32 tfilters.h5) # nbit SET (TESTTYPE "TEST") IF (NOT USE_FILTER_NBIT) SET (TESTTYPE "SKIP") ENDIF (NOT USE_FILTER_NBIT) - ADD_SKIP_H5_TEST (tnbit 0 ${TESTTYPE} -H -p -d nbit tfilters.h5) + ADD_SKIP_H5_TEST (tnbit 0 ${TESTTYPE} --enable-error-stack -H -p -d nbit tfilters.h5) # scaleoffset SET (TESTTYPE "TEST") IF (NOT USE_FILTER_SCALEOFFSET) SET (TESTTYPE "SKIP") ENDIF (NOT USE_FILTER_SCALEOFFSET) - ADD_SKIP_H5_TEST (tscaleoffset 0 ${TESTTYPE} -H -p -d scaleoffset tfilters.h5) + ADD_SKIP_H5_TEST (tscaleoffset 0 ${TESTTYPE} --enable-error-stack -H -p -d scaleoffset tfilters.h5) # all SET (TESTTYPE "TEST") IF (NOT USE_FILTER_SZIP OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_NBIT OR NOT USE_FILTER_SCALEOFFSET) SET (TESTTYPE "SKIP") ENDIF (NOT USE_FILTER_SZIP OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_NBIT OR NOT USE_FILTER_SCALEOFFSET) - ADD_SKIP_H5_TEST (tallfilters 0 ${TESTTYPE} -H -p -d all tfilters.h5) + ADD_SKIP_H5_TEST (tallfilters 0 ${TESTTYPE} --enable-error-stack -H -p -d all tfilters.h5) # user defined ADD_H5_TEST (tuserfilter 0 --enable-error-stack -H -p -d myfilter tfilters.h5) @@ -1281,8 +1288,7 @@ IF (BUILD_TESTING) ADD_H5_TEST (textlinkfar 0 textlinkfar.h5) # test for dangling external links - # JIRA HDFFV-7936 ADD_H5_TEST (textlink 0 --enable-error-stack textlink.h5) - ADD_H5_TEST (textlink 0 textlink.h5) + ADD_H5_MASK_TEST (textlink 0 --enable-error-stack textlink.h5) # test for error stack display (BZ2048) ADD_H5_MASK_TEST (filter_fail 1 --enable-error-stack filter_fail.h5) @@ -1412,7 +1418,7 @@ IF (BUILD_TESTING) # test failure handling # Missing file name - ADD_H5_TEST (tnofilename-with-packed-bits 1) + ADD_H5_TEST (tnofilename-with-packed-bits 1 --enable-error-stack) # Limits: # Maximum number of packed bits is 8 (for now). # Maximum integer size is 8*sizeof(long long). @@ -1471,23 +1477,23 @@ IF (BUILD_TESTING) ADD_H5_TEST (tpbitsArray 0 --enable-error-stack -d /Dataset1 -M 0,1,1,1 tarray1.h5) # Test Error handling. # Too many packed bits requested. Max is 8 for now. - ADD_H5_TEST (tpbitsMaxExceeded 1 -d /DS08BITS -M 0,1,0,1,1,1,2,1,3,1,4,1,5,1,6,1,7,1 packedbits.h5) + ADD_H5_TEST (tpbitsMaxExceeded 1 --enable-error-stack -d /DS08BITS -M 0,1,0,1,1,1,2,1,3,1,4,1,5,1,6,1,7,1 packedbits.h5) # Offset too large. Max is 8*sizeof(long long. - ADD_H5_TEST (tpbitsOffsetExceeded 1 -d /DS08BITS -M 64,1 packedbits.h5) + ADD_H5_TEST (tpbitsOffsetExceeded 1 --enable-error-stack -d /DS08BITS -M 64,1 packedbits.h5) ADD_H5_TEST (tpbitsCharOffsetExceeded 0 --enable-error-stack -d /DS08BITS -M 8,1 packedbits.h5) ADD_H5_TEST (tpbitsIntOffsetExceeded 0 --enable-error-stack -d /DS16BITS -M 16,1 packedbits.h5) ADD_H5_TEST (tpbitsLongOffsetExceeded 0 --enable-error-stack -d /DS32BITS -M 32,1 packedbits.h5) # Bad offset, must not be negative. - ADD_H5_TEST (tpbitsOffsetNegative 1 -d /DS08BITS -M -1,1 packedbits.h5) + ADD_H5_TEST (tpbitsOffsetNegative 1 --enable-error-stack -d /DS08BITS -M -1,1 packedbits.h5) # Bad length, must not be positive. - ADD_H5_TEST (tpbitsLengthPositive 1 -d /DS08BITS -M 4,0 packedbits.h5) + ADD_H5_TEST (tpbitsLengthPositive 1 --enable-error-stack -d /DS08BITS -M 4,0 packedbits.h5) # Offset+Length is too large. Max is 8*sizeof(long long). - ADD_H5_TEST (tpbitsLengthExceeded 1 -d /DS08BITS -M 37,28 packedbits.h5) + ADD_H5_TEST (tpbitsLengthExceeded 1 --enable-error-stack -d /DS08BITS -M 37,28 packedbits.h5) ADD_H5_TEST (tpbitsCharLengthExceeded 0 --enable-error-stack -d /DS08BITS -M 2,7 packedbits.h5) ADD_H5_TEST (tpbitsIntLengthExceeded 0 --enable-error-stack -d /DS16BITS -M 10,7 packedbits.h5) ADD_H5_TEST (tpbitsLongLengthExceeded 0 --enable-error-stack -d /DS32BITS -M 26,7 packedbits.h5) # Incomplete pair of packed bits request. - ADD_H5_TEST (tpbitsIncomplete 1 -d /DS08BITS -M 0,2,2,1,0,2,2, packedbits.h5) + ADD_H5_TEST (tpbitsIncomplete 1 --enable-error-stack -d /DS08BITS -M 0,2,2,1,0,2,2, packedbits.h5) IF (HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in index 4b18574..1141cf7 100644 --- a/tools/h5dump/testh5dump.sh.in +++ b/tools/h5dump/testh5dump.sh.in @@ -266,6 +266,7 @@ $SRC_H5DUMP_TESTFILES/tscaleoffset.ddl $SRC_H5DUMP_TESTFILES/tshuffle.ddl $SRC_H5DUMP_TESTFILES/tslink-1.ddl $SRC_H5DUMP_TESTFILES/tslink-2.ddl +$SRC_H5DUMP_TESTFILES/tslink-D.ddl $SRC_H5DUMP_TESTFILES/tsplit_file.ddl $SRC_H5DUMP_TESTFILES/tstr-1.ddl $SRC_H5DUMP_TESTFILES/tstr-2.ddl @@ -719,7 +720,7 @@ TOOLTEST tattr-1.ddl --enable-error-stack tattr.h5 # test for displaying the selected attributes of string type and scalar space TOOLTEST tattr-2.ddl --enable-error-stack -a /attr1 --attribute /attr4 --attribute=/attr5 tattr.h5 # test for header and error messages -TOOLTEST tattr-3.ddl --header -a /attr2 --attribute=/attr tattr.h5 +TOOLTEST3 tattr-3.ddl --enable-error-stack --header -a /attr2 --attribute=/attr tattr.h5 # test for displaying at least 9 attributes on root from a BE machine TOOLTEST tattr-4_be.ddl --enable-error-stack tattr4_be.h5 # test for displaying attributes in shared datatype (also in group and dataset) @@ -877,57 +878,57 @@ TOOLTEST tindicessub3.ddl --enable-error-stack -d 3d -s 0,1,2 -S 1,3,3 -c 2,2,2 TOOLTEST tindicessub4.ddl --enable-error-stack -d 4d -s 0,0,1,2 -c 2,2,3,2 -S 1,1,3,3 -k 1,1,2,2 taindices.h5 #Exceed the dimensions for subsetting -TOOLTEST texceedsubstart.ddl -d 1d -s 1,3 taindices.h5 -TOOLTEST texceedsubcount.ddl -d 1d -c 1,3 taindices.h5 -TOOLTEST texceedsubstride.ddl -d 1d -S 1,3 taindices.h5 -TOOLTEST texceedsubblock.ddl -d 1d -k 1,3 taindices.h5 +TOOLTEST texceedsubstart.ddl --enable-error-stack -d 1d -s 1,3 taindices.h5 +TOOLTEST texceedsubcount.ddl --enable-error-stack -d 1d -c 1,3 taindices.h5 +TOOLTEST texceedsubstride.ddl --enable-error-stack -d 1d -S 1,3 taindices.h5 +TOOLTEST texceedsubblock.ddl --enable-error-stack -d 1d -k 1,3 taindices.h5 # tests for filters # SZIP -option="-H -p -d szip tfilters.h5" +option="--enable-error-stack -H -p -d szip tfilters.h5" if test $USE_FILTER_SZIP != "yes"; then SKIP $option else TOOLTEST tszip.ddl $option fi # deflate -option="-H -p -d deflate tfilters.h5" +option="--enable-error-stack -H -p -d deflate tfilters.h5" if test $USE_FILTER_DEFLATE != "yes"; then SKIP $option else TOOLTEST tdeflate.ddl $option fi # shuffle -option="-H -p -d shuffle tfilters.h5" +option="--enable-error-stack -H -p -d shuffle tfilters.h5" if test $USE_FILTER_SHUFFLE != "yes"; then SKIP $option else TOOLTEST tshuffle.ddl $option fi # fletcher32 -option="-H -p -d fletcher32 tfilters.h5" +option="--enable-error-stack -H -p -d fletcher32 tfilters.h5" if test $USE_FILTER_FLETCHER32 != "yes"; then SKIP $option else TOOLTEST tfletcher32.ddl $option fi # nbit -option="-H -p -d nbit tfilters.h5" +option="--enable-error-stack -H -p -d nbit tfilters.h5" if test $USE_FILTER_NBIT != "yes"; then SKIP $option else TOOLTEST tnbit.ddl $option fi # scaleoffset -option="-H -p -d scaleoffset tfilters.h5" +option="--enable-error-stack -H -p -d scaleoffset tfilters.h5" if test $USE_FILTER_SCALEOFFSET != "yes"; then SKIP $option else TOOLTEST tscaleoffset.ddl $option fi # all -option="-H -p -d all tfilters.h5" +option="--enable-error-stack -H -p -d all tfilters.h5" if test $USE_FILTER_FLETCHER32 != "yes" -o $USE_FILTER_SZIP != "yes" -o $USE_FILTER_DEFLATE != "yes" -o $USE_FILTER_SHUFFLE != "yes" -o $USE_FILTER_NBIT != "yes" -o $USE_FILTER_SCALEOFFSET != "yes"; then SKIP $option else @@ -1024,7 +1025,7 @@ TOOLTEST textlinkfar.ddl textlinkfar.h5 # test for dangling external links # JIRA HDFFV-7936 TOOLTEST textlink.ddl --enable-error-stack textlink.h5 -TOOLTEST textlink.ddl textlink.h5 +TOOLTEST3 textlink.ddl --enable-error-stack textlink.h5 # test for error stack display (BZ2048) TOOLTEST3 filter_fail.ddl --enable-error-stack filter_fail.h5 @@ -1036,7 +1037,7 @@ TOOLTEST tall-6.ddl --enable-error-stack -y -o data -d /g1/g1.1/dset1.1.1 tall.h # test failure handling # Missing file name -TOOLTEST tnofilename-with-packed-bits.ddl +TOOLTEST tnofilename-with-packed-bits.ddl --enable-error-stack # Limits: # Maximum number of packed bits is 8 (for now). # Maximum integer size is 64 (for now). @@ -1095,23 +1096,23 @@ TOOLTEST tpbitsCompound.ddl --enable-error-stack -d /dset1 -M 0,1,1,1 tcompound. TOOLTEST tpbitsArray.ddl --enable-error-stack -d /Dataset1 -M 0,1,1,1 tarray1.h5 # Test Error handling. # Too many packed bits requested. Max is 8 for now. -TOOLTEST tpbitsMaxExceeded.ddl -d /DS08BITS -M 0,1,0,1,1,1,2,1,3,1,4,1,5,1,6,1,7,1 packedbits.h5 +TOOLTEST tpbitsMaxExceeded.ddl --enable-error-stack -d /DS08BITS -M 0,1,0,1,1,1,2,1,3,1,4,1,5,1,6,1,7,1 packedbits.h5 # Offset too large. Max is 7 (8-1) for now. -TOOLTEST tpbitsOffsetExceeded.ddl -d /DS08BITS -M 64,1 packedbits.h5 +TOOLTEST tpbitsOffsetExceeded.ddl --enable-error-stack -d /DS08BITS -M 64,1 packedbits.h5 TOOLTEST tpbitsCharOffsetExceeded.ddl --enable-error-stack -d /DS08BITS -M 8,1 packedbits.h5 TOOLTEST tpbitsIntOffsetExceeded.ddl --enable-error-stack -d /DS16BITS -M 16,1 packedbits.h5 TOOLTEST tpbitsLongOffsetExceeded.ddl --enable-error-stack -d /DS32BITS -M 32,1 packedbits.h5 # Bad offset, must not be negative. -TOOLTEST tpbitsOffsetNegative.ddl -d /DS08BITS -M -1,1 packedbits.h5 +TOOLTEST tpbitsOffsetNegative.ddl --enable-error-stack -d /DS08BITS -M -1,1 packedbits.h5 # Bad length, must not be positive. -TOOLTEST tpbitsLengthPositive.ddl -d /DS08BITS -M 4,0 packedbits.h5 +TOOLTEST tpbitsLengthPositive.ddl --enable-error-stack -d /DS08BITS -M 4,0 packedbits.h5 # Offset+Length is too large. Max is 8 for now. -TOOLTEST tpbitsLengthExceeded.ddl -d /DS08BITS -M 37,28 packedbits.h5 +TOOLTEST tpbitsLengthExceeded.ddl --enable-error-stack -d /DS08BITS -M 37,28 packedbits.h5 TOOLTEST tpbitsCharLengthExceeded.ddl --enable-error-stack -d /DS08BITS -M 2,7 packedbits.h5 TOOLTEST tpbitsIntLengthExceeded.ddl --enable-error-stack -d /DS16BITS -M 10,7 packedbits.h5 TOOLTEST tpbitsLongLengthExceeded.ddl --enable-error-stack -d /DS32BITS -M 26,7 packedbits.h5 # Incomplete pair of packed bits request. -TOOLTEST tpbitsIncomplete.ddl -d /DS08BITS -M 0,2,2,1,0,2,2, packedbits.h5 +TOOLTEST tpbitsIncomplete.ddl --enable-error-stack -d /DS08BITS -M 0,2,2,1,0,2,2, packedbits.h5 # Report test results and exit diff --git a/tools/testfiles/tattr-3.ddl b/tools/testfiles/tattr-3.ddl index 4eee317..c0dd123 100644 --- a/tools/testfiles/tattr-3.ddl +++ b/tools/testfiles/tattr-3.ddl @@ -6,4 +6,11 @@ ATTRIBUTE "/attr2" { ATTRIBUTE "/attr" { } } +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Aopen(): unable to load attribute info from object header for attribute: 'attr' + major: Attribute + minor: Unable to initialize object + #001: (file name) line (number) in H5O_attr_open_by_name(): can't locate attribute: 'attr' + major: Attribute + minor: Object not found h5dump error: unable to open attribute "/attr" diff --git a/tools/testfiles/textlink.ddl b/tools/testfiles/textlink.ddl index 5459b30..4718adb 100644 --- a/tools/testfiles/textlink.ddl +++ b/tools/testfiles/textlink.ddl @@ -10,3 +10,53 @@ GROUP "/" { } } } +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Oopen(): unable to open object + major: Symbol table + minor: Can't open object + #001: (file name) line (number) in H5O_open_name(): object not found + major: Symbol table + minor: Object not found + #002: (file name) line (number) in H5G_loc_find(): can't find object + major: Symbol table + minor: Object not found + #003: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #004: (file name) line (number) in H5G_traverse_real(): special link traversal failed + major: Links + minor: Link traversal failure + #005: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed + major: Links + minor: Link traversal failure + #006: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + major: Symbol table + minor: Unable to find atom information (already closed?) + #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'filename', temp_file_name = 'filename' + major: Links + minor: Unable to open file +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Oopen(): unable to open object + major: Symbol table + minor: Can't open object + #001: (file name) line (number) in H5O_open_name(): object not found + major: Symbol table + minor: Object not found + #002: (file name) line (number) in H5G_loc_find(): can't find object + major: Symbol table + minor: Object not found + #003: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #004: (file name) line (number) in H5G_traverse_real(): special link traversal failed + major: Links + minor: Link traversal failure + #005: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed + major: Links + minor: Link traversal failure + #006: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + major: Symbol table + minor: Unable to find atom information (already closed?) + #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'anotherfile', temp_file_name = 'anotherfile' + major: Links + minor: Unable to open file diff --git a/tools/testfiles/tnofilename-with-packed-bits.ddl b/tools/testfiles/tnofilename-with-packed-bits.ddl index ca16c42..4a7f0b9 100644 --- a/tools/testfiles/tnofilename-with-packed-bits.ddl +++ b/tools/testfiles/tnofilename-with-packed-bits.ddl @@ -94,3 +94,4 @@ usage: h5dump [OPTIONS] file h5dump -d /dset -M 0,1,4,3 quux.h5 +h5dump error: missing file name -- cgit v0.12 From 3723a9591e04fe67c2ef36379905869b7f8a39bc Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 7 Mar 2012 09:39:38 -0500 Subject: [svn-r22033] Remove unnecessary INCLUDE_DIR command Tested: local linux and windows --- tools/CMakeLists.txt | 1 - tools/h5copy/CMakeLists.txt | 1 - tools/h5diff/CMakeLists.txt | 1 - tools/h5dump/CMakeLists.txt | 1 - tools/h5import/CMakeLists.txt | 1 - tools/h5jam/CMakeLists.txt | 1 - tools/h5ls/CMakeLists.txt | 1 - tools/h5stat/CMakeLists.txt | 1 - tools/lib/CMakeLists.txt | 2 -- tools/misc/CMakeLists.txt | 1 - 10 files changed, 11 deletions(-) diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index fad517c..6cdfcac 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -5,7 +5,6 @@ PROJECT (HDF5_TOOLS) # Setup include Directories #----------------------------------------------------------------------------- INCLUDE_DIRECTORIES (${HDF5_TOOLS_SOURCE_DIR}/lib) -INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test) # -------------------------------------------------------------------- # If testing was NOT enabled, then we need to build the tools library diff --git a/tools/h5copy/CMakeLists.txt b/tools/h5copy/CMakeLists.txt index 7006283..f9e7c12 100644 --- a/tools/h5copy/CMakeLists.txt +++ b/tools/h5copy/CMakeLists.txt @@ -5,7 +5,6 @@ PROJECT (HDF5_TOOLS_H5COPY) # Setup include Directories #----------------------------------------------------------------------------- INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) -INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test) # -------------------------------------------------------------------- # Add the h5copy and test executables diff --git a/tools/h5diff/CMakeLists.txt b/tools/h5diff/CMakeLists.txt index 3f73bd7..d810a2c 100644 --- a/tools/h5diff/CMakeLists.txt +++ b/tools/h5diff/CMakeLists.txt @@ -5,7 +5,6 @@ PROJECT (HDF5_TOOLS_H5DIFF) # Setup include Directories #----------------------------------------------------------------------------- INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) -INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test) # -------------------------------------------------------------------- # Add the h5diff executables diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt index a5432c4..e16b319 100644 --- a/tools/h5dump/CMakeLists.txt +++ b/tools/h5dump/CMakeLists.txt @@ -5,7 +5,6 @@ PROJECT (HDF5_TOOLS_H5DUMP) # Setup include Directories #----------------------------------------------------------------------------- INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) -INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test) # -------------------------------------------------------------------- # Add the h5dump executables diff --git a/tools/h5import/CMakeLists.txt b/tools/h5import/CMakeLists.txt index bb8de26..76dcf26 100644 --- a/tools/h5import/CMakeLists.txt +++ b/tools/h5import/CMakeLists.txt @@ -5,7 +5,6 @@ PROJECT (HDF5_TOOLS_H5IMPORT) # Setup include Directories #----------------------------------------------------------------------------- INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) -INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test) # -------------------------------------------------------------------- # Add the h5import executables diff --git a/tools/h5jam/CMakeLists.txt b/tools/h5jam/CMakeLists.txt index 9a74ebc..a03d139 100644 --- a/tools/h5jam/CMakeLists.txt +++ b/tools/h5jam/CMakeLists.txt @@ -5,7 +5,6 @@ PROJECT (HDF5_TOOLS_H5JAM) # Setup include Directories #----------------------------------------------------------------------------- INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) -INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test) # -------------------------------------------------------------------- # Add the h5jam executables diff --git a/tools/h5ls/CMakeLists.txt b/tools/h5ls/CMakeLists.txt index ad37da0..f76c054 100644 --- a/tools/h5ls/CMakeLists.txt +++ b/tools/h5ls/CMakeLists.txt @@ -5,7 +5,6 @@ PROJECT (HDF5_TOOLS_H5LS) # Setup include Directories #----------------------------------------------------------------------------- INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) -INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test) #----------------------------------------------------------------------------- # Add the h5ls executable diff --git a/tools/h5stat/CMakeLists.txt b/tools/h5stat/CMakeLists.txt index b0984a6..8c621c9 100644 --- a/tools/h5stat/CMakeLists.txt +++ b/tools/h5stat/CMakeLists.txt @@ -5,7 +5,6 @@ PROJECT (HDF5_TOOLS_H5STAT) # Setup include Directories #----------------------------------------------------------------------------- INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) -INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test) # -------------------------------------------------------------------- # Add the h5stat executables diff --git a/tools/lib/CMakeLists.txt b/tools/lib/CMakeLists.txt index a75596d..837a14e 100644 --- a/tools/lib/CMakeLists.txt +++ b/tools/lib/CMakeLists.txt @@ -4,8 +4,6 @@ PROJECT (HDF5_TOOLS_LIB) #----------------------------------------------------------------------------- # Define Sources #----------------------------------------------------------------------------- -#INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) -#INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test) SET (H5_TOOLS_LIB_SRCS ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5diff.c diff --git a/tools/misc/CMakeLists.txt b/tools/misc/CMakeLists.txt index 3e70163..72930c9 100644 --- a/tools/misc/CMakeLists.txt +++ b/tools/misc/CMakeLists.txt @@ -5,7 +5,6 @@ PROJECT (HDF5_TOOLS_MISC) # Setup include Directories #----------------------------------------------------------------------------- INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) -INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test) # -------------------------------------------------------------------- # Add the misc executables -- cgit v0.12 From 3ac8dfa8b7a8f9b5e22a9ac6812a2ba9a5a9f730 Mon Sep 17 00:00:00 2001 From: Jonathan Kim Date: Thu, 8 Mar 2012 16:35:23 -0500 Subject: [svn-r22036] Purpose: HDFFV-7602 - GMQS: HDF5 command tools: Provide framework for reusable test files among tools Stage2 working for h5ls tool. Description: Update cmake script to fetch test files from any tools to a test directory and run test in organized manner. Also keep the apperance similiar to shell script for better maintainance. Tested: CMake (Windows and jam) --- tools/h5ls/CMakeLists.txt | 189 ++++++++++++++++++++++------------------------ 1 file changed, 91 insertions(+), 98 deletions(-) diff --git a/tools/h5ls/CMakeLists.txt b/tools/h5ls/CMakeLists.txt index f76c054..a057594 100644 --- a/tools/h5ls/CMakeLists.txt +++ b/tools/h5ls/CMakeLists.txt @@ -28,111 +28,104 @@ IF (BUILD_TESTING) # -------------------------------------------------------------------- # Copy all the test files from source directory to test directory # -------------------------------------------------------------------- - SET (LIST_EXPECT_OUTPUT_FILES - help-1.ls - help-2.ls - help-3.ls - nosuchfile.ls - tall-1.ls - tall-2.ls - tarray1.ls - tattr2.ls - tattrreg_le.ls - tattrreg_be.ls - tcomp-1.ls - tdataregbe.ls - tdataregle.ls - tdset-1.ls - tempty.ls - textlink-1.ls - textlinksrc-1.ls - textlinksrc-2.ls - textlinksrc-3.ls - textlinksrc-4.ls - textlinksrc-5.ls - textlinksrc-6.ls - textlinksrc-7.ls - textlinksrc-1-old.ls - textlinksrc-2-old.ls - textlinksrc-3-old.ls - textlinksrc-6-old.ls - textlinksrc-7-old.ls - tsoftlinks-1.ls - tsoftlinks-2.ls - tsoftlinks-3.ls - tsoftlinks-4.ls - tsoftlinks-5.ls - textlinksrc-nodangle-1.ls - textlinksrc-nodangle-2.ls - tgrp_comments.ls - tsoftlinks-nodangle-1.ls - thlinks-nodangle-1.ls - tgroup.ls - tgroup-1.ls - tgroup-2.ls - tgroup-3.ls - thlink-1.ls - tloop-1.ls - tnestcomp-1.ls - tnestcomp-2.ls - tnestcomp-3.ls - tnestcomp-4.ls - tsaf.ls - tslink-1.ls - tstr-1.ls - tudlink-1.ls - tvldtypes1.ls - tvldtypes2le.ls - tvldtypes2be.ls - ) SET (LIST_HDF5_TEST_FILES - tall.h5 - tarray1.h5 - tattr2.h5 - tattrreg.h5 - tcompound.h5 - tdatareg.h5 - tdset.h5 - tempty.h5 - textlink.h5 - textlinksrc.h5 - textlinktar.h5 - tgroup.h5 - tgrp_comments.h5 - thlink.h5 - tloop.h5 - tnestedcomp.h5 - tsaf.h5 - tslink.h5 - tsoftlinks.h5 - tstr.h5 - tudlink.h5 - tvldtypes1.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tall.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray1.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tattr2.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tattrreg.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tcompound.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tdatareg.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tdset.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tempty.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlink.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinktar.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tgroup.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tgrp_comments.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/thlink.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tloop.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tnestedcomp.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tsaf.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tslink.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tsoftlinks.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tstr.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tudlink.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes1.h5 ) - # copy the list of expected output files - FOREACH (out_file ${LIST_EXPECT_OUTPUT_FILES}) - SET (out_dest "${PROJECT_BINARY_DIR}/${out_file}") - #MESSAGE (STATUS " Translating ${out_file}") - ADD_CUSTOM_COMMAND ( - TARGET h5ls - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/${out_file} ${out_dest} - ) - ENDFOREACH (out_file ${LIST_EXPECT_OUTPUT_FILES}) + SET (LIST_OTHER_TEST_FILES + ${HDF5_TOOLS_SRC_DIR}/testfiles/help-1.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/help-2.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/help-3.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/nosuchfile.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-1.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-2.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray1.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tattr2.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tattrreg_le.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tattrreg_be.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tcomp-1.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tdataregbe.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tdataregle.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tdset-1.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tempty.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlink-1.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-1.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-2.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-3.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-4.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-5.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-6.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-7.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-1-old.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-2-old.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-3-old.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-6-old.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-7-old.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tsoftlinks-1.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tsoftlinks-2.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tsoftlinks-3.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tsoftlinks-4.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tsoftlinks-5.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-nodangle-1.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-nodangle-2.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tgrp_comments.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tsoftlinks-nodangle-1.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/thlinks-nodangle-1.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tgroup.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tgroup-1.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tgroup-2.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tgroup-3.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/thlink-1.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tloop-1.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tnestcomp-1.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tnestcomp-2.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tnestcomp-3.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tnestcomp-4.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tsaf.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tslink-1.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tstr-1.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tudlink-1.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes1.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes2le.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes2be.ls + ) - # copy the list of hdf5 test files - FOREACH (h5_file ${LIST_HDF5_TEST_FILES}) - SET (h5_dest "${PROJECT_BINARY_DIR}/${h5_file}") - #MESSAGE (STATUS " Copying ${h5_file}") + FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + + # copy the list of test files + FOREACH (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + GET_FILENAME_COMPONENT(fname "${listfiles}" NAME) + SET (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}") + #MESSAGE (STATUS " Copying ${listfiles} to ${dest}") ADD_CUSTOM_COMMAND ( TARGET h5ls POST_BUILD COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/${h5_file} ${h5_dest} + ARGS -E copy_if_different ${listfiles} ${dest} ) - ENDFOREACH (h5_file ${LIST_HDF5_TEST_FILES}) + ENDFOREACH (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + ############################################################################## ############################################################################## @@ -155,14 +148,14 @@ IF (BUILD_TESTING) ADD_TEST ( NAME H5LS-clear-${resultfile}-objects COMMAND ${CMAKE_COMMAND} - -E remove ${resultfile}.out ${resultfile}.out.err + -E remove ./testfiles/${resultfile}.out ./testfiles/${resultfile}.out.err ) ADD_TEST ( NAME H5LS-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_ARGS=${ARGN}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${resultfile}.out" -D "TEST_EXPECT=${resultcode}" -D "TEST_REFERENCE=${resultfile}.ls" -- cgit v0.12 From 0a46593a382259ac39df2e317609d21c32160317 Mon Sep 17 00:00:00 2001 From: Jonathan Kim Date: Fri, 9 Mar 2012 15:34:37 -0500 Subject: [svn-r22038] Purpose: Fix for HDFFV-7835 h5diff: incorrect result for comparing the two same type symlinks as dangling links. Description: When two symbolic dangling links are compared with --follow-symlinks option, the result should be same. It works for comparing two files, but didn't work for comparing two objects. Test cases were added and tagged with jira#. Tested: jam (linux32-LE), koala (linux64-LE), ostrich (linuxppc64-BE), tejeda (mac32-LE), linew (solaris-BE), Windows (32-LE cmake), Cmake (jam) --- MANIFEST | 4 +++ release_docs/RELEASE.txt | 15 +++++++---- tools/h5diff/CMakeLists.txt | 23 +++++++++++++++- tools/h5diff/testfiles/h5diff_465.txt | 3 +-- tools/h5diff/testfiles/h5diff_466.txt | 5 ++++ tools/h5diff/testfiles/h5diff_467.txt | 3 +++ tools/h5diff/testfiles/h5diff_468.txt | 5 ++++ tools/h5diff/testfiles/h5diff_469.txt | 3 +++ tools/h5diff/testh5diff.sh | 13 +++++++++ tools/lib/h5diff.c | 51 +++++++++++++++++++++-------------- 10 files changed, 97 insertions(+), 28 deletions(-) create mode 100644 tools/h5diff/testfiles/h5diff_466.txt create mode 100644 tools/h5diff/testfiles/h5diff_467.txt create mode 100644 tools/h5diff/testfiles/h5diff_468.txt create mode 100644 tools/h5diff/testfiles/h5diff_469.txt diff --git a/MANIFEST b/MANIFEST index 0cccbad..c5ba0af 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1849,6 +1849,10 @@ ./tools/h5diff/testfiles/h5diff_458.txt ./tools/h5diff/testfiles/h5diff_459.txt ./tools/h5diff/testfiles/h5diff_465.txt +./tools/h5diff/testfiles/h5diff_466.txt +./tools/h5diff/testfiles/h5diff_467.txt +./tools/h5diff/testfiles/h5diff_468.txt +./tools/h5diff/testfiles/h5diff_469.txt ./tools/h5diff/testfiles/h5diff_480.txt ./tools/h5diff/testfiles/h5diff_481.txt ./tools/h5diff/testfiles/h5diff_482.txt diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index baf9f50..2d7b48c 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -241,12 +241,13 @@ New Features Tools: ------ - - h5repack: Improved performance for hanlding big chunked dataset - (size > 128MB). It would perform much better prior to the - improvement, especially for cases that chunk dimentions - looks like "1024x5x1" (compare to "1x5x1024"). When bigger numbers + - h5repack: Improved performance for big chunked datasets (size > 128MB) + when used with layout (-l) or compression (-f) option. + It would perform much better prior to the improvement, + especially for cases that chunk dimentions looks like + "1024x5x1" (compare to "1x5x1024"). When bigger numbers are toward front and smaller number is toward back in chunk - dimentions. + dimentions. HDFFV-7862 (JKM - 2012/03/01) - h5dump: Added new option --no-compact-subset. This option will not interpret the '[' character as starting the compact form of subsetting. This is useful when the "h5dump error: unable to @@ -649,6 +650,10 @@ Bug Fixes since HDF5-1.8.0 release Tools ----- + - h5diff: When two symbolic dangling links are compared with + --follow-symlinks option, the result should be same. It worked for + comparing two files, but didn't work for comparing two objects. + HDFFV-7835 (JKM 2012/03/09) - h5dump: Refactored code to remove duplicated functions. Split XML functions from DDL functions. Corrected indentation and formatting errors. Also fixed subsetting counting overflow (HDFFV-5874). Verified diff --git a/tools/h5diff/CMakeLists.txt b/tools/h5diff/CMakeLists.txt index d810a2c..f178f19 100644 --- a/tools/h5diff/CMakeLists.txt +++ b/tools/h5diff/CMakeLists.txt @@ -130,6 +130,10 @@ IF (BUILD_TESTING) h5diff_458.txt h5diff_459.txt h5diff_465.txt + h5diff_466.txt + h5diff_467.txt + h5diff_468.txt + h5diff_469.txt h5diff_480.txt h5diff_481.txt h5diff_482.txt @@ -657,6 +661,14 @@ IF (BUILD_TESTING) h5diff_459.out.err h5diff_465.out h5diff_465.out.err + h5diff_466.out + h5diff_466.out.err + h5diff_467.out + h5diff_467.out.err + h5diff_468.out + h5diff_468.out.err + h5diff_469.out + h5diff_469.out.err h5diff_480.out h5diff_480.out.err h5diff_481.out @@ -1266,7 +1278,16 @@ ADD_H5_TEST (h5diff_459 2 --follow-symlinks -v --no-dangling-links ${FILE15} $ # dangling link --follow-symlinks (obj vs obj) # (HDFFV-7836) -ADD_H5_TEST (h5diff_465 1 --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /soft_link1) +ADD_H5_TEST (h5diff_465 0 --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /soft_link1) +# (HDFFV-7835) +# soft dangling vs. soft dangling +ADD_H5_TEST (h5diff_466 0 -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /soft_link1) +# soft link vs. soft dangling +ADD_H5_TEST (h5diff_467 1 -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /soft_link2) +# ext dangling vs. ext dangling +ADD_H5_TEST (h5diff_468 0 -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /ext_link4) +# ext link vs. ext dangling +ADD_H5_TEST (h5diff_469 1 -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /ext_link2) # ############################################################################## # # test for group diff recursivly diff --git a/tools/h5diff/testfiles/h5diff_465.txt b/tools/h5diff/testfiles/h5diff_465.txt index 827e88e..eca5994 100644 --- a/tools/h5diff/testfiles/h5diff_465.txt +++ b/tools/h5diff/testfiles/h5diff_465.txt @@ -1,2 +1 @@ -1 differences found -EXIT CODE: 1 +EXIT CODE: 0 diff --git a/tools/h5diff/testfiles/h5diff_466.txt b/tools/h5diff/testfiles/h5diff_466.txt new file mode 100644 index 0000000..3e00ca3 --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_466.txt @@ -0,0 +1,5 @@ +obj1 is a dangling link. +obj2 is a dangling link. +dangling link: and +0 differences found +EXIT CODE: 0 diff --git a/tools/h5diff/testfiles/h5diff_467.txt b/tools/h5diff/testfiles/h5diff_467.txt new file mode 100644 index 0000000..f5195c0 --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_467.txt @@ -0,0 +1,3 @@ +obj2 is a dangling link. +1 differences found +EXIT CODE: 1 diff --git a/tools/h5diff/testfiles/h5diff_468.txt b/tools/h5diff/testfiles/h5diff_468.txt new file mode 100644 index 0000000..75b16c6 --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_468.txt @@ -0,0 +1,5 @@ +obj1 is a dangling link. +obj2 is a dangling link. +dangling link: and +0 differences found +EXIT CODE: 0 diff --git a/tools/h5diff/testfiles/h5diff_469.txt b/tools/h5diff/testfiles/h5diff_469.txt new file mode 100644 index 0000000..594fd80 --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_469.txt @@ -0,0 +1,3 @@ +obj2 is a dangling link. +1 differences found +EXIT CODE: 1 diff --git a/tools/h5diff/testh5diff.sh b/tools/h5diff/testh5diff.sh index aa0f502..2e2feb9 100755 --- a/tools/h5diff/testh5diff.sh +++ b/tools/h5diff/testh5diff.sh @@ -201,6 +201,10 @@ $SRC_H5DIFF_TESTFILES/h5diff_457.txt $SRC_H5DIFF_TESTFILES/h5diff_458.txt $SRC_H5DIFF_TESTFILES/h5diff_459.txt $SRC_H5DIFF_TESTFILES/h5diff_465.txt +$SRC_H5DIFF_TESTFILES/h5diff_466.txt +$SRC_H5DIFF_TESTFILES/h5diff_467.txt +$SRC_H5DIFF_TESTFILES/h5diff_468.txt +$SRC_H5DIFF_TESTFILES/h5diff_469.txt $SRC_H5DIFF_TESTFILES/h5diff_480.txt $SRC_H5DIFF_TESTFILES/h5diff_481.txt $SRC_H5DIFF_TESTFILES/h5diff_482.txt @@ -943,6 +947,15 @@ TOOLTEST h5diff_459.txt --follow-symlinks -v --no-dangling-links h5diff_extlin # dangling link --follow-symlinks (obj vs obj) # (HDFFV-7836) TOOLTEST h5diff_465.txt --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /soft_link1 +# (HDFFV-7835) +# soft dangling vs. soft dangling +TOOLTEST h5diff_466.txt -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /soft_link1 +# soft link vs. soft dangling +TOOLTEST h5diff_467.txt -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /soft_link2 +# ext dangling vs. ext dangling +TOOLTEST h5diff_468.txt -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /ext_link4 +# ext link vs. ext dangling +TOOLTEST h5diff_469.txt -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /ext_link2 # ############################################################################## # # test for group diff recursivly diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index bc8acd5..c6353eb 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -644,8 +644,8 @@ hsize_t h5diff(const char *fname1, char filenames[2][MAX_FILENAME]; hsize_t nfound = 0; int i; - //int i1, i2; - int l_ret; + int l_ret1 = -1; + int l_ret2 = -1; const char * obj1fullname = NULL; const char * obj2fullname = NULL; /* init to group type */ @@ -862,6 +862,10 @@ hsize_t h5diff(const char *fname1, } + /* get any symbolic links info */ + l_ret1 = H5tools_get_symlink_info(file1_id, obj1fullname, &trg_linfo1, TRUE); + l_ret2 = H5tools_get_symlink_info(file2_id, obj2fullname, &trg_linfo2, TRUE); + /*--------------------------------------------- * check for following symlinks */ @@ -874,13 +878,12 @@ hsize_t h5diff(const char *fname1, /*------------------------------- * check symbolic link (object1) */ - l_ret = H5tools_get_symlink_info(file1_id, obj1fullname, &trg_linfo1, TRUE); /* dangling link */ - if (l_ret == 0) + if (l_ret1 == 0) { if (options->no_dangle_links) { - /* gangling link is error */ + /* treat dangling link is error */ if(options->m_verbose) parallel_print("Warning: <%s> is a dangling link.\n", obj1fullname); options->err_stat = 1; @@ -890,30 +893,33 @@ hsize_t h5diff(const char *fname1, { if(options->m_verbose) parallel_print("obj1 <%s> is a dangling link.\n", obj1fullname); - nfound++; - print_found(nfound); - goto out; + if (l_ret1 != 0 || l_ret2 != 0) + { + nfound++; + print_found(nfound); + goto out; + } } } - else if(l_ret < 0) /* fail */ + else if(l_ret1 < 0) /* fail */ { parallel_print ("Object <%s> could not be found in <%s>\n", obj1fullname, fname1); options->err_stat = 1; goto out; } - else if(l_ret != 2) /* symbolic link */ + else if(l_ret1 != 2) /* symbolic link */ obj1type = trg_linfo1.trg_type; /*------------------------------- * check symbolic link (object2) */ - l_ret = H5tools_get_symlink_info(file2_id, obj2fullname, &trg_linfo2, TRUE); + /* dangling link */ - if (l_ret == 0) + if (l_ret2 == 0) { if (options->no_dangle_links) { - /* gangling link is error */ + /* treat dangling link is error */ if(options->m_verbose) parallel_print("Warning: <%s> is a dangling link.\n", obj2fullname); options->err_stat = 1; @@ -923,18 +929,21 @@ hsize_t h5diff(const char *fname1, { if(options->m_verbose) parallel_print("obj2 <%s> is a dangling link.\n", obj2fullname); - nfound++; - print_found(nfound); - goto out; + if (l_ret1 != 0 || l_ret2 != 0) + { + nfound++; + print_found(nfound); + goto out; + } } } - else if(l_ret < 0) /* fail */ + else if(l_ret2 < 0) /* fail */ { parallel_print ("Object <%s> could not be found in <%s>\n", obj2fullname, fname2); options->err_stat = 1; goto out; } - else if(l_ret != 2) /* symbolic link */ + else if(l_ret2 != 2) /* symbolic link */ obj2type = trg_linfo2.trg_type; } /* end of if follow symlinks */ @@ -947,8 +956,10 @@ hsize_t h5diff(const char *fname1, if(!(options->m_verbose || options->m_report)) { - if (h5tools_is_obj_same(file1_id,obj1fullname,file2_id,obj2fullname)!=0) - goto out; + /* if no danglink links */ + if ( l_ret1 > 0 && l_ret2 > 0 ) + if (h5tools_is_obj_same(file1_id,obj1fullname,file2_id,obj2fullname)!=0) + goto out; } -- cgit v0.12 From 80b2b54f416f102404ba9f7f724ec3e8241a4b71 Mon Sep 17 00:00:00 2001 From: HDF Tester Date: Sun, 11 Mar 2012 10:52:04 -0500 Subject: [svn-r22040] Snapshot version 1.9 release 110 --- README.txt | 2 +- c++/src/Makefile.in | 2 +- config/lt_vers.am | 2 +- configure | 24 ++++++++++++------------ configure.in | 2 +- fortran/src/Makefile.in | 2 +- hl/c++/src/Makefile.in | 2 +- hl/fortran/src/Makefile.in | 2 +- hl/src/Makefile.in | 2 +- release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 ++-- src/Makefile.in | 2 +- vms/src/h5pubconf.h | 6 +++--- windows/src/H5pubconf.h | 6 +++--- 14 files changed, 30 insertions(+), 30 deletions(-) diff --git a/README.txt b/README.txt index 269829a..8ee01cf 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.110 currently under development +HDF5 version 1.9.111 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index 1903667..f3e8e5d 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -431,7 +431,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 100 +LT_VERS_REVISION = 101 LT_VERS_AGE = 0 # Include src directory diff --git a/config/lt_vers.am b/config/lt_vers.am index 4528e68..c137d57 100644 --- a/config/lt_vers.am +++ b/config/lt_vers.am @@ -17,7 +17,7 @@ # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 100 +LT_VERS_REVISION = 101 LT_VERS_AGE = 0 ## If the API changes *at all*, increment LT_VERS_INTERFACE and diff --git a/configure b/configure index 4b4c7a6..d7029d2 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh -# From configure.in Id: configure.in 21910 2012-02-05 15:51:01Z hdftest . +# From configure.in Id: configure.in 22022 2012-03-04 15:34:49Z hdftest . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for HDF5 1.9.110. +# Generated by GNU Autoconf 2.68 for HDF5 1.9.111. # # Report bugs to . # @@ -571,8 +571,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.9.110' -PACKAGE_STRING='HDF5 1.9.110' +PACKAGE_VERSION='1.9.111' +PACKAGE_STRING='HDF5 1.9.111' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1463,7 +1463,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures HDF5 1.9.110 to adapt to many kinds of systems. +\`configure' configures HDF5 1.9.111 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1533,7 +1533,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.9.110:";; + short | recursive ) echo "Configuration of HDF5 1.9.111:";; esac cat <<\_ACEOF @@ -1726,7 +1726,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.9.110 +HDF5 configure 1.9.111 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -2815,7 +2815,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by HDF5 $as_me 1.9.110, which was +It was created by HDF5 $as_me 1.9.111, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -3636,7 +3636,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.9.110' + VERSION='1.9.111' cat >>confdefs.h <<_ACEOF @@ -30611,7 +30611,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.9.110, which was +This file was extended by HDF5 $as_me 1.9.111, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -30677,7 +30677,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.9.110 +HDF5 config.status 1.9.111 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" @@ -33471,7 +33471,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.9.110 +HDF5 config.lt 1.9.111 configured by $0, generated by GNU Autoconf 2.68. Copyright (C) 2010 Free Software Foundation, Inc. diff --git a/configure.in b/configure.in index 799d290..5e81022 100644 --- a/configure.in +++ b/configure.in @@ -26,7 +26,7 @@ dnl dnl NOTE: Don't forget to change the version number here when we do a dnl release!!! dnl -AC_INIT([HDF5], [1.9.110], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.9.111], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AM_CONFIG_HEADER([src/H5config.h]) diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index ca53252..0ccaf33 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -478,7 +478,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 100 +LT_VERS_REVISION = 101 LT_VERS_AGE = 0 # Include src directory in both Fortran and C flags (C compiler is used diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index eba4308..d9db5de 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -421,7 +421,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 100 +LT_VERS_REVISION = 101 LT_VERS_AGE = 0 # Include src directory diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index bbe420c..4056a1b 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -436,7 +436,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 100 +LT_VERS_REVISION = 101 LT_VERS_AGE = 0 INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/hl/src -I$(top_builddir)/hl/src \ -I$(top_srcdir)/fortran/src -I$(top_builddir)/fortran/src diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index 0509b75..3826215 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -420,7 +420,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 100 +LT_VERS_REVISION = 101 LT_VERS_AGE = 0 # This library is our main target. diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 2d7b48c..bc830ed 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.110 currently under development +HDF5 version 1.9.111 currently under development ================================================================================ diff --git a/src/H5public.h b/src/H5public.h index 562dd5e..6a03972 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -75,10 +75,10 @@ extern "C" { /* Version numbers */ #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 9 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 110 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 111 /* For tweaks, bug-fixes, or development */ #define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.9.110" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.9.111" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) diff --git a/src/Makefile.in b/src/Makefile.in index 8a616bb..1a1fb03 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -484,7 +484,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 100 +LT_VERS_REVISION = 101 LT_VERS_AGE = 0 H5detect_CFLAGS = -g $(AM_CFLAGS) diff --git a/vms/src/h5pubconf.h b/vms/src/h5pubconf.h index b8afa43..7e0334d 100644 --- a/vms/src/h5pubconf.h +++ b/vms/src/h5pubconf.h @@ -502,7 +502,7 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.110" +#define H5_PACKAGE_STRING "HDF5 1.9.111" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" @@ -511,7 +511,7 @@ #define H5_PACKAGE_URL "" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.110" +#define H5_PACKAGE_VERSION "1.9.111" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "ll" @@ -674,7 +674,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.110" +#define H5_VERSION "1.9.111" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ diff --git a/windows/src/H5pubconf.h b/windows/src/H5pubconf.h index 448c0a7..849c22e 100644 --- a/windows/src/H5pubconf.h +++ b/windows/src/H5pubconf.h @@ -527,7 +527,7 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.110" +#define H5_PACKAGE_STRING "HDF5 1.9.111" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" @@ -536,7 +536,7 @@ #define H5_PACKAGE_URL "" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.110" +#define H5_PACKAGE_VERSION "1.9.111" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "I64" @@ -707,7 +707,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.110" +#define H5_VERSION "1.9.111" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ -- cgit v0.12 From bec199165a54b8c369c40a11b9159771fb947b1c Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 12 Mar 2012 11:33:15 -0500 Subject: [svn-r22042] HDFFV-7957-7958: Add tools error stack and check return from H5Dreference call. Tested: CMake and h5committest --- tools/h5dump/h5dump.c | 290 ++++++++++++++++++++++------------------ tools/lib/h5tools.c | 11 +- tools/lib/h5tools_dump.c | 64 +++++---- tools/lib/h5tools_dump.h | 4 +- tools/lib/h5tools_error.h | 7 +- tools/testfiles/filter_fail.ddl | 4 + 6 files changed, 217 insertions(+), 163 deletions(-) diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c index 64c5e7c..3cda4c1 100644 --- a/tools/h5dump/h5dump.c +++ b/tools/h5dump/h5dump.c @@ -1369,11 +1369,13 @@ main(int argc, const char *argv[]) hid_t fid = -1; hid_t gid = -1; H5E_auto2_t func; + H5E_auto2_t tools_func; H5O_info_t oi; - struct handler_t *hand; + struct handler_t *hand = NULL; int i; unsigned u; void *edata; + void *tools_edata; char *fname = NULL; h5tools_setprogname(PROGRAMNAME); @@ -1388,6 +1390,10 @@ main(int argc, const char *argv[]) /* Initialize h5tools lib */ h5tools_init(); + /* Disable tools error reporting */ + H5Eget_auto2(H5tools_ERR_STACK_g, &tools_func, &tools_edata); + H5Eset_auto2(H5tools_ERR_STACK_g, NULL, NULL); + if((hand = parse_command_line(argc, argv))==NULL) { goto done; } @@ -1398,8 +1404,10 @@ main(int argc, const char *argv[]) goto done; } - if (enable_error_stack) + if (enable_error_stack) { H5Eset_auto2(H5E_DEFAULT, func, edata); + H5Eset_auto2(H5tools_ERR_STACK_g, tools_func, tools_edata); + } /* Check for conflicting options */ if (doxml) { @@ -1442,169 +1450,186 @@ main(int argc, const char *argv[]) h5tools_setstatus(EXIT_FAILURE); goto done; } - fname = HDstrdup(argv[opt_ind]); + while(opt_ind < argc) { + fname = HDstrdup(argv[opt_ind++]); - fid = h5tools_fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT, driver, NULL, 0); - - if (fid < 0) { - error_msg("unable to open file \"%s\"\n", fname); - h5tools_setstatus(EXIT_FAILURE); - goto done; - } + fid = h5tools_fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT, driver, NULL, 0); - /* allocate and initialize internal data structure */ - init_prefix(&prefix, prefix_len); + if (fid < 0) { + error_msg("unable to open file \"%s\"\n", fname); + h5tools_setstatus(EXIT_FAILURE); + goto done; + } - /* Prepare to find objects that might be targets of a reference */ - fill_ref_path_table(fid); + /* allocate and initialize internal data structure */ + init_prefix(&prefix, prefix_len); - if(doxml) { - /* initialize XML */ - /* reset prefix! */ - HDstrcpy(prefix, ""); + /* Prepare to find objects that might be targets of a reference */ + fill_ref_path_table(fid); - /* make sure the URI is initialized to something */ - if (xml_dtd_uri == NULL) { - if (useschema) { - xml_dtd_uri = DEFAULT_XSD; + if(doxml) { + /* initialize XML */ + /* reset prefix! */ + HDstrcpy(prefix, ""); + + /* make sure the URI is initialized to something */ + if (xml_dtd_uri == NULL) { + if (useschema) { + xml_dtd_uri = DEFAULT_XSD; + } + else { + xml_dtd_uri = DEFAULT_DTD; + xmlnsprefix = ""; + } } else { - xml_dtd_uri = DEFAULT_DTD; - xmlnsprefix = ""; - } - } - else { - if (useschema && HDstrcmp(xmlnsprefix,"")) { - error_msg("Cannot set Schema URL for a qualified namespace--use -X or -U option with -D \n"); - h5tools_setstatus(EXIT_FAILURE); - goto done; + if (useschema && HDstrcmp(xmlnsprefix,"")) { + error_msg("Cannot set Schema URL for a qualified namespace--use -X or -U option with -D \n"); + h5tools_setstatus(EXIT_FAILURE); + goto done; + } } } - } - - /* Get object info for root group */ - if(H5Oget_info_by_name(fid, "/", &oi, H5P_DEFAULT) < 0) { - error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__); - h5tools_setstatus(EXIT_FAILURE); - goto done; - } - /* Initialize object tables */ - if(table_list_add(fid, oi.fileno) < 0) { - error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__); - h5tools_setstatus(EXIT_FAILURE); - goto done; - } - group_table = table_list.tables[0].group_table; - dset_table = table_list.tables[0].dset_table; - type_table = table_list.tables[0].type_table; - - /* does there exist unamed committed datatype */ - for (u = 0; u < type_table->nobjs; u++) - if (!type_table->objs[u].recorded) { - unamedtype = 1; - break; - } /* end if */ + /* Get object info for root group */ + if(H5Oget_info_by_name(fid, "/", &oi, H5P_DEFAULT) < 0) { + error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__); + h5tools_setstatus(EXIT_FAILURE); + goto done; + } - /* start to dump - display file header information */ - if (!doxml) { - begin_obj(h5tools_dump_header_format->filebegin, fname, h5tools_dump_header_format->fileblockbegin); - } - else { - HDfprintf(rawoutstream, "\n"); + /* Initialize object tables */ + if(table_list_add(fid, oi.fileno) < 0) { + error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__); + h5tools_setstatus(EXIT_FAILURE); + goto done; + } + group_table = table_list.tables[0].group_table; + dset_table = table_list.tables[0].dset_table; + type_table = table_list.tables[0].type_table; + + /* does there exist unamed committed datatype */ + for (u = 0; u < type_table->nobjs; u++) + if (!type_table->objs[u].recorded) { + unamedtype = 1; + break; + } /* end if */ + + /* start to dump - display file header information */ + if (!doxml) { + begin_obj(h5tools_dump_header_format->filebegin, fname, h5tools_dump_header_format->fileblockbegin); + } + else { + HDfprintf(rawoutstream, "\n"); - /* alternative first element, depending on schema or DTD. */ - if (useschema) { - if (HDstrcmp(xmlnsprefix,"") == 0) { - HDfprintf(rawoutstream, "\n", - xml_dtd_uri); + /* alternative first element, depending on schema or DTD. */ + if (useschema) { + if (HDstrcmp(xmlnsprefix,"") == 0) { + HDfprintf(rawoutstream, "\n", + xml_dtd_uri); + } + else { + /* TO DO: make -url option work in this case (may need new option) */ + char *ns; + char *indx; + + ns = HDstrdup(xmlnsprefix); + indx = HDstrrchr(ns,(int)':'); + if (indx) *indx = '\0'; + + HDfprintf(rawoutstream, "<%sHDF5-File xmlns:%s=\"http://hdfgroup.org/HDF5/XML/schema/HDF5-File\" " + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " + "xsi:schemaLocation=\"http://hdfgroup.org/HDF5/XML/schema/HDF5-File " + "http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd\">\n",xmlnsprefix,ns); + HDfree(ns); + } } else { -/* TO DO: make -url option work in this case (may need new option) */ - char *ns; - char *indx; - - ns = HDstrdup(xmlnsprefix); - indx = HDstrrchr(ns,(int)':'); - if (indx) *indx = '\0'; - - HDfprintf(rawoutstream, "<%sHDF5-File xmlns:%s=\"http://hdfgroup.org/HDF5/XML/schema/HDF5-File\" " - "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " - "xsi:schemaLocation=\"http://hdfgroup.org/HDF5/XML/schema/HDF5-File " - "http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd\">\n",xmlnsprefix,ns); - HDfree(ns); + HDfprintf(rawoutstream, "\n", xml_dtd_uri); + HDfprintf(rawoutstream, "\n"); } - } - else { - HDfprintf(rawoutstream, "\n", xml_dtd_uri); - HDfprintf(rawoutstream, "\n"); } - } - if (!doxml) { - if (display_fi) { - HDfprintf(rawoutstream, "\n"); - dump_fcontents(fid); - end_obj(h5tools_dump_header_format->fileend,h5tools_dump_header_format->fileblockend); - HDfprintf(rawoutstream, "\n"); - goto done; + if (!doxml) { + if (display_fi) { + HDfprintf(rawoutstream, "\n"); + dump_fcontents(fid); + end_obj(h5tools_dump_header_format->fileend,h5tools_dump_header_format->fileblockend); + HDfprintf(rawoutstream, "\n"); + goto done; + } + + if (display_bb) + dump_fcpl(fid); } - if (display_bb) - dump_fcpl(fid); - } + if(display_all) { + if((gid = H5Gopen2(fid, "/", H5P_DEFAULT)) < 0) { + error_msg("unable to open root group\n"); + h5tools_setstatus(EXIT_FAILURE); + } + else { + if (!doxml) + dump_indent += COL; + dump_function_table->dump_group_function(gid, "/" ); + if (!doxml) + dump_indent -= COL; + HDfprintf(rawoutstream, "\n"); + } + + if(H5Gclose(gid) < 0) { + error_msg("unable to close root group\n"); + h5tools_setstatus(EXIT_FAILURE); + } - if(display_all) { - if((gid = H5Gopen2(fid, "/", H5P_DEFAULT)) < 0) { - error_msg("unable to open root group\n"); - h5tools_setstatus(EXIT_FAILURE); } else { - if (!doxml) - dump_indent += COL; - dump_function_table->dump_group_function(gid, "/" ); - if (!doxml) - dump_indent -= COL; + /* Note: this option is not supported for XML */ + if(doxml) { + error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__); + h5tools_setstatus(EXIT_FAILURE); + goto done; + } /* end if */ + + for(i = 0; i < argc; i++) { + if(hand[i].func) { + hand[i].func(fid, hand[i].obj, hand[i].subset_info, 1, NULL); + } + } HDfprintf(rawoutstream, "\n"); } - if(H5Gclose(gid) < 0) { - error_msg("unable to close root group\n"); - h5tools_setstatus(EXIT_FAILURE); + if (!doxml) { + end_obj(h5tools_dump_header_format->fileend, h5tools_dump_header_format->fileblockend); + HDfprintf(rawoutstream, "\n"); + } + else { + HDfprintf(rawoutstream, "\n", xmlnsprefix); } + /* Free tables for objects */ + table_list_free(); - } - else { - /* Note: this option is not supported for XML */ - if(doxml) { - error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__); - h5tools_setstatus(EXIT_FAILURE); - goto done; - } /* end if */ + if(fid >=0) + if (H5Fclose(fid) < 0) + h5tools_setstatus(EXIT_FAILURE); - for(i = 0; i < argc; i++) { - if(hand[i].func) { - hand[i].func(fid, hand[i].obj, hand[i].subset_info, 1, NULL); - } - } - HDfprintf(rawoutstream, "\n"); - } + if(prefix) + HDfree(prefix); + if(fname) + HDfree(fname); + } /* end while */ - if (!doxml) { - end_obj(h5tools_dump_header_format->fileend, h5tools_dump_header_format->fileblockend); - HDfprintf(rawoutstream, "\n"); - } - else { - HDfprintf(rawoutstream, "\n", xmlnsprefix); - } + if(hand) + free_handler(hand, argc); + + /* To Do: clean up XML table */ + + leave(h5tools_getstatus()); done: /* Free tables for objects */ table_list_free(); - if(hand) - free_handler(hand, argc); - if(fid >=0) if (H5Fclose(fid) < 0) h5tools_setstatus(EXIT_FAILURE); @@ -1614,6 +1639,9 @@ done: if(fname) HDfree(fname); + if(hand) + free_handler(hand, argc); + /* To Do: clean up XML table */ H5Eset_auto2(H5E_DEFAULT, func, edata); diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index 30b8f33..ba9510e 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -35,6 +35,7 @@ #define ALIGN(A,Z) ((((A) + (Z) - 1) / (Z)) * (Z)) /* global variables */ +hid_t H5tools_ERR_STACK_g = 0; hid_t H5tools_ERR_CLS_g = -1; hid_t H5E_tools_g = -1; hid_t H5E_tools_min_id_g = -1; @@ -114,7 +115,8 @@ h5tools_init(void) if (!h5tools_init_g) { /* register the error class */ HDsnprintf(lib_str, sizeof(lib_str), "%d.%d.%d",H5_VERS_MAJOR, H5_VERS_MINOR, H5_VERS_RELEASE); - + + H5tools_ERR_STACK_g = H5Ecreate_stack(); H5TOOLS_INIT_ERROR() if (!rawdatastream) @@ -149,7 +151,12 @@ h5tools_init(void) void h5tools_close(void) { + H5E_auto2_t tools_func; + void *tools_edata; if (h5tools_init_g) { + H5Eget_auto2(H5tools_ERR_STACK_g, &tools_func, &tools_edata); + if(tools_func!=NULL) + H5Eprint(H5tools_ERR_STACK_g, rawerrorstream); if (rawdatastream && rawdatastream != stdout) { if (fclose(rawdatastream)) perror("closing rawdatastream"); @@ -173,7 +180,7 @@ h5tools_close(void) term_ref_path_table(); H5TOOLS_CLOSE_ERROR() - + H5Eclose_stack(H5tools_ERR_STACK_g); /* Shut down the library */ H5close(); diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index 2a2267e..9188225 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -232,8 +232,8 @@ h5tools_dump_init(void) * indicates whether the data supplied in this call falls at the * beginning or end of the total data to be printed (START_OF_DATA and * END_OF_DATA). - * Return: - * None + * Return: Success: SUCCEED + * Failure: FAIL * Programmer: * Robb Matzke, Monday, April 26, 1999 * Modifications: @@ -256,11 +256,12 @@ h5tools_dump_init(void) * new field sm_pos in h5tools_context_t, the current stripmine element position *------------------------------------------------------------------------- */ -void +int h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, hid_t container, h5tools_context_t *ctx/*in,out*/, unsigned flags, hsize_t nelmts, hid_t type, void *_mem) { + HERR_INIT(int, SUCCEED) unsigned char *mem = (unsigned char*) _mem; hsize_t i; /*element counter */ size_t size; /*size of each datum */ @@ -357,8 +358,10 @@ h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, hid_t contai HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Dclose failed"); } /* if (region_id >= 0) */ - else - HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Rdereference failed"); + else { + /* if (region_id < 0) - could mean that no reference was written do not throw failure */ + H5Epush2(H5tools_ERR_STACK_g, __FILE__, FUNC, __LINE__, H5tools_ERR_CLS_g, H5E_tools_g, H5E_tools_min_id_g, "H5Rdereference failed"); + } ctx->need_prefix = TRUE; @@ -386,6 +389,9 @@ h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, hid_t contai h5tools_str_close(&buffer); }/* else bin */ + +CATCH + return ret_value; } /*------------------------------------------------------------------------- @@ -1226,7 +1232,8 @@ h5tools_print_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_c ctx->need_prefix = TRUE; - h5tools_dump_simple_data(stream, info, dset, ctx, flags, sm_nelmts, p_type, sm_buf); + if(h5tools_dump_simple_data(stream, info, dset, ctx, flags, sm_nelmts, p_type, sm_buf) < 0) + HERROR(H5E_tools_g, H5E_tools_min_id_g, "h5tools_dump_simple_data failed"); /* Reclaim any VL memory, if necessary */ if (vl_data) @@ -1484,7 +1491,8 @@ static int h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, hid_t dset, hid_t p_type) { - hid_t f_space; /* file data space */ + HERR_INIT(herr_t, SUCCEED) + hid_t f_space = -1; /* file data space */ hsize_t elmtno; /* counter */ size_t i; /* counter */ int carry; /* counter carry value */ @@ -1501,7 +1509,7 @@ h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, h5tools_cont hsize_t sm_nbytes; /* bytes per stripmine */ hsize_t sm_nelmts; /* elements per stripmine*/ unsigned char *sm_buf = NULL; /* buffer for raw data */ - hid_t sm_space; /* stripmine data space */ + hid_t sm_space = -1; /* stripmine data space */ /* Hyperslab info */ hsize_t hs_offset[H5S_MAX_RANK]; /* starting offset */ @@ -1514,13 +1522,12 @@ h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, h5tools_cont f_space = H5Dget_space(dset); if (f_space == FAIL) - return FAIL; + H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Dget_space failed"); ctx->ndims = H5Sget_simple_extent_ndims(f_space); if ((size_t)ctx->ndims > NELMTS(sm_size)) { - H5Sclose(f_space); - return FAIL; + H5E_THROW(FAIL, H5E_tools_min_id_g, "ctx->ndims > NELMTS(sm_size) failed"); } /* Assume entire data space to be printed */ @@ -1542,9 +1549,7 @@ h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, h5tools_cont ctx->size_last_dim = 0; if (p_nelmts == 0) { - /* nothing to print */ - H5Sclose(f_space); - return SUCCEED; + H5_LEAVE(SUCCEED); /* nothing to print */ } /* Check if we have VL data in the dataset's datatype */ @@ -1606,10 +1611,7 @@ h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, h5tools_cont /* Read the data */ if (H5Dread(dset, p_type, sm_space, f_space, H5P_DEFAULT, sm_buf) < 0) { - H5Sclose(f_space); - H5Sclose(sm_space); - HDfree(sm_buf); - return FAIL; + H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Dread failed"); } /* Print the data */ @@ -1620,7 +1622,8 @@ h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, h5tools_cont indices */ ctx->sm_pos = elmtno; - h5tools_dump_simple_data(stream, info, dset, ctx, flags, hs_nelmts, p_type, sm_buf); + if(h5tools_dump_simple_data(stream, info, dset, ctx, flags, hs_nelmts, p_type, sm_buf) < 0) + HERROR(H5E_tools_g, H5E_tools_min_id_g, "h5tools_dump_simple_data failed"); /* Reclaim any VL memory, if necessary */ if (vl_data) @@ -1640,13 +1643,17 @@ h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, h5tools_cont ctx->continuation++; } - HDfree(sm_buf); +CATCH + if(sm_buf) + HDfree(sm_buf); done: - H5Sclose(sm_space); - H5Sclose(f_space); + if(sm_space >= 0 && H5Sclose(sm_space) < 0) + H5E_THROW(H5E_tools_g, H5E_tools_min_id_g, "H5Sclose failed"); + if(f_space >= 0 && H5Sclose(f_space) < 0) + H5E_THROW(H5E_tools_g, H5E_tools_min_id_g, "H5Sclose failed"); - return SUCCEED; + return ret_value; } /*------------------------------------------------------------------------- @@ -1664,13 +1671,14 @@ static int h5tools_dump_simple_mem(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, hid_t obj_id, hid_t type, hid_t space, void *mem) { + HERR_INIT(herr_t, SUCCEED) int i; /*counters */ hsize_t nelmts; /*total selected elmts */ ctx->ndims = H5Sget_simple_extent_ndims(space); if ((size_t) ctx->ndims > NELMTS(ctx->p_min_idx)) - return FAIL; + H5E_THROW(FAIL, H5E_tools_min_id_g, "ctx->ndims > NELMTS(ctx->p_min_idx) failed"); /* Assume entire data space to be printed */ for (i = 0; i < ctx->ndims; i++) @@ -1682,7 +1690,7 @@ h5tools_dump_simple_mem(FILE *stream, const h5tool_format_t *info, h5tools_conte nelmts *= ctx->p_max_idx[i] - ctx->p_min_idx[i]; if (nelmts == 0) - return SUCCEED; /*nothing to print*/ + H5_LEAVE(SUCCEED); /* nothing to print */ if (ctx->ndims > 0) { HDassert(ctx->p_max_idx[ctx->ndims - 1] == (hsize_t) ((int) ctx->p_max_idx[ctx->ndims - 1])); ctx->size_last_dim = (int) (ctx->p_max_idx[ctx->ndims - 1]); @@ -1693,9 +1701,11 @@ h5tools_dump_simple_mem(FILE *stream, const h5tool_format_t *info, h5tools_conte if (ctx->ndims > 0) init_acc_pos(ctx, ctx->p_max_idx); - h5tools_dump_simple_data(stream, info, obj_id, ctx, START_OF_DATA | END_OF_DATA, nelmts, type, mem); + if(h5tools_dump_simple_data(stream, info, obj_id, ctx, START_OF_DATA | END_OF_DATA, nelmts, type, mem) < 0) + HERROR(H5E_tools_g, H5E_tools_min_id_g, "h5tools_dump_simple_data failed"); - return SUCCEED; +CATCH + return ret_value; } /*------------------------------------------------------------------------- diff --git a/tools/lib/h5tools_dump.h b/tools/lib/h5tools_dump.h index c94d0e1..55e046b 100644 --- a/tools/lib/h5tools_dump.h +++ b/tools/lib/h5tools_dump.h @@ -44,10 +44,10 @@ H5TOOLS_DLL int h5tools_dump_dset(FILE *stream, const h5tool_format_t *info, H5TOOLS_DLL int h5tools_dump_mem(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx/*in,out*/, hid_t obj_id, hid_t type, hid_t space, void *mem); -H5TOOLS_DLL void h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, hid_t container, +H5TOOLS_DLL int h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, hid_t container, h5tools_context_t *ctx/*in,out*/, unsigned flags, hsize_t nelmts, hid_t type, void *_mem); -H5TOOLS_DLL void h5tools_dump_datatype(FILE *stream, const h5tool_format_t *info, +H5TOOLS_DLL void h5tools_dump_datatype(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx/*in,out*/, hid_t type); H5TOOLS_DLL void h5tools_dump_dataspace(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx/*in,out*/, hid_t space); diff --git a/tools/lib/h5tools_error.h b/tools/lib/h5tools_error.h index 207218e..ae549fd 100644 --- a/tools/lib/h5tools_error.h +++ b/tools/lib/h5tools_error.h @@ -22,6 +22,7 @@ #include "H5Epublic.h" /* tools-HDF5 Error variables */ +H5TOOLS_DLLVAR hid_t H5tools_ERR_STACK_g; H5TOOLS_DLLVAR hid_t H5tools_ERR_CLS_g; H5TOOLS_DLLVAR hid_t H5E_tools_g; H5TOOLS_DLLVAR hid_t H5E_tools_min_id_g; @@ -66,7 +67,11 @@ H5TOOLS_DLLVAR hid_t H5E_tools_min_id_g; * HERROR macro, used to facilitate error reporting . The arguments are the major * error number, the minor error number, and a description of the error. */ -#define HERROR(maj_id, min_id, str) H5Epush2(H5E_DEFAULT, __FILE__, FUNC, __LINE__, H5tools_ERR_CLS_g, maj_id, min_id, str) +#define HERROR(maj_id, min_id, str) { \ + H5Epush2(H5tools_ERR_STACK_g, __FILE__, FUNC, __LINE__, H5tools_ERR_CLS_g, maj_id, min_id, str); \ + ret_value = FAIL; \ +} + /* Macro for "catching" flow of control when an error occurs. Note that the * H5_LEAVE macro won't jump back here once it's past this point. diff --git a/tools/testfiles/filter_fail.ddl b/tools/testfiles/filter_fail.ddl index 9cc2de5..75534e2 100644 --- a/tools/testfiles/filter_fail.ddl +++ b/tools/testfiles/filter_fail.ddl @@ -25,3 +25,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): major: Data filters minor: Read failed h5dump error: unable to print data +H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): + #000: (file name) line (number) in h5tools_dump_simple_dset(): H5Dread failed + major: Failure in tools library + minor: error in function -- cgit v0.12 From 0c323c00b731a283a4ad850052996d3f857bc4a2 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 12 Mar 2012 15:36:10 -0500 Subject: [svn-r22047] Add h5dump issues fixed --- release_docs/RELEASE.txt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index bc830ed..934cae1 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -241,6 +241,9 @@ New Features Tools: ------ + - h5dump: Added ability to apply command options across multiple files using a + wildcard in the filename. Example; "h5dump -H -d Dataset1 tarr*.h5". + HDFFV-7876 (ADB - 2012/03/12). - h5repack: Improved performance for big chunked datasets (size > 128MB) when used with layout (-l) or compression (-f) option. It would perform much better prior to the improvement, @@ -252,8 +255,7 @@ New Features interpret the '[' character as starting the compact form of subsetting. This is useful when the "h5dump error: unable to open dataset "datset_name"" message is output because a dataset - name contains a '[' character.(JIRA HDFFV-7689). - (ADB - 2012/01/31) + name contains a '[' character. HDFFV-7689 (ADB - 2012/01/31) - h5dump: Corrected schema location: Date: Mon, 12 Mar 2012 16:21:00 -0500 Subject: [svn-r22049] Add working folder to test properties when not using runTest.cmake script --- tools/h5ls/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/h5ls/CMakeLists.txt b/tools/h5ls/CMakeLists.txt index a057594..599202f 100644 --- a/tools/h5ls/CMakeLists.txt +++ b/tools/h5ls/CMakeLists.txt @@ -137,6 +137,7 @@ IF (BUILD_TESTING) # If using memchecker add tests without using scripts IF (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST (NAME H5LS-${resultfile} COMMAND $ ${ARGN}) + SET_TESTS_PROPERTIES (H5LS-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") IF (${resultcode} STREQUAL "1") SET_TESTS_PROPERTIES (H5LS-${resultfile} PROPERTIES WILL_FAIL "true") ENDIF (${resultcode} STREQUAL "1") -- cgit v0.12 From fcf96afeb24119690187ac3907d23070f0ba99d1 Mon Sep 17 00:00:00 2001 From: Peter Cao Date: Mon, 12 Mar 2012 16:27:11 -0500 Subject: [svn-r22052] - h5dump: Added capability for "-a" option to show attributes containing "/" by using an escape character. For example, for a dataset "/dset" containing attribute "speed(m/h)", use "h5dump -a "/dset/speed(\/h)" to show the content of the attribute. See details at HDFFV-7523 --- release_docs/RELEASE.txt | 5 +++++ tools/h5dump/CMakeLists.txt | 2 +- tools/h5dump/h5dump_ddl.c | 17 ++++++++++----- tools/h5dump/testh5dump.sh.in | 2 +- tools/lib/h5tools_str.c | 49 ++++++++++++++++++++++++++++++++++++++++++ tools/lib/h5tools_str.h | 2 ++ tools/testfiles/tarray6.h5 | Bin 6400 -> 6400 bytes tools/testfiles/tattr-1.ddl | 2 +- tools/testfiles/tattr-2.ddl | 4 ++-- tools/testfiles/tattr-3.ddl | 6 +++--- tools/testfiles/tattr.h5 | Bin 3024 -> 3024 bytes tools/testfiles/tattr.h5.xml | 2 +- 12 files changed, 77 insertions(+), 14 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 934cae1..7cfb763 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -241,6 +241,11 @@ New Features Tools: ------ + - h5dump: Added capability for "-a" option to show attributes containing "/" + by using an escape character. For example, for a dataset "/dset" + containing attribute "speed(m/h)", use "h5dump -a "/dset/speed(\/h)" + to show the content of the attribute. See details at HDFFV-7523 + (PC -- 2012/03/12) - h5dump: Added ability to apply command options across multiple files using a wildcard in the filename. Example; "h5dump -H -d Dataset1 tarr*.h5". HDFFV-7876 (ADB - 2012/03/12). diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt index e16b319..70b1b56 100644 --- a/tools/h5dump/CMakeLists.txt +++ b/tools/h5dump/CMakeLists.txt @@ -937,7 +937,7 @@ IF (BUILD_TESTING) # test for displaying attributes ADD_H5_TEST (tattr-1 0 --enable-error-stack tattr.h5) # test for displaying the selected attributes of string type and scalar space - ADD_H5_TEST (tattr-2 0 --enable-error-stack -a /attr1 --attribute /attr4 --attribute=/attr5 tattr.h5) + ADD_H5_TEST (tattr-2 0 --enable-error-stack -a "/\/attr1" --attribute /attr4 --attribute=/attr5 tattr.h5) # test for header and error messages ADD_H5_MASK_TEST (tattr-3 1 --enable-error-stack --header -a /attr2 --attribute=/attr tattr.h5) # test for displaying attributes in shared datatype (also in group and dataset) diff --git a/tools/h5dump/h5dump_ddl.c b/tools/h5dump/h5dump_ddl.c index be56c9b..b8deaf9 100644 --- a/tools/h5dump/h5dump_ddl.c +++ b/tools/h5dump/h5dump_ddl.c @@ -1322,7 +1322,7 @@ handle_attributes(hid_t fid, const char *attr, void UNUSED * data, int UNUSED pe hid_t oid = -1; hid_t attr_id = -1; char *obj_name; - const char *attr_name; + char *attr_name; int j; h5tools_str_t buffer; /* string into which to render */ h5tools_context_t ctx; /* print context */ @@ -1337,7 +1337,7 @@ handle_attributes(hid_t fid, const char *attr, void UNUSED * data, int UNUSED pe /* find the last / */ while(j >= 0) { - if (attr[j] == '/') + if (attr[j] == '/' && (j==0 || (j>0 && attr[j-1]!='\\'))) break; j--; } @@ -1372,9 +1372,12 @@ handle_attributes(hid_t fid, const char *attr, void UNUSED * data, int UNUSED pe string_dataformat.do_escape = display_escape; outputformat = &string_dataformat; - attr_name = attr + j + 1; + //attr_name = attr + j + 1; + // need to replace escape characters + attr_name = h5tools_str_replace(attr + j + 1, "\\/", "/"); - /* Open the object with the attribute */ + + /* handle error case: cannot open the object with the attribute */ if((oid = H5Oopen(fid, obj_name, H5P_DEFAULT)) < 0) { /* setup */ HDmemset(&buffer, 0, sizeof(h5tools_str_t)); @@ -1415,7 +1418,7 @@ handle_attributes(hid_t fid, const char *attr, void UNUSED * data, int UNUSED pe attr_data_output = display_attr_data; h5dump_type_table = type_table; - h5tools_dump_attribute(rawoutstream, outputformat, &ctx, oid, attr, attr_id, display_ai, display_char); + h5tools_dump_attribute(rawoutstream, outputformat, &ctx, oid, attr_name, attr_id, display_ai, display_char); h5dump_type_table = NULL; if(attr_id < 0) { @@ -1428,6 +1431,7 @@ handle_attributes(hid_t fid, const char *attr, void UNUSED * data, int UNUSED pe } /* end if */ HDfree(obj_name); + HDfree(attr_name); dump_indent -= COL; return; @@ -1435,6 +1439,9 @@ error: h5tools_setstatus(EXIT_FAILURE); if(obj_name) HDfree(obj_name); + + if (attr_name) + HDfree(attr_name); H5E_BEGIN_TRY { H5Oclose(oid); diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in index 1141cf7..63c81ed 100644 --- a/tools/h5dump/testh5dump.sh.in +++ b/tools/h5dump/testh5dump.sh.in @@ -718,7 +718,7 @@ TOOLTEST3 tdset-2.ddl --enable-error-stack -H -d dset1 -d /dset2 --dataset=dset3 # test for displaying attributes TOOLTEST tattr-1.ddl --enable-error-stack tattr.h5 # test for displaying the selected attributes of string type and scalar space -TOOLTEST tattr-2.ddl --enable-error-stack -a /attr1 --attribute /attr4 --attribute=/attr5 tattr.h5 +TOOLTEST tattr-2.ddl --enable-error-stack -a "/\/attr1" --attribute /attr4 --attribute=/attr5 tattr.h5 # test for header and error messages TOOLTEST3 tattr-3.ddl --enable-error-stack --header -a /attr2 --attribute=/attr tattr.h5 # test for displaying at least 9 attributes on root from a BE machine diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index b0a3ed8..795107a 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -1363,3 +1363,52 @@ h5tools_str_is_zero(const void *_mem, size_t size) return TRUE; } + +/*------------------------------------------------------------------------- + * Function: h5tools_str_replace + * + * Purpose: replace all occurrences of substring. + * + * Return: char * + * + * Programmer: Peter Cao + * March 8, 2012 + * + * Notes: + * Applications need to call free() to free the memoery allocated for + * the return string + * + *------------------------------------------------------------------------- + */ +char * +h5tools_str_replace ( const char *string, const char *substr, const char *replacement ) +{ + char *tok = NULL; + char *newstr = NULL; + char *oldstr = NULL; + char *head = NULL; + + if ( substr == NULL || replacement == NULL ) + return strdup (string); + + newstr = strdup (string); + head = newstr; + while ( (tok = strstr ( head, substr ))){ + oldstr = newstr; + newstr = malloc ( strlen ( oldstr ) - strlen ( substr ) + strlen ( replacement ) + 1 ); + + if ( newstr == NULL ){ + free (oldstr); + return NULL; + } + memcpy ( newstr, oldstr, tok - oldstr ); + memcpy ( newstr + (tok - oldstr), replacement, strlen ( replacement ) ); + memcpy ( newstr + (tok - oldstr) + strlen( replacement ), tok + strlen ( substr ), strlen ( oldstr ) - strlen ( substr ) - ( tok - oldstr ) ); + memset ( newstr + strlen ( oldstr ) - strlen ( substr ) + strlen ( replacement ) , 0, 1 ); + /* move back head right after the last replacement */ + head = newstr + (tok - oldstr) + strlen( replacement ); + free (oldstr); + } + + return newstr; +} diff --git a/tools/lib/h5tools_str.h b/tools/lib/h5tools_str.h index 9527a56..38697c6 100644 --- a/tools/lib/h5tools_str.h +++ b/tools/lib/h5tools_str.h @@ -47,5 +47,7 @@ H5TOOLS_DLL void h5tools_str_sprint_region(h5tools_str_t *str, const h5tool_ H5TOOLS_DLL char *h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t container, hid_t type, void *vp, h5tools_context_t *ctx); +H5TOOLS_DLL char *h5tools_str_replace ( const char *string, const char *substr, + const char *replacement ); #endif /* H5TOOLS_STR_H__ */ diff --git a/tools/testfiles/tarray6.h5 b/tools/testfiles/tarray6.h5 index b4af19b..7eb078c 100644 Binary files a/tools/testfiles/tarray6.h5 and b/tools/testfiles/tarray6.h5 differ diff --git a/tools/testfiles/tattr-1.ddl b/tools/testfiles/tattr-1.ddl index d353577..b58731b 100644 --- a/tools/testfiles/tattr-1.ddl +++ b/tools/testfiles/tattr-1.ddl @@ -1,6 +1,6 @@ HDF5 "tattr.h5" { GROUP "/" { - ATTRIBUTE "attr1" { + ATTRIBUTE "/attr1" { DATATYPE H5T_STD_I8BE DATASPACE SIMPLE { ( 24 ) / ( 24 ) } DATA { diff --git a/tools/testfiles/tattr-2.ddl b/tools/testfiles/tattr-2.ddl index 79ba8c3..328b54f 100644 --- a/tools/testfiles/tattr-2.ddl +++ b/tools/testfiles/tattr-2.ddl @@ -7,14 +7,14 @@ ATTRIBUTE "/attr1" { (14): 111, 111, 116, 32, 103, 114, 111, 117, 112, 0 } } -ATTRIBUTE "/attr4" { +ATTRIBUTE "attr4" { DATATYPE H5T_STD_I32BE DATASPACE SCALAR DATA { (0): 100 } } -ATTRIBUTE "/attr5" { +ATTRIBUTE "attr5" { DATATYPE H5T_STRING { STRSIZE 17; STRPAD H5T_STR_NULLTERM; diff --git a/tools/testfiles/tattr-3.ddl b/tools/testfiles/tattr-3.ddl index c0dd123..a19f69a 100644 --- a/tools/testfiles/tattr-3.ddl +++ b/tools/testfiles/tattr-3.ddl @@ -1,9 +1,9 @@ HDF5 "tattr.h5" { -ATTRIBUTE "/attr2" { +ATTRIBUTE "attr2" { DATATYPE H5T_STD_I32BE DATASPACE SIMPLE { ( 10 ) / ( 10 ) } } -ATTRIBUTE "/attr" { +ATTRIBUTE "attr" { } } HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): @@ -13,4 +13,4 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #001: (file name) line (number) in H5O_attr_open_by_name(): can't locate attribute: 'attr' major: Attribute minor: Object not found -h5dump error: unable to open attribute "/attr" +h5dump error: unable to open attribute "attr" diff --git a/tools/testfiles/tattr.h5 b/tools/testfiles/tattr.h5 index fd14b58..d61def5 100644 Binary files a/tools/testfiles/tattr.h5 and b/tools/testfiles/tattr.h5 differ diff --git a/tools/testfiles/tattr.h5.xml b/tools/testfiles/tattr.h5.xml index 57fa276..fceea99 100644 --- a/tools/testfiles/tattr.h5.xml +++ b/tools/testfiles/tattr.h5.xml @@ -1,7 +1,7 @@ - + -- cgit v0.12 From f698c360f567e9094050b699dfa4721dc1852a68 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Mon, 12 Mar 2012 16:45:38 -0500 Subject: [svn-r22053] Description: Correct corner case for creating a contiguous dataset with a zero-sized dataspace, when the allocation time is set to early. Also clean up a few compiler warnings in the dataspace code. Tested on: Mac OSX/64 10.7.3 (amazon) w/debug & parallel --- src/H5Dcontig.c | 7 +- src/H5S.c | 9 +- test/th5s.c | 966 +++++++++++++++++++++++++++++--------------------------- 3 files changed, 506 insertions(+), 476 deletions(-) diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c index 674582d..bb10b77 100644 --- a/src/H5Dcontig.c +++ b/src/H5Dcontig.c @@ -494,8 +494,11 @@ H5D_contig_is_space_alloc(const H5O_storage_t *storage) /* Sanity checks */ HDassert(storage); - /* Set return value */ - ret_value = (hbool_t)H5F_addr_defined(storage->u.contig.addr); + /* Set return value, indicating space is allocated when size is zero */ + if(0 == storage->u.contig.size) + ret_value = TRUE; + else + ret_value = (hbool_t)H5F_addr_defined(storage->u.contig.addr); FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_contig_is_space_alloc() */ diff --git a/src/H5S.c b/src/H5S.c index 59f3085..5d99066 100644 --- a/src/H5S.c +++ b/src/H5S.c @@ -86,7 +86,7 @@ H5S_init_interface(void) /* Allow MPI buf-and-file-type optimizations? */ const char *s = HDgetenv ("HDF5_MPI_OPT_TYPES"); if (s && HDisdigit(*s)) - H5S_mpi_opt_types_g = (int)HDstrtol (s, NULL, 0); + H5S_mpi_opt_types_g = (hbool_t)HDstrtol (s, NULL, 0); } #endif /* H5_HAVE_PARALLEL */ @@ -186,6 +186,7 @@ H5S_create(H5S_class_t type) new_ds->extent.nelem = 0; break; + case H5S_NO_CLASS: default: HDassert("unknown dataspace (extent) type" && 0); break; @@ -512,6 +513,7 @@ H5S_extent_copy(H5S_extent_t *dst, const H5S_extent_t *src, hbool_t copy_max) dst->max = NULL; break; + case H5S_NO_CLASS: default: HDassert("unknown dataspace type" && 0); break; @@ -712,6 +714,7 @@ H5S_get_npoints_max(const H5S_t *ds) } break; + case H5S_NO_CLASS: default: assert("unknown dataspace class" && 0); HGOTO_ERROR(H5E_DATASPACE, H5E_UNSUPPORTED, 0, "internal error (unknown dataspace class)") @@ -796,6 +799,7 @@ H5S_get_simple_extent_ndims(const H5S_t *ds) ret_value = (int)ds->extent.rank; break; + case H5S_NO_CLASS: default: HDassert("unknown dataspace class" && 0); HGOTO_ERROR(H5E_DATASPACE, H5E_UNSUPPORTED, FAIL, "internal error (unknown dataspace class)") @@ -894,6 +898,7 @@ H5S_extent_get_dims(const H5S_extent_t *ext, hsize_t dims[], hsize_t max_dims[]) } /* end for */ break; + case H5S_NO_CLASS: default: HDassert("unknown dataspace class" && 0); HGOTO_ERROR(H5E_DATASPACE, H5E_UNSUPPORTED, FAIL, "internal error (unknown dataspace class)") @@ -1827,7 +1832,7 @@ H5S_set_extent(H5S_t *space, const hsize_t *size) /* Check for invalid dimension size modification */ if(space->extent.max && H5S_UNLIMITED != space->extent.max[u] && space->extent.max[u] < size[u]) - HGOTO_ERROR(H5E_DATASPACE, H5E_BADVALUE, FAIL, "dimension cannot exceed the existing maximal size") + HGOTO_ERROR(H5E_DATASPACE, H5E_BADVALUE, FAIL, "dimension cannot exceed the existing maximal size (new: %llu max: %llu)", (unsigned long long)size[u], (unsigned long long)space->extent.max[u]) /* Indicate that dimension size can be modified */ ret_value = TRUE; diff --git a/test/th5s.c b/test/th5s.c index c17d96e..87aa0f1 100644 --- a/test/th5s.c +++ b/test/th5s.c @@ -544,70 +544,13 @@ test_h5s_zero_dim(void) hssize_t nelem; /* Number of elements */ H5S_sel_type sel_type; /* Type of selection currently */ H5S_class_t stype; /* dataspace type */ + H5D_alloc_time_t alloc_time; /* Space allocation time */ herr_t ret; /* Generic return value */ unsigned int i, j, k; /* Output message about test being performed */ MESSAGE(5, ("Testing Dataspace with zero dimension size\n")); - /* Make sure we can create the space with the dimension size 0 (starting from v1.8.7). - * The dimension doesn't need to be unlimited. */ - sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL); - CHECK(sid1, FAIL, "H5Screate_simple"); - - ret = H5Sclose(sid1); - CHECK(ret, FAIL, "H5Sclose"); - - sid1 = H5Screate(H5S_SIMPLE); - CHECK(sid1, FAIL, "H5Screate"); - - /* SID1 has the 1st dimension size as zero. The maximal dimension will be - * the same as the dimension because of the NULL passed in. */ - ret = H5Sset_extent_simple(sid1,SPACE1_RANK,dims1,NULL); - CHECK(ret, FAIL, "H5Sset_extent_simple"); - - /* Check that the dataspace actually has 0 elements */ - nelem = H5Sget_simple_extent_npoints(sid1); - VERIFY(nelem, 0, "H5Sget_simple_extent_npoints"); - - /* Check that the dataspace was created with an "all" selection */ - sel_type = H5Sget_select_type(sid1); - VERIFY(sel_type, H5S_SEL_ALL, "H5Sget_select_type"); - - /* Check that the dataspace has 0 elements selected */ - nelem = H5Sget_select_npoints(sid1); - VERIFY(nelem, 0, "H5Sget_select_npoints"); - - /* Change to "none" selection */ - ret = H5Sselect_none(sid1); - CHECK(ret, FAIL, "H5Sselect_none"); - - /* Check that the dataspace has 0 elements selected */ - nelem = H5Sget_select_npoints(sid1); - VERIFY(nelem, 0, "H5Sget_select_npoints"); - - /* Try to select all dataspace */ - ret = H5Sselect_all(sid1); - CHECK(ret, FAIL, "H5Sselect_all"); - - /* Check that the dataspace has 0 elements selected */ - nelem = H5Sget_select_npoints(sid1); - VERIFY(nelem, 0, "H5Sget_select_npoints"); - - /* Create the dataspace for chunked dataset with the first dimension size as zero. - * The maximal dimensions are bigger than the dimensions for later expansion. */ - sid_chunk = H5Screate_simple(SPACE1_RANK, dims1, max_dims); - CHECK(sid_chunk, FAIL, "H5Screate_simple"); - - /*============================================ - * Make sure we can use 0-dimension to create - * contiguous, chunked, compact, and external - * datasets, and also attribute. - *============================================ - */ - fid1 = H5Fcreate(ZEROFILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - CHECK(fid1, FAIL, "H5Fcreate"); - /* Initialize the data */ for(i=0; i Date: Mon, 12 Mar 2012 16:53:24 -0500 Subject: [svn-r22054] Use HDmalloc/free. --- tools/lib/h5tools_str.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index 795107a..0de126d 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -1395,10 +1395,10 @@ h5tools_str_replace ( const char *string, const char *substr, const char *replac head = newstr; while ( (tok = strstr ( head, substr ))){ oldstr = newstr; - newstr = malloc ( strlen ( oldstr ) - strlen ( substr ) + strlen ( replacement ) + 1 ); + newstr = HDmalloc ( strlen ( oldstr ) - strlen ( substr ) + strlen ( replacement ) + 1 ); if ( newstr == NULL ){ - free (oldstr); + HDfree (oldstr); return NULL; } memcpy ( newstr, oldstr, tok - oldstr ); @@ -1407,7 +1407,7 @@ h5tools_str_replace ( const char *string, const char *substr, const char *replac memset ( newstr + strlen ( oldstr ) - strlen ( substr ) + strlen ( replacement ) , 0, 1 ); /* move back head right after the last replacement */ head = newstr + (tok - oldstr) + strlen( replacement ); - free (oldstr); + HDfree (oldstr); } return newstr; -- cgit v0.12 From c17a5d1278a43efc8b62c718f5897e4ec1ed82e9 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Mon, 12 Mar 2012 23:19:46 -0500 Subject: [svn-r22058] Description: Better fix for zero-sized dataset error (r22053). Tested on: Mac OSX/64 10.7.3 (amazon) w/debug & parallel --- src/H5Dcontig.c | 7 ++----- src/H5Dint.c | 17 +++++++++++------ src/H5Ocopy.c | 3 +-- src/H5Olayout.c | 10 ++++++++++ 4 files changed, 24 insertions(+), 13 deletions(-) diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c index bb10b77..674582d 100644 --- a/src/H5Dcontig.c +++ b/src/H5Dcontig.c @@ -494,11 +494,8 @@ H5D_contig_is_space_alloc(const H5O_storage_t *storage) /* Sanity checks */ HDassert(storage); - /* Set return value, indicating space is allocated when size is zero */ - if(0 == storage->u.contig.size) - ret_value = TRUE; - else - ret_value = (hbool_t)H5F_addr_defined(storage->u.contig.addr); + /* Set return value */ + ret_value = (hbool_t)H5F_addr_defined(storage->u.contig.addr); FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_contig_is_space_alloc() */ diff --git a/src/H5Dint.c b/src/H5Dint.c index f105e0a..9a80bfc 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -1596,15 +1596,20 @@ H5D_alloc_storage(H5D_t *dset/*in,out*/, hid_t dxpl_id, H5D_time_alloc_t time_al switch(layout->type) { case H5D_CONTIGUOUS: if(!(*dset->shared->layout.ops->is_space_alloc)(&dset->shared->layout.storage)) { - /* Reserve space in the file for the entire array */ - if(H5D_contig_alloc(f, dxpl_id, &layout->storage.u.contig/*out*/) < 0) - HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "unable to initialize contiguous storage") + /* Check if we have a zero-sized dataset */ + if(layout->storage.u.contig.size > 0) { + /* Reserve space in the file for the entire array */ + if(H5D_contig_alloc(f, dxpl_id, &layout->storage.u.contig/*out*/) < 0) + HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "unable to initialize contiguous storage") + + /* Indicate that we should initialize storage space */ + must_init_space = TRUE; + } /* end if */ + else + layout->storage.u.contig.addr = HADDR_UNDEF; /* Indicate that we set the storage addr */ addr_set = TRUE; - - /* Indicate that we should initialize storage space */ - must_init_space = TRUE; } /* end if */ break; diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c index 337287d..dd649ff 100644 --- a/src/H5Ocopy.c +++ b/src/H5Ocopy.c @@ -974,8 +974,7 @@ H5O_copy_header(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */, HGOTO_ERROR(H5E_SLIST, H5E_CANTCREATE, FAIL, "cannot make skip list") /* copy the object from the source file to the destination file */ - if(H5O_copy_header_real(oloc_src, oloc_dst, dxpl_id, &cpy_info, NULL, NULL) - < 0) + if(H5O_copy_header_real(oloc_src, oloc_dst, dxpl_id, &cpy_info, NULL, NULL) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object") done: diff --git a/src/H5Olayout.c b/src/H5Olayout.c index e4d6486..1b17bff 100644 --- a/src/H5Olayout.c +++ b/src/H5Olayout.c @@ -241,6 +241,8 @@ H5O_layout_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, mesg->ops = H5D_LOPS_CHUNK; break; + case H5D_LAYOUT_ERROR: + case H5D_NLAYOUTS: default: HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "Invalid layout class") } /* end switch */ @@ -342,6 +344,8 @@ H5O_layout_encode(H5F_t *f, hbool_t UNUSED disable_shared, uint8_t *p, const voi UINT32ENCODE(p, mesg->u.chunk.dim[u]); break; + case H5D_LAYOUT_ERROR: + case H5D_NLAYOUTS: default: HGOTO_ERROR(H5E_OHDR, H5E_CANTENCODE, FAIL, "Invalid layout class") } /* end switch */ @@ -556,6 +560,8 @@ H5O_layout_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg) HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to free raw data") break; + case H5D_LAYOUT_ERROR: + case H5D_NLAYOUTS: default: HGOTO_ERROR(H5E_OHDR, H5E_BADTYPE, FAIL, "not valid storage type") } /* end switch */ @@ -641,6 +647,8 @@ H5O_layout_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, } /* end if */ break; + case H5D_LAYOUT_ERROR: + case H5D_NLAYOUTS: default: HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "Invalid layout class") } /* end switch */ @@ -737,6 +745,8 @@ H5O_layout_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, "Data Size:", mesg->storage.u.compact.size); break; + case H5D_LAYOUT_ERROR: + case H5D_NLAYOUTS: default: HDfprintf(stream, "%*s%-*s %s (%u)\n", indent, "", fwidth, "Type:", "Unknown", (unsigned)mesg->type); -- cgit v0.12 From 46a289c79674eed28d768b88c2b342e1164353cf Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Tue, 13 Mar 2012 09:38:37 -0500 Subject: [svn-r22061] Description: Change to use versioned API call, to avoid problems when defaulting to older AI versions. Tested on: Mac OSX/64 10.7.3 (amazon) w/debug --- tools/lib/h5tools.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index ba9510e..5e173e8 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -156,7 +156,7 @@ h5tools_close(void) if (h5tools_init_g) { H5Eget_auto2(H5tools_ERR_STACK_g, &tools_func, &tools_edata); if(tools_func!=NULL) - H5Eprint(H5tools_ERR_STACK_g, rawerrorstream); + H5Eprint2(H5tools_ERR_STACK_g, rawerrorstream); if (rawdatastream && rawdatastream != stdout) { if (fclose(rawdatastream)) perror("closing rawdatastream"); -- cgit v0.12 From 63df2d99fdc8839613cc2e3525835a8703c5e2b2 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 13 Mar 2012 14:57:00 -0500 Subject: [svn-r22063] escape char in test needed multiple slashes to get through cmake parsing --- tools/h5dump/CMakeLists.txt | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt index 70b1b56..861ec01 100644 --- a/tools/h5dump/CMakeLists.txt +++ b/tools/h5dump/CMakeLists.txt @@ -127,6 +127,9 @@ IF (BUILD_TESTING) tlonglinks.ddl tloop-1.ddl tmulti.ddl + tmultifile.ddl + tqmarkfile.ddl + tstarfile.ddl tnamed_dtype_attr.ddl tnestcomp-1.ddl tnbit.ddl @@ -831,6 +834,12 @@ IF (BUILD_TESTING) tloop-1.out.err tmulti.out tmulti.out.err + tmultifile.out + tmultifile.out.err + tqmarkfile.out + tqmarkfile.out.err + tstarfile.out + tstarfile.out.err tnamed_dtype_attr.out tnamed_dtype_attr.out.err tnestcomp-1.out @@ -937,7 +946,7 @@ IF (BUILD_TESTING) # test for displaying attributes ADD_H5_TEST (tattr-1 0 --enable-error-stack tattr.h5) # test for displaying the selected attributes of string type and scalar space - ADD_H5_TEST (tattr-2 0 --enable-error-stack -a "/\/attr1" --attribute /attr4 --attribute=/attr5 tattr.h5) + ADD_H5_TEST (tattr-2 0 --enable-error-stack -a /\\\\/attr1 --attribute /attr4 --attribute=/attr5 tattr.h5) # test for header and error messages ADD_H5_MASK_TEST (tattr-3 1 --enable-error-stack --header -a /attr2 --attribute=/attr tattr.h5) # test for displaying attributes in shared datatype (also in group and dataset) @@ -1014,6 +1023,11 @@ IF (BUILD_TESTING) ADD_H5_TEST (tarray7 0 --enable-error-stack tarray7.h5) ADD_H5_TEST (tarray8 0 --enable-error-stack tarray8.h5) + # test for wildcards in filename (does not work with cmake) + #ADD_H5_MASK_TEST (tstarfile 0 --enable-error-stack -H -d Dataset1 tarr*.h5) + #ADD_H5_MASK_TEST (tqmarkfile 0 --enable-error-stack -H -d Dataset1 tarray?.h5) + #ADD_H5_TEST (tmultifile 0 --enable-error-stack -H -d Dataset1 tarray[2-7].h5) + # test for files with empty data ADD_H5_TEST (tempty 0 --enable-error-stack tempty.h5) -- cgit v0.12 From 67f67925b8d58710eade38b971766fe0a8fe2e04 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 14 Mar 2012 10:49:52 -0500 Subject: [svn-r22066] Comment out linux non-cmake only files --- tools/h5dump/CMakeLists.txt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt index 861ec01..a257fc0 100644 --- a/tools/h5dump/CMakeLists.txt +++ b/tools/h5dump/CMakeLists.txt @@ -127,9 +127,9 @@ IF (BUILD_TESTING) tlonglinks.ddl tloop-1.ddl tmulti.ddl - tmultifile.ddl - tqmarkfile.ddl - tstarfile.ddl +# tmultifile.ddl +# tqmarkfile.ddl +# tstarfile.ddl tnamed_dtype_attr.ddl tnestcomp-1.ddl tnbit.ddl @@ -834,12 +834,12 @@ IF (BUILD_TESTING) tloop-1.out.err tmulti.out tmulti.out.err - tmultifile.out - tmultifile.out.err - tqmarkfile.out - tqmarkfile.out.err - tstarfile.out - tstarfile.out.err +# tmultifile.out +# tmultifile.out.err +# tqmarkfile.out +# tqmarkfile.out.err +# tstarfile.out +# tstarfile.out.err tnamed_dtype_attr.out tnamed_dtype_attr.out.err tnestcomp-1.out -- cgit v0.12 From 9f35a8b04e58db92296d716449cd5f560c6c1a5d Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 14 Mar 2012 13:36:21 -0500 Subject: [svn-r22068] HDFFV-7876: wildcard filenames The test scripts for cmake, on windows, and the h5ls shell script do not work properly. Tested: h5committest --- MANIFEST | 3 ++ tools/h5dump/testh5dump.sh.in | 9 +++++ tools/h5ls/testh5ls.sh.in | 41 ++++++++++--------- tools/testfiles/tmultifile.ddl | 42 ++++++++++++++++++++ tools/testfiles/tqmarkfile.ddl | 83 +++++++++++++++++++++++++++++++++++++++ tools/testfiles/tstarfile.ddl | 89 ++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 249 insertions(+), 18 deletions(-) create mode 100644 tools/testfiles/tmultifile.ddl create mode 100644 tools/testfiles/tqmarkfile.ddl create mode 100644 tools/testfiles/tstarfile.ddl diff --git a/MANIFEST b/MANIFEST index c5ba0af..91c4ce5 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1408,6 +1408,9 @@ ./tools/testfiles/tmulti-o.h5 ./tools/testfiles/tmulti-r.h5 ./tools/testfiles/tmulti-s.h5 +./tools/testfiles/tmultifile.ddl +./tools/testfiles/tqmarkfile.ddl +./tools/testfiles/tstarfile.ddl ./tools/testfiles/tnbit.ddl ./tools/testfiles/tnestcomp-1.ddl ./tools/testfiles/tnestedcomp.h5 diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in index 63c81ed..ae28df6 100644 --- a/tools/h5dump/testh5dump.sh.in +++ b/tools/h5dump/testh5dump.sh.in @@ -50,6 +50,7 @@ if test -z "$srcdir"; then fi # source dirs SRC_TOOLS="$srcdir/../" + SRC_TOOLS_TESTFILES="$SRC_TOOLS/testfiles" # testfiles source dirs for tools SRC_H5LS_TESTFILES="$SRC_TOOLS_TESTFILES" @@ -244,6 +245,9 @@ $SRC_H5DUMP_TESTFILES/tlarge_objname.ddl $SRC_H5DUMP_TESTFILES/tlonglinks.ddl $SRC_H5DUMP_TESTFILES/tloop-1.ddl $SRC_H5DUMP_TESTFILES/tmulti.ddl +$SRC_H5DUMP_TESTFILES/tmultifile.ddl +$SRC_H5DUMP_TESTFILES/tqmarkfile.ddl +$SRC_H5DUMP_TESTFILES/tstarfile.ddl $SRC_H5DUMP_TESTFILES/tnamed_dtype_attr.ddl $SRC_H5DUMP_TESTFILES/tnestcomp-1.ddl $SRC_H5DUMP_TESTFILES/tnbit.ddl @@ -794,6 +798,11 @@ TOOLTEST tarray6.ddl --enable-error-stack tarray6.h5 TOOLTEST tarray7.ddl --enable-error-stack tarray7.h5 TOOLTEST tarray8.ddl --enable-error-stack tarray8.h5 +# test for wildcards in filename (does not work with cmake) +TOOLTEST3 tstarfile --enable-error-stack -H -d Dataset1 tarr*.h5 +TOOLTEST3 tqmarkfile --enable-error-stack -H -d Dataset1 tarray?.h5 +TOOLTEST tmultifile --enable-error-stack -H -d Dataset1 tarray[2-7].h5 + # test for files with empty data TOOLTEST tempty.ddl --enable-error-stack tempty.h5 diff --git a/tools/h5ls/testh5ls.sh.in b/tools/h5ls/testh5ls.sh.in index e2c204b..d36988b 100644 --- a/tools/h5ls/testh5ls.sh.in +++ b/tools/h5ls/testh5ls.sh.in @@ -25,13 +25,13 @@ H5LS_BIN=`pwd`/$H5LS # The path of the tool binary CMP='cmp -s' DIFF='diff -c' CP='cp' -NLINES=20 # Max. lines of output to display if test fails +NLINES=20 # Max. lines of output to display if test fails WORDS_BIGENDIAN="@WORDS_BIGENDIAN@" nerrors=0 verbose=yes -h5haveexitcode=yes # default is yes +h5haveexitcode=yes # default is yes # The build (current) directory might be different than the source directory. if test -z "$srcdir"; then srcdir=. @@ -210,7 +210,7 @@ TOOLTEST() { # any unexpected output from that stream too. TESTING $H5LS $@ ( - cd $TESTDIR + cd $TESTDIR $RUNSERIAL $H5LS_BIN "$@" ) >$actual 2>$actual_err @@ -222,37 +222,37 @@ TOOLTEST() { STDERR_FILTER $actual_err cat $actual_err >> $actual if [ $h5haveexitcode = 'yes' -a $exitcode -ne $retvalexpect ]; then - echo "*FAILED*" - nerrors="`expr $nerrors + 1`" - if [ yes = "$verbose" ]; then - echo "test returned with exit code $exitcode" - echo "test output: (up to $NLINES lines)" - head -$NLINES $actual - echo "***end of test output***" - echo "" - fi + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + if [ yes = "$verbose" ]; then + echo "test returned with exit code $exitcode" + echo "test output: (up to $NLINES lines)" + head -$NLINES $actual + echo "***end of test output***" + echo "" + fi elif [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. + # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect elif $CMP $expect $actual; then echo " PASSED" else echo "*FAILED*" - echo " Expected result differs from actual result" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + echo " Expected result differs from actual result" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err $actual_sav $actual_err_sav + rm -f $actual $actual_err $actual_sav $actual_err_sav fi } ############################################################################## ############################################################################## -### T H E T E S T S ### +### T H E T E S T S ### ############################################################################## ############################################################################## # prepare for test @@ -322,6 +322,11 @@ TOOLTEST tsoftlinks-nodangle-1.ls 1 -w80 --follow-symlinks --no-dangling-links t # when used file with no dangling links - expected exit code 0 TOOLTEST thlinks-nodangle-1.ls 0 -w80 --follow-symlinks --no-dangling-links thlink.h5 +# test for wildcards in filename (does not work with cmake) +# this h5ls test script does not pass the filename properly like the h5dump test script??? +#TOOLTEST tstarfile t*link.h5 +#TOOLTEST tqmarkfile t?link.h5 +#TOOLTEST tmultifile t[h,s]link.h5 # tests for hard links TOOLTEST thlink-1.ls 0 -w80 thlink.h5 diff --git a/tools/testfiles/tmultifile.ddl b/tools/testfiles/tmultifile.ddl new file mode 100644 index 0000000..cf94f2c --- /dev/null +++ b/tools/testfiles/tmultifile.ddl @@ -0,0 +1,42 @@ +HDF5 "tarray2.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [3][4][5] H5T_STD_I32LE } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} +HDF5 "tarray3.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [4] H5T_ARRAY { [6][3] H5T_STD_I32LE } } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} +HDF5 "tarray4.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [4] H5T_COMPOUND { + H5T_STD_I32LE "i"; + H5T_IEEE_F32LE "f"; + } } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} +HDF5 "tarray5.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [4] H5T_COMPOUND { + H5T_STD_I32LE "i"; + H5T_ARRAY { [4] H5T_IEEE_F32LE } "f"; + } } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} +HDF5 "tarray6.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [4] H5T_VLEN { H5T_STD_U32LE} } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} +HDF5 "tarray7.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [4] H5T_VLEN { H5T_ARRAY { [4] H5T_STD_U32LE }} } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} diff --git a/tools/testfiles/tqmarkfile.ddl b/tools/testfiles/tqmarkfile.ddl new file mode 100644 index 0000000..e7771cb --- /dev/null +++ b/tools/testfiles/tqmarkfile.ddl @@ -0,0 +1,83 @@ +HDF5 "tarray1.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [4] H5T_STD_I32LE } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} +HDF5 "tarray2.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [3][4][5] H5T_STD_I32LE } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} +HDF5 "tarray3.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [4] H5T_ARRAY { [6][3] H5T_STD_I32LE } } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} +HDF5 "tarray4.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [4] H5T_COMPOUND { + H5T_STD_I32LE "i"; + H5T_IEEE_F32LE "f"; + } } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} +HDF5 "tarray5.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [4] H5T_COMPOUND { + H5T_STD_I32LE "i"; + H5T_ARRAY { [4] H5T_IEEE_F32LE } "f"; + } } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} +HDF5 "tarray6.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [4] H5T_VLEN { H5T_STD_U32LE} } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} +HDF5 "tarray7.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [4] H5T_VLEN { H5T_ARRAY { [4] H5T_STD_U32LE }} } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} +HDF5 "tarray8.h5" { +} +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Dopen2(): not found + major: Dataset + minor: Object not found + #001: (file name) line (number) in H5G_loc_find(): can't find object + major: Symbol table + minor: Object not found + #002: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #003: (file name) line (number) in H5G_traverse_real(): traversal operator failed + major: Symbol table + minor: Callback failed + #004: (file name) line (number) in H5G_loc_find_cb(): object 'Dataset1' doesn't exist + major: Symbol table + minor: Object not found +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Lget_info(): unable to get link info + major: Symbol table + minor: Object not found + #001: (file name) line (number) in H5L_get_info(): name doesn't exist + major: Symbol table + minor: Object already exists + #002: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #003: (file name) line (number) in H5G_traverse_real(): traversal operator failed + major: Symbol table + minor: Callback failed + #004: (file name) line (number) in H5L_get_info_cb(): name doesn't exist + major: Symbol table + minor: Object not found +h5dump error: unable to get link info from "Dataset1" diff --git a/tools/testfiles/tstarfile.ddl b/tools/testfiles/tstarfile.ddl new file mode 100644 index 0000000..77b80e0 --- /dev/null +++ b/tools/testfiles/tstarfile.ddl @@ -0,0 +1,89 @@ +HDF5 "tarray1_big.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [1000] H5T_STD_I32LE } + DATASPACE SIMPLE { ( 2000 ) / ( 2000 ) } +} +} +HDF5 "tarray1.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [4] H5T_STD_I32LE } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} +HDF5 "tarray2.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [3][4][5] H5T_STD_I32LE } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} +HDF5 "tarray3.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [4] H5T_ARRAY { [6][3] H5T_STD_I32LE } } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} +HDF5 "tarray4.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [4] H5T_COMPOUND { + H5T_STD_I32LE "i"; + H5T_IEEE_F32LE "f"; + } } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} +HDF5 "tarray5.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [4] H5T_COMPOUND { + H5T_STD_I32LE "i"; + H5T_ARRAY { [4] H5T_IEEE_F32LE } "f"; + } } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} +HDF5 "tarray6.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [4] H5T_VLEN { H5T_STD_U32LE} } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} +HDF5 "tarray7.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [4] H5T_VLEN { H5T_ARRAY { [4] H5T_STD_U32LE }} } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} +HDF5 "tarray8.h5" { +} +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Dopen2(): not found + major: Dataset + minor: Object not found + #001: (file name) line (number) in H5G_loc_find(): can't find object + major: Symbol table + minor: Object not found + #002: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #003: (file name) line (number) in H5G_traverse_real(): traversal operator failed + major: Symbol table + minor: Callback failed + #004: (file name) line (number) in H5G_loc_find_cb(): object 'Dataset1' doesn't exist + major: Symbol table + minor: Object not found +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Lget_info(): unable to get link info + major: Symbol table + minor: Object not found + #001: (file name) line (number) in H5L_get_info(): name doesn't exist + major: Symbol table + minor: Object already exists + #002: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #003: (file name) line (number) in H5G_traverse_real(): traversal operator failed + major: Symbol table + minor: Callback failed + #004: (file name) line (number) in H5L_get_info_cb(): name doesn't exist + major: Symbol table + minor: Object not found +h5dump error: unable to get link info from "Dataset1" -- cgit v0.12 From d849a118c28f7bcb57798c1222b539adeb8dbe2b Mon Sep 17 00:00:00 2001 From: Neil Fortner Date: Thu, 15 Mar 2012 13:42:51 -0500 Subject: [svn-r22070] Purpose: Fix rare corruption bug Description: When using the new object header format and adding an attribute with a size near 64K, it was possible for file corruption to occur. This happened only if the first object header chunk was smaller than 256 bytes and then grew to larger than 64K after the attribute was added. Tested: ostrich, jam, koala (h5committest), durandal --- src/H5Oalloc.c | 23 ++++--- src/H5Odbg.c | 26 +++++--- test/tattr.c | 207 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 235 insertions(+), 21 deletions(-) diff --git a/src/H5Oalloc.c b/src/H5Oalloc.c index a21c2b8..dfc844d 100644 --- a/src/H5Oalloc.c +++ b/src/H5Oalloc.c @@ -559,26 +559,27 @@ H5O_alloc_extend_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno, /* Check for changing the chunk #0 data size enough to need adjusting the flags */ if(oh->version > H5O_VERSION_1 && chunkno == 0) { uint64_t chunk0_size; /* Size of chunk 0's data */ + size_t orig_prfx_size = (size_t)1 << (oh->flags & H5O_HDR_CHUNK0_SIZE); /* Original prefix size */ HDassert(oh->chunk[0].size >= (size_t)H5O_SIZEOF_HDR(oh)); chunk0_size = oh->chunk[0].size - (size_t)H5O_SIZEOF_HDR(oh); - /* Check for moving from a 1-byte to a 2-byte size encoding */ - if(chunk0_size <= 255 && (chunk0_size + delta) > 255) { - extra_prfx_size = 1; - new_size_flags = H5O_HDR_CHUNK0_2; + /* Check for moving to a 8-byte size encoding */ + if(orig_prfx_size < 8 && (chunk0_size + delta) > 4294967295) { + extra_prfx_size = 8 - orig_prfx_size; + new_size_flags = H5O_HDR_CHUNK0_8; adjust_size_flags = TRUE; } /* end if */ - /* Check for moving from a 2-byte to a 4-byte size encoding */ - else if(chunk0_size <= 65535 && (chunk0_size + delta) > 65535) { - extra_prfx_size = 2; + /* Check for moving to a 4-byte size encoding */ + else if(orig_prfx_size < 4 && (chunk0_size + delta) > 65535) { + extra_prfx_size = 4 - orig_prfx_size; new_size_flags = H5O_HDR_CHUNK0_4; adjust_size_flags = TRUE; } /* end if */ - /* Check for moving from a 4-byte to a 8-byte size encoding */ - else if(chunk0_size <= 4294967295 && (chunk0_size + delta) > 4294967295) { - extra_prfx_size = 4; - new_size_flags = H5O_HDR_CHUNK0_8; + /* Check for moving to a 2-byte size encoding */ + else if(orig_prfx_size < 2 && (chunk0_size + delta) > 255) { + extra_prfx_size = 2 - orig_prfx_size; + new_size_flags = H5O_HDR_CHUNK0_2; adjust_size_flags = TRUE; } /* end if */ } /* end if */ diff --git a/src/H5Odbg.c b/src/H5Odbg.c index bd30b90..ce8b870 100644 --- a/src/H5Odbg.c +++ b/src/H5Odbg.c @@ -106,7 +106,7 @@ H5O_assert(const H5O_t *oh) /* Initialize the tracking variables */ hdr_size = 0; - meta_space = H5O_SIZEOF_HDR(oh) + (H5O_SIZEOF_CHKHDR_OH(oh) * (oh->nchunks - 1)); + meta_space = (size_t)H5O_SIZEOF_HDR(oh) + (size_t)(H5O_SIZEOF_CHKHDR_OH(oh) * (oh->nchunks - 1)); mesg_space = 0; free_space = 0; @@ -140,7 +140,7 @@ H5O_assert(const H5O_t *oh) /* Check for correct chunk #0 size flags */ if(oh->version > H5O_VERSION_1) { - uint64_t chunk0_size = oh->chunk[0].size - H5O_SIZEOF_HDR(oh); + uint64_t chunk0_size = oh->chunk[0].size - (size_t)H5O_SIZEOF_HDR(oh); if(chunk0_size <= 255) HDassert((oh->flags & H5O_HDR_CHUNK0_SIZE) == H5O_HDR_CHUNK0_1); @@ -154,9 +154,15 @@ H5O_assert(const H5O_t *oh) /* Loop over all messages in object header */ for(u = 0, curr_msg = &oh->mesg[0]; u < oh->nmesgs; u++, curr_msg++) { + uint8_t *curr_hdr; /* Start of current message header */ + size_t curr_tot_size; /* Total size of current message (including header) */ + + curr_hdr = curr_msg->raw - H5O_SIZEOF_MSGHDR_OH(oh); + curr_tot_size = curr_msg->raw_size + (size_t)H5O_SIZEOF_MSGHDR_OH(oh); + /* Accumulate information, based on the type of message */ if(H5O_NULL_ID == curr_msg->type->id) - free_space += H5O_SIZEOF_MSGHDR_OH(oh) + curr_msg->raw_size; + free_space += curr_tot_size; else if(H5O_CONT_ID == curr_msg->type->id) { H5O_cont_t *cont = (H5O_cont_t *)curr_msg->native; hbool_t found_chunk = FALSE; /* Found a chunk that matches */ @@ -175,10 +181,10 @@ H5O_assert(const H5O_t *oh) } /* end for */ HDassert(found_chunk); - meta_space += H5O_SIZEOF_MSGHDR_OH(oh) + curr_msg->raw_size; + meta_space += curr_tot_size; } /* end if */ else { - meta_space += H5O_SIZEOF_MSGHDR_OH(oh); + meta_space += (size_t)H5O_SIZEOF_MSGHDR_OH(oh); mesg_space += curr_msg->raw_size; } /* end else */ @@ -190,17 +196,19 @@ H5O_assert(const H5O_t *oh) HDassert(oh->chunk[curr_msg->chunkno].gap == 0); /* Make certain that the message is completely in a chunk message area */ - HDassert(curr_msg->raw_size <= (oh->chunk[curr_msg->chunkno].size) - (H5O_SIZEOF_CHKSUM_OH(oh) + oh->chunk[curr_msg->chunkno].gap)); + HDassert(curr_tot_size <= (oh->chunk[curr_msg->chunkno].size) - (H5O_SIZEOF_CHKSUM_OH(oh) + oh->chunk[curr_msg->chunkno].gap)); if(curr_msg->chunkno == 0) - HDassert(curr_msg->raw >= oh->chunk[curr_msg->chunkno].image + (H5O_SIZEOF_HDR(oh) - H5O_SIZEOF_CHKSUM_OH(oh))); + HDassert(curr_hdr >= oh->chunk[curr_msg->chunkno].image + (H5O_SIZEOF_HDR(oh) - H5O_SIZEOF_CHKSUM_OH(oh))); else - HDassert(curr_msg->raw >= oh->chunk[curr_msg->chunkno].image + (H5O_SIZEOF_CHKHDR_OH(oh) - H5O_SIZEOF_CHKSUM_OH(oh))); + HDassert(curr_hdr >= oh->chunk[curr_msg->chunkno].image + (H5O_SIZEOF_CHKHDR_OH(oh) - H5O_SIZEOF_CHKSUM_OH(oh))); HDassert(curr_msg->raw + curr_msg->raw_size <= (oh->chunk[curr_msg->chunkno].image + oh->chunk[curr_msg->chunkno].size) - (H5O_SIZEOF_CHKSUM_OH(oh) + oh->chunk[curr_msg->chunkno].gap)); /* Make certain that no other messages overlap this message */ for(v = 0, tmp_msg = &oh->mesg[0]; v < oh->nmesgs; v++, tmp_msg++) { if(u != v) - HDassert(!(tmp_msg->raw >= curr_msg->raw && tmp_msg->raw < (curr_msg->raw + curr_msg->raw_size))); + HDassert(!((tmp_msg->raw - H5O_SIZEOF_MSGHDR_OH(oh)) >= curr_hdr + && (tmp_msg->raw - H5O_SIZEOF_MSGHDR_OH(oh)) + < (curr_hdr + curr_tot_size))); } /* end for */ } /* end for */ diff --git a/test/tattr.c b/test/tattr.c index 60d4ddb..82873b5 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -10216,7 +10216,208 @@ test_attr_bug6(hid_t fcpl, hid_t fapl) ret = H5Sclose(sid); CHECK(ret, FAIL, "H5Sclose"); -} +} /* test_attr_bug6() */ + +/**************************************************************** +** +** test_attr_bug7(): Test basic H5A (attribute) code. +** (Really tests object header allocation code). +** Tests creating and deleting attributes in such a way as +** to change the size of the "chunk #0 size" field. +** Includes testing "skipping" a possible size of the +** field, i.e. going from 1 to 4 bytes or 4 to 1 byte. +** +****************************************************************/ +static void +test_attr_bug7(hid_t fcpl, hid_t fapl) +{ + hid_t fid; /* File ID */ + hid_t aid; /* Attribute ID */ + hid_t sid; /* Dataspace ID */ + hid_t tid; /* Datatype ID */ + hsize_t dims_s = 140; /* Small attribute dimensions */ + hsize_t dims_l = 65480; /* Large attribute dimensions */ + H5A_info_t ainfo; /* Attribute info */ + herr_t ret; /* Generic return status */ + + /* Output message about test being performed */ + MESSAGE(5, ("Testing adding and deleting large attributes\n")); + + + /* Create committed datatype to operate on. Use a committed datatype so that + * there is nothing after the object header and the first chunk can expand and + * contract as necessary. */ + fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl); + CHECK(fid, FAIL, "H5Fcreate"); + tid = H5Tcopy(H5T_STD_I32LE); + CHECK(tid, FAIL, "H5Tcopy"); + ret = H5Tcommit2(fid, TYPE1_NAME, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Tcommit2"); + + /* + * Create small attribute + */ + sid = H5Screate_simple(1, &dims_s, NULL); + CHECK(sid, FAIL, "H5Screate_simple"); + aid = H5Acreate2(tid, ATTR1_NAME, H5T_STD_I8LE, sid, H5P_DEFAULT, H5P_DEFAULT); + CHECK(aid, FAIL, "H5Acreate2"); + + /* Close file */ + ret = H5Aclose(aid); + CHECK(ret, FAIL, "H5Aclose"); + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + ret = H5Tclose(tid); + CHECK(ret, FAIL, "H5Tclose"); + + /* Open file */ + fid = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl); + CHECK(fid, FAIL, "H5Fopen"); + + /* Check attribute */ + tid = H5Topen2(fid, TYPE1_NAME, H5P_DEFAULT); + CHECK(tid, FAIL, "H5Topen2"); + ret = H5Aget_info_by_name(tid, ".", ATTR1_NAME, &ainfo, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Aget_info_by_name"); + if(ainfo.data_size != dims_s) + TestErrPrintf("attribute data size different: data_size=%llu, should be %llu\n", (long long unsigned)ainfo.data_size, (long long unsigned)dims_s); + + /* + * Create another small attribute. Should cause chunk size field to expand by + * 1 byte (1->2). + */ + aid = H5Acreate2(tid, ATTR2_NAME, H5T_STD_I8LE, sid, H5P_DEFAULT, H5P_DEFAULT); + CHECK(aid, FAIL, "H5Acreate2"); + + /* Close file */ + ret = H5Aclose(aid); + CHECK(ret, FAIL, "H5Aclose"); + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + ret = H5Tclose(tid); + CHECK(ret, FAIL, "H5Tclose"); + + /* Open file */ + fid = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl); + CHECK(fid, FAIL, "H5Fopen"); + + /* Check attributes */ + tid = H5Topen2(fid, TYPE1_NAME, H5P_DEFAULT); + CHECK(tid, FAIL, "H5Topen2"); + ret = H5Aget_info_by_name(tid, ".", ATTR1_NAME, &ainfo, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Aget_info_by_name"); + if(ainfo.data_size != dims_s) + TestErrPrintf("attribute data size different: data_size=%llu, should be %llu\n", (long long unsigned)ainfo.data_size, (long long unsigned)dims_s); + ret = H5Aget_info_by_name(tid, ".", ATTR2_NAME, &ainfo, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Aget_info_by_name"); + if(ainfo.data_size != dims_s) + TestErrPrintf("attribute data size different: data_size=%llu, should be %llu\n", (long long unsigned)ainfo.data_size, (long long unsigned)dims_s); + + /* + * Create large attribute. Should cause chunk size field to expand by 2 bytes + * (2->4). + */ + ret = H5Sset_extent_simple(sid, 1, &dims_l, NULL); + CHECK(ret, FAIL, "H5Sset_extent_simple"); + aid = H5Acreate2(tid, ATTR3_NAME, H5T_STD_I8LE, sid, H5P_DEFAULT, H5P_DEFAULT); + CHECK(aid, FAIL, "H5Acreate2"); + + /* Close file */ + ret = H5Aclose(aid); + CHECK(ret, FAIL, "H5Aclose"); + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + ret = H5Tclose(tid); + CHECK(ret, FAIL, "H5Tclose"); + + /* Open file */ + fid = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl); + CHECK(fid, FAIL, "H5Fopen"); + + /* Check attributes */ + tid = H5Topen2(fid, TYPE1_NAME, H5P_DEFAULT); + CHECK(tid, FAIL, "H5Topen2"); + ret = H5Aget_info_by_name(tid, ".", ATTR1_NAME, &ainfo, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Aget_info_by_name"); + if(ainfo.data_size != dims_s) + TestErrPrintf("attribute data size different: data_size=%llu, should be %llu\n", (long long unsigned)ainfo.data_size, (long long unsigned)dims_s); + ret = H5Aget_info_by_name(tid, ".", ATTR2_NAME, &ainfo, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Aget_info_by_name"); + if(ainfo.data_size != dims_s) + TestErrPrintf("attribute data size different: data_size=%llu, should be %llu\n", (long long unsigned)ainfo.data_size, (long long unsigned)dims_s); + ret = H5Aget_info_by_name(tid, ".", ATTR3_NAME, &ainfo, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Aget_info_by_name"); + if(ainfo.data_size != dims_l) + TestErrPrintf("attribute data size different: data_size=%llu, should be %llu\n", (long long unsigned)ainfo.data_size, (long long unsigned)dims_l); + + /* + * Delete last two attributes - should merge into a null message that is too + * large, causing the chunk size field to shrink by 3 bytes (4->1). + */ + ret = H5Sset_extent_simple(sid, 1, &dims_l, NULL); + CHECK(ret, FAIL, "H5Sset_extent_simple"); + ret = H5Adelete(tid, ATTR2_NAME); + CHECK(ret, FAIL, "H5Adelete"); + ret = H5Adelete(tid, ATTR3_NAME); + CHECK(ret, FAIL, "H5Adelete"); + + /* Close file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + ret = H5Tclose(tid); + CHECK(ret, FAIL, "H5Tclose"); + + /* Open file */ + fid = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl); + CHECK(fid, FAIL, "H5Fopen"); + + /* Check attribute */ + tid = H5Topen2(fid, TYPE1_NAME, H5P_DEFAULT); + CHECK(tid, FAIL, "H5Topen2"); + ret = H5Aget_info_by_name(tid, ".", ATTR1_NAME, &ainfo, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Aget_info_by_name"); + if(ainfo.data_size != dims_s) + TestErrPrintf("attribute data size different: data_size=%llu, should be %llu\n", (long long unsigned)ainfo.data_size, (long long unsigned)dims_s); + + /* + * Create large attribute. Should cause chunk size field to expand by 3 bytes + * (1->4). + */ + aid = H5Acreate2(tid, ATTR2_NAME, H5T_STD_I8LE, sid, H5P_DEFAULT, H5P_DEFAULT); + CHECK(aid, FAIL, "H5Acreate2"); + + /* Close file */ + ret = H5Aclose(aid); + CHECK(ret, FAIL, "H5Aclose"); + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + ret = H5Tclose(tid); + CHECK(ret, FAIL, "H5Tclose"); + + /* Open file */ + fid = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl); + CHECK(fid, FAIL, "H5Fopen"); + + /* Check attributes */ + tid = H5Topen2(fid, TYPE1_NAME, H5P_DEFAULT); + CHECK(tid, FAIL, "H5Topen2"); + ret = H5Aget_info_by_name(tid, ".", ATTR1_NAME, &ainfo, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Aget_info_by_name"); + if(ainfo.data_size != dims_s) + TestErrPrintf("attribute data size different: data_size=%llu, should be %llu\n", (long long unsigned)ainfo.data_size, (long long unsigned)dims_s); + ret = H5Aget_info_by_name(tid, ".", ATTR2_NAME, &ainfo, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Aget_info_by_name"); + if(ainfo.data_size != dims_l) + TestErrPrintf("attribute data size different: data_size=%llu, should be %llu\n", (long long unsigned)ainfo.data_size, (long long unsigned)dims_l); + + /* Close IDs */ + ret = H5Tclose(tid); + CHECK(ret, FAIL, "H5Tclose"); + ret = H5Sclose(sid); + CHECK(ret, FAIL, "H5Sclose"); + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); +} /* test_attr_bug7() */ /**************************************************************** ** @@ -10364,6 +10565,7 @@ test_attr(void) test_attr_bug4(my_fcpl, my_fapl); /* Test attributes on named datatypes */ test_attr_bug5(my_fcpl, my_fapl); /* Test opening/closing attributes through different file handles */ test_attr_bug6(my_fcpl, my_fapl); /* Test reading empty attribute */ + test_attr_bug7(my_fcpl, my_fapl); /* Test creating and deleting large attributes in ohdr chunk 0 */ } /* end for */ } /* end if */ else { @@ -10388,6 +10590,9 @@ test_attr(void) test_attr_bug4(fcpl, my_fapl); /* Test attributes on named datatypes */ test_attr_bug5(fcpl, my_fapl); /* Test opening/closing attributes through different file handles */ test_attr_bug6(fcpl, my_fapl); /* Test reading empty attribute */ + /* Skip test_attr_bug7 because it is specific to the new object + * header format and in fact fails if used with the old format, due + * to the attributes being larger than 64K */ } /* end else */ } /* end for */ -- cgit v0.12 From 3ee8b91dee10390a31d60fb6578b7e874060a50e Mon Sep 17 00:00:00 2001 From: Neil Fortner Date: Thu, 15 Mar 2012 14:16:24 -0500 Subject: [svn-r22072] Purpose: Fix rare corruption bug (HDFFV-7879) Description: When using the new object header format, it was possible for corruption to occur if the first object header chunk changed size such that the lenght of the "chunk 0 size" field changed. This only occurred if there were messages that had not been decoded. The original algorithm that changed the object header chunk size marked all messages as dirty, causing those that had not been decoded to have both the raw and native form invalidated. Changed the algorithm to avoid marking messages dirty and added assertions to catch the case where messages are dirtied without being decoded (or recently created) first. Tested: jam, koala, ostrich (h5committest), durandal --- release_docs/RELEASE.txt | 2 + src/H5Oalloc.c | 23 ++++---- src/H5Odbg.c | 5 ++ src/H5Omessage.c | 5 +- test/tattr.c | 135 +++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 158 insertions(+), 12 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 7cfb763..8055516 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -365,6 +365,8 @@ Bug Fixes since HDF5-1.8.0 release Library ------- + - Fixed rare corruption bugs that could occur when using the new object + header format. (NAF - 2012/3/15 - HDFFV-7879) - Creating a dataset in a read-only file caused seg fault when the file is closed. It's fixed. The error stack is returned correctly now. (SLU - 2012/1/25. Issue 7756) diff --git a/src/H5Oalloc.c b/src/H5Oalloc.c index dfc844d..05322af 100644 --- a/src/H5Oalloc.c +++ b/src/H5Oalloc.c @@ -647,17 +647,18 @@ H5O_alloc_extend_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno, /* Wipe new space for chunk */ HDmemset(oh->chunk[chunkno].image + old_size, 0, oh->chunk[chunkno].size - old_size); + /* Move chunk 0 data up if the size flags changed */ + if(adjust_size_flags) + HDmemmove(oh->chunk[0].image + H5O_SIZEOF_HDR(oh) - H5O_SIZEOF_CHKSUM_OH(oh), + oh->chunk[0].image + H5O_SIZEOF_HDR(oh) - H5O_SIZEOF_CHKSUM_OH(oh) - extra_prfx_size, + old_size - (size_t)H5O_SIZEOF_HDR(oh) + extra_prfx_size); + /* Spin through existing messages, adjusting them */ for(u = 0; u < oh->nmesgs; u++) { /* Adjust raw addresses for messages in this chunk to reflect new 'image' address */ - if(oh->mesg[u].chunkno == chunkno) { + if(oh->mesg[u].chunkno == chunkno) oh->mesg[u].raw = oh->chunk[chunkno].image + extra_prfx_size + (oh->mesg[u].raw - old_image); - /* Flag message as dirty directly */ - /* (we mark the entire chunk dirty when we update its size) */ - oh->mesg[u].dirty = TRUE; - } /* endif */ - /* Find continuation message which points to this chunk and adjust chunk's size */ /* (Chunk 0 doesn't have a continuation message that points to it and * it's size is directly encoded in the object header) */ @@ -1331,8 +1332,9 @@ H5O_move_cont(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned cont_u) move_end = cont_msg->raw + cont_msg->raw_size; cont_chunkno = cont_msg->chunkno; - /* Convert continuation message into a null message */ - if(H5O_release_mesg(f, dxpl_id, oh, cont_msg, TRUE) < 0) + /* Convert continuation message into a null message. Do not delete + * the target chunk yet, so we can still copy messages from it. */ + if(H5O_release_mesg(f, dxpl_id, oh, cont_msg, FALSE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "unable to convert into null message") /* Protect chunk */ @@ -1354,7 +1356,6 @@ H5O_move_cont(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned cont_u) HDmemcpy(move_start, curr_msg->raw - H5O_SIZEOF_MSGHDR_OH(oh), move_size); curr_msg->raw = move_start + H5O_SIZEOF_MSGHDR_OH(oh); curr_msg->chunkno = cont_chunkno; - curr_msg->dirty = TRUE; chk_dirtied = TRUE; /* Adjust location to move messages to */ @@ -1362,6 +1363,10 @@ H5O_move_cont(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned cont_u) } /* end else */ } /* end if */ + /* Delete the target chunk */ + if(H5O_chunk_delete(f, dxpl_id, oh, deleted_chunkno) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "unable to remove chunk from cache") + HDassert(move_start <= (move_end + gap_size)); /* Check if there is space remaining in the continuation message */ diff --git a/src/H5Odbg.c b/src/H5Odbg.c index ce8b870..5c07b64 100644 --- a/src/H5Odbg.c +++ b/src/H5Odbg.c @@ -167,6 +167,8 @@ H5O_assert(const H5O_t *oh) H5O_cont_t *cont = (H5O_cont_t *)curr_msg->native; hbool_t found_chunk = FALSE; /* Found a chunk that matches */ + HDassert(cont); + /* Increment # of continuation messages found */ cont_msgs_found++; @@ -186,6 +188,9 @@ H5O_assert(const H5O_t *oh) else { meta_space += (size_t)H5O_SIZEOF_MSGHDR_OH(oh); mesg_space += curr_msg->raw_size; + + /* Make sure the message has a native form if it is marked dirty */ + HDassert(curr_msg->native || !curr_msg->dirty); } /* end else */ /* Make certain that the message is in a valid chunk */ diff --git a/src/H5Omessage.c b/src/H5Omessage.c index a3d02d1..f12c835 100644 --- a/src/H5Omessage.c +++ b/src/H5Omessage.c @@ -2161,9 +2161,8 @@ H5O_msg_flush(H5F_t *f, H5O_t *oh, H5O_mesg_t *mesg) /* Make certain that null messages aren't in chunks w/gaps */ if(H5O_NULL_ID == msg_id) HDassert(oh->chunk[mesg->chunkno].gap == 0); - - /* Unknown messages should always have a native pointer */ - if(mesg->type == H5O_MSG_UNKNOWN) + else + /* Non-null messages should always have a native pointer */ HDassert(mesg->native); #endif /* NDEBUG */ diff --git a/test/tattr.c b/test/tattr.c index 82873b5..1285f0e 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -128,6 +128,8 @@ float attr_data5=(float)-5.123; /* Test data for 5th attribute */ #define ATTR7_NAME "attr 1 - 000000" #define ATTR8_NAME "attr 2" +#define LINK1_NAME "Link1" + #define NATTR_MANY_OLD 350 #define NATTR_MANY_NEW 35000 @@ -10421,6 +10423,137 @@ test_attr_bug7(hid_t fcpl, hid_t fapl) /**************************************************************** ** +** test_attr_bug8(): Test basic H5A (attribute) code. +** (Really tests object header code). +** Tests adding a link and attribute to a group in such a +** way as to cause the "chunk #0 size" field to expand +** when some object header messages are not loaded into +** cache. Before the bug was fixed, this would prevent +** these messages from being shifted to the correct +** position as the expansion algorithm marked them dirty, +** invalidating the raw form, when there was no native +** form to encode. +** +****************************************************************/ +static void +test_attr_bug8(hid_t fcpl, hid_t fapl) +{ + hid_t fid; /* File ID */ + hid_t aid; /* Attribute ID */ + hid_t sid; /* Dataspace ID */ + hid_t gid; /* Group ID */ + hid_t oid; /* Object ID */ + hsize_t dims = 256; /* Attribute dimensions */ + H5O_info_t oinfo; /* Object info */ + H5A_info_t ainfo; /* Attribute info */ + haddr_t root_addr; /* Root group address */ + herr_t ret; /* Generic return status */ + + /* Output message about test being performed */ + MESSAGE(5, ("Testing attribute expanding object header with undecoded messages\n")); + + + /* Create committed datatype to operate on. Use a committed datatype so that + * there is nothing after the object header and the first chunk can expand and + * contract as necessary. */ + fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl); + CHECK(fid, FAIL, "H5Fcreate"); + gid = H5Gcreate2(fid, GROUP1_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(gid, FAIL, "H5Gcreate2"); + + /* Get root group address */ + ret = H5Oget_info(fid, &oinfo); + CHECK(ret, FAIL, "H5Oget_info"); + root_addr = oinfo.addr; + + /* + * Create link to root group + */ + ret = H5Lcreate_hard(fid, "/", gid, LINK1_NAME, H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Lcreate_hard"); + + /* Close file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + ret = H5Gclose(gid); + CHECK(ret, FAIL, "H5Gclose"); + + /* Open file */ + fid = H5Fopen(FILENAME, H5F_ACC_RDONLY, fapl); + CHECK(fid, FAIL, "H5Fopen"); + + /* Check link */ + gid = H5Gopen2(fid, GROUP1_NAME, H5P_DEFAULT); + CHECK(gid, FAIL, "H5Gopen2"); + oid = H5Oopen(gid, LINK1_NAME, H5P_DEFAULT); + CHECK(oid, FAIL, "H5Oopen"); + ret = H5Oget_info(oid, &oinfo); + CHECK(ret, FAIL, "H5Oget_info"); + if(oinfo.addr != root_addr) + TestErrPrintf("incorrect link target address: addr: %llu, expected: %llu\n", (long long unsigned)oinfo.addr, (long long unsigned)root_addr); + + /* Close file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + ret = H5Gclose(gid); + CHECK(ret, FAIL, "H5Gclose"); + ret = H5Oclose(oid); + CHECK(ret, FAIL, "H5Oclose"); + + /* Open file */ + fid = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl); + CHECK(fid, FAIL, "H5Fopen"); + + /* + * Create attribute. Should cause chunk size field to expand by 1 byte + * (1->2). + */ + gid = H5Gopen2(fid, GROUP1_NAME, H5P_DEFAULT); + CHECK(gid, FAIL, "H5Gopen2"); + sid = H5Screate_simple(1, &dims, NULL); + CHECK(sid, FAIL, "H5Screate_simple"); + aid = H5Acreate2(gid, ATTR1_NAME, H5T_STD_I8LE, sid, H5P_DEFAULT, H5P_DEFAULT); + CHECK(aid, FAIL, "H5Acreate2"); + + /* Close file */ + ret = H5Aclose(aid); + CHECK(ret, FAIL, "H5Aclose"); + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + ret = H5Gclose(gid); + CHECK(ret, FAIL, "H5Gclose"); + + /* Open file */ + fid = H5Fopen(FILENAME, H5F_ACC_RDONLY, fapl); + CHECK(fid, FAIL, "H5Fopen"); + + /* Check link and attribute */ + gid = H5Gopen2(fid, GROUP1_NAME, H5P_DEFAULT); + CHECK(gid, FAIL, "H5Gopen2"); + oid = H5Oopen(gid, LINK1_NAME, H5P_DEFAULT); + CHECK(oid, FAIL, "H5Oopen"); + ret = H5Oget_info(oid, &oinfo); + CHECK(ret, FAIL, "H5Oget_info"); + if(oinfo.addr != root_addr) + TestErrPrintf("incorrect link target address: addr: %llu, expected: %llu\n", (long long unsigned)oinfo.addr, (long long unsigned)root_addr); + ret = H5Aget_info_by_name(gid, ".", ATTR1_NAME, &ainfo, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Aget_info_by_name"); + if(ainfo.data_size != dims) + TestErrPrintf("attribute data size different: data_size=%llu, should be %llu\n", (long long unsigned)ainfo.data_size, (long long unsigned)dims); + + /* Close IDs */ + ret = H5Oclose(oid); + CHECK(ret, FAIL, "H5Oclose"); + ret = H5Gclose(gid); + CHECK(ret, FAIL, "H5Gclose"); + ret = H5Sclose(sid); + CHECK(ret, FAIL, "H5Sclose"); + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); +} /* test_attr_bug8() */ + +/**************************************************************** +** ** test_attr(): Main H5A (attribute) testing routine. ** ****************************************************************/ @@ -10566,6 +10699,7 @@ test_attr(void) test_attr_bug5(my_fcpl, my_fapl); /* Test opening/closing attributes through different file handles */ test_attr_bug6(my_fcpl, my_fapl); /* Test reading empty attribute */ test_attr_bug7(my_fcpl, my_fapl); /* Test creating and deleting large attributes in ohdr chunk 0 */ + test_attr_bug8(my_fcpl, my_fapl); /* Test attribute expanding object header with undecoded messages */ } /* end for */ } /* end if */ else { @@ -10593,6 +10727,7 @@ test_attr(void) /* Skip test_attr_bug7 because it is specific to the new object * header format and in fact fails if used with the old format, due * to the attributes being larger than 64K */ + test_attr_bug8(fcpl, my_fapl); /* Test attribute expanding object header with undecoded messages */ } /* end else */ } /* end for */ -- cgit v0.12 From 956fde680a35b1fbc19fa5ff1367fcf8eb54c194 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 15 Mar 2012 14:50:36 -0500 Subject: [svn-r22074] Remove , from list of file char substitutions. --- tools/h5ls/testh5ls.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/h5ls/testh5ls.sh.in b/tools/h5ls/testh5ls.sh.in index d36988b..e79be02 100644 --- a/tools/h5ls/testh5ls.sh.in +++ b/tools/h5ls/testh5ls.sh.in @@ -326,7 +326,7 @@ TOOLTEST thlinks-nodangle-1.ls 0 -w80 --follow-symlinks --no-dangling-links thli # this h5ls test script does not pass the filename properly like the h5dump test script??? #TOOLTEST tstarfile t*link.h5 #TOOLTEST tqmarkfile t?link.h5 -#TOOLTEST tmultifile t[h,s]link.h5 +#TOOLTEST tmultifile t[hs]link.h5 # tests for hard links TOOLTEST thlink-1.ls 0 -w80 thlink.h5 -- cgit v0.12 From 207c05e2e9f1c2844416c19fe5b74b2d71610fd1 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 15 Mar 2012 15:44:51 -0500 Subject: [svn-r22075] Add test for multiple files with h5ls and h5dump. Tested: local linux --- MANIFEST | 1 + tools/h5dump/CMakeLists.txt | 8 ++++---- tools/h5dump/testh5dump.sh.in | 2 +- tools/h5ls/CMakeLists.txt | 6 ++++++ tools/h5ls/testh5ls.sh.in | 7 ++++--- tools/testfiles/tmultifile.ls | 6 ++++++ 6 files changed, 22 insertions(+), 8 deletions(-) create mode 100644 tools/testfiles/tmultifile.ls diff --git a/MANIFEST b/MANIFEST index 91c4ce5..f30ea30 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1408,6 +1408,7 @@ ./tools/testfiles/tmulti-o.h5 ./tools/testfiles/tmulti-r.h5 ./tools/testfiles/tmulti-s.h5 +./tools/testfiles/tmultifile.ls ./tools/testfiles/tmultifile.ddl ./tools/testfiles/tqmarkfile.ddl ./tools/testfiles/tstarfile.ddl diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt index a257fc0..a6e452d 100644 --- a/tools/h5dump/CMakeLists.txt +++ b/tools/h5dump/CMakeLists.txt @@ -127,7 +127,7 @@ IF (BUILD_TESTING) tlonglinks.ddl tloop-1.ddl tmulti.ddl -# tmultifile.ddl + tmultifile.ddl # tqmarkfile.ddl # tstarfile.ddl tnamed_dtype_attr.ddl @@ -834,8 +834,8 @@ IF (BUILD_TESTING) tloop-1.out.err tmulti.out tmulti.out.err -# tmultifile.out -# tmultifile.out.err + tmultifile.out + tmultifile.out.err # tqmarkfile.out # tqmarkfile.out.err # tstarfile.out @@ -1026,7 +1026,7 @@ IF (BUILD_TESTING) # test for wildcards in filename (does not work with cmake) #ADD_H5_MASK_TEST (tstarfile 0 --enable-error-stack -H -d Dataset1 tarr*.h5) #ADD_H5_MASK_TEST (tqmarkfile 0 --enable-error-stack -H -d Dataset1 tarray?.h5) - #ADD_H5_TEST (tmultifile 0 --enable-error-stack -H -d Dataset1 tarray[2-7].h5) + ADD_H5_TEST (tmultifile 0 --enable-error-stack -H -d Dataset1 tarray2.h5 tarray3.h5 tarray4.h5 tarray5.h5 tarray6.h5 tarray7.h5) # test for files with empty data ADD_H5_TEST (tempty 0 --enable-error-stack tempty.h5) diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in index ae28df6..68052a6 100644 --- a/tools/h5dump/testh5dump.sh.in +++ b/tools/h5dump/testh5dump.sh.in @@ -801,7 +801,7 @@ TOOLTEST tarray8.ddl --enable-error-stack tarray8.h5 # test for wildcards in filename (does not work with cmake) TOOLTEST3 tstarfile --enable-error-stack -H -d Dataset1 tarr*.h5 TOOLTEST3 tqmarkfile --enable-error-stack -H -d Dataset1 tarray?.h5 -TOOLTEST tmultifile --enable-error-stack -H -d Dataset1 tarray[2-7].h5 +TOOLTEST tmultifile --enable-error-stack -H -d Dataset1 tarray2.h5 tarray3.h5 tarray4.h5 tarray5.h5 tarray6.h5 tarray7.h5 # test for files with empty data TOOLTEST tempty.ddl --enable-error-stack tempty.h5 diff --git a/tools/h5ls/CMakeLists.txt b/tools/h5ls/CMakeLists.txt index 599202f..0dec21c 100644 --- a/tools/h5ls/CMakeLists.txt +++ b/tools/h5ls/CMakeLists.txt @@ -98,6 +98,7 @@ IF (BUILD_TESTING) ${HDF5_TOOLS_SRC_DIR}/testfiles/tgroup-3.ls ${HDF5_TOOLS_SRC_DIR}/testfiles/thlink-1.ls ${HDF5_TOOLS_SRC_DIR}/testfiles/tloop-1.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tmultifile.ls ${HDF5_TOOLS_SRC_DIR}/testfiles/tnestcomp-1.ls ${HDF5_TOOLS_SRC_DIR}/testfiles/tnestcomp-2.ls ${HDF5_TOOLS_SRC_DIR}/testfiles/tnestcomp-3.ls @@ -354,6 +355,11 @@ IF (BUILD_TESTING) # when used file with no dangling links - expected exit code 0 ADD_H5_TEST (thlinks-nodangle-1 0 -w80 --follow-symlinks --no-dangling-links thlink.h5) +# test for wildcards in filename (does not work with cmake) +# ADD_H5_TEST (tstarfile 0 -w80 t*link.h5) +# ADD_H5_TEST (tqmarkfile 0 -w80 t?link.h5) + ADD_H5_TEST (tmultifile 0 -w80 thlink.h5 tslink.h5) + # tests for hard links ADD_H5_TEST (thlink-1 0 -w80 thlink.h5) diff --git a/tools/h5ls/testh5ls.sh.in b/tools/h5ls/testh5ls.sh.in index e79be02..3f84ac5 100644 --- a/tools/h5ls/testh5ls.sh.in +++ b/tools/h5ls/testh5ls.sh.in @@ -131,6 +131,7 @@ $SRC_H5LS_TESTFILES/tgroup-2.ls $SRC_H5LS_TESTFILES/tgroup-3.ls $SRC_H5LS_TESTFILES/thlink-1.ls $SRC_H5LS_TESTFILES/tloop-1.ls +$SRC_H5LS_TESTFILES/tmultifile.ls $SRC_H5LS_TESTFILES/tnestcomp-1.ls $SRC_H5LS_TESTFILES/tnestcomp-2.ls $SRC_H5LS_TESTFILES/tnestcomp-3.ls @@ -324,9 +325,9 @@ TOOLTEST thlinks-nodangle-1.ls 0 -w80 --follow-symlinks --no-dangling-links thli # test for wildcards in filename (does not work with cmake) # this h5ls test script does not pass the filename properly like the h5dump test script??? -#TOOLTEST tstarfile t*link.h5 -#TOOLTEST tqmarkfile t?link.h5 -#TOOLTEST tmultifile t[hs]link.h5 +#TOOLTEST tstarfile 0 -w80 t*link.h5 +#TOOLTEST tqmarkfile 0 -w80 t?link.h5 +TOOLTEST tmultifile 0 -w80 thlink.h5 tslink.h5 # tests for hard links TOOLTEST thlink-1.ls 0 -w80 thlink.h5 diff --git a/tools/testfiles/tmultifile.ls b/tools/testfiles/tmultifile.ls new file mode 100644 index 0000000..3fee937 --- /dev/null +++ b/tools/testfiles/tmultifile.ls @@ -0,0 +1,6 @@ +dset1 Dataset {5} +g1 Group +g2 Group +g3 Group, same as / +slink1 Soft Link {somevalue} +slink2 Soft Link {linkvalue} -- cgit v0.12 From b337ae979dad938f1ef72df4f67b612a883040b1 Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Thu, 15 Mar 2012 15:53:14 -0500 Subject: [svn-r22076] #Issue 7922 - H5Pset_data_transform had seg fault with some operations like x*-100. The parser mistaked "-" as substraction. I fixed it and also fixed another problem with some special cases like 100-x and 2/x. Tested on jam, koala, and ostrich. --- release_docs/RELEASE.txt | 4 +- src/H5HF.c | 1 + src/H5Ztrans.c | 187 +++++++++++++++++++++++++++++++++++++++-------- test/dtransform.c | 180 ++++++++++++++++++++++++++++++++++++++++++++- 4 files changed, 338 insertions(+), 34 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 8055516..63ae2d7 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -364,7 +364,9 @@ Bug Fixes since HDF5-1.8.0 release Library ------- - + - H5Pset_data_transform had seg fault in some cases like x*-100. It + works correctly now and handles other cases like 100-x or 2/x. + (SLU - 2012/3/15. Issue 7922) - Fixed rare corruption bugs that could occur when using the new object header format. (NAF - 2012/3/15 - HDFFV-7879) - Creating a dataset in a read-only file caused seg fault when the file diff --git a/src/H5HF.c b/src/H5HF.c index 9c911fd..801fa8c 100644 --- a/src/H5HF.c +++ b/src/H5HF.c @@ -361,6 +361,7 @@ H5HF_insert(H5HF_t *fh, hid_t dxpl_id, size_t size, const void *obj, herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI(FAIL) + #ifdef QAK HDfprintf(stderr, "%s: size = %Zu\n", FUNC, size); #endif /* QAK */ diff --git a/src/H5Ztrans.c b/src/H5Ztrans.c index 5a707b5..2a2796d 100644 --- a/src/H5Ztrans.c +++ b/src/H5Ztrans.c @@ -94,6 +94,8 @@ static H5Z_node *H5Z_parse_term(H5Z_token *current, H5Z_datval_ptrs* dat_val_poi static H5Z_node *H5Z_parse_factor(H5Z_token *current, H5Z_datval_ptrs* dat_val_pointers); static H5Z_node *H5Z_new_node(H5Z_token_type type); static void H5Z_do_op(H5Z_node* tree); +static hbool_t H5Z_op_is_numbs(H5Z_node* _tree); +static hbool_t H5Z_op_is_numbs2(H5Z_node* _tree); static hid_t H5Z_xform_find_type(const H5T_t* type); static herr_t H5Z_xform_eval_full(H5Z_node *tree, const size_t array_size, const hid_t array_type, H5Z_result* res); static void H5Z_xform_destroy_parse_tree(H5Z_node *tree); @@ -105,41 +107,46 @@ static void H5Z_XFORM_DEBUG(H5Z_node *tree); static void H5Z_print(H5Z_node *tree, FILE *stream); #endif /* H5Z_XFORM_DEBUG */ - #define H5Z_XFORM_DO_OP1(RESL,RESR,TYPE,OP,SIZE) \ { \ - if( (((RESL).type == H5Z_XFORM_SYMBOL) && ((RESR).type != H5Z_XFORM_SYMBOL)) || (((RESR).type == H5Z_XFORM_SYMBOL) && ((RESL).type != H5Z_XFORM_SYMBOL))) \ + size_t u; \ + \ + if(((RESL).type == H5Z_XFORM_SYMBOL) && ((RESR).type != H5Z_XFORM_SYMBOL)) \ + { \ + TYPE* p; \ + double tree_val; \ + \ + tree_val = ((RESR).type==H5Z_XFORM_INTEGER ? (double)(RESR).value.int_val : (RESR).value.float_val); \ + p = (TYPE*)(RESL).value.dat_val; \ + \ + for(u=0; u<(SIZE); u++) \ + *p++ = *p OP tree_val; \ + } \ + else if(((RESR).type == H5Z_XFORM_SYMBOL) && ((RESL).type != H5Z_XFORM_SYMBOL)) \ { \ - size_t u; \ TYPE* p; \ double tree_val; \ \ - if((RESL).type == H5Z_XFORM_SYMBOL) \ - { \ - tree_val = ((RESR).type==H5Z_XFORM_INTEGER ? (double)(RESR).value.int_val : (RESR).value.float_val); \ - p = (TYPE*)(RESL).value.dat_val; \ - } \ + /* The case that the left operand is nothing, like -x or +x */ \ + if((RESL).type == H5Z_XFORM_ERROR) \ + tree_val = 0; \ else \ - { \ tree_val = ((RESL).type==H5Z_XFORM_INTEGER ? (double)(RESL).value.int_val : (RESL).value.float_val); \ - p = (TYPE*)(RESR).value.dat_val; \ - } \ - \ + \ + p = (TYPE*)(RESR).value.dat_val; \ for(u=0; u<(SIZE); u++) \ - *p++ OP tree_val; \ - } \ + *p++ = tree_val OP *p; \ + } \ else if( ((RESL).type == H5Z_XFORM_SYMBOL) && ((RESR).type==H5Z_XFORM_SYMBOL)) \ { \ - size_t u; \ TYPE* pl = (TYPE*)(RESL).value.dat_val; \ TYPE* pr = (TYPE*)(RESR).value.dat_val; \ \ for(u=0; u<(SIZE); u++) \ - *pl++ OP *pr++; \ + *pl++ = *pl OP *pr++; \ } \ else \ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Unexpected type conversion operation") \ - \ } /* Due to the undefined nature of embedding macros/conditionals within macros, we employ @@ -235,6 +242,7 @@ static void H5Z_print(H5Z_node *tree, FILE *stream); } #endif /*H5_SIZEOF_LONG_DOUBLE */ + #define H5Z_XFORM_DO_OP3(OP) \ { \ if((tree->lchild->type == H5Z_XFORM_INTEGER) && (tree->rchild->type==H5Z_XFORM_INTEGER)) \ @@ -259,6 +267,48 @@ static void H5Z_print(H5Z_node *tree, FILE *stream); } \ } +/* The difference of this macro from H5Z_XFORM_DO_OP3 is that it handles the operations when the left operand is empty, like -x or +x. + * The reason that it's seperated from H5Z_XFORM_DO_OP3 is because compilers don't accept operations like *x or /x. So in H5Z_do_op, + * these two macros are called in different ways. + */ +#define H5Z_XFORM_DO_OP6(OP) \ +{ \ + if(!tree->lchild && (tree->rchild->type==H5Z_XFORM_INTEGER)) \ + { \ + tree->type = H5Z_XFORM_INTEGER; \ + tree->value.int_val = OP tree->rchild->value.int_val; \ + H5MM_xfree(tree->rchild); \ + tree->rchild = NULL; \ + } \ + else if(!tree->lchild && (tree->rchild->type==H5Z_XFORM_FLOAT)) \ + { \ + tree->type = H5Z_XFORM_FLOAT; \ + tree->value.float_val = OP tree->rchild->value.float_val; \ + H5MM_xfree(tree->rchild); \ + tree->rchild = NULL; \ + } \ + else if((tree->lchild->type == H5Z_XFORM_INTEGER) && (tree->rchild->type==H5Z_XFORM_INTEGER)) \ + { \ + tree->type = H5Z_XFORM_INTEGER; \ + tree->value.int_val = tree->lchild->value.int_val OP tree->rchild->value.int_val; \ + H5MM_xfree(tree->lchild); \ + H5MM_xfree(tree->rchild); \ + tree->lchild = NULL; \ + tree->rchild = NULL; \ + } \ + else if( ( (tree->lchild->type == H5Z_XFORM_FLOAT) || (tree->lchild->type == H5Z_XFORM_INTEGER)) && \ + ( (tree->rchild->type == H5Z_XFORM_FLOAT) || (tree->rchild->type == H5Z_XFORM_INTEGER))) \ + { \ + tree->type = H5Z_XFORM_FLOAT; \ + tree->value.float_val = ((tree->lchild->type == H5Z_XFORM_FLOAT) ? tree->lchild->value.float_val : (double)tree->lchild->value.int_val) OP \ + ((tree->rchild->type == H5Z_XFORM_FLOAT) ? tree->rchild->value.float_val : (double)tree->rchild->value.int_val); \ + H5MM_xfree(tree->lchild); \ + H5MM_xfree(tree->rchild); \ + tree->lchild = NULL; \ + tree->rchild = NULL; \ + } \ +} + #define H5Z_XFORM_DO_OP4(TYPE) \ { \ if ((ret_value = (H5Z_node*) H5MM_malloc(sizeof(H5Z_node))) == NULL) \ @@ -1027,6 +1077,9 @@ H5Z_xform_eval_full(H5Z_node *tree, const size_t array_size, const hid_t array_ /* check args */ HDassert(tree); + HDmemset(&resl, 0, sizeof(H5Z_result)); + HDmemset(&resr, 0, sizeof(H5Z_result)); + if (tree->type == H5Z_XFORM_INTEGER) { res->type = H5Z_XFORM_INTEGER; res->value.int_val = tree->value.int_val; @@ -1044,7 +1097,7 @@ H5Z_xform_eval_full(H5Z_node *tree, const size_t array_size, const hid_t array_ res->value.dat_val = *((void**)(tree->value.dat_val)); } /* end if */ else { - if(H5Z_xform_eval_full(tree->lchild, array_size, array_type, &resl) < 0) + if(tree->lchild && H5Z_xform_eval_full(tree->lchild, array_size, array_type, &resl) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "error while performing data transform") if(H5Z_xform_eval_full(tree->rchild, array_size, array_type, &resr) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "error while performing data transform") @@ -1059,19 +1112,19 @@ H5Z_xform_eval_full(H5Z_node *tree, const size_t array_size, const hid_t array_ switch (tree->type) { case H5Z_XFORM_PLUS: - H5Z_XFORM_TYPE_OP(resl, resr, array_type, +=, array_size) + H5Z_XFORM_TYPE_OP(resl, resr, array_type, +, array_size) break; case H5Z_XFORM_MINUS: - H5Z_XFORM_TYPE_OP(resl, resr, array_type, -=, array_size) + H5Z_XFORM_TYPE_OP(resl, resr, array_type, -, array_size) break; case H5Z_XFORM_MULT: - H5Z_XFORM_TYPE_OP(resl, resr, array_type, *=, array_size) + H5Z_XFORM_TYPE_OP(resl, resr, array_type, *, array_size) break; case H5Z_XFORM_DIVIDE: - H5Z_XFORM_TYPE_OP(resl, resr, array_type, /=, array_size) + H5Z_XFORM_TYPE_OP(resl, resr, array_type, /, array_size) break; default: @@ -1274,22 +1327,37 @@ H5Z_xform_reduce_tree(H5Z_node* tree) FUNC_ENTER_NOAPI_NOINIT_NOERR if(tree) { - if((tree->type == H5Z_XFORM_PLUS) || (tree->type == H5Z_XFORM_DIVIDE) ||(tree->type == H5Z_XFORM_MULT) ||(tree->type == H5Z_XFORM_MINUS)) + if((tree->type == H5Z_XFORM_DIVIDE) || (tree->type == H5Z_XFORM_MULT)) { - if(((tree->lchild->type == H5Z_XFORM_INTEGER) || (tree->lchild->type == H5Z_XFORM_FLOAT)) && ((tree->rchild->type == H5Z_XFORM_INTEGER) || (tree->rchild->type == H5Z_XFORM_FLOAT))) + if(H5Z_op_is_numbs(tree)) H5Z_do_op(tree); else { H5Z_xform_reduce_tree(tree->lchild); - if(((tree->lchild->type == H5Z_XFORM_INTEGER) || (tree->lchild->type == H5Z_XFORM_FLOAT)) && ((tree->rchild->type == H5Z_XFORM_INTEGER) || (tree->rchild->type == H5Z_XFORM_FLOAT))) + if(H5Z_op_is_numbs(tree)) H5Z_do_op(tree); else { H5Z_xform_reduce_tree(tree->rchild); - if(((tree->lchild->type == H5Z_XFORM_INTEGER) || (tree->lchild->type == H5Z_XFORM_FLOAT)) && ((tree->rchild->type == H5Z_XFORM_INTEGER) || (tree->rchild->type == H5Z_XFORM_FLOAT))) + if(H5Z_op_is_numbs(tree)) + H5Z_do_op(tree); + } + } + } else if((tree->type == H5Z_XFORM_PLUS) || (tree->type == H5Z_XFORM_MINUS)) { + if(H5Z_op_is_numbs2(tree)) + H5Z_do_op(tree); + else + { + H5Z_xform_reduce_tree(tree->lchild); + if(H5Z_op_is_numbs2(tree)) + H5Z_do_op(tree); + else { + H5Z_xform_reduce_tree(tree->rchild); + if(H5Z_op_is_numbs2(tree)) H5Z_do_op(tree); } } } + } FUNC_LEAVE_NOAPI_VOID; @@ -1297,6 +1365,63 @@ H5Z_xform_reduce_tree(H5Z_node* tree) /*------------------------------------------------------------------------- + * Function: H5Z_op_is_numbs + * Purpose: Internal function to facilitate the condition check in + * H5Z_xform_reduce_tree to reduce the bulkiness of the code. + * Return: TRUE or FALSE + * Programmer: Raymond Lu + * 15 March 2012 + * Modifications: + * + *------------------------------------------------------------------------- + */ +static hbool_t +H5Z_op_is_numbs(H5Z_node* _tree) +{ + hbool_t ret_value = FALSE; + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + assert(_tree); + + if(((_tree->lchild->type == H5Z_XFORM_INTEGER) || (_tree->lchild->type == H5Z_XFORM_FLOAT)) && ((_tree->rchild->type == H5Z_XFORM_INTEGER) || (_tree->rchild->type == H5Z_XFORM_FLOAT))) + ret_value = TRUE; + + FUNC_LEAVE_NOAPI(ret_value) +} + + +/*------------------------------------------------------------------------- + * Function: H5Z_op_is_numbs2 + * Purpose: Internal function to facilitate the condition check in + * H5Z_xform_reduce_tree to reduce the bulkiness of the code. + * The difference from H5Z_op_is_numbs is that the left child + * can be empty, like -x or +x. + * Return: TRUE or FALSE + * Programmer: Raymond Lu + * 15 March 2012 + * Modifications: + * + *------------------------------------------------------------------------- + */ +static hbool_t +H5Z_op_is_numbs2(H5Z_node* _tree) +{ + hbool_t ret_value = FALSE; + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + assert(_tree); + + if((!_tree->lchild && ((_tree->rchild->type == H5Z_XFORM_INTEGER) || (_tree->rchild->type == H5Z_XFORM_FLOAT))) || + ((_tree->lchild && ((_tree->lchild->type == H5Z_XFORM_INTEGER) || (_tree->lchild->type == H5Z_XFORM_FLOAT))) && (_tree->rchild && ((_tree->rchild->type == H5Z_XFORM_INTEGER) || (_tree->rchild->type == H5Z_XFORM_FLOAT))))) + ret_value = TRUE; + + FUNC_LEAVE_NOAPI(ret_value) +} + + +/*------------------------------------------------------------------------- * Function: H5Z_do_op * Purpose: If the root of the tree passed in points to a simple * arithmetic operation and the left and right subtrees are both @@ -1307,7 +1432,11 @@ H5Z_xform_reduce_tree(H5Z_node* tree) * Programmer: Leon Arber * April 1, 2004. * Modifications: -* + * Raymond Lu + * 15 March 2012 + * I added a new macro H5Z_XFORM_DO_OP6 to handle the special + * operations like -x or +x when the left operand is empty. + * *------------------------------------------------------------------------- */ static void @@ -1320,9 +1449,9 @@ H5Z_do_op(H5Z_node* tree) else if(tree->type == H5Z_XFORM_MULT) H5Z_XFORM_DO_OP3(*) else if(tree->type == H5Z_XFORM_PLUS) - H5Z_XFORM_DO_OP3(+) + H5Z_XFORM_DO_OP6(+) else if(tree->type == H5Z_XFORM_MINUS) - H5Z_XFORM_DO_OP3(-) + H5Z_XFORM_DO_OP6(-) FUNC_LEAVE_NOAPI_VOID; } diff --git a/test/dtransform.c b/test/dtransform.c index 5d5cefe..2bcbe8c 100644 --- a/test/dtransform.c +++ b/test/dtransform.c @@ -23,6 +23,7 @@ static int init_test(hid_t file_id); static int test_copy(const hid_t dxpl_id_c_to_f_copy, const hid_t dxpl_id_polynomial_copy); static int test_trivial(const hid_t dxpl_id_simple); static int test_poly(const hid_t dxpl_id_polynomial); +static int test_specials(hid_t file); static int test_set(void); static int test_getset(const hid_t dxpl_id_simple); @@ -50,14 +51,14 @@ const float windchillFfloat[ROWS][COLS] = const int transformData[ROWS][COLS] = { {36, 31, 25, 19, 13, 7, 1, 5, 11, 16, 22, 28, 34, 40, 46, 52, 57, 63 }, - {34, 27, 21, 15, 9, 3, 4, 10, 16, 22, 28, 35, 41, 47, 53, 59, 66, 0 } , - {32, 25, 19, 13, 6, 0, 7, 13, 19, 26, 32, 39, 45, 51, 58, 64, 71, 5 }, + {34, 27, 21, 15, 9, 3, 4, 10, 16, 22, 28, 35, 41, 47, 53, 59, 66, 1 } , + {32, 25, 19, 13, 6, 2, 7, 13, 19, 26, 32, 39, 45, 51, 58, 64, 71, 5 }, {30, 24, 17, 11, 4, 2, 9, 15, 22, 29, 35, 42, 48, 55, 61, 68, 2, 9 }, {29, 23, 16, 9, 3, 4, 11, 17, 24, 31, 37, 44, 51, 58, 64, 71, 6, 12 }, {28, 22, 15, 8, 1, 5, 12, 19, 26, 33, 39, 46, 53, 60, 67, 1, 8, 15 }, - {28, 21, 14, 7, 0, 7, 14, 21, 27, 34, 41, 48, 55, 62, 69, 4, 10, 17 }, + {28, 21, 14, 7, 6, 7, 14, 21, 27, 34, 41, 48, 55, 62, 69, 4, 10, 17 }, {27, 20, 13, 6, 1, 8, 15, 22, 29, 36, 43, 50, 57, 64, 71, 6, 12, 19 }, - {26, 19, 12, 5, 2, 9, 16, 23, 30, 37, 44, 51, 58, 65, 0, 7, 14, 21 }, + {26, 19, 12, 5, 2, 9, 16, 23, 30, 37, 44, 51, 58, 65, 5, 7, 14, 21 }, {26, 19, 12, 4, 3, 10, 17, 24, 31, 38, 45, 52, 60, 67, 2, 9, 16, 23}, {25, 18, 11, 4, 3, 11, 18, 25, 32, 39, 46, 54, 61, 68, 3, 10, 17, 25}, {25, 17, 10, 3, 4, 11, 19, 26, 33, 40, 48, 55, 62, 69, 4, 12, 19, 26} @@ -97,6 +98,22 @@ const int transformData[ROWS][COLS] = PASSED(); \ } +#define COMPARE_INT(VAR1,VAR2) \ +{ \ + size_t i,j; \ + \ + for(i=0; i Date: Thu, 15 Mar 2012 16:21:46 -0500 Subject: [svn-r22077] Add example of multiple files for h5dump help text. Tested: local linux --- tools/h5dump/h5dump.c | 6 +++++- tools/testfiles/h5dump-help.txt | 6 +++++- tools/testfiles/tnofilename-with-packed-bits.ddl | 6 +++++- tools/testfiles/tpbitsIncomplete.ddl | 6 +++++- tools/testfiles/tpbitsLengthExceeded.ddl | 6 +++++- tools/testfiles/tpbitsLengthPositive.ddl | 6 +++++- tools/testfiles/tpbitsMaxExceeded.ddl | 6 +++++- tools/testfiles/tpbitsOffsetExceeded.ddl | 6 +++++- tools/testfiles/tpbitsOffsetNegative.ddl | 6 +++++- 9 files changed, 45 insertions(+), 9 deletions(-) diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c index 3cda4c1..650846a 100644 --- a/tools/h5dump/h5dump.c +++ b/tools/h5dump/h5dump.c @@ -231,7 +231,7 @@ static void usage(const char *prog) { HDfflush(rawoutstream); - HDfprintf(rawoutstream, "usage: %s [OPTIONS] file\n", prog); + HDfprintf(rawoutstream, "usage: %s [OPTIONS] files\n", prog); HDfprintf(rawoutstream, " OPTIONS\n"); HDfprintf(rawoutstream, " -h, --help Print a usage message and exit\n"); HDfprintf(rawoutstream, " -n, --contents Print a list of the file contents and exit\n"); @@ -329,6 +329,10 @@ usage(const char *prog) HDfprintf(rawoutstream, "\n"); HDfprintf(rawoutstream, " h5dump -d /dset -M 0,1,4,3 quux.h5\n"); HDfprintf(rawoutstream, "\n"); + HDfprintf(rawoutstream, " 5) Dataset foo in files multi1.h5 multi2.h5 multi3.h5\n"); + HDfprintf(rawoutstream, "\n"); + HDfprintf(rawoutstream, " h5dump -d /foo multi1.h5 multi2.h5 multi3.h5\n"); + HDfprintf(rawoutstream, "\n"); } diff --git a/tools/testfiles/h5dump-help.txt b/tools/testfiles/h5dump-help.txt index ca16c42..f04ed48 100644 --- a/tools/testfiles/h5dump-help.txt +++ b/tools/testfiles/h5dump-help.txt @@ -1,4 +1,4 @@ -usage: h5dump [OPTIONS] file +usage: h5dump [OPTIONS] files OPTIONS -h, --help Print a usage message and exit -n, --contents Print a list of the file contents and exit @@ -94,3 +94,7 @@ usage: h5dump [OPTIONS] file h5dump -d /dset -M 0,1,4,3 quux.h5 + 5) Dataset foo in files multi1.h5 multi2.h5 multi3.h5 + + h5dump -d /foo multi1.h5 multi2.h5 multi3.h5 + diff --git a/tools/testfiles/tnofilename-with-packed-bits.ddl b/tools/testfiles/tnofilename-with-packed-bits.ddl index 4a7f0b9..d3b12e3 100644 --- a/tools/testfiles/tnofilename-with-packed-bits.ddl +++ b/tools/testfiles/tnofilename-with-packed-bits.ddl @@ -1,4 +1,4 @@ -usage: h5dump [OPTIONS] file +usage: h5dump [OPTIONS] files OPTIONS -h, --help Print a usage message and exit -n, --contents Print a list of the file contents and exit @@ -94,4 +94,8 @@ usage: h5dump [OPTIONS] file h5dump -d /dset -M 0,1,4,3 quux.h5 + 5) Dataset foo in files multi1.h5 multi2.h5 multi3.h5 + + h5dump -d /foo multi1.h5 multi2.h5 multi3.h5 + h5dump error: missing file name diff --git a/tools/testfiles/tpbitsIncomplete.ddl b/tools/testfiles/tpbitsIncomplete.ddl index 88dac0a..0da055b 100644 --- a/tools/testfiles/tpbitsIncomplete.ddl +++ b/tools/testfiles/tpbitsIncomplete.ddl @@ -1,4 +1,4 @@ -usage: h5dump [OPTIONS] file +usage: h5dump [OPTIONS] files OPTIONS -h, --help Print a usage message and exit -n, --contents Print a list of the file contents and exit @@ -94,4 +94,8 @@ usage: h5dump [OPTIONS] file h5dump -d /dset -M 0,1,4,3 quux.h5 + 5) Dataset foo in files multi1.h5 multi2.h5 multi3.h5 + + h5dump -d /foo multi1.h5 multi2.h5 multi3.h5 + h5dump error: Bad mask list(0,2,2,1,0,2,2,) diff --git a/tools/testfiles/tpbitsLengthExceeded.ddl b/tools/testfiles/tpbitsLengthExceeded.ddl index 35055f4..594d70c 100644 --- a/tools/testfiles/tpbitsLengthExceeded.ddl +++ b/tools/testfiles/tpbitsLengthExceeded.ddl @@ -1,4 +1,4 @@ -usage: h5dump [OPTIONS] file +usage: h5dump [OPTIONS] files OPTIONS -h, --help Print a usage message and exit -n, --contents Print a list of the file contents and exit @@ -94,4 +94,8 @@ usage: h5dump [OPTIONS] file h5dump -d /dset -M 0,1,4,3 quux.h5 + 5) Dataset foo in files multi1.h5 multi2.h5 multi3.h5 + + h5dump -d /foo multi1.h5 multi2.h5 multi3.h5 + h5dump error: Packed Bit offset+length value(65) too large. Max is 64 diff --git a/tools/testfiles/tpbitsLengthPositive.ddl b/tools/testfiles/tpbitsLengthPositive.ddl index 3daeab4..7b3b678 100644 --- a/tools/testfiles/tpbitsLengthPositive.ddl +++ b/tools/testfiles/tpbitsLengthPositive.ddl @@ -1,4 +1,4 @@ -usage: h5dump [OPTIONS] file +usage: h5dump [OPTIONS] files OPTIONS -h, --help Print a usage message and exit -n, --contents Print a list of the file contents and exit @@ -94,4 +94,8 @@ usage: h5dump [OPTIONS] file h5dump -d /dset -M 0,1,4,3 quux.h5 + 5) Dataset foo in files multi1.h5 multi2.h5 multi3.h5 + + h5dump -d /foo multi1.h5 multi2.h5 multi3.h5 + h5dump error: Packed Bit length value(0) must be positive. diff --git a/tools/testfiles/tpbitsMaxExceeded.ddl b/tools/testfiles/tpbitsMaxExceeded.ddl index 2b3b68f..60bc2b1 100644 --- a/tools/testfiles/tpbitsMaxExceeded.ddl +++ b/tools/testfiles/tpbitsMaxExceeded.ddl @@ -1,4 +1,4 @@ -usage: h5dump [OPTIONS] file +usage: h5dump [OPTIONS] files OPTIONS -h, --help Print a usage message and exit -n, --contents Print a list of the file contents and exit @@ -94,4 +94,8 @@ usage: h5dump [OPTIONS] file h5dump -d /dset -M 0,1,4,3 quux.h5 + 5) Dataset foo in files multi1.h5 multi2.h5 multi3.h5 + + h5dump -d /foo multi1.h5 multi2.h5 multi3.h5 + h5dump error: Too many masks requested (max. 8). Mask list(0,1,0,1,1,1,2,1,3,1,4,1,5,1,6,1,7,1) diff --git a/tools/testfiles/tpbitsOffsetExceeded.ddl b/tools/testfiles/tpbitsOffsetExceeded.ddl index 6ccdc26..5db6a91 100644 --- a/tools/testfiles/tpbitsOffsetExceeded.ddl +++ b/tools/testfiles/tpbitsOffsetExceeded.ddl @@ -1,4 +1,4 @@ -usage: h5dump [OPTIONS] file +usage: h5dump [OPTIONS] files OPTIONS -h, --help Print a usage message and exit -n, --contents Print a list of the file contents and exit @@ -94,4 +94,8 @@ usage: h5dump [OPTIONS] file h5dump -d /dset -M 0,1,4,3 quux.h5 + 5) Dataset foo in files multi1.h5 multi2.h5 multi3.h5 + + h5dump -d /foo multi1.h5 multi2.h5 multi3.h5 + h5dump error: Packed Bit offset value(64) must be between 0 and 63 diff --git a/tools/testfiles/tpbitsOffsetNegative.ddl b/tools/testfiles/tpbitsOffsetNegative.ddl index eb41bd7..060fc37 100644 --- a/tools/testfiles/tpbitsOffsetNegative.ddl +++ b/tools/testfiles/tpbitsOffsetNegative.ddl @@ -1,4 +1,4 @@ -usage: h5dump [OPTIONS] file +usage: h5dump [OPTIONS] files OPTIONS -h, --help Print a usage message and exit -n, --contents Print a list of the file contents and exit @@ -94,4 +94,8 @@ usage: h5dump [OPTIONS] file h5dump -d /dset -M 0,1,4,3 quux.h5 + 5) Dataset foo in files multi1.h5 multi2.h5 multi3.h5 + + h5dump -d /foo multi1.h5 multi2.h5 multi3.h5 + h5dump error: Bad mask list(-1,1) -- cgit v0.12 From 29e7e2890bf51bce3120090f740ce1f336c0d6c4 Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Thu, 15 Mar 2012 19:53:56 -0500 Subject: [svn-r22078] New API: H5ltpath_valid REF: HDFFV-1233 A high-level "H5LTpath_valid" routine for checking if a path is correct Both Fortran and C version. Tested: jam (gnu and intel) --- hl/fortran/src/H5LTf90proto.h | 8 ++ hl/fortran/src/H5LTfc.c | 51 +++++++ hl/fortran/src/H5LTff.f90 | 67 +++++++++ hl/fortran/test/tstlite.f90 | 87 +++++++++++- hl/src/H5LT.c | 108 ++++++++++++++- hl/src/H5LTpublic.h | 3 +- hl/test/test_lite.c | 316 +++++++++++++++++++++++++++++++++++++++++- 7 files changed, 634 insertions(+), 6 deletions(-) diff --git a/hl/fortran/src/H5LTf90proto.h b/hl/fortran/src/H5LTf90proto.h index 5525af9..3d2ae3b 100755 --- a/hl/fortran/src/H5LTf90proto.h +++ b/hl/fortran/src/H5LTf90proto.h @@ -149,6 +149,7 @@ H5_FCDLL void HD5packFstring (char *src, char *dest, size_t len); #define nh5ltget_attribute_ndims_c H5_FC_FUNC_(h5ltget_attribute_ndims_c, H5LTGET_ATTRIBUTE_NDIMS_C) #define nh5ltget_attribute_info_c H5_FC_FUNC_(h5ltget_attribute_info_c, H5LTGET_ATTRIBUTE_INFO_C) +#define nh5ltpath_valid_c H5_FC_FUNC_(h5ltpath_valid_c, H5LTPATH_VALID_C) /*------------------------------------------------------------------------- * Image @@ -1197,6 +1198,13 @@ nh5ltread_dataset_string_c (hid_t_f *loc_id, _fcd name, char *buf); +HDF5_HL_F90CSTUBDLL +int_f +nh5ltpath_valid_c(hid_t_f *loc_id, + _fcd path, + int_f *pathlen, + int_f *check_object_valid_c); + /*------------------------------------------------------------------------- * Image *------------------------------------------------------------------------- diff --git a/hl/fortran/src/H5LTfc.c b/hl/fortran/src/H5LTfc.c index 484acf1..c0b7695 100755 --- a/hl/fortran/src/H5LTfc.c +++ b/hl/fortran/src/H5LTfc.c @@ -2124,3 +2124,54 @@ done: return ret_value; } + +/*------------------------------------------------------------------------- +* Function: h5ltpath_valid_c +* +* Purpose: Calls h5ltpath_valid +* +* Return: Success: 0, Failure: -1 +* +* Programmer: M. Scot Breitenfeld +* +* Date: February 18, 2012 +* +* Comments: +* +* Modifications: +* +* +*------------------------------------------------------------------------- +*/ + +int_f +nh5ltpath_valid_c(hid_t_f *loc_id, + _fcd path, + int_f *pathlen, + int_f *check_object_valid_c) +{ + htri_t ret = -1; + char *c_path = NULL; + hbool_t check_object_valid; + + /* + * convert FORTRAN name to C name + */ + if( NULL == (c_path = (char *)HD5f2cstring(path, (int)*pathlen))) + goto done; + + check_object_valid = FALSE; + if(*check_object_valid_c == 1) + check_object_valid = TRUE; + + /* + * call H5LTpath_valid function. + */ + ret = H5LTpath_valid( (hid_t)*loc_id, c_path, check_object_valid ); + +done: + if(c_path != NULL) + free(c_path); + + return (int_f)ret; +} diff --git a/hl/fortran/src/H5LTff.f90 b/hl/fortran/src/H5LTff.f90 index cbc9b96..7d53ab7 100755 --- a/hl/fortran/src/H5LTff.f90 +++ b/hl/fortran/src/H5LTff.f90 @@ -6308,6 +6308,73 @@ CONTAINS errcode = h5ltget_attribute_info_c(loc_id,namelen,dset_name,attrlen,attr_name,dims,type_class,type_size) END SUBROUTINE h5ltget_attribute_info_f + + !------------------------------------------------------------------------- + ! Function: h5ltpath_valid_f + ! + ! Purpose: Validates a path + ! + ! Return: Success: 0, Failure: -1 + ! + ! Programmer: M. Scot Breitenfeld + ! + ! Date: February 18, 2012 + ! + ! Comments: + ! + ! Modifications: + ! + !------------------------------------------------------------------------- + + SUBROUTINE h5ltpath_valid_f(loc_id, path, check_object_valid, path_valid, errcode) + + IMPLICIT NONE + ! + !This definition is needed for Windows DLLs + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$attributes dllexport :: h5ltpath_valid_f + !DEC$endif + ! + INTEGER(hid_t) , INTENT(IN) :: loc_id ! File or group identifier. + CHARACTER(LEN=*), INTENT(IN) :: path ! Path to the object to check, relative to loc_id. + LOGICAL , INTENT(IN) :: check_object_valid ! Indicates whether to check if the final component + ! of the path resolves to a valid object + LOGICAL , INTENT(OUT) :: path_valid ! Object status + INTEGER , INTENT(OUT) :: errcode ! Error code: 0 on success and -1 on failure + + INTEGER :: pathlen + INTEGER :: check_object_valid_c + INTEGER :: status + + INTERFACE + INTEGER FUNCTION h5ltpath_valid_c(loc_id, path, pathlen, check_object_valid_c) + USE h5global + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTPATH_VALID_C'::h5ltpath_valid_c + !DEC$ENDIF + !DEC$ATTRIBUTES reference :: path + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(len=*), INTENT(in) :: path + INTEGER :: pathlen + INTEGER :: check_object_valid_c + END FUNCTION h5ltpath_valid_c + END INTERFACE + + check_object_valid_c = 0 + IF(check_object_valid) check_object_valid_c = 1 + + pathlen = LEN(path) + status = h5ltpath_valid_c(loc_id, path, pathlen, check_object_valid_c) + + path_valid = .FALSE. + errcode = 0 + IF(status.EQ.1)THEN + path_valid = .TRUE. + ELSE IF(status.LT.0)THEN + errcode = -1 + ENDIF + + END SUBROUTINE h5ltpath_valid_f ! end ! END MODULE H5LT diff --git a/hl/fortran/test/tstlite.f90 b/hl/fortran/test/tstlite.f90 index b0e28f9..9329dba 100644 --- a/hl/fortran/test/tstlite.f90 +++ b/hl/fortran/test/tstlite.f90 @@ -1067,6 +1067,9 @@ SUBROUTINE test_datasets() INTEGER :: has ! general purpose integer INTEGER :: type_class INTEGER(SIZE_T) :: type_size + LOGICAL :: path_valid ! status of the path + CHARACTER(LEN=6) :: chr_exact + CHARACTER(LEN=8) :: chr_lg ! ! Initialize FORTRAN predefined datatypes. @@ -1118,6 +1121,7 @@ SUBROUTINE test_datasets() CALL passed() + !------------------------------------------------------------------------- ! real !------------------------------------------------------------------------- @@ -1207,9 +1211,60 @@ SUBROUTINE test_datasets() CALL passed() + CALL test_begin(' Test h5ltpath_valid_f ') + ! + ! test function h5ltpath_valid_f + ! + chr_exact = "/"//dsetname2 ! test character buffer the exact size needed + CALL h5ltpath_valid_f(file_id, chr_exact, .TRUE., path_valid, errcode) + IF(errcode.LT.0.OR..NOT.path_valid)THEN + PRINT *, 'error in h5ltpath_valid_f' + STOP + ENDIF + chr_lg = "/"//dsetname2 ! test character buffer larger then needed + CALL h5ltpath_valid_f(file_id, chr_lg, .TRUE., path_valid, errcode) + IF(errcode.LT.0.OR..NOT.path_valid)THEN + PRINT *, 'error in h5ltpath_valid_f' + STOP + ENDIF + CALL h5ltpath_valid_f(file_id, chr_lg, .FALSE., path_valid, errcode) + IF(errcode.LT.0.OR..NOT.path_valid)THEN + PRINT *, 'error in h5ltpath_valid_f' + STOP + ENDIF + ! Should fail, dataset does not exist + CALL h5ltpath_valid_f(file_id, "/"//dsetname2//"junk", .TRUE., path_valid, errcode) + IF(errcode.LT.0.OR.path_valid)THEN + PRINT *, 'error in h5ltpath_valid_f' + STOP + ENDIF + + CALL h5ltpath_valid_f(file_id, "/"//dsetname2//"junk", .FALSE., path_valid, errcode) + IF(errcode.LT.0.OR.path_valid)THEN + PRINT *, 'error in h5ltpath_valid_f' + STOP + ENDIF + + ! Create a dangling soft link + CALL h5lcreate_soft_f("/G2", file_id, "/G3", errcode) + + ! Should pass, does not check for dangled link + CALL h5ltpath_valid_f(file_id, "/G3", .FALSE., path_valid, errcode) + IF(.NOT.path_valid)THEN + PRINT *, 'error in h5ltpath_valid_f' + STOP + ENDIF + + ! Should fail, dangled link + CALL h5ltpath_valid_f(file_id, "/G2", .TRUE., path_valid, errcode) + IF(path_valid)THEN + PRINT *, 'error in h5ltpath_valid_f' + STOP + ENDIF + CALL passed() CALL test_begin(' Get dataset dimensions/info ') @@ -1296,6 +1351,8 @@ SUBROUTINE test_attributes() CHARACTER(LEN=5), PARAMETER :: attrname5 = "attr5" ! Attribute name CHARACTER(LEN=8), PARAMETER :: buf1 = "mystring" ! Data buffer CHARACTER(LEN=8) :: bufr1 ! Data buffer + CHARACTER(LEN=10) :: bufr1_lg ! Data buffer + CHARACTER(LEN=6) :: bufr1_sm ! Data buffer INTEGER, DIMENSION(DIM1) :: buf2 ! Data buffer INTEGER, DIMENSION(DIM1) :: bufr2 ! Data buffer REAL, DIMENSION(DIM1) :: buf3 ! Data buffer @@ -1446,20 +1503,46 @@ SUBROUTINE test_attributes() CALL h5ltset_attribute_string_f(file_id,dsetname1,attrname5,buf1,errcode) ! - ! read attribute. + ! read attribute into a fortran character buf that is the same size as buf1. ! CALL h5ltget_attribute_string_f(file_id,dsetname1,attrname5,bufr1,errcode) ! ! compare read and write buffers. ! - IF ( buf1 .NE. bufr1 ) THEN PRINT *, 'read buffer differs from write buffer' PRINT *, buf1, ' and ', bufr1 STOP ENDIF + ! + ! read attribute into a fortran character buf that is larger then buf1. + ! + CALL h5ltget_attribute_string_f(file_id,dsetname1,attrname5,bufr1_lg,errcode) + + ! + ! compare read and write buffers, make sure C NULL character was removed. + ! + IF ( buf1(1:8) .NE. bufr1_lg(1:8) .AND. bufr1_lg(9:10) .NE. ' ' ) THEN + PRINT *, 'larger read buffer differs from write buffer' + PRINT *, buf1, ' and ', bufr1_lg + STOP + ENDIF + + ! + ! read attribute into a fortran character buf that is smaller then buf1. + ! + CALL h5ltget_attribute_string_f(file_id,dsetname1,attrname5,bufr1_sm,errcode) + + ! + ! compare read and write buffers. + ! + IF ( buf1(1:6) .NE. bufr1_sm(1:6) ) THEN + PRINT *, 'smaller read buffer differs from write buffer' + PRINT *, buf1, ' and ', bufr1_sm + STOP + ENDIF CALL passed() diff --git a/hl/src/H5LT.c b/hl/src/H5LT.c index 1cc1017..eeaceeb 100644 --- a/hl/src/H5LT.c +++ b/hl/src/H5LT.c @@ -3030,4 +3030,110 @@ out: } - +htri_t +H5LTpath_valid(hid_t loc_id, const char *path, hbool_t check_object_valid) + { + char *tmp_path = NULL; /* Temporary copy of the path */ + char *curr_name; /* Pointer to current component of path name */ + char *delimit; /* Pointer to path delimiter during traversal */ + H5I_type_t obj_type; + htri_t link_exists, obj_exists; + size_t path_length; + htri_t ret_value; + + /* Initialize */ + ret_value = FALSE; + + /* Find the type of loc_id */ + if((obj_type = H5Iget_type(loc_id)) == H5I_BADID) { + ret_value = FAIL; + goto done; + } + + /* Find the length of the path */ + path_length = HDstrlen(path); + + /* Check if the identifier is the object itself, i.e. path is '.' */ + if(HDstrncmp(path, ".", path_length) == 0) { + if(check_object_valid) { + obj_exists = H5Oexists_by_name(loc_id, path, H5P_DEFAULT); + ret_value = obj_exists; + goto done; + } else { + ret_value = TRUE; /* Since the object is the identifier itself, + * we can only check if loc_id is a valid type */ + goto done; + } + } + + /* Duplicate the path to use */ + if(NULL == (tmp_path = HDstrdup(path))) { + ret_value = FAIL; + goto done; + } + + curr_name = tmp_path; + + /* check if absolute pathname */ + if(HDstrncmp(path, "/", 1) == 0) curr_name++; + + /* check if relative path name starts with "./" */ + if(HDstrncmp(path, "./", 2) == 0) curr_name += 2; + + while((delimit=HDstrchr(curr_name,'/'))!=NULL) { + /* Change the delimiter to terminate the string */ + *delimit='\0'; + + obj_exists = FALSE; + if((link_exists = H5Lexists(loc_id, tmp_path, H5P_DEFAULT)) < 0) { + ret_value = FAIL; + goto done; + } + + /* If target link does not exist then no reason to + * continue checking the path */ + if(link_exists != TRUE) { + ret_value = FALSE; + goto done; + } + + /* Determine if link resolves to an actual object */ + if((obj_exists = H5Oexists_by_name(loc_id, tmp_path, H5P_DEFAULT)) < 0) { + ret_value = FAIL; + goto done; + } + + if(obj_exists != TRUE) + break; + + /* Change the delimiter back to '/' */ + *delimit='/'; + + /* Advance the pointer in the path to the start of the next component */ + curr_name = delimit + 1; + + } /* end while */ + + /* Should be pointing to the last component in the path name now... */ + + /* Check if link does not exist */ + if((link_exists = H5Lexists(loc_id, tmp_path, H5P_DEFAULT)) < 0) { + ret_value = FAIL; + } else { + ret_value = link_exists; + /* Determine if link resolves to an actual object for check_object_valid TRUE */ + if(check_object_valid == TRUE && link_exists == TRUE) { + if((obj_exists = H5Oexists_by_name(loc_id, tmp_path, H5P_DEFAULT)) < 0) { + ret_value = FAIL; + } else { + ret_value = obj_exists; + } + } + } + +done: + if(tmp_path != NULL) + HDfree(tmp_path); + + return ret_value; + } diff --git a/hl/src/H5LTpublic.h b/hl/src/H5LTpublic.h index 7fb873a..6efae68 100644 --- a/hl/src/H5LTpublic.h +++ b/hl/src/H5LTpublic.h @@ -340,8 +340,9 @@ H5_HLDLL herr_t H5LTdtype_to_text(hid_t dtype, char *str, H5LT_lang_t lang_type, *------------------------------------------------------------------------- */ -H5_HLDLL herr_t H5LTfind_attribute( hid_t loc_id, const char *name ); +H5_HLDLL herr_t H5LTfind_attribute( hid_t loc_id, const char *name ); +H5_HLDLL htri_t H5LTpath_valid(hid_t loc_id, const char *path, hbool_t check_object_valid); #ifdef __cplusplus } diff --git a/hl/test/test_lite.c b/hl/test/test_lite.c index 4944143..7a5e43a 100644 --- a/hl/test/test_lite.c +++ b/hl/test/test_lite.c @@ -21,6 +21,8 @@ #define FILE_NAME "test_lite1.h5" #define FILE_NAME2 "test_lite2.h5" +#define FILE_NAME3 "test_lite3.h5" +#define FILE_NAME4 "test_lite4.h5" #define INPUT_FILE "dtype_file.txt" #define DSET0_NAME "2D int array" @@ -1805,6 +1807,317 @@ out: } /*------------------------------------------------------------------------- + * test H5LTpath_valid function + *------------------------------------------------------------------------- + */ +static int test_valid_path(void) +{ + hid_t file_id, group; + herr_t status; + FILE *fp = NULL; + htri_t path_valid; + char path[10]; + const char *data_string_in = "test"; + + TESTING("H5LTpath_valid"); + + /* Create a new file using default properties. */ + + /************************************************************** + * The file structure should look like this: + * + * +----------------------------------+ + * | / | + * +----------------------------------+ + * / | \ \ + * / | \ \ + * / | \ \ + * / | \ G8 (dangled external link) + * / DS \ + * / \ + * G1 G2 + * | --> DS1 | + * / \--> DS3 / \ + * / / \ + * G2 DS4 G7 + * | (hard link (dangled soft link + * | to /G1/DS3) to /G1/G20 ) + * / \ + * / \ + * G5 \ + * (soft link G6 (external link /G1 in FILENAME4) + * to /G2) + * + ****************************************************************/ + + file_id = H5Fcreate(FILE_NAME3, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + + /* + * Create dataset "/DS" + */ + if(H5LTmake_dataset_string(file_id, "DS", data_string_in)<0) + goto out; + + /* + * Create an external dangled link + */ + if(H5Lcreate_external("NonExistant_File.h5", "G8", file_id, "DangledExternalLink", H5P_DEFAULT, H5P_DEFAULT)<0) + goto out; + + /* + * Create a group named "G2" in the file. + */ + if((group = H5Gcreate(file_id, "G2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT))<0) + goto out; + + /* + * Create a dataset named "G2/DS4" in the file. + */ + if(H5LTmake_dataset_string(group, "/G2/DS4", data_string_in)<0) + goto out; + + /* + * Create a soft link + */ + if(H5Lcreate_soft("/G1/G20", file_id, "/G2/G7", H5P_DEFAULT, H5P_DEFAULT) <0) + goto out; + + if(H5Gclose(group)<0) + goto out; + + /* + * Create a group named "G1" in the file. + */ + if((group = H5Gcreate(file_id, "G1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT))<0) + goto out; + + /* + * Create a group named "G1/DS1" in the file. + */ + if(H5LTmake_dataset_string(group, "/G1/DS1", data_string_in)<0) + goto out; + + if(H5Gclose(group)<0) + goto out; + + /* + * Create a group named "/G3/G5" in the file. + */ + if(H5Lcreate_hard(file_id, "/G2/DS4", file_id, "/G1/DS3",H5P_DEFAULT, H5P_DEFAULT)<0) + goto out; + /* + * Create a group named "/G1/G2" in the file. + */ + if((group = H5Gcreate (file_id, "/G1/G2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT))<0) + goto out; + + /* + * Create a soft link + */ + if(H5Lcreate_soft("/G2", file_id, "/G1/G2/G5", H5P_DEFAULT, H5P_DEFAULT)<0) + goto out; + + if(H5Gclose(group)<0) + goto out; + + /* + * Create a group named "/G1/G2/G6" in the file. + */ + if((group = H5Gcreate(file_id, "/G1/G2/G6", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT))<0) + goto out; + + /* + * Create an external link + */ + if(H5Lcreate_external( FILE_NAME4, "G1", group, "ExternalLink", H5P_DEFAULT, H5P_DEFAULT)<0) + goto out; + + if(H5Gclose(group)<0) + goto out; + /* + * Close the file. + */ + status = H5Fclose (file_id); + + /* Create another file for checking external links */ + + /************************************************************** + * The file structure should look like this: + * + * +----+ + * | / | + * +----+ + * | + * | + * | + * G1 + * / \ + * / \ + * DS1 G2 + * (dangled soft link to /G1/G20) + * + ****************************************************************/ + + /* Make external link file */ + file_id = H5Fcreate(FILE_NAME4, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + + /* + * Create a group named "G1" in the file. + */ + if((group = H5Gcreate(file_id, "G1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT))<0) + goto out; + /* + * Create a dataset named "G1/DS1" in the file. + */ + if(H5LTmake_dataset_string(group, "/G1/DS1", data_string_in)<0) + goto out; + + /* + * Create a dangling soft link + */ + + if(H5Lcreate_soft("/G1/G2", file_id, "/G1/G20", H5P_DEFAULT, H5P_DEFAULT)<0) + goto out; + + if(H5Gclose(group)<0) + goto out; + + H5Fclose(file_id); + + /* Open input file */ + if((file_id = H5Fopen(FILE_NAME3,H5F_ACC_RDONLY, H5P_DEFAULT))<0) + goto out; + + /************************************** + * CHECK ABSOLUTE PATHS + **************************************/ + + strncpy(path, "/G1",3); + if( (path_valid = H5LTpath_valid(file_id, path, TRUE)) != TRUE) { + goto out; + } + + if((path_valid = H5LTpath_valid(file_id, "/G1/DS1", TRUE)) != TRUE) + goto out; + + if( (path_valid = H5LTpath_valid(file_id, "/G1/DS3", TRUE)) != TRUE) + goto out; + + if( (path_valid = H5LTpath_valid(file_id, "/G1/G2", TRUE)) != TRUE) + goto out; + + if( (path_valid = H5LTpath_valid(file_id, "/G1/G2/G5", TRUE)) != TRUE) + goto out; + + if( (path_valid = H5LTpath_valid(file_id, "/G2", TRUE)) != TRUE) + goto out; + + /* check soft link points to a valid object*/ + if( (path_valid = H5LTpath_valid(file_id, "/G2/DS4", TRUE)) != TRUE) + goto out; + + /* check if path exist, but not the object */ + if( (path_valid = H5LTpath_valid(file_id, "/G2/G7", FALSE)) != TRUE ) + goto out; + + /* check if path exist and if the object exists. It should fail + * since it is a dangling soft link + */ + if( (path_valid = H5LTpath_valid(file_id, "/G2/G7", TRUE)) == TRUE) + goto out; + + /* check soft links */ + if( (path_valid = H5LTpath_valid(file_id, "/G1/G2/G5/DS4", TRUE)) != TRUE) + goto out; + + /************************************** + * CHECK RELATIVE PATHS + ***************************************/ + + if( (group = H5Gopen(file_id, "/G1", H5P_DEFAULT)) < 0) + goto out; + + /* The identifier (file id) is the object itself, i.e. "." */ + + if((path_valid = H5LTpath_valid(file_id, ".", FALSE)) != TRUE) + goto out; + + if( (path_valid = H5LTpath_valid(file_id, ".", TRUE)) != TRUE) + goto out; + + /* The identifier (group id) is the object itself, i.e. "." */ + + if( (path_valid = H5LTpath_valid(group, ".", TRUE)) != TRUE) + goto out; + + if( (path_valid = H5LTpath_valid(group, "DS3", FALSE)) != TRUE) + goto out; + + if( (path_valid = H5LTpath_valid(group, "DS3", TRUE)) != TRUE) + goto out; + + if( (path_valid = H5LTpath_valid(group, "G2/G5", TRUE)) != TRUE) + goto out; + + /* Check the "./" case */ + if( (path_valid = H5LTpath_valid(group, "./DS3", TRUE)) != TRUE) + goto out; + + if( (path_valid = H5LTpath_valid(group, "./G2/G5", TRUE)) != TRUE) + goto out; + + /* Should fail, does not exist */ + if( (path_valid = H5LTpath_valid(group, "./G2/G20", FALSE)) == TRUE) + goto out; + + /* Should fail, does not exist */ + if( (path_valid = H5LTpath_valid(group, "./G2/G20", TRUE)) == TRUE) + goto out; + + if(H5Gclose(group)<0) + goto out; + + /***************************** + * Check external links + *****************************/ + + /* The dangled external link path is valid */ + if( (path_valid = H5LTpath_valid(file_id, "/DangledExternalLink", FALSE)) != TRUE) + goto out; + + /* The file however does not exists, so the link dangles -> should return false */ + if( (path_valid = H5LTpath_valid(file_id, "/DangledExternalLink", TRUE)) == TRUE) + goto out; + + if( (path_valid = H5LTpath_valid(file_id, "/G1/G2/G6/ExternalLink", FALSE)) != TRUE) + goto out; + + if( (path_valid = H5LTpath_valid(file_id, "/G1/G2/G6/ExternalLink", TRUE)) != TRUE) + goto out; + + if( (path_valid = H5LTpath_valid(file_id, "/G1/G2/G6/ExternalLink/DS1", TRUE)) != TRUE) + goto out; + + if( (path_valid = H5LTpath_valid(file_id, "/G1/G2/G6/ExternalLink/G20", FALSE)) != TRUE) + goto out; + + /* Should fail, does not exist */ + if( (path_valid = H5LTpath_valid(file_id, "/G1/G2/G6/ExternalLink/G20", TRUE)) == TRUE) + goto out; + + if(H5Fclose(file_id)<0) + goto out; + + PASSED(); + return 0; + + out: + H5_FAILED(); + return -1; +} + + +/*------------------------------------------------------------------------- * the main program *------------------------------------------------------------------------- */ @@ -1819,7 +2132,7 @@ int main( void ) nerrors += test_attr(); /* test text-dtype functions */ - nerrors += test_text_dtype(); + nerrors += test_valid_path(); /* check for errors */ if (nerrors) @@ -1832,4 +2145,3 @@ error: } - -- cgit v0.12 From c9ebe22dd06b60d626a2844f2e0967c5480a3bfc Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Thu, 15 Mar 2012 23:24:55 -0500 Subject: [svn-r22079] Added H5LTpath_valid(_f) description. --- release_docs/RELEASE.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 63ae2d7..4e5e9ae 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -349,6 +349,10 @@ New Features h5dsget_scale_name_f h5dsget_num_scales_f (EIP for SB - 2011/10/13) + + - New API: h5ltpath_valid (Fortran: h5ltpath_valid_f) which checks + if a path is correct and determines if a link resolves to a valid + object and does not dangle. (MSB- 2012/3/15) Documentation ------------- -- cgit v0.12 From e4c1c566d462eb5e3492ca3b82b0b032b9978b45 Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Thu, 15 Mar 2012 23:27:47 -0500 Subject: [svn-r22080] Description: aligned H5_FC_FUNC with the H5_FC_FUNC in the line above tested: none --- hl/fortran/src/H5LTf90proto.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hl/fortran/src/H5LTf90proto.h b/hl/fortran/src/H5LTf90proto.h index 3d2ae3b..205871c 100755 --- a/hl/fortran/src/H5LTf90proto.h +++ b/hl/fortran/src/H5LTf90proto.h @@ -149,7 +149,7 @@ H5_FCDLL void HD5packFstring (char *src, char *dest, size_t len); #define nh5ltget_attribute_ndims_c H5_FC_FUNC_(h5ltget_attribute_ndims_c, H5LTGET_ATTRIBUTE_NDIMS_C) #define nh5ltget_attribute_info_c H5_FC_FUNC_(h5ltget_attribute_info_c, H5LTGET_ATTRIBUTE_INFO_C) -#define nh5ltpath_valid_c H5_FC_FUNC_(h5ltpath_valid_c, H5LTPATH_VALID_C) +#define nh5ltpath_valid_c H5_FC_FUNC_(h5ltpath_valid_c, H5LTPATH_VALID_C) /*------------------------------------------------------------------------- * Image -- cgit v0.12 From e37a9c67d85025215445cee71d9242aace3244d2 Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Fri, 16 Mar 2012 09:54:18 -0500 Subject: [svn-r22081] Description: Changed H5G*() to H5G*2() APIs for compatability. Tested: (jam intel, --with-default-api-version=v16) --- hl/test/test_lite.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hl/test/test_lite.c b/hl/test/test_lite.c index 7a5e43a..4b432d6 100644 --- a/hl/test/test_lite.c +++ b/hl/test/test_lite.c @@ -1867,7 +1867,7 @@ static int test_valid_path(void) /* * Create a group named "G2" in the file. */ - if((group = H5Gcreate(file_id, "G2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT))<0) + if((group = H5Gcreate2(file_id, "G2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT))<0) goto out; /* @@ -1888,7 +1888,7 @@ static int test_valid_path(void) /* * Create a group named "G1" in the file. */ - if((group = H5Gcreate(file_id, "G1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT))<0) + if((group = H5Gcreate2(file_id, "G1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT))<0) goto out; /* @@ -1908,7 +1908,7 @@ static int test_valid_path(void) /* * Create a group named "/G1/G2" in the file. */ - if((group = H5Gcreate (file_id, "/G1/G2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT))<0) + if((group = H5Gcreate2(file_id, "/G1/G2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT))<0) goto out; /* @@ -1923,7 +1923,7 @@ static int test_valid_path(void) /* * Create a group named "/G1/G2/G6" in the file. */ - if((group = H5Gcreate(file_id, "/G1/G2/G6", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT))<0) + if((group = H5Gcreate2(file_id, "/G1/G2/G6", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT))<0) goto out; /* @@ -1964,7 +1964,7 @@ static int test_valid_path(void) /* * Create a group named "G1" in the file. */ - if((group = H5Gcreate(file_id, "G1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT))<0) + if((group = H5Gcreate2(file_id, "G1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT))<0) goto out; /* * Create a dataset named "G1/DS1" in the file. @@ -2034,7 +2034,7 @@ static int test_valid_path(void) * CHECK RELATIVE PATHS ***************************************/ - if( (group = H5Gopen(file_id, "/G1", H5P_DEFAULT)) < 0) + if( (group = H5Gopen2(file_id, "/G1", H5P_DEFAULT)) < 0) goto out; /* The identifier (file id) is the object itself, i.e. "." */ -- cgit v0.12 From 18a18f7f10294cc4621cbf0fd6319425ce10786b Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Fri, 16 Mar 2012 10:13:46 -0500 Subject: [svn-r22082] Description: replaced strncopy with passing path name directly. --- hl/test/test_lite.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/hl/test/test_lite.c b/hl/test/test_lite.c index 4b432d6..59da1f1 100644 --- a/hl/test/test_lite.c +++ b/hl/test/test_lite.c @@ -1991,12 +1991,10 @@ static int test_valid_path(void) /************************************** * CHECK ABSOLUTE PATHS **************************************/ - - strncpy(path, "/G1",3); - if( (path_valid = H5LTpath_valid(file_id, path, TRUE)) != TRUE) { + if( (path_valid = H5LTpath_valid(file_id, "/G1", TRUE)) != TRUE) { goto out; } - + if((path_valid = H5LTpath_valid(file_id, "/G1/DS1", TRUE)) != TRUE) goto out; @@ -2019,7 +2017,6 @@ static int test_valid_path(void) /* check if path exist, but not the object */ if( (path_valid = H5LTpath_valid(file_id, "/G2/G7", FALSE)) != TRUE ) goto out; - /* check if path exist and if the object exists. It should fail * since it is a dangling soft link */ -- cgit v0.12 From c8ad738d4e0f00196a97288f9de35cb0401dcf86 Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Fri, 16 Mar 2012 11:12:20 -0500 Subject: [svn-r22084] I updated the item for Issue 7756. No test is needed. --- release_docs/RELEASE.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 4e5e9ae..d33a560 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -374,8 +374,9 @@ Bug Fixes since HDF5-1.8.0 release - Fixed rare corruption bugs that could occur when using the new object header format. (NAF - 2012/3/15 - HDFFV-7879) - Creating a dataset in a read-only file caused seg fault when the file - is closed. It's fixed. The error stack is returned correctly - now. (SLU - 2012/1/25. Issue 7756) + is closed. It's fixed. The attemp to create a dataset will fail + with the error stack indicating the file is read-only. (SLU - + 2012/1/25. Issue 7756) - Fixed a seg fault that could occur when shrinking a dataset with chunks larger than 1 MB. (NAF - 2011/11/30 - HDFFV-7833) - The library allowed the conversion of strings between ASCII and UTF8 -- cgit v0.12 From a51eaab41a23427016afd1d870b39464f2201f2b Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 19 Mar 2012 09:03:12 -0500 Subject: [svn-r22087] Minor formatting changes to sync with 1.8 --- tools/h5ls/testh5ls.sh.in | 34 +++++++++++++++++----------------- tools/lib/h5tools.c | 2 +- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/tools/h5ls/testh5ls.sh.in b/tools/h5ls/testh5ls.sh.in index 3f84ac5..23b4ab3 100644 --- a/tools/h5ls/testh5ls.sh.in +++ b/tools/h5ls/testh5ls.sh.in @@ -25,7 +25,7 @@ H5LS_BIN=`pwd`/$H5LS # The path of the tool binary CMP='cmp -s' DIFF='diff -c' CP='cp' -NLINES=20 # Max. lines of output to display if test fails +NLINES=20 # Max. lines of output to display if test fails WORDS_BIGENDIAN="@WORDS_BIGENDIAN@" @@ -211,7 +211,7 @@ TOOLTEST() { # any unexpected output from that stream too. TESTING $H5LS $@ ( - cd $TESTDIR + cd $TESTDIR $RUNSERIAL $H5LS_BIN "$@" ) >$actual 2>$actual_err @@ -223,37 +223,37 @@ TOOLTEST() { STDERR_FILTER $actual_err cat $actual_err >> $actual if [ $h5haveexitcode = 'yes' -a $exitcode -ne $retvalexpect ]; then - echo "*FAILED*" - nerrors="`expr $nerrors + 1`" - if [ yes = "$verbose" ]; then - echo "test returned with exit code $exitcode" - echo "test output: (up to $NLINES lines)" - head -$NLINES $actual - echo "***end of test output***" - echo "" - fi + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + if [ yes = "$verbose" ]; then + echo "test returned with exit code $exitcode" + echo "test output: (up to $NLINES lines)" + head -$NLINES $actual + echo "***end of test output***" + echo "" + fi elif [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. + # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect elif $CMP $expect $actual; then echo " PASSED" else echo "*FAILED*" - echo " Expected result differs from actual result" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + echo " Expected result differs from actual result" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err $actual_sav $actual_err_sav + rm -f $actual $actual_err $actual_sav $actual_err_sav fi } ############################################################################## ############################################################################## -### T H E T E S T S ### +### T H E T E S T S ### ############################################################################## ############################################################################## # prepare for test diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index 5e173e8..17639bc 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -115,7 +115,7 @@ h5tools_init(void) if (!h5tools_init_g) { /* register the error class */ HDsnprintf(lib_str, sizeof(lib_str), "%d.%d.%d",H5_VERS_MAJOR, H5_VERS_MINOR, H5_VERS_RELEASE); - + H5tools_ERR_STACK_g = H5Ecreate_stack(); H5TOOLS_INIT_ERROR() -- cgit v0.12 From 14bc79b1b8ed7f8b0936cca9c5bbc33b1b8cacc1 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 19 Mar 2012 10:05:19 -0500 Subject: [svn-r22090] Reorder tools/h5jam/testfiles ordering --- MANIFEST | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MANIFEST b/MANIFEST index f30ea30..ddf5423 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1960,12 +1960,12 @@ ./tools/h5jam/getub.c # test files for jam -./tools/h5jam/testfiles/twithub.h5 -./tools/h5jam/testfiles/twithub513.h5 ./tools/h5jam/testfiles/h5jam-help.txt ./tools/h5jam/testfiles/h5unjam-help.txt -./tools/h5jam/testfiles/u10.txt ./tools/h5jam/testfiles/tall.h5 +./tools/h5jam/testfiles/twithub.h5 +./tools/h5jam/testfiles/twithub513.h5 +./tools/h5jam/testfiles/u10.txt ./tools/h5jam/testfiles/u511.txt ./tools/h5jam/testfiles/u512.txt ./tools/h5jam/testfiles/u513.txt -- cgit v0.12 From 16591dbcc509a908e4edc509aa43081f9938c05d Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Mon, 19 Mar 2012 16:10:40 -0500 Subject: [svn-r22094] Issue 7922 - follow-up checkin. Daily test reported that PGCC (11.8-0) on jam and koala has trouble with the command "*p++ = *p OP tree_val" in the macro definition of H5Z_XFORM_DO_OP1 of H5Ztrans.c. It increments P first before doing the operation. So I break down the command into two lines: "*p = *p OP tree_val; p++;" I also reported the problem to PGI. Tested on jam, koala, and ostrich. --- src/H5Ztrans.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/H5Ztrans.c b/src/H5Ztrans.c index 2a2796d..00eebb4 100644 --- a/src/H5Ztrans.c +++ b/src/H5Ztrans.c @@ -107,6 +107,10 @@ static void H5Z_XFORM_DEBUG(H5Z_node *tree); static void H5Z_print(H5Z_node *tree, FILE *stream); #endif /* H5Z_XFORM_DEBUG */ +/* PGCC (11.8-0) has trouble with the command *p++ = *p OP tree_val. It increments P first before + * doing the operation. So I break down the command into two lines: + * *p = *p OP tree_val; p++; + * (SLU - 2012/3/19) */ #define H5Z_XFORM_DO_OP1(RESL,RESR,TYPE,OP,SIZE) \ { \ size_t u; \ @@ -119,8 +123,10 @@ static void H5Z_print(H5Z_node *tree, FILE *stream); tree_val = ((RESR).type==H5Z_XFORM_INTEGER ? (double)(RESR).value.int_val : (RESR).value.float_val); \ p = (TYPE*)(RESL).value.dat_val; \ \ - for(u=0; u<(SIZE); u++) \ - *p++ = *p OP tree_val; \ + for(u=0; u<(SIZE); u++) { \ + *p = *p OP tree_val; \ + p++; \ + } \ } \ else if(((RESR).type == H5Z_XFORM_SYMBOL) && ((RESL).type != H5Z_XFORM_SYMBOL)) \ { \ @@ -134,16 +140,20 @@ static void H5Z_print(H5Z_node *tree, FILE *stream); tree_val = ((RESL).type==H5Z_XFORM_INTEGER ? (double)(RESL).value.int_val : (RESL).value.float_val); \ \ p = (TYPE*)(RESR).value.dat_val; \ - for(u=0; u<(SIZE); u++) \ - *p++ = tree_val OP *p; \ + for(u=0; u<(SIZE); u++) { \ + *p = tree_val OP *p; \ + p++; \ + } \ } \ else if( ((RESL).type == H5Z_XFORM_SYMBOL) && ((RESR).type==H5Z_XFORM_SYMBOL)) \ { \ TYPE* pl = (TYPE*)(RESL).value.dat_val; \ TYPE* pr = (TYPE*)(RESR).value.dat_val; \ \ - for(u=0; u<(SIZE); u++) \ - *pl++ = *pl OP *pr++; \ + for(u=0; u<(SIZE); u++) { \ + *pl = *pl OP *pr; \ + pl++; pr++; \ + } \ } \ else \ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Unexpected type conversion operation") \ -- cgit v0.12 From 5e202882c906ea1b144d26c0b7a837d4fb8a8b10 Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Mon, 19 Mar 2012 23:23:10 -0500 Subject: [svn-r22096] Desciption: Added cyclic path test for H5LTpath_valid. Tested: jam (gnu and intel) --- hl/test/test_lite.c | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/hl/test/test_lite.c b/hl/test/test_lite.c index 59da1f1..eb00cd7 100644 --- a/hl/test/test_lite.c +++ b/hl/test/test_lite.c @@ -1841,8 +1841,11 @@ static int test_valid_path(void) * / / \ * G2 DS4 G7 * | (hard link (dangled soft link - * | to /G1/DS3) to /G1/G20 ) - * / \ + * | to /G1/DS3) to /G1/G20 ) + * | + * | + * | --- Gcyc (soft link to /G1) + * / \ * / \ * G5 \ * (soft link G6 (external link /G1 in FILENAME4) @@ -1901,7 +1904,7 @@ static int test_valid_path(void) goto out; /* - * Create a group named "/G3/G5" in the file. + * Create a hard link */ if(H5Lcreate_hard(file_id, "/G2/DS4", file_id, "/G1/DS3",H5P_DEFAULT, H5P_DEFAULT)<0) goto out; @@ -1917,6 +1920,12 @@ static int test_valid_path(void) if(H5Lcreate_soft("/G2", file_id, "/G1/G2/G5", H5P_DEFAULT, H5P_DEFAULT)<0) goto out; + /* + * Create a cyclic soft link + */ + if(H5Lcreate_soft("/G1", file_id, "/G1/G2/Gcyc", H5P_DEFAULT, H5P_DEFAULT)<0) + goto out; + if(H5Gclose(group)<0) goto out; @@ -2007,6 +2016,12 @@ static int test_valid_path(void) if( (path_valid = H5LTpath_valid(file_id, "/G1/G2/G5", TRUE)) != TRUE) goto out; + if( (path_valid = H5LTpath_valid(file_id, "/G1/G2/Gcyc/DS1", FALSE)) != TRUE) + goto out; + + if( (path_valid = H5LTpath_valid(file_id, "/G1/G2/Gcyc/DS1", TRUE)) != TRUE) + goto out; + if( (path_valid = H5LTpath_valid(file_id, "/G2", TRUE)) != TRUE) goto out; @@ -2092,6 +2107,12 @@ static int test_valid_path(void) if( (path_valid = H5LTpath_valid(file_id, "/G1/G2/G6/ExternalLink", TRUE)) != TRUE) goto out; + if( (path_valid = H5LTpath_valid(file_id, "/G1/G2/Gcyc/G2/G6/ExternalLink/DS1", TRUE)) != TRUE) + goto out; + + if( (path_valid = H5LTpath_valid(file_id, "/G1/G2/Gcyc/G2/G6/ExternalLink/G20", FALSE)) != TRUE) + goto out; + if( (path_valid = H5LTpath_valid(file_id, "/G1/G2/G6/ExternalLink/DS1", TRUE)) != TRUE) goto out; @@ -2102,6 +2123,10 @@ static int test_valid_path(void) if( (path_valid = H5LTpath_valid(file_id, "/G1/G2/G6/ExternalLink/G20", TRUE)) == TRUE) goto out; + if( (path_valid = H5LTpath_valid(file_id, "/G1/G2/Gcyc/G2/G6/ExternalLink/G20", TRUE)) == TRUE) + goto out; + + if(H5Fclose(file_id)<0) goto out; -- cgit v0.12 From 2c428c1bd7e168795035af74e6ca582ba13983b1 Mon Sep 17 00:00:00 2001 From: HDF Tester Date: Tue, 20 Mar 2012 08:00:55 -0500 Subject: [svn-r22097] Snapshot version 1.9 release 111 --- README.txt | 2 +- c++/src/Makefile.in | 2 +- config/lt_vers.am | 2 +- configure | 24 ++++++++++++------------ configure.in | 2 +- fortran/src/Makefile.in | 2 +- hl/c++/src/Makefile.in | 2 +- hl/fortran/src/Makefile.in | 2 +- hl/src/Makefile.in | 2 +- release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 ++-- src/Makefile.in | 2 +- vms/src/h5pubconf.h | 6 +++--- windows/src/H5pubconf.h | 6 +++--- 14 files changed, 30 insertions(+), 30 deletions(-) diff --git a/README.txt b/README.txt index 8ee01cf..1934e39 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.111 currently under development +HDF5 version 1.9.112 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index f3e8e5d..159bbf6 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -431,7 +431,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 101 +LT_VERS_REVISION = 102 LT_VERS_AGE = 0 # Include src directory diff --git a/config/lt_vers.am b/config/lt_vers.am index c137d57..daf5dc6 100644 --- a/config/lt_vers.am +++ b/config/lt_vers.am @@ -17,7 +17,7 @@ # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 101 +LT_VERS_REVISION = 102 LT_VERS_AGE = 0 ## If the API changes *at all*, increment LT_VERS_INTERFACE and diff --git a/configure b/configure index d7029d2..c6f46b2 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh -# From configure.in Id: configure.in 22022 2012-03-04 15:34:49Z hdftest . +# From configure.in Id: configure.in 22040 2012-03-11 15:52:04Z hdftest . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for HDF5 1.9.111. +# Generated by GNU Autoconf 2.68 for HDF5 1.9.112. # # Report bugs to . # @@ -571,8 +571,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.9.111' -PACKAGE_STRING='HDF5 1.9.111' +PACKAGE_VERSION='1.9.112' +PACKAGE_STRING='HDF5 1.9.112' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1463,7 +1463,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures HDF5 1.9.111 to adapt to many kinds of systems. +\`configure' configures HDF5 1.9.112 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1533,7 +1533,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.9.111:";; + short | recursive ) echo "Configuration of HDF5 1.9.112:";; esac cat <<\_ACEOF @@ -1726,7 +1726,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.9.111 +HDF5 configure 1.9.112 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -2815,7 +2815,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by HDF5 $as_me 1.9.111, which was +It was created by HDF5 $as_me 1.9.112, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -3636,7 +3636,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.9.111' + VERSION='1.9.112' cat >>confdefs.h <<_ACEOF @@ -30611,7 +30611,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.9.111, which was +This file was extended by HDF5 $as_me 1.9.112, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -30677,7 +30677,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.9.111 +HDF5 config.status 1.9.112 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" @@ -33471,7 +33471,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.9.111 +HDF5 config.lt 1.9.112 configured by $0, generated by GNU Autoconf 2.68. Copyright (C) 2010 Free Software Foundation, Inc. diff --git a/configure.in b/configure.in index 5e81022..6be679a 100644 --- a/configure.in +++ b/configure.in @@ -26,7 +26,7 @@ dnl dnl NOTE: Don't forget to change the version number here when we do a dnl release!!! dnl -AC_INIT([HDF5], [1.9.111], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.9.112], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AM_CONFIG_HEADER([src/H5config.h]) diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index 0ccaf33..35fafee 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -478,7 +478,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 101 +LT_VERS_REVISION = 102 LT_VERS_AGE = 0 # Include src directory in both Fortran and C flags (C compiler is used diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index d9db5de..6dae65a 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -421,7 +421,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 101 +LT_VERS_REVISION = 102 LT_VERS_AGE = 0 # Include src directory diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index 4056a1b..62d7309 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -436,7 +436,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 101 +LT_VERS_REVISION = 102 LT_VERS_AGE = 0 INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/hl/src -I$(top_builddir)/hl/src \ -I$(top_srcdir)/fortran/src -I$(top_builddir)/fortran/src diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index 3826215..2623b3a 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -420,7 +420,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 101 +LT_VERS_REVISION = 102 LT_VERS_AGE = 0 # This library is our main target. diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index d33a560..2726ff1 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.111 currently under development +HDF5 version 1.9.112 currently under development ================================================================================ diff --git a/src/H5public.h b/src/H5public.h index 6a03972..1f44ff3 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -75,10 +75,10 @@ extern "C" { /* Version numbers */ #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 9 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 111 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 112 /* For tweaks, bug-fixes, or development */ #define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.9.111" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.9.112" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) diff --git a/src/Makefile.in b/src/Makefile.in index 1a1fb03..64e5cdc 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -484,7 +484,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 101 +LT_VERS_REVISION = 102 LT_VERS_AGE = 0 H5detect_CFLAGS = -g $(AM_CFLAGS) diff --git a/vms/src/h5pubconf.h b/vms/src/h5pubconf.h index 7e0334d..4a2d8c4 100644 --- a/vms/src/h5pubconf.h +++ b/vms/src/h5pubconf.h @@ -502,7 +502,7 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.111" +#define H5_PACKAGE_STRING "HDF5 1.9.112" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" @@ -511,7 +511,7 @@ #define H5_PACKAGE_URL "" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.111" +#define H5_PACKAGE_VERSION "1.9.112" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "ll" @@ -674,7 +674,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.111" +#define H5_VERSION "1.9.112" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ diff --git a/windows/src/H5pubconf.h b/windows/src/H5pubconf.h index 849c22e..ade2790 100644 --- a/windows/src/H5pubconf.h +++ b/windows/src/H5pubconf.h @@ -527,7 +527,7 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.111" +#define H5_PACKAGE_STRING "HDF5 1.9.112" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" @@ -536,7 +536,7 @@ #define H5_PACKAGE_URL "" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.111" +#define H5_PACKAGE_VERSION "1.9.112" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "I64" @@ -707,7 +707,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.111" +#define H5_VERSION "1.9.112" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ -- cgit v0.12 From be410798d056b29d8e6574d05d2d11b35b4d6c66 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 20 Mar 2012 08:50:03 -0500 Subject: [svn-r22098] Add reference file extensions in new tests. Remove "STAR" test as some platforms vary in interpretation. --- tools/h5dump/testh5dump.sh.in | 6 +++--- tools/h5ls/testh5ls.sh.in | 40 ++++++++++++++++++++-------------------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in index 68052a6..25a30c5 100644 --- a/tools/h5dump/testh5dump.sh.in +++ b/tools/h5dump/testh5dump.sh.in @@ -799,9 +799,9 @@ TOOLTEST tarray7.ddl --enable-error-stack tarray7.h5 TOOLTEST tarray8.ddl --enable-error-stack tarray8.h5 # test for wildcards in filename (does not work with cmake) -TOOLTEST3 tstarfile --enable-error-stack -H -d Dataset1 tarr*.h5 -TOOLTEST3 tqmarkfile --enable-error-stack -H -d Dataset1 tarray?.h5 -TOOLTEST tmultifile --enable-error-stack -H -d Dataset1 tarray2.h5 tarray3.h5 tarray4.h5 tarray5.h5 tarray6.h5 tarray7.h5 +# inconsistent across platforms TOOLTEST3 tstarfile.ddl --enable-error-stack -H -d Dataset1 tarr*.h5 +TOOLTEST3 tqmarkfile.ddl --enable-error-stack -H -d Dataset1 tarray?.h5 +TOOLTEST tmultifile.ddl --enable-error-stack -H -d Dataset1 tarray2.h5 tarray3.h5 tarray4.h5 tarray5.h5 tarray6.h5 tarray7.h5 # test for files with empty data TOOLTEST tempty.ddl --enable-error-stack tempty.h5 diff --git a/tools/h5ls/testh5ls.sh.in b/tools/h5ls/testh5ls.sh.in index 23b4ab3..d6f6d12 100644 --- a/tools/h5ls/testh5ls.sh.in +++ b/tools/h5ls/testh5ls.sh.in @@ -25,7 +25,7 @@ H5LS_BIN=`pwd`/$H5LS # The path of the tool binary CMP='cmp -s' DIFF='diff -c' CP='cp' -NLINES=20 # Max. lines of output to display if test fails +NLINES=20 # Max. lines of output to display if test fails WORDS_BIGENDIAN="@WORDS_BIGENDIAN@" @@ -211,7 +211,7 @@ TOOLTEST() { # any unexpected output from that stream too. TESTING $H5LS $@ ( - cd $TESTDIR + cd $TESTDIR $RUNSERIAL $H5LS_BIN "$@" ) >$actual 2>$actual_err @@ -223,37 +223,37 @@ TOOLTEST() { STDERR_FILTER $actual_err cat $actual_err >> $actual if [ $h5haveexitcode = 'yes' -a $exitcode -ne $retvalexpect ]; then - echo "*FAILED*" - nerrors="`expr $nerrors + 1`" - if [ yes = "$verbose" ]; then - echo "test returned with exit code $exitcode" - echo "test output: (up to $NLINES lines)" - head -$NLINES $actual - echo "***end of test output***" - echo "" - fi + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + if [ yes = "$verbose" ]; then + echo "test returned with exit code $exitcode" + echo "test output: (up to $NLINES lines)" + head -$NLINES $actual + echo "***end of test output***" + echo "" + fi elif [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. + # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect elif $CMP $expect $actual; then echo " PASSED" else echo "*FAILED*" - echo " Expected result differs from actual result" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + echo " Expected result differs from actual result" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err $actual_sav $actual_err_sav + rm -f $actual $actual_err $actual_sav $actual_err_sav fi } ############################################################################## ############################################################################## -### T H E T E S T S ### +### T H E T E S T S ### ############################################################################## ############################################################################## # prepare for test @@ -325,9 +325,9 @@ TOOLTEST thlinks-nodangle-1.ls 0 -w80 --follow-symlinks --no-dangling-links thli # test for wildcards in filename (does not work with cmake) # this h5ls test script does not pass the filename properly like the h5dump test script??? -#TOOLTEST tstarfile 0 -w80 t*link.h5 -#TOOLTEST tqmarkfile 0 -w80 t?link.h5 -TOOLTEST tmultifile 0 -w80 thlink.h5 tslink.h5 +#TOOLTEST tstarfile.ls 0 -w80 t*link.h5 +#TOOLTEST tqmarkfile.ls 0 -w80 t?link.h5 +TOOLTEST tmultifile.ls 0 -w80 thlink.h5 tslink.h5 # tests for hard links TOOLTEST thlink-1.ls 0 -w80 thlink.h5 -- cgit v0.12 From 9f18db936fcb588325bfb63a60a6804972d91d70 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 20 Mar 2012 16:42:38 -0500 Subject: [svn-r22103] Fix for HDFFV-7769 (HDF5 tests time out on Windows when core VFD is set). This occurs due to the istore test creating very large files on systems which do not have POSIX-like sparse file semantics. The large amount of I/O causes the test to run for a very long period of time. The fix was to copy the "big" test's sparse file check and only run the largest sparse file test when POSIX-like sparse file semantics are found. Tested on: jam (nfs) ostrich (nfs) loyalty (ufs) 64-bit linux VM (ext4) 64-bit OS-X Lion (hfs, detected as not POSIX sparse) 64-bit Windows 7 (NTFS, detected as not POSIX sparse) The OS-X failure to pass the sparse check is likely an error and will be entered as a new bug. --- test/istore.c | 48 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/test/istore.c b/test/istore.c index 3ae8da7..0c970bc 100644 --- a/test/istore.c +++ b/test/istore.c @@ -54,6 +54,42 @@ hsize_t zero[H5O_LAYOUT_NDIMS]; /*------------------------------------------------------------------------- + * Function: is_sparse + * + * Purpose: Determines if the file system of the current working + * directory supports holes. + * + * Return: Success: Non-zero if holes are supported; zero + * otherwise. + * + * Failure: zero + * + * Programmer: Robb Matzke + * Wednesday, July 15, 1998 + * + *------------------------------------------------------------------------- + */ +static int +is_sparse(void) +{ + int fd; + h5_stat_t sb; + + if ((fd=HDopen("x.h5", O_RDWR|O_TRUNC|O_CREAT, 0666)) < 0) return 0; + if (HDlseek(fd, (off_t)(1024*1024), SEEK_SET)!=1024*1024) return 0; + if (5!=HDwrite(fd, "hello", (size_t)5)) return 0; + if (HDclose(fd) < 0) return 0; + if (HDstat("x.h5", &sb) < 0) return 0; + if (HDremove("x.h5") < 0) return 0; +#ifdef H5_HAVE_STAT_ST_BLOCKS + return ((unsigned long)sb.st_blocks*512 < (unsigned long)sb.st_size); +#else + return (0); +#endif +} + + +/*------------------------------------------------------------------------- * Function: print_array * * Purpose: Prints the values in an array @@ -565,6 +601,7 @@ main(int argc, char *argv[]) unsigned size_of_test; unsigned u; /* Local index variable */ char filename[1024]; + int has_sparse_support = 0; /* Parse arguments or assume these tests (`small', `medium' ) */ if (1 == argc) { @@ -598,6 +635,12 @@ main(int argc, char *argv[]) /* Set the random # seed */ HDsrandom((unsigned)HDtime(NULL)); + /* Check to see if the file system supports POSIX-style sparse files. + * Windows NTFS does not, so we want to avoid tests which create + * very large files. + */ + has_sparse_support = is_sparse(); + /* Reset library */ h5_reset(); fapl = h5_fileaccess(); @@ -656,7 +699,10 @@ main(int argc, char *argv[]) status = test_sparse(file, "sparse", (size_t)2000, (size_t)4, (size_t)2, (size_t)3); nerrors += status < 0 ? 1 : 0; } - if (size_of_test & TEST_LARGE) { + if (has_sparse_support && size_of_test & TEST_LARGE) { + /* This test is skipped if there is no POSIX-style sparse file support + * e.g.: Windows NTFS filesystems + */ status = test_sparse(file, "sparse", (size_t)800, (size_t)50, (size_t)50, (size_t)50); nerrors += status < 0 ? 1 : 0; } -- cgit v0.12 From 26cab92853adc480d0d72bd845fafa229a97becc Mon Sep 17 00:00:00 2001 From: Jonathan Kim Date: Wed, 21 Mar 2012 13:56:36 -0500 Subject: [svn-r22108] Purpose: HDFFV-7523 JPSS: h5dump fails to open an attribute when using the -a option to specify an attribute with a slash in the name Description: Update command line help page and test generating file. Previous commits: r22052, r22063 Tested: jam (linux32-LE), koala (linux64-LE), cmake (jam) --- tools/h5dump/h5dump.c | 7 +++++++ tools/h5dump/h5dumpgentest.c | 2 +- tools/testfiles/h5dump-help.txt | 7 +++++++ tools/testfiles/tnofilename-with-packed-bits.ddl | 7 +++++++ tools/testfiles/tpbitsIncomplete.ddl | 7 +++++++ tools/testfiles/tpbitsLengthExceeded.ddl | 7 +++++++ tools/testfiles/tpbitsLengthPositive.ddl | 7 +++++++ tools/testfiles/tpbitsMaxExceeded.ddl | 7 +++++++ tools/testfiles/tpbitsOffsetExceeded.ddl | 7 +++++++ tools/testfiles/tpbitsOffsetNegative.ddl | 7 +++++++ 10 files changed, 64 insertions(+), 1 deletion(-) diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c index 650846a..2799d95 100644 --- a/tools/h5dump/h5dump.c +++ b/tools/h5dump/h5dump.c @@ -243,6 +243,9 @@ usage(const char *prog) HDfprintf(rawoutstream, " -e, --escape Escape non printing characters\n"); HDfprintf(rawoutstream, " -V, --version Print version number and exit\n"); HDfprintf(rawoutstream, " -a P, --attribute=P Print the specified attribute\n"); + HDfprintf(rawoutstream, " If an attribute name contains a slash (/), escape the\n"); + HDfprintf(rawoutstream, " slash with a preceding backslash (\\).\n"); + HDfprintf(rawoutstream, " (See example section below.)\n"); HDfprintf(rawoutstream, " -d P, --dataset=P Print the specified dataset\n"); HDfprintf(rawoutstream, " -y, --noindex Do not print array indices with the data\n"); HDfprintf(rawoutstream, " -p, --properties Print dataset filters, storage layout and fill value\n"); @@ -316,6 +319,10 @@ usage(const char *prog) HDfprintf(rawoutstream, "\n"); HDfprintf(rawoutstream, " h5dump -a /bar_none/foo quux.h5\n"); HDfprintf(rawoutstream, "\n"); + HDfprintf(rawoutstream, " Attribute \"high/low\" of the group /bar_none in the file quux.h5\n"); + HDfprintf(rawoutstream, "\n"); + HDfprintf(rawoutstream, " h5dump -a \"/bar_none/high\\/low\" quux.h5\n"); + HDfprintf(rawoutstream, "\n"); HDfprintf(rawoutstream, " 2) Selecting a subset from dataset /foo in file quux.h5\n"); HDfprintf(rawoutstream, "\n"); HDfprintf(rawoutstream, " h5dump -d /foo -s \"0,1\" -S \"1,1\" -c \"2,3\" -k \"2,2\" quux.h5\n"); diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c index 5b97434..b28f3de 100644 --- a/tools/h5dump/h5dumpgentest.c +++ b/tools/h5dump/h5dumpgentest.c @@ -426,7 +426,7 @@ gent_attribute(void) /* attribute 1 */ dims[0] = 24; space = H5Screate_simple(1, dims, NULL); - attr = H5Acreate2(root, "attr1", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT); + attr = H5Acreate2(root, "/attr1", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT); sprintf(buf, "attribute of root group"); H5Awrite(attr, H5T_NATIVE_SCHAR, buf); H5Sclose(space); diff --git a/tools/testfiles/h5dump-help.txt b/tools/testfiles/h5dump-help.txt index f04ed48..d8551ca 100644 --- a/tools/testfiles/h5dump-help.txt +++ b/tools/testfiles/h5dump-help.txt @@ -10,6 +10,9 @@ usage: h5dump [OPTIONS] files -e, --escape Escape non printing characters -V, --version Print version number and exit -a P, --attribute=P Print the specified attribute + If an attribute name contains a slash (/), escape the + slash with a preceding backslash (\). + (See example section below.) -d P, --dataset=P Print the specified dataset -y, --noindex Do not print array indices with the data -p, --properties Print dataset filters, storage layout and fill value @@ -81,6 +84,10 @@ usage: h5dump [OPTIONS] files h5dump -a /bar_none/foo quux.h5 + Attribute "high/low" of the group /bar_none in the file quux.h5 + + h5dump -a "/bar_none/high\/low" quux.h5 + 2) Selecting a subset from dataset /foo in file quux.h5 h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5 diff --git a/tools/testfiles/tnofilename-with-packed-bits.ddl b/tools/testfiles/tnofilename-with-packed-bits.ddl index d3b12e3..050a3a3 100644 --- a/tools/testfiles/tnofilename-with-packed-bits.ddl +++ b/tools/testfiles/tnofilename-with-packed-bits.ddl @@ -10,6 +10,9 @@ usage: h5dump [OPTIONS] files -e, --escape Escape non printing characters -V, --version Print version number and exit -a P, --attribute=P Print the specified attribute + If an attribute name contains a slash (/), escape the + slash with a preceding backslash (\). + (See example section below.) -d P, --dataset=P Print the specified dataset -y, --noindex Do not print array indices with the data -p, --properties Print dataset filters, storage layout and fill value @@ -81,6 +84,10 @@ usage: h5dump [OPTIONS] files h5dump -a /bar_none/foo quux.h5 + Attribute "high/low" of the group /bar_none in the file quux.h5 + + h5dump -a "/bar_none/high\/low" quux.h5 + 2) Selecting a subset from dataset /foo in file quux.h5 h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5 diff --git a/tools/testfiles/tpbitsIncomplete.ddl b/tools/testfiles/tpbitsIncomplete.ddl index 0da055b..5608d2b 100644 --- a/tools/testfiles/tpbitsIncomplete.ddl +++ b/tools/testfiles/tpbitsIncomplete.ddl @@ -10,6 +10,9 @@ usage: h5dump [OPTIONS] files -e, --escape Escape non printing characters -V, --version Print version number and exit -a P, --attribute=P Print the specified attribute + If an attribute name contains a slash (/), escape the + slash with a preceding backslash (\). + (See example section below.) -d P, --dataset=P Print the specified dataset -y, --noindex Do not print array indices with the data -p, --properties Print dataset filters, storage layout and fill value @@ -81,6 +84,10 @@ usage: h5dump [OPTIONS] files h5dump -a /bar_none/foo quux.h5 + Attribute "high/low" of the group /bar_none in the file quux.h5 + + h5dump -a "/bar_none/high\/low" quux.h5 + 2) Selecting a subset from dataset /foo in file quux.h5 h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5 diff --git a/tools/testfiles/tpbitsLengthExceeded.ddl b/tools/testfiles/tpbitsLengthExceeded.ddl index 594d70c..f89b65f 100644 --- a/tools/testfiles/tpbitsLengthExceeded.ddl +++ b/tools/testfiles/tpbitsLengthExceeded.ddl @@ -10,6 +10,9 @@ usage: h5dump [OPTIONS] files -e, --escape Escape non printing characters -V, --version Print version number and exit -a P, --attribute=P Print the specified attribute + If an attribute name contains a slash (/), escape the + slash with a preceding backslash (\). + (See example section below.) -d P, --dataset=P Print the specified dataset -y, --noindex Do not print array indices with the data -p, --properties Print dataset filters, storage layout and fill value @@ -81,6 +84,10 @@ usage: h5dump [OPTIONS] files h5dump -a /bar_none/foo quux.h5 + Attribute "high/low" of the group /bar_none in the file quux.h5 + + h5dump -a "/bar_none/high\/low" quux.h5 + 2) Selecting a subset from dataset /foo in file quux.h5 h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5 diff --git a/tools/testfiles/tpbitsLengthPositive.ddl b/tools/testfiles/tpbitsLengthPositive.ddl index 7b3b678..ba32aa6 100644 --- a/tools/testfiles/tpbitsLengthPositive.ddl +++ b/tools/testfiles/tpbitsLengthPositive.ddl @@ -10,6 +10,9 @@ usage: h5dump [OPTIONS] files -e, --escape Escape non printing characters -V, --version Print version number and exit -a P, --attribute=P Print the specified attribute + If an attribute name contains a slash (/), escape the + slash with a preceding backslash (\). + (See example section below.) -d P, --dataset=P Print the specified dataset -y, --noindex Do not print array indices with the data -p, --properties Print dataset filters, storage layout and fill value @@ -81,6 +84,10 @@ usage: h5dump [OPTIONS] files h5dump -a /bar_none/foo quux.h5 + Attribute "high/low" of the group /bar_none in the file quux.h5 + + h5dump -a "/bar_none/high\/low" quux.h5 + 2) Selecting a subset from dataset /foo in file quux.h5 h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5 diff --git a/tools/testfiles/tpbitsMaxExceeded.ddl b/tools/testfiles/tpbitsMaxExceeded.ddl index 60bc2b1..16f953d 100644 --- a/tools/testfiles/tpbitsMaxExceeded.ddl +++ b/tools/testfiles/tpbitsMaxExceeded.ddl @@ -10,6 +10,9 @@ usage: h5dump [OPTIONS] files -e, --escape Escape non printing characters -V, --version Print version number and exit -a P, --attribute=P Print the specified attribute + If an attribute name contains a slash (/), escape the + slash with a preceding backslash (\). + (See example section below.) -d P, --dataset=P Print the specified dataset -y, --noindex Do not print array indices with the data -p, --properties Print dataset filters, storage layout and fill value @@ -81,6 +84,10 @@ usage: h5dump [OPTIONS] files h5dump -a /bar_none/foo quux.h5 + Attribute "high/low" of the group /bar_none in the file quux.h5 + + h5dump -a "/bar_none/high\/low" quux.h5 + 2) Selecting a subset from dataset /foo in file quux.h5 h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5 diff --git a/tools/testfiles/tpbitsOffsetExceeded.ddl b/tools/testfiles/tpbitsOffsetExceeded.ddl index 5db6a91..446fe2d 100644 --- a/tools/testfiles/tpbitsOffsetExceeded.ddl +++ b/tools/testfiles/tpbitsOffsetExceeded.ddl @@ -10,6 +10,9 @@ usage: h5dump [OPTIONS] files -e, --escape Escape non printing characters -V, --version Print version number and exit -a P, --attribute=P Print the specified attribute + If an attribute name contains a slash (/), escape the + slash with a preceding backslash (\). + (See example section below.) -d P, --dataset=P Print the specified dataset -y, --noindex Do not print array indices with the data -p, --properties Print dataset filters, storage layout and fill value @@ -81,6 +84,10 @@ usage: h5dump [OPTIONS] files h5dump -a /bar_none/foo quux.h5 + Attribute "high/low" of the group /bar_none in the file quux.h5 + + h5dump -a "/bar_none/high\/low" quux.h5 + 2) Selecting a subset from dataset /foo in file quux.h5 h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5 diff --git a/tools/testfiles/tpbitsOffsetNegative.ddl b/tools/testfiles/tpbitsOffsetNegative.ddl index 060fc37..747cf99 100644 --- a/tools/testfiles/tpbitsOffsetNegative.ddl +++ b/tools/testfiles/tpbitsOffsetNegative.ddl @@ -10,6 +10,9 @@ usage: h5dump [OPTIONS] files -e, --escape Escape non printing characters -V, --version Print version number and exit -a P, --attribute=P Print the specified attribute + If an attribute name contains a slash (/), escape the + slash with a preceding backslash (\). + (See example section below.) -d P, --dataset=P Print the specified dataset -y, --noindex Do not print array indices with the data -p, --properties Print dataset filters, storage layout and fill value @@ -81,6 +84,10 @@ usage: h5dump [OPTIONS] files h5dump -a /bar_none/foo quux.h5 + Attribute "high/low" of the group /bar_none in the file quux.h5 + + h5dump -a "/bar_none/high\/low" quux.h5 + 2) Selecting a subset from dataset /foo in file quux.h5 h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5 -- cgit v0.12 From 8de7487ffd5964a7d4acbd24acccc41d700fcccc Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 21 Mar 2012 14:40:02 -0500 Subject: [svn-r22109] Removed the executable flag from the COPYING file. --- hl/test/COPYING | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 hl/test/COPYING diff --git a/hl/test/COPYING b/hl/test/COPYING old mode 100755 new mode 100644 -- cgit v0.12 From 48688a2dbcfd9ffdd5a956cd6f4a044f458aa431 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 21 Mar 2012 14:50:28 -0500 Subject: [svn-r22110] Removed incorrect 'executable' svn properties. --- test/COPYING | 0 test/corrupt_stab_msg.h5 | Bin test/cross_read.c | 0 test/gen_cross.c | 0 test/reserved.c | 0 5 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 test/COPYING mode change 100755 => 100644 test/corrupt_stab_msg.h5 mode change 100755 => 100644 test/cross_read.c mode change 100755 => 100644 test/gen_cross.c mode change 100755 => 100644 test/reserved.c diff --git a/test/COPYING b/test/COPYING old mode 100755 new mode 100644 diff --git a/test/corrupt_stab_msg.h5 b/test/corrupt_stab_msg.h5 old mode 100755 new mode 100644 diff --git a/test/cross_read.c b/test/cross_read.c old mode 100755 new mode 100644 diff --git a/test/gen_cross.c b/test/gen_cross.c old mode 100755 new mode 100644 diff --git a/test/reserved.c b/test/reserved.c old mode 100755 new mode 100644 -- cgit v0.12 From ada561507a68ad41b71c0d891974e6f7a97fa2a8 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 21 Mar 2012 15:01:10 -0500 Subject: [svn-r22111] Removed incorrect 'executable' svn properties. --- test/objcopy.c | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 test/objcopy.c diff --git a/test/objcopy.c b/test/objcopy.c old mode 100755 new mode 100644 -- cgit v0.12 From b7d9ed39c22b616c7da48323c03531e122670ebc Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Wed, 21 Mar 2012 15:25:52 -0500 Subject: [svn-r22112] Description: Minor code safety issue in test/fheap.c and whitespace in other files. Tested on: Mac OSX/64 10.7.3 (amazon) w/debug (Too minor to require h5committest) --- src/H5HF.c | 1 - test/fheap.c | 13 ++++++++++--- tools/h5ls/testh5ls.sh.in | 32 ++++++++++++++++---------------- 3 files changed, 26 insertions(+), 20 deletions(-) diff --git a/src/H5HF.c b/src/H5HF.c index 801fa8c..9c911fd 100644 --- a/src/H5HF.c +++ b/src/H5HF.c @@ -361,7 +361,6 @@ H5HF_insert(H5HF_t *fh, hid_t dxpl_id, size_t size, const void *obj, herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI(FAIL) - #ifdef QAK HDfprintf(stderr, "%s: size = %Zu\n", FUNC, size); #endif /* QAK */ diff --git a/test/fheap.c b/test/fheap.c index 2cb8796..14cfbe8 100644 --- a/test/fheap.c +++ b/test/fheap.c @@ -415,13 +415,20 @@ add_obj(H5HF_t *fh, hid_t dxpl, size_t obj_off, if(keep_ids) { /* Check for needing to increase size of heap ID array */ if(keep_ids->num_ids + 1 > keep_ids->alloc_ids) { + unsigned char *tmp_ids; + size_t *tmp_lens; + size_t *tmp_offs; + keep_ids->alloc_ids = MAX(1024, (keep_ids->alloc_ids * 2)); - if(NULL == (keep_ids->ids = (unsigned char *)H5MM_realloc(keep_ids->ids, id_len * keep_ids->alloc_ids))) + if(NULL == (tmp_ids = (unsigned char *)H5MM_realloc(keep_ids->ids, id_len * keep_ids->alloc_ids))) TEST_ERROR - if(NULL == (keep_ids->lens = (size_t *)H5MM_realloc(keep_ids->lens, sizeof(size_t) * keep_ids->alloc_ids))) + keep_ids->ids = tmp_ids; + if(NULL == (tmp_lens = (size_t *)H5MM_realloc(keep_ids->lens, sizeof(size_t) * keep_ids->alloc_ids))) TEST_ERROR - if(NULL == (keep_ids->offs = (size_t *)H5MM_realloc(keep_ids->offs, sizeof(size_t) * keep_ids->alloc_ids))) + keep_ids->lens = tmp_lens; + if(NULL == (tmp_offs = (size_t *)H5MM_realloc(keep_ids->offs, sizeof(size_t) * keep_ids->alloc_ids))) TEST_ERROR + keep_ids->offs = tmp_offs; } /* end if */ /* Append the object info onto the array */ diff --git a/tools/h5ls/testh5ls.sh.in b/tools/h5ls/testh5ls.sh.in index d6f6d12..110c651 100644 --- a/tools/h5ls/testh5ls.sh.in +++ b/tools/h5ls/testh5ls.sh.in @@ -211,7 +211,7 @@ TOOLTEST() { # any unexpected output from that stream too. TESTING $H5LS $@ ( - cd $TESTDIR + cd $TESTDIR $RUNSERIAL $H5LS_BIN "$@" ) >$actual 2>$actual_err @@ -223,37 +223,37 @@ TOOLTEST() { STDERR_FILTER $actual_err cat $actual_err >> $actual if [ $h5haveexitcode = 'yes' -a $exitcode -ne $retvalexpect ]; then - echo "*FAILED*" - nerrors="`expr $nerrors + 1`" - if [ yes = "$verbose" ]; then - echo "test returned with exit code $exitcode" - echo "test output: (up to $NLINES lines)" - head -$NLINES $actual - echo "***end of test output***" - echo "" - fi + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + if [ yes = "$verbose" ]; then + echo "test returned with exit code $exitcode" + echo "test output: (up to $NLINES lines)" + head -$NLINES $actual + echo "***end of test output***" + echo "" + fi elif [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. + # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect elif $CMP $expect $actual; then echo " PASSED" else echo "*FAILED*" - echo " Expected result differs from actual result" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + echo " Expected result differs from actual result" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err $actual_sav $actual_err_sav + rm -f $actual $actual_err $actual_sav $actual_err_sav fi } ############################################################################## ############################################################################## -### T H E T E S T S ### +### T H E T E S T S ### ############################################################################## ############################################################################## # prepare for test -- cgit v0.12 From d476ce138bbb78d3f7bf22a21172724f6519a1cf Mon Sep 17 00:00:00 2001 From: Jonathan Kim Date: Wed, 21 Mar 2012 16:00:15 -0500 Subject: [svn-r22114] Purpose: Fix for HDFFV-7837 - h5diff: incorrect behavior with exclude-path option when unique object exist only in one file Description: If unique objects exists only in one file and try to exclude the unique objects with --exclude-path option, h5diff missed excluding some objects. Fixed to exclude objects correctly in such case. Test cases were added and tagged with jira#. Tested: jam (linux32-LE), koala (linux64-LE), ostrich (linuxppc64-BE), tejeda (mac32-LE), linew (solaris-BE), Windows (32-LE cmake), Cmake (jam) --- MANIFEST | 5 ++ release_docs/RELEASE.txt | 5 ++ tools/h5diff/CMakeLists.txt | 18 +++++ tools/h5diff/h5diffgentest.c | 100 +++++++++++++++++++++++++++- tools/h5diff/testfiles/h5diff_485.txt | 11 +++ tools/h5diff/testfiles/h5diff_486.txt | 11 +++ tools/h5diff/testfiles/h5diff_487.txt | 12 ++++ tools/h5diff/testfiles/h5diff_exclude3-1.h5 | Bin 0 -> 4792 bytes tools/h5diff/testfiles/h5diff_exclude3-2.h5 | Bin 0 -> 2176 bytes tools/h5diff/testh5diff.sh | 11 +++ tools/lib/h5diff.c | 19 ++++-- 11 files changed, 184 insertions(+), 8 deletions(-) create mode 100644 tools/h5diff/testfiles/h5diff_485.txt create mode 100644 tools/h5diff/testfiles/h5diff_486.txt create mode 100644 tools/h5diff/testfiles/h5diff_487.txt create mode 100644 tools/h5diff/testfiles/h5diff_exclude3-1.h5 create mode 100644 tools/h5diff/testfiles/h5diff_exclude3-2.h5 diff --git a/MANIFEST b/MANIFEST index ddf5423..fe3a612 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1862,6 +1862,9 @@ ./tools/h5diff/testfiles/h5diff_482.txt ./tools/h5diff/testfiles/h5diff_483.txt ./tools/h5diff/testfiles/h5diff_484.txt +./tools/h5diff/testfiles/h5diff_485.txt +./tools/h5diff/testfiles/h5diff_486.txt +./tools/h5diff/testfiles/h5diff_487.txt ./tools/h5diff/testfiles/h5diff_500.txt ./tools/h5diff/testfiles/h5diff_501.txt ./tools/h5diff/testfiles/h5diff_502.txt @@ -1916,6 +1919,8 @@ ./tools/h5diff/testfiles/h5diff_exclude1-2.h5 ./tools/h5diff/testfiles/h5diff_exclude2-1.h5 ./tools/h5diff/testfiles/h5diff_exclude2-2.h5 +./tools/h5diff/testfiles/h5diff_exclude3-1.h5 +./tools/h5diff/testfiles/h5diff_exclude3-2.h5 ./tools/h5diff/testfiles/h5diff_comp_vl_strs.h5 ./tools/h5diff/testfiles/h5diff_dset_zero_dim_size1.h5 ./tools/h5diff/testfiles/h5diff_dset_zero_dim_size2.h5 diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 2726ff1..f0f296c 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -666,6 +666,11 @@ Bug Fixes since HDF5-1.8.0 release Tools ----- + - h5diff: If unique objects exists only in one file and try to exclude + the unique objects with --exclude-path option, h5diff missed + excluding some objects. + Fixed to exclude objects correctly in such case. + HDFFV-7837 (JKM 2012/03/20) - h5dump: Added tools library error stack to properly catch error information generated within the library. HDFFV-7958 (ADB 2012/03/12) diff --git a/tools/h5diff/CMakeLists.txt b/tools/h5diff/CMakeLists.txt index f178f19..dfd1800 100644 --- a/tools/h5diff/CMakeLists.txt +++ b/tools/h5diff/CMakeLists.txt @@ -139,6 +139,9 @@ IF (BUILD_TESTING) h5diff_482.txt h5diff_483.txt h5diff_484.txt + h5diff_485.txt + h5diff_486.txt + h5diff_487.txt h5diff_50.txt h5diff_51.txt h5diff_52.txt @@ -253,6 +256,8 @@ IF (BUILD_TESTING) h5diff_exclude1-2.h5 h5diff_exclude2-1.h5 h5diff_exclude2-2.h5 + h5diff_exclude3-1.h5 + h5diff_exclude3-2.h5 h5diff_comp_vl_strs.h5 h5diff_attr_v_level1.h5 h5diff_attr_v_level2.h5 @@ -490,6 +495,9 @@ IF (BUILD_TESTING) # different structure and obj names SET (EXCLUDE_FILE2_1 h5diff_exclude2-1.h5) SET (EXCLUDE_FILE2_2 h5diff_exclude2-2.h5) + # Only one file contains unique objs. Common objs are same. + SET (EXCLUDE_FILE3_1 h5diff_exclude3-1.h5) + SET (EXCLUDE_FILE3_2 h5diff_exclude3-2.h5) # compound type with multiple vlen string types SET (COMP_VL_STRS_FILE h5diff_comp_vl_strs.h5) # container types (array,vlen) with multiple nested compound types @@ -1359,6 +1367,16 @@ ADD_H5_TEST (h5diff_483 1 -v --exclude-path "/group1" ${EXCLUDE_FILE2_1} ${EXCLU # Exclude from group compare ADD_H5_TEST (h5diff_484 0 -v --exclude-path "/dset3" ${EXCLUDE_FILE1_1} ${EXCLUDE_FILE1_2} /group1) +# +# Only one file contains unique objs. Common objs are same. +# (HDFFV-7837) +# +ADD_H5_TEST (h5diff_485 0 -v --exclude-path "/group1" h5diff_exclude3-1.h5 h5diff_exclude3-2.h5) +ADD_H5_TEST (h5diff_486 0 -v --exclude-path "/group1" h5diff_exclude3-2.h5 h5diff_exclude3-1.h5) +ADD_H5_TEST (h5diff_487 1 -v --exclude-path "/group1/dset" h5diff_exclude3-1.h5 h5diff_exclude3-2.h5) + + + # ############################################################################## # # diff various multiple vlen and fixed strings in a compound type dataset # ############################################################################## diff --git a/tools/h5diff/h5diffgentest.c b/tools/h5diff/h5diffgentest.c index d58e1b4..b57c98a 100644 --- a/tools/h5diff/h5diffgentest.c +++ b/tools/h5diff/h5diffgentest.c @@ -77,6 +77,9 @@ hsize_t H5TOOLS_MALLOCSIZE = (128 * 1024 * 1024); /* different structure and obj names */ #define EXCLUDE_FILE2_1 "h5diff_exclude2-1.h5" #define EXCLUDE_FILE2_2 "h5diff_exclude2-2.h5" +/* only one file has unique objs */ +#define EXCLUDE_FILE3_1 "h5diff_exclude3-1.h5" +#define EXCLUDE_FILE3_2 "h5diff_exclude3-2.h5" /* compound type with multiple vlen string types */ #define COMP_VL_STRS_FILE "h5diff_comp_vl_strs.h5" /* attribute compre with verbose level */ @@ -144,6 +147,7 @@ static int test_group_recurse(const char *fname1, const char *fname2); static int test_group_recurse2(void); static int test_exclude_obj1(const char *fname1, const char *fname2); static int test_exclude_obj2(const char *fname1, const char *fname2); +static int test_exclude_obj3(const char *fname1, const char *fname2); static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int is_file_new); static int test_attributes_verbose_level(const char *fname1, const char *fname2); static int test_enums(const char *fname); @@ -213,6 +217,7 @@ int main(void) test_exclude_obj1(EXCLUDE_FILE1_1, EXCLUDE_FILE1_2); test_exclude_obj2(EXCLUDE_FILE2_1, EXCLUDE_FILE2_2); + test_exclude_obj3(EXCLUDE_FILE3_1, EXCLUDE_FILE3_2); /* diff various multiple vlen and fixlen string types in a compound dataset */ test_comp_vlen_strings(COMP_VL_STRS_FILE, "group", 1); @@ -3344,6 +3349,100 @@ out: /*------------------------------------------------------------------------- * +* Purpose: Create test files for excluding obj. +* Only one file contains unique objs. Common objs are same. +* Test : exclude unique objs to verify the rest are same +* - HDFFV-7837 +* +* Programmer: Jonathan Kim (Mar, 19, 2012) +* +*-------------------------------------------------------------------------*/ +static int test_exclude_obj3(const char *fname1, const char *fname2) +{ + hid_t fid1=0; + hid_t fid2=0; + hid_t gid1=0; + hsize_t dims2[2] = {2,4}; + int data1[4][2] = {{0,0},{0,0},{0,0},{0,0}}; + herr_t status = SUCCEED; + + /*----------------------------------------------------------------------- + * Create file(s) + *------------------------------------------------------------------------*/ + fid1 = H5Fcreate (fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + if (fid1 < 0) + { + fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); + status = FAIL; + goto out; + } + + fid2 = H5Fcreate (fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + if (fid2 < 0) + { + fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2); + status = FAIL; + goto out; + } + + + /*----------------------------------------------------------------------- + * Group + *------------------------------------------------------------------------*/ + /* file1 */ + gid1 = H5Gcreate2(fid1, "group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + if (gid1 < 0) + { + fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); + status = FAIL; + goto out; + } + + /*----------------------------------------------------------------------- + * Datasets + *------------------------------------------------------------------------*/ + /* file1 */ + status = write_dset(fid1,2,dims2,"dset1",H5T_NATIVE_INT,data1); + if (status == FAIL) + { + fprintf(stderr, "Error: %s> write_dset failed\n", fname1); + status = FAIL; + goto out; + } + + status = write_dset(gid1,2,dims2,"dset",H5T_NATIVE_INT,data1); + if (status == FAIL) + { + fprintf(stderr, "Error: %s> write_dset failed\n", fname1); + status = FAIL; + goto out; + } + + /* file2 */ + status = write_dset(fid2,2,dims2,"dset1",H5T_NATIVE_INT,data1); + if (status == FAIL) + { + fprintf(stderr, "Error: %s> write_dset failed\n", fname2); + status = FAIL; + goto out; + } + +out: + /*----------------------------------------------------------------------- + * Close + *-----------------------------------------------------------------------*/ + if(fid1) + H5Fclose(fid1); + if(fid2) + H5Fclose(fid2); + if(gid1) + H5Gclose(gid1); + + return status; +} + +/*------------------------------------------------------------------------- +* * Purpose: Create test files for multiple variable length string/string array * along with fixed length string/string array types in * a compound type dataset. @@ -4717,7 +4816,6 @@ static void test_non_comparables (const char * fname, int make_diffs) int rank_attr; char data1_str[DIM_ARRY][STR_SIZE]= {"ab","cd","ef"}; herr_t status = SUCCEED; - int i; void *dset_data_ptr1=NULL; void *dset_data_ptr2=NULL; void *dset_data_ptr3=NULL; diff --git a/tools/h5diff/testfiles/h5diff_485.txt b/tools/h5diff/testfiles/h5diff_485.txt new file mode 100644 index 0000000..4175809 --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_485.txt @@ -0,0 +1,11 @@ + +file1 file2 +--------------------------------------- + x x / + x x /dset1 + +group : and +0 differences found +dataset: and +0 differences found +EXIT CODE: 0 diff --git a/tools/h5diff/testfiles/h5diff_486.txt b/tools/h5diff/testfiles/h5diff_486.txt new file mode 100644 index 0000000..4175809 --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_486.txt @@ -0,0 +1,11 @@ + +file1 file2 +--------------------------------------- + x x / + x x /dset1 + +group : and +0 differences found +dataset: and +0 differences found +EXIT CODE: 0 diff --git a/tools/h5diff/testfiles/h5diff_487.txt b/tools/h5diff/testfiles/h5diff_487.txt new file mode 100644 index 0000000..8555a71 --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_487.txt @@ -0,0 +1,12 @@ + +file1 file2 +--------------------------------------- + x x / + x x /dset1 + x /group1 + +group : and +0 differences found +dataset: and +0 differences found +EXIT CODE: 1 diff --git a/tools/h5diff/testfiles/h5diff_exclude3-1.h5 b/tools/h5diff/testfiles/h5diff_exclude3-1.h5 new file mode 100644 index 0000000..f9cc83d Binary files /dev/null and b/tools/h5diff/testfiles/h5diff_exclude3-1.h5 differ diff --git a/tools/h5diff/testfiles/h5diff_exclude3-2.h5 b/tools/h5diff/testfiles/h5diff_exclude3-2.h5 new file mode 100644 index 0000000..f811905 Binary files /dev/null and b/tools/h5diff/testfiles/h5diff_exclude3-2.h5 differ diff --git a/tools/h5diff/testh5diff.sh b/tools/h5diff/testh5diff.sh index 2e2feb9..27fb253 100755 --- a/tools/h5diff/testh5diff.sh +++ b/tools/h5diff/testh5diff.sh @@ -111,6 +111,8 @@ $SRC_H5DIFF_TESTFILES/h5diff_exclude1-1.h5 $SRC_H5DIFF_TESTFILES/h5diff_exclude1-2.h5 $SRC_H5DIFF_TESTFILES/h5diff_exclude2-1.h5 $SRC_H5DIFF_TESTFILES/h5diff_exclude2-2.h5 +$SRC_H5DIFF_TESTFILES/h5diff_exclude3-1.h5 +$SRC_H5DIFF_TESTFILES/h5diff_exclude3-2.h5 $SRC_H5DIFF_TESTFILES/h5diff_comp_vl_strs.h5 $SRC_H5DIFF_TESTFILES/compounds_array_vlen1.h5 $SRC_H5DIFF_TESTFILES/compounds_array_vlen2.h5 @@ -1027,6 +1029,15 @@ TOOLTEST h5diff_483.txt -v --exclude-path "/group1" h5diff_exclude2-1.h5 h5diff_ # Exclude from group compare TOOLTEST h5diff_484.txt -v --exclude-path "/dset3" h5diff_exclude1-1.h5 h5diff_exclude1-2.h5 /group1 +# +# Only one file contains unique objs. Common objs are same. +# (HDFFV-7837) +# +TOOLTEST h5diff_485.txt -v --exclude-path "/group1" h5diff_exclude3-1.h5 h5diff_exclude3-2.h5 +TOOLTEST h5diff_486.txt -v --exclude-path "/group1" h5diff_exclude3-2.h5 h5diff_exclude3-1.h5 +TOOLTEST h5diff_487.txt -v --exclude-path "/group1/dset" h5diff_exclude3-1.h5 h5diff_exclude3-2.h5 + + # ############################################################################## # # diff various multiple vlen and fixed strings in a compound type dataset # ############################################################################## diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index c6353eb..cef30dd 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -270,12 +270,12 @@ static int is_exclude_path (char * path, h5trav_type_t type, diff_opt_t *options /* search objects in exclude list */ while (NULL != exclude_path_ptr) { - /* if given object is group, exclude its members as well */ + /* if exclude path is is group, exclude its members as well */ if (exclude_path_ptr->obj_type == H5TRAV_TYPE_GROUP) { ret_cmp = HDstrncmp(exclude_path_ptr->obj_path, path, HDstrlen(exclude_path_ptr->obj_path)); - if (ret_cmp == 0) + if (ret_cmp == 0) /* found matching members */ { /* check if given path belong to an excluding group, if so * exclude it as well. @@ -295,12 +295,13 @@ static int is_exclude_path (char * path, h5trav_type_t type, diff_opt_t *options else { ret_cmp = HDstrcmp(exclude_path_ptr->obj_path, path); - if (ret_cmp == 0) + if (ret_cmp == 0) /* found matching object */ { /* excluded non-group object */ ret = 1; - /* assign type as scan progress, which is sufficient to - * determine type for excluding groups from the above if. */ + /* remember the type of this maching object. + * if it's group, it can be used for excluding its member + * objects in this while() loop */ exclude_path_ptr->obj_type = type; break; /* while */ } @@ -443,9 +444,11 @@ static void build_match_list (const char *objname1, trav_info_t *info1, const ch infile[1] = 0; while(curr1 < info1->nused) { + path1_lp = (info1->paths[curr1].path) + path1_offset; + type1_l = info1->paths[curr1].type; + if(!is_exclude_path(path1_lp, type1_l, options)) { - path1_lp = (info1->paths[curr1].path) + path1_offset; trav_table_addflags(infile, path1_lp, info1->paths[curr1].type, table); } curr1++; @@ -456,9 +459,11 @@ static void build_match_list (const char *objname1, trav_info_t *info1, const ch infile[1] = 1; while(curr2 < info2->nused) { + path2_lp = (info2->paths[curr2].path) + path2_offset; + type2_l = info2->paths[curr2].type; + if (!is_exclude_path(path2_lp, type2_l, options)) { - path2_lp = (info2->paths[curr2].path) + path2_offset; trav_table_addflags(infile, path2_lp, info2->paths[curr2].type, table); } curr2++; -- cgit v0.12 From dd1b2c3208ecb4969ad854a65e2261bced518698 Mon Sep 17 00:00:00 2001 From: Mohamad Chaarawi Date: Wed, 21 Mar 2012 16:00:48 -0500 Subject: [svn-r22115] Add 2 new API routines to set/unset file atomicity for files opened with the MPI-IO VFD Add test cases for these two routines Jira issue HDFFV-7961 --- src/H5FDmpio.c | 94 +++++++++++++++ src/H5FDprivate.h | 4 + src/H5Fmpi.c | 82 +++++++++++++ src/H5Fpublic.h | 4 + testpar/t_dset.c | 325 ++++++++++++++++++++++++++++++++++++++++++++++++++++ testpar/testphdf5.c | 12 ++ testpar/testphdf5.h | 3 + 7 files changed, 524 insertions(+) diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index d780ceb..6dbe831 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -876,6 +876,100 @@ fprintf(stderr, "leaving H5FD_mpio_fapl_free\n"); /*------------------------------------------------------------------------- + * Function: H5FD_set_mpio_atomicity + * + * Purpose: Sets the atomicity mode + * + * Return: Success: Non-negative + * + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * Feb 14, 2012 + * + *------------------------------------------------------------------------- + */ +herr_t +H5FD_set_mpio_atomicity(H5FD_t *_file, hbool_t flag) +{ + H5FD_mpio_t *file = (H5FD_mpio_t*)_file; + int mpi_code; /* MPI return code */ + int temp_flag; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + +#ifdef H5FDmpio_DEBUG + if (H5FD_mpio_Debug[(int)'t']) + fprintf(stdout, "Entering H5FD_set_mpio_atomicity\n"); +#endif + + if (FALSE == flag) + temp_flag = 0; + else + temp_flag = 1; + + /* set atomicity value */ + if (MPI_SUCCESS != (mpi_code=MPI_File_set_atomicity(file->f, temp_flag))) + HMPI_GOTO_ERROR(FAIL, "MPI_File_set_atomicity", mpi_code) + +done: +#ifdef H5FDmpio_DEBUG + if (H5FD_mpio_Debug[(int)'t']) + fprintf(stdout, "Leaving H5FD_set_mpio_atomicity\n"); +#endif + FUNC_LEAVE_NOAPI(ret_value) +} + + +/*------------------------------------------------------------------------- + * Function: H5FD_get_mpio_atomicity + * + * Purpose: Returns the atomicity mode + * + * Return: Success: Non-negative + * + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * Feb 14, 2012 + * + *------------------------------------------------------------------------- + */ +herr_t +H5FD_get_mpio_atomicity(H5FD_t *_file, hbool_t *flag) +{ + H5FD_mpio_t *file = (H5FD_mpio_t*)_file; + int mpi_code; /* MPI return code */ + int temp_flag; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + +#ifdef H5FDmpio_DEBUG + if (H5FD_mpio_Debug[(int)'t']) + fprintf(stdout, "Entering H5FD_get_mpio_atomicity\n"); +#endif + + /* get atomicity value */ + if (MPI_SUCCESS != (mpi_code=MPI_File_get_atomicity(file->f, &temp_flag))) + HMPI_GOTO_ERROR(FAIL, "MPI_File_get_atomicity", mpi_code) + + if (0 != temp_flag) + *flag = TRUE; + else + *flag = FALSE; + +done: +#ifdef H5FDmpio_DEBUG + if (H5FD_mpio_Debug[(int)'t']) + fprintf(stdout, "Leaving H5FD_get_mpio_atomicity\n"); +#endif + FUNC_LEAVE_NOAPI(ret_value) +} + + +/*------------------------------------------------------------------------- * Function: H5FD_mpio_open * * Purpose: Opens a file with name NAME. The FLAGS are a bit field with diff --git a/src/H5FDprivate.h b/src/H5FDprivate.h index fe770d2..4f7d059 100644 --- a/src/H5FDprivate.h +++ b/src/H5FDprivate.h @@ -105,6 +105,10 @@ H5_DLL herr_t H5FD_get_fileno(const H5FD_t *file, unsigned long *filenum); H5_DLL herr_t H5FD_get_vfd_handle(H5FD_t *file, hid_t fapl, void** file_handle); H5_DLL herr_t H5FD_set_base_addr(H5FD_t *file, haddr_t base_addr); H5_DLL haddr_t H5FD_get_base_addr(const H5FD_t *file); +#ifdef H5_HAVE_PARALLEL +H5_DLL herr_t H5FD_set_mpio_atomicity(H5FD_t *file, hbool_t flag); +H5_DLL herr_t H5FD_get_mpio_atomicity(H5FD_t *file, hbool_t *flag); +#endif /* H5_HAVE_PARALLEL */ #endif /* !_H5FDprivate_H */ diff --git a/src/H5Fmpi.c b/src/H5Fmpi.c index 4fd04f6..0f612be 100644 --- a/src/H5Fmpi.c +++ b/src/H5Fmpi.c @@ -38,6 +38,8 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5Fpkg.h" /* File access */ #include "H5FDmpi.h" /* MPI-based file drivers */ +#include "H5FDprivate.h" /* File drivers */ +#include "H5Iprivate.h" /* IDs */ /****************/ @@ -177,5 +179,85 @@ H5F_mpi_get_size(const H5F_t *f) done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_mpi_get_size() */ + + +/*------------------------------------------------------------------------- + * Function: H5Fset_mpi_atomicity + * + * Purpose: Sets the atomicity mode + * + * Return: Success: Non-negative + * + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * Feb 14, 2012 + * + *------------------------------------------------------------------------- + */ +herr_t +H5Fset_mpi_atomicity(hid_t file_id, hbool_t flag) +{ + H5F_t *file; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_API(FAIL) + H5TRACE2("e", "iMi", file_id, flag); + + /* Check args */ + if(NULL == (file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID") + + /* Check VFD */ + if(!IS_H5FD_MPIO(file)) + HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "incorrect VFL driver, must use MPI-I/O driver") + + /* set atomicity value */ + if (H5FD_set_mpio_atomicity (file->shared->lf, flag) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set atomicity flag") + +done: + FUNC_LEAVE_API(ret_value) +} + + +/*------------------------------------------------------------------------- + * Function: H5Fget_mpi_atomicity + * + * Purpose: Returns the atomicity mode + * + * Return: Success: Non-negative + * + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * Feb 14, 2012 + * + *------------------------------------------------------------------------- + */ +herr_t +H5Fget_mpi_atomicity(hid_t file_id, hbool_t *flag) +{ + H5F_t *file; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_API(FAIL) + H5TRACE2("e", "iMi", file_id, flag); + + /* Check args */ + if(NULL == (file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID") + + /* Check VFD */ + if(!IS_H5FD_MPIO(file)) + HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "incorrect VFL driver, must use MPI-I/O driver") + + /* get atomicity value */ + if (H5FD_get_mpio_atomicity (file->shared->lf, flag) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get atomicity flag") + +done: + FUNC_LEAVE_API(ret_value) +} #endif /* H5_HAVE_PARALLEL */ diff --git a/src/H5Fpublic.h b/src/H5Fpublic.h index 75a3547..d88538b 100644 --- a/src/H5Fpublic.h +++ b/src/H5Fpublic.h @@ -208,6 +208,10 @@ H5_DLL herr_t H5Fget_info2(hid_t obj_id, H5F_info2_t *finfo); H5_DLL ssize_t H5Fget_free_sections(hid_t file_id, H5F_mem_t type, size_t nsects, H5F_sect_info_t *sect_info/*out*/); H5_DLL herr_t H5Fclear_elink_file_cache(hid_t file_id); +#ifdef H5_HAVE_PARALLEL +H5_DLL herr_t H5Fset_mpi_atomicity(hid_t file_id, hbool_t flag); +H5_DLL herr_t H5Fget_mpi_atomicity(hid_t file_id, hbool_t *flag); +#endif /* H5_HAVE_PARALLEL */ /* Symbols defined for compatibility with previous versions of the HDF5 API. * diff --git a/testpar/t_dset.c b/testpar/t_dset.c index d2f061d..33cf765 100644 --- a/testpar/t_dset.c +++ b/testpar/t_dset.c @@ -3047,3 +3047,328 @@ actual_io_mode_tests(void) { test_actual_io_mode(TEST_ACTUAL_IO_RESET); return; } + +/* + * Test consistency semantics of atomic mode + */ + +/* + * Example of using the parallel HDF5 library to create a dataset, + * where process 0 writes and the other processes read at the same + * time. If atomic mode is set correctly, the other processes should + * read the old values in the dataset or the new ones. + */ + +void +dataset_atomicity(void) +{ + hid_t fid; /* HDF5 file ID */ + hid_t acc_tpl; /* File access templates */ + hid_t sid; /* Dataspace ID */ + hid_t dataset1; /* Dataset IDs */ + hbool_t use_gpfs = FALSE; /* Use GPFS hints */ + hsize_t dims[RANK]; /* dataset dim sizes */ + int *write_buf = NULL; /* data buffer */ + int *read_buf = NULL; /* data buffer */ + int buf_size; + hid_t dataset2; + hid_t file_dataspace; /* File dataspace ID */ + hid_t mem_dataspace; /* Memory dataspace ID */ + hsize_t start[RANK]; + hsize_t stride[RANK]; + hsize_t count[RANK]; + hsize_t block[RANK]; + const char *filename; + herr_t ret; /* Generic return value */ + int mpi_size, mpi_rank; + int i, j, k; + hbool_t atomicity = FALSE; + MPI_Comm comm = MPI_COMM_WORLD; + MPI_Info info = MPI_INFO_NULL; + + dim0 = 64; dim1 = 32; + filename = GetTestParameters(); + if(VERBOSE_MED) + printf("Independent write test on file %s\n", filename); + + /* set up MPI parameters */ + MPI_Comm_size(MPI_COMM_WORLD,&mpi_size); + MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank); + + buf_size = dim0 * dim1; + /* allocate memory for data buffer */ + write_buf = (int *)calloc(buf_size, sizeof(int)); + VRFY((write_buf != NULL), "write_buf malloc succeeded"); + /* allocate memory for data buffer */ + read_buf = (int *)calloc(buf_size, sizeof(int)); + VRFY((read_buf != NULL), "read_buf malloc succeeded"); + + /* setup file access template */ + acc_tpl = create_faccess_plist(comm, info, facc_type, use_gpfs); + VRFY((acc_tpl >= 0), ""); + + /* create the file collectively */ + fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, acc_tpl); + VRFY((fid >= 0), "H5Fcreate succeeded"); + + /* Release file-access template */ + ret = H5Pclose(acc_tpl); + VRFY((ret >= 0), "H5Pclose succeeded"); + + /* setup dimensionality object */ + dims[0] = dim0; + dims[1] = dim1; + sid = H5Screate_simple (RANK, dims, NULL); + VRFY((sid >= 0), "H5Screate_simple succeeded"); + + /* create datasets */ + dataset1 = H5Dcreate2(fid, DATASETNAME5, H5T_NATIVE_INT, sid, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + VRFY((dataset1 >= 0), "H5Dcreate2 succeeded"); + + dataset2 = H5Dcreate2(fid, DATASETNAME6, H5T_NATIVE_INT, sid, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + VRFY((dataset2 >= 0), "H5Dcreate2 succeeded"); + + /* initialize datasets to 0s */ + if (0 == mpi_rank) { + ret = H5Dwrite(dataset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, + H5P_DEFAULT, write_buf); + VRFY((ret >= 0), "H5Dwrite dataset1 succeeded"); + + ret = H5Dwrite(dataset2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, + H5P_DEFAULT, write_buf); + VRFY((ret >= 0), "H5Dwrite dataset2 succeeded"); + } + + ret = H5Dclose(dataset1); + VRFY((ret >= 0), "H5Dclose succeeded"); + ret = H5Dclose(dataset2); + VRFY((ret >= 0), "H5Dclose succeeded"); + ret = H5Sclose(sid); + VRFY((ret >= 0), "H5Sclose succeeded"); + ret = H5Fclose(fid); + VRFY((ret >= 0), "H5Fclose succeeded"); + + MPI_Barrier (comm); + + /* make sure setting atomicity fails on a serial file ID */ + /* open the file collectively */ + fid=H5Fopen(filename,H5F_ACC_RDWR,H5P_DEFAULT); + VRFY((fid >= 0), "H5Fopen succeeed"); + + /* should fail */ + ret = H5Fset_mpi_atomicity (fid , TRUE); + VRFY((ret == FAIL), "H5Fset_mpi_atomicity failed"); + + ret = H5Fclose(fid); + VRFY((ret >= 0), "H5Fclose succeeded"); + + MPI_Barrier (comm); + + /* setup file access template */ + acc_tpl = create_faccess_plist(comm, info, facc_type, use_gpfs); + VRFY((acc_tpl >= 0), ""); + + /* open the file collectively */ + fid=H5Fopen(filename,H5F_ACC_RDWR,acc_tpl); + VRFY((fid >= 0), "H5Fopen succeeded"); + + /* Release file-access template */ + ret = H5Pclose(acc_tpl); + VRFY((ret >= 0), "H5Pclose succeeded"); + + ret = H5Fset_mpi_atomicity (fid , TRUE); + VRFY((ret >= 0), "H5Fset_mpi_atomicity succeeded"); + + /* open dataset1 (contiguous case) */ + dataset1 = H5Dopen2(fid, DATASETNAME5, H5P_DEFAULT); + VRFY((dataset1 >= 0), "H5Dopen2 succeeded"); + + if (0 == mpi_rank) { + for (i=0 ; i= 0), "atomcity get failed"); + VRFY((atomicity == TRUE), "atomcity set failed"); + + MPI_Barrier (comm); + + /* Process 0 writes contiguously to the entire dataset */ + if (0 == mpi_rank) { + ret = H5Dwrite(dataset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, write_buf); + VRFY((ret >= 0), "H5Dwrite dataset1 succeeded"); + } + /* The other processes read the entire dataset */ + else { + ret = H5Dread(dataset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, read_buf); + VRFY((ret >= 0), "H5Dwrite() dataset multichunk write succeeded"); + } + + if(VERBOSE_MED) { + i=0;j=0;k=0; + for (i=0 ; i= 0), "H5D close succeeded"); + + /* release data buffers */ + if(write_buf) free(write_buf); + if(read_buf) free(read_buf); + + /* open dataset2 (non-contiguous case) */ + dataset2 = H5Dopen2(fid, DATASETNAME6, H5P_DEFAULT); + VRFY((dataset2 >= 0), "H5Dopen2 succeeded"); + + /* allocate memory for data buffer */ + write_buf = (int *)calloc(buf_size, sizeof(int)); + VRFY((write_buf != NULL), "write_buf malloc succeeded"); + /* allocate memory for data buffer */ + read_buf = (int *)calloc(buf_size, sizeof(int)); + VRFY((read_buf != NULL), "read_buf malloc succeeded"); + + for (i=0 ; i= 0), "atomcity get failed"); + VRFY((atomicity == TRUE), "atomcity set failed"); + + + block[0] = dim0/mpi_size - 1; + block[1] = dim1/mpi_size - 1; + stride[0] = block[0] + 1; + stride[1] = block[1] + 1; + count[0] = mpi_size; + count[1] = mpi_size; + start[0] = 0; + start[1] = 0; + + /* create a file dataspace */ + file_dataspace = H5Dget_space (dataset2); + VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); + ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); + + /* create a memory dataspace */ + mem_dataspace = H5Screate_simple (RANK, dims, NULL); + VRFY((mem_dataspace >= 0), ""); + + ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block); + VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); + + MPI_Barrier (comm); + + /* Process 0 writes to the dataset */ + if (0 == mpi_rank) { + ret = H5Dwrite(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace, + H5P_DEFAULT, write_buf); + VRFY((ret >= 0), "H5Dwrite dataset2 succeeded"); + } + /* All processes wait for the write to finish. This works because + atomicity is set to true */ + MPI_Barrier (comm); + /* The other processes read the entire dataset */ + if (0 != mpi_rank) { + ret = H5Dread(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace, + H5P_DEFAULT, read_buf); + VRFY((ret >= 0), "H5Dread dataset2 succeeded"); + } + + if(VERBOSE_MED) { + if (mpi_rank == 1) { + i=0;j=0;k=0; + for (i=0 ; i= mpi_rank*(block[0]+1)) { + break; + } + if ((i+1)%(block[0]+1)==0) { + k += dim1; + continue; + } + for (j=0 ; j= mpi_rank*(block[1]+1)) { + k += dim1 - mpi_rank*(block[1]+1); + break; + } + if ((j+1)%(block[1]+1)==0) { + k++; + continue; + } + else if (compare != read_buf[k]) { + printf("Atomicity Test Failed Process %d: read_buf[%d] is %d, should be %d\n", mpi_rank, k, read_buf[k], compare); + nerrors++; + } + k ++; + } + } + } + + ret = H5Dclose(dataset2); + VRFY((ret >= 0), "H5Dclose succeeded"); + ret = H5Sclose(file_dataspace); + VRFY((ret >= 0), "H5Sclose succeeded"); + ret = H5Sclose(mem_dataspace); + VRFY((ret >= 0), "H5Sclose succeeded"); + + /* release data buffers */ + if(write_buf) free(write_buf); + if(read_buf) free(read_buf); + + ret = H5Fclose(fid); + VRFY((ret >= 0), "H5Fclose succeeded"); + +} diff --git a/testpar/testphdf5.c b/testpar/testphdf5.c index e3c72ef..4ec05ca 100644 --- a/testpar/testphdf5.c +++ b/testpar/testphdf5.c @@ -512,6 +512,18 @@ int main(int argc, char **argv) /* Parse command line arguments */ TestParseCmdLine(argc, argv); + if((mpi_size < 2)&& MAINPROCESS ) { + printf("Atomicity tests need at least 2 processes to participate\n"); + printf("8 is more recommended.. Atomicity tests will be skipped \n"); + } + else if (facc_type != FACC_MPIO && MAINPROCESS) { + printf("Atomicity tests will not work with a non MPIO VFD\n"); + } + else if(mpi_size >= 2 && facc_type == FACC_MPIO){ + AddTest("atomicity", dataset_atomicity, NULL, + "dataset atomic updates", PARATESTFILE); + } + if (facc_type == FACC_MPIPOSIX && MAINPROCESS){ printf("===================================\n" " Using MPIPOSIX driver\n" diff --git a/testpar/testphdf5.h b/testpar/testphdf5.h index 11656f9..15ef75f 100644 --- a/testpar/testphdf5.h +++ b/testpar/testphdf5.h @@ -43,6 +43,8 @@ enum H5TEST_COLL_CHUNK_API {API_NONE=0,API_LINK_HARD, #define DATASETNAME2 "Data2" #define DATASETNAME3 "Data3" #define DATASETNAME4 "Data4" +#define DATASETNAME5 "Data5" +#define DATASETNAME6 "Data6" /* Hyperslab layout styles */ #define BYROW 1 /* divide into slabs of rows */ @@ -225,6 +227,7 @@ void independent_group_read(void); void test_fapl_mpio_dup(void); void test_fapl_mpiposix_dup(void); void test_split_comm_access(void); +void dataset_atomicity(void); void dataset_writeInd(void); void dataset_writeAll(void); void extend_writeInd(void); -- cgit v0.12 From 0d118ea88a384bb18afa87a8ae068ceb99dc812c Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Wed, 21 Mar 2012 16:08:52 -0500 Subject: [svn-r22116] #Issue 7922 - follow-up checkin. I changed the order of two private functions and a macro according to Quincey's suggestion. Tested on jam - simple change. --- src/H5Ztrans.c | 154 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 76 insertions(+), 78 deletions(-) diff --git a/src/H5Ztrans.c b/src/H5Ztrans.c index 00eebb4..48948a7 100644 --- a/src/H5Ztrans.c +++ b/src/H5Ztrans.c @@ -110,7 +110,8 @@ static void H5Z_print(H5Z_node *tree, FILE *stream); /* PGCC (11.8-0) has trouble with the command *p++ = *p OP tree_val. It increments P first before * doing the operation. So I break down the command into two lines: * *p = *p OP tree_val; p++; - * (SLU - 2012/3/19) */ + * Actually, the behavior of *p++ = *p OP tree_val is undefined. (SLU - 2012/3/19) + */ #define H5Z_XFORM_DO_OP1(RESL,RESR,TYPE,OP,SIZE) \ { \ size_t u; \ @@ -252,7 +253,6 @@ static void H5Z_print(H5Z_node *tree, FILE *stream); } #endif /*H5_SIZEOF_LONG_DOUBLE */ - #define H5Z_XFORM_DO_OP3(OP) \ { \ if((tree->lchild->type == H5Z_XFORM_INTEGER) && (tree->rchild->type==H5Z_XFORM_INTEGER)) \ @@ -277,9 +277,27 @@ static void H5Z_print(H5Z_node *tree, FILE *stream); } \ } +#define H5Z_XFORM_DO_OP4(TYPE) \ +{ \ + if ((ret_value = (H5Z_node*) H5MM_malloc(sizeof(H5Z_node))) == NULL) \ + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "Ran out of memory trying to copy parse tree") \ + else \ + { \ + ret_value->type = (TYPE); \ + ret_value->lchild = (H5Z_node*) H5Z_xform_copy_tree(tree->lchild, dat_val_pointers, new_dat_val_pointers); \ + ret_value->rchild = (H5Z_node*) H5Z_xform_copy_tree(tree->rchild, dat_val_pointers, new_dat_val_pointers); \ + } \ +} + +#define H5Z_XFORM_DO_OP5(TYPE, SIZE) \ +{ \ + TYPE val = ((tree->type == H5Z_XFORM_INTEGER) ? (TYPE)tree->value.int_val : (TYPE)tree->value.float_val); \ + H5V_array_fill(array, &val, sizeof(TYPE), (SIZE)); \ +} + /* The difference of this macro from H5Z_XFORM_DO_OP3 is that it handles the operations when the left operand is empty, like -x or +x. * The reason that it's seperated from H5Z_XFORM_DO_OP3 is because compilers don't accept operations like *x or /x. So in H5Z_do_op, - * these two macros are called in different ways. + * these two macros are called in different ways. (SLU 2012/3/20) */ #define H5Z_XFORM_DO_OP6(OP) \ { \ @@ -319,26 +337,6 @@ static void H5Z_print(H5Z_node *tree, FILE *stream); } \ } -#define H5Z_XFORM_DO_OP4(TYPE) \ -{ \ - if ((ret_value = (H5Z_node*) H5MM_malloc(sizeof(H5Z_node))) == NULL) \ - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "Ran out of memory trying to copy parse tree") \ - else \ - { \ - ret_value->type = (TYPE); \ - ret_value->lchild = (H5Z_node*) H5Z_xform_copy_tree(tree->lchild, dat_val_pointers, new_dat_val_pointers); \ - ret_value->rchild = (H5Z_node*) H5Z_xform_copy_tree(tree->rchild, dat_val_pointers, new_dat_val_pointers); \ - } \ -} - -#define H5Z_XFORM_DO_OP5(TYPE, SIZE) \ -{ \ - TYPE val = ((tree->type == H5Z_XFORM_INTEGER) ? (TYPE)tree->value.int_val : (TYPE)tree->value.float_val); \ - H5V_array_fill(array, &val, sizeof(TYPE), (SIZE)); \ -} - - - /* * Programmer: Bill Wendling * 25. August 2003 @@ -1320,61 +1318,6 @@ H5Z_xform_copy_tree(H5Z_node* tree, H5Z_datval_ptrs* dat_val_pointers, H5Z_datva /*------------------------------------------------------------------------- - * Function: H5Z_xform_reduce_tree - * Purpose: Simplifies parse tree passed in by performing any obvious - * and trivial arithemtic calculations. - * - * Return: None. - * Programmer: Leon Arber - * April 1, 2004. - * Modifications: - * - *------------------------------------------------------------------------- - */ -void -H5Z_xform_reduce_tree(H5Z_node* tree) -{ - FUNC_ENTER_NOAPI_NOINIT_NOERR - - if(tree) { - if((tree->type == H5Z_XFORM_DIVIDE) || (tree->type == H5Z_XFORM_MULT)) - { - if(H5Z_op_is_numbs(tree)) - H5Z_do_op(tree); - else - { - H5Z_xform_reduce_tree(tree->lchild); - if(H5Z_op_is_numbs(tree)) - H5Z_do_op(tree); - else { - H5Z_xform_reduce_tree(tree->rchild); - if(H5Z_op_is_numbs(tree)) - H5Z_do_op(tree); - } - } - } else if((tree->type == H5Z_XFORM_PLUS) || (tree->type == H5Z_XFORM_MINUS)) { - if(H5Z_op_is_numbs2(tree)) - H5Z_do_op(tree); - else - { - H5Z_xform_reduce_tree(tree->lchild); - if(H5Z_op_is_numbs2(tree)) - H5Z_do_op(tree); - else { - H5Z_xform_reduce_tree(tree->rchild); - if(H5Z_op_is_numbs2(tree)) - H5Z_do_op(tree); - } - } - } - - } - - FUNC_LEAVE_NOAPI_VOID; -} - - -/*------------------------------------------------------------------------- * Function: H5Z_op_is_numbs * Purpose: Internal function to facilitate the condition check in * H5Z_xform_reduce_tree to reduce the bulkiness of the code. @@ -1432,6 +1375,61 @@ H5Z_op_is_numbs2(H5Z_node* _tree) /*------------------------------------------------------------------------- + * Function: H5Z_xform_reduce_tree + * Purpose: Simplifies parse tree passed in by performing any obvious + * and trivial arithemtic calculations. + * + * Return: None. + * Programmer: Leon Arber + * April 1, 2004. + * Modifications: + * + *------------------------------------------------------------------------- + */ +void +H5Z_xform_reduce_tree(H5Z_node* tree) +{ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + if(tree) { + if((tree->type == H5Z_XFORM_DIVIDE) || (tree->type == H5Z_XFORM_MULT)) + { + if(H5Z_op_is_numbs(tree)) + H5Z_do_op(tree); + else + { + H5Z_xform_reduce_tree(tree->lchild); + if(H5Z_op_is_numbs(tree)) + H5Z_do_op(tree); + else { + H5Z_xform_reduce_tree(tree->rchild); + if(H5Z_op_is_numbs(tree)) + H5Z_do_op(tree); + } + } + } else if((tree->type == H5Z_XFORM_PLUS) || (tree->type == H5Z_XFORM_MINUS)) { + if(H5Z_op_is_numbs2(tree)) + H5Z_do_op(tree); + else + { + H5Z_xform_reduce_tree(tree->lchild); + if(H5Z_op_is_numbs2(tree)) + H5Z_do_op(tree); + else { + H5Z_xform_reduce_tree(tree->rchild); + if(H5Z_op_is_numbs2(tree)) + H5Z_do_op(tree); + } + } + } + + } + + FUNC_LEAVE_NOAPI_VOID; +} + + +/*------------------------------------------------------------------------- * Function: H5Z_do_op * Purpose: If the root of the tree passed in points to a simple * arithmetic operation and the left and right subtrees are both -- cgit v0.12