/tags/rel-1-3-29/SWIG/Lib/modula3/modula3head.swg
Unknown | 67 lines | 60 code | 7 blank | 0 comment | 0 complexity | 6c537c6c8681f507f9ae94a95a566bc4 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
- /* -----------------------------------------------------------------------------
- * See the LICENSE file for information on copyright, usage and redistribution
- * of SWIG, and the README file for authors - http://www.swig.org/release.html.
- *
- * modula3head.swg
- *
- * Modula3 support code
- * ----------------------------------------------------------------------------- */
- %insert(runtime) %{
- #include <stdlib.h>
- #include <string.h>
- #include <stdio.h>
- %}
- #if 0
- %insert(runtime) %{
- /* Support for throwing Modula3 exceptions */
- typedef enum {
- SWIG_JavaOutOfMemoryError = 1,
- SWIG_JavaIOException,
- SWIG_JavaRuntimeException,
- SWIG_JavaIndexOutOfBoundsException,
- SWIG_JavaArithmeticException,
- SWIG_JavaIllegalArgumentException,
- SWIG_JavaNullPointerException,
- SWIG_JavaUnknownError
- } SWIG_JavaExceptionCodes;
- typedef struct {
- SWIG_JavaExceptionCodes code;
- const char *java_exception;
- } SWIG_JavaExceptions_t;
- #if defined(SWIG_NOINCLUDE)
- void SWIG_JavaThrowException(JNIEnv *jenv, SWIG_JavaExceptionCodes code, const char *msg);
- #else
- %}
- %insert(runtime) {
- void SWIG_JavaThrowException(JNIEnv *jenv, SWIG_JavaExceptionCodes code, const char *msg) {
- jclass excep;
- static const SWIG_JavaExceptions_t java_exceptions[] = {
- { SWIG_JavaOutOfMemoryError, "java/lang/OutOfMemoryError" },
- { SWIG_JavaIOException, "java/io/IOException" },
- { SWIG_JavaRuntimeException, "java/lang/RuntimeException" },
- { SWIG_JavaIndexOutOfBoundsException, "java/lang/IndexOutOfBoundsException" },
- { SWIG_JavaArithmeticException, "java/lang/ArithmeticException" },
- { SWIG_JavaIllegalArgumentException, "java/lang/IllegalArgumentException" },
- { SWIG_JavaNullPointerException, "java/lang/NullPointerException" },
- { SWIG_JavaUnknownError, "java/lang/UnknownError" },
- { (SWIG_JavaExceptionCodes)0, "java/lang/UnknownError" } };
- const SWIG_JavaExceptions_t *except_ptr = java_exceptions;
- while (except_ptr->code != code && except_ptr->code)
- except_ptr++;
- JCALL0(ExceptionClear, jenv);
- excep = JCALL1(FindClass, jenv, except_ptr->java_exception);
- if (excep)
- JCALL2(ThrowNew, jenv, excep, msg);
- }
- }
- %insert(runtime) %{
- #endif
- %}
- #endif