summaryrefslogtreecommitdiff
path: root/textproc/ispell/files/patch-term.c
blob: 7f25ea9a1f3cd75a3779d8882fe0a518fe0eae9a (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
107
108
--- term.c.orig	2008-07-04 11:42:14.000000000 -0500
+++ term.c	2008-07-04 11:55:44.000000000 -0500
@@ -86,8 +86,12 @@
 #include "ispell.h"
 #include "proto.h"
 #include "msgs.h"
+#ifdef BSD4_4
+#define USG
+#endif
 #ifdef USG
-#include <termio.h>
+#include <unistd.h>
+#include <termios.h>
 #else
 #ifndef __DJGPP__
 #include <sgtty.h>
@@ -166,8 +170,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;
@@ -276,7 +280,7 @@
 	(void) fprintf (stderr, TERM_C_NO_BATCH);
 	exit (1);
 	}
-    (void) ioctl (0, TCGETA, (char *) &osbuf);
+    tcgetattr(STDIN_FILENO, &osbuf);
     termchanged = 1;
 
     sbuf = osbuf;
@@ -285,7 +289,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];
@@ -373,7 +377,7 @@
 	if (te)
 	    tputs (te, 1, iputch);
 #ifdef USG
-	(void) ioctl (0, TCSETAW, (char *) &osbuf);
+	tcsetattr(STDIN_FILENO, TCSANOW, &osbuf);
 #else
 	(void) ioctl (0, TIOCSETP, (char *) &osbuf);
 #ifdef TIOCSLTC
@@ -394,7 +398,7 @@
 	if (te)
 	    tputs (te, 1, iputch);
 #ifdef USG
-	(void) ioctl (0, TCSETAW, (char *) &osbuf);
+	tcsetattr(STDIN_FILENO, TCSANOW, &osbuf);
 #else
 	(void) ioctl (0, TIOCSETP, (char *) &osbuf);
 #ifdef TIOCSLTC
@@ -413,7 +417,7 @@
     if (termchanged)
 	{
 #ifdef USG
-	(void) ioctl (0, TCSETAW, (char *) &sbuf);
+	tcsetattr(STDIN_FILENO, TCSANOW, &sbuf);
 #else
 	(void) ioctl (0, TIOCSETP, (char *) &sbuf);
 #ifdef TIOCSLTC
@@ -481,7 +485,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
@@ -527,7 +531,7 @@
 #endif
 
 #ifdef USG
-    (void) ioctl (0, TCSETAW, (char *) &sbuf);
+    tcsetattr(STDIN_FILENO, TCSANOW, &sbuf);
 #else
     (void) ioctl (0, TIOCSETP, (char *) &sbuf);
 #ifdef TIOCSLTC
@@ -563,7 +567,7 @@
 #endif
 
 #ifdef USG
-    (void) ioctl (0, TCSETAW, (char *) &osbuf);
+    tcsetattr(STDIN_FILENO, TCSANOW, &osbuf);
 #else
     (void) ioctl (0, TIOCSETP, (char *) &osbuf);
 #ifdef TIOCSLTC
@@ -611,7 +615,7 @@
 #endif
 
 #ifdef USG
-    (void) ioctl (0, TCSETAW, (char *) &sbuf);
+    tcsetattr(STDIN_FILENO, TCSANOW, &sbuf);
 #else
     (void) ioctl (0, TIOCSETP, (char *) &sbuf);
 #ifdef TIOCSLTC