summaryrefslogtreecommitdiffstats
path: root/doxygen/examples
diff options
context:
space:
mode:
authorAllen Byrne <50328838+byrnHDF@users.noreply.github.com>2021-04-20 00:17:24 (GMT)
committerGitHub <noreply@github.com>2021-04-20 00:17:24 (GMT)
commit168c1245b4aa6fa4779b3df5cc050d0272abdc2e (patch)
tree6e4dc53920a8c2c0bbdb7cfb6f190e6703e80446 /doxygen/examples
parent100e132a62ae1aaf97f379684d04ed00d6016208 (diff)
downloadhdf5-168c1245b4aa6fa4779b3df5cc050d0272abdc2e.zip
hdf5-168c1245b4aa6fa4779b3df5cc050d0272abdc2e.tar.gz
hdf5-168c1245b4aa6fa4779b3df5cc050d0272abdc2e.tar.bz2
1 8 Merge dev changes for long double and cmake (#548)
* Update supported platforms * Merge PR#3 changes from develop * # WARNING: head commit changed in the meantime Merge gcc 10 diagnostics option from develop Merge CMake changes from develop Merge warnings from develop Merge #318 OSX changes from develop Merge tools changes from develop Merge test macros from develop * Format updates * Fix missing semicolon and format fix * Format update * Correct actions, remove java option * Update autotools build files * Add testfiles * Fix configure issue with make flags * Init fapls to default * Update generated files and fix h5repack id closure * update format * Merges from develop #358 patches from vtk #361 fix header guard spelling * Merges from develop #340 clang -Wformat-security warnings #360 Fixed uninitialized warnings header guard underscore cleanup whitespace cleanup tools sync * format alignment * initialize vars * revert H5private change * Merge #380 from develop * Split format source and commit changes on repo push * Change windows TS to use older VS. * HDFFV-11229 merge dev changes for long double display in tools * Committing clang-format changes * Update unsupported types with precision Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'doxygen/examples')
-rw-r--r--doxygen/examples/H5Fclose.c13
-rw-r--r--doxygen/examples/H5Fcreate.c13
-rw-r--r--doxygen/examples/hello_hdf5.c13
3 files changed, 39 insertions, 0 deletions
diff --git a/doxygen/examples/H5Fclose.c b/doxygen/examples/H5Fclose.c
new file mode 100644
index 0000000..525bad3
--- /dev/null
+++ b/doxygen/examples/H5Fclose.c
@@ -0,0 +1,13 @@
+#include "hdf5.h"
+
+int
+main()
+{
+ hid_t file;
+ if ((file = H5Fcreate("foo.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ return -1;
+ /* Do something good with this file. */
+ if (H5Fclose(file) < 0)
+ return -2;
+ return 0;
+}
diff --git a/doxygen/examples/H5Fcreate.c b/doxygen/examples/H5Fcreate.c
new file mode 100644
index 0000000..525bad3
--- /dev/null
+++ b/doxygen/examples/H5Fcreate.c
@@ -0,0 +1,13 @@
+#include "hdf5.h"
+
+int
+main()
+{
+ hid_t file;
+ if ((file = H5Fcreate("foo.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ return -1;
+ /* Do something good with this file. */
+ if (H5Fclose(file) < 0)
+ return -2;
+ return 0;
+}
diff --git a/doxygen/examples/hello_hdf5.c b/doxygen/examples/hello_hdf5.c
new file mode 100644
index 0000000..a37d39f
--- /dev/null
+++ b/doxygen/examples/hello_hdf5.c
@@ -0,0 +1,13 @@
+#include "hdf5.h"
+
+int
+main()
+{
+ herr_t retval;
+ unsigned majnum, minnum, relnum;
+
+ if ((retval = H5get_libversion(&majnum, &minnum, &relnum)) >= 0) {
+ printf("Hello, HDF5 %d.%d.%d!\n", majnum, minnum, relnum);
+ }
+ return retval;
+}