home *** CD-ROM | disk | FTP | other *** search
/ BUG 15 / BUGCD1998_06.ISO / aplic / jbuilder / jruntime.z / exceptions.h < prev    next >
C/C++ Source or Header  |  1997-08-25  |  2KB  |  86 lines

  1. /*
  2.  * @(#)exceptions.h    1.10 96/11/23
  3.  * 
  4.  * Copyright (c) 1995, 1996 Sun Microsystems, Inc. All Rights Reserved.
  5.  * 
  6.  * This software is the confidential and proprietary information of Sun
  7.  * Microsystems, Inc. ("Confidential Information").  You shall not
  8.  * disclose such Confidential Information and shall use it only in
  9.  * accordance with the terms of the license agreement you entered into
  10.  * with Sun.
  11.  * 
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
  13.  * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  14.  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  15.  * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
  16.  * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
  17.  * THIS SOFTWARE OR ITS DERIVATIVES.
  18.  * 
  19.  * CopyrightVersion 1.1_beta
  20.  * 
  21.  */
  22.  
  23. /*
  24.  * The Java runtime exception handling mechanism.
  25.  */
  26.  
  27. #ifndef _EXCEPTIONS_H_
  28. #define _EXCEPTIONS_H_
  29.  
  30. /*
  31.  * Header files.
  32.  */
  33.  
  34. #include "oobj.h"
  35. #include "threads.h"
  36.  
  37. /*
  38.  * Type definitions.
  39.  */
  40.  
  41. /*
  42.  * Exceptions, as defined in the Java93 spec, are subclasses of Object.
  43.  *
  44.  * The list of exceptions thrown by the runtime and other commonly
  45.  * used classes can be found in StandardDefs.gt.
  46.  */
  47. typedef JHandle *exception_t;
  48.  
  49. /*
  50.  * The exception mechanism has a set of preallocated exception objects
  51.  * that can be thrown in the face of utter confusion and system meltdown.
  52.  * internal_exception_t enumerates these objects.
  53.  */
  54. typedef enum {
  55.     IEXC_NONE,                    /* A null object */
  56.     IEXC_NoClassDefinitionFound,
  57.     IEXC_OutOfMemory,
  58.     IEXC_END                    /* Keep this last */
  59. } internal_exception_t;
  60.  
  61.  
  62. /*
  63.  * External routines.
  64.  */
  65.  
  66. /*
  67.  * exceptionInit() -- Initialize the exception subsystem.
  68.  */
  69. extern void exceptionInit(void);
  70.  
  71. /*
  72.  * exceptionInternalObject() -- Return an internal, preallocated
  73.  *    exception object.  These are shared by all threads, so they
  74.  *    should only be used in a last ditch effort.
  75.  */
  76. extern JHandle *exceptionInternalObject(internal_exception_t exc);
  77.  
  78. /*
  79.  * exceptionDescribe() -- Print out a description of a given exception
  80.  *     object.
  81.  */
  82. extern void exceptionDescribe(struct execenv *ee);
  83.  
  84. #endif /* !_EXCEPTIONS_H_ */
  85.  
  86.