< prev index next >

src/java.base/share/native/include/jni.h

Print this page

 753 
 754     jboolean (JNICALL *ExceptionCheck)
 755        (JNIEnv *env);
 756 
 757     jobject (JNICALL *NewDirectByteBuffer)
 758        (JNIEnv* env, void* address, jlong capacity);
 759     void* (JNICALL *GetDirectBufferAddress)
 760        (JNIEnv* env, jobject buf);
 761     jlong (JNICALL *GetDirectBufferCapacity)
 762        (JNIEnv* env, jobject buf);
 763 
 764     /* New JNI 1.6 Features */
 765 
 766     jobjectRefType (JNICALL *GetObjectRefType)
 767         (JNIEnv* env, jobject obj);
 768 
 769     /* Module Features */
 770 
 771     jobject (JNICALL *GetModule)
 772        (JNIEnv* env, jclass clazz);





 773 };
 774 
 775 /*
 776  * We use inlined functions for C++ so that programmers can write:
 777  *
 778  *    env->FindClass("java/lang/String")
 779  *
 780  * in C++ rather than:
 781  *
 782  *    (*env)->FindClass(env, "java/lang/String")
 783  *
 784  * in C.
 785  */
 786 
 787 struct JNIEnv_ {
 788     const struct JNINativeInterface_ *functions;
 789 #ifdef __cplusplus
 790 
 791     jint GetVersion() {
 792         return functions->GetVersion(this);

1851 
1852     jobject NewDirectByteBuffer(void* address, jlong capacity) {
1853         return functions->NewDirectByteBuffer(this, address, capacity);
1854     }
1855     void* GetDirectBufferAddress(jobject buf) {
1856         return functions->GetDirectBufferAddress(this, buf);
1857     }
1858     jlong GetDirectBufferCapacity(jobject buf) {
1859         return functions->GetDirectBufferCapacity(this, buf);
1860     }
1861     jobjectRefType GetObjectRefType(jobject obj) {
1862         return functions->GetObjectRefType(this, obj);
1863     }
1864 
1865     /* Module Features */
1866 
1867     jobject GetModule(jclass clazz) {
1868         return functions->GetModule(this, clazz);
1869     }
1870 






1871 #endif /* __cplusplus */
1872 };
1873 
1874 /*
1875  * optionString may be any option accepted by the JVM, or one of the
1876  * following:
1877  *
1878  * -D<name>=<value>          Set a system property.
1879  * -verbose[:class|gc|jni]   Enable verbose output, comma-separated. E.g.
1880  *                           "-verbose:class" or "-verbose:gc,class"
1881  *                           Standard names include: gc, class, and jni.
1882  *                           All nonstandard (VM-specific) names must begin
1883  *                           with "X".
1884  * vfprintf                  extraInfo is a pointer to the vfprintf hook.
1885  * exit                      extraInfo is a pointer to the exit hook.
1886  * abort                     extraInfo is a pointer to the abort hook.
1887  */
1888 typedef struct JavaVMOption {
1889     char *optionString;
1890     void *extraInfo;

 753 
 754     jboolean (JNICALL *ExceptionCheck)
 755        (JNIEnv *env);
 756 
 757     jobject (JNICALL *NewDirectByteBuffer)
 758        (JNIEnv* env, void* address, jlong capacity);
 759     void* (JNICALL *GetDirectBufferAddress)
 760        (JNIEnv* env, jobject buf);
 761     jlong (JNICALL *GetDirectBufferCapacity)
 762        (JNIEnv* env, jobject buf);
 763 
 764     /* New JNI 1.6 Features */
 765 
 766     jobjectRefType (JNICALL *GetObjectRefType)
 767         (JNIEnv* env, jobject obj);
 768 
 769     /* Module Features */
 770 
 771     jobject (JNICALL *GetModule)
 772        (JNIEnv* env, jclass clazz);
 773 
 774     /* Loom */
 775 
 776     jboolean (JNICALL *IsVirtualThread)
 777        (JNIEnv* env, jobject obj);
 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     /* Loom */
1877 
1878     jboolean IsVirtualThread(jobject obj) {
1879         return functions->IsVirtualThread(this, obj);
1880     }
1881 
1882 #endif /* __cplusplus */
1883 };
1884 
1885 /*
1886  * optionString may be any option accepted by the JVM, or one of the
1887  * following:
1888  *
1889  * -D<name>=<value>          Set a system property.
1890  * -verbose[:class|gc|jni]   Enable verbose output, comma-separated. E.g.
1891  *                           "-verbose:class" or "-verbose:gc,class"
1892  *                           Standard names include: gc, class, and jni.
1893  *                           All nonstandard (VM-specific) names must begin
1894  *                           with "X".
1895  * vfprintf                  extraInfo is a pointer to the vfprintf hook.
1896  * exit                      extraInfo is a pointer to the exit hook.
1897  * abort                     extraInfo is a pointer to the abort hook.
1898  */
1899 typedef struct JavaVMOption {
1900     char *optionString;
1901     void *extraInfo;
< prev index next >