summaryrefslogtreecommitdiffstats
path: root/doxygen/dox/cookbook/Accessibility.c
diff options
context:
space:
mode:
authorAllen Byrne <50328838+byrnHDF@users.noreply.github.com>2021-09-07 21:08:41 (GMT)
committerGitHub <noreply@github.com>2021-09-07 21:08:41 (GMT)
commitd0507c23f30fc1ff66ae4a31d41f681612e51851 (patch)
tree18032d7c438334900adf45d22659b70cee072215 /doxygen/dox/cookbook/Accessibility.c
parentf5709db18e10993de3bc4668ad07b66d14279877 (diff)
downloadhdf5-d0507c23f30fc1ff66ae4a31d41f681612e51851.zip
hdf5-d0507c23f30fc1ff66ae4a31d41f681612e51851.tar.gz
hdf5-d0507c23f30fc1ff66ae4a31d41f681612e51851.tar.bz2
1.12 Merge A batch of life-cycle examples for different modules #654 (#987)
* Merge A batch of life-cycle examples for different modules #654 * Remove generated file * Change doxygen generated file location
Diffstat (limited to 'doxygen/dox/cookbook/Accessibility.c')
-rw-r--r--doxygen/dox/cookbook/Accessibility.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/doxygen/dox/cookbook/Accessibility.c b/doxygen/dox/cookbook/Accessibility.c
new file mode 100644
index 0000000..f4cc905
--- /dev/null
+++ b/doxygen/dox/cookbook/Accessibility.c
@@ -0,0 +1,48 @@
+/* -*- c-file-style: "stroustrup" -*- */
+
+#include "hdf5.h"
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+int
+main(void)
+{
+ int ret_val = EXIT_SUCCESS;
+
+ //! <!-- [set_libver_bounds] -->
+ {
+ __label__ fail_fapl, fail_file;
+ hid_t fapl, file, aspace, attr;
+
+ if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_fapl;
+ }
+#if H5_VERSION_GE(1, 10, 0)
+ if (H5Pset_libver_bounds(fapl, H5F_LIBVER_V18, H5F_LIBVER_V18) < 0) {
+#elif H5_VERSION_GE(1, 8, 0)
+ if (H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) {
+#else
+#error Only HDF5 1.8.x and later supported.
+#endif
+ ret_val = EXIT_FAILURE;
+ goto fail_file;
+ }
+ if ((file = H5Fcreate("set_libver_bounds.h5", H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_file;
+ }
+
+ H5Fclose(file);
+fail_file:
+ H5Pclose(fapl);
+fail_fapl:;
+ }
+ //! <!-- [set_libver_bounds] -->
+
+ assert(ret_val == EXIT_SUCCESS);
+
+ return ret_val;
+}