--- ports.c 27 Jan 2007 10:51:48 +1100 1.204.2.14 +++ ports.c 21 Aug 2007 17:02:53 +1000 @@ -929,25 +929,26 @@ } #undef FUNC_NAME + +static void +scm_flush_all_ports_one (void *dummy, SCM port) +{ + if (SCM_OPOUTPORTP (port)) + scm_flush (port); +} + SCM_DEFINE (scm_flush_all_ports, "flush-all-ports", 0, 0, 0, (), "Equivalent to calling @code{force-output} on\n" "all open output ports. The return value is unspecified.") #define FUNC_NAME s_scm_flush_all_ports { - size_t i; - - scm_i_scm_pthread_mutex_lock (&scm_i_port_table_mutex); - for (i = 0; i < scm_i_port_table_size; i++) - { - if (SCM_OPOUTPORTP (scm_i_port_table[i]->port)) - scm_flush (scm_i_port_table[i]->port); - } - scm_i_pthread_mutex_unlock (&scm_i_port_table_mutex); + scm_c_port_for_each (scm_flush_all_ports_one); return SCM_UNSPECIFIED; } #undef FUNC_NAME + SCM_DEFINE (scm_read_char, "read-char", 0, 1, 0, (SCM port), "Return the next character available from @var{port}, updating\n"