Fixes <http://bugs.gnu.org/21114>.
* libguile/Makefile.am (chknew-E chknew-SIG): Remove the line
continuation after the targets, and include numbers in the
recipe's signal/error regexp to catch names like E2BIG.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* module/web/response.scm (make-delimited-input-port)[close]: Replace
erroneous self-recursive call with a call to 'close-port'.
* test-suite/tests/web-response.test ("example-1")["response-body-port +
close"]: New test.
Reported by Panicz Maciej Godek <godek.maciek@gmail.com> in
<http://lists.gnu.org/archive/html/guile-user/2015-09/msg00017.html>.
* module/ice-9/psyntax.scm (match-each+): Fix the case where a non-pair
syntax object is encountered in a dotted tail.
* module/ice-9/psyntax-pp.scm: Regenerate.
When encountering the #!r6rs directive, apply the appropriate reader
settings to the port.
* libguile/read.scm (read-string-as-list): New helper procedure.
(scm_read_shebang): Set reader options implied by the R6RS syntax
upon encountering the #!r6rs directive.
* test-suite/tests/reader.test (per-port-read-options): Add tests for
the #!r6rs directive.
Originally applied to stable-2.0 as "Fix bytevector and custom binary
ports to actually use ISO-8859-1 encoding.", commit
d574d96f87. Related to
http://bugs.gnu.org/20200, which was introduced in in stable-2.0 but
never existed on master. Test modified by Andy Wingo to add a
`force-output' where needed.
* test-suite/tests/r6rs-ports.test: Add tests.
* module/system/base/types.scm (cell->object): Use 'get-bytevector-n'
instead of 'get-bytevector-all', so that the zero-length case does not
return EOF.
Fixes <http://bugs.gnu.org/19646>.
Reported by John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>.
* test-suite/tests/posix.test ("affinity")["setaffinity"]: Wrap in
'catch' and throw 'unresolved upon ENOSYS.
Before that it would occasionally fail because the "$target" (not the
intermediate temporary file) would be produced.
* test-suite/standalone/test-guild-compile: Call 'pause' before 'sleep'
in test program.
Although popular compilers allow it as long as the expression is of type
void, it violates C99 and some compilers choke on it.
* libguile/numbers.c (scm_euclidean_divide, scm_floor_divide)
(scm_ceiling_divide, scm_truncate_divide, scm_centered_divide)
(scm_round_divide): Don't use the return statement with an expression
from functions with return type void.
* libguile/ports-internal.h (scm_port_buffer_position):
(scm_port_position_line, scm_port_position_set_line):
(scm_port_position_column, scm_port_position_set_column): New
helpers.
(scm_t_port): Ports now hold position as a pair, so that Scheme can
access it easily.
(SCM_LINUM, SCM_COL, SCM_INCLINE, SCM_ZEROCOL, SCM_INCCOL)
(SCM_DECCOL, SCM_TABCOL): Remove.
* libguile/ports.c (make_port_buffer): Rename from
scm_c_make_port_buffer, make static, and take port as an argument so
we can initialize the position field.
(initialize_port_buffers): Adapt make_port_buffer change.
(scm_c_make_port_with_encoding): Initialize position.
(update_port_position): Rename from update_port_lf, and operate on
port position objects.
(scm_ungetc): Operate on port position objects.
(scm_setvbuf, scm_expand_port_read_buffer_x): Adapt to
make_port_buffer change.
(scm_lfwrite): Adapt to call update_port_position.
(scm_port_line, scm_set_port_line_x, scm_port_column)
(scm_set_port_column_x): Adapt to use port positions.
* libguile/ports.h (scm_c_make_port_buffer): Remove internal decl.
* libguile/read.c: Adapt to use scm_port_line / scm_port_column instead
of SCM_LINUM et al.
* module/ice-9/ports.scm (port-buffer-position, port-position-line)
(port-position-column, set-port-position-line!)
(set-port-position-column!): New accessors for the internals module.
* module/ice-9/sports.scm (advance-port-position!): Rename from
port-advance-position! and use the new accessors.
(read-char, port-fold-chars/iso-8859-1): Adapt to use
advance-port-position!.
* libguile/ports-internal.h: Remove unused scm_t_port_rw_active.
* libguile/deprecated.h (scm_port_rw_active): Remove deprecation shim,
as this thing is just gone now.
This removes a limitation on the number of port types, simplifies the
API, and removes a central point of coordination.
* libguile/ports-internal.h (struct scm_t_port_type): Rename from
scm_t_ptob_descriptor, now that it's private. Add GOOPS class
fields.
(struct scm_t_port): Rename from struct scm_port, especially
considering that deprecated.h redefines scm_port using the
preprocessor :(.
* libguile/ports.h: Add definitions of SCM_PORT and SCM_PORT_TYPE,
though the scm_t_port and scm_t_port_type types are incomplete.
(SCM_TC2PTOBNUM, SCM_PTOBNUM, SCM_PTOBNAME): Remove, as there are no
more typecodes for port types.
(scm_c_num_port_types, scm_c_port_type_ref, scm_c_port_type_add_x):
Remove.
(scm_make_port_type): Return a scm_t_port_type*. All methods adapted
to take a scm_t_port_type* instead of a ptobnum.
(scm_c_make_port_with_encoding, scm_c_make_port): Take a port type
pointer instead of a tag.
(scm_new_port_table_entry): Remove; not useful.
* libguile/ports.c: Remove things related to the port kind table. Adapt
uses of SCM_PORT_DESCRIPTOR / scm_t_ptob_descriptor to use
SCM_PORT_TYPE and scm_t_port_type.
* libguile/deprecated.c:
* libguile/deprecated.h:
* libguile/filesys.c:
* libguile/fports.c:
* libguile/fports.h:
* libguile/print.c:
* libguile/r6rs-ports.c:
* libguile/strports.c:
* libguile/strports.h:
* libguile/tags.h:
* libguile/vports.c:
* test-suite/standalone/test-scm-c-read.c: Adapt to change.
* libguile/goops.c (scm_class_of, make_port_classes)
(scm_make_port_classes, create_port_classes): Adapt to store the
classes in the ptob.
* libguile/ports-internal.h (enum scm_port_encoding_mode): Remove unused
enum.
(scm_t_port_internal, scm_t_port): Make encoding and
conversion_strategy private. Instead of scm_t_port_internal containing
scm_t_port, now that all members are private, we can store the user's
"stream" in a word in the port object itself and make the whole of
scm_t_port private. The next commit will remove scm_t_port_internal.
(SCM_PTAB_ENTRY, SCM_PORT_DESCRIPTOR): Make private.
* libguile/ports.c (scm_c_make_port_with_encoding): Adapt to new port
layout.
(scm_port_print): Use SCM_PTAB_ENTRY when printing.
* libguile/ports.h: Remove scm_t_port definition.
* libguile/ioext.c (get_matching_port): Simplify.
* libguile/fports.c (scm_i_evict_port): Simplify.