home *** CD-ROM | disk | FTP | other *** search
/ Solo Programadores 22 / SOLO_22.iso / packages / win32ada / data.z / win32-signal.ads < prev    next >
Encoding:
Text File  |  1996-03-15  |  3.4 KB  |  74 lines

  1. -- $Source: /home/harp/1/proto/monoBANK/winnt/win32-signal.ads,v $ 
  2. -- $Revision: 1.8 $ $Date: 96/03/15 12:55:52 $ $Author: stm $ 
  3. -- See end of file for Copyright (c) information.
  4.  
  5. with Ada.Unchecked_Conversion;
  6.  
  7. package Win32.Signal is
  8.  
  9.     NSIG     : constant := 23;                              -- signal.h:49
  10.     SIGINT   : constant := 2;                               -- signal.h:53
  11.     SIGILL   : constant := 4;                               -- signal.h:54
  12.     SIGFPE   : constant := 8;                               -- signal.h:55
  13.     SIGSEGV  : constant := 11;                              -- signal.h:56
  14.     SIGTERM  : constant := 15;                              -- signal.h:57
  15.     SIGBREAK : constant := 21;                              -- signal.h:58
  16.     SIGABRT  : constant := 22;                              -- signal.h:59
  17.  
  18.     type Handler is access procedure (
  19.         sig    : in Win32.INT;
  20.         subcode: in Win32.INT := 0);
  21.     pragma Convention(Stdcall, Handler);
  22.  
  23.     SIG_DFL: constant Handler;                              -- signal.h:64
  24.     SIG_IGN: constant Handler;                              -- signal.h:65
  25.     SIG_SGE: constant Handler;                              -- signal.h:66
  26.     SIG_ACK: constant Handler;                              -- signal.h:67
  27.     SIG_ERR: constant Handler;                              -- signal.h:72
  28.  
  29.     type sig_atomic_t is new Win32.INT;                     -- signal.h:45
  30.  
  31.     function pxcptinfoptrs return Win32.PVOID;              -- signal.h:77
  32.  
  33.     function signal(sig : Win32.INT;
  34.                     func: Handler)
  35.                         return Handler;                     -- signal.h:85
  36.  
  37.     function c_raise(sig: Win32.INT) return Win32.INT;      -- signal.h:86
  38.  
  39. private
  40.  
  41.     function To_Handler is new Ada.Unchecked_Conversion(Win32.DWORD, Handler);
  42.  
  43.     SIG_DFL: constant Handler := To_Handler(0);             -- signal.h:64
  44.     SIG_IGN: constant Handler := To_Handler(1);             -- signal.h:65
  45.     SIG_SGE: constant Handler := To_Handler(3);             -- signal.h:66
  46.     SIG_ACK: constant Handler := To_Handler(4);             -- signal.h:67
  47.     SIG_ERR: constant Handler := To_Handler(Win32.DWORD'Last); -- signal.h:72
  48.  
  49.     pragma Inline(pxcptinfoptrs);
  50.  
  51.     pragma Import(C, signal, "signal");                     -- signal.h:85
  52.     pragma Import(C, c_raise, "raise");                     -- signal.h:86
  53.  
  54. -------------------------------------------------------------------------------
  55. --
  56. -- THIS FILE AND ANY ASSOCIATED DOCUMENTATION IS PROVIDED WITHOUT CHARGE
  57. -- "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING
  58. -- BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR
  59. -- FITNESS FOR A PARTICULAR PURPOSE.  The user assumes the entire risk as to
  60. -- the accuracy and the use of this file.  This file may be used, copied,
  61. -- modified and distributed only by licensees of Microsoft Corporation's
  62. -- WIN32 Software Development Kit in accordance with the terms of the 
  63. -- licensee's End-User License Agreement for Microsoft Software for the
  64. -- WIN32 Development Kit.
  65. --
  66. -- Copyright (c) Intermetrics, Inc. 1995
  67. -- Portions (c) 1985-1994 Microsoft Corporation with permission.
  68. -- Microsoft is a registered trademark and Windows and Windows NT are
  69. -- trademarks of Microsoft Corporation.
  70. --
  71. -------------------------------------------------------------------------------
  72.  
  73. end Win32.Signal;
  74.