diff --git a/src/clj/coffi/ffi.clj b/src/clj/coffi/ffi.clj index 8353507..9919a31 100644 --- a/src/clj/coffi/ffi.clj +++ b/src/clj/coffi/ffi.clj @@ -799,6 +799,17 @@ args-types 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 (def ^:private return-for-type