1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-18 01:22:24 +02:00
Commit graph

15883 commits

Author SHA1 Message Date
Andy Wingo
dde0d17f8e Use source file permissions for compiled files
* module/system/base/compile.scm (call-with-output-file/atomic): Use the
  permissions of the source file, if available, as the permissions of
  the compiled file.  Fixes #18477.
2016-06-21 18:05:16 +02:00
Andy Wingo
8c8499a5e4 Document pretty-print #:max-expr-width
* doc/ref/misc-modules.texi (Pretty Printing): Document #:max-expr-width
  keyword argument.  Fixes #17657.
2016-06-21 18:05:10 +02:00
Andy Wingo
961e226104 Detect too-old libunistring at configure-time.
* configure.ac: Detect too-old libunistring at configure-time.  Fixes
  #17399.
2016-06-21 18:04:48 +02:00
Andy Wingo
64039f3d12 Update and-let-star.test
* test-suite/tests/and-let-star.test ("and-let*"): Update test
  expectations.
2016-06-21 18:04:42 +02:00
Taylan Ulrich Bayırlı/Kammer
4034a9c5fe Add SRFI-2 (and-let*) test suite.
* test-suite/tests/srfi-2.test: New file.
* test-suite/Makefile.am (SCM_TESTS): Add it.
2016-06-21 18:04:34 +02:00
Taylan Ulrich Bayırlı/Kammer
57e8775915 Fix SRFI-2 (and-let*) implementation.
* module/ice-9/and-let-star.scm (%and-let*): Re-implemented this in a
  more verbose but accurate way.
2016-06-21 18:04:24 +02:00
Andy Wingo
6dc06a5ec6 Document sigaction + SA_RESTART
* doc/ref/posix.texi (Signals): Document interaction between Guile's
  signal handling and SA_RESTART.  Fixes #14640.
2016-06-21 18:03:51 +02:00
Andy Wingo
b77642dff2 Fix size measurement in bytevector_large_set
* libguile/bytevectors.c (bytevector_large_set): Fix computation of
  value size in words.
* test-suite/tests/bytevectors.test: Add test.

Thanks to Ben Rocer <fleabyte@mail.com> for the bug report and fix.
2016-06-21 18:02:14 +02:00
Andy Wingo
0a3ea0586d Fix uri-decode behavior for "+"
* module/web/uri.scm (uri-decode): Add #:decode-plus-to-space? keyword
  argument.
  (split-and-decode-uri-path): Don't decode plus to space.
* doc/ref/web.texi (URIs): Update documentation.
* test-suite/tests/web-uri.test ("decode"): Add tests.
* NEWS: Add entry.

Based on a patch by Brent <brent@tomski.co.za>.
2016-06-21 18:02:03 +02:00
Diogo F. S. Ramos
05b3e0608e Add reference to the lack of "non-greedy" variants
While describing special characters, remind the reader that
"non-greedy" variants are not supported.  They might not be familiar
with POSIX extended regular expression and expect it to work.

* doc/ref/api-regex.texi: Add "non-greedy" observation
2016-06-21 17:55:37 +02:00
Diogo F. S. Ramos
64fd7ccf69 Remove link to Emacs' regexp syntax
Linking to Emacs' regexps as an example of regexp syntax gives the
wrong impression that Guile supports it, which is not true.

* doc/ref/api-regex.texi: Remove link to Emacs' regexp syntax
2016-06-21 17:55:28 +02:00
Andy Wingo
a192c336a2 peval: Always visit prompt bodies in values context
* module/language/tree-il/peval.scm (peval): Always evaluate the body in
  values context, as a captured continuation could continue to a
  continuation of any arity.  However the handler, if it returns, does
  return to the prompt's continuation.  Fixes #14347.  Thanks to Jussi
  Piitulainen for the report.
* test-suite/tests/control.test ("shift and reset"): Add a test.
2016-06-20 23:05:55 +02:00
Mark H Weaver
ee3381c94d FFI: Add support for functions that set 'errno'.
Implements wishlist item <https://debbugs.gnu.org/18592>.
Requested by Frank Terbeck <ft@bewatermyfriend.org>.
Based on a proposed patch by Nala Ginrut <nalaginrut@gmail.com>.

