Files
Scot Breitenfeld 05676d1abe Consolidate documentation under docs/ directory (#6310)
* Consolidate documentation under doc/ directory

Move user-facing guides from release_docs/ and doxygen/ into a single
doc/ root. release_docs/ now holds only release artifacts (changelogs,
history, release process, maintainer info).

- git mv release_docs/INSTALL*.md, USING_*.md, README_HPC.md,
  BuildSystemNotes.md, AutotoolsToCMakeOptions.md,
  HDF5_Library_2.0.0_Migration_Guide.md → doc/
- git mv doxygen/ → doc/doxygen/
- Update CMakeLists.txt: HDF5_DOXYGEN_DIR and add_subdirectory path
- Update CMakeInstallation.cmake: all install paths for moved files
- Update bin/make_vers: hardcoded doxygen/ path substitution
- Update doc/doxygen/CMakeLists.txt: EXAMPLES_DIRECTORY and comments
- Update README.md, CONTRIBUTING.md, SECURITY.md, config/README.md,
  release_docs/RELEASE_PROCESS.md: links to moved files
- Update doxygen .dox files: release_docs/ URLs for moved guides
- Rewrite release_docs/README.md for narrowed scope

* Add HDF5_DOCS_DIR variable for doc/ root path

Introduce HDF5_DOCS_DIR = \${HDF5_SOURCE_DIR}/doc so that
CMakeInstallation.cmake and future callers reference the doc/
directory symbolically rather than by hardcoded path.
HDF5_DOXYGEN_DIR is now derived from HDF5_DOCS_DIR.
2026-03-31 17:01:54 -06:00

86 lines
1.9 KiB
C

/* -*- c-file-style: "stroustrup" -*- */
#include "hdf5.h"
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
//! <!-- [closing_shop] -->
void
closing_shop(void *ctx)
{
printf("GoodBye, Cruel World!\n");
}
//! <!-- [closing_shop] -->
int
main(void)
{
int ret_val = EXIT_SUCCESS;
//! <!-- [create] -->
{
// an HDF5 library instance is automatically initialized as
// part of the first HDF5 API call, but there's no harm in
// calling H5open().
if (H5open() < 0) {
ret_val = EXIT_FAILURE;
}
}
//! <!-- [create] -->
//! <!-- [read] -->
{
__label__ fail_read;
unsigned majnum, minnum, relnum;
bool flag;
// retrieve the library version
if (H5get_libversion(&majnum, &minnum, &relnum) < 0) {
ret_val = EXIT_FAILURE;
goto fail_read;
}
// is this a thread-safe library build?
if (H5is_library_threadsafe(&flag) < 0) {
ret_val = EXIT_FAILURE;
goto fail_read;
}
printf("Welcome to HDF5 %d.%d.%d\n", majnum, minnum, relnum);
printf("Thread-safety %s\n", (flag > 0) ? "enabled" : "disabled");
fail_read:;
}
//! <!-- [read] -->
//! <!-- [update] -->
{
// update the library instance free list limits
if (H5set_free_list_limits(512 * 1024, 32 * 1024, 2048 * 1024, 128 * 1024, 8192 * 1024, 512 * 1024) <
0) {
ret_val = EXIT_FAILURE;
}
}
//! <!-- [update] -->
//! <!-- [delete] -->
{
#if H5_VERSION_GE(1, 13, 0)
// install a finalization routine
if (H5atclose(&closing_shop, NULL) < 0) {
ret_val = EXIT_FAILURE;
}
#endif
// close shop
if (H5close() < 0) {
ret_val = EXIT_FAILURE;
}
}
//! <!-- [delete] -->
assert(ret_val == EXIT_SUCCESS);
return ret_val;
}