Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions src/iffi/function.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,11 @@
(if (null param-config)
doc
(with-output-to-string (out)
(let ((*print-case* :downcase))
(let ((*print-case* :downcase)
(rest-p nil))
(when (eq (car (last param-config)) '&rest)
(setq param-config (butlast param-config))
(setq rest-p t))
(format out "Adapted result: ")
(prin1 return-type out)
(format out "~&Adapted parameters:")
Expand All @@ -133,6 +137,8 @@
(prin1 type out)
(format out " ")
(princ name out))
(when rest-p
(format out "~&..."))
(format out "~&~%~A" doc)))))


Expand Down Expand Up @@ -160,7 +166,7 @@
'(:const))
(loop for param in param-config
if (eq param '&rest)
collect '&rest
collect ''&rest
else
collect
(destructuring-bind (cffi-type
Expand All @@ -178,8 +184,7 @@
(cffi:defcfun (,mangled ,cfun-name ,@(nreverse cffi-opts)) ,return-type
,@(when doc
(list doc))
,@(loop for (param-name type) in param-config
collect `(,param-name ,type)))
,@param-config)
(meta-eval
(setf (intricate-function ',name ,@signed-param-types) ',cfun-name))
,@(when pointer-extractor
Expand Down