Removed java bits. Updated release notes.

master
nathan 2017-12-03 00:19:08 +01:00
parent 1f2cfec1ab
commit fa99cd4030
32 changed files with 24 additions and 10460 deletions

181
.cproject
View File

@ -1,181 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?fileVersion 4.0.0?><cproject>
<storageModule moduleId="org.eclipse.cdt.core.settings">
<cconfiguration id="converted.config.1797282818">
<storageModule buildSystemId="org.eclipse.cdt.core.defaultConfigDataProvider" id="converted.config.1797282818" moduleId="org.eclipse.cdt.core.settings" name="convertedConfig">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.MachO" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.MachO64" point="org.eclipse.cdt.core.BinaryParser"/>
</extensions>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
</cconfiguration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
<storageModule moduleId="refreshScope"/>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="false" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
<buildOutputProvider>
<openAction enabled="false" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="makefileGenerator">
<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
<parser enabled="false"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="false" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="false"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="false" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="false"/>
</scannerInfoProvider>
</profile>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
<storageModule moduleId="org.eclipse.cdt.core.pathentry">
<pathentry base-path="UDT" include="jvm/include" kind="inc" path="" system="true"/>
<pathentry include="/usr/include" kind="inc" path="" system="true"/>
<pathentry include="/usr/include/asm" kind="inc" path="" system="true"/>
<pathentry include="/usr/include/bits" kind="inc" path="" system="true"/>
<pathentry include="/usr/include/net" kind="inc" path="" system="true"/>
<pathentry include="/usr/include/netinet" kind="inc" path="" system="true"/>
<pathentry include="/usr/include/sys" kind="inc" path="" system="true"/>
<pathentry include="/usr/include/gdk-pixbuf-2.0" kind="inc" path="" system="true"/>
<pathentry include="/usr/include/gtk-2.0" kind="inc" path="" system="true"/>
<pathentry include="/usr/include/glib-2.0" kind="inc" path="" system="true"/>
<pathentry include="/usr/include/gio-unix-2.0/" kind="inc" path="" system="true"/>
<pathentry include="/usr/include/pixman-1" kind="inc" path="" system="true"/>
<pathentry include="/usr/include/freetype2" kind="inc" path="" system="true"/>
<pathentry include="/usr/include/libpng12" kind="inc" path="" system="true"/>
<pathentry include="/usr/i686-w64-mingw32/include" kind="inc" path="" system="true"/>
<pathentry include="/usr/include/x86_64-linux-gnu" kind="inc" path="" system="true"/>
<pathentry include="/usr/lib/gcc/x86_64-linux-gnu/4.8/include/" kind="inc" path="" system="true"/>
<pathentry include="/usr/share/mingw-w64/include/" kind="inc" path="" system="true"/>
<pathentry kind="mac" name="ENABLE_LGPL" path="" value="true"/>
<pathentry kind="mac" name="ENABLE_CRYPTO" path="" value="true"/>
<pathentry kind="mac" name="DEBUG" path="" value="true"/>
<pathentry kind="mac" name="CUSTOM_RUNTIME" path="" value="true"/>
<pathentry kind="mac" name="ENABLE_INPUT_MONITOR" path="" value="true"/>
<pathentry kind="mac" name="WRAP_BIND_SOCKETS" path="" value="true"/>
<pathentry kind="mac" name="GDK3_LIB" path="" value="1"/>
<pathentry kind="mac" name="GTK3_LIB" path="" value="1"/>
<pathentry kind="mac" name="GTK_LIB" path="" value="1"/>
<pathentry kind="mac" name="GDK_LIB" path="" value="1"/>
<pathentry kind="mac" name="GOBJ_LIB" path="" value="1"/>
<pathentry kind="mac" name="PIXBUF_LIB" path="" value="1"/>
<pathentry kind="mac" name="X11_LIB" path="" value="1"/>
<pathentry kind="mac" name="GTHREAD_LIB" path="" value="1"/>
<pathentry kind="mac" name="X11_TEST_LIB" path="" value="1"/>
<pathentry kind="mac" name="DEFAULT_OS" path="" value="&quot;linux&quot;"/>
<pathentry kind="mac" name="DEFAULT_OS_ARCH" path="" value="&quot;x86_64&quot;"/>
<pathentry kind="src" path="src"/>
<pathentry kind="out" path="bin"/>
<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets">
<buildTargets>
<target name="clean_windows" path="" targetID="org.eclipse.cdt.make.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-f make_windows.mak</buildArguments>
<buildTarget>clean</buildTarget>
<stopOnError>false</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="windows_32" path="" targetID="org.eclipse.cdt.make.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-f make_windows.mak COMPILE_OS=windows COMPILE_OS_ARCH=32</buildArguments>
<buildTarget>all</buildTarget>
<stopOnError>false</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="windows_64" path="" targetID="org.eclipse.cdt.make.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-f make_windows.mak COMPILE_OS=windows COMPILE_OS_ARCH=64</buildArguments>
<buildTarget>all</buildTarget>
<stopOnError>false</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="clean_macosx" path="" targetID="org.eclipse.cdt.make.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-f make_macosx.mak</buildArguments>
<buildTarget>clean</buildTarget>
<stopOnError>false</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="macosx_32" path="" targetID="org.eclipse.cdt.make.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-f make_macosx.mak COMPILE_OS=macosx COMPILE_OS_ARCH=32</buildArguments>
<buildTarget>all</buildTarget>
<stopOnError>false</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="macosx_64" path="" targetID="org.eclipse.cdt.make.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-f make_macosx.mak COMPILE_OS=macosx COMPILE_OS_ARCH=64</buildArguments>
<buildTarget>all</buildTarget>
<stopOnError>false</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="clean_linux" path="" targetID="org.eclipse.cdt.make.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-f make_linux.mak</buildArguments>
<buildTarget>clean</buildTarget>
<stopOnError>false</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="linux_32" path="" targetID="org.eclipse.cdt.make.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-f make_linux.mak COMPILE_OS=linux COMPILE_OS_ARCH=32</buildArguments>
<buildTarget>all</buildTarget>
<stopOnError>false</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="linux_64" path="" targetID="org.eclipse.cdt.make.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-f make_linux.mak COMPILE_OS=linux COMPILE_OS_ARCH=64</buildArguments>
<buildTarget>all</buildTarget>
<stopOnError>false</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
</buildTargets>
</storageModule>
</cproject>

View File

@ -1,86 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>UDT</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.cdt.make.core.makeBuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
<dictionary>
<key>org.eclipse.cdt.core.errorOutputParser</key>
<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;org.eclipse.cdt.core.GmakeErrorParser;</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.append_environment</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.build.arguments</key>
<value>-f &apos;make_${system:OS}.mak&apos;</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.build.command</key>
<value>make</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.build.location</key>
<value>/UDT/</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.build.target.auto</key>
<value>all</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.build.target.clean</key>
<value>clean</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.build.target.inc</key>
<value>all</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
<value>false</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableFullBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.environment</key>
<value>DEFAULT_WS=${system_property:osgi.ws}|JAVA_ROOT=${system_property:java.home}/..|DEFAULT_OS_ARCH=${system_property:osgi.arch}|PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib64/pkgconfig:/usr/share/pkgconfig:/opt/kde3/lib64/pkgconfig:/opt/gnome/lib64/pkgconfig:/opt/gnome/lib64/pkgconfig:/opt/gnome/share/pkgconfig|DEFAULT_OS=${system_property:osgi.os}|</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.stopOnError</key>
<value>false</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
<value>false</value>
</dictionary>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.make.core.makeNature</nature>
<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
<nature>org.eclipse.pde.FeatureNature</nature>
</natures>
</projectDescription>

