1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-14 15:40:19 +02:00

Remove scm_t_port_internal

* libguile/ports-internal.h (SCM_PORT): Rename from SCM_PTAB_ENTRY.
  (scm_t_port_internal, SCM_PORT_GET_INTERNAL): Remove.
  (SCM_FILENAME, SCM_SET_FILENAME, SCM_LINUM, SCM_COL): Adapt.
* libguile/ports.c:
* libguile/poll.c:
* libguile/ioext.c:
* libguile/fports.c:
* libguile/filesys.c:
* libguile/print.c:
* libguile/read.c:
* libguile/rw.c:
* libguile/strings.c: Adapt.
This commit is contained in:
Andy Wingo 2016-05-13 11:34:52 +02:00
parent e5d2f4e566
commit 08574987d9
10 changed files with 142 additions and 154 deletions

View file

@ -650,19 +650,15 @@ set_element (fd_set *set, SCM *ports_ready, SCM element, int pos)
SCM_ASSERT (SCM_OPFPORTP (element), element, pos, "select");
if (pos == SCM_ARG1)
{
/* check whether port has buffered input. */
scm_t_port_internal *pti = SCM_PORT_GET_INTERNAL (element);
if (scm_port_buffer_can_take (pti->read_buf) > 0)
/* Check whether port has input buffered. */
if (scm_port_buffer_can_take (SCM_PORT (element)->read_buf) > 0)
use_buf = 1;
}
else if (pos == SCM_ARG2)
{
/* check whether port's output buffer has room. */
scm_t_port_internal *pti = SCM_PORT_GET_INTERNAL (element);
/* > 1 since writing the last byte in the buffer causes flush. */
if (scm_port_buffer_can_put (pti->write_buf) > 1)
/* Check whether port's output buffer has room. > 1 since
writing the last byte in the buffer causes flush. */
if (scm_port_buffer_can_put (SCM_PORT (element)->write_buf) > 1)
use_buf = 1;
}
fd = use_buf ? -1 : SCM_FPORT_FDES (element);