home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1997 May / Pcwk0597.iso / sybase / starbuck / h.z / EXCPT.H < prev    next >
C/C++ Source or Header  |  1996-02-28  |  2KB  |  69 lines

  1. /*
  2.  *  excpt.h    Structured Exception Handling types, defines and routines
  3.  *
  4.  *  Copyright by WATCOM International Corp. 1988-1996.  All rights reserved.
  5.  */
  6. #ifndef _EXCPT_H_INCLUDED
  7. #define _EXCPT_H_INCLUDED
  8. #define _INC_EXCPT
  9. #ifdef __cplusplus
  10. extern "C" {
  11. #endif
  12.  
  13.  
  14. /*
  15.  * Exception disposition return values.
  16.  */
  17. typedef enum _EXCEPTION_DISPOSITION {
  18.     ExceptionContinueExecution,
  19.     ExceptionContinueSearch,
  20.     ExceptionNestedException,
  21.     ExceptionCollidedUnwind
  22. } EXCEPTION_DISPOSITION;
  23.  
  24.  
  25. /*
  26.  * Prototype for SEH support function.
  27.  */
  28. struct _EXCEPTION_RECORD;
  29. struct _CONTEXT;
  30.  
  31. EXCEPTION_DISPOSITION __cdecl _except_handler (
  32.     struct _EXCEPTION_RECORD *ExceptionRecord,
  33.     void * EstablisherFrame,
  34.     struct _CONTEXT *ContextRecord,
  35.     void * DispatcherContext
  36.     );
  37.  
  38. /*
  39.  * Keywords and intrinsics for SEH
  40.  */
  41. #define __try        _try
  42. #define __except    _except
  43. #define __finally    _finally
  44. #define __leave        _leave
  45. #define GetExceptionCode        *(unsigned long*)_exception_code
  46. #define exception_code            *(unsigned long*)_exception_code
  47. #define GetExceptionInformation     (struct _EXCEPTION_POINTERS *)_exception_info
  48. #define exception_info            (struct _EXCEPTION_POINTERS *)_exception_info
  49. #define AbnormalTermination        _abnormal_termination
  50. #define abnormal_termination        _abnormal_termination
  51.  
  52. unsigned long __cdecl _exception_code(void);
  53. void *          __cdecl _exception_info(void);
  54. int          __cdecl _abnormal_termination(void);
  55.  
  56.  
  57. /*
  58.  * Legal values for expression in except().
  59.  */
  60. #define EXCEPTION_EXECUTE_HANDLER     1
  61. #define EXCEPTION_CONTINUE_SEARCH     0
  62. #define EXCEPTION_CONTINUE_EXECUTION    -1
  63.  
  64.  
  65. #ifdef __cplusplus
  66. };
  67. #endif
  68. #endif
  69.