* libguile/foreign.c (cif_to_procedure): Add 'return_errno' argument.
  Store its boolean value in the object table of the generated program.
  (scm_i_foreign_call): If the stored 'return_errno' flag is true, then
  clear 'errno' before the call, save it after the call, and return it
  as a second return value.
  (pointer_to_procedure): New static function.
  (scm_pointer_to_procedure_with_errno): New C API function, implemented
  in terms of 'pointer_to_procedure'.
  (scm_pointer_to_procedure): Reimplement in terms of
  'pointer_to_procedure', no longer bound to "pointer->procedure".  See
  below.
  (scm_i_pointer_to_procedure): New C function bound to
  "pointer->procedure" which now accepts the optional #:return-errno?
  keyword argument, implemented in terms of 'pointer_to_procedure'.
  (k_return_errno): New keyword #:return-errno?.
* libguile/foreign.h (scm_pointer_to_procedure_with_errno): Add prototype.
* doc/ref/api-foreign.texi (Dynamic FFI): Adjust documentation.
2016-06-20 15:22:27 -04:00
Mark H Weaver
b0a702d773 Do not assume that sizeof (long) == sizeof (void *) == sizeof (SCM).
This assumption does not hold on systems that use the LLP64 data model.

Partially fixes <https://debbugs.gnu.org/22406>.
Reported by Peter TB Brett <peter@peter-b.co.uk>.

* libguile/numbers.h (scm_t_inum): Move here from numbers.c, and change
  to be equivalent to 'long' (formerly 'scm_t_signed_bits').
  (SCM_MOST_POSITIVE_FIXNUM, SCM_MOST_NEGATIVE_FIXNUM): Define based on
  SCM_I_FIXNUM_BIT instead of SCM_T_SIGNED_BITS_MAX.
  (SCM_I_INUM): Adjust definitions to return a 'scm_t_inum', and avoiding
  the assumption that SCM_UNPACK returns a 'long'.
* libguile/numbers.c (scm_t_inum): Move definition to numbers.h.
  Verify that 'scm_t_inum' fits within a SCM value.
  (scm_i_inum2big): Remove preprocessor code that forced a compile error
  unless sizeof (long) == sizeof (void *).
* libguile/vm-i-scheme.c (_CX): For fixnum assembly functions, choose
  the register size based on SCM_I_FIXNUM_BIT instead of SIZEOF_VOID_P.
  (ASM_MUL, "ash", "vector-ref", "vector-set", BV_FIXABLE_INT_REF)
  (BV_INT_REF, BV_FLOAT_REF, BV_FIXABLE_INT_SET, BV_INT_SET)
  (BV_FLOAT_SET): Use 'scm_t_inum' for fixnums instead of
  'scm_t_signed_bits'.
2016-06-20 15:22:27 -04:00
Mark H Weaver
1e86dc32a4 Fix fat_mutex owner corruption and other problems in fat_mutex_unlock.
Fixes <https://debbugs.gnu.org/22152>.
Reported by Iwan Aucamp <aucampia@gmail.com>.

* libguile/threads.c (fat_mutex_unlock): Avoid repeatedly decrementing
  m->level and changing the owner of the mutex when 'block_self' returns
  EINTR.  Unblock asyncs before calling scm_syserror.  Refactor the code
  to clarify the EINTR loop, and to make it more apparent that the async
  blocks and unblocks are balanced.
2016-06-20 15:22:27 -04:00
Mark H Weaver
4b60562820 Avoid signed integer overflows in numeric conversions.
Reported by Miroslav Lichvar <mlichvar@redhat.com>
in <https://lists.gnu.org/archive/html/guile-devel/2016-02/msg00045.html>

* libguile/conv-integer.i.c: Avoid signed overflow.
* libguile/numbers.c (scm_is_signed_integer): Avoid signed overflow.
2016-06-20 15:22:27 -04:00
Mark H Weaver
ff51de66bd unget-bytevector: Allow start == length when count is not given.
* libguile/r6rs-ports.c (scm_unget_bytevector): Allow 'start' to be
  equal to the bytevector length when the 'count' optional argument is
  not passed.
