1 /* -*- Mode: C++; indent-tabs-mode: t; tab-width: 4 -*-
2 // ---------------------------------------------------------------------------
4 // Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
5 // ---------------------------------------------------------------------------
6 // SquirrelJME is under the Mozilla Public License Version 2.0.
7 // See license.mkd for licensing and copyright information.
8 // -------------------------------------------------------------------------*/
10 #include "squirreljme.h"
14 forwardMethod JNICALL
findForwardMethod(JNIEnv
* env
,
15 const char* const classy
, const char* const name
, const char* const type
)
19 result
.xclass
= (*env
)->FindClass(env
, classy
);
20 result
.xmeth
= (*env
)->GetStaticMethodID(env
, result
.xclass
, name
, type
);
30 call = findForwardMethod(env, classy, name, type);\
32 va_start(vaArgs, type);
39 #if 0 /*defined(_DEBUG) || defined(DEBUG)*/
40 #define DEBUG_CALL fprintf(stderr, "JNI Forward: %s:%s\n", classy, name);
45 void JNICALL
forwardCallStaticVoid(JNIEnv
* env
,
46 const char* const classy
, const char* const name
, const char* const type
,
51 (*env
)->CallStaticVoidMethodV(env
, call
.xclass
, call
.xmeth
, vaArgs
);
55 jint JNICALL
forwardCallStaticInteger(JNIEnv
* env
,
56 const char* const classy
, const char* const name
, const char* const type
,
63 rv
= (*env
)->CallStaticIntMethodV(env
, call
.xclass
, call
.xmeth
, vaArgs
);
69 jlong JNICALL
forwardCallStaticLong(JNIEnv
* env
,
70 const char* const classy
, const char* const name
, const char* const type
,
77 rv
= (*env
)->CallStaticLongMethodV(env
, call
.xclass
, call
.xmeth
, vaArgs
);
83 jobject JNICALL
forwardCallStaticObject(JNIEnv
* env
,
84 const char* const classy
, const char* const name
, const char* const type
,
91 rv
= (*env
)->CallStaticObjectMethodV(env
, call
.xclass
, call
.xmeth
, vaArgs
);
97 jboolean JNICALL
forwardCallStaticBoolean(JNIEnv
* env
,
98 const char* const classy
, const char* const name
, const char* const type
,
105 rv
= (*env
)->CallStaticBooleanMethodV(env
, call
.xclass
, call
.xmeth
, vaArgs
);