1
{ Copyright 2000-2005 The Apache Software Foundation or its licensors, as
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
8
* http://www.apache.org/licenses/LICENSE-2.0
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
19
* @brief APR Signal Handling
23
#include "apr_pools.h"
30
* @defgroup apr_signal Handling
34
{$if defined(APR_HAVE_SIGACTION) or defined(DOXYGEN)}
37
{ work around Darwin header file bugs
38
* http://www.opensource.apple.com/bugs/X/BSD%20Kernel/2657228.html
43
#define SIG_DFL (void ( *)(int))0
44
#define SIG_IGN (void ( *)(int))1
45
#define SIG_ERR (void ( *)(int))-1
48
{ Function prototype for signal handlers }
49
type apr_sigfunc_t = procedure(para: cint);
52
* Set the signal handler function for a given signal
53
* @param signo The signal (eg... SIGWINCH)
54
* @param func the function to get called
56
function apr_signal(signo: Integer; func: apr_sigfunc_t): Papr_sigfunc_t;
57
{$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
58
external LibAPR name LibNamePrefix + 'apr_signal' + LibSuff8;
60
{if defined(SIG_IGN) && !defined(SIG_ERR)
61
#define SIG_ERR ((apr_sigfunc_t *) -1)
64
#else} { !APR_HAVE_SIGACTION }
65
{#define apr_signal(a, b) signal(a, b)
70
* Get the description for a specific signal number
71
* @param signum The signal number
72
* @return The description of the signal
74
function apr_signal_description_get(signo: Integer): PChar;
75
{$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
76
external LibAPR name LibNamePrefix + 'apr_signal_description_get' + LibSuff4;
78
{ @deprecated @see apr_signal_description_get }
79
function apr_signal_get_description(signo: Integer): PChar;
80
{$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
81
external LibAPR name LibNamePrefix + 'apr_signal_get_description' + LibSuff4;
84
* APR-private function for initializing the signal package
86
* @param pglobal The internal, global pool
88
//void apr_signal_init(apr_pool_t *pglobal);