summaryrefslogtreecommitdiffstats
path: root/tools/lib/h5tools.c
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2012-08-03 20:11:36 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2012-08-03 20:11:36 (GMT)
commit28943c415b7e6ad11a412e7a88d500622886bffe (patch)
tree6b112cad4a3c050694ed7bdf78b4664815d32b57 /tools/lib/h5tools.c
parentc9cd62c1b55f96a45f3180e7ac73712340f479a1 (diff)
downloadhdf5-28943c415b7e6ad11a412e7a88d500622886bffe.zip
hdf5-28943c415b7e6ad11a412e7a88d500622886bffe.tar.gz
hdf5-28943c415b7e6ad11a412e7a88d500622886bffe.tar.bz2
[svn-r22625] HDFFV-8111: h5diff compare file to itself - removed path shortcut
Diffstat (limited to 'tools/lib/h5tools.c')
-rw-r--r--tools/lib/h5tools.c251
1 files changed, 0 insertions, 251 deletions
diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c
index 495aca1..7b6098d 100644
--- a/tools/lib/h5tools.c
+++ b/tools/lib/h5tools.c
@@ -1072,256 +1072,6 @@ init_acc_pos(h5tools_context_t *ctx, hsize_t *dims)
* Failure: FAIL
*-------------------------------------------------------------------------
*/
-
-#ifdef DEBUG_H5DUMP_BIN
-int
-render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem)
-{
- HERR_INIT(int, SUCCEED)
- unsigned char *mem = (unsigned char*)_mem;
- size_t size; /* datum size */
- float tempfloat;
- double tempdouble;
- unsigned long long tempullong;
- long long templlong;
- unsigned long tempulong;
- long templong;
- unsigned int tempuint;
- int tempint;
- unsigned short tempushort;
- short tempshort;
- unsigned char tempuchar;
- char tempschar;
-#if H5_SIZEOF_LONG_DOUBLE !=0
- long double templdouble;
-#endif
- static char fmt_llong[8], fmt_ullong[8];
- if (!fmt_llong[0]) {
- HDsprintf(fmt_llong, "%%%sd", H5_PRINTF_LL_WIDTH);
- HDsprintf(fmt_ullong, "%%%su", H5_PRINTF_LL_WIDTH);
- }
-
- if((size = H5Tget_size(tid)) == 0)
- H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_size failed");
-
- if (H5Tequal(tid, H5T_NATIVE_FLOAT)) {
- HDmemcpy(&tempfloat, mem, sizeof(float));
- HDfprintf(stream, "%g ", tempfloat);
- }
- else if (H5Tequal(tid, H5T_NATIVE_DOUBLE)) {
- HDmemcpy(&tempdouble, mem, sizeof(double));
- HDfprintf(stream, "%g ", tempdouble);
- }
-#if H5_SIZEOF_LONG_DOUBLE !=0
- else if (H5Tequal(tid, H5T_NATIVE_LDOUBLE)) {
- HDmemcpy(&templdouble, mem, sizeof(long double));
- HDfprintf(stream, "%Lf ", templdouble);
- }
-#endif
- else if (H5T_STRING == H5Tget_class(tid)) {
- unsigned int i;
- H5T_str_t pad;
- char *s;
-
- pad = H5Tget_strpad(tid);
-
- if (H5Tis_variable_str(tid)) {
- s = *(char**) mem;
- if (s != NULL)
- size = HDstrlen(s);
- }
- else {
- s = (char *) mem;
- if((size = H5Tget_size(tid)) == 0)
- H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_size failed");
- }
- for (i = 0; i < size && (s[i] || pad != H5T_STR_NULLTERM); i++) {
- HDmemcpy(&tempuchar, &s[i], sizeof(unsigned char));
- HDfprintf(stream, "%d", tempuchar);
- } /* i */
- }
- else if (H5Tequal(tid, H5T_NATIVE_INT)) {
- HDmemcpy(&tempint, mem, sizeof(int));
- HDfprintf(stream, "%d ", tempint);
- }
- else if (H5Tequal(tid, H5T_NATIVE_UINT)) {
- HDmemcpy(&tempuint, mem, sizeof(unsigned int));
- HDfprintf(stream, "%u ", tempuint);
- }
- else if (H5Tequal(tid, H5T_NATIVE_SCHAR)) {
- HDmemcpy(&tempschar, mem, sizeof(char));
- HDfprintf(stream, "%d ", tempschar);
- }
- else if (H5Tequal(tid, H5T_NATIVE_UCHAR)) {
- HDmemcpy(&tempuchar, mem, sizeof(unsigned char));
- HDfprintf(stream, "%u ", tempuchar);
- }
- else if (H5Tequal(tid, H5T_NATIVE_SHORT)) {
- HDmemcpy(&tempshort, mem, sizeof(short));
- HDfprintf(stream, "%d ", tempshort);
- }
- else if (H5Tequal(tid, H5T_NATIVE_USHORT)) {
- HDmemcpy(&tempushort, mem, sizeof(unsigned short));
- HDfprintf(stream, "%u ", tempushort);
- }
- else if (H5Tequal(tid, H5T_NATIVE_LONG)) {
- HDmemcpy(&templong, mem, sizeof(long));
- HDfprintf(stream, "%ld ", templong);
- }
- else if (H5Tequal(tid, H5T_NATIVE_ULONG)) {
- HDmemcpy(&tempulong, mem, sizeof(unsigned long));
- HDfprintf(stream, "%lu ", tempulong);
- }
- else if (H5Tequal(tid, H5T_NATIVE_LLONG)) {
- HDmemcpy(&templlong, mem, sizeof(long long));
- HDfprintf(stream, fmt_llong, templlong);
- }
- else if (H5Tequal(tid, H5T_NATIVE_ULLONG)) {
- HDmemcpy(&tempullong, mem, sizeof(unsigned long long));
- HDfprintf(stream, fmt_ullong, tempullong);
- }
- else if (H5Tequal(tid, H5T_NATIVE_HSSIZE)) {
- if (sizeof(hssize_t) == sizeof(int)) {
- HDmemcpy(&tempint, mem, sizeof(int));
- HDfprintf(stream, "%d ", tempint);
- }
- else if (sizeof(hssize_t) == sizeof(long)) {
- HDmemcpy(&templong, mem, sizeof(long));
- HDfprintf(stream, "%ld ", templong);
- }
- else {
- HDmemcpy(&templlong, mem, sizeof(long long));
- HDfprintf(stream, fmt_llong, templlong);
- }
- }
- else if (H5Tequal(tid, H5T_NATIVE_HSIZE)) {
- if (sizeof(hsize_t) == sizeof(int)) {
- HDmemcpy(&tempuint, mem, sizeof(unsigned int));
- HDfprintf(stream, "%u ", tempuint);
- }
- else if (sizeof(hsize_t) == sizeof(long)) {
- HDmemcpy(&tempulong, mem, sizeof(unsigned long));
- HDfprintf(stream, "%lu ", tempulong);
- }
- else {
- HDmemcpy(&tempullong, mem, sizeof(unsigned long long));
- HDfprintf(stream, fmt_ullong, tempullong);
- }
- }
- else if (H5Tget_class(tid) == H5T_COMPOUND) {
- unsigned j;
- hid_t memb;
- unsigned nmembs;
- size_t offset;
-
- nmembs = H5Tget_nmembers(tid);
-
- for (j = 0; j < nmembs; j++) {
- offset = H5Tget_member_offset(tid, j);
- memb = H5Tget_member_type(tid, j);
-
- if (render_bin_output(stream, container, memb, mem + offset) < 0)
- return FAIL;
-
- H5Tclose(memb);
- }
- }
- else if (H5Tget_class(tid) == H5T_ENUM) {
- unsigned int i;
- if (1 == size) {
- HDfprintf(stream, "0x%02x", mem[0]);
- }
- else {
- for (i = 0; i < size; i++) {
- HDfprintf(stream, "%s%02x", i?":":"", mem[i]);
- } /*i*/
- }/*else 1 */
- }
- else if (H5Tget_class(tid) == H5T_ARRAY) {
- int k, ndims;
- hsize_t i, dims[H5S_MAX_RANK], temp_nelmts, nelmts;
- hid_t memb;
-
- /* get the array's base datatype for each element */
- memb = H5Tget_super(tid);
- size = H5Tget_size(memb);
- ndims = H5Tget_array_ndims(tid);
- H5Tget_array_dims2(tid, dims);
- HDassert(ndims >= 1 && ndims <= H5S_MAX_RANK);
-
- /* calculate the number of array elements */
- for (k = 0, nelmts = 1; k < ndims; k++) {
- temp_nelmts = nelmts;
- temp_nelmts *= dims[k];
- nelmts = (size_t) temp_nelmts;
- }
-
- /* dump the array element */
- for (i = 0; i < nelmts; i++) {
- if (render_bin_output(stream, container, memb, mem + i * size) < 0)
- H5E_THROW(FAIL, H5E_tools_min_id_g, "render_bin_output failed");
- }
-
- H5Tclose(memb);
- }
- else if (H5Tget_class(tid) == H5T_VLEN) {
- unsigned int i;
- hsize_t nelmts;
- hid_t memb;
-
- /* get the VL sequences's base datatype for each element */
- memb = H5Tget_super(tid);
- size = H5Tget_size(memb);
-
- /* Get the number of sequence elements */
- nelmts = ((hvl_t *) mem)->len;
-
- for (i = 0; i < nelmts; i++) {
- /* dump the array element */
- if (render_bin_output(stream, container, memb, ((char *) (((hvl_t *) mem)->p)) + i * size) < 0)
- H5E_THROW(FAIL, H5E_tools_min_id_g, "render_bin_output failed");
- }
- H5Tclose(memb);
- }
- else if (H5Tequal(tid, H5T_STD_REF_DSETREG)) {
- if (region_output) {
- /* region data */
- hid_t region_id, region_space;
- H5S_sel_type region_type;
-
- region_id = H5Rdereference2(container, H5P_DEFAULT, H5R_DATASET_REGION, mem);
- if (region_id >= 0) {
- region_space = H5Rget_region(container, H5R_DATASET_REGION, mem);
- if (region_space >= 0) {
- region_type = H5Sget_select_type(region_space);
- if(region_type == H5S_SEL_POINTS)
- render_bin_output_region_points(region_space, region_id, stream, container);
- else
- render_bin_output_region_blocks(region_space, region_id, stream, container);
- H5Sclose(region_space);
- } /* end if (region_space >= 0) */
- H5Dclose(region_id);
- } /* end if (region_id >= 0) */
- } /* end if (region_output... */
- }
- else if (H5Tequal(tid, H5T_STD_REF_OBJ)) {
- }
- else {
- size_t i;
- if (1 == size) {
- HDfprintf(stream, "0x%02x", mem[0]);
- }
- else {
- for (i = 0; i < size; i++) {
- HDfprintf(stream, "%s%02x", i?":":"", mem[i]);
- } /*i*/
- }/*else 1 */
- }
-
-CATCH
- return ret_value;
-}
-#else
int
render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t block_nelmts)
{
@@ -1504,7 +1254,6 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t
CATCH
return ret_value;
}
-#endif
/*-------------------------------------------------------------------------
* Audience: Public