1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-21 11:10:21 +02:00

Replace setbinary' by a public %default-port-encoding' fluid.

* doc/ref/api-evaluation.texi (Character Encoding of Source Files): Add
  reference to the "Ports" node.

* doc/ref/api-io.texi (Ports): Document `%default-port-encoding'.

* libguile/ports.c (scm_port_encoding_var): Rename to...
  (default_port_encoding_var): ... this; update callers.  Make `static'.

* libguile/posix.c (scm_setbinary): Remove.

* libguile/posix.h: Adjust accordingly.

* test-suite/tests/numbers.test: Remove unneeded `setbinary' call.

* test-suite/tests/ports.test: Replace `setbinary' call by equivalent
  `%default-port-encoding' mutation and `set-port-encoding!' calls.

* test-suite/tests/r6rs-ports.test: Replace `setbinary' call by
  equivalent `%default-port-encoding' mutation.
This commit is contained in:
Ludovic Courtès 2009-11-14 16:14:20 +01:00
parent c2be4e891c
commit d6a6989e08
8 changed files with 38 additions and 53 deletions

View file

@ -1,5 +1,5 @@
;;;; numbers.test --- tests guile's numbers -*- scheme -*-
;;;; Copyright (C) 2000, 2001, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
;;;; Copyright (C) 2000, 2001, 2003, 2004, 2005, 2006, 2009 Free Software Foundation, Inc.
;;;;
;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
@ -22,7 +22,6 @@
;;;
;;; miscellaneous
;;;
(setbinary)
(define exception:numerical-overflow
(cons 'numerical-overflow "^Numerical overflow"))

View file

@ -1,7 +1,7 @@
;;;; ports.test --- test suite for Guile I/O ports -*- scheme -*-
;;;; Jim Blandy <jimb@red-bean.com> --- May 1999
;;;;
;;;; Copyright (C) 1999, 2001, 2004, 2006, 2007 Free Software Foundation, Inc.
;;;; Copyright (C) 1999, 2001, 2004, 2006, 2007, 2009 Free Software Foundation, Inc.
;;;;
;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
@ -33,8 +33,12 @@
;;;; Some general utilities for testing ports.
;;; Make sure we are set up for 8-bit data
(setbinary)
;; Make sure we are set up for 8-bit Latin-1 data.
(fluid-set! %default-port-encoding "ISO-8859-1")
(for-each (lambda (p)
(set-port-encoding! p (fluid-ref %default-port-encoding)))
(list (current-input-port) (current-output-port)
(current-error-port)))
;;; Read from PORT until EOF, and return the result as a string.
(define (read-all port)

View file

@ -27,8 +27,8 @@
;;; All these tests assume Guile 1.8's port system, where characters are
;;; treated as octets.
;;; Set the default encoding of future ports to be binary
(setbinary)
;; Set the default encoding of future ports to be Latin-1.
(fluid-set! %default-port-encoding #f)
(with-test-prefix "7.2.5 End-of-File Object"