1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-03 13:20:26 +02:00
Commit graph

18442 commits

Author SHA1 Message Date
Andy Wingo
2fa2e50a0f Add file descriptor finalizers
* doc/ref/posix.texi (Ports and File Descriptors): Document new
  interfaces.
* libguile/filesys.c (scm_close, scm_close_fdes)
* libguile/fports.c (fport_close):
* libguile/ioext.c (scm_primitive_move_to_fdes): Call
  scm_run_fdes_finalizers.
* module/ice-9/fdes-finalizers.scm:
* test-suite/tests/fdes-finalizers.test:
* libguile/fdes-finalizers.h:
* libguile/fdes-finalizers.c: New files.
* module/Makefile.am:
* test-suite/Makefile.am:
* libguile/Makefile.am:
* libguile.h:
* libguile/init.c: Wire up new files.
2016-08-30 23:35:10 +02:00
Andy Wingo
4256e0655f Remove duplicate documentation
* doc/ref/posix.texi (Ports and File Descriptors): Remove duplicate
  documentation for port-mode and setvbuf.
2016-08-28 22:13:59 +02:00
Andy Wingo
ebb8cb7206 Remove SCM_I_MAX_PORT_TYPE_COUNT
* libguile/ports.h (SCM_I_MAX_PORT_TYPE_COUNT): Remove unused CPP
  definition.
2016-08-28 14:46:32 +02:00
Andy Wingo
342bd8dfb3 ETag list headers accept sloppy etags
* module/web/http.scm (parse-entity-tag): Add #:sloppy-delimiters
  keyword argument, and return a second value indicating the end
  position.
  (parse-entity-tag-list): Use parse-entity-tag, so that we also accept
  sloppy etags that aren't qstrings.
* test-suite/tests/web-http.test ("request headers"): Add a test.
2016-08-28 13:48:42 +02:00
Andy Wingo
57aff02646 Add prebuilt alias for x86_64-pc-linux-gnu
* prebuilt/x86_64-pc-linux-gnu: Add as alias to
  x86_64-unknown-linux-gnu.
2016-08-28 11:37:19 +02:00
Andy Wingo
af360e5ce5 Tweak to conversion strategy access
* libguile/strings.c (scm_from_port_stringn, scm_to_port_stringn):
  Access the conversion_strategy directly to make sure these functions
  can run while the port is flushing on close.  Fixes web-http.test to
  allow the closed flag to be atomically cleared on a port before
  flushing.
2016-08-25 16:16:39 +02:00
Andy Wingo
aa86ae6bf9 Fix exception when running ",help debug"
* module/system/repl/command.scm (*command-table*): Remove entry for
  ",procedure", a command removed a few months ago.
2016-08-25 16:08:50 +02:00
sirgazil
8f2f8db10b Fix typo about open-pipe
* doc/ref/posix.texi (Pipes): Fix typo.
2016-08-08 22:21:59 +02:00
James Clarke
b434ea36d3 Recognize alpha as compilation target
* module/system/base/target.scm (cpu-endianness): Add case for "alpha".
(triplet-pointer-size): Likewise.
2016-08-08 22:20:10 +02:00
sirgazil
24502780eb Fix typo about variable definitions
* doc/ref/api-binding.texi (Top Level Variable Definitions): Fix typo.
2016-08-08 00:06:32 +02:00
Ethan Stefan Day
96d3cb3fcf Documentation fixes
* doc/ref/api-compound.texi:
* doc/ref/api-control.texi:
* doc/ref/api-data.texi: Fix typos and clarify.
2016-08-07 23:40:16 +02:00
David Kastrup
469970d4b3 Let assv/assoc shortcircuit to assq where feasible
* libguile/alist.c (scm_sloppy_assv, scm_sloppy_assoc):
  (scm_assv, scm_assoc): Shortcircuit to scm_assq where feasible.
2016-08-07 22:52:20 +02:00
Marek Vasut
8ad67667f3 Recognize nios2 as compilation target
Add support for the nios2 architecture.

Signed-off-by: Marek Vasut <marex@denx.de>
2016-08-07 13:30:30 +02:00
Andy Wingo
bcc40bc1c7 Capture full path to GUILE_FOR_BUILD.
* acinclude.m4: Capture full path to GUILE_FOR_BUILD.  Fixes #22342.
2016-08-07 13:26:18 +02:00
Calvin Heim
978229a52a Fix grammar in api-compound.texi
* doc/ref/api-compound.texi: Fix grammar.
2016-08-07 12:58:34 +02:00
sirgazil
0f1b5674c4 Fix typo about pattern variables
* doc/ref/sxml-match.texi (Matching XML Elements): Fix typo.
2016-08-07 11:57:35 +02:00
Andy Wingo
e68dd5c601 Manual recommends against SRFI-10
* doc/ref/srfi-modules.texi (SRFI-10): Deprecate, or at least recommend
  against.
2016-08-07 11:55:01 +02:00
Andy Wingo
1a1c3bbe59 Implement R6RS custom binary input/output ports
* NEWS: Add new feature.
* doc/ref/r6rs.texi (rnrs io ports):
* doc/ref/api-io.texi (Custom Ports): Document new procedure.
* libguile/r6rs-ports.h:
* libguile/r6rs-ports.c (make_custom_binary_input_output_port)
  (scm_make_custom_binary_input_output_port)
  (custom_binary_input_output_port_random_access_p)
  (initialize_custom_binary_input_output_ports)
  (scm_init_r6rs_ports): Implement custom binary input/output ports.
* module/rnrs/io/ports.scm (rnrs):
* module/ice-9/binary-ports.scm (ice-9): Export
  make-custom-binary-input/output-port.
2016-08-04 22:29:51 +02:00
Andy Wingo
8da33d972a Fix compilation of continue' in while'.
* module/language/cps/rotate-loops.scm (rotate-loops-in-function): Don't
  attempt to rotate a loop whose header is a $prompt.  Fixes use of
  `continue' in `while'.  Thanks to Nala Ginrut for the report :)
2016-08-04 21:36:34 +02:00
Eli Zaretskii
d2684fe898 Avoid compilation warnings about alloca in read.c
* libguile/read.c: Include alloca.h.
2016-07-25 11:51:40 +02:00
Andy Wingo
401214313b Fix --without-threads against threaded BDW-GC
* libguile/gc.c (scm_storage_prehistory): Prevent BDW-GC from spawning
  marker threads if Guile was built without threading support.
2016-07-25 11:51:30 +02:00
Andy Wingo
ca2d00ad65 Reimplement null-threads as inline functions
* libguile/null-threads.h: Reimplement null-threads stubs for pthread
  data types, initializers, and functions in terms of types and inline
  functions instead of CPP macros.  Fixes unused-value warnings, and
  tightens things up in general.
  (scm_i_pthread_cleanup_push, scm_i_pthread_cleanup_pop): Remove these,
  as they were unused and incorrect -- they would never run the cleanup
  handler even if 1 was passed to pop.
2016-07-25 11:50:17 +02:00
Andy Wingo
315acd5ee0 Use non-deprecated HAVE_STRUCT_TM_TM_ZONE
* libguile/stime.c: Change uses of the deprecated HAVE_TM_ZONE to the
  new HAVE_STRUCT_TM_TM_ZONE.
2016-07-25 11:50:05 +02:00
Andy Wingo
1f14900a07 Use gnulib for basename / dirname
* libguile/filesys.c (scm_dirname, scm_basename): Rewrite to use
  gnulib's dirname-lgpl.
2016-07-25 11:49:55 +02:00
Andy Wingo
8868c850e6 Gnulib: Add dirname-lgpl.
* lib/Makefile.am:
* m4/gnulib-cache.m4:
* m4/gnulib-comp.m4: Add dirname-lgpl.
2016-07-25 11:49:46 +02:00
Ludovic Courtès
ad7e806a9f 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-25 11:49:40 +02:00
Eli Zaretskii
0cf155be72 Untabify posix-w32.c 2016-07-25 11:49:32 +02:00
Eli Zaretskii
62843d5475 Improve process handling on MS-Windows
* libguile/posix-w32.c: Include gc.h and threads.h.
(proc_record): New structure tag.
<procs, proc_size>: New static variables.
(find_proc, proc_handle, record_proc, delete_proc): New utility
functions.
(start_child): Return value is now pid_t, as it is on Posix
platforms.  Record the new process and returns its PID, instead of
returning a handle.  Fix the recursive call.
(waitpid, kill, getpriority, setpriority, sched_getaffinity)
(sched_setaffinity): Look up the PID in the recorded subprocesses
before trying to open a process that is not our subprocess.  Make
sure any open handle is closed before returning, unless it's our
subprocess.
2016-07-25 11:49:27 +02:00
Andy Wingo
aae3561584 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-25 11:46:18 +02:00
Ricardo Wurmus
e868fae658 doc: Do not gender the programmer.
* doc/ref/api-foreign.texi: Replace "his" with "their".
* doc/ref/sxml.texi: Likewise.
2016-07-25 11:44:52 +02:00
Eli Zaretskii
d87915f25d Update uname implementation in posix-w32
* libguile/posix-w32.c (uname): Update to modern processors (ia64 and
  x86_64) and OS versions (Vista to Windows 10).  Delete trailing
  whitespace.
2016-07-25 11:44:45 +02:00
Andy Wingo
da0ee4dc80 Fix unused static variables in net_db.c
* libguile/net_db.c (SCM_DEFINE_CONSTANT): New helper.  Use it to
  define constants and avoid the unneeded static variables that were
  used before, named "sym_" but actually holding variables.  Thanks to
  Eli Zaretskii for the report.
