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

* ports.h: new prototype.

* ports.c (scm_flush_all_ports): new procedure, scsh compatible.
This commit is contained in:
Gary Houston 1997-06-21 18:46:27 +00:00
parent 91529b1de0
commit 89ea5b7cdf
4 changed files with 28 additions and 1 deletions

3
NEWS
View file

@ -196,6 +196,9 @@ facility. Maybe this is not needed, since the thread support may
provide solutions to the problem of consistent access to data provide solutions to the problem of consistent access to data
structures. structures.
** A new procedure `flush-all-ports' is equivalent to running
`force-output' on every port open for output.
Changes in Guile 1.1 (Fri May 16 1997): Changes in Guile 1.1 (Fri May 16 1997):

View file

@ -1,3 +1,8 @@
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> Sat Jun 21 00:25:03 1997 Jim Blandy <jimb@floss.red-bean.com>
Make things compile neatly under Sun's C compiler. Make things compile neatly under Sun's C compiler.

View file

@ -49,6 +49,7 @@
#include "fports.h" #include "fports.h"
#include "strports.h" #include "strports.h"
#include "vports.h" #include "vports.h"
#include "kw.h"
#include "ports.h" #include "ports.h"
@ -456,6 +457,23 @@ scm_force_output (port)
} }
} }
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); SCM_PROC(s_read_char, "read-char", 0, 1, 0, scm_read_char);

View file

@ -2,7 +2,7 @@
#ifndef PORTSH #ifndef PORTSH
#define 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 * 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 * it under the terms of the GNU General Public License as published by
@ -183,6 +183,7 @@ extern SCM scm_input_port_p SCM_P ((SCM x));
extern SCM scm_output_port_p SCM_P ((SCM x)); extern SCM scm_output_port_p SCM_P ((SCM x));
extern SCM scm_eof_object_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_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_read_char SCM_P ((SCM port));
extern SCM scm_peek_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)); extern SCM scm_unread_char SCM_P ((SCM cobj, SCM port));