Centralize the creation of port objects based on stdio FILE * in
authorJim Blandy <jimb@red-bean.com>
Fri, 9 Oct 1998 12:46:31 +0000 (12:46 +0000)
committerJim Blandy <jimb@red-bean.com>
Fri, 9 Oct 1998 12:46:31 +0000 (12:46 +0000)
commitbc45012d8fb7bb6f572c5b7a2919e3ff2fe5bfd5
treeeb10cda4446c1a138d917ea7a0c597f24fddfd70
parent571031dca0b8474ec576dbb949ea82d9265a9897
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.
libguile/init.c
libguile/ioext.c
libguile/ioext.h
libguile/posix.c
libguile/socket.c