[SCM] Java Abstracted Foreign Function Layer branch, master, updated. debian/0.5.4-1.1-3-g7c6ae7d
Damien Raude-Morvan
drazzib at debian.org
Thu Dec 20 23:24:51 UTC 2012
The following commit has been merged in the master branch:
commit 6b2c5f08e972e90d70d52b39d51994fa2f4a3db6
Author: Damien Raude-Morvan <drazzib at debian.org>
Date: Wed Aug 29 22:27:10 2012 +0200
Imported Upstream version 0.5.9
diff --git a/LICENSE b/LICENSE
index ca27eda..a3a8343 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,19 +1,25 @@
-Copyright (c) 2008 Wayne Meissner
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
+ http://www.apache.org/licenses/LICENSE-2.0
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
+
+ Alternatively, 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 3 of the License, or
+ (at your option) any later version.
+
+ This code is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ version 3 for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ version 3 along with this work. If not, see <http://www.gnu.org/licenses/>.
diff --git a/libtest/Benchmark.c b/libtest/Benchmark.c
index 44de6c2..bd3bbf0 100644
--- a/libtest/Benchmark.c
+++ b/libtest/Benchmark.c
@@ -1,20 +1,3 @@
-/*
- * Copyright (c) 2007 Wayne Meissner. All rights reserved.
- *
- * This file is part of jffi.
- *
- * This code is free software: you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License version 3 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
- * version 3 for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with this work. If not, see <http://www.gnu.org/licenses/>.
- */
void returnVoid() {
diff --git a/libtest/BufferTest.c b/libtest/BufferTest.c
index 5f8cc36..443027c 100644
--- a/libtest/BufferTest.c
+++ b/libtest/BufferTest.c
@@ -1,21 +1,3 @@
-/*
- * Copyright (C) 2007 Wayne Meissner
- *
- * This file is part of jffi.
- *
- * This code is free software: you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License version 3 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
- * version 3 for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with this work. If not, see <http://www.gnu.org/licenses/>.
- */
-
#define MEMSET(buf, value, size) do { \
int i; for (i = 0; i < size; ++i) buf[i] = value; \
diff --git a/libtest/ClosureTest.c b/libtest/ClosureTest.c
index d56e543..5767f61 100644
--- a/libtest/ClosureTest.c
+++ b/libtest/ClosureTest.c
@@ -1,20 +1,3 @@
-/*
- * Copyright (c) 2007 Wayne Meissner. All rights reserved.
- *
- * This file is part of jffi.
- *
- * This code is free software: you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License version 3 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
- * version 3 for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with this work. If not, see <http://www.gnu.org/licenses/>.
- */
void testClosureVrV(void (*closure)(void))
{
diff --git a/libtest/LastErrorTest.c b/libtest/LastErrorTest.c
index 146e605..11cea64 100644
--- a/libtest/LastErrorTest.c
+++ b/libtest/LastErrorTest.c
@@ -1,20 +1,4 @@
-/*
- * Copyright (c) 2008 Wayne Meissner. All rights reserved.
- *
- * This file is part of jffi.
- *
- * This code is free software: you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License version 3 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
- * version 3 for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with this work. If not, see <http://www.gnu.org/licenses/>.
- */
+
#include <errno.h>
int setLastError(int error) {
diff --git a/libtest/NumberTest.c b/libtest/NumberTest.c
index 0f129da..0ec2356 100644
--- a/libtest/NumberTest.c
+++ b/libtest/NumberTest.c
@@ -1,20 +1,3 @@
-/*
- * Copyright (c) 2007 Wayne Meissner. All rights reserved.
- *
- * This file is part of jffi.
- *
- * This code is free software: you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License version 3 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
- * version 3 for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with this work. If not, see <http://www.gnu.org/licenses/>.
- */
#include <stdio.h>
#include <stdint.h>
diff --git a/libtest/PointerTest.c b/libtest/PointerTest.c
index ae9203d..61a8767 100644
--- a/libtest/PointerTest.c
+++ b/libtest/PointerTest.c
@@ -1,20 +1,3 @@
-/*
- * Copyright (c) 2007 Wayne Meissner. All rights reserved.
- *
- * This file is part of jffi.
- *
- * This code is free software: you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License version 3 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
- * version 3 for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with this work. If not, see <http://www.gnu.org/licenses/>.
- */
#include <sys/types.h>
#include <sys/param.h>
diff --git a/libtest/ReferenceTest.c b/libtest/ReferenceTest.c
index 1c112c4..d570419 100644
--- a/libtest/ReferenceTest.c
+++ b/libtest/ReferenceTest.c
@@ -1,20 +1,4 @@
-/*
- * Copyright (c) 2007 Wayne Meissner. All rights reserved.
- *
- * This file is part of jffi.
- *
- * This code is free software: you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License version 3 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
- * version 3 for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with this work. If not, see <http://www.gnu.org/licenses/>.
- */
+
#include <stdint.h>
diff --git a/libtest/StringTest.c b/libtest/StringTest.c
index bb8c7df..d910801 100644
--- a/libtest/StringTest.c
+++ b/libtest/StringTest.c
@@ -1,20 +1,3 @@
-/*
- * Copyright (c) 2007 Wayne Meissner. All rights reserved.
- *
- * This file is part of jffi.
- *
- * This code is free software: you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License version 3 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
- * version 3 for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with this work. If not, see <http://www.gnu.org/licenses/>.
- */
#include <string.h>
diff --git a/libtest/StructTest.c b/libtest/StructTest.c
index 35d5d77..6d402bd 100644
--- a/libtest/StructTest.c
+++ b/libtest/StructTest.c
@@ -1,20 +1,3 @@
-/*
- * Copyright (c) 2007 Wayne Meissner. All rights reserved.
- *
- * This file is part of jffi.
- *
- * This code is free software: you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License version 3 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
- * version 3 for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with this work. If not, see <http://www.gnu.org/licenses/>.
- */
#include <stdio.h>
#include <stdbool.h>
diff --git a/nbproject/project.properties b/nbproject/project.properties
index ddf0ad2..79d9d45 100644
--- a/nbproject/project.properties
+++ b/nbproject/project.properties
@@ -26,7 +26,7 @@ file.reference.asm-commons-3.2.jar=lib/asm-commons-3.2.jar
file.reference.asm-tree-3.2.jar=lib/asm-tree-3.2.jar
file.reference.asm-util-3.2.jar=lib/asm-util-3.2.jar
file.reference.asm-xml-3.2.jar=lib/asm-xml-3.2.jar
-file.reference.jffi-complete.jar-1=../jffi.git/dist/jffi-complete.jar
+file.reference.jffi-complete.jar-1=../jffi/dist/jffi-complete.jar
includes=**
jar.compress=true
javac.classpath=\
@@ -65,10 +65,10 @@ jnlp.descriptor=application
jnlp.enabled=false
jnlp.offline-allowed=false
jnlp.signed=false
-main.class=com.kenai.jaffl.provider.jffi.AsmLibraryLoader
+main.class=com.kenai.jaffl.provider.ffi.AsmLibraryLoader
meta.inf.dir=${src.dir}/META-INF
platform.active=default_platform
-project.jffi=../jffi.git
+project.jffi=../jffi
project.jnr-x86asm=../jnr-x86asm
reference.jffi.jar=${project.jffi}/dist/jffi.jar
reference.jnr-x86asm.jar=${project.jnr-x86asm}/dist/jnr-x86asm.jar
diff --git a/pom.xml b/pom.xml
index 0f2c24b..7b253bf 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,14 +4,14 @@
<groupId>org.jruby.extras</groupId>
<artifactId>jaffl</artifactId>
<packaging>jar</packaging>
- <version>0.5.4</version>
+ <version>0.5.9</version>
<name>jaffl</name>
<description>An abstracted interface to invoking native functions from java</description>
<url>http://github.com/wmeissner/jaffl</url>
<licenses>
<license>
- <name>GNU Lesser General Public License Version 3</name>
- <url>http://www.gnu.org/licenses/lgpl-3.0.txt</url>
+ <name>The Apache Software License, Version 2.0</name>
+ <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
@@ -44,7 +44,7 @@
<enabled>true</enabled>
</releases>
<snapshots>
- <enabled>false</enabled>
+ <enabled>true</enabled>
</snapshots>
<url>http://repository.codehaus.org</url>
</repository>
@@ -64,7 +64,6 @@
</developer>
</developers>
<properties>
- <maven.test.skip>true</maven.test.skip>
<maven.test.failure.ignore>true</maven.test.failure.ignore>
</properties>
<dependencies>
@@ -77,20 +76,33 @@
<dependency>
<groupId>org.jruby.extras</groupId>
<artifactId>jffi</artifactId>
- <version>0.6.5</version>
- <scope>provided</scope>
+ <version>1.0.6</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jruby.extras</groupId>
+ <artifactId>jffi</artifactId>
+ <version>1.0.6</version>
+ <scope>runtime</scope>
+ <classifier>native</classifier>
</dependency>
<dependency>
<groupId>asm</groupId>
<artifactId>asm</artifactId>
<version>3.2</version>
- <scope>provided</scope>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>asm</groupId>
+ <artifactId>asm-commons</artifactId>
+ <version>3.2</version>
+ <scope>compile</scope>
</dependency>
<dependency>
<groupId>org.jruby.extras</groupId>
<artifactId>jnr-x86asm</artifactId>
- <version>0.1</version>
- <scope>provided</scope>
+ <version>1.0.0</version>
+ <scope>compile</scope>
</dependency>
</dependencies>
<build>
@@ -140,6 +152,17 @@
</configuration>
</plugin>
</plugins>
+ <extensions>
+ <extension>
+ <groupId>org.jvnet.wagon-svn</groupId>
+ <artifactId>wagon-svn</artifactId>
+ <version>1.8</version>
+ </extension>
+ <extension>
+ <groupId>org.apache.maven.wagon</groupId>
+ <artifactId>wagon-webdav</artifactId>
+ </extension>
+ </extensions>
</build>
<reporting>
<outputDirectory>build/report</outputDirectory>
diff --git a/src/com/kenai/jaffl/provider/Library.java b/src/com/kenai/jaffl/provider/Library.java
index c34b32f..297f316 100644
--- a/src/com/kenai/jaffl/provider/Library.java
+++ b/src/com/kenai/jaffl/provider/Library.java
@@ -11,16 +11,20 @@ import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
/**
*
*/
public abstract class Library {
- private static final List<String> userLibraryPath = new CopyOnWriteArrayList<String>();
- private static final Map<String, List<String>> customSearchPaths
- = new ConcurrentHashMap<String, List<String>>();
+ private static final class StaticDataHolder {
+ private static final List<String> userLibraryPath = new CopyOnWriteArrayList<String>();
+ static {
+ userLibraryPath.addAll(getPropertyPaths("jaffl.library.path"));
+ // Add JNA paths for compatibility
+ userLibraryPath.addAll(getPropertyPaths("jna.library.path"));
+ }
+ };
public abstract Invoker getInvoker(Method method, Map<LibraryOption, ?> options);
public abstract Object libraryLock();
@@ -35,8 +39,9 @@ public abstract class Library {
// Prepend any custom search paths specifically for this library
//
searchPath.addAll(0, com.kenai.jaffl.Library.getLibraryPath(libraryName));
- searchPath.addAll(userLibraryPath);
+ searchPath.addAll(StaticDataHolder.userLibraryPath);
String path = Platform.getPlatform().locateLibrary(libraryName, searchPath);
+
return path != null ? path : null;
}
@@ -49,9 +54,5 @@ public abstract class Library {
return Collections.emptyList();
}
- static {
- userLibraryPath.addAll(getPropertyPaths("jaffl.library.path"));
- // Add JNA paths for compatibility
- userLibraryPath.addAll(getPropertyPaths("jna.library.path"));
- }
+
}
diff --git a/src/com/kenai/jaffl/provider/StringIO.java b/src/com/kenai/jaffl/provider/StringIO.java
index 68c35df..7941f4c 100644
--- a/src/com/kenai/jaffl/provider/StringIO.java
+++ b/src/com/kenai/jaffl/provider/StringIO.java
@@ -14,41 +14,83 @@ import java.nio.charset.CodingErrorAction;
/**
*
*/
-public class StringIO {
- private static final ThreadLocal<SoftReference<StringIO>> localData = new ThreadLocal<SoftReference<StringIO>>() {
+public final class StringIO {
- @Override
- protected synchronized SoftReference<StringIO> initialValue() {
- return new SoftReference<StringIO>(new StringIO());
+ private static final class StaticDataHolder {
+ static final StringIO INSTANCE = new StringIO(Charset.defaultCharset());
+ static final ThreadLocal<SoftReference<CharsetEncoder>> ENCODER = new ThreadLocal<SoftReference<CharsetEncoder>>();
+ static final ThreadLocal<SoftReference<CharsetDecoder>> DECODER = new ThreadLocal<SoftReference<CharsetDecoder>>();
+ }
+
+ private final Charset charset;
+
+ public static StringIO getStringIO() {
+ return StaticDataHolder.INSTANCE;
+ }
+
+ public static StringIO getStringIO(Charset charset) {
+ return new StringIO(charset);
+ }
+
+ private StringIO(Charset charset) {
+ this.charset = charset;
+ }
+
+ private static CharsetEncoder getEncoder(Charset charset) {
+ SoftReference<CharsetEncoder> ref = StaticDataHolder.ENCODER.get();
+ CharsetEncoder encoder;
+ if (ref != null && (encoder = ref.get()) != null && encoder.charset() == charset) {
+ return encoder;
}
- };
- private static final Charset defaultCharset = Charset.defaultCharset();
- public static final StringIO getStringIO() {
- StringIO io = localData.get().get();
- if (io == null) {
- localData.set(new SoftReference<StringIO>(io = new StringIO()));
+ return initEncoder(charset);
+ }
+
+ private static CharsetDecoder getDecoder(Charset charset) {
+ SoftReference<CharsetDecoder> ref = StaticDataHolder.DECODER.get();
+ CharsetDecoder decoder;
+ if (ref != null && (decoder = ref.get()) != null && decoder.charset() == charset) {
+ return decoder;
}
- return io;
+
+ return initDecoder(charset);
}
- public final CharsetEncoder encoder = defaultCharset.newEncoder();
- public final CharsetDecoder decoder = defaultCharset.newDecoder();
- public final int nulByteCount = Math.round(encoder.maxBytesPerChar());
- public StringIO() {
+ private static CharsetEncoder initEncoder(Charset charset) {
+ CharsetEncoder encoder = charset.newEncoder();
encoder.onMalformedInput(CodingErrorAction.REPLACE).onUnmappableCharacter(CodingErrorAction.REPLACE);
+ StaticDataHolder.ENCODER.set(new SoftReference<CharsetEncoder>(encoder));
+
+ return encoder;
+ }
+
+ private static CharsetDecoder initDecoder(Charset charset) {
+ CharsetDecoder decoder = charset.newDecoder();
decoder.onMalformedInput(CodingErrorAction.REPLACE).onUnmappableCharacter(CodingErrorAction.REPLACE);
+ StaticDataHolder.DECODER.set(new SoftReference<CharsetDecoder>(decoder));
+
+ return decoder;
}
+
public final ByteBuffer toNative(final CharSequence value, final int minSize, boolean copyIn) {
+ return toNative(getEncoder(charset), value, minSize, copyIn);
+ }
+
+ public final ByteBuffer toNative(final CharSequence value, final ByteBuffer buf) {
+ return toNative(getEncoder(charset), value, buf);
+ }
+
+ private static ByteBuffer toNative(CharsetEncoder encoder, final CharSequence value, final int minSize, boolean copyIn) {
// Calculate the raw byte size required (with allowance for NUL termination)
final int len = (int) (((float)Math.max(minSize, value.length()) + 1) * encoder.maxBytesPerChar());
final ByteBuffer buf = ByteBuffer.allocate(len);
if (copyIn) {
- toNative(value, buf);
+ toNative(encoder, value, buf);
}
return buf;
}
- public final ByteBuffer toNative(final CharSequence value, final ByteBuffer buf) {
+
+ private static ByteBuffer toNative(CharsetEncoder encoder, final CharSequence value, final ByteBuffer buf) {
//
// Copy the string to native memory
//
@@ -57,12 +99,14 @@ public class StringIO {
encoder.reset();
encoder.encode(CharBuffer.wrap(value), buf, true);
encoder.flush(buf);
- nulTerminate(buf);
+ nulTerminate(encoder, buf);
} finally {
buf.reset();
}
return buf;
}
+
+
public final CharSequence fromNative(final ByteBuffer buf, final int maxSize) {
// Find the NUL terminator and limit to that, so the
// StringBuffer/StringBuilder does not have superfluous NUL chars
@@ -74,23 +118,31 @@ public class StringIO {
final int limit = buf.limit();
buf.limit(end);
try {
- return decoder.reset().decode(buf);
+ return getDecoder(charset).reset().decode(buf);
} catch (CharacterCodingException ex) {
throw new Error("Illegal character data in native string", ex);
} finally {
buf.limit(limit);
}
}
+
+
public final CharSequence fromNative(final ByteBuffer buf) {
try {
- return decoder.reset().decode(buf);
+ return getDecoder(charset).reset().decode(buf);
} catch (CharacterCodingException ex) {
throw new Error("Illegal character data in native string", ex);
}
}
+
+
public final void nulTerminate(ByteBuffer buf) {
+ nulTerminate(getEncoder(charset), buf);
+ }
+
+ private static void nulTerminate(CharsetEncoder encoder, ByteBuffer buf) {
// NUL terminate the string
- int nulSize = nulByteCount;
+ int nulSize = Math.round(encoder.maxBytesPerChar());
while (nulSize >= 4) {
buf.putInt(0);
nulSize -= 4;
diff --git a/src/com/kenai/jaffl/provider/jffi/AbstractX86StubCompiler.java b/src/com/kenai/jaffl/provider/jffi/AbstractX86StubCompiler.java
index 5809a93..333da9b 100644
--- a/src/com/kenai/jaffl/provider/jffi/AbstractX86StubCompiler.java
+++ b/src/com/kenai/jaffl/provider/jffi/AbstractX86StubCompiler.java
@@ -1,20 +1,4 @@
-/*
- * Copyright (C) 2010 Wayne Meissner
- *
- * This file is part of jnr.
- *
- * This code is free software: you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License version 3 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
- * version 3 for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with this work. If not, see <http://www.gnu.org/licenses/>.
- */
+
package com.kenai.jaffl.provider.jffi;
@@ -31,15 +15,18 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.WeakHashMap;
+import java.util.logging.Level;
+import java.util.logging.Logger;
/**
* Base class for most X86_32/X86_64 stub compilers
*/
abstract class AbstractX86StubCompiler extends StubCompiler {
- // Keep a reference from the loaded class to the pages holding the code for that class.
- static final Map<Class, PageHolder> pages
- = Collections.synchronizedMap(new WeakHashMap<Class, PageHolder>());
-
+ private static final class StaticDataHolder {
+ // Keep a reference from the loaded class to the pages holding the code for that class.
+ static final Map<Class, PageHolder> PAGES
+ = Collections.synchronizedMap(new WeakHashMap<Class, PageHolder>());
+ }
final List<Stub> stubs = new LinkedList<Stub>();
@@ -55,18 +42,27 @@ abstract class AbstractX86StubCompiler extends StubCompiler {
}
}
- final class PageHolder {
+ static final class PageHolder {
+ final PageManager pm;
final long memory;
final long pageCount;
- public PageHolder(long memory, long pageCount) {
+ public PageHolder(PageManager pm, long memory, long pageCount) {
+ this.pm = pm;
this.memory = memory;
this.pageCount = pageCount;
}
@Override
protected void finalize() throws Throwable {
- PageManager.getInstance().freePages(memory, (int) pageCount);
+ try {
+ pm.freePages(memory, (int) pageCount);
+ } catch (Throwable t) {
+ Logger.getLogger(getClass().getName()).log(Level.WARNING,
+ "Exception when freeing native pages: %s", t.getLocalizedMessage());
+ } finally {
+ super.finalize();
+ }
}
}
@@ -92,7 +88,7 @@ abstract class AbstractX86StubCompiler extends StubCompiler {
if (code == 0) {
throw new OutOfMemoryError("allocatePages failed for codeSize=" + codeSize);
}
- PageHolder page = new PageHolder(code, npages);
+ PageHolder page = new PageHolder(pm, code, npages);
// Now relocate/copy all the assembler stubs into the real code area
List<NativeMethod> methods = new ArrayList<NativeMethod>(stubs.size());
@@ -111,7 +107,7 @@ abstract class AbstractX86StubCompiler extends StubCompiler {
pm.protectPages(code, (int) npages, PageManager.PROT_READ | PageManager.PROT_EXEC);
NativeMethods.register(clazz, methods);
- pages.put(clazz, page);
+ StaticDataHolder.PAGES.put(clazz, page);
}
static final int align(int offset, int align) {
diff --git a/src/com/kenai/jaffl/provider/jffi/AsmLibraryLoader.java b/src/com/kenai/jaffl/provider/jffi/AsmLibraryLoader.java
index f2b619d..ae55aa2 100644
--- a/src/com/kenai/jaffl/provider/jffi/AsmLibraryLoader.java
+++ b/src/com/kenai/jaffl/provider/jffi/AsmLibraryLoader.java
@@ -1,21 +1,3 @@
-/*
- * Copyright (C) 2009 Wayne Meissner
- *
- * This file is part of jffi.
- *
- * This code is free software: you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License version 3 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
- * version 3 for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with this work. If not, see <http://www.gnu.org/licenses/>.
- */
-
package com.kenai.jaffl.provider.jffi;
@@ -60,7 +42,9 @@ import static com.kenai.jaffl.provider.jffi.AsmUtil.*;
public class AsmLibraryLoader extends LibraryLoader implements Opcodes {
public final static boolean DEBUG = false || Boolean.getBoolean("jaffl.compile.dump");
- private static final LibraryLoader INSTANCE = new AsmLibraryLoader();
+ private static final class SingletonHolder {
+ static final LibraryLoader INSTANCE = new AsmLibraryLoader();
+ }
private static final boolean FAST_NUMERIC_AVAILABLE = isFastNumericAvailable();
private static final boolean FAST_LONG_AVAILABLE = isFastLongAvailable();
private final AtomicLong nextClassID = new AtomicLong(0);
@@ -68,7 +52,7 @@ public class AsmLibraryLoader extends LibraryLoader implements Opcodes {
private final AtomicLong nextMethodID = new AtomicLong(0);
static final LibraryLoader getInstance() {
- return INSTANCE;
+ return SingletonHolder.INSTANCE;
}
boolean isInterfaceSupported(Class interfaceClass, Map<LibraryOption, ?> options) {
@@ -152,7 +136,7 @@ public class AsmLibraryLoader extends LibraryLoader implements Opcodes {
ToNativeConverter[][] parameterConverters = new ToNativeConverter[methods.length][0];
FunctionMapper functionMapper = libraryOptions.containsKey(LibraryOption.FunctionMapper)
- ? (FunctionMapper) libraryOptions.get(LibraryOption.FunctionMapper) : IdentityFunctionMapper.INSTANCE;
+ ? (FunctionMapper) libraryOptions.get(LibraryOption.FunctionMapper) : IdentityFunctionMapper.getInstance();
TypeMapper typeMapper = libraryOptions.containsKey(LibraryOption.TypeMapper)
? (TypeMapper) libraryOptions.get(LibraryOption.TypeMapper) : NullTypeMapper.INSTANCE;
diff --git a/src/com/kenai/jaffl/provider/jffi/DefaultInvokerFactory.java b/src/com/kenai/jaffl/provider/jffi/DefaultInvokerFactory.java
index ea4c007..835e6fe 100644
--- a/src/com/kenai/jaffl/provider/jffi/DefaultInvokerFactory.java
+++ b/src/com/kenai/jaffl/provider/jffi/DefaultInvokerFactory.java
@@ -47,9 +47,8 @@ final class DefaultInvokerFactory implements InvokerFactory {
}
public final Invoker createInvoker(Method method, com.kenai.jaffl.provider.Library library, Map<LibraryOption, ?> options) {
FunctionMapper functionMapper = options.containsKey(LibraryOption.FunctionMapper)
- ? (FunctionMapper) options.get(LibraryOption.FunctionMapper) : IdentityFunctionMapper.INSTANCE;
+ ? (FunctionMapper) options.get(LibraryOption.FunctionMapper) : IdentityFunctionMapper.getInstance();
final long address = ((Library) library).findSymbolAddress(functionMapper.mapFunctionName(method.getName(), null));
-
TypeMapper typeMapper = options.containsKey(LibraryOption.TypeMapper)
? (TypeMapper) options.get(LibraryOption.TypeMapper) : NullTypeMapper.INSTANCE;
diff --git a/src/com/kenai/jaffl/provider/jffi/IdentityFunctionMapper.java b/src/com/kenai/jaffl/provider/jffi/IdentityFunctionMapper.java
index f647594..5798d00 100644
--- a/src/com/kenai/jaffl/provider/jffi/IdentityFunctionMapper.java
+++ b/src/com/kenai/jaffl/provider/jffi/IdentityFunctionMapper.java
@@ -6,7 +6,13 @@ import com.kenai.jaffl.mapper.FunctionMapper;
* An implementation of {@link FunctionMapper} that just returns the same name as input
*/
public class IdentityFunctionMapper implements FunctionMapper {
- public static final FunctionMapper INSTANCE = new IdentityFunctionMapper();
+ private static final class SingletonHolder {
+ public static final FunctionMapper INSTANCE = new IdentityFunctionMapper();
+ }
+
+ public static FunctionMapper getInstance() {
+ return SingletonHolder.INSTANCE;
+ }
public String mapFunctionName(String functionName, Context context) {
return functionName;
diff --git a/src/com/kenai/jaffl/provider/jffi/NumberUtil.java b/src/com/kenai/jaffl/provider/jffi/NumberUtil.java
index 4c7d36b..947cedc 100644
--- a/src/com/kenai/jaffl/provider/jffi/NumberUtil.java
+++ b/src/com/kenai/jaffl/provider/jffi/NumberUtil.java
@@ -1,20 +1,3 @@
-/*
- * Copyright (C) 2009 Wayne Meissner
- *
- * This file is part of jffi.
- *
- * This code is free software: you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License version 3 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
- * version 3 for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with this work. If not, see <http://www.gnu.org/licenses/>.
- */
package com.kenai.jaffl.provider.jffi;
diff --git a/src/com/kenai/jaffl/provider/jffi/StubCompiler.java b/src/com/kenai/jaffl/provider/jffi/StubCompiler.java
index 62dc97f..28f85de 100644
--- a/src/com/kenai/jaffl/provider/jffi/StubCompiler.java
+++ b/src/com/kenai/jaffl/provider/jffi/StubCompiler.java
@@ -1,20 +1,3 @@
-/*
- * Copyright (C) 2010 Wayne Meissner
- *
- * This file is part of jffi.
- *
- * This code is free software: you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License version 3 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
- * version 3 for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with this work. If not, see <http://www.gnu.org/licenses/>.
- */
package com.kenai.jaffl.provider.jffi;
diff --git a/src/com/kenai/jaffl/provider/jffi/X86_32StubCompiler.java b/src/com/kenai/jaffl/provider/jffi/X86_32StubCompiler.java
index 9c8f5da..f16faa6 100644
--- a/src/com/kenai/jaffl/provider/jffi/X86_32StubCompiler.java
+++ b/src/com/kenai/jaffl/provider/jffi/X86_32StubCompiler.java
@@ -1,20 +1,3 @@
-/*
- * Copyright (C) 2010 Wayne Meissner
- *
- * This file is part of jnr.
- *
- * This code is free software: you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License version 3 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
- * version 3 for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with this work. If not, see <http://www.gnu.org/licenses/>.
- */
package com.kenai.jaffl.provider.jffi;
diff --git a/src/com/kenai/jaffl/provider/jffi/X86_64StubCompiler.java b/src/com/kenai/jaffl/provider/jffi/X86_64StubCompiler.java
index 25a04f0..0086111 100644
--- a/src/com/kenai/jaffl/provider/jffi/X86_64StubCompiler.java
+++ b/src/com/kenai/jaffl/provider/jffi/X86_64StubCompiler.java
@@ -1,20 +1,3 @@
-/*
- * Copyright (C) 2010 Wayne Meissner
- *
- * This file is part of jnr.
- *
- * This code is free software: you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License version 3 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
- * version 3 for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with this work. If not, see <http://www.gnu.org/licenses/>.
- */
package com.kenai.jaffl.provider.jffi;
diff --git a/src/com/kenai/jaffl/struct/Struct.java b/src/com/kenai/jaffl/struct/Struct.java
index b487eb6..f6c83aa 100644
--- a/src/com/kenai/jaffl/struct/Struct.java
+++ b/src/com/kenai/jaffl/struct/Struct.java
@@ -1,5 +1,7 @@
/*
- * Some of the design and code of this class is from the javolution project.
+ * This file is covered by the license described in the LICENSE file in the root of
+ * the project, however, it incorporates some code from the javolution project,
+ * and that copyright is reproduced here.
*
* Copyright (C) 2006 - Javolution (http://javolution.org/)
* All rights reserved.
@@ -479,7 +481,7 @@ public abstract class Struct /*implements Marshallable */{
/**
* Base implementation of Member
*/
- protected abstract class AbstractMember implements Member {
+ public abstract class AbstractMember implements Member {
private final int offset;
protected AbstractMember(int size) {
this(size, size);
@@ -490,6 +492,14 @@ public abstract class Struct /*implements Marshallable */{
protected AbstractMember(int size, int align) {
this.offset = __info.addField(size, align);
}
+
+ protected AbstractMember(Type type) {
+ this.offset = __info.addField(type.size() * 8, type.alignment() * 8);
+ }
+
+ protected AbstractMember(Type type, Offset offset) {
+ this.offset = __info.addField(type.size() * 8, type.alignment() * 8, offset);
+ }
/**
* Gets the <tt>MemoryIO</tt> used to read/write this <tt>Member</tt>.
@@ -518,6 +528,77 @@ public abstract class Struct /*implements Marshallable */{
}
/**
+ * Base class for Boolean fields
+ */
+ public abstract class AbstractBoolean extends AbstractMember {
+ public AbstractBoolean(Type type) {
+ super(type);
+ }
+
+ protected AbstractBoolean(Type type, Offset offset) {
+ super(type, offset);
+ }
+
+ /**
+ * Gets the value for this field.
+ *
+ * @return a boolean.
+ */
+ public abstract boolean get();
+
+ /**
+ * Sets the field to a new value.
+ *
+ * @param value The new value.
+ */
+ public abstract void set(boolean value);
+
+ /**
+ * Returns a string representation of this <code>Address</code>.
+ *
+ * @return a string representation of this <code>Address</code>.
+ */
+ @Override
+ public java.lang.String toString() {
+ return java.lang.Boolean.toString(get());
+ }
+ }
+
+ /**
+ * A normal C boolean - 1 byte in size
+ */
+ public final class Boolean extends AbstractBoolean {
+ public Boolean() {
+ super(Type.SCHAR);
+ }
+
+ public final boolean get() {
+ return (getMemoryIO().getByte(offset()) & 0x1) != 0;
+ }
+
+ public final void set(boolean value) {
+ getMemoryIO().putByte(offset(), (byte) (value ? 1 : 0));
+ }
+ }
+
+ /**
+ * A Windows BOOL - 4 bytes
+ */
+ public final class WBOOL extends AbstractBoolean {
+ public WBOOL() {
+ super(Type.SINT);
+ }
+
+ public final boolean get() {
+ return (getMemoryIO().getInt(offset()) & 0x1) != 0;
+ }
+
+ public final void set(boolean value) {
+ getMemoryIO().putInt(offset(), value ? 1 : 0);
+ }
+ }
+
+ /**
* Base class for all Number structure fields.
*/
protected abstract class NumberField extends java.lang.Number implements Member {
@@ -1790,7 +1871,7 @@ public abstract class Struct /*implements Marshallable */{
* members for more efficient struct construction.
*/
public final class Padding extends AbstractMember {
- Padding(Type type, int length) {
+ public Padding(Type type, int length) {
super(type.size() * 8 * length, type.alignment() * 8);
}
}
diff --git a/src/com/kenai/jaffl/struct/Union.java b/src/com/kenai/jaffl/struct/Union.java
index 05ecf83..f9111c5 100644
--- a/src/com/kenai/jaffl/struct/Union.java
+++ b/src/com/kenai/jaffl/struct/Union.java
@@ -1,5 +1,7 @@
/*
- * Some of the design and code of this class is from the javolution project.
+ * This file is covered by the license described in the LICENSE file in the root of
+ * the project, however, it incorporates some code from the javolution project,
+ * and that copyright is reproduced here.
*
* Copyright (C) 2006 - Javolution (http://javolution.org/)
* All rights reserved.
diff --git a/src/com/kenai/jaffl/util/EnumMapper.java b/src/com/kenai/jaffl/util/EnumMapper.java
index e2f12ce..a1a94b6 100644
--- a/src/com/kenai/jaffl/util/EnumMapper.java
+++ b/src/com/kenai/jaffl/util/EnumMapper.java
@@ -17,9 +17,12 @@ public class EnumMapper {
Map<Integer, Enum> enumMap = new HashMap<Integer, Enum>();
Map<Enum, Integer> valueMap = new HashMap<Enum, Integer>();
}
- private static final EnumMapper mapper = new EnumMapper();
+
+ private static final class SingletonHolder {
+ private static final EnumMapper INSTANCE = new EnumMapper();
+ }
public static EnumMapper getInstance() {
- return mapper;
+ return SingletonHolder.INSTANCE;
}
private static final int getIntegerValue(Enum e) {
if (e instanceof IntegerEnum) {
diff --git a/test/com/kenai/jaffl/ArrayTest.java b/test/com/kenai/jaffl/ArrayTest.java
index 7788d52..8dfbd48 100644
--- a/test/com/kenai/jaffl/ArrayTest.java
+++ b/test/com/kenai/jaffl/ArrayTest.java
@@ -1,20 +1,3 @@
-/*
- * Copyright (C) 2007, 2008 Wayne Meissner
- *
- * This file is part of jffi.
- *
- * This code is free software: you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License version 3 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
- * version 3 for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with this work. If not, see <http://www.gnu.org/licenses/>.
- */
package com.kenai.jaffl;
diff --git a/test/com/kenai/jaffl/BufferTest.java b/test/com/kenai/jaffl/BufferTest.java
index 11dc57a..70e2b71 100644
--- a/test/com/kenai/jaffl/BufferTest.java
+++ b/test/com/kenai/jaffl/BufferTest.java
@@ -1,20 +1,3 @@
-/*
- * Copyright (C) 2007, 2008 Wayne Meissner
- *
- * This file is part of jffi.
- *
- * This code is free software: you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License version 3 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
- * version 3 for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with this work. If not, see <http://www.gnu.org/licenses/>.
- */
package com.kenai.jaffl;
diff --git a/test/com/kenai/jaffl/ClosureTest.java b/test/com/kenai/jaffl/ClosureTest.java
index aff786a..c23672d 100644
--- a/test/com/kenai/jaffl/ClosureTest.java
+++ b/test/com/kenai/jaffl/ClosureTest.java
@@ -1,20 +1,3 @@
-/*
- * Copyright (C) 2008 Wayne Meissner
- *
- * This file is part of jffi.
- *
- * This code is free software: you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License version 3 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
- * version 3 for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with this work. If not, see <http://www.gnu.org/licenses/>.
- */
package com.kenai.jaffl;
diff --git a/test/com/kenai/jaffl/EnumTest.java b/test/com/kenai/jaffl/EnumTest.java
index 18ecb45..c0f09e8 100644
--- a/test/com/kenai/jaffl/EnumTest.java
+++ b/test/com/kenai/jaffl/EnumTest.java
@@ -1,20 +1,4 @@
-/*
- * Copyright (C) 2007, 2008 Wayne Meissner
- *
- * This file is part of jffi.
- *
- * This code is free software: you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License version 3 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
- * version 3 for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with this work. If not, see <http://www.gnu.org/licenses/>.
- */
+
package com.kenai.jaffl;
@@ -28,7 +12,6 @@ import static org.junit.Assert.*;
/**
*
- * @author wayne
*/
public class EnumTest {
diff --git a/test/com/kenai/jaffl/LastErrorTest.java b/test/com/kenai/jaffl/LastErrorTest.java
index 95c3118..988dc53 100644
--- a/test/com/kenai/jaffl/LastErrorTest.java
+++ b/test/com/kenai/jaffl/LastErrorTest.java
@@ -1,20 +1,3 @@
-/*
- * Copyright (C) 2008 Wayne Meissner
- *
- * This file is part of jffi.
- *
- * This code is free software: you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License version 3 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
- * version 3 for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with this work. If not, see <http://www.gnu.org/licenses/>.
- */
package com.kenai.jaffl;
diff --git a/test/com/kenai/jaffl/LibraryTest.java b/test/com/kenai/jaffl/LibraryTest.java
index 1670514..31f4c80 100644
--- a/test/com/kenai/jaffl/LibraryTest.java
+++ b/test/com/kenai/jaffl/LibraryTest.java
@@ -1,20 +1,3 @@
-/*
- * Copyright (C) 2008 Wayne Meissner
- *
- * This file is part of jffi.
- *
- * This code is free software: you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License version 3 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
- * version 3 for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with this work. If not, see <http://www.gnu.org/licenses/>.
- */
package com.kenai.jaffl;
diff --git a/test/com/kenai/jaffl/MemoryIOTest.java b/test/com/kenai/jaffl/MemoryIOTest.java
index 76e9301..14da234 100644
--- a/test/com/kenai/jaffl/MemoryIOTest.java
+++ b/test/com/kenai/jaffl/MemoryIOTest.java
@@ -1,20 +1,3 @@
-/*
- * Copyright (C) 2007, 2008 Wayne Meissner
- *
- * This file is part of jffi.
- *
- * This code is free software: you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License version 3 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
- * version 3 for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with this work. If not, see <http://www.gnu.org/licenses/>.
- */
package com.kenai.jaffl;
diff --git a/test/com/kenai/jaffl/NumberTest.java b/test/com/kenai/jaffl/NumberTest.java
index daa0a87..abbdc66 100644
--- a/test/com/kenai/jaffl/NumberTest.java
+++ b/test/com/kenai/jaffl/NumberTest.java
@@ -1,20 +1,3 @@
-/*
- * Copyright (C) 2007, 2008 Wayne Meissner
- *
- * This file is part of jffi.
- *
- * This code is free software: you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License version 3 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
- * version 3 for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with this work. If not, see <http://www.gnu.org/licenses/>.
- */
package com.kenai.jaffl;
diff --git a/test/com/kenai/jaffl/PointerTest.java b/test/com/kenai/jaffl/PointerTest.java
index 6019472..c2325d1 100644
--- a/test/com/kenai/jaffl/PointerTest.java
+++ b/test/com/kenai/jaffl/PointerTest.java
@@ -1,20 +1,3 @@
-/*
- * Copyright (C) 2007, 2008 Wayne Meissner
- *
- * This file is part of jffi.
- *
- * This code is free software: you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License version 3 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
- * version 3 for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with this work. If not, see <http://www.gnu.org/licenses/>.
- */
package com.kenai.jaffl;
diff --git a/test/com/kenai/jaffl/StringTest.java b/test/com/kenai/jaffl/StringTest.java
index e15e9eb..f66b4e4 100644
--- a/test/com/kenai/jaffl/StringTest.java
+++ b/test/com/kenai/jaffl/StringTest.java
@@ -1,20 +1,3 @@
-/*
- * Copyright (C) 2007, 2008 Wayne Meissner
- *
- * This file is part of jffi.
- *
- * This code is free software: you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License version 3 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
- * version 3 for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with this work. If not, see <http://www.gnu.org/licenses/>.
- */
package com.kenai.jaffl;
diff --git a/test/com/kenai/jaffl/byref/AddressByReferenceTest.java b/test/com/kenai/jaffl/byref/AddressByReferenceTest.java
index 643dc14..ad54e98 100644
--- a/test/com/kenai/jaffl/byref/AddressByReferenceTest.java
+++ b/test/com/kenai/jaffl/byref/AddressByReferenceTest.java
@@ -1,20 +1,3 @@
-/*
- * Copyright (C) 2007, 2008 Wayne Meissner
- *
- * This file is part of jffi.
- *
- * This code is free software: you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License version 3 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
- * version 3 for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with this work. If not, see <http://www.gnu.org/licenses/>.
- */
package com.kenai.jaffl.byref;
diff --git a/test/com/kenai/jaffl/byref/ByteByReferenceTest.java b/test/com/kenai/jaffl/byref/ByteByReferenceTest.java
index 6271c23..975f8a7 100644
--- a/test/com/kenai/jaffl/byref/ByteByReferenceTest.java
+++ b/test/com/kenai/jaffl/byref/ByteByReferenceTest.java
@@ -1,20 +1,3 @@
-/*
- * Copyright (C) 2008 Wayne Meissner
- *
- * This file is part of jffi.
- *
- * This code is free software: you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License version 3 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
- * version 3 for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with this work. If not, see <http://www.gnu.org/licenses/>.
- */
package com.kenai.jaffl.byref;
diff --git a/test/com/kenai/jaffl/byref/IntByReferenceTest.java b/test/com/kenai/jaffl/byref/IntByReferenceTest.java
index 5e645e3..09ad661 100644
--- a/test/com/kenai/jaffl/byref/IntByReferenceTest.java
+++ b/test/com/kenai/jaffl/byref/IntByReferenceTest.java
@@ -1,21 +1,3 @@
-/*
- * Copyright (C) 2008 Wayne Meissner
- *
- * This file is part of jffi.
- *
- * This code is free software: you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License version 3 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
- * version 3 for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with this work. If not, see <http://www.gnu.org/licenses/>.
- */
-
package com.kenai.jaffl.byref;
--
Java Abstracted Foreign Function Layer
More information about the pkg-java-commits
mailing list