summaryrefslogtreecommitdiffstats
path: root/src/H5HGtrap.c
blob: e7918293501d86c6539c2debdd958d0ff5706d0c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * Copyright by The HDF Group.                                               *
 * All rights reserved.                                                      *
 *                                                                           *
 * This file is part of HDF5.  The full HDF5 copyright notice, including     *
 * terms governing use, modification, and redistribution, is contained in    *
 * the COPYING file, which can be found at the root of the source code       *
 * distribution tree, or in https://www.hdfgroup.org/licenses.               *
 * If you do not have access to either file, you may request a copy from     *
 * help@hdfgroup.org.                                                        *
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

/****************/
/* Module Setup */
/****************/

#include "H5HGmodule.h" /* This source code file is part of the H5HG module */

/*
 * Headers
 */
#include "H5private.h"  /* Generic Functions			*/
#include "H5Eprivate.h" /* Error handling		  	*/
#include "H5HGpkg.h"    /* Global heaps				*/

/* H5HG_trap() is an instrumentation point for the global heap.
 * The H5HG_trap() result modifies the global heap's treatment of
 * an unexpected condition that ordinarily would cause an
 * HDassert() statement to abort the program.
 *
 * Currently, just one function, H5HG_read(), calls H5HG_trap(), using
 * the `reason` string "out of bounds".
 *
 * Test programs such as test/vfd_swmr_vlstr_{reader,writer}.c provide
 * their own H5HG_trap() implementation that overrides the one in the library.
 *
 * H5HG_trap() returns `true` if the caller should generate an error-stack
 * entry and return an error code to the caller's caller.
 *
 * H5HG_trap() returns `false` if the caller should blithely carry on;
 * if NDEBUG is not #defined, then the caller will ordinarily abort the
 * program in a subsequent HDassert() statement.
 */
bool
H5HG_trap(const char *reason)
{
    return false;
}