]> git.ipfire.org Git - thirdparty/squid.git/blob - tools/purge/signal.hh
Renamed squid.h to squid-old.h and config.h to squid.h
[thirdparty/squid.git] / tools / purge / signal.hh
1 //
2 // $Id$
3 //
4 // Author: Jens-S. V?ckler <voeckler@rvs.uni-hannover.de>
5 // File: signal.hh
6 // Date: Sat Feb 28 1998
7 // Compiler: gcc 2.7.2.x series
8 //
9 // Books: W. Richard Steven, "Advanced Programming in the UNIX Environment",
10 // Addison-Wesley, 1992.
11 //
12 // (c) 1998 Lehrgebiet Rechnernetze und Verteilte Systeme
13 // Universit?t Hannover, Germany
14 //
15 // Permission to use, copy, modify, distribute, and sell this software
16 // and its documentation for any purpose is hereby granted without fee,
17 // provided that (i) the above copyright notices and this permission
18 // notice appear in all copies of the software and related documentation,
19 // and (ii) the names of the Lehrgebiet Rechnernetze und Verteilte
20 // Systeme and the University of Hannover may not be used in any
21 // advertising or publicity relating to the software without the
22 // specific, prior written permission of Lehrgebiet Rechnernetze und
23 // Verteilte Systeme and the University of Hannover.
24 //
25 // THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
26 // EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
27 // WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
28 //
29 // IN NO EVENT SHALL THE LEHRGEBIET RECHNERNETZE UND VERTEILTE SYSTEME OR
30 // THE UNIVERSITY OF HANNOVER BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
31 // INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES
32 // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT
33 // ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY,
34 // ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
35 // SOFTWARE.
36 //
37 // Revision 1.4 2000/09/21 10:59:27 cached
38 // introduced extern "C" to function pointer type.
39 //
40 // Revision 1.3 1999/01/19 11:53:49 voeckler
41 // added bool compatibility definitions.
42 //
43 // Revision 1.2 1999/01/19 11:00:50 voeckler
44 // added psignal(int,const char*) compatibility function declaration.
45 //
46 // Revision 1.1 1998/08/13 21:51:58 voeckler
47 // Initial revision
48 //
49 //
50
51 #ifndef _SIGNAL_HH
52 #define _SIGNAL_HH
53
54 #include "squid.h"
55
56 #if HAVE_SIGNAL_H
57 #include <signal.h>
58 #endif
59
60 #if !defined(__cplusplus)
61 #if defined(__GNUC__) || defined(__GNUG__)
62 #pragma interface
63 #else
64 #ifndef HAVE_BOOL
65 #define HAVE_BOOL
66 typedef int bool;
67 #define false 0
68 #define true 1
69 #endif
70 #endif
71 #endif /* __cplusplus */
72
73 #if 1 // so far, all systems I know use void
74 # define SIGRETTYPE void
75 #else
76 # define SIGRETTYPE int
77 #endif
78
79 #if defined(SUNOS) && defined(SUN)
80 # define SIGPARAM void
81 #else // SOLARIS, LINUX, IRIX, AIX, SINIXY
82 # define SIGPARAM int
83 #endif
84
85 extern "C" {
86 typedef SIGRETTYPE SigFunc( SIGPARAM );
87 }
88
89 SigFunc*
90 Signal( int signo, SigFunc* newhandler, bool doInterrupt );
91 // purpose: install reliable signals
92 // paramtr: signo (IN): signal for which a handler is to be installed
93 // newhandler (IN): function pointer to the signal handler
94 // doInterrupt (IN): interrupted system calls wanted!
95 // returns: the old signal handler, or SIG_ERR in case of error.
96
97 SIGRETTYPE
98 sigChild( int signo );
99 // purpose: supply ad hoc child handler with output on stderr
100 // paramtr: signo (IN): == SIGCHLD
101 // returns: only if OS uses a return type for signal handler
102
103 #endif // _SIGNAL_HH