1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 11:50:28 +02:00
Commit graph

1701 commits

Author SHA1 Message Date
Arne Babenhauserheide
8a5e40655b doc: Describe -e (module) on equal footing with (@ ...).
* doc/ref/guile-invoke.texi, doc/ref/scheme-scripts.texi:
describe the -e (module) shorthand as on equal footing with (@ ...)

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2017-02-13 22:02:32 +01:00
Ludovic Courtès
4b2b867c21 i18n: 'number->locale-string' guesses the minimum number of decimals.
This feature was removed by 4aead68cdb.

* module/ice-9/i18n.scm (number-decimal-string): Rewrite the case where
DIGIT-COUNT is not an integer.
(number->locale-string): Always pass FRACTION-DIGITS to
'number-decimal-string'.
* test-suite/tests/format.test ("~h localized number")["1234.5"]
["padding", "padchar"]: Remove decimal specifier.
* test-suite/tests/i18n.test ("number->locale-string")
["fraction",
* test-suite/tests/i18n.test ("format ~h")["12 345,678"]: Remove decimal
specifier.  Remove one decimal.
* doc/ref/api-i18n.texi (Number Input and Output): Update
'number->locale-string' doc to mention the number of decimals.
2017-02-13 21:34:57 +01:00
Georgi Kirilov
00b57d0ee8 doc: Fix typo in site packages documentation.
* doc/ref/scheme-using.texi (Installing Site Packages): Fix typo

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-02-12 22:06:54 +01:00
Georgi Kirilov
f637d93f40 doc: Fix typo in keywords documentation.
* doc/ref/api-data.texi (Keyword Read Syntax): Fix typo

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-02-12 22:06:45 +01:00
Mark H Weaver
08c021916d REPL Server: Guard against HTTP inter-protocol exploitation attacks.
Reported by Christopher Allan Webber <cwebber@dustycloud.org>
Co-authored-by: Ludovic Courtès <ludo@gnu.org>

This commit adds protection to Guile's REPL servers against HTTP
inter-protocol exploitation attacks, a scenario whereby an attacker can,
via an HTML page, cause a web browser to send data to TCP servers
listening on a loopback interface or private network.  See
<https://en.wikipedia.org/wiki/Inter-protocol_exploitation> and
<https://www.jochentopf.com/hfpa/hfpa.pdf>, The HTML Form Protocol
Attack (2001) by Tochen Topf <jochen@remote.org>.

Here we add a procedure to 'before-read-hook' that looks for a possible
HTTP request-line in the first line of input from the client socket.  If
present, the socket is drained and closed, and a loud warning is written
to stderr (POSIX file descriptor 2).

* module/system/repl/server.scm: Add 'maybe-check-for-http-request'
to 'before-read-hook' when this module is loaded.
(with-temporary-port-encoding, with-saved-port-line+column)
(drain-input-and-close, permissive-http-request-line?)
(check-for-http-request, guard-against-http-request)
(maybe-check-for-http-request): New procedures.
(serve-client): Use 'guard-against-http-request'.
* module/system/repl/coop-server.scm (start-repl-client): Use
'guard-against-http-request'.
* doc/ref/guile-invoke.texi (Command-line Options): In the description
of the --listen option, make the security warning more prominent.
Mention the new protection added here.  Recommend using UNIX domain
sockets for REPL servers.  "a path to" => "the file name of".
2016-10-11 11:29:09 +02:00
Ludovic Courtès
79bac3bf31 Add 'scm_to_uintptr_t' and 'scm_from_uintptr_t'.
* libguile/numbers.h (scm_to_uintptr_t, scm_from_uintptr_t): New
macros.
* doc/ref/api-data.texi (Integers): Document them.
* NEWS: Mention it.
2016-10-11 10:57:18 +02:00
Ludovic Courtès
2456089116 Remove 'umask' calls from 'mkdir'.
Fixes <http://bugs.gnu.org/24659>.

* libguile/filesys.c (SCM_DEFINE): Remove calls to 'umask' when MODE is
unbound; instead, use 0777 as the mode.  Update docstring to clarify
this.
* doc/ref/posix.texi (File System): Adjust accordingly.
* NEWS: Mention it.
2016-10-11 10:23:57 +02:00
sirgazil
c5f00813e9 Fix typo about variable definitions
* doc/ref/api-binding.texi (Top Level Variable Definitions): Fix typo.
2016-08-08 22:20:51 +02:00
Ethan Stefan Day
6a22d42fbc Documentation fixes
* doc/ref/api-compound.texi:
* doc/ref/api-control.texi:
* doc/ref/api-data.texi: Fix typos and clarify.
2016-08-08 22:20:51 +02:00
Calvin Heim
85f1894dfa Fix grammar in api-compound.texi
* doc/ref/api-compound.texi: Fix grammar.
2016-08-07 13:31:50 +02:00
sirgazil
aca6a8a46e Fix typo about pattern variables
* doc/ref/sxml-match.texi (Matching XML Elements): Fix typo.
2016-08-07 13:31:43 +02:00
Andy Wingo
355986773d Manual recommends against SRFI-10
* doc/ref/srfi-modules.texi (SRFI-10): Deprecate, or at least recommend
  against.
2016-08-07 13:31:37 +02:00
Ludovic Courtès
141e390b59 doc: Add unquote and unquote-splicing examples.
Suggested by Vincent Legoll <vincent.legoll@gmail.com>.

* doc/ref/api-evaluation.texi (Expression Syntax): Add an unquote and an
unquote-splicing example.
2016-07-22 16:40:01 +02:00
Andy Wingo
0cf62c576d Allow mkstemp! to have optional "mode" argument
* m4/mkstemp.m4: Remove.
* lib/mkstemp.c: Remove.
* lib/mkostemp.c: New file.
* m4/mkostemp.m4: New file.
* lib/Makefile.am:
* m4/gnulib-cache.m4:
* m4/gnulib-comp.m4: Remove mkstemp module, replace with mkostemp.

* libguile/fports.h:
* libguile/fports.c (scm_i_mode_to_open_flags): Factor out helper to
  parse mode string to open flags.
  (scm_open_file_with_encoding): Use the new helper.
* libguile/filesys.c:
  (scm_i_mkstemp): Adapt to take optional second argument, being a mode
  string.  Use mkostemp.
  (scm_mkstemp): Backwards compatible shim that calls scm_i_mkstemp.

* doc/ref/posix.texi:
* NEWS: Update.

* module/system/base/compile.scm (call-with-output-file/atomic): Pass
  "wb" as mode, to cause O_BINARY to be added on MinGW.
2016-07-16 15:37:55 +02:00
Ricardo Wurmus
2d6e224003 doc: Do not gender the programmer.
* doc/ref/api-foreign.texi: Replace "his" with "their".
* doc/ref/sxml.texi: Likewise.
2016-07-16 10:59:54 +02:00
Andy Wingo
e8c93013e3 Add popen feature
* doc/ref/api-options.texi (Common Feature Symbols): Document the popen
  feature.
* doc/ref/posix.texi (Pipes): Depend on the popen feature, not fork.
* libguile/posix.c (scm_init_posix): Add popen feature if we can.
2016-07-14 16:33:32 +02:00
Andy Wingo
5b7b5749e1 Add meta/build-env
* meta/build-env.in: New file which sets up an environment that does not
  inherit GUILE_LOAD_PATH / GUILE_LOAD_COMPILED_PATH (unless
  cross-compiling).
* doc/ref/Makefile.am (autoconf-macros.texi):
* libguile/Makefile.am (snarf2checkedtexi):
* module/Makefile.am (ice-9/psyntax-pp.go):
* test-suite/standalone/Makefile.am (GUILE_INSTALL_LOCALE):
* am/guilec (.scm.go): Use build-env.
* configure.ac: Create build-env.
2016-07-10 13:21:38 +02:00
Ludovic Courtès
8f644ef87a doc: smobs: Fix typos.
* doc/ref/api-smobs.texi (Smobs): Fix typos.
2016-06-28 22:51:57 +02:00
Andy Wingo
811024669a Add documentation pointer from getopt-long to SRFI-37.
* doc/ref/mod-getopt-long.texi (getopt-long): Point to SRFI-37.
2016-06-26 22:38:00 +02:00
Andy Wingo
da0f1eadaa Favor "escape continuation" over "one-shot continuation" in manual
* doc/ref/api-control.texi (Prompt Primitives): Remove mention of
  one-shot continuations, as it's possible to invoke them multiple times
  if the continuation is re-entered through other means.
2016-06-26 22:38:00 +02:00
Andy Wingo
8707958e6c Fix typo about `keywords' read option
* doc/ref/api-data.texi (Keyword Read Syntax): Fix typo.  Thanks to
  Glenn Michaels for the report and fix.
2016-06-26 22:27:54 +02:00
Andy Wingo
9591da310e Clarify use of the term "scanning" in the manual
* doc/ref/api-memory.texi (Garbage Collection Functions):
* doc/ref/libguile-concepts.texi (Garbage Collection): Attempt to be
  clear that scanning is a thing that happens in the mark phase.  Fixes
  #20907 I think.
2016-06-26 22:27:18 +02:00
Andy Wingo
387010196f Fix R6RS fold-left documentation
* doc/ref/r6rs.texi (rnrs lists): Fix documentation of fold-left.
2016-06-26 22:26:59 +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
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
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
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
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
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
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
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
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
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
Taylan Ulrich Bayırlı/Kammer
5d66fd3fcf Clarify datum->syntax documentation.
* doc/ref/api-macros.texi (Syntax Case): Make it clear that the first
  argument to datum->syntax must be an identifier.
2015-09-02 14:08:46 -04:00
Mark H Weaver
4c5788d1ab Fix uses of 'scm_gc_protect', which does not exist, in the manual.
* doc/ref/api-memory.texi (Garbage Collection Functions),
  doc/ref/libguile-concepts.texi (Garbage Collection): Change
  'scm_gc_protect' --> 'scm_gc_protect_object'.
2015-09-02 13:55:16 -04:00
Mathieu Lirzin
0854b87493 doc: Fix parameter of 'set-record-type-printer!'.
* doc/ref/api-compound.texi (SRFI-9 Records)[set-record-type-printer!]:
  Fix parameter name.
2015-06-19 16:11:13 -04:00
Alex Kost
f285b2115f Fix typo in manual.
* doc/ref/api-modules.texi (Using Guile Modules): Remove extra "yet".
2015-06-19 15:43:58 -04:00
Ludovic Courtès
d680713327 doc: Update libgc URL.
* doc/ref/data-rep.texi (Conservative GC): Update libgc URL.
2015-04-03 16:35:54 +02:00
Mark H Weaver
9f0ec10fc9 Implement 'string-utf8-length' and 'scm_c_string_utf8_length'.
* libguile/strings.c (utf8_length, scm_c_string_utf8_length)
  (scm_string_utf8_length): New functions.
* libguile/strings.h (scm_c_string_utf8_length, scm_string_utf8_length):
  New prototypes.
* doc/ref/api-data.texi (Bytevectors as Strings): Add docs.
* doc/ref/guile.texi: Update manual copyright date to 2015.
* test-suite/tests/strings.test (string-utf8-length): Add tests.
2015-03-01 22:04:07 -05:00
Ludovic Courtès
cdcba5b2f6 statprof: 'statprof' and 'with-statprof' return the code's return values.
* module/statprof.scm (statprof): Return the return values of THUNK.
  (with-statprof): Adjust docstring accordingly.
* test-suite/tests/statprof.test ("return values"): New test.
* doc/ref/statprof.texi (Statprof): Adjust accordingly.
2015-01-11 20:44:44 +01:00
Ludovic Courtès
680135b6a3 doc: Clarify the unit of the 'offset' argument of 'seek'.
Reported in <http://bugs.gnu.org/18520>
by David Kastrup <dak@gnu.org>.

* doc/ref/api-io.texi (Random Access): Clarify the unit of the 'offset'
  argument to 'seek'.
2014-12-03 19:07:28 +01:00
Ludovic Courtès
5fac1a7ada Add the 'guild' and 'guile' variables to 'guile-2.0.pc'.
* configure.ac: Remove meta/guile-2.0.pc and
  meta/guile-2.0-uninstalled.pc from 'AC_CONFIG_FILES'.
* meta/Makefile.am (substitute): New variable.
  (guile-2.0.pc, guile-2.0-uninstalled.pc): New targets.
  (guile-config, guild): Use $(substitute) instead of duplicated sed
  script.
  (CLEANFILES): Add the .pc files.
* meta/guile-2.0.pc.in (bindir, guild, guile): New variables.
* doc/ref/libguile-parallel.texi (Parallel Installations): Document the
  'guild' and 'guile' pkg-config variables.
2014-12-03 18:59:36 +01:00
Ludovic Courtès
7e466e0265 doc: Tell when 'GUILE_INSTALL_LOCALE' first appeared.
* doc/ref/guile-invoke.texi (Environment Variables): Add footnote about
  the Guile version where 'GUILE_INSTALL_LOCALE' appeared.
2014-12-02 21:25:56 +01:00
Chris Jester-Young
cffa9bd6a3 Implement SRFI 28: Basic Format Strings.
* module/srfi/srfi-28.scm: New module.
* module/Makefile.am (SRFI_SOURCES): Add srfi/srfi-28.scm.
* doc/ref/srfi-modules.texi (SRFI-28): New node.
2014-12-02 11:49:05 -05:00
Ludovic Courtès
d1447c717b doc: Clarify behavior of 'select' in the presence of signal interruptions.
Fixes <http://bugs.gnu.org/18988>.
Reported by Chris Vine <chris@cvine.freeserve.co.uk>.

* libguile/filesys.c (scm_select): Clarify handling of signal
  interruptions.
* doc/ref/posix.texi (Ports and File Descriptors): Adjust accordingly.
2014-11-20 21:32:44 +01:00
Mark H Weaver
5af307de43 read: Accept "\(" in string literals.
Suggested by David Kastrup <dak@gnu.org> in <http://bugs.gnu.org/13644>.

* libguile/read.c (scm_read_string_like_syntax): Accept "\(" as
  equivalent to "(".
* doc/ref/api-data.texi (String Syntax): Document it.
* test-suite/tests/reader.test ("reading"): Add test.
2014-10-01 21:00:23 -04:00