View File

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@ -1,544 +0,0 @@
/*
* Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
#ifndef CLASSFILE_CONSTANTS_H
#define CLASSFILE_CONSTANTS_H
#ifdef __cplusplus
extern "C" {
#endif
/* Classfile version number for this information */
#define JVM_CLASSFILE_MAJOR_VERSION 50
#define JVM_CLASSFILE_MINOR_VERSION 0
/* Flags */
enum {
JVM_ACC_PUBLIC = 0x0001,
JVM_ACC_PRIVATE = 0x0002,
JVM_ACC_PROTECTED = 0x0004,
JVM_ACC_STATIC = 0x0008,
JVM_ACC_FINAL = 0x0010,
JVM_ACC_SYNCHRONIZED = 0x0020,
JVM_ACC_SUPER = 0x0020,
JVM_ACC_VOLATILE = 0x0040,
JVM_ACC_BRIDGE = 0x0040,
JVM_ACC_TRANSIENT = 0x0080,
JVM_ACC_VARARGS = 0x0080,
JVM_ACC_NATIVE = 0x0100,
JVM_ACC_INTERFACE = 0x0200,
JVM_ACC_ABSTRACT = 0x0400,
JVM_ACC_STRICT = 0x0800,
JVM_ACC_SYNTHETIC = 0x1000,
JVM_ACC_ANNOTATION = 0x2000,
JVM_ACC_ENUM = 0x4000
};
/* Used in newarray instruction. */
enum {
JVM_T_BOOLEAN = 4,
JVM_T_CHAR = 5,
JVM_T_FLOAT = 6,
JVM_T_DOUBLE = 7,
JVM_T_BYTE = 8,
JVM_T_SHORT = 9,
JVM_T_INT = 10,
JVM_T_LONG = 11
};
/* Constant Pool Entries */
enum {
JVM_CONSTANT_Utf8 = 1,
JVM_CONSTANT_Unicode = 2, /* unused */
JVM_CONSTANT_Integer = 3,
JVM_CONSTANT_Float = 4,
JVM_CONSTANT_Long = 5,
JVM_CONSTANT_Double = 6,
JVM_CONSTANT_Class = 7,
JVM_CONSTANT_String = 8,
JVM_CONSTANT_Fieldref = 9,
JVM_CONSTANT_Methodref = 10,
JVM_CONSTANT_InterfaceMethodref = 11,
JVM_CONSTANT_NameAndType = 12
};
/* StackMapTable type item numbers */
enum {
JVM_ITEM_Top = 0,
JVM_ITEM_Integer = 1,
JVM_ITEM_Float = 2,
JVM_ITEM_Double = 3,
JVM_ITEM_Long = 4,
JVM_ITEM_Null = 5,
JVM_ITEM_UninitializedThis = 6,
JVM_ITEM_Object = 7,
JVM_ITEM_Uninitialized = 8
};
/* Type signatures */
enum {
JVM_SIGNATURE_ARRAY = '[',
JVM_SIGNATURE_BYTE = 'B',
JVM_SIGNATURE_CHAR = 'C',
JVM_SIGNATURE_CLASS = 'L',
JVM_SIGNATURE_ENDCLASS = ';',
JVM_SIGNATURE_ENUM = 'E',
JVM_SIGNATURE_FLOAT = 'F',
JVM_SIGNATURE_DOUBLE = 'D',
JVM_SIGNATURE_FUNC = '(',
JVM_SIGNATURE_ENDFUNC = ')',
JVM_SIGNATURE_INT = 'I',
JVM_SIGNATURE_LONG = 'J',
JVM_SIGNATURE_SHORT = 'S',
JVM_SIGNATURE_VOID = 'V',
JVM_SIGNATURE_BOOLEAN = 'Z'
};
/* Opcodes */
enum {
JVM_OPC_nop = 0,
JVM_OPC_aconst_null = 1,
JVM_OPC_iconst_m1 = 2,
JVM_OPC_iconst_0 = 3,
JVM_OPC_iconst_1 = 4,
JVM_OPC_iconst_2 = 5,
JVM_OPC_iconst_3 = 6,
JVM_OPC_iconst_4 = 7,
JVM_OPC_iconst_5 = 8,
JVM_OPC_lconst_0 = 9,
JVM_OPC_lconst_1 = 10,
JVM_OPC_fconst_0 = 11,
JVM_OPC_fconst_1 = 12,
JVM_OPC_fconst_2 = 13,
JVM_OPC_dconst_0 = 14,
JVM_OPC_dconst_1 = 15,
JVM_OPC_bipush = 16,
JVM_OPC_sipush = 17,
JVM_OPC_ldc = 18,
JVM_OPC_ldc_w = 19,
JVM_OPC_ldc2_w = 20,
JVM_OPC_iload = 21,
JVM_OPC_lload = 22,
JVM_OPC_fload = 23,
JVM_OPC_dload = 24,
JVM_OPC_aload = 25,
JVM_OPC_iload_0 = 26,
JVM_OPC_iload_1 = 27,
JVM_OPC_iload_2 = 28,
JVM_OPC_iload_3 = 29,
JVM_OPC_lload_0 = 30,
JVM_OPC_lload_1 = 31,
JVM_OPC_lload_2 = 32,
JVM_OPC_lload_3 = 33,
JVM_OPC_fload_0 = 34,
JVM_OPC_fload_1 = 35,
JVM_OPC_fload_2 = 36,
JVM_OPC_fload_3 = 37,
JVM_OPC_dload_0 = 38,
JVM_OPC_dload_1 = 39,
JVM_OPC_dload_2 = 40,
JVM_OPC_dload_3 = 41,
JVM_OPC_aload_0 = 42,
JVM_OPC_aload_1 = 43,
JVM_OPC_aload_2 = 44,
JVM_OPC_aload_3 = 45,
JVM_OPC_iaload = 46,
JVM_OPC_laload = 47,
JVM_OPC_faload = 48,
JVM_OPC_daload = 49,
JVM_OPC_aaload = 50,
JVM_OPC_baload = 51,
JVM_OPC_caload = 52,
JVM_OPC_saload = 53,
JVM_OPC_istore = 54,
JVM_OPC_lstore = 55,
JVM_OPC_fstore = 56,
JVM_OPC_dstore = 57,
JVM_OPC_astore = 58,
JVM_OPC_istore_0 = 59,
JVM_OPC_istore_1 = 60,
JVM_OPC_istore_2 = 61,
JVM_OPC_istore_3 = 62,
JVM_OPC_lstore_0 = 63,
JVM_OPC_lstore_1 = 64,
JVM_OPC_lstore_2 = 65,
JVM_OPC_lstore_3 = 66,
JVM_OPC_fstore_0 = 67,
JVM_OPC_fstore_1 = 68,
JVM_OPC_fstore_2 = 69,
JVM_OPC_fstore_3 = 70,
JVM_OPC_dstore_0 = 71,
JVM_OPC_dstore_1 = 72,
JVM_OPC_dstore_2 = 73,
JVM_OPC_dstore_3 = 74,
JVM_OPC_astore_0 = 75,
JVM_OPC_astore_1 = 76,
JVM_OPC_astore_2 = 77,
JVM_OPC_astore_3 = 78,
JVM_OPC_iastore = 79,
JVM_OPC_lastore = 80,
JVM_OPC_fastore = 81,
JVM_OPC_dastore = 82,
JVM_OPC_aastore = 83,
JVM_OPC_bastore = 84,
JVM_OPC_castore = 85,
JVM_OPC_sastore = 86,
JVM_OPC_pop = 87,
JVM_OPC_pop2 = 88,
JVM_OPC_dup = 89,
JVM_OPC_dup_x1 = 90,
JVM_OPC_dup_x2 = 91,
JVM_OPC_dup2 = 92,
JVM_OPC_dup2_x1 = 93,
JVM_OPC_dup2_x2 = 94,
JVM_OPC_swap = 95,
JVM_OPC_iadd = 96,
JVM_OPC_ladd = 97,
JVM_OPC_fadd = 98,
JVM_OPC_dadd = 99,
JVM_OPC_isub = 100,
JVM_OPC_lsub = 101,
JVM_OPC_fsub = 102,
JVM_OPC_dsub = 103,
JVM_OPC_imul = 104,
JVM_OPC_lmul = 105,
JVM_OPC_fmul = 106,
JVM_OPC_dmul = 107,
JVM_OPC_idiv = 108,
JVM_OPC_ldiv = 109,
JVM_OPC_fdiv = 110,
JVM_OPC_ddiv = 111,
JVM_OPC_irem = 112,
JVM_OPC_lrem = 113,
JVM_OPC_frem = 114,
JVM_OPC_drem = 115,
JVM_OPC_ineg = 116,
JVM_OPC_lneg = 117,
JVM_OPC_fneg = 118,
JVM_OPC_dneg = 119,
JVM_OPC_ishl = 120,
JVM_OPC_lshl = 121,
JVM_OPC_ishr = 122,
JVM_OPC_lshr = 123,
JVM_OPC_iushr = 124,
JVM_OPC_lushr = 125,
JVM_OPC_iand = 126,
JVM_OPC_land = 127,
JVM_OPC_ior = 128,
JVM_OPC_lor = 129,
JVM_OPC_ixor = 130,
JVM_OPC_lxor = 131,
JVM_OPC_iinc = 132,
JVM_OPC_i2l = 133,
JVM_OPC_i2f = 134,
JVM_OPC_i2d = 135,
JVM_OPC_l2i = 136,
JVM_OPC_l2f = 137,
JVM_OPC_l2d = 138,
JVM_OPC_f2i = 139,
JVM_OPC_f2l = 140,
JVM_OPC_f2d = 141,
JVM_OPC_d2i = 142,
JVM_OPC_d2l = 143,
JVM_OPC_d2f = 144,
JVM_OPC_i2b = 145,
JVM_OPC_i2c = 146,
JVM_OPC_i2s = 147,
JVM_OPC_lcmp = 148,
JVM_OPC_fcmpl = 149,
JVM_OPC_fcmpg = 150,
JVM_OPC_dcmpl = 151,
JVM_OPC_dcmpg = 152,
JVM_OPC_ifeq = 153,
JVM_OPC_ifne = 154,
JVM_OPC_iflt = 155,
JVM_OPC_ifge = 156,
JVM_OPC_ifgt = 157,
JVM_OPC_ifle = 158,
JVM_OPC_if_icmpeq = 159,
JVM_OPC_if_icmpne = 160,
JVM_OPC_if_icmplt = 161,
JVM_OPC_if_icmpge = 162,
JVM_OPC_if_icmpgt = 163,
JVM_OPC_if_icmple = 164,
JVM_OPC_if_acmpeq = 165,
JVM_OPC_if_acmpne = 166,
JVM_OPC_goto = 167,
JVM_OPC_jsr = 168,
JVM_OPC_ret = 169,
JVM_OPC_tableswitch = 170,
JVM_OPC_lookupswitch = 171,
JVM_OPC_ireturn = 172,
JVM_OPC_lreturn = 173,
JVM_OPC_freturn = 174,
JVM_OPC_dreturn = 175,
JVM_OPC_areturn = 176,
JVM_OPC_return = 177,
JVM_OPC_getstatic = 178,
JVM_OPC_putstatic = 179,
JVM_OPC_getfield = 180,
JVM_OPC_putfield = 181,
JVM_OPC_invokevirtual = 182,
JVM_OPC_invokespecial = 183,
JVM_OPC_invokestatic = 184,
JVM_OPC_invokeinterface = 185,
JVM_OPC_xxxunusedxxx = 186,
JVM_OPC_new = 187,
JVM_OPC_newarray = 188,
JVM_OPC_anewarray = 189,
JVM_OPC_arraylength = 190,
JVM_OPC_athrow = 191,
JVM_OPC_checkcast = 192,
JVM_OPC_instanceof = 193,
JVM_OPC_monitorenter = 194,
JVM_OPC_monitorexit = 195,
JVM_OPC_wide = 196,
JVM_OPC_multianewarray = 197,
JVM_OPC_ifnull = 198,
JVM_OPC_ifnonnull = 199,
JVM_OPC_goto_w = 200,
JVM_OPC_jsr_w = 201,
JVM_OPC_MAX = 201
};
/* Opcode length initializer, use with something like:
* unsigned char opcode_length[JVM_OPC_MAX+1] = JVM_OPCODE_LENGTH_INITIALIZER;
*/
#define JVM_OPCODE_LENGTH_INITIALIZER { \
1, /* nop */ \
1, /* aconst_null */ \
1, /* iconst_m1 */ \
1, /* iconst_0 */ \
1, /* iconst_1 */ \
1, /* iconst_2 */ \
1, /* iconst_3 */ \
1, /* iconst_4 */ \
1, /* iconst_5 */ \
1, /* lconst_0 */ \
1, /* lconst_1 */ \
1, /* fconst_0 */ \
1, /* fconst_1 */ \
1, /* fconst_2 */ \
1, /* dconst_0 */ \
1, /* dconst_1 */ \
2, /* bipush */ \
3, /* sipush */ \
2, /* ldc */ \
3, /* ldc_w */ \
3, /* ldc2_w */ \
2, /* iload */ \
2, /* lload */ \
2, /* fload */ \
2, /* dload */ \
2, /* aload */ \
1, /* iload_0 */ \
1, /* iload_1 */ \
1, /* iload_2 */ \
1, /* iload_3 */ \
1, /* lload_0 */ \
1, /* lload_1 */ \
1, /* lload_2 */ \
1, /* lload_3 */ \
1, /* fload_0 */ \
1, /* fload_1 */ \
1, /* fload_2 */ \
1, /* fload_3 */ \
1, /* dload_0 */ \
1, /* dload_1 */ \
1, /* dload_2 */ \
1, /* dload_3 */ \
1, /* aload_0 */ \
1, /* aload_1 */ \
1, /* aload_2 */ \
1, /* aload_3 */ \
1, /* iaload */ \
1, /* laload */ \
1, /* faload */ \
1, /* daload */ \
1, /* aaload */ \
1, /* baload */ \
1, /* caload */ \
1, /* saload */ \
2, /* istore */ \
2, /* lstore */ \
2, /* fstore */ \
2, /* dstore */ \
2, /* astore */ \
1, /* istore_0 */ \
1, /* istore_1 */ \
1, /* istore_2 */ \
1, /* istore_3 */ \
1, /* lstore_0 */ \
1, /* lstore_1 */ \
1, /* lstore_2 */ \
1, /* lstore_3 */ \
1, /* fstore_0 */ \
1, /* fstore_1 */ \
1, /* fstore_2 */ \
1, /* fstore_3 */ \
1, /* dstore_0 */ \
1, /* dstore_1 */ \
1, /* dstore_2 */ \
1, /* dstore_3 */ \
1, /* astore_0 */ \
1, /* astore_1 */ \
1, /* astore_2 */ \
1, /* astore_3 */ \
1, /* iastore */ \
1, /* lastore */ \
1, /* fastore */ \
1, /* dastore */ \
1, /* aastore */ \
1, /* bastore */ \
1, /* castore */ \
1, /* sastore */ \
1, /* pop */ \
1, /* pop2 */ \
1, /* dup */ \
1, /* dup_x1 */ \
1, /* dup_x2 */ \
1, /* dup2 */ \
1, /* dup2_x1 */ \
1, /* dup2_x2 */ \
1, /* swap */ \
1, /* iadd */ \
1, /* ladd */ \
1, /* fadd */ \
1, /* dadd */ \
1, /* isub */ \
1, /* lsub */ \
1, /* fsub */ \
1, /* dsub */ \
1, /* imul */ \
1, /* lmul */ \
1, /* fmul */ \
1, /* dmul */ \
1, /* idiv */ \
1, /* ldiv */ \
1, /* fdiv */ \
1, /* ddiv */ \
1, /* irem */ \
1, /* lrem */ \
1, /* frem */ \
1, /* drem */ \
1, /* ineg */ \
1, /* lneg */ \
1, /* fneg */ \
1, /* dneg */ \
1, /* ishl */ \
1, /* lshl */ \
1, /* ishr */ \
1, /* lshr */ \
1, /* iushr */ \
1, /* lushr */ \
1, /* iand */ \
1, /* land */ \
1, /* ior */ \
1, /* lor */ \
1, /* ixor */ \
1, /* lxor */ \
3, /* iinc */ \
1, /* i2l */ \
1, /* i2f */ \
1, /* i2d */ \
1, /* l2i */ \
1, /* l2f */ \
1, /* l2d */ \
1, /* f2i */ \
1, /* f2l */ \
1, /* f2d */ \
1, /* d2i */ \
1, /* d2l */ \
1, /* d2f */ \
1, /* i2b */ \
1, /* i2c */ \
1, /* i2s */ \
1, /* lcmp */ \
1, /* fcmpl */ \
1, /* fcmpg */ \
1, /* dcmpl */ \
1, /* dcmpg */ \
3, /* ifeq */ \
3, /* ifne */ \
3, /* iflt */ \
3, /* ifge */ \
3, /* ifgt */ \
3, /* ifle */ \
3, /* if_icmpeq */ \
3, /* if_icmpne */ \
3, /* if_icmplt */ \
3, /* if_icmpge */ \
3, /* if_icmpgt */ \
3, /* if_icmple */ \
3, /* if_acmpeq */ \
3, /* if_acmpne */ \
3, /* goto */ \
3, /* jsr */ \
2, /* ret */ \
99, /* tableswitch */ \
99, /* lookupswitch */ \
1, /* ireturn */ \
1, /* lreturn */ \
1, /* freturn */ \
1, /* dreturn */ \
1, /* areturn */ \
1, /* return */ \
3, /* getstatic */ \
3, /* putstatic */ \
3, /* getfield */ \
3, /* putfield */ \
3, /* invokevirtual */ \
3, /* invokespecial */ \
3, /* invokestatic */ \
5, /* invokeinterface */ \
0, /* xxxunusedxxx */ \
3, /* new */ \
2, /* newarray */ \
3, /* anewarray */ \
1, /* arraylength */ \
1, /* athrow */ \
3, /* checkcast */ \
3, /* instanceof */ \
1, /* monitorenter */ \
1, /* monitorexit */ \
0, /* wide */ \
4, /* multianewarray */ \
3, /* ifnull */ \
3, /* ifnonnull */ \
5, /* goto_w */ \
5 /* jsr_w */ \
}
#ifdef __cplusplus
} /* extern "C" */
#endif /* __cplusplus */
#endif /* CLASSFILE_CONSTANTS */

View File

