home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1997 May / Pcwk0597.iso / sybase / starbuck / java.z / exceptions.h < prev    next >
C/C++ Source or Header  |  1996-05-03  |  2KB  |  83 lines

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