* Fixed many tests for termio.h, termios.h, TIOCFLUSH, etc.
git-svn-id: svn://svn.zoy.org/elk/trunk@122 55e467fa-43c5-0310-a8a2-de718669efc6
This commit is contained in:
+12
-13
@@ -35,12 +35,14 @@
|
||||
#include <ctype.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#ifdef FLUSH_TIOCFLUSH
|
||||
# include <sys/ioctl.h>
|
||||
#else
|
||||
#ifdef FLUSH_TCFLSH
|
||||
# include <termio.h>
|
||||
#if defined(HAVE_TERMIO_H)
|
||||
# include <termio.h>
|
||||
#elif defined(HAVE_TERMIOS_H)
|
||||
# include <termios.h>
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_SYS_IOCTL_H)
|
||||
# include <sys/ioctl.h>
|
||||
#endif
|
||||
|
||||
#include "kernel.h"
|
||||
@@ -203,21 +205,18 @@ void Discard_Output (Object port) {
|
||||
if (PORT(port)->flags & P_STRING)
|
||||
return;
|
||||
f = PORT(port)->file;
|
||||
#ifdef FLUSH_FPURGE
|
||||
#if defined(HAVE_FPURGE)
|
||||
(void)fpurge (f);
|
||||
#else
|
||||
#ifdef FLUSH_BSD
|
||||
#elif defined(HAVE_BSD_FLUSH)
|
||||
f->_cnt = 0;
|
||||
f->_ptr = f->_base;
|
||||
#endif
|
||||
#endif
|
||||
#ifdef FLUSH_TIOCFLUSH
|
||||
|
||||
#if defined(TIOCFLUSH)
|
||||
(void)ioctl (fileno (f), TIOCFLUSH, (char *)0);
|
||||
#else
|
||||
#ifdef FLUSH_TCFLSH
|
||||
#elif defined(TCFLSH)
|
||||
(void)ioctl (fileno (f), TCFLSH, (char *)1);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
Object P_Flush_Output_Port (int argc, Object *argv) {
|
||||
|
||||
+13
-18
@@ -34,19 +34,17 @@
|
||||
#include <limits.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef FLUSH_TIOCFLUSH
|
||||
# include <sys/ioctl.h>
|
||||
#else
|
||||
#ifdef FLUSH_TCFLSH
|
||||
# include <termio.h>
|
||||
#endif
|
||||
#if defined(HAVE_TERMIO_H)
|
||||
# include <termio.h>
|
||||
#elif defined(HAVE_TERMIOS_H)
|
||||
# include <termios.h>
|
||||
#endif
|
||||
|
||||
#if defined(FIONREAD_IN_TERMIOS_H)
|
||||
# include <termios.h>
|
||||
#elif defined(FIONREAD_IN_SYS_IOCTL_H)
|
||||
#if defined(HAVE_SYS_IOCTL_H)
|
||||
# include <sys/ioctl.h>
|
||||
#elif defined(FIONREAD_IN_SYS_FILIO_H)
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_SYS_FILIO_H)
|
||||
# include <sys/filio.h>
|
||||
#endif
|
||||
|
||||
@@ -146,21 +144,18 @@ void Discard_Input (Object port) {
|
||||
if (PORT(port)->flags & P_STRING)
|
||||
return;
|
||||
f = PORT(port)->file;
|
||||
#ifdef FLUSH_FPURGE
|
||||
#if defined(HAVE_FPURGE)
|
||||
(void)fpurge (f);
|
||||
#else
|
||||
#ifdef FLUSH_BSD
|
||||
#elif defined(HAVE_BSD_FLUSH)
|
||||
f->_cnt = 0;
|
||||
f->_ptr = f->_base;
|
||||
#endif
|
||||
#endif
|
||||
#ifdef FLUSH_TIOCFLUSH
|
||||
|
||||
#if defined(TIOCFLUSH)
|
||||
(void)ioctl (fileno (f), TIOCFLUSH, (char *)0);
|
||||
#else
|
||||
#ifdef FLUSH_TCFLSH
|
||||
#elif defined(TCFLSH)
|
||||
(void)ioctl (fileno (f), TCFLSH, (char *)0);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
Object P_Unread_Char (int argc, Object *argv) {
|
||||
|
||||
Reference in New Issue
Block a user