@ -1,296 +0,0 @@
/*
* Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
#ifndef _JAVASOFT_JAWT_H_
#define _JAVASOFT_JAWT_H_
#include "jni.h"
#ifdef __cplusplus
extern "C" {
#endif
/*
* AWT native interface (new in JDK 1.3)
*
* The AWT native interface allows a native C or C++ application a means
* by which to access native structures in AWT. This is to facilitate moving
* legacy C and C++ applications to Java and to target the needs of the
* community who, at present, wish to do their own native rendering to canvases
* for performance reasons. Standard extensions such as Java3D also require a
* means to access the underlying native data structures of AWT.
*
* There may be future extensions to this API depending on demand.
*
* A VM does not have to implement this API in order to pass the JCK.
* It is recommended, however, that this API is implemented on VMs that support
* standard extensions, such as Java3D.
*
* Since this is a native API, any program which uses it cannot be considered
* 100% pure java.
*/
/*
* AWT Native Drawing Surface (JAWT_DrawingSurface).
*
* For each platform, there is a native drawing surface structure. This
* platform-specific structure can be found in jawt_md.h. It is recommended
* that additional platforms follow the same model. It is also recommended
* that VMs on Win32 and Solaris support the existing structures in jawt_md.h.
*
*******************
* EXAMPLE OF USAGE:
*******************
*
* In Win32, a programmer wishes to access the HWND of a canvas to perform
* native rendering into it. The programmer has declared the paint() method
* for their canvas subclass to be native:
*
*
* MyCanvas.java:
*
* import java.awt.*;
*
* public class MyCanvas extends Canvas {
*
* static {
* System.loadLibrary("mylib");
* }
*
* public native void paint(Graphics g);
* }
*
*
* myfile.c:
*
* #include "jawt_md.h"
* #include <assert.h>
*
* JNIEXPORT void JNICALL
* Java_MyCanvas_paint(JNIEnv* env, jobject canvas, jobject graphics)
* {
* JAWT awt;
* JAWT_DrawingSurface* ds;
* JAWT_DrawingSurfaceInfo* dsi;
* JAWT_Win32DrawingSurfaceInfo* dsi_win;
* jboolean result;
* jint lock;
*
* // Get the AWT
* awt.version = JAWT_VERSION_1_3;
* result = JAWT_GetAWT(env, &awt);
* assert(result != JNI_FALSE);
*
* // Get the drawing surface
* ds = awt.GetDrawingSurface(env, canvas);
* assert(ds != NULL);
*
* // Lock the drawing surface
* lock = ds->Lock(ds);
* assert((lock & JAWT_LOCK_ERROR) == 0);
*
* // Get the drawing surface info
* dsi = ds->GetDrawingSurfaceInfo(ds);
*
* // Get the platform-specific drawing info
* dsi_win = (JAWT_Win32DrawingSurfaceInfo*)dsi->platformInfo;
*
* //////////////////////////////
* // !!! DO PAINTING HERE !!! //
* //////////////////////////////
*
* // Free the drawing surface info
* ds->FreeDrawingSurfaceInfo(dsi);
*
* // Unlock the drawing surface
* ds->Unlock(ds);
*
* // Free the drawing surface
* awt.FreeDrawingSurface(ds);
* }
*
*/
/*
* JAWT_Rectangle
* Structure for a native rectangle.
*/
typedef struct jawt_Rectangle {
jint x;
jint y;
jint width;
jint height;
} JAWT_Rectangle;
struct jawt_DrawingSurface;
/*
* JAWT_DrawingSurfaceInfo
* Structure for containing the underlying drawing information of a component.
*/
typedef struct jawt_DrawingSurfaceInfo {
/*
* Pointer to the platform-specific information. This can be safely
* cast to a JAWT_Win32DrawingSurfaceInfo on Windows or a
* JAWT_X11DrawingSurfaceInfo on Solaris. See jawt_md.h for details.
*/
void* platformInfo;
/* Cached pointer to the underlying drawing surface */
struct jawt_DrawingSurface* ds;
/* Bounding rectangle of the drawing surface */
JAWT_Rectangle bounds;
/* Number of rectangles in the clip */
jint clipSize;
/* Clip rectangle array */
JAWT_Rectangle* clip;
} JAWT_DrawingSurfaceInfo;
#define JAWT_LOCK_ERROR 0x00000001
#define JAWT_LOCK_CLIP_CHANGED 0x00000002
#define JAWT_LOCK_BOUNDS_CHANGED 0x00000004
#define JAWT_LOCK_SURFACE_CHANGED 0x00000008
/*
* JAWT_DrawingSurface
* Structure for containing the underlying drawing information of a component.
* All operations on a JAWT_DrawingSurface MUST be performed from the same
* thread as the call to GetDrawingSurface.
*/
typedef struct jawt_DrawingSurface {
/*
* Cached reference to the Java environment of the calling thread.
* If Lock(), Unlock(), GetDrawingSurfaceInfo() or
* FreeDrawingSurfaceInfo() are called from a different thread,
* this data member should be set before calling those functions.
*/
JNIEnv* env;
/* Cached reference to the target object */
jobject target;
/*
* Lock the surface of the target component for native rendering.
* When finished drawing, the surface must be unlocked with
* Unlock(). This function returns a bitmask with one or more of the
* following values:
*
* JAWT_LOCK_ERROR - When an error has occurred and the surface could not
* be locked.
*
* JAWT_LOCK_CLIP_CHANGED - When the clip region has changed.
*
* JAWT_LOCK_BOUNDS_CHANGED - When the bounds of the surface have changed.
*
* JAWT_LOCK_SURFACE_CHANGED - When the surface itself has changed
*/
jint (JNICALL *Lock)
(struct jawt_DrawingSurface* ds);
/*
* Get the drawing surface info.
* The value returned may be cached, but the values may change if
* additional calls to Lock() or Unlock() are made.
* Lock() must be called before this can return a valid value.
* Returns NULL if an error has occurred.
* When finished with the returned value, FreeDrawingSurfaceInfo must be
* called.
*/
JAWT_DrawingSurfaceInfo* (JNICALL *GetDrawingSurfaceInfo)
(struct jawt_DrawingSurface* ds);
/*
* Free the drawing surface info.
*/
void (JNICALL *FreeDrawingSurfaceInfo)
(JAWT_DrawingSurfaceInfo* dsi);
/*
* Unlock the drawing surface of the target component for native rendering.
*/
void (JNICALL *Unlock)
(struct jawt_DrawingSurface* ds);
} JAWT_DrawingSurface;
/*
* JAWT
* Structure for containing native AWT functions.
*/
typedef struct jawt {
/*
* Version of this structure. This must always be set before
* calling JAWT_GetAWT()
*/
jint version;
/*
* Return a drawing surface from a target jobject. This value
* may be cached.
* Returns NULL if an error has occurred.
* Target must be a java.awt.Component (should be a Canvas
* or Window for native rendering).
* FreeDrawingSurface() must be called when finished with the
* returned JAWT_DrawingSurface.
*/
JAWT_DrawingSurface* (JNICALL *GetDrawingSurface)
(JNIEnv* env, jobject target);
/*
* Free the drawing surface allocated in GetDrawingSurface.
*/
void (JNICALL *FreeDrawingSurface)
(JAWT_DrawingSurface* ds);
/*
* Since 1.4
* Locks the entire AWT for synchronization purposes
*/
void (JNICALL *Lock)(JNIEnv* env);
/*
* Since 1.4
* Unlocks the entire AWT for synchronization purposes
*/
void (JNICALL *Unlock)(JNIEnv* env);
/*
* Since 1.4
* Returns a reference to a java.awt.Component from a native
* platform handle. On Windows, this corresponds to an HWND;
* on Solaris and Linux, this is a Drawable. For other platforms,
* see the appropriate machine-dependent header file for a description.
* The reference returned by this function is a local
* reference that is only valid in this environment.
* This function returns a NULL reference if no component could be
* found with matching platform information.
*/
jobject (JNICALL *GetComponent)(JNIEnv* env, void* platformInfo);
} JAWT;
/*
* Get the AWT native structure. This function returns JNI_FALSE if
* an error occurs.
*/
_JNI_IMPORT_OR_EXPORT_
jboolean JNICALL JAWT_GetAWT(JNIEnv* env, JAWT* awt);
#define JAWT_VERSION_1_3 0x00010003
#define JAWT_VERSION_1_4 0x00010004
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* !_JAVASOFT_JAWT_H_ */

View File

@ -1,254 +0,0 @@
/*
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* Java Debug Wire Protocol Transport Service Provider Interface.
*/
#ifndef JDWPTRANSPORT_H
#define JDWPTRANSPORT_H
#include "jni.h"
enum {
JDWPTRANSPORT_VERSION_1_0 = 0x00010000
};
#ifdef __cplusplus
extern "C" {
#endif
struct jdwpTransportNativeInterface_;
struct _jdwpTransportEnv;
#ifdef __cplusplus
typedef _jdwpTransportEnv jdwpTransportEnv;
#else
typedef const struct jdwpTransportNativeInterface_ *jdwpTransportEnv;
#endif /* __cplusplus */
/*
* Errors. Universal errors with JVMTI/JVMDI equivalents keep the
* values the same.
*/
typedef enum {
JDWPTRANSPORT_ERROR_NONE = 0,
JDWPTRANSPORT_ERROR_ILLEGAL_ARGUMENT = 103,
JDWPTRANSPORT_ERROR_OUT_OF_MEMORY = 110,
JDWPTRANSPORT_ERROR_INTERNAL = 113,
JDWPTRANSPORT_ERROR_ILLEGAL_STATE = 201,
JDWPTRANSPORT_ERROR_IO_ERROR = 202,
JDWPTRANSPORT_ERROR_TIMEOUT = 203,
JDWPTRANSPORT_ERROR_MSG_NOT_AVAILABLE = 204
} jdwpTransportError;
/*
* Structure to define capabilities
*/
typedef struct {
unsigned int can_timeout_attach :1;
unsigned int can_timeout_accept :1;
unsigned int can_timeout_handshake :1;
unsigned int reserved3 :1;
unsigned int reserved4 :1;
unsigned int reserved5 :1;
unsigned int reserved6 :1;
unsigned int reserved7 :1;
unsigned int reserved8 :1;
unsigned int reserved9 :1;
unsigned int reserved10 :1;
unsigned int reserved11 :1;
unsigned int reserved12 :1;
unsigned int reserved13 :1;
unsigned int reserved14 :1;
unsigned int reserved15 :1;
} JDWPTransportCapabilities;
/*
* Structures to define packet layout.
*
* See: http://java.sun.com/j2se/1.5/docs/guide/jpda/jdwp-spec.html
*/
enum {
JDWPTRANSPORT_FLAGS_NONE = 0x0,
JDWPTRANSPORT_FLAGS_REPLY = 0x80
};
typedef struct {
jint len;
jint id;
jbyte flags;
jbyte cmdSet;
jbyte cmd;
jbyte *data;
} jdwpCmdPacket;
typedef struct {
jint len;
jint id;
jbyte flags;
jshort errorCode;
jbyte *data;
} jdwpReplyPacket;
typedef struct {
union {
jdwpCmdPacket cmd;
jdwpReplyPacket reply;
} type;
} jdwpPacket;
/*
* JDWP functions called by the transport.
*/
typedef struct jdwpTransportCallback {
void *(*alloc)(jint numBytes); /* Call this for all allocations */
void (*free)(void *buffer); /* Call this for all deallocations */
} jdwpTransportCallback;
typedef jint (JNICALL *jdwpTransport_OnLoad_t)(JavaVM *jvm,
jdwpTransportCallback *callback,
jint version,
jdwpTransportEnv** env);
/* Function Interface */
struct jdwpTransportNativeInterface_ {
/* 1 : RESERVED */
void *reserved1;
/* 2 : Get Capabilities */
jdwpTransportError (JNICALL *GetCapabilities)(jdwpTransportEnv* env,
JDWPTransportCapabilities *capabilities_ptr);
/* 3 : Attach */
jdwpTransportError (JNICALL *Attach)(jdwpTransportEnv* env,
const char* address,
jlong attach_timeout,
jlong handshake_timeout);
/* 4: StartListening */
jdwpTransportError (JNICALL *StartListening)(jdwpTransportEnv* env,
const char* address,
char** actual_address);
/* 5: StopListening */
jdwpTransportError (JNICALL *StopListening)(jdwpTransportEnv* env);
/* 6: Accept */
jdwpTransportError (JNICALL *Accept)(jdwpTransportEnv* env,
jlong accept_timeout,
jlong handshake_timeout);
/* 7: IsOpen */
jboolean (JNICALL *IsOpen)(jdwpTransportEnv* env);
/* 8: Close */
jdwpTransportError (JNICALL *Close)(jdwpTransportEnv* env);
/* 9: ReadPacket */
jdwpTransportError (JNICALL *ReadPacket)(jdwpTransportEnv* env,
jdwpPacket *pkt);
/* 10: Write Packet */
jdwpTransportError (JNICALL *WritePacket)(jdwpTransportEnv* env,
const jdwpPacket* pkt);
/* 11: GetLastError */
jdwpTransportError (JNICALL *GetLastError)(jdwpTransportEnv* env,
char** error);
};
/*
* Use inlined functions so that C++ code can use syntax such as
* env->Attach("mymachine:5000", 10*1000, 0);
*
* rather than using C's :-
*
* (*env)->Attach(env, "mymachine:5000", 10*1000, 0);
*/
struct _jdwpTransportEnv {
const struct jdwpTransportNativeInterface_ *functions;
#ifdef __cplusplus
jdwpTransportError GetCapabilities(JDWPTransportCapabilities *capabilities_ptr) {
return functions->GetCapabilities(this, capabilities_ptr);
}
jdwpTransportError Attach(const char* address, jlong attach_timeout,
jlong handshake_timeout) {
return functions->Attach(this, address, attach_timeout, handshake_timeout);
}
jdwpTransportError StartListening(const char* address,
char** actual_address) {
return functions->StartListening(this, address, actual_address);
}
jdwpTransportError StopListening(void) {
return functions->StopListening(this);
}
jdwpTransportError Accept(jlong accept_timeout, jlong handshake_timeout) {
return functions->Accept(this, accept_timeout, handshake_timeout);
}
jboolean IsOpen(void) {
return functions->IsOpen(this);
}
jdwpTransportError Close(void) {
return functions->Close(this);
}
jdwpTransportError ReadPacket(jdwpPacket *pkt) {
return functions->ReadPacket(this, pkt);
}
jdwpTransportError WritePacket(const jdwpPacket* pkt) {
return functions->WritePacket(this, pkt);
}
jdwpTransportError GetLastError(char** error) {
return functions->GetLastError(this, error);
}
#endif /* __cplusplus */
};
#ifdef __cplusplus
} /* extern "C" */
#endif /* __cplusplus */
#endif /* JDWPTRANSPORT_H */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,115 +0,0 @@
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* This header file defines the data structures sent by the VM
* through the JVMTI CompiledMethodLoad callback function via the
* "void * compile_info" parameter. The memory pointed to by the
* compile_info parameter may not be referenced after returning from
* the CompiledMethodLoad callback. These are VM implementation
* specific data structures that may evolve in future releases. A
* JVMTI agent should interpret a non-NULL compile_info as a pointer
* to a region of memory containing a list of records. In a typical
* usage scenario, a JVMTI agent would cast each record to a
* jvmtiCompiledMethodLoadRecordHeader, a struct that represents
* arbitrary information. This struct contains a kind field to indicate
* the kind of information being passed, and a pointer to the next
* record. If the kind field indicates inlining information, then the
* agent would cast the record to a jvmtiCompiledMethodLoadInlineRecord.
* This record contains an array of PCStackInfo structs, which indicate
* for every pc address what are the methods on the invocation stack.
* The "methods" and "bcis" fields in each PCStackInfo struct specify a
* 1-1 mapping between these inlined methods and their bytecode indices.
* This can be used to derive the proper source lines of the inlined
* methods.
*/
#ifndef _JVMTI_CMLR_H_
#define _JVMTI_CMLR_H_
enum {
JVMTI_CMLR_MAJOR_VERSION_1 = 0x00000001,
JVMTI_CMLR_MINOR_VERSION_0 = 0x00000000,
JVMTI_CMLR_MAJOR_VERSION = 0x00000001,
JVMTI_CMLR_MINOR_VERSION = 0x00000000
/*
* This comment is for the "JDK import from HotSpot" sanity check:
* version: 1.0.0
*/
};
typedef enum {
JVMTI_CMLR_DUMMY = 1,
JVMTI_CMLR_INLINE_INFO = 2
} jvmtiCMLRKind;
/*
* Record that represents arbitrary information passed through JVMTI
* CompiledMethodLoadEvent void pointer.
*/
typedef struct _jvmtiCompiledMethodLoadRecordHeader {
jvmtiCMLRKind kind; /* id for the kind of info passed in the record */
jint majorinfoversion; /* major and minor info version values. Init'ed */
jint minorinfoversion; /* to current version value in jvmtiExport.cpp. */
struct _jvmtiCompiledMethodLoadRecordHeader* next;
} jvmtiCompiledMethodLoadRecordHeader;
/*
* Record that gives information about the methods on the compile-time
* stack at a specific pc address of a compiled method. Each element in
* the methods array maps to same element in the bcis array.
*/
typedef struct _PCStackInfo {
void* pc; /* the pc address for this compiled method */
jint numstackframes; /* number of methods on the stack */
jmethodID* methods; /* array of numstackframes method ids */
jint* bcis; /* array of numstackframes bytecode indices */
} PCStackInfo;
/*
* Record that contains inlining information for each pc address of
* an nmethod.
*/
typedef struct _jvmtiCompiledMethodLoadInlineRecord {
jvmtiCompiledMethodLoadRecordHeader header; /* common header for casting */
jint numpcs; /* number of pc descriptors in this nmethod */
PCStackInfo* pcinfo; /* array of numpcs pc descriptors */
} jvmtiCompiledMethodLoadInlineRecord;
/*
* Dummy record used to test that we can pass records with different
* information through the void pointer provided that they can be cast
* to a jvmtiCompiledMethodLoadRecordHeader.
*/
typedef struct _jvmtiCompiledMethodLoadDummyRecord {
jvmtiCompiledMethodLoadRecordHeader header; /* common header for casting */
char message[50];
} jvmtiCompiledMethodLoadDummyRecord;
#endif

View File

