Add `get-string-n' and `get-string-n!' for R6RS ports
authorAndreas Rottmann <a.rottmann@gmx.at>
Sun, 13 Mar 2011 21:39:14 +0000 (22:39 +0100)
committerLudovic Courtès <ludo@gnu.org>
Sun, 13 Mar 2011 21:39:14 +0000 (22:39 +0100)
commita6c377f7d8a311b0ce4f9c5900b1c81c27b2d60c
tree7a4bc6be9ea639d40c53385b1e2858ed717a8099
parentca33b501a93f8de389c1e3e1bc987f63b6912029
Add `get-string-n' and `get-string-n!' for R6RS ports

* libguile/r6rs-ports.c (scm_get_string_n_x): Implement `get-string-n!'
  in C for efficiency.
* libguile/r6rs-ports.h: Add prototype for this function.
* module/ice-9/binary-ports.scm: Export `get-string-n!'.

* module/rnrs/io/ports.scm (get-string-n): Implement based on
  `get-string-n!'.
  Export both `get-string-n!' and `get-string-n'.
* module/rnrs.scm: Also export these.

* test-suite/tests/r6rs-ports.test (8.2.9 Textual input): Add a few
  tests for `get-string-n' and `get-string-n!'.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
libguile/r6rs-ports.c
libguile/r6rs-ports.h
module/ice-9/binary-ports.scm
module/rnrs.scm
module/rnrs/io/ports.scm
test-suite/tests/r6rs-ports.test