aboutsummaryrefslogtreecommitdiffstats
path: root/vietnamese/vnless/files/patch-screen.c
blob: af08d69013c97c3c1abe4f833a2e0f7de653416b (plain) (blame)
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
--- screen.c.orig   Mon Feb 24 12:45:41 1992
+++ screen.c    Sat May 20 01:40:56 2000
@@ -12,7 +12,7 @@
 #endif
 
 #if TERMIO
-#include <termio.h>
+#include <termios.h>
 #else
 #include <sgtty.h>
 #endif
@@ -92,21 +92,21 @@
    int on;
 {
 #if TERMIO
-   struct termio s;
-   static struct termio save_term;
+   struct termios s;
+   static struct termios save_term;
 
    if (on)
    {
        /*
         * Get terminal modes.
         */
-       ioctl(2, TCGETA, &s);
+       tcgetattr(2, &s);
 
        /*
         * Save modes and set certain variables dependent on modes.
         */
        save_term = s;
-       ospeed = s.c_cflag & CBAUD;
+       ospeed = cfgetospeed(&s);
        erase_char = s.c_cc[VERASE];
        kill_char = s.c_cc[VKILL];
 
@@ -114,7 +114,7 @@
         * Set the modes to the way we want them.
         */
        s.c_lflag &= ~(ICANON|ECHO|ECHOE|ECHOK|ECHONL);
-       s.c_oflag |=  (OPOST|ONLCR|TAB3);
+       s.c_oflag |=  (OPOST|ONLCR|OXTABS);
        s.c_oflag &= ~(OCRNL|ONOCR|ONLRET);
        s.c_cc[VMIN] = 1;
        s.c_cc[VTIME] = 0;
@@ -125,7 +125,7 @@
         */
        s = save_term;
    }
-   ioctl(2, TCSETAW, &s);
+   tcsetattr(2, TCSANOW, &s);
 #else
    struct sgttyb s;
    static struct sgttyb save_term;
@@ -480,7 +480,7 @@
  * Clear the screen.
  */
    public void
-clear()
+clearscr()
 {
    tputs(sc_clear, sc_height, putchr);
 }