diff options
| author | Jörg Sommrey <28217714+jo-37@users.noreply.github.com> | 2023-03-26 12:59:09 +0200 |
|---|---|---|
| committer | Jörg Sommrey <28217714+jo-37@users.noreply.github.com> | 2023-04-19 17:15:33 +0200 |
| commit | 8ecb35a8a99c82a4bf8e4000b5cf7d5fa292a701 (patch) | |
| tree | aac0bfb115236768efb66c4b8fb1cf35923def60 /challenge-029 | |
| parent | 61d50ade92975c7055cb75174f77be99857a65b8 (diff) | |
| download | perlweeklychallenge-club-8ecb35a8a99c82a4bf8e4000b5cf7d5fa292a701.tar.gz perlweeklychallenge-club-8ecb35a8a99c82a4bf8e4000b5cf7d5fa292a701.tar.bz2 perlweeklychallenge-club-8ecb35a8a99c82a4bf8e4000b5cf7d5fa292a701.zip | |
challenge 029 task 2
Diffstat (limited to 'challenge-029')
| -rw-r--r-- | challenge-029/jo-37/perl/CH_2/CH_2.xs | 15 | ||||
| -rw-r--r-- | challenge-029/jo-37/perl/CH_2/Changes | 6 | ||||
| -rw-r--r-- | challenge-029/jo-37/perl/CH_2/MANIFEST | 8 | ||||
| -rw-r--r-- | challenge-029/jo-37/perl/CH_2/Makefile.PL | 19 | ||||
| -rw-r--r-- | challenge-029/jo-37/perl/CH_2/README | 27 | ||||
| -rw-r--r-- | challenge-029/jo-37/perl/CH_2/lib/CH_2.pm | 71 | ||||
| -rw-r--r-- | challenge-029/jo-37/perl/CH_2/ppport.h | 10737 | ||||
| -rw-r--r-- | challenge-029/jo-37/perl/CH_2/t/CH_2.t | 18 | ||||
| -rwxr-xr-x | challenge-029/jo-37/perl/ch-2.sh | 25 |
9 files changed, 10926 insertions, 0 deletions
diff --git a/challenge-029/jo-37/perl/CH_2/CH_2.xs b/challenge-029/jo-37/perl/CH_2/CH_2.xs new file mode 100644 index 0000000000..4db29d25e0 --- /dev/null +++ b/challenge-029/jo-37/perl/CH_2/CH_2.xs @@ -0,0 +1,15 @@ +#define PERL_NO_GET_CONTEXT +#include "EXTERN.h" +#include "perl.h" +#include "XSUB.h" + +#include "ppport.h" + +#include <math.h> + +MODULE = CH_2 PACKAGE = CH_2 + +double +erf(x) + double x + PROTOTYPE: $ diff --git a/challenge-029/jo-37/perl/CH_2/Changes b/challenge-029/jo-37/perl/CH_2/Changes new file mode 100644 index 0000000000..978f5f1323 --- /dev/null +++ b/challenge-029/jo-37/perl/CH_2/Changes @@ -0,0 +1,6 @@ +Revision history for Perl extension CH_2. + +0.01 Mon Mar 27 21:41:38 2023 + - original version; created by h2xs 1.23 with options + -A -n CH_2 + diff --git a/challenge-029/jo-37/perl/CH_2/MANIFEST b/challenge-029/jo-37/perl/CH_2/MANIFEST new file mode 100644 index 0000000000..7e402cb23d --- /dev/null +++ b/challenge-029/jo-37/perl/CH_2/MANIFEST @@ -0,0 +1,8 @@ +CH_2.xs +Changes +Makefile.PL +MANIFEST +ppport.h +README +t/CH_2.t +lib/CH_2.pm diff --git a/challenge-029/jo-37/perl/CH_2/Makefile.PL b/challenge-029/jo-37/perl/CH_2/Makefile.PL new file mode 100644 index 0000000000..8f63b3f186 --- /dev/null +++ b/challenge-029/jo-37/perl/CH_2/Makefile.PL @@ -0,0 +1,19 @@ +use 5.032001; +use ExtUtils::MakeMaker; +# See lib/ExtUtils/MakeMaker.pm for details of how to influence +# the contents of the Makefile that is written. +WriteMakefile( + NAME => 'CH_2', + VERSION_FROM => 'lib/CH_2.pm', # finds $VERSION, requires EU::MM from perl >= 5.5 + PREREQ_PM => {}, # e.g., Module::Name => 1.1 + ABSTRACT_FROM => 'lib/CH_2.pm', # retrieve abstract from module + AUTHOR => 'Jörg Sommrey <jo@>', + #LICENSE => 'perl', + #Value must be from legacy list of licenses here + #https://metacpan.org/pod/Module::Build::API + LIBS => [''], # e.g., '-lm' + DEFINE => '', # e.g., '-DHAVE_SOMETHING' + INC => '-I.', # e.g., '-I. -I/usr/include/other' + # Un-comment this if you add C files to link with later: + # OBJECT => '$(O_FILES)', # link all the C files too +); diff --git a/challenge-029/jo-37/perl/CH_2/README b/challenge-029/jo-37/perl/CH_2/README new file mode 100644 index 0000000000..3b49061c64 --- /dev/null +++ b/challenge-029/jo-37/perl/CH_2/README @@ -0,0 +1,27 @@ +CH_2 version 0.01 +================= + +INSTALLATION + +To install this module type the following: + + perl Makefile.PL + make + make test + make install + +DEPENDENCIES + +This module requires these other modules and libraries: + + none. + +COPYRIGHT AND LICENCE + +Copyright (C) 2023 by Jörg Sommrey + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.32.1 or, +at your option, any later version of Perl 5 you may have available. + + diff --git a/challenge-029/jo-37/perl/CH_2/lib/CH_2.pm b/challenge-029/jo-37/perl/CH_2/lib/CH_2.pm new file mode 100644 index 0000000000..e8ddd7f450 --- /dev/null +++ b/challenge-029/jo-37/perl/CH_2/lib/CH_2.pm @@ -0,0 +1,71 @@ +package CH_2; + +use 5.032001; +use strict; +use warnings; + +require Exporter; + +our @ISA = qw(Exporter); + +# Items to export into callers namespace by default. Note: do not export +# names by default without a very good reason. Use EXPORT_OK instead. +# Do not simply export all your public functions/methods/constants. + +# This allows declaration use CH_2 ':all'; +# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK +# will save memory. +our %EXPORT_TAGS = ( 'all' => [ qw( + erf +) ] ); + +our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); + +our @EXPORT = qw( +); + +our $VERSION = '0.01'; + +require XSLoader; +XSLoader::load('CH_2', $VERSION); + +# Preloaded methods go here. + +1; +__END__ +# Below is stub documentation for your module. You'd better edit it! + +=encoding utf-8 + +=head1 NAME + +CH_2 - Perl extension for erf + +=head1 SYNOPSIS + + use CH_2 ':all'; + $erf = erf $x; + +=head1 DESCRIPTION + +This module demonstrates the call of a C library function from +perl. The only function provided is C<erf> + +=head2 EXPORT + +This module exports C<erf> on request. + +=head1 AUTHOR + +Jörg Sommrey, E<lt>jo@E<gt> + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2023 by Jörg Sommrey + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.32.1 or, +at your option, any later version of Perl 5 you may have available. + + +=cut diff --git a/challenge-029/jo-37/perl/CH_2/ppport.h b/challenge-029/jo-37/perl/CH_2/ppport.h new file mode 100644 index 0000000000..7b40e23917 --- /dev/null +++ b/challenge-029/jo-37/perl/CH_2/ppport.h @@ -0,0 +1,10737 @@ +#if 0 +<<'SKIP'; +#endif +/* +---------------------------------------------------------------------- + + ppport.h -- Perl/Pollution/Portability Version 3.57 + + Automatically created by Devel::PPPort running under perl 5.032001. + + Do NOT edit this file directly! -- Edit PPPort_pm.PL and the + includes in parts/inc/ instead. + + Use 'perldoc ppport.h' to view the documentation below. + +---------------------------------------------------------------------- + +SKIP + +=pod + +=head1 NAME + +ppport.h - Perl/Pollution/Portability version 3.57 + +=head1 SYNOPSIS + + perl ppport.h [options] [source files] + + Searches current directory for files if no [source files] are given + + --help show short help + + --version show version + + --patch=file write one patch file with changes + --copy=suffix write changed copies with suffix + --diff=program use diff program and options + + --compat-version=version provide compatibility with Perl version + --cplusplus accept C++ comments + + --quiet don't output anything except fatal errors + --nodiag don't show diagnostics + --nohints don't show hints + --nochanges don't suggest changes + --nofilter don't filter input files + + --strip strip all script and doc functionality + from ppport.h + + --list-provided list provided API + --list-unsupported list unsupported API + --api-info=name show Perl API portability information + +=head1 COMPATIBILITY + +This version of F<ppport.h> is designed to support operation with Perl +installations back to 5.003_07, and has been tested up to 5.31.6. + +=head1 OPTIONS + +=head2 --help + +Display a brief usage summary. + +=head2 --version + +Display the version of F<ppport.h>. + +=head2 --patch=I<file> + +If this option is given, a single patch file will be created if +any changes are suggested. This requires a working diff program +to be installed on your system. + +=head2 --copy=I<suffix> + +If this option is given, a copy of each file will be saved with +the given suffix that contains the suggested changes. This does +not require any external programs. Note that this does not +automagically add a dot between the original filename and the +suffix. If you want the dot, you have to include it in the option +argument. + +If neither C<--patch> or C<--copy> are given, the default is to +simply print the diffs for each file. This requires either +C<Text::Diff> or a C<diff> program to be installed. + +=head2 --diff=I<program> + +Manually set the diff program and options to use. The default +is to use C<Text::Diff>, when installed, and output unified +context diffs. + +=head2 --compat-version=I<version> + +Tell F<ppport.h> to check for compatibility with the given +Perl version. The default is to check for compatibility with Perl +version 5.003_07. You can use this option to reduce the output +of F<ppport.h> if you intend to be backward compatible only +down to a certain Perl version. + +=head2 --cplusplus + +Usually, F<ppport.h> will detect C++ style comments and +replace them with C style comments for portability reasons. +Using this option instructs F<ppport.h> to leave C++ +comments untouched. + +=head2 --quiet + +Be quiet. Don't print anything except fatal errors. + +=head2 --nodiag + +Don't output any diagnostic messages. Only portability +alerts will be printed. + +=head2 --nohints + +Don't output any hints. Hints often contain useful portability +notes. Warnings will still be displayed. + +=head2 --nochanges + +Don't suggest any changes. Only give diagnostic output and hints +unless these are also deactivated. + +=head2 --nofilter + +Don't filter the list of input files. By default, files not looking +like source code (i.e. not *.xs, *.c, *.cc, *.cpp or *.h) are skipped. + +=head2 --strip + +Strip all script and documentation functionality from F<ppport.h>. +This reduces the size of F<ppport.h> dramatically and may be useful +if you want to include F<ppport.h> in smaller modules without +increasing their distribution size too much. + +The stripped F<ppport.h> will have a C<--unstrip> option that allows +you to undo the stripping, but only if an appropriate C<Devel::PPPort> +module is installed. + +=head2 --list-provided + +Lists the API elements for which compatibility is provided by +F<ppport.h>. Also lists if it must be explicitly requested, +if it has dependencies, and if there are hints or warnings for it. + +=head2 --list-unsupported + +Lists the API elements that are known not to be supported by +F<ppport.h> and below which version of Perl they probably +won't be available or work. + +=head2 --api-info=I<name> + +Show portability information for API elements matching I<name>. +If I<name> is surrounded by slashes, it is interpreted as a regular +expression. + +=head1 DESCRIPTION + +In order for a Perl extension (XS) module to be as portable as possible +across differing versions of Perl itself, certain steps need to be taken. + +=over 4 + +=item * + +Including this header is the first major one. This alone will give you +access to a large part of the Perl API that hasn't been available in +earlier Perl releases. Use + + perl ppport.h --list-provided + +to see which API elements are provided by ppport.h. + +=item * + +You should avoid using deprecated parts of the API. For example, using +global Perl variables without the C<PL_> prefix is deprecated. Also, +some API functions used to have a C<perl_> prefix. Using this form is +also deprecated. You can safely use the supported API, as F<ppport.h> +will provide wrappers for older Perl versions. + +=item * + +If you use one of a few functions or variables that were not present in +earlier versions of Perl, and that can't be provided using a macro, you +have to explicitly request support for these functions by adding one or +more C<#define>s in your source code before the inclusion of F<ppport.h>. + +These functions or variables will be marked C<explicit> in the list shown +by C<--list-provided>. + +Depending on whether you module has a single or multiple files that +use such functions or variables, you want either C<static> or global +variants. + +For a C<static> function or variable (used only in a single source +file), use: + + #define NEED_function + #define NEED_variable + +For a global function or variable (used in multiple source files), +use: + + #define NEED_function_GLOBAL + #define NEED_variable_GLOBAL + +Note that you mustn't have more than one global request for the +same function or variable in your project. + + Function / Variable Static Request Global Request + ----------------------------------------------------------------------------------------- + caller_cx() NEED_caller_cx NEED_caller_cx_GLOBAL + croak_xs_usage() NEED_croak_xs_usage NEED_croak_xs_usage_GLOBAL + die_sv() NEED_die_sv NEED_die_sv_GLOBAL + eval_pv() NEED_eval_pv NEED_eval_pv_GLOBAL + grok_bin() NEED_grok_bin NEED_grok_bin_GLOBAL + grok_hex() NEED_grok_hex NEED_grok_hex_GLOBAL + grok_number() NEED_grok_number NEED_grok_number_GLOBAL + grok_numeric_radix() NEED_grok_numeric_radix NEED_grok_numeric_radix_GLOBAL + grok_oct() NEED_grok_oct NEED_grok_oct_GLOBAL + load_module() NEED_load_module NEED_load_module_GLOBAL + mess() NEED_mess NEED_mess_GLOBAL + mess_nocontext() NEED_mess_nocontext NEED_mess_nocontext_GLOBAL + mess_sv() NEED_mess_sv NEED_mess_sv_GLOBAL + mg_findext() NEED_mg_findext NEED_mg_findext_GLOBAL + my_snprintf() NEED_my_snprintf NEED_my_snprintf_GLOBAL + my_sprintf() NEED_my_sprintf NEED_my_sprintf_GLOBAL + my_strlcat() NEED_my_strlcat NEED_my_strlcat_GLOBAL + my_strlcpy() NEED_my_strlcpy NEED_my_strlcpy_GLOBAL + my_strnlen() NEED_my_strnlen NEED_my_strnlen_GLOBAL + newCONSTSUB() NEED_newCONSTSUB NEED_newCONSTSUB_GLOBAL + newSVpvn_share() NEED_newSVpvn_share NEED_newSVpvn_share_GLOBAL + PL_parser NEED_PL_parser NEED_PL_parser_GLOBAL + PL_signals NEED_PL_signals NEED_PL_signals_GLOBAL + pv_display() NEED_pv_display NEED_pv_display_GLOBAL + pv_escape() NEED_pv_escape NEED_pv_escape_GLOBAL + pv_pretty() NEED_pv_pretty NEED_pv_pretty_GLOBAL + sv_catpvf_mg() NEED_sv_catpvf_mg NEED_sv_catpvf_mg_GLOBAL + sv_catpvf_mg_nocontext() NEED_sv_catpvf_mg_nocontext NEED_sv_catpvf_mg_nocontext_GLOBAL + sv_setpvf_mg() NEED_sv_setpvf_mg NEED_sv_setpvf_mg_GLOBAL + sv_setpvf_mg_nocontext() NEED_sv_setpvf_mg_nocontext NEED_sv_setpvf_mg_nocontext_GLOBAL + sv_unmagicext() NEED_sv_unmagicext NEED_sv_unmagicext_GLOBAL + utf8_to_uvchr_buf() NEED_utf8_to_uvchr_buf NEED_utf8_to_uvchr_buf_GLOBAL + vload_module() NEED_vload_module NEED_vload_module_GLOBAL + vmess() NEED_vmess NEED_vmess_GLOBAL + warner() NEED_warner NEED_warner_GLOBAL + +To avoid namespace conflicts, you can change the namespace of the +explicitly exported functions / variables using the C<DPPP_NAMESPACE> +macro. Just C<#define> the macro before including C<ppport.h>: + + #define DPPP_NAMESPACE MyOwnNamespace_ + #include "ppport.h" + +The default namespace is C<DPPP_>. + +=back + +The good thing is that most of the above can be checked by running +F<ppport.h> on your source code. See the next section for +details. + +=head1 EXAMPLES + +To verify whether F<ppport.h> is needed for your module, whether you +should make any changes to your code, and whether any special defines +should be used, F<ppport.h> can be run as a Perl script to check your +source code. Simply say: + + perl ppport.h + +The result will usually be a list of patches suggesting changes +that should at least be acceptable, if not necessarily the most +efficient solution, or a fix for all possible problems. + +If you know that your XS module uses features only available in +newer Perl releases, if you're aware that it uses C++ comments, +and if you want all suggestions as a single patch file, you could +use something like this: + + perl ppport.h --compat-version=5.6.0 --cplusplus --patch=test.diff + +If you only want your code to be scanned without any suggestions +for changes, use: + + perl ppport.h --nochanges + +You can specify a different C<diff> program or options, using +the C<--diff> option: + + perl ppport.h --diff='diff -C 10' + +This would output context diffs with 10 lines of context. + +If you want to create patched copies of your files instead, use: + + perl ppport.h --copy=.new + +To display portability information for the C<newSVpvn> function, +use: + + perl ppport.h --api-info=newSVpvn + +Since the argument to C<--api-info> can be a regular expression, +you can use + + perl ppport.h --api-info=/_nomg$/ + +to display portability information for all C<_nomg> functions or + + perl ppport.h --api-info=/./ + +to display information for all known API elements. + +=head1 BUGS + +Some of the suggested edits and/or generated patches may not compile as-is +without tweaking manually. This is generally due to the need for an extra +parameter to be added to the call to prevent buffer overflow. + +If this version of F<ppport.h> is causing failure during +the compilation of this module, please check if newer versions +of either this module or C<Devel::PPPort> are available on CPAN +before sending a bug report. + +If F<ppport.h> was generated using the latest version of +C<Devel::PPPort> and is causing failure of this module, please +send a bug report to L<perlbug@perl.org|mailto:perlbug@perl.org>. + +Please include the following information: + +=over 4 + +=item 1. + +The complete output from running "perl -V" + +=item 2. + +This file. + +=item 3. + +The name and version of the module you were trying to build. + +=item 4. + +A full log of the build that failed. + +=item 5. + +Any other information that you think could be relevant. + +=back + +For the latest version of this code, please get the C<Devel::PPPort> +module from CPAN. + +=head1 COPYRIGHT + +Version 3.x, Copyright (c) 2004-2013, Marcus Holland-Moritz. + +Version 2.x, Copyright (C) 2001, Paul Marquess. + +Version 1.x, Copyright (C) 1999, Kenneth Albanowski. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +=head1 SEE ALSO + +See L<Devel::PPPort>. + +=cut + +# These are tools that must be included in ppport.h. It doesn't work if given +# a .pl suffix + +sub format_version +{ + # Given an input version that is acceptable to parse_version(), return a + # string of the standard representation of it. + + my($r,$v,$s) = parse_version(shift); + + if ($r < 5 || ($r == 5 && $v < 6)) { + my $ver = sprintf "%d.%03d", $r, $v; + $s > 0 and $ver .= sprintf "_%02d", $s; + + return $ver; + } + + return sprintf "%d.%d.%d", $r, $v, $s; +} + +sub parse_version +{ + # Returns a triplet, (5, major, minor) from the input, treated as a string, + # which can be in any of several typical formats. + + my $ver = shift; + $ver = "" unless defined $ver; + + my($r,$v,$s); + + if ( ($r, $v, $s) = $ver =~ /^(5)(\d{3})(\d{3})$/ # 5029010, from the file + # names in our + # parts/base/ and + # parts/todo directories + or ($r, $v, $s) = $ver =~ /^(\d+)\.(\d+)\.(\d+)$/ # 5.25.7 + or ($r, $v, $s) = $ver =~ /^(\d+)\.(\d{3})(\d{3})$/ # 5.025008, from the + # output of $] + or ($r, $v, $s) = $ver =~ /^(\d+)\.(\d{1,3})()$/ # 5.24, 5.004 + or ($r, $v, $s) = $ver =~ /^(\d+)\.(00[1-5])_?(\d{2})$/ # 5.003_07 + ) { + + $s = 0 unless $s; + + die "Only Perl 5 is supported '$ver'\n" if $r != 5; + die "Invalid version number: $ver\n" if $v >= 1000 || $s >= 1000; + return (5, 0 + $v, 0 + $s); + } + + # For some safety, don't assume something is a version number if it has a + # literal dot as one of the three characters. This will have to be fixed + # when we reach 5.46 + if ($ver !~ /\./ && (($r, $v, $s) = $ver =~ /^(.)(.)(.)$/)) # vstring 5.25.7 + { + $r = ord $r; + $v = ord $v; + $s = ord $s; + + die "Only Perl 5 is supported '$ver'\n" if $r != 5; + return (5, $v, $s); + } + + my $mesg = ""; + $mesg = ". (In 5.00x_yz, x must be 1-5.)" if $ver =~ /_/; + die "Invalid version number format: '$ver'$mesg\n"; +} + +sub int_parse_version +{ + # Returns integer 7 digit human-readable version, suitable for use in file + # names in parts/todo parts/base. + + return 0 + join "", map { sprintf("%03d", $_) } parse_version(shift); +} + +sub ivers # Shorter name for int_parse_version +{ + return int_parse_version(shift); +} + +sub format_version_line +{ + # Returns a floating point representation of the input version + + my $version = int_parse_version(shift); + $version =~ s/^5\B/5./; + return $version; +} + +sub dictionary_order($$) # Sort caselessly, ignoring punct +{ + my ($lc_a, $lc_b); + my ($squeezed_a, $squeezed_b); + my ($valid_a, $valid_b); # Meaning valid for all releases + + # On early perls, the implicit pass by reference doesn't work, so we have + # to use the globals to initialize. + if ("$]" < "5.006" ) { + $valid_a = $a; $valid_b = $b; + } + else { + ($valid_a, $valid_b) = @_; + } + + $lc_a = lc $valid_a; + $lc_b = lc $valid_b; + + $squeezed_a = $lc_a; + $squeezed_a =~ s/[\W_]//g; # No punct, including no underscore + $squeezed_b = $lc_b; + $squeezed_b =~ s/[\W_]//g; + + return( $squeezed_a cmp $squeezed_b + or $lc_a cmp $lc_b + or $valid_a cmp $valid_b); +} + +sub sort_api_lines # Sort lines of the form flags|return|name|args... + # by 'name' +{ + $a =~ / ^ [^|]* \| [^|]* \| (\w+) /x; # 3rd field '|' is sep + my $a_name = $1; + $b =~ / ^ [^|]* \| [^|]* \| (\w+) /x; + my $b_name = $1; + return dictionary_order($a_name, $b_name); +} + +1; + +use strict; + +BEGIN { require warnings if "$]" > '5.006' } + +# Disable broken TRIE-optimization +BEGIN { eval '${^RE_TRIE_MAXBUF} = -1' if "$]" >= 5.009004 && "$]" <= 5.009005 } + +my $VERSION = 3.57; + +my %opt = ( + quiet => 0, + diag => 1, + hints => 1, + changes => 1, + cplusplus => 0, + filter => 1, + strip => 0, + version => 0, +); + +my($ppport) = $0 =~ /([\w.]+)$/; +my $LF = '(?:\r\n|[\r\n])'; # line feed +my $HS = "[ \t]"; # horizontal whitespace + +# Never use C comments in this file! +my $ccs = '/'.'*'; +my $cce = '*'.'/'; +my $rccs = quotemeta $ccs; +my $rcce = quotemeta $cce; + +eval { + require Getopt::Long; + Getopt::Long::GetOptions(\%opt, qw( + help quiet diag! filter! hints! changes! cplusplus strip version + patch=s copy=s diff=s compat-version=s + list-provided list-unsupported api-info=s + )) or usage(); +}; + +if ($@ and grep /^-/, @ARGV) { + usage() if "@ARGV" =~ /^--?h(?:elp)?$/; + die "Getopt::Long not found. Please don't use any options.\n"; +} + +if ($opt{version}) { + print "This is $0 $VERSION.\n"; + exit 0; +} + +usage() if $opt{help}; +strip() if $opt{strip}; + +$opt{'compat-version'} = 5.003_07 unless exists $opt{'compat-version'}; +$opt{'compat-version'} = int_parse_version($opt{'compat-version'}); + +my $int_min_perl = int_parse_version(5.003_07); + +# Each element of this hash looks something like: +# 'Poison' => { +# 'base' => '5.008000', +# 'provided' => 1, +# 'todo' => '5.003007' +# }, +my %API = map { /^(\w+)\|([^|]*)\|([^|]*)\|(\w*)$/ + ? ( $1 => { + ($2 ? ( base => $2 ) : ()), + ($3 ? ( todo => $3 ) : ()), + (index($4, 'v') >= 0 ? ( varargs => 1 ) : ()), + (index($4, 'p') >= 0 ? ( provided => 1 ) : ()), + (index($4, 'n') >= 0 ? ( noTHXarg => 1 ) : ()), + (index($4, 'c') >= 0 ? ( core_only => 1 ) : ()), + (index($4, 'd') >= 0 ? ( deprecated => 1 ) : ()), + (index($4, 'i') >= 0 ? ( inaccessible => 1 ) : ()), + (index($4, 'x') >= 0 ? ( experimental => 1 ) : ()), + (index($4, 'u') >= 0 ? ( undocumented => 1 ) : ()), + (index($4, 'o') >= 0 ? ( ppport_fnc => 1 ) : ()), + (index($4, 'V') >= 0 ? ( unverified => 1 ) : ()), + } ) + : die "invalid spec: $_" } qw( +abort_execution|5.025010||Viu +add_above_Latin1_folds|5.021001||Viu +add_cp_to_invlist|5.013011||Viu +add_data|5.005000||nViu +add_multi_match|5.021004||Viu +_add_range_to_invlist|5.016000||cViu +add_utf16_textfilter|5.011001||Viu +adjust_size_and_find_bucket|5.019003||nViu +advance_one_LB|5.023007||Viu +advance_one_SB|5.021009||Viu +advance_one_WB|5.021009||Viu +alloccopstash|5.017001|5.017001|x +alloc_LOGOP|5.025004||xViu +allocmy|5.008001||Viu +amagic_call|5.003007|5.003007|u +amagic_cmp|5.009003||Viu +amagic_cmp_locale|5.009003||Viu +amagic_deref_call|5.013007|5.013007|u +amagic_i_ncmp|5.009003||Viu +amagic_is_enabled|5.015008||Viu +amagic_ncmp|5.009003||Viu +_aMY_CXT|5.009000|5.009000|p +aMY_CXT_|5.009000|5.009000|p +aMY_CXT|5.009000|5.009000|p +anonymise_cv_maybe|5.013003||Viu +any_dup|5.006000||Vu +ao|5.005000||Viu +_append_range_to_invlist|5.013010||Viu +append_utf8_from_native_byte|5.019004||ncViu +apply|5.003007||Viu +apply_attrs|5.006000||Viu +apply_attrs_my|5.007003||Viu +apply_attrs_string|5.006001|5.006001|xu +ARCHNAME|5.004000|5.004000| +argvout_final|5.029006||Viu +ASCII_TO_NEED|5.019004||ndcVu +__ASSERT_|5.019007|5.008008|p +assert_uft8_cache_coherent|5.013003||Viu +assignment_type|5.021005||Viu +atfork_lock|5.007002|5.007002|nu +atfork_unlock|5.007002|5.007002|nu +aTHX_|5.006000|5.003007|p +aTHX|5.006000|5.003007|p +aTHXR_||5.003007|pou +aTHXR||5.003007|pou +av_arylen_p|5.009003|5.009003|u +av_clear|5.003007|5.003007| +av_create_and_push|5.009005|5.009005|x +av_create_and_unshift_one|5.009005|5.009005|x +av_delete|5.006000|5.006000| +av_exists|5.006000|5.006000| +av_extend|5.003007|5.003007| +av_extend_guts|5.017004||Viu +av_fetch|5.003007|5.003007| +av_fill|5.003007|5.003007| +AvFILL|5.003007|5.003007| +AvFILLp|5.004005|5.003007|poV +av_iter_p|5.011000|5.011000|u +av_len|5.003007|5.003007| +av_make|5.003007|5.003007| +av_nonelem|5.027009||Viu +av_pop|5.003007|5.003007| +av_push|5.003007|5.003007| +av_reify|5.004004||cViu +av_shift|5.003007|5.003007| +av_store|5.003007|5.003007| +av_tindex|5.017009|5.003007|p +av_top_index|5.017009|5.003007|p +av_undef|5.003007|5.003007| +av_unshift|5.003007|5.003007| +ax|5.003007|5.003007| +backup_one_GCB|5.025003||Viu +backup_one_LB|5.023007||Viu +backup_one_SB|5.021009||Viu +backup_one_WB|5.021009||Viu +bad_type_gv|5.019002||Viu +bad_type_pv|5.016000||Viu +BhkDISABLE|||x +BhkENABLE|||x +BhkENTRY_set|||x +BhkENTRY|||xi +BhkFLAGS|||xi +BIN|5.003007|5.003007| +bind_match|5.003007||Viu +block_end|5.004000|5.004000| +block_gimme|5.004000|5.004000|u +blockhook_register|5.013003|5.013003|x +block_start|5.004000|5.004000| +BOM_UTF8|5.025005|5.003007|p +boolSV|5.004000|5.003007|p +boot_core_mro|5.009005||Viu +boot_core_PerlIO|5.007002||Viu +boot_core_UNIVERSAL|5.003007||Viu +_byte_dump_string|5.025006||cViu +BYTEORDER|5.003007|5.003007| +bytes_cmp_utf8|5.013007|5.013007| +bytes_from_utf8|5.007001|5.007001|x +bytes_from_utf8_loc|5.027001|5.027001|nxu +bytes_to_utf8|5.006001|5.006001|x +call_argv|5.006000|5.003007|p +call_atexit|5.006000|5.006000|u +CALL_BLOCK_HOOKS|||xi +CALL_CHECKER_REQUIRE_GV|5.021004|5.021004| +caller_cx|5.013005|5.006000|p +call_list|5.004000|5.004000|u +call_method|5.006000|5.003007|p +calloc|5.007002|5.007002|n +call_pv|5.006000|5.003007|p +call_sv|5.006000|5.003007|p +cando|5.003007||Viu +C_ARRAY_END|5.013002|5.003007|p +C_ARRAY_LENGTH|5.008001|5.003007|p +CASTFLAGS|5.003007|5.003007| +cast_i32|5.006000|5.006000|nu +cast_iv|5.006000|5.006000|nu +cast_ulong|5.006000|5.006000|nu +cast_uv|5.006000|5.006000|nu +category_name|5.027008||nViu +cBOOL|5.013000|5.003007|p +change_engine_size|5.029004||Viu +CHARBITS|5.011002|5.011002| +checkcomma|5.003007||Viu +check_locale_boundary_crossing|5.015006||Viu +check_type_and_open|5.009003||Viu +check_uni|5.003007||Viu +check_utf8_print|5.013009||Viu +ck_entersub_args_core|||iu +ck_entersub_args_list|5.013006|5.013006| +ck_entersub_args_proto|5.013006|5.013006| +ck_entersub_args_proto_or_list|5.013006|5.013006| +ckWARN2|5.006000|5.006000| +ckWARN2_d|5.006000|5.006000| +ckWARN3|5.007003|5.007003| +ckWARN3_d|5.007003|5.007003| +ckWARN4|5.007003|5.007003| +ckWARN4_d|5.007003|5.007003| +ckWARN|5.006000|5.003007|p +ckwarn|5.009003|5.009003|u +ckwarn_common|5.011001||Viu +ckWARN_d|5.006000|5.006000| +ckwarn_d|5.009003|5.009003|u +ck_warner|5.011001|5.011001|vu +ck_warner_d|5.011001|5.011001|vu +CLASS||5.003007| +clear_defarray|5.023008|5.023008|u +CLEAR_ERRSV|5.025007|5.025007| +clear_placeholders|5.009004||xViu +clear_special_blocks|5.021003||Viu +clone_params_del|5.013002|5.013002|nu +clone_params_new|5.013002|5.013002|nu +closest_cop|5.007002||Viu +cntrl_to_mnemonic|5.021004||ncViu +compute_EXACTish|5.017003||nViu +construct_ahocorasick_from_trie|5.021001||Viu +cop_fetch_label|5.015001|5.015001|x +CopFILE|5.006000||pVu +CopFILEAV|5.006000||pVu +CopFILEGV|5.006000||pVu +CopFILEGV_set|5.006000||pVu +CopFILE_set|5.006000||pVu +CopFILESV|5.006000||pVu +cop_free|5.006000||Viu +cophh_2hv|5.013007|5.013007|x +cophh_copy|5.013007|5.013007|x +cophh_delete_pv|5.013007|5.013007|x +cophh_delete_pvn|5.013007|5.013007|x +cophh_delete_pvs|5.013007|5.013007|x +cophh_delete_sv|5.013007|5.013007|x +cophh_fetch_pv|5.013007|5.013007|x +cophh_fetch_pvn|5.013007|5.013007|x +cophh_fetch_pvs|5.013007|5.013007|x +cophh_fetch_sv|5.013007|5.013007|x +cophh_free|5.013007|5.013007|x +COPHH_KEY_UTF8|5.013007|5.013007| +cophh_new_empty|5.013007|5.013007|x +cophh_store_pv|5.013007|5.013007|x +cophh_store_pvn|5.013007|5.013007|x +cophh_store_pvs|5.013007|5.013007|x +cophh_store_sv|5.013007|5.013007|x +cop_hints_2hv|5.013007|5.013007| +cop_hints_fetch_pv|5.013007|5.013007| +cop_hints_fetch_pvn|5.013007|5.013007| +cop_hints_fetch_pvs|5.013007|5.013007| +cop_hints_fetch_sv|5.013007|5.013007| +CopLABEL|5.009005|5.009005| +CopLABEL_len|5.016000|5.016000| +CopLABEL_len_flags|5.016000|5.016000| +CopSTASH|5.006000||pVu +CopSTASH_eq|5.006000||pVu +CopSTASHPV|5.006000||pVu +CopSTASHPV_set|5.006000||pVu +CopSTASH_set|5.006000||pVu +cop_store_label|5.015001|5.015001|x +Copy|5.003007|5.003007| +CopyD|5.009002|5.003007|p +core_prototype|5.015002||Vi +coresub_op|5.015003||Viu +CPERLscope|5.005000||pVu +CPPLAST|5.006000|5.006000| +CPPMINUS|5.003007|5.003007| +CPPRUN|5.006000|5.006000| +CPPSTDIN|5.003007|5.003007| +create_eval_scope|5.009004||xViu +croak|5.006000|5.003007|v +croak_caller|5.025004||vnViu +croak_memory_wrap|5.017006|5.003007|pnu +croak_nocontext|5.006000||pvnVu +croak_no_mem|5.017006||nViu +croak_no_modify|5.013003|5.003007|pn +croak_popstack|5.017008||ncViu +croak_sv|5.013001|5.003007|p +croak_xs_usage|5.010001|5.003007|pn +cr_textfilter|5.006000||Viu +csighandler1|||nu +csighandler3|||nu +csighandler|||nu +current_re_engine|5.017001||cViu +curse|5.013009||Viu +custom_op_desc|5.007003|5.007003|d +custom_op_get_f |
