summaryrefslogtreecommitdiff
path: root/textproc/ispell/files/patch-term.c
blob: 511cb4aa527245840be6734386ae2aa80fa0f5e4 (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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
--- term.c	Wed Jul 25 23:51:46 2001
+++ term.c	Fri Mar 16 10:52:35 2007
@@ -80,8 +80,10 @@
 #include "ispell.h"
 #include "proto.h"
 #include "msgs.h"
+#define USG
 #ifdef USG
-#include <termio.h>
+#include <unistd.h>
+#include <termios.h>
 #else
 #include <sgtty.h>
 #endif
@@ -152,8 +154,8 @@
     }
 
 #ifdef USG
-static struct termio	sbuf;
-static struct termio	osbuf;
+static struct termios	sbuf;
+static struct termios	osbuf;
 #else
 static struct sgttyb	sbuf;
 static struct sgttyb	osbuf;
@@ -263,7 +265,7 @@
 	(void) fprintf (stderr, TERM_C_NO_BATCH);
 	exit (1);
 	}
-    (void) ioctl (0, TCGETA, (char *) &osbuf);
+    tcgetattr(STDIN_FILENO, &osbuf);
     termchanged = 1;
 
     sbuf = osbuf;
@@ -272,7 +274,7 @@
     sbuf.c_iflag &= ~(INLCR | IGNCR | ICRNL);
     sbuf.c_cc[VMIN] = 1;
     sbuf.c_cc[VTIME] = 1;
-    (void) ioctl (0, TCSETAW, (char *) &sbuf);
+    tcsetattr(STDIN_FILENO, TCSANOW, &sbuf);
 
     uerasechar = osbuf.c_cc[VERASE];
     ukillchar = osbuf.c_cc[VKILL];
@@ -360,7 +362,7 @@
 	if (te)
 	    tputs (te, 1, putch);
 #ifdef USG
-	(void) ioctl (0, TCSETAW, (char *) &osbuf);
+	tcsetattr(STDIN_FILENO, TCSANOW, &osbuf);
 #else
 	(void) ioctl (0, TIOCSETP, (char *) &osbuf);
 #ifdef TIOCSLTC
@@ -376,7 +378,7 @@
     int		signo;
     {
 #ifdef USG
-    (void) ioctl (0, TCSETAW, (char *) &osbuf);
+    tcsetattr(STDIN_FILENO, TCSANOW, &osbuf);
 #else
     (void) ioctl (0, TIOCSETP, (char *) &osbuf);
 #ifdef TIOCSLTC
@@ -391,7 +393,7 @@
     /* stop here until continued */
     (void) signal (signo, onstop);
 #ifdef USG
-    (void) ioctl (0, TCSETAW, (char *) &sbuf);
+    tcsetattr(STDIN_FILENO, TCSANOW, &sbuf);
 #else
     (void) ioctl (0, TIOCSETP, (char *) &sbuf);
 #ifdef TIOCSLTC
@@ -451,7 +453,7 @@
     argv[i] = NULL;
 
 #ifdef USG
-    (void) ioctl (0, TCSETAW, (char *) &osbuf);
+    tcsetattr(STDIN_FILENO, TCSANOW, &osbuf);
 #else
     (void) ioctl (0, TIOCSETP, (char *) &osbuf);
 #ifdef TIOCSLTC
@@ -497,7 +499,7 @@
 #endif
 
 #ifdef USG
-    (void) ioctl (0, TCSETAW, (char *) &sbuf);
+    tcsetattr(STDIN_FILENO, TCSANOW, &sbuf);
 #else
     (void) ioctl (0, TIOCSETP, (char *) &sbuf);
 #ifdef TIOCSLTC
@@ -530,7 +532,7 @@
 #endif
 
 #ifdef USG
-    (void) ioctl (0, TCSETAW, (char *) &osbuf);
+    tcsetattr(STDIN_FILENO, TCSANOW, &osbuf);
 #else
     (void) ioctl (0, TIOCSETP, (char *) &osbuf);
 #ifdef TIOCSLTC
@@ -562,7 +564,7 @@
 #endif
 
 #ifdef USG
-    (void) ioctl (0, TCSETAW, (char *) &sbuf);
+    tcsetattr(STDIN_FILENO, TCSANOW, &sbuf);
 #else
     (void) ioctl (0, TIOCSETP, (char *) &sbuf);
 #ifdef TIOCSLTC