1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-01 12:20:26 +02:00

* ports.c (scm_drain_input): extended the docstring. thanks to

Alex Schroeder and Thien-Thi Nguyen.
This commit is contained in:
Gary Houston 2001-09-25 22:59:16 +00:00
parent 4f39d095cb
commit ec10ef3942
2 changed files with 18 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2001-09-25 Gary Houston <ghouston@arglist.com>
* ports.c (scm_drain_input): extended the docstring. thanks to
Alex Schroeder and Thien-Thi Nguyen.
2001-09-23 Mikael Djurfeldt <mdj@linnaeus>
* validate.h (SCM_NUM2FLOAT, SCM_NUM2DOUBLE,

View file

@ -311,8 +311,19 @@ size_t scm_take_from_input_buffers (SCM port, char *dest, size_t read_len)
/* Clear a port's read buffers, returning the contents. */
SCM_DEFINE (scm_drain_input, "drain-input", 1, 0, 0,
(SCM port),
"Drain @var{port}'s read buffers (including any pushed-back\n"
"characters) and return the content as a single string.")
"This procedure clears a port's input buffers, similar\n"
"to the way that force-output clears the output buffer. The\n"
"contents of the buffers are returned as a single string, e.g.,\n"
"\n"
"@lisp\n"
"(define p (open-input-file ...))\n"
"(drain-input p) => empty string, nothing buffered yet.\n"
"(unread-char (read-char p) p)\n"
"(drain-input p) => initial chars from p, up to the buffer size.\n"
"@end lisp\n\n"
"Draining the buffers may be useful for cleanly finishing\n"
"buffered I/O so that the file descriptor can be used directly\n"
"for further input.")
#define FUNC_NAME s_scm_drain_input
{
SCM result;