home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / adav313.zip / gnat-3_13p-os2-bin-20010916.zip / emx / gnatlib / g-curexc.ads < prev    next >
Text File  |  2000-07-19  |  5KB  |  91 lines

  1. ------------------------------------------------------------------------------
  2. --                                                                          --
  3. --                         GNAT LIBRARY COMPONENTS                          --
  4. --                                                                          --
  5. --                    C U R R E N T _ E X C E P T I O N                     --
  6. --                                                                          --
  7. --                                 S p e c                                  --
  8. --                                                                          --
  9. --                            $Revision: 1.1 $                              --
  10. --                                                                          --
  11. --         Copyright (C) 1996-1999 Ada Core Technologies, Inc.              --
  12. --                                                                          --
  13. -- GNAT is free software;  you can  redistribute it  and/or modify it under --
  14. -- terms of the  GNU General Public License as published  by the Free Soft- --
  15. -- ware  Foundation;  either version 2,  or (at your option) any later ver- --
  16. -- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
  17. -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
  18. -- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
  19. -- for  more details.  You should have  received  a copy of the GNU General --
  20. -- Public License  distributed with GNAT;  see file COPYING.  If not, write --
  21. -- to  the Free Software Foundation,  59 Temple Place - Suite 330,  Boston, --
  22. -- MA 02111-1307, USA.                                                      --
  23. --                                                                          --
  24. -- As a special exception,  if other files  instantiate  generics from this --
  25. -- unit, or you link  this unit with other files  to produce an executable, --
  26. -- this  unit  does not  by itself cause  the resulting  executable  to  be --
  27. -- covered  by the  GNU  General  Public  License.  This exception does not --
  28. -- however invalidate  any other reasons why  the executable file  might be --
  29. -- covered by the  GNU Public License.                                      --
  30. --                                                                          --
  31. -- GNAT was originally developed  by the GNAT team at  New York University. --
  32. -- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
  33. --                                                                          --
  34. ------------------------------------------------------------------------------
  35.  
  36. --  This package provides routines for obtaining the current exception
  37. --  information in Ada 83 style. In Ada 83, there was no official method
  38. --  for obtaining exception information, but a number of vendors supplied
  39. --  routines for this purpose, and this package closely approximates the
  40. --  interfaces supplied by DEC Ada 83 and VADS Ada.
  41.  
  42. package GNAT.Current_Exception is
  43. pragma Pure (Current_Exception);
  44.  
  45.    -----------------
  46.    -- Subprograms --
  47.    -----------------
  48.  
  49.    function Exception_Information return String;
  50.    --  Returns the result of calling Ada.Exceptions.Exception_Information
  51.    --  with an argument that is the Exception_Occurrence corresponding to
  52.    --  the current exception. Returns the null string if called from outside
  53.    --  an exception handler.
  54.  
  55.    function Exception_Message return String;
  56.    --  Returns the result of calling Ada.Exceptions.Exception_Message with
  57.    --  an argument that is the Exception_Occurrence corresponding to the
  58.    --  current exception. Returns the null string if called from outside an
  59.    --  exception handler.
  60.  
  61.    function Exception_Name return String;
  62.    --  Returns the result of calling Ada.Exceptions.Exception_Name with
  63.    --  an argument that is the Exception_Occurrence corresponding to the
  64.    --  current exception. Returns the null string if called from outside an
  65.    --  exception handler.
  66.  
  67.    -----------------------------------
  68.    -- Use of Library Level Renaming --
  69.    -----------------------------------
  70.  
  71.    --  For greater compatibility with existing legacy software, library
  72.    --  level renaming may be used to create a function with a name matching
  73.    --  one that is in use. For example, some versions of VADS Ada provided
  74.    --  a functin called Current_Exception whose semantics was identical to
  75.    --  that of GNAT. The following library level renaming declaration:
  76.  
  77.    --    with GNAT.Current_Exception;
  78.    --    function Current_Exception
  79.    --      renames GNAT.Current_Exception.Exception_Name;
  80.  
  81.    --  placed in a file called current_exception.ads and compiled into the
  82.    --  application compilation environment, will make the function available
  83.    --  in a manner exactly compatible with that in VADS Ada 83.
  84.  
  85. private
  86.    pragma Import (Intrinsic, Exception_Information);
  87.    pragma Import (intrinsic, Exception_Message);
  88.    pragma Import (Intrinsic, Exception_Name);
  89.  
  90. end GNAT.Current_Exception;
  91.