summaryrefslogtreecommitdiff
path: root/libguile/ports.h
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2016-04-30 14:46:45 +0200
committerAndy Wingo <wingo@pobox.com>2016-04-30 14:46:45 +0200
commit6a752bcf2ae78ee1ce25512a7c65307a909e99e1 (patch)
tree3263a187ced7f2a912d0f0b329409b278227646d /libguile/ports.h
parent300c85b0f0943f3af1c53b5df8937d4b2cef97a3 (diff)
downloadguile-6a752bcf2ae78ee1ce25512a7c65307a909e99e1.tar.gz
peek-byte in Scheme
* libguile/ports.c (trampoline_to_c_read, trampoline_to_c_write): Since C might assume that the indices are within bounds of the bytevector, verify them more here. (scm_port_random_access_p, scm_port_read_buffering) (scm_set_port_read_buffer, scm_port_read, scm_port_write): New helpers exposed to (ice-9 ports). (scm_port_read_buffer, scm_port_write_buffer): Don't flush or validate port mode; we do that in Scheme. * module/ice-9/ports.scm: Implement enough of port machinery to implement peek-byte in Scheme. Not yet exported.
Diffstat (limited to 'libguile/ports.h')
-rw-r--r--libguile/ports.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/libguile/ports.h b/libguile/ports.h
index ba4bc2c3a..2a6e42c8b 100644
--- a/libguile/ports.h
+++ b/libguile/ports.h
@@ -316,6 +316,12 @@ SCM_API SCM scm_drain_input (SCM port);
SCM_API void scm_end_input (SCM port);
SCM_API SCM scm_force_output (SCM port);
SCM_API void scm_flush (SCM port);
+
+SCM_INTERNAL SCM scm_port_random_access_p (SCM port);
+SCM_INTERNAL SCM scm_port_read_buffering (SCM port);
+SCM_INTERNAL SCM scm_set_port_read_buffer_x (SCM port, SCM buf);
+SCM_INTERNAL SCM scm_port_read (SCM port);
+SCM_INTERNAL SCM scm_port_write (SCM port);
SCM_INTERNAL SCM scm_port_read_buffer (SCM port);
SCM_INTERNAL SCM scm_port_write_buffer (SCM port);