From e72d57c10f9941b0495b063bed2657ce26893e6e Mon Sep 17 00:00:00 2001 From: Joshua Suskalo Date: Fri, 17 Sep 2021 10:51:40 -0500 Subject: [PATCH] Create a public varargs factory builder --- src/coffi/ffi.clj | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/coffi/ffi.clj b/src/coffi/ffi.clj index 6492513..7fe9ae2 100644 --- a/src/coffi/ffi.clj +++ b/src/coffi/ffi.clj @@ -649,6 +649,13 @@ (function-descriptor args ret)) (downcall-fn args ret))) +(defn make-varargs-factory + [symbol required-args ret] + (memoize + (fn [& types] + (let [args (concat required-args types)] + (make-downcall symbol args ret))))) + (s/def ::defcfn-args (s/cat :name simple-symbol? :doc (s/? string?)