758 759 jboolean (JNICALL *ExceptionCheck) 760 (JNIEnv *env); 761 762 jobject (JNICALL *NewDirectByteBuffer) 763 (JNIEnv* env, void* address, jlong capacity); 764 void* (JNICALL *GetDirectBufferAddress) 765 (JNIEnv* env, jobject buf); 766 jlong (JNICALL *GetDirectBufferCapacity) 767 (JNIEnv* env, jobject buf); 768 769 /* New JNI 1.6 Features */ 770 771 jobjectRefType (JNICALL *GetObjectRefType) 772 (JNIEnv* env, jobject obj); 773 774 /* Module Features */ 775 776 jobject (JNICALL *GetModule) 777 (JNIEnv* env, jclass clazz); 778 }; 779 780 /* 781 * We use inlined functions for C++ so that programmers can write: 782 * 783 * env->FindClass("java/lang/String") 784 * 785 * in C++ rather than: 786 * 787 * (*env)->FindClass(env, "java/lang/String") 788 * 789 * in C. 790 */ 791 792 struct JNIEnv_ { 793 const struct JNINativeInterface_ *functions; 794 #ifdef __cplusplus 795 796 jint GetVersion() { 797 return functions->GetVersion(this); 1856 1857 jobject NewDirectByteBuffer(void* address, jlong capacity) { 1858 return functions->NewDirectByteBuffer(this, address, capacity); 1859 } 1860 void* GetDirectBufferAddress(jobject buf) { 1861 return functions->GetDirectBufferAddress(this, buf); 1862 } 1863 jlong GetDirectBufferCapacity(jobject buf) { 1864 return functions->GetDirectBufferCapacity(this, buf); 1865 } 1866 jobjectRefType GetObjectRefType(jobject obj) { 1867 return functions->GetObjectRefType(this, obj); 1868 } 1869 1870 /* Module Features */ 1871 1872 jobject GetModule(jclass clazz) { 1873 return functions->GetModule(this, clazz); 1874 } 1875 1876 #endif /* __cplusplus */ 1877 }; 1878 1879 /* 1880 * optionString may be any option accepted by the JVM, or one of the 1881 * following: 1882 * 1883 * -D<name>=<value> Set a system property. 1884 * -verbose[:class|gc|jni] Enable verbose output, comma-separated. E.g. 1885 * "-verbose:class" or "-verbose:gc,class" 1886 * Standard names include: gc, class, and jni. 1887 * All nonstandard (VM-specific) names must begin 1888 * with "X". 1889 * vfprintf extraInfo is a pointer to the vfprintf hook. 1890 * exit extraInfo is a pointer to the exit hook. 1891 * abort extraInfo is a pointer to the abort hook. 1892 */ 1893 typedef struct JavaVMOption { 1894 char *optionString; 1895 void *extraInfo; | 758 759 jboolean (JNICALL *ExceptionCheck) 760 (JNIEnv *env); 761 762 jobject (JNICALL *NewDirectByteBuffer) 763 (JNIEnv* env, void* address, jlong capacity); 764 void* (JNICALL *GetDirectBufferAddress) 765 (JNIEnv* env, jobject buf); 766 jlong (JNICALL *GetDirectBufferCapacity) 767 (JNIEnv* env, jobject buf); 768 769 /* New JNI 1.6 Features */ 770 771 jobjectRefType (JNICALL *GetObjectRefType) 772 (JNIEnv* env, jobject obj); 773 774 /* Module Features */ 775 776 jobject (JNICALL *GetModule) 777 (JNIEnv* env, jclass clazz); 778 779 /* Flattened arrays Features */ 780 void* (JNICALL *GetFlattenedArrayElements) 781 (JNIEnv* env, jarray array , jboolean *isCopy); 782 void (JNICALL *ReleaseFlattenedArrayElements) 783 (JNIEnv* env, jarray, void* elem, jint mode); 784 jclass (JNICALL *GetFlattenedArrayElementClass) 785 (JNIEnv* env, jarray array); 786 jsize (JNICALL *GetFlattenedArrayElementSize) 787 (JNIEnv* env, jarray array); 788 jsize (JNICALL *GetFieldOffsetInFlattenedLayout) 789 (JNIEnv* env, jclass clazz, const char *name, const char *signature, jboolean* isFlattened); 790 }; 791 792 /* 793 * We use inlined functions for C++ so that programmers can write: 794 * 795 * env->FindClass("java/lang/String") 796 * 797 * in C++ rather than: 798 * 799 * (*env)->FindClass(env, "java/lang/String") 800 * 801 * in C. 802 */ 803 804 struct JNIEnv_ { 805 const struct JNINativeInterface_ *functions; 806 #ifdef __cplusplus 807 808 jint GetVersion() { 809 return functions->GetVersion(this); 1868 1869 jobject NewDirectByteBuffer(void* address, jlong capacity) { 1870 return functions->NewDirectByteBuffer(this, address, capacity); 1871 } 1872 void* GetDirectBufferAddress(jobject buf) { 1873 return functions->GetDirectBufferAddress(this, buf); 1874 } 1875 jlong GetDirectBufferCapacity(jobject buf) { 1876 return functions->GetDirectBufferCapacity(this, buf); 1877 } 1878 jobjectRefType GetObjectRefType(jobject obj) { 1879 return functions->GetObjectRefType(this, obj); 1880 } 1881 1882 /* Module Features */ 1883 1884 jobject GetModule(jclass clazz) { 1885 return functions->GetModule(this, clazz); 1886 } 1887 1888 /* Flattened arrays Features */ 1889 void* GetFlattenedArrayElements(jarray array , jboolean *isCopy) { 1890 return functions->GetFlattenedArrayElements(this, array, isCopy); 1891 } 1892 1893 void ReleaseFlattenedArrayElements(jarray array, void* elem, jint mode) { 1894 return functions->ReleaseFlattenedArrayElements(this, array, elem, mode); 1895 } 1896 1897 jclass GetFlattenedArrayElementClass(jarray array) { 1898 return functions->GetFlattenedArrayElementClass(this, array); 1899 } 1900 1901 jsize GetFlattenedArrayElementSize(jarray array) { 1902 return functions->GetFlattenedArrayElementSize(this, array); 1903 } 1904 1905 jsize GetFieldOffsetInFlattenedLayout(jclass clazz, const char *name, const char *signature, jboolean* isFlattened) { 1906 return functions->GetFieldOffsetInFlattenedLayout(this, clazz, name, signature, isFlattened); 1907 } 1908 1909 #endif /* __cplusplus */ 1910 }; 1911 1912 /* 1913 * optionString may be any option accepted by the JVM, or one of the 1914 * following: 1915 * 1916 * -D<name>=<value> Set a system property. 1917 * -verbose[:class|gc|jni] Enable verbose output, comma-separated. E.g. 1918 * "-verbose:class" or "-verbose:gc,class" 1919 * Standard names include: gc, class, and jni. 1920 * All nonstandard (VM-specific) names must begin 1921 * with "X". 1922 * vfprintf extraInfo is a pointer to the vfprintf hook. 1923 * exit extraInfo is a pointer to the exit hook. 1924 * abort extraInfo is a pointer to the abort hook. 1925 */ 1926 typedef struct JavaVMOption { 1927 char *optionString; 1928 void *extraInfo; |