1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 03:40:34 +02:00

Remove scm_fill_input_unlocked

* libguile/ports.h (scm_fill_input_unlocked): Remove.
* libguile/ports.c (scm_fill_input): Rename from
  scm_fill_input_unlocked.  Adapt callers.
* libguile/r6rs-ports.c (scm_get_bytevector_some): Adapt.
* libguile/read.c (scm_i_scan_for_encoding): Adapt.
This commit is contained in:
Andy Wingo 2016-04-26 22:13:26 +02:00
parent abf90c4e72
commit 796676028b
4 changed files with 4 additions and 21 deletions

View file

@ -1516,7 +1516,7 @@ scm_c_read_bytes (SCM port, SCM dst, size_t start, size_t count)
buffer directly. */
if (to_read < pt->read_buffering)
{
read_buf = scm_fill_input_unlocked (port);
read_buf = scm_fill_input (port);
did_read = scm_port_buffer_take (read_buf, dst_ptr, to_read);
dst_ptr += did_read;
to_read -= did_read;
@ -2310,20 +2310,6 @@ SCM_DEFINE (scm_setvbuf, "setvbuf", 2, 1, 0,
}
#undef FUNC_NAME
SCM
scm_fill_input (SCM port)
{
scm_i_pthread_mutex_t *lock;
SCM ret;
scm_c_lock_port (port, &lock);
ret = scm_fill_input_unlocked (port);
if (lock)
scm_i_pthread_mutex_unlock (lock);
return ret;
}
/* Move up to READ_LEN bytes from PORT's read buffer into memory
starting at DEST. Return the number of bytes moved. PORT's
line/column numbers are left unchanged. */
@ -2378,11 +2364,9 @@ SCM_DEFINE (scm_drain_input, "drain-input", 1, 0, 0,
void
scm_end_input (SCM port)
{
scm_t_port *pt;
SCM buf;
size_t discarded;
pt = SCM_PTAB_ENTRY (port);
buf = SCM_PTAB_ENTRY (port)->read_buf;
discarded = scm_port_buffer_take (buf, NULL, (size_t) -1);
@ -2423,7 +2407,7 @@ scm_flush (SCM port)
}
SCM
scm_fill_input_unlocked (SCM port)
scm_fill_input (SCM port)
{
scm_t_port *pt = SCM_PTAB_ENTRY (port);
SCM read_buf = pt->read_buf;

View file

@ -314,7 +314,6 @@ SCM_API SCM scm_unread_string (SCM str, SCM port);
/* Manipulating the buffers. */
SCM_API SCM scm_setvbuf (SCM port, SCM mode, SCM size);
SCM_API SCM scm_fill_input (SCM port);
SCM_API SCM scm_fill_input_unlocked (SCM port);
SCM_INTERNAL size_t scm_take_from_input_buffers (SCM port, char *dest, size_t read_len);
SCM_API SCM scm_drain_input (SCM port);
SCM_API void scm_end_input (SCM port);

View file

@ -474,7 +474,7 @@ SCM_DEFINE (scm_get_bytevector_some, "get-bytevector-some", 1, 0, 0,
SCM_VALIDATE_BINARY_INPUT_PORT (1, port);
buf = scm_fill_input_unlocked (port);
buf = scm_fill_input (port);
size = scm_port_buffer_can_take (buf);
if (size == 0)
{

View file

@ -2073,7 +2073,7 @@ scm_i_scan_for_encoding (SCM port)
if (scm_port_buffer_can_take (buf) == 0)
{
/* We can use the read buffer, and thus avoid a seek. */
buf = scm_fill_input_unlocked (port);
buf = scm_fill_input (port);
bytes_read = scm_port_buffer_can_take (buf);
if (bytes_read > SCM_ENCODING_SEARCH_SIZE)
bytes_read = SCM_ENCODING_SEARCH_SIZE;