* ports.c (scm_flush_all_ports): new procedure, scsh compatible.
provide solutions to the problem of consistent access to data
structures.
+** A new procedure `flush-all-ports' is equivalent to running
+`force-output' on every port open for output.
+
\f
Changes in Guile 1.1 (Fri May 16 1997):
+Sat Jun 21 18:44:03 1997 Gary Houston <ghouston@actrix.gen.nz>
+
+ * ports.h: new prototype.
+ * ports.c (scm_flush_all_ports): new procedure, scsh compatible.
+
Sat Jun 21 00:25:03 1997 Jim Blandy <jimb@floss.red-bean.com>
Make things compile neatly under Sun's C compiler.
#include "fports.h"
#include "strports.h"
#include "vports.h"
+#include "kw.h"
#include "ports.h"
}
}
+SCM_PROC (s_flush_all_ports, "flush-all-ports", 0, 1, 0, scm_flush_all_ports);
+SCM
+scm_flush_all_ports (void)
+{
+ int i;
+
+ for (i = 0; i < scm_port_table_size; i++)
+ {
+ SCM port = scm_port_table[i]->port;
+ if (SCM_OPOUTPORTP (port))
+ {
+ scm_sizet ptob = SCM_PTOBNUM (port);
+ (scm_ptobs[ptob].fflush) (SCM_STREAM (port));
+ }
+ }
+ return SCM_UNSPECIFIED;
+}
SCM_PROC(s_read_char, "read-char", 0, 1, 0, scm_read_char);
#ifndef PORTSH
#define PORTSH
-/* Copyright (C) 1995,1996 Free Software Foundation, Inc.
+/* Copyright (C) 1995,1996,1997 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
extern SCM scm_output_port_p SCM_P ((SCM x));
extern SCM scm_eof_object_p SCM_P ((SCM x));
extern SCM scm_force_output SCM_P ((SCM port));
+extern SCM scm_flush_all_ports SCM_P ((void));
extern SCM scm_read_char SCM_P ((SCM port));
extern SCM scm_peek_char SCM_P ((SCM port));
extern SCM scm_unread_char SCM_P ((SCM cobj, SCM port));