diff options
Diffstat (limited to 'libguile/vports.c')
-rw-r--r-- | libguile/vports.c | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/libguile/vports.c b/libguile/vports.c index 75e7df303..e7263302b 100644 --- a/libguile/vports.c +++ b/libguile/vports.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1995,1996,1998,1999,2000,2001, 2002, 2003, 2006, 2009, 2010 Free Software Foundation, Inc. +/* Copyright (C) 1995,1996,1998,1999,2000,2001, 2002, 2003, 2006, 2009, 2010, 2011, 2013 Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -28,6 +28,8 @@ #include "libguile/_scm.h" #include "libguile/eval.h" #include "libguile/chars.h" +#include "libguile/ports.h" +#include "libguile/ports-internal.h" #include "libguile/fports.h" #include "libguile/root.h" #include "libguile/strings.h" @@ -86,15 +88,15 @@ sf_fill_input (SCM port) { SCM p = SCM_PACK (SCM_STREAM (port)); SCM ans; - scm_t_port *pt; + scm_t_port_internal *pti; ans = scm_call_0 (SCM_SIMPLE_VECTOR_REF (p, 3)); /* get char. */ if (scm_is_false (ans) || SCM_EOF_OBJECT_P (ans)) return EOF; SCM_ASSERT (SCM_CHARP (ans), ans, SCM_ARG1, "sf_fill_input"); - pt = SCM_PTAB_ENTRY (port); + pti = SCM_PORT_GET_INTERNAL (port); - if (pt->encoding == NULL) + if (pti->encoding_mode == SCM_PORT_ENCODING_MODE_LATIN1) { scm_t_port *pt = SCM_PTAB_ENTRY (port); @@ -104,7 +106,7 @@ sf_fill_input (SCM port) return *pt->read_buf; } else - scm_ungetc (SCM_CHAR (ans), port); + scm_ungetc_unlocked (SCM_CHAR (ans), port); return SCM_CHAR (ans); } @@ -188,7 +190,6 @@ SCM_DEFINE (scm_make_soft_port, "make-soft-port", 2, 0, 0, #define FUNC_NAME s_scm_make_soft_port { int vlen; - scm_t_port *pt; SCM z; SCM_VALIDATE_VECTOR (1, pv); @@ -196,14 +197,10 @@ SCM_DEFINE (scm_make_soft_port, "make-soft-port", 2, 0, 0, SCM_ASSERT ((vlen == 5) || (vlen == 6), pv, 1, FUNC_NAME); SCM_VALIDATE_STRING (2, modes); - scm_i_scm_pthread_mutex_lock (&scm_i_port_table_mutex); - z = scm_new_port_table_entry (scm_tc16_sfport); - pt = SCM_PTAB_ENTRY (z); - scm_port_non_buffer (pt); - SCM_SET_CELL_TYPE (z, scm_tc16_sfport | scm_i_mode_bits (modes)); - - SCM_SETSTREAM (z, SCM_UNPACK (pv)); - scm_i_pthread_mutex_unlock (&scm_i_port_table_mutex); + z = scm_c_make_port (scm_tc16_sfport, scm_i_mode_bits (modes), + SCM_UNPACK (pv)); + scm_port_non_buffer (SCM_PTAB_ENTRY (z)); + return z; } #undef FUNC_NAME |