Stxxl  1.3.2
exithandler.h
1 /***************************************************************************
2  * include/stxxl/bits/common/exithandler.h
3  *
4  * Part of the STXXL. See http://stxxl.sourceforge.net
5  *
6  * Copyright (C) 2009 Andreas Beckmann <[email protected]>
7  *
8  * Distributed under the Boost Software License, Version 1.0.
9  * (See accompanying file LICENSE_1_0.txt or copy at
10  * http://www.boost.org/LICENSE_1_0.txt)
11  **************************************************************************/
12 
13 #ifndef STXXL_EXITHANDLER_HEADER
14 #define STXXL_EXITHANDLER_HEADER
15 
16 #include <stxxl/bits/namespace.h>
17 
18 
19 __STXXL_BEGIN_NAMESPACE
20 
21 // There are several possibilities for the exit handlers.
22 // To use the default implementation (which uses atexit()), nothing special has to be done.
23 //
24 // To work around problems with atexit() being used in a dll you may #define STXXL_NON_DEFAULT_EXIT_HANDLER at library compilation time.
25 // In this case the library/application should call stxxl::run_exit_handlers() during shutdown.
26 //
27 // To provide your own exit handler implementation, #define STXXL_EXTERNAL_EXIT_HANDLER and implement
28 // stxxl::register_exit_handler(void (*)(void)) and stxxl::run_exit_handlers() in your application.
29 
30 int register_exit_handler(void (* function)(void));
31 void run_exit_handlers();
32 
33 __STXXL_END_NAMESPACE
34 
35 #endif // !STXXL_EXITHANDLER_HEADER
36 // vim: et:ts=4:sw=4