946 * Compare if two classes are in the same package. |
946 * Compare if two classes are in the same package. |
947 */ |
947 */ |
948 JNIEXPORT jboolean JNICALL |
948 JNIEXPORT jboolean JNICALL |
949 JVM_IsSameClassPackage(JNIEnv *env, jclass class1, jclass class2); |
949 JVM_IsSameClassPackage(JNIEnv *env, jclass class1, jclass class2); |
950 |
950 |
951 /* Constants in class files */ |
951 /* Get classfile constants */ |
952 |
952 #include "classfile_constants.h" |
953 #define JVM_ACC_PUBLIC 0x0001 /* visible to everyone */ |
|
954 #define JVM_ACC_PRIVATE 0x0002 /* visible only to the defining class */ |
|
955 #define JVM_ACC_PROTECTED 0x0004 /* visible to subclasses */ |
|
956 #define JVM_ACC_STATIC 0x0008 /* instance variable is static */ |
|
957 #define JVM_ACC_FINAL 0x0010 /* no further subclassing, overriding */ |
|
958 #define JVM_ACC_SYNCHRONIZED 0x0020 /* wrap method call in monitor lock */ |
|
959 #define JVM_ACC_SUPER 0x0020 /* funky handling of invokespecial */ |
|
960 #define JVM_ACC_VOLATILE 0x0040 /* can not cache in registers */ |
|
961 #define JVM_ACC_BRIDGE 0x0040 /* bridge method generated by compiler */ |
|
962 #define JVM_ACC_TRANSIENT 0x0080 /* not persistant */ |
|
963 #define JVM_ACC_VARARGS 0x0080 /* method declared with variable number of args */ |
|
964 #define JVM_ACC_NATIVE 0x0100 /* implemented in C */ |
|
965 #define JVM_ACC_INTERFACE 0x0200 /* class is an interface */ |
|
966 #define JVM_ACC_ABSTRACT 0x0400 /* no definition provided */ |
|
967 #define JVM_ACC_STRICT 0x0800 /* strict floating point */ |
|
968 #define JVM_ACC_SYNTHETIC 0x1000 /* compiler-generated class, method or field */ |
|
969 |
|
970 #define JVM_ACC_ANNOTATION 0x2000 /* annotation type */ |
|
971 #define JVM_ACC_ENUM 0x4000 /* field is declared as element of enum */ |
|
972 |
|
973 #define JVM_ACC_PUBLIC_BIT 0 |
|
974 #define JVM_ACC_PRIVATE_BIT 1 |
|
975 #define JVM_ACC_PROTECTED_BIT 2 |
|
976 #define JVM_ACC_STATIC_BIT 3 |
|
977 #define JVM_ACC_FINAL_BIT 4 |
|
978 #define JVM_ACC_SYNCHRONIZED_BIT 5 |
|
979 #define JVM_ACC_SUPER_BIT 5 |
|
980 #define JVM_ACC_VOLATILE_BIT 6 |
|
981 #define JVM_ACC_BRIDGE_BIT 6 |
|
982 #define JVM_ACC_TRANSIENT_BIT 7 |
|
983 #define JVM_ACC_VARARGS_BIT 7 |
|
984 #define JVM_ACC_NATIVE_BIT 8 |
|
985 #define JVM_ACC_INTERFACE_BIT 9 |
|
986 #define JVM_ACC_ABSTRACT_BIT 10 |
|
987 #define JVM_ACC_STRICT_BIT 11 |
|
988 #define JVM_ACC_SYNTHETIC_BIT 12 |
|
989 #define JVM_ACC_ANNOTATION_BIT 13 |
|
990 #define JVM_ACC_ENUM_BIT 14 |
|
991 |
|
992 enum { |
|
993 JVM_CONSTANT_Utf8 = 1, |
|
994 JVM_CONSTANT_Unicode, /* unused */ |
|
995 JVM_CONSTANT_Integer, |
|
996 JVM_CONSTANT_Float, |
|
997 JVM_CONSTANT_Long, |
|
998 JVM_CONSTANT_Double, |
|
999 JVM_CONSTANT_Class, |
|
1000 JVM_CONSTANT_String, |
|
1001 JVM_CONSTANT_Fieldref, |
|
1002 JVM_CONSTANT_Methodref, |
|
1003 JVM_CONSTANT_InterfaceMethodref, |
|
1004 JVM_CONSTANT_NameAndType |
|
1005 }; |
|
1006 |
|
1007 /* Used in the newarray instruction. */ |
|
1008 |
|
1009 #define JVM_T_BOOLEAN 4 |
|
1010 #define JVM_T_CHAR 5 |
|
1011 #define JVM_T_FLOAT 6 |
|
1012 #define JVM_T_DOUBLE 7 |
|
1013 #define JVM_T_BYTE 8 |
|
1014 #define JVM_T_SHORT 9 |
|
1015 #define JVM_T_INT 10 |
|
1016 #define JVM_T_LONG 11 |
|
1017 |
|
1018 /* JVM method signatures */ |
|
1019 |
|
1020 #define JVM_SIGNATURE_ARRAY '[' |
|
1021 #define JVM_SIGNATURE_BYTE 'B' |
|
1022 #define JVM_SIGNATURE_CHAR 'C' |
|
1023 #define JVM_SIGNATURE_CLASS 'L' |
|
1024 #define JVM_SIGNATURE_ENDCLASS ';' |
|
1025 #define JVM_SIGNATURE_ENUM 'E' |
|
1026 #define JVM_SIGNATURE_FLOAT 'F' |
|
1027 #define JVM_SIGNATURE_DOUBLE 'D' |
|
1028 #define JVM_SIGNATURE_FUNC '(' |
|
1029 #define JVM_SIGNATURE_ENDFUNC ')' |
|
1030 #define JVM_SIGNATURE_INT 'I' |
|
1031 #define JVM_SIGNATURE_LONG 'J' |
|
1032 #define JVM_SIGNATURE_SHORT 'S' |
|
1033 #define JVM_SIGNATURE_VOID 'V' |
|
1034 #define JVM_SIGNATURE_BOOLEAN 'Z' |
|
1035 |
953 |
1036 /* |
954 /* |
1037 * A function defined by the byte-code verifier and called by the VM. |
955 * A function defined by the byte-code verifier and called by the VM. |
1038 * This is not a function implemented in the VM. |
956 * This is not a function implemented in the VM. |
1039 * |
957 * |
1326 JNIEXPORT jint JNICALL |
1244 JNIEXPORT jint JNICALL |
1327 JVM_GetSockOpt(jint fd, int level, int optname, char *optval, int *optlen); |
1245 JVM_GetSockOpt(jint fd, int level, int optname, char *optval, int *optlen); |
1328 |
1246 |
1329 JNIEXPORT jint JNICALL |
1247 JNIEXPORT jint JNICALL |
1330 JVM_SetSockOpt(jint fd, int level, int optname, const char *optval, int optlen); |
1248 JVM_SetSockOpt(jint fd, int level, int optname, const char *optval, int optlen); |
1331 |
|
1332 /* |
|
1333 * These routines are only reentrant on Windows |
|
1334 */ |
|
1335 |
|
1336 #ifdef WIN32 |
|
1337 |
|
1338 JNIEXPORT struct protoent * JNICALL |
|
1339 JVM_GetProtoByName(char* name); |
|
1340 |
|
1341 JNIEXPORT struct hostent* JNICALL |
|
1342 JVM_GetHostByAddr(const char* name, int len, int type); |
|
1343 |
|
1344 JNIEXPORT struct hostent* JNICALL |
|
1345 JVM_GetHostByName(char* name); |
|
1346 |
|
1347 #endif /* _WINDOWS */ |
|
1348 |
1249 |
1349 JNIEXPORT int JNICALL |
1250 JNIEXPORT int JNICALL |
1350 JVM_GetHostName(char* name, int namelen); |
1251 JVM_GetHostName(char* name, int namelen); |
1351 |
1252 |
1352 /* |
1253 /* |