core: Add current-output-port, open-output-file, set-current-output-port.
authorJan Nieuwenhuizen <janneke@gnu.org>
Fri, 19 May 2017 04:56:47 +0000 (06:56 +0200)
committerJan Nieuwenhuizen <janneke@gnu.org>
Fri, 19 May 2017 04:56:47 +0000 (06:56 +0200)
commit45ce77df85fd4a70cf4f2148128d1aada65bf35b
tree8083b8cceb81cc4ca20752e72149adfe9477f694
parent44c8f26bf03c577a908155ee91d04ef31986cf58
core: Add current-output-port, open-output-file, set-current-output-port.

* libc/include/fcntl.h: Declare it.  Add some fcntl defines.
* libc/include/stdio.h: Remove fcntl defines, Declare g_stdout.
* module/language/c99/compiler.mes (c99-input->ast): Define O_WRONLY, O_RDWR.
* module/mes/guile.mes (with-output-to-file, with-output-to-port): New functions.
* src/posix.c (current_output_port, open_output_file,
  set_current_output_port): New functions.
* libc/mlibc.c (open): Add optional mode parameter.
* module/mes/libc-i386.mes (i386:open): Forward third parameter.
* scaffold/mini-mes.c (main): Init g_stdout.
* src/mes.c (main): Likewise.
libc/include/fcntl.h
libc/include/stdio.h
libc/mlibc.c
module/language/c99/compiler.mes
module/mes/guile.mes
module/mes/libc-i386.mes
module/mes/posix.mes
scaffold/mini-mes.c
src/mes.c
src/posix.c