#include "libguile/iselect.h"
-scm_bits_t scm_tc16_fport;
+scm_t_bits scm_tc16_fport;
/* default buffer size, used if the O/S won't supply a value. */
scm_fport_buffer_add (SCM port, long read_size, int write_size)
#define FUNC_NAME "scm_fport_buffer_add"
{
- scm_fport_t *fp = SCM_FSTREAM (port);
- scm_port_t *pt = SCM_PTAB_ENTRY (port);
+ scm_t_fport *fp = SCM_FSTREAM (port);
+ scm_t_port *pt = SCM_PTAB_ENTRY (port);
if (read_size == -1 || write_size == -1)
{
{
int cmode;
long csize;
- scm_port_t *pt;
+ scm_t_port *pt;
port = SCM_COERCE_OUTPORT (port);
{
long i;
- for (i = 0; i < scm_port_table_size; i++)
+ for (i = 0; i < scm_t_portable_size; i++)
{
- SCM port = scm_port_table[i]->port;
+ SCM port = scm_t_portable[i]->port;
if (SCM_FPORTP (port))
{
- scm_fport_t *fp = SCM_FSTREAM (port);
+ scm_t_fport *fp = SCM_FSTREAM (port);
if (fp->fdes == fd)
{
{
long mode_bits = scm_mode_bits (mode);
SCM port;
- scm_port_t *pt;
+ scm_t_port *pt;
int flags;
/* test that fdes is valid. */
SCM_SET_CELL_TYPE (port, (scm_tc16_fport | mode_bits));
{
- scm_fport_t *fp
- = (scm_fport_t *) scm_must_malloc (sizeof (scm_fport_t),
+ scm_t_fport *fp
+ = (scm_t_fport *) scm_must_malloc (sizeof (scm_t_fport),
FUNC_NAME);
fp->fdes = fdes;
fport_fill_input (SCM port)
{
long count;
- scm_port_t *pt = SCM_PTAB_ENTRY (port);
- scm_fport_t *fp = SCM_FSTREAM (port);
+ scm_t_port *pt = SCM_PTAB_ENTRY (port);
+ scm_t_fport *fp = SCM_FSTREAM (port);
#ifdef GUILE_ISELECT
fport_wait_for_input (port);
static off_t
fport_seek (SCM port, off_t offset, int whence)
{
- scm_port_t *pt = SCM_PTAB_ENTRY (port);
- scm_fport_t *fp = SCM_FSTREAM (port);
+ scm_t_port *pt = SCM_PTAB_ENTRY (port);
+ scm_t_fport *fp = SCM_FSTREAM (port);
off_t rv;
off_t result;
static void
fport_truncate (SCM port, off_t length)
{
- scm_fport_t *fp = SCM_FSTREAM (port);
+ scm_t_fport *fp = SCM_FSTREAM (port);
if (ftruncate (fp->fdes, length) == -1)
scm_syserror ("ftruncate");
fport_write (SCM port, const void *data, size_t size)
{
/* this procedure tries to minimize the number of writes/flushes. */
- scm_port_t *pt = SCM_PTAB_ENTRY (port);
+ scm_t_port *pt = SCM_PTAB_ENTRY (port);
if (pt->write_buf == &pt->shortbuf
|| (pt->write_pos == pt->write_buf && size >= pt->write_buf_size))
static void
fport_flush (SCM port)
{
- scm_port_t *pt = SCM_PTAB_ENTRY (port);
- scm_fport_t *fp = SCM_FSTREAM (port);
+ scm_t_port *pt = SCM_PTAB_ENTRY (port);
+ scm_t_fport *fp = SCM_FSTREAM (port);
unsigned char *ptr = pt->write_buf;
long init_size = pt->write_pos - pt->write_buf;
long remaining = init_size;
static void
fport_end_input (SCM port, int offset)
{
- scm_fport_t *fp = SCM_FSTREAM (port);
- scm_port_t *pt = SCM_PTAB_ENTRY (port);
+ scm_t_fport *fp = SCM_FSTREAM (port);
+ scm_t_port *pt = SCM_PTAB_ENTRY (port);
offset += pt->read_end - pt->read_pos;
static int
fport_close (SCM port)
{
- scm_fport_t *fp = SCM_FSTREAM (port);
- scm_port_t *pt = SCM_PTAB_ENTRY (port);
+ scm_t_fport *fp = SCM_FSTREAM (port);
+ scm_t_port *pt = SCM_PTAB_ENTRY (port);
int rv;
fport_flush (port);
return 0;
}
-static scm_bits_t
+static scm_t_bits
scm_make_fptob ()
{
- scm_bits_t tc = scm_make_port_type ("file", fport_fill_input, fport_write);
+ scm_t_bits tc = scm_make_port_type ("file", fport_fill_input, fport_write);
scm_set_port_free (tc, fport_free);
scm_set_port_print (tc, fport_print);