mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-19 18:20:22 +02:00
1999-08-04 Gary Houston <ghouston@easynet.co.uk>
* ports.c (scm_putc, scm_puts), * unif.c (scm_uniform_array_write): use scm_lfwrite. * ports.c (scm_putc): change type of first argument from int to char.
This commit is contained in:
parent
82cc1b112c
commit
265e6a4d28
4 changed files with 11 additions and 54 deletions
|
@ -1692,31 +1692,10 @@ loop:
|
|||
|
||||
if (SCM_NIMP (port_or_fd))
|
||||
{
|
||||
scm_port *pt = SCM_PTAB_ENTRY (port_or_fd);
|
||||
int remaining = (cend - offset) * sz;
|
||||
char *source = SCM_CHARS (v) + (cstart + offset) * sz;
|
||||
scm_ptob_descriptor *ptob = &scm_ptobs[SCM_PTOBNUM (port_or_fd)];
|
||||
|
||||
ans = cend - offset;
|
||||
if (pt->rw_active == SCM_PORT_READ)
|
||||
scm_read_flush (port_or_fd);
|
||||
|
||||
while (remaining > 0)
|
||||
{
|
||||
int to_copy = min (pt->write_end - pt->write_pos, remaining);
|
||||
|
||||
memcpy (pt->write_pos, source, to_copy);
|
||||
pt->write_pos += to_copy;
|
||||
source += to_copy;
|
||||
remaining -= to_copy;
|
||||
if (pt->write_pos == pt->write_end)
|
||||
ptob->fflush (port_or_fd);
|
||||
}
|
||||
|
||||
if (pt->rw_random)
|
||||
{
|
||||
pt->rw_active = SCM_PORT_WRITE;
|
||||
}
|
||||
scm_lfwrite (source, ans * sz, port_or_fd);
|
||||
}
|
||||
else /* file descriptor. */
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue