File: tty.c

package info (click to toggle)
wine 0.0.20000109-3
  • links: PTS
  • area: main
  • in suites: potato
  • size: 22,652 kB
  • ctags: 59,973
  • sloc: ansic: 342,054; perl: 3,697; yacc: 3,059; tcl: 2,647; makefile: 2,466; lex: 1,494; sh: 394
file content (41 lines) | stat: -rw-r--r-- 1,105 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/* tty.c */
/* Copyright 1999 - Joseph Pranevich */

/* This is the console driver for TTY-based consoles, i.e. consoles
   without cursor placement, etc. It's also a pretty decent starting
   point for other driers.
*/

/* When creating new drivers, you need to assign all the functions that
   that driver supports into the driver struct. If it is a supplementary
   driver, it should make sure to perserve the old values. */

#include <stdio.h>
#include "console.h"
#include "config.h"
#include "windef.h"
void TTY_Start()
{
   /* This should be the root driver so we can ignore anything
      already in the struct. */

   driver.norefresh = FALSE;

   driver.write = TTY_Write;
   driver.getKeystroke = TTY_GetKeystroke;
}

void TTY_Write(char output, int fg, int bg, int attribute)
{
   /* We can discard all extended information. */
   fprintf(driver.console_out, "%c", output);
}

void TTY_GetKeystroke(char *scan, char *ch)
{
   /* All we have are character input things, nothing for extended */
   /* This is just the TTY driver, after all. We'll cope. */
   *ch = fgetc(driver.console_in);
}