@ -1,61 +0,0 @@
/*
* Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
#ifndef _JAVASOFT_JAWT_MD_H_
#define _JAVASOFT_JAWT_MD_H_
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Intrinsic.h>
#include "jawt.h"
#ifdef __cplusplus
extern "C" {
#endif
/*
* X11-specific declarations for AWT native interface.
* See notes in jawt.h for an example of use.
*/
typedef struct jawt_X11DrawingSurfaceInfo {
Drawable drawable;
Display* display;
VisualID visualID;
Colormap colormapID;
int depth;
/*
* Since 1.4
* Returns a pixel value from a set of RGB values.
* This is useful for paletted color (256 color) modes.
*/
int (JNICALL *GetAWTColor)(JAWT_DrawingSurface* ds,
int r, int g, int b);
} JAWT_X11DrawingSurfaceInfo;
#ifdef __cplusplus
}
#endif
#endif /* !_JAVASOFT_JAWT_MD_H_ */

View File

@ -1,42 +0,0 @@
/*
* Copyright (c) 1996, 2000, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
#ifndef _JAVASOFT_JNI_MD_H_
#define _JAVASOFT_JNI_MD_H_
#define JNIEXPORT
#define JNIIMPORT
#define JNICALL
typedef int jint;
#ifdef _LP64 /* 64-bit Solaris */
typedef long jlong;
#else
typedef long long jlong;
#endif
typedef signed char jbyte;
#endif /* !_JAVASOFT_JNI_MD_H_ */

View File

@ -1,15 +0,0 @@
//
// AWTCocoaComponent.h
//
// Copyright (c) 2003 Apple Computer Inc. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <JavaVM/jni.h>
// This is implemented by a com.apple.eawt.CocoaComponent. It receives messages
// from java safely on the AppKit thread. See the com.apple.eawt.CocoaComponent
// java documentation for more information.
@protocol AWTCocoaComponent
-(void)awtMessage:(jint)messageID message:(jobject)message env:(JNIEnv*)env;
@end

View File

@ -1,53 +0,0 @@
/*
* @(#)JDWP.h 1.33 05/11/17
*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
#ifndef JDWP_JDWP_H
#define JDWP_JDWP_H
#include "JDWPCommands.h"
/*
* JDWPCommands.h is the javah'ed version of all the constants defined
* com.sun.tools.jdi.JDWP and all its nested classes. Since the names are
* very long, the macros below are provided for convenience.
*/
#define JDWP_COMMAND_SET(name) JDWP_ ## name
#define JDWP_COMMAND(set, name) JDWP_ ## set ## _ ## name
#define JDWP_REQUEST_MODIFIER(name) \
JDWP_EventRequest_Set_Out_modifiers_Modifier_ ## name
#define JDWP_EVENT(name) \
JDWP_EventKind_ ## name
#define JDWP_THREAD_STATUS(name) \
JDWP_ThreadStatus_ ## name
#define JDWP_SUSPEND_STATUS(name) \
JDWP_SuspendStatus_SUSPEND_STATUS_ ## name
#define JDWP_CLASS_STATUS(name) \
JDWP_ClassStatus_ ## name
#define JDWP_TYPE_TAG(name) \
JDWP_TypeTag_ ## name
#define JDWP_TAG(name) \
JDWP_Tag_ ## name
#define JDWP_STEP_DEPTH(name) \
JDWP_StepDepth_ ## name
#define JDWP_STEP_SIZE(name) \
JDWP_StepSize_ ## name
#define JDWP_SUSPEND_POLICY(name) \
JDWP_SuspendPolicy_ ## name
#define JDWP_INVOKE_OPTIONS(name) \
JDWP_InvokeOptions_INVOKE_ ## name
#define JDWP_ERROR(name) \
JDWP_Error_ ## name
#define JDWP_HIGHEST_COMMAND_SET 17
#define JDWP_REQUEST_NONE -1
/* This typedef helps keep the event and error types straight. */
typedef unsigned short jdwpError;
typedef unsigned char jdwpEvent;
typedef jint jdwpThreadStatus;
#endif

View File

@ -1,257 +0,0 @@
#define JDWP_VirtualMachine 1
#define JDWP_VirtualMachine_Version 1
#define JDWP_VirtualMachine_ClassesBySignature 2
#define JDWP_VirtualMachine_AllClasses 3
#define JDWP_VirtualMachine_AllThreads 4
#define JDWP_VirtualMachine_TopLevelThreadGroups 5
#define JDWP_VirtualMachine_Dispose 6
#define JDWP_VirtualMachine_IDSizes 7
#define JDWP_VirtualMachine_Suspend 8
#define JDWP_VirtualMachine_Resume 9
#define JDWP_VirtualMachine_Exit 10
#define JDWP_VirtualMachine_CreateString 11
#define JDWP_VirtualMachine_Capabilities 12
#define JDWP_VirtualMachine_ClassPaths 13
#define JDWP_VirtualMachine_DisposeObjects 14
#define JDWP_VirtualMachine_HoldEvents 15
#define JDWP_VirtualMachine_ReleaseEvents 16
#define JDWP_VirtualMachine_CapabilitiesNew 17
#define JDWP_VirtualMachine_RedefineClasses 18
#define JDWP_VirtualMachine_SetDefaultStratum 19
#define JDWP_VirtualMachine_AllClassesWithGeneric 20
#define JDWP_VirtualMachine_InstanceCounts 21
#define JDWP_ReferenceType 2
#define JDWP_ReferenceType_Signature 1
#define JDWP_ReferenceType_ClassLoader 2
#define JDWP_ReferenceType_Modifiers 3
#define JDWP_ReferenceType_Fields 4
#define JDWP_ReferenceType_Methods 5
#define JDWP_ReferenceType_GetValues 6
#define JDWP_ReferenceType_SourceFile 7
#define JDWP_ReferenceType_NestedTypes 8
#define JDWP_ReferenceType_Status 9
#define JDWP_ReferenceType_Interfaces 10
#define JDWP_ReferenceType_ClassObject 11
#define JDWP_ReferenceType_SourceDebugExtension 12
#define JDWP_ReferenceType_SignatureWithGeneric 13
#define JDWP_ReferenceType_FieldsWithGeneric 14
#define JDWP_ReferenceType_MethodsWithGeneric 15
#define JDWP_ReferenceType_Instances 16
#define JDWP_ReferenceType_ClassFileVersion 17
#define JDWP_ReferenceType_ConstantPool 18
#define JDWP_ClassType 3
#define JDWP_ClassType_Superclass 1
#define JDWP_ClassType_SetValues 2
#define JDWP_ClassType_InvokeMethod 3
#define JDWP_ClassType_NewInstance 4
#define JDWP_ArrayType 4
#define JDWP_ArrayType_NewInstance 1
#define JDWP_InterfaceType 5
#define JDWP_Method 6
#define JDWP_Method_LineTable 1
#define JDWP_Method_VariableTable 2
#define JDWP_Method_Bytecodes 3
#define JDWP_Method_IsObsolete 4
#define JDWP_Method_VariableTableWithGeneric 5
#define JDWP_Field 8
#define JDWP_ObjectReference 9
#define JDWP_ObjectReference_ReferenceType 1
#define JDWP_ObjectReference_GetValues 2
#define JDWP_ObjectReference_SetValues 3
#define JDWP_ObjectReference_MonitorInfo 5
#define JDWP_ObjectReference_InvokeMethod 6
#define JDWP_ObjectReference_DisableCollection 7
#define JDWP_ObjectReference_EnableCollection 8
#define JDWP_ObjectReference_IsCollected 9
#define JDWP_ObjectReference_ReferringObjects 10
#define JDWP_StringReference 10
#define JDWP_StringReference_Value 1
#define JDWP_ThreadReference 11
#define JDWP_ThreadReference_Name 1
#define JDWP_ThreadReference_Suspend 2
#define JDWP_ThreadReference_Resume 3
#define JDWP_ThreadReference_Status 4
#define JDWP_ThreadReference_ThreadGroup 5
#define JDWP_ThreadReference_Frames 6
#define JDWP_ThreadReference_FrameCount 7
#define JDWP_ThreadReference_OwnedMonitors 8
#define JDWP_ThreadReference_CurrentContendedMonitor 9
#define JDWP_ThreadReference_Stop 10
#define JDWP_ThreadReference_Interrupt 11
#define JDWP_ThreadReference_SuspendCount 12
#define JDWP_ThreadReference_OwnedMonitorsStackDepthInfo 13
#define JDWP_ThreadReference_ForceEarlyReturn 14
#define JDWP_ThreadGroupReference 12
#define JDWP_ThreadGroupReference_Name 1
#define JDWP_ThreadGroupReference_Parent 2
#define JDWP_ThreadGroupReference_Children 3
#define JDWP_ArrayReference 13
#define JDWP_ArrayReference_Length 1
#define JDWP_ArrayReference_GetValues 2
#define JDWP_ArrayReference_SetValues 3
#define JDWP_ClassLoaderReference 14
#define JDWP_ClassLoaderReference_VisibleClasses 1
#define JDWP_EventRequest 15
#define JDWP_EventRequest_Set 1
#define JDWP_EventRequest_Set_Out_modifiers_Modifier_Count 1
#define JDWP_EventRequest_Set_Out_modifiers_Modifier_Conditional 2
#define JDWP_EventRequest_Set_Out_modifiers_Modifier_ThreadOnly 3
#define JDWP_EventRequest_Set_Out_modifiers_Modifier_ClassOnly 4
#define JDWP_EventRequest_Set_Out_modifiers_Modifier_ClassMatch 5
#define JDWP_EventRequest_Set_Out_modifiers_Modifier_ClassExclude 6
#define JDWP_EventRequest_Set_Out_modifiers_Modifier_LocationOnly 7
#define JDWP_EventRequest_Set_Out_modifiers_Modifier_ExceptionOnly 8
#define JDWP_EventRequest_Set_Out_modifiers_Modifier_FieldOnly 9
#define JDWP_EventRequest_Set_Out_modifiers_Modifier_Step 10
#define JDWP_EventRequest_Set_Out_modifiers_Modifier_InstanceOnly 11
#define JDWP_EventRequest_Set_Out_modifiers_Modifier_SourceNameMatch 12
#define JDWP_EventRequest_Clear 2
#define JDWP_EventRequest_ClearAllBreakpoints 3
#define JDWP_StackFrame 16
#define JDWP_StackFrame_GetValues 1
#define JDWP_StackFrame_SetValues 2
#define JDWP_StackFrame_ThisObject 3
#define JDWP_StackFrame_PopFrames 4
#define JDWP_ClassObjectReference 17
#define JDWP_ClassObjectReference_ReflectedType 1
#define JDWP_Event 64
#define JDWP_Event_Composite 100
#define JDWP_Event_Composite_Event_events_Events_VMStart JDWP.EventKind.VM_START
#define JDWP_Event_Composite_Event_events_Events_SingleStep JDWP.EventKind.SINGLE_STEP
#define JDWP_Event_Composite_Event_events_Events_Breakpoint JDWP.EventKind.BREAKPOINT
#define JDWP_Event_Composite_Event_events_Events_MethodEntry JDWP.EventKind.METHOD_ENTRY
#define JDWP_Event_Composite_Event_events_Events_MethodExit JDWP.EventKind.METHOD_EXIT
#define JDWP_Event_Composite_Event_events_Events_MethodExitWithReturnValue JDWP.EventKind.METHOD_EXIT_WITH_RETURN_VALUE
#define JDWP_Event_Composite_Event_events_Events_MonitorContendedEnter JDWP.EventKind.MONITOR_CONTENDED_ENTER
#define JDWP_Event_Composite_Event_events_Events_MonitorContendedEntered JDWP.EventKind.MONITOR_CONTENDED_ENTERED
#define JDWP_Event_Composite_Event_events_Events_MonitorWait JDWP.EventKind.MONITOR_WAIT
#define JDWP_Event_Composite_Event_events_Events_MonitorWaited JDWP.EventKind.MONITOR_WAITED
#define JDWP_Event_Composite_Event_events_Events_Exception JDWP.EventKind.EXCEPTION
#define JDWP_Event_Composite_Event_events_Events_ThreadStart JDWP.EventKind.THREAD_START
#define JDWP_Event_Composite_Event_events_Events_ThreadDeath JDWP.EventKind.THREAD_DEATH
#define JDWP_Event_Composite_Event_events_Events_ClassPrepare JDWP.EventKind.CLASS_PREPARE
#define JDWP_Event_Composite_Event_events_Events_ClassUnload JDWP.EventKind.CLASS_UNLOAD
#define JDWP_Event_Composite_Event_events_Events_FieldAccess JDWP.EventKind.FIELD_ACCESS
#define JDWP_Event_Composite_Event_events_Events_FieldModification JDWP.EventKind.FIELD_MODIFICATION
#define JDWP_Event_Composite_Event_events_Events_VMDeath JDWP.EventKind.VM_DEATH
#define JDWP_Error_NONE 0
#define JDWP_Error_INVALID_THREAD 10
#define JDWP_Error_INVALID_THREAD_GROUP 11
#define JDWP_Error_INVALID_PRIORITY 12
#define JDWP_Error_THREAD_NOT_SUSPENDED 13
#define JDWP_Error_THREAD_SUSPENDED 14
#define JDWP_Error_THREAD_NOT_ALIVE 15
#define JDWP_Error_INVALID_OBJECT 20
#define JDWP_Error_INVALID_CLASS 21
#define JDWP_Error_CLASS_NOT_PREPARED 22
#define JDWP_Error_INVALID_METHODID 23
#define JDWP_Error_INVALID_LOCATION 24
#define JDWP_Error_INVALID_FIELDID 25
#define JDWP_Error_INVALID_FRAMEID 30
#define JDWP_Error_NO_MORE_FRAMES 31
#define JDWP_Error_OPAQUE_FRAME 32
#define JDWP_Error_NOT_CURRENT_FRAME 33
#define JDWP_Error_TYPE_MISMATCH 34
#define JDWP_Error_INVALID_SLOT 35
#define JDWP_Error_DUPLICATE 40
#define JDWP_Error_NOT_FOUND 41
#define JDWP_Error_INVALID_MONITOR 50
#define JDWP_Error_NOT_MONITOR_OWNER 51
#define JDWP_Error_INTERRUPT 52
#define JDWP_Error_INVALID_CLASS_FORMAT 60
#define JDWP_Error_CIRCULAR_CLASS_DEFINITION 61
#define JDWP_Error_FAILS_VERIFICATION 62
#define JDWP_Error_ADD_METHOD_NOT_IMPLEMENTED 63
#define JDWP_Error_SCHEMA_CHANGE_NOT_IMPLEMENTED 64
#define JDWP_Error_INVALID_TYPESTATE 65
#define JDWP_Error_HIERARCHY_CHANGE_NOT_IMPLEMENTED 66
#define JDWP_Error_DELETE_METHOD_NOT_IMPLEMENTED 67
#define JDWP_Error_UNSUPPORTED_VERSION 68
#define JDWP_Error_NAMES_DONT_MATCH 69
#define JDWP_Error_CLASS_MODIFIERS_CHANGE_NOT_IMPLEMENTED 70
#define JDWP_Error_METHOD_MODIFIERS_CHANGE_NOT_IMPLEMENTED 71
#define JDWP_Error_NOT_IMPLEMENTED 99
#define JDWP_Error_NULL_POINTER 100
#define JDWP_Error_ABSENT_INFORMATION 101
#define JDWP_Error_INVALID_EVENT_TYPE 102
#define JDWP_Error_ILLEGAL_ARGUMENT 103
#define JDWP_Error_OUT_OF_MEMORY 110
#define JDWP_Error_ACCESS_DENIED 111
#define JDWP_Error_VM_DEAD 112
#define JDWP_Error_INTERNAL 113
#define JDWP_Error_UNATTACHED_THREAD 115
#define JDWP_Error_INVALID_TAG 500
#define JDWP_Error_ALREADY_INVOKING 502
#define JDWP_Error_INVALID_INDEX 503
#define JDWP_Error_INVALID_LENGTH 504
#define JDWP_Error_INVALID_STRING 506
#define JDWP_Error_INVALID_CLASS_LOADER 507
#define JDWP_Error_INVALID_ARRAY 508
#define JDWP_Error_TRANSPORT_LOAD 509
#define JDWP_Error_TRANSPORT_INIT 510
#define JDWP_Error_NATIVE_METHOD 511
#define JDWP_Error_INVALID_COUNT 512
#define JDWP_EventKind_SINGLE_STEP 1
#define JDWP_EventKind_BREAKPOINT 2
#define JDWP_EventKind_FRAME_POP 3
#define JDWP_EventKind_EXCEPTION 4
#define JDWP_EventKind_USER_DEFINED 5
#define JDWP_EventKind_THREAD_START 6
#define JDWP_EventKind_THREAD_DEATH 7
#define JDWP_EventKind_THREAD_END 7
#define JDWP_EventKind_CLASS_PREPARE 8
#define JDWP_EventKind_CLASS_UNLOAD 9
#define JDWP_EventKind_CLASS_LOAD 10
#define JDWP_EventKind_FIELD_ACCESS 20
#define JDWP_EventKind_FIELD_MODIFICATION 21
#define JDWP_EventKind_EXCEPTION_CATCH 30
#define JDWP_EventKind_METHOD_ENTRY 40
#define JDWP_EventKind_METHOD_EXIT 41
#define JDWP_EventKind_METHOD_EXIT_WITH_RETURN_VALUE 42
#define JDWP_EventKind_MONITOR_CONTENDED_ENTER 43
#define JDWP_EventKind_MONITOR_CONTENDED_ENTERED 44
#define JDWP_EventKind_MONITOR_WAIT 45
#define JDWP_EventKind_MONITOR_WAITED 46
#define JDWP_EventKind_VM_START 90
#define JDWP_EventKind_VM_INIT 90
#define JDWP_EventKind_VM_DEATH 99
#define JDWP_EventKind_VM_DISCONNECTED 100
#define JDWP_ThreadStatus_ZOMBIE 0
#define JDWP_ThreadStatus_RUNNING 1
#define JDWP_ThreadStatus_SLEEPING 2
#define JDWP_ThreadStatus_MONITOR 3
#define JDWP_ThreadStatus_WAIT 4
#define JDWP_SuspendStatus_SUSPEND_STATUS_SUSPENDED 0x1
#define JDWP_ClassStatus_VERIFIED 1
#define JDWP_ClassStatus_PREPARED 2
#define JDWP_ClassStatus_INITIALIZED 4
#define JDWP_ClassStatus_ERROR 8
#define JDWP_TypeTag_CLASS 1
#define JDWP_TypeTag_INTERFACE 2
#define JDWP_TypeTag_ARRAY 3
#define JDWP_Tag_ARRAY 91
#define JDWP_Tag_BYTE 66
#define JDWP_Tag_CHAR 67
#define JDWP_Tag_OBJECT 76
#define JDWP_Tag_FLOAT 70
#define JDWP_Tag_DOUBLE 68
#define JDWP_Tag_INT 73
#define JDWP_Tag_LONG 74
#define JDWP_Tag_SHORT 83
#define JDWP_Tag_VOID 86
#define JDWP_Tag_BOOLEAN 90
#define JDWP_Tag_STRING 115
#define JDWP_Tag_THREAD 116
#define JDWP_Tag_THREAD_GROUP 103
#define JDWP_Tag_CLASS_LOADER 108
#define JDWP_Tag_CLASS_OBJECT 99
#define JDWP_StepDepth_INTO 0
#define JDWP_StepDepth_OVER 1
#define JDWP_StepDepth_OUT 2
#define JDWP_StepSize_MIN 0
#define JDWP_StepSize_LINE 1
#define JDWP_SuspendPolicy_NONE 0
#define JDWP_SuspendPolicy_EVENT_THREAD 1
#define JDWP_SuspendPolicy_ALL 2
#define JDWP_InvokeOptions_INVOKE_SINGLE_THREADED 0x01
#define JDWP_InvokeOptions_INVOKE_NONVIRTUAL 0x02

