summaryrefslogtreecommitdiff
path: root/alien.lisp
diff options
context:
space:
mode:
Diffstat (limited to 'alien.lisp')
-rw-r--r--alien.lisp12
1 files changed, 12 insertions, 0 deletions
diff --git a/alien.lisp b/alien.lisp
new file mode 100644
index 0000000..3451dc9
--- /dev/null
+++ b/alien.lisp
@@ -0,0 +1,12 @@
+(in-package #:alien)
+
+(defmacro call (fname rtype &rest types-n-values)
+ (let ((tlist (queue:new))
+ (vlist (queue:new)))
+ (dolist (item types-n-values)
+ (queue:add tlist (first item))
+ (queue:add vlist (second item)))
+ `(alien-funcall (extern-alien ,fname
+ (function ,rtype
+ ,@(queue:to-list tlist)))
+ ,@(queue:to-list vlist))))