3 (defmacro defcfun
+doc
((c-name lisp-name
) return-type
(&body args
) docstring
)
5 (defcfun (,c-name
,lisp-name
) ,return-type
,@args
)
6 (setf (documentation #',lisp-name
'function
) ,docstring
)))
8 (defmacro defcfun
+out
+doc
((c-name lisp-name
) return-type
(&body args
) docstring
)
9 (let ((internal-name (intern (format nil
"%~a" lisp-name
)))
10 (in-arg-names (mapcar #'second
(remove-if-not #'(lambda (arg)
13 (out-args (mapcar #'cdr
(remove-if-not #'(lambda (arg)
17 (defcfun (,c-name
,internal-name
) ,return-type
18 ,@(mapcar #'(lambda (arg)
19 (if (eql (car arg
) :out
)
20 (list (second arg
) :pointer
)
23 (defun ,lisp-name
,in-arg-names
25 (with-foreign-objects ,out-args
26 (,internal-name
,@(mapcar #'second args
))
27 (list ,@(mapcar #'(lambda (arg)
28 `(mem-ref ,(first arg
) ',(second arg
)))