View File

@ -1,11 +0,0 @@
/*
* JavaVM.h
*
* Copyright (C) 1997-2001, Apple Computer, Inc.
* All Rights Reserved.
*
*/
#import <JavaVM/NSJavaVirtualMachine.h>
#import <JavaVM/NSJavaConfiguration.h>

View File

@ -1,79 +0,0 @@
/*
* NSJavaConfiguration.h
*
* Copyright (c) 1997-2001, Apple Computer, Inc.
* All Rights Reserved.
*
* LaurentR- April, 2000
* - added:
* NSDefaultJavaLibraryKey
* NSDefaultJavaDebugLibraryKey
* NSDefaultObjCJavaLibraryKey
* NSDefaultObjCJavaDebugLibraryKey
* NSJavaVMArgumentsKey
*/
#import <Foundation/Foundation.h>
// The configuration dictionary contains a set of vendor-specific key/value
// pairs and a set of default key/value pairs. If no vendor is specified,
// NSJavaConfiguration uses the NSDefaultJavaVendorKey key to determine which
// vendor-specific dictionary should be searched before the top-level dictionary// is searched. eg.:
/*
{
Vendor = sun;
default = {
DefaultClasspath = "/NextLibrary/Java";
};
next = {
Compiler = "/usr/bin/javac";
VM = "/usr/bin/java";
};
sun = {
Compiler = "/NextLibrary/JDK/bin/javac";
VM = "/NextLibrary/JDK/bin/java";
};
}
*/
// In this case, if no vendor is specified, the `sun' mappings will be searched
// first. The value for `VM' would be "/NextLibrary/JDK/bin/java" and the value
// for `DefaultClasspath' would be "/NextLibrary/Java".
//
// This search patter is applied to three dictionaries, in order:
// - the JavaConfiguration dictionary in the defaults for the application
// - the dictionary in the "JavaConfiguration" domain of the user defaults
// - the configuration file (/NextLibrary/Java/JavaConfig.plist).
// This permits per-application, per-user and per-system specifications.
extern NSString *NSDefaultJavaVendorKey;
extern NSString *NSDefaultJavaVMKey;
extern NSString *NSDefaultJavaCompilerKey;
extern NSString *NSDefaultJavaClassPathKey;
extern NSString *NSDefaultJavaLibraryKey;
extern NSString *NSDefaultJavaDebugLibraryKey;
extern NSString *NSDefaultObjCJavaLibraryKey;
extern NSString *NSDefaultObjCJavaDebugLibraryKey;
extern NSString *NSJavaVMArgumentsKey;
@interface NSJavaConfiguration : NSObject
{
NSString *_vendorName;
}
+ (NSJavaConfiguration *) defaultConfiguration;
+ (NSJavaConfiguration *) configurationForVendor:(NSString *)vendorName;
+ (NSArray *) vendorNames;
- init;
- initWithVendor:(NSString *)vendorName;
- (NSString *) vendorName;
- valueForKey:(NSString *)keyName;
- valueForKey:(NSString *)keyName expandEnvironmentVariables:(BOOL)flag;
@end

View File

@ -1,61 +0,0 @@
/*
* NSJavaVirtualMachine.h
*
* Copyright (c) 1997-2001, Apple Computer, Inc.
* All Rights Reserved.
*/
#import <Foundation/Foundation.h>
@interface NSJavaVirtualMachine : NSObject
{
@private
void *_vmdata;
}
// Returns the default virtual machine - if necessary, calls alloc + init
+ (id) defaultVirtualMachine;
// Returns a class path. First checks NSProcessInfo for an environment variable
// called CLASSPATH and if that doesn't exist, uses NSJavaConfiguration to find
// the default class path.
+ (NSString *) defaultClassPath;
// Note that any NSThreads spawned after this method returns will automatically
// be attached to the virtual machine. Likewise, it is not necessary to attach
// the thread that is actually creating the virtual machine. If you spawn a
// thread before creating the virtual machine, or if you use the cthread/pthread
// or any other non-NSThread api for creating a thread, you must explicitly
// attach those threads before messaging any Java object from that thread.
// This is most easily done by using the -attachCurrentThread method.
// Use -detachCurrentThread to detach explicitly attached threads when done.
- initWithClassPath:(NSString *)classPath;
- (void) attachCurrentThread;
- (void) detachCurrentThread;
- (Class)findClass:(NSString *)className;
- (Class)defineClass:(NSData *)javaClassData withName:(NSString *)className;
@end
@interface NSObject (InstantiatingJavaObjects)
// Instantiating java objects for when no -init/constructor mapping works.
// The class these methods are invoked on *must* be a class returned by the
// -findClass: method (or NSClassFromString() function), otherwise
// NSInvalidJavaClassException is raised. The signature is specified using the
// rather counter-intuitive format defined by the Java Virtual Machine
// specification. Try looking in JavaVM/vm-interface.h for help.
+ (id) newWithSignature:(NSString *)signature, ...;
+ (id) newWithSignature:(NSString *)signature arguments:(va_list)args;
@end
extern NSString *NSInvalidJavaClassException;

View File

@ -1,66 +0,0 @@
//
// jawt_md.h
// Copyright (c) 2002-2010 Apple Inc. All rights reserved.
//
#ifndef _JAVASOFT_JAWT_MD_H_
#define _JAVASOFT_JAWT_MD_H_
#include "jawt.h"
#import <AppKit/NSView.h>
#import <QuartzCore/CALayer.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* JAWT on Mac OS X has two rendering models; legacy NSView, and CALayer.
*
* The CALayer based model returns an object conforming to the JAWT_SurfaceLayers
* protocol in it's JAWT_DrawingSurfaceInfo->platformInfo pointer. A CALayer
* assigned to the "layer" property overlays the rectangle of the java.awt.Component.
* The client CALayer traces the rect of the Java component as it is moved and resized.
*
* If there is a superlayer for the entire window, it is also accessible via
* the "windowLayer" property. This layer is useful for embedding the Java
* window in other layer graphs.
*
*
* The legacy NSView model provides raw access to the NSView hierarchy which
* mirrors the Java component hierarchy. The legacy NSView drawing model is deprecated,
* and will not be available in future versions of Java for Mac OS X.
*
* Clients can opt-into the CALayer model by OR'ing the JAWT_MACOSX_USE_CALAYER into the requested JAWT version.
*
* JAWT awt;
* awt.version = JAWT_VERSION_1_4 | JAWT_MACOSX_USE_CALAYER;
* jboolean success = JAWT_GetAWT(env, &awt);
*
* Future versions of Java for Mac OS X will only support the CALayer model,
* and will not return a JAWT_MacOSXDrawingSurfaceInfo struct.
*/
#define JAWT_MACOSX_USE_CALAYER 0x80000000
// CALayer-based rendering
@protocol JAWT_SurfaceLayers
@property (readwrite, retain) CALayer *layer;
@property (readonly) CALayer *windowLayer;
@end
// Legacy NSView-based rendering
typedef struct JAWT_MacOSXDrawingSurfaceInfo {
NSView *cocoaViewRef; // the view is guaranteed to be valid only for the duration of Component.paint method
}
JAWT_MacOSXDrawingSurfaceInfo;
#ifdef __cplusplus
}
#endif
#endif /* !_JAVASOFT_JAWT_MD_H_ */

View File

@ -1,23 +0,0 @@
/*
* @(#)jni_md.h 1.19 05/11/17
*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
#ifndef _JAVASOFT_JNI_MD_H_
#define _JAVASOFT_JNI_MD_H_
#define JNIEXPORT __attribute__((visibility("default")))
#define JNIIMPORT
#define JNICALL
#if defined(__LP64__) && __LP64__ /* for -Wundef */
typedef int jint;
#else
typedef long jint;
#endif
typedef long long jlong;
typedef signed char jbyte;
#endif /* !_JAVASOFT_JNI_MD_H_ */

View File

