Skip to content

Commit 4e03828

Browse files
committed
init
0 parents  commit 4e03828

File tree

4 files changed

+40
-0
lines changed

4 files changed

+40
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.class

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "lmdb"]
2+
path = src/c/lmdb
3+
url = https://github.com/LMDB/lmdb

gen.sh

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
cd src/java
4+
5+
# generate Lib.java
6+
java -jar ../../javacpp.jar datalevin/javacpp/Config.java
7+
8+
# compile native library
9+
java -jar ../../javacpp.jar datalevin/javacpp/Lib.java
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package datalevin.javacpp;
2+
3+
import org.bytedeco.javacpp.*;
4+
import org.bytedeco.javacpp.annotation.*;
5+
import org.bytedeco.javacpp.tools.*;
6+
7+
@Properties(
8+
value = @Platform(
9+
includepath = {"/usr/include", "../src/c"},
10+
cinclude = {"lmdb/libraries/liblmdb/lmdb.h", "dtlv.h"},
11+
linkpath = {"../src/c"},
12+
link = {"dtlv", "lmdb"}
13+
),
14+
target = "datalevin.javacpp.Lib"
15+
)
16+
public class Config implements InfoMapper {
17+
public void map(InfoMap infoMap) {
18+
infoMap
19+
.put(new Info("mdb_mode_t").cast().valueTypes("int").pointerTypes("IntPointer", "IntBuffer", "int[]"))
20+
.put(new Info("mdb_filehandle_t").cast().valueTypes("int").pointerTypes("IntPointer"))
21+
.put(new Info("MDB_VERINT").cppText("#define MDB_VERINT"))
22+
.put(new Info("MDB_VERSION_FULL").cppText("#define MDB_VERSION_FULL"))
23+
.put(new Info("MDB_VERSTR").cppText("#define MDB_VERSTR"))
24+
.put(new Info("MDB_VERFOO").cppText("#define MDB_VERFOO"))
25+
.put(new Info("MDB_VERSION_STRING").cppText("#define MDB_VERSION_STRING"));
26+
}
27+
}

0 commit comments

Comments
 (0)