All Projects → techascent → tech.jna

techascent / tech.jna

Licence: EPL-1.0 license
java native access bindings

Programming Languages

clojure
4091 projects

tech.jna

Clojars Project

Usage

(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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].