summaryrefslogtreecommitdiff
path: root/innobase/os/os0trash.c
diff options
context:
space:
mode:
Diffstat (limited to 'innobase/os/os0trash.c')
-rw-r--r--innobase/os/os0trash.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/innobase/os/os0trash.c b/innobase/os/os0trash.c
new file mode 100644
index 00000000000..e896ac9f083
--- /dev/null
+++ b/innobase/os/os0trash.c
@@ -0,0 +1,43 @@
+/* Stores the old console mode when echo is turned off */
+ulint os_old_console_mode;
+
+/********************************************************************
+Turns off echo from console input. */
+
+void
+os_console_echo_off(void)
+/*=====================*/
+{
+ GetConsoleMode(stdio, &os_old_console_mode);
+ SetConsoleMode(stdio, ENABLE_PROCESSED_INPUT);
+}
+
+/********************************************************************
+Turns on echo in console input. */
+
+void
+os_console_echo_on(void)
+/*====================*/
+{
+ SetConsoleMode(stdio, &os_old_console_mode);
+}
+
+/********************************************************************
+Reads a character from the console. */
+
+char
+os_read_console(void)
+/*=================*/
+{
+ char input_char;
+ ulint n_chars;
+
+ n_chars = 0;
+
+ while (n_chars == 0) {
+ ReadConsole(stdio, &input_char, 1, &n_chars, NULL);
+ }
+
+ return(input_char);
+}
+