summaryrefslogtreecommitdiffstats
path: root/doxygen/examples
diff options
context:
space:
mode:
authorLarry Knox <lrknox@hdfgroup.org>2020-11-29 13:46:34 (GMT)
committerLarry Knox <lrknox@hdfgroup.org>2020-11-29 13:46:34 (GMT)
commit49b99cf1b058eec8f23ce78b85f68a8305e9785e (patch)
tree3b92096dbcd5479bb2ded1804ad5e1755d7a8e73 /doxygen/examples
parent9572872ad7a4c06f362fd37f26c35890238caed2 (diff)
parent4fea1bcccd283a407fe0936c56e56cc40a019b3c (diff)
downloadhdf5-49b99cf1b058eec8f23ce78b85f68a8305e9785e.zip
hdf5-49b99cf1b058eec8f23ce78b85f68a8305e9785e.tar.gz
hdf5-49b99cf1b058eec8f23ce78b85f68a8305e9785e.tar.bz2
Merge branch 'develop' into zzz-gitlab-ci
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;
+}