summaryrefslogtreecommitdiff
path: root/libguile/fports.h
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2016-07-16 15:34:41 +0200
committerAndy Wingo <wingo@pobox.com>2016-07-25 11:46:18 +0200
commitaae356158412662c97b7178768bfe4be41749a3b (patch)
tree7aa62f3b9a505ecc4f5008a60221e54f2def5317 /libguile/fports.h
parente868fae6585d82c0b46a9a840913f0674dde0d3e (diff)
downloadguile-aae356158412662c97b7178768bfe4be41749a3b.tar.gz
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.
Diffstat (limited to 'libguile/fports.h')
-rw-r--r--libguile/fports.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/libguile/fports.h b/libguile/fports.h
index 6b15bd971..ee9bf7cbd 100644
--- a/libguile/fports.h
+++ b/libguile/fports.h
@@ -53,6 +53,8 @@ SCM_API scm_t_port_type *scm_file_port_type;
SCM_API void scm_evict_ports (int fd);
+SCM_INTERNAL int scm_i_mode_to_open_flags (SCM mode, int *is_binary,
+ const char *FUNC_NAME);
SCM_API SCM scm_open_file_with_encoding (SCM filename, SCM modes,
SCM guess_encoding, SCM encoding);
SCM_API SCM scm_open_file (SCM filename, SCM modes);