summaryrefslogtreecommitdiff
path: root/libguile/fports.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2016-05-13 11:21:41 +0200
committerAndy Wingo <wingo@pobox.com>2016-05-13 11:27:37 +0200
commite5d2f4e566586f768bda99c28a74fd2303ecace1 (patch)
tree71fead353c58b0a42e7c3dbf71bd4e9d884297b4 /libguile/fports.c
parent9a9e0cceae8433ba45e2ab9b37c02dd3b3c71d9a (diff)
downloadguile-e5d2f4e566586f768bda99c28a74fd2303ecace1.tar.gz
Make scm_t_port private
* libguile/ports-internal.h (enum scm_port_encoding_mode): Remove unused enum. (scm_t_port_internal, scm_t_port): Make encoding and conversion_strategy private. Instead of scm_t_port_internal containing scm_t_port, now that all members are private, we can store the user's "stream" in a word in the port object itself and make the whole of scm_t_port private. The next commit will remove scm_t_port_internal. (SCM_PTAB_ENTRY, SCM_PORT_DESCRIPTOR): Make private. * libguile/ports.c (scm_c_make_port_with_encoding): Adapt to new port layout. (scm_port_print): Use SCM_PTAB_ENTRY when printing. * libguile/ports.h: Remove scm_t_port definition. * libguile/ioext.c (get_matching_port): Simplify. * libguile/fports.c (scm_i_evict_port): Simplify.
Diffstat (limited to 'libguile/fports.c')
-rw-r--r--libguile/fports.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/libguile/fports.c b/libguile/fports.c
index aab83c9d3..c756129d7 100644
--- a/libguile/fports.c
+++ b/libguile/fports.c
@@ -83,16 +83,9 @@ scm_i_evict_port (void *closure, SCM port)
{
int fd = * (int*) closure;
- if (SCM_FPORTP (port))
+ if (SCM_OPFPORTP (port))
{
- scm_t_port *p;
- scm_t_fport *fp;
-
- /* XXX: In some cases, we can encounter a port with no associated ptab
- entry. */
- p = SCM_PTAB_ENTRY (port);
- fp = (p != NULL) ? (scm_t_fport *) p->stream : NULL;
-
+ scm_t_fport *fp = SCM_FSTREAM (port);
if ((fp != NULL) && (fp->fdes == fd))
{
fp->fdes = dup (fd);