summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2012-07-04 17:43:53 +0200
committerAndy Wingo <wingo@pobox.com>2012-07-04 17:43:53 +0200
commit467be245cbd8992b69c53b9fafeb2828fe816a0b (patch)
treec051192aeff20237b4a4eec86325a25828f8c9cd
parentd2e3579363c5f4c3ddc0eb993fad03eeac055491 (diff)
downloadguile-467be245cbd8992b69c53b9fafeb2828fe816a0b.tar.gz
add scm_{to,from}_pointer docs
* doc/ref/api-foreign.texi: Add documentation for scm_to_pointer and scm_from_pointer.
-rw-r--r--doc/ref/api-foreign.texi16
1 files changed, 16 insertions, 0 deletions
diff --git a/doc/ref/api-foreign.texi b/doc/ref/api-foreign.texi
index 3097a5211..57cf8846d 100644
--- a/doc/ref/api-foreign.texi
+++ b/doc/ref/api-foreign.texi
@@ -582,6 +582,22 @@ Unsafely cast @var{pointer} to a Scheme object.
Cross your fingers!
@end deffn
+Sometimes you want to give C extensions access to the dynamic FFI. At
+that point, the names get confusing, because ``pointer'' can refer to a
+@code{SCM} object that wraps a pointer, or to a @code{void*} value. We
+will try to use ``pointer object'' to refer to Scheme objects, and
+``pointer value'' to refer to @code{void *} values.
+
+@deftypefn {C Function} SCM scm_from_pointer (void *ptr, void (*finalizer) (void*))
+Create a pointer object from a pointer value.
+
+If @var{finalizer} is non-null, Guile arranges to call it on the pointer
+value at some point after the pointer object becomes collectable.
+@end deftypefn
+
+@deftypefn {C Function} void* scm_to_pointer (SCM obj)
+Unpack the pointer value from a pointer object.
+@end deftypefn
@node Void Pointers and Byte Access
@subsubsection Void Pointers and Byte Access