00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00039 #ifndef __LIBSB_SIG_H__
00040 #define __LIBSB_SIG_H__
00041 
00042 
00043 #ifdef HAVE_CONFIG_H
00044 #  include <config.h>
00045 #endif
00046 
00047 #include <signal.h>
00048 
00049 #if defined(__cplusplus)
00050 extern "C" {
00051 #endif
00052 
00053 
00054 
00056 #ifdef NSIG
00057     #define MAX_SIGNALS NSIG
00058 #else
00059     #ifdef _NSIG
00060         #define MAX_SIGNALS _NSIG
00061     #else
00062         #define MAX_SIGNALS 65
00063     #endif
00064 #endif
00065 
00066 
00067 
00069 typedef void (*sb_signal_handler_t)(int signum);
00070 
00071 
00072     
00077 int sb_signal_init(void);
00078 
00079 
00080 
00085 int sb_signal_is_initialized(void);
00086 
00087 
00088 
00095 int sb_signal_set_handler(int signum, sb_signal_handler_t handler);
00096  
00097 
00098 
00104 int sb_signal_restore_handler(int signum);
00105  
00106 
00107 
00112 int sb_signal_restore_all_handlers(void);
00113  
00114 
00115 
00116 #if defined(__cplusplus)
00117 }
00118 #endif
00119 
00120 #endif
00121 
00122