]> err.no Git - sope/blob - sope-appserver/NGObjWeb/UnixSignalHandler.h
major improvements in resource/template lookup with SoProduct's
[sope] / sope-appserver / NGObjWeb / UnixSignalHandler.h
1 /*
2    UnixSignalHandler.h
3
4    Copyright (C) 1995, 1996, 1997 Ovidiu Predescu and Mircea Oancea.
5    
6
7    Author: Ovidiu Predescu <ovidiu@net-community.com>
8    Date: November 1997
9
10    Based on a similar class written by Mircea Oancea in July 1995.
11
12    This file is part of libFoundation.
13
14    Permission to use, copy, modify, and distribute this software and its
15    documentation for any purpose and without fee is hereby granted, provided
16    that the above copyright notice appear in all copies and that both that
17    copyright notice and this permission notice appear in supporting
18    documentation.
19
20    We disclaim all warranties with regard to this software, including all
21    implied warranties of merchantability and fitness, in no event shall
22    we be liable for any special, indirect or consequential damages or any
23    damages whatsoever resulting from loss of use, data or profits, whether in
24    an action of contract, negligence or other tortious action, arising out of
25    or in connection with the use or performance of this software.
26 */
27
28 #if LIB_FOUNDATION_LIBRARY
29
30 #include <Foundation/UnixSignalHandler.h>
31
32 #else
33
34 #ifndef __UnixSignalHandler_h__
35 #define __UnixSignalHandler_h__
36
37 #if defined(__MINGW32__)
38 #  include <signal.h>
39 #else
40 #  include <sys/signal.h>
41 #endif
42 #import <Foundation/NSObject.h>
43
44 @class UnixSignalHandlerList;
45
46 @interface UnixSignalHandler : NSObject
47 {
48   UnixSignalHandlerList *signalHandlers[NSIG];
49   unsigned int          currentSigmask;
50   BOOL                  signalsPending;
51 }
52
53 + sharedHandler;
54
55 - (void)addObserver:(id)observer
56   selector:(SEL)selector
57   forSignal:(int)signalNumber
58   immediatelyNotifyOnSignal:(BOOL)flag;
59 - (void)removeObserver:(id)observer;
60 - (void)removeObserver:(id)observer
61   forSignal:(int)signalNumber;
62
63 /* Blocking or enabling signals */
64 - (void)blockAllSignals;
65 - (void)enableAllSignals;
66 - (void)blockSignal:(int)signum;
67 - (void)enableSignal:(int)signum;
68
69 - (void)waitForSignal:(int)signum;
70
71 - (BOOL)signalsPending;
72
73 @end
74
75
76 #endif /* __UnixSignalHandler_h__ */
77
78 #endif
79
80 /*
81   Local Variables:
82   c-basic-offset: 4
83   tab-width: 8
84   End:
85 */