apr_signal.inc 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. { Copyright 2000-2005 The Apache Software Foundation or its licensors, as
  2. * applicable.
  3. *
  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
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  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.
  15. }
  16. {
  17. * @file apr_signal.h
  18. * @brief APR Signal Handling
  19. }
  20. {#include "apr.h"
  21. #include "apr_pools.h"
  22. #if APR_HAVE_SIGNAL_H
  23. #include <signal.h>
  24. #endif}
  25. {
  26. * @defgroup apr_signal Handling
  27. * @ingroup APR
  28. }
  29. {$if defined(APR_HAVE_SIGACTION) or defined(DOXYGEN)}
  30. {$ifdef DARWIN}
  31. { work around Darwin header file bugs
  32. * http://www.opensource.apple.com/bugs/X/BSD%20Kernel/2657228.html
  33. }
  34. #undef SIG_DFL
  35. #undef SIG_IGN
  36. #undef SIG_ERR
  37. #define SIG_DFL (void ( *)(int))0
  38. #define SIG_IGN (void ( *)(int))1
  39. #define SIG_ERR (void ( *)(int))-1
  40. {$endif}
  41. { Function prototype for signal handlers }
  42. type apr_sigfunc_t = procedure(para: cint);
  43. {
  44. * Set the signal handler function for a given signal
  45. * @param signo The signal (eg... SIGWINCH)
  46. * @param func the function to get called
  47. }
  48. function apr_signal(signo: Integer; func: apr_sigfunc_t): Papr_sigfunc_t;
  49. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  50. external LibAPR name LibNamePrefix + 'apr_signal' + LibSuff8;
  51. {if defined(SIG_IGN) && !defined(SIG_ERR)
  52. #define SIG_ERR ((apr_sigfunc_t *) -1)
  53. #endif
  54. #else} { !APR_HAVE_SIGACTION }
  55. {#define apr_signal(a, b) signal(a, b)
  56. #endif}
  57. {
  58. * Get the description for a specific signal number
  59. * @param signum The signal number
  60. * @return The description of the signal
  61. }
  62. function apr_signal_description_get(signo: Integer): PChar;
  63. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  64. external LibAPR name LibNamePrefix + 'apr_signal_description_get' + LibSuff4;
  65. { @deprecated @see apr_signal_description_get }
  66. function apr_signal_get_description(signo: Integer): PChar;
  67. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  68. external LibAPR name LibNamePrefix + 'apr_signal_get_description' + LibSuff4;
  69. {
  70. * APR-private function for initializing the signal package
  71. * @internal
  72. * @param pglobal The internal, global pool
  73. }
  74. //void apr_signal_init(apr_pool_t *pglobal);
  75. {$endif}