+jmethodID jxbt_get_static_smethod(JNIEnv * env, const char *classname,
+ const char *name, const char *signature)
+{
+
+ jclass cls;
+ jmethodID id;
+ cls = jxbt_get_class(env, classname);
+
+ if (!cls)
+ return 0;
+
+ id = (*env)->GetStaticMethodID(env, cls, name, signature);
+
+ if (!id) {
+ char *m =
+ bprintf("Cannot find static method %s(%s) in %s", name, signature,
+ classname);
+
+ jxbt_throw_jni(env, m);
+
+ free(m);
+ return 0;
+ }
+ return id;
+}
+
+jmethodID jxbt_get_smethod(JNIEnv * env, const char *classname,
+ const char *name, const char *signature)
+{
+
+ jclass cls;
+ jmethodID id;
+ cls = jxbt_get_class(env, classname);
+
+ if (!cls)
+ return 0;
+
+ id = (*env)->GetMethodID(env, cls, name, signature);
+
+ if (!id) {
+ char *m =
+ bprintf("Cannot find method %s(%s) in %s", name, signature, classname);
+
+ jxbt_throw_jni(env, m);
+
+ free(m);
+ return 0;
+ }
+ return id;
+}
+
+jfieldID jxbt_get_jfield(JNIEnv * env, jclass cls,
+ const char *name, const char *signature)
+{