add native implementation

This commit is contained in:
Taro L. Saito 2011-03-29 18:36:02 +09:00
parent b1e5ea1076
commit b4cb446ff8
4 changed files with 58 additions and 1 deletions

View File

@ -18,6 +18,7 @@ $(TARGET)/snappy-$(VERSION): $(SNAPPY_ARCHIVE)
$(SRC)/org/xerial/snappy/Snappy.h: $(SRC)/org/xerial/snappy/Snappy.java
$(SRC)/org/xerial/snappy/SnappyNative.h: $(SRC)/org/xerial/snappy/Snappy.java
javah -classpath $(TARGET)/classes -o $@ org.xerial.snappy.Snappy

5
devnote.txt Executable file
View File

@ -0,0 +1,5 @@
mingwin compile
x86_64-w64-mingw32-cpp src/main/java/org/xerial/snappy/SnappyNative.cpp -Isrc/main/java/org/xerial/snappy -Itarget/snappy-1.0.1 -I../sqlite-jdbc/lib/inc_win -D_JNI_IMPLEMENTATION_ -O -o target/SnappyNative.o

View File

@ -0,0 +1,51 @@
#include <snappy.h>
#include "SnappyNative.h"
/*
* Class: org_xerial_snappy_Snappy
* Method: compress
* Signature: (Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;)J
*/
JNIEXPORT jlong JNICALL Java_org_xerial_snappy_Snappy_compress
(JNIEnv *, jobject, jobject, jobject)
{
return (jlong) 0;
}
/*
* Class: org_xerial_snappy_Snappy
* Method: uncompress
* Signature: (Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;)Z
*/
JNIEXPORT jboolean JNICALL Java_org_xerial_snappy_Snappy_uncompress
(JNIEnv *, jobject, jobject, jobject)
{
return (jboolean) true;
}
/*
* Class: org_xerial_snappy_Snappy
* Method: maxCompressedLength
* Signature: (J)J
*/
JNIEXPORT jlong JNICALL Java_org_xerial_snappy_Snappy_maxCompressedLength
(JNIEnv *, jobject, jlong)
{
return (jlong) 0;
}
/*
* Class: org_xerial_snappy_Snappy
* Method: getUncompressedLength
* Signature: (Ljava/nio/ByteBuffer;)J
*/
JNIEXPORT jlong JNICALL Java_org_xerial_snappy_Snappy_getUncompressedLength
(JNIEnv *, jobject, jobject)
{
return (jlong) 0;
}