1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-24 04:15:36 +02:00

Add 'set-port-binary/text-mode!' procedure for MinGW.

* libguile/ports.c (scm_init_ports)[O_BINARY]: Define 'O_BINARY'.
[O_TEXT]: Define 'O_TEXT'.
(scm_c_set_port_binary_text_mode_x): New function.
* libguile/ports.h (scm_set_binary_text_mode_x): Declare it.
* module/ice-9/ports.scm (ice-9): Export it as
'set-port-binary/text-mode!'.
* doc/ref/api-io.texi (File Ports): Document it.
This commit is contained in:
Jan (janneke) Nieuwenhuizen 2020-11-19 15:08:33 +01:00 committed by Michael Gran
parent 2d82b49cf3
commit d58c9411ae
4 changed files with 57 additions and 0 deletions

View file

@ -1150,6 +1150,19 @@ source of data, but only the value that is returned by
Determine whether @var{obj} is a port that is related to a file.
@end deffn
@deffn {Scheme Procedure} set-port-binary/text-mode! port mode
On MinGW, set the binary/text mode for @var{port}. @var{mode} can be one
of the following:
@table @code
@item O_BINARY
binary mode
@item O_TEXT
text mode
@end table
Only open file ports are supported. On POSIX, this is a no-op.
@end deffn
@node Bytevector Ports
@subsubsection Bytevector Ports