Skip to content

Commit

Permalink
editing
Browse files Browse the repository at this point in the history
  • Loading branch information
cnuernber committed Jan 14, 2019
1 parent 9a95f68 commit 960692d
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,29 @@

[![Clojars Project](https://img.shields.io/clojars/v/techascent/tech.jna.svg)](https://clojars.org/techascent/tech.jna)

For a bit of explanation, checkout our [blog](http://techascent.com/blog/jna-simplifies-your-life.html).


## Usage

```clojure
(require '[tech.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
Expand Down

0 comments on commit 960692d

Please sign in to comment.