Update Debian Vcs-* fields to point to git repository
[onak.git] / cleanup.h
1 /*
2  * cleanup.h - Cleanup and shutdown framework.
3  *
4  * Copyright 2004 Jonathan McDowell <noodles@earth.li>
5  *
6  * This program is free software: you can redistribute it and/or modify it
7  * under the terms of the GNU General Public License as published by the Free
8  * Software Foundation; version 2 of the License.
9  *
10  * This program is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13  * more details.
14  *
15  * You should have received a copy of the GNU General Public License along with
16  * this program; if not, write to the Free Software Foundation, Inc., 51
17  * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18  */
19
20 #ifndef __CLEANUP_H__
21 #define __CLEANUP_H__
22
23 #include <stdbool.h>
24
25 /*
26  *      trytocleanup - say we should try to cleanup.
27  *
28  *      This function sets the cleanup flag indicating we want to try and
29  *      cleanup ASAP.
30  */
31 void trytocleanup(void);
32
33 /*
34  *      cleanup - indicate if we should try to cleanup.
35  *
36  *      This function returns a bool which indicates if we want to cleanup and
37  *      exit ASAP.
38  */
39 bool cleanup(void);
40
41 /*
42  *      catchsignals - Register signal handlers for various signals.
43  *
44  *      This function registers a signal handler for various signals (PIPE,
45  *      ALRM, INT, TERM, HUP) that sets the cleanup flag so we try to exit
46  *      ASAP, but cleanly.
47  */
48 void catchsignals(void);
49
50 #endif /* __CLEANUP_H__ */