@ -1,37 +0,0 @@
/*
* Whooho. api's and stuff
*/
#ifndef _JAVASOFT_JAWT_MD_H_
#define _JAVASOFT_JAWT_MD_H_
#include <windows.h>
#include "jawt.h"
#ifdef __cplusplus
extern "C" {
#endif
/*
* Microsoft win32-specific declarations for using the AWT native interface.
*/
typedef struct jawt_Win32DrawingSurfaceInfo {
/* Tada. The native window, DDB, or DIB handle */
union {
HWND hwnd;
HBITMAP hbitmap;
void* pbits;
};
/*
* This HDC should be the one always used, instead of the one returned from
* BeginPaint() or any particular calls to GetDC().
*/
HDC hdc;
HPALETTE hpalette;
} JAWT_Win32DrawingSurfaceInfo;
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,17 +0,0 @@
/*
* jni_md.h header file
*/
#ifndef _JAVASOFT_JNI_MD_H_
#define _JAVASOFT_JNI_MD_H_
#define JNIEXPORT __declspec(dllexport)
#define JNIIMPORT __declspec(dllimport)
#define JNICALL __stdcall
/* stuff and such */
typedef long jint;
typedef __int64 jlong;
typedef signed char jbyte;
#endif

View File

@ -1,172 +0,0 @@
/**
* =================================================================================
*
* BSD LICENCE (http://en.wikipedia.org/wiki/BSD_licenses)
*
* Copyright (C) 2009-2013, Barchart, Inc. (http://www.barchart.com/)
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the name of the Barchart, Inc. nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Developers: Andrei Pozolotin, CCob
*
* =================================================================================
*/
#include "../jni/JNICCC.h"
#include "../jni/JNICCCFactory.h"
#include "../jni/JNIHelpers.h"
JNIEnv* AttachToJVM(JavaVM* vm)
{
JNIEnv* env = NULL;
jint result = vm->GetEnv(reinterpret_cast<void**>(&env),JNI_VERSION_1_4);
if(result == JNI_EDETACHED)
vm->AttachCurrentThread(reinterpret_cast<void**>(&env),NULL);
return env;
}
JNICCC::JNICCC(JNIEnv* env, jobject objCCC) :
_objCCC( env->NewGlobalRef(objCCC)){
env->GetJavaVM(&_javaVM);
if(_objCCC != NULL){
jclass cccClass = env->GetObjectClass(_objCCC);
//We cannot statically store the methodid's as the objCCC
//class maybe a subclass of CCC which means the method id's would differ
_methodInit = env->GetMethodID(cccClass, "init", "()V" );
_methodClose = env->GetMethodID(cccClass, "close", "()V" );
_methodOnACK = env->GetMethodID(cccClass, "onACK", "(I)V" );
_methodOnLoss = env->GetMethodID(cccClass, "onLoss", "([I)V" );
_methodTimeout = env->GetMethodID(cccClass, "onTimeout", "()V" );
_methodOnPktSent = NULL;
_methodProcessCustomMsg = NULL;
env->SetLongField(objCCC,udt_CCC_fld_nativeHandleID,(jlong)(intptr_t)this);
}
}
JNICCC::~JNICCC() {
JNIEnv* env = AttachToJVM(_javaVM);
if(_objCCC)
env->DeleteGlobalRef(_objCCC);
}
jobject JNICCC::getJavaCCC(){
return _objCCC;
}
void JNICCC::init(){
CCC::init();
if(_objCCC){
JNIEnv* env = AttachToJVM(_javaVM);
env->CallVoidMethod(_objCCC, _methodInit);
}
}
void JNICCC::close(){
CCC::close();
if(_objCCC){
JNIEnv* env = AttachToJVM(_javaVM);
env->CallVoidMethod(_objCCC, _methodClose);
}
}
void JNICCC::onACK(const int32_t& ack){
CCC::onACK(ack);
if(_objCCC){
JNIEnv* env = AttachToJVM(_javaVM);
env->CallVoidMethod(_objCCC, _methodOnACK, ack);
}
}
void JNICCC::onLoss(const int32_t* losslist, const int& size){
//TODO: map to Java CCC class;
CCC::onLoss(losslist,size);
}
void JNICCC::onTimeout(){
CCC::onTimeout();
if(_objCCC){
JNIEnv* env = AttachToJVM(_javaVM);
env->CallVoidMethod(_objCCC, _methodTimeout);
}
}
void JNICCC::onPktSent(const CPacket* pkt){
CCC::onPktSent(pkt);
}
void JNICCC::onPktReceived(const CPacket* pkt){
CCC::onPktReceived(pkt);
}
void JNICCC::processCustomMsg(const CPacket* pkt){
CCC::processCustomMsg(pkt);
}
void JNICCC::setACKTimer(const int& msINT){
CCC::setACKTimer(msINT);
}
void JNICCC::setACKInterval(const int& pktINT){
CCC::setACKInterval(pktINT);
}
void JNICCC::setRTO(const int& usRTO){
CCC::setRTO(usRTO);
}
void JNICCC::setPacketSndPeriod(const double sndPeriod){
m_dPktSndPeriod = sndPeriod;
}
void JNICCC::setCWndSize(const double cWndSize){
m_dCWndSize = cWndSize;
}
const CPerfMon* JNICCC::getPerfInfo(){
return CCC::getPerfInfo();
}

View File

@ -1,110 +0,0 @@
/**
* =================================================================================
*
* BSD LICENCE (http://en.wikipedia.org/wiki/BSD_licenses)
*
* Copyright (C) 2009-2013, Barchart, Inc. (http://www.barchart.com/)
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the name of the Barchart, Inc. nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Developers: Andrei Pozolotin, CCob
*
* =================================================================================
*/
#ifndef JNICCC_H_
#define JNICCC_H_
#include "ccc.h"
#include <jni.h>
class JNICCCFactory;
class JNICCC: public CCC {
friend JNIEXPORT void JNICALL Java_com_barchart_udt_CCC_initNative (JNIEnv *env, jobject self);
private:
jobject _objCCC;
JavaVM* _javaVM;
jmethodID _methodInit;
jmethodID _methodClose;
jmethodID _methodOnACK;
jmethodID _methodOnLoss;
jmethodID _methodTimeout;
jmethodID _methodOnPktSent;
jmethodID _methodProcessCustomMsg;
public:
virtual ~JNICCC();
jobject getJavaCCC();
//we need to override the visibility
//of the setXXX calls since we are
//emulating class inheritance from Java
void setACKTimer(const int& msINT);
void setACKInterval(const int& pktINT);
void setRTO(const int& usRTO);
void setPacketSndPeriod(const double sndPeriod);
void setCWndSize(const double cWndSize);
const CPerfMon* getPerfInfo();
private:
//we don't want to allow any overrides on this
//class since it will be emulated in the Java layer
JNICCC(JNIEnv* env, jobject objCCC);
void init();
void close();
void onACK(const int32_t&);
void onLoss(const int32_t*, const int&);
void onTimeout();
void onPktSent(const CPacket*);
void onPktReceived(const CPacket*);
void processCustomMsg(const CPacket*);
};
#endif /* JNICCC_H_ */

View File

@ -1,122 +0,0 @@
/**
* =================================================================================
*
* BSD LICENCE (http://en.wikipedia.org/wiki/BSD_licenses)
*
* Copyright (C) 2009-2013, Barchart, Inc. (http://www.barchart.com/)
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the name of the Barchart, Inc. nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Developers: Andrei Pozolotin, CCob
*
* =================================================================================
*/
#include "../jni/JNICCCFactory.h"
#include "../jni/JNICCC.h"
#include "../jni/JNIHelpers.h"
jmethodID JNICCCFactory::_udt_clsFactoryInterfaceUDT_create = NULL;
jmethodID JNICCCFactory::_udt_clsFactoryInterfaceUDT_cloneFactory = NULL;
bool JNICCCFactory::initJNITypes(JNIEnv* env){
if(_udt_clsFactoryInterfaceUDT_create != NULL)
return true;
if(udt_FactoryInterfaceUDT==NULL)
return false;
_udt_clsFactoryInterfaceUDT_cloneFactory = env->GetMethodID(udt_FactoryInterfaceUDT, "cloneFactory", "()Lcom/barchart/udt/FactoryInterfaceUDT;");
_udt_clsFactoryInterfaceUDT_create = env->GetMethodID(udt_FactoryInterfaceUDT, "create", "()Lcom/barchart/udt/CCC;");
return true;
}
JNIEnv* JNICCCFactory::AttachToJVM()
{
JNIEnv* env = NULL;
jint result = _javaVM->GetEnv(reinterpret_cast<void**>(&env),JNI_VERSION_1_4);
if(result == JNI_EDETACHED)
_javaVM->AttachCurrentThread(reinterpret_cast<void**>(&env),NULL);
return env;
}
JNICCCFactory::JNICCCFactory(JNIEnv* env, jobject factoryUDT) {
initJNITypes(env);
if(factoryUDT==NULL){
;//TODO create new exception
}
env->GetJavaVM(&_javaVM);
//We need to create a global JNI ref since
//we are storing the jobject as a member variable
//for use later on
_factoryUDT = env->NewGlobalRef(factoryUDT);
}
JNICCCFactory::~JNICCCFactory(){
JNIEnv* env = AttachToJVM();
if(_factoryUDT != NULL){
env->DeleteLocalRef(_factoryUDT);
}
}
CCC* JNICCCFactory::create(){
JNIEnv* env = AttachToJVM();
jobject objCCC = env->CallObjectMethod(_factoryUDT,_udt_clsFactoryInterfaceUDT_create);
if(objCCC==NULL && !env->ExceptionCheck() ){
UDT_ThrowExceptionUDT_Message(env, 0, "failed to allocate CCC class via com.barchart.udt.FactoryInterfaceUDT");
}
return reinterpret_cast<CCC*> ((intptr_t) env->GetLongField(objCCC,udt_CCC_fld_nativeHandleID));
}
CCCVirtualFactory* JNICCCFactory::clone(){
JNIEnv* env = AttachToJVM();
jobject objFactoryUDT = env->CallObjectMethod(_factoryUDT,_udt_clsFactoryInterfaceUDT_cloneFactory);
return new JNICCCFactory(env,objFactoryUDT);
}

View File

@ -1,68 +0,0 @@
/**
* =================================================================================
*
* BSD LICENCE (http://en.wikipedia.org/wiki/BSD_licenses)
*
* Copyright (C) 2009-2013, Barchart, Inc. (http://www.barchart.com/)
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the name of the Barchart, Inc. nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Developers: Andrei Pozolotin, CCob
*
* =================================================================================
*/
#ifndef JNICCCFACTORY_H_
#define JNICCCFACTORY_H_
#include "ccc.h"
#include <jni.h>
class JNICCCFactory: public CCCVirtualFactory {
private:
static jmethodID _udt_clsFactoryInterfaceUDT_create;
static jmethodID _udt_clsFactoryInterfaceUDT_cloneFactory;
JavaVM* _javaVM;
jobject _factoryUDT;
static bool initJNITypes(JNIEnv* env);
JNIEnv* AttachToJVM();
public:
JNICCCFactory(JNIEnv* env, jobject factoryUDT);
virtual ~JNICCCFactory();
CCC* create();
CCCVirtualFactory* clone();
};
#endif /* JNICCCFACTORY_H_ */

View File

@ -1,301 +0,0 @@
/**
* =================================================================================
*
* BSD LICENCE (http://en.wikipedia.org/wiki/BSD_licenses)
*
* Copyright (C) 2009-2013, Barchart, Inc. (http://www.barchart.com/)
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the name of the Barchart, Inc. nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Developers: Andrei Pozolotin, CCob
*
* =================================================================================
*/
#include "../jni/JNIHelpers.h"
#include "jni.h"
// ### JNI
#define JNI_UPDATE 0 // jni object release with copy
//
// ### JDK references
// JDK classes
jclass jdk_Boolean; // java.lang.Boolean
jclass jdk_Integer; // java.lang.Integer
jclass jdk_Long; // java.lang.Long
jclass jdk_InetAddress; // java.net.InetAddress
jclass jdk_InetSocketAddress; // java.net.InetSocketAddress
jclass jdk_SocketException; // java.net.SocketException
jclass jdk_Set; // java.util.Set
jclass jdk_Iterator; // java.util.Iterator
// JDK methods
jmethodID jdk_Boolean_init; // new Boolean(boolean x)
jmethodID jdk_Integer_init; // new Integer(int x)
jmethodID jdk_Long_init; // new Long(long x)
jmethodID jdk_InetAddress_getAddress; // byte[] getAddress()
jmethodID jdk_InetAddress_getByAddress; // static InetAddress getByAddress(byte[])
jmethodID jdk_InetSocketAddress_init; // new InetSocketAddress(InetAddress x)
jmethodID jdk_InetSocketAddress_getAddress; //
jmethodID jdk_InetSocketAddress_getPort; //
jmethodID jdk_Set_iterator; // Iterator set.iterator()
jmethodID jdk_Set_add; // boolean set.add(Object)
jmethodID jdk_Set_contains; // boolean set.contains(Object)
jmethodID jdk_Iterator_hasNext; // boolean iterator.hasNext()
jmethodID jdk_Iterator_next; // Object iterator.next()
// UDT classes
jclass udt_FactoryInterfaceUDT; //com.barchart.udt.FactoryInterfaceUDT
// UDT methods
jfieldID udt_CCC_fld_nativeHandleID;
void X_InitClassReference(JNIEnv *env, jclass *classReference,
const char *className) {
CHK_NUL_RET_RET(env, "env");
CHK_NUL_RET_RET(className, "className");
CHK_NUL_RET_RET(classReference, "classReference");
jclass klaz = env->FindClass(className);
CHK_NUL_RET_RET(klaz, "klaz");
*classReference = static_cast<jclass>(env->NewGlobalRef((jobject) klaz));
CHK_NUL_RET_RET(*classReference, "*classReference");
}
void X_FreeClassReference(JNIEnv *env, jclass* globalRef) {
CHK_NUL_RET_RET(env, "env");
CHK_NUL_RET_RET(globalRef, "globalRef");
env->DeleteGlobalRef(*globalRef);
*globalRef = NULL;
}
// use native bool parameter
jobject X_NewBoolean(JNIEnv *env, bool value) {
CHK_NUL_RET_NUL(env, "env");
return env->NewObject(jdk_Boolean, jdk_Boolean_init,
BOOLEAN(value) );
}
// use native 32 bit int parameter
jobject X_NewInteger(JNIEnv *env, int value) {
CHK_NUL_RET_NUL(env, "env");
return env->NewObject(jdk_Integer, jdk_Integer_init, (jint) value);
}
// use native 64 bit long parameter
jobject X_NewLong(JNIEnv* env, int64_t value) {
CHK_NUL_RET_NUL(env, "env");
return env->NewObject(jdk_Long, jdk_Long_init, (jlong) value);
}
// NOTE: ipv4 only
int X_InitSockAddr(sockaddr* sockAddr) {
CHK_NUL_RET_ERR(sockAddr, "sockAddr");
sockaddr_in* sockAddrIn = (sockaddr_in*) sockAddr;
sockAddrIn->sin_family = AF_INET;
memset(&(sockAddrIn->sin_zero), '\0', 8);
return JNI_OK;
}
// NOTE: ipv4 only
int X_ConvertInetAddressToInteger( //
JNIEnv* env, //
jobject objInetAddress, //
jint* address //
) {
CHK_NUL_RET_ERR(env, "env");
CHK_NUL_RET_ERR(objInetAddress, "objInetAddress");
CHK_NUL_RET_ERR(address, "address");
const jbyteArray objArray = (jbyteArray) env->CallObjectMethod(
objInetAddress, jdk_InetAddress_getAddress);
CHK_NUL_RET_ERR(objArray, "objArray");
const int sizeArray = env->GetArrayLength(objArray);
switch (sizeArray) {
case 4:
// IPV4
break;
case 16:
// IPV6
default:
CHK_LOG("unsupported address size", "sizeArray");
return JNI_ERR;
}
jbyte* refArray = env->GetByteArrayElements(objArray, NULL);
int value = 0;
value |= (0xFF000000 & (refArray[0] << 24));
value |= (0x00FF0000 & (refArray[1] << 16));
value |= (0x0000FF00 & (refArray[2] << 8));
value |= (0x000000FF & (refArray[3]));
env->ReleaseByteArrayElements(objArray, refArray, 0);
*address = value;
return JNI_OK;
}
// NOTE: ipv4 only
int X_ConvertInetSocketAddressToSockaddr( //
JNIEnv* env, //
jobject objInetSocketAddress, //
sockaddr* sockAddr //
) {
CHK_NUL_RET_ERR(env, "env");
CHK_NUL_RET_ERR(sockAddr, "sockAddr");
CHK_NUL_RET_ERR(objInetSocketAddress, "objInetSocketAddress");
const jobject objInetAddress = env->CallObjectMethod(objInetSocketAddress,
jdk_InetSocketAddress_getAddress);
CHK_NUL_RET_ERR(objInetAddress, "objInetAddress");
jint address = 0;
jint port = env->CallIntMethod(objInetSocketAddress,
jdk_InetSocketAddress_getPort);
const int rv = X_ConvertInetAddressToInteger(env, objInetAddress, &address);
if (rv == JNI_ERR) {
return JNI_ERR;
}
sockaddr_in* sockAddrIn = (sockaddr_in*) sockAddr;
sockAddrIn->sin_addr.s_addr = htonl(address);
sockAddrIn->sin_port = htons(port);
return JNI_OK;
}
// NOTE: only ipv4
jobject X_NewInetAddress( //
JNIEnv* env, //
const jint address //
) {
CHK_NUL_RET_NUL(env, "env");
char valArray[4];
valArray[0] = (address & 0xFF000000) >> 24;
valArray[1] = (address & 0x00FF0000) >> 16;
valArray[2] = (address & 0x0000FF00) >> 8;
valArray[3] = (address & 0x000000FF);
const jbyteArray objArray = env->NewByteArray(4);
env->SetByteArrayRegion(objArray, (jint) 0, (jint) 4, (jbyte*) valArray);
const jobject objInetAddress = env->CallStaticObjectMethod(
jdk_InetAddress, jdk_InetAddress_getByAddress, objArray);
CHK_NUL_RET_NUL(objInetAddress, "objInetAddress");
return objInetAddress;
}
// NOTE: ipv4 only
jobject X_NewInetSocketAddress( //
JNIEnv* env, //
sockaddr* sockAddr //
) {
CHK_NUL_RET_NUL(env, "env");
CHK_NUL_RET_NUL(sockAddr, "sockAddr");
sockaddr_in* sockAddrIn = (sockaddr_in*) sockAddr;
const jint address = ntohl(sockAddrIn->sin_addr.s_addr);
const jint port = ntohs(sockAddrIn->sin_port);
const jobject objInetAddress = X_NewInetAddress(env, address);
CHK_NUL_RET_NUL(objInetAddress, "objInetAddress");
const jobject objInetSocketAddress = env->NewObject(
jdk_InetSocketAddress, jdk_InetSocketAddress_init,
objInetAddress, port);
CHK_NUL_RET_NUL(objInetSocketAddress, "objInetSocketAddress");
return objInetSocketAddress;
}
bool X_IsSockaddrEqualsInetSocketAddress( //
JNIEnv* env, //
sockaddr* sockAddr, //
jobject objSocketAddress //
) {
CHK_NUL_RET_FLS(env, "env");
CHK_NUL_RET_FLS(sockAddr, "sockAddr");
CHK_NUL_RET_FLS(objSocketAddress, "objSocketAddress");
sockaddr_in* sockAddrIn = (sockaddr_in*) sockAddr;
jint address1 = ntohl(sockAddrIn->sin_addr.s_addr);
jint port1 = ntohs(sockAddrIn->sin_port);
jint address2 = 0;
jint port2 = env->CallIntMethod(objSocketAddress,
jdk_InetSocketAddress_getPort);
jobject objInetAddress = env->CallObjectMethod(objSocketAddress,
jdk_InetSocketAddress_getAddress);
CHK_NUL_RET_ERR(objInetAddress, "objInetAddress");
const int rv = X_ConvertInetAddressToInteger(env, objInetAddress,
&address2);
if (rv == JNI_ERR) {
return false;
}
if (address1 == address2 && port1 == port2) {
return true;
}
return false;
}

View File

@ -1,198 +0,0 @@
/**
* =================================================================================
*
* BSD LICENCE (http://en.wikipedia.org/wiki/BSD_licenses)
*
* Copyright (C) 2009-2013, Barchart, Inc. (http://www.barchart.com/)
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the name of the Barchart, Inc. nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Developers: Andrei Pozolotin, CCob
*
* =================================================================================
*/
#ifndef JNIHELPERS_H_
#define JNIHELPERS_H_
#include "udt.h"
#include <cassert>
#include <climits>
#include <cstring>
#include <vector>
#include <algorithm>
#include "jni.h"
// ### JNI
#define JNI_UPDATE 0 // jni object release with copy
//
extern "C"{
// ### JDK references
// JDK classes
extern jclass jdk_Boolean; // java.lang.Boolean
extern jclass jdk_Integer; // java.lang.Integer
extern jclass jdk_Long; // java.lang.Long
extern jclass jdk_InetAddress; // java.net.InetAddress
extern jclass jdk_InetSocketAddress; // java.net.InetSocketAddress
extern jclass jdk_SocketException; // java.net.SocketException
extern jclass jdk_Set; // java.util.Set
extern jclass jdk_Iterator; // java.util.Iterator
// JDK methods
extern jmethodID jdk_Boolean_init; // new Boolean(boolean x)
extern jmethodID jdk_Integer_init; // new Integer(int x)
extern jmethodID jdk_Long_init; // new Long(long x)
extern jmethodID jdk_InetAddress_getAddress; // byte[] getAddress()
extern jmethodID jdk_InetAddress_getByAddress; // static InetAddress getByAddress(byte[])
extern jmethodID jdk_InetSocketAddress_init; // new InetSocketAddress(InetAddress x)
extern jmethodID jdk_InetSocketAddress_getAddress; // InetAddress InetSocketAddress.getAddress()
extern jmethodID jdk_InetSocketAddress_getPort; // int InetSocketAddress.getPort()
extern jmethodID jdk_Set_iterator; // Iterator Set.iterator()
extern jmethodID jdk_Set_add; // boolean Set.add(Object)
extern jmethodID jdk_Set_contains; // boolean Set.contains(Object)
extern jmethodID jdk_Iterator_hasNext; // boolean Iterator.hasNext()
extern jmethodID jdk_Iterator_next; // Object Iterator.next()
// UDT classes
extern jclass udt_FactoryInterfaceUDT;
// UDT methods
extern jfieldID udt_CCC_fld_nativeHandleID;
//#define EOL "\n"
// special UDT method return value
#define UDT_TIMEOUT 0
// TODO make more portable mingw / msvc
#ifdef _MSC_VER
#define __func__ __FUNCTION__
#endif
//
// null pointer safety
//
#define CHK_LOG(title,comment) printf ("%s function: %s comment: %s", title, __func__, comment);
//
#define CHK_NUL_RET_RET(reference,comment) if ((reference) == NULL) \
{ CHK_LOG("CHK_NUL_RET_RET;",comment); return; }
//
#define CHK_NUL_RET_NUL(reference,comment) if ((reference) == NULL) \
{ CHK_LOG("CHK_NUL_RET_NUL;",comment); return NULL; }
//
#define CHK_NUL_RET_FLS(reference,comment) if ((reference) == NULL) \
{ CHK_LOG("CHK_NUL_RET_FLS;",comment); return false; }
//
#define CHK_NUL_RET_ERR(reference,comment) if ((reference) == NULL) \
{ CHK_LOG("CHK_NUL_RET_ERR;",comment); return JNI_ERR; }
//
// c++ <-> java, bool <-> boolean conversions
#define BOOL(x) (((x) == JNI_TRUE) ? true : false) // from java to c++
#define BOOLEAN(x) ((jboolean) ( ((x) == true) ? JNI_TRUE : JNI_FALSE )) // from c++ to java
//
// free/malloc convenience
#define FREE(x) if ((x) != NULL) { free(x); x = NULL; }
#define MALLOC(var,type,size) type* var = (type*) malloc(sizeof(type) * size);
// declare unused explicitly or else see compiler warnings
#define UNUSED(x) ((void)(x))
void X_InitClassReference(JNIEnv *env, jclass *classReference,
const char *className);
void X_FreeClassReference(JNIEnv *env, jclass* globalRef);
jobject X_NewBoolean(JNIEnv *env, bool value);
jobject X_NewInteger(JNIEnv *env, int value);
jobject X_NewLong(JNIEnv* env, int64_t value);
int X_InitSockAddr(sockaddr* sockAddr);
inline bool X_IsInRange(jlong min, jlong var, jlong max) {
if (min <= var && var <= max) {
return true;
} else {
return false;
}
}
inline void X_ConvertMillisIntoTimeValue(const jlong millisTimeout,
timeval* timeValue) {
if (millisTimeout < 0) { // infinite wait
timeValue->tv_sec = INT_MAX;
timeValue->tv_usec = 0;
} else if (millisTimeout > 0) { // finite wait
timeValue->tv_sec = millisTimeout / 1000; // msvc C4244
timeValue->tv_usec = (millisTimeout % 1000) * 1000;
} else { // immediate return (not less the UDT event slice of 10 ms)
timeValue->tv_sec = 0;
timeValue->tv_usec = 0;
}
}
// NOTE: ipv4 only
int X_ConvertInetSocketAddressToSockaddr(JNIEnv* env,
jobject objInetSocketAddress, sockaddr* sockAddr);
// NOTE: only ipv4
jobject X_NewInetAddress(JNIEnv* env, jint address);
// NOTE: ipv4 only
jobject X_NewInetSocketAddress(JNIEnv* env, sockaddr* sockAddr);
// NOTE: ipv4 only
bool X_IsSockaddrEqualsInetSocketAddress(JNIEnv* env, sockaddr* sockAddr,
jobject socketAddress);
void UDT_ThrowExceptionUDT_Message(JNIEnv* env, const jint socketID,
const char *comment);
}//extern "C"
#endif /* JNIHELPERS_H_ */

View File

@ -1,186 +0,0 @@
/**
* =================================================================================
*
* BSD LICENCE (http://en.wikipedia.org/wiki/BSD_licenses)
*
* Copyright (C) 2009-2013, Barchart, Inc. (http://www.barchart.com/)
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the name of the Barchart, Inc. nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Developers: Andrei Pozolotin, CCob
*
* =================================================================================
*/
#include "../jni/com_barchart_udt_CCC.h"
#include "../jni/JNICCC.h"
#include "../jni/JNIHelpers.h"
extern "C" {
JNICCC* getNativeJNICCC(JNIEnv* env, jobject javaCCC){
CHK_NUL_RET_NUL(env, "env");
CHK_NUL_RET_NUL(env, "javaCCC");
JNICCC* jniCCC = reinterpret_cast<JNICCC*>( (intptr_t) env->GetLongField(javaCCC,udt_CCC_fld_nativeHandleID)) ;
if(jniCCC==NULL){
UDT_ThrowExceptionUDT_Message(env,0,"illegal state, nativeHandle not set to instance of native JNICCC* class");
return NULL;
}
return jniCCC;
}
/*
* Class: com_barchart_udt_CCC
* Method: initNative
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_com_barchart_udt_CCC_initNative (JNIEnv *env, jobject self){
JNICCC* jniCCC = new JNICCC(env, self);
if(jniCCC==NULL)
UDT_ThrowExceptionUDT_Message(env,0,"failed to allocate native JNICCC* class");
return;
}
/*
* Class: com_barchart_udt_CCC
* Method: setACKTimer
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_com_barchart_udt_CCC_setACKTimer
(JNIEnv * env, jobject obj, jint msINT){
JNICCC* jniCCC = getNativeJNICCC(env,obj);
if(jniCCC==NULL){
return;
}
jniCCC->setACKTimer(msINT);
}
/*
* Class: com_barchart_udt_CCC
* Method: setACKInterval
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_com_barchart_udt_CCC_setACKInterval
(JNIEnv * env, jobject obj, jint pktINT){
JNICCC* jniCCC = getNativeJNICCC(env,obj);
if(jniCCC==NULL)
return;
jniCCC->setACKInterval(pktINT);
}
/*
* Class: com_barchart_udt_CCC
* Method: setRTO
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_com_barchart_udt_CCC_setRTO
(JNIEnv * env, jobject obj, jint usRTO){
JNICCC* jniCCC = getNativeJNICCC(env,obj);
if(jniCCC==NULL)
return;
jniCCC->setRTO(usRTO);
}
/*
* Class: com_barchart_udt_CCC
* Method: setPacketSndPeriod
* Signature: (D)V
*/
JNIEXPORT void JNICALL Java_com_barchart_udt_CCC_setPacketSndPeriod
(JNIEnv *env, jobject obj, jdouble sndPeriod){
JNICCC* jniCCC = getNativeJNICCC(env,obj);
if(jniCCC==NULL)
return;
jniCCC->setPacketSndPeriod(sndPeriod);
}
/*
* Class: com_barchart_udt_CCC
* Method: setCWndSize
* Signature: (D)V
*/
JNIEXPORT void JNICALL Java_com_barchart_udt_CCC_setCWndSize
(JNIEnv *env, jobject obj, jdouble cWndSize){
JNICCC* jniCCC = getNativeJNICCC(env,obj);
if(jniCCC==NULL)
return;
jniCCC->setCWndSize(cWndSize);
}
/*
* Class: com_barchart_udt_CCC
* Method: getPerfInfo
* Signature: ()Lcom/barchart/udt/MonitorUDT;
*/
JNIEXPORT jobject JNICALL Java_com_barchart_udt_CCC_getPerfInfo
(JNIEnv *env, jobject obj){
JNICCC* jniCCC = getNativeJNICCC(env,obj);
const CPerfMon* perfMon = jniCCC->getPerfInfo();
UNUSED(perfMon);
UDT_ThrowExceptionUDT_Message(env,0,"TODO: implement CPerfMon -> MonitorUDT mapping");
return NULL;
}
} // __cplusplus defined.

View File

@ -1,71 +0,0 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
#include <jvmti.h>
/* Header for class com_barchart_udt_CCC */
#ifndef _Included_com_barchart_udt_CCC
#define _Included_com_barchart_udt_CCC
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: com_barchart_udt_CCC
* Method: initNative
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_com_barchart_udt_CCC_initNative
(JNIEnv *, jobject);
/*
* Class: com_barchart_udt_CCC
* Method: setACKTimer
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_com_barchart_udt_CCC_setACKTimer
(JNIEnv *, jobject, jint);
/*
* Class: com_barchart_udt_CCC
* Method: setACKInterval
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_com_barchart_udt_CCC_setACKInterval
(JNIEnv *, jobject, jint);
/*
* Class: com_barchart_udt_CCC
* Method: setRTO
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_com_barchart_udt_CCC_setRTO
(JNIEnv *, jobject, jint);
/*
* Class: com_barchart_udt_CCC
* Method: setPacketSndPeriod
* Signature: (D)V
*/
JNIEXPORT void JNICALL Java_com_barchart_udt_CCC_setPacketSndPeriod
(JNIEnv *, jobject, jdouble);
/*
* Class: com_barchart_udt_CCC
* Method: setCWndSize
* Signature: (D)V
*/
JNIEXPORT void JNICALL Java_com_barchart_udt_CCC_setCWndSize
(JNIEnv *, jobject, jdouble);
/*
* Class: com_barchart_udt_CCC
* Method: getPerfInfo
* Signature: ()Lcom/barchart/udt/MonitorUDT;
*/
JNIEXPORT jobject JNICALL Java_com_barchart_udt_CCC_getPerfInfo
(JNIEnv *, jobject);
#ifdef __cplusplus
}
#endif
#endif

