summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/perl/cpan
diff options
context:
space:
mode:
authorafresh1 <afresh1@openbsd.org>2020-03-06 01:16:16 +0000
committerafresh1 <afresh1@openbsd.org>2020-03-06 01:16:16 +0000
commit99fd087599a8791921855f21bd7e36130f39aadc (patch)
treef99f083abb78e6c47d5ed6d9c2355c30716209bf /gnu/usr.bin/perl/cpan
parentamdgpu/gmc_v9: save/restore sdpif regs during S3 (diff)
downloadwireguard-openbsd-99fd087599a8791921855f21bd7e36130f39aadc.tar.xz
wireguard-openbsd-99fd087599a8791921855f21bd7e36130f39aadc.zip
Update perl Term::ReadKey to 2.38
ok bluhm@
Diffstat (limited to 'gnu/usr.bin/perl/cpan')
-rw-r--r--gnu/usr.bin/perl/cpan/Term-ReadKey/Changes251
-rw-r--r--gnu/usr.bin/perl/cpan/Term-ReadKey/Configure.pm139
-rw-r--r--gnu/usr.bin/perl/cpan/Term-ReadKey/MANIFEST5
-rw-r--r--gnu/usr.bin/perl/cpan/Term-ReadKey/MANIFEST.SKIP1
-rw-r--r--gnu/usr.bin/perl/cpan/Term-ReadKey/META.json26
-rw-r--r--gnu/usr.bin/perl/cpan/Term-ReadKey/META.yml21
-rw-r--r--gnu/usr.bin/perl/cpan/Term-ReadKey/Makefile.PL107
-rw-r--r--gnu/usr.bin/perl/cpan/Term-ReadKey/README4
-rw-r--r--gnu/usr.bin/perl/cpan/Term-ReadKey/ReadKey.pm.PL (renamed from gnu/usr.bin/perl/cpan/Term-ReadKey/ReadKey.pm)495
-rw-r--r--gnu/usr.bin/perl/cpan/Term-ReadKey/ReadKey.xs119
-rw-r--r--gnu/usr.bin/perl/cpan/Term-ReadKey/SIGNATURE41
-rw-r--r--gnu/usr.bin/perl/cpan/Term-ReadKey/example/test.pl3
-rw-r--r--gnu/usr.bin/perl/cpan/Term-ReadKey/genchars.pl69
-rw-r--r--gnu/usr.bin/perl/cpan/Term-ReadKey/t/02_terminal_functions.t26
14 files changed, 703 insertions, 604 deletions
diff --git a/gnu/usr.bin/perl/cpan/Term-ReadKey/Changes b/gnu/usr.bin/perl/cpan/Term-ReadKey/Changes
index 6372ca39004..329cf9e862c 100644
--- a/gnu/usr.bin/perl/cpan/Term-ReadKey/Changes
+++ b/gnu/usr.bin/perl/cpan/Term-ReadKey/Changes
@@ -1,240 +1,123 @@
-2015-06-04 Jonathan Stowe <jns+git@gellyfish.co.uk>
+2.38 - 2019-01-05
+ * Bundle up various changes including:
+ * Indexing improvements
+ * Makefile improvements for some make utils
+ * Various code cleanups and modernizations
- * .gitignore, Changes, META.yml, README, ReadKey.pm: Up version
+2.37 - 2016-10-07
-2015-06-04 Jonathan Stowe <jns+git@gellyfish.co.uk>
+ * Make minimum version of ExtUtils::MakeMaker 6.58
+ * Better support parallel builds by making 'dynamic' a dependency of the ReadKey.pm
+ * Add a 'provides' META section to help indexing
- * .gitignore: Add .bs file to .gitignore
+2.36 - 2016-10-07
-2015-06-04 Jonathan Stowe <jns@gellyfish.co.uk>
+ * Add a package declaration to the ReadKey_pm.PL to aid indexing
- * : Merge pull request #6 from ntyni/master Make genchars.pl output reproducible by sorting hash keys
+2.35 - 2016-10-06
-2015-04-30 Jonathan Stowe <jns+git@gellyfish.co.uk>
+ * Use FULLPERLRUNINST to run the ReadKey_pm.PL to get the 'blib'
- * Makefile.PL: Fix for "[rt.cpan.org #100932] Parallel build fails"
- from Petr Pisar
+2.34 - 2016-10-06
-2015-04-30 Jonathan Stowe <jns+git@gellyfish.co.uk>
+ * Fix GetTerminalSize() argument handling
+ * Fix miniperl build on Win32
+ * Remove unused Cwd
+ * Fix TAP output
+ * Fix warnings in XS file
+ * Don't attempt some tests if STDIN is not a terminal
+ * Generate ReadKey.pm from ReadKey_pm.PL to expand blockoptions
+ * demand-load Carp,
+ * remove unneeded AutoLoader,
+ * Improve genchars.pl, support make -s silence.
+ * Improve Makefile.PL add SIGN, fix pure_site_install, support dual-life, fix realclean
- * MANIFEST.SKIP: Add .git directory to the MANIFEST.SKIP
+2.33 - 2015-06-04
-2015-04-13 Jonathan Stowe <jns+git@gellyfish.co.uk>
+ * Make genchars.pl output reproducible by sorting hash keys
+ * Fix for "[rt.cpan.org #100932] Parallel build fails" from Petr Pisar
+ * Move tests to t directory from Sébastien Deseille <sebastien.deseille@gmail.com>
+ * Move original test to example directory
+ * Don't use 'resize' or 'stty' on MS Windows
- * MANIFEST, MANIFEST.SKIP: Add new artefacts
-
-2015-04-13 Jonathan Stowe <jns+git@gellyfish.co.uk>
-
- * .travis.yml: Add travis-ci testing
-
-2015-04-13 Jonathan Stowe <jns+git@gellyfish.co.uk>
-
- * .gitignore: Add .gitignore
-
-2015-04-13 Jonathan Stowe <jns@gellyfish.co.uk>
-
- * : Merge pull request #5 from
- sdeseille/Create_T_directory_and_split_test.pl Create t directory and split test.pl
-
-2015-04-11 Sébastien Deseille <sebastien.deseille@gmail.com>
-
- * README: Update README to reflect the move of test.pl in example
- subdirectory
-
-2015-04-11 Sébastien Deseille <sebastien.deseille@gmail.com>
-
- * README: Revert "Update README to reflect the move of test.pl in
- example subdirectory" This reverts commit 09402dcd68d8d0417e0eb2f9ea0aeaf4b4c72e9a.
-
-2015-04-11 Sébastien Deseille <sebastien.deseille@gmail.com>
-
- * README: Update README to reflect the move of test.pl in example
- subdirectory
-
-2015-04-11 Sébastien Deseille <sebastien.deseille@gmail.com>
-
- * example/test.pl, test.pl: Move test.pl in example's subdirectory
- in order to keep the possibility to use its interactive mode
-
-2015-04-11 Sébastien Deseille <sebastien.deseille@gmail.com>
-
- * t/02_terminal_functions.t: Finished to implement all tests from
- test.pl
-
-2015-04-11 Sébastien Deseille <sebastien.deseille@gmail.com>
-
- * t/02_terminal_functions.t: Add test to Check TerminalSize OUT
-
-2015-04-11 Sébastien Deseille <sebastien.deseille@gmail.com>
-
- * t/02_terminal_functions.t: Add test to Check non-blocking read
-
-2015-04-10 Sébastien Deseille <sebastien.deseille@gmail.com>
-
- * t/02_terminal_functions.t: Add second test about Comparing
- TerminalSize
-
-2015-04-10 Sébastien Deseille <sebastien.deseille@gmail.com>
-
- * t/01_basic.t: Add first test to validate module loading
-
-2015-04-03 Jonathan Stowe <jns@gellyfish.co.uk>
-
- * : Merge pull request #3 from kmx/master no resize, no stty on MS Windows
-
-2014-05-10 Jonathan Stowe <jns+git@gellyfish.co.uk>
-
- * Changes: Update changes with git2cl (some manual reordering)
-
-2014-05-10 Jonathan Stowe <jns+git@gellyfish.co.uk>
+2.32 - 2014-05-10
* Makefile.PL: Makefile.PL more specific
+ * Fix some warnings
+ * Don't index Configure.pm
+ * POD fixes
+ * Change licensing to optional Artistic
-2014-05-10 Jonathan Stowe <jns+git@gellyfish.co.uk>
-
- * : Merge pull request #2 from jacquesg/warnings Fix some warnings
-
-2014-03-09 Jonathan Stowe <jns+git@gellyfish.co.uk>
-
- * Configure.pm, META.yml, Makefile.PL: Don't index Configure.pm
-
-2014-03-03 Jonathan Stowe <jns+git@gellyfish.co.uk>
-
- * Changes, README, ReadKey.pm: Added documentation patch as per
- Chris Marshall Bumped version
+2.31 - 2013-10-26
+
+ * Update pport.h
+ * Added additional metadata to Makefile.PL
-2013-10-28 Jonathan Stowe <jns+git@gellyfish.co.uk>
+2.30.02 - 2011-02-07
- * README: Some changes to README
+2.30.01 - 2008-06-24
-2013-10-28 Brian Wightman <MidLifeXis@wightmanfam.org>
+2.30 - 2005-01-12
- * ReadKey.pm: Promote SUPPORT and LICENSE to top-level head sections SUPPORT and LICENSE sections were in item sections, but outside of
- an over/back block.
-
-2013-10-27 Jonathan Stowe <jns@gellyfish.co.uk>
-
- * Makefile.PL, README, ReadKey.pm, ReadKey.xs, genchars.pl: Change
- licensing Fix some warnings
-
-2013-10-26 Jonathan Stowe <jns@gellyfish.co.uk>
-
- * ReadKey.pm: Applied patch from rt #35669
-
-2013-10-26 Jonathan Stowe <jns@gellyfish.co.uk>
-
- * Makefile.PL, ReadKey.xs: Applied change from rt #26235 Also fixed
- repo name
-
-2013-10-26 Jonathan Stowe <jns@gellyfish.co.uk>
-
- * ReadKey.pm: Patch from rt #35671
-
-2013-10-26 Jonathan Stowe <jns@gellyfish.co.uk>
-
- * ppport.h: Updated ppport.h as per #78831
-
-2013-10-26 Jonathan Stowe <jns@gellyfish.co.uk>
-
- * Makefile.PL: Changed distname per RT #87885 Added additional
- metadata
-
-2013-10-26 Jonathan Stowe <jns@gellyfish.co.uk>
-
- * ReadKey.pm: Added changes for RT #86584
-
-2013-10-26 Jonathan Stowe <jns@gellyfish.co.uk>
-
- * ReadKey.pm: Added patch from jpeacock@cpan.org for RT #88266
-
-2011-04-19 Jonathan Stowe <jns@gellyfish.co.uk>
-
- * Changes: Added Changes
-
-2011-04-19 Jonathan Stowe <jns@gellyfish.co.uk>
-
- * : commit 40ba6a2a80ae495b921ab416f6b024014daac25e Author: Stas
- Grabois <CENSORED> Date: Tue Jun 24 01:57:37 2008 -0800
-
-2006-01-13 jonathan <jonathan@d4a3e428-c23c-0410-a93a-b1ce904c0fb3>
-
- * MANIFEST, Makefile.PL: Added Changes git-svn-id: http://jstowe.googlecode.com/svn/trunk/TermReadKey@74
- d4a3e428-c23c-0410-a93a-b1ce904c0fb3
-
-2005-01-11 jonathan <jonathan@d4a3e428-c23c-0410-a93a-b1ce904c0fb3>
-
- * test.pl: Skip tests if /dev/tty for automated testing git-svn-id: http://jstowe.googlecode.com/svn/trunk/TermReadKey@53
- d4a3e428-c23c-0410-a93a-b1ce904c0fb3
-
-2005-01-11 jonathan <jonathan@d4a3e428-c23c-0410-a93a-b1ce904c0fb3>
-
- * ReadKey.pm: Fixed POD git-svn-id: http://jstowe.googlecode.com/svn/trunk/TermReadKey@52
- d4a3e428-c23c-0410-a93a-b1ce904c0fb3
-
-2005-01-11 jonathan <jonathan@d4a3e428-c23c-0410-a93a-b1ce904c0fb3>
-
- * README, ReadKey.pm, ReadKey.xs, genchars.pl, ppport.h: * Updated ppport.h * Fixed example in synopsis * termio branch not updated git-svn-id: http://jstowe.googlecode.com/svn/trunk/TermReadKey@51
- d4a3e428-c23c-0410-a93a-b1ce904c0fb3
-
-2004-03-02 jonathan <jonathan@d4a3e428-c23c-0410-a93a-b1ce904c0fb3>
-
- * Put back in CVS git-svn-id: http://jstowe.googlecode.com/svn/trunk/TermReadKey@19
- d4a3e428-c23c-0410-a93a-b1ce904c0fb3
-
-2005-01-12 Jonathan Stowe <jns@gellyfish.co.uk>
-
- * Configure.pm, MANIFEST, META.yml, Makefile.PL, README,
- ReadKey.pm, ReadKey.xs, genchars.pl, ppport.h, test.pl: 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
+ * Skip tests if /dev/tty for automated testing
+ * Fixed POD
+ * Fixed example in synopsis
+ * Update ppport.h
-2002-07-28 Jonathan Stowe <jns@gellyfish.co.uk>
+2.21 - 2002-07-28
+ 2002-07-28 Jonathan Stowe <jns@gellyfish.co.uk>
* README, ReadKey.pm, ReadKey.xs, ppport.h, test.pl: import
TermReadKey 2.21 from CPAN git-cpan-module: TermReadKey git-cpan-version: 2.21
git-cpan-authorid: JSTOWE git-cpan-file:
authors/id/J/JS/JSTOWE/TermReadKey-2.21.tar.gz
-2002-05-24 Jonathan Stowe <jns@gellyfish.co.uk>
+2.20 - 2002-05-24
+ 2002-05-24 Jonathan Stowe <jns@gellyfish.co.uk>
* README, ReadKey.pm, ReadKey.xs: import TermReadKey 2.20 from CPAN git-cpan-module: TermReadKey git-cpan-version: 2.20
git-cpan-authorid: JSTOWE git-cpan-file:
authors/id/J/JS/JSTOWE/TermReadKey-2.20.tar.gz
-2002-03-21 Jonathan Stowe <jns@gellyfish.co.uk>
+2.19 - 2002-03-21
+ 2002-03-21 Jonathan Stowe <jns@gellyfish.co.uk>
* README, ReadKey.pm, ReadKey.xs: import TermReadKey 2.19 from CPAN git-cpan-module: TermReadKey git-cpan-version: 2.19
git-cpan-authorid: JSTOWE git-cpan-file:
authors/id/J/JS/JSTOWE/TermReadKey-2.19.tar.gz
-2002-02-10 Jonathan Stowe <jns@gellyfish.co.uk>
+2.18 - 2002-02-10
+ 2002-02-10 Jonathan Stowe <jns@gellyfish.co.uk>
* Configure.pm, Makefile.PL, README, ReadKey.pm, ReadKey.xs,
genchars.pl: import TermReadKey 2.18 from CPAN git-cpan-module: TermReadKey git-cpan-version: 2.18
git-cpan-authorid: JSTOWE git-cpan-file:
authors/id/J/JS/JSTOWE/TermReadKey-2.18.tar.gz
-2002-01-25 Jonathan Stowe <jns@gellyfish.co.uk>
+2.17 - 2002-01-25
+ 2002-01-25 Jonathan Stowe <jns@gellyfish.co.uk>
* Makefile.PL, README, ReadKey.pm, ReadKey.xs, test.pl: import
TermReadKey 2.17 from CPAN git-cpan-module: TermReadKey git-cpan-version: 2.17
git-cpan-authorid: JSTOWE git-cpan-file:
authors/id/J/JS/JSTOWE/TermReadKey-2.17.tar.gz
-2001-11-29 Jonathan Stowe <jns@gellyfish.co.uk>
+2.16 - 2001-11-29
+ 2001-11-29 Jonathan Stowe <jns@gellyfish.co.uk>
* ReadKey.pm, ReadKey.xs, genchars.pl, ppport.h: import TermReadKey
2.16 from CPAN git-cpan-module: TermReadKey git-cpan-version: 2.16
git-cpan-authorid: JSTOWE git-cpan-file:
authors/id/J/JS/JSTOWE/TermReadKey-2.16.tar.gz
-2001-11-07 Jonathan Stowe <jns@gellyfish.co.uk>
+2.15 - 2001-11-07
+ 2001-11-07 Jonathan Stowe <jns@gellyfish.co.uk>
* ReadKey.pm, ReadKey.xs: import TermReadKey 2.15 from CPAN git-cpan-module: TermReadKey git-cpan-version: 2.15
git-cpan-authorid: JSTOWE git-cpan-file:
authors/id/J/JS/JSTOWE/TermReadKey-2.15.tar.gz
+2.14 - 1999-03-29
1999-03-29 Kenneth Albanowski <kjahds@kjahds.com>
* Makefile.PL, ReadKey.pm, ReadKey.xs, ppport.h: import TermReadKey
@@ -242,6 +125,7 @@
git-cpan-authorid: KJALB git-cpan-file:
authors/id/K/KJ/KJALB/TermReadKey-2.14.tar.gz
+2.13 - 1999-03-24
1999-03-24 Kenneth Albanowski <kjahds@kjahds.com>
* MANIFEST, Makefile.PL, README, ReadKey.pm, ReadKey.xs,
@@ -249,6 +133,7 @@
git-cpan-authorid: KJALB git-cpan-file:
authors/id/K/KJ/KJALB/TermReadKey-2.13.tar.gz
+2.12 - 1998-01-07
1998-01-07 Kenneth Albanowski <kjahds@kjahds.com>
* Makefile.PL, README, ReadKey.pm, ReadKey.xs, test.pl: import
@@ -256,6 +141,7 @@
git-cpan-authorid: KJALB git-cpan-file:
authors/id/K/KJ/KJALB/TermReadKey-2.12.tar.gz
+2.11 - 1997-12-14
1997-12-13 Kenneth Albanowski <kjahds@kjahds.com>
* Makefile.PL, README, ReadKey.pm, ReadKey.xs, test.pl: import
@@ -263,6 +149,7 @@
git-cpan-authorid: KJALB git-cpan-file:
authors/id/K/KJ/KJALB/TermReadKey-2.11.tar.gz
+2.09 - 1997-10-07
1997-10-07 Kenneth Albanowski <kjahds@kjahds.com>
* Makefile.PL, ReadKey.pm, ReadKey.xs, genchars.pl: import
@@ -270,6 +157,7 @@
git-cpan-authorid: KJALB git-cpan-file:
authors/id/K/KJ/KJALB/TermReadKey-2.09.tar.gz
+2.08 - 1997-10-06
1997-10-06 Kenneth Albanowski <kjahds@kjahds.com>
* Makefile.PL, README, ReadKey.pm, ReadKey.xs: import TermReadKey
@@ -277,6 +165,7 @@
git-cpan-authorid: KJALB git-cpan-file:
authors/id/K/KJ/KJALB/TermReadKey-2.08.tar.gz
+2.07 - 1997-01-27
1997-01-27 Kenneth Albanowski <kjahds@kjahds.com>
* Makefile.PL, ReadKey.pm, ReadKey.xs: import TermReadKey 2.07 from
@@ -284,6 +173,7 @@
git-cpan-authorid: KJALB git-cpan-file:
authors/id/K/KJ/KJALB/TermReadKey-2.07.tar.gz
+2.06 - 1996-11-26
1996-11-25 Kenneth Albanowski <kjahds@kjahds.com>
* Makefile.PL, README, ReadKey.pm, ReadKey.xs, test.pl: import
@@ -291,6 +181,7 @@
git-cpan-authorid: KJALB git-cpan-file:
authors/id/K/KJ/KJALB/TermReadKey-2.06.tar.gz
+2.05 - 1996-03-14
1996-03-14 Kenneth Albanowski <kjahds@kjahds.com>
* Makefile.PL, README, ReadKey.pm, ReadKey.xs: import TermReadKey
@@ -298,12 +189,14 @@
git-cpan-authorid: KJALB git-cpan-file:
authors/id/K/KJ/KJALB/TermReadKey-2.05.tar.gz
+2.04 - 1995-10-11
1995-10-11 Kenneth Albanowski <kjahds@kjahds.com>
* Makefile.PL, README, ReadKey.xs: import TermReadKey 2.04 from CPAN git-cpan-module: TermReadKey git-cpan-version: 2.04
git-cpan-authorid: KJALB git-cpan-file:
authors/id/K/KJ/KJALB/TermReadKey-2.04.tar.gz
+2.03 - 1995-09-29
1995-09-29 Kenneth Albanowski <kjahds@kjahds.com>
* Configure.pm, MANIFEST, Makefile.PL, README, ReadKey.pm,
diff --git a/gnu/usr.bin/perl/cpan/Term-ReadKey/Configure.pm b/gnu/usr.bin/perl/cpan/Term-ReadKey/Configure.pm
index 8ae97e2285c..aabf136756f 100644
--- a/gnu/usr.bin/perl/cpan/Term-ReadKey/Configure.pm
+++ b/gnu/usr.bin/perl/cpan/Term-ReadKey/Configure.pm
@@ -8,7 +8,7 @@
# merging into the original, please contact me at kjahds@kjahds.com or
# CIS:70705,126
#
-# $Id: Configure.pm,v 1.3 2016/07/03 01:07:58 afresh1 Exp $
+# $Id: Configure.pm,v 2.21 2004/03/02 20:28:11 jonathan Exp $
#
# Todo: clean up redudant code in CPP, Compile, Link, and Execute
@@ -16,10 +16,9 @@
# for when no_index is not enough
package
-Configure;
+ Configure;
use strict;
-
use vars qw(@EXPORT @ISA);
use Carp;
@@ -71,7 +70,7 @@ levels of specificity, so here is a summary of what the functions can do:
CheckHeader: Look for headers.
-CheckStructure: Look for a structure.
+CheckStructure: Look for a structure.
CheckField: Look for a field in a structure.
@@ -85,11 +84,11 @@ GetTextSymbol: Get the contents of a symbol as text.
GetNumericSymbol: Get the contents of a symbol as a number.
-Apply: Try compiling code with a set of headers and libs.
+Apply: Try compiling code with a set of headers and libs.
ApplyHeaders: Try compiling code with a set of headers.
-ApplyLibraries: Try linking code with a set of libraries.
+ApplyLibraries: Try linking code with a set of libraries.
ApplyHeadersAndLibaries: You get the idea.
@@ -99,7 +98,7 @@ CPP: Feed some code through the C preproccessor.
Compile: Try to compile some C code.
-Link: Try to compile & link some C code.
+Link: Try to compile & link some C code.
Execute: Try to compile, link, & execute some C code.
@@ -175,7 +174,7 @@ sub Compile { # Feed code to compiler. On error, return status and text
my($result) = scalar(`$C_cc $C_ccflags -c $in $C_ldflags $C_libs $options 2>&1`);
print "Executing '$C_cc $C_ccflags -c $in $C_ldflags $C_libs $options 2>&1'\n" if $Verbose;
my($error) = $?;
- my($error2) = ! -e $out;
+ my($error2) = ! -e $out;
unlink($in,$out);
return (($error || $error2) ? 0 : 1) unless wantarray;
($error,$result,$error2);
@@ -427,11 +426,12 @@ sub Apply { #
@l = split(/\s+/,$lookup[$i+1]);
}
- if($ret=&{$cmd == \&Link && !@l?\&Compile:$cmd}(join("",map($_?"#include <$_>\n":"",grep(!/^-I/,@h))).
+ if ($ret=&{$cmd == \&Link && !@l?\&Compile:$cmd}(
+ join("",map($_?"#include <$_>\n":"",grep(!/^-I/,@h))).
$code,grep(/^-I/,@h),@l)) {
print "Ret=|$ret|\n" if $Verbose;
return $ret unless wantarray;
- return (join(" ",@h),join(" ",@l));
+ return (join(" ",@h),join(" ",@l));
}
}
return 0 unless wantarray;
@@ -531,7 +531,7 @@ be returned if nothing succeeds.
sub CheckField { # Check for the existance of specified field in structure
my($structname,$fieldname,@headers) = @_;
ApplyHeaders("main(){ struct $structname s1; struct $structname s2;
- s1.$fieldname = s2.$fieldname; }",@headers);
+ s1.$fieldname = s2.$fieldname; }",@headers);
}
=head2 CheckLSymbol
@@ -592,7 +592,7 @@ sub CheckHPrototype { # Check for header prototype.
my($function,$proto,@headers) = @_;
my(@proto) = @{$proto};
ApplyHeaders("main() { extern ".$proto[0]." $function(".
- join(",",@proto[1..$#proto])."); }",@headers);
+ join(",",@proto[1..$#proto])."); }",@headers);
}
=head2 GetSymbol
@@ -705,48 +705,61 @@ sub DeducePrototype {
if($firstdeduce) {
$firstdeduce=0;
- my $checknumber=!Compile("extern int func(int a,int b);
- extern int func(int a,int b,int c);
- main(){}");
- $checkreturn=!Compile("extern int func(int a,int b);
- extern long func(int a,int b);
- main(){}");
- my $checketc= !Compile("extern int func(int a,int b);
- extern long func(int a,...);
- main(){}");
- my $checknumberetc=!Compile("extern int func(int a,int b);
- extern int func(int a,int b,...);
- main(){}");
- my $checketcnumber=!Compile("extern int func(int a,int b,int c,...);
- extern int func(int a,int b,...);
- main(){}");
- my $checkargtypes=!Compile("extern int func(int a);
- extern int func(long a);
- main(){}");
- my $checkargsnil=!Compile("extern int func();
- extern int func(int a,int b,int c);
- main(){}");
- $checknilargs=!Compile("extern int func(int a,int b,int c);
- extern int func();
- main(){}");
- my $checkargsniletc=!Compile("extern int func(...);
- extern int func(int a,int b,int c);
- main(){}");
- $checkniletcargs=!Compile("extern int func(int a,int b,int c);
- extern int func(...);
- main(){}");
-
- my $checkconst=!Compile("extern int func(const int * a);
- extern int func(int * a);
- main(){ }");
-
- my $checksign=!Compile("extern int func(int a);
- extern int func(unsigned int a);
- main(){ }");
-
- $checkreturnnil=!Compile("extern func(int a);
- extern void func(int a);
- main(){ }");
+ my $checknumber=!Compile("
+extern int func(int a,int b);
+extern int func(int a,int b,int c);
+main(){}");
+ $checkreturn=!Compile("
+extern int func(int a,int b);
+extern long func(int a,int b);
+main(){}");
+ my $checketc= !Compile("
+extern int func(int a,int b);
+extern long func(int a,...);
+main(){}");
+ my $checknumberetc=!Compile("
+extern int func(int a,int b);
+extern int func(int a,int b,...);
+main(){}");
+ my $checketcnumber=!Compile("
+extern int func(int a,int b,int c,...);
+extern int func(int a,int b,...);
+main(){}");
+ my $checkargtypes=!Compile("
+extern int func(int a);
+extern int func(long a);
+main(){}");
+ my $checkargsnil=!Compile("
+extern int func();
+extern int func(int a,int b,int c);
+main(){}");
+ $checknilargs=!Compile("
+extern int func(int a,int b,int c);
+extern int func();
+main(){}");
+ my $checkargsniletc=!Compile("
+extern int func(...);
+extern int func(int a,int b,int c);
+main(){}");
+ $checkniletcargs=!Compile("
+extern int func(int a,int b,int c);
+extern int func(...);
+main(){}");
+
+ my $checkconst=!Compile("
+extern int func(const int * a);
+extern int func(int * a);
+main(){ }");
+
+ my $checksign=!Compile("
+extern int func(int a);
+extern int func(unsigned int a);
+main(){ }");
+
+ $checkreturnnil=!Compile("
+extern func(int a);
+extern void func(int a);
+main(){ }");
@types = sort grep(Compile("main(){$_ a;}"),
"void","int","long int","unsigned int","unsigned long int","long long int",
@@ -765,11 +778,13 @@ sub DeducePrototype {
for ($i=0;$i<=$#types;$i++) {
for ($j=$i+1;$j<=$#types;$j++) {
next if $j==$i;
- if(Compile("extern void func($types[$i]);
- extern void func($types[$j]); main(){}")) {
- print "Removing type $types[$j] because it equals $types[$i]\n";
- splice(@types,$j,1);
- $j--;
+ if(Compile("
+extern void func($types[$i]);
+extern void func($types[$j]);
+main(){}")) {
+ print "Removing type $types[$j] because it equals $types[$i]\n";
+ splice(@types,$j,1);
+ $j--;
}
}
}
@@ -777,8 +792,10 @@ sub DeducePrototype {
for ($i=0;$i<=$#types;$i++) {
for ($j=$i+1;$j<=$#types;$j++) {
next if $j==$i;
- if(Compile("$types[$i] func(void);
- extern $types[$j] func(void); main(){}")) {
+ if(Compile("
+$types[$i] func(void);
+extern $types[$j] func(void);
+main(){}")) {
print "Removing type $types[$j] because it equals $types[$i]\n";
splice(@types,$j,1);
$j--;
diff --git a/gnu/usr.bin/perl/cpan/Term-ReadKey/MANIFEST b/gnu/usr.bin/perl/cpan/Term-ReadKey/MANIFEST
index b4c40774254..312c697a189 100644
--- a/gnu/usr.bin/perl/cpan/Term-ReadKey/MANIFEST
+++ b/gnu/usr.bin/perl/cpan/Term-ReadKey/MANIFEST
@@ -3,7 +3,7 @@ MANIFEST
MANIFEST.SKIP
Makefile.PL
README
-ReadKey.pm
+ReadKey.pm.PL
ReadKey.xs
genchars.pl
ppport.h
@@ -11,5 +11,6 @@ example/test.pl
t/01_basic.t
t/02_terminal_functions.t
Changes
-META.yml Module meta-data (added by MakeMaker)
+META.yml Module YAML meta-data (added by MakeMaker)
META.json Module JSON meta-data (added by MakeMaker)
+SIGNATURE Public-key signature (added by MakeMaker)
diff --git a/gnu/usr.bin/perl/cpan/Term-ReadKey/MANIFEST.SKIP b/gnu/usr.bin/perl/cpan/Term-ReadKey/MANIFEST.SKIP
index 422a152da8d..ad05b0b5a1c 100644
--- a/gnu/usr.bin/perl/cpan/Term-ReadKey/MANIFEST.SKIP
+++ b/gnu/usr.bin/perl/cpan/Term-ReadKey/MANIFEST.SKIP
@@ -1,3 +1,4 @@
.gitignore
.travis.yml
.git
+.gz
diff --git a/gnu/usr.bin/perl/cpan/Term-ReadKey/META.json b/gnu/usr.bin/perl/cpan/Term-ReadKey/META.json
index bcc2fdac4e9..d2ae12d38b9 100644
--- a/gnu/usr.bin/perl/cpan/Term-ReadKey/META.json
+++ b/gnu/usr.bin/perl/cpan/Term-ReadKey/META.json
@@ -1,23 +1,20 @@
{
- "abstract" : "unknown",
+ "abstract" : "Change terminal modes, and perform non-blocking reads.",
"author" : [
- "unknown"
+ "Kenneth Albanowski",
+ "Jonathan Stowe"
],
"dynamic_config" : 1,
- "generated_by" : "ExtUtils::MakeMaker version 6.98, CPAN::Meta::Converter version 2.142060",
+ "generated_by" : "ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 2.150010",
"license" : [
"perl_5"
],
"meta-spec" : {
"url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
- "version" : "2"
+ "version" : 2
},
"name" : "TermReadKey",
"no_index" : {
- "directory" : [
- "t",
- "inc"
- ],
"file" : [
"Configure.pm"
],
@@ -28,15 +25,21 @@
"prereqs" : {
"build" : {
"requires" : {
- "ExtUtils::MakeMaker" : "0"
+ "ExtUtils::MakeMaker" : "6.58"
}
},
"configure" : {
"requires" : {
- "ExtUtils::MakeMaker" : "0"
+ "ExtUtils::MakeMaker" : "6.58"
}
}
},
+ "provides" : {
+ "Term::ReadKey" : {
+ "file" : "ReadKey.pm.PL",
+ "version" : "2.38"
+ }
+ },
"release_status" : "stable",
"resources" : {
"repository" : {
@@ -45,5 +48,6 @@
"web" : "https://github.com/jonathanstowe/TermReadKey"
}
},
- "version" : "2.33"
+ "version" : "2.38",
+ "x_serialization_backend" : "JSON::PP version 2.97001"
}
diff --git a/gnu/usr.bin/perl/cpan/Term-ReadKey/META.yml b/gnu/usr.bin/perl/cpan/Term-ReadKey/META.yml
index 89dde468ca5..1e46f325428 100644
--- a/gnu/usr.bin/perl/cpan/Term-ReadKey/META.yml
+++ b/gnu/usr.bin/perl/cpan/Term-ReadKey/META.yml
@@ -1,26 +1,29 @@
---
-abstract: unknown
+abstract: 'Change terminal modes, and perform non-blocking reads.'
author:
- - unknown
+ - 'Kenneth Albanowski'
+ - 'Jonathan Stowe'
build_requires:
- ExtUtils::MakeMaker: '0'
+ ExtUtils::MakeMaker: '6.58'
configure_requires:
- ExtUtils::MakeMaker: '0'
+ ExtUtils::MakeMaker: '6.58'
dynamic_config: 1
-generated_by: 'ExtUtils::MakeMaker version 6.98, CPAN::Meta::Converter version 2.142060'
+generated_by: 'ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 2.150010'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: '1.4'
name: TermReadKey
no_index:
- directory:
- - t
- - inc
file:
- Configure.pm
package:
- Configure
+provides:
+ Term::ReadKey:
+ file: ReadKey.pm.PL
+ version: '2.38'
resources:
repository: https://github.com/jonathanstowe/TermReadKey.git
-version: '2.33'
+version: '2.38'
+x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
diff --git a/gnu/usr.bin/perl/cpan/Term-ReadKey/Makefile.PL b/gnu/usr.bin/perl/cpan/Term-ReadKey/Makefile.PL
index 4c97e22a897..dc6f29d2357 100644
--- a/gnu/usr.bin/perl/cpan/Term-ReadKey/Makefile.PL
+++ b/gnu/usr.bin/perl/cpan/Term-ReadKey/Makefile.PL
@@ -1,20 +1,37 @@
+use strict;
+use warnings;
use ExtUtils::MakeMaker;
use Carp;
-my $mm_version = $ExtUtils::MakeMaker::VERSION || $ExtUtils::MakeMaker::Version;
-if( $mm_version < 3.5 ) {
- croak("Sorry, but MakeMaker 3.5 or better is needed to build this package.");
+my $mm_version = $ExtUtils::MakeMaker::VERSION;
+if ( $mm_version < 6.58 ) {
+ croak("Sorry, but MakeMaker 6.58 or better is needed to build this package.");
}
-&WriteMakefile(
- NAME => 'Term::ReadKey',
- DISTNAME => 'TermReadKey',
- LICENSE => 'perl',
- META_MERGE => {
+WriteMakefile(
+ NAME => 'Term::ReadKey',
+ DISTNAME => 'TermReadKey',
+ LICENSE => 'perl',
+ ABSTRACT => 'Change terminal modes, and perform non-blocking reads.',
+ AUTHOR => ['Kenneth Albanowski','Jonathan Stowe'],
+ CONFIGURE_REQUIRES => {
+ 'ExtUtils::MakeMaker' => 6.58,
+ },
+ BUILD_REQUIRES => {
+ 'ExtUtils::MakeMaker' => 6.58,
+ },
+ META_ADD => { # needs to _ADD because I want over-ride the dynamic_config
+ dynamic_config => 1,
no_index => {
- file => [qw(Configure.pm)],
- package => [qw(Configure)],
+ file => [ qw(Configure.pm) ],
+ package => [ qw(Configure) ],
+ },
+ provides => {
+ 'Term::ReadKey' => {
+ file => 'ReadKey.pm.PL',
+ version => '2.38',
+ },
},
'meta-spec' => { version => 2 },
resources => {
@@ -25,62 +42,62 @@ if( $mm_version < 3.5 ) {
},
},
},
- VERSION_FROM => 'ReadKey.pm',
- XSPROTOARG => '-noprototypes',
- PM => { "ReadKey.pm" => '$(INST_LIBDIR)/ReadKey.pm'},
-
- 'dist' => { COMPRESS=>"gzip", SUFFIX=>"gz" },
- "test" => {
- "TESTS" => "t/*.t"
- }
-
-# Uncomment these to allow testing of sgtty under Linux. Not needed normally.
-# INC => "-I/usr/include/bsd",
-# LIBS => "-lbsd"
+ VERSION_FROM => 'ReadKey.pm.PL',
+ XSPROTOARG => '-noprototypes',
+ PL_FILES => { 'ReadKey.pm.PL' => 'ReadKey.pm' },
+ PM => { 'ReadKey.pm' => '$(INST_ARCHLIBDIR)/ReadKey.pm' },
+ clean => { FILES => 'cchars.h ReadKey.pm' },
+ SIGN => 1,
+
+ # Uncomment these to allow testing of sgtty under Linux. Not needed normally.
+ # INC => "-I/usr/include/bsd",
+ # LIBS => "-lbsd"
);
-sub MY::realclean {
- my $self = shift;
- $_ = $self->MM::realclean();
- s/\t/\trm -f cchars.h\n\t/;
- $_;
-}
-
sub MY::top_targets {
- my $self = shift;
- $_ = $self->MM::top_targets();
- $_ .= "
+ my $self = shift;
+ $_ = $self->MM::top_targets();
+ # ensure that the XS is built before the PM
+ s/pure_all :: config pm_to_blib (.* )linkext/pure_all :: config linkext pm_to_blib $1/;
+
+ $_ .= "
sgtty cchars.h: genchars.pl
- \$(PERL) -I. -I\$(PERL_LIB) genchars.pl
+ \$(PERLRUN) genchars.pl
distcc: genchars.pl
- \$(PERL) -I. -I\$(PERL_LIB) genchars.pl dist
+ \$(PERLRUN) genchars.pl dist
-ReadKey.c: cchars.h
+ReadKey\$(OBJ_EXT): ReadKey.c cchars.h
";
- $_;
+ return $_;
+}
+# The template needs DynaLoader. don't use miniperl (dual-life only)
+sub MY::processPL {
+ my $self = shift;
+ $_ = $self->MM::processPL();
+ s/ReadKey.pm :: ReadKey.pm.PL/ReadKey.pm :: ReadKey.pm.PL dynamic/;
+ s/\$\(PERLRUN\)/\$(FULLPERLRUNINST)/;
+ return $_;
}
sub MY::test {
- my $self = shift;
- $_ = $self->MM::test();
- s#example/test.pl#-w example/test.pl#;
- $_;
+ my $self = shift;
+ $_ = $self->MM::test();
+ s#example/test.pl#-w example/test.pl#;
+ return $_;
}
-sub MY::test_interactive
-{
+sub MY::test_interactive {
return "Fooo";
}
-sub MY::pure_site_install
-{
+sub MY::pure_site_install {
my $self = shift;
my $new = $self->MM::test();
- $new .= "\n\t./register_module Your::Module";
+ $new .= "\n\t./register_module Term::ReadKey";
return $new;
}
diff --git a/gnu/usr.bin/perl/cpan/Term-ReadKey/README b/gnu/usr.bin/perl/cpan/Term-ReadKey/README
index 8769c8d1da3..30fe804763e 100644
--- a/gnu/usr.bin/perl/cpan/Term-ReadKey/README
+++ b/gnu/usr.bin/perl/cpan/Term-ReadKey/README
@@ -1,7 +1,7 @@
- Term::ReadKey 2.33 - Change terminal modes, and perform non-blocking reads.
+ Term::ReadKey 2.36 - Change terminal modes, and perform non-blocking reads.
Copyright (C) 1994-1999 Kenneth Albanowski.
- 2001-2015 Jonathan Stowe and others
+ 2001-2016 Jonathan Stowe and others
This package is dual licensed. You can either choose to license it under
the original terms which were:
diff --git a/gnu/usr.bin/perl/cpan/Term-ReadKey/ReadKey.pm b/gnu/usr.bin/perl/cpan/Term-ReadKey/ReadKey.pm.PL
index a2642e130cc..1ebbdd3c838 100644
--- a/gnu/usr.bin/perl/cpan/Term-ReadKey/ReadKey.pm
+++ b/gnu/usr.bin/perl/cpan/Term-ReadKey/ReadKey.pm.PL
@@ -1,5 +1,47 @@
+#! perl
+
+package Term::ReadKey;
+
+# This also needs to be adjusted in the generated code below
+# and in the Makefile.PL
+use vars qw($VERSION);
+
+$VERSION = '2.38';
+
+use Config;
+use File::Basename qw(&basename &dirname);
+use File::Spec;
+use Cwd;
+
+# List explicitly here the variables you want Configure to
+# generate. Metaconfig only looks for shell variables, so you
+# have to mention them as if they were shell variables, not
+# %Config entries. Thus you write
+# $startperl
+# to ensure Configure will look for $Config{startperl}.
+# Wanted: $archlibexp
+
+# This forces PL files to create target in same directory as PL file.
+# This is so that make depend always knows where to find PL derivatives.
+my $origdir = cwd;
+my $dir = dirname($0);
+chdir $dir;
+my $file = 'ReadKey.pm';
+
+open OUT, ">", $file or die "Can't create $file: $!";
+
+print "Creating $file\n";
+
+print OUT <<'!FIRSTPART';
+# -*- buffer-read-only: t -*-
+#
+# This file is auto-generated. ***ANY*** changes here will be lost
+#
package Term::ReadKey;
+use strict;
+use warnings;
+
=head1 NAME
Term::ReadKey - A perl module for simple terminal control
@@ -167,7 +209,7 @@ OS will probably send a SIGWINCH signal to anything reading that tty or pty.
B<This call does not work under Windows>.
-=item GetSpeeds [, Filehandle]
+=item GetSpeed [, Filehandle]
Returns either an empty array if the operation is unsupported, or a two
value array containing the terminal in and out speeds, in B<decimal>. E.g,
@@ -249,10 +291,10 @@ Please feel free to fork and suggest patches.
Prior to the 2.31 release the license statement was:
Copyright (C) 1994-1999 Kenneth Albanowski.
- 2001-2005 Jonathan Stowe and others
+ 2001-2005 Jonathan Stowe and others
- Unlimited distribution and/or modification is allowed as long as this
- copyright notice remains intact.
+ Unlimited distribution and/or modification is allowed as long as this
+ copyright notice remains intact.
And was only stated in the README file.
@@ -275,14 +317,14 @@ choose to license this under the standard Perl license:
use vars qw($VERSION);
-$VERSION = '2.33';
+$VERSION = '2.38';
require Exporter;
-require AutoLoader;
require DynaLoader;
-use Carp;
-@ISA = qw(Exporter AutoLoader DynaLoader);
+use vars qw(@ISA @EXPORT_OK @EXPORT);
+
+@ISA = qw(Exporter DynaLoader);
# Items to export into callers namespace by default
# (move infrequently used names to @EXPORT_OK below)
@@ -302,14 +344,13 @@ use Carp;
bootstrap Term::ReadKey;
-# Preloaded methods go here. Autoload methods go after __END__, and are
-# processed by the autosplit program.
-
# Should we use LINES and COLUMNS to try and get the terminal size?
# Change this to zero if you have systems where these are commonly
# set to erroneous values. (But if either are near zero, they won't be
# used anyhow.)
+use vars qw($UseEnv $CurrentMode %modes);
+
$UseEnv = 1;
$CurrentMode = 0;
@@ -324,24 +365,31 @@ $CurrentMode = 0;
'ultra-raw' => 5
);
+# reduce Carp memory footprint, only load when needed
+sub croak { require Carp; goto &Carp::croak; }
+sub carp { require Carp; goto &Carp::carp; }
+
sub ReadMode
{
- my ($mode) = $modes{ lc $_[0] }; # lowercase is canonical
- my ($fh) = normalizehandle( ( @_ > 1 ? $_[1] : \*STDIN ) );
- if ( defined($mode) ) { $CurrentMode = $mode }
+ my $mode = $modes{ lc $_[0] }; # lowercase is canonical
+ my $fh = normalizehandle( ( @_ > 1 ? $_[1] : \*STDIN ) );
+
+ if ( defined($mode) ) { $CurrentMode = $mode }
elsif ( $_[0] =~ /^\d/ ) { $CurrentMode = $_[0] }
- else { croak("Unknown terminal mode `$_[0]'"); }
+ else { croak("Unknown terminal mode `$_[0]'"); }
+
SetReadMode($CurrentMode, $fh);
}
sub normalizehandle
{
- my ($file) = @_;
+ my ($file) = @_; # allows fake signature optimization
+ no strict;
# print "Handle = $file\n";
if ( ref($file) ) { return $file; } # Reference is fine
- # if($file =~ /^\*/) { return $file; } # Type glob is good
+ # if ($file =~ /^\*/) { return $file; } # Type glob is good
if ( ref( \$file ) eq 'GLOB' ) { return $file; } # Glob is good
# print "Caller = ",(caller(1))[0],"\n";
@@ -350,9 +398,9 @@ sub normalizehandle
sub GetTerminalSize
{
- my ($file) = normalizehandle( ( @_ > 1 ? $_[1] : \*STDOUT ) );
- my (@results) = ();
- my (@fail);
+ my $file = normalizehandle( ( @_ > 0 ? $_[0] : \*STDOUT ) );
+
+ my (@results, @fail);
if ( &termsizeoptions() & 1 ) # VIO
{
@@ -400,11 +448,10 @@ sub GetTerminalSize
}
my ($resize) = scalar(`$prog 2>/dev/null`);
- if (
- defined $resize
+ if (defined $resize
and ( $resize =~ /COLUMNS\s*=\s*(\d+)/
or $resize =~ /setenv\s+COLUMNS\s+'?(\d+)/ )
- )
+ )
{
$results[0] = $1;
if ( $resize =~ /LINES\s*=\s*(\d+)/
@@ -430,14 +477,13 @@ sub GetTerminalSize
my ($prog) = "stty size";
my ($stty) = scalar(`$prog 2>/dev/null`);
- if (
- defined $stty
+ if (defined $stty
and ( $stty =~ /(\d+) (\d+)/ )
- )
+ )
{
$results[0] = $2;
- $results[1] = $1;
- @results[ 2, 3 ] = ( 0, 0 );
+ $results[1] = $1;
+ @results[ 2, 3 ] = ( 0, 0 );
}
else
{
@@ -448,207 +494,240 @@ sub GetTerminalSize
if ( @results != 4 )
{
- warn "Unable to get Terminal Size."
- . join( "", map( " The $_ didn't work.", @fail ) );
+ carp("Unable to get Terminal Size."
+ . join( "", map( " The $_ didn't work.", @fail ) ));
return undef;
}
@results;
}
+!FIRSTPART
+
+close OUT;
+# preload the XS module needed for the blockoptions() expansions below
+# does not work with miniperl
+package Term::ReadKey;
+require DynaLoader;
+our @ISA = qw(DynaLoader);
+
+print "Bootstrapping the XS for blockoptions: ";
+bootstrap Term::ReadKey or die;
+print blockoptions()."\n";
+
+open OUT, ">>", $file or die "Can't append to $file: $!";
+print OUT "# blockoptions: \n";
if ( &blockoptions() & 1 ) # Use nodelay
{
+ print OUT "#nodelay\n";
if ( &blockoptions() & 2 ) #poll
{
- eval <<'DONE';
- sub ReadKey {
- my($File) = normalizehandle((@_>1?$_[1]:\*STDIN));
- if (defined $_[0] && $_[0] > 0) {
- if ($_[0]) {
- return undef if &pollfile($File,$_[0]) == 0;
- }
- }
- if (defined $_[0] && $_[0] < 0) {
- &setnodelay($File,1);
- }
- my ($value) = getc $File;
- if (defined $_[0] && $_[0] < 0) {
- &setnodelay($File,0);
- }
- $value;
- }
- sub ReadLine {
- my($File) = normalizehandle((@_>1?$_[1]:\*STDIN));
-
- if (defined $_[0] && $_[0] > 0) {
- if ($_[0]) {
- return undef if &pollfile($File,$_[0]) == 0;
- }
- }
- if (defined $_[0] && $_[0] < 0) {
- &setnodelay($File,1)
- };
- my ($value) = scalar(<$File>);
- if ( defined $_[0] && $_[0]<0 ) {
- &setnodelay($File,0)
- };
- $value;
- }
-DONE
+ print OUT <<'!NO!SUBS!';
+# poll
+sub ReadKey {
+ my $File = normalizehandle((@_>1?$_[1]:\*STDIN));
+ if (defined $_[0] && $_[0] > 0) {
+ if ($_[0]) {
+ return undef if &pollfile($File,$_[0]) == 0;
+ }
+ }
+ if (defined $_[0] && $_[0] < 0) { &setnodelay($File,1); }
+ my $value = getc $File;
+ if (defined $_[0] && $_[0] < 0) { &setnodelay($File,0); }
+ $value;
+}
+sub ReadLine {
+ my $File = normalizehandle((@_>1?$_[1]:\*STDIN));
+ if (defined $_[0] && $_[0] > 0) {
+ if ($_[0]) {
+ return undef if &pollfile($File,$_[0]) == 0;
+ }
+ }
+ if (defined $_[0] && $_[0] < 0) { &setnodelay($File,1) };
+ my $value = scalar(<$File>);
+ if (defined $_[0] && $_[0] < 0) { &setnodelay($File,0) };
+ $value;
+}
+!NO!SUBS!
+
}
elsif ( &blockoptions() & 4 ) #select
{
- eval <<'DONE';
- sub ReadKey {
- my($File) = normalizehandle((@_>1?$_[1]:\*STDIN));
- if(defined $_[0] && $_[0]>0) {
- if($_[0]) {return undef if &selectfile($File,$_[0])==0}
- }
- if(defined $_[0] && $_[0]<0) {&setnodelay($File,1);}
- my($value) = getc $File;
- if(defined $_[0] && $_[0]<0) {&setnodelay($File,0);}
- $value;
- }
- sub ReadLine {
- my($File) = normalizehandle((@_>1?$_[1]:\*STDIN));
- if(defined $_[0] && $_[0]>0) {
- if($_[0]) {return undef if &selectfile($File,$_[0])==0}
- }
- if(defined $_[0] && $_[0]<0) {&setnodelay($File,1)};
- my($value)=scalar(<$File>);
- if(defined $_[0] && $_[0]<0) {&setnodelay($File,0)};
- $value;
- }
-DONE
+ print OUT <<'!NO!SUBS!';
+#select
+sub ReadKey {
+ my $File = normalizehandle((@_>1?$_[1]:\*STDIN));
+ if (defined $_[0] && $_[0] > 0) {
+ if ($_[0]) { return undef if &selectfile($File,$_[0]) == 0 }
+ }
+ if (defined $_[0] && $_[0] < 0) { &setnodelay($File,1); }
+ my $value = getc $File;
+ if (defined $_[0] && $_[0] < 0) { &setnodelay($File,0); }
+ $value;
+}
+sub ReadLine {
+ my $File = normalizehandle((@_>1?$_[1]:\*STDIN));
+ if (defined $_[0] && $_[0] > 0) {
+ if ($_[0]) { return undef if &selectfile($File,$_[0]) == 0 }
+ }
+ if (defined $_[0] && $_[0] < 0) { &setnodelay($File,1) };
+ my $value = scalar(<$File>);
+ if (defined $_[0] && $_[0] < 0) { &setnodelay($File,0) };
+ $value;
+}
+!NO!SUBS!
+
}
else
{ #nothing
- eval <<'DONE';
- sub ReadKey {
- my($File) = normalizehandle((@_>1?$_[1]:\*STDIN));
- if(defined $_[0] && $_[0]>0) {
- # Nothing better seems to exist, so I just use time-of-day
- # to timeout the read. This isn't very exact, though.
- $starttime=time;
- $endtime=$starttime+$_[0];
- &setnodelay($File,1);
- my($value)=undef;
- while(time<$endtime) { # This won't catch wraparound!
- $value = getc $File;
- last if defined($value);
- }
- &setnodelay($File,0);
- return $value;
- }
- if(defined $_[0] && $_[0]<0) {&setnodelay($File,1);}
- my($value) = getc $File;
- if(defined $_[0] && $_[0]<0) {&setnodelay($File,0);}
- $value;
- }
- sub ReadLine {
- my($File) = normalizehandle((@_>1?$_[1]:\*STDIN));
- if(defined $_[0] && $_[0]>0) {
- # Nothing better seems to exist, so I just use time-of-day
- # to timeout the read. This isn't very exact, though.
- $starttime=time;
- $endtime=$starttime+$_[0];
- &setnodelay($File,1);
- my($value)=undef;
- while(time<$endtime) { # This won't catch wraparound!
- $value = scalar(<$File>);
- last if defined($value);
- }
- &setnodelay($File,0);
- return $value;
- }
- if(defined $_[0] && $_[0]<0) {&setnodelay($File,1)};
- my($value)=scalar(<$File>);
- if(defined $_[0] && $_[0]<0) {&setnodelay($File,0)};
- $value;
- }
-DONE
+ print OUT <<'!NO!SUBS!';
+sub ReadKey {
+ my $File = normalizehandle((@_>1?$_[1]:\*STDIN));
+ if (defined $_[0] && $_[0] > 0) {
+ # Nothing better seems to exist, so I just use time-of-day
+ # to timeout the read. This isn't very exact, though.
+ $starttime = time;
+ $endtime = $starttime + $_[0];
+ &setnodelay($File,1);
+ my $value;
+ while (time < $endtime) { # This won't catch wraparound!
+ $value = getc $File;
+ last if defined($value);
+ }
+ &setnodelay($File,0);
+ return $value;
}
+ if (defined $_[0] && $_[0] < 0) { &setnodelay($File,1); }
+ my $value = getc $File;
+ if (defined $_[0] && $_[0] < 0) { &setnodelay($File,0); }
+ $value;
}
-elsif ( &blockoptions() & 2 ) # Use poll
-{
- eval <<'DONE';
- sub ReadKey {
- my($File) = normalizehandle((@_>1?$_[1]:\*STDIN));
- if(defined $_[0] && $_[0] != 0) {
- return undef if &pollfile($File,$_[0]) == 0
- }
- getc $File;
- }
- sub ReadLine {
- my($File) = normalizehandle((@_>1?$_[1]:\*STDIN));
- if(defined $_[0] && $_[0]!=0) {
- return undef if &pollfile($File,$_[0]) == 0;
- }
- scalar(<$File>);
- }
-DONE
+sub ReadLine {
+ my $File = normalizehandle((@_>1?$_[1]:\*STDIN));
+ if (defined $_[0] && $_[0] > 0) {
+ # Nothing better seems to exist, so I just use time-of-day
+ # to timeout the read. This isn't very exact, though.
+ $starttime = time;
+ $endtime = $starttime + $_[0];
+ &setnodelay($File,1);
+ my $value;
+ while (time < $endtime) { # This won't catch wraparound!
+ $value = scalar(<$File>);
+ last if defined($value);
+ }
+ &setnodelay($File,0);
+ return $value;
+ }
+ if (defined $_[0] && $_[0] < 0) { &setnodelay($File,1) };
+ my $value = scalar(<$File>);
+ if (defined $_[0] && $_[0] < 0) { &setnodelay($File,0) };
+ $value;
}
-elsif ( &blockoptions() & 4 ) # Use select
-{
- eval <<'DONE';
- sub ReadKey {
- my($File) = normalizehandle((@_>1?$_[1]:\*STDIN));
- if(defined $_[0] && $_[0] !=0 ) {
- return undef if &selectfile($File,$_[0])==0
- }
- getc $File;
- }
- sub ReadLine {
- my($File) = normalizehandle((@_>1?$_[1]:\*STDIN));
- if(defined $_[0] && $_[0] != 0) {
- return undef if &selectfile($File,$_[0]) == 0;
- }
- scalar(<$File>);
- }
-DONE
+!NO!SUBS!
+
+ }
}
-elsif ( &blockoptions() & 8 ) # Use Win32
-{
- eval <<'DONE';
- sub ReadKey {
- my($File) = normalizehandle((@_>1?$_[1]:\*STDIN));
- if ($_[0] || $CurrentMode >= 3) {
- Win32PeekChar($File, $_[0]);
- } else {
- getc $File;
- }
- #if ($_[0]!=0) {return undef if !Win32PeekChar($File, $_[0])};
- #getc $File;
- }
- sub ReadLine {
- my($File) = normalizehandle((@_>1?$_[1]:\*STDIN));
- #if ($_[0]!=0) {return undef if !Win32PeekChar($File, $_[0])};
- #scalar(<$File>);
- if($_[0])
- {croak("Non-blocking ReadLine is not supported on this architecture")}
- scalar(<$File>);
- }
-DONE
+else {
+ print OUT "#no nodelay\n";
+
+ if ( &blockoptions() & 2 ) # Use poll
+ {
+ print OUT <<'!NO!SUBS!';
+#poll
+sub ReadKey {
+ my $File = normalizehandle((@_>1?$_[1]:\*STDIN));
+ if (defined $_[0] && $_[0] != 0) {
+ return undef if &pollfile($File,$_[0]) == 0
+ }
+ getc $File;
}
-else
-{
- eval <<'DONE';
- sub ReadKey {
- my($File) = normalizehandle((@_>1?$_[1]:\*STDIN));
- if($_[0])
- {croak("Non-blocking ReadKey is not supported on this architecture")}
- getc $File;
- }
- sub ReadLine {
- my($File) = normalizehandle((@_>1?$_[1]:\*STDIN));
- if($_[0])
- {croak("Non-blocking ReadLine is not supported on this architecture")}
- scalar(<$File>);
- }
-DONE
+sub ReadLine {
+ my $File = normalizehandle((@_>1?$_[1]:\*STDIN));
+ if (defined $_[0] && $_[0] != 0 ) {
+ return undef if &pollfile($File,$_[0]) == 0;
+ }
+ scalar(<$File>);
}
+!NO!SUBS!
-package Term::ReadKey; # return to package ReadKey so AutoSplit is happy
-1;
+ }
+ elsif ( &blockoptions() & 4 ) # Use select
+ {
+ print OUT <<'!NO!SUBS!';
+#select
+sub ReadKey {
+ my $File = normalizehandle((@_>1?$_[1]:\*STDIN));
+ if (defined $_[0] && $_[0] != 0) {
+ return undef if &selectfile($File,$_[0]) == 0
+ }
+ getc $File;
+}
+sub ReadLine {
+ my $File = normalizehandle((@_>1?$_[1]:\*STDIN));
+ if (defined $_[0] && $_[0] != 0) {
+ return undef if &selectfile($File,$_[0]) == 0;
+ }
+ scalar(<$File>);
+}
+!NO!SUBS!
-__END__;
+ }
+ elsif ( &blockoptions() & 8 ) # Use Win32
+ {
+ print OUT <<'!NO!SUBS!';
+#Win32
+sub ReadKey {
+ my $File = normalizehandle((@_>1?$_[1]:\*STDIN));
+ if ($_[0] || $CurrentMode >= 3) {
+ Win32PeekChar($File, $_[0]);
+ } else {
+ getc $File;
+ }
+ #if ($_[0]!=0) {return undef if !Win32PeekChar($File, $_[0])};
+ #getc $File;
+}
+sub ReadLine {
+ my $File = normalizehandle((@_>1?$_[1]:\*STDIN));
+ #if ($_[0]!=0) {return undef if !Win32PeekChar($File, $_[0])};
+ #scalar(<$File>);
+ if ($_[0]) {
+ croak("Non-blocking ReadLine is not supported on this architecture")
+ }
+ scalar(<$File>);
+}
+!NO!SUBS!
+
+ }
+ else
+ {
+ print OUT <<'!NO!SUBS!';
+sub ReadKey {
+ my $File = normalizehandle((@_>1?$_[1]:\*STDIN));
+ if ($_[0]) {
+ croak("Non-blocking ReadKey is not supported on this architecture")
+ }
+ getc $File;
+}
+sub ReadLine {
+ my $File = normalizehandle((@_>1?$_[1]:\*STDIN));
+ if ($_[0]) {
+ croak("Non-blocking ReadLine is not supported on this architecture")
+ }
+ scalar(<$File>);
+}
+!NO!SUBS!
+
+ }
+}
+
+print OUT <<'EOF';
+1;
+# ex: set ro:
+EOF
+
+close OUT;
+if (-s $file < 1000) {
+ warn "WARNING: $file probably too small";
+} else {
+ print "Done\n";
+}
diff --git a/gnu/usr.bin/perl/cpan/Term-ReadKey/ReadKey.xs b/gnu/usr.bin/perl/cpan/Term-ReadKey/ReadKey.xs
index e4c70ca203a..bf13a02b485 100644
--- a/gnu/usr.bin/perl/cpan/Term-ReadKey/ReadKey.xs
+++ b/gnu/usr.bin/perl/cpan/Term-ReadKey/ReadKey.xs
@@ -1,5 +1,6 @@
/* -*-C-*- */
+#define PERL_NO_GET_CONTEXT /* we want efficiency */
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
@@ -16,9 +17,12 @@
Written by Kenneth Albanowski on Thu Oct 6 11:42:20 EDT 1994
Contact at kjahds@kjahds.com or CIS:70705,126
- Maintained by Jonathan Stowe <jns@gellyfish.com>
+ Maintained by Jonathan Stowe <jns@gellyfish.co.uk>
- $Id: ReadKey.xs,v 1.2 2016/07/03 01:07:58 afresh1 Exp $
+ The below captures the history prior to it being in full time version
+ control:
+
+ $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
@@ -375,41 +379,41 @@
#include "cchars.h"
-int GetTermSizeVIO _((PerlIO * file,
+STATIC int GetTermSizeVIO _((pTHX_ PerlIO * file,
int * retwidth, int * retheight,
int * xpix, int * ypix));
-int GetTermSizeGWINSZ _((PerlIO * file,
+STATIC int GetTermSizeGWINSZ _((pTHX_ PerlIO * file,
int * retwidth, int * retheight,
int * xpix, int * ypix));
-int GetTermSizeGSIZE _((PerlIO * file,
+STATIC int GetTermSizeGSIZE _((pTHX_ PerlIO * file,
int * retwidth, int * retheight,
int * xpix, int * ypix));
-int GetTermSizeWin32 _((PerlIO * file,
+STATIC int GetTermSizeWin32 _((pTHX_ PerlIO * file,
int * retwidth, int * retheight,
int * xpix, int * ypix));
-int SetTerminalSize _((PerlIO * file,
+STATIC int SetTerminalSize _((pTHX_ PerlIO * file,
int width, int height,
int xpix, int ypix));
-void ReadMode _((PerlIO * file,int mode));
+STATIC void ReadMode _((pTHX_ PerlIO * file,int mode));
-int pollfile _((PerlIO * file, double delay));
+STATIC int pollfile _((pTHX_ PerlIO * file, double delay));
-int setnodelay _((PerlIO * file, int mode));
+STATIC int setnodelay _((pTHX_ PerlIO * file, int mode));
-int selectfile _((PerlIO * file, double delay));
+STATIC int selectfile _((pTHX_ PerlIO * file, double delay));
-int Win32PeekChar _((PerlIO * file, double delay, char * key));
+STATIC int Win32PeekChar _((pTHX_ PerlIO * file, double delay, char * key));
-int getspeed _((PerlIO * file, I32 *in, I32 * out ));
+STATIC int getspeed _((pTHX_ PerlIO * file, I32 *in, I32 * out ));
#ifdef VIOMODE
-int GetTermSizeVIO(PerlIO *file,int *retwidth,int *retheight,int *xpix,int *ypix)
+int GetTermSizeVIO(pTHX_ PerlIO *file,int *retwidth,int *retheight,int *xpix,int *ypix)
{
/*int handle=PerlIO_fileno(file);
@@ -431,7 +435,7 @@ int GetTermSizeVIO(PerlIO *file,int *retwidth,int *retheight,int *xpix,int *ypix
return 0;
}
#else
-int GetTermSizeVIO(PerlIO *file,int * retwidth,int *retheight, int *xpix,int *ypix)
+int GetTermSizeVIO(pTHX_ PerlIO *file,int * retwidth,int *retheight, int *xpix,int *ypix)
{
croak("TermSizeVIO is not implemented on this architecture");
return 0;
@@ -440,7 +444,7 @@ int GetTermSizeVIO(PerlIO *file,int * retwidth,int *retheight, int *xpix,int *yp
#if defined(TIOCGWINSZ) && !defined(DONT_USE_GWINSZ)
-int GetTermSizeGWINSZ(PerlIO *file,int *retwidth,int *retheight,int *xpix,int *ypix)
+int GetTermSizeGWINSZ(pTHX_ PerlIO *file,int *retwidth,int *retheight,int *xpix,int *ypix)
{
int handle=PerlIO_fileno(file);
struct winsize w;
@@ -455,7 +459,7 @@ int GetTermSizeGWINSZ(PerlIO *file,int *retwidth,int *retheight,int *xpix,int *y
}
#else
-int GetTermSizeGWINSZ(PerlIO *file,int *retwidth,int *retheight,int *xpix,int *ypix)
+int GetTermSizeGWINSZ(pTHX_ PerlIO *file,int *retwidth,int *retheight,int *xpix,int *ypix)
{
croak("TermSizeGWINSZ is not implemented on this architecture");
return 0;
@@ -463,7 +467,7 @@ int GetTermSizeGWINSZ(PerlIO *file,int *retwidth,int *retheight,int *xpix,int *y
#endif
#if (!defined(TIOCGWINSZ) || defined(DONT_USE_GWINSZ)) && (defined(TIOCGSIZE) && !defined(DONT_USE_GSIZE))
-int GetTermSizeGSIZE(PerlIO *file,int *retwidth,int *retheight,int *xpix,int *ypix)
+int GetTermSizeGSIZE(pTHX_ PerlIO *file,int *retwidth,int *retheight,int *xpix,int *ypix)
{
int handle=PerlIO_fileno(file);
@@ -478,7 +482,7 @@ int GetTermSizeGSIZE(PerlIO *file,int *retwidth,int *retheight,int *xpix,int *yp
}
}
#else
-int GetTermSizeGSIZE(PerlIO *file,int *retwidth,int *retheight,int *xpix,int *ypix)
+int GetTermSizeGSIZE(pTHX_ PerlIO *file,int *retwidth,int *retheight,int *xpix,int *ypix)
{
croak("TermSizeGSIZE is not implemented on this architecture");
return 0;
@@ -486,7 +490,7 @@ int GetTermSizeGSIZE(PerlIO *file,int *retwidth,int *retheight,int *xpix,int *yp
#endif
#ifdef USE_WIN32
-int GetTermSizeWin32(PerlIO *file,int *retwidth,int *retheight,int *xpix,int *ypix)
+int GetTermSizeWin32(pTHX_ PerlIO *file,int *retwidth,int *retheight,int *xpix,int *ypix)
{
int handle=PerlIO_fileno(file);
HANDLE whnd = (HANDLE)_get_osfhandle(handle);
@@ -509,7 +513,7 @@ int GetTermSizeWin32(PerlIO *file,int *retwidth,int *retheight,int *xpix,int *yp
return -1;
}
#else
-int GetTermSizeWin32(PerlIO *file,int *retwidth,int *retheight,int *xpix,int *ypix)
+int GetTermSizeWin32(pTHX_ PerlIO *file,int *retwidth,int *retheight,int *xpix,int *ypix)
{
croak("TermSizeWin32 is not implemented on this architecture");
return 0;
@@ -517,7 +521,7 @@ int GetTermSizeWin32(PerlIO *file,int *retwidth,int *retheight,int *xpix,int *yp
#endif /* USE_WIN32 */
-int termsizeoptions() {
+STATIC int termsizeoptions() {
return 0
#ifdef VIOMODE
| 1
@@ -535,9 +539,8 @@ int termsizeoptions() {
}
-int SetTerminalSize(PerlIO *file,int width,int height,int xpix,int ypix)
+int SetTerminalSize(pTHX_ PerlIO *file,int width,int height,int xpix,int ypix)
{
- char buffer[10];
int handle=PerlIO_fileno(file);
#ifdef VIOMODE
@@ -545,6 +548,7 @@ int SetTerminalSize(PerlIO *file,int width,int height,int xpix,int ypix)
#else
#if defined(TIOCSWINSZ) && !defined(DONT_USE_SWINSZ)
+ char buffer[10];
struct winsize w;
w.ws_col=width;
@@ -564,6 +568,7 @@ int SetTerminalSize(PerlIO *file,int width,int height,int xpix,int ypix)
}
#else
# if defined(TIOCSSIZE) && !defined(DONT_USE_SSIZE)
+ char buffer[10];
struct ttysize w;
w.ts_lines=height;
@@ -594,7 +599,7 @@ int SetTerminalSize(PerlIO *file,int width,int height,int xpix,int ypix)
}
-I32 terminal_speeds[] = {
+STATIC const I32 terminal_speeds[] = {
#ifdef B50
50, B50,
#endif
@@ -658,10 +663,12 @@ I32 terminal_speeds[] = {
-1,-1
};
-int getspeed(PerlIO *file,I32 *in, I32 *out)
+int getspeed(pTHX_ PerlIO *file,I32 *in, I32 *out)
{
int handle=PerlIO_fileno(file);
+#if defined(I_TERMIOS) || defined(I_TERMIO) || defined(I_SGTTY)
int i;
+#endif
# ifdef I_TERMIOS
/* Posixy stuff */
@@ -762,10 +769,10 @@ struct tbuffer {
#endif
#endif
-HV * filehash; /* Used to store the original terminal settings for each handle*/
-HV * modehash; /* Used to record the current terminal "mode" for each handle*/
+static HV * filehash; /* Used to store the original terminal settings for each handle*/
+static HV * modehash; /* Used to record the current terminal "mode" for each handle*/
-void ReadMode(PerlIO *file,int mode)
+void ReadMode(pTHX_ PerlIO *file,int mode)
{
dTHR;
int handle;
@@ -1450,7 +1457,7 @@ understand this syntax, either fix the checkwaiting call below, or define
DONT_USE_SELECT. */
#ifdef Have_select
-int selectfile(PerlIO *file,double delay)
+int selectfile(pTHX_ PerlIO *file,double delay)
{
struct timeval t;
int handle=PerlIO_fileno(file);
@@ -1479,7 +1486,7 @@ int selectfile(PerlIO *file,double delay)
}
#else
-int selectfile(PerlIO *file, double delay)
+int selectfile(pTHX_ PerlIO *file, double delay)
{
croak("select is not supported on this architecture");
return 0;
@@ -1487,7 +1494,7 @@ int selectfile(PerlIO *file, double delay)
#endif
#ifdef Have_nodelay
-int setnodelay(PerlIO *file, int mode)
+int setnodelay(pTHX_ PerlIO *file, int mode)
{
int handle=PerlIO_fileno(file);
int flags;
@@ -1501,7 +1508,7 @@ int setnodelay(PerlIO *file, int mode)
}
#else
-int setnodelay(PerlIO *file, int mode)
+int setnodelay(pTHX_ PerlIO *file, int mode)
{
croak("setnodelay is not supported on this architecture");
return 0;
@@ -1509,7 +1516,7 @@ int setnodelay(PerlIO *file, int mode)
#endif
#ifdef Have_poll
-int pollfile(PerlIO *file,double delay)
+int pollfile(pTHX_ pTHX_ PerlIO *file,double delay)
{
int handle=PerlIO_fileno(file);
struct pollfd fds;
@@ -1522,7 +1529,7 @@ int pollfile(PerlIO *file,double delay)
return (poll(&fds,1,(long)(delay * 1000.0))>0);
}
#else
-int pollfile(PerlIO *file,double delay)
+int pollfile(pTHX_ PerlIO *file,double delay)
{
croak("pollfile is not supported on this architecture");
return 0;
@@ -1567,7 +1574,7 @@ typedef struct {
goto again; \
} while (0)
-int Win32PeekChar(PerlIO *file,double delay,char *key)
+int Win32PeekChar(pTHX_ PerlIO *file,double delay,char *key)
{
int handle;
HANDLE whnd;
@@ -1611,7 +1618,7 @@ again:
}
if (delay > 0) {
- if (WaitForSingleObject(whnd, delay * 1000.0) != WAIT_OBJECT_0)
+ if (WaitForSingleObject(whnd, delay * 1000) != WAIT_OBJECT_0)
{
return FALSE;
}
@@ -1703,7 +1710,7 @@ again:
}
#else
-int Win32PeekChar(PerlIO *file, double delay,char *key)
+int Win32PeekChar(pTHX_ PerlIO *file, double delay,char *key)
{
croak("Win32PeekChar is not supported on this architecture");
return 0;
@@ -1711,7 +1718,7 @@ int Win32PeekChar(PerlIO *file, double delay,char *key)
#endif
-int blockoptions() {
+STATIC int blockoptions() {
return 0
#ifdef Have_nodelay
| 1
@@ -1728,7 +1735,7 @@ int blockoptions() {
;
}
-int termoptions() {
+STATIC int termoptions() {
int i=0;
#ifdef USE_TERMIOS
i=1;
@@ -1756,6 +1763,10 @@ int
selectfile(file,delay)
InputStream file
double delay
+CODE:
+ RETVAL = selectfile(aTHX_ file, delay);
+OUTPUT:
+ RETVAL
# Clever, eh?
void
@@ -1764,18 +1775,26 @@ SetReadMode(mode,file=STDIN)
InputStream file
CODE:
{
- ReadMode(file,mode);
+ ReadMode(aTHX_ file,mode);
}
int
setnodelay(file,mode)
InputStream file
int mode
+CODE:
+ RETVAL = setnodelay(aTHX_ file, mode);
+OUTPUT:
+ RETVAL
int
pollfile(file,delay)
InputStream file
double delay
+CODE:
+ RETVAL = pollfile(aTHX_ file, delay);
+OUTPUT:
+ RETVAL
SV *
Win32PeekChar(file, delay)
@@ -1784,7 +1803,7 @@ Win32PeekChar(file, delay)
CODE:
{
char key;
- if (Win32PeekChar(file, delay, &key))
+ if (Win32PeekChar(aTHX_ file, delay, &key))
RETVAL = newSVpv(&key, 1);
else
RETVAL = newSVsv(&PL_sv_undef);
@@ -1807,7 +1826,7 @@ GetTermSizeWin32(file=STDIN)
PPCODE:
{
int x,y,xpix,ypix;
- if( GetTermSizeWin32(file,&x,&y,&xpix,&ypix)==0)
+ if( GetTermSizeWin32(aTHX_ file,&x,&y,&xpix,&ypix)==0)
{
EXTEND(sp, 4);
PUSHs(sv_2mortal(newSViv((IV)x)));
@@ -1827,7 +1846,7 @@ GetTermSizeVIO(file=STDIN)
PPCODE:
{
int x,y,xpix,ypix;
- if( GetTermSizeVIO(file,&x,&y,&xpix,&ypix)==0)
+ if( GetTermSizeVIO(aTHX_ file,&x,&y,&xpix,&ypix)==0)
{
EXTEND(sp, 4);
PUSHs(sv_2mortal(newSViv((IV)x)));
@@ -1847,7 +1866,7 @@ GetTermSizeGWINSZ(file=STDIN)
PPCODE:
{
int x,y,xpix,ypix;
- if( GetTermSizeGWINSZ(file,&x,&y,&xpix,&ypix)==0)
+ if( GetTermSizeGWINSZ(aTHX_ file,&x,&y,&xpix,&ypix)==0)
{
EXTEND(sp, 4);
PUSHs(sv_2mortal(newSViv((IV)x)));
@@ -1867,7 +1886,7 @@ GetTermSizeGSIZE(file=STDIN)
PPCODE:
{
int x,y,xpix,ypix;
- if( GetTermSizeGSIZE(file,&x,&y,&xpix,&ypix)==0)
+ if( GetTermSizeGSIZE(aTHX_ file,&x,&y,&xpix,&ypix)==0)
{
EXTEND(sp, 4);
PUSHs(sv_2mortal(newSViv((IV)x)));
@@ -1890,7 +1909,7 @@ SetTerminalSize(width,height,xpix,ypix,file=STDIN)
InputStream file
CODE:
{
- RETVAL=SetTerminalSize(file,width,height,xpix,ypix);
+ RETVAL=SetTerminalSize(aTHX_ file,width,height,xpix,ypix);
}
OUTPUT:
RETVAL
@@ -1901,10 +1920,14 @@ GetSpeed(file=STDIN)
PPCODE:
{
I32 in,out;
+/*
+ * experimentally relaxed for
+ * https://rt.cpan.org/Ticket/Display.html?id=88050
if(items!=0) {
croak("Usage: Term::ReadKey::GetSpeed()");
}
- if(getspeed(file,&in,&out)) {
+*/
+ if(getspeed(aTHX_ file,&in,&out)) {
/* Failure */
ST( 0) = sv_newmortal();
} else {
diff --git a/gnu/usr.bin/perl/cpan/Term-ReadKey/SIGNATURE b/gnu/usr.bin/perl/cpan/Term-ReadKey/SIGNATURE
new file mode 100644
index 00000000000..2394f16c6de
--- /dev/null
+++ b/gnu/usr.bin/perl/cpan/Term-ReadKey/SIGNATURE
@@ -0,0 +1,41 @@
+This file contains message digests of all files listed in MANIFEST,
+signed via the Module::Signature module, version 0.81.
+
+To verify the content in this distribution, first make sure you have
+Module::Signature installed, then type:
+
+ % cpansign -v
+
+It will check each file's integrity, as well as the signature's
+validity. If "==> Signature verified OK! <==" is not displayed,
+the distribution may already have been compromised, and you should
+not run its Makefile.PL or Build.PL.
+
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
+SHA1 616229399c8babf4256fadad2571aad7d72a3ea8 Changes
+SHA1 87c9015c9692363397e1b5a8895db403bb6b24ad Configure.pm
+SHA1 fb4e59f63cf055ed8d1a7578d797b365c00ae276 MANIFEST
+SHA1 9bc08cea258bfe3fb880b2a5c7dd941a55d7860c MANIFEST.SKIP
+SHA1 0264821daf45fa82f1305fc31448e78f17d36432 META.json
+SHA1 4cc1f0b60a13222510e07f1aacf9e8c0609e6901 META.yml
+SHA1 fdcaac61068156a6823f79c61eed02942c012fda Makefile.PL
+SHA1 86fe91551c70c1899796cda79bb5c8d265d987aa README
+SHA1 463beea66445d64a7d7c877b234ecf8ad046f515 ReadKey.pm.PL
+SHA1 3bd8375779236d70dcc5c70aa269618b35a76a34 ReadKey.xs
+SHA1 c009e9a2bbd000588fbcba9a9ae08dfdaa1e8ad1 example/test.pl
+SHA1 f2e7df00c08c34872cedcce1746cc71d642c1d80 genchars.pl
+SHA1 58a50d6a9276b38cb76fae60561c2e1e9f95801b ppport.h
+SHA1 a4ac8dc9eee6dbc7f1522c733068c7ac1c31db61 t/01_basic.t
+SHA1 24ce32574887ccf5f7b3ec5619f840e5944d8c75 t/02_terminal_functions.t
+-----BEGIN PGP SIGNATURE-----
+
+iQEcBAEBAgAGBQJcMJqnAAoJECBWhy2NZBIANEQIAI7mZf0PDoA65wgUhSXXkQNv
+n/eWk5R6ykla6smZII5Jf7kwBThbwlIFXlGgr4Ub1SWnupXm82mcjMzk/Qpfl+au
+svGrr6c9S3uSliGTSwEq8LSjU7LDOkUDkCDx4fT88+4fQvWnagkMMxJ3UujNgyIa
+MmBFx5GqDJyakW85AK9KtMvUGFrXb9in/5ADkgrd0fuM607cn519ogUNejHnRL6y
+FLxguVH7WT8+0urUTIvK8VC4nU2t8Rng9z+NYATDYmA5/+DpEoRt35dJPwgqsVbk
+rZWt9zPaPMvnRPPK85FiAL6nvTWaXP1OoJu73OmamBTZC6ffdniKS74gH0V+7dc=
+=8p+z
+-----END PGP SIGNATURE-----
diff --git a/gnu/usr.bin/perl/cpan/Term-ReadKey/example/test.pl b/gnu/usr.bin/perl/cpan/Term-ReadKey/example/test.pl
index efbc866a14b..2c9489beb39 100644
--- a/gnu/usr.bin/perl/cpan/Term-ReadKey/example/test.pl
+++ b/gnu/usr.bin/perl/cpan/Term-ReadKey/example/test.pl
@@ -59,7 +59,8 @@ else
*IN = *IN; # Make single-use warning go away
$| = 1;
-my $size1 = join( ",", GetTerminalSize( \IN ) );
+# Bad filehandle: IN at ../lib/Term/ReadKey.pm line 377 with \IN and harness
+my $size1 = join( ",", GetTerminalSize( -t \IN ? \IN : "IN" ) );
my $size2 = join( ",", GetTerminalSize("IN") );
my $size3 = join( ",", GetTerminalSize(*IN) );
my $size4 = join( ",", GetTerminalSize( \*IN ) );
diff --git a/gnu/usr.bin/perl/cpan/Term-ReadKey/genchars.pl b/gnu/usr.bin/perl/cpan/Term-ReadKey/genchars.pl
index 0ea0fc37358..7f33df46154 100644
--- a/gnu/usr.bin/perl/cpan/Term-ReadKey/genchars.pl
+++ b/gnu/usr.bin/perl/cpan/Term-ReadKey/genchars.pl
@@ -1,14 +1,16 @@
#!/usr/bin/perl
-
#
-# $Id: genchars.pl,v 1.2 2016/07/03 01:07:58 afresh1 Exp $
+# $Id: genchars.pl,v 2.22 2005/01/11 21:15:17 jonathan Exp $
#
##############################
-$version="1.97";
+$version="1.98";
##############################
use Config;
+BEGIN { push @INC, "."; }
use Configure;
+use constant SILENT =>
+ (defined $ENV{MAKEFLAGS} and $ENV{MAKEFLAGS} =~ /\b(s|silent|quiet)\b/ ? 1 : 0);
#sub report {
# my($prog)=join(" ",@_);
@@ -88,19 +90,21 @@ open(CCHARS,">cchars.h") || die "Fatal error, Unable to write to cchars.h!";
);
print CCHARS "
+/* -*- buffer-read-only: t -*-
-/* Written by genchars.pl version $version */
+ This file is auto-generated. ***ANY*** changes here will be lost.
+ Written by genchars.pl version $version */
";
print CCHARS "#define HAVE_POLL_H\n" if CheckHeader("poll.h");
print CCHARS "#define HAVE_SYS_POLL_H\n" if CheckHeader("sys/poll.h");
-print "\n";
+print "\n" unless SILENT;
if(1) {
@values = sort { $possible{$a} cmp $possible{$b} or $a cmp $b } keys %possible;
- print "Writing termio/termios section of cchars.h... ";
+ print "Writing termio/termios section of cchars.h... " unless SILENT;
print CCHARS "
#ifdef CC_TERMIOS
@@ -129,9 +133,15 @@ if(1) {
# define LEGALMAXCC 126
#endif
+#ifdef XS_INTERNAL
+# define TRTXS(a) XS_INTERNAL(a)
+#else
+# define TRTXS(a) XS(a)
+#endif
+
#if defined(CC_TERMIO) || defined(CC_TERMIOS)
-char * cc_names[] = { ".join('',map("
+STATIC const char * const cc_names[] = { ".join('',map("
#if defined($_) && ($_ < LEGALMAXCC)
\"$possible{$_}\", "."
#else "."
@@ -139,13 +149,13 @@ char * cc_names[] = { ".join('',map("
#endif ", @values ))."
};
-const int MAXCC = 0 ",join('',map("
+STATIC const int MAXCC = 0 ",join('',map("
#if defined($_) && ($_ < LEGALMAXCC)
+1 /* $possible{$_} */
#endif ", @values ))."
;
-XS(XS_Term__ReadKey_GetControlChars)
+TRTXS(XS_Term__ReadKey_GetControlChars)
{
dXSARGS;
if (items < 0 || items > 1) {
@@ -182,7 +192,7 @@ PUSHs(sv_2mortal(newSVpv((char*)&s.c_cc[$values[$_]],1))); "."
}
}
-XS(XS_Term__ReadKey_SetControlChars)
+TRTXS(XS_Term__ReadKey_SetControlChars)
{
dXSARGS;
/*if ((items % 2) != 0) {
@@ -243,7 +253,7 @@ XS(XS_Term__ReadKey_SetControlChars)
";
- print "Done.\n";
+ print "Done.\n" unless SILENT;
}
@@ -252,9 +262,9 @@ undef %billy;
if(@ARGV) { # If any argument is supplied on the command-line don't check sgtty
$SGTTY=0; #skip tests
} else {
- print "Checking for sgtty...\n";
+ print "Checking for sgtty...\n" unless SILENT;
- $SGTTY = CheckStructure "sgttyb","sgtty.h";
+ $SGTTY = CheckStructure("sgttyb","sgtty.h");
# $SGTTY = !Compile("
##include <sgtty.h>
#struct sgttyb s;
@@ -271,7 +281,7 @@ if(@ARGV) { # If any argument is supplied on the command-line don't check sgtty
#ioctl(0,TIOCGETP,&s);
#}");
- print " Sgtty ",($SGTTY?"":"NOT "),"found.\n";
+ print " Sgtty ",($SGTTY?"":"NOT "),"found.\n" unless SILENT;
}
$billy{"ERASE"} = "s1.sg_erase";
@@ -280,27 +290,27 @@ $tchars=$ltchars=0;
if($SGTTY) {
- print "Checking sgtty...\n";
+ print "Checking sgtty...\n" unless SILENT;
- $tchars = CheckStructure "tchars","sgtty.h";
+ $tchars = CheckStructure("tchars","sgtty.h");
# $tchars = !report( '
##include <sgtty.h>
#struct tchars t;
#main() { ioctl(0,TIOCGETC,&t); }
#');
- print " tchars structure found.\n" if $tchars;
+ print " tchars structure found.\n" if $tchars and !SILENT;
- $ltchars = CheckStructure "ltchars","sgtty.h";
+ $ltchars = CheckStructure("ltchars","sgtty.h");
# $ltchars = !report( '
##include <sgtty.h>
#struct ltchars t;
#main() { ioctl(0,TIOCGLTC,&t); }
#');
- print " ltchars structure found.\n" if $ltchars;
+ print " ltchars structure found.\n" if $ltchars and !SILENT;
- print "Checking symbols\n";
+ print "Checking symbols\n" unless SILENT;
for $c (sort keys %possible2) {
@@ -312,7 +322,7 @@ if($SGTTY) {
#")) {
if($tchars and CheckField("tchars","t_$c","sgtty.h")) {
- print " t_$c ($possible2{$c}) found in tchars\n";
+ print " t_$c ($possible2{$c}) found in tchars\n" unless SILENT;
$billy{$possible2{$c}} = "s2.t_$c";
}
@@ -322,7 +332,7 @@ if($SGTTY) {
#main () { char c = s3.t_$c; }
#")) {
elsif($ltchars and CheckField("ltchars","t_$c","sgtty.h")) {
- print " t_$c ($possible2{$c}) found in ltchars\n";
+ print " t_$c ($possible2{$c}) found in ltchars\n" unless SILENT;
$billy{$possible2{$c}} = "s3.t_$c";
}
@@ -355,7 +365,7 @@ struct termstruct {
$struct .= "
};";
-print "Writing sgtty section of cchars.h... ";
+print "Writing sgtty section of cchars.h... " unless SILENT;
print CCHARS "
@@ -363,13 +373,13 @@ print "Writing sgtty section of cchars.h... ";
$struct
#define TermStructure struct termstruct
-char * cc_names[] = { ".join('',map("
+STATIC const char * const cc_names[] = { ".join('',map("
\"$_\", ", @values ))."
};
#define MAXCC ". ($#values+1)."
-XS(XS_Term__ReadKey_GetControlChars)
+TRTXS(XS_Term__ReadKey_GetControlChars)
{
dXSARGS;
if (items < 0 || items > 1) {
@@ -401,7 +411,7 @@ PUSHs(sv_2mortal(newSVpv(&s.$billy{$values[$_]},1))); ",0..$#values))."
}
}
-XS(XS_Term__ReadKey_SetControlChars)
+TRTXS(XS_Term__ReadKey_SetControlChars)
{
dXSARGS;
/*if ((items % 2) != 0) {
@@ -452,7 +462,7 @@ XS(XS_Term__ReadKey_SetControlChars)
#if !defined(CC_TERMIO) && !defined(CC_TERMIOS) && !defined(CC_SGTTY)
#define TermStructure int
-XS(XS_Term__ReadKey_GetControlChars)
+TRTXS(XS_Term__ReadKey_GetControlChars)
{
dXSARGS;
if (items <0 || items>1) {
@@ -466,7 +476,7 @@ XS(XS_Term__ReadKey_GetControlChars)
}
}
-XS(XS_Term__ReadKey_SetControlChars)
+TRTXS(XS_Term__ReadKey_SetControlChars)
{
dXSARGS;
if (items < 0 || items > 1) {
@@ -478,9 +488,10 @@ XS(XS_Term__ReadKey_SetControlChars)
#endif
+/* ex: set ro: */
";
-print "Done.\n";
+print "Done.\n" unless SILENT;
diff --git a/gnu/usr.bin/perl/cpan/Term-ReadKey/t/02_terminal_functions.t b/gnu/usr.bin/perl/cpan/Term-ReadKey/t/02_terminal_functions.t
index 09fe2e4b67d..e262c50229f 100644
--- a/gnu/usr.bin/perl/cpan/Term-ReadKey/t/02_terminal_functions.t
+++ b/gnu/usr.bin/perl/cpan/Term-ReadKey/t/02_terminal_functions.t
@@ -2,11 +2,20 @@ use strict;
use warnings;
-use Test::More tests => 7;
+use Test::More ;
+
+if ( -t STDIN ) {
+ plan tests => 7;
+}
+else {
+ plan skip_all => "Need a terminal to test";
+}
use Term::ReadKey;
use Fcntl;
+$| = 1;
+
if ( not exists $ENV{COLUMNS} ){
$ENV{COLUMNS} = 80;
$ENV{LINES} = 24;
@@ -29,24 +38,23 @@ SKIP:
}
}
};
- skip( 'Because Term::ReadKey need at least a tty to be useful', 1 ) if $@;
+ skip( 'Because Term::ReadKey need at least a tty to be useful', 7 ) if $@;
*IN = *IN; # Make single-use warning go away
$| = 1;
no strict "subs";
- my $size1 = join( ",", GetTerminalSize( \IN ) );
my $size2 = join( ",", GetTerminalSize("IN") );
my $size3 = join( ",", GetTerminalSize(*IN) );
my $size4 = join( ",", GetTerminalSize( \*IN ) );
my $size_result=0;
- if ( ( $size1 eq $size2 ) && ( $size2 eq $size3 ) && ( $size3 eq $size4 ) ){
+ if ( ( $size2 eq $size3 ) && ( $size3 eq $size4 ) ){
$size_result = 1;
}
is($size_result, 1, "Comparing TerminalSize IN");
my $usable_terminal=0;
for (my $i = 1; $i < 6; $i++){
- if ( &Term::ReadKey::termoptions() == $i ){
+ if ( Term::ReadKey::termoptions() == $i ){
$usable_terminal = 1;
last;
}
@@ -55,10 +63,10 @@ SKIP:
my @modes;
eval {
- push( @modes, "O_NODELAY" ) if &Term::ReadKey::blockoptions() & 1;
- push( @modes, "poll()" ) if &Term::ReadKey::blockoptions() & 2;
- push( @modes, "select()" ) if &Term::ReadKey::blockoptions() & 4;
- push( @modes, "Win32" ) if &Term::ReadKey::blockoptions() & 8;
+ push( @modes, "O_NODELAY" ) if Term::ReadKey::blockoptions() & 1;
+ push( @modes, "poll()" ) if Term::ReadKey::blockoptions() & 2;
+ push( @modes, "select()" ) if Term::ReadKey::blockoptions() & 4;
+ push( @modes, "Win32" ) if Term::ReadKey::blockoptions() & 8;
};
is($@, '', "Check non-blocking read");