diff options
Diffstat (limited to 'luni/src/main/native/java_lang_Character.cpp')
-rw-r--r-- | luni/src/main/native/java_lang_Character.cpp | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/luni/src/main/native/java_lang_Character.cpp b/luni/src/main/native/java_lang_Character.cpp new file mode 100644 index 0000000..c1324d6 --- /dev/null +++ b/luni/src/main/native/java_lang_Character.cpp @@ -0,0 +1,75 @@ +// +// java_lang_Character.cpp +// Android +// +// Copyright 2006 The Android Open Source Project +// +#include "JNIHelp.h" +#include "AndroidSystemNatives.h" + +//#define LOG_TAG "Character" +//#include "utils/Log.h" +#include "utils/AndroidUnicode.h" + +#include <stdlib.h> + + +using namespace android; + +/* + * native private static int nativeGetData(int c) + */ +static jint getData(JNIEnv* env, jclass clazz, jint val) +{ + return Unicode::getPackedData(val); +} + +/* + * native private static int nativeToLower(int c) + */ +static jint toLower(JNIEnv* env, jclass clazz, jint val) +{ + return Unicode::toLower(val); +} + +/* + * native private static int nativeToUpper(int c) + */ +static jint toUpper(JNIEnv* env, jclass clazz, jint val) +{ + return Unicode::toUpper(val); +} + +/* + * native private static int nativeNumericValue(int c) + */ +static jint numericValue(JNIEnv* env, jclass clazz, jint val) +{ + return Unicode::getNumericValue(val); +} + +/* + * native private static int nativeToTitle(int c) + */ +static jint toTitle(JNIEnv* env, jclass clazz, jint val) +{ + return Unicode::toTitle(val); +} + +/* + * JNI registration + */ +static JNINativeMethod gMethods[] = { + /* name, signature, funcPtr */ + { "nativeGetData", "(I)I", (void*) getData }, + { "nativeToLower", "(I)I", (void*) toLower }, + { "nativeToUpper", "(I)I", (void*) toUpper }, + { "nativeNumericValue", "(I)I", (void*) numericValue }, + { "nativeToTitle", "(I)I", (void*) toTitle }, +}; +int register_java_lang_Character(JNIEnv* env) +{ + return jniRegisterNativeMethods(env, "java/lang/Character", + gMethods, NELEM(gMethods)); +} + |