From 8bce350bd71c813531a3d9e6f53876381f72baf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lennart=20J=C3=B6relid?= Date: Sat, 28 May 2022 09:32:51 +0200 Subject: [PATCH 01/10] Removed JNA lib. --- lib/jna.jar | Bin 692070 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 lib/jna.jar diff --git a/lib/jna.jar b/lib/jna.jar deleted file mode 100644 index ed8a45635c6e0609dd647f7d9bf73266130ea832..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 692070 zcmafaW3VpKlI5{&+qP}nwr$(K$F^Ip2T>P$$=^82a}VoWs%%M-j`%iq?h{br!V>rZ~dYetmHO_F4R3ofy_rhy*K3)sW+ z&1k_W1ZzrxH(`Z#f8GV zSVC~iYFVKPY*1=3--sc#-=7x(JJ`nzc;v`V?iQu=>Qk}QSkKO#aS2NqAiIkM($n3M zjU8}dmAs0<1pb9KwYm3KGRq7w`q9FK<_3%CHLpzBaVxnA%ugn0YRiP46siGRnaeFu zoZ`FsU8=4*x0iyzdt^?XHT-Z@mz@kp?cebDPlC7D`NSKal?9YbZ=Xw|`+wS*$z5G% z+nH9j+M=jGd%KsqJxL4^!2bNFr~&@BsQ*R&f7K5FU~F$o|9@ov-w}V6|GyE=u6F-| z`u945`4^Oxo#FojiSTbo2N$RR2O8<$(C(IY%uN4@|7VesdRNNX{>6p<{gM3}UeLxx z*wDtt(#~Ai-pEH`8%mmDM>ougqewfQ2>A#m^s13$N=y^3HWEg3>on%eSZTb2Lu3M{-xrK|Uhq0-{Kf;zUv@@|Wb^2%Yu5mMPfPx4iRo_>Q5)wE(0l?s++lmm8 z!vk|Y?lP&YW~TmkHgI_T!jRO6kqY5AQXkUl+c#;{0eDnwP;62mT1F(~J7jpdC0xUs z{Ro{k6)-PEQZaY1(SX+1ja$!UeE6CcY`GdXgL}iZYTqwWd(*)r$yUuPQ3{@q+bC^{ zWG;R^)^vSIV>YW=p&_Gxls%1Np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fbs#K}dx{2hBce=1hpSq8PGH&u!Peww5^tT$&)10D@0RN9uV19K0;TIi*g1tPA2`^oMYpDPT z^5l_KuCRifc?-iMV7@&9WlMmS2tqT?U_W1jfNKBFE(8|;79%v^Z3J*(_kFDFYk - * */ public class NativeInterface { - private static INativeInterface ACTIVE; + public static final String PROP_NATIVEINTERFACE = "de.intarsys.nativec.api.INativeInterface"; //$NON-NLS-1$ + public static INativeHandle NULL; + private static INativeInterface ACTIVE; + private static String NAME; - private static String NAME; + static protected INativeInterface createNativeInterface() { + String className = getName(); + if (className == null) { + className = System.getProperty(PROP_NATIVEINTERFACE); + } + if (className != null) { + try { + Class clazz = Class.forName(className); + return (INativeInterface) clazz.newInstance(); + } catch (Exception e) { + throw new NoClassDefFoundError(className); + } + } + return findNativeInterface(); + } - public static INativeHandle NULL; + static protected INativeInterface findNativeInterface() { + ServiceLoader loader = ServiceLoader + .load(INativeInterface.class); + Iterator ps = loader.iterator(); + if (ps.hasNext()) { + try { + return ps.next(); + } catch (Throwable e) { + // ignore and try on + } + } + return null; + } - public static final String PROP_NATIVEINTERFACE = "de.intarsys.nativec.api.INativeInterface"; //$NON-NLS-1$ + synchronized static public INativeInterface get() { + if (ACTIVE == null) { + set(createNativeInterface()); + } + return ACTIVE; + } - static protected INativeInterface createNativeInterface() { - String className = getName(); - if (className == null) { - className = System.getProperty(PROP_NATIVEINTERFACE); - } - if (className != null) { - try { - Class clazz = Class.forName(className); - return (INativeInterface) clazz.newInstance(); - } catch (Exception e) { - throw new NoClassDefFoundError(className); - } - } - return findNativeInterface(); - } + synchronized static public String getName() { + return NAME; + } - static protected INativeInterface findNativeInterface() { - ServiceLoader loader = ServiceLoader - .load(INativeInterface.class); - Iterator ps = loader.iterator(); - if (ps.hasNext()) { - try { - return ps.next(); - } catch (Throwable e) { - // ignore and try on - } - } - return null; - } - - synchronized static public INativeInterface get() { - if (ACTIVE == null) { - set(createNativeInterface()); - } - return ACTIVE; - } - - synchronized static public String getName() { - return NAME; - } - - synchronized static public void set(INativeInterface nativeInterface) { - if (nativeInterface == null) { - throw new NullPointerException("no native interface available"); - } - ACTIVE = nativeInterface; - NULL = nativeInterface.createHandle(0); - } - - synchronized static public void setName(String name) { - NAME = name; - } + synchronized static public void setName(String name) { + NAME = name; + } + synchronized static public void set(INativeInterface nativeInterface) { + if (nativeInterface == null) { + throw new NullPointerException("no native interface available"); + } + ACTIVE = nativeInterface; + NULL = nativeInterface.createHandle(0); + } } diff --git a/native-c-api/src/main/java/de/intarsys/nativec/api/NativeTools.java b/native-c-api/src/main/java/de/intarsys/nativec/api/NativeTools.java new file mode 100644 index 0000000..461d498 --- /dev/null +++ b/native-c-api/src/main/java/de/intarsys/nativec/api/NativeTools.java @@ -0,0 +1,203 @@ +/* + * Copyright (c) 2008, intarsys consulting GmbH + * + * 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 intarsys 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 OWNER 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. + */ +package de.intarsys.nativec.api; + +import de.intarsys.nativec.type.INativeType; +import de.intarsys.nativec.type.NativeArray; +import de.intarsys.nativec.type.NativeArrayType; +import de.intarsys.nativec.type.NativeBuffer; +import de.intarsys.nativec.type.NativeBufferType; +import de.intarsys.nativec.type.NativeInt; +import de.intarsys.nativec.type.NativeLong; + +/** + * Tool class for for dealing with the native framework. + */ +public class NativeTools { + + public static byte[] fromNativeByteArray(long ptr, int count) { + + INativeHandle handle; + INativeType type; + NativeBuffer nativeValue; + + if (ptr == 0) { + return null; + } + + handle = NativeInterface.get().createHandle(ptr); + type = NativeBufferType.create(count); + nativeValue = (NativeBuffer) type.createNative(handle); + return nativeValue.getBytes(); + } + + public static long fromNativeCLong(long ptr) { + INativeHandle handle; + NativeLong nativeValue; + + handle = NativeInterface.get().createHandle(ptr); + nativeValue = (NativeLong) NativeLong.META.createNative(handle); + return nativeValue.intValue(); + } + + public static IValueHolder fromNativeCLongHolder(long ptr) { + return new ObjectValueHolder(fromNativeCLong(ptr)); + } + + public static int fromNativeInt(long ptr) { + INativeHandle handle; + NativeInt nativeValue; + + handle = NativeInterface.get().createHandle(ptr); + nativeValue = (NativeInt) NativeInt.META.createNative(handle); + return nativeValue.intValue(); + } + + public static int[] fromNativeIntArray(INativeHandle handle, int count) { + int[] ints; + int offset; + + ints = new int[count]; + offset = NativeInt.META.getByteCount(); + for (int index = 0; index < count; index++) { + ints[index] = handle.getInt(index * offset); + } + return ints; + } + + public static int[] fromNativeIntArray(long ptr, int count) { + INativeHandle handle; + + handle = NativeInterface.get().createHandle(ptr); + return fromNativeIntArray(handle, count); + } + + public static IValueHolder fromNativeIntHolder(long ptr) { + return new ObjectValueHolder(fromNativeInt(ptr)); + } + + public static String fromNativeString(long ptr, int count) { + return null; + } + + public static INativeHandle toHandle(long address) { + return NativeInterface.get().createHandle(address); + } + + public static void toNativeByteArray(long ptr, byte[] value) { + if (value != null) { + INativeHandle handle; + INativeType type; + NativeBuffer buffer; + + handle = NativeInterface.get().createHandle(ptr); + type = NativeBufferType.create(value.length); + buffer = (NativeBuffer) type.createNative(handle); + buffer.setValue(value); + } + } + + public static void toNativeCLong(long ptr, int[] value) { + if (value != null) { + INativeHandle handle; + NativeArrayType type; + NativeArray array; + + handle = NativeInterface.get().createHandle(ptr); + type = NativeArrayType.create(NativeLong.META, value.length); + array = (NativeArray) type.createNative(handle); + for (int index = 0; index < value.length; index++) { + array.setValue(index, value[index]); + } + } + } + + public static void toNativeCLong(long ptr, IValueHolder value) { + toNativeCLong(ptr, value.get().longValue()); + } + + public static void toNativeCLong(long ptr, long value) { + INativeHandle handle; + NativeLong nativeValue; + + handle = NativeInterface.get().createHandle(ptr); + nativeValue = (NativeLong) NativeLong.META.createNative(handle); + nativeValue.setValue(value); + } + + public static void toNativeCLong(long ptr, long[] value) { + if (value != null) { + INativeHandle handle; + NativeArrayType type; + NativeArray array; + + handle = NativeInterface.get().createHandle(ptr); + type = NativeArrayType.create(NativeLong.META, value.length); + array = (NativeArray) type.createNative(handle); + for (int index = 0; index < value.length; index++) { + array.setValue(index, value[index]); + } + } + } + + public static void toNativeInt(long ptr, int value) { + INativeHandle handle; + + handle = NativeInterface.get().createHandle(ptr); + handle.setSize(NativeInt.META.getByteCount()); + handle.setInt(0, value); + } + + public static void toNativeInt(long ptr, int[] value) { + if (value != null) { + INativeHandle handle; + NativeArrayType type; + NativeArray array; + + handle = NativeInterface.get().createHandle(ptr); + type = NativeArrayType.create(NativeInt.META, value.length); + array = (NativeArray) type.createNative(handle); + for (int index = 0; index < value.length; index++) { + array.setValue(index, value[index]); + } + } + } + + public static void toNativeInt(long ptr, IValueHolder value) { + toNativeInt(ptr, value.get()); + } + + public static void toNativePointer(long ptr, INativeHandle value) { + INativeHandle handle; + + handle = NativeInterface.get().createHandle(ptr); + handle.setNativeHandle(0, value); + } +} diff --git a/src/de/intarsys/nativec/api/ObjectValueHolder.java b/native-c-api/src/main/java/de/intarsys/nativec/api/ObjectValueHolder.java similarity index 86% rename from src/de/intarsys/nativec/api/ObjectValueHolder.java rename to native-c-api/src/main/java/de/intarsys/nativec/api/ObjectValueHolder.java index 085b9a7..ed257f3 100644 --- a/src/de/intarsys/nativec/api/ObjectValueHolder.java +++ b/native-c-api/src/main/java/de/intarsys/nativec/api/ObjectValueHolder.java @@ -31,28 +31,27 @@ /** * A object holding nothing but a value - * + *

* This can easily be plugged in for a {@link IValueHolder}. */ public class ObjectValueHolder implements IValueHolder { - private T value; + private T value; - public ObjectValueHolder(T value) { - super(); - this.value = value; - } + public ObjectValueHolder(T value) { + super(); + this.value = value; + } - @Override - public T get() { - return value; - } - - @Override - public T set(T newValue) { - T oldValue = value; - value = newValue; - return oldValue; - } + @Override + public T get() { + return value; + } + @Override + public T set(T newValue) { + T oldValue = value; + value = newValue; + return oldValue; + } } diff --git a/native-c-api/src/main/java/de/intarsys/nativec/api/package.html b/native-c-api/src/main/java/de/intarsys/nativec/api/package.html new file mode 100644 index 0000000..65cbbea --- /dev/null +++ b/native-c-api/src/main/java/de/intarsys/nativec/api/package.html @@ -0,0 +1,36 @@ + + +This is the main package of the native c component. +

+ Here we define the API's and the VM singleton access to native c. +

+ The component itself was built, as we didn't (once again) find anything + around that satisfied our needs. We wanted: +

    +
  • Clean, layered design
  • +
  • Unrestricted access to all modeled objects and concepts.
  • +
  • Easy adaption and integration with other views. This means primarily unrestricted + access to pointers. There is no use in a native library if i can't bootstrap + with a simple address (in our point of view). +
  • +
  • Clean design for c data structures (primitive, composites and references)
  • +
  • Exchangeable native implementation
  • +
  • Platform independence
  • +
+ +So we created an API and a data structure component and mapped it to JNA, which has +great ideas (but in our opinion is to sealed off and has not well done on the +data structure side) and can serve as a good foundation. + +There are some topics we didn't care about yet - this means they may be working or may +not, its simply not tested. JNA brings a lot of basic features... + +
    +
  • Pointer size was not really an issue
  • +
  • We didn't care about byte order
  • +
+ +64 bit implementation is under way. + + + \ No newline at end of file diff --git a/src/de/intarsys/nativec/type/INativeObject.java b/native-c-api/src/main/java/de/intarsys/nativec/type/INativeObject.java similarity index 69% rename from src/de/intarsys/nativec/type/INativeObject.java rename to native-c-api/src/main/java/de/intarsys/nativec/type/INativeObject.java index 5378686..b94279a 100644 --- a/src/de/intarsys/nativec/type/INativeObject.java +++ b/native-c-api/src/main/java/de/intarsys/nativec/type/INativeObject.java @@ -37,43 +37,41 @@ * The {@link INativeObject} has a reference to c memory (the * {@link INativeHandle} and "marshalling" methods "getValue" and "setValue" to * get and set the Java representation. - * */ public interface INativeObject { - /** - * The bytes that make up the {@link INativeObject}. - * - * @return The bytes that make up the {@link INativeObject}. - */ - public byte[] getBytes(); + /** + * The bytes that make up the {@link INativeObject}. + * + * @return The bytes that make up the {@link INativeObject}. + */ + public byte[] getBytes(); - /** - * The {@link INativeHandle} to the c memory for the object. - * - * @return The {@link INativeHandle} to the c memory for the object. - */ - public INativeHandle getNativeHandle(); + /** + * The {@link INativeHandle} to the c memory for the object. + * + * @return The {@link INativeHandle} to the c memory for the object. + */ + public INativeHandle getNativeHandle(); - /** - * The {@link INativeType} for the object. - * - * @return The {@link INativeType} for the object. - */ - public INativeType getNativeType(); + /** + * The {@link INativeType} for the object. + * + * @return The {@link INativeType} for the object. + */ + public INativeType getNativeType(); - /** - * A Java side representation from the memory. - * - * @return A Java side representation for the {@link INativeObject}. - */ - public Object getValue(); + /** + * A Java side representation from the memory. + * + * @return A Java side representation for the {@link INativeObject}. + */ + public Object getValue(); - /** - * Assign (and marshall to memory) the Java side representation. - * - * @param value - * The new Java value. - */ - public void setValue(Object value); + /** + * Assign (and marshall to memory) the Java side representation. + * + * @param value The new Java value. + */ + public void setValue(Object value); } diff --git a/src/de/intarsys/nativec/type/INativeType.java b/native-c-api/src/main/java/de/intarsys/nativec/type/INativeType.java similarity index 62% rename from src/de/intarsys/nativec/type/INativeType.java rename to native-c-api/src/main/java/de/intarsys/nativec/type/INativeType.java index 224be22..9526f48 100644 --- a/src/de/intarsys/nativec/type/INativeType.java +++ b/native-c-api/src/main/java/de/intarsys/nativec/type/INativeType.java @@ -35,58 +35,55 @@ * The type (factory) for {@link INativeObject} instances. *

* A type has declaration style method to create more complex types. - * */ public interface INativeType { - /** - * Create an array type from this. - * - * @param size - * The predefined size for the array. - * - * @return The derived type. - */ - public INativeType Array(int size); + /** + * Create an array type from this. + * + * @param size The predefined size for the array. + * + * @return The derived type. + */ + public INativeType Array(int size); - /** - * Create an {@link INativeObject} for this type from the Java object. - * - * @param value - * - * @return The new {@link INativeObject} - */ - public INativeObject createNative(Object value); + /** + * Create an {@link INativeObject} for this type from the Java object. + * + * @param value + * + * @return The new {@link INativeObject} + */ + public INativeObject createNative(Object value); - /** - * Create a new {@link INativeObject} from a {@link INativeHandle}. - * - * @param handle - * The handle to memory. - * @return The new {@link INativeObject} - */ - public INativeObject createNative(INativeHandle handle); + /** + * Create a new {@link INativeObject} from a {@link INativeHandle}. + * + * @param handle The handle to memory. + * + * @return The new {@link INativeObject} + */ + public INativeObject createNative(INativeHandle handle); - /** - * The boundary where this type as a struct member would want to be aligned. - * A structure can override this value with packing. - * - * @return The preferred alignment boundary. - */ - public int getPreferredBoundary(); + /** + * The boundary where this type as a struct member would want to be aligned. + * A structure can override this value with packing. + * + * @return The preferred alignment boundary. + */ + public int getPreferredBoundary(); - /** - * The size of the type in c memory. - * - * @return The size of the type in c memory. - */ - public int getByteCount(); - - /** - * Create a reference type to this. - * - * @return The derived type. - */ - public INativeType Ref(); + /** + * The size of the type in c memory. + * + * @return The size of the type in c memory. + */ + public int getByteCount(); + /** + * Create a reference type to this. + * + * @return The derived type. + */ + public INativeType Ref(); } diff --git a/src/de/intarsys/nativec/type/NativeAbstractStringType.java b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeAbstractStringType.java similarity index 70% rename from src/de/intarsys/nativec/type/NativeAbstractStringType.java rename to native-c-api/src/main/java/de/intarsys/nativec/type/NativeAbstractStringType.java index 887ef1d..76b9c3d 100644 --- a/src/de/intarsys/nativec/type/NativeAbstractStringType.java +++ b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeAbstractStringType.java @@ -36,39 +36,38 @@ */ public class NativeAbstractStringType extends NativeType { - private final int characterSize; - private final int stringSize; + private final int characterSize; + private final int stringSize; - protected NativeAbstractStringType(int pCharacterSize) { - super(); - characterSize = pCharacterSize; - stringSize = 0; - } + protected NativeAbstractStringType(int pCharacterSize) { + super(); + characterSize = pCharacterSize; + stringSize = 0; + } - protected NativeAbstractStringType(int pStringSize, int pCharacterSize) { - super(); - characterSize = pCharacterSize; - stringSize = pStringSize; - } + protected NativeAbstractStringType(int pStringSize, int pCharacterSize) { + super(); + characterSize = pCharacterSize; + stringSize = pStringSize; + } - @Override - public int getByteCount() { - if (stringSize == 0) { - throw new IllegalStateException(); - } - return stringSize * characterSize; - } + @Override + public int getByteCount() { + if (stringSize == 0) { + throw new IllegalStateException(); + } + return stringSize * characterSize; + } - public int getPreferredBoundary() { - return NativeInterface.get().pointerSize(); - } + public int getPreferredBoundary() { + return NativeInterface.get().pointerSize(); + } - public int getStringSize() { - return stringSize; - } - - public boolean hasByteCount() { - return stringSize != 0; - } + public int getStringSize() { + return stringSize; + } + public boolean hasByteCount() { + return stringSize != 0; + } } \ No newline at end of file diff --git a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeArray.java b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeArray.java new file mode 100644 index 0000000..84978c2 --- /dev/null +++ b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeArray.java @@ -0,0 +1,177 @@ +/* + * Copyright (c) 2008, intarsys consulting GmbH + * + * 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 intarsys 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 OWNER 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. + */ +package de.intarsys.nativec.type; + +import de.intarsys.nativec.api.INativeHandle; + +/** + * An {@link INativeObject} that represents a homogeneous (this means of equal + * length and type) sequence of other {@link INativeObject} instances. + */ +public class NativeArray extends NativeObject { + + /** + * The meta class instance + */ + public static final NativeArrayType META = new NativeArrayType( + NativeVoid.META, 0); + + static { + NativeType.register(NativeArray.class, META); + } + + private INativeObject[] values; + private NativeArrayType type; + + protected NativeArray(NativeArrayType type) { + this.type = type; + allocate(); + } + + protected NativeArray(NativeArrayType type, INativeHandle handle) { + super(handle); + this.type = type; + } + + public static NativeArray create(INativeType baseType, int size) { + NativeArrayType type = new NativeArrayType(baseType, size); + return new NativeArray(type); + } + + public INativeType getBaseType() { + return type.getBaseType(); + } + + public void setBaseType(INativeType baseType) { + type = NativeArrayType.create(baseType, type.getArraySize()); + this.values = null; + handle.setSize(getByteCount()); + } + + @Override + public int getByteCount() { + return type.getByteCount(); + } + + /** + * The {@link INativeObject} at index in the sequence (the index'th element + * of the array). + * + * @param index The index of the element to be reported. + * + * @return The NativeObject at index + */ + synchronized public INativeObject getNativeObject(int index) { + if (values == null) { + values = new INativeObject[getSize()]; + } + INativeObject result = values[index]; + if (result == null) { + int elementOffset = index * type.getBaseSize(); + result = type.getBaseType().createNative( + handle.offset(elementOffset)); + values[index] = result; + } + return result; + } + + /* + * (non-Javadoc) + * + * @see de.intarsys.graphic.freetype.NativeObject#getMetaClass() + */ + @Override + public INativeType getNativeType() { + return type; + } + + /** + * The number of NativeObject instances in the sequence represented by this + * (in other terms the array size). + * + * @return The number of NativeObject instances in the sequence represented + * by this + */ + public int getSize() { + return type.getArraySize(); + } + + public void setSize(int size) { + type = NativeArrayType.create(type.getBaseType(), size); + this.values = null; + handle.setSize(getByteCount()); + } + + public Object getValue() { + throw new UnsupportedOperationException( + "getValue not implemented for NativeArray"); + } + + public void setValue(Object value) { + throw new UnsupportedOperationException( + "setValue not implemented for NativeArray"); + } + + public Object getValue(int index) { + return getNativeObject(index).getValue(); + } + + public void setValue(int index, Object value) { + getNativeObject(index).setValue(value); + } + + /* + * (non-Javadoc) + * + * @see de.intarsys.graphic.freetype.NativeObject#toNestedString() + */ + @Override + public String toNestedString() { + return "[...]"; + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("["); + for (int i = 0; i < getSize(); i++) { + // NativeObject element = get(i); + // sb.append(element.toString()); + // sb.append(", "); + } + sb.append("]"); + return sb.toString(); + } +} diff --git a/src/de/intarsys/nativec/type/NativeArrayType.java b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeArrayType.java similarity index 57% rename from src/de/intarsys/nativec/type/NativeArrayType.java rename to native-c-api/src/main/java/de/intarsys/nativec/type/NativeArrayType.java index 361f132..63af297 100644 --- a/src/de/intarsys/nativec/type/NativeArrayType.java +++ b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeArrayType.java @@ -36,64 +36,61 @@ */ public class NativeArrayType extends NativeType { - public static NativeArrayType create(INativeType baseType, int size) { - return new NativeArrayType(baseType, size); - } + private final int arraySize; + /** + * The size of the base type of the array. + */ + private final int baseSize; + /** + * The base type of the array. + */ + private final INativeType baseType; - private final int arraySize; + protected NativeArrayType(INativeType baseDeclaration, int arraySize) { + super(); + this.baseType = baseDeclaration; + this.baseSize = baseDeclaration.getByteCount(); + this.arraySize = arraySize; + } - /** - * The size of the base type of the array. - */ - private final int baseSize; + public static NativeArrayType create(INativeType baseType, int size) { + return new NativeArrayType(baseType, size); + } - /** - * The base type of the array. - */ - private final INativeType baseType; + @Override + public INativeObject createNative(INativeHandle handle) { + NativeArray array = new NativeArray(this, handle); + if (arraySize > 0) { + array.setSize(arraySize); + } + return array; + } - protected NativeArrayType(INativeType baseDeclaration, int arraySize) { - super(); - this.baseType = baseDeclaration; - this.baseSize = baseDeclaration.getByteCount(); - this.arraySize = arraySize; - } + @Override + public INativeObject createNative(Object value) { + NativeArray array = new NativeArray(this); + return array; + } - @Override - public INativeObject createNative(INativeHandle handle) { - NativeArray array = new NativeArray(this, handle); - if (arraySize > 0) { - array.setSize(arraySize); - } - return array; - } + public int getArraySize() { + return arraySize; + } - @Override - public INativeObject createNative(Object value) { - NativeArray array = new NativeArray(this); - return array; - } + public int getBaseSize() { + return baseSize; + } - public int getArraySize() { - return arraySize; - } + public INativeType getBaseType() { + return baseType; + } - public int getBaseSize() { - return baseSize; - } - - public INativeType getBaseType() { - return baseType; - } - - @Override - public int getByteCount() { - // todo take into account alignment / packing? - return arraySize * baseSize; - } - - public int getPreferredBoundary() { - return baseType.getPreferredBoundary(); - } + @Override + public int getByteCount() { + // todo take into account alignment / packing? + return arraySize * baseSize; + } + public int getPreferredBoundary() { + return baseType.getPreferredBoundary(); + } } diff --git a/src/de/intarsys/nativec/type/NativeBuffer.java b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeBuffer.java similarity index 52% rename from src/de/intarsys/nativec/type/NativeBuffer.java rename to native-c-api/src/main/java/de/intarsys/nativec/type/NativeBuffer.java index 349d5f0..ac1a9e8 100644 --- a/src/de/intarsys/nativec/type/NativeBuffer.java +++ b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeBuffer.java @@ -36,81 +36,82 @@ /** * A wrapper for a sequence of bytes. - * */ public class NativeBuffer extends NativeObject { - /** The meta class instance */ - public static final NativeBufferType META = new NativeBufferType(); + /** + * The meta class instance + */ + public static final NativeBufferType META = new NativeBufferType(); - static { - NativeType.register(NativeBuffer.class, META); - } + static { + NativeType.register(NativeBuffer.class, META); + } - private NativeBufferType type; + private NativeBufferType type; - public NativeBuffer(byte[] bytes) { - type = new NativeBufferType(bytes.length); - handle = NativeInterface.get().allocate(bytes.length); - handle.setByteArray(0, bytes, 0, bytes.length); - } + public NativeBuffer(byte[] bytes) { + type = new NativeBufferType(bytes.length); + handle = NativeInterface.get().allocate(bytes.length); + handle.setByteArray(0, bytes, 0, bytes.length); + } - protected NativeBuffer(INativeHandle handle) { - super(handle); - } + protected NativeBuffer(INativeHandle handle) { + super(handle); + } - public NativeBuffer(int pSize) { - type = new NativeBufferType(pSize); - handle = NativeInterface.get().allocate(pSize); - } + public NativeBuffer(int pSize) { + type = new NativeBufferType(pSize); + handle = NativeInterface.get().allocate(pSize); + } - /* - * (non-Javadoc) - * - * @see de.intarsys.tools.nativec.NativeObject#getByteCount() - */ - @Override - public int getByteCount() { - // todo alignment? - return type.getByteCount(); - } + /* + * (non-Javadoc) + * + * @see de.intarsys.tools.nativec.NativeObject#getByteCount() + */ + @Override + public int getByteCount() { + // todo alignment? + return type.getByteCount(); + } - /* - * (non-Javadoc) - * - * @see de.intarsys.graphic.freetype.NativeObject#getMetaClass() - */ - @Override - public INativeType getNativeType() { - return META; - } + /* + * (non-Javadoc) + * + * @see de.intarsys.graphic.freetype.NativeObject#getMetaClass() + */ + @Override + public INativeType getNativeType() { + return META; + } - /** - * The number of elements in the NativeBuffer - * - * @return The number of elements in the NativeBuffer - */ - public int getSize() { - return type.getByteCount(); - } + /** + * The number of elements in the NativeBuffer + * + * @return The number of elements in the NativeBuffer + */ + public int getSize() { + return type.getByteCount(); + } - public Object getValue() { - return getBytes(); - } + public void setSize(int size) { + type = new NativeBufferType(size); + handle.setSize(getByteCount()); + } - public void setSize(int size) { - type = new NativeBufferType(size); - handle.setSize(getByteCount()); - } + public Object getValue() { + return getBytes(); + } - public void setValue(Object value) { - if (value instanceof byte[]) { - byte[] data = (byte[]) value; - setByteArray(0, data, 0, data.length); - } else if (value instanceof ByteBuffer) { - byte[] data = new byte[getSize()]; - ((ByteBuffer) value).get(data); - setByteArray(0, data, 0, data.length); - } - } + public void setValue(Object value) { + if (value instanceof byte[]) { + byte[] data = (byte[]) value; + setByteArray(0, data, 0, data.length); + } else if (value instanceof ByteBuffer) { + byte[] data = new byte[getSize()]; + ((ByteBuffer) value).get(data); + setByteArray(0, data, 0, data.length); + } + } } diff --git a/src/de/intarsys/nativec/type/NativeBufferType.java b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeBufferType.java similarity index 69% rename from src/de/intarsys/nativec/type/NativeBufferType.java rename to native-c-api/src/main/java/de/intarsys/nativec/type/NativeBufferType.java index 0c8e1ae..faa2ac8 100644 --- a/src/de/intarsys/nativec/type/NativeBufferType.java +++ b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeBufferType.java @@ -36,44 +36,43 @@ */ public class NativeBufferType extends NativeType { - public static NativeBufferType create(int size) { - return new NativeBufferType(size); - } + final private int bufferSize; - final private int bufferSize; + protected NativeBufferType() { + super(); + this.bufferSize = 0; + } - protected NativeBufferType() { - super(); - this.bufferSize = 0; - } + protected NativeBufferType(int bufferSize) { + super(); + this.bufferSize = bufferSize; + } - protected NativeBufferType(int bufferSize) { - super(); - this.bufferSize = bufferSize; - } + public static NativeBufferType create(int size) { + return new NativeBufferType(size); + } - @Override - public INativeObject createNative(INativeHandle handle) { - NativeBuffer buffer; + @Override + public INativeObject createNative(INativeHandle handle) { + NativeBuffer buffer; - buffer = new NativeBuffer(handle); - // setSize() creates a new type object - // TODO create constructor to use the existing one? - buffer.setSize(bufferSize); - return buffer; - } + buffer = new NativeBuffer(handle); + // setSize() creates a new type object + // TODO create constructor to use the existing one? + buffer.setSize(bufferSize); + return buffer; + } - public int getBufferSize() { - return bufferSize; - } + public int getBufferSize() { + return bufferSize; + } - @Override - public int getByteCount() { - return bufferSize; - } - - public int getPreferredBoundary() { - return 1; - } + @Override + public int getByteCount() { + return bufferSize; + } + public int getPreferredBoundary() { + return 1; + } } \ No newline at end of file diff --git a/src/de/intarsys/nativec/type/NativeByte.java b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeByte.java similarity index 54% rename from src/de/intarsys/nativec/type/NativeByte.java rename to native-c-api/src/main/java/de/intarsys/nativec/type/NativeByte.java index e92bb98..1cf981d 100644 --- a/src/de/intarsys/nativec/type/NativeByte.java +++ b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeByte.java @@ -34,88 +34,89 @@ /** * A wrapper for a primitive byte. - * */ public class NativeByte extends NativeNumber { - /** The meta class instance */ - public static final NativeByteType META = new NativeByteType(); - - static { - NativeType.register(NativeByte.class, META); - } - - static public NativeByte createFromAddress(long address) { - return (NativeByte) NativeByte.META.createNative(NativeTools - .toHandle(address)); - } - - /** - * Create a new wrapper - */ - public NativeByte() { - allocate(); - } - - /** - * Create a new wrapper - */ - public NativeByte(byte value) { - allocate(); - setValue(value); - } - - protected NativeByte(INativeHandle handle) { - super(handle); - } - - @Override - public byte byteValue() { - return handle.getByte(0); - } - - @Override - public INativeType getNativeType() { - return META; - } - - @Override - public Object getValue() { - return new Byte(byteValue()); - } - - @Override - public int intValue() { - return byteValue(); - } - - @Override - public long longValue() { - return byteValue(); - } - - public void setValue(byte value) { - handle.setByte(0, value); - } - - @Override - public void setValue(Object value) { - setValue(((Number) value).byteValue()); - } - - @Override - public short shortValue() { - return byteValue(); - } - - @Override - public String toString() { - if (getNativeHandle() == null) { - return "nope - no handle"; //$NON-NLS-1$ - } - if (getNativeHandle().getAddress() == 0) { - return "nope - null pointer"; //$NON-NLS-1$ - } - return String.valueOf(byteValue()); - } + /** + * The meta class instance + */ + public static final NativeByteType META = new NativeByteType(); + + static { + NativeType.register(NativeByte.class, META); + } + + /** + * Create a new wrapper + */ + public NativeByte() { + allocate(); + } + + /** + * Create a new wrapper + */ + public NativeByte(byte value) { + allocate(); + setValue(value); + } + + protected NativeByte(INativeHandle handle) { + super(handle); + } + + static public NativeByte createFromAddress(long address) { + return (NativeByte) NativeByte.META.createNative(NativeTools + .toHandle(address)); + } + + @Override + public byte byteValue() { + return handle.getByte(0); + } + + @Override + public INativeType getNativeType() { + return META; + } + + @Override + public Object getValue() { + return new Byte(byteValue()); + } + + public void setValue(byte value) { + handle.setByte(0, value); + } + + @Override + public void setValue(Object value) { + setValue(((Number) value).byteValue()); + } + + @Override + public int intValue() { + return byteValue(); + } + + @Override + public long longValue() { + return byteValue(); + } + + @Override + public short shortValue() { + return byteValue(); + } + + @Override + public String toString() { + if (getNativeHandle() == null) { + return "nope - no handle"; //$NON-NLS-1$ + } + if (getNativeHandle().getAddress() == 0) { + return "nope - null pointer"; //$NON-NLS-1$ + } + return String.valueOf(byteValue()); + } } diff --git a/src/de/intarsys/nativec/type/NativeByteType.java b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeByteType.java similarity index 82% rename from src/de/intarsys/nativec/type/NativeByteType.java rename to native-c-api/src/main/java/de/intarsys/nativec/type/NativeByteType.java index e446a6b..0bddf60 100644 --- a/src/de/intarsys/nativec/type/NativeByteType.java +++ b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeByteType.java @@ -36,22 +36,22 @@ */ public class NativeByteType extends NativeNumberType { - protected NativeByteType() { - super(); - } + protected NativeByteType() { + super(); + } - @Override - public INativeObject createNative(INativeHandle handle) { - return new NativeByte(handle); - } + @Override + public INativeObject createNative(INativeHandle handle) { + return new NativeByte(handle); + } - @Override - public INativeObject createNative(Object value) { - return new NativeByte(((Number) value).byteValue()); - } + @Override + public INativeObject createNative(Object value) { + return new NativeByte(((Number) value).byteValue()); + } - @Override - public int getByteCount() { - return NativeByte.SIZE_BYTE; - } + @Override + public int getByteCount() { + return NativeByte.SIZE_BYTE; + } } \ No newline at end of file diff --git a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeFunction.java b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeFunction.java new file mode 100644 index 0000000..aad2332 --- /dev/null +++ b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeFunction.java @@ -0,0 +1,44 @@ +package de.intarsys.nativec.type; + +import de.intarsys.nativec.api.INativeFunction; +import de.intarsys.nativec.api.INativeHandle; +import de.intarsys.nativec.api.NativeInterface; + +public class NativeFunction extends NativeVoid { + + public static final NativeFunctionType META = new NativeFunctionType(); + private Object callingConvention; + private INativeFunction function; + protected NativeFunction(INativeHandle handle) { + super(handle); + callingConvention = INativeFunction.CallingConventionCdecl; + } + + public Object getCallingConvention() { + return callingConvention; + } + + public void setCallingConvention(Object callingConvention) { + if (function != null) { + throw new IllegalStateException(); + } + this.callingConvention = callingConvention; + } + + public INativeFunction getFunction() { + // TODO do we want to check if handle has changed? + if (function == null) { + function = NativeInterface.get().createFunction( + getNativeHandle().getAddress(), callingConvention); + } + return function; + } + + public static class NativeFunctionType extends NativeVoidType { + + @Override + public INativeObject createNative(INativeHandle handle) { + return new NativeFunction(handle); + } + } +} diff --git a/src/de/intarsys/nativec/type/NativeGenericStruct.java b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeGenericStruct.java similarity index 77% rename from src/de/intarsys/nativec/type/NativeGenericStruct.java rename to native-c-api/src/main/java/de/intarsys/nativec/type/NativeGenericStruct.java index e894a52..bc75caf 100644 --- a/src/de/intarsys/nativec/type/NativeGenericStruct.java +++ b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeGenericStruct.java @@ -33,36 +33,34 @@ /** * The generic struct may change its type at runtime. - * */ public class NativeGenericStruct extends NativeStruct { - private NativeStructType type; + private NativeStructType type; - protected NativeGenericStruct(NativeStructType type) { - super(); - this.type = type; - allocate(); - } + protected NativeGenericStruct(NativeStructType type) { + super(); + this.type = type; + allocate(); + } - protected NativeGenericStruct(NativeStructType type, INativeHandle handle) { - super(handle); - this.type = type; - } + protected NativeGenericStruct(NativeStructType type, INativeHandle handle) { + super(handle); + this.type = type; + } - @Override - public INativeType getNativeType() { - return type; - } + @Override + public INativeType getNativeType() { + return type; + } - @Override - public NativeStructType getStructType() { - return type; - } - - public void setNativeType(NativeStructType type) { - this.type = type; - this.values = null; - } + public void setNativeType(NativeStructType type) { + this.type = type; + this.values = null; + } + @Override + public NativeStructType getStructType() { + return type; + } } diff --git a/src/de/intarsys/nativec/type/NativeInt.java b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeInt.java similarity index 55% rename from src/de/intarsys/nativec/type/NativeInt.java rename to native-c-api/src/main/java/de/intarsys/nativec/type/NativeInt.java index e87ec2a..2610025 100644 --- a/src/de/intarsys/nativec/type/NativeInt.java +++ b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeInt.java @@ -38,84 +38,86 @@ */ public class NativeInt extends NativeNumber { - /** The meta class instance */ - public static final NativeIntType META = new NativeIntType(); - - static { - NativeType.register(NativeInt.class, META); - } - - static public NativeInt createFromAddress(long address) { - return (NativeInt) NativeInt.META.createNative(NativeTools - .toHandle(address)); - } - - /** - * Create a new wrapper - */ - public NativeInt() { - allocate(); - } - - protected NativeInt(INativeHandle handle) { - super(handle); - } - - /** - * Create a new wrapper - */ - public NativeInt(long value) { - allocate(); - setValue(value); - } - - @Override - public byte byteValue() { - return (byte) intValue(); - } - - @Override - public INativeType getNativeType() { - return META; - } - - @Override - public Object getValue() { - return new Integer(intValue()); - } - - @Override - public int intValue() { - return handle.getInt(0); - } - - @Override - public long longValue() { - return intValue(); - } - - public void setValue(int value) { - handle.setInt(0, value); - } - - @Override - public void setValue(Object value) { - setValue(((Number) value).intValue()); - } - - @Override - public short shortValue() { - return (short) intValue(); - } - - @Override - public String toString() { - if (getNativeHandle() == null) { - return "nope - no handle"; //$NON-NLS-1$ - } - if (getNativeHandle().getAddress() == 0) { - return "nope - null pointer"; //$NON-NLS-1$ - } - return String.valueOf(intValue()); - } + /** + * The meta class instance + */ + public static final NativeIntType META = new NativeIntType(); + + static { + NativeType.register(NativeInt.class, META); + } + + /** + * Create a new wrapper + */ + public NativeInt() { + allocate(); + } + + protected NativeInt(INativeHandle handle) { + super(handle); + } + + /** + * Create a new wrapper + */ + public NativeInt(long value) { + allocate(); + setValue(value); + } + + static public NativeInt createFromAddress(long address) { + return (NativeInt) NativeInt.META.createNative(NativeTools + .toHandle(address)); + } + + @Override + public byte byteValue() { + return (byte) intValue(); + } + + @Override + public INativeType getNativeType() { + return META; + } + + @Override + public Object getValue() { + return new Integer(intValue()); + } + + public void setValue(int value) { + handle.setInt(0, value); + } + + @Override + public void setValue(Object value) { + setValue(((Number) value).intValue()); + } + + @Override + public int intValue() { + return handle.getInt(0); + } + + @Override + public long longValue() { + return intValue(); + } + + @Override + public short shortValue() { + return (short) intValue(); + } + + @Override + public String toString() { + if (getNativeHandle() == null) { + return "nope - no handle"; //$NON-NLS-1$ + } + if (getNativeHandle().getAddress() == 0) { + return "nope - null pointer"; //$NON-NLS-1$ + } + return String.valueOf(intValue()); + } } diff --git a/src/de/intarsys/nativec/type/NativeIntType.java b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeIntType.java similarity index 82% rename from src/de/intarsys/nativec/type/NativeIntType.java rename to native-c-api/src/main/java/de/intarsys/nativec/type/NativeIntType.java index 45b55cf..d638a63 100644 --- a/src/de/intarsys/nativec/type/NativeIntType.java +++ b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeIntType.java @@ -36,22 +36,22 @@ */ public class NativeIntType extends NativeNumberType { - protected NativeIntType() { - super(); - } + protected NativeIntType() { + super(); + } - @Override - public INativeObject createNative(INativeHandle handle) { - return new NativeInt(handle); - } + @Override + public INativeObject createNative(INativeHandle handle) { + return new NativeInt(handle); + } - @Override - public INativeObject createNative(Object value) { - return new NativeInt(((Number) value).longValue()); - } + @Override + public INativeObject createNative(Object value) { + return new NativeInt(((Number) value).longValue()); + } - @Override - public int getByteCount() { - return NativeInt.SIZE_INT; - } + @Override + public int getByteCount() { + return NativeInt.SIZE_INT; + } } \ No newline at end of file diff --git a/src/de/intarsys/nativec/type/NativeLong.java b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeLong.java similarity index 55% rename from src/de/intarsys/nativec/type/NativeLong.java rename to native-c-api/src/main/java/de/intarsys/nativec/type/NativeLong.java index 319cdc3..c1d6620 100644 --- a/src/de/intarsys/nativec/type/NativeLong.java +++ b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeLong.java @@ -38,84 +38,86 @@ */ public class NativeLong extends NativeNumber { - /** The meta class instance */ - public static final NativeLongType META = new NativeLongType(); - - static { - NativeType.register(NativeLong.class, META); - } - - static public NativeLong createFromAddress(long address) { - return (NativeLong) NativeLong.META.createNative(NativeTools - .toHandle(address)); - } - - /** - * Create a new wrapper - */ - public NativeLong() { - allocate(); - } - - protected NativeLong(INativeHandle handle) { - super(handle); - } - - /** - * Create a new wrapper - */ - public NativeLong(long value) { - allocate(); - setValue(value); - } - - @Override - public byte byteValue() { - return (byte) intValue(); - } - - @Override - public INativeType getNativeType() { - return META; - } - - @Override - public Object getValue() { - return new Long(longValue()); - } - - @Override - public int intValue() { - return (int) longValue(); - } - - @Override - public long longValue() { - return handle.getCLong(0); - } - - public void setValue(long value) { - handle.setCLong(0, value); - } - - @Override - public void setValue(Object value) { - setValue(((Number) value).longValue()); - } - - @Override - public short shortValue() { - return (short) longValue(); - } - - @Override - public String toString() { - if (getNativeHandle() == null) { - return "nope - no handle"; //$NON-NLS-1$ - } - if (getNativeHandle().getAddress() == 0) { - return "nope - null pointer"; //$NON-NLS-1$ - } - return String.valueOf(longValue()); - } + /** + * The meta class instance + */ + public static final NativeLongType META = new NativeLongType(); + + static { + NativeType.register(NativeLong.class, META); + } + + /** + * Create a new wrapper + */ + public NativeLong() { + allocate(); + } + + protected NativeLong(INativeHandle handle) { + super(handle); + } + + /** + * Create a new wrapper + */ + public NativeLong(long value) { + allocate(); + setValue(value); + } + + static public NativeLong createFromAddress(long address) { + return (NativeLong) NativeLong.META.createNative(NativeTools + .toHandle(address)); + } + + @Override + public byte byteValue() { + return (byte) intValue(); + } + + @Override + public INativeType getNativeType() { + return META; + } + + @Override + public Object getValue() { + return new Long(longValue()); + } + + public void setValue(long value) { + handle.setCLong(0, value); + } + + @Override + public void setValue(Object value) { + setValue(((Number) value).longValue()); + } + + @Override + public int intValue() { + return (int) longValue(); + } + + @Override + public long longValue() { + return handle.getCLong(0); + } + + @Override + public short shortValue() { + return (short) longValue(); + } + + @Override + public String toString() { + if (getNativeHandle() == null) { + return "nope - no handle"; //$NON-NLS-1$ + } + if (getNativeHandle().getAddress() == 0) { + return "nope - null pointer"; //$NON-NLS-1$ + } + return String.valueOf(longValue()); + } } diff --git a/src/de/intarsys/nativec/type/NativeLongLP64.java b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeLongLP64.java similarity index 52% rename from src/de/intarsys/nativec/type/NativeLongLP64.java rename to native-c-api/src/main/java/de/intarsys/nativec/type/NativeLongLP64.java index 7dd44a2..0959edb 100644 --- a/src/de/intarsys/nativec/type/NativeLongLP64.java +++ b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeLongLP64.java @@ -39,92 +39,93 @@ */ public class NativeLongLP64 extends NativeNumber { - /** The meta class instance */ - public static final NativeLongLP64Type META = new NativeLongLP64Type(); - - static { - NativeType.register(NativeLongLP64.class, META); - } - - static public NativeLongLP64 createFromAddress(long address) { - return (NativeLongLP64) NativeLongLP64.META.createNative(NativeTools - .toHandle(address)); - } - - /** - * Create a new wrapper - */ - public NativeLongLP64() { - allocate(); - } - - protected NativeLongLP64(INativeHandle handle) { - super(handle); - } - - /** - * Create a new wrapper - */ - public NativeLongLP64(long value) { - allocate(); - setValue(value); - } - - @Override - public byte byteValue() { - return (byte) intValue(); - } - - @Override - public INativeType getNativeType() { - return META; - } - - @Override - public Object getValue() { - return new Long(longValue()); - } - - @Override - public int intValue() { - return (int) longValue(); - } - - @Override - public long longValue() { - if (NativeObject.SIZE_PTR == 4) { - return handle.getInt(0); - } - return handle.getLong(0); - } - - public void setValue(long value) { - if (NativeObject.SIZE_PTR == 4) { - handle.setInt(0, (int) value); - return; - } - handle.setLong(0, value); - } - - @Override - public void setValue(Object value) { - setValue(((Number) value).longValue()); - } - - @Override - public short shortValue() { - return (short) longValue(); - } - - @Override - public String toString() { - if (getNativeHandle() == null) { - return "nope - no handle"; //$NON-NLS-1$ - } - if (getNativeHandle().getAddress() == 0) { - return "nope - null pointer"; //$NON-NLS-1$ - } - return String.valueOf(longValue()); - } - + /** + * The meta class instance + */ + public static final NativeLongLP64Type META = new NativeLongLP64Type(); + + static { + NativeType.register(NativeLongLP64.class, META); + } + + /** + * Create a new wrapper + */ + public NativeLongLP64() { + allocate(); + } + + protected NativeLongLP64(INativeHandle handle) { + super(handle); + } + + /** + * Create a new wrapper + */ + public NativeLongLP64(long value) { + allocate(); + setValue(value); + } + + static public NativeLongLP64 createFromAddress(long address) { + return (NativeLongLP64) NativeLongLP64.META.createNative(NativeTools + .toHandle(address)); + } + + @Override + public byte byteValue() { + return (byte) intValue(); + } + + @Override + public INativeType getNativeType() { + return META; + } + + @Override + public Object getValue() { + return new Long(longValue()); + } + + public void setValue(long value) { + if (NativeObject.SIZE_PTR == 4) { + handle.setInt(0, (int) value); + return; + } + handle.setLong(0, value); + } + + @Override + public void setValue(Object value) { + setValue(((Number) value).longValue()); + } + + @Override + public int intValue() { + return (int) longValue(); + } + + @Override + public long longValue() { + if (NativeObject.SIZE_PTR == 4) { + return handle.getInt(0); + } + return handle.getLong(0); + } + + @Override + public short shortValue() { + return (short) longValue(); + } + + @Override + public String toString() { + if (getNativeHandle() == null) { + return "nope - no handle"; //$NON-NLS-1$ + } + if (getNativeHandle().getAddress() == 0) { + return "nope - null pointer"; //$NON-NLS-1$ + } + return String.valueOf(longValue()); + } } diff --git a/src/de/intarsys/nativec/type/NativeLongLP64Type.java b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeLongLP64Type.java similarity index 65% rename from src/de/intarsys/nativec/type/NativeLongLP64Type.java rename to native-c-api/src/main/java/de/intarsys/nativec/type/NativeLongLP64Type.java index 46eb639..400f8a3 100644 --- a/src/de/intarsys/nativec/type/NativeLongLP64Type.java +++ b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeLongLP64Type.java @@ -36,44 +36,44 @@ */ public class NativeLongLP64Type extends NativeNumberType { - /** - * Utility method: return the given number as another number object with - * compatible byte size - */ - public static Object coerce(Number value) { - if (NativeObject.SIZE_PTR == 4) { - return value.intValue(); - } - return value.longValue(); - } + protected NativeLongLP64Type() { + super(); + } - /** - * Utility method: return the java class whose instances have compatible - * byte size - */ - public static Class primitiveClass() { - if (NativeObject.SIZE_PTR == 4) { - return Integer.class; - } - return Long.class; - } + /** + * Utility method: return the given number as another number object with + * compatible byte size + */ + public static Object coerce(Number value) { + if (NativeObject.SIZE_PTR == 4) { + return value.intValue(); + } + return value.longValue(); + } - protected NativeLongLP64Type() { - super(); - } + /** + * Utility method: return the java class whose instances have compatible + * byte size + */ + public static Class primitiveClass() { + if (NativeObject.SIZE_PTR == 4) { + return Integer.class; + } + return Long.class; + } - @Override - public INativeObject createNative(INativeHandle handle) { - return new NativeLongLP64(handle); - } + @Override + public INativeObject createNative(INativeHandle handle) { + return new NativeLongLP64(handle); + } - @Override - public INativeObject createNative(Object value) { - return new NativeLongLP64(((Number) value).longValue()); - } + @Override + public INativeObject createNative(Object value) { + return new NativeLongLP64(((Number) value).longValue()); + } - @Override - public int getByteCount() { - return NativeObject.SIZE_PTR; - } + @Override + public int getByteCount() { + return NativeObject.SIZE_PTR; + } } \ No newline at end of file diff --git a/src/de/intarsys/nativec/type/NativeLongType.java b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeLongType.java similarity index 82% rename from src/de/intarsys/nativec/type/NativeLongType.java rename to native-c-api/src/main/java/de/intarsys/nativec/type/NativeLongType.java index 0f107d8..f92e1c9 100644 --- a/src/de/intarsys/nativec/type/NativeLongType.java +++ b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeLongType.java @@ -36,22 +36,22 @@ */ public class NativeLongType extends NativeNumberType { - protected NativeLongType() { - super(); - } + protected NativeLongType() { + super(); + } - @Override - public INativeObject createNative(INativeHandle handle) { - return new NativeLong(handle); - } + @Override + public INativeObject createNative(INativeHandle handle) { + return new NativeLong(handle); + } - @Override - public INativeObject createNative(Object value) { - return new NativeLong(((Number) value).longValue()); - } + @Override + public INativeObject createNative(Object value) { + return new NativeLong(((Number) value).longValue()); + } - @Override - public int getByteCount() { - return NativeLong.SIZE_LONG; - } + @Override + public int getByteCount() { + return NativeLong.SIZE_LONG; + } } \ No newline at end of file diff --git a/src/de/intarsys/nativec/type/NativeNumber.java b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeNumber.java similarity index 71% rename from src/de/intarsys/nativec/type/NativeNumber.java rename to native-c-api/src/main/java/de/intarsys/nativec/type/NativeNumber.java index 6259626..4fef55a 100644 --- a/src/de/intarsys/nativec/type/NativeNumber.java +++ b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeNumber.java @@ -36,41 +36,42 @@ * {@link NativeSimple}. */ public abstract class NativeNumber extends NativeSimple { - /** - * Create a wrapper - */ - protected NativeNumber() { - } - protected NativeNumber(INativeHandle handle) { - super(handle); - } + /** + * Create a wrapper + */ + protected NativeNumber() { + } - /** - * This as a java primitive byte value. - * - * @return This as a java primitive byte value. - */ - public abstract byte byteValue(); + protected NativeNumber(INativeHandle handle) { + super(handle); + } - /** - * This as a java primitive int value. - * - * @return This as a java primitive int value. - */ - public abstract int intValue(); + /** + * This as a java primitive byte value. + * + * @return This as a java primitive byte value. + */ + public abstract byte byteValue(); - /** - * This as a java primitive long value. - * - * @return This as a java primitive long value. - */ - public abstract long longValue(); + /** + * This as a java primitive int value. + * + * @return This as a java primitive int value. + */ + public abstract int intValue(); - /** - * This as a java primitive short value. - * - * @return This as a java primitive short value. - */ - public abstract short shortValue(); + /** + * This as a java primitive long value. + * + * @return This as a java primitive long value. + */ + public abstract long longValue(); + + /** + * This as a java primitive short value. + * + * @return This as a java primitive short value. + */ + public abstract short shortValue(); } diff --git a/src/de/intarsys/nativec/type/NativeNumberType.java b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeNumberType.java similarity index 97% rename from src/de/intarsys/nativec/type/NativeNumberType.java rename to native-c-api/src/main/java/de/intarsys/nativec/type/NativeNumberType.java index ef64399..8fb0ee7 100644 --- a/src/de/intarsys/nativec/type/NativeNumberType.java +++ b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeNumberType.java @@ -34,7 +34,7 @@ */ public class NativeNumberType extends NativeSimpleType { - protected NativeNumberType() { - super(); - } + protected NativeNumberType() { + super(); + } } \ No newline at end of file diff --git a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeObject.java b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeObject.java new file mode 100644 index 0000000..e59f7e5 --- /dev/null +++ b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeObject.java @@ -0,0 +1,289 @@ +/* + * Copyright (c) 2008, intarsys consulting GmbH + * + * 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 intarsys 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 OWNER 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. + */ +package de.intarsys.nativec.type; + +import de.intarsys.nativec.api.INativeHandle; +import de.intarsys.nativec.api.NativeInterface; + +/** + * An instance of an external (C memory) represented object. The C-object is + * represented using the handle (the pointer to the object in C memory) and its + * type {@link INativeType}. + *

+ * Supported data types are + *

    + *
  • primitive types (char, byte, int, short, long, String...)
  • + *
  • byte buffer
  • + *
  • array types
  • + *
  • structures
  • + *
  • references
  • + *
+ *

+ */ +public abstract class NativeObject implements INativeObject { + + public static final int SIZE_BYTE = 1; + + public static final int SIZE_INT = 4; + + public static final int SHIFT_INT = 2; + + public static final int SIZE_LONGLONG = 8; + + public static final int SHIFT_LONGLONG = 3; + + public static final int SIZE_LONG = NativeInterface.get().longSize(); + + public static final int SHIFT_LONG = SIZE_LONG == 4 ? 2 : 3; + + public static final int SIZE_PTR = NativeInterface.get().pointerSize(); + + public static final int SIZE_SHORT = 2; + + /** + * DEBUG flag + */ + public static boolean DEBUG = true; + + /** + * The handle to the memory chunk used by this object. While in fact this is + * final, Java language semantics does not allow to declare so! + *

+ * The handle should only be assigned in the constructor, via parameter or + * "allocate". + */ + protected INativeHandle handle; + + /** + * + */ + protected NativeObject() { + // + } + + /** + * Create a new NativeObject in C-Memory at pointer "handle". The bytes + * belonging to this object may already have been copied from C-Memory and + * made available in bytes at location offset. + * + * @param handle The pointer in C-memory + */ + protected NativeObject(INativeHandle handle) { + this.handle = handle; + } + + /** + * Manage the objects memory in Java. C memory will be valid at least as + * long as we hold a reference to the buffer. C memory is undefined (but not + * a memory leak) and may be reclaimed at any time after dropping our + * pointer to the buffer. + */ + protected void allocate() { + int size = getByteCount(); + handle = NativeInterface.get().allocate(size); + } + + /** + * This is a special form of the "createNative" signature, implementing a + * "type cast" on the same memory location. + * + * @param declaration The new base declaration type. + * + * @return The {@link INativeObject} at the same memory location as this, + * but of a different type. + */ + public INativeObject cast(INativeType declaration) { + return declaration.createNative(handle); + } + + public INativeObject createReference() { + NativeReference ref = NativeReference.create(getNativeType()); + ref.setValue(this); + return ref; + } + + /** + * The byte at index as a byte. + * + * @param index The index of the element to be reported. + * + * @return The element at index as a native byte. + */ + public byte getByte(int index) { + return handle.getByte(index); + } + + /** + * The element at index as an array of bytes with dimension count. This is a + * lightweight optimization. + * + * @param index The index of the element to be reported. + * + * @return The element at index as an array of native byte with dimension + * count. + */ + public byte[] getByteArray(int index, int count) { + return handle.getByteArray(index, count); + } + + /** + * The number of bytes occupied by this. + * + * @return The number of bytes occupied by this. + */ + public abstract int getByteCount(); + + /** + * The bytes copied from C-memory that represent this. + * + * @return The bytes copied from C-memory that represent this. + */ + public byte[] getBytes() { + return handle.getByteArray(0, getByteCount()); + } + + /** + * The element at index as a native long. Only the "platform" number of + * bytes are read. + * + * @param index The index of the element to be reported. + * + * @return The element at index as a native long. + */ + public long getCLong(int index) { + return handle.getCLong(index); + } + + /** + * The element at index as a native int. + * + * @param index The index of the element to be reported. + * + * @return The element at index as a native int. + */ + public int getInt(int index) { + return handle.getInt(index); + } + + /** + * The C-Pointer where the associated memory is found. + * + * @return The C-Pointer where the associated memory is found. + */ + public INativeHandle getNativeHandle() { + return handle; + } + + public INativeHandle getNativeHandle(int index) { + return handle.getNativeHandle(index); + } + + /** + * The meta information and behavior for the NativeObject. + *

+ * There is exactly one meta instance for all NativeObject instances of a + * certain type. + * + * @return The meta information and behavior for the NativeObject. + */ + abstract public INativeType getNativeType(); + + /** + * The element at index as a native short. This is a lightweight + * optimization. + * + * @param index The index of the element to be reported. + * + * @return The element at index as a native short. + */ + public short getShort(int index) { + return handle.getShort(index); + } + + public String getString(int index) { + return handle.getString(index); + } + + public String getWideString(int index) { + return handle.getWideString(index); + } + + /** + * Answer true if this is "null". This means the associated + * C-pointer is pointing to 0. + * + * @return Answer true if this is "null". + */ + public boolean isNull() { + return handle == null || handle.getAddress() == 0; + } + + public void setByte(int index, byte value) { + handle.setByte(index, value); + } + + public void setByteArray(int index, byte[] value, int valueOffset, + int valueCount) { + handle.setByteArray(index, value, valueOffset, valueCount); + } + + public void setCLong(int index, long value) { + handle.setCLong(index, value); + } + + public void setInt(int index, int value) { + handle.setInt(index, value); + } + + public void setNativeHandle(int index, INativeHandle value) { + handle.setNativeHandle(index, value); + } + + public void setShort(int index, short value) { + handle.setShort(index, value); + } + + public void setString(int index, String value) { + handle.setString(index, value); + } + + public void setWideString(int index, String value) { + handle.setWideString(index, value); + } + + /** + * A string for debugging purposes. + * + * @return A string for debugging purposes. + */ + public String toNestedString() { + return toString(); + } +} \ No newline at end of file diff --git a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeReference.java b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeReference.java new file mode 100644 index 0000000..c28f3d5 --- /dev/null +++ b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeReference.java @@ -0,0 +1,130 @@ +/* + * Copyright (c) 2008, intarsys consulting GmbH + * + * 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 intarsys 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 OWNER 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. + */ +package de.intarsys.nativec.type; + +import de.intarsys.nativec.api.INativeHandle; +import de.intarsys.nativec.api.NativeInterface; + +/** + * An object representing a reference to another object ("pointer"). + */ +public class NativeReference extends NativeObject { + + /** + * The meta class instance + */ + public static final NativeReferenceType META = new NativeReferenceType( + NativeVoid.META); + + static { + NativeType.register(NativeReference.class, META); + } + + private INativeHandle dereferenceHandle; + private T dereferenced; + private NativeReferenceType type; + + protected NativeReference(NativeReferenceType type) { + this.type = type; + allocate(); + } + + protected NativeReference(NativeReferenceType type, INativeHandle handle) { + super(handle); + this.type = type; + handle.setSize(getByteCount()); + } + + public static NativeReference create( + INativeType baseType) { + NativeReferenceType type = new NativeReferenceType(baseType); + return new NativeReference(type); + } + + public INativeType getBaseType() { + return type.getBaseType(); + } + + public void setBaseType(INativeType baseType) { + type = NativeReferenceType.create(baseType); + dereferenceHandle = null; + dereferenced = null; + } + + @Override + public int getByteCount() { + return NativeInterface.get().pointerSize(); + } + + @Override + public INativeType getNativeType() { + return type; + } + + public long getReferencedAddress() { + return getNativeHandle(0).getAddress(); + } + + synchronized public T getValue() { + dereferenceHandle = handle.getNativeHandle(0); + // check if not yet computed or handle changed + if (dereferenced == null + || !dereferenced.getNativeHandle().equals(dereferenceHandle)) { + dereferenced = (T) type.getBaseType().createNative( + dereferenceHandle); + } + return dereferenced; + } + + synchronized public void setValue(Object value) { + if (value instanceof INativeObject) { + T nativeObject = (T) value; + INativeHandle valueHandle = nativeObject.getNativeHandle(); + handle.setNativeHandle(0, valueHandle); + dereferenceHandle = valueHandle; + dereferenced = nativeObject; + } else if (value instanceof INativeHandle) { + INativeHandle valueHandle = (INativeHandle) value; + handle.setNativeHandle(0, valueHandle); + dereferenceHandle = valueHandle; + dereferenced = null; + } else { + throw new IllegalArgumentException(); + } + } + + @Override + public String toString() { + if (handle == null) { + return "Ref to null"; + } + return "Ref to " + getReferencedAddress(); + } +} diff --git a/src/de/intarsys/nativec/type/NativeReferenceType.java b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeReferenceType.java similarity index 68% rename from src/de/intarsys/nativec/type/NativeReferenceType.java rename to native-c-api/src/main/java/de/intarsys/nativec/type/NativeReferenceType.java index 85efb1d..3015493 100644 --- a/src/de/intarsys/nativec/type/NativeReferenceType.java +++ b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeReferenceType.java @@ -37,42 +37,43 @@ */ public class NativeReferenceType extends NativeType { - public static NativeReferenceType create(INativeType baseType) { - return new NativeReferenceType(baseType); - } + /** + * The declaration for the dereference slot + */ + private final INativeType baseType; - /** The declaration for the dereference slot */ - private final INativeType baseType; + /** + * Declare a reference to a base type + */ + protected NativeReferenceType(INativeType baseDeclaration) { + super(); + this.baseType = baseDeclaration; + } - /** - * Declare a reference to a base type - */ - protected NativeReferenceType(INativeType baseDeclaration) { - super(); - this.baseType = baseDeclaration; - } + public static NativeReferenceType create(INativeType baseType) { + return new NativeReferenceType(baseType); + } - @Override - public INativeObject createNative(INativeHandle handle) { - return new NativeReference(this, handle); - } + @Override + public INativeObject createNative(INativeHandle handle) { + return new NativeReference(this, handle); + } - @Override - public INativeObject createNative(Object value) { - return new NativeReference(this); - } + @Override + public INativeObject createNative(Object value) { + return new NativeReference(this); + } - public INativeType getBaseType() { - return baseType; - } + public INativeType getBaseType() { + return baseType; + } - @Override - public int getByteCount() { - return NativeInterface.get().pointerSize(); - } - - public int getPreferredBoundary() { - return NativeInterface.get().pointerSize(); - } + @Override + public int getByteCount() { + return NativeInterface.get().pointerSize(); + } + public int getPreferredBoundary() { + return NativeInterface.get().pointerSize(); + } } diff --git a/src/de/intarsys/nativec/type/NativeShort.java b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeShort.java similarity index 53% rename from src/de/intarsys/nativec/type/NativeShort.java rename to native-c-api/src/main/java/de/intarsys/nativec/type/NativeShort.java index c96b2fc..47fe4ff 100644 --- a/src/de/intarsys/nativec/type/NativeShort.java +++ b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeShort.java @@ -34,88 +34,89 @@ /** * A wrapper for a primitive short. - * */ public class NativeShort extends NativeNumber { - /** The meta class instance */ - public static final NativeShortType META = new NativeShortType(); - - static { - NativeType.register(NativeShort.class, META); - } - - static public NativeShort createFromAddress(long address) { - return (NativeShort) NativeShort.META.createNative(NativeTools - .toHandle(address)); - } - - /** - * Create a new wrapper - */ - public NativeShort() { - allocate(); - } - - protected NativeShort(INativeHandle handle) { - super(handle); - } - - /** - * Create a new wrapper - */ - public NativeShort(short value) { - allocate(); - setValue(value); - } - - @Override - public byte byteValue() { - return (byte) shortValue(); - } - - @Override - public INativeType getNativeType() { - return META; - } - - @Override - public Object getValue() { - return new Short(shortValue()); - } - - @Override - public int intValue() { - return shortValue(); - } - - @Override - public long longValue() { - return shortValue(); - } - - @Override - public void setValue(Object value) { - setValue(((Number) value).shortValue()); - } - - public void setValue(short value) { - handle.setShort(0, value); - } - - @Override - public short shortValue() { - return handle.getShort(0); - } - - @Override - public String toString() { - if (getNativeHandle() == null) { - return "nope - no handle"; //$NON-NLS-1$ - } - if (getNativeHandle().getAddress() == 0) { - return "nope - null pointer"; //$NON-NLS-1$ - } - return String.valueOf(shortValue()); - } + /** + * The meta class instance + */ + public static final NativeShortType META = new NativeShortType(); + + static { + NativeType.register(NativeShort.class, META); + } + + /** + * Create a new wrapper + */ + public NativeShort() { + allocate(); + } + + protected NativeShort(INativeHandle handle) { + super(handle); + } + + /** + * Create a new wrapper + */ + public NativeShort(short value) { + allocate(); + setValue(value); + } + + static public NativeShort createFromAddress(long address) { + return (NativeShort) NativeShort.META.createNative(NativeTools + .toHandle(address)); + } + + @Override + public byte byteValue() { + return (byte) shortValue(); + } + + @Override + public INativeType getNativeType() { + return META; + } + + @Override + public Object getValue() { + return new Short(shortValue()); + } + + @Override + public void setValue(Object value) { + setValue(((Number) value).shortValue()); + } + + public void setValue(short value) { + handle.setShort(0, value); + } + + @Override + public int intValue() { + return shortValue(); + } + + @Override + public long longValue() { + return shortValue(); + } + + @Override + public short shortValue() { + return handle.getShort(0); + } + + @Override + public String toString() { + if (getNativeHandle() == null) { + return "nope - no handle"; //$NON-NLS-1$ + } + if (getNativeHandle().getAddress() == 0) { + return "nope - null pointer"; //$NON-NLS-1$ + } + return String.valueOf(shortValue()); + } } diff --git a/src/de/intarsys/nativec/type/NativeShortType.java b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeShortType.java similarity index 82% rename from src/de/intarsys/nativec/type/NativeShortType.java rename to native-c-api/src/main/java/de/intarsys/nativec/type/NativeShortType.java index 47c5b6f..d831056 100644 --- a/src/de/intarsys/nativec/type/NativeShortType.java +++ b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeShortType.java @@ -36,22 +36,22 @@ */ public class NativeShortType extends NativeNumberType { - protected NativeShortType() { - super(); - } + protected NativeShortType() { + super(); + } - @Override - public NativeObject createNative(INativeHandle handle) { - return new NativeShort(handle); - } + @Override + public NativeObject createNative(INativeHandle handle) { + return new NativeShort(handle); + } - @Override - public NativeObject createNative(Object value) { - return new NativeShort(((Number) value).shortValue()); - } + @Override + public NativeObject createNative(Object value) { + return new NativeShort(((Number) value).shortValue()); + } - @Override - public int getByteCount() { - return NativeShort.SIZE_SHORT; - } + @Override + public int getByteCount() { + return NativeShort.SIZE_SHORT; + } } \ No newline at end of file diff --git a/src/de/intarsys/nativec/type/NativeSimple.java b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeSimple.java similarity index 83% rename from src/de/intarsys/nativec/type/NativeSimple.java rename to native-c-api/src/main/java/de/intarsys/nativec/type/NativeSimple.java index 09a8161..525658e 100644 --- a/src/de/intarsys/nativec/type/NativeSimple.java +++ b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeSimple.java @@ -36,29 +36,27 @@ * {@link NativeObject} instances. These {@link NativeObject} instances are not * constructed from other {@link NativeObject} instances but implemented * directly in Java, having a fixed size. - * */ public abstract class NativeSimple extends NativeObject { - /** - * Create a wrapper for a NativePrimitive - */ - protected NativeSimple() { - } + /** + * Create a wrapper for a NativePrimitive + */ + protected NativeSimple() { + } - protected NativeSimple(INativeHandle handle) { - super(handle); - handle.setSize(getByteCount()); - } - - /* - * (non-Javadoc) - * - * @see de.intarsys.tools.nativec.NativeObject#getByteCount() - */ - @Override - public int getByteCount() { - return getNativeType().getByteCount(); - } + protected NativeSimple(INativeHandle handle) { + super(handle); + handle.setSize(getByteCount()); + } + /* + * (non-Javadoc) + * + * @see de.intarsys.tools.nativec.NativeObject#getByteCount() + */ + @Override + public int getByteCount() { + return getNativeType().getByteCount(); + } } diff --git a/src/de/intarsys/nativec/type/NativeSimpleType.java b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeSimpleType.java similarity index 93% rename from src/de/intarsys/nativec/type/NativeSimpleType.java rename to native-c-api/src/main/java/de/intarsys/nativec/type/NativeSimpleType.java index 929ae07..50d84e9 100644 --- a/src/de/intarsys/nativec/type/NativeSimpleType.java +++ b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeSimpleType.java @@ -34,12 +34,11 @@ */ public class NativeSimpleType extends NativeType { - protected NativeSimpleType() { - super(); - } - - public int getPreferredBoundary() { - return getByteCount(); - } + protected NativeSimpleType() { + super(); + } + public int getPreferredBoundary() { + return getByteCount(); + } } \ No newline at end of file diff --git a/src/de/intarsys/nativec/type/NativeStaticStruct.java b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeStaticStruct.java similarity index 91% rename from src/de/intarsys/nativec/type/NativeStaticStruct.java rename to native-c-api/src/main/java/de/intarsys/nativec/type/NativeStaticStruct.java index 8454eb5..a1b31be 100644 --- a/src/de/intarsys/nativec/type/NativeStaticStruct.java +++ b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeStaticStruct.java @@ -33,17 +33,15 @@ /** * A struct with a statically defined type. - * */ public abstract class NativeStaticStruct extends NativeStruct { - protected NativeStaticStruct() { - allocate(); - } - - protected NativeStaticStruct(INativeHandle handle) { - super(handle); - handle.setSize(getByteCount()); - } + protected NativeStaticStruct() { + allocate(); + } + protected NativeStaticStruct(INativeHandle handle) { + super(handle); + handle.setSize(getByteCount()); + } } diff --git a/src/de/intarsys/nativec/type/NativeString.java b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeString.java similarity index 52% rename from src/de/intarsys/nativec/type/NativeString.java rename to native-c-api/src/main/java/de/intarsys/nativec/type/NativeString.java index 6ba6a15..f06994b 100644 --- a/src/de/intarsys/nativec/type/NativeString.java +++ b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeString.java @@ -37,79 +37,80 @@ */ public class NativeString extends NativeObject { - /** The meta class instance */ - public static final NativeStringType META = new NativeStringType(); - - static { - NativeType.register(NativeString.class, META); - } - - static public NativeString createFromAddress(long address) { - return (NativeString) NativeString.META.createNative(NativeTools - .toHandle(address)); - } - - private int size = 0; - private NativeStringType type; - - protected NativeString(NativeStringType pType) { - type = pType; - allocate(); - } - - protected NativeString(NativeStringType pType, INativeHandle handle) { - super(handle); - type = pType; - if (type.hasByteCount()) { - handle.setSize(type.getByteCount()); - } - } - - protected NativeString(NativeStringType pType, String value) { - type = pType; - if (type.getStringSize() == 0) { - this.size = value.length() + 1; - } - allocate(); - setValue(value); - } - - public NativeString(String value) { - this(META, value); - } - - @Override - public int getByteCount() { - if (type.hasByteCount()) { - return type.getByteCount(); - } - return size; - } - - @Override - public INativeType getNativeType() { - return type; - } - - public Object getValue() { - return stringValue(); - } - - public void setValue(Object value) { - setValue((String) value); - } - - public void setValue(String value) { - this.size = value.length() + 1; - handle.setString(0, value); - } - - /** - * The java object corresponding to this. - * - * @return The java object corresponding to this. - */ - public String stringValue() { - return handle.getString(0); - } + /** + * The meta class instance + */ + public static final NativeStringType META = new NativeStringType(); + + static { + NativeType.register(NativeString.class, META); + } + + private int size = 0; + private NativeStringType type; + protected NativeString(NativeStringType pType) { + type = pType; + allocate(); + } + + protected NativeString(NativeStringType pType, INativeHandle handle) { + super(handle); + type = pType; + if (type.hasByteCount()) { + handle.setSize(type.getByteCount()); + } + } + + protected NativeString(NativeStringType pType, String value) { + type = pType; + if (type.getStringSize() == 0) { + this.size = value.length() + 1; + } + allocate(); + setValue(value); + } + + public NativeString(String value) { + this(META, value); + } + + static public NativeString createFromAddress(long address) { + return (NativeString) NativeString.META.createNative(NativeTools + .toHandle(address)); + } + + @Override + public int getByteCount() { + if (type.hasByteCount()) { + return type.getByteCount(); + } + return size; + } + + @Override + public INativeType getNativeType() { + return type; + } + + public Object getValue() { + return stringValue(); + } + + public void setValue(Object value) { + setValue((String) value); + } + + public void setValue(String value) { + this.size = value.length() + 1; + handle.setString(0, value); + } + + /** + * The java object corresponding to this. + * + * @return The java object corresponding to this. + */ + public String stringValue() { + return handle.getString(0); + } } diff --git a/src/de/intarsys/nativec/type/NativeStringType.java b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeStringType.java similarity index 76% rename from src/de/intarsys/nativec/type/NativeStringType.java rename to native-c-api/src/main/java/de/intarsys/nativec/type/NativeStringType.java index 8af13ce..72b3638 100644 --- a/src/de/intarsys/nativec/type/NativeStringType.java +++ b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeStringType.java @@ -36,30 +36,29 @@ */ public class NativeStringType extends NativeAbstractStringType { - public static NativeStringType create(int size) { - return new NativeStringType(size); - } + protected NativeStringType() { + super(1); + } - protected NativeStringType() { - super(1); - } + protected NativeStringType(int size) { + super(size, 1); + } - protected NativeStringType(int size) { - super(size, 1); - } + public static NativeStringType create(int size) { + return new NativeStringType(size); + } - public NativeObject createNative() { - return new NativeString(this); - } + public NativeObject createNative() { + return new NativeString(this); + } - @Override - public NativeObject createNative(INativeHandle handle) { - return new NativeString(this, handle); - } - - @Override - public NativeObject createNative(Object value) { - return new NativeString(this, (String) value); - } + @Override + public NativeObject createNative(INativeHandle handle) { + return new NativeString(this, handle); + } + @Override + public NativeObject createNative(Object value) { + return new NativeString(this, (String) value); + } } \ No newline at end of file diff --git a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeStruct.java b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeStruct.java new file mode 100644 index 0000000..a13a3e3 --- /dev/null +++ b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeStruct.java @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2008, intarsys consulting GmbH + * + * 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 intarsys 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 OWNER 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. + */ +package de.intarsys.nativec.type; + +import java.util.Iterator; + +import de.intarsys.nativec.api.INativeHandle; + +/** + * An abstract superclass for the implementation of structured + * {@link NativeObject} instances. These objects are built using named slots + * with other {@link INativeObject} instances (as opposed to {@link NativeArray}, + * using indexed slots). + */ +public abstract class NativeStruct extends NativeObject { + + /** + * The meta class instance + */ + public static final NativeStructType META = new NativeStructType(); + + static { + NativeType.register(NativeGenericStruct.class, META); + } + + protected INativeObject[] values; + + public NativeStruct() { + super(); + } + + public NativeStruct(INativeHandle handle) { + super(handle); + } + + @Override + public int getByteCount() { + return getNativeType().getByteCount(); + } + + /** + * The NativeObject at the named slot name. + *

+ * The marshalling is delegated to the StructMember in the + * StructDeclaration. + * + * @param name The name of the slot in the structure. + * + * @return The NativeObject at the named slot name. + */ + public INativeObject getNativeObject(String name) { + return getStructType().getNativeObject(this, name); + } + + protected StructMember getStructField(String name) { + return getStructType().getField(name); + } + + public NativeStructType getStructType() { + return (NativeStructType) getNativeType(); + } + + public Object getValue() { + throw new UnsupportedOperationException( + "getValue not implemented for NativeStruct"); + } + + public void setValue(Object value) { + throw new UnsupportedOperationException( + "getValue not implemented for NativeStruct"); + } + + /* + * (non-Javadoc) + * + * @see de.intarsys.tools.nativec.NativeObject#toNestedString() + */ + @Override + public String toNestedString() { + return "Struct " + getClass().getName(); + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getName()); + sb.append("\n"); + for (Iterator it = getStructType().getFields().iterator(); it.hasNext(); ) { + StructMember field = (StructMember) it.next(); + sb.append(field.getName()); + sb.append("="); + try { + sb.append(getNativeObject(field.getName()).toString()); + } catch (RuntimeException e) { + sb.append("**error**"); + } + sb.append("\n"); + } + return sb.toString(); + } +} diff --git a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeStructType.java b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeStructType.java new file mode 100644 index 0000000..a74e769 --- /dev/null +++ b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeStructType.java @@ -0,0 +1,171 @@ +/* + * Copyright (c) 2008, intarsys consulting GmbH + * + * 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 intarsys 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 OWNER 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. + */ +package de.intarsys.nativec.type; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import de.intarsys.nativec.api.NativeInterface; + +/** + * The meta class implementation + */ +public class NativeStructType extends NativeType { + + /** + * The named members of the structure definition + */ + private final Map fields = new HashMap(); + /** + * The boundary where the struct as a member of another struct would want to + * be aligned. + */ + private int byteBoundary = 1; + /** + * The offset where theoretically a new member could be placed. Where it + * will actually be placed depends on the member itself. + */ + private int byteOffset = 0; + /** + * The size in bytes of the member collection + */ + private int byteSize = 0; + /** + * The number of members in the structure + */ + private int fieldsSize = 0; + + /** + * Where members should be aligned in native memory + */ + // expecting pointer size to be a reasonable default - have to look that up + private int packing = NativeInterface.get().pointerSize(); + + protected NativeStructType() { + super(); + } + + protected NativeStructType(Class instanceClass) { + super(instanceClass); + } + + /** + * Declare a new member for the struct. + * + * @param name The name of the new member slot. + * @param declaration The type declaration for the slot + */ + public StructMember declare(String name, INativeType declaration) { + int size; + int boundary; + + size = declaration.getByteCount(); + boundary = Math.min(declaration.getPreferredBoundary(), packing); + byteBoundary = Math.max(byteBoundary, boundary); + + byteOffset = byteOffset - ((byteOffset + boundary - 1) % boundary + 1) + + boundary; + StructMember field = new StructMember(this, name, fieldsSize++, + declaration, byteOffset); + fields.put(name, field); + byteOffset = byteOffset + size; + byteSize = byteOffset; + return field; + } + + public int getByteBoundary() { + return byteBoundary; + } + + @Override + public int getByteCount() { + return getByteSize(); + } + + /** + * The total size of the StructDeclaration. + * + * @return The total size of the StructDeclaration. + */ + public int getByteSize() { + return byteSize; + } + + public StructMember getField(String name) { + return fields.get(name); + } + + /** + * The collection of StructMember instances in declaration order. + * + * @return The collection of StructMember instances in declaration order. + */ + public List getFields() { + return new ArrayList(fields.values()); + } + + public int getFieldsSize() { + return fieldsSize; + } + + public INativeObject getNativeObject(NativeStruct struct, String name) { + StructMember member = fields.get(name); + return member.getNativeObject(struct); + } + + public int getPacking() { + return packing; + } + + public void setPacking(int pPacking) { + if (!fields.isEmpty()) { + throw new IllegalStateException( + "packing must be set before members are declared"); + } + packing = pPacking; + } + + @Override + public int getPreferredBoundary() { + return getByteBoundary(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + for (StructMember field : getFields()) { + sb.append(field.toString()); + sb.append("\n"); + } + return sb.toString(); + } +} \ No newline at end of file diff --git a/src/de/intarsys/nativec/type/NativeType.java b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeType.java similarity index 51% rename from src/de/intarsys/nativec/type/NativeType.java rename to native-c-api/src/main/java/de/intarsys/nativec/type/NativeType.java index 6f6219c..4df63de 100644 --- a/src/de/intarsys/nativec/type/NativeType.java +++ b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeType.java @@ -39,69 +39,71 @@ */ public abstract class NativeType implements INativeType { - /** All known meta classes. */ - private static Map, INativeType> metaClasses = new HashMap, INativeType>(); + /** + * All known meta classes. + */ + private static Map, INativeType> metaClasses = new HashMap, INativeType>(); - public static synchronized INativeType lookup(Class clazz) { - INativeType result = metaClasses.get(clazz); - if (result == null) { - ClassLoader classLoader; + protected NativeType() { + // + } - clazz.getClasses(); - classLoader = Thread.currentThread().getContextClassLoader(); - if (classLoader == null) { - classLoader = NativeType.class.getClassLoader(); - } + protected NativeType(Class instanceClass) { + register(instanceClass, this); + } - try { - Class.forName(clazz.getName(), true, classLoader); - } catch (ClassNotFoundException ex) { - // ignore - } - result = metaClasses.get(clazz); - } - return result; - } + public static synchronized INativeType lookup(Class clazz) { + INativeType result = metaClasses.get(clazz); + if (result == null) { + ClassLoader classLoader; - public static synchronized void register(Class clazz, INativeType type) { - metaClasses.put(clazz, type); - } + clazz.getClasses(); + classLoader = Thread.currentThread().getContextClassLoader(); + if (classLoader == null) { + classLoader = NativeType.class.getClassLoader(); + } - protected NativeType() { - // - } + try { + Class.forName(clazz.getName(), true, classLoader); + } catch (ClassNotFoundException ex) { + // ignore + } + result = metaClasses.get(clazz); + } + return result; + } - protected NativeType(Class instanceClass) { - register(instanceClass, this); - } + public static synchronized void register(Class clazz, INativeType type) { + metaClasses.put(clazz, type); + } - /** - * Create a Declaration that represents an array of this. - * - * @return Create a Declaration that represents an array of this. - */ - public INativeType Array(int size) { - return new NativeArrayType(this, size); - } + /** + * Create a Declaration that represents an array of this. + * + * @return Create a Declaration that represents an array of this. + */ + public INativeType Array(int size) { + return new NativeArrayType(this, size); + } - public INativeObject createNative(INativeHandle handle) { - throw new IllegalStateException("meta constructor missing"); - } + public INativeObject createNative(INativeHandle handle) { + throw new IllegalStateException("meta constructor missing"); + } - public INativeObject createNative(Object value) { - throw new IllegalStateException("meta constructor missing"); - } + public INativeObject createNative(Object value) { + throw new IllegalStateException("meta constructor missing"); + } - public int getByteCount() { - return 0; - } + public int getByteCount() { + return 0; + } - /** - * Create a Declaration that represents a reference to this. - * - * @return Create a Declaration that represents a reference to this. - */ - public INativeType Ref() { - return new NativeReferenceType(this); - } + /** + * Create a Declaration that represents a reference to this. + * + * @return Create a Declaration that represents a reference to this. + */ + public INativeType Ref() { + return new NativeReferenceType(this); + } } diff --git a/src/de/intarsys/nativec/type/NativeVoid.java b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeVoid.java similarity index 70% rename from src/de/intarsys/nativec/type/NativeVoid.java rename to native-c-api/src/main/java/de/intarsys/nativec/type/NativeVoid.java index de6e044..4528aa4 100644 --- a/src/de/intarsys/nativec/type/NativeVoid.java +++ b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeVoid.java @@ -39,38 +39,39 @@ */ public class NativeVoid extends NativeSimple { - /** The meta class instance */ - public static final NativeVoidType META = new NativeVoidType(); + /** + * The meta class instance + */ + public static final NativeVoidType META = new NativeVoidType(); - public static final NativeVoid NULL = (NativeVoid) META - .createNative(NativeInterface.NULL); + public static final NativeVoid NULL = (NativeVoid) META + .createNative(NativeInterface.NULL); - static { - NativeType.register(NativeVoid.class, META); - } + static { + NativeType.register(NativeVoid.class, META); + } - static public NativeVoid createFromAddress(long address) { - return (NativeVoid) NativeVoid.META.createNative(NativeTools - .toHandle(address)); - } + protected NativeVoid(INativeHandle handle) { + super(handle); + } - protected NativeVoid(INativeHandle handle) { - super(handle); - } + static public NativeVoid createFromAddress(long address) { + return (NativeVoid) NativeVoid.META.createNative(NativeTools + .toHandle(address)); + } - @Override - public INativeType getNativeType() { - return META; - } + @Override + public INativeType getNativeType() { + return META; + } - @Override - public Object getValue() { - throw new UnsupportedOperationException(); - } - - @Override - public void setValue(Object value) { - throw new UnsupportedOperationException(); - } + @Override + public Object getValue() { + throw new UnsupportedOperationException(); + } + @Override + public void setValue(Object value) { + throw new UnsupportedOperationException(); + } } diff --git a/src/de/intarsys/nativec/type/NativeVoidType.java b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeVoidType.java similarity index 83% rename from src/de/intarsys/nativec/type/NativeVoidType.java rename to native-c-api/src/main/java/de/intarsys/nativec/type/NativeVoidType.java index 3980c68..bc1a44a 100644 --- a/src/de/intarsys/nativec/type/NativeVoidType.java +++ b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeVoidType.java @@ -36,23 +36,22 @@ */ public class NativeVoidType extends NativeSimpleType { - protected NativeVoidType() { - super(); - } + protected NativeVoidType() { + super(); + } - @Override - public INativeObject createNative(INativeHandle handle) { - return new NativeVoid(handle); - } + @Override + public INativeObject createNative(INativeHandle handle) { + return new NativeVoid(handle); + } - @Override - public INativeObject createNative(Object value) { - throw new UnsupportedOperationException(); - } - - @Override - public int getByteCount() { - return 0; - } + @Override + public INativeObject createNative(Object value) { + throw new UnsupportedOperationException(); + } + @Override + public int getByteCount() { + return 0; + } } \ No newline at end of file diff --git a/src/de/intarsys/nativec/type/NativeWideString.java b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeWideString.java similarity index 51% rename from src/de/intarsys/nativec/type/NativeWideString.java rename to native-c-api/src/main/java/de/intarsys/nativec/type/NativeWideString.java index d8903c7..7c16d05 100644 --- a/src/de/intarsys/nativec/type/NativeWideString.java +++ b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeWideString.java @@ -37,81 +37,82 @@ */ public class NativeWideString extends NativeObject { - /** The meta class instance */ - public static final NativeWideStringType META = new NativeWideStringType(); - - static { - NativeType.register(NativeWideString.class, META); - } - - static public NativeWideString createFromAddress(long address) { - return (NativeWideString) NativeWideString.META - .createNative(NativeTools.toHandle(address)); - } - - private int size = 0; - private NativeWideStringType type; - - protected NativeWideString(NativeWideStringType pType) { - type = pType; - allocate(); - } - - protected NativeWideString(NativeWideStringType pType, INativeHandle handle) { - super(handle); - type = pType; - if (type.hasByteCount()) { - handle.setSize(type.getByteCount()); - } - } - - protected NativeWideString(NativeWideStringType pType, String value) { - type = pType; - if (type.getStringSize() == 0) { - size = value.length() + 1; - size = size << 1; - } - allocate(); - setValue(value); - } - - public NativeWideString(String value) { - this(META, value); - } - - @Override - public int getByteCount() { - if (type.hasByteCount()) { - return type.getByteCount(); - } - return size; - } - - @Override - public INativeType getNativeType() { - return type; - } - - public Object getValue() { - return stringValue(); - } - - public void setValue(Object value) { - setValue((String) value); - } - - public void setValue(String value) { - size = value.length() + 1; - size = size << 1; - handle.setWideString(0, value); - } - - /** - * The java object corresponding to this. - * - * @return The java object corresponding to this. - */ - public String stringValue() { - return handle.getWideString(0); - } + /** + * The meta class instance + */ + public static final NativeWideStringType META = new NativeWideStringType(); + + static { + NativeType.register(NativeWideString.class, META); + } + + private int size = 0; + private NativeWideStringType type; + protected NativeWideString(NativeWideStringType pType) { + type = pType; + allocate(); + } + + protected NativeWideString(NativeWideStringType pType, INativeHandle handle) { + super(handle); + type = pType; + if (type.hasByteCount()) { + handle.setSize(type.getByteCount()); + } + } + + protected NativeWideString(NativeWideStringType pType, String value) { + type = pType; + if (type.getStringSize() == 0) { + size = value.length() + 1; + size = size << 1; + } + allocate(); + setValue(value); + } + + public NativeWideString(String value) { + this(META, value); + } + + static public NativeWideString createFromAddress(long address) { + return (NativeWideString) NativeWideString.META + .createNative(NativeTools.toHandle(address)); + } + + @Override + public int getByteCount() { + if (type.hasByteCount()) { + return type.getByteCount(); + } + return size; + } + + @Override + public INativeType getNativeType() { + return type; + } + + public Object getValue() { + return stringValue(); + } + + public void setValue(Object value) { + setValue((String) value); + } + + public void setValue(String value) { + size = value.length() + 1; + size = size << 1; + handle.setWideString(0, value); + } + + /** + * The java object corresponding to this. + * + * @return The java object corresponding to this. + */ + public String stringValue() { + return handle.getWideString(0); + } } diff --git a/src/de/intarsys/nativec/type/NativeWideStringType.java b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeWideStringType.java similarity index 72% rename from src/de/intarsys/nativec/type/NativeWideStringType.java rename to native-c-api/src/main/java/de/intarsys/nativec/type/NativeWideStringType.java index 49b5df6..bd41079 100644 --- a/src/de/intarsys/nativec/type/NativeWideStringType.java +++ b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeWideStringType.java @@ -37,37 +37,36 @@ */ public class NativeWideStringType extends NativeAbstractStringType { - public static CWideString convert(String string) { - if (string == null) { - return null; - } - return new CWideString(string); - } + protected NativeWideStringType() { + super(2); + } - public static NativeWideStringType create(int size) { - return new NativeWideStringType(size); - } + protected NativeWideStringType(int size) { + super(size, 2); + } - protected NativeWideStringType() { - super(2); - } + public static CWideString convert(String string) { + if (string == null) { + return null; + } + return new CWideString(string); + } - protected NativeWideStringType(int size) { - super(size, 2); - } + public static NativeWideStringType create(int size) { + return new NativeWideStringType(size); + } - public NativeObject createNative() { - return new NativeWideString(this); - } + public NativeObject createNative() { + return new NativeWideString(this); + } - @Override - public NativeObject createNative(INativeHandle handle) { - return new NativeWideString(this, handle); - } - - @Override - public NativeObject createNative(Object value) { - return new NativeWideString(this, (String) value); - } + @Override + public NativeObject createNative(INativeHandle handle) { + return new NativeWideString(this, handle); + } + @Override + public NativeObject createNative(Object value) { + return new NativeWideString(this, (String) value); + } } \ No newline at end of file diff --git a/native-c-api/src/main/java/de/intarsys/nativec/type/StructMember.java b/native-c-api/src/main/java/de/intarsys/nativec/type/StructMember.java new file mode 100644 index 0000000..6b32457 --- /dev/null +++ b/native-c-api/src/main/java/de/intarsys/nativec/type/StructMember.java @@ -0,0 +1,339 @@ +/* + * Copyright (c) 2008, intarsys consulting GmbH + * + * 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 intarsys 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 OWNER 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. + */ +package de.intarsys.nativec.type; + +import de.intarsys.nativec.api.INativeHandle; + +/** + * A field definition within a {@link NativeStructType}. + */ +public class StructMember { + + /** + * The members name + */ + protected final String name; + /** + * the index of the member within the struct + */ + protected final int index; + /** + * the members declaration + */ + private final INativeType memberType; + /** + * The offset of the declaration within its structure + */ + private final int offset; + + /** + * the definition context of the member + */ + private final NativeStructType structType; + + /** + * Create a slot with name "name" and the declaration "memberDeclaration" + */ + protected StructMember(NativeStructType structType, String name, int index, + INativeType memberType, int offset) { + super(); + this.structType = structType; + this.name = name; + this.index = index; + this.memberType = memberType; + this.offset = offset; + } + + /** + * Performance shortcut to access "byte" in the struct member. + * + * @param struct The container struct instance + * @param index The memory offset from the struct member base + * + * @return The byte at index within the memory range of struct + */ + public byte getByte(NativeStruct struct, int index) { + return struct.handle.getByte(offset + index); + } + + /** + * Performance shortcut to access "byte[]" in the struct member. + * + * @param struct The container struct instance + * @param index The memory offset from the struct member base + * + * @return The byte array starting at index of length count within the + * memory range of struct + */ + public byte[] getByteArray(NativeStruct struct, int index, int count) { + return struct.handle.getByteArray(offset + index, count); + } + + /** + * Performance shortcut to access "platform sized long" in the struct + * member. + * + * @param struct The container struct instance + * @param index The memory offset from the struct member base + * + * @return The platform sized long at index within the memory range of + * struct + */ + public long getCLong(NativeStruct struct, int index) { + return struct.handle.getCLong(offset + index); + } + + /** + * Performance shortcut to access "int" in the struct member. + * + * @param struct The container struct instance + * @param index The memory offset from the struct member base + * + * @return The int at index within the memory range of struct + */ + public int getInt(NativeStruct struct, int index) { + return struct.handle.getInt(offset + index); + } + + /** + * Performance shortcut to access "long" in the struct member. + * + * @param struct The container struct instance + * @param index The memory offset from the struct member base + * + * @return The long at index within the memory range of struct + */ + public long getLong(NativeStruct struct, int index) { + return struct.handle.getLong(offset + index); + } + + /** + * The type declaration of the slot. + * + * @return The type declaration of the slot. + */ + protected INativeType getMemberType() { + return memberType; + } + + /** + * The slots name. + * + * @return The slots name. + */ + public String getName() { + return name; + } + + /** + * Performance shortcut to access "INativeHandle" in the struct member. + * + * @param struct The container struct instance + * @param index The memory offset from the struct member base + * + * @return The INativeHandle at index within the memory range of struct + */ + public INativeHandle getNativeHandle(NativeStruct struct, int index) { + return struct.handle.getNativeHandle(offset + index); + } + + synchronized public INativeObject getNativeObject(NativeStruct struct) { + if (struct.values == null) { + struct.values = new INativeObject[structType.getFieldsSize()]; + } + INativeObject result = struct.values[index]; + if (result == null) { + result = memberType.createNative(struct.getNativeHandle().offset( + offset)); + struct.values[this.index] = result; + } + return result; + } + + /** + * The offset of the slot relative to the StructDeclaration. + * + * @return The offset of the slot relative to the StructDeclaration. + */ + protected int getOffset() { + return offset; + } + + /** + * Performance shortcut to access "short" in the struct member. + * + * @param struct The container struct instance + * @param index The memory offset from the struct member base + * + * @return The short at index within the memory range of struct + */ + public short getShort(NativeStruct struct, int index) { + return struct.handle.getShort(offset + index); + } + + /** + * Performance shortcut to access "String" in the struct member. + * + * @param struct The container struct instance + * @param index The memory offset from the struct member base + * + * @return The String at index within the memory range of struct + */ + public String getString(NativeStruct struct, int index) { + return struct.handle.getString(offset + index); + } + + public Object getValue(NativeStruct struct) { + return getNativeObject(struct).getValue(); + } + + /** + * Performance shortcut to access "String" (from wide characters) in the + * struct member. + * + * @param struct The container struct instance + * @param index The memory offset from the struct member base + * + * @return The wide character String at index within the memory range of + * struct + */ + public String getWideString(NativeStruct struct, int index) { + return struct.handle.getWideString(offset + index); + } + + /** + * Performance shortcut to access "byte" in the struct member. + * + * @param struct The container struct instance + * @param index The memory offset from the struct member base + */ + public void setByte(NativeStruct struct, int index, byte value) { + struct.handle.setByte(offset + index, value); + } + + /** + * Performance shortcut to access "byte[]" in the struct member. + * + * @param struct The container struct instance + * @param index The memory offset from the struct member base + */ + public void setByteArray(NativeStruct struct, int index, byte[] value, + int valueOffset, int valueCount) { + struct.handle.setByteArray(offset + index, value, valueOffset, + valueCount); + } + + /** + * Performance shortcut to access "platform sized long" in the struct + * member. + * + * @param struct The container struct instance + * @param index The memory offset from the struct member base + */ + public void setCLong(NativeStruct struct, int index, long value) { + struct.handle.setCLong(offset + index, value); + } + + /** + * Performance shortcut to access "int" in the struct member. + * + * @param struct The container struct instance + * @param index The memory offset from the struct member base + */ + public void setInt(NativeStruct struct, int index, int value) { + struct.handle.setInt(offset + index, value); + } + + /** + * Performance shortcut to access "long" in the struct member. + * + * @param struct The container struct instance + * @param index The memory offset from the struct member base + */ + public void setLong(NativeStruct struct, int index, long value) { + struct.handle.setLong(offset + index, value); + } + + /** + * Performance shortcut to access "INativeHandle" in the struct member. + * + * @param struct The container struct instance + * @param index The memory offset from the struct member base + */ + public void setNativeHandle(NativeStruct struct, int index, + INativeHandle value) { + struct.handle.setNativeHandle(offset + index, value); + } + + /** + * Performance shortcut to access "short" in the struct member. + * + * @param struct The container struct instance + * @param index The memory offset from the struct member base + */ + public void setShort(NativeStruct struct, int index, short value) { + struct.handle.setShort(offset + index, value); + } + + /** + * Performance shortcut to access "String" in the struct member. + * + * @param struct The container struct instance + * @param index The memory offset from the struct member base + */ + public void setString(NativeStruct struct, int index, String value) { + struct.handle.setString(offset + index, value); + } + + public void setValue(NativeStruct struct, Object value) { + getNativeObject(struct).setValue(value); + } + + /** + * Performance shortcut to access "String" (from wide characters) in the + * struct member. + * + * @param struct The container struct instance + * @param index The memory offset from the struct member base + */ + public void setWideString(NativeStruct struct, int index, String value) { + struct.handle.setWideString(offset + index, value); + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "[" + getName() + "]"; + } +} diff --git a/src/de/intarsys/nativec/type/package.html b/native-c-api/src/main/java/de/intarsys/nativec/type/package.html similarity index 100% rename from src/de/intarsys/nativec/type/package.html rename to native-c-api/src/main/java/de/intarsys/nativec/type/package.html diff --git a/native-c-jna-impl/pom.xml b/native-c-jna-impl/pom.xml new file mode 100644 index 0000000..5b2243f --- /dev/null +++ b/native-c-jna-impl/pom.xml @@ -0,0 +1,37 @@ + + + 4.0.0 + + + de.intarsys.opensource + native-c-parent + 1.0.0-SNAPSHOT + + + de.intarsys.opensource + native-c-jna-impl + 1.0.0-SNAPSHOT + jar + + + UTF-8 + + + + + de.intarsys.opensource + native-c-api + 1.0 + + + + net.java.dev.jna + jna + 4.2.2 + + + + + diff --git a/src/de/intarsys/nativec/Opaque.java b/native-c-jna-impl/src/main/java/de/intarsys/nativec/Opaque.java similarity index 64% rename from src/de/intarsys/nativec/Opaque.java rename to native-c-jna-impl/src/main/java/de/intarsys/nativec/Opaque.java index 22b0265..0a0e921 100644 --- a/src/de/intarsys/nativec/Opaque.java +++ b/native-c-jna-impl/src/main/java/de/intarsys/nativec/Opaque.java @@ -4,8 +4,7 @@ public class Opaque extends PseudoObject { - public Opaque(NativeVoid nativeObject) { - super(nativeObject); - } - + public Opaque(NativeVoid nativeObject) { + super(nativeObject); + } } diff --git a/native-c-jna-impl/src/main/java/de/intarsys/nativec/PseudoObject.java b/native-c-jna-impl/src/main/java/de/intarsys/nativec/PseudoObject.java new file mode 100644 index 0000000..e9a9668 --- /dev/null +++ b/native-c-jna-impl/src/main/java/de/intarsys/nativec/PseudoObject.java @@ -0,0 +1,16 @@ +package de.intarsys.nativec; + +import de.intarsys.nativec.type.INativeObject; + +public class PseudoObject { + + private T nativeObject; + + public PseudoObject(T pNativeObject) { + nativeObject = pNativeObject; + } + + public T getNativeObject() { + return nativeObject; + } +} diff --git a/native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JNATools.java b/native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JNATools.java new file mode 100644 index 0000000..7c6d768 --- /dev/null +++ b/native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JNATools.java @@ -0,0 +1,13 @@ +package de.intarsys.nativec.jna; + +import com.sun.jna.Pointer; + +public class JNATools { + + public static long getPeer(Pointer p) { + if (p == null) { + return 0; + } + return Pointer.nativeValue(p); + } +} diff --git a/native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeCallback.java b/native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeCallback.java new file mode 100644 index 0000000..8335002 --- /dev/null +++ b/native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeCallback.java @@ -0,0 +1,125 @@ +/* + * Copyright (c) 2008, intarsys consulting GmbH + * + * 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 intarsys 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 OWNER 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. + */ +package de.intarsys.nativec.jna; + +import com.sun.jna.CallbackProxy; +import com.sun.jna.NativeLong; +import com.sun.jna.Pointer; +import com.sun.jna.WString; +import de.intarsys.nativec.api.CLong; +import de.intarsys.nativec.api.CWideString; +import de.intarsys.nativec.api.ICallback; +import de.intarsys.nativec.api.INativeCallback; +import de.intarsys.nativec.api.INativeHandle; +import de.intarsys.nativec.type.INativeType; +import de.intarsys.nativec.type.NativeObject; +import de.intarsys.nativec.type.NativeType; + +abstract public class JnaNativeCallback implements INativeCallback, + CallbackProxy { + + private ICallback callback; + + public JnaNativeCallback(ICallback pCallback) { + callback = pCallback; + } + + public static Class translateType(Class type) { + // TODO implement more elegant type translation + if (CWideString.class.isAssignableFrom(type)) { + return WString.class; + } else if (CLong.class.isAssignableFrom(type)) { + return NativeLong.class; + } else if (NativeObject.class.isAssignableFrom(type)) { + return Pointer.class; + } else if (INativeHandle.class.isAssignableFrom(type)) { + return Pointer.class; + } + return type; + } + + public Object callback(Object[] args) { + for (int index = 0; index < args.length; index++) { + Class parameterType; + Object object; + + parameterType = callback.getParameterTypes()[index]; + if (CWideString.class.isAssignableFrom(parameterType)) { + WString wstring = (WString) args[index]; + object = new CWideString(wstring.toString()); + } else if (CLong.class.isAssignableFrom(parameterType)) { + Number nativeNumber = (Number) args[index]; + object = new CLong(nativeNumber.longValue()); + } else if (NativeObject.class.isAssignableFrom(parameterType)) { + Pointer pointer = (Pointer) args[index]; + if (pointer == null) { + object = null; + } else { + INativeHandle handle = new JnaNativeHandle(pointer); + INativeType type = NativeType.lookup(parameterType); + if (type == null) { + throw new IllegalArgumentException("no type for '" + + parameterType + "'"); + } + object = type.createNative(handle); + } + } else if (INativeHandle.class.isAssignableFrom(parameterType)) { + Pointer pointer = (Pointer) args[index]; + if (pointer == null) { + object = null; + } else { + object = new JnaNativeHandle(pointer); + } + } else { + object = args[index]; + } + args[index] = object; + } + // TODO map return value too + return callback.invoke(args); + } + + public Class[] getParameterTypes() { + Class[] genericParameterTypes; + Class[] nativeParameterTypes; + + genericParameterTypes = callback.getParameterTypes(); + nativeParameterTypes = new Class[genericParameterTypes.length]; + + for (int index = 0; index < genericParameterTypes.length; index++) { + nativeParameterTypes[index] = translateType(genericParameterTypes[index]); + } + return nativeParameterTypes; + } + + public Class getReturnType() { + return translateType(callback.getReturnType()); + } +} diff --git a/src/de/intarsys/nativec/jna/JnaNativeCallbackAlt.java b/native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeCallbackAlt.java similarity index 54% rename from src/de/intarsys/nativec/jna/JnaNativeCallbackAlt.java rename to native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeCallbackAlt.java index a1a4cda..16a8e31 100644 --- a/src/de/intarsys/nativec/jna/JnaNativeCallbackAlt.java +++ b/native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeCallbackAlt.java @@ -1,14 +1,12 @@ package de.intarsys.nativec.jna; import com.sun.jna.AltCallingConvention; - import de.intarsys.nativec.api.ICallback; public class JnaNativeCallbackAlt extends JnaNativeCallback implements - AltCallingConvention { - - public JnaNativeCallbackAlt(ICallback pCallback) { - super(pCallback); - } + AltCallingConvention { + public JnaNativeCallbackAlt(ICallback pCallback) { + super(pCallback); + } } diff --git a/src/de/intarsys/nativec/jna/JnaNativeCallbackStd.java b/native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeCallbackStd.java similarity index 64% rename from src/de/intarsys/nativec/jna/JnaNativeCallbackStd.java rename to native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeCallbackStd.java index 34002da..7dfeff1 100644 --- a/src/de/intarsys/nativec/jna/JnaNativeCallbackStd.java +++ b/native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeCallbackStd.java @@ -4,8 +4,7 @@ public class JnaNativeCallbackStd extends JnaNativeCallback { - public JnaNativeCallbackStd(ICallback pCallback) { - super(pCallback); - } - + public JnaNativeCallbackStd(ICallback pCallback) { + super(pCallback); + } } diff --git a/native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeFunction.java b/native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeFunction.java new file mode 100644 index 0000000..70aa3dc --- /dev/null +++ b/native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeFunction.java @@ -0,0 +1,113 @@ +/* + * Copyright (c) 2008, intarsys consulting GmbH + * + * 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 intarsys 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 OWNER 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. + */ +package de.intarsys.nativec.jna; + +import com.sun.jna.Function; +import com.sun.jna.NativeLong; +import com.sun.jna.Pointer; +import com.sun.jna.WString; +import de.intarsys.nativec.api.CLong; +import de.intarsys.nativec.api.CWideString; +import de.intarsys.nativec.api.INativeFunction; +import de.intarsys.nativec.api.INativeHandle; +import de.intarsys.nativec.type.INativeObject; +import de.intarsys.nativec.type.INativeType; +import de.intarsys.nativec.type.NativeObject; +import de.intarsys.nativec.type.NativeType; + +public class JnaNativeFunction implements INativeFunction { + + private Function function; + + public JnaNativeFunction(Function function) { + this.function = function; + } + + protected Function getFunction() { + return function; + } + + public T invoke(Class returnType, Object... objects) { + for (int i = 0; i < objects.length; i++) { + Object object = objects[i]; + if (object instanceof INativeObject) { + JnaNativeHandle handle = (JnaNativeHandle) ((INativeObject) object) + .getNativeHandle(); + if (handle == null) { + objects[i] = null; + } else { + objects[i] = handle.getPointer(); + } + } else if (object instanceof INativeHandle) { + JnaNativeHandle handle = (JnaNativeHandle) object; + objects[i] = handle.getPointer(); + } else if (object instanceof CWideString) { + objects[i] = new WString(((CWideString) object).getString()); + } else if (object instanceof CLong) { + objects[i] = new NativeLong(((CLong) object).longValue()); + } + } + // if (Log.isLoggable(Level.FINE)) { + // Log.log(Level.FINE, "jna invoke " + function.getName()); + // } + T result; + if (CWideString.class.isAssignableFrom(returnType)) { + WString wstring = (WString) function.invoke(WString.class, objects); + result = (T) new CWideString(wstring.toString()); + } else if (CLong.class.isAssignableFrom(returnType)) { + NativeLong nativeLong = (NativeLong) function.invoke( + NativeLong.class, objects); + result = (T) new CLong(nativeLong.longValue()); + } else if (NativeObject.class.isAssignableFrom(returnType)) { + Pointer pointer = (Pointer) function.invoke(Pointer.class, objects); + if (pointer == null) { + result = null; + } else { + INativeHandle handle = new JnaNativeHandle(pointer); + INativeType type = NativeType.lookup(returnType); + if (type == null) { + throw new IllegalArgumentException("no type for '" + + returnType + "'"); + } + result = (T) type.createNative(handle); + } + } else if (INativeHandle.class.isAssignableFrom(returnType)) { + Pointer pointer = (Pointer) function.invoke(Pointer.class, objects); + if (pointer == null) { + result = null; + } else { + result = (T) new JnaNativeHandle(pointer); + } + } else { + result = (T) function.invoke(returnType, objects); + } + return result; + } +} diff --git a/native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeHandle.java b/native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeHandle.java new file mode 100644 index 0000000..252bd88 --- /dev/null +++ b/native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeHandle.java @@ -0,0 +1,210 @@ +/* + * Copyright (c) 2008, intarsys consulting GmbH + * + * 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 intarsys 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 OWNER 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. + */ +package de.intarsys.nativec.jna; + +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import de.intarsys.nativec.api.INativeHandle; + +public class JnaNativeHandle implements INativeHandle { + + final private Pointer pointer; + + private int size; + + public JnaNativeHandle(JnaNativeHandle handle, int offset) { + this.pointer = new Pointer(handle.getAddress() + offset); + this.size = handle.size - offset; + } + + public JnaNativeHandle(long address) { + this.pointer = new Pointer(address); + } + + public JnaNativeHandle(Pointer pointer) { + this.pointer = pointer; + } + + @Override + public boolean equals(Object obj) { + if (!(obj instanceof INativeHandle)) { + return false; + } + INativeHandle otherHandle = (INativeHandle) obj; + return JNATools.getPeer(pointer) == otherHandle.getAddress() + && size == otherHandle.getSize(); + } + + @Override + public long getAddress() { + return JNATools.getPeer(pointer); + } + + @Override + public byte getByte(int index) { + return pointer.getByte(index); + } + + @Override + public byte[] getByteArray(int index, int count) { + return pointer.getByteArray(index, count); + } + + @Override + public long getCLong(int index) { + if (Native.LONG_SIZE == 4) { + return pointer.getInt(index); + } + return pointer.getLong(index); + } + + @Override + public int getInt(int index) { + return pointer.getInt(index); + } + + @Override + public long getLong(int index) { + return pointer.getLong(index); + } + + @Override + public INativeHandle getNativeHandle(int index) { + Pointer tempPointer = pointer.getPointer(index); + if (tempPointer == null) { + // TODO can we reuse the existing "NULL" object? + return new JnaNativeHandle(0); + } + return new JnaNativeHandle(tempPointer); + } + + public Pointer getPointer() { + return pointer; + } + + @Override + public short getShort(int index) { + return pointer.getShort(index); + } + + @Override + public int getSize() { + return size; + } + + @Override + public void setSize(int pSize) { + this.size = pSize; + } + + @Override + public String getString(int index) { + // if (buffer == null) { + // return null; + // } + // // todo encoding + // buffer.position(offset + index); + // int i = 0; + // while (buffer.get() != 0) { + // i++; + // } + // buffer.position(offset + index); + // byte[] valueBytes = new byte[i]; + // buffer.get(valueBytes); + // return new String(valueBytes); + return getPointer().getString(index); + } + + @Override + public String getWideString(int index) { + return getPointer().getString(index, true); + } + + @Override + public int hashCode() { + return pointer.hashCode(); + } + + @Override + public INativeHandle offset(int offset) { + return new JnaNativeHandle(this, offset); + } + + @Override + public void setByte(int index, byte value) { + pointer.setByte(index, value); + } + + @Override + public void setByteArray(int index, byte[] value, int valueOffset, + int valueCount) { + pointer.write(index, value, valueOffset, valueCount); + } + + @Override + public void setCLong(int index, long value) { + if (Native.LONG_SIZE == 4) { + pointer.setInt(index, (int) value); + return; + } + pointer.setLong(index, value); + } + + @Override + public void setInt(int index, int value) { + pointer.setInt(index, value); + } + + @Override + public void setLong(int index, long value) { + pointer.setLong(index, value); + } + + @Override + public void setNativeHandle(int index, INativeHandle handle) { + pointer.setPointer(index, new Pointer(handle.getAddress())); + } + + @Override + public void setShort(int index, short value) { + pointer.setShort(index, value); + } + + @Override + public void setString(int index, String value) { + // // todo encoding + getPointer().setString(index, value); + } + + @Override + public void setWideString(int index, String value) { + getPointer().setString(index, value, true); + } +} diff --git a/native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeInterface.java b/native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeInterface.java new file mode 100644 index 0000000..538d232 --- /dev/null +++ b/native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeInterface.java @@ -0,0 +1,199 @@ +/* + * Copyright (c) 2008, intarsys consulting GmbH + * + * 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 intarsys 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 OWNER 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. + */ +package de.intarsys.nativec.jna; + +import java.lang.reflect.Constructor; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.sun.jna.Function; +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import de.intarsys.nativec.api.ICallback; +import de.intarsys.nativec.api.INativeCallback; +import de.intarsys.nativec.api.INativeFunction; +import de.intarsys.nativec.api.INativeHandle; +import de.intarsys.nativec.api.INativeInterface; +import de.intarsys.nativec.api.INativeLibrary; + +/** + * An {@link INativeInterface} implemented using JNA, a LGPL licensed Java + * native interface abstraction. + *

+ * In our point of view, JNA has the power of deploying all what we wanted to + * have, but is ill designed in some key hot spots - so we worked around and + * built on top of our own interfaces. + */ +public class JnaNativeInterface implements INativeInterface { + + private static Constructor pointerFactory; + + static { + /* + * Ugly hack - multithreaded loading caused a deadlock here as + * com.sun.jna.Native requests a native library which later requires a + * lock on the class loader, while another piece of code + * (Security.addProvider) first locks the class loader and later on + * requests the runtime to load a native library.

We try here to + * provide the same ordering (which is based on a lot of assumptions...) + */ + ClassLoader loader = JnaNativeInterface.class.getClassLoader(); + synchronized (loader) { + try { + Class.forName("com.sun.jna.Native", true, loader); + } catch (ClassNotFoundException e) { + throw new InternalError("can not load JNA"); + } + } + + /* + * Another hack. We *can* use a stripped down version of the Memory + * class if available. If not simply fallback... + */ + try { + Class clazz = Class.forName("com.sun.jna.FastMemory", true, loader); + pointerFactory = clazz.getConstructor(Integer.TYPE); + } catch (Exception e) { + try { + pointerFactory = Memory.class.getConstructor(Long.TYPE); + } catch (Exception e1) { + throw new InternalError("can not load JNA"); + } + } + } + + private List searchPaths = new ArrayList(); + + @Override + public void addSearchPath(String path) { + if (searchPaths.contains(path)) { + return; + } + searchPaths.add(path); + } + + @Override + public INativeHandle allocate(int size) { + return new JnaNativeHandle(createMemory(size)); + } + + @Override + public INativeCallback createCallback(ICallback callback) { + if (callback == null) { + return null; + } + if (callback.getCallingConvention() == INativeFunction.CallingConventionStdcall) { + return new JnaNativeCallbackAlt(callback); + } + if (callback.getCallingConvention() == INativeFunction.CallingConventionCdecl) { + return new JnaNativeCallbackStd(callback); + } + throw new IllegalArgumentException("illegal calling convention"); + } + + @Override + public INativeFunction createFunction(long address) { + return createFunction(address, INativeFunction.CallingConventionCdecl); + } + + @Override + public INativeFunction createFunction(long address, Object callingConvention) { + int callFlags; + if (callingConvention == INativeFunction.CallingConventionCdecl) { + callFlags = Function.C_CONVENTION; + } else if (callingConvention == INativeFunction.CallingConventionStdcall) { + callFlags = Function.ALT_CONVENTION; + } else { + throw new IllegalArgumentException("illegal calling convention"); + } + Pointer pointer = new Pointer(address); + Function function = Function.getFunction(pointer, callFlags); + return new JnaNativeFunction(function); + } + + @Override + public INativeHandle createHandle(long address) { + return new JnaNativeHandle(address); + } + + @Override + public INativeLibrary createLibrary(String name) { + return createLibrary(name, INativeFunction.CallingConventionCdecl); + } + + @Override + public INativeLibrary createLibrary(String name, Object callingConvention) { + Map options = new HashMap<>(2); + if (callingConvention == INativeFunction.CallingConventionCdecl) { + options.put(Library.OPTION_CALLING_CONVENTION, + Function.C_CONVENTION); + } else if (callingConvention == INativeFunction.CallingConventionStdcall) { + options.put(Library.OPTION_CALLING_CONVENTION, + Function.ALT_CONVENTION); + } else { + throw new IllegalArgumentException("illegal calling convention"); + } + options.put(Library.OPTION_OPEN_FLAGS, -1); + return new JnaNativeLibrary(this, name, options); + } + + protected Pointer createMemory(int size) { + try { + Pointer p = pointerFactory.newInstance(size); + p.clear(size); + return p; + } catch (Exception e) { + throw new InternalError("can not create Pointer"); + } + } + + protected List getSearchPaths() { + return searchPaths; + } + + @Override + public int longSize() { + return Native.LONG_SIZE; + } + + @Override + public int pointerSize() { + return Native.POINTER_SIZE; + } + + @Override + public int wideCharSize() { + return 2; + } +} diff --git a/src/de/intarsys/nativec/jna/JnaNativeLibrary.java b/native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeLibrary.java similarity index 63% rename from src/de/intarsys/nativec/jna/JnaNativeLibrary.java rename to native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeLibrary.java index eb9def7..23fa3ff 100644 --- a/src/de/intarsys/nativec/jna/JnaNativeLibrary.java +++ b/native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeLibrary.java @@ -35,48 +35,46 @@ import com.sun.jna.Function; import com.sun.jna.NativeLibrary; import com.sun.jna.Pointer; - import de.intarsys.nativec.api.INativeFunction; import de.intarsys.nativec.api.INativeHandle; import de.intarsys.nativec.api.INativeLibrary; public class JnaNativeLibrary implements INativeLibrary { - final private NativeLibrary library; - - final private JnaNativeInterface nativeInterface; + final private NativeLibrary library; - public JnaNativeLibrary(JnaNativeInterface nativeInterface, String name, - Map options) { - this.nativeInterface = nativeInterface; - // this is a kludge - but i can't ask for the searchpaths already - // registered - for (Iterator it = nativeInterface.getSearchPaths().iterator(); it - .hasNext();) { - String path = it.next(); - NativeLibrary.addSearchPath(name, path); - } - library = NativeLibrary.getInstance(name, options); - } + final private JnaNativeInterface nativeInterface; - @Override - public INativeFunction getFunction(String name) { - Function function = getLibrary().getFunction(name); - return new JnaNativeFunction(function); - } + public JnaNativeLibrary(JnaNativeInterface nativeInterface, String name, + Map options) { + this.nativeInterface = nativeInterface; + // this is a kludge - but i can't ask for the searchpaths already + // registered + for (Iterator it = nativeInterface.getSearchPaths().iterator(); it + .hasNext(); ) { + String path = it.next(); + NativeLibrary.addSearchPath(name, path); + } + library = NativeLibrary.getInstance(name, options); + } - @Override - public INativeHandle getGlobal(String symbolName) { - Pointer pointer = getLibrary().getGlobalVariableAddress(symbolName); - return new JnaNativeHandle(pointer); - } + @Override + public INativeFunction getFunction(String name) { + Function function = getLibrary().getFunction(name); + return new JnaNativeFunction(function); + } - protected NativeLibrary getLibrary() { - return library; - } + @Override + public INativeHandle getGlobal(String symbolName) { + Pointer pointer = getLibrary().getGlobalVariableAddress(symbolName); + return new JnaNativeHandle(pointer); + } - protected JnaNativeInterface getNativeInterface() { - return nativeInterface; - } + protected NativeLibrary getLibrary() { + return library; + } + protected JnaNativeInterface getNativeInterface() { + return nativeInterface; + } } diff --git a/resource/META-INF/services/de.intarsys.nativec.api.INativeInterface b/native-c-jna-impl/src/main/resources/META-INF/services/de.intarsys.nativec.api.INativeInterface similarity index 100% rename from resource/META-INF/services/de.intarsys.nativec.api.INativeInterface rename to native-c-jna-impl/src/main/resources/META-INF/services/de.intarsys.nativec.api.INativeInterface diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..3b1874f --- /dev/null +++ b/pom.xml @@ -0,0 +1,34 @@ + + + 4.0.0 + + de.intarsys.opensource + native-c-parent + 1.0.0-SNAPSHOT + pom + + + UTF-8 + + + + native-c-api + native-c-jna-impl + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.5.1 + + 11 + 11 + + + + + diff --git a/src/de/intarsys/nativec/PseudoObject.java b/src/de/intarsys/nativec/PseudoObject.java deleted file mode 100644 index 665391e..0000000 --- a/src/de/intarsys/nativec/PseudoObject.java +++ /dev/null @@ -1,17 +0,0 @@ -package de.intarsys.nativec; - -import de.intarsys.nativec.type.INativeObject; - -public class PseudoObject { - - private T nativeObject; - - public PseudoObject(T pNativeObject) { - nativeObject = pNativeObject; - } - - public T getNativeObject() { - return nativeObject; - } - -} diff --git a/src/de/intarsys/nativec/api/INativeHandle.java b/src/de/intarsys/nativec/api/INativeHandle.java deleted file mode 100644 index 7d7e391..0000000 --- a/src/de/intarsys/nativec/api/INativeHandle.java +++ /dev/null @@ -1,271 +0,0 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * - * 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 intarsys 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 OWNER 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. - */ -package de.intarsys.nativec.api; - -/** - * A "handle" to a piece of memory (in c space). - *

- * The handle combines an address and a memory chunk of a specified size. - */ -public interface INativeHandle { - - /** - * The start address of the memory chunk - * - * @return The start address of the memory chunk - */ - public long getAddress(); - - /** - * Marshal the data at byte offset index from the start of the - * memory chunk to a byte. - * - * @param index - * The byte offset from the start of the memory chunk - * @return A byte marshaled from the memory chunk - */ - public byte getByte(int index); - - /** - * Marshal the data at byte offset index from the start of the - * memory chunk to a byte array of length count. - * - * @param index - * The byte offset from the start of the memory chunk - * @param count - * The size of the byte array - * @return A byte array marshaled from the memory chunk - */ - public byte[] getByteArray(int index, int count); - - /** - * Marshal the data at byte offset index from the start of the - * memory chunk to a long. Get only the "platform" number of bytes. - * - * @param index - * The byte offset from the start of the memory chunk - * @return A long marshaled from the memory chunk - */ - public long getCLong(int index); - - /** - * Marshal the data at byte offset index from the start of the - * memory chunk to an int. - * - * @param index - * The byte offset from the start of the memory chunk - * @return An int marshaled from the memory chunk - */ - public int getInt(int index); - - /** - * Marshal the data at byte offset index from the start of the - * memory chunk to a long value (which is always 8 byte). - * - * @param index - * The byte offset from the start of the memory chunk - * @return A long marshaled from the memory chunk - */ - public long getLong(int index); - - /** - * Marshal the data at byte offset index from the start of the - * memory chunk to an {@link INativeHandle}. - * - * @param index - * The byte offset from the start of the memory chunk - * @return An {@link INativeHandle} marshaled from the memory chunk - */ - public INativeHandle getNativeHandle(int index); - - /** - * Marshal the data at byte offset index from the start of the - * memory chunk to a short. - * - * @param index - * The byte offset from the start of the memory chunk - * @return A short marshaled from the memory chunk - */ - public short getShort(int index); - - /** - * The size for the handle in bytes. - *

- * You can not access bytes from outside the range defined by getAdddress + - * size. - * - */ - public int getSize(); - - /** - * Marshal the data at byte offset index from the start of the - * memory chunk to a String. - * - * @param index - * The byte offset from the start of the memory chunk - * @return A String marshaled from the memory chunk - */ - public String getString(int index); - - /** - * Marshal the data at byte offset index from the start of the - * memory chunk to a String using the platform wide character conversion. - * - * @param index - * The byte offset from the start of the memory chunk - * @return A String marshaled from the memory chunk - */ - public String getWideString(int index); - - /** - * Create a new {@link INativeHandle}, offset from this by - * offset bytes. - * - * @param offset - * The byte offset from the start of the memory chunk - * @return A new {@link INativeHandle} pointing to "getAddress() + offset". - */ - public INativeHandle offset(int offset); - - /** - * Write a byte to the memory at byte offset index from the - * start of the memory chunk. - * - * @param index - * The byte offset from the start of the memory chunk - * @param value - * The value to write. - */ - public void setByte(int index, byte value); - - /** - * Write a byte array to the memory at byte offset index from - * the start of the memory chunk. The method will write - * valueCount bytes from value starting at - * valueOffset. - * - * @param index - * The byte offset from the start of the memory chunk - * @param value - * The value to write. - */ - public void setByteArray(int index, byte[] value, int valueOffset, - int valueCount); - - /** - * Write a long to the memory at byte offset index from the - * start of the memory chunk. Write only the "platform" number of bytes. The - * caller is responsible for observing the value range. - * - * @param index - * The byte offset from the start of the memory chunk - * @param value - * The value to write. - */ - public void setCLong(int index, long value); - - /** - * Write an int to the memory at byte offset index from the - * start of the memory chunk. - * - * @param index - * The byte offset from the start of the memory chunk - * @param value - * The value to write. - */ - public void setInt(int index, int value); - - /** - * Write a long to the memory at byte offset index from the - * start of the memory chunk. - * - * @param index - * The byte offset from the start of the memory chunk - * @param value - * The value to write. - */ - public void setLong(int index, long value); - - /** - * Write an {@link INativeHandle} to the memory at byte offset - * index from the start of the memory chunk. - * - * @param index - * The byte offset from the start of the memory chunk - * @param valueHandle - * The value to write. - */ - public void setNativeHandle(int index, INativeHandle valueHandle); - - /** - * Write a short to the memory at byte offset index from the - * start of the memory chunk. - * - * @param index - * The byte offset from the start of the memory chunk - * @param value - * The value to write. - */ - public void setShort(int index, short value); - - /** - * Set the valid size for the handle to count bytes. - *

- * You can not access bytes from outside the range defined by getAdddress + - * size. - * - * @param count - * The size of the memory managed by the {@link INativeHandle} - */ - public void setSize(int count); - - /** - * Write a String to the memory at byte offset indexfrom the - * start of the memory chunk. - * - * @param index - * The byte offset from the start of the memory chunk - * @param value - * The value to write. - */ - public void setString(int index, String value); - - /** - * Write a String to the memory at byte offset indexfrom the - * start of the memory chunk using the platform wide character conversion. - * - * @param index - * The byte offset from the start of the memory chunk - * @param value - * The value to write. - */ - public void setWideString(int index, String value); - -} diff --git a/src/de/intarsys/nativec/api/INativeInterface.java b/src/de/intarsys/nativec/api/INativeInterface.java deleted file mode 100644 index b803b4c..0000000 --- a/src/de/intarsys/nativec/api/INativeInterface.java +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * - * 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 intarsys 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 OWNER 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. - */ -package de.intarsys.nativec.api; - -/** - * The abstraction of a generic interface to c native code. - */ -public interface INativeInterface { - - /** - * Add a directory to the search path. - * - * @param path - * The path to be added; - */ - public void addSearchPath(String path); - - /** - * Allocate c memory and return the respective {@link INativeHandle}. - * - * @param size - * The size in bytes. - * @return The new allocated {@link INativeHandle} - */ - public INativeHandle allocate(int size); - - public INativeCallback createCallback(ICallback callback); - - /** - * Create an {@link INativeFunction} from a function pointer. - *

- * There is no special handling for the 0 address! - * - * @param address - * The function pointer. - * @return The function object. - */ - public INativeFunction createFunction(long address); - - public INativeFunction createFunction(long address, Object callingConvention); - - /** - * Create a void {@link INativeHandle} to a memory address. - *

- * There is no special handling for the 0 address! - * - * @param address - * The memory address. - * @return The handle to the memory address. - */ - public INativeHandle createHandle(long address); - - /** - * Load a new {@link INativeLibrary}. - * - * @param name - * The name of the library to load. - * @return The new {@link INativeLibrary} - */ - public INativeLibrary createLibrary(String name); - - /** - * Load a new {@link INativeLibrary}. - * - * @param name - * The name of the library to load. - * @param callingConvention - * The calling convention to use as default for functions in this - * library. - * @return The new {@link INativeLibrary} - */ - public INativeLibrary createLibrary(String name, Object callingConvention); - - /** - * The platform long size. - * - * @return The platform long size. - */ - public int longSize(); - - /** - * The platform pointer size. - * - * @return The platform pointer size. - */ - public int pointerSize(); - - /** - * The platform wide char size. - * - * @return The platform wide char size. - */ - public int wideCharSize(); - -} diff --git a/src/de/intarsys/nativec/api/NativeTools.java b/src/de/intarsys/nativec/api/NativeTools.java deleted file mode 100644 index 5ceffd5..0000000 --- a/src/de/intarsys/nativec/api/NativeTools.java +++ /dev/null @@ -1,202 +0,0 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * - * 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 intarsys 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 OWNER 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. - */ -package de.intarsys.nativec.api; - -import de.intarsys.nativec.type.INativeType; -import de.intarsys.nativec.type.NativeArray; -import de.intarsys.nativec.type.NativeArrayType; -import de.intarsys.nativec.type.NativeBuffer; -import de.intarsys.nativec.type.NativeBufferType; -import de.intarsys.nativec.type.NativeInt; -import de.intarsys.nativec.type.NativeLong; - -/** - * Tool class for for dealing with the native framework. - */ -public class NativeTools { - - public static byte[] fromNativeByteArray(long ptr, int count) { - INativeHandle handle; - INativeType type; - NativeBuffer nativeValue; - - if (ptr == 0) { - return null; - } - handle = NativeInterface.get().createHandle(ptr); - type = NativeBufferType.create(count); - nativeValue = (NativeBuffer) type.createNative(handle); - return nativeValue.getBytes(); - } - - public static long fromNativeCLong(long ptr) { - INativeHandle handle; - NativeLong nativeValue; - - handle = NativeInterface.get().createHandle(ptr); - nativeValue = (NativeLong) NativeLong.META.createNative(handle); - return nativeValue.intValue(); - } - - public static IValueHolder fromNativeCLongHolder(long ptr) { - return new ObjectValueHolder(fromNativeCLong(ptr)); - } - - public static int fromNativeInt(long ptr) { - INativeHandle handle; - NativeInt nativeValue; - - handle = NativeInterface.get().createHandle(ptr); - nativeValue = (NativeInt) NativeInt.META.createNative(handle); - return nativeValue.intValue(); - } - - public static int[] fromNativeIntArray(INativeHandle handle, int count) { - int[] ints; - int offset; - - ints = new int[count]; - offset = NativeInt.META.getByteCount(); - for (int index = 0; index < count; index++) { - ints[index] = handle.getInt(index * offset); - } - return ints; - } - - public static int[] fromNativeIntArray(long ptr, int count) { - INativeHandle handle; - - handle = NativeInterface.get().createHandle(ptr); - return fromNativeIntArray(handle, count); - } - - public static IValueHolder fromNativeIntHolder(long ptr) { - return new ObjectValueHolder(fromNativeInt(ptr)); - } - - public static String fromNativeString(long ptr, int count) { - return null; - } - - public static INativeHandle toHandle(long address) { - return NativeInterface.get().createHandle(address); - } - - public static void toNativeByteArray(long ptr, byte[] value) { - if (value != null) { - INativeHandle handle; - INativeType type; - NativeBuffer buffer; - - handle = NativeInterface.get().createHandle(ptr); - type = NativeBufferType.create(value.length); - buffer = (NativeBuffer) type.createNative(handle); - buffer.setValue(value); - } - } - - public static void toNativeCLong(long ptr, int[] value) { - if (value != null) { - INativeHandle handle; - NativeArrayType type; - NativeArray array; - - handle = NativeInterface.get().createHandle(ptr); - type = NativeArrayType.create(NativeLong.META, value.length); - array = (NativeArray) type.createNative(handle); - for (int index = 0; index < value.length; index++) { - array.setValue(index, value[index]); - } - } - } - - public static void toNativeCLong(long ptr, IValueHolder value) { - toNativeCLong(ptr, value.get().longValue()); - } - - public static void toNativeCLong(long ptr, long value) { - INativeHandle handle; - NativeLong nativeValue; - - handle = NativeInterface.get().createHandle(ptr); - nativeValue = (NativeLong) NativeLong.META.createNative(handle); - nativeValue.setValue(value); - } - - public static void toNativeCLong(long ptr, long[] value) { - if (value != null) { - INativeHandle handle; - NativeArrayType type; - NativeArray array; - - handle = NativeInterface.get().createHandle(ptr); - type = NativeArrayType.create(NativeLong.META, value.length); - array = (NativeArray) type.createNative(handle); - for (int index = 0; index < value.length; index++) { - array.setValue(index, value[index]); - } - } - } - - public static void toNativeInt(long ptr, int value) { - INativeHandle handle; - - handle = NativeInterface.get().createHandle(ptr); - handle.setSize(NativeInt.META.getByteCount()); - handle.setInt(0, value); - } - - public static void toNativeInt(long ptr, int[] value) { - if (value != null) { - INativeHandle handle; - NativeArrayType type; - NativeArray array; - - handle = NativeInterface.get().createHandle(ptr); - type = NativeArrayType.create(NativeInt.META, value.length); - array = (NativeArray) type.createNative(handle); - for (int index = 0; index < value.length; index++) { - array.setValue(index, value[index]); - } - } - } - - public static void toNativeInt(long ptr, IValueHolder value) { - toNativeInt(ptr, value.get()); - } - - public static void toNativePointer(long ptr, INativeHandle value) { - INativeHandle handle; - - handle = NativeInterface.get().createHandle(ptr); - handle.setNativeHandle(0, value); - } - -} diff --git a/src/de/intarsys/nativec/api/package.html b/src/de/intarsys/nativec/api/package.html deleted file mode 100644 index ef7284f..0000000 --- a/src/de/intarsys/nativec/api/package.html +++ /dev/null @@ -1,35 +0,0 @@ - - -This is the main package of the native c component. -

-Here we define the API's and the VM singleton access to native c. -

-The component itself was built, as we didn't (once again) find anything -around that satisfied our needs. We wanted: -

    -
  • Clean, layered design
  • -
  • Unrestricted access to all modeled objects and concepts.
  • -
  • Easy adaption and integration with other views. This means primarily unrestricted -access to pointers. There is no use in a native library if i can't bootstrap -with a simple address (in our point of view).
  • -
  • Clean design for c data structures (primitive, composites and references)
  • -
  • Exchangeable native implementation
  • -
  • Platform independence
  • -
- -So we created an API and a data structure component and mapped it to JNA, which has -great ideas (but in our opinion is to sealed off and has not well done on the -data structure side) and can serve as a good foundation. - -There are some topics we didn't care about yet - this means they may be working or may -not, its simply not tested. JNA brings a lot of basic features... - -
    -
  • Pointer size was not really an issue
  • -
  • We didn't care about byte order
  • -
- -64 bit implementation is under way. - - - \ No newline at end of file diff --git a/src/de/intarsys/nativec/jna/JNATools.java b/src/de/intarsys/nativec/jna/JNATools.java deleted file mode 100644 index 57fa5ff..0000000 --- a/src/de/intarsys/nativec/jna/JNATools.java +++ /dev/null @@ -1,14 +0,0 @@ -package de.intarsys.nativec.jna; - -import com.sun.jna.Pointer; - -public class JNATools { - - public static long getPeer(Pointer p) { - if (p == null) { - return 0; - } - return Pointer.nativeValue(p); - } - -} diff --git a/src/de/intarsys/nativec/jna/JnaNativeCallback.java b/src/de/intarsys/nativec/jna/JnaNativeCallback.java deleted file mode 100644 index 38770ca..0000000 --- a/src/de/intarsys/nativec/jna/JnaNativeCallback.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * - * 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 intarsys 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 OWNER 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. - */ -package de.intarsys.nativec.jna; - -import com.sun.jna.CallbackProxy; -import com.sun.jna.NativeLong; -import com.sun.jna.Pointer; -import com.sun.jna.WString; - -import de.intarsys.nativec.api.CLong; -import de.intarsys.nativec.api.CWideString; -import de.intarsys.nativec.api.ICallback; -import de.intarsys.nativec.api.INativeCallback; -import de.intarsys.nativec.api.INativeHandle; -import de.intarsys.nativec.type.INativeType; -import de.intarsys.nativec.type.NativeObject; -import de.intarsys.nativec.type.NativeType; - -abstract public class JnaNativeCallback implements INativeCallback, - CallbackProxy { - - public static Class translateType(Class type) { - // TODO implement more elegant type translation - if (CWideString.class.isAssignableFrom(type)) { - return WString.class; - } else if (CLong.class.isAssignableFrom(type)) { - return NativeLong.class; - } else if (NativeObject.class.isAssignableFrom(type)) { - return Pointer.class; - } else if (INativeHandle.class.isAssignableFrom(type)) { - return Pointer.class; - } - return type; - } - - private ICallback callback; - - public JnaNativeCallback(ICallback pCallback) { - callback = pCallback; - } - - public Object callback(Object[] args) { - for (int index = 0; index < args.length; index++) { - Class parameterType; - Object object; - - parameterType = callback.getParameterTypes()[index]; - if (CWideString.class.isAssignableFrom(parameterType)) { - WString wstring = (WString) args[index]; - object = new CWideString(wstring.toString()); - } else if (CLong.class.isAssignableFrom(parameterType)) { - Number nativeNumber = (Number) args[index]; - object = new CLong(nativeNumber.longValue()); - } else if (NativeObject.class.isAssignableFrom(parameterType)) { - Pointer pointer = (Pointer) args[index]; - if (pointer == null) { - object = null; - } else { - INativeHandle handle = new JnaNativeHandle(pointer); - INativeType type = NativeType.lookup(parameterType); - if (type == null) { - throw new IllegalArgumentException("no type for '" - + parameterType + "'"); - } - object = type.createNative(handle); - } - } else if (INativeHandle.class.isAssignableFrom(parameterType)) { - Pointer pointer = (Pointer) args[index]; - if (pointer == null) { - object = null; - } else { - object = new JnaNativeHandle(pointer); - } - } else { - object = args[index]; - } - args[index] = object; - } - // TODO map return value too - return callback.invoke(args); - } - - public Class[] getParameterTypes() { - Class[] genericParameterTypes; - Class[] nativeParameterTypes; - - genericParameterTypes = callback.getParameterTypes(); - nativeParameterTypes = new Class[genericParameterTypes.length]; - - for (int index = 0; index < genericParameterTypes.length; index++) { - nativeParameterTypes[index] = translateType(genericParameterTypes[index]); - } - return nativeParameterTypes; - } - - public Class getReturnType() { - return translateType(callback.getReturnType()); - } - -} diff --git a/src/de/intarsys/nativec/jna/JnaNativeFunction.java b/src/de/intarsys/nativec/jna/JnaNativeFunction.java deleted file mode 100644 index db3c867..0000000 --- a/src/de/intarsys/nativec/jna/JnaNativeFunction.java +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * - * 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 intarsys 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 OWNER 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. - */ -package de.intarsys.nativec.jna; - -import com.sun.jna.Function; -import com.sun.jna.NativeLong; -import com.sun.jna.Pointer; -import com.sun.jna.WString; - -import de.intarsys.nativec.api.CLong; -import de.intarsys.nativec.api.INativeFunction; -import de.intarsys.nativec.api.INativeHandle; -import de.intarsys.nativec.api.CWideString; -import de.intarsys.nativec.type.INativeObject; -import de.intarsys.nativec.type.INativeType; -import de.intarsys.nativec.type.NativeObject; -import de.intarsys.nativec.type.NativeType; - -public class JnaNativeFunction implements INativeFunction { - - private Function function; - - public JnaNativeFunction(Function function) { - this.function = function; - } - - protected Function getFunction() { - return function; - } - - public T invoke(Class returnType, Object... objects) { - for (int i = 0; i < objects.length; i++) { - Object object = objects[i]; - if (object instanceof INativeObject) { - JnaNativeHandle handle = (JnaNativeHandle) ((INativeObject) object) - .getNativeHandle(); - if (handle == null) { - objects[i] = null; - } else { - objects[i] = handle.getPointer(); - } - } else if (object instanceof INativeHandle) { - JnaNativeHandle handle = (JnaNativeHandle) object; - objects[i] = handle.getPointer(); - } else if (object instanceof CWideString) { - objects[i] = new WString(((CWideString) object).getString()); - } else if (object instanceof CLong) { - objects[i] = new NativeLong(((CLong) object).longValue()); - } - } - // if (Log.isLoggable(Level.FINE)) { - // Log.log(Level.FINE, "jna invoke " + function.getName()); - // } - T result; - if (CWideString.class.isAssignableFrom(returnType)) { - WString wstring = (WString) function.invoke(WString.class, objects); - result = (T) new CWideString(wstring.toString()); - } else if (CLong.class.isAssignableFrom(returnType)) { - NativeLong nativeLong = (NativeLong) function.invoke( - NativeLong.class, objects); - result = (T) new CLong(nativeLong.longValue()); - } else if (NativeObject.class.isAssignableFrom(returnType)) { - Pointer pointer = (Pointer) function.invoke(Pointer.class, objects); - if (pointer == null) { - result = null; - } else { - INativeHandle handle = new JnaNativeHandle(pointer); - INativeType type = NativeType.lookup(returnType); - if (type == null) { - throw new IllegalArgumentException("no type for '" - + returnType + "'"); - } - result = (T) type.createNative(handle); - } - } else if (INativeHandle.class.isAssignableFrom(returnType)) { - Pointer pointer = (Pointer) function.invoke(Pointer.class, objects); - if (pointer == null) { - result = null; - } else { - result = (T) new JnaNativeHandle(pointer); - } - } else { - result = (T) function.invoke(returnType, objects); - } - return result; - } -} diff --git a/src/de/intarsys/nativec/jna/JnaNativeHandle.java b/src/de/intarsys/nativec/jna/JnaNativeHandle.java deleted file mode 100644 index 5978c3b..0000000 --- a/src/de/intarsys/nativec/jna/JnaNativeHandle.java +++ /dev/null @@ -1,212 +0,0 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * - * 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 intarsys 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 OWNER 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. - */ -package de.intarsys.nativec.jna; - -import com.sun.jna.Native; -import com.sun.jna.Pointer; - -import de.intarsys.nativec.api.INativeHandle; - -public class JnaNativeHandle implements INativeHandle { - - final private Pointer pointer; - - private int size; - - public JnaNativeHandle(JnaNativeHandle handle, int offset) { - this.pointer = new Pointer(handle.getAddress() + offset); - this.size = handle.size - offset; - } - - public JnaNativeHandle(long address) { - this.pointer = new Pointer(address); - } - - public JnaNativeHandle(Pointer pointer) { - this.pointer = pointer; - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof INativeHandle)) { - return false; - } - INativeHandle otherHandle = (INativeHandle) obj; - return JNATools.getPeer(pointer) == otherHandle.getAddress() - && size == otherHandle.getSize(); - } - - @Override - public long getAddress() { - return JNATools.getPeer(pointer); - } - - @Override - public byte getByte(int index) { - return pointer.getByte(index); - } - - @Override - public byte[] getByteArray(int index, int count) { - return pointer.getByteArray(index, count); - } - - @Override - public long getCLong(int index) { - if (Native.LONG_SIZE == 4) { - return pointer.getInt(index); - } - return pointer.getLong(index); - } - - @Override - public int getInt(int index) { - return pointer.getInt(index); - } - - @Override - public long getLong(int index) { - return pointer.getLong(index); - } - - @Override - public INativeHandle getNativeHandle(int index) { - Pointer tempPointer = pointer.getPointer(index); - if (tempPointer == null) { - // TODO can we reuse the existing "NULL" object? - return new JnaNativeHandle(0); - } - return new JnaNativeHandle(tempPointer); - } - - public Pointer getPointer() { - return pointer; - } - - @Override - public short getShort(int index) { - return pointer.getShort(index); - } - - @Override - public int getSize() { - return size; - } - - @Override - public String getString(int index) { - // if (buffer == null) { - // return null; - // } - // // todo encoding - // buffer.position(offset + index); - // int i = 0; - // while (buffer.get() != 0) { - // i++; - // } - // buffer.position(offset + index); - // byte[] valueBytes = new byte[i]; - // buffer.get(valueBytes); - // return new String(valueBytes); - return getPointer().getString(index); - } - - @Override - public String getWideString(int index) { - return getPointer().getString(index, true); - } - - @Override - public int hashCode() { - return pointer.hashCode(); - } - - @Override - public INativeHandle offset(int offset) { - return new JnaNativeHandle(this, offset); - } - - @Override - public void setByte(int index, byte value) { - pointer.setByte(index, value); - } - - @Override - public void setByteArray(int index, byte[] value, int valueOffset, - int valueCount) { - pointer.write(index, value, valueOffset, valueCount); - } - - @Override - public void setCLong(int index, long value) { - if (Native.LONG_SIZE == 4) { - pointer.setInt(index, (int) value); - return; - } - pointer.setLong(index, value); - } - - @Override - public void setInt(int index, int value) { - pointer.setInt(index, value); - } - - @Override - public void setLong(int index, long value) { - pointer.setLong(index, value); - } - - @Override - public void setNativeHandle(int index, INativeHandle handle) { - pointer.setPointer(index, new Pointer(handle.getAddress())); - } - - @Override - public void setShort(int index, short value) { - pointer.setShort(index, value); - } - - @Override - public void setSize(int pSize) { - this.size = pSize; - } - - @Override - public void setString(int index, String value) { - // // todo encoding - getPointer().setString(index, value); - } - - @Override - public void setWideString(int index, String value) { - getPointer().setString(index, value, true); - } - -} diff --git a/src/de/intarsys/nativec/jna/JnaNativeInterface.java b/src/de/intarsys/nativec/jna/JnaNativeInterface.java deleted file mode 100644 index 3332b77..0000000 --- a/src/de/intarsys/nativec/jna/JnaNativeInterface.java +++ /dev/null @@ -1,203 +0,0 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * - * 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 intarsys 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 OWNER 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. - */ -package de.intarsys.nativec.jna; - -import java.lang.reflect.Constructor; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import com.sun.jna.Function; -import com.sun.jna.Library; -import com.sun.jna.Memory; -import com.sun.jna.Native; -import com.sun.jna.Pointer; -import com.sun.org.apache.xalan.internal.xsltc.compiler.util.InternalError; - -import de.intarsys.nativec.api.ICallback; -import de.intarsys.nativec.api.INativeCallback; -import de.intarsys.nativec.api.INativeFunction; -import de.intarsys.nativec.api.INativeHandle; -import de.intarsys.nativec.api.INativeInterface; -import de.intarsys.nativec.api.INativeLibrary; - -/** - * An {@link INativeInterface} implemented using JNA, a LGPL licensed Java - * native interface abstraction. - *

- * In our point of view, JNA has the power of deploying all what we wanted to - * have, but is ill designed in some key hot spots - so we worked around and - * built on top of our own interfaces. - * - */ -public class JnaNativeInterface implements INativeInterface { - - private static Constructor pointerFactory; - - static { - /* - * Ugly hack - multithreaded loading caused a deadlock here as - * com.sun.jna.Native requests a native library which later requires a - * lock on the class loader, while another piece of code - * (Security.addProvider) first locks the class loader and later on - * requests the runtime to load a native library.

We try here to - * provide the same ordering (which is based on a lot of assumptions...) - */ - ClassLoader loader = JnaNativeInterface.class.getClassLoader(); - synchronized (loader) { - try { - Class.forName("com.sun.jna.Native", true, loader); - } catch (ClassNotFoundException e) { - throw new InternalError("can not load JNA"); - } - } - - /* - * Another hack. We *can* use a stripped down version of the Memory - * class if available. If not simply fallback... - */ - try { - Class clazz = Class.forName("com.sun.jna.FastMemory", true, loader); - pointerFactory = clazz.getConstructor(Integer.TYPE); - } catch (Exception e) { - try { - pointerFactory = Memory.class.getConstructor(Long.TYPE); - } catch (Exception e1) { - throw new InternalError("can not load JNA"); - } - } - } - - private List searchPaths = new ArrayList(); - - @Override - public void addSearchPath(String path) { - if (searchPaths.contains(path)) { - return; - } - searchPaths.add(path); - } - - @Override - public INativeHandle allocate(int size) { - return new JnaNativeHandle(createMemory(size)); - } - - @Override - public INativeCallback createCallback(ICallback callback) { - if (callback == null) { - return null; - } - if (callback.getCallingConvention() == INativeFunction.CallingConventionStdcall) { - return new JnaNativeCallbackAlt(callback); - } - if (callback.getCallingConvention() == INativeFunction.CallingConventionCdecl) { - return new JnaNativeCallbackStd(callback); - } - throw new IllegalArgumentException("illegal calling convention"); - } - - @Override - public INativeFunction createFunction(long address) { - return createFunction(address, INativeFunction.CallingConventionCdecl); - } - - @Override - public INativeFunction createFunction(long address, Object callingConvention) { - int callFlags; - if (callingConvention == INativeFunction.CallingConventionCdecl) { - callFlags = Function.C_CONVENTION; - } else if (callingConvention == INativeFunction.CallingConventionStdcall) { - callFlags = Function.ALT_CONVENTION; - } else { - throw new IllegalArgumentException("illegal calling convention"); - } - Pointer pointer = new Pointer(address); - Function function = Function.getFunction(pointer, callFlags); - return new JnaNativeFunction(function); - } - - @Override - public INativeHandle createHandle(long address) { - return new JnaNativeHandle(address); - } - - @Override - public INativeLibrary createLibrary(String name) { - return createLibrary(name, INativeFunction.CallingConventionCdecl); - } - - @Override - public INativeLibrary createLibrary(String name, Object callingConvention) { - Map options = new HashMap<>(2); - if (callingConvention == INativeFunction.CallingConventionCdecl) { - options.put(Library.OPTION_CALLING_CONVENTION, - Function.C_CONVENTION); - } else if (callingConvention == INativeFunction.CallingConventionStdcall) { - options.put(Library.OPTION_CALLING_CONVENTION, - Function.ALT_CONVENTION); - } else { - throw new IllegalArgumentException("illegal calling convention"); - } - options.put(Library.OPTION_OPEN_FLAGS, -1); - return new JnaNativeLibrary(this, name, options); - } - - protected Pointer createMemory(int size) { - try { - Pointer p = pointerFactory.newInstance(size); - p.clear(size); - return p; - } catch (Exception e) { - throw new InternalError("can not create Pointer"); - } - } - - protected List getSearchPaths() { - return searchPaths; - } - - @Override - public int longSize() { - return Native.LONG_SIZE; - } - - @Override - public int pointerSize() { - return Native.POINTER_SIZE; - } - - @Override - public int wideCharSize() { - return 2; - } - -} diff --git a/src/de/intarsys/nativec/type/NativeArray.java b/src/de/intarsys/nativec/type/NativeArray.java deleted file mode 100644 index 56779a8..0000000 --- a/src/de/intarsys/nativec/type/NativeArray.java +++ /dev/null @@ -1,178 +0,0 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * - * 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 intarsys 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 OWNER 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. - */ -package de.intarsys.nativec.type; - -import de.intarsys.nativec.api.INativeHandle; - -/** - * An {@link INativeObject} that represents a homogeneous (this means of equal - * length and type) sequence of other {@link INativeObject} instances. - */ -public class NativeArray extends NativeObject { - - /** The meta class instance */ - public static final NativeArrayType META = new NativeArrayType( - NativeVoid.META, 0); - - static { - NativeType.register(NativeArray.class, META); - } - - public static NativeArray create(INativeType baseType, int size) { - NativeArrayType type = new NativeArrayType(baseType, size); - return new NativeArray(type); - } - - private INativeObject[] values; - - private NativeArrayType type; - - protected NativeArray(NativeArrayType type) { - this.type = type; - allocate(); - } - - protected NativeArray(NativeArrayType type, INativeHandle handle) { - super(handle); - this.type = type; - } - - public INativeType getBaseType() { - return type.getBaseType(); - } - - @Override - public int getByteCount() { - return type.getByteCount(); - } - - /** - * The {@link INativeObject} at index in the sequence (the index'th element - * of the array). - * - * @param index - * The index of the element to be reported. - * - * @return The NativeObject at index - */ - synchronized public INativeObject getNativeObject(int index) { - if (values == null) { - values = new INativeObject[getSize()]; - } - INativeObject result = values[index]; - if (result == null) { - int elementOffset = index * type.getBaseSize(); - result = type.getBaseType().createNative( - handle.offset(elementOffset)); - values[index] = result; - } - return result; - } - - /* - * (non-Javadoc) - * - * @see de.intarsys.graphic.freetype.NativeObject#getMetaClass() - */ - @Override - public INativeType getNativeType() { - return type; - } - - /** - * The number of NativeObject instances in the sequence represented by this - * (in other terms the array size). - * - * @return The number of NativeObject instances in the sequence represented - * by this - */ - public int getSize() { - return type.getArraySize(); - } - - public Object getValue() { - throw new UnsupportedOperationException( - "getValue not implemented for NativeArray"); - } - - public Object getValue(int index) { - return getNativeObject(index).getValue(); - } - - public void setBaseType(INativeType baseType) { - type = NativeArrayType.create(baseType, type.getArraySize()); - this.values = null; - handle.setSize(getByteCount()); - } - - public void setSize(int size) { - type = NativeArrayType.create(type.getBaseType(), size); - this.values = null; - handle.setSize(getByteCount()); - } - - public void setValue(int index, Object value) { - getNativeObject(index).setValue(value); - } - - public void setValue(Object value) { - throw new UnsupportedOperationException( - "setValue not implemented for NativeArray"); - } - - /* - * (non-Javadoc) - * - * @see de.intarsys.graphic.freetype.NativeObject#toNestedString() - */ - @Override - public String toNestedString() { - return "[...]"; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#toString() - */ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("["); - for (int i = 0; i < getSize(); i++) { - // NativeObject element = get(i); - // sb.append(element.toString()); - // sb.append(", "); - } - sb.append("]"); - return sb.toString(); - } - -} diff --git a/src/de/intarsys/nativec/type/NativeFunction.java b/src/de/intarsys/nativec/type/NativeFunction.java deleted file mode 100644 index 862bbfe..0000000 --- a/src/de/intarsys/nativec/type/NativeFunction.java +++ /dev/null @@ -1,47 +0,0 @@ -package de.intarsys.nativec.type; - -import de.intarsys.nativec.api.INativeFunction; -import de.intarsys.nativec.api.INativeHandle; -import de.intarsys.nativec.api.NativeInterface; - -public class NativeFunction extends NativeVoid { - - public static class NativeFunctionType extends NativeVoidType { - - @Override - public INativeObject createNative(INativeHandle handle) { - return new NativeFunction(handle); - } - - } - - public static final NativeFunctionType META = new NativeFunctionType(); - - private Object callingConvention; - private INativeFunction function; - - protected NativeFunction(INativeHandle handle) { - super(handle); - callingConvention = INativeFunction.CallingConventionCdecl; - } - - public Object getCallingConvention() { - return callingConvention; - } - - public INativeFunction getFunction() { - // TODO do we want to check if handle has changed? - if (function == null) { - function = NativeInterface.get().createFunction( - getNativeHandle().getAddress(), callingConvention); - } - return function; - } - - public void setCallingConvention(Object callingConvention) { - if(function != null) { - throw new IllegalStateException(); - } - this.callingConvention = callingConvention; - } -} diff --git a/src/de/intarsys/nativec/type/NativeObject.java b/src/de/intarsys/nativec/type/NativeObject.java deleted file mode 100644 index 2e46c0e..0000000 --- a/src/de/intarsys/nativec/type/NativeObject.java +++ /dev/null @@ -1,290 +0,0 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * - * 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 intarsys 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 OWNER 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. - */ -package de.intarsys.nativec.type; - -import de.intarsys.nativec.api.INativeHandle; -import de.intarsys.nativec.api.NativeInterface; - -/** - * An instance of an external (C memory) represented object. The C-object is - * represented using the handle (the pointer to the object in C memory) and its - * type {@link INativeType}. - *

- * Supported data types are - *

    - *
  • primitive types (char, byte, int, short, long, String...)
  • - *
  • byte buffer
  • - *
  • array types
  • - *
  • structures
  • - *
  • references
  • - *
- *

- */ -public abstract class NativeObject implements INativeObject { - - public static final int SIZE_BYTE = 1; - - public static final int SIZE_INT = 4; - - public static final int SHIFT_INT = 2; - - public static final int SIZE_LONGLONG = 8; - - public static final int SHIFT_LONGLONG = 3; - - public static final int SIZE_LONG = NativeInterface.get().longSize(); - - public static final int SHIFT_LONG = SIZE_LONG == 4 ? 2 : 3; - - public static final int SIZE_PTR = NativeInterface.get().pointerSize(); - - public static final int SIZE_SHORT = 2; - - /** DEBUG flag */ - public static boolean DEBUG = true; - - /** - * The handle to the memory chunk used by this object. While in fact this is - * final, Java language semantics does not allow to declare so! - *

- * The handle should only be assigned in the constructor, via parameter or - * "allocate". - */ - protected INativeHandle handle; - - /** - * - */ - protected NativeObject() { - // - } - - /** - * Create a new NativeObject in C-Memory at pointer "handle". The bytes - * belonging to this object may already have been copied from C-Memory and - * made available in bytes at location offset. - * - * @param handle - * The pointer in C-memory - */ - protected NativeObject(INativeHandle handle) { - this.handle = handle; - } - - /** - * Manage the objects memory in Java. C memory will be valid at least as - * long as we hold a reference to the buffer. C memory is undefined (but not - * a memory leak) and may be reclaimed at any time after dropping our - * pointer to the buffer. - */ - protected void allocate() { - int size = getByteCount(); - handle = NativeInterface.get().allocate(size); - } - - /** - * This is a special form of the "createNative" signature, implementing a - * "type cast" on the same memory location. - * - * @param declaration - * The new base declaration type. - * @return The {@link INativeObject} at the same memory location as this, - * but of a different type. - */ - public INativeObject cast(INativeType declaration) { - return declaration.createNative(handle); - } - - public INativeObject createReference() { - NativeReference ref = NativeReference.create(getNativeType()); - ref.setValue(this); - return ref; - } - - /** - * The byte at index as a byte. - * - * @param index - * The index of the element to be reported. - * @return The element at index as a native byte. - */ - public byte getByte(int index) { - return handle.getByte(index); - } - - /** - * The element at index as an array of bytes with dimension count. This is a - * lightweight optimization. - * - * @param index - * The index of the element to be reported. - * @return The element at index as an array of native byte with dimension - * count. - */ - public byte[] getByteArray(int index, int count) { - return handle.getByteArray(index, count); - } - - /** - * The number of bytes occupied by this. - * - * @return The number of bytes occupied by this. - */ - public abstract int getByteCount(); - - /** - * The bytes copied from C-memory that represent this. - * - * @return The bytes copied from C-memory that represent this. - */ - public byte[] getBytes() { - return handle.getByteArray(0, getByteCount()); - } - - /** - * The element at index as a native long. Only the "platform" number of - * bytes are read. - * - * @param index - * The index of the element to be reported. - * @return The element at index as a native long. - */ - public long getCLong(int index) { - return handle.getCLong(index); - } - - /** - * The element at index as a native int. - * - * @param index - * The index of the element to be reported. - * @return The element at index as a native int. - */ - public int getInt(int index) { - return handle.getInt(index); - } - - /** - * The C-Pointer where the associated memory is found. - * - * @return The C-Pointer where the associated memory is found. - */ - public INativeHandle getNativeHandle() { - return handle; - } - - public INativeHandle getNativeHandle(int index) { - return handle.getNativeHandle(index); - } - - /** - * The meta information and behavior for the NativeObject. - *

- * There is exactly one meta instance for all NativeObject instances of a - * certain type. - * - * @return The meta information and behavior for the NativeObject. - * - */ - abstract public INativeType getNativeType(); - - /** - * The element at index as a native short. This is a lightweight - * optimization. - * - * @param index - * The index of the element to be reported. - * @return The element at index as a native short. - */ - public short getShort(int index) { - return handle.getShort(index); - } - - public String getString(int index) { - return handle.getString(index); - } - - public String getWideString(int index) { - return handle.getWideString(index); - } - - /** - * Answer true if this is "null". This means the associated - * C-pointer is pointing to 0. - * - * @return Answer true if this is "null". - */ - public boolean isNull() { - return handle == null || handle.getAddress() == 0; - } - - public void setByte(int index, byte value) { - handle.setByte(index, value); - } - - public void setByteArray(int index, byte[] value, int valueOffset, - int valueCount) { - handle.setByteArray(index, value, valueOffset, valueCount); - } - - public void setCLong(int index, long value) { - handle.setCLong(index, value); - } - - public void setInt(int index, int value) { - handle.setInt(index, value); - } - - public void setNativeHandle(int index, INativeHandle value) { - handle.setNativeHandle(index, value); - } - - public void setShort(int index, short value) { - handle.setShort(index, value); - } - - public void setString(int index, String value) { - handle.setString(index, value); - } - - public void setWideString(int index, String value) { - handle.setWideString(index, value); - } - - /** - * A string for debugging purposes. - * - * @return A string for debugging purposes. - */ - public String toNestedString() { - return toString(); - } - -} \ No newline at end of file diff --git a/src/de/intarsys/nativec/type/NativeReference.java b/src/de/intarsys/nativec/type/NativeReference.java deleted file mode 100644 index 7460bc2..0000000 --- a/src/de/intarsys/nativec/type/NativeReference.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * - * 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 intarsys 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 OWNER 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. - */ -package de.intarsys.nativec.type; - -import de.intarsys.nativec.api.INativeHandle; -import de.intarsys.nativec.api.NativeInterface; - -/** - * An object representing a reference to another object ("pointer"). - */ -public class NativeReference extends NativeObject { - - /** The meta class instance */ - public static final NativeReferenceType META = new NativeReferenceType( - NativeVoid.META); - - static { - NativeType.register(NativeReference.class, META); - } - - public static NativeReference create( - INativeType baseType) { - NativeReferenceType type = new NativeReferenceType(baseType); - return new NativeReference(type); - } - - private INativeHandle dereferenceHandle; - - private T dereferenced; - - private NativeReferenceType type; - - protected NativeReference(NativeReferenceType type) { - this.type = type; - allocate(); - } - - protected NativeReference(NativeReferenceType type, INativeHandle handle) { - super(handle); - this.type = type; - handle.setSize(getByteCount()); - } - - public INativeType getBaseType() { - return type.getBaseType(); - } - - @Override - public int getByteCount() { - return NativeInterface.get().pointerSize(); - } - - @Override - public INativeType getNativeType() { - return type; - } - - public long getReferencedAddress() { - return getNativeHandle(0).getAddress(); - } - - synchronized public T getValue() { - dereferenceHandle = handle.getNativeHandle(0); - // check if not yet computed or handle changed - if (dereferenced == null - || !dereferenced.getNativeHandle().equals(dereferenceHandle)) { - dereferenced = (T) type.getBaseType().createNative( - dereferenceHandle); - } - return dereferenced; - } - - public void setBaseType(INativeType baseType) { - type = NativeReferenceType.create(baseType); - dereferenceHandle = null; - dereferenced = null; - } - - synchronized public void setValue(Object value) { - if (value instanceof INativeObject) { - T nativeObject = (T) value; - INativeHandle valueHandle = nativeObject.getNativeHandle(); - handle.setNativeHandle(0, valueHandle); - dereferenceHandle = valueHandle; - dereferenced = nativeObject; - } else if (value instanceof INativeHandle) { - INativeHandle valueHandle = (INativeHandle) value; - handle.setNativeHandle(0, valueHandle); - dereferenceHandle = valueHandle; - dereferenced = null; - } else { - throw new IllegalArgumentException(); - } - } - - @Override - public String toString() { - if (handle == null) { - return "Ref to null"; - } - return "Ref to " + getReferencedAddress(); - } - -} diff --git a/src/de/intarsys/nativec/type/NativeStruct.java b/src/de/intarsys/nativec/type/NativeStruct.java deleted file mode 100644 index 7e668c8..0000000 --- a/src/de/intarsys/nativec/type/NativeStruct.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * - * 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 intarsys 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 OWNER 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. - */ -package de.intarsys.nativec.type; - -import java.util.Iterator; - -import de.intarsys.nativec.api.INativeHandle; - -/** - * An abstract superclass for the implementation of structured - * {@link NativeObject} instances. These objects are built using named slots - * with other {@link INativeObject} instances (as opposed to {@link NativeArray}, - * using indexed slots). - * - */ -public abstract class NativeStruct extends NativeObject { - - /** The meta class instance */ - public static final NativeStructType META = new NativeStructType(); - - static { - NativeType.register(NativeGenericStruct.class, META); - } - - protected INativeObject[] values; - - public NativeStruct() { - super(); - } - - public NativeStruct(INativeHandle handle) { - super(handle); - } - - @Override - public int getByteCount() { - return getNativeType().getByteCount(); - } - - /** - * The NativeObject at the named slot name. - *

- * The marshalling is delegated to the StructMember in the - * StructDeclaration. - * - * @param name - * The name of the slot in the structure. - * - * @return The NativeObject at the named slot name. - */ - public INativeObject getNativeObject(String name) { - return getStructType().getNativeObject(this, name); - } - - protected StructMember getStructField(String name) { - return getStructType().getField(name); - } - - public NativeStructType getStructType() { - return (NativeStructType) getNativeType(); - } - - public Object getValue() { - throw new UnsupportedOperationException( - "getValue not implemented for NativeStruct"); - } - - public void setValue(Object value) { - throw new UnsupportedOperationException( - "getValue not implemented for NativeStruct"); - } - - /* - * (non-Javadoc) - * - * @see de.intarsys.tools.nativec.NativeObject#toNestedString() - */ - @Override - public String toNestedString() { - return "Struct " + getClass().getName(); - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#toString() - */ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(getClass().getName()); - sb.append("\n"); - for (Iterator it = getStructType().getFields().iterator(); it.hasNext();) { - StructMember field = (StructMember) it.next(); - sb.append(field.getName()); - sb.append("="); - try { - sb.append(getNativeObject(field.getName()).toString()); - } catch (RuntimeException e) { - sb.append("**error**"); - } - sb.append("\n"); - } - return sb.toString(); - } -} diff --git a/src/de/intarsys/nativec/type/NativeStructType.java b/src/de/intarsys/nativec/type/NativeStructType.java deleted file mode 100644 index c48befe..0000000 --- a/src/de/intarsys/nativec/type/NativeStructType.java +++ /dev/null @@ -1,172 +0,0 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * - * 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 intarsys 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 OWNER 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. - */ -package de.intarsys.nativec.type; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import de.intarsys.nativec.api.NativeInterface; - -/** - * The meta class implementation - */ -public class NativeStructType extends NativeType { - - /** - * The boundary where the struct as a member of another struct would want to - * be aligned. - */ - private int byteBoundary = 1; - - /** - * The offset where theoretically a new member could be placed. Where it - * will actually be placed depends on the member itself. - */ - private int byteOffset = 0; - - /** The size in bytes of the member collection */ - private int byteSize = 0; - - /** The named members of the structure definition */ - private final Map fields = new HashMap(); - - /** - * The number of members in the structure - */ - private int fieldsSize = 0; - - /** Where members should be aligned in native memory */ - // expecting pointer size to be a reasonable default - have to look that up - private int packing = NativeInterface.get().pointerSize(); - - protected NativeStructType() { - super(); - } - - protected NativeStructType(Class instanceClass) { - super(instanceClass); - } - - /** - * Declare a new member for the struct. - * - * @param name - * The name of the new member slot. - * @param declaration - * The type declaration for the slot - */ - public StructMember declare(String name, INativeType declaration) { - int size; - int boundary; - - size = declaration.getByteCount(); - boundary = Math.min(declaration.getPreferredBoundary(), packing); - byteBoundary = Math.max(byteBoundary, boundary); - - byteOffset = byteOffset - ((byteOffset + boundary - 1) % boundary + 1) - + boundary; - StructMember field = new StructMember(this, name, fieldsSize++, - declaration, byteOffset); - fields.put(name, field); - byteOffset = byteOffset + size; - byteSize = byteOffset; - return field; - } - - public int getByteBoundary() { - return byteBoundary; - } - - @Override - public int getByteCount() { - return getByteSize(); - } - - /** - * The total size of the StructDeclaration. - * - * @return The total size of the StructDeclaration. - */ - public int getByteSize() { - return byteSize; - } - - public StructMember getField(String name) { - return fields.get(name); - } - - /** - * The collection of StructMember instances in declaration order. - * - * @return The collection of StructMember instances in declaration order. - */ - public List getFields() { - return new ArrayList(fields.values()); - } - - public int getFieldsSize() { - return fieldsSize; - } - - public INativeObject getNativeObject(NativeStruct struct, String name) { - StructMember member = fields.get(name); - return member.getNativeObject(struct); - } - - public int getPacking() { - return packing; - } - - @Override - public int getPreferredBoundary() { - return getByteBoundary(); - } - - public void setPacking(int pPacking) { - if (!fields.isEmpty()) { - throw new IllegalStateException( - "packing must be set before members are declared"); - } - packing = pPacking; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - for (StructMember field : getFields()) { - sb.append(field.toString()); - sb.append("\n"); - } - return sb.toString(); - } - -} \ No newline at end of file diff --git a/src/de/intarsys/nativec/type/StructMember.java b/src/de/intarsys/nativec/type/StructMember.java deleted file mode 100644 index f10965a..0000000 --- a/src/de/intarsys/nativec/type/StructMember.java +++ /dev/null @@ -1,359 +0,0 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * - * 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 intarsys 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 OWNER 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. - */ -package de.intarsys.nativec.type; - -import de.intarsys.nativec.api.INativeHandle; - -/** - * A field definition within a {@link NativeStructType}. - */ -public class StructMember { - - /** the members declaration */ - private final INativeType memberType; - - /** The members name */ - protected final String name; - - /** the index of the member within the struct */ - protected final int index; - - /** The offset of the declaration within its structure */ - private final int offset; - - /** the definition context of the member */ - private final NativeStructType structType; - - /** - * Create a slot with name "name" and the declaration "memberDeclaration" - */ - protected StructMember(NativeStructType structType, String name, int index, - INativeType memberType, int offset) { - super(); - this.structType = structType; - this.name = name; - this.index = index; - this.memberType = memberType; - this.offset = offset; - } - - /** - * Performance shortcut to access "byte" in the struct member. - * - * @param struct - * The container struct instance - * @param index - * The memory offset from the struct member base - * @return The byte at index within the memory range of struct - */ - public byte getByte(NativeStruct struct, int index) { - return struct.handle.getByte(offset + index); - } - - /** - * Performance shortcut to access "byte[]" in the struct member. - * - * @param struct - * The container struct instance - * @param index - * The memory offset from the struct member base - * @return The byte array starting at index of length count within the - * memory range of struct - */ - public byte[] getByteArray(NativeStruct struct, int index, int count) { - return struct.handle.getByteArray(offset + index, count); - } - - /** - * Performance shortcut to access "platform sized long" in the struct - * member. - * - * @param struct - * The container struct instance - * @param index - * The memory offset from the struct member base - * @return The platform sized long at index within the memory range of - * struct - */ - public long getCLong(NativeStruct struct, int index) { - return struct.handle.getCLong(offset + index); - } - - /** - * Performance shortcut to access "int" in the struct member. - * - * @param struct - * The container struct instance - * @param index - * The memory offset from the struct member base - * @return The int at index within the memory range of struct - */ - public int getInt(NativeStruct struct, int index) { - return struct.handle.getInt(offset + index); - } - - /** - * Performance shortcut to access "long" in the struct member. - * - * @param struct - * The container struct instance - * @param index - * The memory offset from the struct member base - * @return The long at index within the memory range of struct - */ - public long getLong(NativeStruct struct, int index) { - return struct.handle.getLong(offset + index); - } - - /** - * The type declaration of the slot. - * - * @return The type declaration of the slot. - */ - protected INativeType getMemberType() { - return memberType; - } - - /** - * The slots name. - * - * @return The slots name. - */ - public String getName() { - return name; - } - - /** - * Performance shortcut to access "INativeHandle" in the struct member. - * - * @param struct - * The container struct instance - * @param index - * The memory offset from the struct member base - * @return The INativeHandle at index within the memory range of struct - */ - public INativeHandle getNativeHandle(NativeStruct struct, int index) { - return struct.handle.getNativeHandle(offset + index); - } - - synchronized public INativeObject getNativeObject(NativeStruct struct) { - if (struct.values == null) { - struct.values = new INativeObject[structType.getFieldsSize()]; - } - INativeObject result = struct.values[index]; - if (result == null) { - result = memberType.createNative(struct.getNativeHandle().offset( - offset)); - struct.values[this.index] = result; - } - return result; - } - - /** - * The offset of the slot relative to the StructDeclaration. - * - * @return The offset of the slot relative to the StructDeclaration. - */ - protected int getOffset() { - return offset; - } - - /** - * Performance shortcut to access "short" in the struct member. - * - * @param struct - * The container struct instance - * @param index - * The memory offset from the struct member base - * @return The short at index within the memory range of struct - */ - public short getShort(NativeStruct struct, int index) { - return struct.handle.getShort(offset + index); - } - - /** - * Performance shortcut to access "String" in the struct member. - * - * @param struct - * The container struct instance - * @param index - * The memory offset from the struct member base - * @return The String at index within the memory range of struct - */ - public String getString(NativeStruct struct, int index) { - return struct.handle.getString(offset + index); - } - - public Object getValue(NativeStruct struct) { - return getNativeObject(struct).getValue(); - } - - /** - * Performance shortcut to access "String" (from wide characters) in the - * struct member. - * - * @param struct - * The container struct instance - * @param index - * The memory offset from the struct member base - * @return The wide character String at index within the memory range of - * struct - */ - public String getWideString(NativeStruct struct, int index) { - return struct.handle.getWideString(offset + index); - } - - /** - * Performance shortcut to access "byte" in the struct member. - * - * @param struct - * The container struct instance - * @param index - * The memory offset from the struct member base - */ - public void setByte(NativeStruct struct, int index, byte value) { - struct.handle.setByte(offset + index, value); - } - - /** - * Performance shortcut to access "byte[]" in the struct member. - * - * @param struct - * The container struct instance - * @param index - * The memory offset from the struct member base - */ - public void setByteArray(NativeStruct struct, int index, byte[] value, - int valueOffset, int valueCount) { - struct.handle.setByteArray(offset + index, value, valueOffset, - valueCount); - } - - /** - * Performance shortcut to access "platform sized long" in the struct - * member. - * - * @param struct - * The container struct instance - * @param index - * The memory offset from the struct member base - */ - public void setCLong(NativeStruct struct, int index, long value) { - struct.handle.setCLong(offset + index, value); - } - - /** - * Performance shortcut to access "int" in the struct member. - * - * @param struct - * The container struct instance - * @param index - * The memory offset from the struct member base - */ - public void setInt(NativeStruct struct, int index, int value) { - struct.handle.setInt(offset + index, value); - } - - /** - * Performance shortcut to access "long" in the struct member. - * - * @param struct - * The container struct instance - * @param index - * The memory offset from the struct member base - */ - public void setLong(NativeStruct struct, int index, long value) { - struct.handle.setLong(offset + index, value); - } - - /** - * Performance shortcut to access "INativeHandle" in the struct member. - * - * @param struct - * The container struct instance - * @param index - * The memory offset from the struct member base - */ - public void setNativeHandle(NativeStruct struct, int index, - INativeHandle value) { - struct.handle.setNativeHandle(offset + index, value); - } - - /** - * Performance shortcut to access "short" in the struct member. - * - * @param struct - * The container struct instance - * @param index - * The memory offset from the struct member base - */ - public void setShort(NativeStruct struct, int index, short value) { - struct.handle.setShort(offset + index, value); - } - - /** - * Performance shortcut to access "String" in the struct member. - * - * @param struct - * The container struct instance - * @param index - * The memory offset from the struct member base - */ - public void setString(NativeStruct struct, int index, String value) { - struct.handle.setString(offset + index, value); - } - - public void setValue(NativeStruct struct, Object value) { - getNativeObject(struct).setValue(value); - } - - /** - * Performance shortcut to access "String" (from wide characters) in the - * struct member. - * - * @param struct - * The container struct instance - * @param index - * The memory offset from the struct member base - */ - public void setWideString(NativeStruct struct, int index, String value) { - struct.handle.setWideString(offset + index, value); - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#toString() - */ - @Override - public String toString() { - return "[" + getName() + "]"; - } -} From e49175e3383c92612815646f9c1e453b06959136 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lennart=20J=C3=B6relid?= Date: Sat, 28 May 2022 13:05:34 +0200 Subject: [PATCH 04/10] Upgraded JNA to latest release. --- native-c-jna-impl/pom.xml | 3 +-- .../java/de/intarsys/nativec/jna/JnaNativeCallback.java | 6 ++---- .../main/java/de/intarsys/nativec/jna/JnaNativeHandle.java | 4 ++-- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/native-c-jna-impl/pom.xml b/native-c-jna-impl/pom.xml index 5b2243f..fd80219 100644 --- a/native-c-jna-impl/pom.xml +++ b/native-c-jna-impl/pom.xml @@ -29,8 +29,7 @@ net.java.dev.jna jna - 4.2.2 - + 5.11.0 diff --git a/native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeCallback.java b/native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeCallback.java index 8335002..dc3c5a7 100644 --- a/native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeCallback.java +++ b/native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeCallback.java @@ -107,11 +107,9 @@ public Object callback(Object[] args) { } public Class[] getParameterTypes() { - Class[] genericParameterTypes; - Class[] nativeParameterTypes; - genericParameterTypes = callback.getParameterTypes(); - nativeParameterTypes = new Class[genericParameterTypes.length]; + Class[] genericParameterTypes = callback.getParameterTypes(); + Class[] nativeParameterTypes = new Class[genericParameterTypes.length]; for (int index = 0; index < genericParameterTypes.length; index++) { nativeParameterTypes[index] = translateType(genericParameterTypes[index]); diff --git a/native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeHandle.java b/native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeHandle.java index 252bd88..80f81a2 100644 --- a/native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeHandle.java +++ b/native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeHandle.java @@ -144,7 +144,7 @@ public String getString(int index) { @Override public String getWideString(int index) { - return getPointer().getString(index, true); + return getPointer().getWideString(index); } @Override @@ -205,6 +205,6 @@ public void setString(int index, String value) { @Override public void setWideString(int index, String value) { - getPointer().setString(index, value, true); + getPointer().setWideString(index, value); } } From 95783104cb9e0681ddbddfa7d58610e10893f526 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lennart=20J=C3=B6relid?= Date: Sat, 28 May 2022 13:07:26 +0200 Subject: [PATCH 05/10] Corrected version in internal dependency. --- native-c-jna-impl/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/native-c-jna-impl/pom.xml b/native-c-jna-impl/pom.xml index fd80219..0815733 100644 --- a/native-c-jna-impl/pom.xml +++ b/native-c-jna-impl/pom.xml @@ -23,7 +23,7 @@ de.intarsys.opensource native-c-api - 1.0 + 1.0.0-SNAPSHOT From 569e976fdd89f98e5b5dd50b31c448f13f24838a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lennart=20J=C3=B6relid?= Date: Sat, 28 May 2022 14:07:01 +0200 Subject: [PATCH 06/10] Added codestyle project holding the license. Tried to compile license structure according to the Intarsys original license. Will check if they can accept an APLv2 phrasing. --- nativec-codestyle/pom.xml | 28 +++++++++++++++++++ .../codestyle/license/intarsys/header.txt | 25 +++++++++++++++++ .../codestyle/license/intarsys/license.txt | 7 +---- .../intarsys/licenseDescriptionTemplate.ftl | 1 + .../codestyle/license/licenses.properties | 1 + 5 files changed, 56 insertions(+), 6 deletions(-) create mode 100644 nativec-codestyle/pom.xml create mode 100644 nativec-codestyle/src/main/resources/codestyle/license/intarsys/header.txt rename native-c-api/src/main/java/de/intarsys/nativec/api/INativeCallback.java => nativec-codestyle/src/main/resources/codestyle/license/intarsys/license.txt (91%) create mode 100644 nativec-codestyle/src/main/resources/codestyle/license/intarsys/licenseDescriptionTemplate.ftl create mode 100644 nativec-codestyle/src/main/resources/codestyle/license/licenses.properties diff --git a/nativec-codestyle/pom.xml b/nativec-codestyle/pom.xml new file mode 100644 index 0000000..42c97cf --- /dev/null +++ b/nativec-codestyle/pom.xml @@ -0,0 +1,28 @@ + + + 4.0.0 + + de.intarsys.opensource.nativec.codestyle + nativec-codestyle + 1.0.0-SNAPSHOT + jar + + + Intarsys Consulting GmbH + https://www.intarsys.de + + + 2013 + + + + Intarsys License + https://www.intarsys.de/licenses/intarsysSourceLicense.txt + repo + A business-friendly OSS license + + + + diff --git a/nativec-codestyle/src/main/resources/codestyle/license/intarsys/header.txt b/nativec-codestyle/src/main/resources/codestyle/license/intarsys/header.txt new file mode 100644 index 0000000..98f3f9c --- /dev/null +++ b/nativec-codestyle/src/main/resources/codestyle/license/intarsys/header.txt @@ -0,0 +1,25 @@ +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 intarsys 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 OWNER 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. \ No newline at end of file diff --git a/native-c-api/src/main/java/de/intarsys/nativec/api/INativeCallback.java b/nativec-codestyle/src/main/resources/codestyle/license/intarsys/license.txt similarity index 91% rename from native-c-api/src/main/java/de/intarsys/nativec/api/INativeCallback.java rename to nativec-codestyle/src/main/resources/codestyle/license/intarsys/license.txt index daa5e7d..b985ee6 100644 --- a/native-c-api/src/main/java/de/intarsys/nativec/api/INativeCallback.java +++ b/nativec-codestyle/src/main/resources/codestyle/license/intarsys/license.txt @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, intarsys consulting GmbH + * Copyright (c) 2013, intarsys consulting GmbH * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -27,8 +27,3 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -package de.intarsys.nativec.api; - -public interface INativeCallback { - // no methods -} diff --git a/nativec-codestyle/src/main/resources/codestyle/license/intarsys/licenseDescriptionTemplate.ftl b/nativec-codestyle/src/main/resources/codestyle/license/intarsys/licenseDescriptionTemplate.ftl new file mode 100644 index 0000000..09c32b7 --- /dev/null +++ b/nativec-codestyle/src/main/resources/codestyle/license/intarsys/licenseDescriptionTemplate.ftl @@ -0,0 +1 @@ +Nazgul Project: ${project.name} \ No newline at end of file diff --git a/nativec-codestyle/src/main/resources/codestyle/license/licenses.properties b/nativec-codestyle/src/main/resources/codestyle/license/licenses.properties new file mode 100644 index 0000000..2942b1d --- /dev/null +++ b/nativec-codestyle/src/main/resources/codestyle/license/licenses.properties @@ -0,0 +1 @@ +intarsys=Intarsys OpenSource License, based on Apache License version 2.0 \ No newline at end of file From 67a943f7653b3da2892f4b370e919eb98e303325 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lennart=20J=C3=B6relid?= Date: Sat, 28 May 2022 14:09:10 +0200 Subject: [PATCH 07/10] Added nativec codestyle and generated/validated license header. Started simplifying some code in the NativeTools.java --- .../java/de/intarsys/nativec/api/package.html | 36 ------ .../intarsys/nativec/type/NativeFunction.java | 44 ------- .../de/intarsys/nativec/type/package.html | 5 - nativec-api/pom.xml | 62 ++++++++++ .../java/de/intarsys/nativec/api/CLong.java | 78 +++++++++++++ .../de/intarsys/nativec/api/CWideString.java | 47 ++++++++ .../de/intarsys/nativec/api/ICallback.java | 51 +++++++++ .../intarsys/nativec/api/INativeCallback.java | 38 ++++++ .../intarsys/nativec/api/INativeFunction.java | 49 ++++++++ .../intarsys/nativec/api/INativeHandle.java | 24 ++-- .../nativec/api/INativeInterface.java | 22 ++-- .../intarsys/nativec/api/INativeLibrary.java | 54 +++++++++ .../de/intarsys/nativec/api/IValueHolder.java | 52 +++++++++ .../intarsys/nativec/api/NativeInterface.java | 61 +++++----- .../de/intarsys/nativec/api/NativeTools.java | 90 +++++++-------- .../nativec/api/ObjectValueHolder.java | 55 +++++++++ .../java/de/intarsys/nativec/api/package.html | 69 +++++++++++ .../intarsys/nativec/type/INativeObject.java | 73 ++++++++++++ .../de/intarsys/nativec/type/INativeType.java | 87 ++++++++++++++ .../type/NativeAbstractStringType.java | 73 ++++++++++++ .../de/intarsys/nativec/type/NativeArray.java | 23 ++-- .../nativec/type/NativeArrayType.java | 96 ++++++++++++++++ .../intarsys/nativec/type/NativeBuffer.java | 22 ++-- .../nativec/type/NativeBufferType.java | 78 +++++++++++++ .../de/intarsys/nativec/type/NativeByte.java | 22 ++-- .../intarsys/nativec/type/NativeByteType.java | 57 +++++++++ .../intarsys/nativec/type/NativeFunction.java | 77 +++++++++++++ .../nativec/type/NativeGenericStruct.java | 66 +++++++++++ .../de/intarsys/nativec/type/NativeInt.java | 23 ++-- .../intarsys/nativec/type/NativeIntType.java | 57 +++++++++ .../de/intarsys/nativec/type/NativeLong.java | 23 ++-- .../intarsys/nativec/type/NativeLongLP64.java | 24 ++-- .../nativec/type/NativeLongLP64Type.java | 79 +++++++++++++ .../intarsys/nativec/type/NativeLongType.java | 57 +++++++++ .../intarsys/nativec/type/NativeNumber.java | 76 ++++++++++++ .../nativec/type/NativeNumberType.java | 40 +++++++ .../intarsys/nativec/type/NativeObject.java | 36 ++---- .../nativec/type/NativeReference.java | 22 ++-- .../nativec/type/NativeReferenceType.java | 79 +++++++++++++ .../de/intarsys/nativec/type/NativeShort.java | 22 ++-- .../nativec/type/NativeShortType.java | 57 +++++++++ .../intarsys/nativec/type/NativeSimple.java | 59 ++++++++++ .../nativec/type/NativeSimpleType.java | 44 +++++++ .../nativec/type/NativeStaticStruct.java | 47 ++++++++ .../intarsys/nativec/type/NativeString.java | 22 ++-- .../nativec/type/NativeStringType.java | 64 +++++++++++ .../intarsys/nativec/type/NativeStruct.java | 25 ++-- .../nativec/type/NativeStructType.java | 24 ++-- .../de/intarsys/nativec/type/NativeType.java | 108 ++++++++++++++++++ .../de/intarsys/nativec/type/NativeVoid.java | 76 ++++++++++++ .../intarsys/nativec/type/NativeVoidType.java | 57 +++++++++ .../nativec/type/NativeWideString.java | 22 ++-- .../nativec/type/NativeWideStringType.java | 72 ++++++++++++ .../intarsys/nativec/type/StructMember.java | 22 ++-- .../de/intarsys/nativec/type/package.html | 38 ++++++ 55 files changed, 2422 insertions(+), 364 deletions(-) delete mode 100644 native-c-api/src/main/java/de/intarsys/nativec/api/package.html delete mode 100644 native-c-api/src/main/java/de/intarsys/nativec/type/NativeFunction.java delete mode 100644 native-c-api/src/main/java/de/intarsys/nativec/type/package.html create mode 100644 nativec-api/pom.xml create mode 100644 nativec-api/src/main/java/de/intarsys/nativec/api/CLong.java create mode 100644 nativec-api/src/main/java/de/intarsys/nativec/api/CWideString.java create mode 100644 nativec-api/src/main/java/de/intarsys/nativec/api/ICallback.java create mode 100644 nativec-api/src/main/java/de/intarsys/nativec/api/INativeCallback.java create mode 100644 nativec-api/src/main/java/de/intarsys/nativec/api/INativeFunction.java rename {native-c-api => nativec-api}/src/main/java/de/intarsys/nativec/api/INativeHandle.java (97%) rename {native-c-api => nativec-api}/src/main/java/de/intarsys/nativec/api/INativeInterface.java (96%) create mode 100644 nativec-api/src/main/java/de/intarsys/nativec/api/INativeLibrary.java create mode 100644 nativec-api/src/main/java/de/intarsys/nativec/api/IValueHolder.java rename {native-c-api => nativec-api}/src/main/java/de/intarsys/nativec/api/NativeInterface.java (73%) rename {native-c-api => nativec-api}/src/main/java/de/intarsys/nativec/api/NativeTools.java (76%) create mode 100644 nativec-api/src/main/java/de/intarsys/nativec/api/ObjectValueHolder.java create mode 100644 nativec-api/src/main/java/de/intarsys/nativec/api/package.html create mode 100644 nativec-api/src/main/java/de/intarsys/nativec/type/INativeObject.java create mode 100644 nativec-api/src/main/java/de/intarsys/nativec/type/INativeType.java create mode 100644 nativec-api/src/main/java/de/intarsys/nativec/type/NativeAbstractStringType.java rename {native-c-api => nativec-api}/src/main/java/de/intarsys/nativec/type/NativeArray.java (95%) create mode 100644 nativec-api/src/main/java/de/intarsys/nativec/type/NativeArrayType.java rename {native-c-api => nativec-api}/src/main/java/de/intarsys/nativec/type/NativeBuffer.java (96%) create mode 100644 nativec-api/src/main/java/de/intarsys/nativec/type/NativeBufferType.java rename {native-c-api => nativec-api}/src/main/java/de/intarsys/nativec/type/NativeByte.java (96%) create mode 100644 nativec-api/src/main/java/de/intarsys/nativec/type/NativeByteType.java create mode 100644 nativec-api/src/main/java/de/intarsys/nativec/type/NativeFunction.java create mode 100644 nativec-api/src/main/java/de/intarsys/nativec/type/NativeGenericStruct.java rename {native-c-api => nativec-api}/src/main/java/de/intarsys/nativec/type/NativeInt.java (93%) create mode 100644 nativec-api/src/main/java/de/intarsys/nativec/type/NativeIntType.java rename {native-c-api => nativec-api}/src/main/java/de/intarsys/nativec/type/NativeLong.java (93%) rename {native-c-api => nativec-api}/src/main/java/de/intarsys/nativec/type/NativeLongLP64.java (93%) create mode 100644 nativec-api/src/main/java/de/intarsys/nativec/type/NativeLongLP64Type.java create mode 100644 nativec-api/src/main/java/de/intarsys/nativec/type/NativeLongType.java create mode 100644 nativec-api/src/main/java/de/intarsys/nativec/type/NativeNumber.java create mode 100644 nativec-api/src/main/java/de/intarsys/nativec/type/NativeNumberType.java rename {native-c-api => nativec-api}/src/main/java/de/intarsys/nativec/type/NativeObject.java (94%) rename {native-c-api => nativec-api}/src/main/java/de/intarsys/nativec/type/NativeReference.java (96%) create mode 100644 nativec-api/src/main/java/de/intarsys/nativec/type/NativeReferenceType.java rename {native-c-api => nativec-api}/src/main/java/de/intarsys/nativec/type/NativeShort.java (96%) create mode 100644 nativec-api/src/main/java/de/intarsys/nativec/type/NativeShortType.java create mode 100644 nativec-api/src/main/java/de/intarsys/nativec/type/NativeSimple.java create mode 100644 nativec-api/src/main/java/de/intarsys/nativec/type/NativeSimpleType.java create mode 100644 nativec-api/src/main/java/de/intarsys/nativec/type/NativeStaticStruct.java rename {native-c-api => nativec-api}/src/main/java/de/intarsys/nativec/type/NativeString.java (96%) create mode 100644 nativec-api/src/main/java/de/intarsys/nativec/type/NativeStringType.java rename {native-c-api => nativec-api}/src/main/java/de/intarsys/nativec/type/NativeStruct.java (92%) rename {native-c-api => nativec-api}/src/main/java/de/intarsys/nativec/type/NativeStructType.java (97%) create mode 100644 nativec-api/src/main/java/de/intarsys/nativec/type/NativeType.java create mode 100644 nativec-api/src/main/java/de/intarsys/nativec/type/NativeVoid.java create mode 100644 nativec-api/src/main/java/de/intarsys/nativec/type/NativeVoidType.java rename {native-c-api => nativec-api}/src/main/java/de/intarsys/nativec/type/NativeWideString.java (96%) create mode 100644 nativec-api/src/main/java/de/intarsys/nativec/type/NativeWideStringType.java rename {native-c-api => nativec-api}/src/main/java/de/intarsys/nativec/type/StructMember.java (98%) create mode 100644 nativec-api/src/main/java/de/intarsys/nativec/type/package.html diff --git a/native-c-api/src/main/java/de/intarsys/nativec/api/package.html b/native-c-api/src/main/java/de/intarsys/nativec/api/package.html deleted file mode 100644 index 65cbbea..0000000 --- a/native-c-api/src/main/java/de/intarsys/nativec/api/package.html +++ /dev/null @@ -1,36 +0,0 @@ - - -This is the main package of the native c component. -

- Here we define the API's and the VM singleton access to native c. -

- The component itself was built, as we didn't (once again) find anything - around that satisfied our needs. We wanted: -

    -
  • Clean, layered design
  • -
  • Unrestricted access to all modeled objects and concepts.
  • -
  • Easy adaption and integration with other views. This means primarily unrestricted - access to pointers. There is no use in a native library if i can't bootstrap - with a simple address (in our point of view). -
  • -
  • Clean design for c data structures (primitive, composites and references)
  • -
  • Exchangeable native implementation
  • -
  • Platform independence
  • -
- -So we created an API and a data structure component and mapped it to JNA, which has -great ideas (but in our opinion is to sealed off and has not well done on the -data structure side) and can serve as a good foundation. - -There are some topics we didn't care about yet - this means they may be working or may -not, its simply not tested. JNA brings a lot of basic features... - -
    -
  • Pointer size was not really an issue
  • -
  • We didn't care about byte order
  • -
- -64 bit implementation is under way. - - - \ No newline at end of file diff --git a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeFunction.java b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeFunction.java deleted file mode 100644 index aad2332..0000000 --- a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeFunction.java +++ /dev/null @@ -1,44 +0,0 @@ -package de.intarsys.nativec.type; - -import de.intarsys.nativec.api.INativeFunction; -import de.intarsys.nativec.api.INativeHandle; -import de.intarsys.nativec.api.NativeInterface; - -public class NativeFunction extends NativeVoid { - - public static final NativeFunctionType META = new NativeFunctionType(); - private Object callingConvention; - private INativeFunction function; - protected NativeFunction(INativeHandle handle) { - super(handle); - callingConvention = INativeFunction.CallingConventionCdecl; - } - - public Object getCallingConvention() { - return callingConvention; - } - - public void setCallingConvention(Object callingConvention) { - if (function != null) { - throw new IllegalStateException(); - } - this.callingConvention = callingConvention; - } - - public INativeFunction getFunction() { - // TODO do we want to check if handle has changed? - if (function == null) { - function = NativeInterface.get().createFunction( - getNativeHandle().getAddress(), callingConvention); - } - return function; - } - - public static class NativeFunctionType extends NativeVoidType { - - @Override - public INativeObject createNative(INativeHandle handle) { - return new NativeFunction(handle); - } - } -} diff --git a/native-c-api/src/main/java/de/intarsys/nativec/type/package.html b/native-c-api/src/main/java/de/intarsys/nativec/type/package.html deleted file mode 100644 index 557247c..0000000 --- a/native-c-api/src/main/java/de/intarsys/nativec/type/package.html +++ /dev/null @@ -1,5 +0,0 @@ - - -Here you find the data types and data structures for native c. - - \ No newline at end of file diff --git a/nativec-api/pom.xml b/nativec-api/pom.xml new file mode 100644 index 0000000..079cdfd --- /dev/null +++ b/nativec-api/pom.xml @@ -0,0 +1,62 @@ + + + 4.0.0 + + + se.jguru.codestyle.poms.java + jguru-codestyle-java-api-parent + 1.2.0 + + + + de.intarsys.opensource.nativec.api + nativec-api + 1.0.0-SNAPSHOT + jar + + + intarsys + classpath://codestyle/license + + + + Intarsys Consulting GmbH + https://www.intarsys.de + + + 2013 + + + + Intarsys License + https://www.intarsys.de/licenses/intarsysSourceLicense.txt + repo + A business-friendly OSS license + + + + + + + + + org.codehaus.mojo + license-maven-plugin + 2.0.0 + + + + de.intarsys.opensource.nativec.codestyle + nativec-codestyle + 1.0.0-SNAPSHOT + + + + + + + diff --git a/nativec-api/src/main/java/de/intarsys/nativec/api/CLong.java b/nativec-api/src/main/java/de/intarsys/nativec/api/CLong.java new file mode 100644 index 0000000..e6b9a1f --- /dev/null +++ b/nativec-api/src/main/java/de/intarsys/nativec/api/CLong.java @@ -0,0 +1,78 @@ +/*- + * #%L + * Nazgul Project: nativec-api + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% + * 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 intarsys 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 OWNER 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. + * #L% + */ +package de.intarsys.nativec.api; +public class CLong extends Number { + + private final Number value; + + public CLong(long pValue) { + value = pValue; + } + + @Override + public double doubleValue() { + return value.doubleValue(); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj instanceof CLong) { + return value.equals(((CLong) obj).value); + } + return false; + } + + @Override + public float floatValue() { + return value.floatValue(); + } + + @Override + public int hashCode() { + return value.hashCode(); + } + + @Override + public int intValue() { + return value.intValue(); + } + + @Override + public long longValue() { + return value.longValue(); + } +} diff --git a/nativec-api/src/main/java/de/intarsys/nativec/api/CWideString.java b/nativec-api/src/main/java/de/intarsys/nativec/api/CWideString.java new file mode 100644 index 0000000..523b336 --- /dev/null +++ b/nativec-api/src/main/java/de/intarsys/nativec/api/CWideString.java @@ -0,0 +1,47 @@ +/*- + * #%L + * Nazgul Project: nativec-api + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% + * 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 intarsys 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 OWNER 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. + * #L% + */ +package de.intarsys.nativec.api; +final public class CWideString { + + private final String string; + + public CWideString(String string) { + super(); + this.string = string; + } + + public String getString() { + return string; + } +} diff --git a/nativec-api/src/main/java/de/intarsys/nativec/api/ICallback.java b/nativec-api/src/main/java/de/intarsys/nativec/api/ICallback.java new file mode 100644 index 0000000..8731899 --- /dev/null +++ b/nativec-api/src/main/java/de/intarsys/nativec/api/ICallback.java @@ -0,0 +1,51 @@ +/*- + * #%L + * Nazgul Project: nativec-api + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% + * 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 intarsys 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 OWNER 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. + * #L% + */ +package de.intarsys.nativec.api; + +public interface ICallback { + + @Deprecated + Object CallingConventionCdecl = INativeFunction.CallingConventionCdecl; + + @Deprecated + Object CallingConventionStdcall = INativeFunction.CallingConventionCdecl; + + Object getCallingConvention(); + + Class[] getParameterTypes(); + + Class getReturnType(); + + Object invoke(Object[] objects); +} diff --git a/nativec-api/src/main/java/de/intarsys/nativec/api/INativeCallback.java b/nativec-api/src/main/java/de/intarsys/nativec/api/INativeCallback.java new file mode 100644 index 0000000..b1f2ab9 --- /dev/null +++ b/nativec-api/src/main/java/de/intarsys/nativec/api/INativeCallback.java @@ -0,0 +1,38 @@ +/*- + * #%L + * Nazgul Project: nativec-api + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% + * 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 intarsys 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 OWNER 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. + * #L% + */ +package de.intarsys.nativec.api; + +public interface INativeCallback { + // no methods +} diff --git a/nativec-api/src/main/java/de/intarsys/nativec/api/INativeFunction.java b/nativec-api/src/main/java/de/intarsys/nativec/api/INativeFunction.java new file mode 100644 index 0000000..233ef10 --- /dev/null +++ b/nativec-api/src/main/java/de/intarsys/nativec/api/INativeFunction.java @@ -0,0 +1,49 @@ +/*- + * #%L + * Nazgul Project: nativec-api + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% + * 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 intarsys 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 OWNER 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. + * #L% + */ +package de.intarsys.nativec.api; +public interface INativeFunction { + + Object CallingConventionCdecl = new Object(); + Object CallingConventionStdcall = new Object(); + + /** + * Invoke the native function. + * + * @param returnType The expected return type. + * @param objects The arguments to the function + * + * @return The result of executing the function + */ + T invoke(Class returnType, Object... objects); +} diff --git a/native-c-api/src/main/java/de/intarsys/nativec/api/INativeHandle.java b/nativec-api/src/main/java/de/intarsys/nativec/api/INativeHandle.java similarity index 97% rename from native-c-api/src/main/java/de/intarsys/nativec/api/INativeHandle.java rename to nativec-api/src/main/java/de/intarsys/nativec/api/INativeHandle.java index f7ee256..489fdfb 100644 --- a/native-c-api/src/main/java/de/intarsys/nativec/api/INativeHandle.java +++ b/nativec-api/src/main/java/de/intarsys/nativec/api/INativeHandle.java @@ -1,20 +1,23 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * +/*- + * #%L + * Nazgul Project: nativec-api + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% * 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 intarsys 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 @@ -26,14 +29,9 @@ * 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. + * #L% */ package de.intarsys.nativec.api; - -/** - * A "handle" to a piece of memory (in c space). - *

- * The handle combines an address and a memory chunk of a specified size. - */ public interface INativeHandle { /** diff --git a/native-c-api/src/main/java/de/intarsys/nativec/api/INativeInterface.java b/nativec-api/src/main/java/de/intarsys/nativec/api/INativeInterface.java similarity index 96% rename from native-c-api/src/main/java/de/intarsys/nativec/api/INativeInterface.java rename to nativec-api/src/main/java/de/intarsys/nativec/api/INativeInterface.java index b2d61a1..3ebf6b2 100644 --- a/native-c-api/src/main/java/de/intarsys/nativec/api/INativeInterface.java +++ b/nativec-api/src/main/java/de/intarsys/nativec/api/INativeInterface.java @@ -1,20 +1,23 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * +/*- + * #%L + * Nazgul Project: nativec-api + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% * 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 intarsys 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 @@ -26,12 +29,9 @@ * 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. + * #L% */ package de.intarsys.nativec.api; - -/** - * The abstraction of a generic interface to c native code. - */ public interface INativeInterface { /** diff --git a/nativec-api/src/main/java/de/intarsys/nativec/api/INativeLibrary.java b/nativec-api/src/main/java/de/intarsys/nativec/api/INativeLibrary.java new file mode 100644 index 0000000..3e01517 --- /dev/null +++ b/nativec-api/src/main/java/de/intarsys/nativec/api/INativeLibrary.java @@ -0,0 +1,54 @@ +/*- + * #%L + * Nazgul Project: nativec-api + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% + * 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 intarsys 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 OWNER 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. + * #L% + */ +package de.intarsys.nativec.api; +public interface INativeLibrary { + + /** + * Lookup a {@link INativeFunction} from the library. + * + * @param name The function name + * + * @return The {@link INativeFunction} + */ + INativeFunction getFunction(String name); + + /** + * Lookup a global in the library. + * + * @param symbolName The global name + * + * @return The {@link INativeHandle} to the global. + */ + INativeHandle getGlobal(String symbolName); +} diff --git a/nativec-api/src/main/java/de/intarsys/nativec/api/IValueHolder.java b/nativec-api/src/main/java/de/intarsys/nativec/api/IValueHolder.java new file mode 100644 index 0000000..e2c2695 --- /dev/null +++ b/nativec-api/src/main/java/de/intarsys/nativec/api/IValueHolder.java @@ -0,0 +1,52 @@ +/*- + * #%L + * Nazgul Project: nativec-api + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% + * 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 intarsys 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 OWNER 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. + * #L% + */ +package de.intarsys.nativec.api; +public interface IValueHolder { + + /** + * Dereference the {@link IValueHolder}. + * + * @return The referenced object. + */ + T get(); + + /** + * Assign a new value. + * + * @param newValue + * + * @return The previous value (optional) + */ + T set(T newValue); +} diff --git a/native-c-api/src/main/java/de/intarsys/nativec/api/NativeInterface.java b/nativec-api/src/main/java/de/intarsys/nativec/api/NativeInterface.java similarity index 73% rename from native-c-api/src/main/java/de/intarsys/nativec/api/NativeInterface.java rename to nativec-api/src/main/java/de/intarsys/nativec/api/NativeInterface.java index 4f69ba9..40b7a6e 100644 --- a/native-c-api/src/main/java/de/intarsys/nativec/api/NativeInterface.java +++ b/nativec-api/src/main/java/de/intarsys/nativec/api/NativeInterface.java @@ -1,20 +1,23 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * +/*- + * #%L + * Nazgul Project: nativec-api + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% * 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 intarsys 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 @@ -26,43 +29,37 @@ * 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. + * #L% */ package de.intarsys.nativec.api; import java.util.Iterator; import java.util.ServiceLoader; - -/** - * Access the VM singleton for {@link INativeInterface}. - *

- * To make this work, just do one of the following: - *

    - *
  • set the class name of your implementation with {@link NativeInterface}
  • - *
  • set a {@link INativeInterface} of your choice in {@link NativeInterface}. - *
  • - *
  • set system property "de.intarsys.nativec.api.INativeInterface" to the - * class name of your implementation.
  • - *
  • include a service provider file - * "de.intarsys.nativec.api.INativeInterface" in your deployment with the class - * name of your implementation.
  • - *
- */ public class NativeInterface { - public static final String PROP_NATIVEINTERFACE = "de.intarsys.nativec.api.INativeInterface"; //$NON-NLS-1$ + public static final String PROP_NATIVEINTERFACE = "de.intarsys.nativec.api.INativeInterface"; + + private static final Class[] NO_PARAMETERS = new Class[0]; + + private static final Object[] NO_ARGUMENTS = new Object[0]; + public static INativeHandle NULL; private static INativeInterface ACTIVE; private static String NAME; static protected INativeInterface createNativeInterface() { + String className = getName(); if (className == null) { className = System.getProperty(PROP_NATIVEINTERFACE); } + if (className != null) { try { - Class clazz = Class.forName(className); - return (INativeInterface) clazz.newInstance(); + + final Class clazz = Class.forName(className); + return (INativeInterface) clazz.getDeclaredConstructor(NO_PARAMETERS).newInstance(NO_ARGUMENTS); + } catch (Exception e) { throw new NoClassDefFoundError(className); } @@ -71,9 +68,10 @@ static protected INativeInterface createNativeInterface() { } static protected INativeInterface findNativeInterface() { - ServiceLoader loader = ServiceLoader - .load(INativeInterface.class); - Iterator ps = loader.iterator(); + + final ServiceLoader loader = ServiceLoader.load(INativeInterface.class); + final Iterator ps = loader.iterator(); + if (ps.hasNext()) { try { return ps.next(); @@ -81,6 +79,7 @@ static protected INativeInterface findNativeInterface() { // ignore and try on } } + return null; } @@ -100,9 +99,11 @@ synchronized static public void setName(String name) { } synchronized static public void set(INativeInterface nativeInterface) { + if (nativeInterface == null) { - throw new NullPointerException("no native interface available"); + throw new NullPointerException("INativeInterface not available."); } + ACTIVE = nativeInterface; NULL = nativeInterface.createHandle(0); } diff --git a/native-c-api/src/main/java/de/intarsys/nativec/api/NativeTools.java b/nativec-api/src/main/java/de/intarsys/nativec/api/NativeTools.java similarity index 76% rename from native-c-api/src/main/java/de/intarsys/nativec/api/NativeTools.java rename to nativec-api/src/main/java/de/intarsys/nativec/api/NativeTools.java index 461d498..11f80fa 100644 --- a/native-c-api/src/main/java/de/intarsys/nativec/api/NativeTools.java +++ b/nativec-api/src/main/java/de/intarsys/nativec/api/NativeTools.java @@ -1,20 +1,23 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * +/*- + * #%L + * Nazgul Project: nativec-api + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% * 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 intarsys 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 @@ -26,6 +29,7 @@ * 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. + * #L% */ package de.intarsys.nativec.api; @@ -36,33 +40,30 @@ import de.intarsys.nativec.type.NativeBufferType; import de.intarsys.nativec.type.NativeInt; import de.intarsys.nativec.type.NativeLong; - -/** - * Tool class for for dealing with the native framework. - */ public class NativeTools { - public static byte[] fromNativeByteArray(long ptr, int count) { + private static INativeHandle toNativeHandle(long ptr) { + return NativeInterface.get().createHandle(ptr); + } - INativeHandle handle; - INativeType type; - NativeBuffer nativeValue; + public static byte[] fromNativeByteArray(long ptr, int count) { if (ptr == 0) { return null; } - handle = NativeInterface.get().createHandle(ptr); - type = NativeBufferType.create(count); - nativeValue = (NativeBuffer) type.createNative(handle); + INativeHandle handle = toNativeHandle(ptr); + INativeType type = NativeBufferType.create(count); + NativeBuffer nativeValue = (NativeBuffer) type.createNative(handle); + return nativeValue.getBytes(); } public static long fromNativeCLong(long ptr) { - INativeHandle handle; + NativeLong nativeValue; - handle = NativeInterface.get().createHandle(ptr); + INativeHandle handle = toNativeHandle(ptr); nativeValue = (NativeLong) NativeLong.META.createNative(handle); return nativeValue.intValue(); } @@ -72,11 +73,10 @@ public static IValueHolder fromNativeCLongHolder(long ptr) { } public static int fromNativeInt(long ptr) { - INativeHandle handle; - NativeInt nativeValue; - handle = NativeInterface.get().createHandle(ptr); - nativeValue = (NativeInt) NativeInt.META.createNative(handle); + INativeHandle handle = toNativeHandle(ptr); + NativeInt nativeValue = (NativeInt) NativeInt.META.createNative(handle); + return nativeValue.intValue(); } @@ -93,9 +93,7 @@ public static int[] fromNativeIntArray(INativeHandle handle, int count) { } public static int[] fromNativeIntArray(long ptr, int count) { - INativeHandle handle; - - handle = NativeInterface.get().createHandle(ptr); + INativeHandle handle = toNativeHandle(ptr); return fromNativeIntArray(handle, count); } @@ -113,11 +111,11 @@ public static INativeHandle toHandle(long address) { public static void toNativeByteArray(long ptr, byte[] value) { if (value != null) { - INativeHandle handle; + INativeType type; NativeBuffer buffer; - handle = NativeInterface.get().createHandle(ptr); + INativeHandle handle = toNativeHandle(ptr); type = NativeBufferType.create(value.length); buffer = (NativeBuffer) type.createNative(handle); buffer.setValue(value); @@ -125,14 +123,13 @@ public static void toNativeByteArray(long ptr, byte[] value) { } public static void toNativeCLong(long ptr, int[] value) { + if (value != null) { - INativeHandle handle; - NativeArrayType type; - NativeArray array; - handle = NativeInterface.get().createHandle(ptr); - type = NativeArrayType.create(NativeLong.META, value.length); - array = (NativeArray) type.createNative(handle); + final INativeHandle handle = toNativeHandle(ptr); + final NativeArrayType type = NativeArrayType.create(NativeLong.META, value.length); + + NativeArray array = (NativeArray) type.createNative(handle); for (int index = 0; index < value.length; index++) { array.setValue(index, value[index]); } @@ -144,21 +141,19 @@ public static void toNativeCLong(long ptr, IValueHolder value) { } public static void toNativeCLong(long ptr, long value) { - INativeHandle handle; - NativeLong nativeValue; - handle = NativeInterface.get().createHandle(ptr); - nativeValue = (NativeLong) NativeLong.META.createNative(handle); + final INativeHandle handle = toNativeHandle(ptr); + final NativeLong nativeValue = (NativeLong) NativeLong.META.createNative(handle); + nativeValue.setValue(value); } public static void toNativeCLong(long ptr, long[] value) { if (value != null) { - INativeHandle handle; NativeArrayType type; NativeArray array; - handle = NativeInterface.get().createHandle(ptr); + final INativeHandle handle = toNativeHandle(ptr); type = NativeArrayType.create(NativeLong.META, value.length); array = (NativeArray) type.createNative(handle); for (int index = 0; index < value.length; index++) { @@ -168,20 +163,20 @@ public static void toNativeCLong(long ptr, long[] value) { } public static void toNativeInt(long ptr, int value) { - INativeHandle handle; - handle = NativeInterface.get().createHandle(ptr); + final INativeHandle handle = toNativeHandle(ptr); handle.setSize(NativeInt.META.getByteCount()); handle.setInt(0, value); } public static void toNativeInt(long ptr, int[] value) { if (value != null) { - INativeHandle handle; + NativeArrayType type; NativeArray array; - handle = NativeInterface.get().createHandle(ptr); + final INativeHandle handle = toNativeHandle(ptr); + type = NativeArrayType.create(NativeInt.META, value.length); array = (NativeArray) type.createNative(handle); for (int index = 0; index < value.length; index++) { @@ -195,9 +190,6 @@ public static void toNativeInt(long ptr, IValueHolder value) { } public static void toNativePointer(long ptr, INativeHandle value) { - INativeHandle handle; - - handle = NativeInterface.get().createHandle(ptr); - handle.setNativeHandle(0, value); + toNativeHandle(ptr).setNativeHandle(0, value); } } diff --git a/nativec-api/src/main/java/de/intarsys/nativec/api/ObjectValueHolder.java b/nativec-api/src/main/java/de/intarsys/nativec/api/ObjectValueHolder.java new file mode 100644 index 0000000..172ec85 --- /dev/null +++ b/nativec-api/src/main/java/de/intarsys/nativec/api/ObjectValueHolder.java @@ -0,0 +1,55 @@ +/*- + * #%L + * Nazgul Project: nativec-api + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% + * 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 intarsys 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 OWNER 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. + * #L% + */ +package de.intarsys.nativec.api; +public class ObjectValueHolder implements IValueHolder { + + private T value; + + public ObjectValueHolder(T value) { + super(); + this.value = value; + } + + @Override + public T get() { + return value; + } + + @Override + public T set(T newValue) { + T oldValue = value; + value = newValue; + return oldValue; + } +} diff --git a/nativec-api/src/main/java/de/intarsys/nativec/api/package.html b/nativec-api/src/main/java/de/intarsys/nativec/api/package.html new file mode 100644 index 0000000..afbb2f4 --- /dev/null +++ b/nativec-api/src/main/java/de/intarsys/nativec/api/package.html @@ -0,0 +1,69 @@ + + + +This is the main package of the native c component. +

+ Here we define the API's and the VM singleton access to native c. +

+ The component itself was built, as we didn't (once again) find anything + around that satisfied our needs. We wanted: +

    +
  • Clean, layered design
  • +
  • Unrestricted access to all modeled objects and concepts.
  • +
  • Easy adaption and integration with other views. This means primarily unrestricted + access to pointers. There is no use in a native library if i can't bootstrap + with a simple address (in our point of view). +
  • +
  • Clean design for c data structures (primitive, composites and references)
  • +
  • Exchangeable native implementation
  • +
  • Platform independence
  • +
+ +So we created an API and a data structure component and mapped it to JNA, which has +great ideas (but in our opinion is to sealed off and has not well done on the +data structure side) and can serve as a good foundation. + +There are some topics we didn't care about yet - this means they may be working or may +not, its simply not tested. JNA brings a lot of basic features... + +
    +
  • Pointer size was not really an issue
  • +
  • We didn't care about byte order
  • +
+ +64 bit implementation is under way. + + + diff --git a/nativec-api/src/main/java/de/intarsys/nativec/type/INativeObject.java b/nativec-api/src/main/java/de/intarsys/nativec/type/INativeObject.java new file mode 100644 index 0000000..0ff9f66 --- /dev/null +++ b/nativec-api/src/main/java/de/intarsys/nativec/type/INativeObject.java @@ -0,0 +1,73 @@ +/*- + * #%L + * Nazgul Project: nativec-api + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% + * 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 intarsys 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 OWNER 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. + * #L% + */ +package de.intarsys.nativec.type; + +import de.intarsys.nativec.api.INativeHandle; +public interface INativeObject { + + /** + * The bytes that make up the {@link INativeObject}. + * + * @return The bytes that make up the {@link INativeObject}. + */ + byte[] getBytes(); + + /** + * The {@link INativeHandle} to the c memory for the object. + * + * @return The {@link INativeHandle} to the c memory for the object. + */ + INativeHandle getNativeHandle(); + + /** + * The {@link INativeType} for the object. + * + * @return The {@link INativeType} for the object. + */ + INativeType getNativeType(); + + /** + * A Java side representation from the memory. + * + * @return A Java side representation for the {@link INativeObject}. + */ + Object getValue(); + + /** + * Assign (and marshall to memory) the Java side representation. + * + * @param value The new Java value. + */ + void setValue(Object value); +} diff --git a/nativec-api/src/main/java/de/intarsys/nativec/type/INativeType.java b/nativec-api/src/main/java/de/intarsys/nativec/type/INativeType.java new file mode 100644 index 0000000..19db0a7 --- /dev/null +++ b/nativec-api/src/main/java/de/intarsys/nativec/type/INativeType.java @@ -0,0 +1,87 @@ +/*- + * #%L + * Nazgul Project: nativec-api + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% + * 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 intarsys 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 OWNER 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. + * #L% + */ +package de.intarsys.nativec.type; + +import de.intarsys.nativec.api.INativeHandle; +public interface INativeType { + + /** + * Create an array type from this. + * + * @param size The predefined size for the array. + * + * @return The derived type. + */ + INativeType Array(int size); + + /** + * Create an {@link INativeObject} for this type from the Java object. + * + * @param value + * + * @return The new {@link INativeObject} + */ + INativeObject createNative(Object value); + + /** + * Create a new {@link INativeObject} from a {@link INativeHandle}. + * + * @param handle The handle to memory. + * + * @return The new {@link INativeObject} + */ + INativeObject createNative(INativeHandle handle); + + /** + * The boundary where this type as a struct member would want to be aligned. + * A structure can override this value with packing. + * + * @return The preferred alignment boundary. + */ + int getPreferredBoundary(); + + /** + * The size of the type in c memory. + * + * @return The size of the type in c memory. + */ + int getByteCount(); + + /** + * Create a reference type to this. + * + * @return The derived type. + */ + INativeType Ref(); +} diff --git a/nativec-api/src/main/java/de/intarsys/nativec/type/NativeAbstractStringType.java b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeAbstractStringType.java new file mode 100644 index 0000000..2fcf203 --- /dev/null +++ b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeAbstractStringType.java @@ -0,0 +1,73 @@ +/*- + * #%L + * Nazgul Project: nativec-api + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% + * 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 intarsys 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 OWNER 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. + * #L% + */ +package de.intarsys.nativec.type; + +import de.intarsys.nativec.api.NativeInterface; +public class NativeAbstractStringType extends NativeType { + + private final int characterSize; + private final int stringSize; + + protected NativeAbstractStringType(int pCharacterSize) { + super(); + characterSize = pCharacterSize; + stringSize = 0; + } + + protected NativeAbstractStringType(int pStringSize, int pCharacterSize) { + super(); + characterSize = pCharacterSize; + stringSize = pStringSize; + } + + @Override + public int getByteCount() { + if (stringSize == 0) { + throw new IllegalStateException(); + } + return stringSize * characterSize; + } + + public int getPreferredBoundary() { + return NativeInterface.get().pointerSize(); + } + + public int getStringSize() { + return stringSize; + } + + public boolean hasByteCount() { + return stringSize != 0; + } +} diff --git a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeArray.java b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeArray.java similarity index 95% rename from native-c-api/src/main/java/de/intarsys/nativec/type/NativeArray.java rename to nativec-api/src/main/java/de/intarsys/nativec/type/NativeArray.java index 84978c2..c54d57e 100644 --- a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeArray.java +++ b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeArray.java @@ -1,20 +1,23 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * +/*- + * #%L + * Nazgul Project: nativec-api + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% * 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 intarsys 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 @@ -26,15 +29,11 @@ * 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. + * #L% */ package de.intarsys.nativec.type; import de.intarsys.nativec.api.INativeHandle; - -/** - * An {@link INativeObject} that represents a homogeneous (this means of equal - * length and type) sequence of other {@link INativeObject} instances. - */ public class NativeArray extends NativeObject { /** diff --git a/nativec-api/src/main/java/de/intarsys/nativec/type/NativeArrayType.java b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeArrayType.java new file mode 100644 index 0000000..ee19103 --- /dev/null +++ b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeArrayType.java @@ -0,0 +1,96 @@ +/*- + * #%L + * Nazgul Project: nativec-api + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% + * 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 intarsys 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 OWNER 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. + * #L% + */ +package de.intarsys.nativec.type; + +import de.intarsys.nativec.api.INativeHandle; +public class NativeArrayType extends NativeType { + + private final int arraySize; + /** + * The size of the base type of the array. + */ + private final int baseSize; + /** + * The base type of the array. + */ + private final INativeType baseType; + + protected NativeArrayType(INativeType baseDeclaration, int arraySize) { + super(); + this.baseType = baseDeclaration; + this.baseSize = baseDeclaration.getByteCount(); + this.arraySize = arraySize; + } + + public static NativeArrayType create(INativeType baseType, int size) { + return new NativeArrayType(baseType, size); + } + + @Override + public INativeObject createNative(INativeHandle handle) { + NativeArray array = new NativeArray(this, handle); + if (arraySize > 0) { + array.setSize(arraySize); + } + return array; + } + + @Override + public INativeObject createNative(Object value) { + NativeArray array = new NativeArray(this); + return array; + } + + public int getArraySize() { + return arraySize; + } + + public int getBaseSize() { + return baseSize; + } + + public INativeType getBaseType() { + return baseType; + } + + @Override + public int getByteCount() { + // todo take into account alignment / packing? + return arraySize * baseSize; + } + + public int getPreferredBoundary() { + return baseType.getPreferredBoundary(); + } +} diff --git a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeBuffer.java b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeBuffer.java similarity index 96% rename from native-c-api/src/main/java/de/intarsys/nativec/type/NativeBuffer.java rename to nativec-api/src/main/java/de/intarsys/nativec/type/NativeBuffer.java index ac1a9e8..576b5b2 100644 --- a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeBuffer.java +++ b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeBuffer.java @@ -1,20 +1,23 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * +/*- + * #%L + * Nazgul Project: nativec-api + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% * 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 intarsys 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 @@ -26,6 +29,7 @@ * 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. + * #L% */ package de.intarsys.nativec.type; @@ -33,10 +37,6 @@ import de.intarsys.nativec.api.INativeHandle; import de.intarsys.nativec.api.NativeInterface; - -/** - * A wrapper for a sequence of bytes. - */ public class NativeBuffer extends NativeObject { /** diff --git a/nativec-api/src/main/java/de/intarsys/nativec/type/NativeBufferType.java b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeBufferType.java new file mode 100644 index 0000000..1b1673e --- /dev/null +++ b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeBufferType.java @@ -0,0 +1,78 @@ +/*- + * #%L + * Nazgul Project: nativec-api + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% + * 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 intarsys 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 OWNER 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. + * #L% + */ +package de.intarsys.nativec.type; + +import de.intarsys.nativec.api.INativeHandle; +public class NativeBufferType extends NativeType { + + final private int bufferSize; + + protected NativeBufferType() { + super(); + this.bufferSize = 0; + } + + protected NativeBufferType(int bufferSize) { + super(); + this.bufferSize = bufferSize; + } + + public static NativeBufferType create(int size) { + return new NativeBufferType(size); + } + + @Override + public INativeObject createNative(INativeHandle handle) { + NativeBuffer buffer; + + buffer = new NativeBuffer(handle); + // setSize() creates a new type object + // TODO create constructor to use the existing one? + buffer.setSize(bufferSize); + return buffer; + } + + public int getBufferSize() { + return bufferSize; + } + + @Override + public int getByteCount() { + return bufferSize; + } + + public int getPreferredBoundary() { + return 1; + } +} diff --git a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeByte.java b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeByte.java similarity index 96% rename from native-c-api/src/main/java/de/intarsys/nativec/type/NativeByte.java rename to nativec-api/src/main/java/de/intarsys/nativec/type/NativeByte.java index 1cf981d..caa6d28 100644 --- a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeByte.java +++ b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeByte.java @@ -1,20 +1,23 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * +/*- + * #%L + * Nazgul Project: nativec-api + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% * 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 intarsys 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 @@ -26,15 +29,12 @@ * 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. + * #L% */ package de.intarsys.nativec.type; import de.intarsys.nativec.api.INativeHandle; import de.intarsys.nativec.api.NativeTools; - -/** - * A wrapper for a primitive byte. - */ public class NativeByte extends NativeNumber { /** diff --git a/nativec-api/src/main/java/de/intarsys/nativec/type/NativeByteType.java b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeByteType.java new file mode 100644 index 0000000..076ec2e --- /dev/null +++ b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeByteType.java @@ -0,0 +1,57 @@ +/*- + * #%L + * Nazgul Project: nativec-api + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% + * 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 intarsys 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 OWNER 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. + * #L% + */ +package de.intarsys.nativec.type; + +import de.intarsys.nativec.api.INativeHandle; +public class NativeByteType extends NativeNumberType { + + protected NativeByteType() { + super(); + } + + @Override + public INativeObject createNative(INativeHandle handle) { + return new NativeByte(handle); + } + + @Override + public INativeObject createNative(Object value) { + return new NativeByte(((Number) value).byteValue()); + } + + @Override + public int getByteCount() { + return NativeByte.SIZE_BYTE; + } +} diff --git a/nativec-api/src/main/java/de/intarsys/nativec/type/NativeFunction.java b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeFunction.java new file mode 100644 index 0000000..48cbc91 --- /dev/null +++ b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeFunction.java @@ -0,0 +1,77 @@ +/*- + * #%L + * Nazgul Project: nativec-api + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% + * 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 intarsys 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 OWNER 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. + * #L% + */ +package de.intarsys.nativec.type; + +import de.intarsys.nativec.api.INativeFunction; +import de.intarsys.nativec.api.INativeHandle; +import de.intarsys.nativec.api.NativeInterface; + +public class NativeFunction extends NativeVoid { + + public static final NativeFunctionType META = new NativeFunctionType(); + private Object callingConvention; + private INativeFunction function; + protected NativeFunction(INativeHandle handle) { + super(handle); + callingConvention = INativeFunction.CallingConventionCdecl; + } + + public Object getCallingConvention() { + return callingConvention; + } + + public void setCallingConvention(Object callingConvention) { + if (function != null) { + throw new IllegalStateException(); + } + this.callingConvention = callingConvention; + } + + public INativeFunction getFunction() { + // TODO do we want to check if handle has changed? + if (function == null) { + function = NativeInterface.get().createFunction( + getNativeHandle().getAddress(), callingConvention); + } + return function; + } + + public static class NativeFunctionType extends NativeVoidType { + + @Override + public INativeObject createNative(INativeHandle handle) { + return new NativeFunction(handle); + } + } +} diff --git a/nativec-api/src/main/java/de/intarsys/nativec/type/NativeGenericStruct.java b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeGenericStruct.java new file mode 100644 index 0000000..88bdd2c --- /dev/null +++ b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeGenericStruct.java @@ -0,0 +1,66 @@ +/*- + * #%L + * Nazgul Project: nativec-api + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% + * 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 intarsys 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 OWNER 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. + * #L% + */ +package de.intarsys.nativec.type; + +import de.intarsys.nativec.api.INativeHandle; +public class NativeGenericStruct extends NativeStruct { + + private NativeStructType type; + + protected NativeGenericStruct(NativeStructType type) { + super(); + this.type = type; + allocate(); + } + + protected NativeGenericStruct(NativeStructType type, INativeHandle handle) { + super(handle); + this.type = type; + } + + @Override + public INativeType getNativeType() { + return type; + } + + public void setNativeType(NativeStructType type) { + this.type = type; + this.values = null; + } + + @Override + public NativeStructType getStructType() { + return type; + } +} diff --git a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeInt.java b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeInt.java similarity index 93% rename from native-c-api/src/main/java/de/intarsys/nativec/type/NativeInt.java rename to nativec-api/src/main/java/de/intarsys/nativec/type/NativeInt.java index 2610025..a469874 100644 --- a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeInt.java +++ b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeInt.java @@ -1,20 +1,23 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * +/*- + * #%L + * Nazgul Project: nativec-api + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% * 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 intarsys 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 @@ -26,16 +29,12 @@ * 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. + * #L% */ package de.intarsys.nativec.type; import de.intarsys.nativec.api.INativeHandle; import de.intarsys.nativec.api.NativeTools; - -/** - * A wrapper for a primitive int (which is always 4 bytes except on ILP64 - * systems which can be treated as non-existent for our purposes). - */ public class NativeInt extends NativeNumber { /** diff --git a/nativec-api/src/main/java/de/intarsys/nativec/type/NativeIntType.java b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeIntType.java new file mode 100644 index 0000000..211f6ce --- /dev/null +++ b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeIntType.java @@ -0,0 +1,57 @@ +/*- + * #%L + * Nazgul Project: nativec-api + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% + * 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 intarsys 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 OWNER 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. + * #L% + */ +package de.intarsys.nativec.type; + +import de.intarsys.nativec.api.INativeHandle; +public class NativeIntType extends NativeNumberType { + + protected NativeIntType() { + super(); + } + + @Override + public INativeObject createNative(INativeHandle handle) { + return new NativeInt(handle); + } + + @Override + public INativeObject createNative(Object value) { + return new NativeInt(((Number) value).longValue()); + } + + @Override + public int getByteCount() { + return NativeInt.SIZE_INT; + } +} diff --git a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeLong.java b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeLong.java similarity index 93% rename from native-c-api/src/main/java/de/intarsys/nativec/type/NativeLong.java rename to nativec-api/src/main/java/de/intarsys/nativec/type/NativeLong.java index c1d6620..e8bbe3f 100644 --- a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeLong.java +++ b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeLong.java @@ -1,20 +1,23 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * +/*- + * #%L + * Nazgul Project: nativec-api + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% * 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 intarsys 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 @@ -26,16 +29,12 @@ * 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. + * #L% */ package de.intarsys.nativec.type; import de.intarsys.nativec.api.INativeHandle; import de.intarsys.nativec.api.NativeTools; - -/** - * A wrapper for a primitive long. The size of a long depends on the platform; - * on a 64-bit Linux or Mac OS X we have 8 byte longs... - */ public class NativeLong extends NativeNumber { /** diff --git a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeLongLP64.java b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeLongLP64.java similarity index 93% rename from native-c-api/src/main/java/de/intarsys/nativec/type/NativeLongLP64.java rename to nativec-api/src/main/java/de/intarsys/nativec/type/NativeLongLP64.java index 0959edb..3d92d75 100644 --- a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeLongLP64.java +++ b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeLongLP64.java @@ -1,20 +1,23 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * +/*- + * #%L + * Nazgul Project: nativec-api + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% * 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 intarsys 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 @@ -26,17 +29,12 @@ * 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. + * #L% */ package de.intarsys.nativec.type; import de.intarsys.nativec.api.INativeHandle; import de.intarsys.nativec.api.NativeTools; - -/** - * A wrapper for the Windows type LONG_PTR. This type has the same size as a - * pointer but is semantically a simple integer. (same as NativeLong on LP64 - * platforms size-wise) - */ public class NativeLongLP64 extends NativeNumber { /** diff --git a/nativec-api/src/main/java/de/intarsys/nativec/type/NativeLongLP64Type.java b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeLongLP64Type.java new file mode 100644 index 0000000..e1235e9 --- /dev/null +++ b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeLongLP64Type.java @@ -0,0 +1,79 @@ +/*- + * #%L + * Nazgul Project: nativec-api + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% + * 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 intarsys 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 OWNER 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. + * #L% + */ +package de.intarsys.nativec.type; + +import de.intarsys.nativec.api.INativeHandle; +public class NativeLongLP64Type extends NativeNumberType { + + protected NativeLongLP64Type() { + super(); + } + + /** + * Utility method: return the given number as another number object with + * compatible byte size + */ + public static Object coerce(Number value) { + if (NativeObject.SIZE_PTR == 4) { + return value.intValue(); + } + return value.longValue(); + } + + /** + * Utility method: return the java class whose instances have compatible + * byte size + */ + public static Class primitiveClass() { + if (NativeObject.SIZE_PTR == 4) { + return Integer.class; + } + return Long.class; + } + + @Override + public INativeObject createNative(INativeHandle handle) { + return new NativeLongLP64(handle); + } + + @Override + public INativeObject createNative(Object value) { + return new NativeLongLP64(((Number) value).longValue()); + } + + @Override + public int getByteCount() { + return NativeObject.SIZE_PTR; + } +} diff --git a/nativec-api/src/main/java/de/intarsys/nativec/type/NativeLongType.java b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeLongType.java new file mode 100644 index 0000000..271cd5a --- /dev/null +++ b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeLongType.java @@ -0,0 +1,57 @@ +/*- + * #%L + * Nazgul Project: nativec-api + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% + * 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 intarsys 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 OWNER 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. + * #L% + */ +package de.intarsys.nativec.type; + +import de.intarsys.nativec.api.INativeHandle; +public class NativeLongType extends NativeNumberType { + + protected NativeLongType() { + super(); + } + + @Override + public INativeObject createNative(INativeHandle handle) { + return new NativeLong(handle); + } + + @Override + public INativeObject createNative(Object value) { + return new NativeLong(((Number) value).longValue()); + } + + @Override + public int getByteCount() { + return NativeLong.SIZE_LONG; + } +} diff --git a/nativec-api/src/main/java/de/intarsys/nativec/type/NativeNumber.java b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeNumber.java new file mode 100644 index 0000000..4ef3a59 --- /dev/null +++ b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeNumber.java @@ -0,0 +1,76 @@ +/*- + * #%L + * Nazgul Project: nativec-api + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% + * 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 intarsys 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 OWNER 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. + * #L% + */ +package de.intarsys.nativec.type; + +import de.intarsys.nativec.api.INativeHandle; +public abstract class NativeNumber extends NativeSimple { + + /** + * Create a wrapper + */ + protected NativeNumber() { + } + + protected NativeNumber(INativeHandle handle) { + super(handle); + } + + /** + * This as a java primitive byte value. + * + * @return This as a java primitive byte value. + */ + public abstract byte byteValue(); + + /** + * This as a java primitive int value. + * + * @return This as a java primitive int value. + */ + public abstract int intValue(); + + /** + * This as a java primitive long value. + * + * @return This as a java primitive long value. + */ + public abstract long longValue(); + + /** + * This as a java primitive short value. + * + * @return This as a java primitive short value. + */ + public abstract short shortValue(); +} diff --git a/nativec-api/src/main/java/de/intarsys/nativec/type/NativeNumberType.java b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeNumberType.java new file mode 100644 index 0000000..c2c6c7c --- /dev/null +++ b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeNumberType.java @@ -0,0 +1,40 @@ +/*- + * #%L + * Nazgul Project: nativec-api + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% + * 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 intarsys 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 OWNER 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. + * #L% + */ +package de.intarsys.nativec.type; +public class NativeNumberType extends NativeSimpleType { + + protected NativeNumberType() { + super(); + } +} diff --git a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeObject.java b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeObject.java similarity index 94% rename from native-c-api/src/main/java/de/intarsys/nativec/type/NativeObject.java rename to nativec-api/src/main/java/de/intarsys/nativec/type/NativeObject.java index e59f7e5..0e67bed 100644 --- a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeObject.java +++ b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeObject.java @@ -1,20 +1,23 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * +/*- + * #%L + * Nazgul Project: nativec-api + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% * 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 intarsys 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 @@ -26,27 +29,12 @@ * 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. + * #L% */ package de.intarsys.nativec.type; import de.intarsys.nativec.api.INativeHandle; import de.intarsys.nativec.api.NativeInterface; - -/** - * An instance of an external (C memory) represented object. The C-object is - * represented using the handle (the pointer to the object in C memory) and its - * type {@link INativeType}. - *

- * Supported data types are - *

    - *
  • primitive types (char, byte, int, short, long, String...)
  • - *
  • byte buffer
  • - *
  • array types
  • - *
  • structures
  • - *
  • references
  • - *
- *

- */ public abstract class NativeObject implements INativeObject { public static final int SIZE_BYTE = 1; @@ -286,4 +274,4 @@ public void setWideString(int index, String value) { public String toNestedString() { return toString(); } -} \ No newline at end of file +} diff --git a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeReference.java b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeReference.java similarity index 96% rename from native-c-api/src/main/java/de/intarsys/nativec/type/NativeReference.java rename to nativec-api/src/main/java/de/intarsys/nativec/type/NativeReference.java index c28f3d5..4b5b369 100644 --- a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeReference.java +++ b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeReference.java @@ -1,20 +1,23 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * +/*- + * #%L + * Nazgul Project: nativec-api + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% * 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 intarsys 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 @@ -26,15 +29,12 @@ * 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. + * #L% */ package de.intarsys.nativec.type; import de.intarsys.nativec.api.INativeHandle; import de.intarsys.nativec.api.NativeInterface; - -/** - * An object representing a reference to another object ("pointer"). - */ public class NativeReference extends NativeObject { /** diff --git a/nativec-api/src/main/java/de/intarsys/nativec/type/NativeReferenceType.java b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeReferenceType.java new file mode 100644 index 0000000..5d34648 --- /dev/null +++ b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeReferenceType.java @@ -0,0 +1,79 @@ +/*- + * #%L + * Nazgul Project: nativec-api + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% + * 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 intarsys 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 OWNER 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. + * #L% + */ +package de.intarsys.nativec.type; + +import de.intarsys.nativec.api.INativeHandle; +import de.intarsys.nativec.api.NativeInterface; +public class NativeReferenceType extends NativeType { + + /** + * The declaration for the dereference slot + */ + private final INativeType baseType; + + /** + * Declare a reference to a base type + */ + protected NativeReferenceType(INativeType baseDeclaration) { + super(); + this.baseType = baseDeclaration; + } + + public static NativeReferenceType create(INativeType baseType) { + return new NativeReferenceType(baseType); + } + + @Override + public INativeObject createNative(INativeHandle handle) { + return new NativeReference(this, handle); + } + + @Override + public INativeObject createNative(Object value) { + return new NativeReference(this); + } + + public INativeType getBaseType() { + return baseType; + } + + @Override + public int getByteCount() { + return NativeInterface.get().pointerSize(); + } + + public int getPreferredBoundary() { + return NativeInterface.get().pointerSize(); + } +} diff --git a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeShort.java b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeShort.java similarity index 96% rename from native-c-api/src/main/java/de/intarsys/nativec/type/NativeShort.java rename to nativec-api/src/main/java/de/intarsys/nativec/type/NativeShort.java index 47fe4ff..f40f132 100644 --- a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeShort.java +++ b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeShort.java @@ -1,20 +1,23 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * +/*- + * #%L + * Nazgul Project: nativec-api + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% * 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 intarsys 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 @@ -26,15 +29,12 @@ * 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. + * #L% */ package de.intarsys.nativec.type; import de.intarsys.nativec.api.INativeHandle; import de.intarsys.nativec.api.NativeTools; - -/** - * A wrapper for a primitive short. - */ public class NativeShort extends NativeNumber { /** diff --git a/nativec-api/src/main/java/de/intarsys/nativec/type/NativeShortType.java b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeShortType.java new file mode 100644 index 0000000..b835162 --- /dev/null +++ b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeShortType.java @@ -0,0 +1,57 @@ +/*- + * #%L + * Nazgul Project: nativec-api + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% + * 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 intarsys 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 OWNER 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. + * #L% + */ +package de.intarsys.nativec.type; + +import de.intarsys.nativec.api.INativeHandle; +public class NativeShortType extends NativeNumberType { + + protected NativeShortType() { + super(); + } + + @Override + public NativeObject createNative(INativeHandle handle) { + return new NativeShort(handle); + } + + @Override + public NativeObject createNative(Object value) { + return new NativeShort(((Number) value).shortValue()); + } + + @Override + public int getByteCount() { + return NativeShort.SIZE_SHORT; + } +} diff --git a/nativec-api/src/main/java/de/intarsys/nativec/type/NativeSimple.java b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeSimple.java new file mode 100644 index 0000000..9a895db --- /dev/null +++ b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeSimple.java @@ -0,0 +1,59 @@ +/*- + * #%L + * Nazgul Project: nativec-api + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% + * 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 intarsys 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 OWNER 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. + * #L% + */ +package de.intarsys.nativec.type; + +import de.intarsys.nativec.api.INativeHandle; +public abstract class NativeSimple extends NativeObject { + + /** + * Create a wrapper for a NativePrimitive + */ + protected NativeSimple() { + } + + protected NativeSimple(INativeHandle handle) { + super(handle); + handle.setSize(getByteCount()); + } + + /* + * (non-Javadoc) + * + * @see de.intarsys.tools.nativec.NativeObject#getByteCount() + */ + @Override + public int getByteCount() { + return getNativeType().getByteCount(); + } +} diff --git a/nativec-api/src/main/java/de/intarsys/nativec/type/NativeSimpleType.java b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeSimpleType.java new file mode 100644 index 0000000..dbd137b --- /dev/null +++ b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeSimpleType.java @@ -0,0 +1,44 @@ +/*- + * #%L + * Nazgul Project: nativec-api + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% + * 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 intarsys 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 OWNER 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. + * #L% + */ +package de.intarsys.nativec.type; +public class NativeSimpleType extends NativeType { + + protected NativeSimpleType() { + super(); + } + + public int getPreferredBoundary() { + return getByteCount(); + } +} diff --git a/nativec-api/src/main/java/de/intarsys/nativec/type/NativeStaticStruct.java b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeStaticStruct.java new file mode 100644 index 0000000..ae571e8 --- /dev/null +++ b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeStaticStruct.java @@ -0,0 +1,47 @@ +/*- + * #%L + * Nazgul Project: nativec-api + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% + * 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 intarsys 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 OWNER 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. + * #L% + */ +package de.intarsys.nativec.type; + +import de.intarsys.nativec.api.INativeHandle; +public abstract class NativeStaticStruct extends NativeStruct { + + protected NativeStaticStruct() { + allocate(); + } + + protected NativeStaticStruct(INativeHandle handle) { + super(handle); + handle.setSize(getByteCount()); + } +} diff --git a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeString.java b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeString.java similarity index 96% rename from native-c-api/src/main/java/de/intarsys/nativec/type/NativeString.java rename to nativec-api/src/main/java/de/intarsys/nativec/type/NativeString.java index f06994b..90a5230 100644 --- a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeString.java +++ b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeString.java @@ -1,20 +1,23 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * +/*- + * #%L + * Nazgul Project: nativec-api + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% * 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 intarsys 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 @@ -26,15 +29,12 @@ * 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. + * #L% */ package de.intarsys.nativec.type; import de.intarsys.nativec.api.INativeHandle; import de.intarsys.nativec.api.NativeTools; - -/** - * A wrapper for a C single byte null terminated string. - */ public class NativeString extends NativeObject { /** diff --git a/nativec-api/src/main/java/de/intarsys/nativec/type/NativeStringType.java b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeStringType.java new file mode 100644 index 0000000..743e25a --- /dev/null +++ b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeStringType.java @@ -0,0 +1,64 @@ +/*- + * #%L + * Nazgul Project: nativec-api + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% + * 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 intarsys 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 OWNER 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. + * #L% + */ +package de.intarsys.nativec.type; + +import de.intarsys.nativec.api.INativeHandle; +public class NativeStringType extends NativeAbstractStringType { + + protected NativeStringType() { + super(1); + } + + protected NativeStringType(int size) { + super(size, 1); + } + + public static NativeStringType create(int size) { + return new NativeStringType(size); + } + + public NativeObject createNative() { + return new NativeString(this); + } + + @Override + public NativeObject createNative(INativeHandle handle) { + return new NativeString(this, handle); + } + + @Override + public NativeObject createNative(Object value) { + return new NativeString(this, (String) value); + } +} diff --git a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeStruct.java b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeStruct.java similarity index 92% rename from native-c-api/src/main/java/de/intarsys/nativec/type/NativeStruct.java rename to nativec-api/src/main/java/de/intarsys/nativec/type/NativeStruct.java index a13a3e3..c340d65 100644 --- a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeStruct.java +++ b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeStruct.java @@ -1,20 +1,23 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * +/*- + * #%L + * Nazgul Project: nativec-api + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% * 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 intarsys 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 @@ -26,19 +29,13 @@ * 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. + * #L% */ package de.intarsys.nativec.type; import java.util.Iterator; import de.intarsys.nativec.api.INativeHandle; - -/** - * An abstract superclass for the implementation of structured - * {@link NativeObject} instances. These objects are built using named slots - * with other {@link INativeObject} instances (as opposed to {@link NativeArray}, - * using indexed slots). - */ public abstract class NativeStruct extends NativeObject { /** diff --git a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeStructType.java b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeStructType.java similarity index 97% rename from native-c-api/src/main/java/de/intarsys/nativec/type/NativeStructType.java rename to nativec-api/src/main/java/de/intarsys/nativec/type/NativeStructType.java index a74e769..23846d4 100644 --- a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeStructType.java +++ b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeStructType.java @@ -1,20 +1,23 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * +/*- + * #%L + * Nazgul Project: nativec-api + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% * 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 intarsys 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 @@ -26,6 +29,7 @@ * 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. + * #L% */ package de.intarsys.nativec.type; @@ -35,10 +39,6 @@ import java.util.Map; import de.intarsys.nativec.api.NativeInterface; - -/** - * The meta class implementation - */ public class NativeStructType extends NativeType { /** @@ -168,4 +168,4 @@ public String toString() { } return sb.toString(); } -} \ No newline at end of file +} diff --git a/nativec-api/src/main/java/de/intarsys/nativec/type/NativeType.java b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeType.java new file mode 100644 index 0000000..8d6ce44 --- /dev/null +++ b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeType.java @@ -0,0 +1,108 @@ +/*- + * #%L + * Nazgul Project: nativec-api + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% + * 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 intarsys 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 OWNER 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. + * #L% + */ +package de.intarsys.nativec.type; + +import java.util.HashMap; +import java.util.Map; + +import de.intarsys.nativec.api.INativeHandle; +public abstract class NativeType implements INativeType { + + /** + * All known meta classes. + */ + private static Map, INativeType> META_CLASSES = new HashMap, INativeType>(); + protected NativeType() { + // + } + + protected NativeType(Class instanceClass) { + register(instanceClass, this); + } + + public static synchronized INativeType lookup(Class clazz) { + + INativeType result = META_CLASSES.get(clazz); + if (result == null) { + ClassLoader classLoader; + + clazz.getClasses(); + classLoader = Thread.currentThread().getContextClassLoader(); + if (classLoader == null) { + classLoader = NativeType.class.getClassLoader(); + } + + try { + Class.forName(clazz.getName(), true, classLoader); + } catch (ClassNotFoundException ex) { + // ignore + } + result = META_CLASSES.get(clazz); + } + return result; + } + public static synchronized void register(Class clazz, INativeType type) { + META_CLASSES.put(clazz, type); + } + + /** + * Create a Declaration that represents an array of this. + * + * @return Create a Declaration that represents an array of this. + */ + public INativeType Array(int size) { + return new NativeArrayType(this, size); + } + + public INativeObject createNative(INativeHandle handle) { + throw new IllegalStateException("meta constructor missing"); + } + + public INativeObject createNative(Object value) { + throw new IllegalStateException("meta constructor missing"); + } + + public int getByteCount() { + return 0; + } + + /** + * Create a Declaration that represents a reference to this. + * + * @return Create a Declaration that represents a reference to this. + */ + public INativeType Ref() { + return new NativeReferenceType(this); + } +} diff --git a/nativec-api/src/main/java/de/intarsys/nativec/type/NativeVoid.java b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeVoid.java new file mode 100644 index 0000000..ed17098 --- /dev/null +++ b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeVoid.java @@ -0,0 +1,76 @@ +/*- + * #%L + * Nazgul Project: nativec-api + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% + * 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 intarsys 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 OWNER 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. + * #L% + */ +package de.intarsys.nativec.type; + +import de.intarsys.nativec.api.INativeHandle; +import de.intarsys.nativec.api.NativeInterface; +import de.intarsys.nativec.api.NativeTools; +public class NativeVoid extends NativeSimple { + + /** + * The meta class instance + */ + public static final NativeVoidType META = new NativeVoidType(); + + public static final NativeVoid NULL = (NativeVoid) META + .createNative(NativeInterface.NULL); + + static { + NativeType.register(NativeVoid.class, META); + } + + protected NativeVoid(INativeHandle handle) { + super(handle); + } + + static public NativeVoid createFromAddress(long address) { + return (NativeVoid) NativeVoid.META.createNative(NativeTools + .toHandle(address)); + } + + @Override + public INativeType getNativeType() { + return META; + } + + @Override + public Object getValue() { + throw new UnsupportedOperationException(); + } + + @Override + public void setValue(Object value) { + throw new UnsupportedOperationException(); + } +} diff --git a/nativec-api/src/main/java/de/intarsys/nativec/type/NativeVoidType.java b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeVoidType.java new file mode 100644 index 0000000..fc9e2fb --- /dev/null +++ b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeVoidType.java @@ -0,0 +1,57 @@ +/*- + * #%L + * Nazgul Project: nativec-api + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% + * 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 intarsys 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 OWNER 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. + * #L% + */ +package de.intarsys.nativec.type; + +import de.intarsys.nativec.api.INativeHandle; +public class NativeVoidType extends NativeSimpleType { + + protected NativeVoidType() { + super(); + } + + @Override + public INativeObject createNative(INativeHandle handle) { + return new NativeVoid(handle); + } + + @Override + public INativeObject createNative(Object value) { + throw new UnsupportedOperationException(); + } + + @Override + public int getByteCount() { + return 0; + } +} diff --git a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeWideString.java b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeWideString.java similarity index 96% rename from native-c-api/src/main/java/de/intarsys/nativec/type/NativeWideString.java rename to nativec-api/src/main/java/de/intarsys/nativec/type/NativeWideString.java index 7c16d05..c581e20 100644 --- a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeWideString.java +++ b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeWideString.java @@ -1,20 +1,23 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * +/*- + * #%L + * Nazgul Project: nativec-api + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% * 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 intarsys 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 @@ -26,15 +29,12 @@ * 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. + * #L% */ package de.intarsys.nativec.type; import de.intarsys.nativec.api.INativeHandle; import de.intarsys.nativec.api.NativeTools; - -/** - * A wrapper for a C wide (double byte) string. - */ public class NativeWideString extends NativeObject { /** diff --git a/nativec-api/src/main/java/de/intarsys/nativec/type/NativeWideStringType.java b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeWideStringType.java new file mode 100644 index 0000000..a8f6a2e --- /dev/null +++ b/nativec-api/src/main/java/de/intarsys/nativec/type/NativeWideStringType.java @@ -0,0 +1,72 @@ +/*- + * #%L + * Nazgul Project: nativec-api + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% + * 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 intarsys 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 OWNER 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. + * #L% + */ +package de.intarsys.nativec.type; + +import de.intarsys.nativec.api.CWideString; +import de.intarsys.nativec.api.INativeHandle; +public class NativeWideStringType extends NativeAbstractStringType { + + protected NativeWideStringType() { + super(2); + } + + protected NativeWideStringType(int size) { + super(size, 2); + } + + public static CWideString convert(String string) { + if (string == null) { + return null; + } + return new CWideString(string); + } + + public static NativeWideStringType create(int size) { + return new NativeWideStringType(size); + } + + public NativeObject createNative() { + return new NativeWideString(this); + } + + @Override + public NativeObject createNative(INativeHandle handle) { + return new NativeWideString(this, handle); + } + + @Override + public NativeObject createNative(Object value) { + return new NativeWideString(this, (String) value); + } +} diff --git a/native-c-api/src/main/java/de/intarsys/nativec/type/StructMember.java b/nativec-api/src/main/java/de/intarsys/nativec/type/StructMember.java similarity index 98% rename from native-c-api/src/main/java/de/intarsys/nativec/type/StructMember.java rename to nativec-api/src/main/java/de/intarsys/nativec/type/StructMember.java index 6b32457..6bd01cb 100644 --- a/native-c-api/src/main/java/de/intarsys/nativec/type/StructMember.java +++ b/nativec-api/src/main/java/de/intarsys/nativec/type/StructMember.java @@ -1,20 +1,23 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * +/*- + * #%L + * Nazgul Project: nativec-api + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% * 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 intarsys 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 @@ -26,14 +29,11 @@ * 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. + * #L% */ package de.intarsys.nativec.type; import de.intarsys.nativec.api.INativeHandle; - -/** - * A field definition within a {@link NativeStructType}. - */ public class StructMember { /** diff --git a/nativec-api/src/main/java/de/intarsys/nativec/type/package.html b/nativec-api/src/main/java/de/intarsys/nativec/type/package.html new file mode 100644 index 0000000..c69999c --- /dev/null +++ b/nativec-api/src/main/java/de/intarsys/nativec/type/package.html @@ -0,0 +1,38 @@ + + + +Here you find the data types and data structures for native c. + + From 23fa16cee84e4b1c4192058bf90708f08000323d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lennart=20J=C3=B6relid?= Date: Sat, 28 May 2022 14:12:37 +0200 Subject: [PATCH 08/10] Added codestyle resource module. --- doc/jna_license.txt | 5 - doc/lgpl-2.1.txt | 504 ------------------ native-c-api/pom.xml | 23 - .../java/de/intarsys/nativec/api/CLong.java | 80 --- .../de/intarsys/nativec/api/CWideString.java | 50 -- .../de/intarsys/nativec/api/ICallback.java | 47 -- .../intarsys/nativec/api/INativeFunction.java | 49 -- .../intarsys/nativec/api/INativeLibrary.java | 54 -- .../de/intarsys/nativec/api/IValueHolder.java | 52 -- .../nativec/api/ObjectValueHolder.java | 57 -- .../intarsys/nativec/type/INativeObject.java | 77 --- .../de/intarsys/nativec/type/INativeType.java | 89 ---- .../type/NativeAbstractStringType.java | 73 --- .../nativec/type/NativeArrayType.java | 96 ---- .../nativec/type/NativeBufferType.java | 78 --- .../intarsys/nativec/type/NativeByteType.java | 57 -- .../nativec/type/NativeGenericStruct.java | 66 --- .../intarsys/nativec/type/NativeIntType.java | 57 -- .../nativec/type/NativeLongLP64Type.java | 79 --- .../intarsys/nativec/type/NativeLongType.java | 57 -- .../intarsys/nativec/type/NativeNumber.java | 77 --- .../nativec/type/NativeNumberType.java | 40 -- .../nativec/type/NativeReferenceType.java | 79 --- .../nativec/type/NativeShortType.java | 57 -- .../intarsys/nativec/type/NativeSimple.java | 62 --- .../nativec/type/NativeSimpleType.java | 44 -- .../nativec/type/NativeStaticStruct.java | 47 -- .../nativec/type/NativeStringType.java | 64 --- .../de/intarsys/nativec/type/NativeType.java | 109 ---- .../de/intarsys/nativec/type/NativeVoid.java | 77 --- .../intarsys/nativec/type/NativeVoidType.java | 57 -- .../nativec/type/NativeWideStringType.java | 72 --- native-c-jna-impl/pom.xml | 36 -- .../main/java/de/intarsys/nativec/Opaque.java | 10 - .../de/intarsys/nativec/PseudoObject.java | 16 - .../de/intarsys/nativec/jna/JNATools.java | 13 - .../nativec/jna/JnaNativeCallbackAlt.java | 12 - .../nativec/jna/JnaNativeCallbackStd.java | 10 - pom.xml | 66 ++- 39 files changed, 37 insertions(+), 2561 deletions(-) delete mode 100644 doc/jna_license.txt delete mode 100644 doc/lgpl-2.1.txt delete mode 100644 native-c-api/pom.xml delete mode 100644 native-c-api/src/main/java/de/intarsys/nativec/api/CLong.java delete mode 100644 native-c-api/src/main/java/de/intarsys/nativec/api/CWideString.java delete mode 100644 native-c-api/src/main/java/de/intarsys/nativec/api/ICallback.java delete mode 100644 native-c-api/src/main/java/de/intarsys/nativec/api/INativeFunction.java delete mode 100644 native-c-api/src/main/java/de/intarsys/nativec/api/INativeLibrary.java delete mode 100644 native-c-api/src/main/java/de/intarsys/nativec/api/IValueHolder.java delete mode 100644 native-c-api/src/main/java/de/intarsys/nativec/api/ObjectValueHolder.java delete mode 100644 native-c-api/src/main/java/de/intarsys/nativec/type/INativeObject.java delete mode 100644 native-c-api/src/main/java/de/intarsys/nativec/type/INativeType.java delete mode 100644 native-c-api/src/main/java/de/intarsys/nativec/type/NativeAbstractStringType.java delete mode 100644 native-c-api/src/main/java/de/intarsys/nativec/type/NativeArrayType.java delete mode 100644 native-c-api/src/main/java/de/intarsys/nativec/type/NativeBufferType.java delete mode 100644 native-c-api/src/main/java/de/intarsys/nativec/type/NativeByteType.java delete mode 100644 native-c-api/src/main/java/de/intarsys/nativec/type/NativeGenericStruct.java delete mode 100644 native-c-api/src/main/java/de/intarsys/nativec/type/NativeIntType.java delete mode 100644 native-c-api/src/main/java/de/intarsys/nativec/type/NativeLongLP64Type.java delete mode 100644 native-c-api/src/main/java/de/intarsys/nativec/type/NativeLongType.java delete mode 100644 native-c-api/src/main/java/de/intarsys/nativec/type/NativeNumber.java delete mode 100644 native-c-api/src/main/java/de/intarsys/nativec/type/NativeNumberType.java delete mode 100644 native-c-api/src/main/java/de/intarsys/nativec/type/NativeReferenceType.java delete mode 100644 native-c-api/src/main/java/de/intarsys/nativec/type/NativeShortType.java delete mode 100644 native-c-api/src/main/java/de/intarsys/nativec/type/NativeSimple.java delete mode 100644 native-c-api/src/main/java/de/intarsys/nativec/type/NativeSimpleType.java delete mode 100644 native-c-api/src/main/java/de/intarsys/nativec/type/NativeStaticStruct.java delete mode 100644 native-c-api/src/main/java/de/intarsys/nativec/type/NativeStringType.java delete mode 100644 native-c-api/src/main/java/de/intarsys/nativec/type/NativeType.java delete mode 100644 native-c-api/src/main/java/de/intarsys/nativec/type/NativeVoid.java delete mode 100644 native-c-api/src/main/java/de/intarsys/nativec/type/NativeVoidType.java delete mode 100644 native-c-api/src/main/java/de/intarsys/nativec/type/NativeWideStringType.java delete mode 100644 native-c-jna-impl/pom.xml delete mode 100644 native-c-jna-impl/src/main/java/de/intarsys/nativec/Opaque.java delete mode 100644 native-c-jna-impl/src/main/java/de/intarsys/nativec/PseudoObject.java delete mode 100644 native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JNATools.java delete mode 100644 native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeCallbackAlt.java delete mode 100644 native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeCallbackStd.java diff --git a/doc/jna_license.txt b/doc/jna_license.txt deleted file mode 100644 index 7282b28..0000000 --- a/doc/jna_license.txt +++ /dev/null @@ -1,5 +0,0 @@ -This program uses jna (https://github.com/twall/jna). - -jna is governed by the LGPL license, available in this directory. - -jna source code is available at https://github.com/twall/jna. \ No newline at end of file diff --git a/doc/lgpl-2.1.txt b/doc/lgpl-2.1.txt deleted file mode 100644 index 602bfc9..0000000 --- a/doc/lgpl-2.1.txt +++ /dev/null @@ -1,504 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! - - diff --git a/native-c-api/pom.xml b/native-c-api/pom.xml deleted file mode 100644 index c94c9c2..0000000 --- a/native-c-api/pom.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - 4.0.0 - - - de.intarsys.opensource - native-c-parent - 1.0.0-SNAPSHOT - - - de.intarsys.opensource - native-c-api - 1.0.0-SNAPSHOT - jar - - - UTF-8 - - - - diff --git a/native-c-api/src/main/java/de/intarsys/nativec/api/CLong.java b/native-c-api/src/main/java/de/intarsys/nativec/api/CLong.java deleted file mode 100644 index 424cf64..0000000 --- a/native-c-api/src/main/java/de/intarsys/nativec/api/CLong.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * - * 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 intarsys 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 OWNER 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. - */ -package de.intarsys.nativec.api; - -/** - * A plain Java object representing a platform long. In contrast to the fixed 8 - * byte Java primitive type the platform long may vary in size, depending on - * operating system and processor architecture. - */ -public class CLong extends Number { - - private final Number value; - - public CLong(long pValue) { - value = pValue; - } - - @Override - public double doubleValue() { - return value.doubleValue(); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj instanceof CLong) { - return value.equals(((CLong) obj).value); - } - return false; - } - - @Override - public float floatValue() { - return value.floatValue(); - } - - @Override - public int hashCode() { - return value.hashCode(); - } - - @Override - public int intValue() { - return value.intValue(); - } - - @Override - public long longValue() { - return value.longValue(); - } -} diff --git a/native-c-api/src/main/java/de/intarsys/nativec/api/CWideString.java b/native-c-api/src/main/java/de/intarsys/nativec/api/CWideString.java deleted file mode 100644 index 08ad927..0000000 --- a/native-c-api/src/main/java/de/intarsys/nativec/api/CWideString.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * - * 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 intarsys 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 OWNER 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. - */ -package de.intarsys.nativec.api; - -/** - * Wrapper class to indicate use of a "wide" string on native side. - *

- * Use this to indicate on a native call parameter or return type that you will - * deal with the platforms wide string capabilities. - */ -final public class CWideString { - - private final String string; - - public CWideString(String string) { - super(); - this.string = string; - } - - public String getString() { - return string; - } -} diff --git a/native-c-api/src/main/java/de/intarsys/nativec/api/ICallback.java b/native-c-api/src/main/java/de/intarsys/nativec/api/ICallback.java deleted file mode 100644 index 2e1758f..0000000 --- a/native-c-api/src/main/java/de/intarsys/nativec/api/ICallback.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * - * 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 intarsys 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 OWNER 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. - */ -package de.intarsys.nativec.api; - -public interface ICallback { - - @Deprecated - Object CallingConventionCdecl = INativeFunction.CallingConventionCdecl; - - @Deprecated - Object CallingConventionStdcall = INativeFunction.CallingConventionCdecl; - - Object getCallingConvention(); - - Class[] getParameterTypes(); - - Class getReturnType(); - - Object invoke(Object[] objects); -} diff --git a/native-c-api/src/main/java/de/intarsys/nativec/api/INativeFunction.java b/native-c-api/src/main/java/de/intarsys/nativec/api/INativeFunction.java deleted file mode 100644 index 51c6ccc..0000000 --- a/native-c-api/src/main/java/de/intarsys/nativec/api/INativeFunction.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * - * 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 intarsys 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 OWNER 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. - */ -package de.intarsys.nativec.api; - -/** - * The representation of a native function. - */ -public interface INativeFunction { - - Object CallingConventionCdecl = new Object(); - Object CallingConventionStdcall = new Object(); - - /** - * Invoke the native function. - * - * @param returnType The expected return type. - * @param objects The arguments to the function - * - * @return The result of executing the function - */ - T invoke(Class returnType, Object... objects); -} diff --git a/native-c-api/src/main/java/de/intarsys/nativec/api/INativeLibrary.java b/native-c-api/src/main/java/de/intarsys/nativec/api/INativeLibrary.java deleted file mode 100644 index e0aca79..0000000 --- a/native-c-api/src/main/java/de/intarsys/nativec/api/INativeLibrary.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * - * 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 intarsys 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 OWNER 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. - */ -package de.intarsys.nativec.api; - -/** - * A native library (DLL or shared library). - */ -public interface INativeLibrary { - - /** - * Lookup a {@link INativeFunction} from the library. - * - * @param name The function name - * - * @return The {@link INativeFunction} - */ - INativeFunction getFunction(String name); - - /** - * Lookup a global in the library. - * - * @param symbolName The global name - * - * @return The {@link INativeHandle} to the global. - */ - INativeHandle getGlobal(String symbolName); -} diff --git a/native-c-api/src/main/java/de/intarsys/nativec/api/IValueHolder.java b/native-c-api/src/main/java/de/intarsys/nativec/api/IValueHolder.java deleted file mode 100644 index 116dffc..0000000 --- a/native-c-api/src/main/java/de/intarsys/nativec/api/IValueHolder.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2007, intarsys consulting GmbH - * - * 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 intarsys 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 OWNER 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. - */ -package de.intarsys.nativec.api; - -/** - * Generic interface for objects holding references to others. - */ -public interface IValueHolder { - - /** - * Dereference the {@link IValueHolder}. - * - * @return The referenced object. - */ - T get(); - - /** - * Assign a new value. - * - * @param newValue - * - * @return The previous value (optional) - */ - T set(T newValue); -} diff --git a/native-c-api/src/main/java/de/intarsys/nativec/api/ObjectValueHolder.java b/native-c-api/src/main/java/de/intarsys/nativec/api/ObjectValueHolder.java deleted file mode 100644 index ed257f3..0000000 --- a/native-c-api/src/main/java/de/intarsys/nativec/api/ObjectValueHolder.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2007, intarsys consulting GmbH - * - * 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 intarsys 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 OWNER 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. - */ -package de.intarsys.nativec.api; - -/** - * A object holding nothing but a value - *

- * This can easily be plugged in for a {@link IValueHolder}. - */ -public class ObjectValueHolder implements IValueHolder { - - private T value; - - public ObjectValueHolder(T value) { - super(); - this.value = value; - } - - @Override - public T get() { - return value; - } - - @Override - public T set(T newValue) { - T oldValue = value; - value = newValue; - return oldValue; - } -} diff --git a/native-c-api/src/main/java/de/intarsys/nativec/type/INativeObject.java b/native-c-api/src/main/java/de/intarsys/nativec/type/INativeObject.java deleted file mode 100644 index b94279a..0000000 --- a/native-c-api/src/main/java/de/intarsys/nativec/type/INativeObject.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * - * 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 intarsys 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 OWNER 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. - */ -package de.intarsys.nativec.type; - -import de.intarsys.nativec.api.INativeHandle; - -/** - * The Java object representation of a c memory construct. - *

- * The {@link INativeObject} has a reference to c memory (the - * {@link INativeHandle} and "marshalling" methods "getValue" and "setValue" to - * get and set the Java representation. - */ -public interface INativeObject { - - /** - * The bytes that make up the {@link INativeObject}. - * - * @return The bytes that make up the {@link INativeObject}. - */ - public byte[] getBytes(); - - /** - * The {@link INativeHandle} to the c memory for the object. - * - * @return The {@link INativeHandle} to the c memory for the object. - */ - public INativeHandle getNativeHandle(); - - /** - * The {@link INativeType} for the object. - * - * @return The {@link INativeType} for the object. - */ - public INativeType getNativeType(); - - /** - * A Java side representation from the memory. - * - * @return A Java side representation for the {@link INativeObject}. - */ - public Object getValue(); - - /** - * Assign (and marshall to memory) the Java side representation. - * - * @param value The new Java value. - */ - public void setValue(Object value); -} diff --git a/native-c-api/src/main/java/de/intarsys/nativec/type/INativeType.java b/native-c-api/src/main/java/de/intarsys/nativec/type/INativeType.java deleted file mode 100644 index 9526f48..0000000 --- a/native-c-api/src/main/java/de/intarsys/nativec/type/INativeType.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * - * 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 intarsys 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 OWNER 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. - */ -package de.intarsys.nativec.type; - -import de.intarsys.nativec.api.INativeHandle; - -/** - * The type (factory) for {@link INativeObject} instances. - *

- * A type has declaration style method to create more complex types. - */ -public interface INativeType { - - /** - * Create an array type from this. - * - * @param size The predefined size for the array. - * - * @return The derived type. - */ - public INativeType Array(int size); - - /** - * Create an {@link INativeObject} for this type from the Java object. - * - * @param value - * - * @return The new {@link INativeObject} - */ - public INativeObject createNative(Object value); - - /** - * Create a new {@link INativeObject} from a {@link INativeHandle}. - * - * @param handle The handle to memory. - * - * @return The new {@link INativeObject} - */ - public INativeObject createNative(INativeHandle handle); - - /** - * The boundary where this type as a struct member would want to be aligned. - * A structure can override this value with packing. - * - * @return The preferred alignment boundary. - */ - public int getPreferredBoundary(); - - /** - * The size of the type in c memory. - * - * @return The size of the type in c memory. - */ - public int getByteCount(); - - /** - * Create a reference type to this. - * - * @return The derived type. - */ - public INativeType Ref(); -} diff --git a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeAbstractStringType.java b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeAbstractStringType.java deleted file mode 100644 index 76b9c3d..0000000 --- a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeAbstractStringType.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * - * 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 intarsys 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 OWNER 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. - */ -package de.intarsys.nativec.type; - -import de.intarsys.nativec.api.NativeInterface; - -/** - * A meta class implementation - */ -public class NativeAbstractStringType extends NativeType { - - private final int characterSize; - private final int stringSize; - - protected NativeAbstractStringType(int pCharacterSize) { - super(); - characterSize = pCharacterSize; - stringSize = 0; - } - - protected NativeAbstractStringType(int pStringSize, int pCharacterSize) { - super(); - characterSize = pCharacterSize; - stringSize = pStringSize; - } - - @Override - public int getByteCount() { - if (stringSize == 0) { - throw new IllegalStateException(); - } - return stringSize * characterSize; - } - - public int getPreferredBoundary() { - return NativeInterface.get().pointerSize(); - } - - public int getStringSize() { - return stringSize; - } - - public boolean hasByteCount() { - return stringSize != 0; - } -} \ No newline at end of file diff --git a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeArrayType.java b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeArrayType.java deleted file mode 100644 index 63af297..0000000 --- a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeArrayType.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * - * 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 intarsys 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 OWNER 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. - */ -package de.intarsys.nativec.type; - -import de.intarsys.nativec.api.INativeHandle; - -/** - * The type for a {@link NativeArray} - */ -public class NativeArrayType extends NativeType { - - private final int arraySize; - /** - * The size of the base type of the array. - */ - private final int baseSize; - /** - * The base type of the array. - */ - private final INativeType baseType; - - protected NativeArrayType(INativeType baseDeclaration, int arraySize) { - super(); - this.baseType = baseDeclaration; - this.baseSize = baseDeclaration.getByteCount(); - this.arraySize = arraySize; - } - - public static NativeArrayType create(INativeType baseType, int size) { - return new NativeArrayType(baseType, size); - } - - @Override - public INativeObject createNative(INativeHandle handle) { - NativeArray array = new NativeArray(this, handle); - if (arraySize > 0) { - array.setSize(arraySize); - } - return array; - } - - @Override - public INativeObject createNative(Object value) { - NativeArray array = new NativeArray(this); - return array; - } - - public int getArraySize() { - return arraySize; - } - - public int getBaseSize() { - return baseSize; - } - - public INativeType getBaseType() { - return baseType; - } - - @Override - public int getByteCount() { - // todo take into account alignment / packing? - return arraySize * baseSize; - } - - public int getPreferredBoundary() { - return baseType.getPreferredBoundary(); - } -} diff --git a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeBufferType.java b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeBufferType.java deleted file mode 100644 index faa2ac8..0000000 --- a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeBufferType.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * - * 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 intarsys 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 OWNER 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. - */ -package de.intarsys.nativec.type; - -import de.intarsys.nativec.api.INativeHandle; - -/** - * The meta class implementation - */ -public class NativeBufferType extends NativeType { - - final private int bufferSize; - - protected NativeBufferType() { - super(); - this.bufferSize = 0; - } - - protected NativeBufferType(int bufferSize) { - super(); - this.bufferSize = bufferSize; - } - - public static NativeBufferType create(int size) { - return new NativeBufferType(size); - } - - @Override - public INativeObject createNative(INativeHandle handle) { - NativeBuffer buffer; - - buffer = new NativeBuffer(handle); - // setSize() creates a new type object - // TODO create constructor to use the existing one? - buffer.setSize(bufferSize); - return buffer; - } - - public int getBufferSize() { - return bufferSize; - } - - @Override - public int getByteCount() { - return bufferSize; - } - - public int getPreferredBoundary() { - return 1; - } -} \ No newline at end of file diff --git a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeByteType.java b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeByteType.java deleted file mode 100644 index 0bddf60..0000000 --- a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeByteType.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * - * 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 intarsys 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 OWNER 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. - */ -package de.intarsys.nativec.type; - -import de.intarsys.nativec.api.INativeHandle; - -/** - * The meta class implementation - */ -public class NativeByteType extends NativeNumberType { - - protected NativeByteType() { - super(); - } - - @Override - public INativeObject createNative(INativeHandle handle) { - return new NativeByte(handle); - } - - @Override - public INativeObject createNative(Object value) { - return new NativeByte(((Number) value).byteValue()); - } - - @Override - public int getByteCount() { - return NativeByte.SIZE_BYTE; - } -} \ No newline at end of file diff --git a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeGenericStruct.java b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeGenericStruct.java deleted file mode 100644 index bc75caf..0000000 --- a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeGenericStruct.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * - * 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 intarsys 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 OWNER 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. - */ -package de.intarsys.nativec.type; - -import de.intarsys.nativec.api.INativeHandle; - -/** - * The generic struct may change its type at runtime. - */ -public class NativeGenericStruct extends NativeStruct { - - private NativeStructType type; - - protected NativeGenericStruct(NativeStructType type) { - super(); - this.type = type; - allocate(); - } - - protected NativeGenericStruct(NativeStructType type, INativeHandle handle) { - super(handle); - this.type = type; - } - - @Override - public INativeType getNativeType() { - return type; - } - - public void setNativeType(NativeStructType type) { - this.type = type; - this.values = null; - } - - @Override - public NativeStructType getStructType() { - return type; - } -} diff --git a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeIntType.java b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeIntType.java deleted file mode 100644 index d638a63..0000000 --- a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeIntType.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * - * 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 intarsys 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 OWNER 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. - */ -package de.intarsys.nativec.type; - -import de.intarsys.nativec.api.INativeHandle; - -/** - * The meta class implementation - */ -public class NativeIntType extends NativeNumberType { - - protected NativeIntType() { - super(); - } - - @Override - public INativeObject createNative(INativeHandle handle) { - return new NativeInt(handle); - } - - @Override - public INativeObject createNative(Object value) { - return new NativeInt(((Number) value).longValue()); - } - - @Override - public int getByteCount() { - return NativeInt.SIZE_INT; - } -} \ No newline at end of file diff --git a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeLongLP64Type.java b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeLongLP64Type.java deleted file mode 100644 index 400f8a3..0000000 --- a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeLongLP64Type.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * - * 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 intarsys 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 OWNER 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. - */ -package de.intarsys.nativec.type; - -import de.intarsys.nativec.api.INativeHandle; - -/** - * The meta class implementation - */ -public class NativeLongLP64Type extends NativeNumberType { - - protected NativeLongLP64Type() { - super(); - } - - /** - * Utility method: return the given number as another number object with - * compatible byte size - */ - public static Object coerce(Number value) { - if (NativeObject.SIZE_PTR == 4) { - return value.intValue(); - } - return value.longValue(); - } - - /** - * Utility method: return the java class whose instances have compatible - * byte size - */ - public static Class primitiveClass() { - if (NativeObject.SIZE_PTR == 4) { - return Integer.class; - } - return Long.class; - } - - @Override - public INativeObject createNative(INativeHandle handle) { - return new NativeLongLP64(handle); - } - - @Override - public INativeObject createNative(Object value) { - return new NativeLongLP64(((Number) value).longValue()); - } - - @Override - public int getByteCount() { - return NativeObject.SIZE_PTR; - } -} \ No newline at end of file diff --git a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeLongType.java b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeLongType.java deleted file mode 100644 index f92e1c9..0000000 --- a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeLongType.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * - * 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 intarsys 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 OWNER 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. - */ -package de.intarsys.nativec.type; - -import de.intarsys.nativec.api.INativeHandle; - -/** - * The meta class implementation - */ -public class NativeLongType extends NativeNumberType { - - protected NativeLongType() { - super(); - } - - @Override - public INativeObject createNative(INativeHandle handle) { - return new NativeLong(handle); - } - - @Override - public INativeObject createNative(Object value) { - return new NativeLong(((Number) value).longValue()); - } - - @Override - public int getByteCount() { - return NativeLong.SIZE_LONG; - } -} \ No newline at end of file diff --git a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeNumber.java b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeNumber.java deleted file mode 100644 index 4fef55a..0000000 --- a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeNumber.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * - * 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 intarsys 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 OWNER 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. - */ -package de.intarsys.nativec.type; - -import de.intarsys.nativec.api.INativeHandle; - -/** - * An abstract superclass for the implementation of number - * {@link NativeSimple}. - */ -public abstract class NativeNumber extends NativeSimple { - - /** - * Create a wrapper - */ - protected NativeNumber() { - } - - protected NativeNumber(INativeHandle handle) { - super(handle); - } - - /** - * This as a java primitive byte value. - * - * @return This as a java primitive byte value. - */ - public abstract byte byteValue(); - - /** - * This as a java primitive int value. - * - * @return This as a java primitive int value. - */ - public abstract int intValue(); - - /** - * This as a java primitive long value. - * - * @return This as a java primitive long value. - */ - public abstract long longValue(); - - /** - * This as a java primitive short value. - * - * @return This as a java primitive short value. - */ - public abstract short shortValue(); -} diff --git a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeNumberType.java b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeNumberType.java deleted file mode 100644 index 8fb0ee7..0000000 --- a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeNumberType.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * - * 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 intarsys 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 OWNER 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. - */ -package de.intarsys.nativec.type; - -/** - * The meta class implementation - */ -public class NativeNumberType extends NativeSimpleType { - - protected NativeNumberType() { - super(); - } -} \ No newline at end of file diff --git a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeReferenceType.java b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeReferenceType.java deleted file mode 100644 index 3015493..0000000 --- a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeReferenceType.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * - * 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 intarsys 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 OWNER 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. - */ -package de.intarsys.nativec.type; - -import de.intarsys.nativec.api.INativeHandle; -import de.intarsys.nativec.api.NativeInterface; - -/** - * A declaration for a slot containing a reference to a native object. - */ -public class NativeReferenceType extends NativeType { - - /** - * The declaration for the dereference slot - */ - private final INativeType baseType; - - /** - * Declare a reference to a base type - */ - protected NativeReferenceType(INativeType baseDeclaration) { - super(); - this.baseType = baseDeclaration; - } - - public static NativeReferenceType create(INativeType baseType) { - return new NativeReferenceType(baseType); - } - - @Override - public INativeObject createNative(INativeHandle handle) { - return new NativeReference(this, handle); - } - - @Override - public INativeObject createNative(Object value) { - return new NativeReference(this); - } - - public INativeType getBaseType() { - return baseType; - } - - @Override - public int getByteCount() { - return NativeInterface.get().pointerSize(); - } - - public int getPreferredBoundary() { - return NativeInterface.get().pointerSize(); - } -} diff --git a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeShortType.java b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeShortType.java deleted file mode 100644 index d831056..0000000 --- a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeShortType.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * - * 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 intarsys 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 OWNER 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. - */ -package de.intarsys.nativec.type; - -import de.intarsys.nativec.api.INativeHandle; - -/** - * The meta class implementation - */ -public class NativeShortType extends NativeNumberType { - - protected NativeShortType() { - super(); - } - - @Override - public NativeObject createNative(INativeHandle handle) { - return new NativeShort(handle); - } - - @Override - public NativeObject createNative(Object value) { - return new NativeShort(((Number) value).shortValue()); - } - - @Override - public int getByteCount() { - return NativeShort.SIZE_SHORT; - } -} \ No newline at end of file diff --git a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeSimple.java b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeSimple.java deleted file mode 100644 index 525658e..0000000 --- a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeSimple.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * - * 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 intarsys 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 OWNER 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. - */ -package de.intarsys.nativec.type; - -import de.intarsys.nativec.api.INativeHandle; - -/** - * An abstract superclass for the implementation of primitive - * {@link NativeObject} instances. These {@link NativeObject} instances are not - * constructed from other {@link NativeObject} instances but implemented - * directly in Java, having a fixed size. - */ -public abstract class NativeSimple extends NativeObject { - - /** - * Create a wrapper for a NativePrimitive - */ - protected NativeSimple() { - } - - protected NativeSimple(INativeHandle handle) { - super(handle); - handle.setSize(getByteCount()); - } - - /* - * (non-Javadoc) - * - * @see de.intarsys.tools.nativec.NativeObject#getByteCount() - */ - @Override - public int getByteCount() { - return getNativeType().getByteCount(); - } -} diff --git a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeSimpleType.java b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeSimpleType.java deleted file mode 100644 index 50d84e9..0000000 --- a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeSimpleType.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * - * 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 intarsys 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 OWNER 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. - */ -package de.intarsys.nativec.type; - -/** - * The meta class implementation - */ -public class NativeSimpleType extends NativeType { - - protected NativeSimpleType() { - super(); - } - - public int getPreferredBoundary() { - return getByteCount(); - } -} \ No newline at end of file diff --git a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeStaticStruct.java b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeStaticStruct.java deleted file mode 100644 index a1b31be..0000000 --- a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeStaticStruct.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * - * 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 intarsys 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 OWNER 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. - */ -package de.intarsys.nativec.type; - -import de.intarsys.nativec.api.INativeHandle; - -/** - * A struct with a statically defined type. - */ -public abstract class NativeStaticStruct extends NativeStruct { - - protected NativeStaticStruct() { - allocate(); - } - - protected NativeStaticStruct(INativeHandle handle) { - super(handle); - handle.setSize(getByteCount()); - } -} diff --git a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeStringType.java b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeStringType.java deleted file mode 100644 index 72b3638..0000000 --- a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeStringType.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * - * 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 intarsys 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 OWNER 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. - */ -package de.intarsys.nativec.type; - -import de.intarsys.nativec.api.INativeHandle; - -/** - * The meta class implementation - */ -public class NativeStringType extends NativeAbstractStringType { - - protected NativeStringType() { - super(1); - } - - protected NativeStringType(int size) { - super(size, 1); - } - - public static NativeStringType create(int size) { - return new NativeStringType(size); - } - - public NativeObject createNative() { - return new NativeString(this); - } - - @Override - public NativeObject createNative(INativeHandle handle) { - return new NativeString(this, handle); - } - - @Override - public NativeObject createNative(Object value) { - return new NativeString(this, (String) value); - } -} \ No newline at end of file diff --git a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeType.java b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeType.java deleted file mode 100644 index 4df63de..0000000 --- a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeType.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * - * 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 intarsys 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 OWNER 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. - */ -package de.intarsys.nativec.type; - -import java.util.HashMap; -import java.util.Map; - -import de.intarsys.nativec.api.INativeHandle; - -/** - * A common superclass for {@link INativeType} implementations - */ -public abstract class NativeType implements INativeType { - - /** - * All known meta classes. - */ - private static Map, INativeType> metaClasses = new HashMap, INativeType>(); - - protected NativeType() { - // - } - - protected NativeType(Class instanceClass) { - register(instanceClass, this); - } - - public static synchronized INativeType lookup(Class clazz) { - INativeType result = metaClasses.get(clazz); - if (result == null) { - ClassLoader classLoader; - - clazz.getClasses(); - classLoader = Thread.currentThread().getContextClassLoader(); - if (classLoader == null) { - classLoader = NativeType.class.getClassLoader(); - } - - try { - Class.forName(clazz.getName(), true, classLoader); - } catch (ClassNotFoundException ex) { - // ignore - } - result = metaClasses.get(clazz); - } - return result; - } - - public static synchronized void register(Class clazz, INativeType type) { - metaClasses.put(clazz, type); - } - - /** - * Create a Declaration that represents an array of this. - * - * @return Create a Declaration that represents an array of this. - */ - public INativeType Array(int size) { - return new NativeArrayType(this, size); - } - - public INativeObject createNative(INativeHandle handle) { - throw new IllegalStateException("meta constructor missing"); - } - - public INativeObject createNative(Object value) { - throw new IllegalStateException("meta constructor missing"); - } - - public int getByteCount() { - return 0; - } - - /** - * Create a Declaration that represents a reference to this. - * - * @return Create a Declaration that represents a reference to this. - */ - public INativeType Ref() { - return new NativeReferenceType(this); - } -} diff --git a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeVoid.java b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeVoid.java deleted file mode 100644 index 4528aa4..0000000 --- a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeVoid.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * - * 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 intarsys 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 OWNER 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. - */ -package de.intarsys.nativec.type; - -import de.intarsys.nativec.api.INativeHandle; -import de.intarsys.nativec.api.NativeInterface; -import de.intarsys.nativec.api.NativeTools; - -/** - * An object representing "void" ("nothing" or rather nothing we can specify - * more explicitly). Mostly (only?) useful with references. - */ -public class NativeVoid extends NativeSimple { - - /** - * The meta class instance - */ - public static final NativeVoidType META = new NativeVoidType(); - - public static final NativeVoid NULL = (NativeVoid) META - .createNative(NativeInterface.NULL); - - static { - NativeType.register(NativeVoid.class, META); - } - - protected NativeVoid(INativeHandle handle) { - super(handle); - } - - static public NativeVoid createFromAddress(long address) { - return (NativeVoid) NativeVoid.META.createNative(NativeTools - .toHandle(address)); - } - - @Override - public INativeType getNativeType() { - return META; - } - - @Override - public Object getValue() { - throw new UnsupportedOperationException(); - } - - @Override - public void setValue(Object value) { - throw new UnsupportedOperationException(); - } -} diff --git a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeVoidType.java b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeVoidType.java deleted file mode 100644 index bc1a44a..0000000 --- a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeVoidType.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * - * 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 intarsys 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 OWNER 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. - */ -package de.intarsys.nativec.type; - -import de.intarsys.nativec.api.INativeHandle; - -/** - * The meta class implementation - */ -public class NativeVoidType extends NativeSimpleType { - - protected NativeVoidType() { - super(); - } - - @Override - public INativeObject createNative(INativeHandle handle) { - return new NativeVoid(handle); - } - - @Override - public INativeObject createNative(Object value) { - throw new UnsupportedOperationException(); - } - - @Override - public int getByteCount() { - return 0; - } -} \ No newline at end of file diff --git a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeWideStringType.java b/native-c-api/src/main/java/de/intarsys/nativec/type/NativeWideStringType.java deleted file mode 100644 index bd41079..0000000 --- a/native-c-api/src/main/java/de/intarsys/nativec/type/NativeWideStringType.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * - * 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 intarsys 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 OWNER 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. - */ -package de.intarsys.nativec.type; - -import de.intarsys.nativec.api.CWideString; -import de.intarsys.nativec.api.INativeHandle; - -/** - * The meta class implementation - */ -public class NativeWideStringType extends NativeAbstractStringType { - - protected NativeWideStringType() { - super(2); - } - - protected NativeWideStringType(int size) { - super(size, 2); - } - - public static CWideString convert(String string) { - if (string == null) { - return null; - } - return new CWideString(string); - } - - public static NativeWideStringType create(int size) { - return new NativeWideStringType(size); - } - - public NativeObject createNative() { - return new NativeWideString(this); - } - - @Override - public NativeObject createNative(INativeHandle handle) { - return new NativeWideString(this, handle); - } - - @Override - public NativeObject createNative(Object value) { - return new NativeWideString(this, (String) value); - } -} \ No newline at end of file diff --git a/native-c-jna-impl/pom.xml b/native-c-jna-impl/pom.xml deleted file mode 100644 index 0815733..0000000 --- a/native-c-jna-impl/pom.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - 4.0.0 - - - de.intarsys.opensource - native-c-parent - 1.0.0-SNAPSHOT - - - de.intarsys.opensource - native-c-jna-impl - 1.0.0-SNAPSHOT - jar - - - UTF-8 - - - - - de.intarsys.opensource - native-c-api - 1.0.0-SNAPSHOT - - - - net.java.dev.jna - jna - 5.11.0 - - - - diff --git a/native-c-jna-impl/src/main/java/de/intarsys/nativec/Opaque.java b/native-c-jna-impl/src/main/java/de/intarsys/nativec/Opaque.java deleted file mode 100644 index 0a0e921..0000000 --- a/native-c-jna-impl/src/main/java/de/intarsys/nativec/Opaque.java +++ /dev/null @@ -1,10 +0,0 @@ -package de.intarsys.nativec; - -import de.intarsys.nativec.type.NativeVoid; - -public class Opaque extends PseudoObject { - - public Opaque(NativeVoid nativeObject) { - super(nativeObject); - } -} diff --git a/native-c-jna-impl/src/main/java/de/intarsys/nativec/PseudoObject.java b/native-c-jna-impl/src/main/java/de/intarsys/nativec/PseudoObject.java deleted file mode 100644 index e9a9668..0000000 --- a/native-c-jna-impl/src/main/java/de/intarsys/nativec/PseudoObject.java +++ /dev/null @@ -1,16 +0,0 @@ -package de.intarsys.nativec; - -import de.intarsys.nativec.type.INativeObject; - -public class PseudoObject { - - private T nativeObject; - - public PseudoObject(T pNativeObject) { - nativeObject = pNativeObject; - } - - public T getNativeObject() { - return nativeObject; - } -} diff --git a/native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JNATools.java b/native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JNATools.java deleted file mode 100644 index 7c6d768..0000000 --- a/native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JNATools.java +++ /dev/null @@ -1,13 +0,0 @@ -package de.intarsys.nativec.jna; - -import com.sun.jna.Pointer; - -public class JNATools { - - public static long getPeer(Pointer p) { - if (p == null) { - return 0; - } - return Pointer.nativeValue(p); - } -} diff --git a/native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeCallbackAlt.java b/native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeCallbackAlt.java deleted file mode 100644 index 16a8e31..0000000 --- a/native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeCallbackAlt.java +++ /dev/null @@ -1,12 +0,0 @@ -package de.intarsys.nativec.jna; - -import com.sun.jna.AltCallingConvention; -import de.intarsys.nativec.api.ICallback; - -public class JnaNativeCallbackAlt extends JnaNativeCallback implements - AltCallingConvention { - - public JnaNativeCallbackAlt(ICallback pCallback) { - super(pCallback); - } -} diff --git a/native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeCallbackStd.java b/native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeCallbackStd.java deleted file mode 100644 index 7dfeff1..0000000 --- a/native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeCallbackStd.java +++ /dev/null @@ -1,10 +0,0 @@ -package de.intarsys.nativec.jna; - -import de.intarsys.nativec.api.ICallback; - -public class JnaNativeCallbackStd extends JnaNativeCallback { - - public JnaNativeCallbackStd(ICallback pCallback) { - super(pCallback); - } -} diff --git a/pom.xml b/pom.xml index 3b1874f..bb67989 100644 --- a/pom.xml +++ b/pom.xml @@ -1,34 +1,42 @@ - - 4.0.0 + + 4.0.0 - de.intarsys.opensource - native-c-parent - 1.0.0-SNAPSHOT - pom + + se.jguru.codestyle.poms.java + jguru-codestyle-java-reactor-parent + 1.2.0 + + - - UTF-8 - + de.intarsys.opensource.nativec.parent + nativec-parent + 1.0.0-SNAPSHOT + pom - - native-c-api - native-c-jna-impl - + + intarsys + - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.5.1 - - 11 - 11 - - - - - + + Intarsys Consulting GmbH + https://www.intarsys.de + + + + + Intarsys License + https://www.intarsys.de/licenses/intarsysSourceLicense.txt + repo + A business-friendly OSS license + + + + + nativec-codestyle + nativec-api + nativec-jna-impl + + From 5cbbe14f5da08d1e477b9e305760db97804e1227 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lennart=20J=C3=B6relid?= Date: Sat, 28 May 2022 14:13:11 +0200 Subject: [PATCH 09/10] Added codestyle and license header. Updated JNA to newest stable release. --- nativec-jna-impl/pom.xml | 83 +++++++++++++++++++ .../main/java/de/intarsys/nativec/Opaque.java | 43 ++++++++++ .../de/intarsys/nativec/PseudoObject.java | 49 +++++++++++ .../de/intarsys/nativec/jna/JNATools.java | 46 ++++++++++ .../nativec/jna/JnaNativeCallback.java | 18 ++-- .../nativec/jna/JnaNativeCallbackAlt.java | 45 ++++++++++ .../nativec/jna/JnaNativeCallbackStd.java | 43 ++++++++++ .../nativec/jna/JnaNativeFunction.java | 18 ++-- .../intarsys/nativec/jna/JnaNativeHandle.java | 18 ++-- .../nativec/jna/JnaNativeInterface.java | 18 ++-- .../nativec/jna/JnaNativeLibrary.java | 18 ++-- .../de.intarsys.nativec.api.INativeInterface | 0 12 files changed, 364 insertions(+), 35 deletions(-) create mode 100644 nativec-jna-impl/pom.xml create mode 100644 nativec-jna-impl/src/main/java/de/intarsys/nativec/Opaque.java create mode 100644 nativec-jna-impl/src/main/java/de/intarsys/nativec/PseudoObject.java create mode 100644 nativec-jna-impl/src/main/java/de/intarsys/nativec/jna/JNATools.java rename {native-c-jna-impl => nativec-jna-impl}/src/main/java/de/intarsys/nativec/jna/JnaNativeCallback.java (97%) create mode 100644 nativec-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeCallbackAlt.java create mode 100644 nativec-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeCallbackStd.java rename {native-c-jna-impl => nativec-jna-impl}/src/main/java/de/intarsys/nativec/jna/JnaNativeFunction.java (97%) rename {native-c-jna-impl => nativec-jna-impl}/src/main/java/de/intarsys/nativec/jna/JnaNativeHandle.java (97%) rename {native-c-jna-impl => nativec-jna-impl}/src/main/java/de/intarsys/nativec/jna/JnaNativeInterface.java (98%) rename {native-c-jna-impl => nativec-jna-impl}/src/main/java/de/intarsys/nativec/jna/JnaNativeLibrary.java (95%) rename {native-c-jna-impl => nativec-jna-impl}/src/main/resources/META-INF/services/de.intarsys.nativec.api.INativeInterface (100%) diff --git a/nativec-jna-impl/pom.xml b/nativec-jna-impl/pom.xml new file mode 100644 index 0000000..9110c74 --- /dev/null +++ b/nativec-jna-impl/pom.xml @@ -0,0 +1,83 @@ + + + 4.0.0 + + + se.jguru.codestyle.poms.java + jguru-codestyle-java-parent + 1.2.0 + + + + de.intarsys.opensource.nativec.impl.jna + nativec-jna-impl + 1.0.0-SNAPSHOT + jar + + + intarsys + + + 2013 + + + Intarsys Consulting GmbH + https://www.intarsys.de + + + + + Intarsys License + https://www.intarsys.de/licenses/intarsysSourceLicense.txt + repo + A business-friendly OSS license + + + + + + de.intarsys.opensource + native-c-api + 1.0.0-SNAPSHOT + + + + net.java.dev.jna + jna + 5.11.0 + + + + de.intarsys.opensource.nativec.codestyle + nativec-codestyle + 1.0.0-SNAPSHOT + compile + + + + + + + + + + org.codehaus.mojo + license-maven-plugin + 2.0.0 + + + + de.intarsys.opensource.nativec.codestyle + nativec-codestyle + 1.0.0-SNAPSHOT + + + + + + + diff --git a/nativec-jna-impl/src/main/java/de/intarsys/nativec/Opaque.java b/nativec-jna-impl/src/main/java/de/intarsys/nativec/Opaque.java new file mode 100644 index 0000000..3c0f099 --- /dev/null +++ b/nativec-jna-impl/src/main/java/de/intarsys/nativec/Opaque.java @@ -0,0 +1,43 @@ +/*- + * #%L + * Nazgul Project: nativec-jna-impl + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% + * 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 intarsys 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 OWNER 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. + * #L% + */ +package de.intarsys.nativec; + +import de.intarsys.nativec.type.NativeVoid; + +public class Opaque extends PseudoObject { + + public Opaque(NativeVoid nativeObject) { + super(nativeObject); + } +} diff --git a/nativec-jna-impl/src/main/java/de/intarsys/nativec/PseudoObject.java b/nativec-jna-impl/src/main/java/de/intarsys/nativec/PseudoObject.java new file mode 100644 index 0000000..f96c106 --- /dev/null +++ b/nativec-jna-impl/src/main/java/de/intarsys/nativec/PseudoObject.java @@ -0,0 +1,49 @@ +/*- + * #%L + * Nazgul Project: nativec-jna-impl + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% + * 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 intarsys 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 OWNER 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. + * #L% + */ +package de.intarsys.nativec; + +import de.intarsys.nativec.type.INativeObject; + +public class PseudoObject { + + private T nativeObject; + + public PseudoObject(T pNativeObject) { + nativeObject = pNativeObject; + } + + public T getNativeObject() { + return nativeObject; + } +} diff --git a/nativec-jna-impl/src/main/java/de/intarsys/nativec/jna/JNATools.java b/nativec-jna-impl/src/main/java/de/intarsys/nativec/jna/JNATools.java new file mode 100644 index 0000000..54fb738 --- /dev/null +++ b/nativec-jna-impl/src/main/java/de/intarsys/nativec/jna/JNATools.java @@ -0,0 +1,46 @@ +/*- + * #%L + * Nazgul Project: nativec-jna-impl + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% + * 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 intarsys 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 OWNER 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. + * #L% + */ +package de.intarsys.nativec.jna; + +import com.sun.jna.Pointer; + +public class JNATools { + + public static long getPeer(Pointer p) { + if (p == null) { + return 0; + } + return Pointer.nativeValue(p); + } +} diff --git a/native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeCallback.java b/nativec-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeCallback.java similarity index 97% rename from native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeCallback.java rename to nativec-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeCallback.java index dc3c5a7..261ec63 100644 --- a/native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeCallback.java +++ b/nativec-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeCallback.java @@ -1,20 +1,23 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * +/*- + * #%L + * Nazgul Project: nativec-jna-impl + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% * 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 intarsys 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 @@ -26,6 +29,7 @@ * 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. + * #L% */ package de.intarsys.nativec.jna; diff --git a/nativec-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeCallbackAlt.java b/nativec-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeCallbackAlt.java new file mode 100644 index 0000000..d638e0d --- /dev/null +++ b/nativec-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeCallbackAlt.java @@ -0,0 +1,45 @@ +/*- + * #%L + * Nazgul Project: nativec-jna-impl + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% + * 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 intarsys 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 OWNER 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. + * #L% + */ +package de.intarsys.nativec.jna; + +import com.sun.jna.AltCallingConvention; +import de.intarsys.nativec.api.ICallback; + +public class JnaNativeCallbackAlt extends JnaNativeCallback implements + AltCallingConvention { + + public JnaNativeCallbackAlt(ICallback pCallback) { + super(pCallback); + } +} diff --git a/nativec-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeCallbackStd.java b/nativec-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeCallbackStd.java new file mode 100644 index 0000000..9fef206 --- /dev/null +++ b/nativec-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeCallbackStd.java @@ -0,0 +1,43 @@ +/*- + * #%L + * Nazgul Project: nativec-jna-impl + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% + * 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 intarsys 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 OWNER 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. + * #L% + */ +package de.intarsys.nativec.jna; + +import de.intarsys.nativec.api.ICallback; + +public class JnaNativeCallbackStd extends JnaNativeCallback { + + public JnaNativeCallbackStd(ICallback pCallback) { + super(pCallback); + } +} diff --git a/native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeFunction.java b/nativec-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeFunction.java similarity index 97% rename from native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeFunction.java rename to nativec-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeFunction.java index 70aa3dc..68d0cfe 100644 --- a/native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeFunction.java +++ b/nativec-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeFunction.java @@ -1,20 +1,23 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * +/*- + * #%L + * Nazgul Project: nativec-jna-impl + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% * 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 intarsys 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 @@ -26,6 +29,7 @@ * 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. + * #L% */ package de.intarsys.nativec.jna; diff --git a/native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeHandle.java b/nativec-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeHandle.java similarity index 97% rename from native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeHandle.java rename to nativec-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeHandle.java index 80f81a2..c339565 100644 --- a/native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeHandle.java +++ b/nativec-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeHandle.java @@ -1,20 +1,23 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * +/*- + * #%L + * Nazgul Project: nativec-jna-impl + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% * 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 intarsys 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 @@ -26,6 +29,7 @@ * 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. + * #L% */ package de.intarsys.nativec.jna; diff --git a/native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeInterface.java b/nativec-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeInterface.java similarity index 98% rename from native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeInterface.java rename to nativec-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeInterface.java index 538d232..3920af5 100644 --- a/native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeInterface.java +++ b/nativec-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeInterface.java @@ -1,20 +1,23 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * +/*- + * #%L + * Nazgul Project: nativec-jna-impl + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% * 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 intarsys 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 @@ -26,6 +29,7 @@ * 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. + * #L% */ package de.intarsys.nativec.jna; diff --git a/native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeLibrary.java b/nativec-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeLibrary.java similarity index 95% rename from native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeLibrary.java rename to nativec-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeLibrary.java index 23fa3ff..db37d83 100644 --- a/native-c-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeLibrary.java +++ b/nativec-jna-impl/src/main/java/de/intarsys/nativec/jna/JnaNativeLibrary.java @@ -1,20 +1,23 @@ -/* - * Copyright (c) 2008, intarsys consulting GmbH - * +/*- + * #%L + * Nazgul Project: nativec-jna-impl + * %% + * Copyright (C) 2013 - 2022 Intarsys Consulting GmbH + * %% * 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 intarsys 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 @@ -26,6 +29,7 @@ * 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. + * #L% */ package de.intarsys.nativec.jna; diff --git a/native-c-jna-impl/src/main/resources/META-INF/services/de.intarsys.nativec.api.INativeInterface b/nativec-jna-impl/src/main/resources/META-INF/services/de.intarsys.nativec.api.INativeInterface similarity index 100% rename from native-c-jna-impl/src/main/resources/META-INF/services/de.intarsys.nativec.api.INativeInterface rename to nativec-jna-impl/src/main/resources/META-INF/services/de.intarsys.nativec.api.INativeInterface From b8028fb44b776d31699c1fc938072a0a0ee0eedf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lennart=20J=C3=B6relid?= Date: Sat, 28 May 2022 14:24:14 +0200 Subject: [PATCH 10/10] Changed to standard Markdown in README file. --- README.textile => README.md | 259 ++++++++++++++++-------------------- 1 file changed, 116 insertions(+), 143 deletions(-) rename README.textile => README.md (64%) diff --git a/README.textile b/README.md similarity index 64% rename from README.textile rename to README.md index ec569d3..b16df0d 100644 --- a/README.textile +++ b/README.md @@ -1,33 +1,29 @@ -h1. intarsys native-c +# intarsys native-c -h2. Overview +## Overview This is "another" JNI wrapping library, but in some regards quite different. -p. The real memory / JNI access semantics is delegated to some concrete service implementation. Actually we don't provide one of our own, the default implementation we use is JNA. -p. The real strength of this library is its high level model of JNI access, allowing more easy and understandable API's. We feel that at this point most of the candidates we reviewed are quite poor or hard to understand. -p. The design goals were as follows: -# Provide access to all levels of a native interface. As we can not forsee what different libaries and systems will work together, access is provided from bottom up using the plain address as the least common denominator. -# Provide clean abstractions -# Differentiate between a "pointer" or "memory handle" and the data semantics. This allows to work as well using plain pointer arithmetics as object state access. +1. Provide access to all levels of a native interface. As we can not forsee what different libaries and systems will work together, access is provided from bottom up using the plain address as the least common denominator. +2. Provide clean abstractions +3. Differentiate between a "pointer" or "memory handle" and the data semantics. This allows to work as well using plain pointer arithmetics as object state access. -p. The high level model provides the following abstractions: -# Interface The concrete implementation for accessing JNI. This interface is quite small and allows for the adaption of many JNI libraries out there. It should not be to hard to create one of your own. -# Library The loadable library providing state and behavior. -# Function The behavior part of the library, accepting parameters and return results. -# Handle An abstraction of a pointer, without any data specific features. This could be viewed as a plain wrapper around an address, another representation for "void *". -# Object The data referenced by a handle (or pointer). The object deals with the bytes referenced by the handle. +1. Interface The concrete implementation for accessing JNI. This interface is quite small and allows for the adaption of many JNI libraries out there. It should not be to hard to create one of your own. +2. Library The loadable library providing state and behavior. +3. Function The behavior part of the library, accepting parameters and return results. +4. Handle An abstraction of a pointer, without any data specific features. This could be viewed as a plain wrapper around an address, another representation for "void *". +5. Object The data referenced by a handle (or pointer). The object deals with the bytes referenced by the handle. The object defines the semantics of how to interpret the memory referenced by the handle. The handle defines "where" to find data, the object defines "what" data you will find there - @@ -37,26 +33,23 @@ On the C side, the object is always represented by the handle / pointer. This me is always used and forwarded by reference. Do not confuse this with the handling on primitive types. In this code snippet -bc. -int a; -NativeInt b = new NativeInt(); -... -int result = function.invoke(Integer.class, a, b); -... - + + int a; + NativeInt b = new NativeInt(); + ... + int result = function.invoke(Integer.class, a, b); + ... the function is called using the value of "a" and a pointer to "b". - -p. This library currently does not provide any convenience for some aspects of native calls, for example -# primitive arrays -# float / double support -# String encodings -# callbacks -# maybe other features we didn't need until now and so are not aware of.. +- primitive arrays +- float / double support +- String encodings +- callbacks +- maybe other features we didn't need until now and so are not aware of.. The underlying infrastructure (JNA) may handle such constructs, but as long as the semantics is not defined on this library level, you should expect unportable @@ -65,215 +58,194 @@ behavior. We propose, even if not convenient, to express all call semantics using documented features only. Feel free to ask for the inclusion of more library features. -h2. Build +## Build + +The project is divided into an API project and a JNA implementation project. +Both are built using Maven using the ```clean install``` standard pattern: -The project is committed as a self contained Eclipse project and should compile without problems there. + mvn clean install -Anyone in Ant is kindly asked to provide a script... (as for maven) -h2. Dependencies +## Dependencies This library consists of a platform independent part and a provider implementation. A provider based on JNA is included and as such you need the jna.jar to compile and run. -h2. Usage +## Usage -h3. Common scenarios +### Common scenarios -h4. Call functions with primitive types +#### Call functions with primitive types The most simple calls use only primitive types. These are mapped by the "invoke" itself using builtin rules to target the C types. -p. The C part may look like this: -bc. -int intValue; -float floatValue; -... -int result = function(intValue, floatValue); -... + int intValue; + float floatValue; + ... + int result = function(intValue, floatValue); + ... -p. An equivalent call from Java would look like: -bc. -int intValue; -float floatValue; -... -int result = function.invoke(Integer.class, intValue, floatValue); -... -... + int intValue; + float floatValue; + ... + int result = function.invoke(Integer.class, intValue, floatValue); + ... + ... This seems straightforward.... -h4. Call functions with String parameters +#### Call functions with String parameters The first problems are expected when dealing with strings or char* on the C side. But no problem here: -p. The C part may look like this: -bc. -char* string = "test"; -... -int result = function(string); -... + char* string = "test"; + ... + int result = function(string); + ... + -p. An equivalent call from Java would look like: -bc. -String string = "test"; -... -int result = function.invoke(Integer.class, string); -... + String string = "test"; + ... + int result = function.invoke(Integer.class, string); + ... String semantics are handled internally. Even the platform wide character features can be accessed quite easy - simply wrap the String in a "WideString" to indicate the special treatment on invocation marshalling. -bc. -String string = "test"; -WideString wideString = new WideString(string); -... -int result = function.invoke(Integer.class, wideString); -... + + String string = "test"; + WideString wideString = new WideString(string); + ... + int result = function.invoke(Integer.class, wideString); + ... In much the same way you can request a wide string conversion on the result. -bc. -... -WideString result = function.invoke(WideString.class); -String string = result.toString(); -... + ... + WideString result = function.invoke(WideString.class); + String string = result.toString(); + ... -h4. Call with parameters "by reference" (out parameters) +#### Call with parameters "by reference" (out parameters) Other functions return values via "out" parameters, via references to C memory. -p. The C part may look like this: -bc. -int value; - -... -int result = function(&value); -if (value == 42) { + int value; + + ... + int result = function(&value); + if (value == 42) { + ... + } ... -} -... -p. An equivalent call from Java would look like: -bc. -NativeInt value = new NativeInt(); + NativeInt value = new NativeInt(); -int result = function.invoke(Integer.class, value); -if (value.intValue() == 42) { + int result = function.invoke(Integer.class, value); + if (value.intValue() == 42) { + ... + } ... -} -... The NativeObject is allocated in C memory and forwarded "by reference". This call pattern stays the same regardless of the complexity of the NativeObject - so this is the call for your Java side definition of the C struct: -bc. -// allocates memory for the struct in C -MyStruct value = new MyStruct(); + // allocates memory for the struct in C + MyStruct value = new MyStruct(); -// call function with a pointer to the new struct -int result = function.invoke(Integer.class, value); -... + // call function with a pointer to the new struct + int result = function.invoke(Integer.class, value); + ... -h4. Wrapping pointers returned from out parameters +#### Wrapping pointers returned from out parameters With C you find quite often a pointer to a newly create memory chunk returned via an out parameter. -bc. -my_struct *value; -... -function(&value); -int a = value->a; -... + my_struct *value; + ... + function(&value); + int a = value->a; + ... This is one of the rare occasions you will deal with the "NativeReference" directly. If we follow exactly the pattern we have used so far we get: -bc. -// allocate memory for holding a pointer to a struct -NativeReference ptrValue = new NativeReference(MyStruct.META); -// call the function with the pointer to the pointer -int result = function.invoke(Integer.class, ptrValue); -// dereference the result... -MyStruct value = (MyStruct)ptrValue.getValue(); - + // allocate memory for holding a pointer to a struct + NativeReference ptrValue = new NativeReference(MyStruct.META); + // call the function with the pointer to the pointer + int result = function.invoke(Integer.class, ptrValue); + // dereference the result... + MyStruct value = (MyStruct)ptrValue.getValue(); Here's a common pattern to manage "transparent" handles that do not designate data structures you should deal with - for sure you can declare a NativeVoid subclass of you own for better readability or to add methods. -bc. -// allocate memory for holding a void pointer -NativeReference ptrValue = new NativeReference(NativeVoid.META); -// call the function with the pointer to the pointer -int result = function.invoke(Integer.class, value); -// dereference the result... -NativeVoid value = (NativeVoid)ptrValue.getValue(); + // allocate memory for holding a void pointer + NativeReference ptrValue = new NativeReference(NativeVoid.META); + // call the function with the pointer to the pointer + int result = function.invoke(Integer.class, value); + // dereference the result... + NativeVoid value = (NativeVoid)ptrValue.getValue(); -h4. Wrapping a pointer returned as function result +#### Wrapping a pointer returned as function result Many functions return handles to newly created objects. Wrapping this result to the INativeObject framework is simply a matter of declaration: -bc. -NativeVoid result = function.invoke(NativeVoid.class, ...); + NativeVoid result = function.invoke(NativeVoid.class, ...); You have just wrapped a "void *" (void pointer)! Notice how you "hide" the C reference or pointer semantics. The less you think about it, the more it is intuitive :-). Using this code will return "null" in case of a "0" address. -p. NativeVoid is a "stateless" object, declaring to be of size "0". This is often the case with transparent handles to some proprietary / private information. Only the handle itself is used to manipulate state via the associated library functions. -p. In much the same way you can create a NativeStruct instances, holding public state information and allowing easy access to it. -p. Assume you have defined a NativeStruct subclass "MyStruct" of any memory layout. The above code sequence changes to -bc. -MyStruct structObj = function.invoke(MyStruct.class, ...); + MyStruct structObj = function.invoke(MyStruct.class, ...); Behind this code is a simple two step process. You can do it manually if the default is not exactly what you want, for example in some cases where an address of "-1" means failure. -# Create the INativeHandle wrapper. This object represents a memory address and implements some access primitives -# Use the INativeHandle to build the INativeObject wrapper that is situated at this memory location. This can be any of the INativeObject subclasses, such as a primitive, composite or even void representation. +- Create the INativeHandle wrapper. This object represents a memory address and implements some access primitives +- Use the INativeHandle to build the INativeObject wrapper that is situated at this memory location. This can be any of the INativeObject subclasses, such as a primitive, composite or even void representation. + -bc. -int address = function.invoke(Integer.class, ...); -if (address == 0) { - return null; -} -INativeHandle handle = NativeInterface.get().createHandle(address); -return NativeVoid.META.createNative(handle); + int address = function.invoke(Integer.class, ...); + if (address == 0) { + return null; + } + INativeHandle handle = NativeInterface.get().createHandle(address); + return NativeVoid.META.createNative(handle); -p. The pointer, represented by the INativeHandle is wrapped by a NativeObject which is what is referenced by the pointer. -h4. Primitive arrays and buffers +#### Primitive arrays and buffers You can call a native function using primitive arrays the same way as using plain primitives. The basic marshalling will map the values in both direction, so you see C side changes in the @@ -296,9 +268,9 @@ between Java and C. In any case you may use a NativeBuffer and access the memory allocated in heap space from both sides. NativeBuffer can be seen as an explicit equivalent to a DirectBuffer. -h2. License +## License -bc. +

 /*
  * Copyright (c) 2013, intarsys consulting GmbH
  *
@@ -330,13 +302,13 @@ bc.
  */
 
-h2. Service & Support +## Service & Support -Service&support should be funneled through the tools available with Github. +Service & support should be funneled through the tools available with Github. If you need further assistance, contact us. -bc. +
 
 intarsys consulting GmbH
 Kriegstrasse 100
 76135 Karlsruhe
@@ -344,3 +316,4 @@ Fon +49 721 38479-0
 Fax +49 721 38479-60
 info@intarsys.de
 www.intarsys.de
+