summaryrefslogtreecommitdiff
path: root/libguile/foreign.h
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2010-09-03 15:12:54 +0200
committerLudovic Courtès <ludo@gnu.org>2010-09-03 15:26:37 +0200
commit33186356668fe7697a8f2692660aaff69178d720 (patch)
treeec54e0b939ee5abccd30b9e1a1c76970e921dbf4 /libguile/foreign.h
parenta148c752ba7adf0d2005cc7bc5928a2dde467609 (diff)
downloadguile-33186356668fe7697a8f2692660aaff69178d720.tar.gz
Add `procedure->pointer' to the FFI.
* libguile/foreign.c (make_cif): New procedure, with code formerly in `scm_make_foreign_function'. (scm_make_foreign_function): Use it. (invoke_closure, scm_procedure_to_pointer)[FFI_CLOSURES]: New functions. * libguile/foreign.h (scm_procedure_to_pointer): New declaration. * module/system/foreign.scm: Export `procedure->pointer' when available. * test-suite/standalone/test-ffi (f-callback-1, f-callback-2): New procedures and related tests. * test-suite/standalone/test-ffi-lib.c (test_ffi_callback_1, test_ffi_callback_2): New functions. * test-suite/tests/foreign.test ("procedure->pointer"): New test prefix. * doc/ref/api-foreign.texi (Dynamic FFI): Document `procedure->pointer'.
Diffstat (limited to 'libguile/foreign.h')
-rw-r--r--libguile/foreign.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/libguile/foreign.h b/libguile/foreign.h
index f5fac5136..1c576211f 100644
--- a/libguile/foreign.h
+++ b/libguile/foreign.h
@@ -95,6 +95,8 @@ SCM_INTERNAL SCM scm_pointer_to_string (SCM pointer);
SCM_API SCM scm_make_foreign_function (SCM return_type, SCM func_ptr,
SCM arg_types);
+SCM_API SCM scm_procedure_to_pointer (SCM return_type, SCM func_ptr,
+ SCM arg_types);
SCM_INTERNAL SCM scm_i_foreign_call (SCM foreign, const SCM *argv);