Main Page | Namespace List | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

exit.h

Go to the documentation of this file.
00001 #ifndef _exit_h_defined_
00002 #define _exit_h_defined_
00003 
00004 /*!
00005  * @file exit.h
00006  *
00007  * @brief Exit codes for JVM diagnostics.
00008  *
00009  * Notice that if a Java program calls @c @b System.exit() ,
00010  * then the system call @c @b exit(2) will @e still be made, but
00011  * with that requested exit code, having nothing to do with
00012  * these codes.  However, Most exit situations are set up
00013  * with @c @b fprintf(stderr) immediately before the
00014  * @c @b exit(2) call itself, so console output should demonstrate
00015  * proper context if there is ever a question.
00016  *
00017  *
00018  * @section Control
00019  *
00020  * \$URL: https://svn.apache.org/path/name/exit.h $ \$Id: exit.h 0 09/28/2005 dlydick $
00021  *
00022  * Copyright 2005 The Apache Software Foundation
00023  * or its licensors, as applicable.
00024  *
00025  * Licensed under the Apache License, Version 2.0 ("the License");
00026  * you may not use this file except in compliance with the License.
00027  * You may obtain a copy of the License at
00028  *
00029  *     http://www.apache.org/licenses/LICENSE-2.0
00030  *
00031  * Unless required by applicable law or agreed to in writing,
00032  * software distributed under the License is distributed on an
00033  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
00034  * either express or implied.
00035  *
00036  * See the License for the specific language governing permissions
00037  * and limitations under the License.
00038  *
00039  * @version \$LastChangedRevision: 0 $
00040  *
00041  * @date \$LastChangedDate: 09/28/2005 $
00042  *
00043  * @author \$LastChangedBy: dlydick $
00044  *         Original code contributed by Daniel Lydick on 09/28/2005.
00045  *
00046  * @section Reference
00047  *
00048  */
00049 
00050 ARCH_COPYRIGHT_APACHE(exit, h, "$URL: https://svn.apache.org/path/name/exit.h $ $Id: exit.h 0 09/28/2005 dlydick $");
00051 
00052 
00053 /*!
00054  * @name Exit code enumeration definitions and name strings.
00055  *
00056  * @brief Codes and null-terminated strings for constructing
00057  * @link #exit_code_enum exit_code_enum enum@endlink and
00058  * @link #exit_get_name exit_get_name() switch@endlink, respectively.
00059  *
00060  * @b NEVER change definition of
00061  * @link #EXIT_MAIN_OKAY EXIT_MAIN_OKAY@endlink!  It is
00062  * the normal return from @link #exit_init() exit_init()@endlink
00063  * function by virtue of @c @b setjmp(3) definition.
00064  *
00065  * @b NEVER change the definition of
00066  * @link #EXIT_LONGJMP_ARGERROR EXIT_LONGJMP_ARGERROR@endlink!
00067  * It is defined by @c @b longjmp(3) when an attempt is made to
00068  * use @link #EXIT_MAIN_OKAY EXIT_MAIN_OKAY@endlink as
00069  * its return code.
00070  *
00071  */
00072 
00073 /*@{ */ /* Begin grouped definitions */
00074 
00075 #ifdef I_AM_EXIT_C
00076 #define EXIT_MAIN_OKAY_DESC        "no error"
00077 #define EXIT_LONGJMP_ARGERROR_DESC "longjmp(3) argument error"
00078 
00079 #define EXIT_ARGV_HELP_DESC        "help request"
00080 #define EXIT_ARGV_VERSION_DESC     "version request"
00081 #define EXIT_ARGV_COPYRIGHT_DESC   "copyright request"
00082 #define EXIT_ARGV_LICENSE_DESC     "license request"
00083 #define EXIT_ARGV_ENVIRONMENT_DESC "environment request"
00084 
00085 #define EXIT_JVM_THREAD_DESC       "thread start error"
00086 #define EXIT_JVM_CLASS_DESC        "class load error"
00087 #define EXIT_JVM_OBJECT_DESC       "object load error"
00088 #define EXIT_JVM_METHOD_DESC       "method invocation error"
00089 #define EXIT_JVM_FIELD_DESC        "field access error"
00090 #define EXIT_JVM_ATTRIBUTE_DESC    "attribute access error"
00091 #define EXIT_JVM_THROWABLE_DESC    "throwable event abort"
00092 #define EXIT_JVM_SIGNAL_DESC       "OS signal abort trapped"
00093 #define EXIT_JVM_BYTECODE_DESC     "JVM byte code execution error"
00094 #define EXIT_JVM_GC_DESC           "Garbage collection error"
00095 #define EXIT_JVM_INTERNAL_DESC     "Internal JVM logic error"
00096 
00097 #define EXIT_HEAP_ALLOC_DESC       "Heap allocation error"
00098 #define EXIT_GC_ALLOC_DESC         "Garbage collection heap error"
00099 #define EXIT_THREAD_STACK_DESC     "Stack overflow suppressed"
00100 #define EXIT_TIMESLICE_START_DESC  "cannot start timer"
00101 #define EXIT_TMPAREA_MKDIR_DESC    "cannot make temp directory"
00102 #define EXIT_TMPAREA_RMDIR_DESC    "cannot remove temp directory"
00103 #define EXIT_CLASSPATH_JAR_DESC    "cannot run jar command"
00104 #define EXIT_MANIFEST_JAR_DESC     "cannot process jar manifest file"
00105 #endif
00106 
00107 typedef enum
00108 {
00109     EXIT_MAIN_OKAY        = 0, /**< Everything went fine.
00110                                     No Java code called
00111                                    @c @b java.lang.System.exit() ,
00112                                     either. */
00113     EXIT_LONGJMP_ARGERROR = 1, /**< @c @b longjmp(3) called with 0 arg*/
00114 
00115 /* Command line conditions and errors */
00116     EXIT_ARGV_HELP        = 10, /**< @b Help invoked on command line */
00117     EXIT_ARGV_VERSION     = 11,/**< @b Version invoked on command line*/
00118     EXIT_ARGV_COPYRIGHT   = 12, /**< @b Copyright invoked on cmd line */
00119     EXIT_ARGV_LICENSE     = 13, /**< @b Copyright invoked on cmd line */
00120     EXIT_ARGV_ENVIRONMENT = 14, /**< Environment variable error */
00121 
00122 /* JVM fatal runtime errors */
00123     EXIT_JVM_THREAD       = 20, /**< Thread start error */
00124     EXIT_JVM_CLASS        = 21, /**< Class load error */
00125     EXIT_JVM_OBJECT       = 22, /**< Object load error */
00126     EXIT_JVM_METHOD       = 23, /**< Method invocation error */
00127     EXIT_JVM_FIELD        = 24, /**< Field access error */
00128     EXIT_JVM_ATTRIBUTE    = 25, /**< Attribute access error */
00129     EXIT_JVM_THROWABLE    = 26, /**< Throwable event abort */
00130     EXIT_JVM_SIGNAL       = 27, /**< OS signal abort trapped */
00131     EXIT_JVM_BYTECODE     = 28, /**< JVM byte code execution error */
00132     EXIT_JVM_GC           = 29, /**< Garbage collection error */
00133     EXIT_JVM_INTERNAL     = 30, /**< Internal JVM logic error */
00134 
00135 /* Fatal runtime errors in other modules */
00136     EXIT_HEAP_ALLOC       = 31, /**< Heap allocation error */
00137     EXIT_GC_ALLOC         = 32, /**< Garbage collection heap error */
00138     EXIT_THREAD_STACK     = 33, /**< Stack overflow suppressed */
00139     EXIT_TIMESLICE_START  = 34, /**< Cannot start timer */
00140     EXIT_TMPAREA_MKDIR    = 35, /**< Cannot make temp directory */
00141     EXIT_TMPAREA_RMDIR    = 36, /**< Cannot remove temp directory */
00142     EXIT_CLASSPATH_JAR    = 37, /**< Cannot run jar command */
00143     EXIT_MANIFEST_JAR     = 38  /**< Cannot process jar manifest file */
00144 
00145 } exit_code_enum;
00146 
00147 /*@} */ /* End of grouped definitions */
00148 
00149 
00150 /* Prototypes for functions in 'exit.c' */
00151 extern int exit_init(rvoid);
00152 
00153 extern rchar *exit_get_name(exit_code_enum code);
00154 
00155 extern rchar *exit_LinkageError_subclass;
00156 extern jvm_thread_index exit_LinkageError_thridx;
00157 extern int exit_exception_setup(rvoid);
00158 
00159 extern rvoid exit_throw_exception(exit_code_enum rc, rchar *preason);
00160 
00161 extern int   exit_end_thread_setup(rvoid);
00162 extern rvoid exit_end_thread_test(jvm_thread_index thridx);
00163 
00164 extern rvoid exit_jvm(exit_code_enum rc);
00165 
00166 #endif /* _exit_h_defined_ */
00167 
00168 
00169 /* EOF */
00170 

Generated on Fri Sep 30 18:59:27 2005 by  doxygen 1.4.4