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

1871 commits

Author SHA1 Message Date
Daniel Llorens
3320eaa788 Remove uniform-array-read!, uniform-array-write from the manual
These procedures where removed in
fc7bd367ab (2011-05-12).

* doc/ref/api-compound.texi: Ditto.
2016-07-11 09:11:50 +02:00
Daniel Llorens
f6003e8881 Clean up (array-for-each-cell)
* libguile/array-map.c (array-for-each-cell,
  array-for-each-cell-in-order): Moved from libguile/arrays.c. Fix
  argument names. Complete docstring.

* libguile/array-map.h (array-for-each-cell,
  array-for-each-cell-in-order): Declarations moved from
  libguile/arrays.h.

* test-suite/tests/array-map.test: Renamed from
  test-suite/tests/ramap.test, fix module name.

  Add tests for (array-for-each-cell).

* test-suite/Makefile.am: Apply rename array-map.test -> ramap.test.

* doc/ref/api-compound.texi: Minor documentation fixes.
2016-07-11 09:11:50 +02:00
Daniel Llorens
a8dd99d0de Draft documentation for (array-for-each-cell)
* doc/ref/api-compound.texi: New section 'Arrays as arrays of
  arrays'. Move the documentation for (array-from), (array-from*) and
  (array-amend!) in here. Add documentation for (array-for-each-cell).
2016-07-11 09:11:50 +02:00
Daniel Llorens
3aafc2c857 Rename array-set-from!, scm_array_set_from_x to array-amend!, scm_array_amend_x 2016-07-11 09:11:50 +02:00
Daniel Llorens
ecb38d4268 Tests & doc for array-from, array-from*, array-set-from!
* test-suite/tests/arrays.test: tests for array-from, array-from*,
  array-set-from!

* doc/ref/api-compound.texi: document array-from, array-from*,
  array-set-from!.
2016-07-11 09:11:50 +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
73714b87aa Add documentation pointer from getopt-long to SRFI-37.
* doc/ref/mod-getopt-long.texi (getopt-long): Point to SRFI-37.
2016-06-25 10:06:15 +02:00
Andy Wingo
5f9134c32d 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-24 18:18:46 +02:00
Andy Wingo
cab7167849 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-24 09:55:28 +02:00
Andy Wingo
20718dd94b Add with-input-from-port, etc documentation
* doc/ref/api-io.texi (Default Ports): Add documentation for
  with-input-from-port, with-output-to-port, and with-error-to-port.
  Fixes #20919.
2016-06-24 09:05:05 +02:00
Andy Wingo
f84006c564 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-24 08:56:21 +02:00
Andy Wingo
8a072fc2d6 Add weak hash table documentation
* doc/ref/api-memory.texi (Weak hash tables): Update documentation.
  Fixes #20551.
2016-06-23 22:37:23 +02:00
Andy Wingo
498cd58cb4 Fix R6RS fold-left documentation
* doc/ref/r6rs.texi (rnrs lists): Fix documentation of fold-left.
2016-06-23 21:39:23 +02:00
Andy Wingo
f1c0434403 `define!' instruction returns the variable
* doc/ref/vm.texi (Top-Level Environment Instructions): Update
  documentation.
* libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION): Bump, sadly.
* module/system/vm/assembler.scm (*bytecode-minor-version*): Bump.
* libguile/vm-engine.c (define!): Change to store variable in dst slot.
* module/language/tree-il/compile-cps.scm (convert):
* module/language/cps/compile-bytecode.scm (compile-function): Adapt to
  define! change.
* module/language/cps/effects-analysis.scm (current-module): Fix define!
  effects.  Incidentally here was the bug: in Guile 2.2 you can't have
  effects on different object kinds in one instruction, without
  reverting to &unknown-memory-kinds.
* test-suite/tests/compiler.test ("regression tests"): Add a test.
2016-06-21 22:40:31 +02:00
Andy Wingo
7e88ca6f8a Document pretty-print #:max-expr-width
* doc/ref/misc-modules.texi (Pretty Printing): Document #:max-expr-width
  keyword argument.  Fixes #17657.
2016-06-21 16:45:37 +02:00
Andy Wingo
e877e1bccb Document sigaction + SA_RESTART
* doc/ref/posix.texi (Signals): Document interaction between Guile's
  signal handling and SA_RESTART.  Fixes #14640.
2016-06-21 08:35:59 +02:00
Andy Wingo
5b6eaa91d2 Document char-ready? limitations.
* doc/ref/api-io.texi (Venerable Port Interfaces): Document limitations
  of char-ready?.  See http://debbugs.gnu.org/10627.
2016-06-20 21:21:20 +02:00
Andy Wingo
687d393e2c 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-20 14:48:15 +02:00
Diogo F. S. Ramos
4cf81b7ba0 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-19 17:39:41 +02:00
Diogo F. S. Ramos
ff040ee033 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-19 17:38:49 +02:00
Andy Wingo
69ea1fc45b Support `connect' on nonblocking sockets
* libguile/socket.c (scm_connect):
* doc/ref/posix.texi (Network Sockets and Communication): Support
  connect on nonblocking ports.