2016-07-25 11:44:29 +02:00
Andy Wingo
a58bfb4ada Fix MinGW build error
* configure.ac: Fix for recent rename of win32-uname.c to posix-w32.c.
2016-07-25 11:44:22 +02:00
Andy Wingo
ea223b07c2 Update NEWS
* NEWS: Update.
2016-07-25 11:44:14 +02:00
Andy Wingo
513344e33d 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-25 11:43:54 +02:00
Eli Zaretskii
3231d7658d Add POSIX shims for MinGW
* libguile/posix-w32.h:
* libguile/posix-w32.c (kill, waitpid, getpriority, setpriority)
  (sched_getaffinity, sched_setaffinity): Add MinGW implementations.
  Also, provides macros that on Posix hosts are in sys/wait.h, like
  WIFEXITED and WTERMSIG.
  (start_child): Add implementation.
2016-07-25 11:42:09 +02:00
Andy Wingo
b2d77c38c4 Rename win32-uname.[ch] to posix-w32.[ch]
* libguile/posix-w32.c:
* libguile/posix-w32.h: Rename from win32-uname.c and win32-uname.h.
* libguile/posix.c:
* libguile/Makefile.am
  (EXTRA_libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES)
  (noinst_HEADERS): Adapt.
2016-07-25 11:41:50 +02:00
Andy Wingo
d32f37e56c Ignore meta/build-env
* .gitignore: Ignore meta/build-env.
2016-07-25 11:35:58 +02:00
Andy Wingo
10ae9cc601 Factor start_child out of open_process
* libguile/posix.c (start_child): Factor out from open_process.  Based
  on initial work by Eli Zaretskii.
2016-07-25 11:24:55 +02:00
Andy Wingo
f632d45c69 More specific status:exit-val et al compilation guards
* libguile/posix.c (scm_status_exit_val, scm_status_term_sig)
  (scm_status_stop_sig): Guard on WIFEXITED et al macros instead of on
  MinGW.
2016-07-25 11:24:49 +02:00
Andy Wingo
9222e05ef1 getaffinity, setaffinity docstring cleanup
* libguile/posix.c (scm_getaffinity, scm_setaffinity): Clean up
  docstrings.  Obviously if you have the function, you don't need to be
  told that you have it in the docstring.
2016-07-25 11:24:41 +02:00
Andy Wingo
a1cb59c47e Provide `kill' only if supported by the host
* libguile/posix.c (scm_kill): Only provide if the host has `kill'.  An
  incompatible change on MinGW, where this function would work only if
  the PID was the current PID, but that will be fixed by the next
  process.
2016-07-25 11:24:33 +02:00
Andy Wingo
a9e726eda7 More robust setuid, setgid, etc detection
* configure.ac: Check for getuid, getgid, setuid, and setgid.
* libguile/posix.c (scm_getuid, scm_getgid, scm_setuid, scm_setgid):
  Only provide Scheme functions if the OS provides these facilities.
  (scm_geteuid, scm_getegid, scm_seteuid, scm_setegid): Provide if the
  host has getuid, getgid, etc, instead of being in a MinGW guard.
2016-07-25 11:24:26 +02:00
Ludovic Courtès
b505ad9ad3 Add missing 'const' qualifier.
* libguile/stime.c (tzvar): Add 'const'.
2016-07-25 11:22:52 +02:00
Ludovic Courtès
abb0b54be8 Unconditionally include <time.h> from Gnulib.
* libguile/stime.c: Unconditionally include <time.h>.
2016-07-25 11:22:45 +02:00
Ludovic Courtès
147ba05dee build: Remove unneeded check for 'unsetenv'.
* configure.ac: Remove check for 'unsetenv', which is unneeded since we
use Gnulib's 'unsetenv'.
2016-07-25 11:22:38 +02:00
Andy Wingo
867316ffcd build-env: prebuilt .go files are in srcdir
* meta/build-env.in (GUILE_LOAD_COMPILED_PATH): Look for prebuilt files
  in the srcdir, not the builddir.
2016-07-11 09:26:25 +02:00
Andy Wingo
38f23e75a5 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/bootstrap.am (.scm.go):
* am/guilec (.scm.go): Use build-env.
* configure.ac: Create build-env.
2016-07-10 14:10:26 +02:00
Andy Wingo
b05b67b2b3 Avoid Gnulib unistr/* modules
(unistr/base, unistr/u8-mbtouc, unistr/u8-mbtouc-unsafe)
(unistr/u8-mbtoucr, unistr/u8-prev unistr/u8-uctomb, unitypes): --avoid
these modules.
2016-07-10 12:44:35 +02:00
Andy Wingo
d484bfbace Update Gnulib to 68b6ade.
Also add --conditional-dependencies to the flags.  See:
https://lists.gnu.org/archive/html/guile-devel/2016-07/msg00012.html
2016-07-07 14:05:53 +02:00