From a726992cd88fd43f8daa46e057618138ed310795 Mon Sep 17 00:00:00 2001 From: Elena Pourmal Date: Mon, 2 Mar 2015 16:32:27 -0500 Subject: [svn-r26342] Added usage of the new H5S*_regular_hyperslab functions. Tested on jam. --- examples/h5_vds.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/examples/h5_vds.c b/examples/h5_vds.c index dea2ee6..ed6fa55 100644 --- a/examples/h5_vds.c +++ b/examples/h5_vds.c @@ -53,6 +53,10 @@ main (void) stride[2], count[2], block[2]; + hsize_t start_out[2], + stride_out[2], + count_out[2], + block_out[2]; int wdata[DIM0], /* Write buffer for source dataset */ rdata[VDSDIM0][VDSDIM1], /* Read buffer for virtual dataset */ i, j, k, l; @@ -183,6 +187,14 @@ main (void) printf("%d,", (int)buf[RANK2+k]); printf("%d)\n", (int)buf[RANK2+k]); } + /* We also can use new APIs to get start, stride, count and block */ + if (H5Sis_regular_hyperslab(vspace)) { + status = H5Sget_regular_hyperslab (vspace, start_out, stride_out, count_out, block_out); + printf("start = [%d, %d] \n", (int)start_out[0], (int)start_out[1]); + printf("stride = [%d, %d] \n", (int)stride_out[0], (int)stride_out[1]); + printf("count = [%d, %d] \n", (int)count_out[0], (int)count_out[1]); + printf("block = [%d, %d] \n", (int)block_out[0], (int)block_out[1]); + } } /* Get source file name. */ len = H5Pget_virtual_filename (dcpl, (size_t)i, NULL, 0); -- cgit v0.12