summaryrefslogtreecommitdiff
path: root/libguile/foreign.h
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2010-01-18 14:36:23 +0100
committerAndy Wingo <wingo@pobox.com>2010-01-26 22:56:41 +0100
commit20aafae22a4f11289b65dba685495a808ebd6b07 (patch)
tree4356c3736e256673d46b227f90d57dc33ece249a /libguile/foreign.h
parentab4779ffcfb463201d46459e06b9188dd5f1cbda (diff)
downloadguile-20aafae22a4f11289b65dba685495a808ebd6b07.tar.gz
byte access to foreigns via bytevectors
* libguile/foreign.h: * libguile/foreign.c (scm_foreign_ref, scm_foreign_set_x): Remove all bits about offsets and aliasing; bytevectors are much better at that. (scm_foreign_to_bytevector, scm_bytevector_to_foreign): New functions for getting at the bytes of a memory region. * module/system/foreign.scm (foreign->bytevector, bytevector->foreign): Export these.
Diffstat (limited to 'libguile/foreign.h')
-rw-r--r--libguile/foreign.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/libguile/foreign.h b/libguile/foreign.h
index 522916d8a..4a73afcdd 100644
--- a/libguile/foreign.h
+++ b/libguile/foreign.h
@@ -90,8 +90,11 @@ SCM_API SCM scm_take_foreign_pointer (scm_t_foreign_type type, void *ptr,
scm_t_foreign_finalizer finalizer);
SCM_API SCM scm_foreign_type (SCM foreign);
-SCM_API SCM scm_foreign_ref (SCM foreign, SCM type, SCM offset, SCM len);
-SCM_API SCM scm_foreign_set_x (SCM foreign, SCM val, SCM type, SCM offset);
+SCM_API SCM scm_foreign_ref (SCM foreign);
+SCM_API SCM scm_foreign_set_x (SCM foreign, SCM val);
+SCM_API SCM scm_foreign_to_bytevector (SCM foreign, SCM type,
+ SCM offset, SCM len);
+SCM_API SCM scm_bytevector_to_foreign (SCM bv, SCM offset, SCM len);
SCM_INTERNAL void scm_i_foreign_print (SCM foreign, SCM port,
scm_print_state *pstate);