Changed the GDI driver interface to pass an opaque PHYSDEV pointer
[wine] / console / tty.c
1 /*
2  * Copyright 1999 - Joseph Pranevich
3  *
4  * This is the console driver for TTY-based consoles, i.e. consoles
5  * without cursor placement, etc. It's also a pretty decent starting
6  * point for other drivers.
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21  */
22
23 /* When creating new drivers, you need to assign all the functions that
24    that driver supports into the driver struct. If it is a supplementary
25    driver, it should make sure to perserve the old values. */
26
27 #include "config.h"
28
29 #include <stdio.h>
30
31 #include "console.h"
32 #include "windef.h"
33 void TTY_Start()
34 {
35    /* This should be the root driver so we can ignore anything
36       already in the struct. */
37
38    driver.norefresh = FALSE;
39
40    driver.write = TTY_Write;
41    driver.getKeystroke = TTY_GetKeystroke;
42 }
43
44 void TTY_Write(char output, int fg, int bg, int attribute)
45 {
46    /* We can discard all extended information. */
47    fprintf(driver.console_out, "%c", output);
48 }
49
50 void TTY_GetKeystroke(char *scan, char *ch)
51 {
52    /* All we have are character input things, nothing for extended */
53    /* This is just the TTY driver, after all. We'll cope. */
54    *ch = fgetc(driver.console_in);
55 }
56
57