File: TTY.c

package info (click to toggle)
mlton 20061107-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 27,828 kB
  • ctags: 61,118
  • sloc: ansic: 11,446; makefile: 1,339; sh: 1,160; lisp: 900; pascal: 256; asm: 97
file content (87 lines) | stat: -rw-r--r-- 1,621 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#include "platform.h"

static struct termios termios;

Flag Posix_TTY_Termios_iflag () {
        return termios.c_iflag;
}

Flag Posix_TTY_Termios_oflag () {
        return termios.c_oflag;
}

Flag Posix_TTY_Termios_cflag () {
        return termios.c_cflag;
}

Flag Posix_TTY_Termios_lflag () {
        return termios.c_lflag;
}

Cstring Posix_TTY_Termios_cc () {
        return (Cstring)termios.c_cc;
}

Speed Posix_TTY_Termios_cfgetospeed () {
        return cfgetospeed (&termios);
}

Speed Posix_TTY_Termios_cfgetispeed () {
        return cfgetispeed (&termios);
}

void Posix_TTY_Termios_setiflag (Flag f) {
        termios.c_iflag = f;
}

void Posix_TTY_Termios_setoflag (Flag f) {
        termios.c_oflag = f;
}

void Posix_TTY_Termios_setcflag (Flag f) {
        termios.c_cflag = f;
}

void Posix_TTY_Termios_setlflag (Flag f) {
        termios.c_lflag = f;
}

Int Posix_TTY_Termios_setospeed (Speed s) {
        return cfsetospeed (&termios, s);
}

Int Posix_TTY_Termios_setispeed (Speed s) {
        return cfsetispeed (&termios, s);
}

Int Posix_TTY_drain (Fd f) {
        return tcdrain (f);
}

Int Posix_TTY_flow (Fd f, Int i) {
        return tcflow (f, i);
}

Int Posix_TTY_flush (Fd f, Int i) {
        return tcflush (f, i);
}

Int Posix_TTY_getattr (Fd f) {
        return tcgetattr (f, &termios);
}

Int Posix_TTY_getpgrp (Fd f) {
        return tcgetpgrp (f);
}

Int Posix_TTY_sendbreak (Fd f, Int i) {
        return tcsendbreak (f, i);
}

Int Posix_TTY_setattr (Fd f, Int i) {
        return tcsetattr (f, i, &termios);
}

Int Posix_TTY_setpgrp (Fd f, Pid p) {
        return tcsetpgrp (f, p);
}