home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / crt / src / signal.h < prev    next >
C/C++ Source or Header  |  1998-06-17  |  4KB  |  131 lines

  1. /***
  2. *signal.h - defines signal values and routines
  3. *
  4. *       Copyright (c) 1985-1997, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. *       This file defines the signal values and declares the signal functions.
  8. *       [ANSI/System V]
  9. *
  10. *       [Public]
  11. *
  12. ****/
  13.  
  14. #if _MSC_VER > 1000
  15. #pragma once
  16. #endif  /* _MSC_VER > 1000 */
  17.  
  18. #ifndef _INC_SIGNAL
  19. #define _INC_SIGNAL
  20.  
  21. #if !defined (_WIN32) && !defined (_MAC)
  22. #error ERROR: Only Mac or Win32 targets supported!
  23. #endif  /* !defined (_WIN32) && !defined (_MAC) */
  24.  
  25. #ifndef _CRTBLD
  26. /* This version of the header files is NOT for user programs.
  27.  * It is intended for use when building the C runtimes ONLY.
  28.  * The version intended for public use will not have this message.
  29.  */
  30. #error ERROR: Use of C runtime library internal header file.
  31. #endif  /* _CRTBLD */
  32.  
  33. #ifdef __cplusplus
  34. extern "C" {
  35. #endif  /* __cplusplus */
  36.  
  37. #ifndef _INTERNAL_IFSTRIP_
  38. #include <cruntime.h>
  39. #endif  /* _INTERNAL_IFSTRIP_ */
  40.  
  41.  
  42. /* Define _CRTIMP */
  43.  
  44. #ifndef _CRTIMP
  45. #ifdef CRTDLL
  46. #define _CRTIMP __declspec(dllexport)
  47. #else  /* CRTDLL */
  48. #ifdef _DLL
  49. #define _CRTIMP __declspec(dllimport)
  50. #else  /* _DLL */
  51. #define _CRTIMP
  52. #endif  /* _DLL */
  53. #endif  /* CRTDLL */
  54. #endif  /* _CRTIMP */
  55.  
  56. /* Define __cdecl for non-Microsoft compilers */
  57.  
  58. #if (!defined (_MSC_VER) && !defined (__cdecl))
  59. #define __cdecl
  60. #endif  /* (!defined (_MSC_VER) && !defined (__cdecl)) */
  61.  
  62. /* Define _CRTAPI1 (for compatibility with the NT SDK) */
  63.  
  64. #ifndef _CRTAPI1
  65. #if _MSC_VER >= 800 && _M_IX86 >= 300
  66. #define _CRTAPI1 __cdecl
  67. #else  /* _MSC_VER >= 800 && _M_IX86 >= 300 */
  68. #define _CRTAPI1
  69. #endif  /* _MSC_VER >= 800 && _M_IX86 >= 300 */
  70. #endif  /* _CRTAPI1 */
  71.  
  72. #ifndef _SIG_ATOMIC_T_DEFINED
  73. typedef int sig_atomic_t;
  74. #define _SIG_ATOMIC_T_DEFINED
  75. #endif  /* _SIG_ATOMIC_T_DEFINED */
  76.  
  77. #define NSIG 23     /* maximum signal number + 1 */
  78.  
  79.  
  80. /* Signal types */
  81.  
  82. #define SIGINT          2       /* interrupt */
  83. #define SIGILL          4       /* illegal instruction - invalid function image */
  84. #define SIGFPE          8       /* floating point exception */
  85. #define SIGSEGV         11      /* segment violation */
  86. #define SIGTERM         15      /* Software termination signal from kill */
  87. #define SIGBREAK        21      /* Ctrl-Break sequence */
  88. #define SIGABRT         22      /* abnormal termination triggered by abort call */
  89.  
  90.  
  91. /* signal action codes */
  92.  
  93. #define SIG_DFL (void (__cdecl *)(int))0           /* default signal action */
  94. #define SIG_IGN (void (__cdecl *)(int))1           /* ignore signal */
  95. #define SIG_SGE (void (__cdecl *)(int))3           /* signal gets error */
  96. #define SIG_ACK (void (__cdecl *)(int))4           /* acknowledge */
  97.  
  98. #ifndef _INTERNAL_IFSTRIP_
  99. /* internal use only! not valid as an argument to signal() */
  100.  
  101. #define SIG_GET (void (__cdecl *)(int))2           /* accept signal */
  102. #define SIG_DIE (void (__cdecl *)(int))5           /* terminate process */
  103. #endif  /* _INTERNAL_IFSTRIP_ */
  104.  
  105. /* signal error value (returned by signal call on error) */
  106.  
  107. #define SIG_ERR (void (__cdecl *)(int))-1          /* signal error value */
  108.  
  109.  
  110. /* pointer to exception information pointers structure */
  111.  
  112. #if defined (_MT) || defined (_DLL)
  113. extern void * * __cdecl __pxcptinfoptrs(void);
  114. #define _pxcptinfoptrs  (*__pxcptinfoptrs())
  115. #else  /* defined (_MT) || defined (_DLL) */
  116. extern void * _pxcptinfoptrs;
  117. #endif  /* defined (_MT) || defined (_DLL) */
  118.  
  119.  
  120. /* Function prototypes */
  121.  
  122. _CRTIMP void (__cdecl * __cdecl signal(int, void (__cdecl *)(int)))(int);
  123. _CRTIMP int __cdecl raise(int);
  124.  
  125.  
  126. #ifdef __cplusplus
  127. }
  128. #endif  /* __cplusplus */
  129.  
  130. #endif  /* _INC_SIGNAL */
  131.