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

* scheme-io.texi: Removed obsolete section Binary IO. Added

new section Block Reading and Writing.  Updated section
	Line/Delimited with module usage.
This commit is contained in:
Gary Houston 2001-05-01 21:05:44 +00:00
parent 466bb4b350
commit e200c20fa0
2 changed files with 32 additions and 36 deletions

View file

@ -1,3 +1,9 @@
2001-05-01 Gary Houston <ghouston@arglist.com>
* scheme-io.texi: Removed obsolete section Binary IO. Added
new section Block Reading and Writing. Updated section
Line/Delimited with module usage.
2001-04-29 Neil Jerram <neil@ossau.uklinux.net> 2001-04-29 Neil Jerram <neil@ossau.uklinux.net>
* deprecated.texi (Tags): Removed - deprecation expired. * deprecated.texi (Tags): Removed - deprecation expired.

View file

@ -9,7 +9,7 @@
* Closing:: Procedures to close a port. * Closing:: Procedures to close a port.
* Random Access:: Moving around a random access port. * Random Access:: Moving around a random access port.
* Line/Delimited:: Read and write lines or delimited text. * Line/Delimited:: Read and write lines or delimited text.
* Binary IO:: Save and restore Scheme objects. * Block Reading and Writing:: Reading and writing blocks of text.
* Default Ports:: Defaults for input, output and errors. * Default Ports:: Defaults for input, output and errors.
* Port Types:: Types of port and how to make them. * Port Types:: Types of port and how to make them.
@end menu @end menu
@ -323,23 +323,21 @@ in which case the truncation occurs at the current port.
position. The return value is unspecified. position. The return value is unspecified.
@end deffn @end deffn
@node Line/Delimited @node Line/Delimited
@section Handling Line Oriented and Delimited Text @section Line Oriented and Delimited Text
[Line-oriented and delimited IO. Or should this be merged into the The delimited-I/O module can be accessed with:
previous two sections?]
Extended I/O procedures are available which read or write lines of text @smalllisp
or read text delimited by a specified set of characters. (use-modules (ice-9 rdelim))
@end smalllisp
@findex fwrite It can be used to read or write lines of text, or read text delimited by
@findex fread a specified set of characters. It's similar to the @code{(scsh rdelim)}
Interfaces to @code{read}/@code{fread} and @code{write}/@code{fwrite} are module from guile-scsh, but does not use multiple values or character
also available, as @code{uniform-array-read!} and @code{uniform-array-write!}, sets and has an extra procedure @code{write-line}.
@ref{Uniform Arrays}.
@c begin (scm-doc-string "boot-9.scm" "read-line") @c begin (scm-doc-string "rdelim.scm" "read-line")
@deffn procedure read-line [port] [handle-delim] @deffn procedure read-line [port] [handle-delim]
Return a line of text from @var{port} if specified, otherwise from the Return a line of text from @var{port} if specified, otherwise from the
value returned by @code{(current-input-port)}. Under Unix, a line of text value returned by @code{(current-input-port)}. Under Unix, a line of text
@ -359,13 +357,10 @@ Push the terminating delimiter (if any) back on to the port.
@item split @item split
Return a pair containing the string read from the port and the Return a pair containing the string read from the port and the
terminating delimiter or end-of-file object. terminating delimiter or end-of-file object.
NOTE: if the scsh module is loaded then
multiple values are returned instead of a pair.
@end table @end table
@end deffn @end deffn
@c begin (scm-doc-string "boot-9.scm" "read-line!") @c begin (scm-doc-string "rdelim.scm" "read-line!")
@deffn procedure read-line! buf [port] @deffn procedure read-line! buf [port]
Read a line of text into the supplied string @var{buf} and return the Read a line of text into the supplied string @var{buf} and return the
number of characters added to @var{buf}. If @var{buf} is filled, then number of characters added to @var{buf}. If @var{buf} is filled, then
@ -374,18 +369,15 @@ Read from @var{port} if
specified, otherwise from the value returned by @code{(current-input-port)}. specified, otherwise from the value returned by @code{(current-input-port)}.
@end deffn @end deffn
@c begin (scm-doc-string "boot-9.scm" "read-delimited") @c begin (scm-doc-string "rdelim.scm" "read-delimited")
@deffn procedure read-delimited delims [port] [handle-delim] @deffn procedure read-delimited delims [port] [handle-delim]
Read text until one of the characters in the string @var{delims} is found Read text until one of the characters in the string @var{delims} is found
or end-of-file is reached. Read from @var{port} if supplied, otherwise or end-of-file is reached. Read from @var{port} if supplied, otherwise
from the value returned by @code{(current-input-port)}. from the value returned by @code{(current-input-port)}.
@var{handle-delim} takes the same values as described for @code{read-line}. @var{handle-delim} takes the same values as described for @code{read-line}.
NOTE: if the scsh module is loaded then @var{delims} must be an scsh
char-set, not a string.
@end deffn @end deffn
@c begin (scm-doc-string "boot-9.scm" "read-delimited!") @c begin (scm-doc-string "rdelim.scm" "read-delimited!")
@deffn procedure read-delimited! delims buf [port] [handle-delim] [start] [end] @deffn procedure read-delimited! delims buf [port] [handle-delim] [start] [end]
Read text into the supplied string @var{buf} and return the number of Read text into the supplied string @var{buf} and return the number of
characters added to @var{buf} (subject to @var{handle-delim}, which takes characters added to @var{buf} (subject to @var{handle-delim}, which takes
@ -395,9 +387,6 @@ delimiter. Also terminates if one of the characters in the string
@var{delims} is found @var{delims} is found
or end-of-file is reached. Read from @var{port} if supplied, otherwise or end-of-file is reached. Read from @var{port} if supplied, otherwise
from the value returned by @code{(current-input-port)}. from the value returned by @code{(current-input-port)}.
NOTE: if the scsh module is loaded then @var{delims} must be an scsh
char-set, not a string.
@end deffn @end deffn
@deffn primitive write-line obj [port] @deffn primitive write-line obj [port]
@ -440,20 +429,21 @@ delimiter may be either a newline or the @var{eof-object}; if
@code{(#<eof> . #<eof>)}. @code{(#<eof> . #<eof>)}.
@end deffn @end deffn
@node Binary IO @node Block reading and writing
@section Saving and Restoring Scheme Objects @section Block reading and writing
@deffn primitive binary-read [port] The Block-string-I/O module can be accessed with:
Read and return an object from @var{port} in a binary format.
If omitted, @var{port} defaults to the current output port. @smalllisp
(use-modules (ice-9 rw))
@end smalllisp
It currently contains a single procedure which helps implement
the @code{(scsh rw)} module in guile-scsh.
@deffn primitive read-string!/partial str [port_or_fdes] [start] [end]
@end deffn @end deffn
@deffn primitive binary-write obj [port]
Write @var{obj} to @var{port} in a binary format.
If omitted, @var{port} defaults to the current output port.
@end deffn
@node Default Ports @node Default Ports
@section Default Ports for Input, Output and Errors @section Default Ports for Input, Output and Errors