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