2016-06-20 15:22:27 -04:00
Luribert
461b62efc9 doc: Fix typo in Web documentation.
* doc/ref/web.texi (Http Headers): Fixed typo.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2016-05-08 22:01:09 +02:00
Ludovic Courtès
16050431f2 http: Accept date strings with a leading space for hours.
Fixes <http://bugs.gnu.org/23421>.
Reported by Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>.

* module/web/http.scm (parse-rfc-822-date): Add two clauses for hours
with a leading space.
* test-suite/tests/web-http.test ("general headers"): Add two tests.
2016-05-08 21:52:33 +02:00
Ludovic Courtès
6b73c87f58 Remove unused C variables and functions.
Reported by GCC 6.1.0.

* libguile/expand.c (s_empty_combination, s_missing_body_expression)
(s_mixed_body_forms, s_bad_case_clause, s_bad_case_labels)
(s_duplicate_case_label, s_bad_exit_clause, s_splicing)
(s_bad_slot_number): Remove.
* libguile/ports.c (scm_utf8_bom, scm_utf16be_bom, scm_utf32be_bom):
Remove.
* libguile/vm.c (vm_error_stack_underflow): Remove.
2016-05-08 21:38:06 +02:00
Ludovic Courtès
ff98cbb643 Revert foreign objects.
For a long time the API failed to reach consensus among maintainers.
See <https://lists.gnu.org/archive/html/guile-devel/2015-11/msg00005.html>
and <https://lists.gnu.org/archive/html/guile-devel/2014-04/msg00069.html>.

This revert intends to break the deadlock and help further discussion to
take place with less pressure.

* libguile/foreign-object.c, libguile/foreign-object.h: Remove.
* libguile/Makefile.am (libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES)
(modinclude_HEADERS): Adjust accordingly.
* libguile/init.c (scm_i_init_guile): Remove call to
'scm_register_foreign_object'.
* libguile.h: Remove inclusion of "libguile/foreign-object.h".
* module/system/foreign-object.scm: Remove.
* module/Makefile.am (SYSTEM_SOURCES): Adjust accordingly.
* test-suite/standalone/test-foreign-object-c.c,
test-suite/standalone/test-foreign-object-scm: Remove.
* test-suite/standalone/Makefile.am (check_SCRIPTS, check_PROGRAMS)
(TESTS): Adjust accordingly.
(test_foreign_object_c_SOURCES, test_foreign_object_c_CFLAGS)
(test_foreign_object_c_LDADD): Remove.
* doc/ref/libguile-foreign-objects.texi: Remove.
* doc/ref/api-foreign-objects.texi: Remove.
* doc/ref/libguile-smobs.texi: New file.
* doc/ref/Makefile.am (guile_TEXINFOS): Adjust accordingly.
* doc/ref/api-control.texi, doc/ref/api-smobs.texi,
doc/ref/api-utility.texi, doc/ref/guile.texi,
doc/ref/libguile-concepts.texi, doc/ref/libguile-program.texi:
Revert d9a4a1cd and 6e4630e0.
2016-02-01 22:29:33 +01:00
Andy Wingo
c5dac3595f web: Be less strict when parsing entity tags.
* module/web/http.scm (parse-entity-tag): Be less strict, accepting
  unquoted strings as well.

* test-suite/tests/web-http.test ("response headers"): Add a test for
  etag parsing.
2016-02-01 21:56:16 +01:00
Mark H Weaver
5c8b3be820 Bump user-visible copyright years to 2016.
* doc/ref/guile.texi: Add 2016 to user-visible copyright notice.
* module/ice-9/command-line.scm (version-etc): Bump 'copyright-year' to
  2016.
* module/system/repl/common.scm (*version*): Add 2016 to the range of
  copyright years.
2016-01-06 16:44:39 -05:00
Mark H Weaver
b97bfa8be3 SRFI-19: Update the table of leap seconds.
* module/srfi/srfi-19.scm (leap-second-table): Update to include the
  most recent leap second.
2016-01-06 16:44:39 -05:00
Ludovic Courtès
4d08e38e0a http: Use 'read-header-line' instead of 'read-line*'.
* module/web/http.scm (read-line*): Remove.
(read-continuation-line, read-header, read-request-line): Use
'read-header-line' instead of 'read-line*'.
2016-01-06 17:16:46 +01:00
Ludovic Courtès
4c7732c59e http: Accept empty reason phrases.
Fixes <http://bugs.gnu.org/22273>.
Reported by Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>.