2016-06-09 10:59:08 +02:00
Andy Wingo
e6cc051f8c `accept' on nonblocking socket can return #f
* doc/ref/posix.texi (Network Sockets and Communication):
* libguile/socket.c (scm_accept): Return #f if the socket is nonblocking
  and no connection is ready.
2016-06-09 10:59:08 +02:00
Andy Wingo
c7c11f3af9 Update port documentation, rename sports to suspendable ports
* module/ice-9/suspendable-ports.scm: Rename from ice-9/sports.scm, and
  adapt module names.  Remove exports that are not related to the
  suspendable ports facility; we want people to continue using the port
  operations from their original locations.  Add put-string to the
  replacement list.
* module/Makefile.am: Adapt to rename.
* test-suite/tests/suspendable-ports.test: Rename from sports.test.
* test-suite/Makefile.am: Adapt to rename.
* module/ice-9/textual-ports.scm (unget-char, unget-string): New
  functions.
* doc/ref/api-io.texi (Textual I/O, Simple Output): Flesh out
  documentation.
  (Line/Delimited): Undocument write-line, read-string, and
  read-string!.  This is handled by (ice-9 textual-ports).
  (Bytevector Ports): Fix duplicated section.
  (String Ports): Move the note about encodings down to the end.
  (Custom Ports): Add explanatory text.  Remove mention of C functions;
  they should use the C port interface.
  (Venerable Port Interfaces): Add text, and make documentation refer to
  recommended interfaces.
  (Using Ports from C): Add documentation.
  (Non-Blocking I/O): Document more fully and adapt to suspendable-ports
  name change.
2016-06-09 10:50:32 +02:00
Andy Wingo
a21f6467ac Big ports documentation update
* doc/ref/api-io.texi: Update to document ports more thoroughly.  Still
  some work needed.

* doc/ref/r6rs.texi: Move ports documentation back to r6rs.texi, now
  that Guile has a more thorough binary/textual I/O story, heavily based
  on R6RS.

* doc/ref/api-control.texi:
* doc/ref/api-data.texi:
* doc/ref/api-options.texi:
* doc/ref/misc-modules.texi:
* doc/ref/posix.texi:
* doc/ref/srfi-modules.texi: Update references.
2016-06-08 10:19:27 +02:00
Andy Wingo
6eee08874b Undocument (ice-9 rw)
* doc/ref/api-io.texi (Block Reading and Writing): Undocument (ice-9
  rw).  The R6RS routines do the same job and are not so clunky.
2016-06-08 08:38:49 +02:00
Andy Wingo
d7f39a36b1 socket: TCP_CORK, TCP_NODELAY
* libguile/socket.c (scm_init_socket): Define TCP_NODELAY and TCP_CORK
  if they are available.
* doc/ref/posix.texi (Network Sockets and Communication): Add
  documentation.
* NEWS: Add entry.
2016-06-04 12:49:47 +02:00
Luribert
a7d0a0de2f 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-22 20:14:42 +02:00
Mark H Weaver
140496cc00 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-05-22 20:02:43 +02:00
Mark H Weaver
d975a8dec6 docs: Fix external representation of <toplevel-define> in tree-il.
* doc/ref/compiler.texi (Tree-IL): Provide the correct external
  representation of <toplevel-define>.
2016-05-22 19:49:15 +02:00
Ludovic Courtès
e8d3733521 doc: Fix menu order for SXML.
* doc/ref/sxml.texi (SXML): Add missing quotes in example.
  Fix node order in menu.
2016-05-22 19:45:40 +02:00
Ricardo Wurmus
b6c1018d96 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>
2016-05-22 19:45:28 +02:00
Taylan Ulrich Bayırlı/Kammer
a04c849b09 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.
2016-05-22 19:42:23 +02:00
Mark H Weaver
3cf70e36f1 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'.
2016-05-22 19:42:13 +02:00
Mathieu Lirzin
ea8fa622ec doc: Fix parameter of 'set-record-type-printer!'.
* doc/ref/api-compound.texi (SRFI-9 Records)[set-record-type-printer!]:
  Fix parameter name.
2016-05-22 19:29:17 +02:00
Alex Kost
e7cde8be9e Fix typo in manual.
* doc/ref/api-modules.texi (Using Guile Modules): Remove extra "yet".
2016-05-22 19:29:17 +02:00
Ludovic Courtès
93c3b060c1 doc: Update libgc URL.
* doc/ref/data-rep.texi (Conservative GC): Update libgc URL.
2016-05-22 19:29:17 +02:00
Mark H Weaver
e390e5760b 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.
2016-05-22 19:03:37 +02:00
Andy Wingo
534139e458 Support for non-blocking I/O
* doc/ref/api-io.texi (I/O Extensions): Document read_wait_fd /
  write_wait_fd members.
  (Non-Blocking I/O): New section.
* libguile/fports.c (fport_read, fport_write): Return -1 if the
  operation would block.
  (fport_wait_fd, scm_make_fptob): Add read/write wait-fd
  implementation.
* libguile/ports-internal.h (scm_t_port_type): Add read_wait_fd /
  write_wait_fd.
* libguile/ports.c (default_read_wait_fd, default_write_wait_fd): New
  functions.
  (scm_make_port_type): Initialize default read/write wait fd impls.
  (trampoline_to_c_read, trampoline_to_scm_read)
  (trampoline_to_c_write, trampoline_to_scm_write): To Scheme, a return
  of #f indicates EWOULDBLOCk.
  (scm_set_port_read_wait_fd, scm_set_port_write_wait_fd): New
  functions.
  (port_read_wait_fd, port_write_wait_fd, scm_port_read_wait_fd)
  (scm_port_write_wait_fd, port_poll, scm_port_poll): New functions.
  (scm_i_read_bytes, scm_i_write_bytes): Poll if the read or write would
  block.
* libguile/ports.h (scm_set_port_read_wait_fd)
  (scm_set_port_write_wait_fd): Add declarations.
* module/ice-9/ports.scm: Shunt port-poll and port-{read,write}-wait-fd
  to the internals module.
* module/ice-9/sports.scm (current-write-waiter):
  (current-read-waiter): Implement.
* test-suite/tests/ports.test: Adapt non-blocking test to new behavior.
* NEWS: Add entry.
2016-05-20 14:57:27 +02:00
Andy Wingo
1e058add7b U+FFFD is the input substitution character
* libguile/ports.c (UNICODE_REPLACEMENT_CHARACTER):
* libguile/ports.c (peek_utf8_codepoint)
  (scm_port_decode_char, peek_iconv_codepoint):
* module/ice-9/sports.scm (peek-char-and-len/utf8):
  (peek-char-and-len/iconv): Return U+FFFD when we get a decoding error
  when reading, instead of '?', in accordance with Unicode
  recommendations.
* test-suite/tests/iconv.test:
* test-suite/tests/ports.test:
* test-suite/tests/rdelim.test: Update tests.
* NEWS: Update.
2016-05-16 10:48:35 +02:00
Andy Wingo
556ac9777b Document scm_c_make_port and friends
* doc/ref/api-io.texi (I/O Extensions): Document scm_c_make_port and
  friends, and document "mode bits".
2016-05-14 23:27:38 +02:00
Andy Wingo
9322902d02 Update port type documentation
* doc/ref/api-io.texi (I/O Extensions): Update for port type change.
2016-05-13 18:34:12 +02:00
Andy Wingo
af1c443f83 Update port documentation
* doc/ref/api-io.texi: Update for refactorings.
2016-05-13 16:48:02 +02:00
Andy Wingo
6ff542ee71 Add random_access_p port type method
* doc/ref/api-io.texi (I/O Extensions): Update documentation on
  implementing port types.  Document get_natural_buffer_sizes.  Document
  the new random_access_p.
* libguile/fports.c (scm_i_fdes_to_port, fport_random_access_p):
  (scm_make_fptob): Instead of frobbing rw_random manually, implement a
  random_access_p function.
* libguile/ports.c (default_random_access_p)
  (scm_set_port_random_access_p): New functions.
  scm_make_port_type, scm_c_make_port_with_encoding): Arrange for
  random_access_p to work.
2016-05-13 10:05:23 +02:00
Andy Wingo
f5b9a53bd0 Add integer->char and char->integer opcodes
* libguile/vm-engine.c (integer_to_char, char_to_integer): New opcodes.
* libguile/vm.c (vm_error_not_a_char): New error case.
* module/language/cps/compile-bytecode.scm (compile-function):
* module/language/cps/slot-allocation.scm (compute-var-representations):
* module/language/cps/types.scm:
* module/language/tree-il/compile-cps.scm (convert):
* doc/ref/vm.texi (Inlined Scheme Instructions):
* module/system/vm/assembler.scm: Add support for new opcodes.
2016-05-04 12:36:41 +02:00
Andy Wingo
d83140890f Update port implementation documentation.
* doc/ref/api-io.texi (I/O Extensions): Update read/write
  documentation.
2016-04-12 16:31:20 +02:00
Andy Wingo
8399e7af51 Generic port facility provides buffering uniformly
* libguile/ports.h (struct scm_t_port_buffer): New data type.
  (struct scm_t_port): Refactor to use port buffers instead of
  implementation-managed read and write pointers.  Add "read_buffering"
  member.
  (SCM_INITIAL_PUTBACK_BUF_SIZE, SCM_READ_BUFFER_EMPTY_P): Remove.
  (scm_t_ptob_descriptor): Rename "fill_input" function to "read", and
  take a port buffer, returning void.  Likewise "write" takes a port
  buffer and returns void.  Remove "end_input"; instead if there is
  buffered input and rw_random is true, then there must be a seek
  function, so just seek back if needed.  Remove "flush"; instead all
  calls to the "write" function implicitly include a "flush", since the
  buffering happens in the generic port code now.  Remove "setvbuf", but
  add "get_natural_buffer_sizes"; instead the generic port code can
  buffer any port.
  (scm_make_port_type): Adapt to read and write prototype changes.
  (scm_set_port_flush, scm_set_port_end_input, scm_set_port_setvbuf):
  Remove.
  (scm_slow_get_byte_or_eof_unlocked)
  (scm_slow_get_peek_or_eof_unlocked): Remove; the slow path is to call
  scm_fill_input.
  (scm_set_port_get_natural_buffer_sizes): New function.
  (scm_c_make_port_buffer): New internal function.
  (scm_port_non_buffer): Remove.  This was a function for
  implementations that is no longer needed.  Instead open with BUF0 or
  use (setvbuf port 'none).
  (scm_fill_input, scm_fill_input_unlocked): Return the filled port
  buffer.
  (scm_get_byte_or_eof_unlocked, scm_peek_byte_or_eof_unlocked): Adapt
  to changes in buffering and EOF management.
* libguile/ports.c: Adapt to port interface changes.
  (initialize_port_buffers): New function, using the port mode flags to
  set up appropriate initial buffering for all ports.
  (scm_c_make_port_with_encoding): Create port buffers here instead of
  delegating to implementations.
  (scm_close_port): Flush the port if needed instead of delegating to
  the implementation.
* libguile/filesys.c (set_element): Adapt to buffering changes.
* libguile/fports.c (fport_get_natural_buffer_sizes): New function,
  replacing scm_fport_buffer_add.
  (fport_write, fport_read): Update to let the generic ports code do the
  buffering.
  (fport_flush, fport_end_input): Remove.
  (fport_close): Don't flush in a dynwind; that's the core ports' job.
  (scm_make_fptob): Adapt.
* libguile/ioext.c (scm_redirect_port): Adapt to buffering changes.
* libguile/poll.c (scm_primitive_poll): Adapt to buffering changes.
* libguile/ports-internal.h (struct scm_port_internal): Remove
  pending_eof flag; this is now set on the read buffer.
* libguile/r6rs-ports.c (struct bytevector_input_port): New type.  The
  new buffering arrangement means that there's now an intermediate
  buffer between the bytevector and the user of the port; this could
  lead to a perf degradation, but on the other hand there are some other
  speedups enabled by the buffering refactor, so probably the memcpy
  cost is dwarfed by the cost of the other parts of the ports
  machinery.
  (make_bytevector_input_port, bytevector_input_port_read):
  (bytevector_input_port_seek, initialize_bytevector_input_ports): Adapt
  to new buffering arrangement.
  (struct custom_binary_port): Remove read buffer, as Guile handles that
  now.
  (custom_binary_input_port_setvbuf): Remove; now handled by Guile.
  (make_custom_binary_input_port, custom_binary_input_port_read)
  (initialize_custom_binary_input_ports): Adapt.
  (scm_get_bytevector_some): Adapt to new EOF management.
  (scm_t_bytevector_output_port_buffer): Hold on to the underlying port,
  so we can flush it if it's open.
  (make_bytevector_output_port, bytevector_output_port_write):
  (bytevector_output_port_seek): Adapt.
  (bytevector_output_port_procedure): Flush the port as appropriate, so
  that we get all the bytes.
  (make_custom_binary_output_port, custom_binary_output_port_write):
  Adapt.
  (make_transcoded_port): Don't muck with buffering.
  (transcoded_port_write): Simply forward the write to the underlying
  port.
  (transcoded_port_read): Likewise.
  (transcoded_port_close): No need to flush.
  (initialize_transcoded_ports): Adapt.
* libguile/read.c (scm_i_scan_for_encoding): Adapt to buffering
  changes.
* libguile/rw.c (scm_write_string_partial): Adapt to buffering changes.
* libguile/strports.c: Adapt to the fact that we don't manage the
  buffer.  Probably room for speed improvements here...
* libguile/vports.c (soft_port_get_natural_buffer_sizes): New function.
  Adapt the rest of the file for the new buffering regime.
* test-suite/tests/r6rs-ports.test ("8.2.10 Output ports"): Custom
  binary output ports need to be flushed before you can rely on the
  write! procedure having been called.  Add necessary flush-port
  invocations.
  ("8.2.6  Input and output ports"): Transcoded ports now have an
  internal buffer by default.  This test checks that the characters are
  transcoded one at a time, so to do that, call setvbuf on the
  transcoded port to remove the buffer.
* test-suite/tests/web-client.test (run-with-http-transcript): Fix for
  different flushing regime on soft ports.  (The vestigial flush
  procedure is now called after each write, which is not what the test
  was expecting.)
* test-suite/standalone/test-scm-c-read.c: Update for changes to the C
  interface for defining port types.
* doc/ref/api-io.texi (Ports): Update to discuss buffering in a generic
  way, and to remove a hand-wavey paragraph describing string ports as
  "interesting and powerful".
  (Reading, Writing): Remove placeholder comments.  Document
  `scm_lfwrite'.
  (Buffering): New section.
  (File Ports): Link to buffering.
  (I/O Extensions): Join subnodes into parent and describe new API,
  including buffering API.
