diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2010-03-25 03:51:41 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2010-03-25 03:51:41 (GMT) |
commit | 42efc1c2b591e4cd45ec6cb3bdf32044343118d2 (patch) | |
tree | 0ab542871c32246199479e8933ff26286aaf629a /tools/h5dump | |
parent | 3360c3af0c100ac4d3a2fe2865f34661da862ec5 (diff) | |
download | hdf5-42efc1c2b591e4cd45ec6cb3bdf32044343118d2.zip hdf5-42efc1c2b591e4cd45ec6cb3bdf32044343118d2.tar.gz hdf5-42efc1c2b591e4cd45ec6cb3bdf32044343118d2.tar.bz2 |
[svn-r18451] Description:
Bring r18172:18446 from trunk to revise_chunks branch.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Diffstat (limited to 'tools/h5dump')
-rw-r--r-- | tools/h5dump/h5dump.c | 132 | ||||
-rw-r--r-- | tools/h5dump/h5dumpgentest.c | 2 |
2 files changed, 95 insertions, 39 deletions
diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c index 0f25efe..3156ba6 100644 --- a/tools/h5dump/h5dump.c +++ b/tools/h5dump/h5dump.c @@ -717,7 +717,7 @@ usage(const char *prog) /*------------------------------------------------------------------------- * Function: table_list_add * - * Purpose: Add a new set of tables + * Purpose: Add a new set of tables * * Return: index of added table on success, -1 on failure * @@ -1191,17 +1191,17 @@ print_datatype(hid_t type,unsigned in_group) case H5T_REFERENCE: printf("H5T_REFERENCE"); - /* The BNF document states that the type of reference should be - * displayed after "H5T_REFERENCE". Therefore add the missing - * reference type if the region command line option is used. This + /* The BNF document states that the type of reference should be + * displayed after "H5T_REFERENCE". Therefore add the missing + * reference type if the region command line option is used. This * reference type will not be displayed if the region option is not used. */ if(display_region) { if (H5Tequal(type, H5T_STD_REF_DSETREG)==TRUE) { printf(" { H5T_STD_REF_DSETREG }"); - } + } else { printf(" { H5T_STD_REF_OBJECT }"); - } + } } break; @@ -2005,10 +2005,18 @@ dump_named_datatype(hid_t tid, const char *name) /* attribute iteration: if there is a request to do H5_INDEX_CRT_ORDER and tracking order is set in the datatype's create property list for attributes, then, sort by creation order, otherwise by name */ - if( (sort_by == H5_INDEX_CRT_ORDER) && (attr_crt_order_flags & H5P_CRT_ORDER_TRACKED)) - H5Aiterate2(tid, sort_by, sort_order, NULL, dump_attr_cb, NULL); - else - H5Aiterate2(tid, H5_INDEX_NAME, sort_order, NULL, dump_attr_cb, NULL); + if( (sort_by == H5_INDEX_CRT_ORDER) && (attr_crt_order_flags & H5P_CRT_ORDER_TRACKED)) { + if(H5Aiterate2(tid, sort_by, sort_order, NULL, dump_attr_cb, NULL) < 0) { + error_msg(progname, "error getting attribute information\n"); + d_status = EXIT_FAILURE; + } /* end if */ + } /* end if */ + else { + if(H5Aiterate2(tid, H5_INDEX_NAME, sort_order, NULL, dump_attr_cb, NULL) < 0) { + error_msg(progname, "error getting attribute information\n"); + d_status = EXIT_FAILURE; + } /* end if */ + } /* end else */ indent -= COL; @@ -2123,10 +2131,18 @@ dump_group(hid_t gid, const char *name) /* attribute iteration: if there is a request to do H5_INDEX_CRT_ORDER and tracking order is set in the group for attributes, then, sort by creation order, otherwise by name */ - if((sort_by == H5_INDEX_CRT_ORDER) && (attr_crt_order_flags & H5P_CRT_ORDER_TRACKED)) - H5Aiterate2(gid, sort_by, sort_order, NULL, dump_attr_cb, NULL); - else - H5Aiterate2(gid, H5_INDEX_NAME, sort_order, NULL, dump_attr_cb, NULL); + if((sort_by == H5_INDEX_CRT_ORDER) && (attr_crt_order_flags & H5P_CRT_ORDER_TRACKED)) { + if(H5Aiterate2(gid, sort_by, sort_order, NULL, dump_attr_cb, NULL) < 0) { + error_msg(progname, "error getting attribute information\n"); + d_status = EXIT_FAILURE; + } /* end if */ + } /* end if */ + else { + if(H5Aiterate2(gid, H5_INDEX_NAME, sort_order, NULL, dump_attr_cb, NULL) < 0) { + error_msg(progname, "error getting attribute information\n"); + d_status = EXIT_FAILURE; + } /* end if */ + } /* end else */ /* if there is a request to do H5_INDEX_CRT_ORDER and tracking order is set in the group, then, sort by creation order, otherwise by name */ @@ -2146,10 +2162,18 @@ dump_group(hid_t gid, const char *name) /* attribute iteration: if there is a request to do H5_INDEX_CRT_ORDER and tracking order is set in the group for attributes, then, sort by creation order, otherwise by name */ - if((sort_by == H5_INDEX_CRT_ORDER) && (attr_crt_order_flags & H5P_CRT_ORDER_TRACKED)) - H5Aiterate2(gid, sort_by, sort_order, NULL, dump_attr_cb, NULL); - else - H5Aiterate2(gid, H5_INDEX_NAME, sort_order, NULL, dump_attr_cb, NULL); + if((sort_by == H5_INDEX_CRT_ORDER) && (attr_crt_order_flags & H5P_CRT_ORDER_TRACKED)) { + if(H5Aiterate2(gid, sort_by, sort_order, NULL, dump_attr_cb, NULL) < 0) { + error_msg(progname, "error getting attribute information\n"); + d_status = EXIT_FAILURE; + } /* end if */ + } /* end if */ + else { + if(H5Aiterate2(gid, H5_INDEX_NAME, sort_order, NULL, dump_attr_cb, NULL) < 0) { + error_msg(progname, "error getting attribute information\n"); + d_status = EXIT_FAILURE; + } /* end if */ + } /* end else */ /* if there is a request to do H5_INDEX_CRT_ORDER and tracking order is set in the group, then, sort by creation order, otherwise by name */ @@ -2254,10 +2278,18 @@ dump_dataset(hid_t did, const char *name, struct subset_t *sset) /* attribute iteration: if there is a request to do H5_INDEX_CRT_ORDER and tracking order is set in the group for attributes, then, sort by creation order, otherwise by name */ - if( (sort_by == H5_INDEX_CRT_ORDER) && (attr_crt_order_flags & H5P_CRT_ORDER_TRACKED)) - H5Aiterate2(did, sort_by, sort_order, NULL, dump_attr_cb, NULL); - else - H5Aiterate2(did, H5_INDEX_NAME, sort_order, NULL, dump_attr_cb, NULL); + if( (sort_by == H5_INDEX_CRT_ORDER) && (attr_crt_order_flags & H5P_CRT_ORDER_TRACKED)) { + if(H5Aiterate2(did, sort_by, sort_order, NULL, dump_attr_cb, NULL) < 0) { + error_msg(progname, "error getting attribute information\n"); + d_status = EXIT_FAILURE; + } /* end if */ + } /* end if */ + else { + if(H5Aiterate2(did, H5_INDEX_NAME, sort_order, NULL, dump_attr_cb, NULL) < 0) { + error_msg(progname, "error getting attribute information\n"); + d_status = EXIT_FAILURE; + } /* end if */ + } /* end else */ } @@ -2500,14 +2532,14 @@ dump_data(hid_t obj_id, int obj_data, struct subset_t *sset, int display_index) status = h5tools_dump_dset(stdout, outputformat, obj_id, -1, sset, depth); H5Tclose(f_type); - } + } else { /* need to call h5tools_dump_mem for the attribute data */ space = H5Aget_space(obj_id); space_type = H5Sget_simple_extent_type(space); if(space_type == H5S_NULL || space_type == H5S_NO_CLASS) { status = SUCCEED; - } + } else { char string_prefix[64]; h5tool_format_t string_dataformat; @@ -3278,7 +3310,7 @@ set_binary_form(const char *form) int bform=-1; if (strcmp(form,"NATIVE")==0 || - strcmp(form,"MEMORY")==0) + strcmp(form,"MEMORY")==0) {/* native form */ bform = 0; } @@ -4384,7 +4416,7 @@ main(int argc, const char *argv[]) d_status = EXIT_FAILURE; goto done; } - + /* Initialize object tables */ if(table_list_add(fid, oi.fileno) < 0) { error_msg(progname, "internal error (file %s:line %d)\n", __FILE__, __LINE__); @@ -5876,10 +5908,18 @@ xml_dump_group(hid_t gid, const char *name) /* 1. do all the attributes of the group */ - if((sort_by == H5_INDEX_CRT_ORDER) && (attr_crt_order_flags & H5P_CRT_ORDER_TRACKED)) - H5Aiterate2(gid, sort_by, sort_order, NULL, dump_function_table->dump_attribute_function, NULL); - else - H5Aiterate2(gid, H5_INDEX_NAME, sort_order, NULL, dump_function_table->dump_attribute_function, NULL); + if((sort_by == H5_INDEX_CRT_ORDER) && (attr_crt_order_flags & H5P_CRT_ORDER_TRACKED)) { + if(H5Aiterate2(gid, sort_by, sort_order, NULL, dump_function_table->dump_attribute_function, NULL) < 0) { + error_msg(progname, "error getting attribute information\n"); + d_status = EXIT_FAILURE; + } /* end if */ + } /* end if */ + else { + if(H5Aiterate2(gid, H5_INDEX_NAME, sort_order, NULL, dump_function_table->dump_attribute_function, NULL) < 0) { + error_msg(progname, "error getting attribute information\n"); + d_status = EXIT_FAILURE; + } /* end if */ + } /* end else */ if(isRoot && unamedtype) { unsigned u; @@ -5940,10 +5980,18 @@ xml_dump_group(hid_t gid, const char *name) /* 1. do all the attributes of the group */ - if((sort_by == H5_INDEX_CRT_ORDER) && (attr_crt_order_flags & H5P_CRT_ORDER_TRACKED)) - H5Aiterate2(gid, sort_by, sort_order, NULL, dump_function_table->dump_attribute_function, NULL); - else - H5Aiterate2(gid, H5_INDEX_NAME, sort_order, NULL, dump_function_table->dump_attribute_function, NULL); + if((sort_by == H5_INDEX_CRT_ORDER) && (attr_crt_order_flags & H5P_CRT_ORDER_TRACKED)) { + if(H5Aiterate2(gid, sort_by, sort_order, NULL, dump_function_table->dump_attribute_function, NULL) < 0) { + error_msg(progname, "error getting attribute information\n"); + d_status = EXIT_FAILURE; + } /* end if */ + } /* end if */ + else { + if(H5Aiterate2(gid, H5_INDEX_NAME, sort_order, NULL, dump_function_table->dump_attribute_function, NULL) < 0) { + error_msg(progname, "error getting attribute information\n"); + d_status = EXIT_FAILURE; + } /* end if */ + } /* end else */ if(isRoot && unamedtype) { @@ -6598,10 +6646,18 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t UNUSED * sset) indent += COL; - if((sort_by == H5_INDEX_CRT_ORDER) && (attr_crt_order_flags & H5P_CRT_ORDER_TRACKED)) - H5Aiterate2(did, sort_by, sort_order, NULL, dump_function_table->dump_attribute_function, NULL); - else - H5Aiterate2(did, H5_INDEX_NAME, sort_order, NULL, dump_function_table->dump_attribute_function, NULL); + if((sort_by == H5_INDEX_CRT_ORDER) && (attr_crt_order_flags & H5P_CRT_ORDER_TRACKED)) { + if(H5Aiterate2(did, sort_by, sort_order, NULL, dump_function_table->dump_attribute_function, NULL) < 0) { + error_msg(progname, "error getting attribute information\n"); + d_status = EXIT_FAILURE; + } /* end if */ + } /* end if */ + else { + if(H5Aiterate2(did, H5_INDEX_NAME, sort_order, NULL, dump_function_table->dump_attribute_function, NULL) < 0) { + error_msg(progname, "error getting attribute information\n"); + d_status = EXIT_FAILURE; + } /* end if */ + } /* end else */ indent -= COL; tempi = H5Dget_storage_size(did); diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c index ab60807..ccc0f22 100644 --- a/tools/h5dump/h5dumpgentest.c +++ b/tools/h5dump/h5dumpgentest.c @@ -250,7 +250,7 @@ typedef struct s1_t { /* File 65 macros */ #define STRATEGY H5F_FILE_SPACE_AGGR_VFD /* File space handling strategy */ -#define THRESHOLD10 10 /* Free space section threshold */ +#define THRESHOLD10 10 /* Free space section threshold */ /* Declarations for gent_dataset_idx() for "FILE66" */ #define DSET_FIXED "dset_fixed" |