jdk/src/share/native/java/lang/ClassLoader.c
/*
* Class: java_lang_ClassLoader_NativeLibrary
* Method: find
* Signature: (Ljava/lang/String;J)J
*/
JNIEXPORT jlong JNICALL
Java_java_lang_ClassLoader_00024NativeLibrary_find
(JNIEnv *env, jobject this, jstring name)
{
{- -------------------------------------------
(1) (変数宣言など)
---------------------------------------- -}
jlong handle;
const char *cname;
jlong res;
{- -------------------------------------------
(1) (まだ初期化が終わっていなければ) 初期化を行っておく.
初期化中にエラーが起きた場合は, ここでリターン.
---------------------------------------- -}
if (!initIDs(env))
return jlong_zero;
{- -------------------------------------------
(1) JVM_FindLibraryEntry() で探索を行い, 結果をリターン.
---------------------------------------- -}
handle = (*env)->GetLongField(env, this, handleID);
cname = (*env)->GetStringUTFChars(env, name, 0);
if (cname == 0)
return jlong_zero;
res = ptr_to_jlong(JVM_FindLibraryEntry(jlong_to_ptr(handle), cname));
(*env)->ReleaseStringUTFChars(env, name, cname);
return res;
}
This document is available under the GNU GENERAL PUBLIC LICENSE Version 2.