* module/web/http.scm (read-header-line): New procedure.
(read-response-line): Use it instead of 'read-line*'.
* test-suite/tests/web-http.test ("read-response-line"): Add test.
2016-01-06 17:16:46 +01:00
Ludovic Courtès
5df0822b7c http: Test that responses lacking CR/LF are rejected.
* test-suite/tests/web-http.test ("read-response-line")["missing
CR/LF"]: New test.
2016-01-06 17:16:46 +01:00
Mark H Weaver
5c9a8ecd01 Bump user-visible copyright years to 2015.
* module/ice-9/command-line.scm (version-etc): Bump 'copyright-year' to
  2015.

* module/system/repl/common.scm (*version*): Add 2015 to the range of
  copyright years.
2015-11-28 12:38:16 -05:00
Mark H Weaver
e94a42c7f0 Fix getsockopt/setsockopt handling of SO_SNDBUF/SO_RCVBUF options.
Reported by Park SungMin <byulparan_eng@icloud.com>
in <https://lists.gnu.org/archive/html/guile-user/2015-11/msg00026.html>.

* libguile/socket.c (scm_getsockopt, scm_setsockopt): Remove code that
  incorrectly assumed that the argument for SO_SNDBUF and SO_RCVBUF
  options was of type 'size_t'.  Both the Linux and POSIX documentation
  indicates that the argument is of type 'int', as is the case for most
  options.
2015-11-13 11:45:00 -05:00
Mark H Weaver
3e0605458a Revert "Add SRFI-25 implementation"
This reverts commit aaea5b248e.
2015-11-13 11:45:00 -05:00
Andreas Rottmann
aaea5b248e Add SRFI-25 implementation
Adds an implementation of SRFI 25 on top of Guile's native arrays. The
implementation does not introduce a disjoint type; Guile arrays and
SRFI-25 arrays can be used interchangably, though with different, partly
conflicting APIs.

* NEWS: Add preliminary, incomplete section on 2.0.12, noting the
  addition of SRFI-25.
* doc/ref/srfi-modules.texi (SRFI-25): New node.
* module/srfi/srfi-25.scm: New file.
* test-suite/tests/srfi-25.test: New file.
* module/Makefile.am:
* test-suite/Makefile.am: Add new files.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2015-11-05 21:05:57 +01:00
Ludovic Courtès
c028c64eb8 Regenerate SRFI-14 character set data.
Suggested by Mike Gran <spk121@yahoo.com>.

* libguile/srfi-14.i.c: Regenerate for Unicode 8.0.0,
  <ftp://unicode.org/Public/UNIDATA/UnicodeData.txt> with SHA256
  38b17e1118206489a7e0ab5d29d7932212d38838df7d3ec025ecb58e8798ec20.
2015-11-05 21:05:57 +01:00
Mark H Weaver
133ec4c491 string ports: Add overflow checks and other fixes.
* libguile/strports.c (st_resize_port): Check that 'new_size' fits in a
  size_t.
  (st_end_input): Improve code clarity.
  (st_seek): Check for overflow during computation of target position.
  Check for invalid 'whence' argument.  Resize the port when seeking to
  a position beyond the end of the buffer.  Check for overflow during
  computation of new buffer size when resizing the port.
2015-11-01 21:30:01 -05:00
Mark H Weaver
448eb30e3d Fix seeking on binary input ports with putback buffers.
Fixes <http://bugs.gnu.org/20302>.
Reported by David Kastrup <dak@gnu.org>.

* libguile/r6rs-ports.c (bip_end_input): New static function.
  (initialize_bytevector_input_ports): Register it.
  (bip_seek): Rewrite to handle putback buffers, based on st_seek from
  strports.c.
2015-11-01 21:29:45 -05:00
Mark H Weaver
e1788828df build: Add SCM_T_OFF_MAX and SCM_T_OFF_MIN to scmconfig.h.
* libguile/gen-scmconfig.c (main): Add SCM_T_OFF_MAX and SCM_T_OFF_MIN
  to the generated 'scmconfig.h' file.
2015-11-01 21:29:32 -05:00
Ludovic Courtès
f57aba7ab7 doc: Mention a known-good Flex version number.
Suggested by Jamil Egdemir <unclejamil@gmail.com>.

* HACKING: Mention a Flex version number.
2015-10-30 17:15:24 +01:00
Ludovic Courtès
ac2ceddbfa Thank David and Kouhei. 2015-10-29 23:59:02 +01:00
Ludovic Courtès
efd8a438b3 build: Remove libguile/mkstemp.c, redundant with Gnulib.
Fixes <http://bugs.gnu.org/21425>.
Reported by Kouhei Sutou <kou@cozmixng.org>.

* configure.ac: Remove 'AC_REPLACE_FUNCS' for 'mkstemp'.
* libguile/Makefile.am (EXTRA_libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES):
  Remove mkstemp.c.
* libguile/mkstemp.c: Remove.
2015-10-29 23:55:05 +01:00
David Michael
c3f95ec2c2 Remove SIGEV constant definitions.
* libguile/Makefile.am (chknew-E chknew-SIG): Anchor the end of the
  signal/error name pattern to only match alphanumeric symbols.
* libguile/cpp-SIG.syms (SIGEV_MAX_SIZE, SIGEV_NONE): Remove.
  (SIGEV_PAD_SIZE, SIGEV_SIGNAL, SIGEV_THREAD): Likewise.
  (SIGEV_THREAD_ID): Likewise.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2015-10-29 23:39:55 +01:00
David Michael
1be3063bf6 Add Hurd signal and error constants.
* libguile/cpp-E.syms (EAUTH, EBACKGROUND): New definitions.
  (EBADRPC, ED, EDIED, EFTYPE, EGRATUITOUS, EGREGIOUS): Likewise.
  (EIEIO, ENEEDAUTH, EPROCLIM, EPROCUNAVAIL): Likewise.
  (EPROGMISMATCH, EPROGUNAVAIL, ERPCMISMATCH): Likewise.
* libguile/cpp-SIG.syms (SIGEMT, SIGEV_MAX_SIZE): Likewise.
  (SIGEV_PAD_SIZE, SIGINFO, SIGLOST): Likewise.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2015-10-29 23:39:38 +01:00
David Michael
ead362f8d1 Add new Linux errno constants.
* libguile/cpp-E.syms (EHWPOISON, ERFKILL): New definitions.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2015-10-29 23:39:18 +01:00
David Michael
9a4215b8c2 Fix the rule to check for new signals and errors
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>
2015-10-29 23:37:39 +01:00
Ludovic Courtès
67a5377fd8 i18n: Add new collation test for posterity.
* test-suite/tests/i18n.test ("text collation (Czech)"): New test
  prefix.
2015-10-29 23:17:51 +01:00
Ludovic Courtès
53b8d5f335 web: Gracefully handle premature EOF when reading chunk header.
* module/web/http.scm (read-chunk-header): Return 0 when 'read-line'
  returns EOF.
2015-09-26 11:07:05 +02:00
Mark H Weaver
4fd7ad6f85 docs: Fix external representation of <toplevel-define> in tree-il.
* doc/ref/compiler.texi (Tree-IL): Provide the correct external
  representation of <toplevel-define>.
2015-09-17 22:32:10 -04:00
Ludovic Courtès
5a10e416e3 web: Fix 'close' method of delimited input ports.
* 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.
2015-09-10 22:30:52 +02:00
Ludovic Courtès
d85d6d14a2 Thank Ricardo. 2015-09-04 22:55:52 +02:00
Ludovic Courtès
66305829ce doc: Fix menu order for SXML.
* doc/ref/sxml.texi (SXML): Add missing quotes in example.
  Fix node order in menu.
2015-09-04 22:55:52 +02:00
Ricardo Wurmus
fbe95dc6e6 doc: Add SXPath documentation from sources
Fixes <http://bugs.gnu.org/19478>.

* doc/ref/sxml.texi (SXPath): Add procedure documentation from sources.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2015-09-04 22:55:52 +02:00
Mark H Weaver
3bda6eb9df psyntax: Fix bug in match-each+.
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.
2015-09-03 02:51:00 -04:00