Skip to content

Commit

Permalink
Add example with callbacks.
Browse files Browse the repository at this point in the history
  • Loading branch information
phronmophobic committed Jul 11, 2024
1 parent 61aecbf commit 673be82
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
16 changes: 16 additions & 0 deletions examples/libz/build.clj
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,19 @@
:main 'clong.libz}))


(defn uber-qsort [_]
(clean nil)
(b/copy-dir {:src-dirs ["src" "resources"]
:target-dir class-dir})
(b/compile-clj {:basis (b/create-basis basis*)
:ns-compile '[clong.qsort]
:class-dir class-dir
:jvm-opts ["-Dtech.v3.datatype.graal-native=true"
"-Dclojure.compiler.direct-linking=true"
"-Dclojure.spec.skip-macros=true"]})
(b/uber {:class-dir class-dir
:uber-file uber-file
:basis (b/create-basis basis*)
:main 'clong.qsort}))


6 changes: 6 additions & 0 deletions examples/libz/config/jni-config.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
[
{
"name":"com.sun.jna.CallbackProxy",
"methods":[{"name":"callback","parameterTypes":["java.lang.Object[]"] }]
},


{
"condition": {
"typeReachable": "com.sun.jna.Native"
Expand Down
11 changes: 11 additions & 0 deletions examples/libz/config/reflect-config.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
[
{
"name":"clong.qsort.structs.callback_f4737eb2cfe7a0d1af88064384f03bcca4366a715a2105486fb7b17ec4fef17d",
"queryAllDeclaredMethods":true,
"queryAllPublicMethods":true,
"methods":[{"name":"callback","parameterTypes":["com.sun.jna.Pointer","com.sun.jna.Pointer"] }]
},
{
"name":"com.sun.jna.Pointer",
"queryAllPublicMethods":true,
"methods":[{"name":"getByte","parameterTypes":["long"] }]
},
{
"condition": {
"typeReachable": "com.sun.jna.CallbackReference"
Expand Down

0 comments on commit 673be82

Please sign in to comment.