Add a function for constructing a fully wrapped c function

This commit is contained in:
Joshua Suskalo 2021-09-23 09:36:43 -05:00
parent eeee025303
commit d67d539285

View file

@ -799,6 +799,17 @@
args-types args-types
ret-type))))) ret-type)))))
(defn cfn
"Constructs a Clojure function to call the native function referenced by `symbol`.
The function returned will serialize any passed arguments into the `args`
types, and deserialize the return to the `ret` type."
[symbol args ret]
(-> symbol
ensure-address
(make-downcall args ret)
(make-serde-wrapper args ret)))
;;; Function types ;;; Function types
(def ^:private return-for-type (def ^:private return-for-type