diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2020-09-30 14:27:10 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2020-09-30 14:27:10 (GMT) |
commit | b2d661b508a7fc7a2592c13bc6bdc175551f075d (patch) | |
tree | 13baeb0d83a7c2a4c6299993c182b1227c2f6114 /examples/h5_ref_extern.c | |
parent | 29ab58b58dce556639ea3154e262895773a8a8df (diff) | |
download | hdf5-b2d661b508a7fc7a2592c13bc6bdc175551f075d.zip hdf5-b2d661b508a7fc7a2592c13bc6bdc175551f075d.tar.gz hdf5-b2d661b508a7fc7a2592c13bc6bdc175551f075d.tar.bz2 |
Clang-format of source files
Diffstat (limited to 'examples/h5_ref_extern.c')
-rw-r--r-- | examples/h5_ref_extern.c | 48 |
1 files changed, 23 insertions, 25 deletions
diff --git a/examples/h5_ref_extern.c b/examples/h5_ref_extern.c index 5403814..283af95 100644 --- a/examples/h5_ref_extern.c +++ b/examples/h5_ref_extern.c @@ -10,12 +10,12 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - /* - * The example below illustrates the use of the new API with files that are - * opened read-only. Created references to the objects in that file are - * stored into a separate file, and accessed from that file, without the user - * explicitly opening the original file that was referenced. - */ +/* + * The example below illustrates the use of the new API with files that are + * opened read-only. Created references to the objects in that file are + * stored into a separate file, and accessed from that file, without the user + * explicitly opening the original file that was referenced. + */ #include <stdlib.h> @@ -25,30 +25,30 @@ #define H5FILE_NAME1 "refer_extern1.h5" #define H5FILE_NAME2 "refer_extern2.h5" -#define NDIMS 1 /* Number of dimensions */ -#define BUF_SIZE 4 /* Size of example buffer */ -#define NREFS 1 /* Number of references */ +#define NDIMS 1 /* Number of dimensions */ +#define BUF_SIZE 4 /* Size of example buffer */ +#define NREFS 1 /* Number of references */ int -main(void) { - hid_t file1, dset1, space1; - hsize_t dset1_dims[NDIMS] = { BUF_SIZE }; - int dset_buf[BUF_SIZE]; - - hid_t file2, dset2, space2; - hsize_t dset2_dims[NDIMS] = { NREFS }; - H5R_ref_t ref_buf[NREFS] = { 0 }; +main(void) +{ + hid_t file1, dset1, space1; + hsize_t dset1_dims[NDIMS] = {BUF_SIZE}; + int dset_buf[BUF_SIZE]; + + hid_t file2, dset2, space2; + hsize_t dset2_dims[NDIMS] = {NREFS}; + H5R_ref_t ref_buf[NREFS] = {0}; H5O_type_t obj_type; - int i; + int i; for (i = 0; i < BUF_SIZE; i++) dset_buf[i] = i; /* Create file with one dataset and close it */ - file1 = H5Fcreate(H5FILE_NAME1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + file1 = H5Fcreate(H5FILE_NAME1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); space1 = H5Screate_simple(NDIMS, dset1_dims, NULL); - dset1 = H5Dcreate2(file1, "dataset1", H5T_NATIVE_INT, space1, H5P_DEFAULT, - H5P_DEFAULT, H5P_DEFAULT); + dset1 = H5Dcreate2(file1, "dataset1", H5T_NATIVE_INT, space1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); H5Dwrite(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset_buf); H5Dclose(dset1); H5Sclose(space1); @@ -60,10 +60,9 @@ main(void) { H5Fclose(file1); /* Store reference in dataset in separate file "refer_extern2.h5" */ - file2 = H5Fcreate(H5FILE_NAME2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + file2 = H5Fcreate(H5FILE_NAME2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); space2 = H5Screate_simple(NDIMS, dset2_dims, NULL); - dset2 = H5Dcreate2(file2, "references", H5T_STD_REF, space2, H5P_DEFAULT, - H5P_DEFAULT, H5P_DEFAULT); + dset2 = H5Dcreate2(file2, "references", H5T_STD_REF, space2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); H5Dwrite(dset2, H5T_STD_REF, H5S_ALL, H5S_ALL, H5P_DEFAULT, ref_buf); H5Dclose(dset2); H5Sclose(space2); @@ -91,4 +90,3 @@ main(void) { return 0; } - |