* doc/ref/posix.texi (Ports and File Descriptors): Link to buffering.
  Remove unread-char etc, as they are documented elsewhere.
  (Pipes, Network Sockets and Communication): Link to buffering.
2016-04-06 19:21:44 +02:00
Andy Wingo
e8eeeeb1d4 Port close functions return void
* libguile/ports.h (scm_t_ptob_descriptor): The port close function now
  returns void.
  (scm_set_port_close): Adapt prototype.
* libguile/ports.c (scm_close_port): Always return true if we managed to
  call the close function.  There's no other sensible result; exceptions
  are handled, well, exceptionally.

* libguile/fports.c (fport_close)
* libguile/r6rs-ports.c (custom_binary_port_close, transcoded_port_close):
* libguile/vports.c (soft_port_close): Adapt.

* doc/ref/api-io.texi (Port Implementation): Update.
2016-04-05 15:16:26 +02:00
Andy Wingo
e98f64009d Remove port equal functions
* doc/ref/api-io.texi (Port Implementation): Remove mention of port
  equal functions.
* NEWS: Update.
* libguile/ports.c (scm_set_port_equalp): Remove.
* libguile/ports.h (scm_t_ptob_descriptor): Remove equalp function.
2016-04-04 16:30:56 +02:00
Andy Wingo
67b147fb7a Remove port free functions; just close instead
* libguile/ports.h (scm_t_port_type_flags): Replace
  SCM_PORT_TYPE_HAS_FLUSH with SCM_PORT_TYPE_NEEDS_CLOSE_ON_GC.
  (scm_t_ptob_descriptor): Remove free function.
* libguile/ports.c (scm_set_port_needs_close_on_gc): New function.
  (scm_set_port_flush): Don't set flags.
  (scm_c_make_port_with_encoding, scm_close_port): Use the new flag to
  determine when to add a finalizer and also when to include the port in
  the weak set.
  (scm_set_port_free): Remove.
  (do_close, finalize_port): Close port instead of calling free
  function.
* libguile/r6rs-ports.c (initialize_transcoded_ports):
* libguile/vports.c (scm_make_sfptob):
* libguile/fports.c (scm_make_fptob): Mark these ports as needing close
  on GC.
* libguile/fports.c (fport_free): Remove.
* NEWS: Update.
* doc/ref/api-io.texi (Port Implementation): Update.
2016-04-04 16:30:56 +02:00
Andy Wingo
4460f1f152 Remove port mark functions
* doc/ref/api-io.texi (Port Implementation): Remove documentation.
* libguile/ports.c (scm_set_port_mark): Remove function.
* libguile/ports.h (scm_t_ptob_descriptor): Remove mark function.
* NEWS: Add entry.
2016-04-04 16:30:56 +02:00