1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-21 20:20:24 +02:00

Replaced "scm_t_portable" with "scm_port_table" which was an artifact

from the great "scm_*_t -> scm_t_" renaming.
This commit is contained in:
Marius Vollmer 2001-08-26 21:54:11 +00:00
parent 7e8ef316ad
commit f5fd8aa2a7
5 changed files with 38 additions and 38 deletions

View file

@ -209,9 +209,9 @@ scm_evict_ports (int fd)
{
long i;
for (i = 0; i < scm_t_portable_size; i++)
for (i = 0; i < scm_port_table_size; i++)
{
SCM port = scm_t_portable[i]->port;
SCM port = scm_port_table[i]->port;
if (SCM_FPORTP (port))
{

View file

@ -2821,9 +2821,9 @@ scm_init_storage ()
scm_c_hook_init (&scm_after_gc_c_hook, 0, SCM_C_HOOK_NORMAL);
/* Initialise the list of ports. */
scm_t_portable = (scm_t_port **)
malloc (sizeof (scm_t_port *) * scm_t_portable_room);
if (!scm_t_portable)
scm_port_table = (scm_t_port **)
malloc (sizeof (scm_t_port *) * scm_port_table_room);
if (!scm_port_table)
return 1;
#ifdef HAVE_ATEXIT

View file

@ -300,11 +300,11 @@ SCM_DEFINE (scm_fdes_to_ports, "fdes->ports", 1, 0, 0,
SCM_VALIDATE_INUM_COPY (1,fd,int_fd);
for (i = 0; i < scm_t_portable_size; i++)
for (i = 0; i < scm_port_table_size; i++)
{
if (SCM_OPFPORTP (scm_t_portable[i]->port)
&& ((scm_t_fport *) scm_t_portable[i]->stream)->fdes == int_fd)
result = scm_cons (scm_t_portable[i]->port, result);
if (SCM_OPFPORTP (scm_port_table[i]->port)
&& ((scm_t_fport *) scm_port_table[i]->stream)->fdes == int_fd)
result = scm_cons (scm_port_table[i]->port, result);
}
return result;
}

View file

@ -425,10 +425,10 @@ SCM_DEFINE (scm_set_current_error_port, "set-current-error-port", 1, 0, 0,
/* The port table --- an array of pointers to ports. */
scm_t_port **scm_t_portable;
scm_t_port **scm_port_table;
long scm_t_portable_size = 0; /* Number of ports in scm_t_portable. */
long scm_t_portable_room = 20; /* Size of the array. */
long scm_port_table_size = 0; /* Number of ports in scm_port_table. */
long scm_port_table_room = 20; /* Size of the array. */
/* Add a port to the table. */
@ -438,22 +438,22 @@ scm_add_to_port_table (SCM port)
{
scm_t_port *entry;
if (scm_t_portable_size == scm_t_portable_room)
if (scm_port_table_size == scm_port_table_room)
{
/* initial malloc is in gc.c. this doesn't use scm_must_malloc etc.,
since it can never be freed during gc. */
void *newt = realloc ((char *) scm_t_portable,
void *newt = realloc ((char *) scm_port_table,
(size_t) (sizeof (scm_t_port *)
* scm_t_portable_room * 2));
* scm_port_table_room * 2));
if (newt == NULL)
scm_memory_error ("scm_add_to_port_table");
scm_t_portable = (scm_t_port **) newt;
scm_t_portable_room *= 2;
scm_port_table = (scm_t_port **) newt;
scm_port_table_room *= 2;
}
entry = (scm_t_port *) scm_must_malloc (sizeof (scm_t_port), FUNC_NAME);
entry->port = port;
entry->entry = scm_t_portable_size;
entry->entry = scm_port_table_size;
entry->revealed = 0;
entry->stream = 0;
entry->file_name = SCM_BOOL_F;
@ -464,8 +464,8 @@ scm_add_to_port_table (SCM port)
entry->rw_active = SCM_PORT_NEITHER;
entry->rw_random = 0;
scm_t_portable[scm_t_portable_size] = entry;
scm_t_portable_size++;
scm_port_table[scm_port_table_size] = entry;
scm_port_table_size++;
return entry;
}
@ -480,20 +480,20 @@ scm_remove_from_port_table (SCM port)
scm_t_port *p = SCM_PTAB_ENTRY (port);
long i = p->entry;
if (i >= scm_t_portable_size)
if (i >= scm_port_table_size)
SCM_MISC_ERROR ("Port not in table: ~S", scm_list_1 (port));
if (p->putback_buf)
scm_must_free (p->putback_buf);
scm_must_free (p);
/* Since we have just freed slot i we can shrink the table by moving
the last entry to that slot... */
if (i < scm_t_portable_size - 1)
if (i < scm_port_table_size - 1)
{
scm_t_portable[i] = scm_t_portable[scm_t_portable_size - 1];
scm_t_portable[i]->entry = i;
scm_port_table[i] = scm_port_table[scm_port_table_size - 1];
scm_port_table[i]->entry = i;
}
SCM_SETPTAB_ENTRY (port, 0);
scm_t_portable_size--;
scm_port_table_size--;
}
#undef FUNC_NAME
@ -507,7 +507,7 @@ SCM_DEFINE (scm_pt_size, "pt-size", 0, 0, 0,
"is only included in @code{--enable-guile-debug} builds.")
#define FUNC_NAME s_scm_pt_size
{
return SCM_MAKINUM (scm_t_portable_size);
return SCM_MAKINUM (scm_port_table_size);
}
#undef FUNC_NAME
@ -520,10 +520,10 @@ SCM_DEFINE (scm_pt_member, "pt-member", 1, 0, 0,
{
long i;
SCM_VALIDATE_INUM_COPY (1,index,i);
if (i < 0 || i >= scm_t_portable_size)
if (i < 0 || i >= scm_port_table_size)
return SCM_BOOL_F;
else
return scm_t_portable[i]->port;
return scm_port_table[i]->port;
}
#undef FUNC_NAME
#endif
@ -728,8 +728,8 @@ SCM_DEFINE (scm_port_for_each, "port-for-each", 1, 0, 0,
SCM_DEFER_INTS;
scm_block_gc++;
ports = SCM_EOL;
for (i = 0; i < scm_t_portable_size; i++)
ports = scm_cons (scm_t_portable[i]->port, ports);
for (i = 0; i < scm_port_table_size; i++)
ports = scm_cons (scm_port_table[i]->port, ports);
scm_block_gc--;
SCM_ALLOW_INTS;
@ -757,9 +757,9 @@ SCM_DEFINE (scm_close_all_ports_except, "close-all-ports-except", 0, 0, 1,
{
long i = 0;
SCM_VALIDATE_REST_ARGUMENT (ports);
while (i < scm_t_portable_size)
while (i < scm_port_table_size)
{
SCM thisport = scm_t_portable[i]->port;
SCM thisport = scm_port_table[i]->port;
int found = 0;
SCM ports_ptr = ports;
@ -872,10 +872,10 @@ SCM_DEFINE (scm_flush_all_ports, "flush-all-ports", 0, 0, 0,
{
size_t i;
for (i = 0; i < scm_t_portable_size; i++)
for (i = 0; i < scm_port_table_size; i++)
{
if (SCM_OPOUTPORTP (scm_t_portable[i]->port))
scm_flush (scm_t_portable[i]->port);
if (SCM_OPOUTPORTP (scm_port_table[i]->port))
scm_flush (scm_port_table[i]->port);
}
return SCM_UNSPECIFIED;
}

View file

@ -130,8 +130,8 @@ typedef struct
size_t putback_buf_size; /* allocated size of putback_buf. */
} scm_t_port;
extern scm_t_port **scm_t_portable;
extern long scm_t_portable_size; /* Number of ports in scm_t_portable. */
extern scm_t_port **scm_port_table;
extern long scm_port_table_size; /* Number of ports in scm_port_table. */
#define SCM_READ_BUFFER_EMPTY_P(c_port) (c_port->read_pos >= c_port->read_end)
@ -219,7 +219,7 @@ typedef struct scm_t_ptob_descriptor
extern scm_t_ptob_descriptor *scm_ptobs;
extern long scm_numptob;
extern long scm_t_portable_room;
extern long scm_port_table_room;