findclass.c 306 B

12345678910111213
  1. #include <stdlib.h>
  2. #include <findclass.h>
  3. JNIEXPORT jclass JNICALL
  4. Java_findclass_doit (JNIEnv *env, jclass klass, jstring name)
  5. {
  6. const char *buf = (*env)->GetStringUTFChars (env, name, NULL);
  7. jclass k = (*env)->FindClass (env, buf);
  8. (*env)->ReleaseStringUTFChars (env, name, buf);
  9. return k;
  10. }