diff options
author | Christian Grothoff <christian@grothoff.org> | 2009-05-29 00:46:26 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2009-05-29 00:46:26 +0000 |
commit | 0a217a8df1657b4334b55b0e4a6c7837a8dbcfd9 (patch) | |
tree | 6b552f40eb089db96409a312a98d9b12bd669102 /src/include/gnunet_signal_lib.h | |
download | gnunet-0a217a8df1657b4334b55b0e4a6c7837a8dbcfd9.tar.gz gnunet-0a217a8df1657b4334b55b0e4a6c7837a8dbcfd9.zip |
ng
Diffstat (limited to 'src/include/gnunet_signal_lib.h')
-rw-r--r-- | src/include/gnunet_signal_lib.h | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/src/include/gnunet_signal_lib.h b/src/include/gnunet_signal_lib.h new file mode 100644 index 000000000..af1ec0de4 --- /dev/null +++ b/src/include/gnunet_signal_lib.h | |||
@@ -0,0 +1,73 @@ | |||
1 | /* | ||
2 | This file is part of GNUnet. | ||
3 | (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009 Christian Grothoff (and other contributing authors) | ||
4 | |||
5 | GNUnet is free software; you can redistribute it and/or modify | ||
6 | it under the terms of the GNU General Public License as published | ||
7 | by the Free Software Foundation; either version 2, or (at your | ||
8 | option) any later version. | ||
9 | |||
10 | GNUnet is distributed in the hope that it will be useful, but | ||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU General Public License | ||
16 | along with GNUnet; see the file COPYING. If not, write to the | ||
17 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
18 | Boston, MA 02111-1307, USA. | ||
19 | */ | ||
20 | |||
21 | /** | ||
22 | * @file include/gnunet_signal_lib.h | ||
23 | * @brief functions related to signals | ||
24 | * @author Christian Grothoff | ||
25 | */ | ||
26 | |||
27 | #ifndef GNUNET_SIGNAL_LIB_H | ||
28 | #define GNUNET_SIGNAL_LIB_H | ||
29 | |||
30 | #ifdef __cplusplus | ||
31 | extern "C" | ||
32 | { | ||
33 | #if 0 /* keep Emacsens' auto-indent happy */ | ||
34 | } | ||
35 | #endif | ||
36 | #endif | ||
37 | |||
38 | struct GNUNET_SIGNAL_Context; | ||
39 | |||
40 | /** | ||
41 | * A signal handler. Since different OSes have different signatures | ||
42 | * for their handlers, the API only gives the most restrictive | ||
43 | * signature -- no arguments, no return value. Note that this will | ||
44 | * work even if the OS expects a function with arguments. However, | ||
45 | * the implementation must guarantee that this handler is not called | ||
46 | * for signals other than the one that it has been registered for. | ||
47 | */ | ||
48 | typedef void (*GNUNET_SIGNAL_Handler) (void); | ||
49 | |||
50 | /** | ||
51 | * Install a signal handler that will be run if the | ||
52 | * given signal is received. | ||
53 | */ | ||
54 | struct GNUNET_SIGNAL_Context *GNUNET_SIGNAL_handler_install (int signal, | ||
55 | GNUNET_SIGNAL_Handler | ||
56 | handler); | ||
57 | |||
58 | /** | ||
59 | * Uninstall a previously installed signal hander. | ||
60 | */ | ||
61 | void GNUNET_SIGNAL_handler_uninstall (struct GNUNET_SIGNAL_Context *ctx); | ||
62 | |||
63 | |||
64 | #if 0 /* keep Emacsens' auto-indent happy */ | ||
65 | { | ||
66 | #endif | ||
67 | #ifdef __cplusplus | ||
68 | } | ||
69 | #endif | ||
70 | |||
71 | /* ifndef GNUNET_SIGNAL_LIB_H */ | ||
72 | #endif | ||
73 | /* end of gnunet_signal_lib.h */ | ||