diff options
author | Patrick Lu <ptlu@hawkwind.ncsa.uiuc.edu> | 1999-10-13 16:08:26 (GMT) |
---|---|---|
committer | Patrick Lu <ptlu@hawkwind.ncsa.uiuc.edu> | 1999-10-13 16:08:26 (GMT) |
commit | 5246411f704970a2f6568dc7aaf9e7b5b7269505 (patch) | |
tree | bb984268e981b489be04d707152d9dab7101e7d9 /tools/h5tools.c | |
parent | 58a685ac811293349eed92b6d650392c1a18667e (diff) | |
download | hdf5-5246411f704970a2f6568dc7aaf9e7b5b7269505.zip hdf5-5246411f704970a2f6568dc7aaf9e7b5b7269505.tar.gz hdf5-5246411f704970a2f6568dc7aaf9e7b5b7269505.tar.bz2 |
[svn-r1744] i removed an extra function that wasn't being used
Diffstat (limited to 'tools/h5tools.c')
-rw-r--r-- | tools/h5tools.c | 174 |
1 files changed, 1 insertions, 173 deletions
diff --git a/tools/h5tools.c b/tools/h5tools.c index 2eca598..1ecd067 100644 --- a/tools/h5tools.c +++ b/tools/h5tools.c @@ -37,12 +37,7 @@ static void display_string(hsize_t hs_nelmts, hid_t p_type, static void display_compound_data(hsize_t hs_nelmts, hid_t p_type, unsigned char *sm_buf, size_t p_type_nbytes, hsize_t p_nelmts, hsize_t elmtno); -#if 0 -static void display_reference_data(hsize_t hs_nelmts, hid_t p_type, - unsigned char *sm_buf, size_t p_type_nbytes, - hsize_t p_nelmts, hsize_t dim_n_size, - hsize_t elmtno, hid_t container); -#endif + int h5dump_attr(hid_t oid, hid_t ptype); int print_data(hid_t oid, hid_t _p_type, int obj_data); @@ -2249,173 +2244,6 @@ int nmembs, i, j, k, ndims, perm[4]; } } -#if 0 -/*------------------------------------------------------------------------- - * Function: h5dump_simple - * - * Purpose: Print some values from a dataset or an attribute with a - * simple data space. - * - * Return: Success: 0 - * - * Failure: -1 - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -static int -h5dump_simple(hid_t oid, hid_t p_type, int obj_data) -{ - hid_t f_space; /*file data space */ - int ndims; /*dimensionality */ - hsize_t elmtno, i; /*counters */ - int carry; /*counter carry value */ - hssize_t zero[8]; /*vector of zeros */ - - /* Print info */ - hsize_t p_min_idx[8]; /*min selected index */ - hsize_t p_max_idx[8]; /*max selected index */ - size_t p_type_nbytes; /*size of memory type */ - hsize_t p_nelmts; /*total selected elmts */ - - /* Stripmine info */ - hsize_t sm_size[8]; /*stripmine size */ - hsize_t sm_nbytes; /*bytes per stripmine */ - hsize_t sm_nelmts; /*elements per stripmine*/ - unsigned char *sm_buf; /*buffer for raw data */ - hid_t sm_space; /*stripmine data space */ - - /* Hyperslab info */ - hssize_t hs_offset[8]; /*starting offset */ - hsize_t hs_size[8]; /*size this pass */ - hsize_t hs_nelmts; /*elements in request */ - hsize_t dim_n_size; - - - if (obj_data == DATASET_DATA) - f_space = H5Dget_space(oid); - else - f_space = H5Aget_space(oid); - - /* - * Check that everything looks okay. The dimensionality must not be too - * great and the dimensionality of the items selected for printing must - * match the dimensionality of the dataset. - */ - - ndims = H5Sget_simple_extent_ndims(f_space); - - if ((size_t)ndims>NELMTS(sm_size)) return -1; - - /* Assume entire data space to be printed */ - for (i=0; i<(hsize_t)ndims; i++) p_min_idx[i] = 0; - H5Sget_simple_extent_dims(f_space, p_max_idx, NULL); - for (i=0, p_nelmts=1; i<(hsize_t)ndims; i++) { - p_nelmts *= p_max_idx[i]-p_min_idx[i]; - } - if (0==p_nelmts) return 0; /*nothing to print*/ - - /* - * Determine the strip mine size and allocate a buffer. The strip mine is - * a hyperslab whose size is manageable. - */ - p_type_nbytes = H5Tget_size(p_type); - for (i=ndims, sm_nbytes=p_type_nbytes; i>0; --i) { - sm_size[i-1] = MIN (p_max_idx[i-1]-p_min_idx[i-1], - H5DUMP_BUFSIZE/sm_nbytes); - sm_nbytes *= sm_size[i-1]; - assert(sm_nbytes>0); - } - sm_buf = malloc(sm_nbytes); - sm_nelmts = sm_nbytes/p_type_nbytes; - sm_space = H5Screate_simple(1, &sm_nelmts, NULL); - - /* The stripmine loop */ - memset(hs_offset, 0, sizeof hs_offset); - memset(zero, 0, sizeof zero); - - - for (elmtno=0; elmtno<p_nelmts; elmtno+=hs_nelmts) { - - - /* Calculate the hyperslab size */ - if (ndims > 0) { - for (i=0, hs_nelmts=1; i<(hsize_t)ndims; i++) { - hs_size[i] = MIN(sm_size[i], p_max_idx[i]-hs_offset[i]); - hs_nelmts *= hs_size[i]; - } - H5Sselect_hyperslab(f_space, H5S_SELECT_SET, hs_offset, NULL, - hs_size, NULL); - H5Sselect_hyperslab(sm_space, H5S_SELECT_SET, zero, NULL, - &hs_nelmts, NULL); - dim_n_size = p_max_idx[ndims-1]; - } else { - H5Sselect_all(f_space); - H5Sselect_all(sm_space); - hs_nelmts = 1; - dim_n_size = 1; - } - - if (obj_data == DATASET_DATA) { - if (H5Dread(oid, p_type, sm_space, f_space, H5P_DEFAULT, sm_buf) <0) - return -1; - } else { - if (H5Aread(oid, p_type, sm_buf) < 0) - return -1; - } - - /* Print the data */ - switch (H5Tget_class(p_type)) { - case H5T_INTEGER: - display_numeric_data (hs_nelmts, p_type, sm_buf, p_type_nbytes, - p_nelmts, dim_n_size, elmtno, -1); - break; - - case H5T_FLOAT: - display_numeric_data (hs_nelmts, p_type, sm_buf, p_type_nbytes, - p_nelmts, dim_n_size, elmtno, -1); - break; - - case H5T_TIME: - break; - - case H5T_STRING: - display_string (hs_nelmts, p_type, sm_buf, p_type_nbytes, - p_nelmts, dim_n_size, elmtno); - break; - - case H5T_BITFIELD: - break; - - case H5T_OPAQUE: - break; - - case H5T_COMPOUND: - compound_data = 1; - display_compound_data (hs_nelmts, p_type, sm_buf, p_type_nbytes, p_nelmts, elmtno); - compound_data = 0; - break; - - default: break; - } - - /* Calculate the next hyperslab offset */ - for (i=ndims, carry=1; i>0 && carry; --i) { - hs_offset[i-1] += hs_size[i-1]; - if (hs_offset[i-1]==(hssize_t)p_max_idx[i-1]) { - hs_offset[i-1] = p_min_idx[i-1]; - } else { - carry = 0; - } - } - } - - H5Sclose(sm_space); - H5Sclose(f_space); - return 0; -} -#endif /*------------------------------------------------------------------------- * Function: print_data * |