summaryrefslogtreecommitdiffstats
path: root/examples/h5_ref2reg.c
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2011-07-18 22:26:21 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2011-07-18 22:26:21 (GMT)
commit4401ddb8c0ae933630516c4aba6eb219b93f5678 (patch)
tree2f382420359ad990008892d3b550f1ff17adf335 /examples/h5_ref2reg.c
parent304f19d73093427faa319dc04926461d850032a0 (diff)
downloadhdf5-4401ddb8c0ae933630516c4aba6eb219b93f5678.zip
hdf5-4401ddb8c0ae933630516c4aba6eb219b93f5678.tar.gz
hdf5-4401ddb8c0ae933630516c4aba6eb219b93f5678.tar.bz2
[svn-r21118] Issue 2763 - followup commit for r21117 of H5Rdereference. I forgot to update the C examples.
Tested on jam - simple change.
Diffstat (limited to 'examples/h5_ref2reg.c')
-rw-r--r--examples/h5_ref2reg.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/examples/h5_ref2reg.c b/examples/h5_ref2reg.c
index 17ec724..4db7671 100644
--- a/examples/h5_ref2reg.c
+++ b/examples/h5_ref2reg.c
@@ -39,6 +39,7 @@ int main(void)
hid_t spacer_id;
hid_t dsetv_id; /*dataset identifiers*/
hid_t dsetr_id;
+ hid_t dapl_id; /* Dataset access property list */
hsize_t dims[2] = {2,9};
hsize_t dimsr[1] = {2};
int rank = 2;
@@ -67,6 +68,9 @@ int main(void)
space_id = H5Screate_simple(rank, dims, NULL);
spacer_id = H5Screate_simple(rankr, dimsr, NULL);
+ /* Create dataset access property list */
+ dapl_id = H5Pcreate(H5P_DATASET_ACCESS);
+
/*
* Create integer dataset.
*/
@@ -130,7 +134,7 @@ int main(void)
/*
* Dereference the first reference.
*/
- dsetv_id = H5Rdereference(dsetr_id, H5R_DATASET_REGION, &ref_out[0]);
+ dsetv_id = H5Rdereference(dsetr_id, dapl_id, H5R_DATASET_REGION, &ref_out[0]);
/*
* Get name of the dataset the first region reference points to
* using H5Rget_name
@@ -177,7 +181,7 @@ int main(void)
/*
* Dereference the second reference.
*/
- dsetv_id = H5Rdereference(dsetr_id, H5R_DATASET_REGION, &ref_out[1]);
+ dsetv_id = H5Rdereference(dsetr_id, dapl_id, H5R_DATASET_REGION, &ref_out[1]);
space_id = H5Rget_region(dsetv_id, H5R_DATASET_REGION,&ref_out[1]);
/*
@@ -199,6 +203,7 @@ int main(void)
* Close dataspace and the dataset.
*/
status = H5Sclose(space_id);
+ status = H5Pclose(dapl_id);
status = H5Dclose(dsetv_id);
status = H5Dclose(dsetr_id);
status = H5Fclose(file_id);