home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / modu1096.zip / ISOsym / exceptions.def < prev    next >
Text File  |  1996-09-23  |  2KB  |  44 lines

  1. DEFINITION MODULE EXCEPTIONS;
  2.  
  3.  (*
  4.   *  Provides facilities for raising user exceptions
  5.   *  and for making enquiries concerning the current execution state.
  6.   *)
  7.  
  8.   TYPE ExceptionSource;        (* values of this type are used within
  9.                    library modules to identify the source
  10.                    of raised exceptions            *)
  11.   ExceptionNumber = CARDINAL;
  12.  
  13.  
  14.   PROCEDURE AllocateSource(VAR newSource : ExceptionSource);
  15.     (* Allocates a unique value of type ExceptionSource *)
  16.  
  17.   PROCEDURE RAISE(source : ExceptionSource; number : ExceptionNumber;
  18.           message : ARRAY OF CHAR);
  19.     (* Associates the given values of source, number and message with
  20.      * the current context and raises an exception    *)
  21.  
  22.   PROCEDURE CurrentNumber(source : ExceptionSource) : ExceptionNumber;
  23.     (* If the current coroutine is in the exceptional execution state *
  24.      * because of the raising of an exception from source, return the *
  25.      * corresponding number, and otherwise raises an exception        *)
  26.  
  27.   PROCEDURE GetMessage(VAR text : ARRAY OF CHAR);
  28.     (* If the current coroutine is in the exceptional execution state *
  29.      * returns the possibly truncated string associated with the      *
  30.      * current context, otherwise in normal execution state returns   *
  31.      * the empty string                              *)
  32.  
  33.   PROCEDURE IsCurrentSource(source : ExceptionSource) : BOOLEAN;
  34.     (* If the current coroutine is in the exceptional execution state *
  35.      * because of the raising of an exception from source,            *
  36.      * returns TRUE, and otherwise returns FALSE              *)
  37.  
  38.   PROCEDURE IsExceptionalExecution() : BOOLEAN;
  39.     (* If the current coroutine is in the exceptional execution state *
  40.      * because of the raising of an exception, returns TRUE and       *
  41.      * otherwise returns FALSE                          *)
  42.  
  43. END EXCEPTIONS.
  44.