summaryrefslogtreecommitdiff
path: root/ReadKey.xs
diff options
context:
space:
mode:
authorJonathan Stowe <jns@gellyfish.co.uk>2005-01-12 01:16:52 -0800
committerMichael G. Schwern <schwern@pobox.com>2009-12-13 05:34:30 -0800
commit48d3a07e95d2d51214b57cefc4f1c589cf8defc6 (patch)
tree0153a1c263725ce684b55cfd52d59544edfc9f8e /ReadKey.xs
parenta4df36aa81163fc483c5f0cf120d6265139a7f01 (diff)
import TermReadKey 2.30 from CPAN
git-cpan-module: TermReadKey git-cpan-version: 2.30 git-cpan-authorid: JSTOWE git-cpan-file: authors/id/J/JS/JSTOWE/TermReadKey-2.30.tar.gz
Diffstat (limited to 'ReadKey.xs')
-rw-r--r--ReadKey.xs24
1 files changed, 16 insertions, 8 deletions
diff --git a/ReadKey.xs b/ReadKey.xs
index c0e3ebe..af54763 100644
--- a/ReadKey.xs
+++ b/ReadKey.xs
@@ -18,7 +18,7 @@
Maintained by Jonathan Stowe <jns@gellyfish.com>
- $Id: ReadKey.xs,v 1.8 2002/07/28 12:01:18 gellyfish Exp $
+ $Id: ReadKey.xs,v 2.22 2005/01/11 21:15:17 jonathan Exp $
Version 2.21, Sun Jul 28 12:57:56 BST 2002
Fix to improve the chances of automated testing succeeding
@@ -200,10 +200,13 @@
# define DONT_USE_SELECT
# define DONT_USE_POLL
-# define DONT_USE_TERMIO
+# define DONT_USE_TERMIOS
# define DONT_USE_SGTTY
-# define I_TERMIOS
-# define CC_TERMIOS
+# define I_TERMIO
+# define CC_TERMIO
+
+/* This flag should be off in the lflags when we enable termio mode */
+# define TRK_IDEFAULT IDEFAULT
# define INCL_SUB
# define INCL_DOS
@@ -348,6 +351,10 @@
# endif
#endif
+#ifndef TRK_IDEFAULT
+/* This flag should be off in the lflags when we enable termio mode */
+# define TRK_IDEFAULT 0
+#endif
/* Fix up the disappearance of the '_' macro in Perl 5.7.2 */
@@ -1117,7 +1124,7 @@ void ReadMode(PerlIO *file,int mode)
memcpy((void*)&work,(void*)&savebuf,sizeof(struct tbuffer));
work.c_lflag &= ~(ECHO | ISIG | ICANON | XCASE);
- work.c_lflag &= ~(ECHOE | ECHOK | ECHONL);
+ work.c_lflag &= ~(ECHOE | ECHOK | ECHONL | TRK_IDEFAULT);
work.c_iflag &= ~(IXON | IXOFF | IXANY | ICRNL | BRKINT);
if((work.c_cflag | PARENB)!=PARENB ) {
work.c_iflag &= ~(ISTRIP|INPCK);
@@ -1135,7 +1142,7 @@ void ReadMode(PerlIO *file,int mode)
memcpy((void*)&work,(void*)&savebuf,sizeof(struct tbuffer));
work.c_lflag &= ~(ECHO | ISIG | ICANON);
- work.c_lflag &= ~(ECHOE | ECHOK | ECHONL);
+ work.c_lflag &= ~(ECHOE | ECHOK | ECHONL TRK_IDEFAULT);
work.c_iflag = savebuf.c_iflag;
work.c_iflag &= ~(IXON | IXOFF | IXANY | BRKINT);
work.c_oflag = savebuf.c_oflag;
@@ -1149,7 +1156,7 @@ void ReadMode(PerlIO *file,int mode)
memcpy((void*)&work,(void*)&savebuf,sizeof(struct tbuffer));
work.c_lflag &= ~(ECHO | ICANON);
- work.c_lflag &= ~(ECHOE | ECHOK | ECHONL);
+ work.c_lflag &= ~(ECHOE | ECHOK | ECHONL | TRK_IDEFAULT);
work.c_lflag |= ISIG;
work.c_iflag = savebuf.c_iflag;
work.c_iflag &= ~(IXON | IXOFF | IXANY);
@@ -1166,7 +1173,7 @@ void ReadMode(PerlIO *file,int mode)
work.c_lflag |= (ISIG | ICANON);
work.c_lflag &= ~ECHO;
- work.c_lflag &= ~(ECHOE | ECHOK | ECHONL);
+ work.c_lflag &= ~(ECHOE | ECHOK | ECHONL | TRK_IDEFAULT);
work.c_iflag = savebuf.c_iflag;
work.c_iflag &= ~(IXON | IXOFF | IXANY);
work.c_iflag |= savebuf.c_iflag & (IXON|IXOFF|IXANY);
@@ -1190,6 +1197,7 @@ void ReadMode(PerlIO *file,int mode)
memcpy((void*)&work,(void*)&savebuf,sizeof(struct tbuffer));
work.c_lflag |= (ECHO | ISIG | ICANON);
+ work.c_iflag &= ~TRK_IDEFAULT;
work.c_iflag = savebuf.c_iflag;
work.c_iflag &= ~(IXON | IXOFF | IXANY);
work.c_iflag |= savebuf.c_iflag & (IXON|IXOFF|IXANY);