diff options
author | Andy Wingo <wingo@pobox.com> | 2016-05-22 18:16:19 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2016-05-22 18:16:19 +0200 |
commit | fd17cf9f72bcfc1832775c848e678e695d05dbd8 (patch) | |
tree | e5e5decb36b46cfa5e436bfb8882b2de9fd5bf91 /libguile/strings.c | |
parent | a4b06357f644c41188d4e3c555ff60c71631493f (diff) | |
download | guile-fd17cf9f72bcfc1832775c848e678e695d05dbd8.tar.gz |
Speed up port position access from Scheme
* libguile/ports-internal.h (scm_port_buffer_position):
(scm_port_position_line, scm_port_position_set_line):
(scm_port_position_column, scm_port_position_set_column): New
helpers.
(scm_t_port): Ports now hold position as a pair, so that Scheme can
access it easily.
(SCM_LINUM, SCM_COL, SCM_INCLINE, SCM_ZEROCOL, SCM_INCCOL)
(SCM_DECCOL, SCM_TABCOL): Remove.
* libguile/ports.c (make_port_buffer): Rename from
scm_c_make_port_buffer, make static, and take port as an argument so
we can initialize the position field.
(initialize_port_buffers): Adapt make_port_buffer change.
(scm_c_make_port_with_encoding): Initialize position.
(update_port_position): Rename from update_port_lf, and operate on
port position objects.
(scm_ungetc): Operate on port position objects.
(scm_setvbuf, scm_expand_port_read_buffer_x): Adapt to
make_port_buffer change.
(scm_lfwrite): Adapt to call update_port_position.
(scm_port_line, scm_set_port_line_x, scm_port_column)
(scm_set_port_column_x): Adapt to use port positions.
* libguile/ports.h (scm_c_make_port_buffer): Remove internal decl.
* libguile/read.c: Adapt to use scm_port_line / scm_port_column instead
of SCM_LINUM et al.
* module/ice-9/ports.scm (port-buffer-position, port-position-line)
(port-position-column, set-port-position-line!)
(set-port-position-column!): New accessors for the internals module.
* module/ice-9/sports.scm (advance-port-position!): Rename from
port-advance-position! and use the new accessors.
(read-char, port-fold-chars/iso-8859-1): Adapt to use
advance-port-position!.
Diffstat (limited to 'libguile/strings.c')
0 files changed, 0 insertions, 0 deletions