1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +02:00
guile/module
Mark H Weaver 3ace9a8e4e 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.
2013-04-07 15:37:23 -04:00
..
ice-9 Add keyword arguments to file opening procedures. 2013-04-07 15:37:23 -04:00
language Remove duplicate definitions of call/ec' and let/ec'. 2013-04-06 15:40:19 +02:00
oop Clarify the copyright status of GOOPS. 2013-01-26 15:41:05 +01:00
rnrs add read-string and read-string! to (ice-9 rdelim) 2013-01-22 15:15:43 +01:00
scripts Fix a couple of warnings. 2012-01-26 00:37:23 +01:00
srfi Add record type printer for srfi-41. 2013-04-07 12:44:31 -04:00
sxml Remove duplicate definitions of call/ec' and let/ec'. 2013-04-06 15:40:19 +02:00
system use chmod portably in (system base compile) 2013-03-10 20:12:09 +01:00
texinfo texinfo plain-text: Use match' for stexi->plain-text'. 2013-03-22 22:09:05 +01:00
web web http: parse numeric time zones in headers 2013-03-27 18:09:49 +01:00
Makefile.am build: Build and check (ice-9 popen) only when --enable-posix and HAVE_FORK. 2013-03-29 19:20:01 +01:00
rnrs.scm Add missing R6RS `open-file-input/output-port' procedure 2012-11-12 20:47:57 +01:00
statprof.scm add gcprof 2011-05-05 11:43:12 +02:00
texinfo.scm texinfo: Recognize `@:'. 2013-03-21 18:52:29 +01:00