summaryrefslogtreecommitdiffstats
path: root/examples/h5_ref2reg.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2008-09-16 16:22:16 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2008-09-16 16:22:16 (GMT)
commitb9be0455961ca1098bc4977bf1138394932b75db (patch)
tree8bf7377bbda85d614e4e5984c5a1a59ac323310e /examples/h5_ref2reg.c
parent37a1f87664a1b2026e1d2a1dd5033eb2e8b1f5fc (diff)
downloadhdf5-b9be0455961ca1098bc4977bf1138394932b75db.zip
hdf5-b9be0455961ca1098bc4977bf1138394932b75db.tar.gz
hdf5-b9be0455961ca1098bc4977bf1138394932b75db.tar.bz2
[svn-r15629] Description:
Remove trailing whitespace from C/C++ source files, with the following script: foreach f (*.[ch] *.cpp) sed 's/[[:blank:]]*$//' $f > sed.out && mv sed.out $f end Tested on: Mac OS X/32 10.5.5 (amazon) No need for h5committest, just whitespace changes...
Diffstat (limited to 'examples/h5_ref2reg.c')
-rw-r--r--examples/h5_ref2reg.c58
1 files changed, 29 insertions, 29 deletions
diff --git a/examples/h5_ref2reg.c b/examples/h5_ref2reg.c
index 9c75d91..d6df438 100644
--- a/examples/h5_ref2reg.c
+++ b/examples/h5_ref2reg.c
@@ -13,16 +13,16 @@
* access to either file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- This program shows how to create, store and dereference references
+ This program shows how to create, store and dereference references
to the dataset regions.
It creates a file and writes a two dimensional integer dataset
- to it. Then it creates a dataset to store region references in. It
+ to it. Then it creates a dataset to store region references in. It
stores references to a hyperslab and 3 points selected (for the
- integer dataset previously created).
+ integer dataset previously created).
- It then reopens the references dataset, reads and dereferences the
- region references, and then reads and displays the selected hyperslab
+ It then reopens the references dataset, reads and dereferences the
+ region references, and then reads and displays the selected hyperslab
and selected elements data from the integer dataset.
*/
@@ -36,9 +36,9 @@ int main(void)
{
hid_t file_id; /* file identifier */
hid_t space_id; /* dataspace identifiers */
- hid_t spacer_id;
+ hid_t spacer_id;
hid_t dsetv_id; /*dataset identifiers*/
- hid_t dsetr_id;
+ hid_t dsetr_id;
hsize_t dims[2] = {2,9};
hsize_t dimsr[1] = {2};
int rank = 2;
@@ -56,29 +56,29 @@ int main(void)
size_t name_size1, name_size2;
char buf1[10], buf2[10];
- /*
+ /*
* Create file with default file access and file creation properties.
*/
file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
- /*
+ /*
* Create dataspace for datasets.
*/
space_id = H5Screate_simple(rank, dims, NULL);
spacer_id = H5Screate_simple(rankr, dimsr, NULL);
- /*
- * Create integer dataset.
+ /*
+ * Create integer dataset.
*/
dsetv_id = H5Dcreate2(file_id, dsetnamev, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- /*
+ /*
* Write data to the dataset.
*/
status = H5Dwrite(dsetv_id, H5T_NATIVE_INT, H5S_ALL , H5S_ALL, H5P_DEFAULT,data);
status = H5Dclose(dsetv_id);
- /*
+ /*
* Dataset with references.
*/
dsetr_id = H5Dcreate2(file_id, dsetnamer, H5T_STD_REF_DSETREG, spacer_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
@@ -86,8 +86,8 @@ int main(void)
/*
* Create a reference to the hyperslab.
*/
- start[0] = 0;
- start[1] = 3;
+ start[0] = 0;
+ start[1] = 3;
count[0] = 2;
count[1] = 3;
status = H5Sselect_hyperslab(space_id, H5S_SELECT_SET, start, NULL, count, NULL);
@@ -119,42 +119,42 @@ int main(void)
file_id = H5Fopen(filename, H5F_ACC_RDWR, H5P_DEFAULT);
/*
- * Reopen the dataset with object references and read references
+ * Reopen the dataset with object references and read references
* to the buffer.
*/
dsetr_id = H5Dopen2(file_id, dsetnamer, H5P_DEFAULT);
- status = H5Dread(dsetr_id, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL,
+ status = H5Dread(dsetr_id, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL,
H5P_DEFAULT, ref_out);
- /*
+ /*
* Dereference the first reference.
*/
dsetv_id = H5Rdereference(dsetr_id, H5R_DATASET_REGION, &ref_out[0]);
/*
* Get name of the dataset the first region reference points to
- * using H5Rget_name
+ * using H5Rget_name
*/
name_size1 = H5Rget_name(dsetr_id, H5R_DATASET_REGION, &ref_out[0], (char*)buf1, 10);
- printf(" Dataset's name (returned by H5Rget_name) the reference points to is %s, name length is %d\n", buf1, (int)name_size1);
+ printf(" Dataset's name (returned by H5Rget_name) the reference points to is %s, name length is %d\n", buf1, (int)name_size1);
/*
* Get name of the dataset the first region reference points to
- * using H5Iget_name
+ * using H5Iget_name
*/
- name_size2 = H5Iget_name(dsetv_id, (char*)buf2, 10);
- printf(" Dataset's name (returned by H5Iget_name) the reference points to is %s, name length is %d\n", buf2, (int)name_size2);
+ name_size2 = H5Iget_name(dsetv_id, (char*)buf2, 10);
+ printf(" Dataset's name (returned by H5Iget_name) the reference points to is %s, name length is %d\n", buf2, (int)name_size2);
space_id = H5Rget_region(dsetr_id, H5R_DATASET_REGION,&ref_out[0]);
- /*
+ /*
* Read and display hyperslab selection from the dataset.
*/
- status = H5Dread(dsetv_id, H5T_NATIVE_INT, H5S_ALL, space_id,
+ status = H5Dread(dsetv_id, H5T_NATIVE_INT, H5S_ALL, space_id,
H5P_DEFAULT, data_out);
printf("Selected hyperslab: ");
for (i = 0; i <= 1; i++)
- {
+ {
printf("\n");
for (j = 0; j <= 8; j++)
printf("%d ", data_out[i][j]);
@@ -184,11 +184,11 @@ int main(void)
* Read selected data from the dataset.
*/
- status = H5Dread(dsetv_id, H5T_NATIVE_INT, H5S_ALL, space_id,
+ status = H5Dread(dsetv_id, H5T_NATIVE_INT, H5S_ALL, space_id,
H5P_DEFAULT, data_out);
printf("Selected points: ");
for (i = 0; i <= 1; i++)
- {
+ {
printf("\n");
for (j = 0; j <= 8; j++)
printf("%d ", data_out[i][j]);
@@ -205,6 +205,6 @@ int main(void)
return 0;
}
-
+