File diff suppressed because it is too large Load Diff

View File

@ -1,416 +0,0 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
#include <jvmti.h>
/* Header for class com_barchart_udt_SocketUDT */
#ifndef _Included_com_barchart_udt_SocketUDT
#define _Included_com_barchart_udt_SocketUDT
#ifdef __cplusplus
extern "C" {
#endif
#undef com_barchart_udt_SocketUDT_DEFAULT_ACCEPT_QUEUE_SIZE
#define com_barchart_udt_SocketUDT_DEFAULT_ACCEPT_QUEUE_SIZE 256L
#undef com_barchart_udt_SocketUDT_DEFAULT_FILE_BLOCK_SIZE
#define com_barchart_udt_SocketUDT_DEFAULT_FILE_BLOCK_SIZE 1048576L
#undef com_barchart_udt_SocketUDT_DEFAULT_MAX_SELECTOR_SIZE
#define com_barchart_udt_SocketUDT_DEFAULT_MAX_SELECTOR_SIZE 1024L
#undef com_barchart_udt_SocketUDT_DEFAULT_MIN_SELECTOR_TIMEOUT
#define com_barchart_udt_SocketUDT_DEFAULT_MIN_SELECTOR_TIMEOUT 10L
#undef com_barchart_udt_SocketUDT_INFINITE_TTL
#define com_barchart_udt_SocketUDT_INFINITE_TTL -1L
#undef com_barchart_udt_SocketUDT_SIGNATURE_JNI
#define com_barchart_udt_SocketUDT_SIGNATURE_JNI 20150706L
#undef com_barchart_udt_SocketUDT_TIMEOUT_INFINITE
#define com_barchart_udt_SocketUDT_TIMEOUT_INFINITE -1L
#undef com_barchart_udt_SocketUDT_UDT_EXCEPT_INDEX
#define com_barchart_udt_SocketUDT_UDT_EXCEPT_INDEX 2L
#undef com_barchart_udt_SocketUDT_UDT_READ_INDEX
#define com_barchart_udt_SocketUDT_UDT_READ_INDEX 0L
#undef com_barchart_udt_SocketUDT_UDT_SIZE_COUNT
#define com_barchart_udt_SocketUDT_UDT_SIZE_COUNT 3L
#undef com_barchart_udt_SocketUDT_UDT_WRITE_INDEX
#define com_barchart_udt_SocketUDT_UDT_WRITE_INDEX 1L
/*
* Class: com_barchart_udt_SocketUDT
* Method: epollAdd0
* Signature: (III)V
*/
JNIEXPORT void JNICALL Java_com_barchart_udt_SocketUDT_epollAdd0
(JNIEnv *, jclass, jint, jint, jint);
/*
* Class: com_barchart_udt_SocketUDT
* Method: epollCreate0
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_com_barchart_udt_SocketUDT_epollCreate0
(JNIEnv *, jclass);
/*
* Class: com_barchart_udt_SocketUDT
* Method: epollRelease0
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_com_barchart_udt_SocketUDT_epollRelease0
(JNIEnv *, jclass, jint);
/*
* Class: com_barchart_udt_SocketUDT
* Method: epollRemove0
* Signature: (II)V
*/
JNIEXPORT void JNICALL Java_com_barchart_udt_SocketUDT_epollRemove0
(JNIEnv *, jclass, jint, jint);
/*
* Class: com_barchart_udt_SocketUDT
* Method: epollUpdate0
* Signature: (III)V
*/
JNIEXPORT void JNICALL Java_com_barchart_udt_SocketUDT_epollUpdate0
(JNIEnv *, jclass, jint, jint, jint);
/*
* Class: com_barchart_udt_SocketUDT
* Method: epollVerify0
* Signature: (II)I
*/
JNIEXPORT jint JNICALL Java_com_barchart_udt_SocketUDT_epollVerify0
(JNIEnv *, jclass, jint, jint);
/*
* Class: com_barchart_udt_SocketUDT
* Method: epollWait0
* Signature: (ILjava/nio/IntBuffer;Ljava/nio/IntBuffer;Ljava/nio/IntBuffer;J)I
*/
JNIEXPORT jint JNICALL Java_com_barchart_udt_SocketUDT_epollWait0
(JNIEnv *, jclass, jint, jobject, jobject, jobject, jlong);
/*
* Class: com_barchart_udt_SocketUDT
* Method: getSignatureJNI0
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_com_barchart_udt_SocketUDT_getSignatureJNI0
(JNIEnv *, jclass);
/*
* Class: com_barchart_udt_SocketUDT
* Method: initClass0
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_com_barchart_udt_SocketUDT_initClass0
(JNIEnv *, jclass);
/*
* Class: com_barchart_udt_SocketUDT
* Method: receive0
* Signature: (II[B)I
*/
JNIEXPORT jint JNICALL Java_com_barchart_udt_SocketUDT_receive0
(JNIEnv *, jclass, jint, jint, jbyteArray);
/*
* Class: com_barchart_udt_SocketUDT
* Method: receive1
* Signature: (II[BII)I
*/
JNIEXPORT jint JNICALL Java_com_barchart_udt_SocketUDT_receive1
(JNIEnv *, jclass, jint, jint, jbyteArray, jint, jint);
/*
* Class: com_barchart_udt_SocketUDT
* Method: receive2
* Signature: (IILjava/nio/ByteBuffer;II)I
*/
JNIEXPORT jint JNICALL Java_com_barchart_udt_SocketUDT_receive2
(JNIEnv *, jclass, jint, jint, jobject, jint, jint);
/*
* Class: com_barchart_udt_SocketUDT
* Method: receiveFile0
* Signature: (ILjava/lang/String;JJI)J
*/
JNIEXPORT jlong JNICALL Java_com_barchart_udt_SocketUDT_receiveFile0
(JNIEnv *, jclass, jint, jstring, jlong, jlong, jint);
/*
* Class: com_barchart_udt_SocketUDT
* Method: send0
* Signature: (IIIZ[B)I
*/
JNIEXPORT jint JNICALL Java_com_barchart_udt_SocketUDT_send0
(JNIEnv *, jclass, jint, jint, jint, jboolean, jbyteArray);
/*
* Class: com_barchart_udt_SocketUDT
* Method: send1
* Signature: (IIIZ[BII)I
*/
JNIEXPORT jint JNICALL Java_com_barchart_udt_SocketUDT_send1
(JNIEnv *, jclass, jint, jint, jint, jboolean, jbyteArray, jint, jint);
/*
* Class: com_barchart_udt_SocketUDT
* Method: send2
* Signature: (IIIZLjava/nio/ByteBuffer;II)I
*/
JNIEXPORT jint JNICALL Java_com_barchart_udt_SocketUDT_send2
(JNIEnv *, jclass, jint, jint, jint, jboolean, jobject, jint, jint);
/*
* Class: com_barchart_udt_SocketUDT
* Method: sendFile0
* Signature: (ILjava/lang/String;JJI)J
*/
JNIEXPORT jlong JNICALL Java_com_barchart_udt_SocketUDT_sendFile0
(JNIEnv *, jclass, jint, jstring, jlong, jlong, jint);
/*
* Class: com_barchart_udt_SocketUDT
* Method: stopClass0
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_com_barchart_udt_SocketUDT_stopClass0
(JNIEnv *, jclass);
/*
* Class: com_barchart_udt_SocketUDT
* Method: testCrashJVM0
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_com_barchart_udt_SocketUDT_testCrashJVM0
(JNIEnv *, jclass);
/*
* Class: com_barchart_udt_SocketUDT
* Method: testDirectByteBufferAccess0
* Signature: (Ljava/nio/ByteBuffer;)V
*/
JNIEXPORT void JNICALL Java_com_barchart_udt_SocketUDT_testDirectByteBufferAccess0
(JNIEnv *, jclass, jobject);
/*
* Class: com_barchart_udt_SocketUDT
* Method: testDirectIntBufferAccess0
* Signature: (Ljava/nio/IntBuffer;)V
*/
JNIEXPORT void JNICALL Java_com_barchart_udt_SocketUDT_testDirectIntBufferAccess0
(JNIEnv *, jclass, jobject);
/*
* Class: com_barchart_udt_SocketUDT
* Method: testDirectIntBufferLoad0
* Signature: (Ljava/nio/IntBuffer;)V
*/
JNIEXPORT void JNICALL Java_com_barchart_udt_SocketUDT_testDirectIntBufferLoad0
(JNIEnv *, jclass, jobject);
/*
* Class: com_barchart_udt_SocketUDT
* Method: testEmptyCall0
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_com_barchart_udt_SocketUDT_testEmptyCall0
(JNIEnv *, jclass);
/*
* Class: com_barchart_udt_SocketUDT
* Method: testFillArray0
* Signature: ([B)V
*/
JNIEXPORT void JNICALL Java_com_barchart_udt_SocketUDT_testFillArray0
(JNIEnv *, jclass, jbyteArray);
/*
* Class: com_barchart_udt_SocketUDT
* Method: testFillBuffer0
* Signature: (Ljava/nio/ByteBuffer;)V
*/
JNIEXPORT void JNICALL Java_com_barchart_udt_SocketUDT_testFillBuffer0
(JNIEnv *, jclass, jobject);
/*
* Class: com_barchart_udt_SocketUDT
* Method: testGetSetArray0
* Signature: ([IZ)V
*/
JNIEXPORT void JNICALL Java_com_barchart_udt_SocketUDT_testGetSetArray0
(JNIEnv *, jclass, jintArray, jboolean);
/*
* Class: com_barchart_udt_SocketUDT
* Method: testInvalidClose0
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_com_barchart_udt_SocketUDT_testInvalidClose0
(JNIEnv *, jclass, jint);
/*
* Class: com_barchart_udt_SocketUDT
* Method: testIterateArray0
* Signature: ([Ljava/lang/Object;)V
*/
JNIEXPORT void JNICALL Java_com_barchart_udt_SocketUDT_testIterateArray0
(JNIEnv *, jclass, jobjectArray);
/*
* Class: com_barchart_udt_SocketUDT
* Method: testIterateSet0
* Signature: (Ljava/util/Set;)V
*/
JNIEXPORT void JNICALL Java_com_barchart_udt_SocketUDT_testIterateSet0
(JNIEnv *, jclass, jobject);
/*
* Class: com_barchart_udt_SocketUDT
* Method: testMakeArray0
* Signature: (I)[I
*/
JNIEXPORT jintArray JNICALL Java_com_barchart_udt_SocketUDT_testMakeArray0
(JNIEnv *, jclass, jint);
/*
* Class: com_barchart_udt_SocketUDT
* Method: accept0
* Signature: ()Lcom/barchart/udt/SocketUDT;
*/
JNIEXPORT jobject JNICALL Java_com_barchart_udt_SocketUDT_accept0
(JNIEnv *, jobject);
/*
* Class: com_barchart_udt_SocketUDT
* Method: bind0
* Signature: (Ljava/net/InetSocketAddress;)V
*/
JNIEXPORT void JNICALL Java_com_barchart_udt_SocketUDT_bind0
(JNIEnv *, jobject, jobject);
/*
* Class: com_barchart_udt_SocketUDT
* Method: clearError0
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_com_barchart_udt_SocketUDT_clearError0
(JNIEnv *, jobject);
/*
* Class: com_barchart_udt_SocketUDT
* Method: close0
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_com_barchart_udt_SocketUDT_close0
(JNIEnv *, jobject);
/*
* Class: com_barchart_udt_SocketUDT
* Method: connect0
* Signature: (Ljava/net/InetSocketAddress;)V
*/
JNIEXPORT void JNICALL Java_com_barchart_udt_SocketUDT_connect0
(JNIEnv *, jobject, jobject);
/*
* Class: com_barchart_udt_SocketUDT
* Method: getErrorCode0
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_com_barchart_udt_SocketUDT_getErrorCode0
(JNIEnv *, jobject);
/*
* Class: com_barchart_udt_SocketUDT
* Method: getErrorMessage0
* Signature: ()Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_com_barchart_udt_SocketUDT_getErrorMessage0
(JNIEnv *, jobject);
/*
* Class: com_barchart_udt_SocketUDT
* Method: getOption0
* Signature: (ILjava/lang/Class;)Ljava/lang/Object;
*/
JNIEXPORT jobject JNICALL Java_com_barchart_udt_SocketUDT_getOption0
(JNIEnv *, jobject, jint, jclass);
/*
* Class: com_barchart_udt_SocketUDT
* Method: getStatus0
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_com_barchart_udt_SocketUDT_getStatus0
(JNIEnv *, jobject);
/*
* Class: com_barchart_udt_SocketUDT
* Method: hasLoadedLocalSocketAddress
* Signature: ()Z
*/
JNIEXPORT jboolean JNICALL Java_com_barchart_udt_SocketUDT_hasLoadedLocalSocketAddress
(JNIEnv *, jobject);
/*
* Class: com_barchart_udt_SocketUDT
* Method: hasLoadedRemoteSocketAddress
* Signature: ()Z
*/
JNIEXPORT jboolean JNICALL Java_com_barchart_udt_SocketUDT_hasLoadedRemoteSocketAddress
(JNIEnv *, jobject);
/*
* Class: com_barchart_udt_SocketUDT
* Method: initInstance0
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_com_barchart_udt_SocketUDT_initInstance0
(JNIEnv *, jobject, jint);
/*
* Class: com_barchart_udt_SocketUDT
* Method: initInstance1
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_com_barchart_udt_SocketUDT_initInstance1
(JNIEnv *, jobject, jint);
/*
* Class: com_barchart_udt_SocketUDT
* Method: listen0
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_com_barchart_udt_SocketUDT_listen0
(JNIEnv *, jobject, jint);
/*
* Class: com_barchart_udt_SocketUDT
* Method: setOption0
* Signature: (ILjava/lang/Class;Ljava/lang/Object;)V
*/
JNIEXPORT void JNICALL Java_com_barchart_udt_SocketUDT_setOption0
(JNIEnv *, jobject, jint, jclass, jobject);
/*
* Class: com_barchart_udt_SocketUDT
* Method: updateMonitor0
* Signature: (Z)V
*/
JNIEXPORT void JNICALL Java_com_barchart_udt_SocketUDT_updateMonitor0
(JNIEnv *, jobject, jboolean);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,15 +1,33 @@
version 4.13
removed java bits (after performance testing, the JNI wasn't as fast as hoped, likely because of JVM issues)
cleaned up build
added cmake (from Bjorn Stahl, thank you!)
version 4.12
NOTE: Fixed linux timer step from patch in help thread. Also some misc fixes -- see patches.
---------------------------------------------------------
The following notes are from the (no longer maintained) sourceforge repository.
version 4.11
mostly bug fixes since last version.
version 4.10
added UDT_SNDDATA and UDT_RCVDATA options
fixed a bug that causes unnecessary connection timeout
improved epoll UDT event handling
version 4.9
asynchronous close
@ -19,6 +37,8 @@ improved cache code
removed unnecessary NAK (reduced loss retransmission)
receiver side error can unblock a blocked sender
version 4.8
fix a bug that may cause seg fault on concurrent close on the same socket
@ -28,11 +48,15 @@ fix a bug that may cause accept/select to return positively when an accepted soc
fix a bug that may cause connect to fail if the server closes listening socket immediately after accept returns
fix recvfile fstream write status bug (e.g., when disk is full, recvfile should handle properly now)
version 4.7a
fix timeout bug introduced in 4.7
initialize CHandShake
version 4.7
Fix several related bugs that can cause hang/memory leak/segmentation fault during cleanup()