Lines Matching refs:env

31 extern "C" int jniGetFDFromFileDescriptor_QR(JNIEnv* env, jobject fileDescriptor);
35 void AssertionError(JNIEnv* env, const char* format, ...) { in AssertionError() argument
45 ScopedLocalRef<jclass> jlaeClass(env, env->FindClass("java/lang/AssertionError")); in AssertionError()
47 env->GetMethodID(jlaeClass.get(), "<init>", "(Ljava/lang/String;Ljava/lang/Throwable;)V"); in AssertionError()
48 ScopedLocalRef<jstring> message(env, env->NewStringUTF(messageBuffer)); in AssertionError()
49 jobject jlae = env->NewObject(jlaeClass.get(), init, message.get(), nullptr); in AssertionError()
50 env->Throw(reinterpret_cast<jthrowable>(jlae)); in AssertionError()
53 static void throwException(JNIEnv* env, jclass /*clazz*/, jstring className, jstring message) { in throwException() argument
54 ScopedUtfChars c(env, className); in throwException()
55 ScopedUtfChars m(env, message); in throwException()
56 jniThrowException(env, c.c_str(), m.c_str()); in throwException()
59 static void throwExceptionWithIntFormat(JNIEnv* env, in throwExceptionWithIntFormat() argument
64 ScopedUtfChars c(env, className); in throwExceptionWithIntFormat()
65 ScopedUtfChars f(env, format); in throwExceptionWithIntFormat()
66 jniThrowExceptionFmt(env, c.c_str(), f.c_str(), value); in throwExceptionWithIntFormat()
69 static void throwNullPointerException(JNIEnv* env, in throwNullPointerException() argument
72 ScopedUtfChars m(env, message); in throwNullPointerException()
73 jniThrowNullPointerException(env, m.c_str()); in throwNullPointerException()
76 static void throwRuntimeException(JNIEnv* env, jclass /*clazz*/, jstring message) { in throwRuntimeException() argument
77 ScopedUtfChars m(env, message); in throwRuntimeException()
78 jniThrowRuntimeException(env, m.c_str()); in throwRuntimeException()
81 static void throwIOException(JNIEnv* env, jclass /*clazz*/, jint cause) { in throwIOException() argument
82 jniThrowIOException(env, cause); in throwIOException()
85 static void logException(JNIEnv* env, jclass /*clazz*/, jthrowable throwable) { in logException() argument
86 jniLogException(env, ANDROID_LOG_VERBOSE, __FILE__, throwable); in logException()
89 static jobject fileDescriptorCreate(JNIEnv* env, jclass /*clazz*/, jint unix_fd) { in fileDescriptorCreate() argument
90 return jniCreateFileDescriptor(env, unix_fd); in fileDescriptorCreate()
93 static jint fileDescriptorGetFD(JNIEnv* env, jclass /*clazz*/, jobject jiofd) { in fileDescriptorGetFD() argument
94 return jniGetFDFromFileDescriptor(env, jiofd); in fileDescriptorGetFD()
97 static jint fileDescriptorGetFDCompatQR(JNIEnv* env, jclass /*clazz*/, jobject jiofd) { in fileDescriptorGetFDCompatQR() argument
101 return jniGetFDFromFileDescriptor_QR(env, jiofd); in fileDescriptorGetFDCompatQR()
104 static void fileDescriptorSetFD(JNIEnv* env, jclass /*clazz*/, jobject jiofd, jint unix_fd) { in fileDescriptorSetFD() argument
105 jniSetFileDescriptorOfFD(env, jiofd, unix_fd); in fileDescriptorSetFD()
108 static jobject allocateDirectNonHeapBuffer(JNIEnv* env, jclass /*clazz*/, jint length) { in allocateDirectNonHeapBuffer() argument
113 return env->NewDirectByteBuffer(&raw_memory, length); in allocateDirectNonHeapBuffer()
117 assertBufferBaseArrayOffsetBytes(JNIEnv* env, jclass /*clazz*/, jobject jnb, jint offset) { in assertBufferBaseArrayOffsetBytes() argument
118 int actualOffset = jniGetNioBufferBaseArrayOffset(env, jnb); in assertBufferBaseArrayOffsetBytes()
120 AssertionError(env, in assertBufferBaseArrayOffsetBytes()
127 static void assertBufferPosition(JNIEnv* env, jclass /*clazz*/, jobject jnb, jint position) { in assertBufferPosition() argument
129 jniGetNioBufferFields(env, jnb, &actualPosition, &actualLimit, &actualElementSizeShift); in assertBufferPosition()
131 AssertionError(env, in assertBufferPosition()
138 static void assertBufferLimit(JNIEnv* env, jclass /*clazz*/, jobject jnb, jint limit) { in assertBufferLimit() argument
140 jniGetNioBufferFields(env, jnb, &actualPosition, &actualLimit, &actualElementSizeShift); in assertBufferLimit()
142 AssertionError(env, in assertBufferLimit()
149 static void assertBufferElementSizeShift(JNIEnv* env, jclass /*clazz*/, jobject jnb, jint ess) { in assertBufferElementSizeShift() argument
151 jniGetNioBufferFields(env, jnb, &actualPosition, &actualLimit, &actualElementSizeShift); in assertBufferElementSizeShift()
153 AssertionError(env, in assertBufferElementSizeShift()
160 static jlong getBufferBaseAddress(JNIEnv* env, jclass /*clazz*/, jobject jnb) { in getBufferBaseAddress() argument
162 return jniGetNioBufferFields(env, jnb, &actualPosition, &actualLimit, &actualElementSizeShift); in getBufferBaseAddress()
165 static jlong getDirectBufferAddress(JNIEnv* env, jclass /*clazz*/, jobject jnb) { in getDirectBufferAddress() argument
166 void* directBufferAddress = env->GetDirectBufferAddress(jnb); in getDirectBufferAddress()
170 static void assertBufferPointer(JNIEnv* env, jclass /*clazz*/, jobject jnb, jlong pointer) { in assertBufferPointer() argument
171 jlong actualPointer = jniGetNioBufferPointer(env, jnb); in assertBufferPointer()
173 AssertionError(env, in assertBufferPointer()
180 static jobject getReferent(JNIEnv* env, jclass /*clazz*/, jobject reference) { in getReferent() argument
181 return jniGetReferent(env, reference); in getReferent()
184 static jstring createString(JNIEnv* env, jclass /*clazz*/, jstring value) { in createString() argument
185 ScopedStringChars ssc(env, value); in createString()
186 return jniCreateString(env, ssc.get(), ssc.size()); in createString()
189 static jobjectArray createStringArray(JNIEnv* env, jclass /*clazz*/, jint length) { in createStringArray() argument
190 return jniCreateStringArray(&env->functions, length); in createStringArray()
196 JNIEnv* env; in JNI_OnLoad() local
197 if (vm->GetEnv(reinterpret_cast<void**>(&env), JNI_VERSION_1_6) != JNI_OK) { in JNI_OnLoad()
266 int rc = jniRegisterNativeMethods(env, in JNI_OnLoad()