#include <string.h>
#include <errno.h>
#include <signal.h>
+#include <sys/time.h>
+#include <sys/types.h>
#include <unistd.h>
+/* On solaris, curses.h must come before both termios.h and term.h */
+#ifdef HAVE_CURSES_H
+#include <curses.h>
+#endif
#ifdef HAVE_TERMIOS_H
#include <termios.h>
#endif
#ifdef HAVE_TERM_H
#include <term.h>
#endif
+/* Needed for FIONREAD under solaris */
+#ifdef HAVE_SYS_FILIO_H
+#include <sys/filio.h>
+#endif
#ifndef PLATFORM_WIN32
#ifndef TIOCGWINSZ
#include <sys/ioctl.h>
static gboolean setup_finished;
static gboolean atexit_called;
static gchar *teardown_str;
-static struct termios initial_attr;
+#ifdef PLATFORM_WIN32
MonoBoolean
ves_icall_System_ConsoleDriver_Isatty (HANDLE handle)
{
MONO_ARCH_SAVE_REGS;
-#ifdef PLATFORM_WIN32
return (GetFileType (handle) == FILE_TYPE_CHAR);
+}
+
+MonoBoolean
+ves_icall_System_ConsoleDriver_SetEcho (MonoBoolean want_echo)
+{
+ return FALSE;
+}
+
+MonoBoolean
+ves_icall_System_ConsoleDriver_SetBreak (MonoBoolean want_break)
+{
+ return FALSE;
+}
+
+gint32
+ves_icall_System_ConsoleDriver_InternalKeyAvailable (gint32 timeout)
+{
+ return FALSE;
+}
+
+MonoBoolean
+ves_icall_System_ConsoleDriver_TtySetup (MonoString *teardown)
+{
+ return FALSE;
+}
+
#else
+static struct termios initial_attr;
+
+MonoBoolean
+ves_icall_System_ConsoleDriver_Isatty (HANDLE handle)
+{
+ MONO_ARCH_SAVE_REGS;
+
return isatty (GPOINTER_TO_INT (handle));
-#endif
}
static MonoBoolean
set_property (gint property, gboolean value)
{
-#ifdef PLATFORM_WIN32
- return FALSE;
-#else
struct termios attr;
gboolean callset = FALSE;
gboolean check;
return FALSE;
return TRUE;
-#endif
}
MonoBoolean
gint32
ves_icall_System_ConsoleDriver_InternalKeyAvailable (gint32 timeout)
{
-#ifdef PLATFORM_WIN32
- return FALSE;
-#else
fd_set rfds;
struct timeval tv;
struct timeval *tvptr;
}
return (ret > 0) ? ret : 0;
-#endif
}
static void
tty_teardown (void)
{
-#ifdef PLATFORM_WIN32
-#else
MONO_ARCH_SAVE_REGS;
if (!setup_finished)
tcflush (STDIN_FILENO, TCIFLUSH);
tcsetattr (STDIN_FILENO, TCSANOW, &initial_attr);
setup_finished = FALSE;
-#endif
}
MonoBoolean
ves_icall_System_ConsoleDriver_TtySetup (MonoString *teardown)
{
-#ifdef PLATFORM_WIN32
- return FALSE;
-#else
struct termios attr;
MONO_ARCH_SAVE_REGS;
}
return TRUE;
-#endif
}
+#endif