summaryrefslogtreecommitdiff
path: root/readline
diff options
context:
space:
mode:
authorunknown <monty@donna.mysql.com>2000-11-28 04:47:47 +0200
committerunknown <monty@donna.mysql.com>2000-11-28 04:47:47 +0200
commit746f0b3b762f2a9d31347dfddf4b07a1621fc15b (patch)
treee3d40dd7c6a7e86bd2388da19d59d5a372bf7bb8 /readline
parent2700d28319bf29ee3957a357eaa102bcc72e1ac4 (diff)
downloadmariadb-git-746f0b3b762f2a9d31347dfddf4b07a1621fc15b.tar.gz
New thr_alarm struct for better integration with OS2
Run bootstrap in separate thread Fix bug in FLUSH TABLES table_name Docs/manual.texi: Updated ChangeLog client/mysql.cc: Added info about compressed protocol include/getopt.h: Fix for OS2 include/global.h: Fix for OS2 include/my_sys.h: Fix for OS2 include/mysql_com.h: Fix for OS2 include/thr_alarm.h: Cleanup up alarm struct for OS2 port isam/isamchk.c: Fix for OS2 libmysql/libmysql.c: cleanup libmysql/net.c: Use new thr_alarm libmysql/violite.c: Fix for OS2 myisam/ChangeLog: Changes myisam/mi_create.c: Use less stack myisam/myisamchk.c: Fix for OS2 mysys/default.c: Fix for OS2 mysys/getopt.c: Fix for OS2 mysys/mf_format.c: Safety mysys/mf_path.c: Fix for OS2 mysys/my_create.c: Fix for OS2 mysys/my_lock.c: Fix for OS2 mysys/my_open.c: Fix for OS2 mysys/thr_alarm.c: Use new thr_alarm struct readline/input.c: Fix for OS2 readline/rltty.c: Fix for OS2 sql/ha_myisam.cc: Remove unnecessary fn_format sql/my_lock.c: Use new thr_alarm sql/mysql_priv.h: Changed bootstrap to run in separate thread to avoid problem with small stack sql/mysqld.cc: Changed bootstrap to run in separate thread to avoid problem with small stack sql/net_serv.cc: Use new thr_alarm sql/sql_base.cc: Fix problem with FLUSH TABLE table_name sql/sql_class.cc: Fix for new bootstrap sql/sql_class.h: cleanup sql/sql_delete.cc: cleanup sql/sql_load.cc: Fix for OS2 sql/sql_parse.cc: Changed bootstrap to run in separate thread to avoid problem with small stack sql/sql_select.cc: Reset used structure elements sql/sql_table.cc: For OS2 sql/violite.c: For OS2
Diffstat (limited to 'readline')
-rw-r--r--readline/input.c100
-rw-r--r--readline/rltty.c7
2 files changed, 106 insertions, 1 deletions
diff --git a/readline/input.c b/readline/input.c
index 2813c1b9903..a9e5c9d143f 100644
--- a/readline/input.c
+++ b/readline/input.c
@@ -171,12 +171,23 @@ rl_unget_char (key)
return (0);
}
+#if defined(__EMX__)
+int waiting_char = -1;
+#endif
+
/* If a character is available to be read, then read it
and stuff it into IBUFFER. Otherwise, just return. */
static void
rl_gather_tyi ()
{
-#if defined (__GO32__)
+#if defined (__EMX__)
+ if (isatty (0) && (waiting_char = _read_kbd(0, 0, 0)) != -1 && ibuffer_space ())
+ {
+ int i;
+ i = (*rl_getc_function) (rl_instream);
+ rl_stuff_char (i);
+ }
+#elif defined (__GO32__)
char input;
if (isatty (0) && kbhit () && ibuffer_space ())
@@ -263,6 +274,10 @@ rl_gather_tyi ()
int
_rl_input_available ()
{
+#if defined (__EMX__)
+ if (isatty (0) && (waiting_char = _read_kbd(0, 0, 0)) != -1)
+ return 1;
+#else /* __EMX__ */
#if defined(HAVE_SELECT)
fd_set readfds, exceptfds;
struct timeval timeout;
@@ -288,6 +303,7 @@ _rl_input_available ()
if (ioctl (tty, FIONREAD, &chars_avail) == 0)
return (chars_avail);
#endif
+#endif /* !__EMX__ */
return 0;
}
@@ -397,6 +413,88 @@ rl_getc (stream)
int result, flags;
unsigned char c;
+#if defined (__EMX__)
+ if (isatty (0))
+ {
+ int key;
+
+ if (waiting_char != -1)
+ {
+ key = waiting_char;
+ waiting_char = -1;
+ }
+ else
+ {
+#ifdef __RSXNT__
+ pc_flush();
+#endif
+ key = _read_kbd(0, 1, 0);
+ }
+
+ while (key == 0)
+ {
+ key |= (_read_kbd(0, 1, 0) << 8);
+ /* printf("<%04X> ", key);
+ fflush(stdout); */
+
+ switch (key)
+ {
+ case 0x4B00: /* left arrow */
+ key = 'B' - 64;
+ break;
+ case 0x4D00: /* right arrow */
+ key = 'F' - 64;
+ break;
+ case 0x7300: /* ctrl left arrow */
+ key = 27;
+ waiting_char = 'B';
+ break;
+ case 0x7400: /* ctrl right arrow */
+ key = 27;
+ waiting_char = 'F';
+ break;
+ case 0x4800: /* up arrow */
+ key = 'P' - 64;
+ break;
+ case 0x5000: /* down arrow */
+ key = 'N' - 64;
+ break;
+ case 0x8D00: /* ctrl up arrow */
+ key = 'R' - 64;
+ break;
+ case 0x9100: /* ctrl down arrow */
+ key = 'S' - 64;
+ break;
+ case 0x4700: /* home key */
+ key = 'A' - 64;
+ break;
+ case 0x4F00: /* end key */
+ key = 'E' - 64;
+ break;
+ case 0x7700: /* ctrl home key */
+ key = 27;
+ waiting_char = '<';
+ break;
+ case 0x7500: /* ctrl end key */
+ key = 27;
+ waiting_char = '>';
+ break;
+ case 0x5300: /* delete key */
+ key = 'D' - 64;
+ break;
+ case 0x5200: /* insert key */
+ key = 'V' - 64;
+ break;
+ default: /* ignore all other special keys, read next */
+ key = _read_kbd(0, 1, 0);
+ break;
+ }
+ }
+
+ return (key & 0xFF);
+ }
+#endif /* __EMX__ */
+
#if defined (__GO32__)
if (isatty (0))
return (getkey () & 0x7F);
diff --git a/readline/rltty.c b/readline/rltty.c
index a5ef938b5c0..b4d0cf127d5 100644
--- a/readline/rltty.c
+++ b/readline/rltty.c
@@ -156,6 +156,13 @@ set_winsize (tty)
if (ioctl (tty, TIOCGWINSZ, &w) == 0)
(void) ioctl (tty, TIOCSWINSZ, &w);
}
+#else
+static void
+set_winsize (tty)
+ int tty;
+{
+// dummy function, required by other code. What should be doing?
+}
#endif /* TIOCGWINSZ */
#if defined (NEW_TTY_DRIVER)