Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-ports-kde
Path: blob/main/japanese/edict/files/patch-xjdfrontend.c
16461 views
1
--- xjdfrontend.c 1998-09-16 02:28:03.000000000 +0200
2
+++ xjdfrontend.c 2007-12-28 19:54:07.000000000 +0100
3
@@ -55,6 +55,8 @@
4
5
#ifdef __STRICT_BSD__
6
static struct sgttyb orig,new;
7
+#elif defined(__POSIX__)
8
+static struct termios orig,new;
9
#else
10
static struct termio orig,new;
11
#endif
12
@@ -240,6 +242,11 @@
13
ioctl(0, TIOCGETP, &orig); ioctl(0, TIOCGETP, &new);
14
new.sg_flags |= CBREAK; new.sg_flags &= ~ECHO;
15
ioctl(0, TIOCSETP, &new);
16
+#elif defined(__POSIX__)
17
+ tcgetattr(0, &orig); tcgetattr(0, &new);
18
+ new.c_lflag &= ~ICANON; new.c_lflag &= ~ISIG; new.c_lflag &= ~ECHO;
19
+ new.c_lflag &= ~IXON; new.c_cc[VMIN] = 1;
20
+ new.c_cc[4] = 1; new.c_cc[5] = 0; tcsetattr(0, TCSANOW, &new);
21
#else
22
ioctl(0, TCGETA, &orig); ioctl(0, TCGETA, &new);
23
new.c_lflag &= ~ICANON; new.c_lflag &= ~ISIG; new.c_lflag &= ~ECHO;
24
@@ -255,6 +262,8 @@
25
{
26
#ifdef __STRICT_BSD__
27
ioctl(0, TIOCSETP, &orig);
28
+#elif defined(__POSIX__)
29
+ tcsetattr(0, TCSANOW, &orig);
30
#else
31
ioctl(0, TCSETA, &orig);
32
#endif
33
34