diff options
author | Mark H Weaver <mhw@netris.org> | 2013-04-06 23:19:55 -0400 |
---|---|---|
committer | Mark H Weaver <mhw@netris.org> | 2013-04-07 15:37:23 -0400 |
commit | 3ace9a8e4e1de7082ceec4aea0813a6adaa913bf (patch) | |
tree | aa9c4ad234e0cdbda23966b36f5abec0e96b0e11 /doc/ref/api-modules.texi | |
parent | b6e374e535597448cb09588300d76b5d270d5d3a (diff) | |
download | guile-3ace9a8e4e1de7082ceec4aea0813a6adaa913bf.tar.gz |
Add keyword arguments to file opening procedures.
* libguile/fports.c (scm_open_file_with_encoding): New API function,
containing the code previously found in 'scm_open_file', but modified
to accept the new 'guess_encoding' and 'encoding' arguments.
(scm_open_file): Now just a simple wrapper that calls
'scm_open_file_with_encoding'.
(scm_i_open_file): New implementation of 'open-file' that accepts
keyword arguments '#:guess-encoding' and '#:encoding', and calls
'scm_open_file_with_encoding'.
(scm_init_fports_keywords): New initialization function that gets
called after keywords are initialized.
* libguile/fports.h (scm_open_file_with_encoding,
scm_init_fports_keywords): Add prototypes.
* libguile/init.c (scm_i_init_guile): Call 'scm_init_fports_keywords'.
* module/ice-9/boot-9.scm: Add enhanced versions of 'open-input-file',
'open-output-file', 'call-with-input-file', 'call-with-output-file',
'with-input-from-file', 'with-output-to-file', and
'with-error-to-file', that accept keyword arguments '#:binary',
'#:encoding', and (for input port constructors) '#:guess-encoding'.
* doc/ref/api-io.texi (File Ports): Update documentation.
* test-suite/tests/ports.test ("keyword arguments for file openers"):
Add tests.
Diffstat (limited to 'doc/ref/api-modules.texi')
0 files changed, 0 insertions, 0 deletions