summaryrefslogtreecommitdiff
path: root/doc/ref
AgeCommit message (Collapse)AuthorFilesLines
2022-10-21Define a Scheme binding to ‘unlinkat’ when it exists.Maxime Devos1-0/+12
‘unlinkat’ is used for both unlinking regular files and removing empty directories. * configure.ac: Detect if ‘unlinkat’ exists. * doc/ref/posix.texi (File System): Document why there is no ‘rmdirat’ procedure, and document the ‘delete-file-at’ procedure. * libguile/filesys.c (scm_rmdir): Adjust the docstring here as well. (scm_delete_file_at): Define a Scheme binding to ‘unlinkat’. * libguile/filesys.h (scm_delete_file_at): Make ‘scm_delete_file_at’ part of the C API. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-10-21Define a Scheme binding to ‘renameat’ when it exists.Maxime Devos1-0/+9
* configure.ac: Detect if ‘renameat’ is defined. * libguile/filesys.c (scm_renameat): Define a Scheme binding to the ‘renameat’ system call. * doc/ref/posix.texi (File System): Document it. * libguile/filesys.h (scm_renameat): Make it part of the C API. * test-suite/tests/filesys.test ("rename-file-at"): New tests. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-10-21Correct documentation of ‘mkdir’ w.r.t. the umask.Maxime Devos1-1/+2
* doc/ref/posix.texi (mkdir): Note that the umask is applied even if the mode argument is set. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-10-21Define bindings to ‘mkdirat’ when the C function exists.Maxime Devos1-0/+6
* configure.ac: Detect if ‘mkdirat’ exists. * libguile/filesys.c (scm_mkdirat): Define the Scheme binding. * doc/ref/posix.texi (File System): Document it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-10-21Define ‘symlinkat’ wrapper when supported.Maxime Devos1-0/+6
* configure.ac: Detect whether ‘symlinkat’ exists. * libguile/filesys.c (scm_symlinkat): Define a Scheme binding when it exists. * libguile/filesys.h: Make the binding part of the public C API. * doc/ref/posix.texi (File System): Document the binding. * test-suite/tests/filesys.test ("symlinkat"): Test it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-10-21Allow file ports in ‘utime’.Maxime Devos1-4/+11
Ports representing symbolic links are currently unsupported. * configure.ac: Detect 'futimens'. * doc/ref/posix.texi (utime): Update documentation. * libguile/posix.c (scm_utime): Support ports. * libguile/posix.h (scm_utime): Rename argument. * test-suite/tests/posix.test ("utime"): Add more tests. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-10-21Allow file ports in ‘readlink’.Maxime Devos1-2/+7
* configure.ac: Detect whether ‘readlinkat’ is defined. * libguile/filesys.c (scm_readlink): Support file ports when ‘readlinkat’ exists. (scm_init_filesys): Provide ‘chdir-ports’ when it exists. * doc/ref/posix.texi (File System): Document it. * test-suite/tests/filesys.test ("readlink"): Test it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-10-21Allow file ports in ‘chdir’ when supported.Maxime Devos2-2/+6
* configure.ac: Check for ‘fchdir’. * libguile/filesys.c (scm_chdir): Support file ports. (scm_init_filesys): Report support of file ports. * doc/ref/posix.texi (Processes): Update accordingly. * doc/ref/guile.texi: Add copyright line for new documentation in this patch and later patches. * test-suite/tests/filesys.test ("chdir"): Test it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-10-12doc: Document how (ice-9 format) replaces 'format'.Jean Abou Samra1-0/+10
* doc/ref/misc-modules.texi (Formatted Output): Add paragraph. * module/ice-9/format.scm: Add comment. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2022-10-12Define SO_RCVTIMEO and SO_SNDTIMEO.Christopher Baines1-0/+2
These are important for reliable networking, since they prevent network operations from hanging indefinitely. * libguile/socket.c (scm_init_socket): Define SO_RCVTIMEO and SO_SNDTIMEO. (scm_getsockopt, scm_setsockopt): Include SO_RCVTIMEO and SO_SNDTIMEO in docstring and handle them. * doc/ref/posix.texi (Network Sockets and Communication): Document them. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-10-01doc: Fix typo in 'coverage-data->lcov' example.Antoine Kalmbach1-1/+1
* doc/ref/api-coverage.texi (Code Coverage): Close PORT, not FILE, in the example. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-10-01doc: Fix typo under "CPS Soup".Fulbert1-1/+1
* doc/ref/compiler.texi (CPS Soup) : fix small typo in doc (closing paren out of @code{} tag). Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-10-01doc: Clarify reference to (sxml transform) module.Fulbert1-8/+8
* doc/ref/sxml.texi (7.21.4 Transforming SXML): Adds a mention to the module to be imported for the procedures introduced in this section of the documentation.. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2022-09-30Fix doc for string args to error C APIDaniel Llorens1-7/+7
2022-09-19'pipe' now takes an optional 'flags' parameter.Ludovic Courtès1-1/+19
This is the same strategy as used for the 'accept4' bindings introduced in 6e0965104c579431e5a786b60e1a964a112c73b8. * libguile/posix.c (scm_pipe): Rename to... (scm_pipe2): ... this. Add an optional 'flags' parameter and honor it. (scm_pipe): Rewrite as a call to 'scm_pipe2'. * libguile/posix.h (scm_pipe2): New declaration. * test-suite/tests/posix.test ("pipe"): New tests. * configure.ac: Look for 'pipe2'. * NEWS: Update.
2022-09-07Add support for "e" flag (O_CLOEXEC) to 'open-file'.Ludovic Courtès1-0/+3
* libguile/fports.c (scm_i_mode_to_open_flags): Add 'e' case. (scm_open_file_with_encoding): Document it. * test-suite/standalone/test-close-on-exec: New file. * test-suite/standalone/Makefile.am (check_SCRIPTS, TESTS): Add it. * doc/ref/api-io.texi (File Ports): Document it. * NEWS: Update.
2022-09-07doc: Add documentation of the "b" flag to 'open-file'.Ludovic Courtès1-0/+4
* doc/ref/api-io.texi (File Ports): Add documentation of the "b" flag, taken from the 'open-file' docstring.
2022-08-11doc: Add car+cdr examplejgart1-0/+7
2022-07-04Define IPPROTO_IPV6 and IPV6_V6ONLY.Ludovic Courtès1-0/+11
* libguile/socket.c (scm_init_socket): Define IPPROTO_IPV6 and IPV6_V6ONLY. * doc/ref/posix.texi (Network Sockets and Communication): Document them.
2022-07-04Define IN6ADDR_ANY and IN6ADDR_LOOPBACK.Ludovic Courtès1-1/+16
* libguile/socket.c (scm_init_socket): Define IN6ADDR_ANY and IN6ADDR_LOOPBACK. * doc/ref/posix.texi (Network Address Conversion): Document them.
2022-07-04web: Don't hide missing data in the chunked input port.Christopher Baines1-0/+3
This port is of limited use if it cannot be used reliably. Rather than behaving as if the input has finished when it ends unexpectedly, instead raise an exception. * module/web/http.scm (make-chunked-input-port): Raise an exception on premature termination. (&chunked-input-ended-prematurely): New exception type. (chunked-input-ended-prematurely-error?): New procedure. * test-suite/tests/web-http.test (pass-if-named-exception): Rename to pass-if-named-exception. (pass-if-named-exception): New syntax. ("Exception on premature chunk end"): New test for this behaviour. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-02-23Typo fix: Use correct variable name in exampleVijay Marupudi1-1/+1
* doc/ref/api-control.texi
2022-02-04Deprecate symbol properties.Ludovic Courtès1-80/+1
* libguile/strings.c (scm_i_make_symbol): Remove 'props' argument. Use 3 words instead of 'scm_double_cell'. * libguile/strings.h: Adjust accordingly. * libguile/symbols.c (scm_i_str2symbol, scm_i_str2uninterned_symbol): Likewise. (scm_symbol_fref, scm_symbol_pref, scm_symbol_fset_x, scm_symbol_pset_x): Move to... * libguile/deprecated.c: ... here. Rewrite in terms of object properties. (symbol_function_slot, symbol_property_slot): New variables. * libguile/symbols.h (SCM_SYMBOL_FUNC, SCM_SET_SYMBOL_FUNC) (SCM_SYMBOL_PROPS, SCM_SET_SYMBOL_PROPS) (scm_symbol_fref, scm_symbol_pref, scm_symbol_fset_x) (scm_symbol_pset_x): Move to... * libguile/deprecated.h: ... here. Mark declarations as 'SCM_DEPRECATED'. * module/system/base/types.scm (cell->object): Remove 'props' field for %TC7-SYMBOL. * doc/ref/api-data.texi (Symbol Props): Remove. * NEWS: Update.
2022-01-13Bignums avoid both custom GMP allocator and finalizersAndy Wingo1-14/+1
* libguile/deprecated.c (make_bignum): Move here from numbers.c, to support scm_i_long2big etc. (scm_i_big2dbl): (scm_i_long2big): (scm_i_ulong2big): (scm_i_clonebig): (scm_i_normbig): Deprecate. (scm_install_gmp_memory_functions): Deprecate, happily! SCM bignums now have digits allocated inline with the bignum itself, so they are completely transparent to the GC already. The price is that if GMP ever allocates digits via the MPZ API, those digits then have to be copied back into managed memory. But we avoid having to install finalizers and we avoid having to muck with GMP's allocator. * libguile/numbers.c (scm_from_mpz): Use scm_integer_from_mpz. (scm_init_numbers): Never muck with GMP's allocators. * doc/ref/guile-invoke.texi (Environment Variables): Remove note about GUILE_INSTALL_GMP_MEMORY_FUNCTIONS. * meta/build-env.in: No need to set GUILE_INSTALL_GMP_MEMORY_FUNCTIONS.
2022-01-04New function bitvector-copy (scm_bitvector_copy)Daniel Llorens1-0/+7
* libguile/bitvectors.h: * libguile/bitvectors.c: As stated. * test-suite/tests/bitvectors.test: Tests. * doc/ref/api-data.texi: Update "Bit vectors" section. * NEWS: Update.
2021-12-13Review REFFIXMEDaniel Llorens3-7/+12
H/t t20kdc on #guile.
2021-12-06New function srfi-4-vector-type-size in (srfi srfi-4 gnu)Daniel Llorens1-0/+6
This patch removes the undocumented function make-srfi-4-vector from (guile). That function is still exported from (srfi srfi-4 gnu). * libguile/srfi-4.h (scm_init_srfi_4): Split into scm_bootstrap_srfi_4() and scm_init_srfi_4(), after the pattern of scm_init_bytevectors() and scm_bootstrap_bytevectors(). * libguile/init.c: Replace scm_init_srfi_4() call by scm_bootstrap_srfi_4(). * module/srfi/srfi-4.scm: Load newly defined srfi-4 extension. This provides undocumented make-srfi-4-vector. * module/srfi/srfi-4/gnu.scm: Export srfi-4-vector-type-size. * doc/ref/srfi-modules.texi: Document srfi-4-vector-type-size.
2021-11-22Fix doc typoDaniel Llorens1-1/+1
H/t to Damien Mattei in guile-devel.
2021-11-15Support C99 complex types in (system foreign)Daniel Llorens1-1/+4
* libguile/foreign.h (SCM_FOREIGN_TYPE_COMPLEX_FLOAT, SCM_FOREIGN_TYPE_COMPLEX_DOUBLE): New enums. * module/system/foreign.scm (complex-float, complex-double): Export new types. (make-c-struct, parse-c-struct): Support the new types. * libguile/foreign.c (complex-float, complex-double): Define new types. (alignof, sizeof, pack, unpack): Support the new types. * test-suite/tests/foreign.test: Test.
2021-11-03Fix typos in SRFI docsArun Isaac2-17/+17
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=50127 * doc/ref/api-foreign.texi, doc/ref/srfi-modules.texi: Fix typos.
2021-10-27Update NEWSDaniel Llorens1-1/+1
2021-10-21Fix doc typoDaniel Llorens1-3/+2
2021-10-21Provide xxvector-copy and xxvector-copy! for srfi-4 vectorsDaniel Llorens2-0/+49
These use the argument conventions of vector-copy!, string-copy!, etc. and not that of bytevector-copy! (which is from r6rs). * module/srfi/srfi-4/gnu.scm: As stated. * test-suite/tests/srfi-4.test: Tests. * doc/ref/srfi-modules.texi: Documentation. * libguile/bytevectors.c (bytevector-copy!): Add overlap note to docstring. * libguile/vectors.c (vector-copy!): Reuse text for the overlap note.
2021-09-20doc: Fix wrong @uref argument order.Ludovic Courtès1-2/+2
* doc/ref/sxml.texi (SXML): Fix @uref argument order.
2021-09-14Fix typo in srfi-69 docDaniel Llorens1-1/+1
2021-08-17Extend bytevector-fill! to handle a partial fillDaniel Llorens1-4/+14
* libguile/bytevectors.c (bytevector-fill!): As stated. (scm_bytevector_fill_x): Stub to avoid changing the C API. * doc/ref/api-data.texi: Documentation. * libguile/vectors.c (vector-fill!): Less confusing variable names. * test-suite/tests/bytevectors.test: Test partial fill cases for bytevector-fill!.
2021-08-16Remove the 'simple vector' conceptDaniel Llorens2-47/+40
* Deprecate scm_is_simple_vector. * libguile/vectors.c (scm_vector_elements, scm_vector_writable_elements): These functions take an array; reword to make this clear. * libguile/print.h: Remove reference to 'simple vector'. * doc/ref/api-data.texi: Remove documentation for scm_is_simple_vector. Remove references to 'simple vector'. Fix documentation for scm_vector_elements, scm_vector_writable_elements. * test-suite/tests/arrays.test: * test-suite/tests/vectors.test: Remove references to 'simple vector'.
2021-08-06Add function vector-copy! to coreDaniel Llorens1-5/+31
This is up to 20%-30% faster than the previous versions in (scheme base) or (srfi srfi-43) that used vector-move-left!/vector-move-right!. * libguile/vectors.h: * libguile/vectors.c: As stated. * doc/ref/api-data.texi (vector-copy!): Document the new function. (vector-fill!): Document optional arguments. (vector-copy): Document optional arguments. * module/scheme/base.scm: Reuse core vector-copy!. * module/srfi/srfi-43.scm: Reuse core vector-copy!.
2021-08-06Extend core vector-copy to r7rs vector-copyDaniel Llorens1-0/+1
* libguile/vectors.h: Declare scm_vector_copy_partial. * libguile/vectors.c (scm_vector_copy_partial): As stated. (scm_vector_copy): Reuse scm_vector_copy_partial. * module/scheme/base.scm: Reuse core vector-copy. * module/srfi/srfi-43: Reuse core vector-copy. * test-suite/tests/vectors.test: Test vector-copy.
2021-05-21Fix typo in lambda documentation.Luis Felipe1-2/+2
In the part about lambda formals, change "arguments will converted into" to "arguments will BE converted into". * doc/ref/api-procedures.texi (Lambda: Basic Procedure Creation): Fix typo.
2021-04-26Allow users to force gmp to use libgcAndy Wingo1-0/+13
* doc/ref/guile-invoke.texi (Environment Variables): Document GUILE_INSTALL_GMP_MEMORY_FUNCTIONS. * libguile/numbers.c (scm_init_numbers): Use environment variable.
2020-10-05Document write-line.Jan (janneke) Nieuwenhuizen1-0/+11
* libguile/rdelim.c (SCM_DEFINE): Use "procedure" rather than "function". * doc/ref/api-io.texi (Line/Delimited): Use it to document 'write-line'.
2021-03-13On Cygwin, 'lib' DLLs use 'cyg' prefixMike Gran1-0/+6
When using automake and libtool to build DLLs on Cygwin, libtool will rename libXXX to cygXXX. 'load-foreign-library' should emulate libltdl behavior and search for DLLs using that convention. * module/system/foreign-library.scm (lib->cyg): new helper function (load-foreign-library): add rename-on-cygwin? option to rename libraries using Cygwin semantics * test-suite/tests/foreign.test: new test section 'lib->cyg' * doc/ref/api-foreign.text: document new rename-on-cygwin? option for load-foreign-library
2021-03-12Revert "Handle CRLF and Unicode line endings in read-line"Andy Wingo1-7/+3
This reverts commit 0f983e3db0c43ad7c89f57ea84f792ede373ba0c. After discussing with Mike we are going to punt the read-line changes for now. Open the port in O_TEXT mode if you want to chomp the CR in CFLF sequences.
2021-03-11Handle CRLF and Unicode line endings in read-lineMike Gran1-3/+7
* libguile/rdelim.c (scm_read_line): handle CRLF, LS and PS * module/ice-9/suspendable-ports.scm (read-line): handle CRLF, LS, and PS * module/web/http.scm (read-header-line): take advantage of CRLF in read-line (read-header): don't need to test for \return * test-suite/tests/rdelim.test: new tests for read-line CRLF, LS and PS * doc/ref/api-io.texi: update doc for read-line
2021-03-10Add mkstemp; undocument mkstemp!Andy Wingo1-11/+14
* doc/ref/posix.texi (File System): Update to document mkstemp only. * libguile/filesys.c: Make a mkstemp that doesn't modify the input template. Instead the caller has to get the file name from port-filename. (scm_mkstemp): Use the new mkstemp to implement mkstemp!. Can't deprecate yet though as the replacement hasn't been there for long enough. * libguile/posix.c (scm_tempnam): Update to mention mkstemp instead. * module/system/base/compile.scm (call-with-output-file/atomic): Use mkstemp. * test-suite/tests/posix.test: * test-suite/tests/r6rs-files.test: Use mkstemp. * NEWS: Update.
2021-03-09Document syntax-sourcevAndy Wingo1-0/+7
* NEWS: Add doc link. * doc/ref/api-macros.texi (Syntax Transformer Helpers): Document syntax-sourcev. * module/system/syntax.scm: Re-export syntax-sourcev.
2021-03-09Document quote-syntaxAndy Wingo1-0/+18
* NEWS: Update. * doc/ref/api-macros.texi (Syntax Case): Update.
2021-03-05Fix up source properties section in manualAndy Wingo1-6/+6
* doc/ref/api-debug.texi (Source Properties): Fix wordo, and adapt text.
2021-03-04Update reference for GUILE_EXTENSIONS_PATHAndy Wingo1-1/+9
* NEWS: Update. * doc/ref/guile-invoke.texi (Environment Variables): Add entry.