diff options
author | Andy Wingo <wingo@pobox.com> | 2016-04-20 09:09:15 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2016-04-20 09:22:20 +0200 |
commit | 5a342f61c4b09e503918b8bd2d996f138b114849 (patch) | |
tree | 3ceda4975e85d2fa52c8d0563761eb344d68af99 /libguile/read.c | |
parent | bb6edc5a35c570b3355dd69f89cbc8d0f85fc21c (diff) |
Port buffers are Scheme values
* libguile/ports-internal.h (scm_port_buffer_bytevector)
(scm_port_buffer_cur, scm_port_buffer_set_cur)
(scm_port_buffer_end, scm_port_buffer_set_end)
(scm_port_buffer_has_eof_p, scm_port_buffer_set_has_eof_p): New
helpers.
* libguile/ports-internal.h (scm_port_buffer_size)
(scm_port_buffer_reset, scm_port_buffer_reset_end)
(scm_port_buffer_can_take, scm_port_buffer_can_put)
(scm_port_buffer_can_putback, scm_port_buffer_did_take)
(scm_port_buffer_did_put, scm_port_buffer_take_pointer)
(scm_port_buffer_put_pointer, scm_port_buffer_take)
(scm_port_buffer_put, scm_port_buffer_putback): Adapt to treat port
buffers as SCM values and use helpers to access them.
* libguile/ports.c (scm_i_clear_pending_eof, scm_i_set_pending_eof)
(scm_c_make_port_buffer, scm_i_read_unlocked)
(scm_c_read_bytes_unlocked, scm_i_unget_bytes_unlocked)
(scm_setvbuf, scm_fill_input, scm_take_from_input_buffers)
(scm_drain_input, scm_end_input_unlocked, scm_flush_unlocked)
(scm_fill_input_unlocked, scm_i_write_unlocked)
(scm_c_write_bytes_unlocked, scm_c_write_unlocked)
(scm_char_ready_p): Adapt to treat port buffers as SCM values and use
helpers to access them.
(scm_port_read_buffer, scm_port_write_buffer): New functions,
allowing (ice-9 ports) to access port buffers.
* libguile/ports.h: Update comments on port buffers. Replace
scm_t_port_buffer structure with a Scheme vector whose fields are
enumerated by "enum scm_port_buffer_field".
(scm_get_byte_or_eof_unlocked, scm_peek_byte_or_eof_unlocked): Adapt
these implementations to port buffer representation change.
* libguile/r6rs-ports.c (scm_get_bytevector_some):
* libguile/read.c (scm_i_scan_for_encoding):
* libguile/rw.c (scm_write_string_partial): Port buffers are Scheme
objects.
Diffstat (limited to 'libguile/read.c')
-rw-r--r-- | libguile/read.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libguile/read.c b/libguile/read.c index bc5c3c179..d717ea27c 100644 --- a/libguile/read.c +++ b/libguile/read.c @@ -2057,7 +2057,7 @@ char * scm_i_scan_for_encoding (SCM port) { scm_t_port *pt; - scm_t_port_buffer *buf; + SCM buf; char header[SCM_ENCODING_SEARCH_SIZE+1]; size_t bytes_read, encoding_length, i; char *encoding = NULL; |