https://github.com/techascent/tech.jna
java native access bindings
https://github.com/techascent/tech.jna
Last synced: 7 months ago
JSON representation
java native access bindings
- Host: GitHub
- URL: https://github.com/techascent/tech.jna
- Owner: techascent
- License: epl-1.0
- Created: 2018-10-24T19:45:42.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-09-23T15:27:54.000Z (almost 2 years ago)
- Last Synced: 2024-10-28T13:40:32.619Z (over 1 year ago)
- Language: Clojure
- Size: 159 KB
- Stars: 41
- Watchers: 5
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tech.jna
[](https://clojars.org/techascent/tech.jna)
* [API Documentation](https://techascent.github.io/tech.jna/)
* For a bit of explanation, checkout our [blog](http://techascent.com/blog/jna-simplifies-your-life.html).
## Usage
```clojure
(require '[tech.v3.jna :as jna])
(jna/def-jna-fn "c" memset
"Set byte memory to a value"
com.sun.jna.Pointer ;;void* return value
[data identity] ;;Each argument has a coercer-fn. Pointers can be lots of types.
[value int] ;;read docs for memset
[n-bytes jna/size-t])
user> (def test-ary (float-array [1 2 3 4]))
#'user/test-ary
user> (vec test-ary)
[1.0 2.0 3.0 4.0]
user> (memset test-ary 0 (* 4 Float/BYTES))
user> (vec test-ary)
[0.0 0.0 0.0 0.0]
```
Copyright © 2018 TechAscent, LLC
Distributed under the Eclipse Public License either version 1.0 or (at
your option) any later version.