* module/Makefile.am:
* module/system/vm/linker.scm: New file, split out of (system vm elf).
(make-string-table, string-table-intern): Export under their bare
names, instead of make-elf-string-table and elf-string-table-intern.
* module/system/vm/elf.scm: Remove linking capabilities.
(string-table-ref): Export.
* module/language/objcode/elf.scm (bytecode->elf): Adapt to use (system
vm linker).
* test-suite/tests/linker.test: New test.
* module/web/uri.scm (uri-encode): the hexadecimal percent-encoding %HH
is now uppercased as suggested by RFC3986:
"For consistency, URI producers and normalizers should use
uppercase hexadecimal digits for all percent-encodings."
* test-suite/tests/web-uri.test ("encode"): update tests.
Fixes <http://bugs.gnu.org/14203> reported by Nikita Karetnikov.
* doc/ref/api-macros.texi (Defining Macros, Syntax Rules): Fix
definition of 'my-or' example macro to use the let-bound variable.
Partly fixes <http://bugs.gnu.org/14042>.
Reported by Marc Girod <marc.girod@gmail.com>
* test-suite/standalone/test-language: Use a shell construct that
/bin/sh on Solaris 10 can understand.
* test-suite/tests/ports.test ("BOM not discarded unless at start of
UTF-16 stream", "BOM not discarded unless at start of UTF-32 stream"):
Adjust tests to reflect the fact that, in the absence of a BOM, big
endian will be used by default for the "UTF-16" and "UTF-32"
encodings.
* libguile/stime.c: Remove #ifdef HAVE_SYS_TIMES_H, HAVE_SYS_TYPES_H,
and HAVE_STRING_H since those headers are always provided by Gnulib
when the corresponding macro is undefined. Fixes a regression on
MinGW introduced by commit 40e2a31.
* GUILE-VERSION (GUILE_MICRO_VERSION): Increment.
(LIBGUILE_INTERFACE_CURRENT): Increment, to account for new C
functions `scm_c_bind_keyword_arguments' et al.
(LIBGUILE_INTERFACE_AGE): Increment.
* libguile/stime.c (scm_init_stime): Fix previous patch. At this point
in the source, we definitely have a run-time function, but don't
necessarily have a real-time function.
* configure.ac: Remove checks for pipe, stftime, times, and select, as
our Gnulib modules already ensure they are provided.
* libguile/stime.c: Rely on gnulib providing `times'.
Reported by Nikita Karetnikov <nikita@karetnikov.org>.
* doc/ref/api-binding.texi (Local Bindings): Remove the incorrect claim
that improperly accessing a letrec-bound variable during evaluation of
its initializers will necessarily cause an error to be signalled.
Reported by Samuel Thibault <samuel.thibault@gnu.org>
and Peter Simons <simons@cryp.to>.
* test-suite/tests/00-socket.test ("AF_INET6/SOCK_STREAM"): Throw
`unresolved' when `bind' throws EADDRNOTAVAIL.
* libguile/filesys.c (scm_sendfile): In Linux-style sendfile(2) code, if
EINTR or EAGAIN occurs, set result to 1 (not 0) so that we actually
keep going. In non-sendfile(2) code, deal gracefully with short reads
due to EOF.
* test-suite/tests/filesys.test ("sendfile"): Use 'let*' to guarantee
the needed order of operations: write (test-file) and then read it.
Add code to check the written data (not just the returned length) in
all tests, including the cases that hit EOF prematurely.
* libguile/filesys.c (scm_sendfile)[HAVE_SYS_SENDFILE_H &&
HAVE_SENDFILE]: Compare RESULT with C_COUNT. Loop until C_COUNT bytes
have been sent.
* doc/ref/posix.texi (File System): Update the description. Explain the
new semantics.
* test-suite/tests/filesys.test ("sendfile"): Rewrite using
`pass-if-equal'. Check the return value for all the tests.
["file with offset past the end", "file with offset near the end"]:
New tests.
* doc/ref/api-evaluation.texi (Character Encoding of Source Files):
Mention UTF-8 as another common encoding used for Scheme source files,
and that it is used by default. Change the description to leave open
the possibility of adding additional heuristics in the future.
Mention that if the coding declaration is in a #!-style block comment,
it must be the first such comment in the file. Mention the
'#:guess-encoding' keyword argument.
* 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.
* libguile/ports.c (scm_i_unget_bytes): New static function.
(scm_unget_bytes): New API function.
(scm_unget_byte): Rewrite to simply call 'scm_i_unget_bytes'.
(scm_ungetc, scm_peek_char, looking_at_bytes): Use 'scm_i_unget_bytes'.
* libguile/ports.h: Add prototype for 'scm_unget_bytes'.
* libguile/fports.c (scm_setvbuf): Use 'scm_unget_bytes'.
* libguile/r6rs-ports.c (scm_unget_bytevector): New procedure.
* module/ice-9/binary-ports.scm (unget-bytevector): New export.
* doc/ref/api-io.texi (R6RS Binary Input): Add documentation.
(R6RS I/O Ports): Update brief description of (ice-9 binary-ports) to
reflect the new reality: it is no longer a subset of (rnrs io ports).
* test-suite/tests/ports.test ("unget-bytevector"): Add test.
* libguile/fports.c (scm_open_file): Do not scan for coding
declarations. Replace 'use_encoding' local variable with
'binary'. Update documentation string.
* module/ice-9/psyntax.scm (include): Add the same file-encoding
logic that's used in compile-file and scm_primitive_load.
* module/ice-9/psyntax-pp.scm: Regenerate.
* doc/ref/api-io.texi (File Ports): Update docs.
* test-suite/tests/ports.test: Change "open-file HONORS file coding
declarations" test to "open-file IGNORES file coding declaration".
* test-suite/tests/coding.test (scan-coding): Use 'file-encoding' to
scan for the encoding, since 'open-input-file' no longer does so.
* doc/ref/api-data.texi (Conversion to/from C, Symbol Primitives,
Keyword Procedures): Fix the recommendations for conversion of C
string constants. The encoding of the source code is irrelevant in
modern compilers. What is relevant is the execution character set.
Both GCC and clang use UTF-8 by default, so recommend the
'scm_from_utf8_*' functions when the argument is a C string constant.
Also fix the broken texinfo markup for 'scm_from_*_symbol' that
prevented them from being listed in the index.
* libguile/keywords.c (scm_keyword_argument_error): New variable.
(scm_c_bind_keyword_arguments): New API function.
* libguile/keywords.h (enum scm_keyword_arguments_flags): New enum.
(scm_t_keyword_arguments_flags): New typedef.
(scm_c_bind_keyword_arguments): New prototype.
* doc/ref/api-data.texi (Coding With Keywords, Keyword Procedures): Add
documentation.
* test-suite/standalone/test-scm-c-bind-keyword-arguments.c: New file.
* test-suite/standalone/Makefile.am: Add
test-scm-c-bind-keyword-arguments test.