summaryrefslogtreecommitdiffstats
path: root/examples/h5_drivers.c
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2020-10-01 15:29:53 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2020-10-01 15:29:53 (GMT)
commitec8ad09125032c9c232878d02e90aa86df162841 (patch)
tree5d63105d3a0db7d5bbee41c5b74b097649a2115e /examples/h5_drivers.c
parent453238e90e1574ef1c15e3c79f7fb3d77920e77c (diff)
downloadhdf5-ec8ad09125032c9c232878d02e90aa86df162841.zip
hdf5-ec8ad09125032c9c232878d02e90aa86df162841.tar.gz
hdf5-ec8ad09125032c9c232878d02e90aa86df162841.tar.bz2
Source formatted
Diffstat (limited to 'examples/h5_drivers.c')
-rw-r--r--examples/h5_drivers.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/examples/h5_drivers.c b/examples/h5_drivers.c
index 43c1fc7..486cf3b 100644
--- a/examples/h5_drivers.c
+++ b/examples/h5_drivers.c
@@ -22,13 +22,12 @@
#include "stdlib.h"
/* global variables */
-int cleanup_g = -1; /* whether to clean. Init to not set. */
+int cleanup_g = -1; /* whether to clean. Init to not set. */
/* prototypes */
void cleanup(const char *);
void split_file(void);
-
/*
* Cleanup a file unless $HDF5_NOCLEANUP is set.
*/
@@ -36,12 +35,11 @@ void
cleanup(const char *filename)
{
if (cleanup_g == -1)
- cleanup_g = getenv("HDF5_NOCLEANUP") ? 0 : 1;
+ cleanup_g = getenv("HDF5_NOCLEANUP") ? 0 : 1;
if (cleanup_g)
- remove(filename);
+ remove(filename);
}
-
/*
* This shows how to use the split file driver.
*/
@@ -55,7 +53,7 @@ split_file(void)
/* the metadata and rawdata files. */
fapl = H5Pcreate(H5P_FILE_ACCESS);
H5Pset_fapl_split(fapl, "-m.h5", H5P_DEFAULT, "-r.h5", H5P_DEFAULT);
- fid=H5Fcreate("Station1",H5F_ACC_TRUNC,H5P_DEFAULT,fapl);
+ fid = H5Fcreate("Station1", H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
/* using the file ... */
H5Fclose(fid);
H5Pclose(fapl);
@@ -68,7 +66,7 @@ split_file(void)
/* the metadata and rawdata files. */
fapl = H5Pcreate(H5P_FILE_ACCESS);
H5Pset_fapl_split(fapl, "-m.h5", H5P_DEFAULT, "/tmp/%s-r.h5", H5P_DEFAULT);
- fid=H5Fcreate("PointA",H5F_ACC_TRUNC,H5P_DEFAULT,fapl);
+ fid = H5Fcreate("PointA", H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
/* using the file ... */
H5Fclose(fid);
H5Pclose(fapl);
@@ -81,7 +79,7 @@ split_file(void)
/* the metadata and rawdata files. */
fapl = H5Pcreate(H5P_FILE_ACCESS);
H5Pset_fapl_split(fapl, NULL, H5P_DEFAULT, NULL, H5P_DEFAULT);
- fid=H5Fcreate("Measure",H5F_ACC_TRUNC,H5P_DEFAULT,fapl);
+ fid = H5Fcreate("Measure", H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
/* using the file ... */
H5Fclose(fid);
H5Pclose(fapl);
@@ -90,13 +88,12 @@ split_file(void)
cleanup("Measure.raw");
}
-
/* Main Body */
int
-main (void)
+main(void)
{
split_file();
- return(0);
+ return (0);
}