4 Copyright (C) 1995, 1996, 1997 Ovidiu Predescu and Mircea Oancea.
7 Author: Ovidiu Predescu <ovidiu@net-community.com>
10 Based on a similar class written by Mircea Oancea in July 1995.
12 This file is part of libFoundation.
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
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.
28 #if LIB_FOUNDATION_LIBRARY
30 #include <Foundation/UnixSignalHandler.h>
34 #ifndef __UnixSignalHandler_h__
35 #define __UnixSignalHandler_h__
37 #if defined(__MINGW32__)
40 # include <sys/signal.h>
42 #import <Foundation/NSObject.h>
44 @class UnixSignalHandlerList;
46 @interface UnixSignalHandler : NSObject
48 UnixSignalHandlerList *signalHandlers[NSIG];
49 unsigned int currentSigmask;
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;
63 /* Blocking or enabling signals */
64 - (void)blockAllSignals;
65 - (void)enableAllSignals;
66 - (void)blockSignal:(int)signum;
67 - (void)enableSignal:(int)signum;
69 - (void)waitForSignal:(int)signum;
71 - (BOOL)signalsPending;
76 #endif /* __UnixSignalHandler_h__ */