diff options
author | Jim Blandy <jimb@red-bean.com> | 1998-10-09 12:46:31 +0000 |
---|---|---|
committer | Jim Blandy <jimb@red-bean.com> | 1998-10-09 12:46:31 +0000 |
commit | bc45012d8fb7bb6f572c5b7a2919e3ff2fe5bfd5 (patch) | |
tree | eb10cda4446c1a138d917ea7a0c597f24fddfd70 /libguile/init.c | |
parent | 571031dca0b8474ec576dbb949ea82d9265a9897 (diff) | |
download | guile-bc45012d8fb7bb6f572c5b7a2919e3ff2fe5bfd5.tar.gz |
Centralize the creation of port objects based on stdio FILE * in
fports.c; don't just throw them together anywhere.
* fports.c (scm_stdio_to_port): Make NAME a SCM value, which is
what the rest of Guile wants. Don't set the revealed count;
that's only appropriate for stdin, stdout, stderr.
(scm_standard_stream_to_port): This function does set the revealed
count.
* init.c (scm_init_standard_ports): Use scm_standard_stream_to_port,
not scm_stdio_to_port.
* filesys.c (scm_open): Call scm_stdio_to_port; don't write it out.
* fports.c (scm_open_file): Same.
* posix.c (scm_pipe): Same.
* socket.c (scm_sock_fd_to_port): Same.
* ioext.c (scm_fdopen): Same.
(scm_freopen): Moved from here to...
* fports.c (scm_freopen): ... here. This is really something that
munges the internals of an fport, so it should go here.
* fports.h (scm_stdio_to_port): Adjust prototype.
(scm_standard_stream_to_port, scm_freopen): New protoypes.
* ioext.h (scm_freopen): Prototype removed.
Diffstat (limited to 'libguile/init.c')
-rw-r--r-- | libguile/init.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libguile/init.c b/libguile/init.c index 24304558f..585826989 100644 --- a/libguile/init.c +++ b/libguile/init.c @@ -264,11 +264,12 @@ scm_init_standard_ports () and scsh, read stdin unbuffered. Applications that can tolerate buffered input on stdin can reset \ex{(current-input-port)} to block buffering for higher performance. */ - scm_def_inp = scm_stdio_to_port (stdin, + scm_def_inp + = scm_standard_stream_to_port (stdin, (isatty (fileno (stdin)) ? "r0" : "r"), "standard input"); - scm_def_outp = scm_stdio_to_port (stdout, "w", "standard output"); - scm_def_errp = scm_stdio_to_port (stderr, "w", "standard error"); + scm_def_outp = scm_standard_stream_to_port (stdout, "w", "standard output"); + scm_def_errp = scm_standard_stream_to_port (stderr, "w", "standard error"); scm_cur_inp = scm_def_inp; scm_cur_outp = scm_def_outp; |