Codebase list libberkeleydb-perl / 713741f
Update upstream source from tag 'v0.64' Update to upstream version '0.64' with Debian dir c0594c290005fb0d91270ccbc18d773976100552 Marco d'Itri 3 years ago
11 changed file(s) with 8893 addition(s) and 561 deletion(s). Raw diff Collapse all Expand all
11 package BerkeleyDB;
22
33
4 # Copyright (c) 1997-2019 Paul Marquess. All rights reserved.
4 # Copyright (c) 1997-2020 Paul Marquess. All rights reserved.
55 # This program is free software; you can redistribute it and/or
66 # modify it under the same terms as Perl itself.
77 #
1616 use vars qw($VERSION @ISA @EXPORT $AUTOLOAD
1717 $use_XSLoader);
1818
19 $VERSION = '0.63';
19 $VERSION = '0.64';
2020
2121 require Exporter;
2222
2323 BEGIN {
2424 $use_XSLoader = 1 ;
2525 { local $SIG{__DIE__} ; eval { require XSLoader } ; }
26
26
2727 if ($@) {
2828 $use_XSLoader = 0 ;
2929 require DynaLoader;
726726 no strict 'refs';
727727 *{$AUTOLOAD} = sub { $val };
728728 goto &{$AUTOLOAD};
729 }
729 }
730730
731731 #bootstrap BerkeleyDB $VERSION;
732732 if ($use_XSLoader)
733733 { XSLoader::load("BerkeleyDB", $VERSION)}
734734 else
735 { bootstrap BerkeleyDB $VERSION }
735 { bootstrap BerkeleyDB $VERSION }
736736
737737 # Preloaded methods go here.
738738
772772 else
773773 { push (@Bad, $key) }
774774 }
775
775
776776 if (@Bad) {
777777 my ($bad) = join(", ", @Bad) ;
778778 croak "unknown key value(s) $bad" ;
833833 push @BerkeleyDB::a, "$k\t$v" ;
834834 }
835835
836 $got->{"Config"} = pack("p*", @BerkeleyDB::a, undef)
836 $got->{"Config"} = pack("p*", @BerkeleyDB::a, undef)
837837 if @BerkeleyDB::a ;
838838 }
839839
972972 BlobDir => undef,
973973 }, @_) ;
974974
975 my $errfile = $got->{ErrFile} ;
975 my $errfile = $got->{ErrFile} ;
976976 if (defined $got->{ErrFile}) {
977977 if (!isaFilehandle($got->{ErrFile})) {
978978 my $handle = new IO::File ">$got->{ErrFile}"
982982 }
983983
984984 if (defined $got->{MsgFile}) {
985 my $msgfile = $got->{MsgFile} ;
985 my $msgfile = $got->{MsgFile} ;
986986 if (!isaFilehandle($msgfile)) {
987987 my $handle = new IO::File ">$msgfile"
988988 or croak "Cannot open file $msgfile: $!\n" ;
10001000 my $k = "" ; my $v = "" ;
10011001 while (($k, $v) = each %config) {
10021002 if ($BerkeleyDB::db_version >= 3.1 && ! $valid_config_keys{$k} ){
1003 $BerkeleyDB::Error = "illegal name-value pair: $k $v\n" ;
1003 $BerkeleyDB::Error = "illegal name-value pair: $k $v\n" ;
10041004 croak $BerkeleyDB::Error ;
10051005 }
10061006 push @BerkeleyDB::a, "$k\t$v" ;
10071007 $got->{$k} = $v;
10081008 }
10091009
1010 $got->{"Config"} = pack("p*", @BerkeleyDB::a, undef)
1010 $got->{"Config"} = pack("p*", @BerkeleyDB::a, undef)
10111011 if @BerkeleyDB::a ;
10121012 }
10131013
10261026 # elsif ($k eq 'DB_TEMP_DIR' || $k eq 'DB_TMP_DIR')
10271027 # { $obj->set_tmp_dir($v) }
10281028 # else {
1029 # $BerkeleyDB::Error = "illegal name-value pair: $k $v\n" ;
1030 # croak $BerkeleyDB::Error
1029 # $BerkeleyDB::Error = "illegal name-value pair: $k $v\n" ;
1030 # croak $BerkeleyDB::Error
10311031 # }
10321032 # }
10331033 # }
11311131 if ($addr) {
11321132 $obj = bless [$addr] , $self ;
11331133 push @{ $obj }, $got->{Env} if $got->{Env} ;
1134 $obj->Txn($got->{Txn})
1134 $obj->Txn($got->{Txn})
11351135 if $got->{Txn} ;
11361136 }
11371137 return $obj ;
11391139
11401140 *TIEHASH = \&new ;
11411141
1142
1142
11431143 package BerkeleyDB::Btree ;
11441144
11451145 use vars qw(@ISA) ;
11981198 # if $got->{set_bt_compress} !~ /ARRAY/ ||
11991199 # @{ $got->{set_bt_compress} } != 2;
12001200 #
1201 # $got->{"_btcompress1"} = $got->{set_bt_compress}[0]
1201 # $got->{"_btcompress1"} = $got->{set_bt_compress}[0]
12021202 # if defined $got->{set_bt_compress}[0];
12031203 #
1204 # $got->{"_btcompress2"} = $got->{set_bt_compress}[1]
1204 # $got->{"_btcompress2"} = $got->{set_bt_compress}[1]
12051205 # if defined $got->{set_bt_compress}[1];
12061206 # }
12071207
12121212 if ($addr) {
12131213 $obj = bless [$addr] , $self ;
12141214 push @{ $obj }, $got->{Env} if $got->{Env} ;
1215 $obj->Txn($got->{Txn})
1215 $obj->Txn($got->{Txn})
12161216 if $got->{Txn} ;
12171217 }
12181218 return $obj ;
12711271 # if $got->{HeapSize} !~ /ARRAY/ ||
12721272 # @{ $got->{set_bt_compress} } != 2;
12731273 #
1274 # $got->{"HeapSize"} = $got->{HeapSize}[0]
1274 # $got->{"HeapSize"} = $got->{HeapSize}[0]
12751275 # if defined $got->{HeapSize}[0];
12761276 #
1277 # $got->{"HeapSize"} = $got->{HeapSize}[1]
1277 # $got->{"HeapSize"} = $got->{HeapSize}[1]
12781278 # if defined $got->{HeapSize}[1];
12791279 # }
12801280
12851285 if ($addr) {
12861286 $obj = bless [$addr] , $self ;
12871287 push @{ $obj }, $got->{Env} if $got->{Env} ;
1288 $obj->Txn($got->{Txn})
1288 $obj->Txn($got->{Txn})
12891289 if $got->{Txn} ;
12901290 }
12911291 return $obj ;
13541354 if ($addr) {
13551355 $obj = bless [$addr] , $self ;
13561356 push @{ $obj }, $got->{Env} if $got->{Env} ;
1357 $obj->Txn($got->{Txn})
1357 $obj->Txn($got->{Txn})
13581358 if $got->{Txn} ;
1359 }
1359 }
13601360 return $obj ;
13611361 }
13621362
14201420 push @{ $obj }, $got->{Env} if $got->{Env} ;
14211421 $obj->Txn($got->{Txn})
14221422 if $got->{Txn} ;
1423 }
1423 }
14241424 return $obj ;
14251425 }
14261426
14331433 }
14341434
14351435 ## package BerkeleyDB::Text ;
1436 ##
1436 ##
14371437 ## use vars qw(@ISA) ;
14381438 ## @ISA = qw( BerkeleyDB::Common BerkeleyDB::_tiedArray ) ;
14391439 ## use UNIVERSAL ;
14401440 ## use Carp ;
1441 ##
1441 ##
14421442 ## sub new
14431443 ## {
14441444 ## my $self = shift ;
14561456 ## Env => undef,
14571457 ## #Tie => undef,
14581458 ## Txn => undef,
1459 ##
1459 ##
14601460 ## # Recno specific
14611461 ## Delim => undef,
14621462 ## Len => undef,
14631463 ## Pad => undef,
14641464 ## Btree => undef,
14651465 ## }, @_) ;
1466 ##
1466 ##
14671467 ## croak("Env not of type BerkeleyDB::Env")
14681468 ## if defined $got->{Env} and ! isa($got->{Env},'BerkeleyDB::Env');
1469 ##
1469 ##
14701470 ## croak("Txn not of type BerkeleyDB::Txn")
14711471 ## if defined $got->{Txn} and ! isa($got->{Txn},'BerkeleyDB::Txn');
1472 ##
1472 ##
14731473 ## croak("-Tie needs a reference to an array")
14741474 ## if defined $got->{Tie} and $got->{Tie} !~ /ARRAY/ ;
1475 ##
1475 ##
14761476 ## # rearange for recno
14771477 ## $got->{Source} = $got->{Filename} if defined $got->{Filename} ;
14781478 ## delete $got->{Filename} ;
14791479 ## $got->{Fname} = $got->{Btree} if defined $got->{Btree} ;
14801480 ## return BerkeleyDB::Recno::_db_open_recno($self, $got);
14811481 ## }
1482 ##
1482 ##
14831483 ## *BerkeleyDB::Text::TIEARRAY = \&BerkeleyDB::Text::new ;
14841484 ## *BerkeleyDB::Text::db_stat = \&BerkeleyDB::Btree::db_stat ;
14851485
15301530 push @{ $obj }, $got->{Env} if $got->{Env} ;
15311531 $obj->Txn($got->{Txn})
15321532 if $got->{Txn} ;
1533 }
1533 }
15341534 return $obj ;
15351535 }
15361536
15391539
15401540 use Carp ;
15411541
1542 #sub TIEHASH
1543 #{
1542 #sub TIEHASH
1543 #{
15441544 # my $self = shift ;
15451545 # my $db_object = shift ;
15461546 #
15471547 #print "Tiehash REF=[$self] [" . (ref $self) . "]\n" ;
15481548 #
1549 # return bless { Obj => $db_object}, $self ;
1549 # return bless { Obj => $db_object}, $self ;
15501550 #}
15511551
15521552 sub Tie
15611561 #print "Tie method REF=[$self] [" . (ref $self) . "]\n" ;
15621562
15631563 croak("usage \$x->Tie \\%hash\n") unless @_ ;
1564 my $ref = shift ;
1564 my $ref = shift ;
15651565
15661566 croak("Tie needs a reference to a hash")
15671567 if defined $ref and $ref !~ /HASH/ ;
15681568
1569 #tie %{ $ref }, ref($self), $self ;
1570 tie %{ $ref }, "BerkeleyDB::_tiedHash", $self ;
1569 #tie %{ $ref }, ref($self), $self ;
1570 tie %{ $ref }, "BerkeleyDB::_tiedHash", $self ;
15711571 return undef ;
15721572 }
15731573
1574
1575 sub TIEHASH
1576 {
1574
1575 sub TIEHASH
1576 {
15771577 my $self = shift ;
15781578 my $db_object = shift ;
1579 #return bless $db_object, 'BerkeleyDB::Common' ;
1579 #return bless $db_object, 'BerkeleyDB::Common' ;
15801580 return $db_object ;
15811581 }
15821582
16191619 my $self = shift ;
16201620 my ($key, $value) = (0, 0) ;
16211621 my $cursor = $self->_db_write_cursor() ;
1622 while ($cursor->c_get($key, $value, BerkeleyDB::DB_PREV()) == 0)
1622 while ($cursor->c_get($key, $value, BerkeleyDB::DB_PREV()) == 0)
16231623 { $cursor->c_del() }
16241624 }
16251625
16541654 #print "Tie method REF=[$self] [" . (ref $self) . "]\n" ;
16551655
16561656 croak("usage \$x->Tie \\%hash\n") unless @_ ;
1657 my $ref = shift ;
1657 my $ref = shift ;
16581658
16591659 croak("Tie needs a reference to an array")
16601660 if defined $ref and $ref !~ /ARRAY/ ;
16611661
1662 #tie %{ $ref }, ref($self), $self ;
1663 tie @{ $ref }, "BerkeleyDB::_tiedArray", $self ;
1662 #tie %{ $ref }, ref($self), $self ;
1663 tie @{ $ref }, "BerkeleyDB::_tiedArray", $self ;
16641664 return undef ;
16651665 }
16661666
1667
1668 #sub TIEARRAY
1669 #{
1667
1668 #sub TIEARRAY
1669 #{
16701670 # my $self = shift ;
16711671 # my $db_object = shift ;
16721672 #
16731673 #print "Tiearray REF=[$self] [" . (ref $self) . "]\n" ;
16741674 #
1675 # return bless { Obj => $db_object}, $self ;
1675 # return bless { Obj => $db_object}, $self ;
16761676 #}
16771677
1678 sub TIEARRAY
1679 {
1678 sub TIEARRAY
1679 {
16801680 my $self = shift ;
16811681 my $db_object = shift ;
1682 #return bless $db_object, 'BerkeleyDB::Common' ;
1682 #return bless $db_object, 'BerkeleyDB::Common' ;
16831683 return $db_object ;
16841684 }
16851685
18801880 {
18811881 croak "Usage: \$db->get_dup(key [,flag])\n"
18821882 unless @_ == 2 or @_ == 3 ;
1883
1883
18841884 my $db = shift ;
18851885 my $key = shift ;
18861886 my $flag = shift ;
18921892 my $counter = 0 ;
18931893 my $status = 0 ;
18941894 my $cursor = $db->db_cursor() ;
1895
1895
18961896 # iterate through the database until either EOF ($status == 0)
18971897 # or a different key is encountered ($key ne $origkey).
18981898 for ($status = $cursor->c_get($key, $value, BerkeleyDB::DB_SET()) ;
19071907 }
19081908 else
19091909 { ++ $counter }
1910
1911 }
1912
1910
1911 }
1912
19131913 return ($wantarray ? ($flag ? %values : @values) : $counter) ;
19141914 }
19151915
20782078 my $db = shift ;
20792079
20802080 # fatal error if database not opened in CDS mode
2081 croak("CDS not enabled for this database\n")
2081 croak("CDS not enabled for this database\n")
20822082 if ! $db->cds_enabled();
20832083
20842084 if ( ! defined $Object{"$db"})
20972097 my $self = shift ;
20982098 my $db = $self->[0] ;
20992099
2100 if ($self->[1])
2100 if ($self->[1])
21012101 {
21022102 $self->[1] = 0 ;
21032103 -- $Count{"$db"} if $Count{"$db"} > 0 ;
21182118 sub DESTROY
21192119 {
21202120 my $self = shift ;
2121 $self->cds_unlock() ;
2121 $self->cds_unlock() ;
21222122 }
21232123
21242124 package BerkeleyDB::Term ;
21362136
21372137 1;
21382138 __END__
2139
2140
2141
5555 $bool = $db->cds_enabled();
5656 $lock = $db->cds_lock();
5757 $lock->cds_unlock();
58
58
5959 ($flag, $old_offset, $old_length) = $db->partial_set($offset, $length) ;
6060 ($flag, $old_offset, $old_length) = $db->partial_clear() ;
6161
266266 =item -SharedMemKey
267267
268268 If present, this parameter sets the base segment ID for the shared memory
269 region used by Berkeley DB.
269 region used by Berkeley DB.
270270
271271 This option requires Berkeley DB 3.1 or better.
272272
288288 Sets the size threshold that will be used to decide when data is stored as
289289 a BLOB. This option must be set for a blobs to be used.
290290
291 This option requires Berkeley DB 6.0 or better.
292
293 =item -BlobDir
291 This option requires Berkeley DB 6.0 or better.
292
293 =item -BlobDir
294294
295295 The directory where the BLOB objects are stored.
296296
297297 If not specified blob files are stores in the environment directoy.
298298
299299
300 This option requires Berkeley DB 6.0 or better.
300 This option requires Berkeley DB 6.0 or better.
301301
302302 =item -Config
303303
324324
325325 -ErrFile => *STDOUT
326326
327 or
327 or
328328
329329 -ErrFile => *STDERR
330330
347347
348348 B<DB_INIT_CDB>
349349
350 Initialise the Concurrent Access Methods
350 Initialise the Concurrent Access Methods
351351
352352 B<DB_INIT_LOCK>
353353
421421
422422 Specifies what to do when a lock conflict occurs. The value should be one of
423423
424 B<DB_LOCK_DEFAULT>
424 B<DB_LOCK_DEFAULT>
425425
426426 Use the default policy as specified by db_deadlock.
427427
528528
529529 =item $env->stat_print
530530
531 Prints statistical information.
531 Prints statistical information.
532532
533533 If the C<MsgFile> option is specified the output will be sent to the
534534 file. Otherwise output is sent to standard output.
624624 =item B<BerkeleyDB::Unknown>
625625
626626 This isn't a database format at all. It is used when you want to open an
627 existing Berkeley DB database without having to know what type is it.
627 existing Berkeley DB database without having to know what type is it.
628628
629629 =back
630630
637637
638638 Equivalent to calling B<db_open> with type B<DB_HASH> in Berkeley DB 2.x and
639639 calling B<db_create> followed by B<DB-E<gt>open> with type B<DB_HASH> in
640 Berkeley DB 3.x or greater.
640 Berkeley DB 3.x or greater.
641641
642642 Two forms of constructor are supported:
643643
664664
665665 and this
666666
667 [$db =] tie %hash, 'BerkeleyDB::Hash',
667 [$db =] tie %hash, 'BerkeleyDB::Hash',
668668 [ -Filename => "filename", ]
669669 [ -Subname => "sub-database name", ]
670670 [ -Flags => flags,]
725725
726726 =item -Hash
727727
728 Allows you to provide a user defined hash function. If not specified,
728 Allows you to provide a user defined hash function. If not specified,
729729 a default hash function is used. Here is a template for a user-defined
730730 hash function
731731
737737 return $hash ;
738738 }
739739
740 tie %h, "BerkeleyDB::Hash",
741 -Filename => $filename,
740 tie %h, "BerkeleyDB::Hash",
741 -Filename => $filename,
742742 -Hash => \&hash,
743743 ...
744744
746746
747747 =item -DupCompare
748748
749 Used in conjunction with the B<DB_DUPOSRT> flag.
749 Used in conjunction with the B<DB_DUPOSRT> flag.
750750
751751 sub compare
752752 {
758758 return (-1 , 0 or 1) ;
759759 }
760760
761 tie %h, "BerkeleyDB::Hash",
762 -Filename => $filename,
761 tie %h, "BerkeleyDB::Hash",
762 -Filename => $filename,
763763 -Property => DB_DUP|DB_DUPSORT,
764764 -DupCompare => \&compare,
765765 ...
806806 here is the output:
807807
808808 Banana Exists
809
809
810810 orange -> orange
811811 tomato -> red
812812 banana -> yellow
938938
939939 =head2 Custom Sorting Duplicate Keys
940940
941 Another variation
941 Another variation
942942
943943 TODO
944944
954954
955955 Equivalent to calling B<db_open> with type B<DB_BTREE> in Berkeley DB 2.x and
956956 calling B<db_create> followed by B<DB-E<gt>open> with type B<DB_BTREE> in
957 Berkeley DB 3.x or greater.
957 Berkeley DB 3.x or greater.
958958
959959 Two forms of constructor are supported:
960960
982982
983983 and this
984984
985 [$db =] tie %hash, 'BerkeleyDB::Btree',
985 [$db =] tie %hash, 'BerkeleyDB::Btree',
986986 [ -Filename => "filename", ]
987987 [ -Subname => "sub-database name", ]
988988 [ -Flags => flags,]
10461046 return (-1 , 0 or 1) ;
10471047 }
10481048
1049 tie %h, "BerkeleyDB::Hash",
1050 -Filename => $filename,
1049 tie %h, "BerkeleyDB::Hash",
1050 -Filename => $filename,
10511051 -Compare => \&compare,
10521052 ...
10531053
10571057 {
10581058 my ($key, $key2) = @_ ;
10591059 ...
1060 # return number of bytes of $key2 which are
1060 # return number of bytes of $key2 which are
10611061 # necessary to determine that it is greater than $key1
10621062 return $bytes ;
10631063 }
10641064
1065 tie %h, "BerkeleyDB::Hash",
1066 -Filename => $filename,
1065 tie %h, "BerkeleyDB::Hash",
1066 -Filename => $filename,
10671067 -Prefix => \&prefix,
10681068 ...
10691069 =item DupCompare
10781078 return (-1 , 0 or 1) ;
10791079 }
10801080
1081 tie %h, "BerkeleyDB::Hash",
1082 -Filename => $filename,
1081 tie %h, "BerkeleyDB::Hash",
1082 -Filename => $filename,
10831083 -DupCompare => \&compare,
10841084 ...
10851085
11011101
11021102 =item $status = $db->db_key_range($key, $less, $equal, $greater [, $flags])
11031103
1104 Given a key, C<$key>, this method returns the proportion of keys less than
1104 Given a key, C<$key>, this method returns the proportion of keys less than
11051105 C<$key> in C<$less>, the proportion equal to C<$key> in C<$equal> and the
11061106 proportion greater than C<$key> in C<$greater>.
11071107
12051205 you must use the same compare function every time you access the
12061206 database.
12071207
1208 =back
1208 =back
12091209
12101210 =head2 Using db_stat
12111211
12151215
12161216 Equivalent to calling B<db_open> with type B<DB_RECNO> in Berkeley DB 2.x and
12171217 calling B<db_create> followed by B<DB-E<gt>open> with type B<DB_RECNO> in
1218 Berkeley DB 3.x or greater.
1218 Berkeley DB 3.x or greater.
12191219
12201220 Two forms of constructor are supported:
12211221
12401240
12411241 and this
12421242
1243 [$db =] tie @arry, 'BerkeleyDB::Recno',
1243 [$db =] tie @arry, 'BerkeleyDB::Recno',
12441244 [ -Filename => "filename", ]
12451245 [ -Subname => "sub-database name", ]
12461246 [ -Flags => flags,]
12611261
12621262 =head2 A Recno Example
12631263
1264 Here is a simple example that uses RECNO (if you are using a version
1265 of Perl earlier than 5.004_57 this example won't work -- see
1264 Here is a simple example that uses RECNO (if you are using a version
1265 of Perl earlier than 5.004_57 this example won't work -- see
12661266 L<Extra RECNO Methods> for a workaround).
12671267
12681268 use strict ;
13371337
13381338 and this
13391339
1340 [$db =] tie @arry, 'BerkeleyDB::Queue',
1340 [$db =] tie @arry, 'BerkeleyDB::Queue',
13411341 [ -Filename => "filename", ]
13421342 [ -Subname => "sub-database name", ]
13431343 [ -Flags => flags,]
13841384
13851385 =head1 BerkeleyDB::Unknown
13861386
1387 This class is used to open an existing database.
1387 This class is used to open an existing database.
13881388
13891389 Equivalent to calling B<db_open> with type B<DB_UNKNOWN> in Berkeley DB 2.x and
13901390 calling B<db_create> followed by B<DB-E<gt>open> with type B<DB_UNKNOWN> in
1391 Berkeley DB 3.x or greater.
1391 Berkeley DB 3.x or greater.
13921392
13931393 The constructor looks like this:
13941394
14071407 Flags => number }, ],
14081408
14091409
1410 =head2 An example
1410 =head2 An example
14111411
14121412 =head1 COMMON OPTIONS
14131413
15791579
15801580 =head2 $status = $env->stat_print([$flags])
15811581
1582 Prints statistical information.
1582 Prints statistical information.
15831583
15841584 If the C<MsgFile> option is specified the output will be sent to the
15851585 file. Otherwise output is sent to standard output.
16871687
16881688 =head2 $status = $db->compact($start, $stop, $c_data, $flags, $end);
16891689
1690 Compacts the database C<$db>.
1690 Compacts the database C<$db>.
16911691
16921692 All the parameters are optional - if only want to make use of some of them,
16931693 use C<undef> for those you don't want. Trailing unused parameters can be
17081708 =item * compact_fillpercent
17091709
17101710 =item * compact_timeout
1711
1711
17121712 =back
17131713
17141714 The following keys, along with associated values, will be created in the
17501750 Associate a foreign key database C<$db> with the secondary DB
17511751 C<$secondary>.
17521752
1753 The second parameter must be a reference to a sub or C<undef>.
1754
1755 The C<$flags> parameter must be either C<DB_FOREIGN_CASCADE>,
1756 C<DB_FOREIGN_ABORT> or C<DB_FOREIGN_NULLIFY>.
1753 The second parameter must be a reference to a sub or C<undef>.
1754
1755 The C<$flags> parameter must be either C<DB_FOREIGN_CASCADE>,
1756 C<DB_FOREIGN_ABORT> or C<DB_FOREIGN_NULLIFY>.
17571757
17581758 When the flags parameter is C<DB_FOREIGN_NULLIFY> the second parameter is a
17591759 reference to a sub of the form
19591959
19601960 Stores the number of duplicates at the current cursor position in B<$cnt>.
19611961
1962 The B<$flags> parameter is not used at present. This method needs
1962 The B<$flags> parameter is not used at present. This method needs
19631963 Berkeley DB 3.1 or better.
19641964
19651965 =head2 $status = $cursor->status()
21152115 =head1 Berkeley DB Concurrent Data Store (CDS)
21162116
21172117 The Berkeley DB I<Concurrent Data Store> (CDS) is a lightweight locking
2118 mechanism that is useful in scenarios where transactions are overkill.
2118 mechanism that is useful in scenarios where transactions are overkill.
21192119
21202120 =head2 What is CDS?
21212121
21332133 using CDS mode, you need to be sure that it is suitable for the expected
21342134 behaviour of your application.
21352135
2136 The key features of this model are
2136 The key features of this model are
21372137
21382138 =over 5
21392139
21942194
21952195 A Berkeley DB Cursor (created with C<< $db->db_cursor >>) will by hold a
21962196 lock on the database until it is either explicitly closed or destroyed.
2197 This means the lock has the potential to be long lived.
2197 This means the lock has the potential to be long lived.
21982198
21992199 By default Berkeley DB cursors create a read lock, but it is possible to
22002200 create a cursor that holds a write lock, thus
22032203
22042204
22052205 Whilst either a read or write cursor is active, it will block any other
2206 processes that wants to write to the database.
2206 processes that wants to write to the database.
22072207
22082208 To avoid blocking problems, only keep cursors open as long as they are
22092209 needed. The same is true when you use the C<cursor> method or the
22822282 above. Firstly, the existing value for the key "Counter" is fetched from
22832283 the database using C<db_get>. A read lock will be used for this part of the
22842284 update. The value is then incremented, and the new value is written back
2285 to the database using C<db_put>. This time a write lock will be used.
2285 to the database using C<db_put>. This time a write lock will be used.
22862286
22872287 Here's the problem - there is nothing to stop two (or more) processes
22882288 executing the read part at the same time. Remember multiple processes can
23002300 module for this purpose. Using C<cds_lock>, the counter update code can now
23012301 be rewritten thus:
23022302
2303 my $lk = $dbh->cds_lock() ;
2303 my $lk = $dbh->cds_lock() ;
23042304 $hash{Counter} ++ ;
23052305 $lk->cds_unlock;
23062306
23112311 $hash{Counter} ++ ;
23122312 }
23132313
2314 Similarly, C<cds_lock> can be used with the native Berkeley DB API
2314 Similarly, C<cds_lock> can be used with the native Berkeley DB API
23152315
23162316 my $lk = $dbh->cds_lock() ;
23172317 $db->db_get("Counter", $value);
23482348
23492349 # Create a write-lock
23502350 my $lock = $db->db_cursor(DB_WRITECURSOR);
2351 # or
2351 # or
23522352 # my $lock = $db->cds_lock();
23532353
2354
2354
23552355 my $cursor = $db->db_cursor();
23562356
23572357 # Now loop through the database, and increment
23582358 # each value using c_put.
2359 while ($cursor->c_get($key, $value, DB_NEXT) == 0)
2359 while ($cursor->c_get($key, $value, DB_NEXT) == 0)
23602360 {
23612361 $cursor->c_put($key, $value+1, DB_CURRENT) == 0
23622362 or die "$BerkeleyDB::Error\n";
23732373
23742374 So the rule is -- you B<CANNOT> carry out a write operation using a
23752375 read-only cursor (i.e. you cannot use C<c_put> or C<c_del>) whilst another
2376 write-cursor is already active.
2376 write-cursor is already active.
23772377
23782378 The workaround for this issue is to just use C<db_put> instead of C<c_put>,
23792379 like this
23822382
23832383 # Create a write-lock
23842384 my $lock = $db->db_cursor(DB_WRITECURSOR);
2385 # or
2385 # or
23862386 # my $lock = $db->cds_lock();
23872387
2388
2388
23892389 my $cursor = $db->db_cursor();
23902390
23912391 # Now loop through the database, and increment
23922392 # each value using c_put.
2393 while ($cursor->c_get($key, $value, DB_NEXT) == 0)
2393 while ($cursor->c_get($key, $value, DB_NEXT) == 0)
23942394 {
23952395 $db->db_put($key, $value+1) == 0
23962396 or die "$BerkeleyDB::Error\n";
24962496
24972497 =item 2.
24982498
2499 Using the L<DBM_Filter> module.
2499 Using the L<DBM_Filter> module.
25002500 This module hides the complexity of the API defined below and comes
25012501 with a number of "canned" filters that cover some of the common use-cases.
25022502
26512651 use BerkeleyDB ;
26522652 use MLDBM qw(BerkeleyDB::Btree) ;
26532653 use Data::Dumper;
2654
2654
26552655 my $filename = 'testmldbm' ;
26562656 my %o ;
2657
2657
26582658 unlink $filename ;
26592659 tie %o, 'MLDBM', -Filename => $filename,
26602660 -Flags => DB_CREATE
26612661 or die "Cannot open database '$filename: $!\n";
2662
2662
26632663 See the MLDBM documentation for information on how to use the module
26642664 and for details of its limitations.
26652665
27072707
27082708 See the Changes file.
27092709
2710 =head1 SUPPORT
2711
2712 General feedback/questions/bug reports should be sent to
2713 L<https://github.com/pmqs/BerkeleyDB/issues> (preferred) or
2714 L<https://rt.cpan.org/Public/Dist/Display.html?Name=BerkeleyDB>.
2715
27102716 =head1 AVAILABILITY
27112717
27122718 The most recent version of B<BerkeleyDB> can always be found
27172723
27182724 =head1 COPYRIGHT
27192725
2720 Copyright (c) 1997-2019 Paul Marquess. All rights reserved. This program
2726 Copyright (c) 1997-2020 Paul Marquess. All rights reserved. This program
27212727 is free software; you can redistribute it and/or modify it under the
27222728 same terms as Perl itself.
27232729
5555 $bool = $db->cds_enabled();
5656 $lock = $db->cds_lock();
5757 $lock->cds_unlock();
58
58
5959 ($flag, $old_offset, $old_length) = $db->partial_set($offset, $length) ;
6060 ($flag, $old_offset, $old_length) = $db->partial_clear() ;
6161
266266 =item -SharedMemKey
267267
268268 If present, this parameter sets the base segment ID for the shared memory
269 region used by Berkeley DB.
269 region used by Berkeley DB.
270270
271271 This option requires Berkeley DB 3.1 or better.
272272
288288 Sets the size threshold that will be used to decide when data is stored as
289289 a BLOB. This option must be set for a blobs to be used.
290290
291 This option requires Berkeley DB 6.0 or better.
292
293 =item -BlobDir
291 This option requires Berkeley DB 6.0 or better.
292
293 =item -BlobDir
294294
295295 The directory where the BLOB objects are stored.
296296
297297 If not specified blob files are stores in the environment directoy.
298298
299299
300 This option requires Berkeley DB 6.0 or better.
300 This option requires Berkeley DB 6.0 or better.
301301
302302 =item -Config
303303
324324
325325 -ErrFile => *STDOUT
326326
327 or
327 or
328328
329329 -ErrFile => *STDERR
330330
347347
348348 B<DB_INIT_CDB>
349349
350 Initialise the Concurrent Access Methods
350 Initialise the Concurrent Access Methods
351351
352352 B<DB_INIT_LOCK>
353353
421421
422422 Specifies what to do when a lock conflict occurs. The value should be one of
423423
424 B<DB_LOCK_DEFAULT>
424 B<DB_LOCK_DEFAULT>
425425
426426 Use the default policy as specified by db_deadlock.
427427
528528
529529 =item $env->stat_print
530530
531 Prints statistical information.
531 Prints statistical information.
532532
533533 If the C<MsgFile> option is specified the output will be sent to the
534534 file. Otherwise output is sent to standard output.
624624 =item B<BerkeleyDB::Unknown>
625625
626626 This isn't a database format at all. It is used when you want to open an
627 existing Berkeley DB database without having to know what type is it.
627 existing Berkeley DB database without having to know what type is it.
628628
629629 =back
630630
637637
638638 Equivalent to calling B<db_open> with type B<DB_HASH> in Berkeley DB 2.x and
639639 calling B<db_create> followed by B<DB-E<gt>open> with type B<DB_HASH> in
640 Berkeley DB 3.x or greater.
640 Berkeley DB 3.x or greater.
641641
642642 Two forms of constructor are supported:
643643
664664
665665 and this
666666
667 [$db =] tie %hash, 'BerkeleyDB::Hash',
667 [$db =] tie %hash, 'BerkeleyDB::Hash',
668668 [ -Filename => "filename", ]
669669 [ -Subname => "sub-database name", ]
670670 [ -Flags => flags,]
725725
726726 =item -Hash
727727
728 Allows you to provide a user defined hash function. If not specified,
728 Allows you to provide a user defined hash function. If not specified,
729729 a default hash function is used. Here is a template for a user-defined
730730 hash function
731731
737737 return $hash ;
738738 }
739739
740 tie %h, "BerkeleyDB::Hash",
741 -Filename => $filename,
740 tie %h, "BerkeleyDB::Hash",
741 -Filename => $filename,
742742 -Hash => \&hash,
743743 ...
744744
746746
747747 =item -DupCompare
748748
749 Used in conjunction with the B<DB_DUPOSRT> flag.
749 Used in conjunction with the B<DB_DUPOSRT> flag.
750750
751751 sub compare
752752 {
758758 return (-1 , 0 or 1) ;
759759 }
760760
761 tie %h, "BerkeleyDB::Hash",
762 -Filename => $filename,
761 tie %h, "BerkeleyDB::Hash",
762 -Filename => $filename,
763763 -Property => DB_DUP|DB_DUPSORT,
764764 -DupCompare => \&compare,
765765 ...
779779 here is the output:
780780
781781 Banana Exists
782
782
783783 orange -> orange
784784 tomato -> red
785785 banana -> yellow
830830
831831 =head2 Custom Sorting Duplicate Keys
832832
833 Another variation
833 Another variation
834834
835835 TODO
836836
846846
847847 Equivalent to calling B<db_open> with type B<DB_BTREE> in Berkeley DB 2.x and
848848 calling B<db_create> followed by B<DB-E<gt>open> with type B<DB_BTREE> in
849 Berkeley DB 3.x or greater.
849 Berkeley DB 3.x or greater.
850850
851851 Two forms of constructor are supported:
852852
874874
875875 and this
876876
877 [$db =] tie %hash, 'BerkeleyDB::Btree',
877 [$db =] tie %hash, 'BerkeleyDB::Btree',
878878 [ -Filename => "filename", ]
879879 [ -Subname => "sub-database name", ]
880880 [ -Flags => flags,]
938938 return (-1 , 0 or 1) ;
939939 }
940940
941 tie %h, "BerkeleyDB::Hash",
942 -Filename => $filename,
941 tie %h, "BerkeleyDB::Hash",
942 -Filename => $filename,
943943 -Compare => \&compare,
944944 ...
945945
949949 {
950950 my ($key, $key2) = @_ ;
951951 ...
952 # return number of bytes of $key2 which are
952 # return number of bytes of $key2 which are
953953 # necessary to determine that it is greater than $key1
954954 return $bytes ;
955955 }
956956
957 tie %h, "BerkeleyDB::Hash",
958 -Filename => $filename,
957 tie %h, "BerkeleyDB::Hash",
958 -Filename => $filename,
959959 -Prefix => \&prefix,
960960 ...
961961 =item DupCompare
970970 return (-1 , 0 or 1) ;
971971 }
972972
973 tie %h, "BerkeleyDB::Hash",
974 -Filename => $filename,
973 tie %h, "BerkeleyDB::Hash",
974 -Filename => $filename,
975975 -DupCompare => \&compare,
976976 ...
977977
993993
994994 =item $status = $db->db_key_range($key, $less, $equal, $greater [, $flags])
995995
996 Given a key, C<$key>, this method returns the proportion of keys less than
996 Given a key, C<$key>, this method returns the proportion of keys less than
997997 C<$key> in C<$less>, the proportion equal to C<$key> in C<$equal> and the
998998 proportion greater than C<$key> in C<$greater>.
999999
10441044 you must use the same compare function every time you access the
10451045 database.
10461046
1047 =back
1047 =back
10481048
10491049 =head2 Using db_stat
10501050
10541054
10551055 Equivalent to calling B<db_open> with type B<DB_RECNO> in Berkeley DB 2.x and
10561056 calling B<db_create> followed by B<DB-E<gt>open> with type B<DB_RECNO> in
1057 Berkeley DB 3.x or greater.
1057 Berkeley DB 3.x or greater.
10581058
10591059 Two forms of constructor are supported:
10601060
10791079
10801080 and this
10811081
1082 [$db =] tie @arry, 'BerkeleyDB::Recno',
1082 [$db =] tie @arry, 'BerkeleyDB::Recno',
10831083 [ -Filename => "filename", ]
10841084 [ -Subname => "sub-database name", ]
10851085 [ -Flags => flags,]
11001100
11011101 =head2 A Recno Example
11021102
1103 Here is a simple example that uses RECNO (if you are using a version
1104 of Perl earlier than 5.004_57 this example won't work -- see
1103 Here is a simple example that uses RECNO (if you are using a version
1104 of Perl earlier than 5.004_57 this example won't work -- see
11051105 L<Extra RECNO Methods> for a workaround).
11061106
11071107 ## simpleRecno
11431143
11441144 and this
11451145
1146 [$db =] tie @arry, 'BerkeleyDB::Queue',
1146 [$db =] tie @arry, 'BerkeleyDB::Queue',
11471147 [ -Filename => "filename", ]
11481148 [ -Subname => "sub-database name", ]
11491149 [ -Flags => flags,]
11901190
11911191 =head1 BerkeleyDB::Unknown
11921192
1193 This class is used to open an existing database.
1193 This class is used to open an existing database.
11941194
11951195 Equivalent to calling B<db_open> with type B<DB_UNKNOWN> in Berkeley DB 2.x and
11961196 calling B<db_create> followed by B<DB-E<gt>open> with type B<DB_UNKNOWN> in
1197 Berkeley DB 3.x or greater.
1197 Berkeley DB 3.x or greater.
11981198
11991199 The constructor looks like this:
12001200
12131213 Flags => number }, ],
12141214
12151215
1216 =head2 An example
1216 =head2 An example
12171217
12181218 =head1 COMMON OPTIONS
12191219
13851385
13861386 =head2 $status = $env->stat_print([$flags])
13871387
1388 Prints statistical information.
1388 Prints statistical information.
13891389
13901390 If the C<MsgFile> option is specified the output will be sent to the
13911391 file. Otherwise output is sent to standard output.
14931493
14941494 =head2 $status = $db->compact($start, $stop, $c_data, $flags, $end);
14951495
1496 Compacts the database C<$db>.
1496 Compacts the database C<$db>.
14971497
14981498 All the parameters are optional - if only want to make use of some of them,
14991499 use C<undef> for those you don't want. Trailing unused parameters can be
15141514 =item * compact_fillpercent
15151515
15161516 =item * compact_timeout
1517
1517
15181518 =back
15191519
15201520 The following keys, along with associated values, will be created in the
15561556 Associate a foreign key database C<$db> with the secondary DB
15571557 C<$secondary>.
15581558
1559 The second parameter must be a reference to a sub or C<undef>.
1560
1561 The C<$flags> parameter must be either C<DB_FOREIGN_CASCADE>,
1562 C<DB_FOREIGN_ABORT> or C<DB_FOREIGN_NULLIFY>.
1559 The second parameter must be a reference to a sub or C<undef>.
1560
1561 The C<$flags> parameter must be either C<DB_FOREIGN_CASCADE>,
1562 C<DB_FOREIGN_ABORT> or C<DB_FOREIGN_NULLIFY>.
15631563
15641564 When the flags parameter is C<DB_FOREIGN_NULLIFY> the second parameter is a
15651565 reference to a sub of the form
17651765
17661766 Stores the number of duplicates at the current cursor position in B<$cnt>.
17671767
1768 The B<$flags> parameter is not used at present. This method needs
1768 The B<$flags> parameter is not used at present. This method needs
17691769 Berkeley DB 3.1 or better.
17701770
17711771 =head2 $status = $cursor->status()
19211921 =head1 Berkeley DB Concurrent Data Store (CDS)
19221922
19231923 The Berkeley DB I<Concurrent Data Store> (CDS) is a lightweight locking
1924 mechanism that is useful in scenarios where transactions are overkill.
1924 mechanism that is useful in scenarios where transactions are overkill.
19251925
19261926 =head2 What is CDS?
19271927
19391939 using CDS mode, you need to be sure that it is suitable for the expected
19401940 behaviour of your application.
19411941
1942 The key features of this model are
1942 The key features of this model are
19431943
19441944 =over 5
19451945
20002000
20012001 A Berkeley DB Cursor (created with C<< $db->db_cursor >>) will by hold a
20022002 lock on the database until it is either explicitly closed or destroyed.
2003 This means the lock has the potential to be long lived.
2003 This means the lock has the potential to be long lived.
20042004
20052005 By default Berkeley DB cursors create a read lock, but it is possible to
20062006 create a cursor that holds a write lock, thus
20092009
20102010
20112011 Whilst either a read or write cursor is active, it will block any other
2012 processes that wants to write to the database.
2012 processes that wants to write to the database.
20132013
20142014 To avoid blocking problems, only keep cursors open as long as they are
20152015 needed. The same is true when you use the C<cursor> method or the
20882088 above. Firstly, the existing value for the key "Counter" is fetched from
20892089 the database using C<db_get>. A read lock will be used for this part of the
20902090 update. The value is then incremented, and the new value is written back
2091 to the database using C<db_put>. This time a write lock will be used.
2091 to the database using C<db_put>. This time a write lock will be used.
20922092
20932093 Here's the problem - there is nothing to stop two (or more) processes
20942094 executing the read part at the same time. Remember multiple processes can
21062106 module for this purpose. Using C<cds_lock>, the counter update code can now
21072107 be rewritten thus:
21082108
2109 my $lk = $dbh->cds_lock() ;
2109 my $lk = $dbh->cds_lock() ;
21102110 $hash{Counter} ++ ;
21112111 $lk->cds_unlock;
21122112
21172117 $hash{Counter} ++ ;
21182118 }
21192119
2120 Similarly, C<cds_lock> can be used with the native Berkeley DB API
2120 Similarly, C<cds_lock> can be used with the native Berkeley DB API
21212121
21222122 my $lk = $dbh->cds_lock() ;
21232123 $db->db_get("Counter", $value);
21542154
21552155 # Create a write-lock
21562156 my $lock = $db->db_cursor(DB_WRITECURSOR);
2157 # or
2157 # or
21582158 # my $lock = $db->cds_lock();
21592159
2160
2160
21612161 my $cursor = $db->db_cursor();
21622162
21632163 # Now loop through the database, and increment
21642164 # each value using c_put.
2165 while ($cursor->c_get($key, $value, DB_NEXT) == 0)
2165 while ($cursor->c_get($key, $value, DB_NEXT) == 0)
21662166 {
21672167 $cursor->c_put($key, $value+1, DB_CURRENT) == 0
21682168 or die "$BerkeleyDB::Error\n";
21792179
21802180 So the rule is -- you B<CANNOT> carry out a write operation using a
21812181 read-only cursor (i.e. you cannot use C<c_put> or C<c_del>) whilst another
2182 write-cursor is already active.
2182 write-cursor is already active.
21832183
21842184 The workaround for this issue is to just use C<db_put> instead of C<c_put>,
21852185 like this
21882188
21892189 # Create a write-lock
21902190 my $lock = $db->db_cursor(DB_WRITECURSOR);
2191 # or
2191 # or
21922192 # my $lock = $db->cds_lock();
21932193
2194
2194
21952195 my $cursor = $db->db_cursor();
21962196
21972197 # Now loop through the database, and increment
21982198 # each value using c_put.
2199 while ($cursor->c_get($key, $value, DB_NEXT) == 0)
2199 while ($cursor->c_get($key, $value, DB_NEXT) == 0)
22002200 {
22012201 $db->db_put($key, $value+1) == 0
22022202 or die "$BerkeleyDB::Error\n";
23022302
23032303 =item 2.
23042304
2305 Using the L<DBM_Filter> module.
2305 Using the L<DBM_Filter> module.
23062306 This module hides the complexity of the API defined below and comes
23072307 with a number of "canned" filters that cover some of the common use-cases.
23082308
24182418 use BerkeleyDB ;
24192419 use MLDBM qw(BerkeleyDB::Btree) ;
24202420 use Data::Dumper;
2421
2421
24222422 my $filename = 'testmldbm' ;
24232423 my %o ;
2424
2424
24252425 unlink $filename ;
24262426 tie %o, 'MLDBM', -Filename => $filename,
24272427 -Flags => DB_CREATE
24282428 or die "Cannot open database '$filename: $!\n";
2429
2429
24302430 See the MLDBM documentation for information on how to use the module
24312431 and for details of its limitations.
24322432
24742474
24752475 See the Changes file.
24762476
2477 =head1 SUPPORT
2478
2479 General feedback/questions/bug reports should be sent to
2480 L<https://github.com/pmqs/BerkeleyDB/issues> (preferred) or
2481 L<https://rt.cpan.org/Public/Dist/Display.html?Name=BerkeleyDB>.
2482
24772483 =head1 AVAILABILITY
24782484
24792485 The most recent version of B<BerkeleyDB> can always be found
24842490
24852491 =head1 COPYRIGHT
24862492
2487 Copyright (c) 1997-2019 Paul Marquess. All rights reserved. This program
2493 Copyright (c) 1997-2020 Paul Marquess. All rights reserved. This program
24882494 is free software; you can redistribute it and/or modify it under the
24892495 same terms as Perl itself.
24902496
61456145 #ifndef AT_LEAST_DB_4_3
61466146 softCrash("$seq->initial_value needs Berkeley DB 4.3.x or better") ;
61476147 #else
6148 RETVAL = seq->seq->initial_value(seq->seq, (db_seq_t)(high << 32 + low));
6148 RETVAL = seq->seq->initial_value(seq->seq, (db_seq_t)(((I64TYPE)high << 32) + low));
61496149 #endif
61506150 OUTPUT:
61516151 RETVAL
00 Revision history for Perl extension BerkeleyDB.
11
2 0.64 17 September 2020
3
4 * Refresh ppport.h
5 2a4ebf00b93977cfbffc65ecbcc0aac4f7cbad1d
6
7 * Silence clang warning in call to "initial_value"
8 https://github.com/pmqs/BerkeleyDB/issues/4
9 aa9c569b797bee78141ef319685d756bcef92a18
10
211 0.63 21 July 2019
312
4 * added 000preret.t
13 * added 000prereq.t
514 Dump version info in "make test"
615 9e17580d74662b6a3186990dd3b1469df2829503
716
3140 * Add test with BERKELEYDB_DEFINE_TRACE set to .travis
3241 000b1d8dffe542d6476fe78f218cc95534f1c1c3
3342
34 * my_db_strerror: Add missing dTHX declaration
43 * my_db_strerror: Add missing dTHX declaration
3544 Merge pull request https://github.com/pmqs/BerkeleyDB/pull/2
3645 4273345d8eff5f521788b3c5e71fb291bf46a646
3746 80ca9b77968ab84aaf8b546f2933d135202e16e0
3847
39 * create .appveyor.yml
48 * create .appveyor.yml
4049 4e7b034ddbe76a7c2dcd189e1e0c935c1559aa2c
4150
4251 * sync dbinfo from DB_File
4453
4554 0.61 30 March 2019
4655
47 * Fix a couple of typos
56 * Fix a couple of typos
4857 One's a copyright date out by 20 years.
4958 The other one breaks builds with 5.2 ≤ BDB < 6.2.
5059 Merge pull request https://github.com/pmqs/BerkeleyDB/pull/1
7483 * Error opening ErrFile with PerlIO_findFILE
7584 [RT #101883]
7685
77 * Minor updates for BDB 6.1
86 * Minor updates for BDB 6.1
7887
7988 0.54 9th November 2013
8089
92101 0.52 7th May 2013
93102
94103 * Updates for BDB 6.0 - Added Blob support
95 - Added BerkeleyDB::DbStream class to interface to Blobs
96 - Added BlobThreshold & BlobDir option to BerkeleyDB::Env
104 - Added BerkeleyDB::DbStream class to interface to Blobs
105 - Added BlobThreshold & BlobDir option to BerkeleyDB::Env
97106 constructor
98107 - Added BlobThreshold & BlobDir option to Hash, Btree & Heap
99108 constructors
188197 * seq->seq->close doesn't compile on win32.
189198 RT# 49474
190199
191 0.39 6th June 2009
200 0.39 6th June 2009
192201
193202 * Added support for BDB 4.8
194 - associate_foreign
203 - associate_foreign
195204 - set_bt_compress (no callbacks as yet).
196205
197 * Also added interface to
206 * Also added interface to
198207 - ENV->stat_print
199208 - ENV->txn_stat_print
200209
209218 * Fixed issue with DNM Filters & UTF8 support.
210219 Patch supplied by Torsten Foertsch.
211220
212 0.38 21st February 2009
221 0.38 21st February 2009
213222
214223 * Fixed typo in BerkleyDB.pod that broke t/pod.t
215224
216 0.37 18th February 2009
225 0.37 18th February 2009
217226
218227 * Included CDS section to the pod.
219228
220229 * Various documentation patches from RT#42243
221230
222 0.36 30th September 2008
231 0.36 30th September 2008
223232
224233 * Added support for $ENV->log_get_config and $ENV->log_set_config.
225234 Patch supplied by Yuval Kogman (#39651 rt.cpan.org)
226235
227 0.35 22nd September 2008
236 0.35 22nd September 2008
228237
229238 * Added a combination of independent patches from Claes Jakobsson
230239 and Yuval Kogman (#38896 rt.cpan.org) to allow multi-key return
237246
238247 * Finish transition of test harness to use Test::More
239248
240 0.34 27th March 2008
249 0.34 27th March 2008
241250
242251 * Updates to support building with Berkeley DB version 4.7
243252
245254
246255 * Updated dbinfo
247256
248 0.33 17th January 2008
257 0.33 17th January 2008
249258
250259 * Added failchk, set_isalive, lock_stat_print & mutex_stat_print.
251260 Patch provided by Thomas Busch.
252261
253 0.32 10th July 2007
262 0.32 10th July 2007
254263
255264 * Updates to support Berkeley DB 4.6
256265
257 * Remove all global static data from BerkeleyDB.xs.
258
259 0.31 15th Oct 2006
266 * Remove all global static data from BerkeleyDB.xs.
267
268 0.31 15th Oct 2006
260269
261270 * Fixed DB_GET_BOTH. Tnanks to Thomas Drugeon for spotting the typo
262271 in typemap and supplying a regression test for this fix.
263272
264 0.30 11th Sept 2006
273 0.30 11th Sept 2006
265274
266275 * Fixed queue test harness for Berkeley DB 4.5 compliance
267276
268277 * Added $env->lsn_reset, $txn->set_timeout, $env->set_timeout &
269278 $env->get_timeout, $txn->set_tx_max, $txn->get_tx_max
270279
271 0.29 2nd July 2006
280 0.29 2nd July 2006
272281
273282 * Fixes for cursor get from secondary where primary os recno.
274283
275284 * Added db_compact
276285
277 0.28 11th June 2006
286 0.28 11th June 2006
278287
279288 * Fixes for secondary where primary is recno.
280289
283292 * Added FreeBSD hints to README - patch supplied by David Landgren
284293 in #17675 from rt.cpan.org
285294
286 0.27 1st Novemver 2005
295 0.27 1st Novemver 2005
287296
288297 * Added support for Berkeley DB 4.4
289298
309318
310319 * added t/cds.t and t/pod.t
311320
312 * Modified the test suite to use "-ErrFile => *STDOUT" where
321 * Modified the test suite to use "-ErrFile => *STDOUT" where
313322 possible. This will make it easier to diagnose build issues.
314323
315324 * -Errfile will now accept a filehandle as well as a filename
325334
326335 * Fixed a problem with push, pop, shift & unshift with Queue &
327336 Recno when used in CDS mode. These methods were not using
328 a write cursor behind the scenes.
337 a write cursor behind the scenes.
329338 Problem reported by Pavel Hlavnicka.
330339
331340 0.25 1st November 2003
348357
349358 * Fixed problem where a secondary index would use the same
350359 compare callback as the primary key, regardless of what was
351 defined for the secondary index.
360 defined for the secondary index.
352361 Problem spotted by Dave Tallman.
353362
354363 * Also fixed a problem with the associate callback. If the value
359368 the BackRef pointer instead of the global CurrentDB. This was
360369 done partially to fix the secondary index problem, above.
361370
362 * The test harness was failing under cygwin. Now fixed.
371 * The test harness was failing under cygwin. Now fixed.
363372
364373 * Previous release broke TRACE. Fixed.
365374
369378
370379 0.21 12th May 2003
371380
372 * adding support for env->set_flags
381 * adding support for env->set_flags
373382 * adding recursion detection
374383 * win32 problem with rename fixed.
375384 * problem with sub-database name in Recno & Queue fixed.
385394 0.20 2nd September 2002
386395
387396 * More support for building with Berkeley DB 4.1.x
388 * db->get & db->pget used the wrong output macro for DBM filters
397 * db->get & db->pget used the wrong output macro for DBM filters
389398 bug spotted by Aaron Ross.
390399 * db_join didn't keep a reference to the cursors it was joining.
391400 Spotted by Winton Davies.
399408 * added support for db->verify via BerkeleyDB::db_verify
400409 * added support for db->associate, db->pget & cursor->c_pget
401410 * Builds with Berkeley DB 4.1.x
402
411
403412
404413 0.18 6th January 2002
405414 * Dropped support for ErrFile as a file handle. It was proving too
407416 Reported by Jonas Smedegaard (Debian powerpc) & Kenneth Olwing (Win32)
408417 * Fixed problem with abort macro in XSUB.h clashing with txn abort
409418 method in Berkeley DB 4.x -- patch supplied by Kenneth Olwing.
410 * DB->set_alloc was getting called too late in BerkeleyDB.xs.
419 * DB->set_alloc was getting called too late in BerkeleyDB.xs.
411420 This was causing problems with ActivePerl -- problem reported
412421 by Kenneth Olwing.
413 * When opening a queue, the Len proprty set the DB_PAD flag.
422 * When opening a queue, the Len proprty set the DB_PAD flag.
414423 Should have been DB_FIXEDLEN. Fix provided by Kenneth Olwing.
415424 * Test harness fixes from Kenneth Olwing.
416425
417426 0.17 23 September 2001
418 * Fixed a bug in BerkeleyDB::Recno - reported by Niklas Paulsson.
427 * Fixed a bug in BerkeleyDB::Recno - reported by Niklas Paulsson.
419428 * Added log_archive - patch supplied by Benjamin Holzman
420429 * Added txn_discard
421430 * Builds with Berkeley DB 4.0.x
439448 * Mentioned the problems that occur when perl is built with sfio.
440449
441450 0.13 15th January 2001
442 * Added support to allow this module to build with Berkeley DB 3.2
451 * Added support to allow this module to build with Berkeley DB 3.2
443452 * Updated dbinfo to support Berkeley DB 3.1 & 3.2 file format
444 changes.
453 changes.
445454 * Documented the Solaris 2.7 core dump problem in README.
446455 * Tidied up the test harness to fix a problem on Solaris where the
447456 "fred" directory wasn't being deleted when it should have been.
448457 * two calls to "open" clashed with a win32 macro.
449 * size argument for hash_cb is different for Berkeley DB 3.x
458 * size argument for hash_cb is different for Berkeley DB 3.x
450459 * Documented the issue of building on Linux.
451 * Added -Server, -CacheSize & -LockDetect options
460 * Added -Server, -CacheSize & -LockDetect options
452461 [original patch supplied by Graham Barr]
453462 * Added support for set_mutexlocks, c_count, set_q_extentsize,
454463 key_range, c_dup
468477 * Plugged small memory leak in db_cursor (DESTROY wasn't freeing
469478 memory)
470479 * Can be built with Berkeley DB 3.1
471
480
472481 0.10 8th December 1999
473482 * The DESTROY method was missing for BerkeleyDB::Env. This resulted in
474483 a memory leak. Fixed.
475 * If opening an environment or database failed, there was a small
476 memory leak. This has been fixed.
477 * A thread-enabled Perl it could core when a database was closed.
484 * If opening an environment or database failed, there was a small
485 memory leak. This has been fixed.
486 * A thread-enabled Perl it could core when a database was closed.
478487 Problem traced to the strdup function.
479488
480489 0.09 29th November 1999
491500 * Added support for the following DB 3.x features:
492501 + The Queue database type
493502 + db_remove
494 + subdatabases
503 + subdatabases
495504 + db_stat for Hash & Queue
496505
497506 0.07 21st September 1999
513522 references will ensure everything gets closed in the correct order.
514523 * The BOOT code now checks that the version of db.h & libdb are the
515524 same - this seems to be a common problem on Linux.
516 * MLDBM support added.
525 * MLDBM support added.
517526 * Support for the new join cursor added.
518527 * Builds with Berkeley DB 3.x
519528 * Updated dbinfo for Berkeley DB 3.x file formats.
520529 * Deprecated the TxnMgr class. As with Berkeley DB version 3,
521530 txn_begin etc are now accessed via the environment object.
522
531
523532 0.06 19 December 1998
524533 * Minor modifications to get the module to build with DB 2.6.x
525534 * Added support for DB 2.6.x's Concurrent Access Method, DB_INIT_CDB.
538547 * fixed c_get with DB_SET_RECNO and DB_GET_RECNO
539548 * implemented BerkeleyDB::Unknown
540549 * implemented BerkeleyDB::Recno, including push, pop etc
541 modified the txn support.
550 modified the txn support.
542551
543552 0.02 30 October 1997
544 * renamed module to BerkeleyDB
553 * renamed module to BerkeleyDB
545554 * fixed a few bugs & added more tests
546555
547556 0.01 23 October 1997
548557 * first alpha release as BerkDB.
549
33 "Paul Marquess <pmqs@cpan.org>"
44 ],
55 "dynamic_config" : 1,
6 "generated_by" : "ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 2.150005",
6 "generated_by" : "ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 2.150010",
77 "license" : [
88 "perl_5"
99 ],
1010 "meta-spec" : {
1111 "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
12 "version" : "2"
12 "version" : 2
1313 },
1414 "name" : "BerkeleyDB",
1515 "no_index" : {
4242 "web" : "https://github.com/pmqs/BerkeleyDB"
4343 }
4444 },
45 "version" : "0.63",
46 "x_serialization_backend" : "JSON::PP version 2.27300"
45 "version" : "0.64",
46 "x_serialization_backend" : "JSON::PP version 4.02"
4747 }
66 configure_requires:
77 ExtUtils::MakeMaker: '0'
88 dynamic_config: 1
9 generated_by: 'ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 2.150005'
9 generated_by: 'ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 2.150010'
1010 license: perl
1111 meta-spec:
1212 url: http://module-build.sourceforge.net/META-spec-v1.4.html
2020 bugtracker: https://github.com/pmqs/BerkeleyDB/issues
2121 homepage: https://github.com/pmqs/BerkeleyDB
2222 repository: git://github.com/pmqs/BerkeleyDB.git
23 version: '0.63'
23 version: '0.64'
2424 x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
00 BerkeleyDB
11
2 Version 0.63
3
4 21sth July 2019
5
6
7 Copyright (c) 1997-2019 Paul Marquess. All rights reserved. This
2 Version 0.64
3
4 17th August 2020
5
6
7 Copyright (c) 1997-2020 Paul Marquess. All rights reserved. This
88 program is free software; you can redistribute it and/or modify
99 it under the same terms as Perl itself.
1010
3838
3939 * Berkeley DB Version 2.6.4 or greater
4040
41 The official web site for Berkeley DB is
41 The official web site for Berkeley DB is
4242
4343 http://www.oracle.com/technology/products/berkeley-db/db/index.html
4444
137137 The error above will occur if there is a copy of the Berkeley DB 1.x
138138 file db.h on your system.
139139
140 This error will happen when
140 This error will happen when
141141
142142 1. you only have Berkeley DB version 1 on your system.
143143 Solution: get & install a newer version of Berkeley DB.
167167 to point to the directories where libdb.a and db.h are
168168 installed.
169169
170 Undefined Symbol: txn_stat
170 Undefined Symbol: txn_stat
171171 --------------------------
172172
173173 BerkeleyDB seems to have built correctly, but you get an error like this
196196 problem is to either delete or temporarily rename the copies
197197 of db.h and libdb.a that you don't want BerkeleyDB to use.
198198
199 Undefined Symbol: db_appinit
199 Undefined Symbol: db_appinit
200200 ----------------------------
201201
202202 BerkeleyDB seems to have built correctly, but you get an error like this
203203 when you run the test harness:
204204
205205 $ make test
206 PERL_DL_NONLAZY=1 /home/paul/perl/install/bin/perl5.00561 -Iblib/arch
207 -Iblib/lib -I/home/paul/perl/install/5.005_61/lib/5.00561/i586-linux
208 -I/home/paul/perl/install/5.005_61/lib/5.00561 -e 'use Test::Harness
206 PERL_DL_NONLAZY=1 /home/paul/perl/install/bin/perl5.00561 -Iblib/arch
207 -Iblib/lib -I/home/paul/perl/install/5.005_61/lib/5.00561/i586-linux
208 -I/home/paul/perl/install/5.005_61/lib/5.00561 -e 'use Test::Harness
209209 qw(&runtests $verbose); $verbose=0; runtests @ARGV;' t/*.t
210 t/btree.............Can't load 'blib/arch/auto/BerkeleyDB/BerkeleyDB.so' for
211 module BerkeleyDB: blib/arch/auto/BerkeleyDB/BerkeleyDB.so:
212 undefined symbol: db_appinit
213 at /home/paul/perl/install/5.005_61/lib/5.00561/i586-linux/DynaLoader.pm
210 t/btree.............Can't load 'blib/arch/auto/BerkeleyDB/BerkeleyDB.so' for
211 module BerkeleyDB: blib/arch/auto/BerkeleyDB/BerkeleyDB.so:
212 undefined symbol: db_appinit
213 at /home/paul/perl/install/5.005_61/lib/5.00561/i586-linux/DynaLoader.pm
214214 ...
215215
216216
218218 3 of Berkeley DB installed on your system and BerkeleyDB attempts
219219 to build using the db.h for Berkeley DB version 2 and the version 3
220220 library. Unfortunately the two versions aren't compatible with each
221 other.
221 other.
222222
223223 Solution: Setting the LIB & INCLUDE variables in config.in to point to the
224224 correct directories can sometimes be enough to fix this
232232 BerkeleyDB seems to have built correctly, but you get an error like this
233233 when you run the test harness:
234234
235 $ make test
236 PERL_DL_NONLAZY=1 /home/paul/perl/install/bin/perl5.00561 -Iblib/arch
237 -Iblib/lib -I/home/paul/perl/install/5.005_61/lib/5.00561/i586-linux
238 -I/home/paul/perl/install/5.005_61/lib/5.00561 -e 'use Test::Harness
235 $ make test
236 PERL_DL_NONLAZY=1 /home/paul/perl/install/bin/perl5.00561 -Iblib/arch
237 -Iblib/lib -I/home/paul/perl/install/5.005_61/lib/5.00561/i586-linux
238 -I/home/paul/perl/install/5.005_61/lib/5.00561 -e 'use Test::Harness
239239 qw(&runtests $verbose); $verbose=0; runtests @ARGV;' t/*.t
240 t/btree.............Can't load 'blib/arch/auto/BerkeleyDB/BerkeleyDB.so' for
241 module BerkeleyDB: blib/arch/auto/BerkeleyDB/BerkeleyDB.so:
242 undefined symbol: db_create
243 at /home/paul/perl/install/5.005_61/lib/5.00561/i586-linux/DynaLoader.pm
240 t/btree.............Can't load 'blib/arch/auto/BerkeleyDB/BerkeleyDB.so' for
241 module BerkeleyDB: blib/arch/auto/BerkeleyDB/BerkeleyDB.so:
242 undefined symbol: db_create
243 at /home/paul/perl/install/5.005_61/lib/5.00561/i586-linux/DynaLoader.pm
244244 ...
245245
246246 This error usually happens when you have both version 2 and version
247247 3 of Berkeley DB installed on your system and BerkeleyDB attempts
248248 to build using the db.h for Berkeley DB version 3 and the version 2
249249 library. Unfortunately the two versions aren't compatible with each
250 other.
250 other.
251251
252252 Solution: Setting the LIB & INCLUDE variables in config.in to point to the
253253 correct directories can sometimes be enough to fix this
273273 BEGIN failed--compilation aborted at t/btree.t line 25.
274274 dubious
275275 Test returned status 255 (wstat 65280, 0xff00)
276 ...
276 ...
277277
278278 Another variation on the theme of having two versions of Berkeley DB on
279 your system.
279 your system.
280280
281281 Solution: Setting the LIB & INCLUDE variables in config.in to point to the
282282 correct directories can sometimes be enough to fix this
366366
367367
368368 t/btree........NOK 178Can't call method "txn_begin" on an undefined value at t/btree.t line 637.
369 t/btree........dubious
369 t/btree........dubious
370370 Test returned status 11 (wstat 2816, 0xb00)
371371 DIED. FAILED tests 28, 178-244
372372 Failed 68/244 tests, 72.13% okay
373373 t/db-3.0.......NOK 2Can't call method "set_mutexlocks" on an undefined value at t/db-3.0.t line 39.
374 t/db-3.0.......dubious
374 t/db-3.0.......dubious
375375 Test returned status 11 (wstat 2816, 0xb00)
376376 DIED. FAILED tests 2-14
377377 Failed 13/14 tests, 7.14% okay
378 t/db-3.1.......ok
378 t/db-3.1.......ok
379379 t/db-3.2.......NOK 5Can't call method "set_flags" on an undefined value at t/db-3.2.t line 62.
380 t/db-3.2.......dubious
380 t/db-3.2.......dubious
381381 Test returned status 11 (wstat 2816, 0xb00)
382382 DIED. FAILED tests 3, 5-6
383383 Failed 3/6 tests, 50.00% okay
384 t/db-3.3.......ok
384 t/db-3.3.......ok
385385
386386 This pattern of errors happens if you have built the module in a directory
387387 that is network mounted (e.g. NFS ar AFS).
598598 FEEDBACK
599599 --------
600600
601 General feedback/questions/bug reports can be sent to
601 General feedback/questions/bug reports can be sent to
602602 https://github.com/pmqs/BerkeleyDB/issues (preferred) or
603603 https://rt.cpan.org/Public/Dist/Display.html?Name=BerkeleyDB
604604
612612
613613 1. The version of Perl and the operating system name and version you
614614 are running. The complete output from running "perl -V" will tell
615 me all I need to know.
615 me all I need to know.
616616 If your perl does not understand the "-V" option is too old.
617617 BerkeleyDB needs Perl version 5.004_04 or better.
618618
669669 See the Changes file.
670670
671671 Paul Marquess <pmqs@cpan.org>
672
0 #!/usr/local/bin/perl
0 #!/usr/bin/perl
11
2 # Name: dbinfo -- identify berkeley DB version used to create
2 # Name: dbinfo -- identify berkeley DB version used to create
33 # a database file
44 #
55 # Author: Paul Marquess <pmqs@cpan.org>
6 # Version: 1.07
6 # Version: 1.07
77 # Date 2nd April 2011
88 #
9 # Copyright (c) 1998-2019 Paul Marquess. All rights reserved.
9 # Copyright (c) 1998-2020 Paul Marquess. All rights reserved.
1010 # This program is free software; you can redistribute it and/or
1111 # modify it under the same terms as Perl itself.
1212
6060 4 => [1, "4.1.x or greater"],
6161 }
6262 },
63 0x074582 => # DB_HEAPMAGIC
63 0x074582 => # DB_HEAPMAGIC
6464 {
65 Type => "Heap",
66 Versions => # DB_HEAPVERSION
67 {
68 1 => [1, "5.2.x"],
69 }
70 },
65 Type => "Heap",
66 Versions => # DB_HEAPVERSION
67 {
68 1 => [1, "5.2.x"],
69 }
70 },
7171 ) ;
7272
7373 die "Usage: dbinfo file\n" unless @ARGV == 1 ;
+8550
-258
ppport.h less more
0 /* This file is Based on output from
1 * Perl/Pollution/Portability Version 2.0000 */
0 #if 0
1 <<'SKIP';
2 #endif
3 /*
4 ----------------------------------------------------------------------
5
6 ppport.h -- Perl/Pollution/Portability Version 3.52
7
8 Automatically created by Devel::PPPort running under perl 5.024000.
9
10 Do NOT edit this file directly! -- Edit PPPort_pm.PL and the
11 includes in parts/inc/ instead.
12
13 Use 'perldoc ppport.h' to view the documentation below.
14
15 ----------------------------------------------------------------------
16
17 SKIP
18
19 =pod
20
21 =head1 NAME
22
23 ppport.h - Perl/Pollution/Portability version 3.52
24
25 =head1 SYNOPSIS
26
27 perl ppport.h [options] [source files]
28
29 Searches current directory for files if no [source files] are given
30
31 --help show short help
32
33 --version show version
34
35 --patch=file write one patch file with changes
36 --copy=suffix write changed copies with suffix
37 --diff=program use diff program and options
38
39 --compat-version=version provide compatibility with Perl version
40 --cplusplus accept C++ comments
41
42 --quiet don't output anything except fatal errors
43 --nodiag don't show diagnostics
44 --nohints don't show hints
45 --nochanges don't suggest changes
46 --nofilter don't filter input files
47
48 --strip strip all script and doc functionality
49 from ppport.h
50
51 --list-provided list provided API
52 --list-unsupported list unsupported API
53 --api-info=name show Perl API portability information
54
55 =head1 COMPATIBILITY
56
57 This version of F<ppport.h> is designed to support operation with Perl
58 installations back to 5.003, and has been tested up to 5.30.
59
60 =head1 OPTIONS
61
62 =head2 --help
63
64 Display a brief usage summary.
65
66 =head2 --version
67
68 Display the version of F<ppport.h>.
69
70 =head2 --patch=I<file>
71
72 If this option is given, a single patch file will be created if
73 any changes are suggested. This requires a working diff program
74 to be installed on your system.
75
76 =head2 --copy=I<suffix>
77
78 If this option is given, a copy of each file will be saved with
79 the given suffix that contains the suggested changes. This does
80 not require any external programs. Note that this does not
81 automagically add a dot between the original filename and the
82 suffix. If you want the dot, you have to include it in the option
83 argument.
84
85 If neither C<--patch> or C<--copy> are given, the default is to
86 simply print the diffs for each file. This requires either
87 C<Text::Diff> or a C<diff> program to be installed.
88
89 =head2 --diff=I<program>
90
91 Manually set the diff program and options to use. The default
92 is to use C<Text::Diff>, when installed, and output unified
93 context diffs.
94
95 =head2 --compat-version=I<version>
96
97 Tell F<ppport.h> to check for compatibility with the given
98 Perl version. The default is to check for compatibility with Perl
99 version 5.003. You can use this option to reduce the output
100 of F<ppport.h> if you intend to be backward compatible only
101 down to a certain Perl version.
102
103 =head2 --cplusplus
104
105 Usually, F<ppport.h> will detect C++ style comments and
106 replace them with C style comments for portability reasons.
107 Using this option instructs F<ppport.h> to leave C++
108 comments untouched.
109
110 =head2 --quiet
111
112 Be quiet. Don't print anything except fatal errors.
113
114 =head2 --nodiag
115
116 Don't output any diagnostic messages. Only portability
117 alerts will be printed.
118
119 =head2 --nohints
120
121 Don't output any hints. Hints often contain useful portability
122 notes. Warnings will still be displayed.
123
124 =head2 --nochanges
125
126 Don't suggest any changes. Only give diagnostic output and hints
127 unless these are also deactivated.
128
129 =head2 --nofilter
130
131 Don't filter the list of input files. By default, files not looking
132 like source code (i.e. not *.xs, *.c, *.cc, *.cpp or *.h) are skipped.
133
134 =head2 --strip
135
136 Strip all script and documentation functionality from F<ppport.h>.
137 This reduces the size of F<ppport.h> dramatically and may be useful
138 if you want to include F<ppport.h> in smaller modules without
139 increasing their distribution size too much.
140
141 The stripped F<ppport.h> will have a C<--unstrip> option that allows
142 you to undo the stripping, but only if an appropriate C<Devel::PPPort>
143 module is installed.
144
145 =head2 --list-provided
146
147 Lists the API elements for which compatibility is provided by
148 F<ppport.h>. Also lists if it must be explicitly requested,
149 if it has dependencies, and if there are hints or warnings for it.
150
151 =head2 --list-unsupported
152
153 Lists the API elements that are known not to be supported by
154 F<ppport.h> and below which version of Perl they probably
155 won't be available or work.
156
157 =head2 --api-info=I<name>
158
159 Show portability information for API elements matching I<name>.
160 If I<name> is surrounded by slashes, it is interpreted as a regular
161 expression.
162
163 =head1 DESCRIPTION
164
165 In order for a Perl extension (XS) module to be as portable as possible
166 across differing versions of Perl itself, certain steps need to be taken.
167
168 =over 4
169
170 =item *
171
172 Including this header is the first major one. This alone will give you
173 access to a large part of the Perl API that hasn't been available in
174 earlier Perl releases. Use
175
176 perl ppport.h --list-provided
177
178 to see which API elements are provided by ppport.h.
179
180 =item *
181
182 You should avoid using deprecated parts of the API. For example, using
183 global Perl variables without the C<PL_> prefix is deprecated. Also,
184 some API functions used to have a C<perl_> prefix. Using this form is
185 also deprecated. You can safely use the supported API, as F<ppport.h>
186 will provide wrappers for older Perl versions.
187
188 =item *
189
190 If you use one of a few functions or variables that were not present in
191 earlier versions of Perl, and that can't be provided using a macro, you
192 have to explicitly request support for these functions by adding one or
193 more C<#define>s in your source code before the inclusion of F<ppport.h>.
194
195 These functions or variables will be marked C<explicit> in the list shown
196 by C<--list-provided>.
197
198 Depending on whether you module has a single or multiple files that
199 use such functions or variables, you want either C<static> or global
200 variants.
201
202 For a C<static> function or variable (used only in a single source
203 file), use:
204
205 #define NEED_function
206 #define NEED_variable
207
208 For a global function or variable (used in multiple source files),
209 use:
210
211 #define NEED_function_GLOBAL
212 #define NEED_variable_GLOBAL
213
214 Note that you mustn't have more than one global request for the
215 same function or variable in your project.
216
217 Function / Variable Static Request Global Request
218 -----------------------------------------------------------------------------------------
219 PL_parser NEED_PL_parser NEED_PL_parser_GLOBAL
220 PL_signals NEED_PL_signals NEED_PL_signals_GLOBAL
221 SvRX() NEED_SvRX NEED_SvRX_GLOBAL
222 caller_cx() NEED_caller_cx NEED_caller_cx_GLOBAL
223 croak_xs_usage() NEED_croak_xs_usage NEED_croak_xs_usage_GLOBAL
224 die_sv() NEED_die_sv NEED_die_sv_GLOBAL
225 eval_pv() NEED_eval_pv NEED_eval_pv_GLOBAL
226 grok_bin() NEED_grok_bin NEED_grok_bin_GLOBAL
227 grok_hex() NEED_grok_hex NEED_grok_hex_GLOBAL
228 grok_number() NEED_grok_number NEED_grok_number_GLOBAL
229 grok_numeric_radix() NEED_grok_numeric_radix NEED_grok_numeric_radix_GLOBAL
230 grok_oct() NEED_grok_oct NEED_grok_oct_GLOBAL
231 gv_fetchpvn_flags() NEED_gv_fetchpvn_flags NEED_gv_fetchpvn_flags_GLOBAL
232 load_module() NEED_load_module NEED_load_module_GLOBAL
233 mess() NEED_mess NEED_mess_GLOBAL
234 mess_nocontext() NEED_mess_nocontext NEED_mess_nocontext_GLOBAL
235 mess_sv() NEED_mess_sv NEED_mess_sv_GLOBAL
236 mg_findext() NEED_mg_findext NEED_mg_findext_GLOBAL
237 my_snprintf() NEED_my_snprintf NEED_my_snprintf_GLOBAL
238 my_sprintf() NEED_my_sprintf NEED_my_sprintf_GLOBAL
239 my_strlcat() NEED_my_strlcat NEED_my_strlcat_GLOBAL
240 my_strlcpy() NEED_my_strlcpy NEED_my_strlcpy_GLOBAL
241 my_strnlen() NEED_my_strnlen NEED_my_strnlen_GLOBAL
242 newCONSTSUB() NEED_newCONSTSUB NEED_newCONSTSUB_GLOBAL
243 newRV_noinc() NEED_newRV_noinc NEED_newRV_noinc_GLOBAL
244 newSV_type() NEED_newSV_type NEED_newSV_type_GLOBAL
245 newSVpvn_flags() NEED_newSVpvn_flags NEED_newSVpvn_flags_GLOBAL
246 newSVpvn_share() NEED_newSVpvn_share NEED_newSVpvn_share_GLOBAL
247 pv_display() NEED_pv_display NEED_pv_display_GLOBAL
248 pv_escape() NEED_pv_escape NEED_pv_escape_GLOBAL
249 pv_pretty() NEED_pv_pretty NEED_pv_pretty_GLOBAL
250 sv_2pv_flags() NEED_sv_2pv_flags NEED_sv_2pv_flags_GLOBAL
251 sv_2pvbyte() NEED_sv_2pvbyte NEED_sv_2pvbyte_GLOBAL
252 sv_catpvf_mg() NEED_sv_catpvf_mg NEED_sv_catpvf_mg_GLOBAL
253 sv_catpvf_mg_nocontext() NEED_sv_catpvf_mg_nocontext NEED_sv_catpvf_mg_nocontext_GLOBAL
254 sv_pvn_force_flags() NEED_sv_pvn_force_flags NEED_sv_pvn_force_flags_GLOBAL
255 sv_setpvf_mg() NEED_sv_setpvf_mg NEED_sv_setpvf_mg_GLOBAL
256 sv_setpvf_mg_nocontext() NEED_sv_setpvf_mg_nocontext NEED_sv_setpvf_mg_nocontext_GLOBAL
257 sv_unmagicext() NEED_sv_unmagicext NEED_sv_unmagicext_GLOBAL
258 utf8_to_uvchr_buf() NEED_utf8_to_uvchr_buf NEED_utf8_to_uvchr_buf_GLOBAL
259 vload_module() NEED_vload_module NEED_vload_module_GLOBAL
260 vmess() NEED_vmess NEED_vmess_GLOBAL
261 vnewSVpvf() NEED_vnewSVpvf NEED_vnewSVpvf_GLOBAL
262 warner() NEED_warner NEED_warner_GLOBAL
263
264 To avoid namespace conflicts, you can change the namespace of the
265 explicitly exported functions / variables using the C<DPPP_NAMESPACE>
266 macro. Just C<#define> the macro before including C<ppport.h>:
267
268 #define DPPP_NAMESPACE MyOwnNamespace_
269 #include "ppport.h"
270
271 The default namespace is C<DPPP_>.
272
273 =back
274
275 The good thing is that most of the above can be checked by running
276 F<ppport.h> on your source code. See the next section for
277 details.
278
279 =head1 EXAMPLES
280
281 To verify whether F<ppport.h> is needed for your module, whether you
282 should make any changes to your code, and whether any special defines
283 should be used, F<ppport.h> can be run as a Perl script to check your
284 source code. Simply say:
285
286 perl ppport.h
287
288 The result will usually be a list of patches suggesting changes
289 that should at least be acceptable, if not necessarily the most
290 efficient solution, or a fix for all possible problems.
291
292 If you know that your XS module uses features only available in
293 newer Perl releases, if you're aware that it uses C++ comments,
294 and if you want all suggestions as a single patch file, you could
295 use something like this:
296
297 perl ppport.h --compat-version=5.6.0 --cplusplus --patch=test.diff
298
299 If you only want your code to be scanned without any suggestions
300 for changes, use:
301
302 perl ppport.h --nochanges
303
304 You can specify a different C<diff> program or options, using
305 the C<--diff> option:
306
307 perl ppport.h --diff='diff -C 10'
308
309 This would output context diffs with 10 lines of context.
310
311 If you want to create patched copies of your files instead, use:
312
313 perl ppport.h --copy=.new
314
315 To display portability information for the C<newSVpvn> function,
316 use:
317
318 perl ppport.h --api-info=newSVpvn
319
320 Since the argument to C<--api-info> can be a regular expression,
321 you can use
322
323 perl ppport.h --api-info=/_nomg$/
324
325 to display portability information for all C<_nomg> functions or
326
327 perl ppport.h --api-info=/./
328
329 to display information for all known API elements.
330
331 =head1 BUGS
332
333 If this version of F<ppport.h> is causing failure during
334 the compilation of this module, please check if newer versions
335 of either this module or C<Devel::PPPort> are available on CPAN
336 before sending a bug report.
337
338 If F<ppport.h> was generated using the latest version of
339 C<Devel::PPPort> and is causing failure of this module, please
340 send a bug report to L<perlbug@perl.org|mailto:perlbug@perl.org>.
341
342 Please include the following information:
343
344 =over 4
345
346 =item 1.
347
348 The complete output from running "perl -V"
349
350 =item 2.
351
352 This file.
353
354 =item 3.
355
356 The name and version of the module you were trying to build.
357
358 =item 4.
359
360 A full log of the build that failed.
361
362 =item 5.
363
364 Any other information that you think could be relevant.
365
366 =back
367
368 For the latest version of this code, please get the C<Devel::PPPort>
369 module from CPAN.
370
371 =head1 COPYRIGHT
372
373 Version 3.x, Copyright (c) 2004-2013, Marcus Holland-Moritz.
374
375 Version 2.x, Copyright (C) 2001, Paul Marquess.
376
377 Version 1.x, Copyright (C) 1999, Kenneth Albanowski.
378
379 This program is free software; you can redistribute it and/or
380 modify it under the same terms as Perl itself.
381
382 =head1 SEE ALSO
383
384 See L<Devel::PPPort>.
385
386 =cut
387
388 use strict;
389
390 # Disable broken TRIE-optimization
391 BEGIN { eval '${^RE_TRIE_MAXBUF} = -1' if "$]" >= 5.009004 && "$]" <= 5.009005 }
392
393 my $VERSION = 3.52;
394
395 my %opt = (
396 quiet => 0,
397 diag => 1,
398 hints => 1,
399 changes => 1,
400 cplusplus => 0,
401 filter => 1,
402 strip => 0,
403 version => 0,
404 );
405
406 my($ppport) = $0 =~ /([\w.]+)$/;
407 my $LF = '(?:\r\n|[\r\n])'; # line feed
408 my $HS = "[ \t]"; # horizontal whitespace
409
410 # Never use C comments in this file!
411 my $ccs = '/'.'*';
412 my $cce = '*'.'/';
413 my $rccs = quotemeta $ccs;
414 my $rcce = quotemeta $cce;
415
416 eval {
417 require Getopt::Long;
418 Getopt::Long::GetOptions(\%opt, qw(
419 help quiet diag! filter! hints! changes! cplusplus strip version
420 patch=s copy=s diff=s compat-version=s
421 list-provided list-unsupported api-info=s
422 )) or usage();
423 };
424
425 if ($@ and grep /^-/, @ARGV) {
426 usage() if "@ARGV" =~ /^--?h(?:elp)?$/;
427 die "Getopt::Long not found. Please don't use any options.\n";
428 }
429
430 if ($opt{version}) {
431 print "This is $0 $VERSION.\n";
432 exit 0;
433 }
434
435 usage() if $opt{help};
436 strip() if $opt{strip};
437
438 if (exists $opt{'compat-version'}) {
439 my($r,$v,$s) = eval { parse_version($opt{'compat-version'}) };
440 if ($@) {
441 die "Invalid version number format: '$opt{'compat-version'}'\n";
442 }
443 die "Only Perl 5 is supported\n" if $r != 5;
444 die "Invalid version number: $opt{'compat-version'}\n" if $v >= 1000 || $s >= 1000;
445 $opt{'compat-version'} = sprintf "%d.%03d%03d", $r, $v, $s;
446 }
447 else {
448 $opt{'compat-version'} = 5;
449 }
450
451 my %API = map { /^(\w+)\|([^|]*)\|([^|]*)\|(\w*)$/
452 ? ( $1 => {
453 ($2 ? ( base => $2 ) : ()),
454 ($3 ? ( todo => $3 ) : ()),
455 (index($4, 'v') >= 0 ? ( varargs => 1 ) : ()),
456 (index($4, 'p') >= 0 ? ( provided => 1 ) : ()),
457 (index($4, 'n') >= 0 ? ( nothxarg => 1 ) : ()),
458 } )
459 : die "invalid spec: $_" } qw(
460 AvFILLp|5.004050||p
461 AvFILL|||
462 BOM_UTF8|||
463 BhkDISABLE||5.024000|
464 BhkENABLE||5.024000|
465 BhkENTRY_set||5.024000|
466 BhkENTRY|||
467 BhkFLAGS|||
468 CALL_BLOCK_HOOKS|||
469 CLASS|||n
470 CPERLscope|5.005000||p
471 CX_CURPAD_SAVE|||
472 CX_CURPAD_SV|||
473 C_ARRAY_END|5.013002||p
474 C_ARRAY_LENGTH|5.008001||p
475 CopFILEAV|5.006000||p
476 CopFILEGV_set|5.006000||p
477 CopFILEGV|5.006000||p
478 CopFILESV|5.006000||p
479 CopFILE_set|5.006000||p
480 CopFILE|5.006000||p
481 CopSTASHPV_set|5.006000||p
482 CopSTASHPV|5.006000||p
483 CopSTASH_eq|5.006000||p
484 CopSTASH_set|5.006000||p
485 CopSTASH|5.006000||p
486 CopyD|5.009002|5.004050|p
487 Copy|||
488 CvPADLIST||5.008001|
489 CvSTASH|||
490 CvWEAKOUTSIDE|||
491 DECLARATION_FOR_LC_NUMERIC_MANIPULATION||5.021010|n
492 DEFSV_set|5.010001||p
493 DEFSV|5.004050||p
494 DO_UTF8||5.006000|
495 END_EXTERN_C|5.005000||p
496 ENTER|||
497 ERRSV|5.004050||p
498 EXTEND|||
499 EXTERN_C|5.005000||p
500 F0convert|||n
501 FREETMPS|||
502 GIMME_V||5.004000|n
503 GIMME|||n
504 GROK_NUMERIC_RADIX|5.007002||p
505 G_ARRAY|||
506 G_DISCARD|||
507 G_EVAL|||
508 G_METHOD|5.006001||p
509 G_NOARGS|||
510 G_SCALAR|||
511 G_VOID||5.004000|
512 GetVars|||
513 GvAV|||
514 GvCV|||
515 GvHV|||
516 GvSV|||
517 Gv_AMupdate||5.011000|
518 HEf_SVKEY|5.003070||p
519 HeHASH||5.003070|
520 HeKEY||5.003070|
521 HeKLEN||5.003070|
522 HePV||5.004000|
523 HeSVKEY_force||5.003070|
524 HeSVKEY_set||5.004000|
525 HeSVKEY||5.003070|
526 HeUTF8|5.010001|5.008000|p
527 HeVAL||5.003070|
528 HvENAMELEN||5.015004|
529 HvENAMEUTF8||5.015004|
530 HvENAME||5.013007|
531 HvNAMELEN_get|5.009003||p
532 HvNAMELEN||5.015004|
533 HvNAMEUTF8||5.015004|
534 HvNAME_get|5.009003||p
535 HvNAME|||
536 INT2PTR|5.006000||p
537 IN_LOCALE_COMPILETIME|5.007002||p
538 IN_LOCALE_RUNTIME|5.007002||p
539 IN_LOCALE|5.007002||p
540 IN_PERL_COMPILETIME|5.008001||p
541 IS_NUMBER_GREATER_THAN_UV_MAX|5.007002||p
542 IS_NUMBER_INFINITY|5.007002||p
543 IS_NUMBER_IN_UV|5.007002||p
544 IS_NUMBER_NAN|5.007003||p
545 IS_NUMBER_NEG|5.007002||p
546 IS_NUMBER_NOT_INT|5.007002||p
547 IVSIZE|5.006000||p
548 IVTYPE|5.006000||p
549 IVdf|5.006000||p
550 LEAVE|||
551 LIKELY|||p
552 LINKLIST||5.013006|
553 LVRET|||
554 MARK|||
555 MULTICALL||5.024000|
556 MUTABLE_PTR|5.010001||p
557 MUTABLE_SV|5.010001||p
558 MY_CXT_CLONE|5.009002||p
559 MY_CXT_INIT|5.007003||p
560 MY_CXT|5.007003||p
561 MoveD|5.009002|5.004050|p
562 Move|||
563 NOOP|5.005000||p
564 NUM2PTR|5.006000||p
565 NVTYPE|5.006000||p
566 NVef|5.006001||p
567 NVff|5.006001||p
568 NVgf|5.006001||p
569 Newxc|5.009003||p
570 Newxz|5.009003||p
571 Newx|5.009003||p
572 Nullav|||
573 Nullch|||
574 Nullcv|||
575 Nullhv|||
576 Nullsv|||
577 OP_CLASS||5.013007|
578 OP_DESC||5.007003|
579 OP_NAME||5.007003|
580 OP_TYPE_IS_OR_WAS||5.019010|
581 OP_TYPE_IS||5.019007|
582 ORIGMARK|||
583 OpHAS_SIBLING|5.021007||p
584 OpLASTSIB_set|5.021011||p
585 OpMAYBESIB_set|5.021011||p
586 OpMORESIB_set|5.021011||p
587 OpSIBLING|5.021007||p
588 PAD_BASE_SV|||
589 PAD_CLONE_VARS|||
590 PAD_COMPNAME_FLAGS|||
591 PAD_COMPNAME_GEN_set|||
592 PAD_COMPNAME_GEN|||
593 PAD_COMPNAME_OURSTASH|||
594 PAD_COMPNAME_PV|||
595 PAD_COMPNAME_TYPE|||
596 PAD_RESTORE_LOCAL|||
597 PAD_SAVE_LOCAL|||
598 PAD_SAVE_SETNULLPAD|||
599 PAD_SETSV|||
600 PAD_SET_CUR_NOSAVE|||
601 PAD_SET_CUR|||
602 PAD_SVl|||
603 PAD_SV|||
604 PERLIO_FUNCS_CAST|5.009003||p
605 PERLIO_FUNCS_DECL|5.009003||p
606 PERL_ABS|5.008001||p
607 PERL_ARGS_ASSERT_CROAK_XS_USAGE|||p
608 PERL_BCDVERSION|5.024000||p
609 PERL_GCC_BRACE_GROUPS_FORBIDDEN|5.008001||p
610 PERL_HASH|5.003070||p
611 PERL_INT_MAX|5.003070||p
612 PERL_INT_MIN|5.003070||p
613 PERL_LONG_MAX|5.003070||p
614 PERL_LONG_MIN|5.003070||p
615 PERL_MAGIC_arylen|5.007002||p
616 PERL_MAGIC_backref|5.007002||p
617 PERL_MAGIC_bm|5.007002||p
618 PERL_MAGIC_collxfrm|5.007002||p
619 PERL_MAGIC_dbfile|5.007002||p
620 PERL_MAGIC_dbline|5.007002||p
621 PERL_MAGIC_defelem|5.007002||p
622 PERL_MAGIC_envelem|5.007002||p
623 PERL_MAGIC_env|5.007002||p
624 PERL_MAGIC_ext|5.007002||p
625 PERL_MAGIC_fm|5.007002||p
626 PERL_MAGIC_glob|5.024000||p
627 PERL_MAGIC_isaelem|5.007002||p
628 PERL_MAGIC_isa|5.007002||p
629 PERL_MAGIC_mutex|5.024000||p
630 PERL_MAGIC_nkeys|5.007002||p
631 PERL_MAGIC_overload_elem|5.024000||p
632 PERL_MAGIC_overload_table|5.007002||p
633 PERL_MAGIC_overload|5.024000||p
634 PERL_MAGIC_pos|5.007002||p
635 PERL_MAGIC_qr|5.007002||p
636 PERL_MAGIC_regdata|5.007002||p
637 PERL_MAGIC_regdatum|5.007002||p
638 PERL_MAGIC_regex_global|5.007002||p
639 PERL_MAGIC_shared_scalar|5.007003||p
640 PERL_MAGIC_shared|5.007003||p
641 PERL_MAGIC_sigelem|5.007002||p
642 PERL_MAGIC_sig|5.007002||p
643 PERL_MAGIC_substr|5.007002||p
644 PERL_MAGIC_sv|5.007002||p
645 PERL_MAGIC_taint|5.007002||p
646 PERL_MAGIC_tiedelem|5.007002||p
647 PERL_MAGIC_tiedscalar|5.007002||p
648 PERL_MAGIC_tied|5.007002||p
649 PERL_MAGIC_utf8|5.008001||p
650 PERL_MAGIC_uvar_elem|5.007003||p
651 PERL_MAGIC_uvar|5.007002||p
652 PERL_MAGIC_vec|5.007002||p
653 PERL_MAGIC_vstring|5.008001||p
654 PERL_PV_ESCAPE_ALL|5.009004||p
655 PERL_PV_ESCAPE_FIRSTCHAR|5.009004||p
656 PERL_PV_ESCAPE_NOBACKSLASH|5.009004||p
657 PERL_PV_ESCAPE_NOCLEAR|5.009004||p
658 PERL_PV_ESCAPE_QUOTE|5.009004||p
659 PERL_PV_ESCAPE_RE|5.009005||p
660 PERL_PV_ESCAPE_UNI_DETECT|5.009004||p
661 PERL_PV_ESCAPE_UNI|5.009004||p
662 PERL_PV_PRETTY_DUMP|5.009004||p
663 PERL_PV_PRETTY_ELLIPSES|5.010000||p
664 PERL_PV_PRETTY_LTGT|5.009004||p
665 PERL_PV_PRETTY_NOCLEAR|5.010000||p
666 PERL_PV_PRETTY_QUOTE|5.009004||p
667 PERL_PV_PRETTY_REGPROP|5.009004||p
668 PERL_QUAD_MAX|5.003070||p
669 PERL_QUAD_MIN|5.003070||p
670 PERL_REVISION|5.006000||p
671 PERL_SCAN_ALLOW_UNDERSCORES|5.007003||p
672 PERL_SCAN_DISALLOW_PREFIX|5.007003||p
673 PERL_SCAN_GREATER_THAN_UV_MAX|5.007003||p
674 PERL_SCAN_SILENT_ILLDIGIT|5.008001||p
675 PERL_SHORT_MAX|5.003070||p
676 PERL_SHORT_MIN|5.003070||p
677 PERL_SIGNALS_UNSAFE_FLAG|5.008001||p
678 PERL_SUBVERSION|5.006000||p
679 PERL_SYS_INIT3||5.006000|
680 PERL_SYS_INIT|||
681 PERL_SYS_TERM||5.024000|
682 PERL_UCHAR_MAX|5.003070||p
683 PERL_UCHAR_MIN|5.003070||p
684 PERL_UINT_MAX|5.003070||p
685 PERL_UINT_MIN|5.003070||p
686 PERL_ULONG_MAX|5.003070||p
687 PERL_ULONG_MIN|5.003070||p
688 PERL_UNUSED_ARG|5.009003||p
689 PERL_UNUSED_CONTEXT|5.009004||p
690 PERL_UNUSED_DECL|5.007002||p
691 PERL_UNUSED_RESULT|5.021001||p
692 PERL_UNUSED_VAR|5.007002||p
693 PERL_UQUAD_MAX|5.003070||p
694 PERL_UQUAD_MIN|5.003070||p
695 PERL_USE_GCC_BRACE_GROUPS|5.009004||p
696 PERL_USHORT_MAX|5.003070||p
697 PERL_USHORT_MIN|5.003070||p
698 PERL_VERSION|5.006000||p
699 PL_DBsignal|5.005000||p
700 PL_DBsingle|||pn
701 PL_DBsub|||pn
702 PL_DBtrace|||pn
703 PL_Sv|5.005000||p
704 PL_bufend|5.024000||p
705 PL_bufptr|5.024000||p
706 PL_check||5.006000|
707 PL_compiling|5.004050||p
708 PL_comppad_name||5.017004|
709 PL_comppad||5.008001|
710 PL_copline|5.024000||p
711 PL_curcop|5.004050||p
712 PL_curpad||5.005000|
713 PL_curstash|5.004050||p
714 PL_debstash|5.004050||p
715 PL_defgv|5.004050||p
716 PL_diehook|5.004050||p
717 PL_dirty|5.004050||p
718 PL_dowarn|||pn
719 PL_errgv|5.004050||p
720 PL_error_count|5.024000||p
721 PL_expect|5.024000||p
722 PL_hexdigit|5.005000||p
723 PL_hints|5.005000||p
724 PL_in_my_stash|5.024000||p
725 PL_in_my|5.024000||p
726 PL_keyword_plugin||5.011002|
727 PL_last_in_gv|||n
728 PL_laststatval|5.005000||p
729 PL_lex_state|5.024000||p
730 PL_lex_stuff|5.024000||p
731 PL_linestr|5.024000||p
732 PL_modglobal||5.005000|n
733 PL_na|5.004050||pn
734 PL_no_modify|5.006000||p
735 PL_ofsgv|||n
736 PL_opfreehook||5.011000|n
737 PL_parser|5.009005||p
738 PL_peepp||5.007003|n
739 PL_perl_destruct_level|5.004050||p
740 PL_perldb|5.004050||p
741 PL_ppaddr|5.006000||p
742 PL_rpeepp||5.013005|n
743 PL_rsfp_filters|5.024000||p
744 PL_rsfp|5.024000||p
745 PL_rs|||n
746 PL_signals|5.008001||p
747 PL_stack_base|5.004050||p
748 PL_stack_sp|5.004050||p
749 PL_statcache|5.005000||p
750 PL_stdingv|5.004050||p
751 PL_sv_arenaroot|5.004050||p
752 PL_sv_no|5.004050||pn
753 PL_sv_undef|5.004050||pn
754 PL_sv_yes|5.004050||pn
755 PL_sv_zero|||n
756 PL_tainted|5.004050||p
757 PL_tainting|5.004050||p
758 PL_tokenbuf|5.024000||p
759 POP_MULTICALL||5.024000|
760 POPi|||n
761 POPl|||n
762 POPn|||n
763 POPpbytex||5.007001|n
764 POPpx||5.005030|n
765 POPp|||n
766 POPs|||n
767 POPul||5.006000|n
768 POPu||5.004000|n
769 PTR2IV|5.006000||p
770 PTR2NV|5.006000||p
771 PTR2UV|5.006000||p
772 PTR2nat|5.009003||p
773 PTR2ul|5.007001||p
774 PTRV|5.006000||p
775 PUSHMARK|||
776 PUSH_MULTICALL||5.024000|
777 PUSHi|||
778 PUSHmortal|5.009002||p
779 PUSHn|||
780 PUSHp|||
781 PUSHs|||
782 PUSHu|5.004000||p
783 PUTBACK|||
784 PadARRAY||5.024000|
785 PadMAX||5.024000|
786 PadlistARRAY||5.024000|
787 PadlistMAX||5.024000|
788 PadlistNAMESARRAY||5.024000|
789 PadlistNAMESMAX||5.024000|
790 PadlistNAMES||5.024000|
791 PadlistREFCNT||5.017004|
792 PadnameIsOUR|||
793 PadnameIsSTATE|||
794 PadnameLEN||5.024000|
795 PadnameOURSTASH|||
796 PadnameOUTER|||
797 PadnamePV||5.024000|
798 PadnameREFCNT_dec||5.024000|
799 PadnameREFCNT||5.024000|
800 PadnameSV||5.024000|
801 PadnameTYPE|||
802 PadnameUTF8||5.021007|
803 PadnamelistARRAY||5.024000|
804 PadnamelistMAX||5.024000|
805 PadnamelistREFCNT_dec||5.024000|
806 PadnamelistREFCNT||5.024000|
807 PerlIO_clearerr||5.007003|
808 PerlIO_close||5.007003|
809 PerlIO_context_layers||5.009004|
810 PerlIO_eof||5.007003|
811 PerlIO_error||5.007003|
812 PerlIO_fileno||5.007003|
813 PerlIO_fill||5.007003|
814 PerlIO_flush||5.007003|
815 PerlIO_get_base||5.007003|
816 PerlIO_get_bufsiz||5.007003|
817 PerlIO_get_cnt||5.007003|
818 PerlIO_get_ptr||5.007003|
819 PerlIO_read||5.007003|
820 PerlIO_restore_errno|||
821 PerlIO_save_errno|||
822 PerlIO_seek||5.007003|
823 PerlIO_set_cnt||5.007003|
824 PerlIO_set_ptrcnt||5.007003|
825 PerlIO_setlinebuf||5.007003|
826 PerlIO_stderr||5.007003|
827 PerlIO_stdin||5.007003|
828 PerlIO_stdout||5.007003|
829 PerlIO_tell||5.007003|
830 PerlIO_unread||5.007003|
831 PerlIO_write||5.007003|
832 PerlLIO_dup2_cloexec|||
833 PerlLIO_dup_cloexec|||
834 PerlLIO_open3_cloexec|||
835 PerlLIO_open_cloexec|||
836 PerlProc_pipe_cloexec|||
837 PerlSock_accept_cloexec|||
838 PerlSock_socket_cloexec|||
839 PerlSock_socketpair_cloexec|||
840 Perl_langinfo|||n
841 Perl_setlocale|||n
842 PoisonFree|5.009004||p
843 PoisonNew|5.009004||p
844 PoisonWith|5.009004||p
845 Poison|5.008000||p
846 READ_XDIGIT||5.017006|
847 REPLACEMENT_CHARACTER_UTF8|||
848 RESTORE_LC_NUMERIC||5.024000|
849 RETVAL|||n
850 Renewc|||
851 Renew|||
852 SAVECLEARSV|||
853 SAVECOMPPAD|||
854 SAVEPADSV|||
855 SAVETMPS|||
856 SAVE_DEFSV|5.004050||p
857 SPAGAIN|||
858 SP|||
859 START_EXTERN_C|5.005000||p
860 START_MY_CXT|5.007003||p
861 STMT_END|||p
862 STMT_START|||p
863 STORE_LC_NUMERIC_FORCE_TO_UNDERLYING||5.024000|
864 STORE_LC_NUMERIC_SET_TO_NEEDED||5.024000|
865 STR_WITH_LEN|5.009003||p
866 ST|||
867 SV_CONST_RETURN|5.009003||p
868 SV_COW_DROP_PV|5.008001||p
869 SV_COW_SHARED_HASH_KEYS|5.009005||p
870 SV_GMAGIC|5.007002||p
871 SV_HAS_TRAILING_NUL|5.009004||p
872 SV_IMMEDIATE_UNREF|5.007001||p
873 SV_MUTABLE_RETURN|5.009003||p
874 SV_NOSTEAL|5.009002||p
875 SV_SMAGIC|5.009003||p
876 SV_UTF8_NO_ENCODING|5.008001||p
877 SVfARG|5.009005||p
878 SVf_UTF8|5.006000||p
879 SVf|5.006000||p
880 SVt_INVLIST||5.019002|
881 SVt_IV|||
882 SVt_NULL|||
883 SVt_NV|||
884 SVt_PVAV|||
885 SVt_PVCV|||
886 SVt_PVFM|||
887 SVt_PVGV|||
888 SVt_PVHV|||
889 SVt_PVIO|||
890 SVt_PVIV|||
891 SVt_PVLV|||
892 SVt_PVMG|||
893 SVt_PVNV|||
894 SVt_PV|||
895 SVt_REGEXP||5.011000|
896 Safefree|||
897 Slab_Alloc|||
898 Slab_Free|||
899 Slab_to_ro|||
900 Slab_to_rw|||
901 StructCopy|||
902 SvCUR_set|||
903 SvCUR|||
904 SvEND|||
905 SvGAMAGIC||5.006001|
906 SvGETMAGIC|5.004050||p
907 SvGROW|||
908 SvIOK_UV||5.006000|
909 SvIOK_notUV||5.006000|
910 SvIOK_off|||
911 SvIOK_only_UV||5.006000|
912 SvIOK_only|||
913 SvIOK_on|||
914 SvIOKp|||
915 SvIOK|||
916 SvIVX|||
917 SvIV_nomg|5.009001||p
918 SvIV_set|||
919 SvIVx|||
920 SvIV|||
921 SvIsCOW_shared_hash||5.008003|
922 SvIsCOW||5.008003|
923 SvLEN_set|||
924 SvLEN|||
925 SvLOCK||5.007003|
926 SvMAGIC_set|5.009003||p
927 SvNIOK_off|||
928 SvNIOKp|||
929 SvNIOK|||
930 SvNOK_off|||
931 SvNOK_only|||
932 SvNOK_on|||
933 SvNOKp|||
934 SvNOK|||
935 SvNVX|||
936 SvNV_nomg||5.013002|
937 SvNV_set|||
938 SvNVx|||
939 SvNV|||
940 SvOK|||
941 SvOOK_offset||5.011000|
942 SvOOK|||
943 SvPOK_off|||
944 SvPOK_only_UTF8||5.006000|
945 SvPOK_only|||
946 SvPOK_on|||
947 SvPOKp|||
948 SvPOK|||
949 SvPVCLEAR|||
950 SvPVX_const|5.009003||p
951 SvPVX_mutable|5.009003||p
952 SvPVX|||
953 SvPV_const|5.009003||p
954 SvPV_flags_const_nolen|5.009003||p
955 SvPV_flags_const|5.009003||p
956 SvPV_flags_mutable|5.009003||p
957 SvPV_flags|5.007002||p
958 SvPV_force_flags_mutable|5.009003||p
959 SvPV_force_flags_nolen|5.009003||p
960 SvPV_force_flags|5.007002||p
961 SvPV_force_mutable|5.009003||p
962 SvPV_force_nolen|5.009003||p
963 SvPV_force_nomg_nolen|5.009003||p
964 SvPV_force_nomg|5.007002||p
965 SvPV_force|||p
966 SvPV_mutable|5.009003||p
967 SvPV_nolen_const|5.009003||p
968 SvPV_nolen|5.006000||p
969 SvPV_nomg_const_nolen|5.009003||p
970 SvPV_nomg_const|5.009003||p
971 SvPV_nomg_nolen|5.013007||p
972 SvPV_nomg|5.007002||p
973 SvPV_renew|5.009003||p
974 SvPV_set|||
975 SvPVbyte_force||5.009002|
976 SvPVbyte_nolen||5.006000|
977 SvPVbytex_force||5.006000|
978 SvPVbytex||5.006000|
979 SvPVbyte|5.006000||p
980 SvPVutf8_force||5.006000|
981 SvPVutf8_nolen||5.006000|
982 SvPVutf8x_force||5.006000|
983 SvPVutf8x||5.006000|
984 SvPVutf8||5.006000|
985 SvPVx|||
986 SvPV|||
987 SvREADONLY_off|||
988 SvREADONLY_on|||
989 SvREADONLY|||
990 SvREFCNT_dec_NN||5.017007|
991 SvREFCNT_dec|||
992 SvREFCNT_inc_NN|5.009004||p
993 SvREFCNT_inc_simple_NN|5.009004||p
994 SvREFCNT_inc_simple_void_NN|5.009004||p
995 SvREFCNT_inc_simple_void|5.009004||p
996 SvREFCNT_inc_simple|5.009004||p
997 SvREFCNT_inc_void_NN|5.009004||p
998 SvREFCNT_inc_void|5.009004||p
999 SvREFCNT_inc|||p
1000 SvREFCNT|||
1001 SvROK_off|||
1002 SvROK_on|||
1003 SvROK|||
1004 SvRV_set|5.009003||p
1005 SvRV|||
1006 SvRXOK|5.009005||p
1007 SvRX|5.009005||p
1008 SvSETMAGIC|||
1009 SvSHARED_HASH|5.009003||p
1010 SvSHARE||5.007003|
1011 SvSTASH_set|5.009003||p
1012 SvSTASH|||
1013 SvSetMagicSV_nosteal||5.004000|
1014 SvSetMagicSV||5.004000|
1015 SvSetSV_nosteal||5.004000|
1016 SvSetSV|||
1017 SvTAINTED_off||5.004000|
1018 SvTAINTED_on||5.004000|
1019 SvTAINTED||5.004000|
1020 SvTAINT|||
1021 SvTHINKFIRST|||
1022 SvTRUE_nomg||5.013006|
1023 SvTRUE|||
1024 SvTYPE|||
1025 SvUNLOCK||5.007003|
1026 SvUOK|5.007001|5.006000|p
1027 SvUPGRADE|||
1028 SvUTF8_off||5.006000|
1029 SvUTF8_on||5.006000|
1030 SvUTF8||5.006000|
1031 SvUVXx|5.004000||p
1032 SvUVX|5.004000||p
1033 SvUV_nomg|5.009001||p
1034 SvUV_set|5.009003||p
1035 SvUVx|5.004000||p
1036 SvUV|5.004000||p
1037 SvVOK||5.008001|
1038 SvVSTRING_mg|5.009004||p
1039 THIS|||n
1040 UNDERBAR|5.009002||p
1041 UNICODE_REPLACEMENT|||p
1042 UNLIKELY|||p
1043 UTF8SKIP||5.006000|
1044 UTF8_IS_INVARIANT|||
1045 UTF8_IS_NONCHAR|||
1046 UTF8_IS_SUPER|||
1047 UTF8_IS_SURROGATE|||
1048 UTF8_MAXBYTES|5.009002||p
1049 UTF8_SAFE_SKIP|||p
1050 UVCHR_IS_INVARIANT|||
1051 UVCHR_SKIP||5.022000|
1052 UVSIZE|5.006000||p
1053 UVTYPE|5.006000||p
1054 UVXf|5.007001||p
1055 UVof|5.006000||p
1056 UVuf|5.006000||p
1057 UVxf|5.006000||p
1058 WARN_ALL|5.006000||p
1059 WARN_AMBIGUOUS|5.006000||p
1060 WARN_ASSERTIONS|5.024000||p
1061 WARN_BAREWORD|5.006000||p
1062 WARN_CLOSED|5.006000||p
1063 WARN_CLOSURE|5.006000||p
1064 WARN_DEBUGGING|5.006000||p
1065 WARN_DEPRECATED|5.006000||p
1066 WARN_DIGIT|5.006000||p
1067 WARN_EXEC|5.006000||p
1068 WARN_EXITING|5.006000||p
1069 WARN_GLOB|5.006000||p
1070 WARN_INPLACE|5.006000||p
1071 WARN_INTERNAL|5.006000||p
1072 WARN_IO|5.006000||p
1073 WARN_LAYER|5.008000||p
1074 WARN_MALLOC|5.006000||p
1075 WARN_MISC|5.006000||p
1076 WARN_NEWLINE|5.006000||p
1077 WARN_NUMERIC|5.006000||p
1078 WARN_ONCE|5.006000||p
1079 WARN_OVERFLOW|5.006000||p
1080 WARN_PACK|5.006000||p
1081 WARN_PARENTHESIS|5.006000||p
1082 WARN_PIPE|5.006000||p
1083 WARN_PORTABLE|5.006000||p
1084 WARN_PRECEDENCE|5.006000||p
1085 WARN_PRINTF|5.006000||p
1086 WARN_PROTOTYPE|5.006000||p
1087 WARN_QW|5.006000||p
1088 WARN_RECURSION|5.006000||p
1089 WARN_REDEFINE|5.006000||p
1090 WARN_REGEXP|5.006000||p
1091 WARN_RESERVED|5.006000||p
1092 WARN_SEMICOLON|5.006000||p
1093 WARN_SEVERE|5.006000||p
1094 WARN_SIGNAL|5.006000||p
1095 WARN_SUBSTR|5.006000||p
1096 WARN_SYNTAX|5.006000||p
1097 WARN_TAINT|5.006000||p
1098 WARN_THREADS|5.008000||p
1099 WARN_UNINITIALIZED|5.006000||p
1100 WARN_UNOPENED|5.006000||p
1101 WARN_UNPACK|5.006000||p
1102 WARN_UNTIE|5.006000||p
1103 WARN_UTF8|5.006000||p
1104 WARN_VOID|5.006000||p
1105 WIDEST_UTYPE|5.015004||p
1106 XCPT_CATCH|5.009002||p
1107 XCPT_RETHROW|5.009002||p
1108 XCPT_TRY_END|5.009002||p
1109 XCPT_TRY_START|5.009002||p
1110 XPUSHi|||
1111 XPUSHmortal|5.009002||p
1112 XPUSHn|||
1113 XPUSHp|||
1114 XPUSHs|||
1115 XPUSHu|5.004000||p
1116 XSPROTO|5.010000||p
1117 XSRETURN_EMPTY|||
1118 XSRETURN_IV|||
1119 XSRETURN_NO|||
1120 XSRETURN_NV|||
1121 XSRETURN_PV|||
1122 XSRETURN_UNDEF|||
1123 XSRETURN_UV|5.008001||p
1124 XSRETURN_YES|||
1125 XSRETURN|||p
1126 XST_mIV|||
1127 XST_mNO|||
1128 XST_mNV|||
1129 XST_mPV|||
1130 XST_mUNDEF|||
1131 XST_mUV|5.008001||p
1132 XST_mYES|||
1133 XS_APIVERSION_BOOTCHECK||5.024000|
1134 XS_EXTERNAL||5.024000|
1135 XS_INTERNAL||5.024000|
1136 XS_VERSION_BOOTCHECK||5.024000|
1137 XS_VERSION|||
1138 XSprePUSH|5.006000||p
1139 XS|||
1140 XopDISABLE||5.024000|
1141 XopENABLE||5.024000|
1142 XopENTRYCUSTOM||5.024000|
1143 XopENTRY_set||5.024000|
1144 XopENTRY||5.024000|
1145 XopFLAGS||5.013007|
1146 ZeroD|5.009002||p
1147 Zero|||
1148 __ASSERT_|||p
1149 _aMY_CXT|5.007003||p
1150 _inverse_folds|||
1151 _is_grapheme|||
1152 _is_in_locale_category|||
1153 _new_invlist_C_array|||
1154 _pMY_CXT|5.007003||p
1155 _to_fold_latin1|||n
1156 _to_upper_title_latin1|||
1157 _to_utf8_case|||
1158 _variant_byte_number|||n
1159 _warn_problematic_locale|||n
1160 aMY_CXT_|5.007003||p
1161 aMY_CXT|5.007003||p
1162 aTHXR_|5.024000||p
1163 aTHXR|5.024000||p
1164 aTHX_|5.006000||p
1165 aTHX|5.006000||p
1166 abort_execution|||
1167 add_above_Latin1_folds|||
1168 add_data|||n
1169 add_multi_match|||
1170 add_utf16_textfilter|||
1171 adjust_size_and_find_bucket|||n
1172 advance_one_LB|||
1173 advance_one_SB|||
1174 advance_one_WB|||
1175 allocmy|||
1176 amagic_call|||
1177 amagic_cmp_locale|||
1178 amagic_cmp|||
1179 amagic_deref_call||5.013007|
1180 amagic_i_ncmp|||
1181 amagic_is_enabled|||
1182 amagic_ncmp|||
1183 anonymise_cv_maybe|||
1184 any_dup|||
1185 ao|||
1186 apply_attrs_my|||
1187 apply_attrs|||
1188 apply|||
1189 argvout_final|||
1190 assert_uft8_cache_coherent|||
1191 assignment_type|||
1192 atfork_lock||5.007003|n
1193 atfork_unlock||5.007003|n
1194 av_arylen_p||5.009003|
1195 av_clear|||
1196 av_delete||5.006000|
1197 av_exists||5.006000|
1198 av_extend_guts|||
1199 av_extend|||
1200 av_fetch|||
1201 av_fill|||
1202 av_iter_p||5.011000|
1203 av_len|||
1204 av_make|||
1205 av_nonelem|||
1206 av_pop|||
1207 av_push|||
1208 av_reify|||
1209 av_shift|||
1210 av_store|||
1211 av_tindex|5.017009|5.017009|p
1212 av_top_index|5.017009|5.017009|p
1213 av_undef|||
1214 av_unshift|||
1215 ax|||n
1216 backup_one_GCB|||
1217 backup_one_LB|||
1218 backup_one_SB|||
1219 backup_one_WB|||
1220 bad_type_gv|||
1221 bad_type_pv|||
1222 bind_match|||
1223 block_end||5.004000|
1224 block_gimme||5.004000|
1225 block_start||5.004000|
1226 blockhook_register||5.013003|
1227 boolSV|5.004000||p
1228 boot_core_PerlIO|||
1229 boot_core_UNIVERSAL|||
1230 boot_core_mro|||
1231 bytes_cmp_utf8||5.013007|
1232 cBOOL|5.013000||p
1233 call_argv|5.006000||p
1234 call_atexit||5.006000|
1235 call_list||5.004000|
1236 call_method|5.006000||p
1237 call_pv|5.006000||p
1238 call_sv|5.006000||p
1239 caller_cx|5.013005|5.006000|p
1240 calloc||5.007002|n
1241 cando|||
1242 cast_i32||5.006000|n
1243 cast_iv||5.006000|n
1244 cast_ulong||5.006000|n
1245 cast_uv||5.006000|n
1246 category_name|||n
1247 change_engine_size|||
1248 check_and_deprecate|||
1249 check_type_and_open|||
1250 check_uni|||
1251 checkcomma|||
1252 ckWARN2_d|||
1253 ckWARN2|||
1254 ckWARN3_d|||
1255 ckWARN3|||
1256 ckWARN4_d|||
1257 ckWARN4|||
1258 ckWARN_d|||
1259 ckWARN|5.006000||p
1260 ck_entersub_args_core|||
1261 ck_entersub_args_list||5.013006|
1262 ck_entersub_args_proto_or_list||5.013006|
1263 ck_entersub_args_proto||5.013006|
1264 ck_warner_d||5.011001|v
1265 ck_warner||5.011001|v
1266 ckwarn_common|||
1267 ckwarn_d||5.009003|
1268 ckwarn||5.009003|
1269 clear_defarray||5.023008|
1270 clear_special_blocks|||
1271 clone_params_del|||n
1272 clone_params_new|||n
1273 closest_cop|||
1274 cntrl_to_mnemonic|||n
1275 compute_EXACTish|||n
1276 construct_ahocorasick_from_trie|||
1277 cop_free|||
1278 cop_hints_2hv||5.013007|
1279 cop_hints_fetch_pvn||5.013007|
1280 cop_hints_fetch_pvs||5.013007|
1281 cop_hints_fetch_pv||5.013007|
1282 cop_hints_fetch_sv||5.013007|
1283 cophh_2hv||5.013007|
1284 cophh_copy||5.013007|
1285 cophh_delete_pvn||5.013007|
1286 cophh_delete_pvs||5.013007|
1287 cophh_delete_pv||5.013007|
1288 cophh_delete_sv||5.013007|
1289 cophh_fetch_pvn||5.013007|
1290 cophh_fetch_pvs||5.013007|
1291 cophh_fetch_pv||5.013007|
1292 cophh_fetch_sv||5.013007|
1293 cophh_free||5.013007|
1294 cophh_new_empty||5.024000|
1295 cophh_store_pvn||5.013007|
1296 cophh_store_pvs||5.013007|
1297 cophh_store_pv||5.013007|
1298 cophh_store_sv||5.013007|
1299 core_prototype|||
1300 coresub_op|||
1301 cr_textfilter|||
1302 croak_caller|||vn
1303 croak_memory_wrap|5.019003||pn
1304 croak_no_mem|||n
1305 croak_no_modify|5.013003||pn
1306 croak_nocontext|||pvn
1307 croak_popstack|||n
1308 croak_sv|5.013001||p
1309 croak_xs_usage|5.010001||pn
1310 croak|||v
1311 csighandler||5.009003|n
1312 current_re_engine|||
1313 curse|||
1314 custom_op_desc||5.007003|
1315 custom_op_get_field|||
1316 custom_op_name||5.007003|
1317 custom_op_register||5.013007|
1318 custom_op_xop||5.013007|
1319 cv_clone_into|||
1320 cv_clone|||
1321 cv_const_sv_or_av|||n
1322 cv_const_sv||5.003070|n
1323 cv_dump|||
1324 cv_forget_slab|||
1325 cv_get_call_checker_flags|||
1326 cv_get_call_checker||5.013006|
1327 cv_name||5.021005|
1328 cv_set_call_checker_flags||5.021004|
1329 cv_set_call_checker||5.013006|
1330 cv_undef_flags|||
1331 cv_undef|||
1332 cvgv_from_hek|||
1333 cvgv_set|||
1334 cvstash_set|||
1335 cx_dump||5.005000|
1336 cx_dup|||
1337 cxinc|||
1338 dAXMARK|5.009003||p
1339 dAX|5.007002||p
1340 dITEMS|5.007002||p
1341 dMARK|||
1342 dMULTICALL||5.009003|
1343 dMY_CXT_SV|5.007003||p
1344 dMY_CXT|5.007003||p
1345 dNOOP|5.006000||p
1346 dORIGMARK|||
1347 dSP|||
1348 dTHR|5.004050||p
1349 dTHXR|5.024000||p
1350 dTHXa|5.006000||p
1351 dTHXoa|5.006000||p
1352 dTHX|5.006000||p
1353 dUNDERBAR|5.009002||p
1354 dVAR|5.009003||p
1355 dXCPT|5.009002||p
1356 dXSARGS|||
1357 dXSI32|||
1358 dXSTARG|5.006000||p
1359 deb_curcv|||
1360 deb_nocontext|||vn
1361 deb_stack_all|||
1362 deb_stack_n|||
1363 debop||5.005000|
1364 debprofdump||5.005000|
1365 debprof|||
1366 debstackptrs||5.007003|
1367 debstack||5.007003|
1368 debug_start_match|||
1369 deb||5.007003|v
1370 defelem_target|||
1371 del_sv|||
1372 delimcpy_no_escape|||n
1373 delimcpy||5.004000|n
1374 despatch_signals||5.007001|
1375 destroy_matcher|||
1376 die_nocontext|||vn
1377 die_sv|5.013001||p
1378 die_unwind|||
1379 die|||v
1380 dirp_dup|||
1381 div128|||
1382 djSP|||
1383 do_aexec5|||
1384 do_aexec|||
1385 do_aspawn|||
1386 do_binmode||5.004050|
1387 do_chomp|||
1388 do_close|||
1389 do_delete_local|||
1390 do_dump_pad|||
1391 do_eof|||
1392 do_exec3|||
1393 do_exec|||
1394 do_gv_dump||5.006000|
1395 do_gvgv_dump||5.006000|
1396 do_hv_dump||5.006000|
1397 do_ipcctl|||
1398 do_ipcget|||
1399 do_join|||
1400 do_magic_dump||5.006000|
1401 do_msgrcv|||
1402 do_msgsnd|||
1403 do_ncmp|||
1404 do_oddball|||
1405 do_op_dump||5.006000|
1406 do_open9||5.006000|
1407 do_openn||5.007001|
1408 do_open||5.003070|
1409 do_pmop_dump||5.006000|
1410 do_print|||
1411 do_readline|||
1412 do_seek|||
1413 do_semop|||
1414 do_shmio|||
1415 do_smartmatch|||
1416 do_spawn_nowait|||
1417 do_spawn|||
1418 do_sprintf|||
1419 do_sv_dump||5.006000|
1420 do_sysseek|||
1421 do_tell|||
1422 do_trans_complex_utf8|||
1423 do_trans_complex|||
1424 do_trans_count_utf8|||
1425 do_trans_count|||
1426 do_trans_simple_utf8|||
1427 do_trans_simple|||
1428 do_trans|||
1429 do_vecget|||
1430 do_vecset|||
1431 do_vop|||
1432 docatch|||
1433 does_utf8_overflow|||n
1434 doeval_compile|||
1435 dofile|||
1436 dofindlabel|||
1437 doform|||
1438 doing_taint||5.008001|n
1439 dooneliner|||
1440 doopen_pm|||
1441 doparseform|||
1442 dopoptoeval|||
1443 dopoptogivenfor|||
1444 dopoptolabel|||
1445 dopoptoloop|||
1446 dopoptosub_at|||
1447 dopoptowhen|||
1448 doref||5.009003|
1449 dounwind|||
1450 dowantarray|||
1451 drand48_init_r|||n
1452 drand48_r|||n
1453 dtrace_probe_call|||
1454 dtrace_probe_load|||
1455 dtrace_probe_op|||
1456 dtrace_probe_phase|||
1457 dump_all_perl|||
1458 dump_all||5.006000|
1459 dump_c_backtrace|||
1460 dump_eval||5.006000|
1461 dump_exec_pos|||
1462 dump_form||5.006000|
1463 dump_indent||5.006000|v
1464 dump_mstats|||
1465 dump_packsubs_perl|||
1466 dump_packsubs||5.006000|
1467 dump_regex_sets_structures|||
1468 dump_sub_perl|||
1469 dump_sub||5.006000|
1470 dump_sv_child|||
1471 dump_trie_interim_list|||
1472 dump_trie_interim_table|||
1473 dump_trie|||
1474 dump_vindent||5.006000|
1475 dumpuntil|||
1476 dup_attrlist|||
1477 dup_warnings|||
1478 edit_distance|||n
1479 emulate_setlocale|||n
1480 eval_pv|5.006000||p
1481 eval_sv|5.006000||p
1482 exec_failed|||
1483 expect_number|||
1484 fbm_compile||5.005000|
1485 fbm_instr||5.005000|
1486 feature_is_enabled|||
1487 filter_add|||
1488 filter_del|||
1489 filter_gets|||
1490 filter_read|||
1491 finalize_optree|||
1492 finalize_op|||
1493 find_and_forget_pmops|||
1494 find_array_subscript|||
1495 find_beginning|||
1496 find_byclass|||
1497 find_default_stash|||
1498 find_hash_subscript|||
1499 find_in_my_stash|||
1500 find_lexical_cv|||
1501 find_next_masked|||n
1502 find_runcv_where|||
1503 find_runcv||5.008001|
1504 find_rundefsv||5.013002|
1505 find_script|||
1506 find_span_end_mask|||n
1507 find_span_end|||n
1508 first_symbol|||n
1509 fixup_errno_string|||
1510 foldEQ_latin1_s2_folded|||n
1511 foldEQ_latin1||5.013008|n
1512 foldEQ_locale||5.013002|n
1513 foldEQ_utf8||5.013002|
1514 foldEQ||5.013002|n
1515 fold_constants|||
1516 forbid_setid|||
1517 force_ident_maybe_lex|||
1518 force_ident|||
1519 force_list|||
1520 force_next|||
1521 force_strict_version|||
1522 force_version|||
1523 force_word|||
1524 forget_pmop|||
1525 form_nocontext|||vn
1526 form||5.004000|v
1527 fp_dup|||
1528 fprintf_nocontext|||vn
1529 free_c_backtrace|||
1530 free_global_struct|||
1531 free_tied_hv_pool|||
1532 free_tmps|||
1533 gen_constant_list|||
1534 get_ANYOFM_contents|||
1535 get_ANYOF_cp_list_for_ssc|||
1536 get_and_check_backslash_N_name_wrapper|||
1537 get_and_check_backslash_N_name|||
1538 get_aux_mg|||
1539 get_av|5.006000||p
1540 get_c_backtrace_dump|||
1541 get_c_backtrace|||
1542 get_context||5.006000|n
1543 get_cvn_flags|||
1544 get_cvs|5.011000||p
1545 get_cv|5.006000||p
1546 get_db_sub|||
1547 get_debug_opts|||
1548 get_hash_seed|||
1549 get_hv|5.006000||p
1550 get_mstats|||
1551 get_no_modify|||
1552 get_num|||
1553 get_op_descs||5.005000|
1554 get_op_names||5.005000|
1555 get_opargs|||
1556 get_ppaddr||5.006000|
1557 get_sv|5.006000||p
1558 get_vtbl||5.005030|
1559 getcwd_sv||5.007002|
1560 getenv_len|||
1561 glob_2number|||
1562 glob_assign_glob|||
1563 gp_dup|||
1564 gp_free|||
1565 gp_ref|||
1566 grok_atoUV|||n
1567 grok_bin|5.007003||p
1568 grok_bslash_N|||
1569 grok_hex|5.007003||p
1570 grok_infnan||5.021004|
1571 grok_number_flags||5.021002|
1572 grok_number|5.007002||p
1573 grok_numeric_radix|5.007002||p
1574 grok_oct|5.007003||p
1575 group_end|||
1576 gv_AVadd|||
1577 gv_HVadd|||
1578 gv_IOadd|||
1579 gv_SVadd|||
1580 gv_add_by_type||5.011000|
1581 gv_autoload4||5.004000|
1582 gv_autoload_pvn||5.015004|
1583 gv_autoload_pv||5.015004|
1584 gv_autoload_sv||5.015004|
1585 gv_check|||
1586 gv_const_sv||5.009003|
1587 gv_dump||5.006000|
1588 gv_efullname3||5.003070|
1589 gv_efullname4||5.006001|
1590 gv_efullname|||
1591 gv_fetchfile_flags||5.009005|
1592 gv_fetchfile|||
1593 gv_fetchmeth_autoload||5.007003|
1594 gv_fetchmeth_internal|||
1595 gv_fetchmeth_pv_autoload||5.015004|
1596 gv_fetchmeth_pvn_autoload||5.015004|
1597 gv_fetchmeth_pvn||5.015004|
1598 gv_fetchmeth_pv||5.015004|
1599 gv_fetchmeth_sv_autoload||5.015004|
1600 gv_fetchmeth_sv||5.015004|
1601 gv_fetchmethod_autoload||5.004000|
1602 gv_fetchmethod|||
1603 gv_fetchmeth|||
1604 gv_fetchpvn_flags|5.009002||p
1605 gv_fetchpvs|5.009004||p
1606 gv_fetchpv|||
1607 gv_fetchsv|||
1608 gv_fullname3||5.003070|
1609 gv_fullname4||5.006001|
1610 gv_fullname|||
1611 gv_handler||5.007001|
1612 gv_init_pvn|||
1613 gv_init_pv||5.015004|
1614 gv_init_svtype|||
1615 gv_init_sv||5.015004|
1616 gv_init|||
1617 gv_is_in_main|||
1618 gv_magicalize_isa|||
1619 gv_magicalize|||
1620 gv_name_set||5.009004|
1621 gv_override|||
1622 gv_setref|||
1623 gv_stashpvn_internal|||
1624 gv_stashpvn|5.003070||p
1625 gv_stashpvs|5.009003||p
1626 gv_stashpv|||
1627 gv_stashsvpvn_cached|||
1628 gv_stashsv|||
1629 handle_named_backref|||
1630 handle_possible_posix|||
1631 handle_regex_sets|||
1632 handle_user_defined_property|||
1633 he_dup|||
1634 hek_dup|||
1635 hfree_next_entry|||
1636 hsplit|||
1637 hv_assert|||
1638 hv_auxinit_internal|||n
1639 hv_auxinit|||
1640 hv_clear_placeholders||5.009001|
1641 hv_clear|||
1642 hv_common_key_len||5.010000|
1643 hv_common||5.010000|
1644 hv_copy_hints_hv||5.009004|
1645 hv_delayfree_ent||5.004000|
1646 hv_delete_ent||5.003070|
1647 hv_delete|||
1648 hv_eiter_p||5.009003|
1649 hv_eiter_set||5.009003|
1650 hv_ename_add|||
1651 hv_ename_delete|||
1652 hv_exists_ent||5.003070|
1653 hv_exists|||
1654 hv_fetch_ent||5.003070|
1655 hv_fetchs|5.009003||p
1656 hv_fetch|||
1657 hv_fill||5.013002|
1658 hv_free_ent_ret|||
1659 hv_free_entries|||
1660 hv_free_ent||5.004000|
1661 hv_iterinit|||
1662 hv_iterkeysv||5.003070|
1663 hv_iterkey|||
1664 hv_iternextsv|||
1665 hv_iternext|||
1666 hv_iterval|||
1667 hv_ksplit||5.003070|
1668 hv_magic_check|||n
1669 hv_magic|||
1670 hv_name_set||5.009003|
1671 hv_notallowed|||
1672 hv_placeholders_get||5.009003|
1673 hv_placeholders_p|||
1674 hv_placeholders_set||5.009003|
1675 hv_pushkv|||
1676 hv_rand_set||5.018000|
1677 hv_riter_p||5.009003|
1678 hv_riter_set||5.009003|
1679 hv_scalar||5.009001|
1680 hv_store_ent||5.003070|
1681 hv_stores|5.009004||p
1682 hv_store|||
1683 hv_undef_flags|||
1684 hv_undef|||
1685 ibcmp_locale||5.004000|
1686 ibcmp_utf8||5.007003|
1687 ibcmp|||
1688 incline|||
1689 incpush_if_exists|||
1690 incpush_use_sep|||
1691 incpush|||
1692 ingroup|||
1693 init_argv_symbols|||
1694 init_constants|||
1695 init_dbargs|||
1696 init_debugger|||
1697 init_global_struct|||
1698 init_ids|||
1699 init_interp|||
1700 init_main_stash|||
1701 init_named_cv|||
1702 init_perllib|||
1703 init_postdump_symbols|||
1704 init_predump_symbols|||
1705 init_stacks||5.005000|
1706 init_tm||5.007002|
1707 init_uniprops|||
1708 inplace_aassign|||
1709 instr|||n
1710 intro_my||5.004000|
1711 intuit_method|||
1712 intuit_more|||
1713 invert|||
1714 invoke_exception_hook|||
1715 io_close|||
1716 isALNUMC_A|||p
1717 isALNUMC|5.006000||p
1718 isALNUM_A|||p
1719 isALNUM|||p
1720 isALPHANUMERIC_A|||p
1721 isALPHANUMERIC|5.017008|5.017008|p
1722 isALPHA_A|||p
1723 isALPHA|||p
1724 isASCII_A|||p
1725 isASCII|5.006000||p
1726 isBLANK_A|||p
1727 isBLANK|5.006001||p
1728 isC9_STRICT_UTF8_CHAR|||n
1729 isCNTRL_A|||p
1730 isCNTRL|5.006000||p
1731 isDIGIT_A|||p
1732 isDIGIT|||p
1733 isFF_OVERLONG|||n
1734 isFOO_utf8_lc|||
1735 isGCB|||
1736 isGRAPH_A|||p
1737 isGRAPH|5.006000||p
1738 isIDCONT_A|||p
1739 isIDCONT|5.017008|5.017008|p
1740 isIDFIRST_A|||p
1741 isIDFIRST|||p
1742 isLB|||
1743 isLOWER_A|||p
1744 isLOWER|||p
1745 isOCTAL_A|||p
1746 isOCTAL|5.013005|5.013005|p
1747 isPRINT_A|||p
1748 isPRINT|5.004000||p
1749 isPSXSPC_A|||p
1750 isPSXSPC|5.006001||p
1751 isPUNCT_A|||p
1752 isPUNCT|5.006000||p
1753 isSB|||
1754 isSCRIPT_RUN|||
1755 isSPACE_A|||p
1756 isSPACE|||p
1757 isSTRICT_UTF8_CHAR|||n
1758 isUPPER_A|||p
1759 isUPPER|||p
1760 isUTF8_CHAR_flags|||
1761 isUTF8_CHAR||5.021001|n
1762 isWB|||
1763 isWORDCHAR_A|||p
1764 isWORDCHAR|5.013006|5.013006|p
1765 isXDIGIT_A|||p
1766 isXDIGIT|5.006000||p
1767 is_an_int|||
1768 is_ascii_string||5.011000|n
1769 is_c9strict_utf8_string_loclen|||n
1770 is_c9strict_utf8_string_loc|||n
1771 is_c9strict_utf8_string|||n
1772 is_handle_constructor|||n
1773 is_invariant_string||5.021007|n
1774 is_lvalue_sub||5.007001|
1775 is_safe_syscall||5.019004|
1776 is_ssc_worth_it|||n
1777 is_strict_utf8_string_loclen|||n
1778 is_strict_utf8_string_loc|||n
1779 is_strict_utf8_string|||n
1780 is_utf8_char_buf||5.015008|n
1781 is_utf8_common_with_len|||
1782 is_utf8_common|||
1783 is_utf8_cp_above_31_bits|||n
1784 is_utf8_fixed_width_buf_flags|||n
1785 is_utf8_fixed_width_buf_loc_flags|||n
1786 is_utf8_fixed_width_buf_loclen_flags|||n
1787 is_utf8_invariant_string_loc|||n
1788 is_utf8_invariant_string|||n
1789 is_utf8_non_invariant_string|||n
1790 is_utf8_overlong_given_start_byte_ok|||n
1791 is_utf8_string_flags|||n
1792 is_utf8_string_loc_flags|||n
1793 is_utf8_string_loclen_flags|||n
1794 is_utf8_string_loclen||5.009003|n
1795 is_utf8_string_loc||5.008001|n
1796 is_utf8_string||5.006001|n
1797 is_utf8_valid_partial_char_flags|||n
1798 is_utf8_valid_partial_char|||n
1799 isa_lookup|||
1800 isinfnansv|||
1801 isinfnan||5.021004|n
1802 items|||n
1803 ix|||n
1804 jmaybe|||
1805 join_exact|||
1806 keyword_plugin_standard|||
1807 keyword|||
1808 leave_scope|||
1809 lex_stuff_pvs||5.013005|
1810 listkids|||
1811 list|||
1812 load_module_nocontext|||vn
1813 load_module|5.006000||pv
1814 localize|||
1815 looks_like_bool|||
1816 looks_like_number|||
1817 lop|||
1818 mPUSHi|5.009002||p
1819 mPUSHn|5.009002||p
1820 mPUSHp|5.009002||p
1821 mPUSHs|5.010001||p
1822 mPUSHu|5.009002||p
1823 mXPUSHi|5.009002||p
1824 mXPUSHn|5.009002||p
1825 mXPUSHp|5.009002||p
1826 mXPUSHs|5.010001||p
1827 mXPUSHu|5.009002||p
1828 magic_clear_all_env|||
1829 magic_cleararylen_p|||
1830 magic_clearenv|||
1831 magic_clearhints|||
1832 magic_clearhint|||
1833 magic_clearisa|||
1834 magic_clearpack|||
1835 magic_clearsig|||
1836 magic_copycallchecker|||
1837 magic_dump||5.006000|
1838 magic_existspack|||
1839 magic_freearylen_p|||
1840 magic_freeovrld|||
1841 magic_getarylen|||
1842 magic_getdebugvar|||
1843 magic_getdefelem|||
1844 magic_getnkeys|||
1845 magic_getpack|||
1846 magic_getpos|||
1847 magic_getsig|||
1848 magic_getsubstr|||
1849 magic_gettaint|||
1850 magic_getuvar|||
1851 magic_getvec|||
1852 magic_get|||
1853 magic_killbackrefs|||
1854 magic_methcall1|||
1855 magic_methcall|||v
1856 magic_methpack|||
1857 magic_nextpack|||
1858 magic_regdata_cnt|||
1859 magic_regdatum_get|||
1860 magic_regdatum_set|||
1861 magic_scalarpack|||
1862 magic_set_all_env|||
1863 magic_setarylen|||
1864 magic_setcollxfrm|||
1865 magic_setdbline|||
1866 magic_setdebugvar|||
1867 magic_setdefelem|||
1868 magic_setenv|||
1869 magic_sethint|||
1870 magic_setisa|||
1871 magic_setlvref|||
1872 magic_setmglob|||
1873 magic_setnkeys|||
1874 magic_setnonelem|||
1875 magic_setpack|||
1876 magic_setpos|||
1877 magic_setregexp|||
1878 magic_setsig|||
1879 magic_setsubstr|||
1880 magic_settaint|||
1881 magic_setutf8|||
1882 magic_setuvar|||
1883 magic_setvec|||
1884 magic_set|||
1885 magic_sizepack|||
1886 magic_wipepack|||
1887 make_matcher|||
1888 make_trie|||
1889 malloc_good_size|||n
1890 malloced_size|||n
1891 malloc||5.007002|n
1892 markstack_grow||5.021001|
1893 matcher_matches_sv|||
1894 maybe_multimagic_gv|||
1895 mayberelocate|||
1896 measure_struct|||
1897 memEQs|5.009005||p
1898 memEQ|5.004000||p
1899 memNEs|5.009005||p
1900 memNE|5.004000||p
1901 mem_collxfrm|||
1902 mem_log_alloc|||n
1903 mem_log_common|||n
1904 mem_log_free|||n
1905 mem_log_realloc|||n
1906 mess_alloc|||
1907 mess_nocontext|||pvn
1908 mess_sv|5.013001||p
1909 mess|5.006000||pv
1910 mfree||5.007002|n
1911 mg_clear|||
1912 mg_copy|||
1913 mg_dup|||
1914 mg_find_mglob|||
1915 mg_findext|5.013008||pn
1916 mg_find|||n
1917 mg_free_type||5.013006|
1918 mg_freeext|||
1919 mg_free|||
1920 mg_get|||
1921 mg_localize|||
1922 mg_magical|||n
1923 mg_set|||
1924 mg_size||5.005000|
1925 mini_mktime||5.007002|n
1926 minus_v|||
1927 missingterm|||
1928 mode_from_discipline|||
1929 modkids|||
1930 more_bodies|||
1931 more_sv|||
1932 moreswitches|||
1933 move_proto_attr|||
1934 mro_clean_isarev|||
1935 mro_gather_and_rename|||
1936 mro_get_from_name||5.010001|
1937 mro_get_linear_isa_dfs|||
1938 mro_get_linear_isa||5.009005|
1939 mro_get_private_data||5.010001|
1940 mro_isa_changed_in|||
1941 mro_meta_dup|||
1942 mro_meta_init|||
1943 mro_method_changed_in||5.009005|
1944 mro_package_moved|||
1945 mro_register||5.010001|
1946 mro_set_mro||5.010001|
1947 mro_set_private_data||5.010001|
1948 mul128|||
1949 multiconcat_stringify|||
1950 multideref_stringify|||
1951 my_atof2||5.007002|
1952 my_atof3|||
1953 my_atof||5.006000|
1954 my_attrs|||
1955 my_bytes_to_utf8|||n
1956 my_chsize|||
1957 my_clearenv|||
1958 my_cxt_index|||
1959 my_cxt_init|||
1960 my_dirfd||5.009005|n
1961 my_exit_jump|||
1962 my_exit|||
1963 my_failure_exit||5.004000|
1964 my_fflush_all||5.006000|
1965 my_fork||5.007003|n
1966 my_kid|||
1967 my_lstat_flags|||
1968 my_lstat||5.024000|
1969 my_memrchr|||n
1970 my_mkostemp|||n
1971 my_mkstemp_cloexec|||n
1972 my_mkstemp|||n
1973 my_nl_langinfo|||n
1974 my_pclose||5.003070|
1975 my_popen_list||5.007001|
1976 my_popen||5.003070|
1977 my_setenv|||
1978 my_snprintf|5.009004||pvn
1979 my_socketpair||5.007003|n
1980 my_sprintf|5.009003||pvn
1981 my_stat_flags|||
1982 my_stat||5.024000|
1983 my_strerror|||
1984 my_strftime||5.007002|
1985 my_strlcat|5.009004||pn
1986 my_strlcpy|5.009004||pn
1987 my_strnlen|||pn
1988 my_strtod|||n
1989 my_unexec|||
1990 my_vsnprintf||5.009004|n
1991 need_utf8|||n
1992 newANONATTRSUB||5.006000|
1993 newANONHASH|||
1994 newANONLIST|||
1995 newANONSUB|||
1996 newASSIGNOP|||
1997 newATTRSUB_x|||
1998 newATTRSUB||5.006000|
1999 newAVREF|||
2000 newAV|||
2001 newBINOP|||
2002 newCONDOP|||
2003 newCONSTSUB_flags||5.015006|
2004 newCONSTSUB|5.004050||p
2005 newCVREF|||
2006 newDEFSVOP||5.021006|
2007 newFORM|||
2008 newFOROP||5.013007|
2009 newGIVENOP||5.009003|
2010 newGIVWHENOP|||
2011 newGVOP|||
2012 newGVREF|||
2013 newGVgen_flags||5.015004|
2014 newGVgen|||
2015 newHVREF|||
2016 newHVhv||5.005000|
2017 newHV|||
2018 newIO|||
2019 newLISTOP|||
2020 newLOGOP|||
2021 newLOOPEX|||
2022 newLOOPOP|||
2023 newMETHOP_internal|||
2024 newMETHOP_named||5.021005|
2025 newMETHOP||5.021005|
2026 newMYSUB||5.017004|
2027 newNULLLIST|||
2028 newOP|||
2029 newPADOP|||
2030 newPMOP|||
2031 newPROG|||
2032 newPVOP|||
2033 newRANGE|||
2034 newRV_inc|5.004000||p
2035 newRV_noinc|5.004000||p
2036 newRV|||
2037 newSLICEOP|||
2038 newSTATEOP|||
2039 newSTUB|||
2040 newSUB|||
2041 newSVOP|||
2042 newSVREF|||
2043 newSV_type|5.009005||p
2044 newSVavdefelem|||
2045 newSVhek||5.009003|
2046 newSViv|||
2047 newSVnv|||
2048 newSVpadname||5.017004|
2049 newSVpv_share||5.013006|
2050 newSVpvf_nocontext|||vn
2051 newSVpvf||5.004000|v
2052 newSVpvn_flags|5.010001||p
2053 newSVpvn_share|5.007001||p
2054 newSVpvn_utf8|5.010001||p
2055 newSVpvn|5.004050||p
2056 newSVpvs_flags|5.010001||p
2057 newSVpvs_share|5.009003||p
2058 newSVpvs|5.009003||p
2059 newSVpv|||
2060 newSVrv|||
2061 newSVsv_flags|||
2062 newSVsv_nomg|||
2063 newSVsv|||
2064 newSVuv|5.006000||p
2065 newSV|||
2066 newUNOP_AUX||5.021007|
2067 newUNOP|||
2068 newWHENOP||5.009003|
2069 newWHILEOP||5.013007|
2070 newXS_deffile|||
2071 newXS_len_flags|||
2072 newXSproto||5.006000|
2073 newXS||5.006000|
2074 new_collate|||
2075 new_constant|||
2076 new_ctype|||
2077 new_he|||
2078 new_logop|||
2079 new_msg_hv|||
2080 new_numeric|||
2081 new_regcurly|||n
2082 new_stackinfo||5.005000|
2083 new_version||5.009000|
2084 next_symbol|||
2085 nextargv|||
2086 nextchar|||
2087 ninstr|||n
2088 no_bareword_allowed|||
2089 no_fh_allowed|||
2090 no_op|||
2091 noperl_die|||vn
2092 not_a_number|||
2093 not_incrementable|||
2094 nothreadhook||5.008000|
2095 notify_parser_that_changed_to_utf8|||
2096 nuke_stacks|||
2097 num_overflow|||n
2098 oopsAV|||
2099 oopsHV|||
2100 op_append_elem||5.013006|
2101 op_append_list||5.013006|
2102 op_class|||
2103 op_clear|||
2104 op_contextualize||5.013006|
2105 op_convert_list||5.021006|
2106 op_dump||5.006000|
2107 op_free|||
2108 op_integerize|||
2109 op_linklist||5.013006|
2110 op_lvalue_flags|||
2111 op_null||5.007002|
2112 op_parent|||n
2113 op_prepend_elem||5.013006|
2114 op_refcnt_lock||5.009002|
2115 op_refcnt_unlock||5.009002|
2116 op_relocate_sv|||
2117 op_sibling_splice||5.021002|n
2118 op_std_init|||
2119 open_script|||
2120 openn_cleanup|||
2121 openn_setup|||
2122 opmethod_stash|||
2123 opslab_force_free|||
2124 opslab_free_nopad|||
2125 opslab_free|||
2126 optimize_optree|||
2127 optimize_op|||
2128 output_posix_warnings|||
2129 pMY_CXT_|5.007003||p
2130 pMY_CXT|5.007003||p
2131 pTHX_|5.006000||p
2132 pTHX|5.006000||p
2133 packWARN|5.007003||p
2134 pack_cat||5.007003|
2135 pack_rec|||
2136 package_version|||
2137 package|||
2138 packlist||5.008001|
2139 pad_add_anon||5.008001|
2140 pad_add_name_pvn||5.015001|
2141 pad_add_name_pvs||5.015001|
2142 pad_add_name_pv||5.015001|
2143 pad_add_name_sv||5.015001|
2144 pad_add_weakref|||
2145 pad_alloc_name|||
2146 pad_block_start|||
2147 pad_check_dup|||
2148 pad_compname_type||5.009003|
2149 pad_findlex|||
2150 pad_findmy_pvn||5.015001|
2151 pad_findmy_pvs||5.015001|
2152 pad_findmy_pv||5.015001|
2153 pad_findmy_sv||5.015001|
2154 pad_fixup_inner_anons|||
2155 pad_free|||
2156 pad_leavemy|||
2157 pad_new||5.008001|
2158 pad_push|||
2159 pad_reset|||
2160 pad_setsv|||
2161 pad_sv|||
2162 pad_swipe|||
2163 padlist_dup|||
2164 padlist_store|||
2165 padname_dup|||
2166 padname_free|||
2167 padnamelist_dup|||
2168 padnamelist_free|||
2169 parse_body|||
2170 parse_gv_stash_name|||
2171 parse_ident|||
2172 parse_lparen_question_flags|||
2173 parse_unicode_opts|||
2174 parse_uniprop_string|||
2175 parser_dup|||
2176 parser_free_nexttoke_ops|||
2177 parser_free|||
2178 path_is_searchable|||n
2179 peep|||
2180 pending_ident|||
2181 perl_alloc_using|||n
2182 perl_alloc|||n
2183 perl_clone_using|||n
2184 perl_clone|||n
2185 perl_construct|||n
2186 perl_destruct||5.007003|n
2187 perl_free|||n
2188 perl_parse||5.006000|n
2189 perl_run|||n
2190 pidgone|||
2191 pm_description|||
2192 pmop_dump||5.006000|
2193 pmruntime|||
2194 pmtrans|||
2195 pop_scope|||
2196 populate_ANYOF_from_invlist|||
2197 populate_isa|||v
2198 pregcomp||5.009005|
2199 pregexec|||
2200 pregfree2||5.011000|
2201 pregfree|||
2202 prescan_version||5.011004|
2203 print_bytes_for_locale|||
2204 print_collxfrm_input_and_return|||
2205 printbuf|||
2206 printf_nocontext|||vn
2207 process_special_blocks|||
2208 ptr_hash|||n
2209 ptr_table_fetch||5.009005|
2210 ptr_table_find|||n
2211 ptr_table_free||5.009005|
2212 ptr_table_new||5.009005|
2213 ptr_table_split||5.009005|
2214 ptr_table_store||5.009005|
2215 push_scope|||
2216 put_charclass_bitmap_innards_common|||
2217 put_charclass_bitmap_innards_invlist|||
2218 put_charclass_bitmap_innards|||
2219 put_code_point|||
2220 put_range|||
2221 pv_display|5.006000||p
2222 pv_escape|5.009004||p
2223 pv_pretty|5.009004||p
2224 pv_uni_display||5.007003|
2225 qerror|||
2226 quadmath_format_needed|||n
2227 quadmath_format_single|||n
2228 re_compile||5.009005|
2229 re_croak2|||
2230 re_dup_guts|||
2231 re_exec_indentf|||v
2232 re_indentf|||v
2233 re_intuit_start||5.019001|
2234 re_intuit_string||5.006000|
2235 re_op_compile|||
2236 re_printf|||v
2237 realloc||5.007002|n
2238 reentrant_free||5.024000|
2239 reentrant_init||5.024000|
2240 reentrant_retry||5.024000|vn
2241 reentrant_size||5.024000|
2242 ref_array_or_hash|||
2243 refcounted_he_chain_2hv|||
2244 refcounted_he_fetch_pvn|||
2245 refcounted_he_fetch_pvs|||
2246 refcounted_he_fetch_pv|||
2247 refcounted_he_fetch_sv|||
2248 refcounted_he_free|||
2249 refcounted_he_inc|||
2250 refcounted_he_new_pvn|||
2251 refcounted_he_new_pvs|||
2252 refcounted_he_new_pv|||
2253 refcounted_he_new_sv|||
2254 refcounted_he_value|||
2255 refkids|||
2256 refto|||
2257 ref||5.024000|
2258 reg2Lanode|||
2259 reg_check_named_buff_matched|||n
2260 reg_named_buff_all||5.009005|
2261 reg_named_buff_exists||5.009005|
2262 reg_named_buff_fetch||5.009005|
2263 reg_named_buff_firstkey||5.009005|
2264 reg_named_buff_iter|||
2265 reg_named_buff_nextkey||5.009005|
2266 reg_named_buff_scalar||5.009005|
2267 reg_named_buff|||
2268 reg_node|||
2269 reg_numbered_buff_fetch|||
2270 reg_numbered_buff_length|||
2271 reg_numbered_buff_store|||
2272 reg_qr_package|||
2273 reg_scan_name|||
2274 reg_skipcomment|||n
2275 reg_temp_copy|||
2276 reganode|||
2277 regatom|||
2278 regbranch|||
2279 regclass|||
2280 regcp_restore|||
2281 regcppop|||
2282 regcppush|||
2283 regcurly|||n
2284 regdump_extflags|||
2285 regdump_intflags|||
2286 regdump||5.005000|
2287 regdupe_internal|||
2288 regex_set_precedence|||n
2289 regexec_flags||5.005000|
2290 regfree_internal||5.009005|
2291 reghop3|||n
2292 reghop4|||n
2293 reghopmaybe3|||n
2294 reginclass|||
2295 reginitcolors||5.006000|
2296 reginsert|||
2297 regmatch|||
2298 regnext||5.005000|
2299 regnode_guts|||
2300 regpiece|||
2301 regprop|||
2302 regrepeat|||
2303 regtail_study|||
2304 regtail|||
2305 regtry|||
2306 reg|||
2307 repeatcpy|||n
2308 report_evil_fh|||
2309 report_redefined_cv|||
2310 report_uninit|||
2311 report_wrongway_fh|||
2312 require_pv||5.006000|
2313 require_tie_mod|||
2314 restore_magic|||
2315 restore_switched_locale|||
2316 rninstr|||n
2317 rpeep|||
2318 rsignal_restore|||
2319 rsignal_save|||
2320 rsignal_state||5.004000|
2321 rsignal||5.004000|
2322 run_body|||
2323 run_user_filter|||
2324 runops_debug||5.005000|
2325 runops_standard||5.005000|
2326 rv2cv_op_cv||5.013006|
2327 rvpv_dup|||
2328 rxres_free|||
2329 rxres_restore|||
2330 rxres_save|||
2331 safesyscalloc||5.006000|n
2332 safesysfree||5.006000|n
2333 safesysmalloc||5.006000|n
2334 safesysrealloc||5.006000|n
2335 same_dirent|||
2336 save_I16||5.004000|
2337 save_I32|||
2338 save_I8||5.006000|
2339 save_adelete||5.011000|
2340 save_aelem_flags||5.011000|
2341 save_aelem||5.004050|
2342 save_alloc||5.006000|
2343 save_aptr|||
2344 save_ary|||
2345 save_bool||5.008001|
2346 save_clearsv|||
2347 save_delete|||
2348 save_destructor_x||5.006000|
2349 save_destructor||5.006000|
2350 save_freeop|||
2351 save_freepv|||
2352 save_freesv|||
2353 save_generic_pvref||5.006001|
2354 save_generic_svref||5.005030|
2355 save_gp||5.004000|
2356 save_hash|||
2357 save_hdelete||5.011000|
2358 save_hek_flags|||n
2359 save_helem_flags||5.011000|
2360 save_helem||5.004050|
2361 save_hints||5.010001|
2362 save_hptr|||
2363 save_int|||
2364 save_item|||
2365 save_iv||5.005000|
2366 save_lines|||
2367 save_list|||
2368 save_long|||
2369 save_magic_flags|||
2370 save_mortalizesv||5.007001|
2371 save_nogv|||
2372 save_op||5.005000|
2373 save_padsv_and_mortalize||5.010001|
2374 save_pptr|||
2375 save_pushi32ptr||5.010001|
2376 save_pushptri32ptr|||
2377 save_pushptrptr||5.010001|
2378 save_pushptr||5.010001|
2379 save_re_context||5.006000|
2380 save_scalar_at|||
2381 save_scalar|||
2382 save_set_svflags||5.009000|
2383 save_shared_pvref||5.007003|
2384 save_sptr|||
2385 save_strlen|||
2386 save_svref|||
2387 save_to_buffer|||n
2388 save_vptr||5.006000|
2389 savepvn|||
2390 savepvs||5.009003|
2391 savepv|||
2392 savesharedpvn||5.009005|
2393 savesharedpvs||5.013006|
2394 savesharedpv||5.007003|
2395 savesharedsvpv||5.013006|
2396 savestack_grow_cnt||5.008001|
2397 savestack_grow|||
2398 savesvpv||5.009002|
2399 sawparens|||
2400 scalar_mod_type|||n
2401 scalarboolean|||
2402 scalarkids|||
2403 scalarseq|||
2404 scalarvoid|||
2405 scalar|||
2406 scan_bin||5.006000|
2407 scan_commit|||
2408 scan_const|||
2409 scan_formline|||
2410 scan_heredoc|||
2411 scan_hex|||
2412 scan_ident|||
2413 scan_inputsymbol|||
2414 scan_num||5.007001|
2415 scan_oct|||
2416 scan_pat|||
2417 scan_subst|||
2418 scan_trans|||
2419 scan_version||5.009001|
2420 scan_vstring||5.009005|
2421 search_const|||
2422 seed||5.008001|
2423 sequence_num|||
2424 set_ANYOF_arg|||
2425 set_caret_X|||
2426 set_context||5.006000|n
2427 set_numeric_radix||5.006000|
2428 set_numeric_standard||5.006000|
2429 set_numeric_underlying|||
2430 set_padlist|||n
2431 set_regex_pv|||
2432 setdefout|||
2433 setfd_cloexec_for_nonsysfd|||
2434 setfd_cloexec_or_inhexec_by_sysfdness|||
2435 setfd_cloexec|||n
2436 setfd_inhexec_for_sysfd|||
2437 setfd_inhexec|||n
2438 setlocale_debug_string|||n
2439 share_hek_flags|||
2440 share_hek||5.004000|
2441 should_warn_nl|||n
2442 si_dup|||
2443 sighandler|||n
2444 simplify_sort|||
2445 skip_to_be_ignored_text|||
2446 softref2xv|||
2447 sortcv_stacked|||
2448 sortcv_xsub|||
2449 sortcv|||
2450 sortsv_flags||5.009003|
2451 sortsv||5.007003|
2452 space_join_names_mortal|||
2453 ss_dup|||
2454 ssc_add_range|||
2455 ssc_and|||
2456 ssc_anything|||
2457 ssc_clear_locale|||n
2458 ssc_cp_and|||
2459 ssc_finalize|||
2460 ssc_init|||
2461 ssc_intersection|||
2462 ssc_is_anything|||n
2463 ssc_is_cp_posixl_init|||n
2464 ssc_or|||
2465 ssc_union|||
2466 stack_grow|||
2467 start_subparse||5.004000|
2468 stdize_locale|||
2469 strEQ|||
2470 strGE|||
2471 strGT|||
2472 strLE|||
2473 strLT|||
2474 strNE|||
2475 str_to_version||5.006000|
2476 strip_return|||
2477 strnEQ|||
2478 strnNE|||
2479 study_chunk|||
2480 sub_crush_depth|||
2481 sublex_done|||
2482 sublex_push|||
2483 sublex_start|||
2484 sv_2bool_flags||5.013006|
2485 sv_2bool|||
2486 sv_2cv|||
2487 sv_2io|||
2488 sv_2iuv_common|||
2489 sv_2iuv_non_preserve|||
2490 sv_2iv_flags||5.009001|
2491 sv_2iv|||
2492 sv_2mortal|||
2493 sv_2nv_flags||5.013001|
2494 sv_2pv_flags|5.007002||p
2495 sv_2pv_nolen|5.006000||p
2496 sv_2pvbyte_nolen|5.006000||p
2497 sv_2pvbyte|5.006000||p
2498 sv_2pvutf8_nolen||5.006000|
2499 sv_2pvutf8||5.006000|
2500 sv_2pv|||
2501 sv_2uv_flags||5.009001|
2502 sv_2uv|5.004000||p
2503 sv_add_arena|||
2504 sv_add_backref|||
2505 sv_backoff|||n
2506 sv_bless|||
2507 sv_buf_to_ro|||
2508 sv_buf_to_rw|||
2509 sv_cat_decode||5.008001|
2510 sv_catpv_flags||5.013006|
2511 sv_catpv_mg|5.004050||p
2512 sv_catpv_nomg||5.013006|
2513 sv_catpvf_mg_nocontext|||pvn
2514 sv_catpvf_mg|5.006000|5.004000|pv
2515 sv_catpvf_nocontext|||vn
2516 sv_catpvf||5.004000|v
2517 sv_catpvn_flags||5.007002|
2518 sv_catpvn_mg|5.004050||p
2519 sv_catpvn_nomg|5.007002||p
2520 sv_catpvn|||
2521 sv_catpvs_flags||5.013006|
2522 sv_catpvs_mg||5.013006|
2523 sv_catpvs_nomg||5.013006|
2524 sv_catpvs|5.009003||p
2525 sv_catpv|||
2526 sv_catsv_flags||5.007002|
2527 sv_catsv_mg|5.004050||p
2528 sv_catsv_nomg|5.007002||p
2529 sv_catsv|||
2530 sv_chop|||
2531 sv_clean_all|||
2532 sv_clean_objs|||
2533 sv_clear|||
2534 sv_cmp_flags||5.013006|
2535 sv_cmp_locale_flags||5.013006|
2536 sv_cmp_locale||5.004000|
2537 sv_cmp|||
2538 sv_collxfrm_flags||5.013006|
2539 sv_collxfrm|||
2540 sv_copypv_flags||5.017002|
2541 sv_copypv_nomg||5.017002|
2542 sv_copypv|||
2543 sv_dec_nomg||5.013002|
2544 sv_dec|||
2545 sv_del_backref|||
2546 sv_derived_from_pvn||5.015004|
2547 sv_derived_from_pv||5.015004|
2548 sv_derived_from_sv||5.015004|
2549 sv_derived_from||5.004000|
2550 sv_destroyable||5.010000|
2551 sv_display|||
2552 sv_does_pvn||5.015004|
2553 sv_does_pv||5.015004|
2554 sv_does_sv||5.015004|
2555 sv_does||5.009004|
2556 sv_dump|||
2557 sv_dup_common|||
2558 sv_dup_inc_multiple|||
2559 sv_dup_inc|||
2560 sv_dup|||
2561 sv_eq_flags||5.013006|
2562 sv_eq|||
2563 sv_exp_grow|||
2564 sv_force_normal_flags||5.007001|
2565 sv_force_normal||5.006000|
2566 sv_free_arenas|||
2567 sv_free|||
2568 sv_gets||5.003070|
2569 sv_grow|||
2570 sv_i_ncmp|||
2571 sv_inc_nomg||5.013002|
2572 sv_inc|||
2573 sv_insert_flags||5.010001|
2574 sv_insert|||
2575 sv_isa|||
2576 sv_isobject|||
2577 sv_iv||5.005000|
2578 sv_len_utf8_nomg|||
2579 sv_len_utf8||5.006000|
2580 sv_len|||
2581 sv_magic_portable|5.024000|5.004000|p
2582 sv_magicext_mglob|||
2583 sv_magicext||5.007003|
2584 sv_magic|||
2585 sv_mortalcopy_flags|||
2586 sv_mortalcopy|||
2587 sv_ncmp|||
2588 sv_newmortal|||
2589 sv_newref|||
2590 sv_nolocking||5.007003|
2591 sv_nosharing||5.007003|
2592 sv_nounlocking|||
2593 sv_nv||5.005000|
2594 sv_only_taint_gmagic|||n
2595 sv_or_pv_pos_u2b|||
2596 sv_peek||5.005000|
2597 sv_pos_b2u_flags||5.019003|
2598 sv_pos_b2u_midway|||
2599 sv_pos_b2u||5.006000|
2600 sv_pos_u2b_cached|||
2601 sv_pos_u2b_flags||5.011005|
2602 sv_pos_u2b_forwards|||n
2603 sv_pos_u2b_midway|||n
2604 sv_pos_u2b||5.006000|
2605 sv_pvbyten_force||5.006000|
2606 sv_pvbyten||5.006000|
2607 sv_pvbyte||5.006000|
2608 sv_pvn_force_flags|5.007002||p
2609 sv_pvn_force|||
2610 sv_pvn_nomg|5.007003|5.005000|p
2611 sv_pvn||5.005000|
2612 sv_pvutf8n_force||5.006000|
2613 sv_pvutf8n||5.006000|
2614 sv_pvutf8||5.006000|
2615 sv_pv||5.006000|
2616 sv_recode_to_utf8||5.007003|
2617 sv_reftype|||
2618 sv_ref||5.015004|
2619 sv_replace|||
2620 sv_report_used|||
2621 sv_resetpvn|||
2622 sv_reset|||
2623 sv_rvunweaken|||
2624 sv_rvweaken||5.006000|
2625 sv_set_undef|||
2626 sv_sethek|||
2627 sv_setiv_mg|5.004050||p
2628 sv_setiv|||
2629 sv_setnv_mg|5.006000||p
2630 sv_setnv|||
2631 sv_setpv_bufsize|||
2632 sv_setpv_mg|5.004050||p
2633 sv_setpvf_mg_nocontext|||pvn
2634 sv_setpvf_mg|5.006000|5.004000|pv
2635 sv_setpvf_nocontext|||vn
2636 sv_setpvf||5.004000|v
2637 sv_setpviv_mg||5.008001|
2638 sv_setpviv||5.008001|
2639 sv_setpvn_mg|5.004050||p
2640 sv_setpvn|||
2641 sv_setpvs_mg||5.013006|
2642 sv_setpvs|5.009004||p
2643 sv_setpv|||
2644 sv_setref_iv|||
2645 sv_setref_nv|||
2646 sv_setref_pvn|||
2647 sv_setref_pvs||5.024000|
2648 sv_setref_pv|||
2649 sv_setref_uv||5.007001|
2650 sv_setsv_flags||5.007002|
2651 sv_setsv_mg|5.004050||p
2652 sv_setsv_nomg|5.007002||p
2653 sv_setsv|||
2654 sv_setuv_mg|5.004050||p
2655 sv_setuv|5.004000||p
2656 sv_string_from_errnum|||
2657 sv_tainted||5.004000|
2658 sv_taint||5.004000|
2659 sv_true||5.005000|
2660 sv_unglob|||
2661 sv_uni_display||5.007003|
2662 sv_unmagicext|5.013008||p
2663 sv_unmagic|||
2664 sv_unref_flags||5.007001|
2665 sv_unref|||
2666 sv_untaint||5.004000|
2667 sv_upgrade|||
2668 sv_usepvn_flags||5.009004|
2669 sv_usepvn_mg|5.004050||p
2670 sv_usepvn|||
2671 sv_utf8_decode|||
2672 sv_utf8_downgrade|||
2673 sv_utf8_encode||5.006000|
2674 sv_utf8_upgrade_flags_grow||5.011000|
2675 sv_utf8_upgrade_flags||5.007002|
2676 sv_utf8_upgrade_nomg||5.007002|
2677 sv_utf8_upgrade||5.007001|
2678 sv_uv|5.005000||p
2679 sv_vcatpvf_mg|5.006000|5.004000|p
2680 sv_vcatpvfn_flags||5.017002|
2681 sv_vcatpvfn||5.004000|
2682 sv_vcatpvf|5.006000|5.004000|p
2683 sv_vsetpvf_mg|5.006000|5.004000|p
2684 sv_vsetpvfn||5.004000|
2685 sv_vsetpvf|5.006000|5.004000|p
2686 svtype|||
2687 swallow_bom|||
2688 swatch_get|||
2689 switch_category_locale_to_template|||
2690 switch_to_global_locale|||n
2691 sync_locale||5.021004|n
2692 sys_init3||5.010000|n
2693 sys_init||5.010000|n
2694 sys_intern_clear|||
2695 sys_intern_dup|||
2696 sys_intern_init|||
2697 sys_term||5.010000|n
2698 taint_env|||
2699 taint_proper|||
2700 tied_method|||v
2701 tmps_grow_p|||
2702 toFOLD_utf8_safe|||
2703 toFOLD_utf8||5.019001|
2704 toFOLD_uvchr||5.023009|
2705 toFOLD||5.019001|
2706 toLOWER_L1||5.019001|
2707 toLOWER_LC||5.004000|
2708 toLOWER_utf8_safe|||
2709 toLOWER_utf8||5.015007|
2710 toLOWER_uvchr||5.023009|
2711 toLOWER|||
2712 toTITLE_utf8_safe|||
2713 toTITLE_utf8||5.015007|
2714 toTITLE_uvchr||5.023009|
2715 toTITLE||5.019001|
2716 toUPPER_utf8_safe|||
2717 toUPPER_utf8||5.015007|
2718 toUPPER_uvchr||5.023009|
2719 toUPPER|||
2720 to_byte_substr|||
2721 to_lower_latin1|||n
2722 to_utf8_substr|||
2723 tokenize_use|||
2724 tokeq|||
2725 tokereport|||
2726 too_few_arguments_pv|||
2727 too_many_arguments_pv|||
2728 translate_substr_offsets|||n
2729 traverse_op_tree|||
2730 try_amagic_bin|||
2731 try_amagic_un|||
2732 turkic_fc|||
2733 turkic_lc|||
2734 turkic_uc|||
2735 uiv_2buf|||n
2736 unlnk|||
2737 unpack_rec|||
2738 unpack_str||5.007003|
2739 unpackstring||5.008001|
2740 unreferenced_to_tmp_stack|||
2741 unshare_hek_or_pvn|||
2742 unshare_hek|||
2743 unsharepvn||5.003070|
2744 unwind_handler_stack|||
2745 update_debugger_info|||
2746 upg_version||5.009005|
2747 usage|||
2748 utf16_textfilter|||
2749 utf16_to_utf8_reversed||5.006001|
2750 utf16_to_utf8||5.006001|
2751 utf8_distance||5.006000|
2752 utf8_hop_back|||n
2753 utf8_hop_forward|||n
2754 utf8_hop_safe|||n
2755 utf8_hop||5.006000|n
2756 utf8_length||5.007001|
2757 utf8_mg_len_cache_update|||
2758 utf8_mg_pos_cache_update|||
2759 utf8_to_uvchr_buf|5.015009|5.015009|p
2760 utf8_to_uvchr|||p
2761 utf8n_to_uvchr_error|||n
2762 utf8n_to_uvchr||5.007001|n
2763 utf8n_to_uvuni||5.007001|
2764 utilize|||
2765 uvchr_to_utf8_flags||5.007003|
2766 uvchr_to_utf8||5.007001|
2767 uvoffuni_to_utf8_flags||5.019004|
2768 uvuni_to_utf8_flags||5.007003|
2769 uvuni_to_utf8||5.007001|
2770 valid_utf8_to_uvchr|||n
2771 validate_suid|||
2772 variant_under_utf8_count|||n
2773 varname|||
2774 vcmp||5.009000|
2775 vcroak||5.006000|
2776 vdeb||5.007003|
2777 vform||5.006000|
2778 visit|||
2779 vivify_defelem|||
2780 vivify_ref|||
2781 vload_module|5.006000||p
2782 vmess|5.006000|5.006000|p
2783 vnewSVpvf|5.006000|5.004000|p
2784 vnormal||5.009002|
2785 vnumify||5.009000|
2786 vstringify||5.009000|
2787 vverify||5.009003|
2788 vwarner||5.006000|
2789 vwarn||5.006000|
2790 wait4pid|||
2791 warn_nocontext|||pvn
2792 warn_on_first_deprecated_use|||
2793 warn_sv|5.013001||p
2794 warner_nocontext|||vn
2795 warner|5.006000|5.004000|pv
2796 warn|||v
2797 was_lvalue_sub|||
2798 watch|||
2799 whichsig_pvn||5.015004|
2800 whichsig_pv||5.015004|
2801 whichsig_sv||5.015004|
2802 whichsig|||
2803 win32_croak_not_implemented|||n
2804 win32_setlocale|||
2805 with_queued_errors|||
2806 wrap_op_checker||5.015008|
2807 write_to_stderr|||
2808 xs_boot_epilog|||
2809 xs_handshake|||vn
2810 xs_version_bootcheck|||
2811 yyerror_pvn|||
2812 yyerror_pv|||
2813 yyerror|||
2814 yylex|||
2815 yyparse|||
2816 yyquit|||
2817 yyunlex|||
2818 yywarn|||
2819 );
2820
2821 if (exists $opt{'list-unsupported'}) {
2822 my $f;
2823 for $f (sort { lc $a cmp lc $b } keys %API) {
2824 next unless $API{$f}{todo};
2825 print "$f ", '.'x(40-length($f)), " ", format_version($API{$f}{todo}), "\n";
2826 }
2827 exit 0;
2828 }
2829
2830 # Scan for possible replacement candidates
2831
2832 my(%replace, %need, %hints, %warnings, %depends);
2833 my $replace = 0;
2834 my($hint, $define, $function);
2835
2836 sub find_api
2837 {
2838 my $code = shift;
2839 $code =~ s{
2840 / (?: \*[^*]*\*+(?:[^$ccs][^*]*\*+)* / | /[^\r\n]*)
2841 | "[^"\\]*(?:\\.[^"\\]*)*"
2842 | '[^'\\]*(?:\\.[^'\\]*)*' }{}egsx;
2843 grep { exists $API{$_} } $code =~ /(\w+)/mg;
2844 }
2845
2846 while (<DATA>) {
2847 if ($hint) {
2848 my $h = $hint->[0] eq 'Hint' ? \%hints : \%warnings;
2849 if (m{^\s*\*\s(.*?)\s*$}) {
2850 for (@{$hint->[1]}) {
2851 $h->{$_} ||= ''; # suppress warning with older perls
2852 $h->{$_} .= "$1\n";
2853 }
2854 }
2855 else { undef $hint }
2856 }
2857
2858 $hint = [$1, [split /,?\s+/, $2]]
2859 if m{^\s*$rccs\s+(Hint|Warning):\s+(\w+(?:,?\s+\w+)*)\s*$};
2860
2861 if ($define) {
2862 if ($define->[1] =~ /\\$/) {
2863 $define->[1] .= $_;
2864 }
2865 else {
2866 if (exists $API{$define->[0]} && $define->[1] !~ /^DPPP_\(/) {
2867 my @n = find_api($define->[1]);
2868 push @{$depends{$define->[0]}}, @n if @n
2869 }
2870 undef $define;
2871 }
2872 }
2873
2874 $define = [$1, $2] if m{^\s*#\s*define\s+(\w+)(?:\([^)]*\))?\s+(.*)};
2875
2876 if ($function) {
2877 if (/^}/) {
2878 if (exists $API{$function->[0]}) {
2879 my @n = find_api($function->[1]);
2880 push @{$depends{$function->[0]}}, @n if @n
2881 }
2882 undef $function;
2883 }
2884 else {
2885 $function->[1] .= $_;
2886 }
2887 }
2888
2889 $function = [$1, ''] if m{^DPPP_\(my_(\w+)\)};
2890
2891 $replace = $1 if m{^\s*$rccs\s+Replace:\s+(\d+)\s+$rcce\s*$};
2892 $replace{$2} = $1 if $replace and m{^\s*#\s*define\s+(\w+)(?:\([^)]*\))?\s+(\w+)};
2893 $replace{$2} = $1 if m{^\s*#\s*define\s+(\w+)(?:\([^)]*\))?\s+(\w+).*$rccs\s+Replace\s+$rcce};
2894 $replace{$1} = $2 if m{^\s*$rccs\s+Replace (\w+) with (\w+)\s+$rcce\s*$};
2895
2896 if (m{^\s*$rccs\s+(\w+(\s*,\s*\w+)*)\s+depends\s+on\s+(\w+(\s*,\s*\w+)*)\s+$rcce\s*$}) {
2897 my @deps = map { s/\s+//g; $_ } split /,/, $3;
2898 my $d;
2899 for $d (map { s/\s+//g; $_ } split /,/, $1) {
2900 push @{$depends{$d}}, @deps;
2901 }
2902 }
2903
2904 $need{$1} = 1 if m{^#if\s+defined\(NEED_(\w+)(?:_GLOBAL)?\)};
2905 }
2906
2907 for (values %depends) {
2908 my %s;
2909 $_ = [sort grep !$s{$_}++, @$_];
2910 }
2911
2912 if (exists $opt{'api-info'}) {
2913 my $f;
2914 my $count = 0;
2915 my $match = $opt{'api-info'} =~ m!^/(.*)/$! ? $1 : "^\Q$opt{'api-info'}\E\$";
2916 for $f (sort { lc $a cmp lc $b } keys %API) {
2917 next unless $f =~ /$match/;
2918 print "\n=== $f ===\n\n";
2919 my $info = 0;
2920 if ($API{$f}{base} || $API{$f}{todo}) {
2921 my $base = format_version($API{$f}{base} || $API{$f}{todo});
2922 print "Supported at least starting from perl-$base.\n";
2923 $info++;
2924 }
2925 if ($API{$f}{provided}) {
2926 my $todo = $API{$f}{todo} ? format_version($API{$f}{todo}) : "5.003";
2927 print "Support by $ppport provided back to perl-$todo.\n";
2928 print "Support needs to be explicitly requested by NEED_$f.\n" if exists $need{$f};
2929 print "Depends on: ", join(', ', @{$depends{$f}}), ".\n" if exists $depends{$f};
2930 print "\n$hints{$f}" if exists $hints{$f};
2931 print "\nWARNING:\n$warnings{$f}" if exists $warnings{$f};
2932 $info++;
2933 }
2934 print "No portability information available.\n" unless $info;
2935 $count++;
2936 }
2937 $count or print "Found no API matching '$opt{'api-info'}'.";
2938 print "\n";
2939 exit 0;
2940 }
2941
2942 if (exists $opt{'list-provided'}) {
2943 my $f;
2944 for $f (sort { lc $a cmp lc $b } keys %API) {
2945 next unless $API{$f}{provided};
2946 my @flags;
2947 push @flags, 'explicit' if exists $need{$f};
2948 push @flags, 'depend' if exists $depends{$f};
2949 push @flags, 'hint' if exists $hints{$f};
2950 push @flags, 'warning' if exists $warnings{$f};
2951 my $flags = @flags ? ' ['.join(', ', @flags).']' : '';
2952 print "$f$flags\n";
2953 }
2954 exit 0;
2955 }
2956
2957 my @files;
2958 my @srcext = qw( .xs .c .h .cc .cpp -c.inc -xs.inc );
2959 my $srcext = join '|', map { quotemeta $_ } @srcext;
2960
2961 if (@ARGV) {
2962 my %seen;
2963 for (@ARGV) {
2964 if (-e) {
2965 if (-f) {
2966 push @files, $_ unless $seen{$_}++;
2967 }
2968 else { warn "'$_' is not a file.\n" }
2969 }
2970 else {
2971 my @new = grep { -f } glob $_
2972 or warn "'$_' does not exist.\n";
2973 push @files, grep { !$seen{$_}++ } @new;
2974 }
2975 }
2976 }
2977 else {
2978 eval {
2979 require File::Find;
2980 File::Find::find(sub {
2981 $File::Find::name =~ /($srcext)$/i
2982 and push @files, $File::Find::name;
2983 }, '.');
2984 };
2985 if ($@) {
2986 @files = map { glob "*$_" } @srcext;
2987 }
2988 }
2989
2990 if (!@ARGV || $opt{filter}) {
2991 my(@in, @out);
2992 my %xsc = map { /(.*)\.xs$/ ? ("$1.c" => 1, "$1.cc" => 1) : () } @files;
2993 for (@files) {
2994 my $out = exists $xsc{$_} || /\b\Q$ppport\E$/i || !/($srcext)$/i;
2995 push @{ $out ? \@out : \@in }, $_;
2996 }
2997 if (@ARGV && @out) {
2998 warning("Skipping the following files (use --nofilter to avoid this):\n| ", join "\n| ", @out);
2999 }
3000 @files = @in;
3001 }
3002
3003 die "No input files given!\n" unless @files;
3004
3005 my(%files, %global, %revreplace);
3006 %revreplace = reverse %replace;
3007 my $filename;
3008 my $patch_opened = 0;
3009
3010 for $filename (@files) {
3011 unless (open IN, "<$filename") {
3012 warn "Unable to read from $filename: $!\n";
3013 next;
3014 }
3015
3016 info("Scanning $filename ...");
3017
3018 my $c = do { local $/; <IN> };
3019 close IN;
3020
3021 my %file = (orig => $c, changes => 0);
3022
3023 # Temporarily remove C/XS comments and strings from the code
3024 my @ccom;
3025
3026 $c =~ s{
3027 ( ^$HS*\#$HS*include\b[^\r\n]+\b(?:\Q$ppport\E|XSUB\.h)\b[^\r\n]*
3028 | ^$HS*\#$HS*(?:define|elif|if(?:def)?)\b[^\r\n]* )
3029 | ( ^$HS*\#[^\r\n]*
3030 | "[^"\\]*(?:\\.[^"\\]*)*"
3031 | '[^'\\]*(?:\\.[^'\\]*)*'
3032 | / (?: \*[^*]*\*+(?:[^$ccs][^*]*\*+)* / | /[^\r\n]* ) )
3033 }{ defined $2 and push @ccom, $2;
3034 defined $1 ? $1 : "$ccs$#ccom$cce" }mgsex;
3035
3036 $file{ccom} = \@ccom;
3037 $file{code} = $c;
3038 $file{has_inc_ppport} = $c =~ /^$HS*#$HS*include[^\r\n]+\b\Q$ppport\E\b/m;
3039
3040 my $func;
3041
3042 for $func (keys %API) {
3043 my $match = $func;
3044 $match .= "|$revreplace{$func}" if exists $revreplace{$func};
3045 if ($c =~ /\b(?:Perl_)?($match)\b/) {
3046 $file{uses_replace}{$1}++ if exists $revreplace{$func} && $1 eq $revreplace{$func};
3047 $file{uses_Perl}{$func}++ if $c =~ /\bPerl_$func\b/;
3048 if (exists $API{$func}{provided}) {
3049 $file{uses_provided}{$func}++;
3050 if (!exists $API{$func}{base} || $API{$func}{base} > $opt{'compat-version'}) {
3051 $file{uses}{$func}++;
3052 my @deps = rec_depend($func);
3053 if (@deps) {
3054 $file{uses_deps}{$func} = \@deps;
3055 for (@deps) {
3056 $file{uses}{$_} = 0 unless exists $file{uses}{$_};
3057 }
3058 }
3059 for ($func, @deps) {
3060 $file{needs}{$_} = 'static' if exists $need{$_};
3061 }
3062 }
3063 }
3064 if (exists $API{$func}{todo} && $API{$func}{todo} > $opt{'compat-version'}) {
3065 if ($c =~ /\b$func\b/) {
3066 $file{uses_todo}{$func}++;
3067 }
3068 }
3069 }
3070 }
3071
3072 while ($c =~ /^$HS*#$HS*define$HS+(NEED_(\w+?)(_GLOBAL)?)\b/mg) {
3073 if (exists $need{$2}) {
3074 $file{defined $3 ? 'needed_global' : 'needed_static'}{$2}++;
3075 }
3076 else { warning("Possibly wrong #define $1 in $filename") }
3077 }
3078
3079 for (qw(uses needs uses_todo needed_global needed_static)) {
3080 for $func (keys %{$file{$_}}) {
3081 push @{$global{$_}{$func}}, $filename;
3082 }
3083 }
3084
3085 $files{$filename} = \%file;
3086 }
3087
3088 # Globally resolve NEED_'s
3089 my $need;
3090 for $need (keys %{$global{needs}}) {
3091 if (@{$global{needs}{$need}} > 1) {
3092 my @targets = @{$global{needs}{$need}};
3093 my @t = grep $files{$_}{needed_global}{$need}, @targets;
3094 @targets = @t if @t;
3095 @t = grep /\.xs$/i, @targets;
3096 @targets = @t if @t;
3097 my $target = shift @targets;
3098 $files{$target}{needs}{$need} = 'global';
3099 for (@{$global{needs}{$need}}) {
3100 $files{$_}{needs}{$need} = 'extern' if $_ ne $target;
3101 }
3102 }
3103 }
3104
3105 for $filename (@files) {
3106 exists $files{$filename} or next;
3107
3108 info("=== Analyzing $filename ===");
3109
3110 my %file = %{$files{$filename}};
3111 my $func;
3112 my $c = $file{code};
3113 my $warnings = 0;
3114
3115 for $func (sort keys %{$file{uses_Perl}}) {
3116 if ($API{$func}{varargs}) {
3117 unless ($API{$func}{nothxarg}) {
3118 my $changes = ($c =~ s{\b(Perl_$func\s*\(\s*)(?!aTHX_?)(\)|[^\s)]*\))}
3119 { $1 . ($2 eq ')' ? 'aTHX' : 'aTHX_ ') . $2 }ge);
3120 if ($changes) {
3121 warning("Doesn't pass interpreter argument aTHX to Perl_$func");
3122 $file{changes} += $changes;
3123 }
3124 }
3125 }
3126 else {
3127 warning("Uses Perl_$func instead of $func");
3128 $file{changes} += ($c =~ s{\bPerl_$func(\s*)\((\s*aTHX_?)?\s*}
3129 {$func$1(}g);
3130 }
3131 }
3132
3133 for $func (sort keys %{$file{uses_replace}}) {
3134 warning("Uses $func instead of $replace{$func}");
3135 $file{changes} += ($c =~ s/\b$func\b/$replace{$func}/g);
3136 }
3137
3138 for $func (sort keys %{$file{uses_provided}}) {
3139 if ($file{uses}{$func}) {
3140 if (exists $file{uses_deps}{$func}) {
3141 diag("Uses $func, which depends on ", join(', ', @{$file{uses_deps}{$func}}));
3142 }
3143 else {
3144 diag("Uses $func");
3145 }
3146 }
3147 $warnings += hint($func);
3148 }
3149
3150 unless ($opt{quiet}) {
3151 for $func (sort keys %{$file{uses_todo}}) {
3152 print "*** WARNING: Uses $func, which may not be portable below perl ",
3153 format_version($API{$func}{todo}), ", even with '$ppport'\n";
3154 $warnings++;
3155 }
3156 }
3157
3158 for $func (sort keys %{$file{needed_static}}) {
3159 my $message = '';
3160 if (not exists $file{uses}{$func}) {
3161 $message = "No need to define NEED_$func if $func is never used";
3162 }
3163 elsif (exists $file{needs}{$func} && $file{needs}{$func} ne 'static') {
3164 $message = "No need to define NEED_$func when already needed globally";
3165 }
3166 if ($message) {
3167 diag($message);
3168 $file{changes} += ($c =~ s/^$HS*#$HS*define$HS+NEED_$func\b.*$LF//mg);
3169 }
3170 }
3171
3172 for $func (sort keys %{$file{needed_global}}) {
3173 my $message = '';
3174 if (not exists $global{uses}{$func}) {
3175 $message = "No need to define NEED_${func}_GLOBAL if $func is never used";
3176 }
3177 elsif (exists $file{needs}{$func}) {
3178 if ($file{needs}{$func} eq 'extern') {
3179 $message = "No need to define NEED_${func}_GLOBAL when already needed globally";
3180 }
3181 elsif ($file{needs}{$func} eq 'static') {
3182 $message = "No need to define NEED_${func}_GLOBAL when only used in this file";
3183 }
3184 }
3185 if ($message) {
3186 diag($message);
3187 $file{changes} += ($c =~ s/^$HS*#$HS*define$HS+NEED_${func}_GLOBAL\b.*$LF//mg);
3188 }
3189 }
3190
3191 $file{needs_inc_ppport} = keys %{$file{uses}};
3192
3193 if ($file{needs_inc_ppport}) {
3194 my $pp = '';
3195
3196 for $func (sort keys %{$file{needs}}) {
3197 my $type = $file{needs}{$func};
3198 next if $type eq 'extern';
3199 my $suffix = $type eq 'global' ? '_GLOBAL' : '';
3200 unless (exists $file{"needed_$type"}{$func}) {
3201 if ($type eq 'global') {
3202 diag("Files [@{$global{needs}{$func}}] need $func, adding global request");
3203 }
3204 else {
3205 diag("File needs $func, adding static request");
3206 }
3207 $pp .= "#define NEED_$func$suffix\n";
3208 }
3209 }
3210
3211 if ($pp && ($c =~ s/^(?=$HS*#$HS*define$HS+NEED_\w+)/$pp/m)) {
3212 $pp = '';
3213 $file{changes}++;
3214 }
3215
3216 unless ($file{has_inc_ppport}) {
3217 diag("Needs to include '$ppport'");
3218 $pp .= qq(#include "$ppport"\n)
3219 }
3220
3221 if ($pp) {
3222 $file{changes} += ($c =~ s/^($HS*#$HS*define$HS+NEED_\w+.*?)^/$1$pp/ms)
3223 || ($c =~ s/^(?=$HS*#$HS*include.*\Q$ppport\E)/$pp/m)
3224 || ($c =~ s/^($HS*#$HS*include.*XSUB.*\s*?)^/$1$pp/m)
3225 || ($c =~ s/^/$pp/);
3226 }
3227 }
3228 else {
3229 if ($file{has_inc_ppport}) {
3230 diag("No need to include '$ppport'");
3231 $file{changes} += ($c =~ s/^$HS*?#$HS*include.*\Q$ppport\E.*?$LF//m);
3232 }
3233 }
3234
3235 # put back in our C comments
3236 my $ix;
3237 my $cppc = 0;
3238 my @ccom = @{$file{ccom}};
3239 for $ix (0 .. $#ccom) {
3240 if (!$opt{cplusplus} && $ccom[$ix] =~ s!^//!!) {
3241 $cppc++;
3242 $file{changes} += $c =~ s/$rccs$ix$rcce/$ccs$ccom[$ix] $cce/;
3243 }
3244 else {
3245 $c =~ s/$rccs$ix$rcce/$ccom[$ix]/;
3246 }
3247 }
3248
3249 if ($cppc) {
3250 my $s = $cppc != 1 ? 's' : '';
3251 warning("Uses $cppc C++ style comment$s, which is not portable");
3252 }
3253
3254 my $s = $warnings != 1 ? 's' : '';
3255 my $warn = $warnings ? " ($warnings warning$s)" : '';
3256 info("Analysis completed$warn");
3257
3258 if ($file{changes}) {
3259 if (exists $opt{copy}) {
3260 my $newfile = "$filename$opt{copy}";
3261 if (-e $newfile) {
3262 error("'$newfile' already exists, refusing to write copy of '$filename'");
3263 }
3264 else {
3265 local *F;
3266 if (open F, ">$newfile") {
3267 info("Writing copy of '$filename' with changes to '$newfile'");
3268 print F $c;
3269 close F;
3270 }
3271 else {
3272 error("Cannot open '$newfile' for writing: $!");
3273 }
3274 }
3275 }
3276 elsif (exists $opt{patch} || $opt{changes}) {
3277 if (exists $opt{patch}) {
3278 unless ($patch_opened) {
3279 if (open PATCH, ">$opt{patch}") {
3280 $patch_opened = 1;
3281 }
3282 else {
3283 error("Cannot open '$opt{patch}' for writing: $!");
3284 delete $opt{patch};
3285 $opt{changes} = 1;
3286 goto fallback;
3287 }
3288 }
3289 mydiff(\*PATCH, $filename, $c);
3290 }
3291 else {
3292 fallback:
3293 info("Suggested changes:");
3294 mydiff(\*STDOUT, $filename, $c);
3295 }
3296 }
3297 else {
3298 my $s = $file{changes} == 1 ? '' : 's';
3299 info("$file{changes} potentially required change$s detected");
3300 }
3301 }
3302 else {
3303 info("Looks good");
3304 }
3305 }
3306
3307 close PATCH if $patch_opened;
3308
3309 exit 0;
3310
3311
3312 sub try_use { eval "use @_;"; return $@ eq '' }
3313
3314 sub mydiff
3315 {
3316 local *F = shift;
3317 my($file, $str) = @_;
3318 my $diff;
3319
3320 if (exists $opt{diff}) {
3321 $diff = run_diff($opt{diff}, $file, $str);
3322 }
3323
3324 if (!defined $diff and try_use('Text::Diff')) {
3325 $diff = Text::Diff::diff($file, \$str, { STYLE => 'Unified' });
3326 $diff = <<HEADER . $diff;
3327 --- $file
3328 +++ $file.patched
3329 HEADER
3330 }
3331
3332 if (!defined $diff) {
3333 $diff = run_diff('diff -u', $file, $str);
3334 }
3335
3336 if (!defined $diff) {
3337 $diff = run_diff('diff', $file, $str);
3338 }
3339
3340 if (!defined $diff) {
3341 error("Cannot generate a diff. Please install Text::Diff or use --copy.");
3342 return;
3343 }
3344
3345 print F $diff;
3346 }
3347
3348 sub run_diff
3349 {
3350 my($prog, $file, $str) = @_;
3351 my $tmp = 'dppptemp';
3352 my $suf = 'aaa';
3353 my $diff = '';
3354 local *F;
3355
3356 while (-e "$tmp.$suf") { $suf++ }
3357 $tmp = "$tmp.$suf";
3358
3359 if (open F, ">$tmp") {
3360 print F $str;
3361 close F;
3362
3363 if (open F, "$prog $file $tmp |") {
3364 while (<F>) {
3365 s/\Q$tmp\E/$file.patched/;
3366 $diff .= $_;
3367 }
3368 close F;
3369 unlink $tmp;
3370 return $diff;
3371 }
3372
3373 unlink $tmp;
3374 }
3375 else {
3376 error("Cannot open '$tmp' for writing: $!");
3377 }
3378
3379 return undef;
3380 }
3381
3382 sub rec_depend
3383 {
3384 my($func, $seen) = @_;
3385 return () unless exists $depends{$func};
3386 $seen = {%{$seen||{}}};
3387 return () if $seen->{$func}++;
3388 my %s;
3389 grep !$s{$_}++, map { ($_, rec_depend($_, $seen)) } @{$depends{$func}};
3390 }
3391
3392 sub parse_version
3393 {
3394 my $ver = shift;
3395
3396 if ($ver =~ /^(\d+)\.(\d+)\.(\d+)$/) {
3397 return ($1, $2, $3);
3398 }
3399 elsif ($ver !~ /^\d+\.[\d_]+$/) {
3400 die "cannot parse version '$ver'\n";
3401 }
3402
3403 $ver =~ s/_//g;
3404 $ver =~ s/$/000000/;
3405
3406 my($r,$v,$s) = $ver =~ /(\d+)\.(\d{3})(\d{3})/;
3407
3408 $v = int $v;
3409 $s = int $s;
3410
3411 if ($r < 5 || ($r == 5 && $v < 6)) {
3412 if ($s % 10) {
3413 die "cannot parse version '$ver'\n";
3414 }
3415 }
3416
3417 return ($r, $v, $s);
3418 }
3419
3420 sub format_version
3421 {
3422 my $ver = shift;
3423
3424 $ver =~ s/$/000000/;
3425 my($r,$v,$s) = $ver =~ /(\d+)\.(\d{3})(\d{3})/;
3426
3427 $v = int $v;
3428 $s = int $s;
3429
3430 if ($r < 5 || ($r == 5 && $v < 6)) {
3431 if ($s % 10) {
3432 die "invalid version '$ver'\n";
3433 }
3434 $s /= 10;
3435
3436 $ver = sprintf "%d.%03d", $r, $v;
3437 $s > 0 and $ver .= sprintf "_%02d", $s;
3438
3439 return $ver;
3440 }
3441
3442 return sprintf "%d.%d.%d", $r, $v, $s;
3443 }
3444
3445 sub info
3446 {
3447 $opt{quiet} and return;
3448 print @_, "\n";
3449 }
3450
3451 sub diag
3452 {
3453 $opt{quiet} and return;
3454 $opt{diag} and print @_, "\n";
3455 }
3456
3457 sub warning
3458 {
3459 $opt{quiet} and return;
3460 print "*** ", @_, "\n";
3461 }
3462
3463 sub error
3464 {
3465 print "*** ERROR: ", @_, "\n";
3466 }
3467
3468 my %given_hints;
3469 my %given_warnings;
3470 sub hint
3471 {
3472 $opt{quiet} and return;
3473 my $func = shift;
3474 my $rv = 0;
3475 if (exists $warnings{$func} && !$given_warnings{$func}++) {
3476 my $warn = $warnings{$func};
3477 $warn =~ s!^!*** !mg;
3478 print "*** WARNING: $func\n", $warn;
3479 $rv++;
3480 }
3481 if ($opt{hints} && exists $hints{$func} && !$given_hints{$func}++) {
3482 my $hint = $hints{$func};
3483 $hint =~ s/^/ /mg;
3484 print " --- hint for $func ---\n", $hint;
3485 }
3486 $rv;
3487 }
3488
3489 sub usage
3490 {
3491 my($usage) = do { local(@ARGV,$/)=($0); <> } =~ /^=head\d$HS+SYNOPSIS\s*^(.*?)\s*^=/ms;
3492 my %M = ( 'I' => '*' );
3493 $usage =~ s/^\s*perl\s+\S+/$^X $0/;
3494 $usage =~ s/([A-Z])<([^>]+)>/$M{$1}$2$M{$1}/g;
3495
3496 print <<ENDUSAGE;
3497
3498 Usage: $usage
3499
3500 See perldoc $0 for details.
3501
3502 ENDUSAGE
3503
3504 exit 2;
3505 }
3506
3507 sub strip
3508 {
3509 my $self = do { local(@ARGV,$/)=($0); <> };
3510 my($copy) = $self =~ /^=head\d\s+COPYRIGHT\s*^(.*?)^=\w+/ms;
3511 $copy =~ s/^(?=\S+)/ /gms;
3512 $self =~ s/^$HS+Do NOT edit.*?(?=^-)/$copy/ms;
3513 $self =~ s/^SKIP.*(?=^__DATA__)/SKIP
3514 if (\@ARGV && \$ARGV[0] eq '--unstrip') {
3515 eval { require Devel::PPPort };
3516 \$@ and die "Cannot require Devel::PPPort, please install.\\n";
3517 if (eval \$Devel::PPPort::VERSION < $VERSION) {
3518 die "$0 was originally generated with Devel::PPPort $VERSION.\\n"
3519 . "Your Devel::PPPort is only version \$Devel::PPPort::VERSION.\\n"
3520 . "Please install a newer version, or --unstrip will not work.\\n";
3521 }
3522 Devel::PPPort::WriteFile(\$0);
3523 exit 0;
3524 }
3525 print <<END;
3526
3527 Sorry, but this is a stripped version of \$0.
3528
3529 To be able to use its original script and doc functionality,
3530 please try to regenerate this file using:
3531
3532 \$^X \$0 --unstrip
3533
3534 END
3535 /ms;
3536 my($pl, $c) = $self =~ /(.*^__DATA__)(.*)/ms;
3537 $c =~ s{
3538 / (?: \*[^*]*\*+(?:[^$ccs][^*]*\*+)* / | /[^\r\n]*)
3539 | ( "[^"\\]*(?:\\.[^"\\]*)*"
3540 | '[^'\\]*(?:\\.[^'\\]*)*' )
3541 | ($HS+) }{ defined $2 ? ' ' : ($1 || '') }gsex;
3542 $c =~ s!\s+$!!mg;
3543 $c =~ s!^$LF!!mg;
3544 $c =~ s!^\s*#\s*!#!mg;
3545 $c =~ s!^\s+!!mg;
3546
3547 open OUT, ">$0" or die "cannot strip $0: $!\n";
3548 print OUT "$pl$c\n";
3549
3550 exit 0;
3551 }
3552
3553 __DATA__
3554 */
23555
33556 #ifndef _P_P_PORTABILITY_H_
43557 #define _P_P_PORTABILITY_H_
53558
3559 #ifndef DPPP_NAMESPACE
3560 # define DPPP_NAMESPACE DPPP_
3561 #endif
3562
3563 #define DPPP_CAT2(x,y) CAT2(x,y)
3564 #define DPPP_(name) DPPP_CAT2(DPPP_NAMESPACE, name)
3565
63566 #ifndef PERL_REVISION
7 # ifndef __PATCHLEVEL_H_INCLUDED__
8 # include "patchlevel.h"
9 # endif
10 # ifndef PERL_REVISION
11 # define PERL_REVISION (5)
12 /* Replace: 1 */
13 # define PERL_VERSION PATCHLEVEL
14 # define PERL_SUBVERSION SUBVERSION
15 /* Replace PERL_PATCHLEVEL with PERL_VERSION */
16 /* Replace: 0 */
17 # endif
18 #endif
19
20 #define PERL_BCDVERSION ((PERL_REVISION * 0x1000000L) + (PERL_VERSION * 0x1000L) + PERL_SUBVERSION)
21
22 #ifndef ERRSV
23 # define ERRSV perl_get_sv("@",FALSE)
24 #endif
25
26 #if (PERL_VERSION < 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION <= 5))
27 /* Replace: 1 */
28 # define PL_Sv Sv
29 # define PL_compiling compiling
30 # define PL_copline copline
31 # define PL_curcop curcop
32 # define PL_curstash curstash
33 # define PL_defgv defgv
34 # define PL_dirty dirty
35 # define PL_hints hints
36 # define PL_na na
37 # define PL_perldb perldb
38 # define PL_rsfp_filters rsfp_filters
39 # define PL_rsfp rsfp
40 # define PL_stdingv stdingv
41 # define PL_sv_no sv_no
42 # define PL_sv_undef sv_undef
43 # define PL_sv_yes sv_yes
44 /* Replace: 0 */
45 #endif
46
3567 # if !defined(__PATCHLEVEL_H_INCLUDED__) && !(defined(PATCHLEVEL) && defined(SUBVERSION))
3568 # define PERL_PATCHLEVEL_H_IMPLICIT
3569 # include <patchlevel.h>
3570 # endif
3571 # if !(defined(PERL_VERSION) || (defined(SUBVERSION) && defined(PATCHLEVEL)))
3572 # include <could_not_find_Perl_patchlevel.h>
3573 # endif
3574 # ifndef PERL_REVISION
3575 # define PERL_REVISION (5)
3576 /* Replace: 1 */
3577 # define PERL_VERSION PATCHLEVEL
3578 # define PERL_SUBVERSION SUBVERSION
3579 /* Replace PERL_PATCHLEVEL with PERL_VERSION */
3580 /* Replace: 0 */
3581 # endif
3582 #endif
3583
3584 #define D_PPP_DEC2BCD(dec) ((((dec)/100)<<8)|((((dec)%100)/10)<<4)|((dec)%10))
3585 #define PERL_BCDVERSION ((D_PPP_DEC2BCD(PERL_REVISION)<<24)|(D_PPP_DEC2BCD(PERL_VERSION)<<12)|D_PPP_DEC2BCD(PERL_SUBVERSION))
3586
3587 /* It is very unlikely that anyone will try to use this with Perl 6
3588 (or greater), but who knows.
3589 */
3590 #if PERL_REVISION != 5
3591 # error ppport.h only works with Perl version 5
3592 #endif /* PERL_REVISION != 5 */
3593 #ifndef dTHR
3594 # define dTHR dNOOP
3595 #endif
3596 #ifndef dTHX
3597 # define dTHX dNOOP
3598 #endif
3599
3600 #ifndef dTHXa
3601 # define dTHXa(x) dNOOP
3602 #endif
473603 #ifndef pTHX
48 # define pTHX
49 # define pTHX_
50 # define aTHX
51 # define aTHX_
52 #endif
3604 # define pTHX void
3605 #endif
3606
3607 #ifndef pTHX_
3608 # define pTHX_
3609 #endif
3610
3611 #ifndef aTHX
3612 # define aTHX
3613 #endif
3614
3615 #ifndef aTHX_
3616 # define aTHX_
3617 #endif
3618
3619 #if (PERL_BCDVERSION < 0x5006000)
3620 # ifdef USE_THREADS
3621 # define aTHXR thr
3622 # define aTHXR_ thr,
3623 # else
3624 # define aTHXR
3625 # define aTHXR_
3626 # endif
3627 # define dTHXR dTHR
3628 #else
3629 # define aTHXR aTHX
3630 # define aTHXR_ aTHX_
3631 # define dTHXR dTHX
3632 #endif
3633 #ifndef dTHXoa
3634 # define dTHXoa(x) dTHXa(x)
3635 #endif
3636
3637 #ifdef I_LIMITS
3638 # include <limits.h>
3639 #endif
3640
3641 #ifndef PERL_UCHAR_MIN
3642 # define PERL_UCHAR_MIN ((unsigned char)0)
3643 #endif
3644
3645 #ifndef PERL_UCHAR_MAX
3646 # ifdef UCHAR_MAX
3647 # define PERL_UCHAR_MAX ((unsigned char)UCHAR_MAX)
3648 # else
3649 # ifdef MAXUCHAR
3650 # define PERL_UCHAR_MAX ((unsigned char)MAXUCHAR)
3651 # else
3652 # define PERL_UCHAR_MAX ((unsigned char)~(unsigned)0)
3653 # endif
3654 # endif
3655 #endif
3656
3657 #ifndef PERL_USHORT_MIN
3658 # define PERL_USHORT_MIN ((unsigned short)0)
3659 #endif
3660
3661 #ifndef PERL_USHORT_MAX
3662 # ifdef USHORT_MAX
3663 # define PERL_USHORT_MAX ((unsigned short)USHORT_MAX)
3664 # else
3665 # ifdef MAXUSHORT
3666 # define PERL_USHORT_MAX ((unsigned short)MAXUSHORT)
3667 # else
3668 # ifdef USHRT_MAX
3669 # define PERL_USHORT_MAX ((unsigned short)USHRT_MAX)
3670 # else
3671 # define PERL_USHORT_MAX ((unsigned short)~(unsigned)0)
3672 # endif
3673 # endif
3674 # endif
3675 #endif
3676
3677 #ifndef PERL_SHORT_MAX
3678 # ifdef SHORT_MAX
3679 # define PERL_SHORT_MAX ((short)SHORT_MAX)
3680 # else
3681 # ifdef MAXSHORT /* Often used in <values.h> */
3682 # define PERL_SHORT_MAX ((short)MAXSHORT)
3683 # else
3684 # ifdef SHRT_MAX
3685 # define PERL_SHORT_MAX ((short)SHRT_MAX)
3686 # else
3687 # define PERL_SHORT_MAX ((short) (PERL_USHORT_MAX >> 1))
3688 # endif
3689 # endif
3690 # endif
3691 #endif
3692
3693 #ifndef PERL_SHORT_MIN
3694 # ifdef SHORT_MIN
3695 # define PERL_SHORT_MIN ((short)SHORT_MIN)
3696 # else
3697 # ifdef MINSHORT
3698 # define PERL_SHORT_MIN ((short)MINSHORT)
3699 # else
3700 # ifdef SHRT_MIN
3701 # define PERL_SHORT_MIN ((short)SHRT_MIN)
3702 # else
3703 # define PERL_SHORT_MIN (-PERL_SHORT_MAX - ((3 & -1) == 3))
3704 # endif
3705 # endif
3706 # endif
3707 #endif
3708
3709 #ifndef PERL_UINT_MAX
3710 # ifdef UINT_MAX
3711 # define PERL_UINT_MAX ((unsigned int)UINT_MAX)
3712 # else
3713 # ifdef MAXUINT
3714 # define PERL_UINT_MAX ((unsigned int)MAXUINT)
3715 # else
3716 # define PERL_UINT_MAX (~(unsigned int)0)
3717 # endif
3718 # endif
3719 #endif
3720
3721 #ifndef PERL_UINT_MIN
3722 # define PERL_UINT_MIN ((unsigned int)0)
3723 #endif
3724
3725 #ifndef PERL_INT_MAX
3726 # ifdef INT_MAX
3727 # define PERL_INT_MAX ((int)INT_MAX)
3728 # else
3729 # ifdef MAXINT /* Often used in <values.h> */
3730 # define PERL_INT_MAX ((int)MAXINT)
3731 # else
3732 # define PERL_INT_MAX ((int)(PERL_UINT_MAX >> 1))
3733 # endif
3734 # endif
3735 #endif
3736
3737 #ifndef PERL_INT_MIN
3738 # ifdef INT_MIN
3739 # define PERL_INT_MIN ((int)INT_MIN)
3740 # else
3741 # ifdef MININT
3742 # define PERL_INT_MIN ((int)MININT)
3743 # else
3744 # define PERL_INT_MIN (-PERL_INT_MAX - ((3 & -1) == 3))
3745 # endif
3746 # endif
3747 #endif
3748
3749 #ifndef PERL_ULONG_MAX
3750 # ifdef ULONG_MAX
3751 # define PERL_ULONG_MAX ((unsigned long)ULONG_MAX)
3752 # else
3753 # ifdef MAXULONG
3754 # define PERL_ULONG_MAX ((unsigned long)MAXULONG)
3755 # else
3756 # define PERL_ULONG_MAX (~(unsigned long)0)
3757 # endif
3758 # endif
3759 #endif
3760
3761 #ifndef PERL_ULONG_MIN
3762 # define PERL_ULONG_MIN ((unsigned long)0L)
3763 #endif
3764
3765 #ifndef PERL_LONG_MAX
3766 # ifdef LONG_MAX
3767 # define PERL_LONG_MAX ((long)LONG_MAX)
3768 # else
3769 # ifdef MAXLONG
3770 # define PERL_LONG_MAX ((long)MAXLONG)
3771 # else
3772 # define PERL_LONG_MAX ((long) (PERL_ULONG_MAX >> 1))
3773 # endif
3774 # endif
3775 #endif
3776
3777 #ifndef PERL_LONG_MIN
3778 # ifdef LONG_MIN
3779 # define PERL_LONG_MIN ((long)LONG_MIN)
3780 # else
3781 # ifdef MINLONG
3782 # define PERL_LONG_MIN ((long)MINLONG)
3783 # else
3784 # define PERL_LONG_MIN (-PERL_LONG_MAX - ((3 & -1) == 3))
3785 # endif
3786 # endif
3787 #endif
3788
3789 #if defined(HAS_QUAD) && (defined(convex) || defined(uts))
3790 # ifndef PERL_UQUAD_MAX
3791 # ifdef ULONGLONG_MAX
3792 # define PERL_UQUAD_MAX ((unsigned long long)ULONGLONG_MAX)
3793 # else
3794 # ifdef MAXULONGLONG
3795 # define PERL_UQUAD_MAX ((unsigned long long)MAXULONGLONG)
3796 # else
3797 # define PERL_UQUAD_MAX (~(unsigned long long)0)
3798 # endif
3799 # endif
3800 # endif
3801
3802 # ifndef PERL_UQUAD_MIN
3803 # define PERL_UQUAD_MIN ((unsigned long long)0L)
3804 # endif
3805
3806 # ifndef PERL_QUAD_MAX
3807 # ifdef LONGLONG_MAX
3808 # define PERL_QUAD_MAX ((long long)LONGLONG_MAX)
3809 # else
3810 # ifdef MAXLONGLONG
3811 # define PERL_QUAD_MAX ((long long)MAXLONGLONG)
3812 # else
3813 # define PERL_QUAD_MAX ((long long) (PERL_UQUAD_MAX >> 1))
3814 # endif
3815 # endif
3816 # endif
3817
3818 # ifndef PERL_QUAD_MIN
3819 # ifdef LONGLONG_MIN
3820 # define PERL_QUAD_MIN ((long long)LONGLONG_MIN)
3821 # else
3822 # ifdef MINLONGLONG
3823 # define PERL_QUAD_MIN ((long long)MINLONGLONG)
3824 # else
3825 # define PERL_QUAD_MIN (-PERL_QUAD_MAX - ((3 & -1) == 3))
3826 # endif
3827 # endif
3828 # endif
3829 #endif
3830
3831 /* This is based on code from 5.003 perl.h */
3832 #ifdef HAS_QUAD
3833 # ifdef cray
3834 #ifndef IVTYPE
3835 # define IVTYPE int
3836 #endif
3837
3838 #ifndef IV_MIN
3839 # define IV_MIN PERL_INT_MIN
3840 #endif
3841
3842 #ifndef IV_MAX
3843 # define IV_MAX PERL_INT_MAX
3844 #endif
3845
3846 #ifndef UV_MIN
3847 # define UV_MIN PERL_UINT_MIN
3848 #endif
3849
3850 #ifndef UV_MAX
3851 # define UV_MAX PERL_UINT_MAX
3852 #endif
3853
3854 # ifdef INTSIZE
3855 #ifndef IVSIZE
3856 # define IVSIZE INTSIZE
3857 #endif
3858
3859 # endif
3860 # else
3861 # if defined(convex) || defined(uts)
3862 #ifndef IVTYPE
3863 # define IVTYPE long long
3864 #endif
3865
3866 #ifndef IV_MIN
3867 # define IV_MIN PERL_QUAD_MIN
3868 #endif
3869
3870 #ifndef IV_MAX
3871 # define IV_MAX PERL_QUAD_MAX
3872 #endif
3873
3874 #ifndef UV_MIN
3875 # define UV_MIN PERL_UQUAD_MIN
3876 #endif
3877
3878 #ifndef UV_MAX
3879 # define UV_MAX PERL_UQUAD_MAX
3880 #endif
3881
3882 # ifdef LONGLONGSIZE
3883 #ifndef IVSIZE
3884 # define IVSIZE LONGLONGSIZE
3885 #endif
3886
3887 # endif
3888 # else
3889 #ifndef IVTYPE
3890 # define IVTYPE long
3891 #endif
3892
3893 #ifndef IV_MIN
3894 # define IV_MIN PERL_LONG_MIN
3895 #endif
3896
3897 #ifndef IV_MAX
3898 # define IV_MAX PERL_LONG_MAX
3899 #endif
3900
3901 #ifndef UV_MIN
3902 # define UV_MIN PERL_ULONG_MIN
3903 #endif
3904
3905 #ifndef UV_MAX
3906 # define UV_MAX PERL_ULONG_MAX
3907 #endif
3908
3909 # ifdef LONGSIZE
3910 #ifndef IVSIZE
3911 # define IVSIZE LONGSIZE
3912 #endif
3913
3914 # endif
3915 # endif
3916 # endif
3917 #ifndef IVSIZE
3918 # define IVSIZE 8
3919 #endif
3920
3921 #ifndef LONGSIZE
3922 # define LONGSIZE 8
3923 #endif
3924
3925 #ifndef PERL_QUAD_MIN
3926 # define PERL_QUAD_MIN IV_MIN
3927 #endif
3928
3929 #ifndef PERL_QUAD_MAX
3930 # define PERL_QUAD_MAX IV_MAX
3931 #endif
3932
3933 #ifndef PERL_UQUAD_MIN
3934 # define PERL_UQUAD_MIN UV_MIN
3935 #endif
3936
3937 #ifndef PERL_UQUAD_MAX
3938 # define PERL_UQUAD_MAX UV_MAX
3939 #endif
3940
3941 #else
3942 #ifndef IVTYPE
3943 # define IVTYPE long
3944 #endif
3945
3946 #ifndef LONGSIZE
3947 # define LONGSIZE 4
3948 #endif
3949
3950 #ifndef IV_MIN
3951 # define IV_MIN PERL_LONG_MIN
3952 #endif
3953
3954 #ifndef IV_MAX
3955 # define IV_MAX PERL_LONG_MAX
3956 #endif
3957
3958 #ifndef UV_MIN
3959 # define UV_MIN PERL_ULONG_MIN
3960 #endif
3961
3962 #ifndef UV_MAX
3963 # define UV_MAX PERL_ULONG_MAX
3964 #endif
3965
3966 #endif
3967
3968 #ifndef IVSIZE
3969 # ifdef LONGSIZE
3970 # define IVSIZE LONGSIZE
3971 # else
3972 # define IVSIZE 4 /* A bold guess, but the best we can make. */
3973 # endif
3974 #endif
3975 #ifndef UVTYPE
3976 # define UVTYPE unsigned IVTYPE
3977 #endif
3978
3979 #ifndef UVSIZE
3980 # define UVSIZE IVSIZE
3981 #endif
3982 #ifndef cBOOL
3983 # define cBOOL(cbool) ((cbool) ? (bool)1 : (bool)0)
3984 #endif
3985
3986 #ifndef OpHAS_SIBLING
3987 # define OpHAS_SIBLING(o) (cBOOL((o)->op_sibling))
3988 #endif
3989
3990 #ifndef OpSIBLING
3991 # define OpSIBLING(o) (0 + (o)->op_sibling)
3992 #endif
3993
3994 #ifndef OpMORESIB_set
3995 # define OpMORESIB_set(o, sib) ((o)->op_sibling = (sib))
3996 #endif
3997
3998 #ifndef OpLASTSIB_set
3999 # define OpLASTSIB_set(o, parent) ((o)->op_sibling = NULL)
4000 #endif
4001
4002 #ifndef OpMAYBESIB_set
4003 # define OpMAYBESIB_set(o, sib, parent) ((o)->op_sibling = (sib))
4004 #endif
4005
4006 #ifndef HEf_SVKEY
4007 # define HEf_SVKEY -2
4008 #endif
4009
4010 #if defined(DEBUGGING) && !defined(__COVERITY__)
4011 #ifndef __ASSERT_
4012 # define __ASSERT_(statement) assert(statement),
4013 #endif
4014
4015 #else
4016 #ifndef __ASSERT_
4017 # define __ASSERT_(statement)
4018 #endif
4019
4020 #endif
4021
4022 #ifndef SvRX
4023 #if defined(NEED_SvRX)
4024 static void * DPPP_(my_SvRX)(pTHX_ SV *rv);
4025 static
4026 #else
4027 extern void * DPPP_(my_SvRX)(pTHX_ SV *rv);
4028 #endif
4029
4030 #if defined(NEED_SvRX) || defined(NEED_SvRX_GLOBAL)
4031
4032 #ifdef SvRX
4033 # undef SvRX
4034 #endif
4035 #define SvRX(a) DPPP_(my_SvRX)(aTHX_ a)
4036
4037
4038 void *
4039 DPPP_(my_SvRX)(pTHX_ SV *rv)
4040 {
4041 if (SvROK(rv)) {
4042 SV *sv = SvRV(rv);
4043 if (SvMAGICAL(sv)) {
4044 MAGIC *mg = mg_find(sv, PERL_MAGIC_qr);
4045 if (mg && mg->mg_obj) {
4046 return mg->mg_obj;
4047 }
4048 }
4049 }
4050 return 0;
4051 }
4052 #endif
4053 #endif
4054 #ifndef SvRXOK
4055 # define SvRXOK(sv) (!!SvRX(sv))
4056 #endif
4057
4058 #ifndef PERL_UNUSED_DECL
4059 # ifdef HASATTRIBUTE
4060 # if (defined(__GNUC__) && defined(__cplusplus)) || defined(__INTEL_COMPILER)
4061 # define PERL_UNUSED_DECL
4062 # else
4063 # define PERL_UNUSED_DECL __attribute__((unused))
4064 # endif
4065 # else
4066 # define PERL_UNUSED_DECL
4067 # endif
4068 #endif
4069
4070 #ifndef PERL_UNUSED_ARG
4071 # if defined(lint) && defined(S_SPLINT_S) /* www.splint.org */
4072 # include <note.h>
4073 # define PERL_UNUSED_ARG(x) NOTE(ARGUNUSED(x))
4074 # else
4075 # define PERL_UNUSED_ARG(x) ((void)x)
4076 # endif
4077 #endif
4078
4079 #ifndef PERL_UNUSED_VAR
4080 # define PERL_UNUSED_VAR(x) ((void)x)
4081 #endif
4082
4083 #ifndef PERL_UNUSED_CONTEXT
4084 # ifdef USE_ITHREADS
4085 # define PERL_UNUSED_CONTEXT PERL_UNUSED_ARG(my_perl)
4086 # else
4087 # define PERL_UNUSED_CONTEXT
4088 # endif
4089 #endif
4090
4091 #ifndef PERL_UNUSED_RESULT
4092 # if defined(__GNUC__) && defined(HASATTRIBUTE_WARN_UNUSED_RESULT)
4093 # define PERL_UNUSED_RESULT(v) STMT_START { __typeof__(v) z = (v); (void)sizeof(z); } STMT_END
4094 # else
4095 # define PERL_UNUSED_RESULT(v) ((void)(v))
4096 # endif
4097 #endif
4098 #ifndef NOOP
4099 # define NOOP /*EMPTY*/(void)0
4100 #endif
4101
4102 #ifndef dNOOP
4103 # define dNOOP extern int /*@unused@*/ Perl___notused PERL_UNUSED_DECL
4104 #endif
4105
4106 #ifndef NVTYPE
4107 # if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
4108 # define NVTYPE long double
4109 # else
4110 # define NVTYPE double
4111 # endif
4112 typedef NVTYPE NV;
4113 #endif
4114
4115 #ifndef INT2PTR
4116 # if (IVSIZE == PTRSIZE) && (UVSIZE == PTRSIZE)
4117 # define PTRV UV
4118 # define INT2PTR(any,d) (any)(d)
4119 # else
4120 # if PTRSIZE == LONGSIZE
4121 # define PTRV unsigned long
4122 # else
4123 # define PTRV unsigned
4124 # endif
4125 # define INT2PTR(any,d) (any)(PTRV)(d)
4126 # endif
4127 #endif
4128
4129 #ifndef PTR2ul
4130 # if PTRSIZE == LONGSIZE
4131 # define PTR2ul(p) (unsigned long)(p)
4132 # else
4133 # define PTR2ul(p) INT2PTR(unsigned long,p)
4134 # endif
4135 #endif
4136 #ifndef PTR2nat
4137 # define PTR2nat(p) (PTRV)(p)
4138 #endif
4139
4140 #ifndef NUM2PTR
4141 # define NUM2PTR(any,d) (any)PTR2nat(d)
4142 #endif
534143
544144 #ifndef PTR2IV
55 # define PTR2IV(d) (IV)(d)
56 #endif
57
58 #ifndef INT2PTR
59 # define INT2PTR(any,d) (any)(d)
60 #endif
61
62 #ifndef dTHR
63 # ifdef WIN32
64 # define dTHR extern int Perl___notused
4145 # define PTR2IV(p) INT2PTR(IV,p)
4146 #endif
4147
4148 #ifndef PTR2UV
4149 # define PTR2UV(p) INT2PTR(UV,p)
4150 #endif
4151
4152 #ifndef PTR2NV
4153 # define PTR2NV(p) NUM2PTR(NV,p)
4154 #endif
4155
4156 #undef START_EXTERN_C
4157 #undef END_EXTERN_C
4158 #undef EXTERN_C
4159 #ifdef __cplusplus
4160 # define START_EXTERN_C extern "C" {
4161 # define END_EXTERN_C }
4162 # define EXTERN_C extern "C"
4163 #else
4164 # define START_EXTERN_C
4165 # define END_EXTERN_C
4166 # define EXTERN_C extern
4167 #endif
4168
4169 #if defined(PERL_GCC_PEDANTIC)
4170 # ifndef PERL_GCC_BRACE_GROUPS_FORBIDDEN
4171 # define PERL_GCC_BRACE_GROUPS_FORBIDDEN
4172 # endif
4173 #endif
4174
4175 #if defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN) && !defined(__cplusplus)
4176 # ifndef PERL_USE_GCC_BRACE_GROUPS
4177 # define PERL_USE_GCC_BRACE_GROUPS
4178 # endif
4179 #endif
4180
4181 #undef STMT_START
4182 #undef STMT_END
4183 #ifdef PERL_USE_GCC_BRACE_GROUPS
4184 # define STMT_START (void)( /* gcc supports ``({ STATEMENTS; })'' */
4185 # define STMT_END )
4186 #else
4187 # if defined(VOIDFLAGS) && (VOIDFLAGS) && (defined(sun) || defined(__sun__)) && !defined(__GNUC__)
4188 # define STMT_START if (1)
4189 # define STMT_END else (void)0
654190 # else
66 # define dTHR extern int errno
4191 # define STMT_START do
4192 # define STMT_END while (0)
674193 # endif
684194 #endif
69
704195 #ifndef boolSV
71 # define boolSV(b) ((b) ? &PL_sv_yes : &PL_sv_no)
72 #endif
73
74 #ifndef gv_stashpvn
75 # define gv_stashpvn(str,len,flags) gv_stashpv(str,flags)
76 #endif
77
78 #ifndef newSVpvn
79 # define newSVpvn(data,len) ((len) ? newSVpv ((data), (len)) : newSVpv ("", 0))
80 #endif
81
82 #ifndef newRV_inc
83 /* Replace: 1 */
84 # define newRV_inc(sv) newRV(sv)
85 /* Replace: 0 */
86 #endif
87
88 #ifndef SvGETMAGIC
89 # define SvGETMAGIC(x) STMT_START { if (SvGMAGICAL(x)) mg_get(x); } STMT_END
90 #endif
91
4196 # define boolSV(b) ((b) ? &PL_sv_yes : &PL_sv_no)
4197 #endif
924198
934199 /* DEFSV appears first in 5.004_56 */
944200 #ifndef DEFSV
95 # define DEFSV GvSV(PL_defgv)
4201 # define DEFSV GvSV(PL_defgv)
964202 #endif
974203
984204 #ifndef SAVE_DEFSV
99 # define SAVE_DEFSV SAVESPTR(GvSV(PL_defgv))
100 #endif
101
102 #ifndef newRV_noinc
103 # ifdef __GNUC__
104 # define newRV_noinc(sv) \
105 ({ \
106 SV *nsv = (SV*)newRV(sv); \
107 SvREFCNT_dec(sv); \
108 nsv; \
109 })
4205 # define SAVE_DEFSV SAVESPTR(GvSV(PL_defgv))
4206 #endif
4207
4208 #ifndef DEFSV_set
4209 # define DEFSV_set(sv) (DEFSV = (sv))
4210 #endif
4211
4212 /* Older perls (<=5.003) lack AvFILLp */
4213 #ifndef AvFILLp
4214 # define AvFILLp AvFILL
4215 #endif
4216 #ifndef av_tindex
4217 # define av_tindex AvFILL
4218 #endif
4219
4220 #ifndef av_top_index
4221 # define av_top_index AvFILL
4222 #endif
4223 #ifndef ERRSV
4224 # define ERRSV get_sv("@",FALSE)
4225 #endif
4226
4227 /* Hint: gv_stashpvn
4228 * This function's backport doesn't support the length parameter, but
4229 * rather ignores it. Portability can only be ensured if the length
4230 * parameter is used for speed reasons, but the length can always be
4231 * correctly computed from the string argument.
4232 */
4233 #ifndef gv_stashpvn
4234 # define gv_stashpvn(str,len,create) gv_stashpv(str,create)
4235 #endif
4236
4237 /* Replace: 1 */
4238 #ifndef get_cv
4239 # define get_cv perl_get_cv
4240 #endif
4241
4242 #ifndef get_sv
4243 # define get_sv perl_get_sv
4244 #endif
4245
4246 #ifndef get_av
4247 # define get_av perl_get_av
4248 #endif
4249
4250 #ifndef get_hv
4251 # define get_hv perl_get_hv
4252 #endif
4253
4254 /* Replace: 0 */
4255 #ifndef dUNDERBAR
4256 # define dUNDERBAR dNOOP
4257 #endif
4258
4259 #ifndef UNDERBAR
4260 # define UNDERBAR DEFSV
4261 #endif
4262 #ifndef dAX
4263 # define dAX I32 ax = MARK - PL_stack_base + 1
4264 #endif
4265
4266 #ifndef dITEMS
4267 # define dITEMS I32 items = SP - MARK
4268 #endif
4269 #ifndef dXSTARG
4270 # define dXSTARG SV * targ = sv_newmortal()
4271 #endif
4272 #ifndef dAXMARK
4273 # define dAXMARK I32 ax = POPMARK; \
4274 register SV ** const mark = PL_stack_base + ax++
4275 #endif
4276 #ifndef XSprePUSH
4277 # define XSprePUSH (sp = PL_stack_base + ax - 1)
4278 #endif
4279
4280 #if (PERL_BCDVERSION < 0x5005000)
4281 # undef XSRETURN
4282 # define XSRETURN(off) \
4283 STMT_START { \
4284 PL_stack_sp = PL_stack_base + ax + ((off) - 1); \
4285 return; \
4286 } STMT_END
4287 #endif
4288 #ifndef XSPROTO
4289 # define XSPROTO(name) void name(pTHX_ CV* cv)
4290 #endif
4291
4292 #ifndef SVfARG
4293 # define SVfARG(p) ((void*)(p))
4294 #endif
4295 #ifndef PERL_ABS
4296 # define PERL_ABS(x) ((x) < 0 ? -(x) : (x))
4297 #endif
4298 #ifndef dVAR
4299 # define dVAR dNOOP
4300 #endif
4301 #ifndef SVf
4302 # define SVf "_"
4303 #endif
4304 #ifndef UTF8_MAXBYTES
4305 # define UTF8_MAXBYTES UTF8_MAXLEN
4306 #endif
4307 #ifndef CPERLscope
4308 # define CPERLscope(x) x
4309 #endif
4310 #ifndef PERL_HASH
4311 # define PERL_HASH(hash,str,len) \
4312 STMT_START { \
4313 const char *s_PeRlHaSh = str; \
4314 I32 i_PeRlHaSh = len; \
4315 U32 hash_PeRlHaSh = 0; \
4316 while (i_PeRlHaSh--) \
4317 hash_PeRlHaSh = hash_PeRlHaSh * 33 + *s_PeRlHaSh++; \
4318 (hash) = hash_PeRlHaSh; \
4319 } STMT_END
4320 #endif
4321
4322 #ifndef PERLIO_FUNCS_DECL
4323 # ifdef PERLIO_FUNCS_CONST
4324 # define PERLIO_FUNCS_DECL(funcs) const PerlIO_funcs funcs
4325 # define PERLIO_FUNCS_CAST(funcs) (PerlIO_funcs*)(funcs)
4326 # else
4327 # define PERLIO_FUNCS_DECL(funcs) PerlIO_funcs funcs
4328 # define PERLIO_FUNCS_CAST(funcs) (funcs)
4329 # endif
4330 #endif
4331
4332 /* provide these typedefs for older perls */
4333 #if (PERL_BCDVERSION < 0x5009003)
4334
4335 # ifdef ARGSproto
4336 typedef OP* (CPERLscope(*Perl_ppaddr_t))(ARGSproto);
4337 # else
4338 typedef OP* (CPERLscope(*Perl_ppaddr_t))(pTHX);
4339 # endif
4340
4341 typedef OP* (CPERLscope(*Perl_check_t)) (pTHX_ OP*);
4342
4343 #endif
4344
4345 #ifndef WIDEST_UTYPE
4346 # ifdef QUADKIND
4347 # ifdef U64TYPE
4348 # define WIDEST_UTYPE U64TYPE
1104349 # else
111 # if defined(CRIPPLED_CC) || defined(USE_THREADS)
112 static SV * newRV_noinc (SV * sv)
113 {
114 SV *nsv = (SV*)newRV(sv);
115 SvREFCNT_dec(sv);
116 return nsv;
117 }
118 # else
119 # define newRV_noinc(sv) \
120 ((PL_Sv=(SV*)newRV(sv), SvREFCNT_dec(sv), (SV*)PL_Sv)
121 # endif
4350 # define WIDEST_UTYPE Quad_t
1224351 # endif
123 #endif
124
125 /* Provide: newCONSTSUB */
126
127 /* newCONSTSUB from IO.xs is in the core starting with 5.004_63 */
128 #if (PERL_VERSION < 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION < 63))
129
130 #if defined(NEED_newCONSTSUB)
4352 # else
4353 # define WIDEST_UTYPE U32
4354 # endif
4355 #endif
4356
4357 #ifdef EBCDIC
4358
4359 /* This is the first version where these macros are fully correct. Relying on
4360 * the C library functions, as earlier releases did, causes problems with
4361 * locales */
4362 # if (PERL_BCDVERSION < 0x5022000)
4363 # undef isALNUM
4364 # undef isALNUM_A
4365 # undef isALNUMC
4366 # undef isALNUMC_A
4367 # undef isALPHA
4368 # undef isALPHA_A
4369 # undef isALPHANUMERIC
4370 # undef isALPHANUMERIC_A
4371 # undef isASCII
4372 # undef isASCII_A
4373 # undef isBLANK
4374 # undef isBLANK_A
4375 # undef isCNTRL
4376 # undef isCNTRL_A
4377 # undef isDIGIT
4378 # undef isDIGIT_A
4379 # undef isGRAPH
4380 # undef isGRAPH_A
4381 # undef isIDCONT
4382 # undef isIDCONT_A
4383 # undef isIDFIRST
4384 # undef isIDFIRST_A
4385 # undef isLOWER
4386 # undef isLOWER_A
4387 # undef isOCTAL
4388 # undef isOCTAL_A
4389 # undef isPRINT
4390 # undef isPRINT_A
4391 # undef isPSXSPC
4392 # undef isPSXSPC_A
4393 # undef isPUNCT
4394 # undef isPUNCT_A
4395 # undef isSPACE
4396 # undef isSPACE_A
4397 # undef isUPPER
4398 # undef isUPPER_A
4399 # undef isWORDCHAR
4400 # undef isWORDCHAR_A
4401 # undef isXDIGIT
4402 # undef isXDIGIT_A
4403 # endif
4404 #ifndef isASCII
4405 # define isASCII(c) (isCNTRL(c) || isPRINT(c))
4406 #endif
4407
4408 /* The below is accurate for all EBCDIC code pages supported by
4409 * all the versions of Perl overridden by this */
4410 #ifndef isCNTRL
4411 # define isCNTRL(c) ( (c) == '\0' || (c) == '\a' || (c) == '\b' \
4412 || (c) == '\f' || (c) == '\n' || (c) == '\r' \
4413 || (c) == '\t' || (c) == '\v' \
4414 || ((c) <= 3 && (c) >= 1) /* SOH, STX, ETX */ \
4415 || (c) == 7 /* U+7F DEL */ \
4416 || ((c) <= 0x13 && (c) >= 0x0E) /* SO, SI */ \
4417 /* DLE, DC[1-3] */ \
4418 || (c) == 0x18 /* U+18 CAN */ \
4419 || (c) == 0x19 /* U+19 EOM */ \
4420 || ((c) <= 0x1F && (c) >= 0x1C) /* [FGRU]S */ \
4421 || (c) == 0x26 /* U+17 ETB */ \
4422 || (c) == 0x27 /* U+1B ESC */ \
4423 || (c) == 0x2D /* U+05 ENQ */ \
4424 || (c) == 0x2E /* U+06 ACK */ \
4425 || (c) == 0x32 /* U+16 SYN */ \
4426 || (c) == 0x37 /* U+04 EOT */ \
4427 || (c) == 0x3C /* U+14 DC4 */ \
4428 || (c) == 0x3D /* U+15 NAK */ \
4429 || (c) == 0x3F /* U+1A SUB */ \
4430 )
4431 #endif
4432
4433 /* The ordering of the tests in this and isUPPER are to exclude most characters
4434 * early */
4435 #ifndef isLOWER
4436 # define isLOWER(c) ( (c) >= 'a' && (c) <= 'z' \
4437 && ( (c) <= 'i' \
4438 || ((c) >= 'j' && (c) <= 'r') \
4439 || (c) >= 's'))
4440 #endif
4441
4442 #ifndef isUPPER
4443 # define isUPPER(c) ( (c) >= 'A' && (c) <= 'Z' \
4444 && ( (c) <= 'I' \
4445 || ((c) >= 'J' && (c) <= 'R') \
4446 || (c) >= 'S'))
4447 #endif
4448
4449 #else /* Above is EBCDIC; below is ASCII */
4450
4451 # if (PERL_BCDVERSION < 0x5004000)
4452 /* The implementation of these in older perl versions can give wrong results if
4453 * the C program locale is set to other than the C locale */
4454 # undef isALNUM
4455 # undef isALNUM_A
4456 # undef isALPHA
4457 # undef isALPHA_A
4458 # undef isDIGIT
4459 # undef isDIGIT_A
4460 # undef isIDFIRST
4461 # undef isIDFIRST_A
4462 # undef isLOWER
4463 # undef isLOWER_A
4464 # undef isUPPER
4465 # undef isUPPER_A
4466 # endif
4467
4468 # if (PERL_BCDVERSION < 0x5008000)
4469 /* Hint: isCNTRL
4470 * Earlier perls omitted DEL */
4471 # undef isCNTRL
4472 # endif
4473
4474 # if (PERL_BCDVERSION < 0x5010000)
4475 /* Hint: isPRINT
4476 * The implementation in older perl versions includes all of the
4477 * isSPACE() characters, which is wrong. The version provided by
4478 * Devel::PPPort always overrides a present buggy version.
4479 */
4480 # undef isPRINT
4481 # undef isPRINT_A
4482 # endif
4483
4484 # if (PERL_BCDVERSION < 0x5014000)
4485 /* Hint: isASCII
4486 * The implementation in older perl versions always returned true if the
4487 * parameter was a signed char
4488 */
4489 # undef isASCII
4490 # undef isASCII_A
4491 # endif
4492
4493 # if (PERL_BCDVERSION < 0x5020000)
4494 /* Hint: isSPACE
4495 * The implementation in older perl versions didn't include \v */
4496 # undef isSPACE
4497 # undef isSPACE_A
4498 # endif
4499 #ifndef isASCII
4500 # define isASCII(c) ((WIDEST_UTYPE) (c) <= 127)
4501 #endif
4502
4503 #ifndef isCNTRL
4504 # define isCNTRL(c) ((WIDEST_UTYPE) (c) < ' ' || (c) == 127)
4505 #endif
4506
4507 #ifndef isLOWER
4508 # define isLOWER(c) ((c) >= 'a' && (c) <= 'z')
4509 #endif
4510
4511 #ifndef isUPPER
4512 # define isUPPER(c) ((c) <= 'Z' && (c) >= 'A')
4513 #endif
4514
4515 #endif /* Below are definitions common to EBCDIC and ASCII */
4516 #ifndef isALNUM
4517 # define isALNUM(c) isWORDCHAR(c)
4518 #endif
4519
4520 #ifndef isALNUMC
4521 # define isALNUMC(c) isALPHANUMERIC(c)
4522 #endif
4523
4524 #ifndef isALPHA
4525 # define isALPHA(c) (isUPPER(c) || isLOWER(c))
4526 #endif
4527
4528 #ifndef isALPHANUMERIC
4529 # define isALPHANUMERIC(c) (isALPHA(c) || isDIGIT(c))
4530 #endif
4531
4532 #ifndef isBLANK
4533 # define isBLANK(c) ((c) == ' ' || (c) == '\t')
4534 #endif
4535
4536 #ifndef isDIGIT
4537 # define isDIGIT(c) ((c) <= '9' && (c) >= '0')
4538 #endif
4539
4540 #ifndef isGRAPH
4541 # define isGRAPH(c) (isWORDCHAR(c) || isPUNCT(c))
4542 #endif
4543
4544 #ifndef isIDCONT
4545 # define isIDCONT(c) isWORDCHAR(c)
4546 #endif
4547
4548 #ifndef isIDFIRST
4549 # define isIDFIRST(c) (isALPHA(c) || (c) == '_')
4550 #endif
4551
4552 #ifndef isOCTAL
4553 # define isOCTAL(c) (((WIDEST_UTYPE)((c)) & ~7) == '0')
4554 #endif
4555
4556 #ifndef isPRINT
4557 # define isPRINT(c) (isGRAPH(c) || (c) == ' ')
4558 #endif
4559
4560 #ifndef isPSXSPC
4561 # define isPSXSPC(c) isSPACE(c)
4562 #endif
4563
4564 #ifndef isPUNCT
4565 # define isPUNCT(c) ( (c) == '-' || (c) == '!' || (c) == '"' \
4566 || (c) == '#' || (c) == '$' || (c) == '%' \
4567 || (c) == '&' || (c) == '\'' || (c) == '(' \
4568 || (c) == ')' || (c) == '*' || (c) == '+' \
4569 || (c) == ',' || (c) == '.' || (c) == '/' \
4570 || (c) == ':' || (c) == ';' || (c) == '<' \
4571 || (c) == '=' || (c) == '>' || (c) == '?' \
4572 || (c) == '@' || (c) == '[' || (c) == '\\' \
4573 || (c) == ']' || (c) == '^' || (c) == '_' \
4574 || (c) == '`' || (c) == '{' || (c) == '|' \
4575 || (c) == '}' || (c) == '~')
4576 #endif
4577
4578 #ifndef isSPACE
4579 # define isSPACE(c) ( isBLANK(c) || (c) == '\n' || (c) == '\r' \
4580 || (c) == '\v' || (c) == '\f')
4581 #endif
4582
4583 #ifndef isWORDCHAR
4584 # define isWORDCHAR(c) (isALPHANUMERIC(c) || (c) == '_')
4585 #endif
4586
4587 #ifndef isXDIGIT
4588 # define isXDIGIT(c) ( isDIGIT(c) \
4589 || ((c) >= 'a' && (c) <= 'f') \
4590 || ((c) >= 'A' && (c) <= 'F'))
4591 #endif
4592 #ifndef isALNUM_A
4593 # define isALNUM_A isALNUM
4594 #endif
4595
4596 #ifndef isALNUMC_A
4597 # define isALNUMC_A isALNUMC
4598 #endif
4599
4600 #ifndef isALPHA_A
4601 # define isALPHA_A isALPHA
4602 #endif
4603
4604 #ifndef isALPHANUMERIC_A
4605 # define isALPHANUMERIC_A isALPHANUMERIC
4606 #endif
4607
4608 #ifndef isASCII_A
4609 # define isASCII_A isASCII
4610 #endif
4611
4612 #ifndef isBLANK_A
4613 # define isBLANK_A isBLANK
4614 #endif
4615
4616 #ifndef isCNTRL_A
4617 # define isCNTRL_A isCNTRL
4618 #endif
4619
4620 #ifndef isDIGIT_A
4621 # define isDIGIT_A isDIGIT
4622 #endif
4623
4624 #ifndef isGRAPH_A
4625 # define isGRAPH_A isGRAPH
4626 #endif
4627
4628 #ifndef isIDCONT_A
4629 # define isIDCONT_A isIDCONT
4630 #endif
4631
4632 #ifndef isIDFIRST_A
4633 # define isIDFIRST_A isIDFIRST
4634 #endif
4635
4636 #ifndef isLOWER_A
4637 # define isLOWER_A isLOWER
4638 #endif
4639
4640 #ifndef isOCTAL_A
4641 # define isOCTAL_A isOCTAL
4642 #endif
4643
4644 #ifndef isPRINT_A
4645 # define isPRINT_A isPRINT
4646 #endif
4647
4648 #ifndef isPSXSPC_A
4649 # define isPSXSPC_A isPSXSPC
4650 #endif
4651
4652 #ifndef isPUNCT_A
4653 # define isPUNCT_A isPUNCT
4654 #endif
4655
4656 #ifndef isSPACE_A
4657 # define isSPACE_A isSPACE
4658 #endif
4659
4660 #ifndef isUPPER_A
4661 # define isUPPER_A isUPPER
4662 #endif
4663
4664 #ifndef isWORDCHAR_A
4665 # define isWORDCHAR_A isWORDCHAR
4666 #endif
4667
4668 #ifndef isXDIGIT_A
4669 # define isXDIGIT_A isXDIGIT
4670 #endif
4671
4672 /* Until we figure out how to support this in older perls... */
4673 #if (PERL_BCDVERSION >= 0x5008000)
4674 #ifndef HeUTF8
4675 # define HeUTF8(he) ((HeKLEN(he) == HEf_SVKEY) ? \
4676 SvUTF8(HeKEY_sv(he)) : \
4677 (U32)HeKUTF8(he))
4678 #endif
4679
4680 #endif
4681 #ifndef C_ARRAY_LENGTH
4682 # define C_ARRAY_LENGTH(a) (sizeof(a)/sizeof((a)[0]))
4683 #endif
4684
4685 #ifndef C_ARRAY_END
4686 # define C_ARRAY_END(a) ((a) + C_ARRAY_LENGTH(a))
4687 #endif
4688 #ifndef LIKELY
4689 # define LIKELY(x) (x)
4690 #endif
4691
4692 #ifndef UNLIKELY
4693 # define UNLIKELY(x) (x)
4694 #endif
4695 #ifndef UNICODE_REPLACEMENT
4696 # define UNICODE_REPLACEMENT 0xFFFD
4697 #endif
4698
4699 #ifndef MUTABLE_PTR
4700 #if defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN)
4701 # define MUTABLE_PTR(p) ({ void *_p = (p); _p; })
4702 #else
4703 # define MUTABLE_PTR(p) ((void *) (p))
4704 #endif
4705 #endif
4706 #ifndef MUTABLE_SV
4707 # define MUTABLE_SV(p) ((SV *)MUTABLE_PTR(p))
4708 #endif
4709 #ifndef WARN_ALL
4710 # define WARN_ALL 0
4711 #endif
4712
4713 #ifndef WARN_CLOSURE
4714 # define WARN_CLOSURE 1
4715 #endif
4716
4717 #ifndef WARN_DEPRECATED
4718 # define WARN_DEPRECATED 2
4719 #endif
4720
4721 #ifndef WARN_EXITING
4722 # define WARN_EXITING 3
4723 #endif
4724
4725 #ifndef WARN_GLOB
4726 # define WARN_GLOB 4
4727 #endif
4728
4729 #ifndef WARN_IO
4730 # define WARN_IO 5
4731 #endif
4732
4733 #ifndef WARN_CLOSED
4734 # define WARN_CLOSED 6
4735 #endif
4736
4737 #ifndef WARN_EXEC
4738 # define WARN_EXEC 7
4739 #endif
4740
4741 #ifndef WARN_LAYER
4742 # define WARN_LAYER 8
4743 #endif
4744
4745 #ifndef WARN_NEWLINE
4746 # define WARN_NEWLINE 9
4747 #endif
4748
4749 #ifndef WARN_PIPE
4750 # define WARN_PIPE 10
4751 #endif
4752
4753 #ifndef WARN_UNOPENED
4754 # define WARN_UNOPENED 11
4755 #endif
4756
4757 #ifndef WARN_MISC
4758 # define WARN_MISC 12
4759 #endif
4760
4761 #ifndef WARN_NUMERIC
4762 # define WARN_NUMERIC 13
4763 #endif
4764
4765 #ifndef WARN_ONCE
4766 # define WARN_ONCE 14
4767 #endif
4768
4769 #ifndef WARN_OVERFLOW
4770 # define WARN_OVERFLOW 15
4771 #endif
4772
4773 #ifndef WARN_PACK
4774 # define WARN_PACK 16
4775 #endif
4776
4777 #ifndef WARN_PORTABLE
4778 # define WARN_PORTABLE 17
4779 #endif
4780
4781 #ifndef WARN_RECURSION
4782 # define WARN_RECURSION 18
4783 #endif
4784
4785 #ifndef WARN_REDEFINE
4786 # define WARN_REDEFINE 19
4787 #endif
4788
4789 #ifndef WARN_REGEXP
4790 # define WARN_REGEXP 20
4791 #endif
4792
4793 #ifndef WARN_SEVERE
4794 # define WARN_SEVERE 21
4795 #endif
4796
4797 #ifndef WARN_DEBUGGING
4798 # define WARN_DEBUGGING 22
4799 #endif
4800
4801 #ifndef WARN_INPLACE
4802 # define WARN_INPLACE 23
4803 #endif
4804
4805 #ifndef WARN_INTERNAL
4806 # define WARN_INTERNAL 24
4807 #endif
4808
4809 #ifndef WARN_MALLOC
4810 # define WARN_MALLOC 25
4811 #endif
4812
4813 #ifndef WARN_SIGNAL
4814 # define WARN_SIGNAL 26
4815 #endif
4816
4817 #ifndef WARN_SUBSTR
4818 # define WARN_SUBSTR 27
4819 #endif
4820
4821 #ifndef WARN_SYNTAX
4822 # define WARN_SYNTAX 28
4823 #endif
4824
4825 #ifndef WARN_AMBIGUOUS
4826 # define WARN_AMBIGUOUS 29
4827 #endif
4828
4829 #ifndef WARN_BAREWORD
4830 # define WARN_BAREWORD 30
4831 #endif
4832
4833 #ifndef WARN_DIGIT
4834 # define WARN_DIGIT 31
4835 #endif
4836
4837 #ifndef WARN_PARENTHESIS
4838 # define WARN_PARENTHESIS 32
4839 #endif
4840
4841 #ifndef WARN_PRECEDENCE
4842 # define WARN_PRECEDENCE 33
4843 #endif
4844
4845 #ifndef WARN_PRINTF
4846 # define WARN_PRINTF 34
4847 #endif
4848
4849 #ifndef WARN_PROTOTYPE
4850 # define WARN_PROTOTYPE 35
4851 #endif
4852
4853 #ifndef WARN_QW
4854 # define WARN_QW 36
4855 #endif
4856
4857 #ifndef WARN_RESERVED
4858 # define WARN_RESERVED 37
4859 #endif
4860
4861 #ifndef WARN_SEMICOLON
4862 # define WARN_SEMICOLON 38
4863 #endif
4864
4865 #ifndef WARN_TAINT
4866 # define WARN_TAINT 39
4867 #endif
4868
4869 #ifndef WARN_THREADS
4870 # define WARN_THREADS 40
4871 #endif
4872
4873 #ifndef WARN_UNINITIALIZED
4874 # define WARN_UNINITIALIZED 41
4875 #endif
4876
4877 #ifndef WARN_UNPACK
4878 # define WARN_UNPACK 42
4879 #endif
4880
4881 #ifndef WARN_UNTIE
4882 # define WARN_UNTIE 43
4883 #endif
4884
4885 #ifndef WARN_UTF8
4886 # define WARN_UTF8 44
4887 #endif
4888
4889 #ifndef WARN_VOID
4890 # define WARN_VOID 45
4891 #endif
4892
4893 #ifndef WARN_ASSERTIONS
4894 # define WARN_ASSERTIONS 46
4895 #endif
4896 #ifndef packWARN
4897 # define packWARN(a) (a)
4898 #endif
4899
4900 #ifndef ckWARN
4901 # ifdef G_WARN_ON
4902 # define ckWARN(a) (PL_dowarn & G_WARN_ON)
4903 # else
4904 # define ckWARN(a) PL_dowarn
4905 # endif
4906 #endif
4907
4908 #if (PERL_BCDVERSION >= 0x5004000) && !defined(warner)
4909 #if defined(NEED_warner)
4910 static void DPPP_(my_warner)(U32 err, const char *pat, ...);
1314911 static
1324912 #else
133 extern void newCONSTSUB _((HV * stash, char * name, SV *sv));
4913 extern void DPPP_(my_warner)(U32 err, const char *pat, ...);
4914 #endif
4915
4916 #if defined(NEED_warner) || defined(NEED_warner_GLOBAL)
4917
4918 #define Perl_warner DPPP_(my_warner)
4919
4920
4921 void
4922 DPPP_(my_warner)(U32 err, const char *pat, ...)
4923 {
4924 SV *sv;
4925 va_list args;
4926
4927 PERL_UNUSED_ARG(err);
4928
4929 va_start(args, pat);
4930 sv = vnewSVpvf(pat, &args);
4931 va_end(args);
4932 sv_2mortal(sv);
4933 warn("%s", SvPV_nolen(sv));
4934 }
4935
4936 #define warner Perl_warner
4937
4938 #define Perl_warner_nocontext Perl_warner
4939
4940 #endif
4941 #endif
4942
4943 #define _ppport_MIN(a,b) (((a) <= (b)) ? (a) : (b))
4944 #ifndef sv_setuv
4945 # define sv_setuv(sv, uv) \
4946 STMT_START { \
4947 UV TeMpUv = uv; \
4948 if (TeMpUv <= IV_MAX) \
4949 sv_setiv(sv, TeMpUv); \
4950 else \
4951 sv_setnv(sv, (double)TeMpUv); \
4952 } STMT_END
4953 #endif
4954 #ifndef newSVuv
4955 # define newSVuv(uv) ((uv) <= IV_MAX ? newSViv((IV)uv) : newSVnv((NV)uv))
4956 #endif
4957 #ifndef sv_2uv
4958 # define sv_2uv(sv) ((PL_Sv = (sv)), (UV) (SvNOK(PL_Sv) ? SvNV(PL_Sv) : sv_2nv(PL_Sv)))
4959 #endif
4960
4961 #ifndef SvUVX
4962 # define SvUVX(sv) ((UV)SvIVX(sv))
4963 #endif
4964
4965 #ifndef SvUVXx
4966 # define SvUVXx(sv) SvUVX(sv)
4967 #endif
4968
4969 #ifndef SvUV
4970 # define SvUV(sv) (SvIOK(sv) ? SvUVX(sv) : sv_2uv(sv))
4971 #endif
4972
4973 #ifndef SvUVx
4974 # define SvUVx(sv) ((PL_Sv = (sv)), SvUV(PL_Sv))
4975 #endif
4976
4977 /* Hint: sv_uv
4978 * Always use the SvUVx() macro instead of sv_uv().
4979 */
4980 #ifndef sv_uv
4981 # define sv_uv(sv) SvUVx(sv)
4982 #endif
4983
4984 #if !defined(SvUOK) && defined(SvIOK_UV)
4985 # define SvUOK(sv) SvIOK_UV(sv)
4986 #endif
4987 #ifndef XST_mUV
4988 # define XST_mUV(i,v) (ST(i) = sv_2mortal(newSVuv(v)) )
4989 #endif
4990
4991 #ifndef XSRETURN_UV
4992 # define XSRETURN_UV(v) STMT_START { XST_mUV(0,v); XSRETURN(1); } STMT_END
4993 #endif
4994 #ifndef PUSHu
4995 # define PUSHu(u) STMT_START { sv_setuv(TARG, (UV)(u)); PUSHTARG; } STMT_END
4996 #endif
4997
4998 #ifndef XPUSHu
4999 # define XPUSHu(u) STMT_START { sv_setuv(TARG, (UV)(u)); XPUSHTARG; } STMT_END
5000 #endif
5001
5002 #if defined UTF8SKIP
5003
5004 /* Don't use official version because it uses MIN, which may not be available */
5005 #undef UTF8_SAFE_SKIP
5006 #ifndef UTF8_SAFE_SKIP
5007 # define UTF8_SAFE_SKIP(s, e) ( \
5008 ((((e) - (s)) <= 0) \
5009 ? 0 \
5010 : _ppport_MIN(((e) - (s)), UTF8SKIP(s))))
5011 #endif
5012
5013 #endif
5014
5015 #if !defined(my_strnlen)
5016 #if defined(NEED_my_strnlen)
5017 static STRLEN DPPP_(my_my_strnlen)(const char *str, Size_t maxlen);
5018 static
5019 #else
5020 extern STRLEN DPPP_(my_my_strnlen)(const char *str, Size_t maxlen);
5021 #endif
5022
5023 #if defined(NEED_my_strnlen) || defined(NEED_my_strnlen_GLOBAL)
5024
5025 #define my_strnlen DPPP_(my_my_strnlen)
5026 #define Perl_my_strnlen DPPP_(my_my_strnlen)
5027
5028
5029 STRLEN
5030 DPPP_(my_my_strnlen)(const char *str, Size_t maxlen)
5031 {
5032 const char *p = str;
5033
5034 while(maxlen-- && *p)
5035 p++;
5036
5037 return p - str;
5038 }
5039
5040 #endif
5041 #endif
5042
5043 #if (PERL_BCDVERSION < 0x5031002)
5044 /* Versions prior to this accepted things that are now considered
5045 * malformations, and didn't return -1 on error with warnings enabled
5046 * */
5047 # undef utf8_to_uvchr_buf
5048 #endif
5049
5050 /* This implementation brings modern, generally more restricted standards to
5051 * utf8_to_uvchr_buf. Some of these are security related, and clearly must
5052 * be done. But its arguable that the others need not, and hence should not.
5053 * The reason they're here is that a module that intends to play with the
5054 * latest perls shoud be able to work the same in all releases. An example is
5055 * that perl no longer accepts any UV for a code point, but limits them to
5056 * IV_MAX or below. This is for future internal use of the larger code points.
5057 * If it turns out that some of these changes are breaking code that isn't
5058 * intended to work with modern perls, the tighter restrictions could be
5059 * relaxed. khw thinks this is unlikely, but has been wrong in the past. */
5060
5061 #ifndef utf8_to_uvchr_buf
5062 /* Choose which underlying implementation to use. At least one must be
5063 * present or the perl is too early to handle this function */
5064 # if defined(utf8n_to_uvchr) || defined(utf8_to_uv)
5065 # if defined(utf8n_to_uvchr) /* This is the preferred implementation */
5066 # define _ppport_utf8_to_uvchr_buf_callee utf8n_to_uvchr
5067 # else
5068 # define _ppport_utf8_to_uvchr_buf_callee utf8_to_uv
5069 # endif
5070
5071 # endif
5072
5073 #ifdef _ppport_utf8_to_uvchr_buf_callee
5074 # if defined(NEED_utf8_to_uvchr_buf)
5075 static UV DPPP_(my_utf8_to_uvchr_buf)(pTHX_ const U8 * s, const U8 * send, STRLEN * retlen);
5076 static
5077 #else
5078 extern UV DPPP_(my_utf8_to_uvchr_buf)(pTHX_ const U8 * s, const U8 * send, STRLEN * retlen);
5079 #endif
5080
5081 #if defined(NEED_utf8_to_uvchr_buf) || defined(NEED_utf8_to_uvchr_buf_GLOBAL)
5082
5083 #ifdef utf8_to_uvchr_buf
5084 # undef utf8_to_uvchr_buf
5085 #endif
5086 #define utf8_to_uvchr_buf(a,b,c) DPPP_(my_utf8_to_uvchr_buf)(aTHX_ a,b,c)
5087 #define Perl_utf8_to_uvchr_buf DPPP_(my_utf8_to_uvchr_buf)
5088
5089
5090 UV
5091 DPPP_(my_utf8_to_uvchr_buf)(pTHX_ const U8 *s, const U8 *send, STRLEN *retlen)
5092 {
5093 UV ret;
5094 STRLEN curlen;
5095 bool overflows = 0;
5096 const U8 *cur_s = s;
5097 const bool do_warnings = ckWARN_d(WARN_UTF8);
5098
5099 if (send > s) {
5100 curlen = send - s;
5101 }
5102 else {
5103 assert(0); /* Modern perls die under this circumstance */
5104 curlen = 0;
5105 if (! do_warnings) { /* Handle empty here if no warnings needed */
5106 if (retlen) *retlen = 0;
5107 return UNICODE_REPLACEMENT;
5108 }
5109 }
5110
5111 /* The modern version allows anything that evaluates to a legal UV, but not
5112 * overlongs nor an empty input */
5113 ret = _ppport_utf8_to_uvchr_buf_callee(
5114 s, curlen, retlen, (UTF8_ALLOW_ANYUV
5115 & ~(UTF8_ALLOW_LONG|UTF8_ALLOW_EMPTY)));
5116
5117 /* But actually, modern versions restrict the UV to being no more than what
5118 * an IV can hold */
5119 if (ret > PERL_INT_MAX) {
5120 overflows = 1;
5121 }
5122
5123 # if (PERL_BCDVERSION < 0x5026000)
5124 # ifndef EBCDIC
5125
5126 /* There are bugs in versions earlier than this on non-EBCDIC platforms
5127 * in which it did not detect all instances of overflow, which could be
5128 * a security hole. Also, earlier versions did not allow the overflow
5129 * malformation under any circumstances, and modern ones do. So we
5130 * need to check here. */
5131
5132 else if (curlen > 0 && *s >= 0xFE) {
5133
5134 /* If the main routine detected overflow, great; it returned 0. But if the
5135 * input's first byte indicates it could overflow, we need to verify.
5136 * First, on a 32-bit machine the first byte being at least \xFE
5137 * automatically is overflow */
5138 if (sizeof(ret) < 8) {
5139 overflows = 1;
5140 }
5141 else {
5142 const U8 highest[] = /* 2*63-1 */
5143 "\xFF\x80\x87\xBF\xBF\xBF\xBF\xBF\xBF\xBF\xBF\xBF\xBF";
5144 const U8 *cur_h = highest;
5145
5146 for (cur_s = s; cur_s < send; cur_s++, cur_h++) {
5147 if (UNLIKELY(*cur_s == *cur_h)) {
5148 continue;
5149 }
5150
5151 /* If this byte is larger than the corresponding highest UTF-8
5152 * byte, the sequence overflows; otherwise the byte is less than
5153 * (as we handled the equality case above), and so the sequence
5154 * doesn't overflow */
5155 overflows = *cur_s > *cur_h;
5156 break;
5157
5158 }
5159
5160 /* Here, either we set the bool and broke out of the loop, or got
5161 * to the end and all bytes are the same which indicates it doesn't
5162 * overflow. */
5163 }
5164 }
5165
5166 # endif
5167 # endif /* < 5.26 */
5168
5169 if (UNLIKELY(overflows)) {
5170 if (! do_warnings) {
5171 if (retlen) {
5172 *retlen = _ppport_MIN(*retlen, UTF8SKIP(s));
5173 *retlen = _ppport_MIN(*retlen, curlen);
5174 }
5175 return UNICODE_REPLACEMENT;
5176 }
5177 else {
5178
5179 /* On versions that correctly detect overflow, but forbid it
5180 * always, 0 will be returned, but also a warning will have been
5181 * raised. Don't repeat it */
5182 if (ret != 0) {
5183 /* We use the error message in use from 5.8-5.14 */
5184 Perl_warner(aTHX_ packWARN(WARN_UTF8),
5185 "Malformed UTF-8 character (overflow at 0x%" UVxf
5186 ", byte 0x%02x, after start byte 0x%02x)",
5187 ret, *cur_s, *s);
5188 }
5189 if (retlen) {
5190 *retlen = (STRLEN) -1;
5191 }
5192 return 0;
5193 }
5194 }
5195
5196 /* If failed and warnings are off, to emulate the behavior of the real
5197 * utf8_to_uvchr(), try again, allowing anything. (Note a return of 0 is
5198 * ok if the input was '\0') */
5199 if (UNLIKELY(ret == 0 && (curlen == 0 || *s != '\0'))) {
5200
5201 /* If curlen is 0, we already handled the case where warnings are
5202 * disabled, so this 'if' will be true, and we won't look at the
5203 * contents of 's' */
5204 if (do_warnings) {
5205 *retlen = (STRLEN) -1;
5206 }
5207 else {
5208 ret = _ppport_utf8_to_uvchr_buf_callee(
5209 s, curlen, retlen, UTF8_ALLOW_ANY);
5210 /* Override with the REPLACEMENT character, as that is what the
5211 * modern version of this function returns */
5212 ret = UNICODE_REPLACEMENT;
5213
5214 # if (PERL_BCDVERSION < 0x5016000)
5215
5216 /* Versions earlier than this don't necessarily return the proper
5217 * length. It should not extend past the end of string, nor past
5218 * what the first byte indicates the length is, nor past the
5219 * continuation characters */
5220 if (retlen && *retlen >= 0) {
5221 *retlen = _ppport_MIN(*retlen, curlen);
5222 *retlen = _ppport_MIN(*retlen, UTF8SKIP(s));
5223 unsigned int i = 1;
5224 do {
5225 if (s[i] < 0x80 || s[i] > 0xBF) {
5226 *retlen = i;
5227 break;
5228 }
5229 } while (++i < *retlen);
5230 }
5231
5232 # endif
5233
5234 }
5235 }
5236
5237 return ret;
5238 }
5239
5240 # endif
5241 #endif
5242 #endif
5243
5244 #if defined(UTF8SKIP) && defined(utf8_to_uvchr_buf)
5245 #undef utf8_to_uvchr /* Always redefine this unsafe function so that it refuses
5246 to read past a NUL, making it much less likely to read
5247 off the end of the buffer. A NUL indicates the start
5248 of the next character anyway. If the input isn't
5249 NUL-terminated, the function remains unsafe, as it
5250 always has been. */
5251 #ifndef utf8_to_uvchr
5252 # define utf8_to_uvchr(s, lp) \
5253 ((*(s) == '\0') \
5254 ? utf8_to_uvchr_buf(s,((s)+1), lp) /* Handle single NUL specially */ \
5255 : utf8_to_uvchr_buf(s, (s) + my_strnlen((char *) (s), UTF8SKIP(s)), (lp)))
5256 #endif
5257
5258 #endif
5259
5260 #ifdef HAS_MEMCMP
5261 #ifndef memNE
5262 # define memNE(s1,s2,l) (memcmp(s1,s2,l))
5263 #endif
5264
5265 #ifndef memEQ
5266 # define memEQ(s1,s2,l) (!memcmp(s1,s2,l))
5267 #endif
5268
5269 #else
5270 #ifndef memNE
5271 # define memNE(s1,s2,l) (bcmp(s1,s2,l))
5272 #endif
5273
5274 #ifndef memEQ
5275 # define memEQ(s1,s2,l) (!bcmp(s1,s2,l))
5276 #endif
5277
5278 #endif
5279 #ifndef memEQs
5280 # define memEQs(s1, l, s2) \
5281 (sizeof(s2)-1 == l && memEQ(s1, (s2 ""), (sizeof(s2)-1)))
5282 #endif
5283
5284 #ifndef memNEs
5285 # define memNEs(s1, l, s2) !memEQs(s1, l, s2)
5286 #endif
5287 #ifndef MoveD
5288 # define MoveD(s,d,n,t) memmove((char*)(d),(char*)(s), (n) * sizeof(t))
5289 #endif
5290
5291 #ifndef CopyD
5292 # define CopyD(s,d,n,t) memcpy((char*)(d),(char*)(s), (n) * sizeof(t))
5293 #endif
5294
5295 #ifdef HAS_MEMSET
5296 #ifndef ZeroD
5297 # define ZeroD(d,n,t) memzero((char*)(d), (n) * sizeof(t))
5298 #endif
5299
5300 #else
5301 #ifndef ZeroD
5302 # define ZeroD(d,n,t) ((void)memzero((char*)(d), (n) * sizeof(t)), d)
5303 #endif
5304
5305 #endif
5306 #ifndef PoisonWith
5307 # define PoisonWith(d,n,t,b) (void)memset((char*)(d), (U8)(b), (n) * sizeof(t))
5308 #endif
5309
5310 #ifndef PoisonNew
5311 # define PoisonNew(d,n,t) PoisonWith(d,n,t,0xAB)
5312 #endif
5313
5314 #ifndef PoisonFree
5315 # define PoisonFree(d,n,t) PoisonWith(d,n,t,0xEF)
5316 #endif
5317
5318 #ifndef Poison
5319 # define Poison(d,n,t) PoisonFree(d,n,t)
5320 #endif
5321 #ifndef Newx
5322 # define Newx(v,n,t) New(0,v,n,t)
5323 #endif
5324
5325 #ifndef Newxc
5326 # define Newxc(v,n,t,c) Newc(0,v,n,t,c)
5327 #endif
5328
5329 #ifndef Newxz
5330 # define Newxz(v,n,t) Newz(0,v,n,t)
5331 #endif
5332 #ifndef PERL_MAGIC_sv
5333 # define PERL_MAGIC_sv '\0'
5334 #endif
5335
5336 #ifndef PERL_MAGIC_overload
5337 # define PERL_MAGIC_overload 'A'
5338 #endif
5339
5340 #ifndef PERL_MAGIC_overload_elem
5341 # define PERL_MAGIC_overload_elem 'a'
5342 #endif
5343
5344 #ifndef PERL_MAGIC_overload_table
5345 # define PERL_MAGIC_overload_table 'c'
5346 #endif
5347
5348 #ifndef PERL_MAGIC_bm
5349 # define PERL_MAGIC_bm 'B'
5350 #endif
5351
5352 #ifndef PERL_MAGIC_regdata
5353 # define PERL_MAGIC_regdata 'D'
5354 #endif
5355
5356 #ifndef PERL_MAGIC_regdatum
5357 # define PERL_MAGIC_regdatum 'd'
5358 #endif
5359
5360 #ifndef PERL_MAGIC_env
5361 # define PERL_MAGIC_env 'E'
5362 #endif
5363
5364 #ifndef PERL_MAGIC_envelem
5365 # define PERL_MAGIC_envelem 'e'
5366 #endif
5367
5368 #ifndef PERL_MAGIC_fm
5369 # define PERL_MAGIC_fm 'f'
5370 #endif
5371
5372 #ifndef PERL_MAGIC_regex_global
5373 # define PERL_MAGIC_regex_global 'g'
5374 #endif
5375
5376 #ifndef PERL_MAGIC_isa
5377 # define PERL_MAGIC_isa 'I'
5378 #endif
5379
5380 #ifndef PERL_MAGIC_isaelem
5381 # define PERL_MAGIC_isaelem 'i'
5382 #endif
5383
5384 #ifndef PERL_MAGIC_nkeys
5385 # define PERL_MAGIC_nkeys 'k'
5386 #endif
5387
5388 #ifndef PERL_MAGIC_dbfile
5389 # define PERL_MAGIC_dbfile 'L'
5390 #endif
5391
5392 #ifndef PERL_MAGIC_dbline
5393 # define PERL_MAGIC_dbline 'l'
5394 #endif
5395
5396 #ifndef PERL_MAGIC_mutex
5397 # define PERL_MAGIC_mutex 'm'
5398 #endif
5399
5400 #ifndef PERL_MAGIC_shared
5401 # define PERL_MAGIC_shared 'N'
5402 #endif
5403
5404 #ifndef PERL_MAGIC_shared_scalar
5405 # define PERL_MAGIC_shared_scalar 'n'
5406 #endif
5407
5408 #ifndef PERL_MAGIC_collxfrm
5409 # define PERL_MAGIC_collxfrm 'o'
5410 #endif
5411
5412 #ifndef PERL_MAGIC_tied
5413 # define PERL_MAGIC_tied 'P'
5414 #endif
5415
5416 #ifndef PERL_MAGIC_tiedelem
5417 # define PERL_MAGIC_tiedelem 'p'
5418 #endif
5419
5420 #ifndef PERL_MAGIC_tiedscalar
5421 # define PERL_MAGIC_tiedscalar 'q'
5422 #endif
5423
5424 #ifndef PERL_MAGIC_qr
5425 # define PERL_MAGIC_qr 'r'
5426 #endif
5427
5428 #ifndef PERL_MAGIC_sig
5429 # define PERL_MAGIC_sig 'S'
5430 #endif
5431
5432 #ifndef PERL_MAGIC_sigelem
5433 # define PERL_MAGIC_sigelem 's'
5434 #endif
5435
5436 #ifndef PERL_MAGIC_taint
5437 # define PERL_MAGIC_taint 't'
5438 #endif
5439
5440 #ifndef PERL_MAGIC_uvar
5441 # define PERL_MAGIC_uvar 'U'
5442 #endif
5443
5444 #ifndef PERL_MAGIC_uvar_elem
5445 # define PERL_MAGIC_uvar_elem 'u'
5446 #endif
5447
5448 #ifndef PERL_MAGIC_vstring
5449 # define PERL_MAGIC_vstring 'V'
5450 #endif
5451
5452 #ifndef PERL_MAGIC_vec
5453 # define PERL_MAGIC_vec 'v'
5454 #endif
5455
5456 #ifndef PERL_MAGIC_utf8
5457 # define PERL_MAGIC_utf8 'w'
5458 #endif
5459
5460 #ifndef PERL_MAGIC_substr
5461 # define PERL_MAGIC_substr 'x'
5462 #endif
5463
5464 #ifndef PERL_MAGIC_defelem
5465 # define PERL_MAGIC_defelem 'y'
5466 #endif
5467
5468 #ifndef PERL_MAGIC_glob
5469 # define PERL_MAGIC_glob '*'
5470 #endif
5471
5472 #ifndef PERL_MAGIC_arylen
5473 # define PERL_MAGIC_arylen '#'
5474 #endif
5475
5476 #ifndef PERL_MAGIC_pos
5477 # define PERL_MAGIC_pos '.'
5478 #endif
5479
5480 #ifndef PERL_MAGIC_backref
5481 # define PERL_MAGIC_backref '<'
5482 #endif
5483
5484 #ifndef PERL_MAGIC_ext
5485 # define PERL_MAGIC_ext '~'
5486 #endif
5487
5488 #ifdef NEED_mess_sv
5489 #define NEED_mess
5490 #endif
5491
5492 #ifdef NEED_mess
5493 #define NEED_mess_nocontext
5494 #define NEED_vmess
5495 #endif
5496
5497 #ifndef croak_sv
5498 #if (PERL_BCDVERSION >= 0x5007003) || ( (PERL_BCDVERSION >= 0x5006001) && (PERL_BCDVERSION < 0x5007000) )
5499 # if ( (PERL_BCDVERSION >= 0x5008000) && (PERL_BCDVERSION < 0x5008009) ) || ( (PERL_BCDVERSION >= 0x5009000) && (PERL_BCDVERSION < 0x5010001) )
5500 # define D_PPP_FIX_UTF8_ERRSV(errsv, sv) \
5501 STMT_START { \
5502 if (sv != errsv) \
5503 SvFLAGS(errsv) = (SvFLAGS(errsv) & ~SVf_UTF8) | \
5504 (SvFLAGS(sv) & SVf_UTF8); \
5505 } STMT_END
5506 # else
5507 # define D_PPP_FIX_UTF8_ERRSV(errsv, sv) STMT_START {} STMT_END
5508 # endif
5509 # define croak_sv(sv) \
5510 STMT_START { \
5511 if (SvROK(sv)) { \
5512 sv_setsv(ERRSV, sv); \
5513 croak(NULL); \
5514 } else { \
5515 D_PPP_FIX_UTF8_ERRSV(ERRSV, sv); \
5516 croak("%" SVf, SVfARG(sv)); \
5517 } \
5518 } STMT_END
5519 #elif (PERL_BCDVERSION >= 0x5004000)
5520 # define croak_sv(sv) croak("%" SVf, SVfARG(sv))
5521 #else
5522 # define croak_sv(sv) croak("%s", SvPV_nolen(sv))
5523 #endif
5524 #endif
5525
5526 #ifndef die_sv
5527 #if defined(NEED_die_sv)
5528 static OP * DPPP_(my_die_sv)(pTHX_ SV *sv);
5529 static
5530 #else
5531 extern OP * DPPP_(my_die_sv)(pTHX_ SV *sv);
5532 #endif
5533
5534 #if defined(NEED_die_sv) || defined(NEED_die_sv_GLOBAL)
5535
5536 #ifdef die_sv
5537 # undef die_sv
5538 #endif
5539 #define die_sv(a) DPPP_(my_die_sv)(aTHX_ a)
5540 #define Perl_die_sv DPPP_(my_die_sv)
5541
5542 OP *
5543 DPPP_(my_die_sv)(pTHX_ SV *sv)
5544 {
5545 croak_sv(sv);
5546 return (OP *)NULL;
5547 }
5548 #endif
5549 #endif
5550
5551 #ifndef warn_sv
5552 #if (PERL_BCDVERSION >= 0x5004000)
5553 # define warn_sv(sv) warn("%" SVf, SVfARG(sv))
5554 #else
5555 # define warn_sv(sv) warn("%s", SvPV_nolen(sv))
5556 #endif
5557 #endif
5558
5559 #ifndef vmess
5560 #if defined(NEED_vmess)
5561 static SV * DPPP_(my_vmess)(pTHX_ const char * pat, va_list * args);
5562 static
5563 #else
5564 extern SV * DPPP_(my_vmess)(pTHX_ const char * pat, va_list * args);
5565 #endif
5566
5567 #if defined(NEED_vmess) || defined(NEED_vmess_GLOBAL)
5568
5569 #ifdef vmess
5570 # undef vmess
5571 #endif
5572 #define vmess(a,b) DPPP_(my_vmess)(aTHX_ a,b)
5573 #define Perl_vmess DPPP_(my_vmess)
5574
5575 SV*
5576 DPPP_(my_vmess)(pTHX_ const char* pat, va_list* args)
5577 {
5578 mess(pat, args);
5579 return PL_mess_sv;
5580 }
5581 #endif
5582 #endif
5583
5584 #if (PERL_BCDVERSION < 0x5006000)
5585 #undef mess
5586 #endif
5587
5588 #if !defined(mess_nocontext) && !defined(Perl_mess_nocontext)
5589 #if defined(NEED_mess_nocontext)
5590 static SV * DPPP_(my_mess_nocontext)(const char * pat, ...);
5591 static
5592 #else
5593 extern SV * DPPP_(my_mess_nocontext)(const char * pat, ...);
5594 #endif
5595
5596 #if defined(NEED_mess_nocontext) || defined(NEED_mess_nocontext_GLOBAL)
5597
5598 #define mess_nocontext DPPP_(my_mess_nocontext)
5599 #define Perl_mess_nocontext DPPP_(my_mess_nocontext)
5600
5601 SV*
5602 DPPP_(my_mess_nocontext)(const char* pat, ...)
5603 {
5604 dTHX;
5605 SV *sv;
5606 va_list args;
5607 va_start(args, pat);
5608 sv = vmess(pat, &args);
5609 va_end(args);
5610 return sv;
5611 }
5612 #endif
5613 #endif
5614
5615 #ifndef mess
5616 #if defined(NEED_mess)
5617 static SV * DPPP_(my_mess)(pTHX_ const char * pat, ...);
5618 static
5619 #else
5620 extern SV * DPPP_(my_mess)(pTHX_ const char * pat, ...);
5621 #endif
5622
5623 #if defined(NEED_mess) || defined(NEED_mess_GLOBAL)
5624
5625 #define Perl_mess DPPP_(my_mess)
5626
5627 SV*
5628 DPPP_(my_mess)(pTHX_ const char* pat, ...)
5629 {
5630 SV *sv;
5631 va_list args;
5632 va_start(args, pat);
5633 sv = vmess(pat, &args);
5634 va_end(args);
5635 return sv;
5636 }
5637 #ifdef mess_nocontext
5638 #define mess mess_nocontext
5639 #else
5640 #define mess Perl_mess_nocontext
5641 #endif
5642 #endif
5643 #endif
5644
5645 #ifndef mess_sv
5646 #if defined(NEED_mess_sv)
5647 static SV * DPPP_(my_mess_sv)(pTHX_ SV * basemsg, bool consume);
5648 static
5649 #else
5650 extern SV * DPPP_(my_mess_sv)(pTHX_ SV * basemsg, bool consume);
5651 #endif
5652
5653 #if defined(NEED_mess_sv) || defined(NEED_mess_sv_GLOBAL)
5654
5655 #ifdef mess_sv
5656 # undef mess_sv
5657 #endif
5658 #define mess_sv(a,b) DPPP_(my_mess_sv)(aTHX_ a,b)
5659 #define Perl_mess_sv DPPP_(my_mess_sv)
5660
5661 SV *
5662 DPPP_(my_mess_sv)(pTHX_ SV *basemsg, bool consume)
5663 {
5664 SV *tmp;
5665 SV *ret;
5666
5667 if (SvPOK(basemsg) && SvCUR(basemsg) && *(SvEND(basemsg)-1) == '\n') {
5668 if (consume)
5669 return basemsg;
5670 ret = mess("");
5671 SvSetSV_nosteal(ret, basemsg);
5672 return ret;
5673 }
5674
5675 if (consume) {
5676 sv_catsv(basemsg, mess(""));
5677 return basemsg;
5678 }
5679
5680 ret = mess("");
5681 tmp = newSVsv(ret);
5682 SvSetSV_nosteal(ret, basemsg);
5683 sv_catsv(ret, tmp);
5684 sv_dec(tmp);
5685 return ret;
5686 }
5687 #endif
5688 #endif
5689
5690 #ifndef warn_nocontext
5691 #define warn_nocontext warn
5692 #endif
5693
5694 #ifndef croak_nocontext
5695 #define croak_nocontext croak
5696 #endif
5697
5698 #ifndef croak_no_modify
5699 #define croak_no_modify() croak_nocontext("%s", PL_no_modify)
5700 #define Perl_croak_no_modify() croak_no_modify()
5701 #endif
5702
5703 #ifndef croak_memory_wrap
5704 #if (PERL_BCDVERSION >= 0x5009002) || ( (PERL_BCDVERSION >= 0x5008006) && (PERL_BCDVERSION < 0x5009000) )
5705 # define croak_memory_wrap() croak_nocontext("%s", PL_memory_wrap)
5706 #else
5707 # define croak_memory_wrap() croak_nocontext("panic: memory wrap")
5708 #endif
5709 #endif
5710
5711 #ifndef croak_xs_usage
5712 #if defined(NEED_croak_xs_usage)
5713 static void DPPP_(my_croak_xs_usage)(const CV * const cv, const char * const params);
5714 static
5715 #else
5716 extern void DPPP_(my_croak_xs_usage)(const CV * const cv, const char * const params);
5717 #endif
5718
5719 #if defined(NEED_croak_xs_usage) || defined(NEED_croak_xs_usage_GLOBAL)
5720
5721 #define croak_xs_usage DPPP_(my_croak_xs_usage)
5722 #define Perl_croak_xs_usage DPPP_(my_croak_xs_usage)
5723
5724
5725 #ifndef PERL_ARGS_ASSERT_CROAK_XS_USAGE
5726 #define PERL_ARGS_ASSERT_CROAK_XS_USAGE assert(cv); assert(params)
5727 #endif
5728
5729 void
5730 DPPP_(my_croak_xs_usage)(const CV *const cv, const char *const params)
5731 {
5732 dTHX;
5733 const GV *const gv = CvGV(cv);
5734
5735 PERL_ARGS_ASSERT_CROAK_XS_USAGE;
5736
5737 if (gv) {
5738 const char *const gvname = GvNAME(gv);
5739 const HV *const stash = GvSTASH(gv);
5740 const char *const hvname = stash ? HvNAME(stash) : NULL;
5741
5742 if (hvname)
5743 croak("Usage: %s::%s(%s)", hvname, gvname, params);
5744 else
5745 croak("Usage: %s(%s)", gvname, params);
5746 } else {
5747 /* Pants. I don't think that it should be possible to get here. */
5748 croak("Usage: CODE(0x%" UVxf ")(%s)", PTR2UV(cv), params);
5749 }
5750 }
5751 #endif
5752 #endif
5753
5754 #ifndef PERL_SIGNALS_UNSAFE_FLAG
5755
5756 #define PERL_SIGNALS_UNSAFE_FLAG 0x0001
5757
5758 #if (PERL_BCDVERSION < 0x5008000)
5759 # define D_PPP_PERL_SIGNALS_INIT PERL_SIGNALS_UNSAFE_FLAG
5760 #else
5761 # define D_PPP_PERL_SIGNALS_INIT 0
5762 #endif
5763
5764 #if defined(NEED_PL_signals)
5765 static U32 DPPP_(my_PL_signals) = D_PPP_PERL_SIGNALS_INIT;
5766 #elif defined(NEED_PL_signals_GLOBAL)
5767 U32 DPPP_(my_PL_signals) = D_PPP_PERL_SIGNALS_INIT;
5768 #else
5769 extern U32 DPPP_(my_PL_signals);
5770 #endif
5771 #define PL_signals DPPP_(my_PL_signals)
5772
5773 #endif
5774
5775 /* Hint: PL_ppaddr
5776 * Calling an op via PL_ppaddr requires passing a context argument
5777 * for threaded builds. Since the context argument is different for
5778 * 5.005 perls, you can use aTHXR (supplied by ppport.h), which will
5779 * automatically be defined as the correct argument.
5780 */
5781
5782 #if (PERL_BCDVERSION <= 0x5005005)
5783 /* Replace: 1 */
5784 # define PL_ppaddr ppaddr
5785 # define PL_no_modify no_modify
5786 /* Replace: 0 */
5787 #endif
5788
5789 #if (PERL_BCDVERSION <= 0x5004005)
5790 /* Replace: 1 */
5791 # define PL_DBsignal DBsignal
5792 # define PL_DBsingle DBsingle
5793 # define PL_DBsub DBsub
5794 # define PL_DBtrace DBtrace
5795 # define PL_Sv Sv
5796 # define PL_bufend bufend
5797 # define PL_bufptr bufptr
5798 # define PL_compiling compiling
5799 # define PL_copline copline
5800 # define PL_curcop curcop
5801 # define PL_curstash curstash
5802 # define PL_debstash debstash
5803 # define PL_defgv defgv
5804 # define PL_diehook diehook
5805 # define PL_dirty dirty
5806 # define PL_dowarn dowarn
5807 # define PL_errgv errgv
5808 # define PL_error_count error_count
5809 # define PL_expect expect
5810 # define PL_hexdigit hexdigit
5811 # define PL_hints hints
5812 # define PL_in_my in_my
5813 # define PL_laststatval laststatval
5814 # define PL_lex_state lex_state
5815 # define PL_lex_stuff lex_stuff
5816 # define PL_linestr linestr
5817 # define PL_na na
5818 # define PL_perl_destruct_level perl_destruct_level
5819 # define PL_perldb perldb
5820 # define PL_rsfp_filters rsfp_filters
5821 # define PL_rsfp rsfp
5822 # define PL_stack_base stack_base
5823 # define PL_stack_sp stack_sp
5824 # define PL_statcache statcache
5825 # define PL_stdingv stdingv
5826 # define PL_sv_arenaroot sv_arenaroot
5827 # define PL_sv_no sv_no
5828 # define PL_sv_undef sv_undef
5829 # define PL_sv_yes sv_yes
5830 # define PL_tainted tainted
5831 # define PL_tainting tainting
5832 # define PL_tokenbuf tokenbuf
5833 /* Replace: 0 */
5834 #endif
5835
5836 /* Warning: PL_parser
5837 * For perl versions earlier than 5.9.5, this is an always
5838 * non-NULL dummy. Also, it cannot be dereferenced. Don't
5839 * use it if you can avoid is and unless you absolutely know
5840 * what you're doing.
5841 * If you always check that PL_parser is non-NULL, you can
5842 * define DPPP_PL_parser_NO_DUMMY to avoid the creation of
5843 * a dummy parser structure.
5844 */
5845
5846 #if (PERL_BCDVERSION >= 0x5009005)
5847 # ifdef DPPP_PL_parser_NO_DUMMY
5848 # define D_PPP_my_PL_parser_var(var) ((PL_parser ? PL_parser : \
5849 (croak("panic: PL_parser == NULL in %s:%d", \
5850 __FILE__, __LINE__), (yy_parser *) NULL))->var)
5851 # else
5852 # ifdef DPPP_PL_parser_NO_DUMMY_WARNING
5853 # define D_PPP_parser_dummy_warning(var)
5854 # else
5855 # define D_PPP_parser_dummy_warning(var) \
5856 warn("warning: dummy PL_" #var " used in %s:%d", __FILE__, __LINE__),
5857 # endif
5858 # define D_PPP_my_PL_parser_var(var) ((PL_parser ? PL_parser : \
5859 (D_PPP_parser_dummy_warning(var) &DPPP_(dummy_PL_parser)))->var)
5860 #if defined(NEED_PL_parser)
5861 static yy_parser DPPP_(dummy_PL_parser);
5862 #elif defined(NEED_PL_parser_GLOBAL)
5863 yy_parser DPPP_(dummy_PL_parser);
5864 #else
5865 extern yy_parser DPPP_(dummy_PL_parser);
5866 #endif
5867
5868 # endif
5869
5870 /* PL_expect, PL_copline, PL_rsfp, PL_rsfp_filters, PL_linestr, PL_bufptr, PL_bufend, PL_lex_state, PL_lex_stuff, PL_tokenbuf depends on PL_parser */
5871 /* Warning: PL_expect, PL_copline, PL_rsfp, PL_rsfp_filters, PL_linestr, PL_bufptr, PL_bufend, PL_lex_state, PL_lex_stuff, PL_tokenbuf
5872 * Do not use this variable unless you know exactly what you're
5873 * doing. It is internal to the perl parser and may change or even
5874 * be removed in the future. As of perl 5.9.5, you have to check
5875 * for (PL_parser != NULL) for this variable to have any effect.
5876 * An always non-NULL PL_parser dummy is provided for earlier
5877 * perl versions.
5878 * If PL_parser is NULL when you try to access this variable, a
5879 * dummy is being accessed instead and a warning is issued unless
5880 * you define DPPP_PL_parser_NO_DUMMY_WARNING.
5881 * If DPPP_PL_parser_NO_DUMMY is defined, the code trying to access
5882 * this variable will croak with a panic message.
5883 */
5884
5885 # define PL_expect D_PPP_my_PL_parser_var(expect)
5886 # define PL_copline D_PPP_my_PL_parser_var(copline)
5887 # define PL_rsfp D_PPP_my_PL_parser_var(rsfp)
5888 # define PL_rsfp_filters D_PPP_my_PL_parser_var(rsfp_filters)
5889 # define PL_linestr D_PPP_my_PL_parser_var(linestr)
5890 # define PL_bufptr D_PPP_my_PL_parser_var(bufptr)
5891 # define PL_bufend D_PPP_my_PL_parser_var(bufend)
5892 # define PL_lex_state D_PPP_my_PL_parser_var(lex_state)
5893 # define PL_lex_stuff D_PPP_my_PL_parser_var(lex_stuff)
5894 # define PL_tokenbuf D_PPP_my_PL_parser_var(tokenbuf)
5895 # define PL_in_my D_PPP_my_PL_parser_var(in_my)
5896 # define PL_in_my_stash D_PPP_my_PL_parser_var(in_my_stash)
5897 # define PL_error_count D_PPP_my_PL_parser_var(error_count)
5898
5899
5900 #else
5901
5902 /* ensure that PL_parser != NULL and cannot be dereferenced */
5903 # define PL_parser ((void *) 1)
5904
5905 #endif
5906 #ifndef mPUSHs
5907 # define mPUSHs(s) PUSHs(sv_2mortal(s))
5908 #endif
5909
5910 #ifndef PUSHmortal
5911 # define PUSHmortal PUSHs(sv_newmortal())
5912 #endif
5913
5914 #ifndef mPUSHp
5915 # define mPUSHp(p,l) sv_setpvn(PUSHmortal, (p), (l))
5916 #endif
5917
5918 #ifndef mPUSHn
5919 # define mPUSHn(n) sv_setnv(PUSHmortal, (NV)(n))
5920 #endif
5921
5922 #ifndef mPUSHi
5923 # define mPUSHi(i) sv_setiv(PUSHmortal, (IV)(i))
5924 #endif
5925
5926 #ifndef mPUSHu
5927 # define mPUSHu(u) sv_setuv(PUSHmortal, (UV)(u))
5928 #endif
5929 #ifndef mXPUSHs
5930 # define mXPUSHs(s) XPUSHs(sv_2mortal(s))
5931 #endif
5932
5933 #ifndef XPUSHmortal
5934 # define XPUSHmortal XPUSHs(sv_newmortal())
5935 #endif
5936
5937 #ifndef mXPUSHp
5938 # define mXPUSHp(p,l) STMT_START { EXTEND(sp,1); sv_setpvn(PUSHmortal, (p), (l)); } STMT_END
5939 #endif
5940
5941 #ifndef mXPUSHn
5942 # define mXPUSHn(n) STMT_START { EXTEND(sp,1); sv_setnv(PUSHmortal, (NV)(n)); } STMT_END
5943 #endif
5944
5945 #ifndef mXPUSHi
5946 # define mXPUSHi(i) STMT_START { EXTEND(sp,1); sv_setiv(PUSHmortal, (IV)(i)); } STMT_END
5947 #endif
5948
5949 #ifndef mXPUSHu
5950 # define mXPUSHu(u) STMT_START { EXTEND(sp,1); sv_setuv(PUSHmortal, (UV)(u)); } STMT_END
5951 #endif
5952
5953 /* Replace: 1 */
5954 #ifndef call_sv
5955 # define call_sv perl_call_sv
5956 #endif
5957
5958 #ifndef call_pv
5959 # define call_pv perl_call_pv
5960 #endif
5961
5962 #ifndef call_argv
5963 # define call_argv perl_call_argv
5964 #endif
5965
5966 #ifndef call_method
5967 # define call_method perl_call_method
5968 #endif
5969 #ifndef eval_sv
5970 # define eval_sv perl_eval_sv
5971 #endif
5972
5973 /* Replace: 0 */
5974 #ifndef PERL_LOADMOD_DENY
5975 # define PERL_LOADMOD_DENY 0x1
5976 #endif
5977
5978 #ifndef PERL_LOADMOD_NOIMPORT
5979 # define PERL_LOADMOD_NOIMPORT 0x2
5980 #endif
5981
5982 #ifndef PERL_LOADMOD_IMPORT_OPS
5983 # define PERL_LOADMOD_IMPORT_OPS 0x4
5984 #endif
5985
5986 #ifndef G_METHOD
5987 # define G_METHOD 64
5988 # ifdef call_sv
5989 # undef call_sv
5990 # endif
5991 # if (PERL_BCDVERSION < 0x5006000)
5992 # define call_sv(sv, flags) ((flags) & G_METHOD ? perl_call_method((char *) SvPV_nolen_const(sv), \
5993 (flags) & ~G_METHOD) : perl_call_sv(sv, flags))
5994 # else
5995 # define call_sv(sv, flags) ((flags) & G_METHOD ? Perl_call_method(aTHX_ (char *) SvPV_nolen_const(sv), \
5996 (flags) & ~G_METHOD) : Perl_call_sv(aTHX_ sv, flags))
5997 # endif
5998 #endif
5999
6000 /* Replace perl_eval_pv with eval_pv */
6001
6002 #ifndef eval_pv
6003 #if defined(NEED_eval_pv)
6004 static SV* DPPP_(my_eval_pv)(char *p, I32 croak_on_error);
6005 static
6006 #else
6007 extern SV* DPPP_(my_eval_pv)(char *p, I32 croak_on_error);
6008 #endif
6009
6010 #if defined(NEED_eval_pv) || defined(NEED_eval_pv_GLOBAL)
6011
6012 #ifdef eval_pv
6013 # undef eval_pv
6014 #endif
6015 #define eval_pv(a,b) DPPP_(my_eval_pv)(aTHX_ a,b)
6016 #define Perl_eval_pv DPPP_(my_eval_pv)
6017
6018
6019 SV*
6020 DPPP_(my_eval_pv)(char *p, I32 croak_on_error)
6021 {
6022 dSP;
6023 SV* sv = newSVpv(p, 0);
6024
6025 PUSHMARK(sp);
6026 eval_sv(sv, G_SCALAR);
6027 SvREFCNT_dec(sv);
6028
6029 SPAGAIN;
6030 sv = POPs;
6031 PUTBACK;
6032
6033 if (croak_on_error && SvTRUEx(ERRSV))
6034 croak_sv(ERRSV);
6035
6036 return sv;
6037 }
6038
6039 #endif
6040 #endif
6041
6042 #ifndef vload_module
6043 #if defined(NEED_vload_module)
6044 static void DPPP_(my_vload_module)(U32 flags, SV *name, SV *ver, va_list *args);
6045 static
6046 #else
6047 extern void DPPP_(my_vload_module)(U32 flags, SV *name, SV *ver, va_list *args);
6048 #endif
6049
6050 #if defined(NEED_vload_module) || defined(NEED_vload_module_GLOBAL)
6051
6052 #ifdef vload_module
6053 # undef vload_module
6054 #endif
6055 #define vload_module(a,b,c,d) DPPP_(my_vload_module)(aTHX_ a,b,c,d)
6056 #define Perl_vload_module DPPP_(my_vload_module)
6057
6058
6059 void
6060 DPPP_(my_vload_module)(U32 flags, SV *name, SV *ver, va_list *args)
6061 {
6062 dTHR;
6063 dVAR;
6064 OP *veop, *imop;
6065
6066 OP * const modname = newSVOP(OP_CONST, 0, name);
6067 /* 5.005 has a somewhat hacky force_normal that doesn't croak on
6068 SvREADONLY() if PL_compling is true. Current perls take care in
6069 ck_require() to correctly turn off SvREADONLY before calling
6070 force_normal_flags(). This seems a better fix than fudging PL_compling
6071 */
6072 SvREADONLY_off(((SVOP*)modname)->op_sv);
6073 modname->op_private |= OPpCONST_BARE;
6074 if (ver) {
6075 veop = newSVOP(OP_CONST, 0, ver);
6076 }
6077 else
6078 veop = NULL;
6079 if (flags & PERL_LOADMOD_NOIMPORT) {
6080 imop = sawparens(newNULLLIST());
6081 }
6082 else if (flags & PERL_LOADMOD_IMPORT_OPS) {
6083 imop = va_arg(*args, OP*);
6084 }
6085 else {
6086 SV *sv;
6087 imop = NULL;
6088 sv = va_arg(*args, SV*);
6089 while (sv) {
6090 imop = append_elem(OP_LIST, imop, newSVOP(OP_CONST, 0, sv));
6091 sv = va_arg(*args, SV*);
6092 }
6093 }
6094 {
6095 const line_t ocopline = PL_copline;
6096 COP * const ocurcop = PL_curcop;
6097 const int oexpect = PL_expect;
6098
6099 #if (PERL_BCDVERSION >= 0x5004000)
6100 utilize(!(flags & PERL_LOADMOD_DENY), start_subparse(FALSE, 0),
6101 veop, modname, imop);
6102 #elif (PERL_BCDVERSION > 0x5003000)
6103 utilize(!(flags & PERL_LOADMOD_DENY), start_subparse(),
6104 veop, modname, imop);
6105 #else
6106 utilize(!(flags & PERL_LOADMOD_DENY), start_subparse(),
6107 modname, imop);
6108 #endif
6109 PL_expect = oexpect;
6110 PL_copline = ocopline;
6111 PL_curcop = ocurcop;
6112 }
6113 }
6114
6115 #endif
6116 #endif
6117
6118 #ifndef load_module
6119 #if defined(NEED_load_module)
6120 static void DPPP_(my_load_module)(U32 flags, SV *name, SV *ver, ...);
6121 static
6122 #else
6123 extern void DPPP_(my_load_module)(U32 flags, SV *name, SV *ver, ...);
6124 #endif
6125
6126 #if defined(NEED_load_module) || defined(NEED_load_module_GLOBAL)
6127
6128 #ifdef load_module
6129 # undef load_module
6130 #endif
6131 #define load_module DPPP_(my_load_module)
6132 #define Perl_load_module DPPP_(my_load_module)
6133
6134
6135 void
6136 DPPP_(my_load_module)(U32 flags, SV *name, SV *ver, ...)
6137 {
6138 va_list args;
6139 va_start(args, ver);
6140 vload_module(flags, name, ver, &args);
6141 va_end(args);
6142 }
6143
6144 #endif
6145 #endif
6146 #ifndef newRV_inc
6147 # define newRV_inc(sv) newRV(sv) /* Replace */
6148 #endif
6149
6150 #ifndef newRV_noinc
6151 #if defined(NEED_newRV_noinc)
6152 static SV * DPPP_(my_newRV_noinc)(SV *sv);
6153 static
6154 #else
6155 extern SV * DPPP_(my_newRV_noinc)(SV *sv);
6156 #endif
6157
6158 #if defined(NEED_newRV_noinc) || defined(NEED_newRV_noinc_GLOBAL)
6159
6160 #ifdef newRV_noinc
6161 # undef newRV_noinc
6162 #endif
6163 #define newRV_noinc(a) DPPP_(my_newRV_noinc)(aTHX_ a)
6164 #define Perl_newRV_noinc DPPP_(my_newRV_noinc)
6165
6166 SV *
6167 DPPP_(my_newRV_noinc)(SV *sv)
6168 {
6169 SV *rv = (SV *)newRV(sv);
6170 SvREFCNT_dec(sv);
6171 return rv;
6172 }
6173 #endif
6174 #endif
6175
6176 /* Hint: newCONSTSUB
6177 * Returns a CV* as of perl-5.7.1. This return value is not supported
6178 * by Devel::PPPort.
6179 */
6180
6181 /* newCONSTSUB from IO.xs is in the core starting with 5.004_63 */
6182 #if (PERL_BCDVERSION < 0x5004063) && (PERL_BCDVERSION != 0x5004005)
6183 #if defined(NEED_newCONSTSUB)
6184 static void DPPP_(my_newCONSTSUB)(HV *stash, const char *name, SV *sv);
6185 static
6186 #else
6187 extern void DPPP_(my_newCONSTSUB)(HV *stash, const char *name, SV *sv);
1346188 #endif
1356189
1366190 #if defined(NEED_newCONSTSUB) || defined(NEED_newCONSTSUB_GLOBAL)
6191
6192 #ifdef newCONSTSUB
6193 # undef newCONSTSUB
6194 #endif
6195 #define newCONSTSUB(a,b,c) DPPP_(my_newCONSTSUB)(aTHX_ a,b,c)
6196 #define Perl_newCONSTSUB DPPP_(my_newCONSTSUB)
6197
6198
6199 /* This is just a trick to avoid a dependency of newCONSTSUB on PL_parser */
6200 /* (There's no PL_parser in perl < 5.005, so this is completely safe) */
6201 #define D_PPP_PL_copline PL_copline
6202
1376203 void
138 newCONSTSUB(stash,name,sv)
139 HV *stash;
140 char *name;
141 SV *sv;
6204 DPPP_(my_newCONSTSUB)(HV *stash, const char *name, SV *sv)
1426205 {
143 U32 oldhints = PL_hints;
144 HV *old_cop_stash = PL_curcop->cop_stash;
145 HV *old_curstash = PL_curstash;
146 line_t oldline = PL_curcop->cop_line;
147 PL_curcop->cop_line = PL_copline;
148
149 PL_hints &= ~HINT_BLOCK_SCOPE;
150 if (stash)
151 PL_curstash = PL_curcop->cop_stash = stash;
152
153 newSUB(
154
155 #if (PERL_VERSION < 3) || ((PERL_VERSION == 3) && (PERL_SUBVERSION < 22))
156 /* before 5.003_22 */
157 start_subparse(),
158 #else
159 # if (PERL_VERSION == 3) && (PERL_SUBVERSION == 22)
160 /* 5.003_22 */
161 start_subparse(0),
162 # else
163 /* 5.003_23 onwards */
164 start_subparse(FALSE, 0),
165 # endif
166 #endif
167
168 newSVOP(OP_CONST, 0, newSVpv(name,0)),
169 newSVOP(OP_CONST, 0, &PL_sv_no), /* SvPV(&PL_sv_no) == "" -- GMB */
170 newSTATEOP(0, Nullch, newSVOP(OP_CONST, 0, sv))
171 );
172
173 PL_hints = oldhints;
174 PL_curcop->cop_stash = old_cop_stash;
175 PL_curstash = old_curstash;
176 PL_curcop->cop_line = oldline;
6206 U32 oldhints = PL_hints;
6207 HV *old_cop_stash = PL_curcop->cop_stash;
6208 HV *old_curstash = PL_curstash;
6209 line_t oldline = PL_curcop->cop_line;
6210 PL_curcop->cop_line = D_PPP_PL_copline;
6211
6212 PL_hints &= ~HINT_BLOCK_SCOPE;
6213 if (stash)
6214 PL_curstash = PL_curcop->cop_stash = stash;
6215
6216 newSUB(
6217
6218 #if (PERL_BCDVERSION < 0x5003022)
6219 start_subparse(),
6220 #elif (PERL_BCDVERSION == 0x5003022)
6221 start_subparse(0),
6222 #else /* 5.003_23 onwards */
6223 start_subparse(FALSE, 0),
6224 #endif
6225
6226 newSVOP(OP_CONST, 0, newSVpv((char *) name, 0)),
6227 newSVOP(OP_CONST, 0, &PL_sv_no), /* SvPV(&PL_sv_no) == "" -- GMB */
6228 newSTATEOP(0, Nullch, newSVOP(OP_CONST, 0, sv))
6229 );
6230
6231 PL_hints = oldhints;
6232 PL_curcop->cop_stash = old_cop_stash;
6233 PL_curstash = old_curstash;
6234 PL_curcop->cop_line = oldline;
1776235 }
1786236 #endif
179
180 #endif /* newCONSTSUB */
181
182
183 #ifndef START_MY_CXT
6237 #endif
1846238
1856239 /*
1866240 * Boilerplate macros for initializing and accessing interpreter-local
2046258 #if defined(MULTIPLICITY) || defined(PERL_OBJECT) || \
2056259 defined(PERL_CAPI) || defined(PERL_IMPLICIT_CONTEXT)
2066260
6261 #ifndef START_MY_CXT
6262
2076263 /* This must appear in all extensions that define a my_cxt_t structure,
2086264 * right after the definition (i.e. at file scope). The non-threads
2096265 * case below uses it to declare the data as static. */
2106266 #define START_MY_CXT
2116267
212 #if PERL_REVISION == 5 && \
213 (PERL_VERSION < 4 || (PERL_VERSION == 4 && PERL_SUBVERSION < 68 ))
6268 #if (PERL_BCDVERSION < 0x5004068)
2146269 /* Fetches the SV that keeps the per-interpreter data. */
2156270 #define dMY_CXT_SV \
216 SV *my_cxt_sv = perl_get_sv(MY_CXT_KEY, FALSE)
6271 SV *my_cxt_sv = get_sv(MY_CXT_KEY, FALSE)
2176272 #else /* >= perl5.004_68 */
2186273 #define dMY_CXT_SV \
219 SV *my_cxt_sv = *hv_fetch(PL_modglobal, MY_CXT_KEY, \
220 sizeof(MY_CXT_KEY)-1, TRUE)
6274 SV *my_cxt_sv = *hv_fetch(PL_modglobal, MY_CXT_KEY, \
6275 sizeof(MY_CXT_KEY)-1, TRUE)
2216276 #endif /* < perl5.004_68 */
2226277
2236278 /* This declaration should be used within all functions that use the
2246279 * interpreter-local data. */
225 #define dMY_CXT \
226 dMY_CXT_SV; \
227 my_cxt_t *my_cxtp = INT2PTR(my_cxt_t*,SvUV(my_cxt_sv))
6280 #define dMY_CXT \
6281 dMY_CXT_SV; \
6282 my_cxt_t *my_cxtp = INT2PTR(my_cxt_t*,SvUV(my_cxt_sv))
2286283
2296284 /* Creates and zeroes the per-interpreter data.
2306285 * (We allocate my_cxtp in a Perl SV so that it will be released when
2316286 * the interpreter goes away.) */
2326287 #define MY_CXT_INIT \
233 dMY_CXT_SV; \
234 /* newSV() allocates one more than needed */ \
235 my_cxt_t *my_cxtp = (my_cxt_t*)SvPVX(newSV(sizeof(my_cxt_t)-1));\
236 Zero(my_cxtp, 1, my_cxt_t); \
237 sv_setuv(my_cxt_sv, PTR2UV(my_cxtp))
6288 dMY_CXT_SV; \
6289 /* newSV() allocates one more than needed */ \
6290 my_cxt_t *my_cxtp = (my_cxt_t*)SvPVX(newSV(sizeof(my_cxt_t)-1));\
6291 Zero(my_cxtp, 1, my_cxt_t); \
6292 sv_setuv(my_cxt_sv, PTR2UV(my_cxtp))
2386293
2396294 /* This macro must be used to access members of the my_cxt_t structure.
2406295 * e.g. MYCXT.some_data */
241 #define MY_CXT (*my_cxtp)
6296 #define MY_CXT (*my_cxtp)
2426297
2436298 /* Judicious use of these macros can reduce the number of times dMY_CXT
2446299 * is used. Use is similar to pTHX, aTHX etc. */
245 #define pMY_CXT my_cxt_t *my_cxtp
246 #define pMY_CXT_ pMY_CXT,
247 #define _pMY_CXT ,pMY_CXT
248 #define aMY_CXT my_cxtp
249 #define aMY_CXT_ aMY_CXT,
250 #define _aMY_CXT ,aMY_CXT
6300 #define pMY_CXT my_cxt_t *my_cxtp
6301 #define pMY_CXT_ pMY_CXT,
6302 #define _pMY_CXT ,pMY_CXT
6303 #define aMY_CXT my_cxtp
6304 #define aMY_CXT_ aMY_CXT,
6305 #define _aMY_CXT ,aMY_CXT
6306
6307 #endif /* START_MY_CXT */
6308
6309 #ifndef MY_CXT_CLONE
6310 /* Clones the per-interpreter data. */
6311 #define MY_CXT_CLONE \
6312 dMY_CXT_SV; \
6313 my_cxt_t *my_cxtp = (my_cxt_t*)SvPVX(newSV(sizeof(my_cxt_t)-1));\
6314 Copy(INT2PTR(my_cxt_t*, SvUV(my_cxt_sv)), my_cxtp, 1, my_cxt_t);\
6315 sv_setuv(my_cxt_sv, PTR2UV(my_cxtp))
6316 #endif
2516317
2526318 #else /* single interpreter */
2536319
254 #ifndef NOOP
255 # define NOOP (void)0
256 #endif
257
258 #ifdef HASATTRIBUTE
259 # define PERL_UNUSED_DECL __attribute__((unused))
260 #else
261 # define PERL_UNUSED_DECL
262 #endif
263
264 #ifndef dNOOP
265 # define dNOOP extern int Perl___notused PERL_UNUSED_DECL
266 #endif
267
268 #define START_MY_CXT static my_cxt_t my_cxt;
269 #define dMY_CXT_SV dNOOP
270 #define dMY_CXT dNOOP
271 #define MY_CXT_INIT NOOP
272 #define MY_CXT my_cxt
273
274 #define pMY_CXT void
6320 #ifndef START_MY_CXT
6321
6322 #define START_MY_CXT static my_cxt_t my_cxt;
6323 #define dMY_CXT_SV dNOOP
6324 #define dMY_CXT dNOOP
6325 #define MY_CXT_INIT NOOP
6326 #define MY_CXT my_cxt
6327
6328 #define pMY_CXT void
2756329 #define pMY_CXT_
2766330 #define _pMY_CXT
2776331 #define aMY_CXT
2786332 #define aMY_CXT_
2796333 #define _aMY_CXT
2806334
281 #endif
282
2836335 #endif /* START_MY_CXT */
2846336
285
286 #if 1
287 #ifdef DBM_setFilter
288 #undef DBM_setFilter
289 #undef DBM_ckFilter
290 #endif
291 #endif
292
293 #ifndef DBM_setFilter
294
295 /*
296 The DBM_setFilter & DBM_ckFilter macros are only used by
297 the *DB*_File modules
298 */
299
300 #define DBM_setFilter(db_type,code) \
301 { \
302 if (db_type) \
303 RETVAL = sv_mortalcopy(db_type) ; \
304 ST(0) = RETVAL ; \
305 if (db_type && (code == &PL_sv_undef)) { \
306 SvREFCNT_dec(db_type) ; \
307 db_type = NULL ; \
308 } \
309 else if (code) { \
310 if (db_type) \
311 sv_setsv(db_type, code) ; \
312 else \
313 db_type = newSVsv(code) ; \
314 } \
6337 #ifndef MY_CXT_CLONE
6338 #define MY_CXT_CLONE NOOP
6339 #endif
6340
6341 #endif
6342
6343 #ifndef IVdf
6344 # if IVSIZE == LONGSIZE
6345 # define IVdf "ld"
6346 # define UVuf "lu"
6347 # define UVof "lo"
6348 # define UVxf "lx"
6349 # define UVXf "lX"
6350 # elif IVSIZE == INTSIZE
6351 # define IVdf "d"
6352 # define UVuf "u"
6353 # define UVof "o"
6354 # define UVxf "x"
6355 # define UVXf "X"
6356 # else
6357 # error "cannot define IV/UV formats"
6358 # endif
6359 #endif
6360
6361 #ifndef NVef
6362 # if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) && \
6363 defined(PERL_PRIfldbl) && (PERL_BCDVERSION != 0x5006000)
6364 /* Not very likely, but let's try anyway. */
6365 # define NVef PERL_PRIeldbl
6366 # define NVff PERL_PRIfldbl
6367 # define NVgf PERL_PRIgldbl
6368 # else
6369 # define NVef "e"
6370 # define NVff "f"
6371 # define NVgf "g"
6372 # endif
6373 #endif
6374
6375 #ifndef SvREFCNT_inc
6376 # ifdef PERL_USE_GCC_BRACE_GROUPS
6377 # define SvREFCNT_inc(sv) \
6378 ({ \
6379 SV * const _sv = (SV*)(sv); \
6380 if (_sv) \
6381 (SvREFCNT(_sv))++; \
6382 _sv; \
6383 })
6384 # else
6385 # define SvREFCNT_inc(sv) \
6386 ((PL_Sv=(SV*)(sv)) ? (++(SvREFCNT(PL_Sv)),PL_Sv) : NULL)
6387 # endif
6388 #endif
6389
6390 #ifndef SvREFCNT_inc_simple
6391 # ifdef PERL_USE_GCC_BRACE_GROUPS
6392 # define SvREFCNT_inc_simple(sv) \
6393 ({ \
6394 if (sv) \
6395 (SvREFCNT(sv))++; \
6396 (SV *)(sv); \
6397 })
6398 # else
6399 # define SvREFCNT_inc_simple(sv) \
6400 ((sv) ? (SvREFCNT(sv)++,(SV*)(sv)) : NULL)
6401 # endif
6402 #endif
6403
6404 #ifndef SvREFCNT_inc_NN
6405 # ifdef PERL_USE_GCC_BRACE_GROUPS
6406 # define SvREFCNT_inc_NN(sv) \
6407 ({ \
6408 SV * const _sv = (SV*)(sv); \
6409 SvREFCNT(_sv)++; \
6410 _sv; \
6411 })
6412 # else
6413 # define SvREFCNT_inc_NN(sv) \
6414 (PL_Sv=(SV*)(sv),++(SvREFCNT(PL_Sv)),PL_Sv)
6415 # endif
6416 #endif
6417
6418 #ifndef SvREFCNT_inc_void
6419 # ifdef PERL_USE_GCC_BRACE_GROUPS
6420 # define SvREFCNT_inc_void(sv) \
6421 ({ \
6422 SV * const _sv = (SV*)(sv); \
6423 if (_sv) \
6424 (void)(SvREFCNT(_sv)++); \
6425 })
6426 # else
6427 # define SvREFCNT_inc_void(sv) \
6428 (void)((PL_Sv=(SV*)(sv)) ? ++(SvREFCNT(PL_Sv)) : 0)
6429 # endif
6430 #endif
6431 #ifndef SvREFCNT_inc_simple_void
6432 # define SvREFCNT_inc_simple_void(sv) STMT_START { if (sv) SvREFCNT(sv)++; } STMT_END
6433 #endif
6434
6435 #ifndef SvREFCNT_inc_simple_NN
6436 # define SvREFCNT_inc_simple_NN(sv) (++SvREFCNT(sv), (SV*)(sv))
6437 #endif
6438
6439 #ifndef SvREFCNT_inc_void_NN
6440 # define SvREFCNT_inc_void_NN(sv) (void)(++SvREFCNT((SV*)(sv)))
6441 #endif
6442
6443 #ifndef SvREFCNT_inc_simple_void_NN
6444 # define SvREFCNT_inc_simple_void_NN(sv) (void)(++SvREFCNT((SV*)(sv)))
6445 #endif
6446
6447 #ifndef newSV_type
6448
6449 #if defined(NEED_newSV_type)
6450 static SV* DPPP_(my_newSV_type)(pTHX_ svtype const t);
6451 static
6452 #else
6453 extern SV* DPPP_(my_newSV_type)(pTHX_ svtype const t);
6454 #endif
6455
6456 #if defined(NEED_newSV_type) || defined(NEED_newSV_type_GLOBAL)
6457
6458 #ifdef newSV_type
6459 # undef newSV_type
6460 #endif
6461 #define newSV_type(a) DPPP_(my_newSV_type)(aTHX_ a)
6462 #define Perl_newSV_type DPPP_(my_newSV_type)
6463
6464
6465 SV*
6466 DPPP_(my_newSV_type)(pTHX_ svtype const t)
6467 {
6468 SV* const sv = newSV(0);
6469 sv_upgrade(sv, t);
6470 return sv;
6471 }
6472
6473 #endif
6474
6475 #endif
6476
6477 #if (PERL_BCDVERSION < 0x5006000)
6478 # define D_PPP_CONSTPV_ARG(x) ((char *) (x))
6479 #else
6480 # define D_PPP_CONSTPV_ARG(x) (x)
6481 #endif
6482 #ifndef newSVpvn
6483 # define newSVpvn(data,len) ((data) \
6484 ? ((len) ? newSVpv((data), (len)) : newSVpv("", 0)) \
6485 : newSV(0))
6486 #endif
6487 #ifndef newSVpvn_utf8
6488 # define newSVpvn_utf8(s, len, u) newSVpvn_flags((s), (len), (u) ? SVf_UTF8 : 0)
6489 #endif
6490 #ifndef SVf_UTF8
6491 # define SVf_UTF8 0
6492 #endif
6493
6494 #ifndef newSVpvn_flags
6495
6496 #if defined(NEED_newSVpvn_flags)
6497 static SV * DPPP_(my_newSVpvn_flags)(pTHX_ const char *s, STRLEN len, U32 flags);
6498 static
6499 #else
6500 extern SV * DPPP_(my_newSVpvn_flags)(pTHX_ const char *s, STRLEN len, U32 flags);
6501 #endif
6502
6503 #if defined(NEED_newSVpvn_flags) || defined(NEED_newSVpvn_flags_GLOBAL)
6504
6505 #ifdef newSVpvn_flags
6506 # undef newSVpvn_flags
6507 #endif
6508 #define newSVpvn_flags(a,b,c) DPPP_(my_newSVpvn_flags)(aTHX_ a,b,c)
6509 #define Perl_newSVpvn_flags DPPP_(my_newSVpvn_flags)
6510
6511
6512 SV *
6513 DPPP_(my_newSVpvn_flags)(pTHX_ const char *s, STRLEN len, U32 flags)
6514 {
6515 SV *sv = newSVpvn(D_PPP_CONSTPV_ARG(s), len);
6516 SvFLAGS(sv) |= (flags & SVf_UTF8);
6517 return (flags & SVs_TEMP) ? sv_2mortal(sv) : sv;
6518 }
6519
6520 #endif
6521
6522 #endif
6523
6524 /* Backwards compatibility stuff... :-( */
6525 #if !defined(NEED_sv_2pv_flags) && defined(NEED_sv_2pv_nolen)
6526 # define NEED_sv_2pv_flags
6527 #endif
6528 #if !defined(NEED_sv_2pv_flags_GLOBAL) && defined(NEED_sv_2pv_nolen_GLOBAL)
6529 # define NEED_sv_2pv_flags_GLOBAL
6530 #endif
6531
6532 /* Hint: sv_2pv_nolen
6533 * Use the SvPV_nolen() or SvPV_nolen_const() macros instead of sv_2pv_nolen().
6534 */
6535 #ifndef sv_2pv_nolen
6536 # define sv_2pv_nolen(sv) SvPV_nolen(sv)
6537 #endif
6538
6539 #ifdef SvPVbyte
6540
6541 /* Hint: SvPVbyte
6542 * Does not work in perl-5.6.1, ppport.h implements a version
6543 * borrowed from perl-5.7.3.
6544 */
6545
6546 #if (PERL_BCDVERSION < 0x5007000)
6547
6548 #if defined(NEED_sv_2pvbyte)
6549 static char * DPPP_(my_sv_2pvbyte)(pTHX_ SV *sv, STRLEN *lp);
6550 static
6551 #else
6552 extern char * DPPP_(my_sv_2pvbyte)(pTHX_ SV *sv, STRLEN *lp);
6553 #endif
6554
6555 #if defined(NEED_sv_2pvbyte) || defined(NEED_sv_2pvbyte_GLOBAL)
6556
6557 #ifdef sv_2pvbyte
6558 # undef sv_2pvbyte
6559 #endif
6560 #define sv_2pvbyte(a,b) DPPP_(my_sv_2pvbyte)(aTHX_ a,b)
6561 #define Perl_sv_2pvbyte DPPP_(my_sv_2pvbyte)
6562
6563
6564 char *
6565 DPPP_(my_sv_2pvbyte)(pTHX_ SV *sv, STRLEN *lp)
6566 {
6567 sv_utf8_downgrade(sv,0);
6568 return SvPV(sv,*lp);
6569 }
6570
6571 #endif
6572
6573 /* Hint: sv_2pvbyte
6574 * Use the SvPVbyte() macro instead of sv_2pvbyte().
6575 */
6576
6577 #undef SvPVbyte
6578
6579 #define SvPVbyte(sv, lp) \
6580 ((SvFLAGS(sv) & (SVf_POK|SVf_UTF8)) == (SVf_POK) \
6581 ? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_2pvbyte(sv, &lp))
6582
6583 #endif
6584
6585 #else
6586
6587 # define SvPVbyte SvPV
6588 # define sv_2pvbyte sv_2pv
6589
6590 #endif
6591 #ifndef sv_2pvbyte_nolen
6592 # define sv_2pvbyte_nolen(sv) sv_2pv_nolen(sv)
6593 #endif
6594
6595 /* Hint: sv_pvn
6596 * Always use the SvPV() macro instead of sv_pvn().
6597 */
6598
6599 /* Hint: sv_pvn_force
6600 * Always use the SvPV_force() macro instead of sv_pvn_force().
6601 */
6602
6603 /* If these are undefined, they're not handled by the core anyway */
6604 #ifndef SV_IMMEDIATE_UNREF
6605 # define SV_IMMEDIATE_UNREF 0
6606 #endif
6607
6608 #ifndef SV_GMAGIC
6609 # define SV_GMAGIC 0
6610 #endif
6611
6612 #ifndef SV_COW_DROP_PV
6613 # define SV_COW_DROP_PV 0
6614 #endif
6615
6616 #ifndef SV_UTF8_NO_ENCODING
6617 # define SV_UTF8_NO_ENCODING 0
6618 #endif
6619
6620 #ifndef SV_NOSTEAL
6621 # define SV_NOSTEAL 0
6622 #endif
6623
6624 #ifndef SV_CONST_RETURN
6625 # define SV_CONST_RETURN 0
6626 #endif
6627
6628 #ifndef SV_MUTABLE_RETURN
6629 # define SV_MUTABLE_RETURN 0
6630 #endif
6631
6632 #ifndef SV_SMAGIC
6633 # define SV_SMAGIC 0
6634 #endif
6635
6636 #ifndef SV_HAS_TRAILING_NUL
6637 # define SV_HAS_TRAILING_NUL 0
6638 #endif
6639
6640 #ifndef SV_COW_SHARED_HASH_KEYS
6641 # define SV_COW_SHARED_HASH_KEYS 0
6642 #endif
6643
6644 #if (PERL_BCDVERSION < 0x5007002)
6645
6646 #if defined(NEED_sv_2pv_flags)
6647 static char * DPPP_(my_sv_2pv_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags);
6648 static
6649 #else
6650 extern char * DPPP_(my_sv_2pv_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags);
6651 #endif
6652
6653 #if defined(NEED_sv_2pv_flags) || defined(NEED_sv_2pv_flags_GLOBAL)
6654
6655 #ifdef sv_2pv_flags
6656 # undef sv_2pv_flags
6657 #endif
6658 #define sv_2pv_flags(a,b,c) DPPP_(my_sv_2pv_flags)(aTHX_ a,b,c)
6659 #define Perl_sv_2pv_flags DPPP_(my_sv_2pv_flags)
6660
6661
6662 char *
6663 DPPP_(my_sv_2pv_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags)
6664 {
6665 STRLEN n_a = (STRLEN) flags;
6666 return sv_2pv(sv, lp ? lp : &n_a);
6667 }
6668
6669 #endif
6670
6671 #if defined(NEED_sv_pvn_force_flags)
6672 static char * DPPP_(my_sv_pvn_force_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags);
6673 static
6674 #else
6675 extern char * DPPP_(my_sv_pvn_force_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags);
6676 #endif
6677
6678 #if defined(NEED_sv_pvn_force_flags) || defined(NEED_sv_pvn_force_flags_GLOBAL)
6679
6680 #ifdef sv_pvn_force_flags
6681 # undef sv_pvn_force_flags
6682 #endif
6683 #define sv_pvn_force_flags(a,b,c) DPPP_(my_sv_pvn_force_flags)(aTHX_ a,b,c)
6684 #define Perl_sv_pvn_force_flags DPPP_(my_sv_pvn_force_flags)
6685
6686
6687 char *
6688 DPPP_(my_sv_pvn_force_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags)
6689 {
6690 STRLEN n_a = (STRLEN) flags;
6691 return sv_pvn_force(sv, lp ? lp : &n_a);
6692 }
6693
6694 #endif
6695
6696 #endif
6697
6698 #if (PERL_BCDVERSION < 0x5008008) || ( (PERL_BCDVERSION >= 0x5009000) && (PERL_BCDVERSION < 0x5009003) )
6699 # define D_PPP_SVPV_NOLEN_LP_ARG &PL_na
6700 #else
6701 # define D_PPP_SVPV_NOLEN_LP_ARG 0
6702 #endif
6703 #ifndef SvPV_const
6704 # define SvPV_const(sv, lp) SvPV_flags_const(sv, lp, SV_GMAGIC)
6705 #endif
6706
6707 #ifndef SvPV_mutable
6708 # define SvPV_mutable(sv, lp) SvPV_flags_mutable(sv, lp, SV_GMAGIC)
6709 #endif
6710 #ifndef SvPV_flags
6711 # define SvPV_flags(sv, lp, flags) \
6712 ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
6713 ? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_2pv_flags(sv, &lp, flags))
6714 #endif
6715 #ifndef SvPV_flags_const
6716 # define SvPV_flags_const(sv, lp, flags) \
6717 ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
6718 ? ((lp = SvCUR(sv)), SvPVX_const(sv)) : \
6719 (const char*) sv_2pv_flags(sv, &lp, flags|SV_CONST_RETURN))
6720 #endif
6721 #ifndef SvPV_flags_const_nolen
6722 # define SvPV_flags_const_nolen(sv, flags) \
6723 ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
6724 ? SvPVX_const(sv) : \
6725 (const char*) sv_2pv_flags(sv, D_PPP_SVPV_NOLEN_LP_ARG, flags|SV_CONST_RETURN))
6726 #endif
6727 #ifndef SvPV_flags_mutable
6728 # define SvPV_flags_mutable(sv, lp, flags) \
6729 ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
6730 ? ((lp = SvCUR(sv)), SvPVX_mutable(sv)) : \
6731 sv_2pv_flags(sv, &lp, flags|SV_MUTABLE_RETURN))
6732 #endif
6733 #ifndef SvPV_force
6734 # define SvPV_force(sv, lp) SvPV_force_flags(sv, lp, SV_GMAGIC)
6735 #endif
6736
6737 #ifndef SvPV_force_nolen
6738 # define SvPV_force_nolen(sv) SvPV_force_flags_nolen(sv, SV_GMAGIC)
6739 #endif
6740
6741 #ifndef SvPV_force_mutable
6742 # define SvPV_force_mutable(sv, lp) SvPV_force_flags_mutable(sv, lp, SV_GMAGIC)
6743 #endif
6744
6745 #ifndef SvPV_force_nomg
6746 # define SvPV_force_nomg(sv, lp) SvPV_force_flags(sv, lp, 0)
6747 #endif
6748
6749 #ifndef SvPV_force_nomg_nolen
6750 # define SvPV_force_nomg_nolen(sv) SvPV_force_flags_nolen(sv, 0)
6751 #endif
6752 #ifndef SvPV_force_flags
6753 # define SvPV_force_flags(sv, lp, flags) \
6754 ((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == SVf_POK \
6755 ? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_pvn_force_flags(sv, &lp, flags))
6756 #endif
6757 #ifndef SvPV_force_flags_nolen
6758 # define SvPV_force_flags_nolen(sv, flags) \
6759 ((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == SVf_POK \
6760 ? SvPVX(sv) : sv_pvn_force_flags(sv, D_PPP_SVPV_NOLEN_LP_ARG, flags))
6761 #endif
6762 #ifndef SvPV_force_flags_mutable
6763 # define SvPV_force_flags_mutable(sv, lp, flags) \
6764 ((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == SVf_POK \
6765 ? ((lp = SvCUR(sv)), SvPVX_mutable(sv)) \
6766 : sv_pvn_force_flags(sv, &lp, flags|SV_MUTABLE_RETURN))
6767 #endif
6768 #ifndef SvPV_nolen
6769 # define SvPV_nolen(sv) \
6770 ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
6771 ? SvPVX(sv) : sv_2pv_flags(sv, D_PPP_SVPV_NOLEN_LP_ARG, SV_GMAGIC))
6772 #endif
6773 #ifndef SvPV_nolen_const
6774 # define SvPV_nolen_const(sv) \
6775 ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
6776 ? SvPVX_const(sv) : sv_2pv_flags(sv, D_PPP_SVPV_NOLEN_LP_ARG, SV_GMAGIC|SV_CONST_RETURN))
6777 #endif
6778 #ifndef SvPV_nomg
6779 # define SvPV_nomg(sv, lp) SvPV_flags(sv, lp, 0)
6780 #endif
6781
6782 #ifndef SvPV_nomg_const
6783 # define SvPV_nomg_const(sv, lp) SvPV_flags_const(sv, lp, 0)
6784 #endif
6785
6786 #ifndef SvPV_nomg_const_nolen
6787 # define SvPV_nomg_const_nolen(sv) SvPV_flags_const_nolen(sv, 0)
6788 #endif
6789
6790 #ifndef SvPV_nomg_nolen
6791 # define SvPV_nomg_nolen(sv) ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
6792 ? SvPVX(sv) : sv_2pv_flags(sv, D_PPP_SVPV_NOLEN_LP_ARG, 0))
6793 #endif
6794 #ifndef SvPV_renew
6795 # define SvPV_renew(sv,n) STMT_START { SvLEN_set(sv, n); \
6796 SvPV_set((sv), (char *) saferealloc( \
6797 (Malloc_t)SvPVX(sv), (MEM_SIZE)((n)))); \
6798 } STMT_END
6799 #endif
6800 #ifndef SvMAGIC_set
6801 # define SvMAGIC_set(sv, val) \
6802 STMT_START { assert(SvTYPE(sv) >= SVt_PVMG); \
6803 (((XPVMG*) SvANY(sv))->xmg_magic = (val)); } STMT_END
6804 #endif
6805
6806 #if (PERL_BCDVERSION < 0x5009003)
6807 #ifndef SvPVX_const
6808 # define SvPVX_const(sv) ((const char*) (0 + SvPVX(sv)))
6809 #endif
6810
6811 #ifndef SvPVX_mutable
6812 # define SvPVX_mutable(sv) (0 + SvPVX(sv))
6813 #endif
6814 #ifndef SvRV_set
6815 # define SvRV_set(sv, val) \
6816 STMT_START { assert(SvTYPE(sv) >= SVt_RV); \
6817 (((XRV*) SvANY(sv))->xrv_rv = (val)); } STMT_END
6818 #endif
6819
6820 #else
6821 #ifndef SvPVX_const
6822 # define SvPVX_const(sv) ((const char*)((sv)->sv_u.svu_pv))
6823 #endif
6824
6825 #ifndef SvPVX_mutable
6826 # define SvPVX_mutable(sv) ((sv)->sv_u.svu_pv)
6827 #endif
6828 #ifndef SvRV_set
6829 # define SvRV_set(sv, val) \
6830 STMT_START { assert(SvTYPE(sv) >= SVt_RV); \
6831 ((sv)->sv_u.svu_rv = (val)); } STMT_END
6832 #endif
6833
6834 #endif
6835 #ifndef SvSTASH_set
6836 # define SvSTASH_set(sv, val) \
6837 STMT_START { assert(SvTYPE(sv) >= SVt_PVMG); \
6838 (((XPVMG*) SvANY(sv))->xmg_stash = (val)); } STMT_END
6839 #endif
6840
6841 #if (PERL_BCDVERSION < 0x5004000)
6842 #ifndef SvUV_set
6843 # define SvUV_set(sv, val) \
6844 STMT_START { assert(SvTYPE(sv) == SVt_IV || SvTYPE(sv) >= SVt_PVIV); \
6845 (((XPVIV*) SvANY(sv))->xiv_iv = (IV) (val)); } STMT_END
6846 #endif
6847
6848 #else
6849 #ifndef SvUV_set
6850 # define SvUV_set(sv, val) \
6851 STMT_START { assert(SvTYPE(sv) == SVt_IV || SvTYPE(sv) >= SVt_PVIV); \
6852 (((XPVUV*) SvANY(sv))->xuv_uv = (val)); } STMT_END
6853 #endif
6854
6855 #endif
6856
6857 #if (PERL_BCDVERSION >= 0x5004000) && !defined(vnewSVpvf)
6858 #if defined(NEED_vnewSVpvf)
6859 static SV * DPPP_(my_vnewSVpvf)(pTHX_ const char *pat, va_list *args);
6860 static
6861 #else
6862 extern SV * DPPP_(my_vnewSVpvf)(pTHX_ const char *pat, va_list *args);
6863 #endif
6864
6865 #if defined(NEED_vnewSVpvf) || defined(NEED_vnewSVpvf_GLOBAL)
6866
6867 #ifdef vnewSVpvf
6868 # undef vnewSVpvf
6869 #endif
6870 #define vnewSVpvf(a,b) DPPP_(my_vnewSVpvf)(aTHX_ a,b)
6871 #define Perl_vnewSVpvf DPPP_(my_vnewSVpvf)
6872
6873
6874 SV *
6875 DPPP_(my_vnewSVpvf)(pTHX_ const char *pat, va_list *args)
6876 {
6877 register SV *sv = newSV(0);
6878 sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*));
6879 return sv;
6880 }
6881
6882 #endif
6883 #endif
6884
6885 #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vcatpvf)
6886 # define sv_vcatpvf(sv, pat, args) sv_vcatpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*))
6887 #endif
6888
6889 #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vsetpvf)
6890 # define sv_vsetpvf(sv, pat, args) sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*))
6891 #endif
6892
6893 #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_catpvf_mg)
6894 #if defined(NEED_sv_catpvf_mg)
6895 static void DPPP_(my_sv_catpvf_mg)(pTHX_ SV *sv, const char *pat, ...);
6896 static
6897 #else
6898 extern void DPPP_(my_sv_catpvf_mg)(pTHX_ SV *sv, const char *pat, ...);
6899 #endif
6900
6901 #if defined(NEED_sv_catpvf_mg) || defined(NEED_sv_catpvf_mg_GLOBAL)
6902
6903 #define Perl_sv_catpvf_mg DPPP_(my_sv_catpvf_mg)
6904
6905
6906 void
6907 DPPP_(my_sv_catpvf_mg)(pTHX_ SV *sv, const char *pat, ...)
6908 {
6909 va_list args;
6910 va_start(args, pat);
6911 sv_vcatpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*));
6912 SvSETMAGIC(sv);
6913 va_end(args);
6914 }
6915
6916 #endif
6917 #endif
6918
6919 #ifdef PERL_IMPLICIT_CONTEXT
6920 #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_catpvf_mg_nocontext)
6921 #if defined(NEED_sv_catpvf_mg_nocontext)
6922 static void DPPP_(my_sv_catpvf_mg_nocontext)(SV *sv, const char *pat, ...);
6923 static
6924 #else
6925 extern void DPPP_(my_sv_catpvf_mg_nocontext)(SV *sv, const char *pat, ...);
6926 #endif
6927
6928 #if defined(NEED_sv_catpvf_mg_nocontext) || defined(NEED_sv_catpvf_mg_nocontext_GLOBAL)
6929
6930 #define sv_catpvf_mg_nocontext DPPP_(my_sv_catpvf_mg_nocontext)
6931 #define Perl_sv_catpvf_mg_nocontext DPPP_(my_sv_catpvf_mg_nocontext)
6932
6933
6934 void
6935 DPPP_(my_sv_catpvf_mg_nocontext)(SV *sv, const char *pat, ...)
6936 {
6937 dTHX;
6938 va_list args;
6939 va_start(args, pat);
6940 sv_vcatpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*));
6941 SvSETMAGIC(sv);
6942 va_end(args);
6943 }
6944
6945 #endif
6946 #endif
6947 #endif
6948
6949 /* sv_catpvf_mg depends on sv_catpvf_mg_nocontext */
6950 #ifndef sv_catpvf_mg
6951 # ifdef PERL_IMPLICIT_CONTEXT
6952 # define sv_catpvf_mg Perl_sv_catpvf_mg_nocontext
6953 # else
6954 # define sv_catpvf_mg Perl_sv_catpvf_mg
6955 # endif
6956 #endif
6957
6958 #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vcatpvf_mg)
6959 # define sv_vcatpvf_mg(sv, pat, args) \
6960 STMT_START { \
6961 sv_vcatpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*)); \
6962 SvSETMAGIC(sv); \
6963 } STMT_END
6964 #endif
6965
6966 #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_setpvf_mg)
6967 #if defined(NEED_sv_setpvf_mg)
6968 static void DPPP_(my_sv_setpvf_mg)(pTHX_ SV *sv, const char *pat, ...);
6969 static
6970 #else
6971 extern void DPPP_(my_sv_setpvf_mg)(pTHX_ SV *sv, const char *pat, ...);
6972 #endif
6973
6974 #if defined(NEED_sv_setpvf_mg) || defined(NEED_sv_setpvf_mg_GLOBAL)
6975
6976 #define Perl_sv_setpvf_mg DPPP_(my_sv_setpvf_mg)
6977
6978
6979 void
6980 DPPP_(my_sv_setpvf_mg)(pTHX_ SV *sv, const char *pat, ...)
6981 {
6982 va_list args;
6983 va_start(args, pat);
6984 sv_vsetpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*));
6985 SvSETMAGIC(sv);
6986 va_end(args);
6987 }
6988
6989 #endif
6990 #endif
6991
6992 #ifdef PERL_IMPLICIT_CONTEXT
6993 #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_setpvf_mg_nocontext)
6994 #if defined(NEED_sv_setpvf_mg_nocontext)
6995 static void DPPP_(my_sv_setpvf_mg_nocontext)(SV *sv, const char *pat, ...);
6996 static
6997 #else
6998 extern void DPPP_(my_sv_setpvf_mg_nocontext)(SV *sv, const char *pat, ...);
6999 #endif
7000
7001 #if defined(NEED_sv_setpvf_mg_nocontext) || defined(NEED_sv_setpvf_mg_nocontext_GLOBAL)
7002
7003 #define sv_setpvf_mg_nocontext DPPP_(my_sv_setpvf_mg_nocontext)
7004 #define Perl_sv_setpvf_mg_nocontext DPPP_(my_sv_setpvf_mg_nocontext)
7005
7006
7007 void
7008 DPPP_(my_sv_setpvf_mg_nocontext)(SV *sv, const char *pat, ...)
7009 {
7010 dTHX;
7011 va_list args;
7012 va_start(args, pat);
7013 sv_vsetpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*));
7014 SvSETMAGIC(sv);
7015 va_end(args);
7016 }
7017
7018 #endif
7019 #endif
7020 #endif
7021
7022 /* sv_setpvf_mg depends on sv_setpvf_mg_nocontext */
7023 #ifndef sv_setpvf_mg
7024 # ifdef PERL_IMPLICIT_CONTEXT
7025 # define sv_setpvf_mg Perl_sv_setpvf_mg_nocontext
7026 # else
7027 # define sv_setpvf_mg Perl_sv_setpvf_mg
7028 # endif
7029 #endif
7030
7031 #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vsetpvf_mg)
7032 # define sv_vsetpvf_mg(sv, pat, args) \
7033 STMT_START { \
7034 sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*)); \
7035 SvSETMAGIC(sv); \
7036 } STMT_END
7037 #endif
7038
7039 /* Hint: newSVpvn_share
7040 * The SVs created by this function only mimic the behaviour of
7041 * shared PVs without really being shared. Only use if you know
7042 * what you're doing.
7043 */
7044
7045 #ifndef newSVpvn_share
7046
7047 #if defined(NEED_newSVpvn_share)
7048 static SV * DPPP_(my_newSVpvn_share)(pTHX_ const char *src, I32 len, U32 hash);
7049 static
7050 #else
7051 extern SV * DPPP_(my_newSVpvn_share)(pTHX_ const char *src, I32 len, U32 hash);
7052 #endif
7053
7054 #if defined(NEED_newSVpvn_share) || defined(NEED_newSVpvn_share_GLOBAL)
7055
7056 #ifdef newSVpvn_share
7057 # undef newSVpvn_share
7058 #endif
7059 #define newSVpvn_share(a,b,c) DPPP_(my_newSVpvn_share)(aTHX_ a,b,c)
7060 #define Perl_newSVpvn_share DPPP_(my_newSVpvn_share)
7061
7062
7063 SV *
7064 DPPP_(my_newSVpvn_share)(pTHX_ const char *src, I32 len, U32 hash)
7065 {
7066 SV *sv;
7067 if (len < 0)
7068 len = -len;
7069 if (!hash)
7070 PERL_HASH(hash, (char*) src, len);
7071 sv = newSVpvn((char *) src, len);
7072 sv_upgrade(sv, SVt_PVIV);
7073 SvIVX(sv) = hash;
7074 SvREADONLY_on(sv);
7075 SvPOK_on(sv);
7076 return sv;
7077 }
7078
7079 #endif
7080
7081 #endif
7082 #ifndef SvSHARED_HASH
7083 # define SvSHARED_HASH(sv) (0 + SvUVX(sv))
7084 #endif
7085 #ifndef HvNAME_get
7086 # define HvNAME_get(hv) HvNAME(hv)
7087 #endif
7088 #ifndef HvNAMELEN_get
7089 # define HvNAMELEN_get(hv) (HvNAME_get(hv) ? (I32)strlen(HvNAME_get(hv)) : 0)
7090 #endif
7091
7092 #ifndef gv_fetchpvn_flags
7093 #if defined(NEED_gv_fetchpvn_flags)
7094 static GV* DPPP_(my_gv_fetchpvn_flags)(pTHX_ const char* name, STRLEN len, int flags, int types);
7095 static
7096 #else
7097 extern GV* DPPP_(my_gv_fetchpvn_flags)(pTHX_ const char* name, STRLEN len, int flags, int types);
7098 #endif
7099
7100 #if defined(NEED_gv_fetchpvn_flags) || defined(NEED_gv_fetchpvn_flags_GLOBAL)
7101
7102 #ifdef gv_fetchpvn_flags
7103 # undef gv_fetchpvn_flags
7104 #endif
7105 #define gv_fetchpvn_flags(a,b,c,d) DPPP_(my_gv_fetchpvn_flags)(aTHX_ a,b,c,d)
7106 #define Perl_gv_fetchpvn_flags DPPP_(my_gv_fetchpvn_flags)
7107
7108
7109 GV*
7110 DPPP_(my_gv_fetchpvn_flags)(pTHX_ const char* name, STRLEN len, int flags, int types) {
7111 char *namepv = savepvn(name, len);
7112 GV* stash = gv_fetchpv(namepv, TRUE, SVt_PVHV);
7113 Safefree(namepv);
7114 return stash;
7115 }
7116
7117 #endif
7118 #endif
7119 #ifndef GvSVn
7120 # define GvSVn(gv) GvSV(gv)
7121 #endif
7122
7123 #ifndef isGV_with_GP
7124 # define isGV_with_GP(gv) isGV(gv)
7125 #endif
7126
7127 #ifndef gv_fetchsv
7128 # define gv_fetchsv(name, flags, svt) gv_fetchpv(SvPV_nolen_const(name), flags, svt)
7129 #endif
7130 #ifndef get_cvn_flags
7131 # define get_cvn_flags(name, namelen, flags) get_cv(name, flags)
7132 #endif
7133
7134 #ifndef gv_init_pvn
7135 # define gv_init_pvn(gv, stash, ptr, len, flags) gv_init(gv, stash, ptr, len, flags & GV_ADDMULTI ? TRUE : FALSE)
7136 #endif
7137
7138 /* concatenating with "" ensures that only literal strings are accepted as argument
7139 * note that STR_WITH_LEN() can't be used as argument to macros or functions that
7140 * under some configurations might be macros
7141 */
7142 #ifndef STR_WITH_LEN
7143 # define STR_WITH_LEN(s) (s ""), (sizeof(s)-1)
7144 #endif
7145 #ifndef newSVpvs
7146 # define newSVpvs(str) newSVpvn(str "", sizeof(str) - 1)
7147 #endif
7148
7149 #ifndef newSVpvs_flags
7150 # define newSVpvs_flags(str, flags) newSVpvn_flags(str "", sizeof(str) - 1, flags)
7151 #endif
7152
7153 #ifndef newSVpvs_share
7154 # define newSVpvs_share(str) newSVpvn_share(str "", sizeof(str) - 1, 0)
7155 #endif
7156
7157 #ifndef sv_catpvs
7158 # define sv_catpvs(sv, str) sv_catpvn(sv, str "", sizeof(str) - 1)
7159 #endif
7160
7161 #ifndef sv_setpvs
7162 # define sv_setpvs(sv, str) sv_setpvn(sv, str "", sizeof(str) - 1)
7163 #endif
7164
7165 #ifndef hv_fetchs
7166 # define hv_fetchs(hv, key, lval) hv_fetch(hv, key "", sizeof(key) - 1, lval)
7167 #endif
7168
7169 #ifndef hv_stores
7170 # define hv_stores(hv, key, val) hv_store(hv, key "", sizeof(key) - 1, val, 0)
7171 #endif
7172 #ifndef gv_fetchpvs
7173 # define gv_fetchpvs(name, flags, svt) gv_fetchpvn_flags(name "", sizeof(name) - 1, flags, svt)
7174 #endif
7175
7176 #ifndef gv_stashpvs
7177 # define gv_stashpvs(name, flags) gv_stashpvn(name "", sizeof(name) - 1, flags)
7178 #endif
7179 #ifndef get_cvs
7180 # define get_cvs(name, flags) get_cvn_flags(name "", sizeof(name)-1, flags)
7181 #endif
7182 #ifndef SvGETMAGIC
7183 # define SvGETMAGIC(x) STMT_START { if (SvGMAGICAL(x)) mg_get(x); } STMT_END
7184 #endif
7185
7186 /* That's the best we can do... */
7187 #ifndef sv_catpvn_nomg
7188 # define sv_catpvn_nomg sv_catpvn
7189 #endif
7190
7191 #ifndef sv_catsv_nomg
7192 # define sv_catsv_nomg sv_catsv
7193 #endif
7194
7195 #ifndef sv_setsv_nomg
7196 # define sv_setsv_nomg sv_setsv
7197 #endif
7198
7199 #ifndef sv_pvn_nomg
7200 # define sv_pvn_nomg sv_pvn
7201 #endif
7202
7203 #ifndef SvIV_nomg
7204 # define SvIV_nomg SvIV
7205 #endif
7206
7207 #ifndef SvUV_nomg
7208 # define SvUV_nomg SvUV
7209 #endif
7210
7211 #ifndef sv_catpv_mg
7212 # define sv_catpv_mg(sv, ptr) \
7213 STMT_START { \
7214 SV *TeMpSv = sv; \
7215 sv_catpv(TeMpSv,ptr); \
7216 SvSETMAGIC(TeMpSv); \
7217 } STMT_END
7218 #endif
7219
7220 #ifndef sv_catpvn_mg
7221 # define sv_catpvn_mg(sv, ptr, len) \
7222 STMT_START { \
7223 SV *TeMpSv = sv; \
7224 sv_catpvn(TeMpSv,ptr,len); \
7225 SvSETMAGIC(TeMpSv); \
7226 } STMT_END
7227 #endif
7228
7229 #ifndef sv_catsv_mg
7230 # define sv_catsv_mg(dsv, ssv) \
7231 STMT_START { \
7232 SV *TeMpSv = dsv; \
7233 sv_catsv(TeMpSv,ssv); \
7234 SvSETMAGIC(TeMpSv); \
7235 } STMT_END
7236 #endif
7237
7238 #ifndef sv_setiv_mg
7239 # define sv_setiv_mg(sv, i) \
7240 STMT_START { \
7241 SV *TeMpSv = sv; \
7242 sv_setiv(TeMpSv,i); \
7243 SvSETMAGIC(TeMpSv); \
7244 } STMT_END
7245 #endif
7246
7247 #ifndef sv_setnv_mg
7248 # define sv_setnv_mg(sv, num) \
7249 STMT_START { \
7250 SV *TeMpSv = sv; \
7251 sv_setnv(TeMpSv,num); \
7252 SvSETMAGIC(TeMpSv); \
7253 } STMT_END
7254 #endif
7255
7256 #ifndef sv_setpv_mg
7257 # define sv_setpv_mg(sv, ptr) \
7258 STMT_START { \
7259 SV *TeMpSv = sv; \
7260 sv_setpv(TeMpSv,ptr); \
7261 SvSETMAGIC(TeMpSv); \
7262 } STMT_END
7263 #endif
7264
7265 #ifndef sv_setpvn_mg
7266 # define sv_setpvn_mg(sv, ptr, len) \
7267 STMT_START { \
7268 SV *TeMpSv = sv; \
7269 sv_setpvn(TeMpSv,ptr,len); \
7270 SvSETMAGIC(TeMpSv); \
7271 } STMT_END
7272 #endif
7273
7274 #ifndef sv_setsv_mg
7275 # define sv_setsv_mg(dsv, ssv) \
7276 STMT_START { \
7277 SV *TeMpSv = dsv; \
7278 sv_setsv(TeMpSv,ssv); \
7279 SvSETMAGIC(TeMpSv); \
7280 } STMT_END
7281 #endif
7282
7283 #ifndef sv_setuv_mg
7284 # define sv_setuv_mg(sv, i) \
7285 STMT_START { \
7286 SV *TeMpSv = sv; \
7287 sv_setuv(TeMpSv,i); \
7288 SvSETMAGIC(TeMpSv); \
7289 } STMT_END
7290 #endif
7291
7292 #ifndef sv_usepvn_mg
7293 # define sv_usepvn_mg(sv, ptr, len) \
7294 STMT_START { \
7295 SV *TeMpSv = sv; \
7296 sv_usepvn(TeMpSv,ptr,len); \
7297 SvSETMAGIC(TeMpSv); \
7298 } STMT_END
7299 #endif
7300 #ifndef SvVSTRING_mg
7301 # define SvVSTRING_mg(sv) (SvMAGICAL(sv) ? mg_find(sv, PERL_MAGIC_vstring) : NULL)
7302 #endif
7303
7304 /* Hint: sv_magic_portable
7305 * This is a compatibility function that is only available with
7306 * Devel::PPPort. It is NOT in the perl core.
7307 * Its purpose is to mimic the 5.8.0 behaviour of sv_magic() when
7308 * it is being passed a name pointer with namlen == 0. In that
7309 * case, perl 5.8.0 and later store the pointer, not a copy of it.
7310 * The compatibility can be provided back to perl 5.004. With
7311 * earlier versions, the code will not compile.
7312 */
7313
7314 #if (PERL_BCDVERSION < 0x5004000)
7315
7316 /* code that uses sv_magic_portable will not compile */
7317
7318 #elif (PERL_BCDVERSION < 0x5008000)
7319
7320 # define sv_magic_portable(sv, obj, how, name, namlen) \
7321 STMT_START { \
7322 SV *SvMp_sv = (sv); \
7323 char *SvMp_name = (char *) (name); \
7324 I32 SvMp_namlen = (namlen); \
7325 if (SvMp_name && SvMp_namlen == 0) \
7326 { \
7327 MAGIC *mg; \
7328 sv_magic(SvMp_sv, obj, how, 0, 0); \
7329 mg = SvMAGIC(SvMp_sv); \
7330 mg->mg_len = -42; /* XXX: this is the tricky part */ \
7331 mg->mg_ptr = SvMp_name; \
7332 } \
7333 else \
7334 { \
7335 sv_magic(SvMp_sv, obj, how, SvMp_name, SvMp_namlen); \
7336 } \
7337 } STMT_END
7338
7339 #else
7340
7341 # define sv_magic_portable(a, b, c, d, e) sv_magic(a, b, c, d, e)
7342
7343 #endif
7344
7345 #if !defined(mg_findext)
7346 #if defined(NEED_mg_findext)
7347 static MAGIC * DPPP_(my_mg_findext)(SV * sv, int type, const MGVTBL *vtbl);
7348 static
7349 #else
7350 extern MAGIC * DPPP_(my_mg_findext)(SV * sv, int type, const MGVTBL *vtbl);
7351 #endif
7352
7353 #if defined(NEED_mg_findext) || defined(NEED_mg_findext_GLOBAL)
7354
7355 #define mg_findext DPPP_(my_mg_findext)
7356 #define Perl_mg_findext DPPP_(my_mg_findext)
7357
7358
7359 MAGIC *
7360 DPPP_(my_mg_findext)(SV * sv, int type, const MGVTBL *vtbl) {
7361 if (sv) {
7362 MAGIC *mg;
7363
7364 #ifdef AvPAD_NAMELIST
7365 assert(!(SvTYPE(sv) == SVt_PVAV && AvPAD_NAMELIST(sv)));
7366 #endif
7367
7368 for (mg = SvMAGIC (sv); mg; mg = mg->mg_moremagic) {
7369 if (mg->mg_type == type && mg->mg_virtual == vtbl)
7370 return mg;
7371 }
7372 }
7373
7374 return NULL;
7375 }
7376
7377 #endif
7378 #endif
7379
7380 #if !defined(sv_unmagicext)
7381 #if defined(NEED_sv_unmagicext)
7382 static int DPPP_(my_sv_unmagicext)(pTHX_ SV * const sv, const int type, MGVTBL * vtbl);
7383 static
7384 #else
7385 extern int DPPP_(my_sv_unmagicext)(pTHX_ SV * const sv, const int type, MGVTBL * vtbl);
7386 #endif
7387
7388 #if defined(NEED_sv_unmagicext) || defined(NEED_sv_unmagicext_GLOBAL)
7389
7390 #ifdef sv_unmagicext
7391 # undef sv_unmagicext
7392 #endif
7393 #define sv_unmagicext(a,b,c) DPPP_(my_sv_unmagicext)(aTHX_ a,b,c)
7394 #define Perl_sv_unmagicext DPPP_(my_sv_unmagicext)
7395
7396
7397 int
7398 DPPP_(my_sv_unmagicext)(pTHX_ SV *const sv, const int type, MGVTBL *vtbl)
7399 {
7400 MAGIC* mg;
7401 MAGIC** mgp;
7402
7403 if (SvTYPE(sv) < SVt_PVMG || !SvMAGIC(sv))
7404 return 0;
7405 mgp = &(SvMAGIC(sv));
7406 for (mg = *mgp; mg; mg = *mgp) {
7407 const MGVTBL* const virt = mg->mg_virtual;
7408 if (mg->mg_type == type && virt == vtbl) {
7409 *mgp = mg->mg_moremagic;
7410 if (virt && virt->svt_free)
7411 virt->svt_free(aTHX_ sv, mg);
7412 if (mg->mg_ptr && mg->mg_type != PERL_MAGIC_regex_global) {
7413 if (mg->mg_len > 0)
7414 Safefree(mg->mg_ptr);
7415 else if (mg->mg_len == HEf_SVKEY) /* Questionable on older perls... */
7416 SvREFCNT_dec(MUTABLE_SV(mg->mg_ptr));
7417 else if (mg->mg_type == PERL_MAGIC_utf8)
7418 Safefree(mg->mg_ptr);
7419 }
7420 if (mg->mg_flags & MGf_REFCOUNTED)
7421 SvREFCNT_dec(mg->mg_obj);
7422 Safefree(mg);
3157423 }
316
317 #define DBM_ckFilter(arg,type,name) \
318 if (db->type) { \
319 /* printf("Filtering %s\n", name); */ \
320 if (db->filtering) { \
321 croak("recursion detected in %s", name) ; \
322 } \
323 ENTER ; \
324 SAVETMPS ; \
325 SAVEINT(db->filtering) ; \
326 db->filtering = TRUE ; \
327 SAVESPTR(DEFSV) ; \
328 if (name[7] == 's') \
329 arg = newSVsv(arg); \
330 DEFSV = arg ; \
331 SvTEMP_off(arg) ; \
332 PUSHMARK(SP) ; \
333 PUTBACK ; \
334 (void) perl_call_sv(db->type, G_DISCARD); \
335 arg = DEFSV ; \
336 SPAGAIN ; \
337 PUTBACK ; \
338 FREETMPS ; \
339 LEAVE ; \
340 if (name[7] == 's'){ \
341 arg = sv_2mortal(arg); \
342 } \
343 SvOKp(arg); \
7424 else
7425 mgp = &mg->mg_moremagic;
7426 }
7427 if (SvMAGIC(sv)) {
7428 if (SvMAGICAL(sv)) /* if we're under save_magic, wait for restore_magic; */
7429 mg_magical(sv); /* else fix the flags now */
7430 }
7431 else {
7432 SvMAGICAL_off(sv);
7433 SvFLAGS(sv) |= (SvFLAGS(sv) & (SVp_IOK|SVp_NOK|SVp_POK)) >> PRIVSHIFT;
7434 }
7435 return 0;
7436 }
7437
7438 #endif
7439 #endif
7440
7441 #ifdef USE_ITHREADS
7442 #ifndef CopFILE
7443 # define CopFILE(c) ((c)->cop_file)
7444 #endif
7445
7446 #ifndef CopFILEGV
7447 # define CopFILEGV(c) (CopFILE(c) ? gv_fetchfile(CopFILE(c)) : Nullgv)
7448 #endif
7449
7450 #ifndef CopFILE_set
7451 # define CopFILE_set(c,pv) ((c)->cop_file = savepv(pv))
7452 #endif
7453
7454 #ifndef CopFILESV
7455 # define CopFILESV(c) (CopFILE(c) ? GvSV(gv_fetchfile(CopFILE(c))) : Nullsv)
7456 #endif
7457
7458 #ifndef CopFILEAV
7459 # define CopFILEAV(c) (CopFILE(c) ? GvAV(gv_fetchfile(CopFILE(c))) : Nullav)
7460 #endif
7461
7462 #ifndef CopSTASHPV
7463 # define CopSTASHPV(c) ((c)->cop_stashpv)
7464 #endif
7465
7466 #ifndef CopSTASHPV_set
7467 # define CopSTASHPV_set(c,pv) ((c)->cop_stashpv = ((pv) ? savepv(pv) : Nullch))
7468 #endif
7469
7470 #ifndef CopSTASH
7471 # define CopSTASH(c) (CopSTASHPV(c) ? gv_stashpv(CopSTASHPV(c),GV_ADD) : Nullhv)
7472 #endif
7473
7474 #ifndef CopSTASH_set
7475 # define CopSTASH_set(c,hv) CopSTASHPV_set(c, (hv) ? HvNAME(hv) : Nullch)
7476 #endif
7477
7478 #ifndef CopSTASH_eq
7479 # define CopSTASH_eq(c,hv) ((hv) && (CopSTASHPV(c) == HvNAME(hv) \
7480 || (CopSTASHPV(c) && HvNAME(hv) \
7481 && strEQ(CopSTASHPV(c), HvNAME(hv)))))
7482 #endif
7483
7484 #else
7485 #ifndef CopFILEGV
7486 # define CopFILEGV(c) ((c)->cop_filegv)
7487 #endif
7488
7489 #ifndef CopFILEGV_set
7490 # define CopFILEGV_set(c,gv) ((c)->cop_filegv = (GV*)SvREFCNT_inc(gv))
7491 #endif
7492
7493 #ifndef CopFILE_set
7494 # define CopFILE_set(c,pv) CopFILEGV_set((c), gv_fetchfile(pv))
7495 #endif
7496
7497 #ifndef CopFILESV
7498 # define CopFILESV(c) (CopFILEGV(c) ? GvSV(CopFILEGV(c)) : Nullsv)
7499 #endif
7500
7501 #ifndef CopFILEAV
7502 # define CopFILEAV(c) (CopFILEGV(c) ? GvAV(CopFILEGV(c)) : Nullav)
7503 #endif
7504
7505 #ifndef CopFILE
7506 # define CopFILE(c) (CopFILESV(c) ? SvPVX(CopFILESV(c)) : Nullch)
7507 #endif
7508
7509 #ifndef CopSTASH
7510 # define CopSTASH(c) ((c)->cop_stash)
7511 #endif
7512
7513 #ifndef CopSTASH_set
7514 # define CopSTASH_set(c,hv) ((c)->cop_stash = (hv))
7515 #endif
7516
7517 #ifndef CopSTASHPV
7518 # define CopSTASHPV(c) (CopSTASH(c) ? HvNAME(CopSTASH(c)) : Nullch)
7519 #endif
7520
7521 #ifndef CopSTASHPV_set
7522 # define CopSTASHPV_set(c,pv) CopSTASH_set((c), gv_stashpv(pv,GV_ADD))
7523 #endif
7524
7525 #ifndef CopSTASH_eq
7526 # define CopSTASH_eq(c,hv) (CopSTASH(c) == (hv))
7527 #endif
7528
7529 #endif /* USE_ITHREADS */
7530
7531 #if (PERL_BCDVERSION >= 0x5006000)
7532 #ifndef caller_cx
7533
7534 # if defined(NEED_caller_cx) || defined(NEED_caller_cx_GLOBAL)
7535 static I32
7536 DPPP_dopoptosub_at(const PERL_CONTEXT *cxstk, I32 startingblock)
7537 {
7538 I32 i;
7539
7540 for (i = startingblock; i >= 0; i--) {
7541 register const PERL_CONTEXT * const cx = &cxstk[i];
7542 switch (CxTYPE(cx)) {
7543 default:
7544 continue;
7545 case CXt_EVAL:
7546 case CXt_SUB:
7547 case CXt_FORMAT:
7548 return i;
3447549 }
345
346 #endif /* DBM_setFilter */
7550 }
7551 return i;
7552 }
7553 # endif
7554
7555 # if defined(NEED_caller_cx)
7556 static const PERL_CONTEXT * DPPP_(my_caller_cx)(pTHX_ I32 count, const PERL_CONTEXT **dbcxp);
7557 static
7558 #else
7559 extern const PERL_CONTEXT * DPPP_(my_caller_cx)(pTHX_ I32 count, const PERL_CONTEXT **dbcxp);
7560 #endif
7561
7562 #if defined(NEED_caller_cx) || defined(NEED_caller_cx_GLOBAL)
7563
7564 #ifdef caller_cx
7565 # undef caller_cx
7566 #endif
7567 #define caller_cx(a,b) DPPP_(my_caller_cx)(aTHX_ a,b)
7568 #define Perl_caller_cx DPPP_(my_caller_cx)
7569
7570
7571 const PERL_CONTEXT *
7572 DPPP_(my_caller_cx)(pTHX_ I32 count, const PERL_CONTEXT **dbcxp)
7573 {
7574 register I32 cxix = DPPP_dopoptosub_at(cxstack, cxstack_ix);
7575 register const PERL_CONTEXT *cx;
7576 register const PERL_CONTEXT *ccstack = cxstack;
7577 const PERL_SI *top_si = PL_curstackinfo;
7578
7579 for (;;) {
7580 /* we may be in a higher stacklevel, so dig down deeper */
7581 while (cxix < 0 && top_si->si_type != PERLSI_MAIN) {
7582 top_si = top_si->si_prev;
7583 ccstack = top_si->si_cxstack;
7584 cxix = DPPP_dopoptosub_at(ccstack, top_si->si_cxix);
7585 }
7586 if (cxix < 0)
7587 return NULL;
7588 /* caller() should not report the automatic calls to &DB::sub */
7589 if (PL_DBsub && GvCV(PL_DBsub) && cxix >= 0 &&
7590 ccstack[cxix].blk_sub.cv == GvCV(PL_DBsub))
7591 count++;
7592 if (!count--)
7593 break;
7594 cxix = DPPP_dopoptosub_at(ccstack, cxix - 1);
7595 }
7596
7597 cx = &ccstack[cxix];
7598 if (dbcxp) *dbcxp = cx;
7599
7600 if (CxTYPE(cx) == CXt_SUB || CxTYPE(cx) == CXt_FORMAT) {
7601 const I32 dbcxix = DPPP_dopoptosub_at(ccstack, cxix - 1);
7602 /* We expect that ccstack[dbcxix] is CXt_SUB, anyway, the
7603 field below is defined for any cx. */
7604 /* caller() should not report the automatic calls to &DB::sub */
7605 if (PL_DBsub && GvCV(PL_DBsub) && dbcxix >= 0 && ccstack[dbcxix].blk_sub.cv == GvCV(PL_DBsub))
7606 cx = &ccstack[dbcxix];
7607 }
7608
7609 return cx;
7610 }
7611
7612 # endif
7613 #endif /* caller_cx */
7614 #endif /* 5.6.0 */
7615 #ifndef IN_PERL_COMPILETIME
7616 # define IN_PERL_COMPILETIME (PL_curcop == &PL_compiling)
7617 #endif
7618
7619 #ifndef IN_LOCALE_RUNTIME
7620 # define IN_LOCALE_RUNTIME (PL_curcop->op_private & HINT_LOCALE)
7621 #endif
7622
7623 #ifndef IN_LOCALE_COMPILETIME
7624 # define IN_LOCALE_COMPILETIME (PL_hints & HINT_LOCALE)
7625 #endif
7626
7627 #ifndef IN_LOCALE
7628 # define IN_LOCALE (IN_PERL_COMPILETIME ? IN_LOCALE_COMPILETIME : IN_LOCALE_RUNTIME)
7629 #endif
7630 #ifndef IS_NUMBER_IN_UV
7631 # define IS_NUMBER_IN_UV 0x01
7632 #endif
7633
7634 #ifndef IS_NUMBER_GREATER_THAN_UV_MAX
7635 # define IS_NUMBER_GREATER_THAN_UV_MAX 0x02
7636 #endif
7637
7638 #ifndef IS_NUMBER_NOT_INT
7639 # define IS_NUMBER_NOT_INT 0x04
7640 #endif
7641
7642 #ifndef IS_NUMBER_NEG
7643 # define IS_NUMBER_NEG 0x08
7644 #endif
7645
7646 #ifndef IS_NUMBER_INFINITY
7647 # define IS_NUMBER_INFINITY 0x10
7648 #endif
7649
7650 #ifndef IS_NUMBER_NAN
7651 # define IS_NUMBER_NAN 0x20
7652 #endif
7653 #ifndef GROK_NUMERIC_RADIX
7654 # define GROK_NUMERIC_RADIX(sp, send) grok_numeric_radix(sp, send)
7655 #endif
7656 #ifndef PERL_SCAN_GREATER_THAN_UV_MAX
7657 # define PERL_SCAN_GREATER_THAN_UV_MAX 0x02
7658 #endif
7659
7660 #ifndef PERL_SCAN_SILENT_ILLDIGIT
7661 # define PERL_SCAN_SILENT_ILLDIGIT 0x04
7662 #endif
7663
7664 #ifndef PERL_SCAN_ALLOW_UNDERSCORES
7665 # define PERL_SCAN_ALLOW_UNDERSCORES 0x01
7666 #endif
7667
7668 #ifndef PERL_SCAN_DISALLOW_PREFIX
7669 # define PERL_SCAN_DISALLOW_PREFIX 0x02
7670 #endif
7671
7672 #ifndef grok_numeric_radix
7673 #if defined(NEED_grok_numeric_radix)
7674 static bool DPPP_(my_grok_numeric_radix)(pTHX_ const char ** sp, const char * send);
7675 static
7676 #else
7677 extern bool DPPP_(my_grok_numeric_radix)(pTHX_ const char ** sp, const char * send);
7678 #endif
7679
7680 #if defined(NEED_grok_numeric_radix) || defined(NEED_grok_numeric_radix_GLOBAL)
7681
7682 #ifdef grok_numeric_radix
7683 # undef grok_numeric_radix
7684 #endif
7685 #define grok_numeric_radix(a,b) DPPP_(my_grok_numeric_radix)(aTHX_ a,b)
7686 #define Perl_grok_numeric_radix DPPP_(my_grok_numeric_radix)
7687
7688 bool
7689 DPPP_(my_grok_numeric_radix)(pTHX_ const char **sp, const char *send)
7690 {
7691 #ifdef USE_LOCALE_NUMERIC
7692 #ifdef PL_numeric_radix_sv
7693 if (PL_numeric_radix_sv && IN_LOCALE) {
7694 STRLEN len;
7695 char* radix = SvPV(PL_numeric_radix_sv, len);
7696 if (*sp + len <= send && memEQ(*sp, radix, len)) {
7697 *sp += len;
7698 return TRUE;
7699 }
7700 }
7701 #else
7702 /* older perls don't have PL_numeric_radix_sv so the radix
7703 * must manually be requested from locale.h
7704 */
7705 #include <locale.h>
7706 dTHR; /* needed for older threaded perls */
7707 struct lconv *lc = localeconv();
7708 char *radix = lc->decimal_point;
7709 if (radix && IN_LOCALE) {
7710 STRLEN len = strlen(radix);
7711 if (*sp + len <= send && memEQ(*sp, radix, len)) {
7712 *sp += len;
7713 return TRUE;
7714 }
7715 }
7716 #endif
7717 #endif /* USE_LOCALE_NUMERIC */
7718 /* always try "." if numeric radix didn't match because
7719 * we may have data from different locales mixed */
7720 if (*sp < send && **sp == '.') {
7721 ++*sp;
7722 return TRUE;
7723 }
7724 return FALSE;
7725 }
7726 #endif
7727 #endif
7728
7729 #ifndef grok_number
7730 #if defined(NEED_grok_number)
7731 static int DPPP_(my_grok_number)(pTHX_ const char * pv, STRLEN len, UV * valuep);
7732 static
7733 #else
7734 extern int DPPP_(my_grok_number)(pTHX_ const char * pv, STRLEN len, UV * valuep);
7735 #endif
7736
7737 #if defined(NEED_grok_number) || defined(NEED_grok_number_GLOBAL)
7738
7739 #ifdef grok_number
7740 # undef grok_number
7741 #endif
7742 #define grok_number(a,b,c) DPPP_(my_grok_number)(aTHX_ a,b,c)
7743 #define Perl_grok_number DPPP_(my_grok_number)
7744
7745 int
7746 DPPP_(my_grok_number)(pTHX_ const char *pv, STRLEN len, UV *valuep)
7747 {
7748 const char *s = pv;
7749 const char *send = pv + len;
7750 const UV max_div_10 = UV_MAX / 10;
7751 const char max_mod_10 = UV_MAX % 10;
7752 int numtype = 0;
7753 int sawinf = 0;
7754 int sawnan = 0;
7755
7756 while (s < send && isSPACE(*s))
7757 s++;
7758 if (s == send) {
7759 return 0;
7760 } else if (*s == '-') {
7761 s++;
7762 numtype = IS_NUMBER_NEG;
7763 }
7764 else if (*s == '+')
7765 s++;
7766
7767 if (s == send)
7768 return 0;
7769
7770 /* next must be digit or the radix separator or beginning of infinity */
7771 if (isDIGIT(*s)) {
7772 /* UVs are at least 32 bits, so the first 9 decimal digits cannot
7773 overflow. */
7774 UV value = *s - '0';
7775 /* This construction seems to be more optimiser friendly.
7776 (without it gcc does the isDIGIT test and the *s - '0' separately)
7777 With it gcc on arm is managing 6 instructions (6 cycles) per digit.
7778 In theory the optimiser could deduce how far to unroll the loop
7779 before checking for overflow. */
7780 if (++s < send) {
7781 int digit = *s - '0';
7782 if (digit >= 0 && digit <= 9) {
7783 value = value * 10 + digit;
7784 if (++s < send) {
7785 digit = *s - '0';
7786 if (digit >= 0 && digit <= 9) {
7787 value = value * 10 + digit;
7788 if (++s < send) {
7789 digit = *s - '0';
7790 if (digit >= 0 && digit <= 9) {
7791 value = value * 10 + digit;
7792 if (++s < send) {
7793 digit = *s - '0';
7794 if (digit >= 0 && digit <= 9) {
7795 value = value * 10 + digit;
7796 if (++s < send) {
7797 digit = *s - '0';
7798 if (digit >= 0 && digit <= 9) {
7799 value = value * 10 + digit;
7800 if (++s < send) {
7801 digit = *s - '0';
7802 if (digit >= 0 && digit <= 9) {
7803 value = value * 10 + digit;
7804 if (++s < send) {
7805 digit = *s - '0';
7806 if (digit >= 0 && digit <= 9) {
7807 value = value * 10 + digit;
7808 if (++s < send) {
7809 digit = *s - '0';
7810 if (digit >= 0 && digit <= 9) {
7811 value = value * 10 + digit;
7812 if (++s < send) {
7813 /* Now got 9 digits, so need to check
7814 each time for overflow. */
7815 digit = *s - '0';
7816 while (digit >= 0 && digit <= 9
7817 && (value < max_div_10
7818 || (value == max_div_10
7819 && digit <= max_mod_10))) {
7820 value = value * 10 + digit;
7821 if (++s < send)
7822 digit = *s - '0';
7823 else
7824 break;
7825 }
7826 if (digit >= 0 && digit <= 9
7827 && (s < send)) {
7828 /* value overflowed.
7829 skip the remaining digits, don't
7830 worry about setting *valuep. */
7831 do {
7832 s++;
7833 } while (s < send && isDIGIT(*s));
7834 numtype |=
7835 IS_NUMBER_GREATER_THAN_UV_MAX;
7836 goto skip_value;
7837 }
7838 }
7839 }
7840 }
7841 }
7842 }
7843 }
7844 }
7845 }
7846 }
7847 }
7848 }
7849 }
7850 }
7851 }
7852 }
7853 }
7854 }
7855 numtype |= IS_NUMBER_IN_UV;
7856 if (valuep)
7857 *valuep = value;
7858
7859 skip_value:
7860 if (GROK_NUMERIC_RADIX(&s, send)) {
7861 numtype |= IS_NUMBER_NOT_INT;
7862 while (s < send && isDIGIT(*s)) /* optional digits after the radix */
7863 s++;
7864 }
7865 }
7866 else if (GROK_NUMERIC_RADIX(&s, send)) {
7867 numtype |= IS_NUMBER_NOT_INT | IS_NUMBER_IN_UV; /* valuep assigned below */
7868 /* no digits before the radix means we need digits after it */
7869 if (s < send && isDIGIT(*s)) {
7870 do {
7871 s++;
7872 } while (s < send && isDIGIT(*s));
7873 if (valuep) {
7874 /* integer approximation is valid - it's 0. */
7875 *valuep = 0;
7876 }
7877 }
7878 else
7879 return 0;
7880 } else if (*s == 'I' || *s == 'i') {
7881 s++; if (s == send || (*s != 'N' && *s != 'n')) return 0;
7882 s++; if (s == send || (*s != 'F' && *s != 'f')) return 0;
7883 s++; if (s < send && (*s == 'I' || *s == 'i')) {
7884 s++; if (s == send || (*s != 'N' && *s != 'n')) return 0;
7885 s++; if (s == send || (*s != 'I' && *s != 'i')) return 0;
7886 s++; if (s == send || (*s != 'T' && *s != 't')) return 0;
7887 s++; if (s == send || (*s != 'Y' && *s != 'y')) return 0;
7888 s++;
7889 }
7890 sawinf = 1;
7891 } else if (*s == 'N' || *s == 'n') {
7892 /* XXX TODO: There are signaling NaNs and quiet NaNs. */
7893 s++; if (s == send || (*s != 'A' && *s != 'a')) return 0;
7894 s++; if (s == send || (*s != 'N' && *s != 'n')) return 0;
7895 s++;
7896 sawnan = 1;
7897 } else
7898 return 0;
7899
7900 if (sawinf) {
7901 numtype &= IS_NUMBER_NEG; /* Keep track of sign */
7902 numtype |= IS_NUMBER_INFINITY | IS_NUMBER_NOT_INT;
7903 } else if (sawnan) {
7904 numtype &= IS_NUMBER_NEG; /* Keep track of sign */
7905 numtype |= IS_NUMBER_NAN | IS_NUMBER_NOT_INT;
7906 } else if (s < send) {
7907 /* we can have an optional exponent part */
7908 if (*s == 'e' || *s == 'E') {
7909 /* The only flag we keep is sign. Blow away any "it's UV" */
7910 numtype &= IS_NUMBER_NEG;
7911 numtype |= IS_NUMBER_NOT_INT;
7912 s++;
7913 if (s < send && (*s == '-' || *s == '+'))
7914 s++;
7915 if (s < send && isDIGIT(*s)) {
7916 do {
7917 s++;
7918 } while (s < send && isDIGIT(*s));
7919 }
7920 else
7921 return 0;
7922 }
7923 }
7924 while (s < send && isSPACE(*s))
7925 s++;
7926 if (s >= send)
7927 return numtype;
7928 if (len == 10 && memEQ(pv, "0 but true", 10)) {
7929 if (valuep)
7930 *valuep = 0;
7931 return IS_NUMBER_IN_UV;
7932 }
7933 return 0;
7934 }
7935 #endif
7936 #endif
7937
7938 /*
7939 * The grok_* routines have been modified to use warn() instead of
7940 * Perl_warner(). Also, 'hexdigit' was the former name of PL_hexdigit,
7941 * which is why the stack variable has been renamed to 'xdigit'.
7942 */
7943
7944 #ifndef grok_bin
7945 #if defined(NEED_grok_bin)
7946 static UV DPPP_(my_grok_bin)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
7947 static
7948 #else
7949 extern UV DPPP_(my_grok_bin)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
7950 #endif
7951
7952 #if defined(NEED_grok_bin) || defined(NEED_grok_bin_GLOBAL)
7953
7954 #ifdef grok_bin
7955 # undef grok_bin
7956 #endif
7957 #define grok_bin(a,b,c,d) DPPP_(my_grok_bin)(aTHX_ a,b,c,d)
7958 #define Perl_grok_bin DPPP_(my_grok_bin)
7959
7960 UV
7961 DPPP_(my_grok_bin)(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result)
7962 {
7963 const char *s = start;
7964 STRLEN len = *len_p;
7965 UV value = 0;
7966 NV value_nv = 0;
7967
7968 const UV max_div_2 = UV_MAX / 2;
7969 bool allow_underscores = *flags & PERL_SCAN_ALLOW_UNDERSCORES;
7970 bool overflowed = FALSE;
7971
7972 if (!(*flags & PERL_SCAN_DISALLOW_PREFIX)) {
7973 /* strip off leading b or 0b.
7974 for compatibility silently suffer "b" and "0b" as valid binary
7975 numbers. */
7976 if (len >= 1) {
7977 if (s[0] == 'b') {
7978 s++;
7979 len--;
7980 }
7981 else if (len >= 2 && s[0] == '0' && s[1] == 'b') {
7982 s+=2;
7983 len-=2;
7984 }
7985 }
7986 }
7987
7988 for (; len-- && *s; s++) {
7989 char bit = *s;
7990 if (bit == '0' || bit == '1') {
7991 /* Write it in this wonky order with a goto to attempt to get the
7992 compiler to make the common case integer-only loop pretty tight.
7993 With gcc seems to be much straighter code than old scan_bin. */
7994 redo:
7995 if (!overflowed) {
7996 if (value <= max_div_2) {
7997 value = (value << 1) | (bit - '0');
7998 continue;
7999 }
8000 /* Bah. We're just overflowed. */
8001 warn("Integer overflow in binary number");
8002 overflowed = TRUE;
8003 value_nv = (NV) value;
8004 }
8005 value_nv *= 2.0;
8006 /* If an NV has not enough bits in its mantissa to
8007 * represent a UV this summing of small low-order numbers
8008 * is a waste of time (because the NV cannot preserve
8009 * the low-order bits anyway): we could just remember when
8010 * did we overflow and in the end just multiply value_nv by the
8011 * right amount. */
8012 value_nv += (NV)(bit - '0');
8013 continue;
8014 }
8015 if (bit == '_' && len && allow_underscores && (bit = s[1])
8016 && (bit == '0' || bit == '1'))
8017 {
8018 --len;
8019 ++s;
8020 goto redo;
8021 }
8022 if (!(*flags & PERL_SCAN_SILENT_ILLDIGIT))
8023 warn("Illegal binary digit '%c' ignored", *s);
8024 break;
8025 }
8026
8027 if ( ( overflowed && value_nv > 4294967295.0)
8028 #if UVSIZE > 4
8029 || (!overflowed && value > 0xffffffff )
8030 #endif
8031 ) {
8032 warn("Binary number > 0b11111111111111111111111111111111 non-portable");
8033 }
8034 *len_p = s - start;
8035 if (!overflowed) {
8036 *flags = 0;
8037 return value;
8038 }
8039 *flags = PERL_SCAN_GREATER_THAN_UV_MAX;
8040 if (result)
8041 *result = value_nv;
8042 return UV_MAX;
8043 }
8044 #endif
8045 #endif
8046
8047 #ifndef grok_hex
8048 #if defined(NEED_grok_hex)
8049 static UV DPPP_(my_grok_hex)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
8050 static
8051 #else
8052 extern UV DPPP_(my_grok_hex)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
8053 #endif
8054
8055 #if defined(NEED_grok_hex) || defined(NEED_grok_hex_GLOBAL)
8056
8057 #ifdef grok_hex
8058 # undef grok_hex
8059 #endif
8060 #define grok_hex(a,b,c,d) DPPP_(my_grok_hex)(aTHX_ a,b,c,d)
8061 #define Perl_grok_hex DPPP_(my_grok_hex)
8062
8063 UV
8064 DPPP_(my_grok_hex)(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result)
8065 {
8066 const char *s = start;
8067 STRLEN len = *len_p;
8068 UV value = 0;
8069 NV value_nv = 0;
8070
8071 const UV max_div_16 = UV_MAX / 16;
8072 bool allow_underscores = *flags & PERL_SCAN_ALLOW_UNDERSCORES;
8073 bool overflowed = FALSE;
8074 const char *xdigit;
8075
8076 if (!(*flags & PERL_SCAN_DISALLOW_PREFIX)) {
8077 /* strip off leading x or 0x.
8078 for compatibility silently suffer "x" and "0x" as valid hex numbers.
8079 */
8080 if (len >= 1) {
8081 if (s[0] == 'x') {
8082 s++;
8083 len--;
8084 }
8085 else if (len >= 2 && s[0] == '0' && s[1] == 'x') {
8086 s+=2;
8087 len-=2;
8088 }
8089 }
8090 }
8091
8092 for (; len-- && *s; s++) {
8093 xdigit = strchr((char *) PL_hexdigit, *s);
8094 if (xdigit) {
8095 /* Write it in this wonky order with a goto to attempt to get the
8096 compiler to make the common case integer-only loop pretty tight.
8097 With gcc seems to be much straighter code than old scan_hex. */
8098 redo:
8099 if (!overflowed) {
8100 if (value <= max_div_16) {
8101 value = (value << 4) | ((xdigit - PL_hexdigit) & 15);
8102 continue;
8103 }
8104 warn("Integer overflow in hexadecimal number");
8105 overflowed = TRUE;
8106 value_nv = (NV) value;
8107 }
8108 value_nv *= 16.0;
8109 /* If an NV has not enough bits in its mantissa to
8110 * represent a UV this summing of small low-order numbers
8111 * is a waste of time (because the NV cannot preserve
8112 * the low-order bits anyway): we could just remember when
8113 * did we overflow and in the end just multiply value_nv by the
8114 * right amount of 16-tuples. */
8115 value_nv += (NV)((xdigit - PL_hexdigit) & 15);
8116 continue;
8117 }
8118 if (*s == '_' && len && allow_underscores && s[1]
8119 && (xdigit = strchr((char *) PL_hexdigit, s[1])))
8120 {
8121 --len;
8122 ++s;
8123 goto redo;
8124 }
8125 if (!(*flags & PERL_SCAN_SILENT_ILLDIGIT))
8126 warn("Illegal hexadecimal digit '%c' ignored", *s);
8127 break;
8128 }
8129
8130 if ( ( overflowed && value_nv > 4294967295.0)
8131 #if UVSIZE > 4
8132 || (!overflowed && value > 0xffffffff )
8133 #endif
8134 ) {
8135 warn("Hexadecimal number > 0xffffffff non-portable");
8136 }
8137 *len_p = s - start;
8138 if (!overflowed) {
8139 *flags = 0;
8140 return value;
8141 }
8142 *flags = PERL_SCAN_GREATER_THAN_UV_MAX;
8143 if (result)
8144 *result = value_nv;
8145 return UV_MAX;
8146 }
8147 #endif
8148 #endif
8149
8150 #ifndef grok_oct
8151 #if defined(NEED_grok_oct)
8152 static UV DPPP_(my_grok_oct)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
8153 static
8154 #else
8155 extern UV DPPP_(my_grok_oct)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
8156 #endif
8157
8158 #if defined(NEED_grok_oct) || defined(NEED_grok_oct_GLOBAL)
8159
8160 #ifdef grok_oct
8161 # undef grok_oct
8162 #endif
8163 #define grok_oct(a,b,c,d) DPPP_(my_grok_oct)(aTHX_ a,b,c,d)
8164 #define Perl_grok_oct DPPP_(my_grok_oct)
8165
8166 UV
8167 DPPP_(my_grok_oct)(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result)
8168 {
8169 const char *s = start;
8170 STRLEN len = *len_p;
8171 UV value = 0;
8172 NV value_nv = 0;
8173
8174 const UV max_div_8 = UV_MAX / 8;
8175 bool allow_underscores = *flags & PERL_SCAN_ALLOW_UNDERSCORES;
8176 bool overflowed = FALSE;
8177
8178 for (; len-- && *s; s++) {
8179 /* gcc 2.95 optimiser not smart enough to figure that this subtraction
8180 out front allows slicker code. */
8181 int digit = *s - '0';
8182 if (digit >= 0 && digit <= 7) {
8183 /* Write it in this wonky order with a goto to attempt to get the
8184 compiler to make the common case integer-only loop pretty tight.
8185 */
8186 redo:
8187 if (!overflowed) {
8188 if (value <= max_div_8) {
8189 value = (value << 3) | digit;
8190 continue;
8191 }
8192 /* Bah. We're just overflowed. */
8193 warn("Integer overflow in octal number");
8194 overflowed = TRUE;
8195 value_nv = (NV) value;
8196 }
8197 value_nv *= 8.0;
8198 /* If an NV has not enough bits in its mantissa to
8199 * represent a UV this summing of small low-order numbers
8200 * is a waste of time (because the NV cannot preserve
8201 * the low-order bits anyway): we could just remember when
8202 * did we overflow and in the end just multiply value_nv by the
8203 * right amount of 8-tuples. */
8204 value_nv += (NV)digit;
8205 continue;
8206 }
8207 if (digit == ('_' - '0') && len && allow_underscores
8208 && (digit = s[1] - '0') && (digit >= 0 && digit <= 7))
8209 {
8210 --len;
8211 ++s;
8212 goto redo;
8213 }
8214 /* Allow \octal to work the DWIM way (that is, stop scanning
8215 * as soon as non-octal characters are seen, complain only iff
8216 * someone seems to want to use the digits eight and nine). */
8217 if (digit == 8 || digit == 9) {
8218 if (!(*flags & PERL_SCAN_SILENT_ILLDIGIT))
8219 warn("Illegal octal digit '%c' ignored", *s);
8220 }
8221 break;
8222 }
8223
8224 if ( ( overflowed && value_nv > 4294967295.0)
8225 #if UVSIZE > 4
8226 || (!overflowed && value > 0xffffffff )
8227 #endif
8228 ) {
8229 warn("Octal number > 037777777777 non-portable");
8230 }
8231 *len_p = s - start;
8232 if (!overflowed) {
8233 *flags = 0;
8234 return value;
8235 }
8236 *flags = PERL_SCAN_GREATER_THAN_UV_MAX;
8237 if (result)
8238 *result = value_nv;
8239 return UV_MAX;
8240 }
8241 #endif
8242 #endif
8243
8244 #if !defined(my_snprintf)
8245 #if defined(NEED_my_snprintf)
8246 static int DPPP_(my_my_snprintf)(char * buffer, const Size_t len, const char * format, ...);
8247 static
8248 #else
8249 extern int DPPP_(my_my_snprintf)(char * buffer, const Size_t len, const char * format, ...);
8250 #endif
8251
8252 #if defined(NEED_my_snprintf) || defined(NEED_my_snprintf_GLOBAL)
8253
8254 #define my_snprintf DPPP_(my_my_snprintf)
8255 #define Perl_my_snprintf DPPP_(my_my_snprintf)
8256
8257
8258 int
8259 DPPP_(my_my_snprintf)(char *buffer, const Size_t len, const char *format, ...)
8260 {
8261 dTHX;
8262 int retval;
8263 va_list ap;
8264 va_start(ap, format);
8265 #ifdef HAS_VSNPRINTF
8266 retval = vsnprintf(buffer, len, format, ap);
8267 #else
8268 retval = vsprintf(buffer, format, ap);
8269 #endif
8270 va_end(ap);
8271 if (retval < 0 || (len > 0 && (Size_t)retval >= len))
8272 Perl_croak(aTHX_ "panic: my_snprintf buffer overflow");
8273 return retval;
8274 }
8275
8276 #endif
8277 #endif
8278
8279 #if !defined(my_sprintf)
8280 #if defined(NEED_my_sprintf)
8281 static int DPPP_(my_my_sprintf)(char * buffer, const char * pat, ...);
8282 static
8283 #else
8284 extern int DPPP_(my_my_sprintf)(char * buffer, const char * pat, ...);
8285 #endif
8286
8287 #if defined(NEED_my_sprintf) || defined(NEED_my_sprintf_GLOBAL)
8288
8289 #define my_sprintf DPPP_(my_my_sprintf)
8290 #define Perl_my_sprintf DPPP_(my_my_sprintf)
8291
8292
8293 int
8294 DPPP_(my_my_sprintf)(char *buffer, const char* pat, ...)
8295 {
8296 va_list args;
8297 va_start(args, pat);
8298 vsprintf(buffer, pat, args);
8299 va_end(args);
8300 return strlen(buffer);
8301 }
8302
8303 #endif
8304 #endif
8305
8306 #ifdef NO_XSLOCKS
8307 # ifdef dJMPENV
8308 # define dXCPT dJMPENV; int rEtV = 0
8309 # define XCPT_TRY_START JMPENV_PUSH(rEtV); if (rEtV == 0)
8310 # define XCPT_TRY_END JMPENV_POP;
8311 # define XCPT_CATCH if (rEtV != 0)
8312 # define XCPT_RETHROW JMPENV_JUMP(rEtV)
8313 # else
8314 # define dXCPT Sigjmp_buf oldTOP; int rEtV = 0
8315 # define XCPT_TRY_START Copy(top_env, oldTOP, 1, Sigjmp_buf); rEtV = Sigsetjmp(top_env, 1); if (rEtV == 0)
8316 # define XCPT_TRY_END Copy(oldTOP, top_env, 1, Sigjmp_buf);
8317 # define XCPT_CATCH if (rEtV != 0)
8318 # define XCPT_RETHROW Siglongjmp(top_env, rEtV)
8319 # endif
8320 #endif
8321
8322 #if !defined(my_strlcat)
8323 #if defined(NEED_my_strlcat)
8324 static Size_t DPPP_(my_my_strlcat)(char * dst, const char * src, Size_t size);
8325 static
8326 #else
8327 extern Size_t DPPP_(my_my_strlcat)(char * dst, const char * src, Size_t size);
8328 #endif
8329
8330 #if defined(NEED_my_strlcat) || defined(NEED_my_strlcat_GLOBAL)
8331
8332 #define my_strlcat DPPP_(my_my_strlcat)
8333 #define Perl_my_strlcat DPPP_(my_my_strlcat)
8334
8335
8336 Size_t
8337 DPPP_(my_my_strlcat)(char *dst, const char *src, Size_t size)
8338 {
8339 Size_t used, length, copy;
8340
8341 used = strlen(dst);
8342 length = strlen(src);
8343 if (size > 0 && used < size - 1) {
8344 copy = (length >= size - used) ? size - used - 1 : length;
8345 memcpy(dst + used, src, copy);
8346 dst[used + copy] = '\0';
8347 }
8348 return used + length;
8349 }
8350 #endif
8351 #endif
8352
8353 #if !defined(my_strlcpy)
8354 #if defined(NEED_my_strlcpy)
8355 static Size_t DPPP_(my_my_strlcpy)(char * dst, const char * src, Size_t size);
8356 static
8357 #else
8358 extern Size_t DPPP_(my_my_strlcpy)(char * dst, const char * src, Size_t size);
8359 #endif
8360
8361 #if defined(NEED_my_strlcpy) || defined(NEED_my_strlcpy_GLOBAL)
8362
8363 #define my_strlcpy DPPP_(my_my_strlcpy)
8364 #define Perl_my_strlcpy DPPP_(my_my_strlcpy)
8365
8366
8367 Size_t
8368 DPPP_(my_my_strlcpy)(char *dst, const char *src, Size_t size)
8369 {
8370 Size_t length, copy;
8371
8372 length = strlen(src);
8373 if (size > 0) {
8374 copy = (length >= size) ? size - 1 : length;
8375 memcpy(dst, src, copy);
8376 dst[copy] = '\0';
8377 }
8378 return length;
8379 }
8380
8381 #endif
8382 #endif
8383 #ifndef PERL_PV_ESCAPE_QUOTE
8384 # define PERL_PV_ESCAPE_QUOTE 0x0001
8385 #endif
8386
8387 #ifndef PERL_PV_PRETTY_QUOTE
8388 # define PERL_PV_PRETTY_QUOTE PERL_PV_ESCAPE_QUOTE
8389 #endif
8390
8391 #ifndef PERL_PV_PRETTY_ELLIPSES
8392 # define PERL_PV_PRETTY_ELLIPSES 0x0002
8393 #endif
8394
8395 #ifndef PERL_PV_PRETTY_LTGT
8396 # define PERL_PV_PRETTY_LTGT 0x0004
8397 #endif
8398
8399 #ifndef PERL_PV_ESCAPE_FIRSTCHAR
8400 # define PERL_PV_ESCAPE_FIRSTCHAR 0x0008
8401 #endif
8402
8403 #ifndef PERL_PV_ESCAPE_UNI
8404 # define PERL_PV_ESCAPE_UNI 0x0100
8405 #endif
8406
8407 #ifndef PERL_PV_ESCAPE_UNI_DETECT
8408 # define PERL_PV_ESCAPE_UNI_DETECT 0x0200
8409 #endif
8410
8411 #ifndef PERL_PV_ESCAPE_ALL
8412 # define PERL_PV_ESCAPE_ALL 0x1000
8413 #endif
8414
8415 #ifndef PERL_PV_ESCAPE_NOBACKSLASH
8416 # define PERL_PV_ESCAPE_NOBACKSLASH 0x2000
8417 #endif
8418
8419 #ifndef PERL_PV_ESCAPE_NOCLEAR
8420 # define PERL_PV_ESCAPE_NOCLEAR 0x4000
8421 #endif
8422
8423 #ifndef PERL_PV_ESCAPE_RE
8424 # define PERL_PV_ESCAPE_RE 0x8000
8425 #endif
8426
8427 #ifndef PERL_PV_PRETTY_NOCLEAR
8428 # define PERL_PV_PRETTY_NOCLEAR PERL_PV_ESCAPE_NOCLEAR
8429 #endif
8430 #ifndef PERL_PV_PRETTY_DUMP
8431 # define PERL_PV_PRETTY_DUMP PERL_PV_PRETTY_ELLIPSES|PERL_PV_PRETTY_QUOTE
8432 #endif
8433
8434 #ifndef PERL_PV_PRETTY_REGPROP
8435 # define PERL_PV_PRETTY_REGPROP PERL_PV_PRETTY_ELLIPSES|PERL_PV_PRETTY_LTGT|PERL_PV_ESCAPE_RE
8436 #endif
8437
8438 /* Hint: pv_escape
8439 * Note that unicode functionality is only backported to
8440 * those perl versions that support it. For older perl
8441 * versions, the implementation will fall back to bytes.
8442 */
8443
8444 #ifndef pv_escape
8445 #if defined(NEED_pv_escape)
8446 static char * DPPP_(my_pv_escape)(pTHX_ SV * dsv, char const * const str, const STRLEN count, const STRLEN max, STRLEN * const escaped, const U32 flags);
8447 static
8448 #else
8449 extern char * DPPP_(my_pv_escape)(pTHX_ SV * dsv, char const * const str, const STRLEN count, const STRLEN max, STRLEN * const escaped, const U32 flags);
8450 #endif
8451
8452 #if defined(NEED_pv_escape) || defined(NEED_pv_escape_GLOBAL)
8453
8454 #ifdef pv_escape
8455 # undef pv_escape
8456 #endif
8457 #define pv_escape(a,b,c,d,e,f) DPPP_(my_pv_escape)(aTHX_ a,b,c,d,e,f)
8458 #define Perl_pv_escape DPPP_(my_pv_escape)
8459
8460
8461 char *
8462 DPPP_(my_pv_escape)(pTHX_ SV *dsv, char const * const str,
8463 const STRLEN count, const STRLEN max,
8464 STRLEN * const escaped, const U32 flags)
8465 {
8466 const char esc = flags & PERL_PV_ESCAPE_RE ? '%' : '\\';
8467 const char dq = flags & PERL_PV_ESCAPE_QUOTE ? '"' : esc;
8468 char octbuf[32] = "%123456789ABCDF";
8469 STRLEN wrote = 0;
8470 STRLEN chsize = 0;
8471 STRLEN readsize = 1;
8472 #if defined(is_utf8_string) && defined(utf8_to_uvchr_buf)
8473 bool isuni = flags & PERL_PV_ESCAPE_UNI ? 1 : 0;
8474 #endif
8475 const char *pv = str;
8476 const char * const end = pv + count;
8477 octbuf[0] = esc;
8478
8479 if (!(flags & PERL_PV_ESCAPE_NOCLEAR))
8480 sv_setpvs(dsv, "");
8481
8482 #if defined(is_utf8_string) && defined(utf8_to_uvchr_buf)
8483 if ((flags & PERL_PV_ESCAPE_UNI_DETECT) && is_utf8_string((U8*)pv, count))
8484 isuni = 1;
8485 #endif
8486
8487 for (; pv < end && (!max || wrote < max) ; pv += readsize) {
8488 const UV u =
8489 #if defined(is_utf8_string) && defined(utf8_to_uvchr_buf)
8490 isuni ? utf8_to_uvchr_buf((U8*)pv, end, &readsize) :
8491 #endif
8492 (U8)*pv;
8493 const U8 c = (U8)u & 0xFF;
8494
8495 if (u > 255 || (flags & PERL_PV_ESCAPE_ALL)) {
8496 if (flags & PERL_PV_ESCAPE_FIRSTCHAR)
8497 chsize = my_snprintf(octbuf, sizeof octbuf,
8498 "%" UVxf, u);
8499 else
8500 chsize = my_snprintf(octbuf, sizeof octbuf,
8501 "%cx{%" UVxf "}", esc, u);
8502 } else if (flags & PERL_PV_ESCAPE_NOBACKSLASH) {
8503 chsize = 1;
8504 } else {
8505 if (c == dq || c == esc || !isPRINT(c)) {
8506 chsize = 2;
8507 switch (c) {
8508 case '\\' : /* fallthrough */
8509 case '%' : if (c == esc)
8510 octbuf[1] = esc;
8511 else
8512 chsize = 1;
8513 break;
8514 case '\v' : octbuf[1] = 'v'; break;
8515 case '\t' : octbuf[1] = 't'; break;
8516 case '\r' : octbuf[1] = 'r'; break;
8517 case '\n' : octbuf[1] = 'n'; break;
8518 case '\f' : octbuf[1] = 'f'; break;
8519 case '"' : if (dq == '"')
8520 octbuf[1] = '"';
8521 else
8522 chsize = 1;
8523 break;
8524 default: chsize = my_snprintf(octbuf, sizeof octbuf,
8525 pv < end && isDIGIT((U8)*(pv+readsize))
8526 ? "%c%03o" : "%c%o", esc, c);
8527 }
8528 } else {
8529 chsize = 1;
8530 }
8531 }
8532 if (max && wrote + chsize > max) {
8533 break;
8534 } else if (chsize > 1) {
8535 sv_catpvn(dsv, octbuf, chsize);
8536 wrote += chsize;
8537 } else {
8538 char tmp[2];
8539 my_snprintf(tmp, sizeof tmp, "%c", c);
8540 sv_catpvn(dsv, tmp, 1);
8541 wrote++;
8542 }
8543 if (flags & PERL_PV_ESCAPE_FIRSTCHAR)
8544 break;
8545 }
8546 if (escaped != NULL)
8547 *escaped= pv - str;
8548 return SvPVX(dsv);
8549 }
8550
8551 #endif
8552 #endif
8553
8554 #ifndef pv_pretty
8555 #if defined(NEED_pv_pretty)
8556 static char * DPPP_(my_pv_pretty)(pTHX_ SV * dsv, char const * const str, const STRLEN count, const STRLEN max, char const * const start_color, char const * const end_color, const U32 flags);
8557 static
8558 #else
8559 extern char * DPPP_(my_pv_pretty)(pTHX_ SV * dsv, char const * const str, const STRLEN count, const STRLEN max, char const * const start_color, char const * const end_color, const U32 flags);
8560 #endif
8561
8562 #if defined(NEED_pv_pretty) || defined(NEED_pv_pretty_GLOBAL)
8563
8564 #ifdef pv_pretty
8565 # undef pv_pretty
8566 #endif
8567 #define pv_pretty(a,b,c,d,e,f,g) DPPP_(my_pv_pretty)(aTHX_ a,b,c,d,e,f,g)
8568 #define Perl_pv_pretty DPPP_(my_pv_pretty)
8569
8570
8571 char *
8572 DPPP_(my_pv_pretty)(pTHX_ SV *dsv, char const * const str, const STRLEN count,
8573 const STRLEN max, char const * const start_color, char const * const end_color,
8574 const U32 flags)
8575 {
8576 const U8 dq = (flags & PERL_PV_PRETTY_QUOTE) ? '"' : '%';
8577 STRLEN escaped;
8578
8579 if (!(flags & PERL_PV_PRETTY_NOCLEAR))
8580 sv_setpvs(dsv, "");
8581
8582 if (dq == '"')
8583 sv_catpvs(dsv, "\"");
8584 else if (flags & PERL_PV_PRETTY_LTGT)
8585 sv_catpvs(dsv, "<");
8586
8587 if (start_color != NULL)
8588 sv_catpv(dsv, D_PPP_CONSTPV_ARG(start_color));
8589
8590 pv_escape(dsv, str, count, max, &escaped, flags | PERL_PV_ESCAPE_NOCLEAR);
8591
8592 if (end_color != NULL)
8593 sv_catpv(dsv, D_PPP_CONSTPV_ARG(end_color));
8594
8595 if (dq == '"')
8596 sv_catpvs(dsv, "\"");
8597 else if (flags & PERL_PV_PRETTY_LTGT)
8598 sv_catpvs(dsv, ">");
8599
8600 if ((flags & PERL_PV_PRETTY_ELLIPSES) && escaped < count)
8601 sv_catpvs(dsv, "...");
8602
8603 return SvPVX(dsv);
8604 }
8605
8606 #endif
8607 #endif
8608
8609 #ifndef pv_display
8610 #if defined(NEED_pv_display)
8611 static char * DPPP_(my_pv_display)(pTHX_ SV * dsv, const char * pv, STRLEN cur, STRLEN len, STRLEN pvlim);
8612 static
8613 #else
8614 extern char * DPPP_(my_pv_display)(pTHX_ SV * dsv, const char * pv, STRLEN cur, STRLEN len, STRLEN pvlim);
8615 #endif
8616
8617 #if defined(NEED_pv_display) || defined(NEED_pv_display_GLOBAL)
8618
8619 #ifdef pv_display
8620 # undef pv_display
8621 #endif
8622 #define pv_display(a,b,c,d,e) DPPP_(my_pv_display)(aTHX_ a,b,c,d,e)
8623 #define Perl_pv_display DPPP_(my_pv_display)
8624
8625
8626 char *
8627 DPPP_(my_pv_display)(pTHX_ SV *dsv, const char *pv, STRLEN cur, STRLEN len, STRLEN pvlim)
8628 {
8629 pv_pretty(dsv, pv, cur, pvlim, NULL, NULL, PERL_PV_PRETTY_DUMP);
8630 if (len > cur && pv[cur] == '\0')
8631 sv_catpvs(dsv, "\\0");
8632 return SvPVX(dsv);
8633 }
8634
8635 #endif
8636 #endif
3478637
3488638 #endif /* _P_P_PORTABILITY_H_ */
8639
8640 /* End of File ppport.h */
99 use warnings ;
1010
1111 use Test::More ;
12 use util ;
1213
1314 BEGIN
1415 {
1920
2021 plan tests => 1 + $extra ;
2122
22 use_ok('BerkeleyDB', '0.63');
23 use_ok('BerkeleyDB', '0.64');
2324 }
2425
2526 if (defined $BerkeleyDB::VERSION)
2627 {
2728 my $ver = BerkeleyDB::DB_VERSION_STRING();
29 my $has_heap = 'Not Available' ;
30 if ($BerkeleyDB::db_version >= 5.1)
31 {
32 $has_heap = BerkeleyDB::has_heap() ? 'True' : 'False';
33 }
34
35 # Is encryption support available?
36 my $has_encryption = 'Not Available';
37
38 if ($BerkeleyDB::db_version >= 4.1)
39 {
40 my $env = new BerkeleyDB::Env @StdErrFile,
41 -Encrypt => {Password => "abc",
42 Flags => DB_ENCRYPT_AES
43 };
44
45 $has_encryption = 'True';
46 $has_encryption = 'False'
47 if $BerkeleyDB::Error =~ /Operation not supported/;
48 }
2849
2950 diag <<EOM ;
3051
3455 BerkeleyDB::db_version $BerkeleyDB::db_version
3556 BerkeleyDB::db_ver $BerkeleyDB::db_ver
3657
58 Heap Support $has_heap
59 Encryption Support $has_encryption
60
3761 EOM
3862 }