PageRenderTime 88ms CodeModel.GetById 16ms RepoModel.GetById 1ms app.codeStats 0ms

/src/ppport.h

http://github.com/PerlGameDev/SDL
C Header | 7142 lines | 3122 code | 586 blank | 3434 comment | 447 complexity | 05306bce4ac57b2115976f9b202c3229 MD5 | raw file
Possible License(s): AGPL-1.0, GPL-2.0
  1. #if 0
  2. <<'SKIP';
  3. #endif
  4. /*
  5. ----------------------------------------------------------------------
  6. ppport.h -- Perl/Pollution/Portability Version 3.19_02
  7. Automatically created by Devel::PPPort running under perl 5.012002.
  8. Do NOT edit this file directly! -- Edit PPPort_pm.PL and the
  9. includes in parts/inc/ instead.
  10. Use 'perldoc ppport.h' to view the documentation below.
  11. ----------------------------------------------------------------------
  12. SKIP
  13. =pod
  14. =head1 NAME
  15. ppport.h - Perl/Pollution/Portability version 3.19_02
  16. =head1 SYNOPSIS
  17. perl ppport.h [options] [source files]
  18. Searches current directory for files if no [source files] are given
  19. --help show short help
  20. --version show version
  21. --patch=file write one patch file with changes
  22. --copy=suffix write changed copies with suffix
  23. --diff=program use diff program and options
  24. --compat-version=version provide compatibility with Perl version
  25. --cplusplus accept C++ comments
  26. --quiet don't output anything except fatal errors
  27. --nodiag don't show diagnostics
  28. --nohints don't show hints
  29. --nochanges don't suggest changes
  30. --nofilter don't filter input files
  31. --strip strip all script and doc functionality from
  32. ppport.h
  33. --list-provided list provided API
  34. --list-unsupported list unsupported API
  35. --api-info=name show Perl API portability information
  36. =head1 COMPATIBILITY
  37. This version of F<ppport.h> is designed to support operation with Perl
  38. installations back to 5.003, and has been tested up to 5.11.5.
  39. =head1 OPTIONS
  40. =head2 --help
  41. Display a brief usage summary.
  42. =head2 --version
  43. Display the version of F<ppport.h>.
  44. =head2 --patch=I<file>
  45. If this option is given, a single patch file will be created if
  46. any changes are suggested. This requires a working diff program
  47. to be installed on your system.
  48. =head2 --copy=I<suffix>
  49. If this option is given, a copy of each file will be saved with
  50. the given suffix that contains the suggested changes. This does
  51. not require any external programs. Note that this does not
  52. automagially add a dot between the original filename and the
  53. suffix. If you want the dot, you have to include it in the option
  54. argument.
  55. If neither C<--patch> or C<--copy> are given, the default is to
  56. simply print the diffs for each file. This requires either
  57. C<Text::Diff> or a C<diff> program to be installed.
  58. =head2 --diff=I<program>
  59. Manually set the diff program and options to use. The default
  60. is to use C<Text::Diff>, when installed, and output unified
  61. context diffs.
  62. =head2 --compat-version=I<version>
  63. Tell F<ppport.h> to check for compatibility with the given
  64. Perl version. The default is to check for compatibility with Perl
  65. version 5.003. You can use this option to reduce the output
  66. of F<ppport.h> if you intend to be backward compatible only
  67. down to a certain Perl version.
  68. =head2 --cplusplus
  69. Usually, F<ppport.h> will detect C++ style comments and
  70. replace them with C style comments for portability reasons.
  71. Using this option instructs F<ppport.h> to leave C++
  72. comments untouched.
  73. =head2 --quiet
  74. Be quiet. Don't print anything except fatal errors.
  75. =head2 --nodiag
  76. Don't output any diagnostic messages. Only portability
  77. alerts will be printed.
  78. =head2 --nohints
  79. Don't output any hints. Hints often contain useful portability
  80. notes. Warnings will still be displayed.
  81. =head2 --nochanges
  82. Don't suggest any changes. Only give diagnostic output and hints
  83. unless these are also deactivated.
  84. =head2 --nofilter
  85. Don't filter the list of input files. By default, files not looking
  86. like source code (i.e. not *.xs, *.c, *.cc, *.cpp or *.h) are skipped.
  87. =head2 --strip
  88. Strip all script and documentation functionality from F<ppport.h>.
  89. This reduces the size of F<ppport.h> dramatically and may be useful
  90. if you want to include F<ppport.h> in smaller modules without
  91. increasing their distribution size too much.
  92. The stripped F<ppport.h> will have a C<--unstrip> option that allows
  93. you to undo the stripping, but only if an appropriate C<Devel::PPPort>
  94. module is installed.
  95. =head2 --list-provided
  96. Lists the API elements for which compatibility is provided by
  97. F<ppport.h>. Also lists if it must be explicitly requested,
  98. if it has dependencies, and if there are hints or warnings for it.
  99. =head2 --list-unsupported
  100. Lists the API elements that are known not to be supported by
  101. F<ppport.h> and below which version of Perl they probably
  102. won't be available or work.
  103. =head2 --api-info=I<name>
  104. Show portability information for API elements matching I<name>.
  105. If I<name> is surrounded by slashes, it is interpreted as a regular
  106. expression.
  107. =head1 DESCRIPTION
  108. In order for a Perl extension (XS) module to be as portable as possible
  109. across differing versions of Perl itself, certain steps need to be taken.
  110. =over 4
  111. =item *
  112. Including this header is the first major one. This alone will give you
  113. access to a large part of the Perl API that hasn't been available in
  114. earlier Perl releases. Use
  115. perl ppport.h --list-provided
  116. to see which API elements are provided by ppport.h.
  117. =item *
  118. You should avoid using deprecated parts of the API. For example, using
  119. global Perl variables without the C<PL_> prefix is deprecated. Also,
  120. some API functions used to have a C<perl_> prefix. Using this form is
  121. also deprecated. You can safely use the supported API, as F<ppport.h>
  122. will provide wrappers for older Perl versions.
  123. =item *
  124. If you use one of a few functions or variables that were not present in
  125. earlier versions of Perl, and that can't be provided using a macro, you
  126. have to explicitly request support for these functions by adding one or
  127. more C<#define>s in your source code before the inclusion of F<ppport.h>.
  128. These functions or variables will be marked C<explicit> in the list shown
  129. by C<--list-provided>.
  130. Depending on whether you module has a single or multiple files that
  131. use such functions or variables, you want either C<static> or global
  132. variants.
  133. For a C<static> function or variable (used only in a single source
  134. file), use:
  135. #define NEED_function
  136. #define NEED_variable
  137. For a global function or variable (used in multiple source files),
  138. use:
  139. #define NEED_function_GLOBAL
  140. #define NEED_variable_GLOBAL
  141. Note that you mustn't have more than one global request for the
  142. same function or variable in your project.
  143. Function / Variable Static Request Global Request
  144. -----------------------------------------------------------------------------------------
  145. PL_parser NEED_PL_parser NEED_PL_parser_GLOBAL
  146. PL_signals NEED_PL_signals NEED_PL_signals_GLOBAL
  147. eval_pv() NEED_eval_pv NEED_eval_pv_GLOBAL
  148. grok_bin() NEED_grok_bin NEED_grok_bin_GLOBAL
  149. grok_hex() NEED_grok_hex NEED_grok_hex_GLOBAL
  150. grok_number() NEED_grok_number NEED_grok_number_GLOBAL
  151. grok_numeric_radix() NEED_grok_numeric_radix NEED_grok_numeric_radix_GLOBAL
  152. grok_oct() NEED_grok_oct NEED_grok_oct_GLOBAL
  153. load_module() NEED_load_module NEED_load_module_GLOBAL
  154. my_snprintf() NEED_my_snprintf NEED_my_snprintf_GLOBAL
  155. my_sprintf() NEED_my_sprintf NEED_my_sprintf_GLOBAL
  156. my_strlcat() NEED_my_strlcat NEED_my_strlcat_GLOBAL
  157. my_strlcpy() NEED_my_strlcpy NEED_my_strlcpy_GLOBAL
  158. newCONSTSUB() NEED_newCONSTSUB NEED_newCONSTSUB_GLOBAL
  159. newRV_noinc() NEED_newRV_noinc NEED_newRV_noinc_GLOBAL
  160. newSV_type() NEED_newSV_type NEED_newSV_type_GLOBAL
  161. newSVpvn_flags() NEED_newSVpvn_flags NEED_newSVpvn_flags_GLOBAL
  162. newSVpvn_share() NEED_newSVpvn_share NEED_newSVpvn_share_GLOBAL
  163. pv_display() NEED_pv_display NEED_pv_display_GLOBAL
  164. pv_escape() NEED_pv_escape NEED_pv_escape_GLOBAL
  165. pv_pretty() NEED_pv_pretty NEED_pv_pretty_GLOBAL
  166. sv_2pv_flags() NEED_sv_2pv_flags NEED_sv_2pv_flags_GLOBAL
  167. sv_2pvbyte() NEED_sv_2pvbyte NEED_sv_2pvbyte_GLOBAL
  168. sv_catpvf_mg() NEED_sv_catpvf_mg NEED_sv_catpvf_mg_GLOBAL
  169. sv_catpvf_mg_nocontext() NEED_sv_catpvf_mg_nocontext NEED_sv_catpvf_mg_nocontext_GLOBAL
  170. sv_pvn_force_flags() NEED_sv_pvn_force_flags NEED_sv_pvn_force_flags_GLOBAL
  171. sv_setpvf_mg() NEED_sv_setpvf_mg NEED_sv_setpvf_mg_GLOBAL
  172. sv_setpvf_mg_nocontext() NEED_sv_setpvf_mg_nocontext NEED_sv_setpvf_mg_nocontext_GLOBAL
  173. vload_module() NEED_vload_module NEED_vload_module_GLOBAL
  174. vnewSVpvf() NEED_vnewSVpvf NEED_vnewSVpvf_GLOBAL
  175. warner() NEED_warner NEED_warner_GLOBAL
  176. To avoid namespace conflicts, you can change the namespace of the
  177. explicitly exported functions / variables using the C<DPPP_NAMESPACE>
  178. macro. Just C<#define> the macro before including C<ppport.h>:
  179. #define DPPP_NAMESPACE MyOwnNamespace_
  180. #include "ppport.h"
  181. The default namespace is C<DPPP_>.
  182. =back
  183. The good thing is that most of the above can be checked by running
  184. F<ppport.h> on your source code. See the next section for
  185. details.
  186. =head1 EXAMPLES
  187. To verify whether F<ppport.h> is needed for your module, whether you
  188. should make any changes to your code, and whether any special defines
  189. should be used, F<ppport.h> can be run as a Perl script to check your
  190. source code. Simply say:
  191. perl ppport.h
  192. The result will usually be a list of patches suggesting changes
  193. that should at least be acceptable, if not necessarily the most
  194. efficient solution, or a fix for all possible problems.
  195. If you know that your XS module uses features only available in
  196. newer Perl releases, if you're aware that it uses C++ comments,
  197. and if you want all suggestions as a single patch file, you could
  198. use something like this:
  199. perl ppport.h --compat-version=5.6.0 --cplusplus --patch=test.diff
  200. If you only want your code to be scanned without any suggestions
  201. for changes, use:
  202. perl ppport.h --nochanges
  203. You can specify a different C<diff> program or options, using
  204. the C<--diff> option:
  205. perl ppport.h --diff='diff -C 10'
  206. This would output context diffs with 10 lines of context.
  207. If you want to create patched copies of your files instead, use:
  208. perl ppport.h --copy=.new
  209. To display portability information for the C<newSVpvn> function,
  210. use:
  211. perl ppport.h --api-info=newSVpvn
  212. Since the argument to C<--api-info> can be a regular expression,
  213. you can use
  214. perl ppport.h --api-info=/_nomg$/
  215. to display portability information for all C<_nomg> functions or
  216. perl ppport.h --api-info=/./
  217. to display information for all known API elements.
  218. =head1 BUGS
  219. If this version of F<ppport.h> is causing failure during
  220. the compilation of this module, please check if newer versions
  221. of either this module or C<Devel::PPPort> are available on CPAN
  222. before sending a bug report.
  223. If F<ppport.h> was generated using the latest version of
  224. C<Devel::PPPort> and is causing failure of this module, please
  225. file a bug report using the CPAN Request Tracker at L<http://rt.cpan.org/>.
  226. Please include the following information:
  227. =over 4
  228. =item 1.
  229. The complete output from running "perl -V"
  230. =item 2.
  231. This file.
  232. =item 3.
  233. The name and version of the module you were trying to build.
  234. =item 4.
  235. A full log of the build that failed.
  236. =item 5.
  237. Any other information that you think could be relevant.
  238. =back
  239. For the latest version of this code, please get the C<Devel::PPPort>
  240. module from CPAN.
  241. =head1 COPYRIGHT
  242. Version 3.x, Copyright (c) 2004-2010, Marcus Holland-Moritz.
  243. Version 2.x, Copyright (C) 2001, Paul Marquess.
  244. Version 1.x, Copyright (C) 1999, Kenneth Albanowski.
  245. This program is free software; you can redistribute it and/or
  246. modify it under the same terms as Perl itself.
  247. =head1 SEE ALSO
  248. See L<Devel::PPPort>.
  249. =cut
  250. use strict;
  251. # Disable broken TRIE-optimization
  252. BEGIN { eval '${^RE_TRIE_MAXBUF} = -1' if $] >= 5.009004 && $] <= 5.009005 }
  253. my $VERSION = 3.19_02;
  254. my %opt = (
  255. quiet => 0,
  256. diag => 1,
  257. hints => 1,
  258. changes => 1,
  259. cplusplus => 0,
  260. filter => 1,
  261. strip => 0,
  262. version => 0,
  263. );
  264. my($ppport) = $0 =~ /([\w.]+)$/;
  265. my $LF = '(?:\r\n|[\r\n])'; # line feed
  266. my $HS = "[ \t]"; # horizontal whitespace
  267. # Never use C comments in this file!
  268. my $ccs = '/'.'*';
  269. my $cce = '*'.'/';
  270. my $rccs = quotemeta $ccs;
  271. my $rcce = quotemeta $cce;
  272. eval {
  273. require Getopt::Long;
  274. Getopt::Long::GetOptions(\%opt, qw(
  275. help quiet diag! filter! hints! changes! cplusplus strip version
  276. patch=s copy=s diff=s compat-version=s
  277. list-provided list-unsupported api-info=s
  278. )) or usage();
  279. };
  280. if ($@ and grep /^-/, @ARGV) {
  281. usage() if "@ARGV" =~ /^--?h(?:elp)?$/;
  282. die "Getopt::Long not found. Please don't use any options.\n";
  283. }
  284. if ($opt{version}) {
  285. print "This is $0 $VERSION.\n";
  286. exit 0;
  287. }
  288. usage() if $opt{help};
  289. strip() if $opt{strip};
  290. if (exists $opt{'compat-version'}) {
  291. my($r,$v,$s) = eval { parse_version($opt{'compat-version'}) };
  292. if ($@) {
  293. die "Invalid version number format: '$opt{'compat-version'}'\n";
  294. }
  295. die "Only Perl 5 is supported\n" if $r != 5;
  296. die "Invalid version number: $opt{'compat-version'}\n" if $v >= 1000 || $s >= 1000;
  297. $opt{'compat-version'} = sprintf "%d.%03d%03d", $r, $v, $s;
  298. }
  299. else {
  300. $opt{'compat-version'} = 5;
  301. }
  302. my %API = map { /^(\w+)\|([^|]*)\|([^|]*)\|(\w*)$/
  303. ? ( $1 => {
  304. ($2 ? ( base => $2 ) : ()),
  305. ($3 ? ( todo => $3 ) : ()),
  306. (index($4, 'v') >= 0 ? ( varargs => 1 ) : ()),
  307. (index($4, 'p') >= 0 ? ( provided => 1 ) : ()),
  308. (index($4, 'n') >= 0 ? ( nothxarg => 1 ) : ()),
  309. } )
  310. : die "invalid spec: $_" } qw(
  311. AvFILLp|5.004050||p
  312. AvFILL|||
  313. CLASS|||n
  314. CPERLscope|5.005000||p
  315. CX_CURPAD_SAVE|||
  316. CX_CURPAD_SV|||
  317. CopFILEAV|5.006000||p
  318. CopFILEGV_set|5.006000||p
  319. CopFILEGV|5.006000||p
  320. CopFILESV|5.006000||p
  321. CopFILE_set|5.006000||p
  322. CopFILE|5.006000||p
  323. CopSTASHPV_set|5.006000||p
  324. CopSTASHPV|5.006000||p
  325. CopSTASH_eq|5.006000||p
  326. CopSTASH_set|5.006000||p
  327. CopSTASH|5.006000||p
  328. CopyD|5.009002||p
  329. Copy|||
  330. CvPADLIST|||
  331. CvSTASH|||
  332. CvWEAKOUTSIDE|||
  333. DEFSV_set|5.010001||p
  334. DEFSV|5.004050||p
  335. END_EXTERN_C|5.005000||p
  336. ENTER|||
  337. ERRSV|5.004050||p
  338. EXTEND|||
  339. EXTERN_C|5.005000||p
  340. F0convert|||n
  341. FREETMPS|||
  342. GIMME_V||5.004000|n
  343. GIMME|||n
  344. GROK_NUMERIC_RADIX|5.007002||p
  345. G_ARRAY|||
  346. G_DISCARD|||
  347. G_EVAL|||
  348. G_METHOD|5.006001||p
  349. G_NOARGS|||
  350. G_SCALAR|||
  351. G_VOID||5.004000|
  352. GetVars|||
  353. GvSVn|5.009003||p
  354. GvSV|||
  355. Gv_AMupdate||5.011000|
  356. HEf_SVKEY||5.004000|
  357. HeHASH||5.004000|
  358. HeKEY||5.004000|
  359. HeKLEN||5.004000|
  360. HePV||5.004000|
  361. HeSVKEY_force||5.004000|
  362. HeSVKEY_set||5.004000|
  363. HeSVKEY||5.004000|
  364. HeUTF8||5.010001|
  365. HeVAL||5.004000|
  366. HvNAMELEN_get|5.009003||p
  367. HvNAME_get|5.009003||p
  368. HvNAME|||
  369. INT2PTR|5.006000||p
  370. IN_LOCALE_COMPILETIME|5.007002||p
  371. IN_LOCALE_RUNTIME|5.007002||p
  372. IN_LOCALE|5.007002||p
  373. IN_PERL_COMPILETIME|5.008001||p
  374. IS_NUMBER_GREATER_THAN_UV_MAX|5.007002||p
  375. IS_NUMBER_INFINITY|5.007002||p
  376. IS_NUMBER_IN_UV|5.007002||p
  377. IS_NUMBER_NAN|5.007003||p
  378. IS_NUMBER_NEG|5.007002||p
  379. IS_NUMBER_NOT_INT|5.007002||p
  380. IVSIZE|5.006000||p
  381. IVTYPE|5.006000||p
  382. IVdf|5.006000||p
  383. LEAVE|||
  384. LVRET|||
  385. MARK|||
  386. MULTICALL||5.011005|
  387. MY_CXT_CLONE|5.009002||p
  388. MY_CXT_INIT|5.007003||p
  389. MY_CXT|5.007003||p
  390. MoveD|5.009002||p
  391. Move|||
  392. NOOP|5.005000||p
  393. NUM2PTR|5.006000||p
  394. NVTYPE|5.006000||p
  395. NVef|5.006001||p
  396. NVff|5.006001||p
  397. NVgf|5.006001||p
  398. Newxc|5.009003||p
  399. Newxz|5.009003||p
  400. Newx|5.009003||p
  401. Nullav|||
  402. Nullch|||
  403. Nullcv|||
  404. Nullhv|||
  405. Nullsv|||
  406. ORIGMARK|||
  407. PAD_BASE_SV|||
  408. PAD_CLONE_VARS|||
  409. PAD_COMPNAME_FLAGS|||
  410. PAD_COMPNAME_GEN_set|||
  411. PAD_COMPNAME_GEN|||
  412. PAD_COMPNAME_OURSTASH|||
  413. PAD_COMPNAME_PV|||
  414. PAD_COMPNAME_TYPE|||
  415. PAD_DUP|||
  416. PAD_RESTORE_LOCAL|||
  417. PAD_SAVE_LOCAL|||
  418. PAD_SAVE_SETNULLPAD|||
  419. PAD_SETSV|||
  420. PAD_SET_CUR_NOSAVE|||
  421. PAD_SET_CUR|||
  422. PAD_SVl|||
  423. PAD_SV|||
  424. PERLIO_FUNCS_CAST|5.009003||p
  425. PERLIO_FUNCS_DECL|5.009003||p
  426. PERL_ABS|5.008001||p
  427. PERL_BCDVERSION|5.011004||p
  428. PERL_GCC_BRACE_GROUPS_FORBIDDEN|5.008001||p
  429. PERL_HASH|5.004000||p
  430. PERL_INT_MAX|5.004000||p
  431. PERL_INT_MIN|5.004000||p
  432. PERL_LONG_MAX|5.004000||p
  433. PERL_LONG_MIN|5.004000||p
  434. PERL_MAGIC_arylen|5.007002||p
  435. PERL_MAGIC_backref|5.007002||p
  436. PERL_MAGIC_bm|5.007002||p
  437. PERL_MAGIC_collxfrm|5.007002||p
  438. PERL_MAGIC_dbfile|5.007002||p
  439. PERL_MAGIC_dbline|5.007002||p
  440. PERL_MAGIC_defelem|5.007002||p
  441. PERL_MAGIC_envelem|5.007002||p
  442. PERL_MAGIC_env|5.007002||p
  443. PERL_MAGIC_ext|5.007002||p
  444. PERL_MAGIC_fm|5.007002||p
  445. PERL_MAGIC_glob|5.011004||p
  446. PERL_MAGIC_isaelem|5.007002||p
  447. PERL_MAGIC_isa|5.007002||p
  448. PERL_MAGIC_mutex|5.011004||p
  449. PERL_MAGIC_nkeys|5.007002||p
  450. PERL_MAGIC_overload_elem|5.007002||p
  451. PERL_MAGIC_overload_table|5.007002||p
  452. PERL_MAGIC_overload|5.007002||p
  453. PERL_MAGIC_pos|5.007002||p
  454. PERL_MAGIC_qr|5.007002||p
  455. PERL_MAGIC_regdata|5.007002||p
  456. PERL_MAGIC_regdatum|5.007002||p
  457. PERL_MAGIC_regex_global|5.007002||p
  458. PERL_MAGIC_shared_scalar|5.007003||p
  459. PERL_MAGIC_shared|5.007003||p
  460. PERL_MAGIC_sigelem|5.007002||p
  461. PERL_MAGIC_sig|5.007002||p
  462. PERL_MAGIC_substr|5.007002||p
  463. PERL_MAGIC_sv|5.007002||p
  464. PERL_MAGIC_taint|5.007002||p
  465. PERL_MAGIC_tiedelem|5.007002||p
  466. PERL_MAGIC_tiedscalar|5.007002||p
  467. PERL_MAGIC_tied|5.007002||p
  468. PERL_MAGIC_utf8|5.008001||p
  469. PERL_MAGIC_uvar_elem|5.007003||p
  470. PERL_MAGIC_uvar|5.007002||p
  471. PERL_MAGIC_vec|5.007002||p
  472. PERL_MAGIC_vstring|5.008001||p
  473. PERL_PV_ESCAPE_ALL|5.009004||p
  474. PERL_PV_ESCAPE_FIRSTCHAR|5.009004||p
  475. PERL_PV_ESCAPE_NOBACKSLASH|5.009004||p
  476. PERL_PV_ESCAPE_NOCLEAR|5.009004||p
  477. PERL_PV_ESCAPE_QUOTE|5.009004||p
  478. PERL_PV_ESCAPE_RE|5.009005||p
  479. PERL_PV_ESCAPE_UNI_DETECT|5.009004||p
  480. PERL_PV_ESCAPE_UNI|5.009004||p
  481. PERL_PV_PRETTY_DUMP|5.009004||p
  482. PERL_PV_PRETTY_ELLIPSES|5.010000||p
  483. PERL_PV_PRETTY_LTGT|5.009004||p
  484. PERL_PV_PRETTY_NOCLEAR|5.010000||p
  485. PERL_PV_PRETTY_QUOTE|5.009004||p
  486. PERL_PV_PRETTY_REGPROP|5.009004||p
  487. PERL_QUAD_MAX|5.004000||p
  488. PERL_QUAD_MIN|5.004000||p
  489. PERL_REVISION|5.006000||p
  490. PERL_SCAN_ALLOW_UNDERSCORES|5.007003||p
  491. PERL_SCAN_DISALLOW_PREFIX|5.007003||p
  492. PERL_SCAN_GREATER_THAN_UV_MAX|5.007003||p
  493. PERL_SCAN_SILENT_ILLDIGIT|5.008001||p
  494. PERL_SHORT_MAX|5.004000||p
  495. PERL_SHORT_MIN|5.004000||p
  496. PERL_SIGNALS_UNSAFE_FLAG|5.008001||p
  497. PERL_SUBVERSION|5.006000||p
  498. PERL_SYS_INIT3||5.006000|
  499. PERL_SYS_INIT|||
  500. PERL_SYS_TERM||5.011005|
  501. PERL_UCHAR_MAX|5.004000||p
  502. PERL_UCHAR_MIN|5.004000||p
  503. PERL_UINT_MAX|5.004000||p
  504. PERL_UINT_MIN|5.004000||p
  505. PERL_ULONG_MAX|5.004000||p
  506. PERL_ULONG_MIN|5.004000||p
  507. PERL_UNUSED_ARG|5.009003||p
  508. PERL_UNUSED_CONTEXT|5.009004||p
  509. PERL_UNUSED_DECL|5.007002||p
  510. PERL_UNUSED_VAR|5.007002||p
  511. PERL_UQUAD_MAX|5.004000||p
  512. PERL_UQUAD_MIN|5.004000||p
  513. PERL_USE_GCC_BRACE_GROUPS|5.009004||p
  514. PERL_USHORT_MAX|5.004000||p
  515. PERL_USHORT_MIN|5.004000||p
  516. PERL_VERSION|5.006000||p
  517. PL_DBsignal|5.005000||p
  518. PL_DBsingle|||pn
  519. PL_DBsub|||pn
  520. PL_DBtrace|||pn
  521. PL_Sv|5.005000||p
  522. PL_bufend|5.011004||p
  523. PL_bufptr|5.011004||p
  524. PL_compiling|5.004050||p
  525. PL_copline|5.011004||p
  526. PL_curcop|5.004050||p
  527. PL_curstash|5.004050||p
  528. PL_debstash|5.004050||p
  529. PL_defgv|5.004050||p
  530. PL_diehook|5.004050||p
  531. PL_dirty|5.004050||p
  532. PL_dowarn|||pn
  533. PL_errgv|5.004050||p
  534. PL_error_count|5.011004||p
  535. PL_expect|5.011004||p
  536. PL_hexdigit|5.005000||p
  537. PL_hints|5.005000||p
  538. PL_in_my_stash|5.011004||p
  539. PL_in_my|5.011004||p
  540. PL_keyword_plugin||5.011002|
  541. PL_last_in_gv|||n
  542. PL_laststatval|5.005000||p
  543. PL_lex_state|5.011004||p
  544. PL_lex_stuff|5.011004||p
  545. PL_linestr|5.011004||p
  546. PL_modglobal||5.005000|n
  547. PL_na|5.004050||pn
  548. PL_no_modify|5.006000||p
  549. PL_ofsgv|||n
  550. PL_opfreehook||5.011000|n
  551. PL_parser|5.009005|5.009005|p
  552. PL_perl_destruct_level|5.004050||p
  553. PL_perldb|5.004050||p
  554. PL_ppaddr|5.006000||p
  555. PL_rsfp_filters|5.004050||p
  556. PL_rsfp|5.004050||p
  557. PL_rs|||n
  558. PL_signals|5.008001||p
  559. PL_stack_base|5.004050||p
  560. PL_stack_sp|5.004050||p
  561. PL_statcache|5.005000||p
  562. PL_stdingv|5.004050||p
  563. PL_sv_arenaroot|5.004050||p
  564. PL_sv_no|5.004050||pn
  565. PL_sv_undef|5.004050||pn
  566. PL_sv_yes|5.004050||pn
  567. PL_tainted|5.004050||p
  568. PL_tainting|5.004050||p
  569. PL_tokenbuf|5.011004||p
  570. POP_MULTICALL||5.011005|
  571. POPi|||n
  572. POPl|||n
  573. POPn|||n
  574. POPpbytex||5.007001|n
  575. POPpx||5.005030|n
  576. POPp|||n
  577. POPs|||n
  578. PTR2IV|5.006000||p
  579. PTR2NV|5.006000||p
  580. PTR2UV|5.006000||p
  581. PTR2nat|5.009003||p
  582. PTR2ul|5.007001||p
  583. PTRV|5.006000||p
  584. PUSHMARK|||
  585. PUSH_MULTICALL||5.011005|
  586. PUSHi|||
  587. PUSHmortal|5.009002||p
  588. PUSHn|||
  589. PUSHp|||
  590. PUSHs|||
  591. PUSHu|5.004000||p
  592. PUTBACK|||
  593. PerlIO_clearerr||5.007003|
  594. PerlIO_close||5.007003|
  595. PerlIO_context_layers||5.009004|
  596. PerlIO_eof||5.007003|
  597. PerlIO_error||5.007003|
  598. PerlIO_fileno||5.007003|
  599. PerlIO_fill||5.007003|
  600. PerlIO_flush||5.007003|
  601. PerlIO_get_base||5.007003|
  602. PerlIO_get_bufsiz||5.007003|
  603. PerlIO_get_cnt||5.007003|
  604. PerlIO_get_ptr||5.007003|
  605. PerlIO_read||5.007003|
  606. PerlIO_seek||5.007003|
  607. PerlIO_set_cnt||5.007003|
  608. PerlIO_set_ptrcnt||5.007003|
  609. PerlIO_setlinebuf||5.007003|
  610. PerlIO_stderr||5.007003|
  611. PerlIO_stdin||5.007003|
  612. PerlIO_stdout||5.007003|
  613. PerlIO_tell||5.007003|
  614. PerlIO_unread||5.007003|
  615. PerlIO_write||5.007003|
  616. Perl_signbit||5.009005|n
  617. PoisonFree|5.009004||p
  618. PoisonNew|5.009004||p
  619. PoisonWith|5.009004||p
  620. Poison|5.008000||p
  621. RETVAL|||n
  622. Renewc|||
  623. Renew|||
  624. SAVECLEARSV|||
  625. SAVECOMPPAD|||
  626. SAVEPADSV|||
  627. SAVETMPS|||
  628. SAVE_DEFSV|5.004050||p
  629. SPAGAIN|||
  630. SP|||
  631. START_EXTERN_C|5.005000||p
  632. START_MY_CXT|5.007003||p
  633. STMT_END|||p
  634. STMT_START|||p
  635. STR_WITH_LEN|5.009003||p
  636. ST|||
  637. SV_CONST_RETURN|5.009003||p
  638. SV_COW_DROP_PV|5.008001||p
  639. SV_COW_SHARED_HASH_KEYS|5.009005||p
  640. SV_GMAGIC|5.007002||p
  641. SV_HAS_TRAILING_NUL|5.009004||p
  642. SV_IMMEDIATE_UNREF|5.007001||p
  643. SV_MUTABLE_RETURN|5.009003||p
  644. SV_NOSTEAL|5.009002||p
  645. SV_SMAGIC|5.009003||p
  646. SV_UTF8_NO_ENCODING|5.008001||p
  647. SVfARG|5.009005||p
  648. SVf_UTF8|5.006000||p
  649. SVf|5.006000||p
  650. SVt_IV|||
  651. SVt_NV|||
  652. SVt_PVAV|||
  653. SVt_PVCV|||
  654. SVt_PVHV|||
  655. SVt_PVMG|||
  656. SVt_PV|||
  657. Safefree|||
  658. Slab_Alloc|||
  659. Slab_Free|||
  660. Slab_to_rw|||
  661. StructCopy|||
  662. SvCUR_set|||
  663. SvCUR|||
  664. SvEND|||
  665. SvGAMAGIC||5.006001|
  666. SvGETMAGIC|5.004050||p
  667. SvGROW|||
  668. SvIOK_UV||5.006000|
  669. SvIOK_notUV||5.006000|
  670. SvIOK_off|||
  671. SvIOK_only_UV||5.006000|
  672. SvIOK_only|||
  673. SvIOK_on|||
  674. SvIOKp|||
  675. SvIOK|||
  676. SvIVX|||
  677. SvIV_nomg|5.009001||p
  678. SvIV_set|||
  679. SvIVx|||
  680. SvIV|||
  681. SvIsCOW_shared_hash||5.008003|
  682. SvIsCOW||5.008003|
  683. SvLEN_set|||
  684. SvLEN|||
  685. SvLOCK||5.007003|
  686. SvMAGIC_set|5.009003||p
  687. SvNIOK_off|||
  688. SvNIOKp|||
  689. SvNIOK|||
  690. SvNOK_off|||
  691. SvNOK_only|||
  692. SvNOK_on|||
  693. SvNOKp|||
  694. SvNOK|||
  695. SvNVX|||
  696. SvNV_set|||
  697. SvNVx|||
  698. SvNV|||
  699. SvOK|||
  700. SvOOK_offset||5.011000|
  701. SvOOK|||
  702. SvPOK_off|||
  703. SvPOK_only_UTF8||5.006000|
  704. SvPOK_only|||
  705. SvPOK_on|||
  706. SvPOKp|||
  707. SvPOK|||
  708. SvPVX_const|5.009003||p
  709. SvPVX_mutable|5.009003||p
  710. SvPVX|||
  711. SvPV_const|5.009003||p
  712. SvPV_flags_const_nolen|5.009003||p
  713. SvPV_flags_const|5.009003||p
  714. SvPV_flags_mutable|5.009003||p
  715. SvPV_flags|5.007002||p
  716. SvPV_force_flags_mutable|5.009003||p
  717. SvPV_force_flags_nolen|5.009003||p
  718. SvPV_force_flags|5.007002||p
  719. SvPV_force_mutable|5.009003||p
  720. SvPV_force_nolen|5.009003||p
  721. SvPV_force_nomg_nolen|5.009003||p
  722. SvPV_force_nomg|5.007002||p
  723. SvPV_force|||p
  724. SvPV_mutable|5.009003||p
  725. SvPV_nolen_const|5.009003||p
  726. SvPV_nolen|5.006000||p
  727. SvPV_nomg_const_nolen|5.009003||p
  728. SvPV_nomg_const|5.009003||p
  729. SvPV_nomg|5.007002||p
  730. SvPV_renew|5.009003||p
  731. SvPV_set|||
  732. SvPVbyte_force||5.009002|
  733. SvPVbyte_nolen||5.006000|
  734. SvPVbytex_force||5.006000|
  735. SvPVbytex||5.006000|
  736. SvPVbyte|5.006000||p
  737. SvPVutf8_force||5.006000|
  738. SvPVutf8_nolen||5.006000|
  739. SvPVutf8x_force||5.006000|
  740. SvPVutf8x||5.006000|
  741. SvPVutf8||5.006000|
  742. SvPVx|||
  743. SvPV|||
  744. SvREFCNT_dec|||
  745. SvREFCNT_inc_NN|5.009004||p
  746. SvREFCNT_inc_simple_NN|5.009004||p
  747. SvREFCNT_inc_simple_void_NN|5.009004||p
  748. SvREFCNT_inc_simple_void|5.009004||p
  749. SvREFCNT_inc_simple|5.009004||p
  750. SvREFCNT_inc_void_NN|5.009004||p
  751. SvREFCNT_inc_void|5.009004||p
  752. SvREFCNT_inc|||p
  753. SvREFCNT|||
  754. SvROK_off|||
  755. SvROK_on|||
  756. SvROK|||
  757. SvRV_set|5.009003||p
  758. SvRV|||
  759. SvRXOK||5.009005|
  760. SvRX||5.009005|
  761. SvSETMAGIC|||
  762. SvSHARED_HASH|5.009003||p
  763. SvSHARE||5.007003|
  764. SvSTASH_set|5.009003||p
  765. SvSTASH|||
  766. SvSetMagicSV_nosteal||5.004000|
  767. SvSetMagicSV||5.004000|
  768. SvSetSV_nosteal||5.004000|
  769. SvSetSV|||
  770. SvTAINTED_off||5.004000|
  771. SvTAINTED_on||5.004000|
  772. SvTAINTED||5.004000|
  773. SvTAINT|||
  774. SvTRUE|||
  775. SvTYPE|||
  776. SvUNLOCK||5.007003|
  777. SvUOK|5.007001|5.006000|p
  778. SvUPGRADE|||
  779. SvUTF8_off||5.006000|
  780. SvUTF8_on||5.006000|
  781. SvUTF8||5.006000|
  782. SvUVXx|5.004000||p
  783. SvUVX|5.004000||p
  784. SvUV_nomg|5.009001||p
  785. SvUV_set|5.009003||p
  786. SvUVx|5.004000||p
  787. SvUV|5.004000||p
  788. SvVOK||5.008001|
  789. SvVSTRING_mg|5.009004||p
  790. THIS|||n
  791. UNDERBAR|5.009002||p
  792. UTF8_MAXBYTES|5.009002||p
  793. UVSIZE|5.006000||p
  794. UVTYPE|5.006000||p
  795. UVXf|5.007001||p
  796. UVof|5.006000||p
  797. UVuf|5.006000||p
  798. UVxf|5.006000||p
  799. WARN_ALL|5.006000||p
  800. WARN_AMBIGUOUS|5.006000||p
  801. WARN_ASSERTIONS|5.011004||p
  802. WARN_BAREWORD|5.006000||p
  803. WARN_CLOSED|5.006000||p
  804. WARN_CLOSURE|5.006000||p
  805. WARN_DEBUGGING|5.006000||p
  806. WARN_DEPRECATED|5.006000||p
  807. WARN_DIGIT|5.006000||p
  808. WARN_EXEC|5.006000||p
  809. WARN_EXITING|5.006000||p
  810. WARN_GLOB|5.006000||p
  811. WARN_INPLACE|5.006000||p
  812. WARN_INTERNAL|5.006000||p
  813. WARN_IO|5.006000||p
  814. WARN_LAYER|5.008000||p
  815. WARN_MALLOC|5.006000||p
  816. WARN_MISC|5.006000||p
  817. WARN_NEWLINE|5.006000||p
  818. WARN_NUMERIC|5.006000||p
  819. WARN_ONCE|5.006000||p
  820. WARN_OVERFLOW|5.006000||p
  821. WARN_PACK|5.006000||p
  822. WARN_PARENTHESIS|5.006000||p
  823. WARN_PIPE|5.006000||p
  824. WARN_PORTABLE|5.006000||p
  825. WARN_PRECEDENCE|5.006000||p
  826. WARN_PRINTF|5.006000||p
  827. WARN_PROTOTYPE|5.006000||p
  828. WARN_QW|5.006000||p
  829. WARN_RECURSION|5.006000||p
  830. WARN_REDEFINE|5.006000||p
  831. WARN_REGEXP|5.006000||p
  832. WARN_RESERVED|5.006000||p
  833. WARN_SEMICOLON|5.006000||p
  834. WARN_SEVERE|5.006000||p
  835. WARN_SIGNAL|5.006000||p
  836. WARN_SUBSTR|5.006000||p
  837. WARN_SYNTAX|5.006000||p
  838. WARN_TAINT|5.006000||p
  839. WARN_THREADS|5.008000||p
  840. WARN_UNINITIALIZED|5.006000||p
  841. WARN_UNOPENED|5.006000||p
  842. WARN_UNPACK|5.006000||p
  843. WARN_UNTIE|5.006000||p
  844. WARN_UTF8|5.006000||p
  845. WARN_VOID|5.006000||p
  846. XCPT_CATCH|5.009002||p
  847. XCPT_RETHROW|5.009002||p
  848. XCPT_TRY_END|5.009002||p
  849. XCPT_TRY_START|5.009002||p
  850. XPUSHi|||
  851. XPUSHmortal|5.009002||p
  852. XPUSHn|||
  853. XPUSHp|||
  854. XPUSHs|||
  855. XPUSHu|5.004000||p
  856. XSPROTO|5.010000||p
  857. XSRETURN_EMPTY|||
  858. XSRETURN_IV|||
  859. XSRETURN_NO|||
  860. XSRETURN_NV|||
  861. XSRETURN_PV|||
  862. XSRETURN_UNDEF|||
  863. XSRETURN_UV|5.008001||p
  864. XSRETURN_YES|||
  865. XSRETURN|||p
  866. XST_mIV|||
  867. XST_mNO|||
  868. XST_mNV|||
  869. XST_mPV|||
  870. XST_mUNDEF|||
  871. XST_mUV|5.008001||p
  872. XST_mYES|||
  873. XS_VERSION_BOOTCHECK|||
  874. XS_VERSION|||
  875. XSprePUSH|5.006000||p
  876. XS|||
  877. ZeroD|5.009002||p
  878. Zero|||
  879. _aMY_CXT|5.007003||p
  880. _pMY_CXT|5.007003||p
  881. aMY_CXT_|5.007003||p
  882. aMY_CXT|5.007003||p
  883. aTHXR_|5.011004||p
  884. aTHXR|5.011004||p
  885. aTHX_|5.006000||p
  886. aTHX|5.006000||p
  887. add_data|||n
  888. add_utf16_textfilter|||
  889. addmad|||
  890. allocmy|||
  891. amagic_call|||
  892. amagic_cmp_locale|||
  893. amagic_cmp|||
  894. amagic_i_ncmp|||
  895. amagic_ncmp|||
  896. anonymise_cv|||
  897. any_dup|||
  898. ao|||
  899. append_elem|||
  900. append_list|||
  901. append_madprops|||
  902. apply_attrs_my|||
  903. apply_attrs_string||5.006001|
  904. apply_attrs|||
  905. apply|||
  906. atfork_lock||5.007003|n
  907. atfork_unlock||5.007003|n
  908. av_arylen_p||5.009003|
  909. av_clear|||
  910. av_create_and_push||5.009005|
  911. av_create_and_unshift_one||5.009005|
  912. av_delete||5.006000|
  913. av_exists||5.006000|
  914. av_extend|||
  915. av_fetch|||
  916. av_fill|||
  917. av_iter_p||5.011000|
  918. av_len|||
  919. av_make|||
  920. av_pop|||
  921. av_push|||
  922. av_reify|||
  923. av_shift|||
  924. av_store|||
  925. av_undef|||
  926. av_unshift|||
  927. ax|||n
  928. bad_type|||
  929. bind_match|||
  930. block_end|||
  931. block_gimme||5.004000|
  932. block_start|||
  933. boolSV|5.004000||p
  934. boot_core_PerlIO|||
  935. boot_core_UNIVERSAL|||
  936. boot_core_mro|||
  937. bytes_from_utf8||5.007001|
  938. bytes_to_uni|||n
  939. bytes_to_utf8||5.006001|
  940. call_argv|5.006000||p
  941. call_atexit||5.006000|
  942. call_list||5.004000|
  943. call_method|5.006000||p
  944. call_pv|5.006000||p
  945. call_sv|5.006000||p
  946. calloc||5.007002|n
  947. cando|||
  948. cast_i32||5.006000|
  949. cast_iv||5.006000|
  950. cast_ulong||5.006000|
  951. cast_uv||5.006000|
  952. check_type_and_open|||
  953. check_uni|||
  954. checkcomma|||
  955. checkposixcc|||
  956. ckWARN|5.006000||p
  957. ck_anoncode|||
  958. ck_bitop|||
  959. ck_concat|||
  960. ck_defined|||
  961. ck_delete|||
  962. ck_die|||
  963. ck_each|||
  964. ck_eof|||
  965. ck_eval|||
  966. ck_exec|||
  967. ck_exists|||
  968. ck_exit|||
  969. ck_ftst|||
  970. ck_fun|||
  971. ck_glob|||
  972. ck_grep|||
  973. ck_index|||
  974. ck_join|||
  975. ck_lfun|||
  976. ck_listiob|||
  977. ck_match|||
  978. ck_method|||
  979. ck_null|||
  980. ck_open|||
  981. ck_readline|||
  982. ck_repeat|||
  983. ck_require|||
  984. ck_return|||
  985. ck_rfun|||
  986. ck_rvconst|||
  987. ck_sassign|||
  988. ck_select|||
  989. ck_shift|||
  990. ck_sort|||
  991. ck_spair|||
  992. ck_split|||
  993. ck_subr|||
  994. ck_substr|||
  995. ck_svconst|||
  996. ck_trunc|||
  997. ck_unpack|||
  998. ck_warner_d||5.011001|v
  999. ck_warner||5.011001|v
  1000. ckwarn_common|||
  1001. ckwarn_d||5.009003|
  1002. ckwarn||5.009003|
  1003. cl_and|||n
  1004. cl_anything|||n
  1005. cl_init_zero|||n
  1006. cl_init|||n
  1007. cl_is_anything|||n
  1008. cl_or|||n
  1009. clear_placeholders|||
  1010. closest_cop|||
  1011. convert|||
  1012. cop_free|||
  1013. cr_textfilter|||
  1014. create_eval_scope|||
  1015. croak_nocontext|||vn
  1016. croak_xs_usage||5.010001|
  1017. croak|||v
  1018. csighandler||5.009003|n
  1019. curmad|||
  1020. custom_op_desc||5.007003|
  1021. custom_op_name||5.007003|
  1022. cv_ckproto_len|||
  1023. cv_clone|||
  1024. cv_const_sv||5.004000|
  1025. cv_dump|||
  1026. cv_undef|||
  1027. cx_dump||5.005000|
  1028. cx_dup|||
  1029. cxinc|||
  1030. dAXMARK|5.009003||p
  1031. dAX|5.007002||p
  1032. dITEMS|5.007002||p
  1033. dMARK|||
  1034. dMULTICALL||5.009003|
  1035. dMY_CXT_SV|5.007003||p
  1036. dMY_CXT|5.007003||p
  1037. dNOOP|5.006000||p
  1038. dORIGMARK|||
  1039. dSP|||
  1040. dTHR|5.004050||p
  1041. dTHXR|5.011004||p
  1042. dTHXa|5.006000||p
  1043. dTHXoa|5.006000||p
  1044. dTHX|5.006000||p
  1045. dUNDERBAR|5.009002||p
  1046. dVAR|5.009003||p
  1047. dXCPT|5.009002||p
  1048. dXSARGS|||
  1049. dXSI32|||
  1050. dXSTARG|5.006000||p
  1051. deb_curcv|||
  1052. deb_nocontext|||vn
  1053. deb_stack_all|||
  1054. deb_stack_n|||
  1055. debop||5.005000|
  1056. debprofdump||5.005000|
  1057. debprof|||
  1058. debstackptrs||5.007003|
  1059. debstack||5.007003|
  1060. debug_start_match|||
  1061. deb||5.007003|v
  1062. del_sv|||
  1063. delete_eval_scope|||
  1064. delimcpy||5.004000|n
  1065. deprecate_commaless_var_list|||
  1066. despatch_signals||5.007001|
  1067. destroy_matcher|||
  1068. die_nocontext|||vn
  1069. die_where|||
  1070. die|||v
  1071. dirp_dup|||
  1072. div128|||
  1073. djSP|||
  1074. do_aexec5|||
  1075. do_aexec|||
  1076. do_aspawn|||
  1077. do_binmode||5.004050|
  1078. do_chomp|||
  1079. do_chop|||
  1080. do_close|||
  1081. do_delete_local|||
  1082. do_dump_pad|||
  1083. do_eof|||
  1084. do_exec3|||
  1085. do_execfree|||
  1086. do_exec|||
  1087. do_gv_dump||5.006000|
  1088. do_gvgv_dump||5.006000|
  1089. do_hv_dump||5.006000|
  1090. do_ipcctl|||
  1091. do_ipcget|||
  1092. do_join|||
  1093. do_kv|||
  1094. do_magic_dump||5.006000|
  1095. do_msgrcv|||
  1096. do_msgsnd|||
  1097. do_oddball|||
  1098. do_op_dump||5.006000|
  1099. do_op_xmldump|||
  1100. do_open9||5.006000|
  1101. do_openn||5.007001|
  1102. do_open||5.004000|
  1103. do_pmop_dump||5.006000|
  1104. do_pmop_xmldump|||
  1105. do_print|||
  1106. do_readline|||
  1107. do_seek|||
  1108. do_semop|||
  1109. do_shmio|||
  1110. do_smartmatch|||
  1111. do_spawn_nowait|||
  1112. do_spawn|||
  1113. do_sprintf|||
  1114. do_sv_dump||5.006000|
  1115. do_sysseek|||
  1116. do_tell|||
  1117. do_trans_complex_utf8|||
  1118. do_trans_complex|||
  1119. do_trans_count_utf8|||
  1120. do_trans_count|||
  1121. do_trans_simple_utf8|||
  1122. do_trans_simple|||
  1123. do_trans|||
  1124. do_vecget|||
  1125. do_vecset|||
  1126. do_vop|||
  1127. docatch|||
  1128. doeval|||
  1129. dofile|||
  1130. dofindlabel|||
  1131. doform|||
  1132. doing_taint||5.008001|n
  1133. dooneliner|||
  1134. doopen_pm|||
  1135. doparseform|||
  1136. dopoptoeval|||
  1137. dopoptogiven|||
  1138. dopoptolabel|||
  1139. dopoptoloop|||
  1140. dopoptosub_at|||
  1141. dopoptowhen|||
  1142. doref||5.009003|
  1143. dounwind|||
  1144. dowantarray|||
  1145. dump_all_perl|||
  1146. dump_all||5.006000|
  1147. dump_eval||5.006000|
  1148. dump_exec_pos|||
  1149. dump_fds|||
  1150. dump_form||5.006000|
  1151. dump_indent||5.006000|v
  1152. dump_mstats|||
  1153. dump_packsubs_perl|||
  1154. dump_packsubs||5.006000|
  1155. dump_sub_perl|||
  1156. dump_sub||5.006000|
  1157. dump_sv_child|||
  1158. dump_trie_interim_list|||
  1159. dump_trie_interim_table|||
  1160. dump_trie|||
  1161. dump_vindent||5.006000|
  1162. dumpuntil|||
  1163. dup_attrlist|||
  1164. emulate_cop_io|||
  1165. eval_pv|5.006000||p
  1166. eval_sv|5.006000||p
  1167. exec_failed|||
  1168. expect_number|||
  1169. fbm_compile||5.005000|
  1170. fbm_instr||5.005000|
  1171. feature_is_enabled|||
  1172. fetch_cop_label||5.011000|
  1173. filter_add|||
  1174. filter_del|||
  1175. filter_gets|||
  1176. filter_read|||
  1177. find_and_forget_pmops|||
  1178. find_array_subscript|||
  1179. find_beginning|||
  1180. find_byclass|||
  1181. find_hash_subscript|||
  1182. find_in_my_stash|||
  1183. find_runcv||5.008001|
  1184. find_rundefsvoffset||5.009002|
  1185. find_script|||
  1186. find_uninit_var|||
  1187. first_symbol|||n
  1188. fold_constants|||
  1189. forbid_setid|||
  1190. force_ident|||
  1191. force_list|||
  1192. force_next|||
  1193. force_strict_version|||
  1194. force_version|||
  1195. force_word|||
  1196. forget_pmop|||
  1197. form_nocontext|||vn
  1198. form||5.004000|v
  1199. fp_dup|||
  1200. fprintf_nocontext|||vn
  1201. free_global_struct|||
  1202. free_tied_hv_pool|||
  1203. free_tmps|||
  1204. gen_constant_list|||
  1205. get_arena|||
  1206. get_aux_mg|||
  1207. get_av|5.006000||p
  1208. get_context||5.006000|n
  1209. get_cvn_flags|5.009005||p
  1210. get_cvs|5.011000||p
  1211. get_cv|5.006000||p
  1212. get_db_sub|||
  1213. get_debug_opts|||
  1214. get_hash_seed|||
  1215. get_hv|5.006000||p
  1216. get_isa_hash|||
  1217. get_mstats|||
  1218. get_no_modify|||
  1219. get_num|||
  1220. get_op_descs||5.005000|
  1221. get_op_names||5.005000|
  1222. get_opargs|||
  1223. get_ppaddr||5.006000|
  1224. get_re_arg|||
  1225. get_sv|5.006000||p
  1226. get_vtbl||5.005030|
  1227. getcwd_sv||5.007002|
  1228. getenv_len|||
  1229. glob_2number|||
  1230. glob_assign_glob|||
  1231. glob_assign_ref|||
  1232. gp_dup|||
  1233. gp_free|||
  1234. gp_ref|||
  1235. grok_bin|5.007003||p
  1236. grok_hex|5.007003||p
  1237. grok_number|5.007002||p
  1238. grok_numeric_radix|5.007002||p
  1239. grok_oct|5.007003||p
  1240. group_end|||
  1241. gv_AVadd|||
  1242. gv_HVadd|||
  1243. gv_IOadd|||
  1244. gv_SVadd|||
  1245. gv_add_by_type||5.011000|
  1246. gv_autoload4||5.004000|
  1247. gv_check|||
  1248. gv_const_sv||5.009003|
  1249. gv_dump||5.006000|
  1250. gv_efullname3||5.004000|
  1251. gv_efullname4||5.006001|
  1252. gv_efullname|||
  1253. gv_ename|||
  1254. gv_fetchfile_flags||5.009005|
  1255. gv_fetchfile|||
  1256. gv_fetchmeth_autoload||5.007003|
  1257. gv_fetchmethod_autoload||5.004000|
  1258. gv_fetchmethod_flags||5.011000|
  1259. gv_fetchmethod|||
  1260. gv_fetchmeth|||
  1261. gv_fetchpvn_flags|5.009002||p
  1262. gv_fetchpvs|5.009004||p
  1263. gv_fetchpv|||
  1264. gv_fetchsv|5.009002||p
  1265. gv_fullname3||5.004000|
  1266. gv_fullname4||5.006001|
  1267. gv_fullname|||
  1268. gv_get_super_pkg|||
  1269. gv_handler||5.007001|
  1270. gv_init_sv|||
  1271. gv_init|||
  1272. gv_name_set||5.009004|
  1273. gv_stashpvn|5.004000||p
  1274. gv_stashpvs|5.009003||p
  1275. gv_stashpv|||
  1276. gv_stashsv|||
  1277. gv_try_downgrade||5.011002|
  1278. he_dup|||
  1279. hek_dup|||
  1280. hfreeentries|||
  1281. hsplit|||
  1282. hv_assert|||
  1283. hv_auxinit|||n
  1284. hv_backreferences_p|||
  1285. hv_clear_placeholders||5.009001|
  1286. hv_clear|||
  1287. hv_common_key_len||5.010000|
  1288. hv_common||5.010000|
  1289. hv_copy_hints_hv|||
  1290. hv_delayfree_ent||5.004000|
  1291. hv_delete_common|||
  1292. hv_delete_ent||5.004000|
  1293. hv_delete|||
  1294. hv_eiter_p||5.009003|
  1295. hv_eiter_set||5.009003|
  1296. hv_exists_ent||5.004000|
  1297. hv_exists|||
  1298. hv_fetch_ent||5.004000|
  1299. hv_fetchs|5.009003||p
  1300. hv_fetch|||
  1301. hv_free_ent||5.004000|
  1302. hv_iterinit|||
  1303. hv_iterkeysv||5.004000|
  1304. hv_iterkey|||
  1305. hv_iternext_flags||5.008000|
  1306. hv_iternextsv|||
  1307. hv_iternext|||
  1308. hv_iterval|||
  1309. hv_kill_backrefs|||
  1310. hv_ksplit||5.004000|
  1311. hv_magic_check|||n
  1312. hv_magic|||
  1313. hv_name_set||5.009003|
  1314. hv_notallowed|||
  1315. hv_placeholders_get||5.009003|
  1316. hv_placeholders_p||5.009003|
  1317. hv_placeholders_set||5.009003|
  1318. hv_riter_p||5.009003|
  1319. hv_riter_set||5.009003|
  1320. hv_scalar||5.009001|
  1321. hv_store_ent||5.004000|
  1322. hv_store_flags||5.008000|
  1323. hv_stores|5.009004||p
  1324. hv_store|||
  1325. hv_undef|||
  1326. ibcmp_locale||5.004000|n
  1327. ibcmp_utf8||5.007003|
  1328. ibcmp|||n
  1329. incline|||
  1330. incpush_if_exists|||
  1331. incpush_use_sep|||
  1332. incpush|||
  1333. ingroup|||
  1334. init_argv_symbols|||
  1335. init_debugger|||
  1336. init_global_struct|||
  1337. init_i18nl10n||5.006000|
  1338. init_i18nl14n||5.006000|
  1339. init_ids|||
  1340. init_interp|||
  1341. init_main_stash|||
  1342. init_perllib|||
  1343. init_postdump_symbols|||
  1344. init_predump_symbols|||
  1345. init_stacks||5.005000|
  1346. init_tm||5.007002|
  1347. instr|||n
  1348. intro_my|||
  1349. intuit_method|||
  1350. intuit_more|||
  1351. invert|||
  1352. io_close|||
  1353. isALNUMC|5.006000||p
  1354. isALNUM|||
  1355. isALPHA|||
  1356. isASCII|5.006000||p
  1357. isBLANK|5.006001||p
  1358. isCNTRL|5.006000||p
  1359. isDIGIT|||
  1360. isGRAPH|5.006000||p
  1361. isGV_with_GP|5.009004||p
  1362. isLOWER|||
  1363. isPRINT|5.004000||p
  1364. isPSXSPC|5.006001||p
  1365. isPUNCT|5.006000||p
  1366. isSPACE|||
  1367. isUPPER|||
  1368. isXDIGIT|5.006000||p
  1369. is_an_int|||
  1370. is_ascii_string||5.011000|n
  1371. is_gv_magical_sv|||
  1372. is_handle_constructor|||n
  1373. is_inplace_av|||
  1374. is_list_assignment|||
  1375. is_lvalue_sub||5.007001|
  1376. is_uni_alnum_lc||5.006000|
  1377. is_uni_alnum||5.006000|
  1378. is_uni_alpha_lc||5.006000|
  1379. is_uni_alpha||5.006000|
  1380. is_uni_ascii_lc||5.006000|
  1381. is_uni_ascii||5.006000|
  1382. is_uni_cntrl_lc||5.006000|
  1383. is_uni_cntrl||5.006000|
  1384. is_uni_digit_lc||5.006000|
  1385. is_uni_digit||5.006000|
  1386. is_uni_graph_lc||5.006000|
  1387. is_uni_graph||5.006000|
  1388. is_uni_idfirst_lc||5.006000|
  1389. is_uni_idfirst||5.006000|
  1390. is_uni_lower_lc||5.006000|
  1391. is_uni_lower||5.006000|
  1392. is_uni_print_lc||5.006000|
  1393. is_uni_print||5.006000|
  1394. is_uni_punct_lc||5.006000|
  1395. is_uni_punct||5.006000|
  1396. is_uni_space_lc||5.006000|
  1397. is_uni_space||5.006000|
  1398. is_uni_upper_lc||5.006000|
  1399. is_uni_upper||5.006000|
  1400. is_uni_xdigit_lc||5.006000|
  1401. is_uni_xdigit||5.006000|
  1402. is_utf8_X_LVT|||
  1403. is_utf8_X_LV_LVT_V|||
  1404. is_utf8_X_LV|||
  1405. is_utf8_X_L|||
  1406. is_utf8_X_T|||
  1407. is_utf8_X_V|||
  1408. is_utf8_X_begin|||
  1409. is_utf8_X_extend|||
  1410. is_utf8_X_non_hangul|||
  1411. is_utf8_X_prepend|||
  1412. is_utf8_alnum||5.006000|
  1413. is_utf8_alpha||5.006000|
  1414. is_utf8_ascii||5.006000|
  1415. is_utf8_char_slow|||n
  1416. is_utf8_char||5.006000|n
  1417. is_utf8_cntrl||5.006000|
  1418. is_utf8_common|||
  1419. is_utf8_digit||5.006000|
  1420. is_utf8_graph||5.006000|
  1421. is_utf8_idcont||5.008000|
  1422. is_utf8_idfirst||5.006000|
  1423. is_utf8_lower||5.006000|
  1424. is_utf8_mark||5.006000|
  1425. is_utf8_perl_space||5.011001|
  1426. is_utf8_perl_word||5.011001|
  1427. is_utf8_posix_digit||5.011001|
  1428. is_utf8_print||5.006000|
  1429. is_utf8_punct||5.006000|
  1430. is_utf8_space||5.006000|
  1431. is_utf8_string_loclen||5.009003|n
  1432. is_utf8_string_loc||5.008001|n
  1433. is_utf8_string||5.006001|n
  1434. is_utf8_upper||5.006000|
  1435. is_utf8_xdigit||5.006000|
  1436. isa_lookup|||
  1437. items|||n
  1438. ix|||n
  1439. jmaybe|||
  1440. join_exact|||
  1441. keyword_plugin_standard|||
  1442. keyword|||
  1443. leave_scope|||
  1444. lex_bufutf8||5.011002|
  1445. lex_discard_to||5.011002|
  1446. lex_end|||
  1447. lex_grow_linestr||5.011002|
  1448. lex_next_chunk||5.011002|
  1449. lex_peek_unichar||5.011002|
  1450. lex_read_space||5.011002|
  1451. lex_read_to||5.011002|
  1452. lex_read_unichar||5.011002|
  1453. lex_start|||
  1454. lex_stuff_pvn||5.011002|
  1455. lex_stuff_sv||5.011002|
  1456. lex_unstuff||5.011002|
  1457. linklist|||
  1458. listkids|||
  1459. list|||
  1460. load_module_nocontext|||vn
  1461. load_module|5.006000||pv
  1462. localize|||
  1463. looks_like_bool|||
  1464. looks_like_number|||
  1465. lop|||
  1466. mPUSHi|5.009002||p
  1467. mPUSHn|5.009002||p
  1468. mPUSHp|5.009002||p
  1469. mPUSHs|5.010001||p
  1470. mPUSHu|5.009002||p
  1471. mXPUSHi|5.009002||p
  1472. mXPUSHn|5.009002||p
  1473. mXPUSHp|5.009002||p
  1474. mXPUSHs|5.010001||p
  1475. mXPUSHu|5.009002||p
  1476. mad_free|||
  1477. madlex|||
  1478. madparse|||
  1479. magic_clear_all_env|||
  1480. magic_clearenv|||
  1481. magic_clearhints|||
  1482. magic_clearhint|||
  1483. magic_clearisa|||
  1484. magic_clearpack|||
  1485. magic_clearsig|||
  1486. magic_dump||5.006000|
  1487. magic_existspack|||
  1488. magic_freearylen_p|||
  1489. magic_freeovrld|||
  1490. magic_getarylen|||
  1491. magic_getdefelem|||
  1492. magic_getnkeys|||
  1493. magic_getpack|||
  1494. magic_getpos|||
  1495. magic_getsig|||
  1496. magic_getsubstr|||
  1497. magic_gettaint|||
  1498. magic_getuvar|||
  1499. magic_getvec|||
  1500. magic_get|||
  1501. magic_killbackrefs|||
  1502. magic_len|||
  1503. magic_methcall|||
  1504. magic_methpack|||
  1505. magic_nextpack|||
  1506. magic_regdata_cnt|||
  1507. magic_regdatum_get|||
  1508. magic_regdatum_set|||
  1509. magic_scalarpack|||
  1510. magic_set_all_env|||
  1511. magic_setamagic|||
  1512. magic_setarylen|||
  1513. magic_setcollxfrm|||
  1514. magic_setdbline|||
  1515. magic_setdefelem|||
  1516. magic_setenv|||
  1517. magic_sethint|||
  1518. magic_setisa|||
  1519. magic_setmglob|||
  1520. magic_setnkeys|||
  1521. magic_setpack|||
  1522. magic_setpos|||
  1523. magic_setregexp|||
  1524. magic_setsig|||
  1525. magic_setsubstr|||
  1526. magic_settaint|||
  1527. magic_setutf8|||
  1528. magic_setuvar|||
  1529. magic_setvec|||
  1530. magic_set|||
  1531. magic_sizepack|||
  1532. magic_wipepack|||
  1533. make_matcher|||
  1534. make_trie_failtable|||
  1535. make_trie|||
  1536. malloc_good_size|||n
  1537. malloced_size|||n
  1538. malloc||5.007002|n
  1539. markstack_grow|||
  1540. matcher_matches_sv|||
  1541. measure_struct|||
  1542. memEQs|5.009005||p
  1543. memEQ|5.004000||p
  1544. memNEs|5.009005||p
  1545. memNE|5.004000||p
  1546. mem_collxfrm|||
  1547. mem_log_common|||n
  1548. mess_alloc|||
  1549. mess_nocontext|||vn
  1550. mess||5.006000|v
  1551. method_common|||
  1552. mfree||5.007002|n
  1553. mg_clear|||
  1554. mg_copy|||
  1555. mg_dup|||
  1556. mg_find|||
  1557. mg_free|||
  1558. mg_get|||
  1559. mg_length||5.005000|
  1560. mg_localize|||
  1561. mg_magical|||
  1562. mg_set|||
  1563. mg_size||5.005000|
  1564. mini_mktime||5.007002|
  1565. missingterm|||
  1566. mode_from_discipline|||
  1567. modkids|||
  1568. mod|||
  1569. more_bodies|||
  1570. more_sv|||
  1571. moreswitches|||
  1572. mro_get_from_name||5.010001|
  1573. mro_get_linear_isa_dfs|||
  1574. mro_get_linear_isa||5.009005|
  1575. mro_get_private_data||5.010001|
  1576. mro_isa_changed_in|||
  1577. mro_meta_dup|||
  1578. mro_meta_init|||
  1579. mro_method_changed_in||5.009005|
  1580. mro_register||5.010001|
  1581. mro_set_mro||5.010001|
  1582. mro_set_private_data||5.010001|
  1583. mul128|||
  1584. mulexp10|||n
  1585. my_atof2||5.007002|
  1586. my_atof||5.006000|
  1587. my_attrs|||
  1588. my_bcopy|||n
  1589. my_betoh16|||n
  1590. my_betoh32|||n
  1591. my_betoh64|||n
  1592. my_betohi|||n
  1593. my_betohl|||n
  1594. my_betohs|||n
  1595. my_bzero|||n
  1596. my_chsize|||
  1597. my_clearenv|||
  1598. my_cxt_index|||
  1599. my_cxt_init|||
  1600. my_dirfd||5.009005|
  1601. my_exit_jump|||
  1602. my_exit|||
  1603. my_failure_exit||5.004000|
  1604. my_fflush_all||5.006000|
  1605. my_fork||5.007003|n
  1606. my_htobe16|||n
  1607. my_htobe32|||n
  1608. my_htobe64|||n
  1609. my_htobei|||n
  1610. my_htobel|||n
  1611. my_htobes|||n
  1612. my_htole16|||n
  1613. my_htole32|||n
  1614. my_htole64|||n
  1615. my_htolei|||n
  1616. my_htolel|||n
  1617. my_htoles|||n
  1618. my_htonl|||
  1619. my_kid|||
  1620. my_letoh16|||n
  1621. my_letoh32|||n
  1622. my_letoh64|||n
  1623. my_letohi|||n
  1624. my_letohl|||n
  1625. my_letohs|||n
  1626. my_lstat|||
  1627. my_memcmp||5.004000|n
  1628. my_memset|||n
  1629. my_ntohl|||
  1630. my_pclose||5.004000|
  1631. my_popen_list||5.007001|
  1632. my_popen||5.004000|
  1633. my_setenv|||
  1634. my_snprintf|5.009004||pvn
  1635. my_socketpair||5.007003|n
  1636. my_sprintf|5.009003||pvn
  1637. my_stat|||
  1638. my_strftime||5.007002|
  1639. my_strlcat|5.009004||pn
  1640. my_strlcpy|5.009004||pn
  1641. my_swabn|||n
  1642. my_swap|||
  1643. my_unexec|||
  1644. my_vsnprintf||5.009004|n
  1645. need_utf8|||n
  1646. newANONATTRSUB||5.006000|
  1647. newANONHASH|||
  1648. newANONLIST|||
  1649. newANONSUB|||
  1650. newASSIGNOP|||
  1651. newATTRSUB||5.006000|
  1652. newAVREF|||
  1653. newAV|||
  1654. newBINOP|||
  1655. newCONDOP|||
  1656. newCONSTSUB|5.004050||p
  1657. newCVREF|||
  1658. newDEFSVOP|||
  1659. newFORM|||
  1660. newFOROP|||
  1661. newGIVENOP||5.009003|
  1662. newGIVWHENOP|||
  1663. newGP|||
  1664. newGVOP|||
  1665. newGVREF|||
  1666. newGVgen|||
  1667. newHVREF|||
  1668. newHVhv||5.005000|
  1669. newHV|||
  1670. newIO|||
  1671. newLISTOP|||
  1672. newLOGOP|||
  1673. newLOOPEX|||
  1674. newLOOPOP|||
  1675. newMADPROP|||
  1676. newMADsv|||
  1677. newMYSUB|||
  1678. newNULLLIST|||
  1679. newOP|||
  1680. newPADOP|||
  1681. newPMOP|||
  1682. newPROG|||
  1683. newPVOP|||
  1684. newRANGE|||
  1685. newRV_inc|5.004000||p
  1686. newRV_noinc|5.004000||p
  1687. newRV|||
  1688. newSLICEOP|||
  1689. newSTATEOP|||
  1690. newSUB|||
  1691. newSVOP|||
  1692. newSVREF|||
  1693. newSV_type|5.009005||p
  1694. newSVhek||5.009003|
  1695. newSViv|||
  1696. newSVnv|||
  1697. newSVpvf_nocontext|||vn
  1698. newSVpvf||5.004000|v
  1699. newSVpvn_flags|5.010001||p
  1700. newSVpvn_share|5.007001||p
  1701. newSVpvn_utf8|5.010001||p
  1702. newSVpvn|5.004050||p
  1703. newSVpvs_flags|5.010001||p
  1704. newSVpvs_share|5.009003||p
  1705. newSVpvs|5.009003||p
  1706. newSVpv|||
  1707. newSVrv|||
  1708. newSVsv|||
  1709. newSVuv|5.006000||p
  1710. newSV|||
  1711. newTOKEN|||
  1712. newUNOP|||
  1713. newWHENOP||5.009003|
  1714. newWHILEOP||5.009003|
  1715. newXS_flags||5.009004|
  1716. newXSproto||5.006000|
  1717. newXS||5.006000|
  1718. new_collate||5.006000|
  1719. new_constant|||
  1720. new_ctype||5.006000|
  1721. new_he|||
  1722. new_logop|||
  1723. new_numeric||5.006000|
  1724. new_stackinfo||5.005000|
  1725. new_version||5.009000|
  1726. new_warnings_bitfield|||
  1727. next_symbol|||
  1728. nextargv|||
  1729. nextchar|||
  1730. ninstr|||n
  1731. no_bareword_allowed|||
  1732. no_fh_allowed|||
  1733. no_op|||
  1734. not_a_number|||
  1735. nothreadhook||5.008000|
  1736. nuke_stacks|||
  1737. num_overflow|||n
  1738. offer_nice_chunk|||
  1739. oopsAV|||
  1740. oopsHV|||
  1741. op_clear|||
  1742. op_const_sv|||
  1743. op_dump||5.006000|
  1744. op_free|||
  1745. op_getmad_weak|||
  1746. op_getmad|||
  1747. op_null||5.007002|
  1748. op_refcnt_dec|||
  1749. op_refcnt_inc|||
  1750. op_refcnt_lock||5.009002|
  1751. op_refcnt_unlock||5.009002|
  1752. op_xmldump|||
  1753. open_script|||
  1754. opt_scalarhv|||
  1755. pMY_CXT_|5.007003||p
  1756. pMY_CXT|5.007003||p
  1757. pTHX_|5.006000||p
  1758. pTHX|5.006000||p
  1759. packWARN|5.007003||p
  1760. pack_cat||5.007003|
  1761. pack_rec|||
  1762. package_version|||
  1763. package|||
  1764. packlist||5.008001|
  1765. pad_add_anon|||
  1766. pad_add_name_sv|||
  1767. pad_add_name|||
  1768. pad_alloc|||
  1769. pad_block_start|||
  1770. pad_check_dup|||
  1771. pad_compname_type|||
  1772. pad_findlex|||
  1773. pad_findmy||5.011002|
  1774. pad_fixup_inner_anons|||
  1775. pad_free|||
  1776. pad_leavemy|||
  1777. pad_new|||
  1778. pad_peg|||n
  1779. pad_push|||
  1780. pad_reset|||
  1781. pad_setsv|||
  1782. pad_sv|||
  1783. pad_swipe|||
  1784. pad_tidy|||
  1785. pad_undef|||
  1786. parse_body|||
  1787. parse_unicode_opts|||
  1788. parser_dup|||
  1789. parser_free|||
  1790. path_is_absolute|||n
  1791. peep|||
  1792. pending_Slabs_to_ro|||
  1793. perl_alloc_using|||n
  1794. perl_alloc|||n
  1795. perl_clone_using|||n
  1796. perl_clone|||n
  1797. perl_construct|||n
  1798. perl_destruct||5.007003|n
  1799. perl_free|||n
  1800. perl_parse||5.006000|n
  1801. perl_run|||n
  1802. pidgone|||
  1803. pm_description|||
  1804. pmflag|||
  1805. pmop_dump||5.006000|
  1806. pmop_xmldump|||
  1807. pmruntime|||
  1808. pmtrans|||
  1809. pop_scope|||
  1810. pregcomp||5.009005|
  1811. pregexec|||
  1812. pregfree2||5.011000|
  1813. pregfree|||
  1814. prepend_elem|||
  1815. prepend_madprops|||
  1816. prescan_version||5.011004|
  1817. printbuf|||
  1818. printf_nocontext|||vn
  1819. process_special_blocks|||
  1820. ptr_table_clear||5.009005|
  1821. ptr_table_fetch||5.009005|
  1822. ptr_table_find|||n
  1823. ptr_table_free||5.009005|
  1824. ptr_table_new||5.009005|
  1825. ptr_table_split||5.009005|
  1826. ptr_table_store||5.009005|
  1827. push_scope|||
  1828. put_byte|||
  1829. pv_display|5.006000||p
  1830. pv_escape|5.009004||p
  1831. pv_pretty|5.009004||p
  1832. pv_uni_display||5.007003|
  1833. qerror|||
  1834. qsortsvu|||
  1835. re_compile||5.009005|
  1836. re_croak2|||
  1837. re_dup_guts|||
  1838. re_intuit_start||5.009005|
  1839. re_intuit_string||5.006000|
  1840. readpipe_override|||
  1841. realloc||5.007002|n
  1842. reentrant_free|||
  1843. reentrant_init|||
  1844. reentrant_retry|||vn
  1845. reentrant_size|||
  1846. ref_array_or_hash|||
  1847. refcounted_he_chain_2hv|||
  1848. refcounted_he_fetch|||
  1849. refcounted_he_free|||
  1850. refcounted_he_new_common|||
  1851. refcounted_he_new|||
  1852. refcounted_he_value|||
  1853. refkids|||
  1854. refto|||
  1855. ref||5.011005|
  1856. reg_check_named_buff_matched|||
  1857. reg_named_buff_all||5.009005|
  1858. reg_named_buff_exists||5.009005|
  1859. reg_named_buff_fetch||5.009005|
  1860. reg_named_buff_firstkey||5.009005|
  1861. reg_named_buff_iter|||
  1862. reg_named_buff_nextkey||5.009005|
  1863. reg_named_buff_scalar||5.009005|
  1864. reg_named_buff|||
  1865. reg_namedseq|||
  1866. reg_node|||
  1867. reg_numbered_buff_fetch|||
  1868. reg_numbered_buff_length|||
  1869. reg_numbered_buff_store|||
  1870. reg_qr_package|||
  1871. reg_recode|||
  1872. reg_scan_name|||
  1873. reg_skipcomment|||
  1874. reg_temp_copy|||
  1875. reganode|||
  1876. regatom|||
  1877. regbranch|||
  1878. regclass_swash||5.009004|
  1879. regclass|||
  1880. regcppop|||
  1881. regcppush|||
  1882. regcurly|||n
  1883. regdump_extflags|||
  1884. regdump||5.005000|
  1885. regdupe_internal|||
  1886. regexec_flags||5.005000|
  1887. regfree_internal||5.009005|
  1888. reghop3|||n
  1889. reghop4|||n
  1890. reghopmaybe3|||n
  1891. reginclass|||
  1892. reginitcolors||5.006000|
  1893. reginsert|||
  1894. regmatch|||
  1895. regnext||5.005000|
  1896. regpiece|||
  1897. regpposixcc|||
  1898. regprop|||
  1899. regrepeat|||
  1900. regtail_study|||
  1901. regtail|||
  1902. regtry|||
  1903. reguni|||
  1904. regwhite|||n
  1905. reg|||
  1906. repeatcpy|||n
  1907. report_evil_fh|||
  1908. report_uninit|||
  1909. require_pv||5.006000|
  1910. require_tie_mod|||
  1911. restore_magic|||
  1912. rninstr|||n
  1913. rsignal_restore|||
  1914. rsignal_save|||
  1915. rsignal_state||5.004000|
  1916. rsignal||5.004000|
  1917. run_body|||
  1918. run_user_filter|||
  1919. runops_debug||5.005000|
  1920. runops_standard||5.005000|
  1921. rvpv_dup|||
  1922. rxres_free|||
  1923. rxres_restore|||
  1924. rxres_save|||
  1925. safesyscalloc||5.006000|n
  1926. safesysfree||5.006000|n
  1927. safesysmalloc||5.006000|n
  1928. safesysrealloc||5.006000|n
  1929. same_dirent|||
  1930. save_I16||5.004000|
  1931. save_I32|||
  1932. save_I8||5.006000|
  1933. save_adelete||5.011000|
  1934. save_aelem_flags||5.011000|
  1935. save_aelem||5.004050|
  1936. save_alloc||5.006000|
  1937. save_aptr|||
  1938. save_ary|||
  1939. save_bool||5.008001|
  1940. save_clearsv|||
  1941. save_delete|||
  1942. save_destructor_x||5.006000|
  1943. save_destructor||5.006000|
  1944. save_freeop|||
  1945. save_freepv|||
  1946. save_freesv|||
  1947. save_generic_pvref||5.006001|
  1948. save_generic_svref||5.005030|
  1949. save_gp||5.004000|
  1950. save_hash|||
  1951. save_hdelete||5.011000|
  1952. save_hek_flags|||n
  1953. save_helem_flags||5.011000|
  1954. save_helem||5.004050|
  1955. save_hints|||
  1956. save_hptr|||
  1957. save_int|||
  1958. save_item|||
  1959. save_iv||5.005000|
  1960. save_lines|||
  1961. save_list|||
  1962. save_long|||
  1963. save_magic|||
  1964. save_mortalizesv||5.007001|
  1965. save_nogv|||
  1966. save_op|||
  1967. save_padsv_and_mortalize||5.010001|
  1968. save_pptr|||
  1969. save_pushi32ptr|||
  1970. save_pushptri32ptr|||
  1971. save_pushptrptr|||
  1972. save_pushptr||5.010001|
  1973. save_re_context||5.006000|
  1974. save_scalar_at|||
  1975. save_scalar|||
  1976. save_set_svflags||5.009000|
  1977. save_shared_pvref||5.007003|
  1978. save_sptr|||
  1979. save_svref|||
  1980. save_vptr||5.006000|
  1981. savepvn|||
  1982. savepvs||5.009003|
  1983. savepv|||
  1984. savesharedpvn||5.009005|
  1985. savesharedpv||5.007003|
  1986. savestack_grow_cnt||5.008001|
  1987. savestack_grow|||
  1988. savesvpv||5.009002|
  1989. sawparens|||
  1990. scalar_mod_type|||n
  1991. scalarboolean|||
  1992. scalarkids|||
  1993. scalarseq|||
  1994. scalarvoid|||
  1995. scalar|||
  1996. scan_bin||5.006000|
  1997. scan_commit|||
  1998. scan_const|||
  1999. scan_formline|||
  2000. scan_heredoc|||
  2001. scan_hex|||
  2002. scan_ident|||
  2003. scan_inputsymbol|||
  2004. scan_num||5.007001|
  2005. scan_oct|||
  2006. scan_pat|||
  2007. scan_str|||
  2008. scan_subst|||
  2009. scan_trans|||
  2010. scan_version||5.009001|
  2011. scan_vstring||5.009005|
  2012. scan_word|||
  2013. scope|||
  2014. screaminstr||5.005000|
  2015. search_const|||
  2016. seed||5.008001|
  2017. sequence_num|||
  2018. sequence_tail|||
  2019. sequence|||
  2020. set_context||5.006000|n
  2021. set_numeric_local||5.006000|
  2022. set_numeric_radix||5.006000|
  2023. set_numeric_standard||5.006000|
  2024. setdefout|||
  2025. share_hek_flags|||
  2026. share_hek||5.004000|
  2027. si_dup|||
  2028. sighandler|||n
  2029. simplify_sort|||
  2030. skipspace0|||
  2031. skipspace1|||
  2032. skipspace2|||
  2033. skipspace|||
  2034. softref2xv|||
  2035. sortcv_stacked|||
  2036. sortcv_xsub|||
  2037. sortcv|||
  2038. sortsv_flags||5.009003|
  2039. sortsv||5.007003|
  2040. space_join_names_mortal|||
  2041. ss_dup|||
  2042. stack_grow|||
  2043. start_force|||
  2044. start_glob|||
  2045. start_subparse||5.004000|
  2046. stashpv_hvname_match||5.011005|
  2047. stdize_locale|||
  2048. store_cop_label|||
  2049. strEQ|||
  2050. strGE|||
  2051. strGT|||
  2052. strLE|||
  2053. strLT|||
  2054. strNE|||
  2055. str_to_version||5.006000|
  2056. strip_return|||
  2057. strnEQ|||
  2058. strnNE|||
  2059. study_chunk|||
  2060. sub_crush_depth|||
  2061. sublex_done|||
  2062. sublex_push|||
  2063. sublex_start|||
  2064. sv_2bool|||
  2065. sv_2cv|||
  2066. sv_2io|||
  2067. sv_2iuv_common|||
  2068. sv_2iuv_non_preserve|||
  2069. sv_2iv_flags||5.009001|
  2070. sv_2iv|||
  2071. sv_2mortal|||
  2072. sv_2num|||
  2073. sv_2nv|||
  2074. sv_2pv_flags|5.007002||p
  2075. sv_2pv_nolen|5.006000||p
  2076. sv_2pvbyte_nolen|5.006000||p
  2077. sv_2pvbyte|5.006000||p
  2078. sv_2pvutf8_nolen||5.006000|
  2079. sv_2pvutf8||5.006000|
  2080. sv_2pv|||
  2081. sv_2uv_flags||5.009001|
  2082. sv_2uv|5.004000||p
  2083. sv_add_arena|||
  2084. sv_add_backref|||
  2085. sv_backoff|||
  2086. sv_bless|||
  2087. sv_cat_decode||5.008001|
  2088. sv_catpv_mg|5.004050||p
  2089. sv_catpvf_mg_nocontext|||pvn
  2090. sv_catpvf_mg|5.006000|5.004000|pv
  2091. sv_catpvf_nocontext|||vn
  2092. sv_catpvf||5.004000|v
  2093. sv_catpvn_flags||5.007002|
  2094. sv_catpvn_mg|5.004050||p
  2095. sv_catpvn_nomg|5.007002||p
  2096. sv_catpvn|||
  2097. sv_catpvs|5.009003||p
  2098. sv_catpv|||
  2099. sv_catsv_flags||5.007002|
  2100. sv_catsv_mg|5.004050||p
  2101. sv_catsv_nomg|5.007002||p
  2102. sv_catsv|||
  2103. sv_catxmlpvn|||
  2104. sv_catxmlsv|||
  2105. sv_chop|||
  2106. sv_clean_all|||
  2107. sv_clean_objs|||
  2108. sv_clear|||
  2109. sv_cmp_locale||5.004000|
  2110. sv_cmp|||
  2111. sv_collxfrm|||
  2112. sv_compile_2op||5.008001|
  2113. sv_copypv||5.007003|
  2114. sv_dec|||
  2115. sv_del_backref|||
  2116. sv_derived_from||5.004000|
  2117. sv_destroyable||5.010000|
  2118. sv_does||5.009004|
  2119. sv_dump|||
  2120. sv_dup_inc_multiple|||
  2121. sv_dup|||
  2122. sv_eq|||
  2123. sv_exp_grow|||
  2124. sv_force_normal_flags||5.007001|
  2125. sv_force_normal||5.006000|
  2126. sv_free2|||
  2127. sv_free_arenas|||
  2128. sv_free|||
  2129. sv_gets||5.004000|
  2130. sv_grow|||
  2131. sv_i_ncmp|||
  2132. sv_inc|||
  2133. sv_insert_flags||5.010001|
  2134. sv_insert|||
  2135. sv_isa|||
  2136. sv_isobject|||
  2137. sv_iv||5.005000|
  2138. sv_kill_backrefs|||
  2139. sv_len_utf8||5.006000|
  2140. sv_len|||
  2141. sv_magic_portable|5.011005|5.004000|p
  2142. sv_magicext||5.007003|
  2143. sv_magic|||
  2144. sv_mortalcopy|||
  2145. sv_ncmp|||
  2146. sv_newmortal|||
  2147. sv_newref|||
  2148. sv_nolocking||5.007003|
  2149. sv_nosharing||5.007003|
  2150. sv_nounlocking|||
  2151. sv_nv||5.005000|
  2152. sv_peek||5.005000|
  2153. sv_pos_b2u_midway|||
  2154. sv_pos_b2u||5.006000|
  2155. sv_pos_u2b_cached|||
  2156. sv_pos_u2b_flags||5.011005|
  2157. sv_pos_u2b_forwards|||n
  2158. sv_pos_u2b_midway|||n
  2159. sv_pos_u2b||5.006000|
  2160. sv_pvbyten_force||5.006000|
  2161. sv_pvbyten||5.006000|
  2162. sv_pvbyte||5.006000|
  2163. sv_pvn_force_flags|5.007002||p
  2164. sv_pvn_force|||
  2165. sv_pvn_nomg|5.007003|5.005000|p
  2166. sv_pvn||5.005000|
  2167. sv_pvutf8n_force||5.006000|
  2168. sv_pvutf8n||5.006000|
  2169. sv_pvutf8||5.006000|
  2170. sv_pv||5.006000|
  2171. sv_recode_to_utf8||5.007003|
  2172. sv_reftype|||
  2173. sv_release_COW|||
  2174. sv_replace|||
  2175. sv_report_used|||
  2176. sv_reset|||
  2177. sv_rvweaken||5.006000|
  2178. sv_setiv_mg|5.004050||p
  2179. sv_setiv|||
  2180. sv_setnv_mg|5.006000||p
  2181. sv_setnv|||
  2182. sv_setpv_mg|5.004050||p
  2183. sv_setpvf_mg_nocontext|||pvn
  2184. sv_setpvf_mg|5.006000|5.004000|pv
  2185. sv_setpvf_nocontext|||vn
  2186. sv_setpvf||5.004000|v
  2187. sv_setpviv_mg||5.008001|
  2188. sv_setpviv||5.008001|
  2189. sv_setpvn_mg|5.004050||p
  2190. sv_setpvn|||
  2191. sv_setpvs|5.009004||p
  2192. sv_setpv|||
  2193. sv_setref_iv|||
  2194. sv_setref_nv|||
  2195. sv_setref_pvn|||
  2196. sv_setref_pv|||
  2197. sv_setref_uv||5.007001|
  2198. sv_setsv_cow|||
  2199. sv_setsv_flags||5.007002|
  2200. sv_setsv_mg|5.004050||p
  2201. sv_setsv_nomg|5.007002||p
  2202. sv_setsv|||
  2203. sv_setuv_mg|5.004050||p
  2204. sv_setuv|5.004000||p
  2205. sv_tainted||5.004000|
  2206. sv_taint||5.004000|
  2207. sv_true||5.005000|
  2208. sv_unglob|||
  2209. sv_uni_display||5.007003|
  2210. sv_unmagic|||
  2211. sv_unref_flags||5.007001|
  2212. sv_unref|||
  2213. sv_untaint||5.004000|
  2214. sv_upgrade|||
  2215. sv_usepvn_flags||5.009004|
  2216. sv_usepvn_mg|5.004050||p
  2217. sv_usepvn|||
  2218. sv_utf8_decode||5.006000|
  2219. sv_utf8_downgrade||5.006000|
  2220. sv_utf8_encode||5.006000|
  2221. sv_utf8_upgrade_flags_grow||5.011000|
  2222. sv_utf8_upgrade_flags||5.007002|
  2223. sv_utf8_upgrade_nomg||5.007002|
  2224. sv_utf8_upgrade||5.007001|
  2225. sv_uv|5.005000||p
  2226. sv_vcatpvf_mg|5.006000|5.004000|p
  2227. sv_vcatpvfn||5.004000|
  2228. sv_vcatpvf|5.006000|5.004000|p
  2229. sv_vsetpvf_mg|5.006000|5.004000|p
  2230. sv_vsetpvfn||5.004000|
  2231. sv_vsetpvf|5.006000|5.004000|p
  2232. sv_xmlpeek|||
  2233. svtype|||
  2234. swallow_bom|||
  2235. swash_fetch||5.007002|
  2236. swash_get|||
  2237. swash_init||5.006000|
  2238. sys_init3||5.010000|n
  2239. sys_init||5.010000|n
  2240. sys_intern_clear|||
  2241. sys_intern_dup|||
  2242. sys_intern_init|||
  2243. sys_term||5.010000|n
  2244. taint_env|||
  2245. taint_proper|||
  2246. tmps_grow||5.006000|
  2247. toLOWER|||
  2248. toUPPER|||
  2249. to_byte_substr|||
  2250. to_uni_fold||5.007003|
  2251. to_uni_lower_lc||5.006000|
  2252. to_uni_lower||5.007003|
  2253. to_uni_title_lc||5.006000|
  2254. to_uni_title||5.007003|
  2255. to_uni_upper_lc||5.006000|
  2256. to_uni_upper||5.007003|
  2257. to_utf8_case||5.007003|
  2258. to_utf8_fold||5.007003|
  2259. to_utf8_lower||5.007003|
  2260. to_utf8_substr|||
  2261. to_utf8_title||5.007003|
  2262. to_utf8_upper||5.007003|
  2263. token_free|||
  2264. token_getmad|||
  2265. tokenize_use|||
  2266. tokeq|||
  2267. tokereport|||
  2268. too_few_arguments|||
  2269. too_many_arguments|||
  2270. uiv_2buf|||n
  2271. unlnk|||
  2272. unpack_rec|||
  2273. unpack_str||5.007003|
  2274. unpackstring||5.008001|
  2275. unshare_hek_or_pvn|||
  2276. unshare_hek|||
  2277. unsharepvn||5.004000|
  2278. unwind_handler_stack|||
  2279. update_debugger_info|||
  2280. upg_version||5.009005|
  2281. usage|||
  2282. utf16_textfilter|||
  2283. utf16_to_utf8_reversed||5.006001|
  2284. utf16_to_utf8||5.006001|
  2285. utf8_distance||5.006000|
  2286. utf8_hop||5.006000|
  2287. utf8_length||5.007001|
  2288. utf8_mg_pos_cache_update|||
  2289. utf8_to_bytes||5.006001|
  2290. utf8_to_uvchr||5.007001|
  2291. utf8_to_uvuni||5.007001|
  2292. utf8n_to_uvchr|||
  2293. utf8n_to_uvuni||5.007001|
  2294. utilize|||
  2295. uvchr_to_utf8_flags||5.007003|
  2296. uvchr_to_utf8|||
  2297. uvuni_to_utf8_flags||5.007003|
  2298. uvuni_to_utf8||5.007001|
  2299. validate_suid|||
  2300. varname|||
  2301. vcmp||5.009000|
  2302. vcroak||5.006000|
  2303. vdeb||5.007003|
  2304. vdie_common|||
  2305. vdie_croak_common|||
  2306. vdie|||
  2307. vform||5.006000|
  2308. visit|||
  2309. vivify_defelem|||
  2310. vivify_ref|||
  2311. vload_module|5.006000||p
  2312. vmess||5.006000|
  2313. vnewSVpvf|5.006000|5.004000|p
  2314. vnormal||5.009002|
  2315. vnumify||5.009000|
  2316. vstringify||5.009000|
  2317. vverify||5.009003|
  2318. vwarner||5.006000|
  2319. vwarn||5.006000|
  2320. wait4pid|||
  2321. warn_nocontext|||vn
  2322. warner_nocontext|||vn
  2323. warner|5.006000|5.004000|pv
  2324. warn|||v
  2325. watch|||
  2326. whichsig|||
  2327. write_no_mem|||
  2328. write_to_stderr|||
  2329. xmldump_all_perl|||
  2330. xmldump_all|||
  2331. xmldump_attr|||
  2332. xmldump_eval|||
  2333. xmldump_form|||
  2334. xmldump_indent|||v
  2335. xmldump_packsubs_perl|||
  2336. xmldump_packsubs|||
  2337. xmldump_sub_perl|||
  2338. xmldump_sub|||
  2339. xmldump_vindent|||
  2340. yyerror|||
  2341. yylex|||
  2342. yyparse|||
  2343. yywarn|||
  2344. );
  2345. if (exists $opt{'list-unsupported'}) {
  2346. my $f;
  2347. for $f (sort { lc $a cmp lc $b } keys %API) {
  2348. next unless $API{$f}{todo};
  2349. print "$f ", '.'x(40-length($f)), " ", format_version($API{$f}{todo}), "\n";
  2350. }
  2351. exit 0;
  2352. }
  2353. # Scan for possible replacement candidates
  2354. my(%replace, %need, %hints, %warnings, %depends);
  2355. my $replace = 0;
  2356. my($hint, $define, $function);
  2357. sub find_api
  2358. {
  2359. my $code = shift;
  2360. $code =~ s{
  2361. / (?: \*[^*]*\*+(?:[^$ccs][^*]*\*+)* / | /[^\r\n]*)
  2362. | "[^"\\]*(?:\\.[^"\\]*)*"
  2363. | '[^'\\]*(?:\\.[^'\\]*)*' }{}egsx;
  2364. grep { exists $API{$_} } $code =~ /(\w+)/mg;
  2365. }
  2366. while (<DATA>) {
  2367. if ($hint) {
  2368. my $h = $hint->[0] eq 'Hint' ? \%hints : \%warnings;
  2369. if (m{^\s*\*\s(.*?)\s*$}) {
  2370. for (@{$hint->[1]}) {
  2371. $h->{$_} ||= ''; # suppress warning with older perls
  2372. $h->{$_} .= "$1\n";
  2373. }
  2374. }
  2375. else { undef $hint }
  2376. }
  2377. $hint = [$1, [split /,?\s+/, $2]]
  2378. if m{^\s*$rccs\s+(Hint|Warning):\s+(\w+(?:,?\s+\w+)*)\s*$};
  2379. if ($define) {
  2380. if ($define->[1] =~ /\\$/) {
  2381. $define->[1] .= $_;
  2382. }
  2383. else {
  2384. if (exists $API{$define->[0]} && $define->[1] !~ /^DPPP_\(/) {
  2385. my @n = find_api($define->[1]);
  2386. push @{$depends{$define->[0]}}, @n if @n
  2387. }
  2388. undef $define;
  2389. }
  2390. }
  2391. $define = [$1, $2] if m{^\s*#\s*define\s+(\w+)(?:\([^)]*\))?\s+(.*)};
  2392. if ($function) {
  2393. if (/^}/) {
  2394. if (exists $API{$function->[0]}) {
  2395. my @n = find_api($function->[1]);
  2396. push @{$depends{$function->[0]}}, @n if @n
  2397. }
  2398. undef $function;
  2399. }
  2400. else {
  2401. $function->[1] .= $_;
  2402. }
  2403. }
  2404. $function = [$1, ''] if m{^DPPP_\(my_(\w+)\)};
  2405. $replace = $1 if m{^\s*$rccs\s+Replace:\s+(\d+)\s+$rcce\s*$};
  2406. $replace{$2} = $1 if $replace and m{^\s*#\s*define\s+(\w+)(?:\([^)]*\))?\s+(\w+)};
  2407. $replace{$2} = $1 if m{^\s*#\s*define\s+(\w+)(?:\([^)]*\))?\s+(\w+).*$rccs\s+Replace\s+$rcce};
  2408. $replace{$1} = $2 if m{^\s*$rccs\s+Replace (\w+) with (\w+)\s+$rcce\s*$};
  2409. if (m{^\s*$rccs\s+(\w+(\s*,\s*\w+)*)\s+depends\s+on\s+(\w+(\s*,\s*\w+)*)\s+$rcce\s*$}) {
  2410. my @deps = map { s/\s+//g; $_ } split /,/, $3;
  2411. my $d;
  2412. for $d (map { s/\s+//g; $_ } split /,/, $1) {
  2413. push @{$depends{$d}}, @deps;
  2414. }
  2415. }
  2416. $need{$1} = 1 if m{^#if\s+defined\(NEED_(\w+)(?:_GLOBAL)?\)};
  2417. }
  2418. for (values %depends) {
  2419. my %s;
  2420. $_ = [sort grep !$s{$_}++, @$_];
  2421. }
  2422. if (exists $opt{'api-info'}) {
  2423. my $f;
  2424. my $count = 0;
  2425. my $match = $opt{'api-info'} =~ m!^/(.*)/$! ? $1 : "^\Q$opt{'api-info'}\E\$";
  2426. for $f (sort { lc $a cmp lc $b } keys %API) {
  2427. next unless $f =~ /$match/;
  2428. print "\n=== $f ===\n\n";
  2429. my $info = 0;
  2430. if ($API{$f}{base} || $API{$f}{todo}) {
  2431. my $base = format_version($API{$f}{base} || $API{$f}{todo});
  2432. print "Supported at least starting from perl-$base.\n";
  2433. $info++;
  2434. }
  2435. if ($API{$f}{provided}) {
  2436. my $todo = $API{$f}{todo} ? format_version($API{$f}{todo}) : "5.003";
  2437. print "Support by $ppport provided back to perl-$todo.\n";
  2438. print "Support needs to be explicitly requested by NEED_$f.\n" if exists $need{$f};
  2439. print "Depends on: ", join(', ', @{$depends{$f}}), ".\n" if exists $depends{$f};
  2440. print "\n$hints{$f}" if exists $hints{$f};
  2441. print "\nWARNING:\n$warnings{$f}" if exists $warnings{$f};
  2442. $info++;
  2443. }
  2444. print "No portability information available.\n" unless $info;
  2445. $count++;
  2446. }
  2447. $count or print "Found no API matching '$opt{'api-info'}'.";
  2448. print "\n";
  2449. exit 0;
  2450. }
  2451. if (exists $opt{'list-provided'}) {
  2452. my $f;
  2453. for $f (sort { lc $a cmp lc $b } keys %API) {
  2454. next unless $API{$f}{provided};
  2455. my @flags;
  2456. push @flags, 'explicit' if exists $need{$f};
  2457. push @flags, 'depend' if exists $depends{$f};
  2458. push @flags, 'hint' if exists $hints{$f};
  2459. push @flags, 'warning' if exists $warnings{$f};
  2460. my $flags = @flags ? ' ['.join(', ', @flags).']' : '';
  2461. print "$f$flags\n";
  2462. }
  2463. exit 0;
  2464. }
  2465. my @files;
  2466. my @srcext = qw( .xs .c .h .cc .cpp -c.inc -xs.inc );
  2467. my $srcext = join '|', map { quotemeta $_ } @srcext;
  2468. if (@ARGV) {
  2469. my %seen;
  2470. for (@ARGV) {
  2471. if (-e) {
  2472. if (-f) {
  2473. push @files, $_ unless $seen{$_}++;
  2474. }
  2475. else { warn "'$_' is not a file.\n" }
  2476. }
  2477. else {
  2478. my @new = grep { -f } glob $_
  2479. or warn "'$_' does not exist.\n";
  2480. push @files, grep { !$seen{$_}++ } @new;
  2481. }
  2482. }
  2483. }
  2484. else {
  2485. eval {
  2486. require File::Find;
  2487. File::Find::find(sub {
  2488. $File::Find::name =~ /($srcext)$/i
  2489. and push @files, $File::Find::name;
  2490. }, '.');
  2491. };
  2492. if ($@) {
  2493. @files = map { glob "*$_" } @srcext;
  2494. }
  2495. }
  2496. if (!@ARGV || $opt{filter}) {
  2497. my(@in, @out);
  2498. my %xsc = map { /(.*)\.xs$/ ? ("$1.c" => 1, "$1.cc" => 1) : () } @files;
  2499. for (@files) {
  2500. my $out = exists $xsc{$_} || /\b\Q$ppport\E$/i || !/($srcext)$/i;
  2501. push @{ $out ? \@out : \@in }, $_;
  2502. }
  2503. if (@ARGV && @out) {
  2504. warning("Skipping the following files (use --nofilter to avoid this):\n| ", join "\n| ", @out);
  2505. }
  2506. @files = @in;
  2507. }
  2508. die "No input files given!\n" unless @files;
  2509. my(%files, %global, %revreplace);
  2510. %revreplace = reverse %replace;
  2511. my $filename;
  2512. my $patch_opened = 0;
  2513. for $filename (@files) {
  2514. unless (open IN, "<$filename") {
  2515. warn "Unable to read from $filename: $!\n";
  2516. next;
  2517. }
  2518. info("Scanning $filename ...");
  2519. my $c = do { local $/; <IN> };
  2520. close IN;
  2521. my %file = (orig => $c, changes => 0);
  2522. # Temporarily remove C/XS comments and strings from the code
  2523. my @ccom;
  2524. $c =~ s{
  2525. ( ^$HS*\#$HS*include\b[^\r\n]+\b(?:\Q$ppport\E|XSUB\.h)\b[^\r\n]*
  2526. | ^$HS*\#$HS*(?:define|elif|if(?:def)?)\b[^\r\n]* )
  2527. | ( ^$HS*\#[^\r\n]*
  2528. | "[^"\\]*(?:\\.[^"\\]*)*"
  2529. | '[^'\\]*(?:\\.[^'\\]*)*'
  2530. | / (?: \*[^*]*\*+(?:[^$ccs][^*]*\*+)* / | /[^\r\n]* ) )
  2531. }{ defined $2 and push @ccom, $2;
  2532. defined $1 ? $1 : "$ccs$#ccom$cce" }mgsex;
  2533. $file{ccom} = \@ccom;
  2534. $file{code} = $c;
  2535. $file{has_inc_ppport} = $c =~ /^$HS*#$HS*include[^\r\n]+\b\Q$ppport\E\b/m;
  2536. my $func;
  2537. for $func (keys %API) {
  2538. my $match = $func;
  2539. $match .= "|$revreplace{$func}" if exists $revreplace{$func};
  2540. if ($c =~ /\b(?:Perl_)?($match)\b/) {
  2541. $file{uses_replace}{$1}++ if exists $revreplace{$func} && $1 eq $revreplace{$func};
  2542. $file{uses_Perl}{$func}++ if $c =~ /\bPerl_$func\b/;
  2543. if (exists $API{$func}{provided}) {
  2544. $file{uses_provided}{$func}++;
  2545. if (!exists $API{$func}{base} || $API{$func}{base} > $opt{'compat-version'}) {
  2546. $file{uses}{$func}++;
  2547. my @deps = rec_depend($func);
  2548. if (@deps) {
  2549. $file{uses_deps}{$func} = \@deps;
  2550. for (@deps) {
  2551. $file{uses}{$_} = 0 unless exists $file{uses}{$_};
  2552. }
  2553. }
  2554. for ($func, @deps) {
  2555. $file{needs}{$_} = 'static' if exists $need{$_};
  2556. }
  2557. }
  2558. }
  2559. if (exists $API{$func}{todo} && $API{$func}{todo} > $opt{'compat-version'}) {
  2560. if ($c =~ /\b$func\b/) {
  2561. $file{uses_todo}{$func}++;
  2562. }
  2563. }
  2564. }
  2565. }
  2566. while ($c =~ /^$HS*#$HS*define$HS+(NEED_(\w+?)(_GLOBAL)?)\b/mg) {
  2567. if (exists $need{$2}) {
  2568. $file{defined $3 ? 'needed_global' : 'needed_static'}{$2}++;
  2569. }
  2570. else { warning("Possibly wrong #define $1 in $filename") }
  2571. }
  2572. for (qw(uses needs uses_todo needed_global needed_static)) {
  2573. for $func (keys %{$file{$_}}) {
  2574. push @{$global{$_}{$func}}, $filename;
  2575. }
  2576. }
  2577. $files{$filename} = \%file;
  2578. }
  2579. # Globally resolve NEED_'s
  2580. my $need;
  2581. for $need (keys %{$global{needs}}) {
  2582. if (@{$global{needs}{$need}} > 1) {
  2583. my @targets = @{$global{needs}{$need}};
  2584. my @t = grep $files{$_}{needed_global}{$need}, @targets;
  2585. @targets = @t if @t;
  2586. @t = grep /\.xs$/i, @targets;
  2587. @targets = @t if @t;
  2588. my $target = shift @targets;
  2589. $files{$target}{needs}{$need} = 'global';
  2590. for (@{$global{needs}{$need}}) {
  2591. $files{$_}{needs}{$need} = 'extern' if $_ ne $target;
  2592. }
  2593. }
  2594. }
  2595. for $filename (@files) {
  2596. exists $files{$filename} or next;
  2597. info("=== Analyzing $filename ===");
  2598. my %file = %{$files{$filename}};
  2599. my $func;
  2600. my $c = $file{code};
  2601. my $warnings = 0;
  2602. for $func (sort keys %{$file{uses_Perl}}) {
  2603. if ($API{$func}{varargs}) {
  2604. unless ($API{$func}{nothxarg}) {
  2605. my $changes = ($c =~ s{\b(Perl_$func\s*\(\s*)(?!aTHX_?)(\)|[^\s)]*\))}
  2606. { $1 . ($2 eq ')' ? 'aTHX' : 'aTHX_ ') . $2 }ge);
  2607. if ($changes) {
  2608. warning("Doesn't pass interpreter argument aTHX to Perl_$func");
  2609. $file{changes} += $changes;
  2610. }
  2611. }
  2612. }
  2613. else {
  2614. warning("Uses Perl_$func instead of $func");
  2615. $file{changes} += ($c =~ s{\bPerl_$func(\s*)\((\s*aTHX_?)?\s*}
  2616. {$func$1(}g);
  2617. }
  2618. }
  2619. for $func (sort keys %{$file{uses_replace}}) {
  2620. warning("Uses $func instead of $replace{$func}");
  2621. $file{changes} += ($c =~ s/\b$func\b/$replace{$func}/g);
  2622. }
  2623. for $func (sort keys %{$file{uses_provided}}) {
  2624. if ($file{uses}{$func}) {
  2625. if (exists $file{uses_deps}{$func}) {
  2626. diag("Uses $func, which depends on ", join(', ', @{$file{uses_deps}{$func}}));
  2627. }
  2628. else {
  2629. diag("Uses $func");
  2630. }
  2631. }
  2632. $warnings += hint($func);
  2633. }
  2634. unless ($opt{quiet}) {
  2635. for $func (sort keys %{$file{uses_todo}}) {
  2636. print "*** WARNING: Uses $func, which may not be portable below perl ",
  2637. format_version($API{$func}{todo}), ", even with '$ppport'\n";
  2638. $warnings++;
  2639. }
  2640. }
  2641. for $func (sort keys %{$file{needed_static}}) {
  2642. my $message = '';
  2643. if (not exists $file{uses}{$func}) {
  2644. $message = "No need to define NEED_$func if $func is never used";
  2645. }
  2646. elsif (exists $file{needs}{$func} && $file{needs}{$func} ne 'static') {
  2647. $message = "No need to define NEED_$func when already needed globally";
  2648. }
  2649. if ($message) {
  2650. diag($message);
  2651. $file{changes} += ($c =~ s/^$HS*#$HS*define$HS+NEED_$func\b.*$LF//mg);
  2652. }
  2653. }
  2654. for $func (sort keys %{$file{needed_global}}) {
  2655. my $message = '';
  2656. if (not exists $global{uses}{$func}) {
  2657. $message = "No need to define NEED_${func}_GLOBAL if $func is never used";
  2658. }
  2659. elsif (exists $file{needs}{$func}) {
  2660. if ($file{needs}{$func} eq 'extern') {
  2661. $message = "No need to define NEED_${func}_GLOBAL when already needed globally";
  2662. }
  2663. elsif ($file{needs}{$func} eq 'static') {
  2664. $message = "No need to define NEED_${func}_GLOBAL when only used in this file";
  2665. }
  2666. }
  2667. if ($message) {
  2668. diag($message);
  2669. $file{changes} += ($c =~ s/^$HS*#$HS*define$HS+NEED_${func}_GLOBAL\b.*$LF//mg);
  2670. }
  2671. }
  2672. $file{needs_inc_ppport} = keys %{$file{uses}};
  2673. if ($file{needs_inc_ppport}) {
  2674. my $pp = '';
  2675. for $func (sort keys %{$file{needs}}) {
  2676. my $type = $file{needs}{$func};
  2677. next if $type eq 'extern';
  2678. my $suffix = $type eq 'global' ? '_GLOBAL' : '';
  2679. unless (exists $file{"needed_$type"}{$func}) {
  2680. if ($type eq 'global') {
  2681. diag("Files [@{$global{needs}{$func}}] need $func, adding global request");
  2682. }
  2683. else {
  2684. diag("File needs $func, adding static request");
  2685. }
  2686. $pp .= "#define NEED_$func$suffix\n";
  2687. }
  2688. }
  2689. if ($pp && ($c =~ s/^(?=$HS*#$HS*define$HS+NEED_\w+)/$pp/m)) {
  2690. $pp = '';
  2691. $file{changes}++;
  2692. }
  2693. unless ($file{has_inc_ppport}) {
  2694. diag("Needs to include '$ppport'");
  2695. $pp .= qq(#include "$ppport"\n)
  2696. }
  2697. if ($pp) {
  2698. $file{changes} += ($c =~ s/^($HS*#$HS*define$HS+NEED_\w+.*?)^/$1$pp/ms)
  2699. || ($c =~ s/^(?=$HS*#$HS*include.*\Q$ppport\E)/$pp/m)
  2700. || ($c =~ s/^($HS*#$HS*include.*XSUB.*\s*?)^/$1$pp/m)
  2701. || ($c =~ s/^/$pp/);
  2702. }
  2703. }
  2704. else {
  2705. if ($file{has_inc_ppport}) {
  2706. diag("No need to include '$ppport'");
  2707. $file{changes} += ($c =~ s/^$HS*?#$HS*include.*\Q$ppport\E.*?$LF//m);
  2708. }
  2709. }
  2710. # put back in our C comments
  2711. my $ix;
  2712. my $cppc = 0;
  2713. my @ccom = @{$file{ccom}};
  2714. for $ix (0 .. $#ccom) {
  2715. if (!$opt{cplusplus} && $ccom[$ix] =~ s!^//!!) {
  2716. $cppc++;
  2717. $file{changes} += $c =~ s/$rccs$ix$rcce/$ccs$ccom[$ix] $cce/;
  2718. }
  2719. else {
  2720. $c =~ s/$rccs$ix$rcce/$ccom[$ix]/;
  2721. }
  2722. }
  2723. if ($cppc) {
  2724. my $s = $cppc != 1 ? 's' : '';
  2725. warning("Uses $cppc C++ style comment$s, which is not portable");
  2726. }
  2727. my $s = $warnings != 1 ? 's' : '';
  2728. my $warn = $warnings ? " ($warnings warning$s)" : '';
  2729. info("Analysis completed$warn");
  2730. if ($file{changes}) {
  2731. if (exists $opt{copy}) {
  2732. my $newfile = "$filename$opt{copy}";
  2733. if (-e $newfile) {
  2734. error("'$newfile' already exists, refusing to write copy of '$filename'");
  2735. }
  2736. else {
  2737. local *F;
  2738. if (open F, ">$newfile") {
  2739. info("Writing copy of '$filename' with changes to '$newfile'");
  2740. print F $c;
  2741. close F;
  2742. }
  2743. else {
  2744. error("Cannot open '$newfile' for writing: $!");
  2745. }
  2746. }
  2747. }
  2748. elsif (exists $opt{patch} || $opt{changes}) {
  2749. if (exists $opt{patch}) {
  2750. unless ($patch_opened) {
  2751. if (open PATCH, ">$opt{patch}") {
  2752. $patch_opened = 1;
  2753. }
  2754. else {
  2755. error("Cannot open '$opt{patch}' for writing: $!");
  2756. delete $opt{patch};
  2757. $opt{changes} = 1;
  2758. goto fallback;
  2759. }
  2760. }
  2761. mydiff(\*PATCH, $filename, $c);
  2762. }
  2763. else {
  2764. fallback:
  2765. info("Suggested changes:");
  2766. mydiff(\*STDOUT, $filename, $c);
  2767. }
  2768. }
  2769. else {
  2770. my $s = $file{changes} == 1 ? '' : 's';
  2771. info("$file{changes} potentially required change$s detected");
  2772. }
  2773. }
  2774. else {
  2775. info("Looks good");
  2776. }
  2777. }
  2778. close PATCH if $patch_opened;
  2779. exit 0;
  2780. sub try_use { eval "use @_;"; return $@ eq '' }
  2781. sub mydiff
  2782. {
  2783. local *F = shift;
  2784. my($file, $str) = @_;
  2785. my $diff;
  2786. if (exists $opt{diff}) {
  2787. $diff = run_diff($opt{diff}, $file, $str);
  2788. }
  2789. if (!defined $diff and try_use('Text::Diff')) {
  2790. $diff = Text::Diff::diff($file, \$str, { STYLE => 'Unified' });
  2791. $diff = <<HEADER . $diff;
  2792. --- $file
  2793. +++ $file.patched
  2794. HEADER
  2795. }
  2796. if (!defined $diff) {
  2797. $diff = run_diff('diff -u', $file, $str);
  2798. }
  2799. if (!defined $diff) {
  2800. $diff = run_diff('diff', $file, $str);
  2801. }
  2802. if (!defined $diff) {
  2803. error("Cannot generate a diff. Please install Text::Diff or use --copy.");
  2804. return;
  2805. }
  2806. print F $diff;
  2807. }
  2808. sub run_diff
  2809. {
  2810. my($prog, $file, $str) = @_;
  2811. my $tmp = 'dppptemp';
  2812. my $suf = 'aaa';
  2813. my $diff = '';
  2814. local *F;
  2815. while (-e "$tmp.$suf") { $suf++ }
  2816. $tmp = "$tmp.$suf";
  2817. if (open F, ">$tmp") {
  2818. print F $str;
  2819. close F;
  2820. if (open F, "$prog $file $tmp |") {
  2821. while (<F>) {
  2822. s/\Q$tmp\E/$file.patched/;
  2823. $diff .= $_;
  2824. }
  2825. close F;
  2826. unlink $tmp;
  2827. return $diff;
  2828. }
  2829. unlink $tmp;
  2830. }
  2831. else {
  2832. error("Cannot open '$tmp' for writing: $!");
  2833. }
  2834. return undef;
  2835. }
  2836. sub rec_depend
  2837. {
  2838. my($func, $seen) = @_;
  2839. return () unless exists $depends{$func};
  2840. $seen = {%{$seen||{}}};
  2841. return () if $seen->{$func}++;
  2842. my %s;
  2843. grep !$s{$_}++, map { ($_, rec_depend($_, $seen)) } @{$depends{$func}};
  2844. }
  2845. sub parse_version
  2846. {
  2847. my $ver = shift;
  2848. if ($ver =~ /^(\d+)\.(\d+)\.(\d+)$/) {
  2849. return ($1, $2, $3);
  2850. }
  2851. elsif ($ver !~ /^\d+\.[\d_]+$/) {
  2852. die "cannot parse version '$ver'\n";
  2853. }
  2854. $ver =~ s/_//g;
  2855. $ver =~ s/$/000000/;
  2856. my($r,$v,$s) = $ver =~ /(\d+)\.(\d{3})(\d{3})/;
  2857. $v = int $v;
  2858. $s = int $s;
  2859. if ($r < 5 || ($r == 5 && $v < 6)) {
  2860. if ($s % 10) {
  2861. die "cannot parse version '$ver'\n";
  2862. }
  2863. }
  2864. return ($r, $v, $s);
  2865. }
  2866. sub format_version
  2867. {
  2868. my $ver = shift;
  2869. $ver =~ s/$/000000/;
  2870. my($r,$v,$s) = $ver =~ /(\d+)\.(\d{3})(\d{3})/;
  2871. $v = int $v;
  2872. $s = int $s;
  2873. if ($r < 5 || ($r == 5 && $v < 6)) {
  2874. if ($s % 10) {
  2875. die "invalid version '$ver'\n";
  2876. }
  2877. $s /= 10;
  2878. $ver = sprintf "%d.%03d", $r, $v;
  2879. $s > 0 and $ver .= sprintf "_%02d", $s;
  2880. return $ver;
  2881. }
  2882. return sprintf "%d.%d.%d", $r, $v, $s;
  2883. }
  2884. sub info
  2885. {
  2886. $opt{quiet} and return;
  2887. print @_, "\n";
  2888. }
  2889. sub diag
  2890. {
  2891. $opt{quiet} and return;
  2892. $opt{diag} and print @_, "\n";
  2893. }
  2894. sub warning
  2895. {
  2896. $opt{quiet} and return;
  2897. print "*** ", @_, "\n";
  2898. }
  2899. sub error
  2900. {
  2901. print "*** ERROR: ", @_, "\n";
  2902. }
  2903. my %given_hints;
  2904. my %given_warnings;
  2905. sub hint
  2906. {
  2907. $opt{quiet} and return;
  2908. my $func = shift;
  2909. my $rv = 0;
  2910. if (exists $warnings{$func} && !$given_warnings{$func}++) {
  2911. my $warn = $warnings{$func};
  2912. $warn =~ s!^!*** !mg;
  2913. print "*** WARNING: $func\n", $warn;
  2914. $rv++;
  2915. }
  2916. if ($opt{hints} && exists $hints{$func} && !$given_hints{$func}++) {
  2917. my $hint = $hints{$func};
  2918. $hint =~ s/^/ /mg;
  2919. print " --- hint for $func ---\n", $hint;
  2920. }
  2921. $rv;
  2922. }
  2923. sub usage
  2924. {
  2925. my($usage) = do { local(@ARGV,$/)=($0); <> } =~ /^=head\d$HS+SYNOPSIS\s*^(.*?)\s*^=/ms;
  2926. my %M = ( 'I' => '*' );
  2927. $usage =~ s/^\s*perl\s+\S+/$^X $0/;
  2928. $usage =~ s/([A-Z])<([^>]+)>/$M{$1}$2$M{$1}/g;
  2929. print <<ENDUSAGE;
  2930. Usage: $usage
  2931. See perldoc $0 for details.
  2932. ENDUSAGE
  2933. exit 2;
  2934. }
  2935. sub strip
  2936. {
  2937. my $self = do { local(@ARGV,$/)=($0); <> };
  2938. my($copy) = $self =~ /^=head\d\s+COPYRIGHT\s*^(.*?)^=\w+/ms;
  2939. $copy =~ s/^(?=\S+)/ /gms;
  2940. $self =~ s/^$HS+Do NOT edit.*?(?=^-)/$copy/ms;
  2941. $self =~ s/^SKIP.*(?=^__DATA__)/SKIP
  2942. if (\@ARGV && \$ARGV[0] eq '--unstrip') {
  2943. eval { require Devel::PPPort };
  2944. \$@ and die "Cannot require Devel::PPPort, please install.\\n";
  2945. if (eval \$Devel::PPPort::VERSION < $VERSION) {
  2946. die "$0 was originally generated with Devel::PPPort $VERSION.\\n"
  2947. . "Your Devel::PPPort is only version \$Devel::PPPort::VERSION.\\n"
  2948. . "Please install a newer version, or --unstrip will not work.\\n";
  2949. }
  2950. Devel::PPPort::WriteFile(\$0);
  2951. exit 0;
  2952. }
  2953. print <<END;
  2954. Sorry, but this is a stripped version of \$0.
  2955. To be able to use its original script and doc functionality,
  2956. please try to regenerate this file using:
  2957. \$^X \$0 --unstrip
  2958. END
  2959. /ms;
  2960. my($pl, $c) = $self =~ /(.*^__DATA__)(.*)/ms;
  2961. $c =~ s{
  2962. / (?: \*[^*]*\*+(?:[^$ccs][^*]*\*+)* / | /[^\r\n]*)
  2963. | ( "[^"\\]*(?:\\.[^"\\]*)*"
  2964. | '[^'\\]*(?:\\.[^'\\]*)*' )
  2965. | ($HS+) }{ defined $2 ? ' ' : ($1 || '') }gsex;
  2966. $c =~ s!\s+$!!mg;
  2967. $c =~ s!^$LF!!mg;
  2968. $c =~ s!^\s*#\s*!#!mg;
  2969. $c =~ s!^\s+!!mg;
  2970. open OUT, ">$0" or die "cannot strip $0: $!\n";
  2971. print OUT "$pl$c\n";
  2972. exit 0;
  2973. }
  2974. __DATA__
  2975. */
  2976. #ifndef _P_P_PORTABILITY_H_
  2977. #define _P_P_PORTABILITY_H_
  2978. #ifndef DPPP_NAMESPACE
  2979. # define DPPP_NAMESPACE DPPP_
  2980. #endif
  2981. #define DPPP_CAT2(x,y) CAT2(x,y)
  2982. #define DPPP_(name) DPPP_CAT2(DPPP_NAMESPACE, name)
  2983. #ifndef PERL_REVISION
  2984. # if !defined(__PATCHLEVEL_H_INCLUDED__) && !(defined(PATCHLEVEL) && defined(SUBVERSION))
  2985. # define PERL_PATCHLEVEL_H_IMPLICIT
  2986. # include <patchlevel.h>
  2987. # endif
  2988. # if !(defined(PERL_VERSION) || (defined(SUBVERSION) && defined(PATCHLEVEL)))
  2989. # include <could_not_find_Perl_patchlevel.h>
  2990. # endif
  2991. # ifndef PERL_REVISION
  2992. # define PERL_REVISION (5)
  2993. /* Replace: 1 */
  2994. # define PERL_VERSION PATCHLEVEL
  2995. # define PERL_SUBVERSION SUBVERSION
  2996. /* Replace PERL_PATCHLEVEL with PERL_VERSION */
  2997. /* Replace: 0 */
  2998. # endif
  2999. #endif
  3000. #define _dpppDEC2BCD(dec) ((((dec)/100)<<8)|((((dec)%100)/10)<<4)|((dec)%10))
  3001. #define PERL_BCDVERSION ((_dpppDEC2BCD(PERL_REVISION)<<24)|(_dpppDEC2BCD(PERL_VERSION)<<12)|_dpppDEC2BCD(PERL_SUBVERSION))
  3002. /* It is very unlikely that anyone will try to use this with Perl 6
  3003. (or greater), but who knows.
  3004. */
  3005. #if PERL_REVISION != 5
  3006. # error ppport.h only works with Perl version 5
  3007. #endif /* PERL_REVISION != 5 */
  3008. #ifndef dTHR
  3009. # define dTHR dNOOP
  3010. #endif
  3011. #ifndef dTHX
  3012. # define dTHX dNOOP
  3013. #endif
  3014. #ifndef dTHXa
  3015. # define dTHXa(x) dNOOP
  3016. #endif
  3017. #ifndef pTHX
  3018. # define pTHX void
  3019. #endif
  3020. #ifndef pTHX_
  3021. # define pTHX_
  3022. #endif
  3023. #ifndef aTHX
  3024. # define aTHX
  3025. #endif
  3026. #ifndef aTHX_
  3027. # define aTHX_
  3028. #endif
  3029. #if (PERL_BCDVERSION < 0x5006000)
  3030. # ifdef USE_THREADS
  3031. # define aTHXR thr
  3032. # define aTHXR_ thr,
  3033. # else
  3034. # define aTHXR
  3035. # define aTHXR_
  3036. # endif
  3037. # define dTHXR dTHR
  3038. #else
  3039. # define aTHXR aTHX
  3040. # define aTHXR_ aTHX_
  3041. # define dTHXR dTHX
  3042. #endif
  3043. #ifndef dTHXoa
  3044. # define dTHXoa(x) dTHXa(x)
  3045. #endif
  3046. #ifdef I_LIMITS
  3047. # include <limits.h>
  3048. #endif
  3049. #ifndef PERL_UCHAR_MIN
  3050. # define PERL_UCHAR_MIN ((unsigned char)0)
  3051. #endif
  3052. #ifndef PERL_UCHAR_MAX
  3053. # ifdef UCHAR_MAX
  3054. # define PERL_UCHAR_MAX ((unsigned char)UCHAR_MAX)
  3055. # else
  3056. # ifdef MAXUCHAR
  3057. # define PERL_UCHAR_MAX ((unsigned char)MAXUCHAR)
  3058. # else
  3059. # define PERL_UCHAR_MAX ((unsigned char)~(unsigned)0)
  3060. # endif
  3061. # endif
  3062. #endif
  3063. #ifndef PERL_USHORT_MIN
  3064. # define PERL_USHORT_MIN ((unsigned short)0)
  3065. #endif
  3066. #ifndef PERL_USHORT_MAX
  3067. # ifdef USHORT_MAX
  3068. # define PERL_USHORT_MAX ((unsigned short)USHORT_MAX)
  3069. # else
  3070. # ifdef MAXUSHORT
  3071. # define PERL_USHORT_MAX ((unsigned short)MAXUSHORT)
  3072. # else
  3073. # ifdef USHRT_MAX
  3074. # define PERL_USHORT_MAX ((unsigned short)USHRT_MAX)
  3075. # else
  3076. # define PERL_USHORT_MAX ((unsigned short)~(unsigned)0)
  3077. # endif
  3078. # endif
  3079. # endif
  3080. #endif
  3081. #ifndef PERL_SHORT_MAX
  3082. # ifdef SHORT_MAX
  3083. # define PERL_SHORT_MAX ((short)SHORT_MAX)
  3084. # else
  3085. # ifdef MAXSHORT /* Often used in <values.h> */
  3086. # define PERL_SHORT_MAX ((short)MAXSHORT)
  3087. # else
  3088. # ifdef SHRT_MAX
  3089. # define PERL_SHORT_MAX ((short)SHRT_MAX)
  3090. # else
  3091. # define PERL_SHORT_MAX ((short) (PERL_USHORT_MAX >> 1))
  3092. # endif
  3093. # endif
  3094. # endif
  3095. #endif
  3096. #ifndef PERL_SHORT_MIN
  3097. # ifdef SHORT_MIN
  3098. # define PERL_SHORT_MIN ((short)SHORT_MIN)
  3099. # else
  3100. # ifdef MINSHORT
  3101. # define PERL_SHORT_MIN ((short)MINSHORT)
  3102. # else
  3103. # ifdef SHRT_MIN
  3104. # define PERL_SHORT_MIN ((short)SHRT_MIN)
  3105. # else
  3106. # define PERL_SHORT_MIN (-PERL_SHORT_MAX - ((3 & -1) == 3))
  3107. # endif
  3108. # endif
  3109. # endif
  3110. #endif
  3111. #ifndef PERL_UINT_MAX
  3112. # ifdef UINT_MAX
  3113. # define PERL_UINT_MAX ((unsigned int)UINT_MAX)
  3114. # else
  3115. # ifdef MAXUINT
  3116. # define PERL_UINT_MAX ((unsigned int)MAXUINT)
  3117. # else
  3118. # define PERL_UINT_MAX (~(unsigned int)0)
  3119. # endif
  3120. # endif
  3121. #endif
  3122. #ifndef PERL_UINT_MIN
  3123. # define PERL_UINT_MIN ((unsigned int)0)
  3124. #endif
  3125. #ifndef PERL_INT_MAX
  3126. # ifdef INT_MAX
  3127. # define PERL_INT_MAX ((int)INT_MAX)
  3128. # else
  3129. # ifdef MAXINT /* Often used in <values.h> */
  3130. # define PERL_INT_MAX ((int)MAXINT)
  3131. # else
  3132. # define PERL_INT_MAX ((int)(PERL_UINT_MAX >> 1))
  3133. # endif
  3134. # endif
  3135. #endif
  3136. #ifndef PERL_INT_MIN
  3137. # ifdef INT_MIN
  3138. # define PERL_INT_MIN ((int)INT_MIN)
  3139. # else
  3140. # ifdef MININT
  3141. # define PERL_INT_MIN ((int)MININT)
  3142. # else
  3143. # define PERL_INT_MIN (-PERL_INT_MAX - ((3 & -1) == 3))
  3144. # endif
  3145. # endif
  3146. #endif
  3147. #ifndef PERL_ULONG_MAX
  3148. # ifdef ULONG_MAX
  3149. # define PERL_ULONG_MAX ((unsigned long)ULONG_MAX)
  3150. # else
  3151. # ifdef MAXULONG
  3152. # define PERL_ULONG_MAX ((unsigned long)MAXULONG)
  3153. # else
  3154. # define PERL_ULONG_MAX (~(unsigned long)0)
  3155. # endif
  3156. # endif
  3157. #endif
  3158. #ifndef PERL_ULONG_MIN
  3159. # define PERL_ULONG_MIN ((unsigned long)0L)
  3160. #endif
  3161. #ifndef PERL_LONG_MAX
  3162. # ifdef LONG_MAX
  3163. # define PERL_LONG_MAX ((long)LONG_MAX)
  3164. # else
  3165. # ifdef MAXLONG
  3166. # define PERL_LONG_MAX ((long)MAXLONG)
  3167. # else
  3168. # define PERL_LONG_MAX ((long) (PERL_ULONG_MAX >> 1))
  3169. # endif
  3170. # endif
  3171. #endif
  3172. #ifndef PERL_LONG_MIN
  3173. # ifdef LONG_MIN
  3174. # define PERL_LONG_MIN ((long)LONG_MIN)
  3175. # else
  3176. # ifdef MINLONG
  3177. # define PERL_LONG_MIN ((long)MINLONG)
  3178. # else
  3179. # define PERL_LONG_MIN (-PERL_LONG_MAX - ((3 & -1) == 3))
  3180. # endif
  3181. # endif
  3182. #endif
  3183. #if defined(HAS_QUAD) && (defined(convex) || defined(uts))
  3184. # ifndef PERL_UQUAD_MAX
  3185. # ifdef ULONGLONG_MAX
  3186. # define PERL_UQUAD_MAX ((unsigned long long)ULONGLONG_MAX)
  3187. # else
  3188. # ifdef MAXULONGLONG
  3189. # define PERL_UQUAD_MAX ((unsigned long long)MAXULONGLONG)
  3190. # else
  3191. # define PERL_UQUAD_MAX (~(unsigned long long)0)
  3192. # endif
  3193. # endif
  3194. # endif
  3195. # ifndef PERL_UQUAD_MIN
  3196. # define PERL_UQUAD_MIN ((unsigned long long)0L)
  3197. # endif
  3198. # ifndef PERL_QUAD_MAX
  3199. # ifdef LONGLONG_MAX
  3200. # define PERL_QUAD_MAX ((long long)LONGLONG_MAX)
  3201. # else
  3202. # ifdef MAXLONGLONG
  3203. # define PERL_QUAD_MAX ((long long)MAXLONGLONG)
  3204. # else
  3205. # define PERL_QUAD_MAX ((long long) (PERL_UQUAD_MAX >> 1))
  3206. # endif
  3207. # endif
  3208. # endif
  3209. # ifndef PERL_QUAD_MIN
  3210. # ifdef LONGLONG_MIN
  3211. # define PERL_QUAD_MIN ((long long)LONGLONG_MIN)
  3212. # else
  3213. # ifdef MINLONGLONG
  3214. # define PERL_QUAD_MIN ((long long)MINLONGLONG)
  3215. # else
  3216. # define PERL_QUAD_MIN (-PERL_QUAD_MAX - ((3 & -1) == 3))
  3217. # endif
  3218. # endif
  3219. # endif
  3220. #endif
  3221. /* This is based on code from 5.003 perl.h */
  3222. #ifdef HAS_QUAD
  3223. # ifdef cray
  3224. #ifndef IVTYPE
  3225. # define IVTYPE int
  3226. #endif
  3227. #ifndef IV_MIN
  3228. # define IV_MIN PERL_INT_MIN
  3229. #endif
  3230. #ifndef IV_MAX
  3231. # define IV_MAX PERL_INT_MAX
  3232. #endif
  3233. #ifndef UV_MIN
  3234. # define UV_MIN PERL_UINT_MIN
  3235. #endif
  3236. #ifndef UV_MAX
  3237. # define UV_MAX PERL_UINT_MAX
  3238. #endif
  3239. # ifdef INTSIZE
  3240. #ifndef IVSIZE
  3241. # define IVSIZE INTSIZE
  3242. #endif
  3243. # endif
  3244. # else
  3245. # if defined(convex) || defined(uts)
  3246. #ifndef IVTYPE
  3247. # define IVTYPE long long
  3248. #endif
  3249. #ifndef IV_MIN
  3250. # define IV_MIN PERL_QUAD_MIN
  3251. #endif
  3252. #ifndef IV_MAX
  3253. # define IV_MAX PERL_QUAD_MAX
  3254. #endif
  3255. #ifndef UV_MIN
  3256. # define UV_MIN PERL_UQUAD_MIN
  3257. #endif
  3258. #ifndef UV_MAX
  3259. # define UV_MAX PERL_UQUAD_MAX
  3260. #endif
  3261. # ifdef LONGLONGSIZE
  3262. #ifndef IVSIZE
  3263. # define IVSIZE LONGLONGSIZE
  3264. #endif
  3265. # endif
  3266. # else
  3267. #ifndef IVTYPE
  3268. # define IVTYPE long
  3269. #endif
  3270. #ifndef IV_MIN
  3271. # define IV_MIN PERL_LONG_MIN
  3272. #endif
  3273. #ifndef IV_MAX
  3274. # define IV_MAX PERL_LONG_MAX
  3275. #endif
  3276. #ifndef UV_MIN
  3277. # define UV_MIN PERL_ULONG_MIN
  3278. #endif
  3279. #ifndef UV_MAX
  3280. # define UV_MAX PERL_ULONG_MAX
  3281. #endif
  3282. # ifdef LONGSIZE
  3283. #ifndef IVSIZE
  3284. # define IVSIZE LONGSIZE
  3285. #endif
  3286. # endif
  3287. # endif
  3288. # endif
  3289. #ifndef IVSIZE
  3290. # define IVSIZE 8
  3291. #endif
  3292. #ifndef PERL_QUAD_MIN
  3293. # define PERL_QUAD_MIN IV_MIN
  3294. #endif
  3295. #ifndef PERL_QUAD_MAX
  3296. # define PERL_QUAD_MAX IV_MAX
  3297. #endif
  3298. #ifndef PERL_UQUAD_MIN
  3299. # define PERL_UQUAD_MIN UV_MIN
  3300. #endif
  3301. #ifndef PERL_UQUAD_MAX
  3302. # define PERL_UQUAD_MAX UV_MAX
  3303. #endif
  3304. #else
  3305. #ifndef IVTYPE
  3306. # define IVTYPE long
  3307. #endif
  3308. #ifndef IV_MIN
  3309. # define IV_MIN PERL_LONG_MIN
  3310. #endif
  3311. #ifndef IV_MAX
  3312. # define IV_MAX PERL_LONG_MAX
  3313. #endif
  3314. #ifndef UV_MIN
  3315. # define UV_MIN PERL_ULONG_MIN
  3316. #endif
  3317. #ifndef UV_MAX
  3318. # define UV_MAX PERL_ULONG_MAX
  3319. #endif
  3320. #endif
  3321. #ifndef IVSIZE
  3322. # ifdef LONGSIZE
  3323. # define IVSIZE LONGSIZE
  3324. # else
  3325. # define IVSIZE 4 /* A bold guess, but the best we can make. */
  3326. # endif
  3327. #endif
  3328. #ifndef UVTYPE
  3329. # define UVTYPE unsigned IVTYPE
  3330. #endif
  3331. #ifndef UVSIZE
  3332. # define UVSIZE IVSIZE
  3333. #endif
  3334. #ifndef sv_setuv
  3335. # define sv_setuv(sv, uv) \
  3336. STMT_START { \
  3337. UV TeMpUv = uv; \
  3338. if (TeMpUv <= IV_MAX) \
  3339. sv_setiv(sv, TeMpUv); \
  3340. else \
  3341. sv_setnv(sv, (double)TeMpUv); \
  3342. } STMT_END
  3343. #endif
  3344. #ifndef newSVuv
  3345. # define newSVuv(uv) ((uv) <= IV_MAX ? newSViv((IV)uv) : newSVnv((NV)uv))
  3346. #endif
  3347. #ifndef sv_2uv
  3348. # define sv_2uv(sv) ((PL_Sv = (sv)), (UV) (SvNOK(PL_Sv) ? SvNV(PL_Sv) : sv_2nv(PL_Sv)))
  3349. #endif
  3350. #ifndef SvUVX
  3351. # define SvUVX(sv) ((UV)SvIVX(sv))
  3352. #endif
  3353. #ifndef SvUVXx
  3354. # define SvUVXx(sv) SvUVX(sv)
  3355. #endif
  3356. #ifndef SvUV
  3357. # define SvUV(sv) (SvIOK(sv) ? SvUVX(sv) : sv_2uv(sv))
  3358. #endif
  3359. #ifndef SvUVx
  3360. # define SvUVx(sv) ((PL_Sv = (sv)), SvUV(PL_Sv))
  3361. #endif
  3362. /* Hint: sv_uv
  3363. * Always use the SvUVx() macro instead of sv_uv().
  3364. */
  3365. #ifndef sv_uv
  3366. # define sv_uv(sv) SvUVx(sv)
  3367. #endif
  3368. #if !defined(SvUOK) && defined(SvIOK_UV)
  3369. # define SvUOK(sv) SvIOK_UV(sv)
  3370. #endif
  3371. #ifndef XST_mUV
  3372. # define XST_mUV(i,v) (ST(i) = sv_2mortal(newSVuv(v)) )
  3373. #endif
  3374. #ifndef XSRETURN_UV
  3375. # define XSRETURN_UV(v) STMT_START { XST_mUV(0,v); XSRETURN(1); } STMT_END
  3376. #endif
  3377. #ifndef PUSHu
  3378. # define PUSHu(u) STMT_START { sv_setuv(TARG, (UV)(u)); PUSHTARG; } STMT_END
  3379. #endif
  3380. #ifndef XPUSHu
  3381. # define XPUSHu(u) STMT_START { sv_setuv(TARG, (UV)(u)); XPUSHTARG; } STMT_END
  3382. #endif
  3383. #ifdef HAS_MEMCMP
  3384. #ifndef memNE
  3385. # define memNE(s1,s2,l) (memcmp(s1,s2,l))
  3386. #endif
  3387. #ifndef memEQ
  3388. # define memEQ(s1,s2,l) (!memcmp(s1,s2,l))
  3389. #endif
  3390. #else
  3391. #ifndef memNE
  3392. # define memNE(s1,s2,l) (bcmp(s1,s2,l))
  3393. #endif
  3394. #ifndef memEQ
  3395. # define memEQ(s1,s2,l) (!bcmp(s1,s2,l))
  3396. #endif
  3397. #endif
  3398. #ifndef memEQs
  3399. # define memEQs(s1, l, s2) \
  3400. (sizeof(s2)-1 == l && memEQ(s1, (s2 ""), (sizeof(s2)-1)))
  3401. #endif
  3402. #ifndef memNEs
  3403. # define memNEs(s1, l, s2) !memEQs(s1, l, s2)
  3404. #endif
  3405. #ifndef MoveD
  3406. # define MoveD(s,d,n,t) memmove((char*)(d),(char*)(s), (n) * sizeof(t))
  3407. #endif
  3408. #ifndef CopyD
  3409. # define CopyD(s,d,n,t) memcpy((char*)(d),(char*)(s), (n) * sizeof(t))
  3410. #endif
  3411. #ifdef HAS_MEMSET
  3412. #ifndef ZeroD
  3413. # define ZeroD(d,n,t) memzero((char*)(d), (n) * sizeof(t))
  3414. #endif
  3415. #else
  3416. #ifndef ZeroD
  3417. # define ZeroD(d,n,t) ((void)memzero((char*)(d), (n) * sizeof(t)), d)
  3418. #endif
  3419. #endif
  3420. #ifndef PoisonWith
  3421. # define PoisonWith(d,n,t,b) (void)memset((char*)(d), (U8)(b), (n) * sizeof(t))
  3422. #endif
  3423. #ifndef PoisonNew
  3424. # define PoisonNew(d,n,t) PoisonWith(d,n,t,0xAB)
  3425. #endif
  3426. #ifndef PoisonFree
  3427. # define PoisonFree(d,n,t) PoisonWith(d,n,t,0xEF)
  3428. #endif
  3429. #ifndef Poison
  3430. # define Poison(d,n,t) PoisonFree(d,n,t)
  3431. #endif
  3432. #ifndef Newx
  3433. # define Newx(v,n,t) New(0,v,n,t)
  3434. #endif
  3435. #ifndef Newxc
  3436. # define Newxc(v,n,t,c) Newc(0,v,n,t,c)
  3437. #endif
  3438. #ifndef Newxz
  3439. # define Newxz(v,n,t) Newz(0,v,n,t)
  3440. #endif
  3441. #ifndef PERL_UNUSED_DECL
  3442. # ifdef HASATTRIBUTE
  3443. # if (defined(__GNUC__) && defined(__cplusplus)) || defined(__INTEL_COMPILER)
  3444. # define PERL_UNUSED_DECL
  3445. # else
  3446. # define PERL_UNUSED_DECL __attribute__((unused))
  3447. # endif
  3448. # else
  3449. # define PERL_UNUSED_DECL
  3450. # endif
  3451. #endif
  3452. #ifndef PERL_UNUSED_ARG
  3453. # if defined(lint) && defined(S_SPLINT_S) /* www.splint.org */
  3454. # include <note.h>
  3455. # define PERL_UNUSED_ARG(x) NOTE(ARGUNUSED(x))
  3456. # else
  3457. # define PERL_UNUSED_ARG(x) ((void)x)
  3458. # endif
  3459. #endif
  3460. #ifndef PERL_UNUSED_VAR
  3461. # define PERL_UNUSED_VAR(x) ((void)x)
  3462. #endif
  3463. #ifndef PERL_UNUSED_CONTEXT
  3464. # ifdef USE_ITHREADS
  3465. # define PERL_UNUSED_CONTEXT PERL_UNUSED_ARG(my_perl)
  3466. # else
  3467. # define PERL_UNUSED_CONTEXT
  3468. # endif
  3469. #endif
  3470. #ifndef NOOP
  3471. # define NOOP /*EMPTY*/(void)0
  3472. #endif
  3473. #ifndef dNOOP
  3474. # define dNOOP extern int /*@unused@*/ Perl___notused PERL_UNUSED_DECL
  3475. #endif
  3476. #ifndef NVTYPE
  3477. # if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
  3478. # define NVTYPE long double
  3479. # else
  3480. # define NVTYPE double
  3481. # endif
  3482. typedef NVTYPE NV;
  3483. #endif
  3484. #ifndef INT2PTR
  3485. # if (IVSIZE == PTRSIZE) && (UVSIZE == PTRSIZE)
  3486. # define PTRV UV
  3487. # define INT2PTR(any,d) (any)(d)
  3488. # else
  3489. # if PTRSIZE == LONGSIZE
  3490. # define PTRV unsigned long
  3491. # else
  3492. # define PTRV unsigned
  3493. # endif
  3494. # define INT2PTR(any,d) (any)(PTRV)(d)
  3495. # endif
  3496. #endif
  3497. #ifndef PTR2ul
  3498. # if PTRSIZE == LONGSIZE
  3499. # define PTR2ul(p) (unsigned long)(p)
  3500. # else
  3501. # define PTR2ul(p) INT2PTR(unsigned long,p)
  3502. # endif
  3503. #endif
  3504. #ifndef PTR2nat
  3505. # define PTR2nat(p) (PTRV)(p)
  3506. #endif
  3507. #ifndef NUM2PTR
  3508. # define NUM2PTR(any,d) (any)PTR2nat(d)
  3509. #endif
  3510. #ifndef PTR2IV
  3511. # define PTR2IV(p) INT2PTR(IV,p)
  3512. #endif
  3513. #ifndef PTR2UV
  3514. # define PTR2UV(p) INT2PTR(UV,p)
  3515. #endif
  3516. #ifndef PTR2NV
  3517. # define PTR2NV(p) NUM2PTR(NV,p)
  3518. #endif
  3519. #undef START_EXTERN_C
  3520. #undef END_EXTERN_C
  3521. #undef EXTERN_C
  3522. #ifdef __cplusplus
  3523. # define START_EXTERN_C extern "C" {
  3524. # define END_EXTERN_C }
  3525. # define EXTERN_C extern "C"
  3526. #else
  3527. # define START_EXTERN_C
  3528. # define END_EXTERN_C
  3529. # define EXTERN_C extern
  3530. #endif
  3531. #if defined(PERL_GCC_PEDANTIC)
  3532. # ifndef PERL_GCC_BRACE_GROUPS_FORBIDDEN
  3533. # define PERL_GCC_BRACE_GROUPS_FORBIDDEN
  3534. # endif
  3535. #endif
  3536. #if defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN) && !defined(__cplusplus)
  3537. # ifndef PERL_USE_GCC_BRACE_GROUPS
  3538. # define PERL_USE_GCC_BRACE_GROUPS
  3539. # endif
  3540. #endif
  3541. #undef STMT_START
  3542. #undef STMT_END
  3543. #ifdef PERL_USE_GCC_BRACE_GROUPS
  3544. # define STMT_START (void)( /* gcc supports ``({ STATEMENTS; })'' */
  3545. # define STMT_END )
  3546. #else
  3547. # if defined(VOIDFLAGS) && (VOIDFLAGS) && (defined(sun) || defined(__sun__)) && !defined(__GNUC__)
  3548. # define STMT_START if (1)
  3549. # define STMT_END else (void)0
  3550. # else
  3551. # define STMT_START do
  3552. # define STMT_END while (0)
  3553. # endif
  3554. #endif
  3555. #ifndef boolSV
  3556. # define boolSV(b) ((b) ? &PL_sv_yes : &PL_sv_no)
  3557. #endif
  3558. /* DEFSV appears first in 5.004_56 */
  3559. #ifndef DEFSV
  3560. # define DEFSV GvSV(PL_defgv)
  3561. #endif
  3562. #ifndef SAVE_DEFSV
  3563. # define SAVE_DEFSV SAVESPTR(GvSV(PL_defgv))
  3564. #endif
  3565. #ifndef DEFSV_set
  3566. # define DEFSV_set(sv) (DEFSV = (sv))
  3567. #endif
  3568. /* Older perls (<=5.003) lack AvFILLp */
  3569. #ifndef AvFILLp
  3570. # define AvFILLp AvFILL
  3571. #endif
  3572. #ifndef ERRSV
  3573. # define ERRSV get_sv("@",FALSE)
  3574. #endif
  3575. /* Hint: gv_stashpvn
  3576. * This function's backport doesn't support the length parameter, but
  3577. * rather ignores it. Portability can only be ensured if the length
  3578. * parameter is used for speed reasons, but the length can always be
  3579. * correctly computed from the string argument.
  3580. */
  3581. #ifndef gv_stashpvn
  3582. # define gv_stashpvn(str,len,create) gv_stashpv(str,create)
  3583. #endif
  3584. /* Replace: 1 */
  3585. #ifndef get_cv
  3586. # define get_cv perl_get_cv
  3587. #endif
  3588. #ifndef get_sv
  3589. # define get_sv perl_get_sv
  3590. #endif
  3591. #ifndef get_av
  3592. # define get_av perl_get_av
  3593. #endif
  3594. #ifndef get_hv
  3595. # define get_hv perl_get_hv
  3596. #endif
  3597. /* Replace: 0 */
  3598. #ifndef dUNDERBAR
  3599. # define dUNDERBAR dNOOP
  3600. #endif
  3601. #ifndef UNDERBAR
  3602. # define UNDERBAR DEFSV
  3603. #endif
  3604. #ifndef dAX
  3605. # define dAX I32 ax = MARK - PL_stack_base + 1
  3606. #endif
  3607. #ifndef dITEMS
  3608. # define dITEMS I32 items = SP - MARK
  3609. #endif
  3610. #ifndef dXSTARG
  3611. # define dXSTARG SV * targ = sv_newmortal()
  3612. #endif
  3613. #ifndef dAXMARK
  3614. # define dAXMARK I32 ax = POPMARK; \
  3615. register SV ** const mark = PL_stack_base + ax++
  3616. #endif
  3617. #ifndef XSprePUSH
  3618. # define XSprePUSH (sp = PL_stack_base + ax - 1)
  3619. #endif
  3620. #if (PERL_BCDVERSION < 0x5005000)
  3621. # undef XSRETURN
  3622. # define XSRETURN(off) \
  3623. STMT_START { \
  3624. PL_stack_sp = PL_stack_base + ax + ((off) - 1); \
  3625. return; \
  3626. } STMT_END
  3627. #endif
  3628. #ifndef XSPROTO
  3629. # define XSPROTO(name) void name(pTHX_ CV* cv)
  3630. #endif
  3631. #ifndef SVfARG
  3632. # define SVfARG(p) ((void*)(p))
  3633. #endif
  3634. #ifndef PERL_ABS
  3635. # define PERL_ABS(x) ((x) < 0 ? -(x) : (x))
  3636. #endif
  3637. #ifndef dVAR
  3638. # define dVAR dNOOP
  3639. #endif
  3640. #ifndef SVf
  3641. # define SVf "_"
  3642. #endif
  3643. #ifndef UTF8_MAXBYTES
  3644. # define UTF8_MAXBYTES UTF8_MAXLEN
  3645. #endif
  3646. #ifndef CPERLscope
  3647. # define CPERLscope(x) x
  3648. #endif
  3649. #ifndef PERL_HASH
  3650. # define PERL_HASH(hash,str,len) \
  3651. STMT_START { \
  3652. const char *s_PeRlHaSh = str; \
  3653. I32 i_PeRlHaSh = len; \
  3654. U32 hash_PeRlHaSh = 0; \
  3655. while (i_PeRlHaSh--) \
  3656. hash_PeRlHaSh = hash_PeRlHaSh * 33 + *s_PeRlHaSh++; \
  3657. (hash) = hash_PeRlHaSh; \
  3658. } STMT_END
  3659. #endif
  3660. #ifndef PERLIO_FUNCS_DECL
  3661. # ifdef PERLIO_FUNCS_CONST
  3662. # define PERLIO_FUNCS_DECL(funcs) const PerlIO_funcs funcs
  3663. # define PERLIO_FUNCS_CAST(funcs) (PerlIO_funcs*)(funcs)
  3664. # else
  3665. # define PERLIO_FUNCS_DECL(funcs) PerlIO_funcs funcs
  3666. # define PERLIO_FUNCS_CAST(funcs) (funcs)
  3667. # endif
  3668. #endif
  3669. /* provide these typedefs for older perls */
  3670. #if (PERL_BCDVERSION < 0x5009003)
  3671. # ifdef ARGSproto
  3672. typedef OP* (CPERLscope(*Perl_ppaddr_t))(ARGSproto);
  3673. # else
  3674. typedef OP* (CPERLscope(*Perl_ppaddr_t))(pTHX);
  3675. # endif
  3676. typedef OP* (CPERLscope(*Perl_check_t)) (pTHX_ OP*);
  3677. #endif
  3678. #ifndef isPSXSPC
  3679. # define isPSXSPC(c) (isSPACE(c) || (c) == '\v')
  3680. #endif
  3681. #ifndef isBLANK
  3682. # define isBLANK(c) ((c) == ' ' || (c) == '\t')
  3683. #endif
  3684. #ifdef EBCDIC
  3685. #ifndef isALNUMC
  3686. # define isALNUMC(c) isalnum(c)
  3687. #endif
  3688. #ifndef isASCII
  3689. # define isASCII(c) isascii(c)
  3690. #endif
  3691. #ifndef isCNTRL
  3692. # define isCNTRL(c) iscntrl(c)
  3693. #endif
  3694. #ifndef isGRAPH
  3695. # define isGRAPH(c) isgraph(c)
  3696. #endif
  3697. #ifndef isPRINT
  3698. # define isPRINT(c) isprint(c)
  3699. #endif
  3700. #ifndef isPUNCT
  3701. # define isPUNCT(c) ispunct(c)
  3702. #endif
  3703. #ifndef isXDIGIT
  3704. # define isXDIGIT(c) isxdigit(c)
  3705. #endif
  3706. #else
  3707. # if (PERL_BCDVERSION < 0x5010000)
  3708. /* Hint: isPRINT
  3709. * The implementation in older perl versions includes all of the
  3710. * isSPACE() characters, which is wrong. The version provided by
  3711. * Devel::PPPort always overrides a present buggy version.
  3712. */
  3713. # undef isPRINT
  3714. # endif
  3715. #ifndef isALNUMC
  3716. # define isALNUMC(c) (isALPHA(c) || isDIGIT(c))
  3717. #endif
  3718. #ifndef isASCII
  3719. # define isASCII(c) ((c) <= 127)
  3720. #endif
  3721. #ifndef isCNTRL
  3722. # define isCNTRL(c) ((c) < ' ' || (c) == 127)
  3723. #endif
  3724. #ifndef isGRAPH
  3725. # define isGRAPH(c) (isALNUM(c) || isPUNCT(c))
  3726. #endif
  3727. #ifndef isPRINT
  3728. # define isPRINT(c) (((c) >= 32 && (c) < 127))
  3729. #endif
  3730. #ifndef isPUNCT
  3731. # define isPUNCT(c) (((c) >= 33 && (c) <= 47) || ((c) >= 58 && (c) <= 64) || ((c) >= 91 && (c) <= 96) || ((c) >= 123 && (c) <= 126))
  3732. #endif
  3733. #ifndef isXDIGIT
  3734. # define isXDIGIT(c) (isDIGIT(c) || ((c) >= 'a' && (c) <= 'f') || ((c) >= 'A' && (c) <= 'F'))
  3735. #endif
  3736. #endif
  3737. #ifndef PERL_SIGNALS_UNSAFE_FLAG
  3738. #define PERL_SIGNALS_UNSAFE_FLAG 0x0001
  3739. #if (PERL_BCDVERSION < 0x5008000)
  3740. # define D_PPP_PERL_SIGNALS_INIT PERL_SIGNALS_UNSAFE_FLAG
  3741. #else
  3742. # define D_PPP_PERL_SIGNALS_INIT 0
  3743. #endif
  3744. #if defined(NEED_PL_signals)
  3745. static U32 DPPP_(my_PL_signals) = D_PPP_PERL_SIGNALS_INIT;
  3746. #elif defined(NEED_PL_signals_GLOBAL)
  3747. U32 DPPP_(my_PL_signals) = D_PPP_PERL_SIGNALS_INIT;
  3748. #else
  3749. extern U32 DPPP_(my_PL_signals);
  3750. #endif
  3751. #define PL_signals DPPP_(my_PL_signals)
  3752. #endif
  3753. /* Hint: PL_ppaddr
  3754. * Calling an op via PL_ppaddr requires passing a context argument
  3755. * for threaded builds. Since the context argument is different for
  3756. * 5.005 perls, you can use aTHXR (supplied by ppport.h), which will
  3757. * automatically be defined as the correct argument.
  3758. */
  3759. #if (PERL_BCDVERSION <= 0x5005005)
  3760. /* Replace: 1 */
  3761. # define PL_ppaddr ppaddr
  3762. # define PL_no_modify no_modify
  3763. /* Replace: 0 */
  3764. #endif
  3765. #if (PERL_BCDVERSION <= 0x5004005)
  3766. /* Replace: 1 */
  3767. # define PL_DBsignal DBsignal
  3768. # define PL_DBsingle DBsingle
  3769. # define PL_DBsub DBsub
  3770. # define PL_DBtrace DBtrace
  3771. # define PL_Sv Sv
  3772. # define PL_bufend bufend
  3773. # define PL_bufptr bufptr
  3774. # define PL_compiling compiling
  3775. # define PL_copline copline
  3776. # define PL_curcop curcop
  3777. # define PL_curstash curstash
  3778. # define PL_debstash debstash
  3779. # define PL_defgv defgv
  3780. # define PL_diehook diehook
  3781. # define PL_dirty dirty
  3782. # define PL_dowarn dowarn
  3783. # define PL_errgv errgv
  3784. # define PL_error_count error_count
  3785. # define PL_expect expect
  3786. # define PL_hexdigit hexdigit
  3787. # define PL_hints hints
  3788. # define PL_in_my in_my
  3789. # define PL_laststatval laststatval
  3790. # define PL_lex_state lex_state
  3791. # define PL_lex_stuff lex_stuff
  3792. # define PL_linestr linestr
  3793. # define PL_na na
  3794. # define PL_perl_destruct_level perl_destruct_level
  3795. # define PL_perldb perldb
  3796. # define PL_rsfp_filters rsfp_filters
  3797. # define PL_rsfp rsfp
  3798. # define PL_stack_base stack_base
  3799. # define PL_stack_sp stack_sp
  3800. # define PL_statcache statcache
  3801. # define PL_stdingv stdingv
  3802. # define PL_sv_arenaroot sv_arenaroot
  3803. # define PL_sv_no sv_no
  3804. # define PL_sv_undef sv_undef
  3805. # define PL_sv_yes sv_yes
  3806. # define PL_tainted tainted
  3807. # define PL_tainting tainting
  3808. # define PL_tokenbuf tokenbuf
  3809. /* Replace: 0 */
  3810. #endif
  3811. /* Warning: PL_parser
  3812. * For perl versions earlier than 5.9.5, this is an always
  3813. * non-NULL dummy. Also, it cannot be dereferenced. Don't
  3814. * use it if you can avoid is and unless you absolutely know
  3815. * what you're doing.
  3816. * If you always check that PL_parser is non-NULL, you can
  3817. * define DPPP_PL_parser_NO_DUMMY to avoid the creation of
  3818. * a dummy parser structure.
  3819. */
  3820. #if (PERL_BCDVERSION >= 0x5009005)
  3821. # ifdef DPPP_PL_parser_NO_DUMMY
  3822. # define D_PPP_my_PL_parser_var(var) ((PL_parser ? PL_parser : \
  3823. (croak("panic: PL_parser == NULL in %s:%d", \
  3824. __FILE__, __LINE__), (yy_parser *) NULL))->var)
  3825. # else
  3826. # ifdef DPPP_PL_parser_NO_DUMMY_WARNING
  3827. # define D_PPP_parser_dummy_warning(var)
  3828. # else
  3829. # define D_PPP_parser_dummy_warning(var) \
  3830. warn("warning: dummy PL_" #var " used in %s:%d", __FILE__, __LINE__),
  3831. # endif
  3832. # define D_PPP_my_PL_parser_var(var) ((PL_parser ? PL_parser : \
  3833. (D_PPP_parser_dummy_warning(var) &DPPP_(dummy_PL_parser)))->var)
  3834. #if defined(NEED_PL_parser)
  3835. static yy_parser DPPP_(dummy_PL_parser);
  3836. #elif defined(NEED_PL_parser_GLOBAL)
  3837. yy_parser DPPP_(dummy_PL_parser);
  3838. #else
  3839. extern yy_parser DPPP_(dummy_PL_parser);
  3840. #endif
  3841. # endif
  3842. /* 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 */
  3843. /* Warning: PL_expect, PL_copline, PL_rsfp, PL_rsfp_filters, PL_linestr, PL_bufptr, PL_bufend, PL_lex_state, PL_lex_stuff, PL_tokenbuf
  3844. * Do not use this variable unless you know exactly what you're
  3845. * doint. It is internal to the perl parser and may change or even
  3846. * be removed in the future. As of perl 5.9.5, you have to check
  3847. * for (PL_parser != NULL) for this variable to have any effect.
  3848. * An always non-NULL PL_parser dummy is provided for earlier
  3849. * perl versions.
  3850. * If PL_parser is NULL when you try to access this variable, a
  3851. * dummy is being accessed instead and a warning is issued unless
  3852. * you define DPPP_PL_parser_NO_DUMMY_WARNING.
  3853. * If DPPP_PL_parser_NO_DUMMY is defined, the code trying to access
  3854. * this variable will croak with a panic message.
  3855. */
  3856. # define PL_expect D_PPP_my_PL_parser_var(expect)
  3857. # define PL_copline D_PPP_my_PL_parser_var(copline)
  3858. # define PL_rsfp D_PPP_my_PL_parser_var(rsfp)
  3859. # define PL_rsfp_filters D_PPP_my_PL_parser_var(rsfp_filters)
  3860. # define PL_linestr D_PPP_my_PL_parser_var(linestr)
  3861. # define PL_bufptr D_PPP_my_PL_parser_var(bufptr)
  3862. # define PL_bufend D_PPP_my_PL_parser_var(bufend)
  3863. # define PL_lex_state D_PPP_my_PL_parser_var(lex_state)
  3864. # define PL_lex_stuff D_PPP_my_PL_parser_var(lex_stuff)
  3865. # define PL_tokenbuf D_PPP_my_PL_parser_var(tokenbuf)
  3866. # define PL_in_my D_PPP_my_PL_parser_var(in_my)
  3867. # define PL_in_my_stash D_PPP_my_PL_parser_var(in_my_stash)
  3868. # define PL_error_count D_PPP_my_PL_parser_var(error_count)
  3869. #else
  3870. /* ensure that PL_parser != NULL and cannot be dereferenced */
  3871. # define PL_parser ((void *) 1)
  3872. #endif
  3873. #ifndef mPUSHs
  3874. # define mPUSHs(s) PUSHs(sv_2mortal(s))
  3875. #endif
  3876. #ifndef PUSHmortal
  3877. # define PUSHmortal PUSHs(sv_newmortal())
  3878. #endif
  3879. #ifndef mPUSHp
  3880. # define mPUSHp(p,l) sv_setpvn(PUSHmortal, (p), (l))
  3881. #endif
  3882. #ifndef mPUSHn
  3883. # define mPUSHn(n) sv_setnv(PUSHmortal, (NV)(n))
  3884. #endif
  3885. #ifndef mPUSHi
  3886. # define mPUSHi(i) sv_setiv(PUSHmortal, (IV)(i))
  3887. #endif
  3888. #ifndef mPUSHu
  3889. # define mPUSHu(u) sv_setuv(PUSHmortal, (UV)(u))
  3890. #endif
  3891. #ifndef mXPUSHs
  3892. # define mXPUSHs(s) XPUSHs(sv_2mortal(s))
  3893. #endif
  3894. #ifndef XPUSHmortal
  3895. # define XPUSHmortal XPUSHs(sv_newmortal())
  3896. #endif
  3897. #ifndef mXPUSHp
  3898. # define mXPUSHp(p,l) STMT_START { EXTEND(sp,1); sv_setpvn(PUSHmortal, (p), (l)); } STMT_END
  3899. #endif
  3900. #ifndef mXPUSHn
  3901. # define mXPUSHn(n) STMT_START { EXTEND(sp,1); sv_setnv(PUSHmortal, (NV)(n)); } STMT_END
  3902. #endif
  3903. #ifndef mXPUSHi
  3904. # define mXPUSHi(i) STMT_START { EXTEND(sp,1); sv_setiv(PUSHmortal, (IV)(i)); } STMT_END
  3905. #endif
  3906. #ifndef mXPUSHu
  3907. # define mXPUSHu(u) STMT_START { EXTEND(sp,1); sv_setuv(PUSHmortal, (UV)(u)); } STMT_END
  3908. #endif
  3909. /* Replace: 1 */
  3910. #ifndef call_sv
  3911. # define call_sv perl_call_sv
  3912. #endif
  3913. #ifndef call_pv
  3914. # define call_pv perl_call_pv
  3915. #endif
  3916. #ifndef call_argv
  3917. # define call_argv perl_call_argv
  3918. #endif
  3919. #ifndef call_method
  3920. # define call_method perl_call_method
  3921. #endif
  3922. #ifndef eval_sv
  3923. # define eval_sv perl_eval_sv
  3924. #endif
  3925. /* Replace: 0 */
  3926. #ifndef PERL_LOADMOD_DENY
  3927. # define PERL_LOADMOD_DENY 0x1
  3928. #endif
  3929. #ifndef PERL_LOADMOD_NOIMPORT
  3930. # define PERL_LOADMOD_NOIMPORT 0x2
  3931. #endif
  3932. #ifndef PERL_LOADMOD_IMPORT_OPS
  3933. # define PERL_LOADMOD_IMPORT_OPS 0x4
  3934. #endif
  3935. #ifndef G_METHOD
  3936. # define G_METHOD 64
  3937. # ifdef call_sv
  3938. # undef call_sv
  3939. # endif
  3940. # if (PERL_BCDVERSION < 0x5006000)
  3941. # define call_sv(sv, flags) ((flags) & G_METHOD ? perl_call_method((char *) SvPV_nolen_const(sv), \
  3942. (flags) & ~G_METHOD) : perl_call_sv(sv, flags))
  3943. # else
  3944. # define call_sv(sv, flags) ((flags) & G_METHOD ? Perl_call_method(aTHX_ (char *) SvPV_nolen_const(sv), \
  3945. (flags) & ~G_METHOD) : Perl_call_sv(aTHX_ sv, flags))
  3946. # endif
  3947. #endif
  3948. /* Replace perl_eval_pv with eval_pv */
  3949. #ifndef eval_pv
  3950. #if defined(NEED_eval_pv)
  3951. static SV* DPPP_(my_eval_pv)(char *p, I32 croak_on_error);
  3952. static
  3953. #else
  3954. extern SV* DPPP_(my_eval_pv)(char *p, I32 croak_on_error);
  3955. #endif
  3956. #ifdef eval_pv
  3957. # undef eval_pv
  3958. #endif
  3959. #define eval_pv(a,b) DPPP_(my_eval_pv)(aTHX_ a,b)
  3960. #define Perl_eval_pv DPPP_(my_eval_pv)
  3961. #if defined(NEED_eval_pv) || defined(NEED_eval_pv_GLOBAL)
  3962. SV*
  3963. DPPP_(my_eval_pv)(char *p, I32 croak_on_error)
  3964. {
  3965. dSP;
  3966. SV* sv = newSVpv(p, 0);
  3967. PUSHMARK(sp);
  3968. eval_sv(sv, G_SCALAR);
  3969. SvREFCNT_dec(sv);
  3970. SPAGAIN;
  3971. sv = POPs;
  3972. PUTBACK;
  3973. if (croak_on_error && SvTRUE(GvSV(errgv)))
  3974. croak(SvPVx(GvSV(errgv), na));
  3975. return sv;
  3976. }
  3977. #endif
  3978. #endif
  3979. #ifndef vload_module
  3980. #if defined(NEED_vload_module)
  3981. static void DPPP_(my_vload_module)(U32 flags, SV *name, SV *ver, va_list *args);
  3982. static
  3983. #else
  3984. extern void DPPP_(my_vload_module)(U32 flags, SV *name, SV *ver, va_list *args);
  3985. #endif
  3986. #ifdef vload_module
  3987. # undef vload_module
  3988. #endif
  3989. #define vload_module(a,b,c,d) DPPP_(my_vload_module)(aTHX_ a,b,c,d)
  3990. #define Perl_vload_module DPPP_(my_vload_module)
  3991. #if defined(NEED_vload_module) || defined(NEED_vload_module_GLOBAL)
  3992. void
  3993. DPPP_(my_vload_module)(U32 flags, SV *name, SV *ver, va_list *args)
  3994. {
  3995. dTHR;
  3996. dVAR;
  3997. OP *veop, *imop;
  3998. OP * const modname = newSVOP(OP_CONST, 0, name);
  3999. /* 5.005 has a somewhat hacky force_normal that doesn't croak on
  4000. SvREADONLY() if PL_compling is true. Current perls take care in
  4001. ck_require() to correctly turn off SvREADONLY before calling
  4002. force_normal_flags(). This seems a better fix than fudging PL_compling
  4003. */
  4004. SvREADONLY_off(((SVOP*)modname)->op_sv);
  4005. modname->op_private |= OPpCONST_BARE;
  4006. if (ver) {
  4007. veop = newSVOP(OP_CONST, 0, ver);
  4008. }
  4009. else
  4010. veop = NULL;
  4011. if (flags & PERL_LOADMOD_NOIMPORT) {
  4012. imop = sawparens(newNULLLIST());
  4013. }
  4014. else if (flags & PERL_LOADMOD_IMPORT_OPS) {
  4015. imop = va_arg(*args, OP*);
  4016. }
  4017. else {
  4018. SV *sv;
  4019. imop = NULL;
  4020. sv = va_arg(*args, SV*);
  4021. while (sv) {
  4022. imop = append_elem(OP_LIST, imop, newSVOP(OP_CONST, 0, sv));
  4023. sv = va_arg(*args, SV*);
  4024. }
  4025. }
  4026. {
  4027. const line_t ocopline = PL_copline;
  4028. COP * const ocurcop = PL_curcop;
  4029. const int oexpect = PL_expect;
  4030. #if (PERL_BCDVERSION >= 0x5004000)
  4031. utilize(!(flags & PERL_LOADMOD_DENY), start_subparse(FALSE, 0),
  4032. veop, modname, imop);
  4033. #else
  4034. utilize(!(flags & PERL_LOADMOD_DENY), start_subparse(),
  4035. modname, imop);
  4036. #endif
  4037. PL_expect = oexpect;
  4038. PL_copline = ocopline;
  4039. PL_curcop = ocurcop;
  4040. }
  4041. }
  4042. #endif
  4043. #endif
  4044. #ifndef load_module
  4045. #if defined(NEED_load_module)
  4046. static void DPPP_(my_load_module)(U32 flags, SV *name, SV *ver, ...);
  4047. static
  4048. #else
  4049. extern void DPPP_(my_load_module)(U32 flags, SV *name, SV *ver, ...);
  4050. #endif
  4051. #ifdef load_module
  4052. # undef load_module
  4053. #endif
  4054. #define load_module DPPP_(my_load_module)
  4055. #define Perl_load_module DPPP_(my_load_module)
  4056. #if defined(NEED_load_module) || defined(NEED_load_module_GLOBAL)
  4057. void
  4058. DPPP_(my_load_module)(U32 flags, SV *name, SV *ver, ...)
  4059. {
  4060. va_list args;
  4061. va_start(args, ver);
  4062. vload_module(flags, name, ver, &args);
  4063. va_end(args);
  4064. }
  4065. #endif
  4066. #endif
  4067. #ifndef newRV_inc
  4068. # define newRV_inc(sv) newRV(sv) /* Replace */
  4069. #endif
  4070. #ifndef newRV_noinc
  4071. #if defined(NEED_newRV_noinc)
  4072. static SV * DPPP_(my_newRV_noinc)(SV *sv);
  4073. static
  4074. #else
  4075. extern SV * DPPP_(my_newRV_noinc)(SV *sv);
  4076. #endif
  4077. #ifdef newRV_noinc
  4078. # undef newRV_noinc
  4079. #endif
  4080. #define newRV_noinc(a) DPPP_(my_newRV_noinc)(aTHX_ a)
  4081. #define Perl_newRV_noinc DPPP_(my_newRV_noinc)
  4082. #if defined(NEED_newRV_noinc) || defined(NEED_newRV_noinc_GLOBAL)
  4083. SV *
  4084. DPPP_(my_newRV_noinc)(SV *sv)
  4085. {
  4086. SV *rv = (SV *)newRV(sv);
  4087. SvREFCNT_dec(sv);
  4088. return rv;
  4089. }
  4090. #endif
  4091. #endif
  4092. /* Hint: newCONSTSUB
  4093. * Returns a CV* as of perl-5.7.1. This return value is not supported
  4094. * by Devel::PPPort.
  4095. */
  4096. /* newCONSTSUB from IO.xs is in the core starting with 5.004_63 */
  4097. #if (PERL_BCDVERSION < 0x5004063) && (PERL_BCDVERSION != 0x5004005)
  4098. #if defined(NEED_newCONSTSUB)
  4099. static void DPPP_(my_newCONSTSUB)(HV *stash, const char *name, SV *sv);
  4100. static
  4101. #else
  4102. extern void DPPP_(my_newCONSTSUB)(HV *stash, const char *name, SV *sv);
  4103. #endif
  4104. #ifdef newCONSTSUB
  4105. # undef newCONSTSUB
  4106. #endif
  4107. #define newCONSTSUB(a,b,c) DPPP_(my_newCONSTSUB)(aTHX_ a,b,c)
  4108. #define Perl_newCONSTSUB DPPP_(my_newCONSTSUB)
  4109. #if defined(NEED_newCONSTSUB) || defined(NEED_newCONSTSUB_GLOBAL)
  4110. /* This is just a trick to avoid a dependency of newCONSTSUB on PL_parser */
  4111. /* (There's no PL_parser in perl < 5.005, so this is completely safe) */
  4112. #define D_PPP_PL_copline PL_copline
  4113. void
  4114. DPPP_(my_newCONSTSUB)(HV *stash, const char *name, SV *sv)
  4115. {
  4116. U32 oldhints = PL_hints;
  4117. HV *old_cop_stash = PL_curcop->cop_stash;
  4118. HV *old_curstash = PL_curstash;
  4119. line_t oldline = PL_curcop->cop_line;
  4120. PL_curcop->cop_line = D_PPP_PL_copline;
  4121. PL_hints &= ~HINT_BLOCK_SCOPE;
  4122. if (stash)
  4123. PL_curstash = PL_curcop->cop_stash = stash;
  4124. newSUB(
  4125. #if (PERL_BCDVERSION < 0x5003022)
  4126. start_subparse(),
  4127. #elif (PERL_BCDVERSION == 0x5003022)
  4128. start_subparse(0),
  4129. #else /* 5.003_23 onwards */
  4130. start_subparse(FALSE, 0),
  4131. #endif
  4132. newSVOP(OP_CONST, 0, newSVpv((char *) name, 0)),
  4133. newSVOP(OP_CONST, 0, &PL_sv_no), /* SvPV(&PL_sv_no) == "" -- GMB */
  4134. newSTATEOP(0, Nullch, newSVOP(OP_CONST, 0, sv))
  4135. );
  4136. PL_hints = oldhints;
  4137. PL_curcop->cop_stash = old_cop_stash;
  4138. PL_curstash = old_curstash;
  4139. PL_curcop->cop_line = oldline;
  4140. }
  4141. #endif
  4142. #endif
  4143. /*
  4144. * Boilerplate macros for initializing and accessing interpreter-local
  4145. * data from C. All statics in extensions should be reworked to use
  4146. * this, if you want to make the extension thread-safe. See ext/re/re.xs
  4147. * for an example of the use of these macros.
  4148. *
  4149. * Code that uses these macros is responsible for the following:
  4150. * 1. #define MY_CXT_KEY to a unique string, e.g. "DynaLoader_guts"
  4151. * 2. Declare a typedef named my_cxt_t that is a structure that contains
  4152. * all the data that needs to be interpreter-local.
  4153. * 3. Use the START_MY_CXT macro after the declaration of my_cxt_t.
  4154. * 4. Use the MY_CXT_INIT macro such that it is called exactly once
  4155. * (typically put in the BOOT: section).
  4156. * 5. Use the members of the my_cxt_t structure everywhere as
  4157. * MY_CXT.member.
  4158. * 6. Use the dMY_CXT macro (a declaration) in all the functions that
  4159. * access MY_CXT.
  4160. */
  4161. #if defined(MULTIPLICITY) || defined(PERL_OBJECT) || \
  4162. defined(PERL_CAPI) || defined(PERL_IMPLICIT_CONTEXT)
  4163. #ifndef START_MY_CXT
  4164. /* This must appear in all extensions that define a my_cxt_t structure,
  4165. * right after the definition (i.e. at file scope). The non-threads
  4166. * case below uses it to declare the data as static. */
  4167. #define START_MY_CXT
  4168. #if (PERL_BCDVERSION < 0x5004068)
  4169. /* Fetches the SV that keeps the per-interpreter data. */
  4170. #define dMY_CXT_SV \
  4171. SV *my_cxt_sv = get_sv(MY_CXT_KEY, FALSE)
  4172. #else /* >= perl5.004_68 */
  4173. #define dMY_CXT_SV \
  4174. SV *my_cxt_sv = *hv_fetch(PL_modglobal, MY_CXT_KEY, \
  4175. sizeof(MY_CXT_KEY)-1, TRUE)
  4176. #endif /* < perl5.004_68 */
  4177. /* This declaration should be used within all functions that use the
  4178. * interpreter-local data. */
  4179. #define dMY_CXT \
  4180. dMY_CXT_SV; \
  4181. my_cxt_t *my_cxtp = INT2PTR(my_cxt_t*,SvUV(my_cxt_sv))
  4182. /* Creates and zeroes the per-interpreter data.
  4183. * (We allocate my_cxtp in a Perl SV so that it will be released when
  4184. * the interpreter goes away.) */
  4185. #define MY_CXT_INIT \
  4186. dMY_CXT_SV; \
  4187. /* newSV() allocates one more than needed */ \
  4188. my_cxt_t *my_cxtp = (my_cxt_t*)SvPVX(newSV(sizeof(my_cxt_t)-1));\
  4189. Zero(my_cxtp, 1, my_cxt_t); \
  4190. sv_setuv(my_cxt_sv, PTR2UV(my_cxtp))
  4191. /* This macro must be used to access members of the my_cxt_t structure.
  4192. * e.g. MYCXT.some_data */
  4193. #define MY_CXT (*my_cxtp)
  4194. /* Judicious use of these macros can reduce the number of times dMY_CXT
  4195. * is used. Use is similar to pTHX, aTHX etc. */
  4196. #define pMY_CXT my_cxt_t *my_cxtp
  4197. #define pMY_CXT_ pMY_CXT,
  4198. #define _pMY_CXT ,pMY_CXT
  4199. #define aMY_CXT my_cxtp
  4200. #define aMY_CXT_ aMY_CXT,
  4201. #define _aMY_CXT ,aMY_CXT
  4202. #endif /* START_MY_CXT */
  4203. #ifndef MY_CXT_CLONE
  4204. /* Clones the per-interpreter data. */
  4205. #define MY_CXT_CLONE \
  4206. dMY_CXT_SV; \
  4207. my_cxt_t *my_cxtp = (my_cxt_t*)SvPVX(newSV(sizeof(my_cxt_t)-1));\
  4208. Copy(INT2PTR(my_cxt_t*, SvUV(my_cxt_sv)), my_cxtp, 1, my_cxt_t);\
  4209. sv_setuv(my_cxt_sv, PTR2UV(my_cxtp))
  4210. #endif
  4211. #else /* single interpreter */
  4212. #ifndef START_MY_CXT
  4213. #define START_MY_CXT static my_cxt_t my_cxt;
  4214. #define dMY_CXT_SV dNOOP
  4215. #define dMY_CXT dNOOP
  4216. #define MY_CXT_INIT NOOP
  4217. #define MY_CXT my_cxt
  4218. #define pMY_CXT void
  4219. #define pMY_CXT_
  4220. #define _pMY_CXT
  4221. #define aMY_CXT
  4222. #define aMY_CXT_
  4223. #define _aMY_CXT
  4224. #endif /* START_MY_CXT */
  4225. #ifndef MY_CXT_CLONE
  4226. #define MY_CXT_CLONE NOOP
  4227. #endif
  4228. #endif
  4229. #ifndef IVdf
  4230. # if IVSIZE == LONGSIZE
  4231. # define IVdf "ld"
  4232. # define UVuf "lu"
  4233. # define UVof "lo"
  4234. # define UVxf "lx"
  4235. # define UVXf "lX"
  4236. # else
  4237. # if IVSIZE == INTSIZE
  4238. # define IVdf "d"
  4239. # define UVuf "u"
  4240. # define UVof "o"
  4241. # define UVxf "x"
  4242. # define UVXf "X"
  4243. # endif
  4244. # endif
  4245. #endif
  4246. #ifndef NVef
  4247. # if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) && \
  4248. defined(PERL_PRIfldbl) && (PERL_BCDVERSION != 0x5006000)
  4249. /* Not very likely, but let's try anyway. */
  4250. # define NVef PERL_PRIeldbl
  4251. # define NVff PERL_PRIfldbl
  4252. # define NVgf PERL_PRIgldbl
  4253. # else
  4254. # define NVef "e"
  4255. # define NVff "f"
  4256. # define NVgf "g"
  4257. # endif
  4258. #endif
  4259. #ifndef SvREFCNT_inc
  4260. # ifdef PERL_USE_GCC_BRACE_GROUPS
  4261. # define SvREFCNT_inc(sv) \
  4262. ({ \
  4263. SV * const _sv = (SV*)(sv); \
  4264. if (_sv) \
  4265. (SvREFCNT(_sv))++; \
  4266. _sv; \
  4267. })
  4268. # else
  4269. # define SvREFCNT_inc(sv) \
  4270. ((PL_Sv=(SV*)(sv)) ? (++(SvREFCNT(PL_Sv)),PL_Sv) : NULL)
  4271. # endif
  4272. #endif
  4273. #ifndef SvREFCNT_inc_simple
  4274. # ifdef PERL_USE_GCC_BRACE_GROUPS
  4275. # define SvREFCNT_inc_simple(sv) \
  4276. ({ \
  4277. if (sv) \
  4278. (SvREFCNT(sv))++; \
  4279. (SV *)(sv); \
  4280. })
  4281. # else
  4282. # define SvREFCNT_inc_simple(sv) \
  4283. ((sv) ? (SvREFCNT(sv)++,(SV*)(sv)) : NULL)
  4284. # endif
  4285. #endif
  4286. #ifndef SvREFCNT_inc_NN
  4287. # ifdef PERL_USE_GCC_BRACE_GROUPS
  4288. # define SvREFCNT_inc_NN(sv) \
  4289. ({ \
  4290. SV * const _sv = (SV*)(sv); \
  4291. SvREFCNT(_sv)++; \
  4292. _sv; \
  4293. })
  4294. # else
  4295. # define SvREFCNT_inc_NN(sv) \
  4296. (PL_Sv=(SV*)(sv),++(SvREFCNT(PL_Sv)),PL_Sv)
  4297. # endif
  4298. #endif
  4299. #ifndef SvREFCNT_inc_void
  4300. # ifdef PERL_USE_GCC_BRACE_GROUPS
  4301. # define SvREFCNT_inc_void(sv) \
  4302. ({ \
  4303. SV * const _sv = (SV*)(sv); \
  4304. if (_sv) \
  4305. (void)(SvREFCNT(_sv)++); \
  4306. })
  4307. # else
  4308. # define SvREFCNT_inc_void(sv) \
  4309. (void)((PL_Sv=(SV*)(sv)) ? ++(SvREFCNT(PL_Sv)) : 0)
  4310. # endif
  4311. #endif
  4312. #ifndef SvREFCNT_inc_simple_void
  4313. # define SvREFCNT_inc_simple_void(sv) STMT_START { if (sv) SvREFCNT(sv)++; } STMT_END
  4314. #endif
  4315. #ifndef SvREFCNT_inc_simple_NN
  4316. # define SvREFCNT_inc_simple_NN(sv) (++SvREFCNT(sv), (SV*)(sv))
  4317. #endif
  4318. #ifndef SvREFCNT_inc_void_NN
  4319. # define SvREFCNT_inc_void_NN(sv) (void)(++SvREFCNT((SV*)(sv)))
  4320. #endif
  4321. #ifndef SvREFCNT_inc_simple_void_NN
  4322. # define SvREFCNT_inc_simple_void_NN(sv) (void)(++SvREFCNT((SV*)(sv)))
  4323. #endif
  4324. #ifndef newSV_type
  4325. #if defined(NEED_newSV_type)
  4326. static SV* DPPP_(my_newSV_type)(pTHX_ svtype const t);
  4327. static
  4328. #else
  4329. extern SV* DPPP_(my_newSV_type)(pTHX_ svtype const t);
  4330. #endif
  4331. #ifdef newSV_type
  4332. # undef newSV_type
  4333. #endif
  4334. #define newSV_type(a) DPPP_(my_newSV_type)(aTHX_ a)
  4335. #define Perl_newSV_type DPPP_(my_newSV_type)
  4336. #if defined(NEED_newSV_type) || defined(NEED_newSV_type_GLOBAL)
  4337. SV*
  4338. DPPP_(my_newSV_type)(pTHX_ svtype const t)
  4339. {
  4340. SV* const sv = newSV(0);
  4341. sv_upgrade(sv, t);
  4342. return sv;
  4343. }
  4344. #endif
  4345. #endif
  4346. #if (PERL_BCDVERSION < 0x5006000)
  4347. # define D_PPP_CONSTPV_ARG(x) ((char *) (x))
  4348. #else
  4349. # define D_PPP_CONSTPV_ARG(x) (x)
  4350. #endif
  4351. #ifndef newSVpvn
  4352. # define newSVpvn(data,len) ((data) \
  4353. ? ((len) ? newSVpv((data), (len)) : newSVpv("", 0)) \
  4354. : newSV(0))
  4355. #endif
  4356. #ifndef newSVpvn_utf8
  4357. # define newSVpvn_utf8(s, len, u) newSVpvn_flags((s), (len), (u) ? SVf_UTF8 : 0)
  4358. #endif
  4359. #ifndef SVf_UTF8
  4360. # define SVf_UTF8 0
  4361. #endif
  4362. #ifndef newSVpvn_flags
  4363. #if defined(NEED_newSVpvn_flags)
  4364. static SV * DPPP_(my_newSVpvn_flags)(pTHX_ const char *s, STRLEN len, U32 flags);
  4365. static
  4366. #else
  4367. extern SV * DPPP_(my_newSVpvn_flags)(pTHX_ const char *s, STRLEN len, U32 flags);
  4368. #endif
  4369. #ifdef newSVpvn_flags
  4370. # undef newSVpvn_flags
  4371. #endif
  4372. #define newSVpvn_flags(a,b,c) DPPP_(my_newSVpvn_flags)(aTHX_ a,b,c)
  4373. #define Perl_newSVpvn_flags DPPP_(my_newSVpvn_flags)
  4374. #if defined(NEED_newSVpvn_flags) || defined(NEED_newSVpvn_flags_GLOBAL)
  4375. SV *
  4376. DPPP_(my_newSVpvn_flags)(pTHX_ const char *s, STRLEN len, U32 flags)
  4377. {
  4378. SV *sv = newSVpvn(D_PPP_CONSTPV_ARG(s), len);
  4379. SvFLAGS(sv) |= (flags & SVf_UTF8);
  4380. return (flags & SVs_TEMP) ? sv_2mortal(sv) : sv;
  4381. }
  4382. #endif
  4383. #endif
  4384. /* Backwards compatibility stuff... :-( */
  4385. #if !defined(NEED_sv_2pv_flags) && defined(NEED_sv_2pv_nolen)
  4386. # define NEED_sv_2pv_flags
  4387. #endif
  4388. #if !defined(NEED_sv_2pv_flags_GLOBAL) && defined(NEED_sv_2pv_nolen_GLOBAL)
  4389. # define NEED_sv_2pv_flags_GLOBAL
  4390. #endif
  4391. /* Hint: sv_2pv_nolen
  4392. * Use the SvPV_nolen() or SvPV_nolen_const() macros instead of sv_2pv_nolen().
  4393. */
  4394. #ifndef sv_2pv_nolen
  4395. # define sv_2pv_nolen(sv) SvPV_nolen(sv)
  4396. #endif
  4397. #ifdef SvPVbyte
  4398. /* Hint: SvPVbyte
  4399. * Does not work in perl-5.6.1, ppport.h implements a version
  4400. * borrowed from perl-5.7.3.
  4401. */
  4402. #if (PERL_BCDVERSION < 0x5007000)
  4403. #if defined(NEED_sv_2pvbyte)
  4404. static char * DPPP_(my_sv_2pvbyte)(pTHX_ SV *sv, STRLEN *lp);
  4405. static
  4406. #else
  4407. extern char * DPPP_(my_sv_2pvbyte)(pTHX_ SV *sv, STRLEN *lp);
  4408. #endif
  4409. #ifdef sv_2pvbyte
  4410. # undef sv_2pvbyte
  4411. #endif
  4412. #define sv_2pvbyte(a,b) DPPP_(my_sv_2pvbyte)(aTHX_ a,b)
  4413. #define Perl_sv_2pvbyte DPPP_(my_sv_2pvbyte)
  4414. #if defined(NEED_sv_2pvbyte) || defined(NEED_sv_2pvbyte_GLOBAL)
  4415. char *
  4416. DPPP_(my_sv_2pvbyte)(pTHX_ SV *sv, STRLEN *lp)
  4417. {
  4418. sv_utf8_downgrade(sv,0);
  4419. return SvPV(sv,*lp);
  4420. }
  4421. #endif
  4422. /* Hint: sv_2pvbyte
  4423. * Use the SvPVbyte() macro instead of sv_2pvbyte().
  4424. */
  4425. #undef SvPVbyte
  4426. #define SvPVbyte(sv, lp) \
  4427. ((SvFLAGS(sv) & (SVf_POK|SVf_UTF8)) == (SVf_POK) \
  4428. ? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_2pvbyte(sv, &lp))
  4429. #endif
  4430. #else
  4431. # define SvPVbyte SvPV
  4432. # define sv_2pvbyte sv_2pv
  4433. #endif
  4434. #ifndef sv_2pvbyte_nolen
  4435. # define sv_2pvbyte_nolen(sv) sv_2pv_nolen(sv)
  4436. #endif
  4437. /* Hint: sv_pvn
  4438. * Always use the SvPV() macro instead of sv_pvn().
  4439. */
  4440. /* Hint: sv_pvn_force
  4441. * Always use the SvPV_force() macro instead of sv_pvn_force().
  4442. */
  4443. /* If these are undefined, they're not handled by the core anyway */
  4444. #ifndef SV_IMMEDIATE_UNREF
  4445. # define SV_IMMEDIATE_UNREF 0
  4446. #endif
  4447. #ifndef SV_GMAGIC
  4448. # define SV_GMAGIC 0
  4449. #endif
  4450. #ifndef SV_COW_DROP_PV
  4451. # define SV_COW_DROP_PV 0
  4452. #endif
  4453. #ifndef SV_UTF8_NO_ENCODING
  4454. # define SV_UTF8_NO_ENCODING 0
  4455. #endif
  4456. #ifndef SV_NOSTEAL
  4457. # define SV_NOSTEAL 0
  4458. #endif
  4459. #ifndef SV_CONST_RETURN
  4460. # define SV_CONST_RETURN 0
  4461. #endif
  4462. #ifndef SV_MUTABLE_RETURN
  4463. # define SV_MUTABLE_RETURN 0
  4464. #endif
  4465. #ifndef SV_SMAGIC
  4466. # define SV_SMAGIC 0
  4467. #endif
  4468. #ifndef SV_HAS_TRAILING_NUL
  4469. # define SV_HAS_TRAILING_NUL 0
  4470. #endif
  4471. #ifndef SV_COW_SHARED_HASH_KEYS
  4472. # define SV_COW_SHARED_HASH_KEYS 0
  4473. #endif
  4474. #if (PERL_BCDVERSION < 0x5007002)
  4475. #if defined(NEED_sv_2pv_flags)
  4476. static char * DPPP_(my_sv_2pv_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags);
  4477. static
  4478. #else
  4479. extern char * DPPP_(my_sv_2pv_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags);
  4480. #endif
  4481. #ifdef sv_2pv_flags
  4482. # undef sv_2pv_flags
  4483. #endif
  4484. #define sv_2pv_flags(a,b,c) DPPP_(my_sv_2pv_flags)(aTHX_ a,b,c)
  4485. #define Perl_sv_2pv_flags DPPP_(my_sv_2pv_flags)
  4486. #if defined(NEED_sv_2pv_flags) || defined(NEED_sv_2pv_flags_GLOBAL)
  4487. char *
  4488. DPPP_(my_sv_2pv_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags)
  4489. {
  4490. STRLEN n_a = (STRLEN) flags;
  4491. return sv_2pv(sv, lp ? lp : &n_a);
  4492. }
  4493. #endif
  4494. #if defined(NEED_sv_pvn_force_flags)
  4495. static char * DPPP_(my_sv_pvn_force_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags);
  4496. static
  4497. #else
  4498. extern char * DPPP_(my_sv_pvn_force_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags);
  4499. #endif
  4500. #ifdef sv_pvn_force_flags
  4501. # undef sv_pvn_force_flags
  4502. #endif
  4503. #define sv_pvn_force_flags(a,b,c) DPPP_(my_sv_pvn_force_flags)(aTHX_ a,b,c)
  4504. #define Perl_sv_pvn_force_flags DPPP_(my_sv_pvn_force_flags)
  4505. #if defined(NEED_sv_pvn_force_flags) || defined(NEED_sv_pvn_force_flags_GLOBAL)
  4506. char *
  4507. DPPP_(my_sv_pvn_force_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags)
  4508. {
  4509. STRLEN n_a = (STRLEN) flags;
  4510. return sv_pvn_force(sv, lp ? lp : &n_a);
  4511. }
  4512. #endif
  4513. #endif
  4514. #if (PERL_BCDVERSION < 0x5008008) || ( (PERL_BCDVERSION >= 0x5009000) && (PERL_BCDVERSION < 0x5009003) )
  4515. # define DPPP_SVPV_NOLEN_LP_ARG &PL_na
  4516. #else
  4517. # define DPPP_SVPV_NOLEN_LP_ARG 0
  4518. #endif
  4519. #ifndef SvPV_const
  4520. # define SvPV_const(sv, lp) SvPV_flags_const(sv, lp, SV_GMAGIC)
  4521. #endif
  4522. #ifndef SvPV_mutable
  4523. # define SvPV_mutable(sv, lp) SvPV_flags_mutable(sv, lp, SV_GMAGIC)
  4524. #endif
  4525. #ifndef SvPV_flags
  4526. # define SvPV_flags(sv, lp, flags) \
  4527. ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
  4528. ? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_2pv_flags(sv, &lp, flags))
  4529. #endif
  4530. #ifndef SvPV_flags_const
  4531. # define SvPV_flags_const(sv, lp, flags) \
  4532. ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
  4533. ? ((lp = SvCUR(sv)), SvPVX_const(sv)) : \
  4534. (const char*) sv_2pv_flags(sv, &lp, flags|SV_CONST_RETURN))
  4535. #endif
  4536. #ifndef SvPV_flags_const_nolen
  4537. # define SvPV_flags_const_nolen(sv, flags) \
  4538. ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
  4539. ? SvPVX_const(sv) : \
  4540. (const char*) sv_2pv_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, flags|SV_CONST_RETURN))
  4541. #endif
  4542. #ifndef SvPV_flags_mutable
  4543. # define SvPV_flags_mutable(sv, lp, flags) \
  4544. ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
  4545. ? ((lp = SvCUR(sv)), SvPVX_mutable(sv)) : \
  4546. sv_2pv_flags(sv, &lp, flags|SV_MUTABLE_RETURN))
  4547. #endif
  4548. #ifndef SvPV_force
  4549. # define SvPV_force(sv, lp) SvPV_force_flags(sv, lp, SV_GMAGIC)
  4550. #endif
  4551. #ifndef SvPV_force_nolen
  4552. # define SvPV_force_nolen(sv) SvPV_force_flags_nolen(sv, SV_GMAGIC)
  4553. #endif
  4554. #ifndef SvPV_force_mutable
  4555. # define SvPV_force_mutable(sv, lp) SvPV_force_flags_mutable(sv, lp, SV_GMAGIC)
  4556. #endif
  4557. #ifndef SvPV_force_nomg
  4558. # define SvPV_force_nomg(sv, lp) SvPV_force_flags(sv, lp, 0)
  4559. #endif
  4560. #ifndef SvPV_force_nomg_nolen
  4561. # define SvPV_force_nomg_nolen(sv) SvPV_force_flags_nolen(sv, 0)
  4562. #endif
  4563. #ifndef SvPV_force_flags
  4564. # define SvPV_force_flags(sv, lp, flags) \
  4565. ((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == SVf_POK \
  4566. ? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_pvn_force_flags(sv, &lp, flags))
  4567. #endif
  4568. #ifndef SvPV_force_flags_nolen
  4569. # define SvPV_force_flags_nolen(sv, flags) \
  4570. ((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == SVf_POK \
  4571. ? SvPVX(sv) : sv_pvn_force_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, flags))
  4572. #endif
  4573. #ifndef SvPV_force_flags_mutable
  4574. # define SvPV_force_flags_mutable(sv, lp, flags) \
  4575. ((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == SVf_POK \
  4576. ? ((lp = SvCUR(sv)), SvPVX_mutable(sv)) \
  4577. : sv_pvn_force_flags(sv, &lp, flags|SV_MUTABLE_RETURN))
  4578. #endif
  4579. #ifndef SvPV_nolen
  4580. # define SvPV_nolen(sv) \
  4581. ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
  4582. ? SvPVX(sv) : sv_2pv_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, SV_GMAGIC))
  4583. #endif
  4584. #ifndef SvPV_nolen_const
  4585. # define SvPV_nolen_const(sv) \
  4586. ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
  4587. ? SvPVX_const(sv) : sv_2pv_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, SV_GMAGIC|SV_CONST_RETURN))
  4588. #endif
  4589. #ifndef SvPV_nomg
  4590. # define SvPV_nomg(sv, lp) SvPV_flags(sv, lp, 0)
  4591. #endif
  4592. #ifndef SvPV_nomg_const
  4593. # define SvPV_nomg_const(sv, lp) SvPV_flags_const(sv, lp, 0)
  4594. #endif
  4595. #ifndef SvPV_nomg_const_nolen
  4596. # define SvPV_nomg_const_nolen(sv) SvPV_flags_const_nolen(sv, 0)
  4597. #endif
  4598. #ifndef SvPV_renew
  4599. # define SvPV_renew(sv,n) STMT_START { SvLEN_set(sv, n); \
  4600. SvPV_set((sv), (char *) saferealloc( \
  4601. (Malloc_t)SvPVX(sv), (MEM_SIZE)((n)))); \
  4602. } STMT_END
  4603. #endif
  4604. #ifndef SvMAGIC_set
  4605. # define SvMAGIC_set(sv, val) \
  4606. STMT_START { assert(SvTYPE(sv) >= SVt_PVMG); \
  4607. (((XPVMG*) SvANY(sv))->xmg_magic = (val)); } STMT_END
  4608. #endif
  4609. #if (PERL_BCDVERSION < 0x5009003)
  4610. #ifndef SvPVX_const
  4611. # define SvPVX_const(sv) ((const char*) (0 + SvPVX(sv)))
  4612. #endif
  4613. #ifndef SvPVX_mutable
  4614. # define SvPVX_mutable(sv) (0 + SvPVX(sv))
  4615. #endif
  4616. #ifndef SvRV_set
  4617. # define SvRV_set(sv, val) \
  4618. STMT_START { assert(SvTYPE(sv) >= SVt_RV); \
  4619. (((XRV*) SvANY(sv))->xrv_rv = (val)); } STMT_END
  4620. #endif
  4621. #else
  4622. #ifndef SvPVX_const
  4623. # define SvPVX_const(sv) ((const char*)((sv)->sv_u.svu_pv))
  4624. #endif
  4625. #ifndef SvPVX_mutable
  4626. # define SvPVX_mutable(sv) ((sv)->sv_u.svu_pv)
  4627. #endif
  4628. #ifndef SvRV_set
  4629. # define SvRV_set(sv, val) \
  4630. STMT_START { assert(SvTYPE(sv) >= SVt_RV); \
  4631. ((sv)->sv_u.svu_rv = (val)); } STMT_END
  4632. #endif
  4633. #endif
  4634. #ifndef SvSTASH_set
  4635. # define SvSTASH_set(sv, val) \
  4636. STMT_START { assert(SvTYPE(sv) >= SVt_PVMG); \
  4637. (((XPVMG*) SvANY(sv))->xmg_stash = (val)); } STMT_END
  4638. #endif
  4639. #if (PERL_BCDVERSION < 0x5004000)
  4640. #ifndef SvUV_set
  4641. # define SvUV_set(sv, val) \
  4642. STMT_START { assert(SvTYPE(sv) == SVt_IV || SvTYPE(sv) >= SVt_PVIV); \
  4643. (((XPVIV*) SvANY(sv))->xiv_iv = (IV) (val)); } STMT_END
  4644. #endif
  4645. #else
  4646. #ifndef SvUV_set
  4647. # define SvUV_set(sv, val) \
  4648. STMT_START { assert(SvTYPE(sv) == SVt_IV || SvTYPE(sv) >= SVt_PVIV); \
  4649. (((XPVUV*) SvANY(sv))->xuv_uv = (val)); } STMT_END
  4650. #endif
  4651. #endif
  4652. #if (PERL_BCDVERSION >= 0x5004000) && !defined(vnewSVpvf)
  4653. #if defined(NEED_vnewSVpvf)
  4654. static SV * DPPP_(my_vnewSVpvf)(pTHX_ const char *pat, va_list *args);
  4655. static
  4656. #else
  4657. extern SV * DPPP_(my_vnewSVpvf)(pTHX_ const char *pat, va_list *args);
  4658. #endif
  4659. #ifdef vnewSVpvf
  4660. # undef vnewSVpvf
  4661. #endif
  4662. #define vnewSVpvf(a,b) DPPP_(my_vnewSVpvf)(aTHX_ a,b)
  4663. #define Perl_vnewSVpvf DPPP_(my_vnewSVpvf)
  4664. #if defined(NEED_vnewSVpvf) || defined(NEED_vnewSVpvf_GLOBAL)
  4665. SV *
  4666. DPPP_(my_vnewSVpvf)(pTHX_ const char *pat, va_list *args)
  4667. {
  4668. register SV *sv = newSV(0);
  4669. sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*));
  4670. return sv;
  4671. }
  4672. #endif
  4673. #endif
  4674. #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vcatpvf)
  4675. # define sv_vcatpvf(sv, pat, args) sv_vcatpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*))
  4676. #endif
  4677. #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vsetpvf)
  4678. # define sv_vsetpvf(sv, pat, args) sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*))
  4679. #endif
  4680. #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_catpvf_mg)
  4681. #if defined(NEED_sv_catpvf_mg)
  4682. static void DPPP_(my_sv_catpvf_mg)(pTHX_ SV *sv, const char *pat, ...);
  4683. static
  4684. #else
  4685. extern void DPPP_(my_sv_catpvf_mg)(pTHX_ SV *sv, const char *pat, ...);
  4686. #endif
  4687. #define Perl_sv_catpvf_mg DPPP_(my_sv_catpvf_mg)
  4688. #if defined(NEED_sv_catpvf_mg) || defined(NEED_sv_catpvf_mg_GLOBAL)
  4689. void
  4690. DPPP_(my_sv_catpvf_mg)(pTHX_ SV *sv, const char *pat, ...)
  4691. {
  4692. va_list args;
  4693. va_start(args, pat);
  4694. sv_vcatpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*));
  4695. SvSETMAGIC(sv);
  4696. va_end(args);
  4697. }
  4698. #endif
  4699. #endif
  4700. #ifdef PERL_IMPLICIT_CONTEXT
  4701. #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_catpvf_mg_nocontext)
  4702. #if defined(NEED_sv_catpvf_mg_nocontext)
  4703. static void DPPP_(my_sv_catpvf_mg_nocontext)(SV *sv, const char *pat, ...);
  4704. static
  4705. #else
  4706. extern void DPPP_(my_sv_catpvf_mg_nocontext)(SV *sv, const char *pat, ...);
  4707. #endif
  4708. #define sv_catpvf_mg_nocontext DPPP_(my_sv_catpvf_mg_nocontext)
  4709. #define Perl_sv_catpvf_mg_nocontext DPPP_(my_sv_catpvf_mg_nocontext)
  4710. #if defined(NEED_sv_catpvf_mg_nocontext) || defined(NEED_sv_catpvf_mg_nocontext_GLOBAL)
  4711. void
  4712. DPPP_(my_sv_catpvf_mg_nocontext)(SV *sv, const char *pat, ...)
  4713. {
  4714. dTHX;
  4715. va_list args;
  4716. va_start(args, pat);
  4717. sv_vcatpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*));
  4718. SvSETMAGIC(sv);
  4719. va_end(args);
  4720. }
  4721. #endif
  4722. #endif
  4723. #endif
  4724. /* sv_catpvf_mg depends on sv_catpvf_mg_nocontext */
  4725. #ifndef sv_catpvf_mg
  4726. # ifdef PERL_IMPLICIT_CONTEXT
  4727. # define sv_catpvf_mg Perl_sv_catpvf_mg_nocontext
  4728. # else
  4729. # define sv_catpvf_mg Perl_sv_catpvf_mg
  4730. # endif
  4731. #endif
  4732. #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vcatpvf_mg)
  4733. # define sv_vcatpvf_mg(sv, pat, args) \
  4734. STMT_START { \
  4735. sv_vcatpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*)); \
  4736. SvSETMAGIC(sv); \
  4737. } STMT_END
  4738. #endif
  4739. #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_setpvf_mg)
  4740. #if defined(NEED_sv_setpvf_mg)
  4741. static void DPPP_(my_sv_setpvf_mg)(pTHX_ SV *sv, const char *pat, ...);
  4742. static
  4743. #else
  4744. extern void DPPP_(my_sv_setpvf_mg)(pTHX_ SV *sv, const char *pat, ...);
  4745. #endif
  4746. #define Perl_sv_setpvf_mg DPPP_(my_sv_setpvf_mg)
  4747. #if defined(NEED_sv_setpvf_mg) || defined(NEED_sv_setpvf_mg_GLOBAL)
  4748. void
  4749. DPPP_(my_sv_setpvf_mg)(pTHX_ SV *sv, const char *pat, ...)
  4750. {
  4751. va_list args;
  4752. va_start(args, pat);
  4753. sv_vsetpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*));
  4754. SvSETMAGIC(sv);
  4755. va_end(args);
  4756. }
  4757. #endif
  4758. #endif
  4759. #ifdef PERL_IMPLICIT_CONTEXT
  4760. #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_setpvf_mg_nocontext)
  4761. #if defined(NEED_sv_setpvf_mg_nocontext)
  4762. static void DPPP_(my_sv_setpvf_mg_nocontext)(SV *sv, const char *pat, ...);
  4763. static
  4764. #else
  4765. extern void DPPP_(my_sv_setpvf_mg_nocontext)(SV *sv, const char *pat, ...);
  4766. #endif
  4767. #define sv_setpvf_mg_nocontext DPPP_(my_sv_setpvf_mg_nocontext)
  4768. #define Perl_sv_setpvf_mg_nocontext DPPP_(my_sv_setpvf_mg_nocontext)
  4769. #if defined(NEED_sv_setpvf_mg_nocontext) || defined(NEED_sv_setpvf_mg_nocontext_GLOBAL)
  4770. void
  4771. DPPP_(my_sv_setpvf_mg_nocontext)(SV *sv, const char *pat, ...)
  4772. {
  4773. dTHX;
  4774. va_list args;
  4775. va_start(args, pat);
  4776. sv_vsetpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*));
  4777. SvSETMAGIC(sv);
  4778. va_end(args);
  4779. }
  4780. #endif
  4781. #endif
  4782. #endif
  4783. /* sv_setpvf_mg depends on sv_setpvf_mg_nocontext */
  4784. #ifndef sv_setpvf_mg
  4785. # ifdef PERL_IMPLICIT_CONTEXT
  4786. # define sv_setpvf_mg Perl_sv_setpvf_mg_nocontext
  4787. # else
  4788. # define sv_setpvf_mg Perl_sv_setpvf_mg
  4789. # endif
  4790. #endif
  4791. #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vsetpvf_mg)
  4792. # define sv_vsetpvf_mg(sv, pat, args) \
  4793. STMT_START { \
  4794. sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*)); \
  4795. SvSETMAGIC(sv); \
  4796. } STMT_END
  4797. #endif
  4798. /* Hint: newSVpvn_share
  4799. * The SVs created by this function only mimic the behaviour of
  4800. * shared PVs without really being shared. Only use if you know
  4801. * what you're doing.
  4802. */
  4803. #ifndef newSVpvn_share
  4804. #if defined(NEED_newSVpvn_share)
  4805. static SV * DPPP_(my_newSVpvn_share)(pTHX_ const char *src, I32 len, U32 hash);
  4806. static
  4807. #else
  4808. extern SV * DPPP_(my_newSVpvn_share)(pTHX_ const char *src, I32 len, U32 hash);
  4809. #endif
  4810. #ifdef newSVpvn_share
  4811. # undef newSVpvn_share
  4812. #endif
  4813. #define newSVpvn_share(a,b,c) DPPP_(my_newSVpvn_share)(aTHX_ a,b,c)
  4814. #define Perl_newSVpvn_share DPPP_(my_newSVpvn_share)
  4815. #if defined(NEED_newSVpvn_share) || defined(NEED_newSVpvn_share_GLOBAL)
  4816. SV *
  4817. DPPP_(my_newSVpvn_share)(pTHX_ const char *src, I32 len, U32 hash)
  4818. {
  4819. SV *sv;
  4820. if (len < 0)
  4821. len = -len;
  4822. if (!hash)
  4823. PERL_HASH(hash, (char*) src, len);
  4824. sv = newSVpvn((char *) src, len);
  4825. sv_upgrade(sv, SVt_PVIV);
  4826. SvIVX(sv) = hash;
  4827. SvREADONLY_on(sv);
  4828. SvPOK_on(sv);
  4829. return sv;
  4830. }
  4831. #endif
  4832. #endif
  4833. #ifndef SvSHARED_HASH
  4834. # define SvSHARED_HASH(sv) (0 + SvUVX(sv))
  4835. #endif
  4836. #ifndef HvNAME_get
  4837. # define HvNAME_get(hv) HvNAME(hv)
  4838. #endif
  4839. #ifndef HvNAMELEN_get
  4840. # define HvNAMELEN_get(hv) (HvNAME_get(hv) ? (I32)strlen(HvNAME_get(hv)) : 0)
  4841. #endif
  4842. #ifndef GvSVn
  4843. # define GvSVn(gv) GvSV(gv)
  4844. #endif
  4845. #ifndef isGV_with_GP
  4846. # define isGV_with_GP(gv) isGV(gv)
  4847. #endif
  4848. #ifndef gv_fetchpvn_flags
  4849. # define gv_fetchpvn_flags(name, len, flags, svt) gv_fetchpv(name, flags, svt)
  4850. #endif
  4851. #ifndef gv_fetchsv
  4852. # define gv_fetchsv(name, flags, svt) gv_fetchpv(SvPV_nolen_const(name), flags, svt)
  4853. #endif
  4854. #ifndef get_cvn_flags
  4855. # define get_cvn_flags(name, namelen, flags) get_cv(name, flags)
  4856. #endif
  4857. #ifndef WARN_ALL
  4858. # define WARN_ALL 0
  4859. #endif
  4860. #ifndef WARN_CLOSURE
  4861. # define WARN_CLOSURE 1
  4862. #endif
  4863. #ifndef WARN_DEPRECATED
  4864. # define WARN_DEPRECATED 2
  4865. #endif
  4866. #ifndef WARN_EXITING
  4867. # define WARN_EXITING 3
  4868. #endif
  4869. #ifndef WARN_GLOB
  4870. # define WARN_GLOB 4
  4871. #endif
  4872. #ifndef WARN_IO
  4873. # define WARN_IO 5
  4874. #endif
  4875. #ifndef WARN_CLOSED
  4876. # define WARN_CLOSED 6
  4877. #endif
  4878. #ifndef WARN_EXEC
  4879. # define WARN_EXEC 7
  4880. #endif
  4881. #ifndef WARN_LAYER
  4882. # define WARN_LAYER 8
  4883. #endif
  4884. #ifndef WARN_NEWLINE
  4885. # define WARN_NEWLINE 9
  4886. #endif
  4887. #ifndef WARN_PIPE
  4888. # define WARN_PIPE 10
  4889. #endif
  4890. #ifndef WARN_UNOPENED
  4891. # define WARN_UNOPENED 11
  4892. #endif
  4893. #ifndef WARN_MISC
  4894. # define WARN_MISC 12
  4895. #endif
  4896. #ifndef WARN_NUMERIC
  4897. # define WARN_NUMERIC 13
  4898. #endif
  4899. #ifndef WARN_ONCE
  4900. # define WARN_ONCE 14
  4901. #endif
  4902. #ifndef WARN_OVERFLOW
  4903. # define WARN_OVERFLOW 15
  4904. #endif
  4905. #ifndef WARN_PACK
  4906. # define WARN_PACK 16
  4907. #endif
  4908. #ifndef WARN_PORTABLE
  4909. # define WARN_PORTABLE 17
  4910. #endif
  4911. #ifndef WARN_RECURSION
  4912. # define WARN_RECURSION 18
  4913. #endif
  4914. #ifndef WARN_REDEFINE
  4915. # define WARN_REDEFINE 19
  4916. #endif
  4917. #ifndef WARN_REGEXP
  4918. # define WARN_REGEXP 20
  4919. #endif
  4920. #ifndef WARN_SEVERE
  4921. # define WARN_SEVERE 21
  4922. #endif
  4923. #ifndef WARN_DEBUGGING
  4924. # define WARN_DEBUGGING 22
  4925. #endif
  4926. #ifndef WARN_INPLACE
  4927. # define WARN_INPLACE 23
  4928. #endif
  4929. #ifndef WARN_INTERNAL
  4930. # define WARN_INTERNAL 24
  4931. #endif
  4932. #ifndef WARN_MALLOC
  4933. # define WARN_MALLOC 25
  4934. #endif
  4935. #ifndef WARN_SIGNAL
  4936. # define WARN_SIGNAL 26
  4937. #endif
  4938. #ifndef WARN_SUBSTR
  4939. # define WARN_SUBSTR 27
  4940. #endif
  4941. #ifndef WARN_SYNTAX
  4942. # define WARN_SYNTAX 28
  4943. #endif
  4944. #ifndef WARN_AMBIGUOUS
  4945. # define WARN_AMBIGUOUS 29
  4946. #endif
  4947. #ifndef WARN_BAREWORD
  4948. # define WARN_BAREWORD 30
  4949. #endif
  4950. #ifndef WARN_DIGIT
  4951. # define WARN_DIGIT 31
  4952. #endif
  4953. #ifndef WARN_PARENTHESIS
  4954. # define WARN_PARENTHESIS 32
  4955. #endif
  4956. #ifndef WARN_PRECEDENCE
  4957. # define WARN_PRECEDENCE 33
  4958. #endif
  4959. #ifndef WARN_PRINTF
  4960. # define WARN_PRINTF 34
  4961. #endif
  4962. #ifndef WARN_PROTOTYPE
  4963. # define WARN_PROTOTYPE 35
  4964. #endif
  4965. #ifndef WARN_QW
  4966. # define WARN_QW 36
  4967. #endif
  4968. #ifndef WARN_RESERVED
  4969. # define WARN_RESERVED 37
  4970. #endif
  4971. #ifndef WARN_SEMICOLON
  4972. # define WARN_SEMICOLON 38
  4973. #endif
  4974. #ifndef WARN_TAINT
  4975. # define WARN_TAINT 39
  4976. #endif
  4977. #ifndef WARN_THREADS
  4978. # define WARN_THREADS 40
  4979. #endif
  4980. #ifndef WARN_UNINITIALIZED
  4981. # define WARN_UNINITIALIZED 41
  4982. #endif
  4983. #ifndef WARN_UNPACK
  4984. # define WARN_UNPACK 42
  4985. #endif
  4986. #ifndef WARN_UNTIE
  4987. # define WARN_UNTIE 43
  4988. #endif
  4989. #ifndef WARN_UTF8
  4990. # define WARN_UTF8 44
  4991. #endif
  4992. #ifndef WARN_VOID
  4993. # define WARN_VOID 45
  4994. #endif
  4995. #ifndef WARN_ASSERTIONS
  4996. # define WARN_ASSERTIONS 46
  4997. #endif
  4998. #ifndef packWARN
  4999. # define packWARN(a) (a)
  5000. #endif
  5001. #ifndef ckWARN
  5002. # ifdef G_WARN_ON
  5003. # define ckWARN(a) (PL_dowarn & G_WARN_ON)
  5004. # else
  5005. # define ckWARN(a) PL_dowarn
  5006. # endif
  5007. #endif
  5008. #if (PERL_BCDVERSION >= 0x5004000) && !defined(warner)
  5009. #if defined(NEED_warner)
  5010. static void DPPP_(my_warner)(U32 err, const char *pat, ...);
  5011. static
  5012. #else
  5013. extern void DPPP_(my_warner)(U32 err, const char *pat, ...);
  5014. #endif
  5015. #define Perl_warner DPPP_(my_warner)
  5016. #if defined(NEED_warner) || defined(NEED_warner_GLOBAL)
  5017. void
  5018. DPPP_(my_warner)(U32 err, const char *pat, ...)
  5019. {
  5020. SV *sv;
  5021. va_list args;
  5022. PERL_UNUSED_ARG(err);
  5023. va_start(args, pat);
  5024. sv = vnewSVpvf(pat, &args);
  5025. va_end(args);
  5026. sv_2mortal(sv);
  5027. warn("%s", SvPV_nolen(sv));
  5028. }
  5029. #define warner Perl_warner
  5030. #define Perl_warner_nocontext Perl_warner
  5031. #endif
  5032. #endif
  5033. /* concatenating with "" ensures that only literal strings are accepted as argument
  5034. * note that STR_WITH_LEN() can't be used as argument to macros or functions that
  5035. * under some configurations might be macros
  5036. */
  5037. #ifndef STR_WITH_LEN
  5038. # define STR_WITH_LEN(s) (s ""), (sizeof(s)-1)
  5039. #endif
  5040. #ifndef newSVpvs
  5041. # define newSVpvs(str) newSVpvn(str "", sizeof(str) - 1)
  5042. #endif
  5043. #ifndef newSVpvs_flags
  5044. # define newSVpvs_flags(str, flags) newSVpvn_flags(str "", sizeof(str) - 1, flags)
  5045. #endif
  5046. #ifndef newSVpvs_share
  5047. # define newSVpvs_share(str) newSVpvn_share(str "", sizeof(str) - 1, 0)
  5048. #endif
  5049. #ifndef sv_catpvs
  5050. # define sv_catpvs(sv, str) sv_catpvn(sv, str "", sizeof(str) - 1)
  5051. #endif
  5052. #ifndef sv_setpvs
  5053. # define sv_setpvs(sv, str) sv_setpvn(sv, str "", sizeof(str) - 1)
  5054. #endif
  5055. #ifndef hv_fetchs
  5056. # define hv_fetchs(hv, key, lval) hv_fetch(hv, key "", sizeof(key) - 1, lval)
  5057. #endif
  5058. #ifndef hv_stores
  5059. # define hv_stores(hv, key, val) hv_store(hv, key "", sizeof(key) - 1, val, 0)
  5060. #endif
  5061. #ifndef gv_fetchpvs
  5062. # define gv_fetchpvs(name, flags, svt) gv_fetchpvn_flags(name "", sizeof(name) - 1, flags, svt)
  5063. #endif
  5064. #ifndef gv_stashpvs
  5065. # define gv_stashpvs(name, flags) gv_stashpvn(name "", sizeof(name) - 1, flags)
  5066. #endif
  5067. #ifndef get_cvs
  5068. # define get_cvs(name, flags) get_cvn_flags(name "", sizeof(name)-1, flags)
  5069. #endif
  5070. #ifndef SvGETMAGIC
  5071. # define SvGETMAGIC(x) STMT_START { if (SvGMAGICAL(x)) mg_get(x); } STMT_END
  5072. #endif
  5073. #ifndef PERL_MAGIC_sv
  5074. # define PERL_MAGIC_sv '\0'
  5075. #endif
  5076. #ifndef PERL_MAGIC_overload
  5077. # define PERL_MAGIC_overload 'A'
  5078. #endif
  5079. #ifndef PERL_MAGIC_overload_elem
  5080. # define PERL_MAGIC_overload_elem 'a'
  5081. #endif
  5082. #ifndef PERL_MAGIC_overload_table
  5083. # define PERL_MAGIC_overload_table 'c'
  5084. #endif
  5085. #ifndef PERL_MAGIC_bm
  5086. # define PERL_MAGIC_bm 'B'
  5087. #endif
  5088. #ifndef PERL_MAGIC_regdata
  5089. # define PERL_MAGIC_regdata 'D'
  5090. #endif
  5091. #ifndef PERL_MAGIC_regdatum
  5092. # define PERL_MAGIC_regdatum 'd'
  5093. #endif
  5094. #ifndef PERL_MAGIC_env
  5095. # define PERL_MAGIC_env 'E'
  5096. #endif
  5097. #ifndef PERL_MAGIC_envelem
  5098. # define PERL_MAGIC_envelem 'e'
  5099. #endif
  5100. #ifndef PERL_MAGIC_fm
  5101. # define PERL_MAGIC_fm 'f'
  5102. #endif
  5103. #ifndef PERL_MAGIC_regex_global
  5104. # define PERL_MAGIC_regex_global 'g'
  5105. #endif
  5106. #ifndef PERL_MAGIC_isa
  5107. # define PERL_MAGIC_isa 'I'
  5108. #endif
  5109. #ifndef PERL_MAGIC_isaelem
  5110. # define PERL_MAGIC_isaelem 'i'
  5111. #endif
  5112. #ifndef PERL_MAGIC_nkeys
  5113. # define PERL_MAGIC_nkeys 'k'
  5114. #endif
  5115. #ifndef PERL_MAGIC_dbfile
  5116. # define PERL_MAGIC_dbfile 'L'
  5117. #endif
  5118. #ifndef PERL_MAGIC_dbline
  5119. # define PERL_MAGIC_dbline 'l'
  5120. #endif
  5121. #ifndef PERL_MAGIC_mutex
  5122. # define PERL_MAGIC_mutex 'm'
  5123. #endif
  5124. #ifndef PERL_MAGIC_shared
  5125. # define PERL_MAGIC_shared 'N'
  5126. #endif
  5127. #ifndef PERL_MAGIC_shared_scalar
  5128. # define PERL_MAGIC_shared_scalar 'n'
  5129. #endif
  5130. #ifndef PERL_MAGIC_collxfrm
  5131. # define PERL_MAGIC_collxfrm 'o'
  5132. #endif
  5133. #ifndef PERL_MAGIC_tied
  5134. # define PERL_MAGIC_tied 'P'
  5135. #endif
  5136. #ifndef PERL_MAGIC_tiedelem
  5137. # define PERL_MAGIC_tiedelem 'p'
  5138. #endif
  5139. #ifndef PERL_MAGIC_tiedscalar
  5140. # define PERL_MAGIC_tiedscalar 'q'
  5141. #endif
  5142. #ifndef PERL_MAGIC_qr
  5143. # define PERL_MAGIC_qr 'r'
  5144. #endif
  5145. #ifndef PERL_MAGIC_sig
  5146. # define PERL_MAGIC_sig 'S'
  5147. #endif
  5148. #ifndef PERL_MAGIC_sigelem
  5149. # define PERL_MAGIC_sigelem 's'
  5150. #endif
  5151. #ifndef PERL_MAGIC_taint
  5152. # define PERL_MAGIC_taint 't'
  5153. #endif
  5154. #ifndef PERL_MAGIC_uvar
  5155. # define PERL_MAGIC_uvar 'U'
  5156. #endif
  5157. #ifndef PERL_MAGIC_uvar_elem
  5158. # define PERL_MAGIC_uvar_elem 'u'
  5159. #endif
  5160. #ifndef PERL_MAGIC_vstring
  5161. # define PERL_MAGIC_vstring 'V'
  5162. #endif
  5163. #ifndef PERL_MAGIC_vec
  5164. # define PERL_MAGIC_vec 'v'
  5165. #endif
  5166. #ifndef PERL_MAGIC_utf8
  5167. # define PERL_MAGIC_utf8 'w'
  5168. #endif
  5169. #ifndef PERL_MAGIC_substr
  5170. # define PERL_MAGIC_substr 'x'
  5171. #endif
  5172. #ifndef PERL_MAGIC_defelem
  5173. # define PERL_MAGIC_defelem 'y'
  5174. #endif
  5175. #ifndef PERL_MAGIC_glob
  5176. # define PERL_MAGIC_glob '*'
  5177. #endif
  5178. #ifndef PERL_MAGIC_arylen
  5179. # define PERL_MAGIC_arylen '#'
  5180. #endif
  5181. #ifndef PERL_MAGIC_pos
  5182. # define PERL_MAGIC_pos '.'
  5183. #endif
  5184. #ifndef PERL_MAGIC_backref
  5185. # define PERL_MAGIC_backref '<'
  5186. #endif
  5187. #ifndef PERL_MAGIC_ext
  5188. # define PERL_MAGIC_ext '~'
  5189. #endif
  5190. /* That's the best we can do... */
  5191. #ifndef sv_catpvn_nomg
  5192. # define sv_catpvn_nomg sv_catpvn
  5193. #endif
  5194. #ifndef sv_catsv_nomg
  5195. # define sv_catsv_nomg sv_catsv
  5196. #endif
  5197. #ifndef sv_setsv_nomg
  5198. # define sv_setsv_nomg sv_setsv
  5199. #endif
  5200. #ifndef sv_pvn_nomg
  5201. # define sv_pvn_nomg sv_pvn
  5202. #endif
  5203. #ifndef SvIV_nomg
  5204. # define SvIV_nomg SvIV
  5205. #endif
  5206. #ifndef SvUV_nomg
  5207. # define SvUV_nomg SvUV
  5208. #endif
  5209. #ifndef sv_catpv_mg
  5210. # define sv_catpv_mg(sv, ptr) \
  5211. STMT_START { \
  5212. SV *TeMpSv = sv; \
  5213. sv_catpv(TeMpSv,ptr); \
  5214. SvSETMAGIC(TeMpSv); \
  5215. } STMT_END
  5216. #endif
  5217. #ifndef sv_catpvn_mg
  5218. # define sv_catpvn_mg(sv, ptr, len) \
  5219. STMT_START { \
  5220. SV *TeMpSv = sv; \
  5221. sv_catpvn(TeMpSv,ptr,len); \
  5222. SvSETMAGIC(TeMpSv); \
  5223. } STMT_END
  5224. #endif
  5225. #ifndef sv_catsv_mg
  5226. # define sv_catsv_mg(dsv, ssv) \
  5227. STMT_START { \
  5228. SV *TeMpSv = dsv; \
  5229. sv_catsv(TeMpSv,ssv); \
  5230. SvSETMAGIC(TeMpSv); \
  5231. } STMT_END
  5232. #endif
  5233. #ifndef sv_setiv_mg
  5234. # define sv_setiv_mg(sv, i) \
  5235. STMT_START { \
  5236. SV *TeMpSv = sv; \
  5237. sv_setiv(TeMpSv,i); \
  5238. SvSETMAGIC(TeMpSv); \
  5239. } STMT_END
  5240. #endif
  5241. #ifndef sv_setnv_mg
  5242. # define sv_setnv_mg(sv, num) \
  5243. STMT_START { \
  5244. SV *TeMpSv = sv; \
  5245. sv_setnv(TeMpSv,num); \
  5246. SvSETMAGIC(TeMpSv); \
  5247. } STMT_END
  5248. #endif
  5249. #ifndef sv_setpv_mg
  5250. # define sv_setpv_mg(sv, ptr) \
  5251. STMT_START { \
  5252. SV *TeMpSv = sv; \
  5253. sv_setpv(TeMpSv,ptr); \
  5254. SvSETMAGIC(TeMpSv); \
  5255. } STMT_END
  5256. #endif
  5257. #ifndef sv_setpvn_mg
  5258. # define sv_setpvn_mg(sv, ptr, len) \
  5259. STMT_START { \
  5260. SV *TeMpSv = sv; \
  5261. sv_setpvn(TeMpSv,ptr,len); \
  5262. SvSETMAGIC(TeMpSv); \
  5263. } STMT_END
  5264. #endif
  5265. #ifndef sv_setsv_mg
  5266. # define sv_setsv_mg(dsv, ssv) \
  5267. STMT_START { \
  5268. SV *TeMpSv = dsv; \
  5269. sv_setsv(TeMpSv,ssv); \
  5270. SvSETMAGIC(TeMpSv); \
  5271. } STMT_END
  5272. #endif
  5273. #ifndef sv_setuv_mg
  5274. # define sv_setuv_mg(sv, i) \
  5275. STMT_START { \
  5276. SV *TeMpSv = sv; \
  5277. sv_setuv(TeMpSv,i); \
  5278. SvSETMAGIC(TeMpSv); \
  5279. } STMT_END
  5280. #endif
  5281. #ifndef sv_usepvn_mg
  5282. # define sv_usepvn_mg(sv, ptr, len) \
  5283. STMT_START { \
  5284. SV *TeMpSv = sv; \
  5285. sv_usepvn(TeMpSv,ptr,len); \
  5286. SvSETMAGIC(TeMpSv); \
  5287. } STMT_END
  5288. #endif
  5289. #ifndef SvVSTRING_mg
  5290. # define SvVSTRING_mg(sv) (SvMAGICAL(sv) ? mg_find(sv, PERL_MAGIC_vstring) : NULL)
  5291. #endif
  5292. /* Hint: sv_magic_portable
  5293. * This is a compatibility function that is only available with
  5294. * Devel::PPPort. It is NOT in the perl core.
  5295. * Its purpose is to mimic the 5.8.0 behaviour of sv_magic() when
  5296. * it is being passed a name pointer with namlen == 0. In that
  5297. * case, perl 5.8.0 and later store the pointer, not a copy of it.
  5298. * The compatibility can be provided back to perl 5.004. With
  5299. * earlier versions, the code will not compile.
  5300. */
  5301. #if (PERL_BCDVERSION < 0x5004000)
  5302. /* code that uses sv_magic_portable will not compile */
  5303. #elif (PERL_BCDVERSION < 0x5008000)
  5304. # define sv_magic_portable(sv, obj, how, name, namlen) \
  5305. STMT_START { \
  5306. SV *SvMp_sv = (sv); \
  5307. char *SvMp_name = (char *) (name); \
  5308. I32 SvMp_namlen = (namlen); \
  5309. if (SvMp_name && SvMp_namlen == 0) \
  5310. { \
  5311. MAGIC *mg; \
  5312. sv_magic(SvMp_sv, obj, how, 0, 0); \
  5313. mg = SvMAGIC(SvMp_sv); \
  5314. mg->mg_len = -42; /* XXX: this is the tricky part */ \
  5315. mg->mg_ptr = SvMp_name; \
  5316. } \
  5317. else \
  5318. { \
  5319. sv_magic(SvMp_sv, obj, how, SvMp_name, SvMp_namlen); \
  5320. } \
  5321. } STMT_END
  5322. #else
  5323. # define sv_magic_portable(a, b, c, d, e) sv_magic(a, b, c, d, e)
  5324. #endif
  5325. #ifdef USE_ITHREADS
  5326. #ifndef CopFILE
  5327. # define CopFILE(c) ((c)->cop_file)
  5328. #endif
  5329. #ifndef CopFILEGV
  5330. # define CopFILEGV(c) (CopFILE(c) ? gv_fetchfile(CopFILE(c)) : Nullgv)
  5331. #endif
  5332. #ifndef CopFILE_set
  5333. # define CopFILE_set(c,pv) ((c)->cop_file = savepv(pv))
  5334. #endif
  5335. #ifndef CopFILESV
  5336. # define CopFILESV(c) (CopFILE(c) ? GvSV(gv_fetchfile(CopFILE(c))) : Nullsv)
  5337. #endif
  5338. #ifndef CopFILEAV
  5339. # define CopFILEAV(c) (CopFILE(c) ? GvAV(gv_fetchfile(CopFILE(c))) : Nullav)
  5340. #endif
  5341. #ifndef CopSTASHPV
  5342. # define CopSTASHPV(c) ((c)->cop_stashpv)
  5343. #endif
  5344. #ifndef CopSTASHPV_set
  5345. # define CopSTASHPV_set(c,pv) ((c)->cop_stashpv = ((pv) ? savepv(pv) : Nullch))
  5346. #endif
  5347. #ifndef CopSTASH
  5348. # define CopSTASH(c) (CopSTASHPV(c) ? gv_stashpv(CopSTASHPV(c),GV_ADD) : Nullhv)
  5349. #endif
  5350. #ifndef CopSTASH_set
  5351. # define CopSTASH_set(c,hv) CopSTASHPV_set(c, (hv) ? HvNAME(hv) : Nullch)
  5352. #endif
  5353. #ifndef CopSTASH_eq
  5354. # define CopSTASH_eq(c,hv) ((hv) && (CopSTASHPV(c) == HvNAME(hv) \
  5355. || (CopSTASHPV(c) && HvNAME(hv) \
  5356. && strEQ(CopSTASHPV(c), HvNAME(hv)))))
  5357. #endif
  5358. #else
  5359. #ifndef CopFILEGV
  5360. # define CopFILEGV(c) ((c)->cop_filegv)
  5361. #endif
  5362. #ifndef CopFILEGV_set
  5363. # define CopFILEGV_set(c,gv) ((c)->cop_filegv = (GV*)SvREFCNT_inc(gv))
  5364. #endif
  5365. #ifndef CopFILE_set
  5366. # define CopFILE_set(c,pv) CopFILEGV_set((c), gv_fetchfile(pv))
  5367. #endif
  5368. #ifndef CopFILESV
  5369. # define CopFILESV(c) (CopFILEGV(c) ? GvSV(CopFILEGV(c)) : Nullsv)
  5370. #endif
  5371. #ifndef CopFILEAV
  5372. # define CopFILEAV(c) (CopFILEGV(c) ? GvAV(CopFILEGV(c)) : Nullav)
  5373. #endif
  5374. #ifndef CopFILE
  5375. # define CopFILE(c) (CopFILESV(c) ? SvPVX(CopFILESV(c)) : Nullch)
  5376. #endif
  5377. #ifndef CopSTASH
  5378. # define CopSTASH(c) ((c)->cop_stash)
  5379. #endif
  5380. #ifndef CopSTASH_set
  5381. # define CopSTASH_set(c,hv) ((c)->cop_stash = (hv))
  5382. #endif
  5383. #ifndef CopSTASHPV
  5384. # define CopSTASHPV(c) (CopSTASH(c) ? HvNAME(CopSTASH(c)) : Nullch)
  5385. #endif
  5386. #ifndef CopSTASHPV_set
  5387. # define CopSTASHPV_set(c,pv) CopSTASH_set((c), gv_stashpv(pv,GV_ADD))
  5388. #endif
  5389. #ifndef CopSTASH_eq
  5390. # define CopSTASH_eq(c,hv) (CopSTASH(c) == (hv))
  5391. #endif
  5392. #endif /* USE_ITHREADS */
  5393. #ifndef IN_PERL_COMPILETIME
  5394. # define IN_PERL_COMPILETIME (PL_curcop == &PL_compiling)
  5395. #endif
  5396. #ifndef IN_LOCALE_RUNTIME
  5397. # define IN_LOCALE_RUNTIME (PL_curcop->op_private & HINT_LOCALE)
  5398. #endif
  5399. #ifndef IN_LOCALE_COMPILETIME
  5400. # define IN_LOCALE_COMPILETIME (PL_hints & HINT_LOCALE)
  5401. #endif
  5402. #ifndef IN_LOCALE
  5403. # define IN_LOCALE (IN_PERL_COMPILETIME ? IN_LOCALE_COMPILETIME : IN_LOCALE_RUNTIME)
  5404. #endif
  5405. #ifndef IS_NUMBER_IN_UV
  5406. # define IS_NUMBER_IN_UV 0x01
  5407. #endif
  5408. #ifndef IS_NUMBER_GREATER_THAN_UV_MAX
  5409. # define IS_NUMBER_GREATER_THAN_UV_MAX 0x02
  5410. #endif
  5411. #ifndef IS_NUMBER_NOT_INT
  5412. # define IS_NUMBER_NOT_INT 0x04
  5413. #endif
  5414. #ifndef IS_NUMBER_NEG
  5415. # define IS_NUMBER_NEG 0x08
  5416. #endif
  5417. #ifndef IS_NUMBER_INFINITY
  5418. # define IS_NUMBER_INFINITY 0x10
  5419. #endif
  5420. #ifndef IS_NUMBER_NAN
  5421. # define IS_NUMBER_NAN 0x20
  5422. #endif
  5423. #ifndef GROK_NUMERIC_RADIX
  5424. # define GROK_NUMERIC_RADIX(sp, send) grok_numeric_radix(sp, send)
  5425. #endif
  5426. #ifndef PERL_SCAN_GREATER_THAN_UV_MAX
  5427. # define PERL_SCAN_GREATER_THAN_UV_MAX 0x02
  5428. #endif
  5429. #ifndef PERL_SCAN_SILENT_ILLDIGIT
  5430. # define PERL_SCAN_SILENT_ILLDIGIT 0x04
  5431. #endif
  5432. #ifndef PERL_SCAN_ALLOW_UNDERSCORES
  5433. # define PERL_SCAN_ALLOW_UNDERSCORES 0x01
  5434. #endif
  5435. #ifndef PERL_SCAN_DISALLOW_PREFIX
  5436. # define PERL_SCAN_DISALLOW_PREFIX 0x02
  5437. #endif
  5438. #ifndef grok_numeric_radix
  5439. #if defined(NEED_grok_numeric_radix)
  5440. static bool DPPP_(my_grok_numeric_radix)(pTHX_ const char ** sp, const char * send);
  5441. static
  5442. #else
  5443. extern bool DPPP_(my_grok_numeric_radix)(pTHX_ const char ** sp, const char * send);
  5444. #endif
  5445. #ifdef grok_numeric_radix
  5446. # undef grok_numeric_radix
  5447. #endif
  5448. #define grok_numeric_radix(a,b) DPPP_(my_grok_numeric_radix)(aTHX_ a,b)
  5449. #define Perl_grok_numeric_radix DPPP_(my_grok_numeric_radix)
  5450. #if defined(NEED_grok_numeric_radix) || defined(NEED_grok_numeric_radix_GLOBAL)
  5451. bool
  5452. DPPP_(my_grok_numeric_radix)(pTHX_ const char **sp, const char *send)
  5453. {
  5454. #ifdef USE_LOCALE_NUMERIC
  5455. #ifdef PL_numeric_radix_sv
  5456. if (PL_numeric_radix_sv && IN_LOCALE) {
  5457. STRLEN len;
  5458. char* radix = SvPV(PL_numeric_radix_sv, len);
  5459. if (*sp + len <= send && memEQ(*sp, radix, len)) {
  5460. *sp += len;
  5461. return TRUE;
  5462. }
  5463. }
  5464. #else
  5465. /* older perls don't have PL_numeric_radix_sv so the radix
  5466. * must manually be requested from locale.h
  5467. */
  5468. #include <locale.h>
  5469. dTHR; /* needed for older threaded perls */
  5470. struct lconv *lc = localeconv();
  5471. char *radix = lc->decimal_point;
  5472. if (radix && IN_LOCALE) {
  5473. STRLEN len = strlen(radix);
  5474. if (*sp + len <= send && memEQ(*sp, radix, len)) {
  5475. *sp += len;
  5476. return TRUE;
  5477. }
  5478. }
  5479. #endif
  5480. #endif /* USE_LOCALE_NUMERIC */
  5481. /* always try "." if numeric radix didn't match because
  5482. * we may have data from different locales mixed */
  5483. if (*sp < send && **sp == '.') {
  5484. ++*sp;
  5485. return TRUE;
  5486. }
  5487. return FALSE;
  5488. }
  5489. #endif
  5490. #endif
  5491. #ifndef grok_number
  5492. #if defined(NEED_grok_number)
  5493. static int DPPP_(my_grok_number)(pTHX_ const char * pv, STRLEN len, UV * valuep);
  5494. static
  5495. #else
  5496. extern int DPPP_(my_grok_number)(pTHX_ const char * pv, STRLEN len, UV * valuep);
  5497. #endif
  5498. #ifdef grok_number
  5499. # undef grok_number
  5500. #endif
  5501. #define grok_number(a,b,c) DPPP_(my_grok_number)(aTHX_ a,b,c)
  5502. #define Perl_grok_number DPPP_(my_grok_number)
  5503. #if defined(NEED_grok_number) || defined(NEED_grok_number_GLOBAL)
  5504. int
  5505. DPPP_(my_grok_number)(pTHX_ const char *pv, STRLEN len, UV *valuep)
  5506. {
  5507. const char *s = pv;
  5508. const char *send = pv + len;
  5509. const UV max_div_10 = UV_MAX / 10;
  5510. const char max_mod_10 = UV_MAX % 10;
  5511. int numtype = 0;
  5512. int sawinf = 0;
  5513. int sawnan = 0;
  5514. while (s < send && isSPACE(*s))
  5515. s++;
  5516. if (s == send) {
  5517. return 0;
  5518. } else if (*s == '-') {
  5519. s++;
  5520. numtype = IS_NUMBER_NEG;
  5521. }
  5522. else if (*s == '+')
  5523. s++;
  5524. if (s == send)
  5525. return 0;
  5526. /* next must be digit or the radix separator or beginning of infinity */
  5527. if (isDIGIT(*s)) {
  5528. /* UVs are at least 32 bits, so the first 9 decimal digits cannot
  5529. overflow. */
  5530. UV value = *s - '0';
  5531. /* This construction seems to be more optimiser friendly.
  5532. (without it gcc does the isDIGIT test and the *s - '0' separately)
  5533. With it gcc on arm is managing 6 instructions (6 cycles) per digit.
  5534. In theory the optimiser could deduce how far to unroll the loop
  5535. before checking for overflow. */
  5536. if (++s < send) {
  5537. int digit = *s - '0';
  5538. if (digit >= 0 && digit <= 9) {
  5539. value = value * 10 + digit;
  5540. if (++s < send) {
  5541. digit = *s - '0';
  5542. if (digit >= 0 && digit <= 9) {
  5543. value = value * 10 + digit;
  5544. if (++s < send) {
  5545. digit = *s - '0';
  5546. if (digit >= 0 && digit <= 9) {
  5547. value = value * 10 + digit;
  5548. if (++s < send) {
  5549. digit = *s - '0';
  5550. if (digit >= 0 && digit <= 9) {
  5551. value = value * 10 + digit;
  5552. if (++s < send) {
  5553. digit = *s - '0';
  5554. if (digit >= 0 && digit <= 9) {
  5555. value = value * 10 + digit;
  5556. if (++s < send) {
  5557. digit = *s - '0';
  5558. if (digit >= 0 && digit <= 9) {
  5559. value = value * 10 + digit;
  5560. if (++s < send) {
  5561. digit = *s - '0';
  5562. if (digit >= 0 && digit <= 9) {
  5563. value = value * 10 + digit;
  5564. if (++s < send) {
  5565. digit = *s - '0';
  5566. if (digit >= 0 && digit <= 9) {
  5567. value = value * 10 + digit;
  5568. if (++s < send) {
  5569. /* Now got 9 digits, so need to check
  5570. each time for overflow. */
  5571. digit = *s - '0';
  5572. while (digit >= 0 && digit <= 9
  5573. && (value < max_div_10
  5574. || (value == max_div_10
  5575. && digit <= max_mod_10))) {
  5576. value = value * 10 + digit;
  5577. if (++s < send)
  5578. digit = *s - '0';
  5579. else
  5580. break;
  5581. }
  5582. if (digit >= 0 && digit <= 9
  5583. && (s < send)) {
  5584. /* value overflowed.
  5585. skip the remaining digits, don't
  5586. worry about setting *valuep. */
  5587. do {
  5588. s++;
  5589. } while (s < send && isDIGIT(*s));
  5590. numtype |=
  5591. IS_NUMBER_GREATER_THAN_UV_MAX;
  5592. goto skip_value;
  5593. }
  5594. }
  5595. }
  5596. }
  5597. }
  5598. }
  5599. }
  5600. }
  5601. }
  5602. }
  5603. }
  5604. }
  5605. }
  5606. }
  5607. }
  5608. }
  5609. }
  5610. }
  5611. numtype |= IS_NUMBER_IN_UV;
  5612. if (valuep)
  5613. *valuep = value;
  5614. skip_value:
  5615. if (GROK_NUMERIC_RADIX(&s, send)) {
  5616. numtype |= IS_NUMBER_NOT_INT;
  5617. while (s < send && isDIGIT(*s)) /* optional digits after the radix */
  5618. s++;
  5619. }
  5620. }
  5621. else if (GROK_NUMERIC_RADIX(&s, send)) {
  5622. numtype |= IS_NUMBER_NOT_INT | IS_NUMBER_IN_UV; /* valuep assigned below */
  5623. /* no digits before the radix means we need digits after it */
  5624. if (s < send && isDIGIT(*s)) {
  5625. do {
  5626. s++;
  5627. } while (s < send && isDIGIT(*s));
  5628. if (valuep) {
  5629. /* integer approximation is valid - it's 0. */
  5630. *valuep = 0;
  5631. }
  5632. }
  5633. else
  5634. return 0;
  5635. } else if (*s == 'I' || *s == 'i') {
  5636. s++; if (s == send || (*s != 'N' && *s != 'n')) return 0;
  5637. s++; if (s == send || (*s != 'F' && *s != 'f')) return 0;
  5638. s++; if (s < send && (*s == 'I' || *s == 'i')) {
  5639. s++; if (s == send || (*s != 'N' && *s != 'n')) return 0;
  5640. s++; if (s == send || (*s != 'I' && *s != 'i')) return 0;
  5641. s++; if (s == send || (*s != 'T' && *s != 't')) return 0;
  5642. s++; if (s == send || (*s != 'Y' && *s != 'y')) return 0;
  5643. s++;
  5644. }
  5645. sawinf = 1;
  5646. } else if (*s == 'N' || *s == 'n') {
  5647. /* XXX TODO: There are signaling NaNs and quiet NaNs. */
  5648. s++; if (s == send || (*s != 'A' && *s != 'a')) return 0;
  5649. s++; if (s == send || (*s != 'N' && *s != 'n')) return 0;
  5650. s++;
  5651. sawnan = 1;
  5652. } else
  5653. return 0;
  5654. if (sawinf) {
  5655. numtype &= IS_NUMBER_NEG; /* Keep track of sign */
  5656. numtype |= IS_NUMBER_INFINITY | IS_NUMBER_NOT_INT;
  5657. } else if (sawnan) {
  5658. numtype &= IS_NUMBER_NEG; /* Keep track of sign */
  5659. numtype |= IS_NUMBER_NAN | IS_NUMBER_NOT_INT;
  5660. } else if (s < send) {
  5661. /* we can have an optional exponent part */
  5662. if (*s == 'e' || *s == 'E') {
  5663. /* The only flag we keep is sign. Blow away any "it's UV" */
  5664. numtype &= IS_NUMBER_NEG;
  5665. numtype |= IS_NUMBER_NOT_INT;
  5666. s++;
  5667. if (s < send && (*s == '-' || *s == '+'))
  5668. s++;
  5669. if (s < send && isDIGIT(*s)) {
  5670. do {
  5671. s++;
  5672. } while (s < send && isDIGIT(*s));
  5673. }
  5674. else
  5675. return 0;
  5676. }
  5677. }
  5678. while (s < send && isSPACE(*s))
  5679. s++;
  5680. if (s >= send)
  5681. return numtype;
  5682. if (len == 10 && memEQ(pv, "0 but true", 10)) {
  5683. if (valuep)
  5684. *valuep = 0;
  5685. return IS_NUMBER_IN_UV;
  5686. }
  5687. return 0;
  5688. }
  5689. #endif
  5690. #endif
  5691. /*
  5692. * The grok_* routines have been modified to use warn() instead of
  5693. * Perl_warner(). Also, 'hexdigit' was the former name of PL_hexdigit,
  5694. * which is why the stack variable has been renamed to 'xdigit'.
  5695. */
  5696. #ifndef grok_bin
  5697. #if defined(NEED_grok_bin)
  5698. static UV DPPP_(my_grok_bin)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
  5699. static
  5700. #else
  5701. extern UV DPPP_(my_grok_bin)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
  5702. #endif
  5703. #ifdef grok_bin
  5704. # undef grok_bin
  5705. #endif
  5706. #define grok_bin(a,b,c,d) DPPP_(my_grok_bin)(aTHX_ a,b,c,d)
  5707. #define Perl_grok_bin DPPP_(my_grok_bin)
  5708. #if defined(NEED_grok_bin) || defined(NEED_grok_bin_GLOBAL)
  5709. UV
  5710. DPPP_(my_grok_bin)(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result)
  5711. {
  5712. const char *s = start;
  5713. STRLEN len = *len_p;
  5714. UV value = 0;
  5715. NV value_nv = 0;
  5716. const UV max_div_2 = UV_MAX / 2;
  5717. bool allow_underscores = *flags & PERL_SCAN_ALLOW_UNDERSCORES;
  5718. bool overflowed = FALSE;
  5719. if (!(*flags & PERL_SCAN_DISALLOW_PREFIX)) {
  5720. /* strip off leading b or 0b.
  5721. for compatibility silently suffer "b" and "0b" as valid binary
  5722. numbers. */
  5723. if (len >= 1) {
  5724. if (s[0] == 'b') {
  5725. s++;
  5726. len--;
  5727. }
  5728. else if (len >= 2 && s[0] == '0' && s[1] == 'b') {
  5729. s+=2;
  5730. len-=2;
  5731. }
  5732. }
  5733. }
  5734. for (; len-- && *s; s++) {
  5735. char bit = *s;
  5736. if (bit == '0' || bit == '1') {
  5737. /* Write it in this wonky order with a goto to attempt to get the
  5738. compiler to make the common case integer-only loop pretty tight.
  5739. With gcc seems to be much straighter code than old scan_bin. */
  5740. redo:
  5741. if (!overflowed) {
  5742. if (value <= max_div_2) {
  5743. value = (value << 1) | (bit - '0');
  5744. continue;
  5745. }
  5746. /* Bah. We're just overflowed. */
  5747. warn("Integer overflow in binary number");
  5748. overflowed = TRUE;
  5749. value_nv = (NV) value;
  5750. }
  5751. value_nv *= 2.0;
  5752. /* If an NV has not enough bits in its mantissa to
  5753. * represent a UV this summing of small low-order numbers
  5754. * is a waste of time (because the NV cannot preserve
  5755. * the low-order bits anyway): we could just remember when
  5756. * did we overflow and in the end just multiply value_nv by the
  5757. * right amount. */
  5758. value_nv += (NV)(bit - '0');
  5759. continue;
  5760. }
  5761. if (bit == '_' && len && allow_underscores && (bit = s[1])
  5762. && (bit == '0' || bit == '1'))
  5763. {
  5764. --len;
  5765. ++s;
  5766. goto redo;
  5767. }
  5768. if (!(*flags & PERL_SCAN_SILENT_ILLDIGIT))
  5769. warn("Illegal binary digit '%c' ignored", *s);
  5770. break;
  5771. }
  5772. if ( ( overflowed && value_nv > 4294967295.0)
  5773. #if UVSIZE > 4
  5774. || (!overflowed && value > 0xffffffff )
  5775. #endif
  5776. ) {
  5777. warn("Binary number > 0b11111111111111111111111111111111 non-portable");
  5778. }
  5779. *len_p = s - start;
  5780. if (!overflowed) {
  5781. *flags = 0;
  5782. return value;
  5783. }
  5784. *flags = PERL_SCAN_GREATER_THAN_UV_MAX;
  5785. if (result)
  5786. *result = value_nv;
  5787. return UV_MAX;
  5788. }
  5789. #endif
  5790. #endif
  5791. #ifndef grok_hex
  5792. #if defined(NEED_grok_hex)
  5793. static UV DPPP_(my_grok_hex)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
  5794. static
  5795. #else
  5796. extern UV DPPP_(my_grok_hex)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
  5797. #endif
  5798. #ifdef grok_hex
  5799. # undef grok_hex
  5800. #endif
  5801. #define grok_hex(a,b,c,d) DPPP_(my_grok_hex)(aTHX_ a,b,c,d)
  5802. #define Perl_grok_hex DPPP_(my_grok_hex)
  5803. #if defined(NEED_grok_hex) || defined(NEED_grok_hex_GLOBAL)
  5804. UV
  5805. DPPP_(my_grok_hex)(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result)
  5806. {
  5807. const char *s = start;
  5808. STRLEN len = *len_p;
  5809. UV value = 0;
  5810. NV value_nv = 0;
  5811. const UV max_div_16 = UV_MAX / 16;
  5812. bool allow_underscores = *flags & PERL_SCAN_ALLOW_UNDERSCORES;
  5813. bool overflowed = FALSE;
  5814. const char *xdigit;
  5815. if (!(*flags & PERL_SCAN_DISALLOW_PREFIX)) {
  5816. /* strip off leading x or 0x.
  5817. for compatibility silently suffer "x" and "0x" as valid hex numbers.
  5818. */
  5819. if (len >= 1) {
  5820. if (s[0] == 'x') {
  5821. s++;
  5822. len--;
  5823. }
  5824. else if (len >= 2 && s[0] == '0' && s[1] == 'x') {
  5825. s+=2;
  5826. len-=2;
  5827. }
  5828. }
  5829. }
  5830. for (; len-- && *s; s++) {
  5831. xdigit = strchr((char *) PL_hexdigit, *s);
  5832. if (xdigit) {
  5833. /* Write it in this wonky order with a goto to attempt to get the
  5834. compiler to make the common case integer-only loop pretty tight.
  5835. With gcc seems to be much straighter code than old scan_hex. */
  5836. redo:
  5837. if (!overflowed) {
  5838. if (value <= max_div_16) {
  5839. value = (value << 4) | ((xdigit - PL_hexdigit) & 15);
  5840. continue;
  5841. }
  5842. warn("Integer overflow in hexadecimal number");
  5843. overflowed = TRUE;
  5844. value_nv = (NV) value;
  5845. }
  5846. value_nv *= 16.0;
  5847. /* If an NV has not enough bits in its mantissa to
  5848. * represent a UV this summing of small low-order numbers
  5849. * is a waste of time (because the NV cannot preserve
  5850. * the low-order bits anyway): we could just remember when
  5851. * did we overflow and in the end just multiply value_nv by the
  5852. * right amount of 16-tuples. */
  5853. value_nv += (NV)((xdigit - PL_hexdigit) & 15);
  5854. continue;
  5855. }
  5856. if (*s == '_' && len && allow_underscores && s[1]
  5857. && (xdigit = strchr((char *) PL_hexdigit, s[1])))
  5858. {
  5859. --len;
  5860. ++s;
  5861. goto redo;
  5862. }
  5863. if (!(*flags & PERL_SCAN_SILENT_ILLDIGIT))
  5864. warn("Illegal hexadecimal digit '%c' ignored", *s);
  5865. break;
  5866. }
  5867. if ( ( overflowed && value_nv > 4294967295.0)
  5868. #if UVSIZE > 4
  5869. || (!overflowed && value > 0xffffffff )
  5870. #endif
  5871. ) {
  5872. warn("Hexadecimal number > 0xffffffff non-portable");
  5873. }
  5874. *len_p = s - start;
  5875. if (!overflowed) {
  5876. *flags = 0;
  5877. return value;
  5878. }
  5879. *flags = PERL_SCAN_GREATER_THAN_UV_MAX;
  5880. if (result)
  5881. *result = value_nv;
  5882. return UV_MAX;
  5883. }
  5884. #endif
  5885. #endif
  5886. #ifndef grok_oct
  5887. #if defined(NEED_grok_oct)
  5888. static UV DPPP_(my_grok_oct)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
  5889. static
  5890. #else
  5891. extern UV DPPP_(my_grok_oct)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
  5892. #endif
  5893. #ifdef grok_oct
  5894. # undef grok_oct
  5895. #endif
  5896. #define grok_oct(a,b,c,d) DPPP_(my_grok_oct)(aTHX_ a,b,c,d)
  5897. #define Perl_grok_oct DPPP_(my_grok_oct)
  5898. #if defined(NEED_grok_oct) || defined(NEED_grok_oct_GLOBAL)
  5899. UV
  5900. DPPP_(my_grok_oct)(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result)
  5901. {
  5902. const char *s = start;
  5903. STRLEN len = *len_p;
  5904. UV value = 0;
  5905. NV value_nv = 0;
  5906. const UV max_div_8 = UV_MAX / 8;
  5907. bool allow_underscores = *flags & PERL_SCAN_ALLOW_UNDERSCORES;
  5908. bool overflowed = FALSE;
  5909. for (; len-- && *s; s++) {
  5910. /* gcc 2.95 optimiser not smart enough to figure that this subtraction
  5911. out front allows slicker code. */
  5912. int digit = *s - '0';
  5913. if (digit >= 0 && digit <= 7) {
  5914. /* Write it in this wonky order with a goto to attempt to get the
  5915. compiler to make the common case integer-only loop pretty tight.
  5916. */
  5917. redo:
  5918. if (!overflowed) {
  5919. if (value <= max_div_8) {
  5920. value = (value << 3) | digit;
  5921. continue;
  5922. }
  5923. /* Bah. We're just overflowed. */
  5924. warn("Integer overflow in octal number");
  5925. overflowed = TRUE;
  5926. value_nv = (NV) value;
  5927. }
  5928. value_nv *= 8.0;
  5929. /* If an NV has not enough bits in its mantissa to
  5930. * represent a UV this summing of small low-order numbers
  5931. * is a waste of time (because the NV cannot preserve
  5932. * the low-order bits anyway): we could just remember when
  5933. * did we overflow and in the end just multiply value_nv by the
  5934. * right amount of 8-tuples. */
  5935. value_nv += (NV)digit;
  5936. continue;
  5937. }
  5938. if (digit == ('_' - '0') && len && allow_underscores
  5939. && (digit = s[1] - '0') && (digit >= 0 && digit <= 7))
  5940. {
  5941. --len;
  5942. ++s;
  5943. goto redo;
  5944. }
  5945. /* Allow \octal to work the DWIM way (that is, stop scanning
  5946. * as soon as non-octal characters are seen, complain only iff
  5947. * someone seems to want to use the digits eight and nine). */
  5948. if (digit == 8 || digit == 9) {
  5949. if (!(*flags & PERL_SCAN_SILENT_ILLDIGIT))
  5950. warn("Illegal octal digit '%c' ignored", *s);
  5951. }
  5952. break;
  5953. }
  5954. if ( ( overflowed && value_nv > 4294967295.0)
  5955. #if UVSIZE > 4
  5956. || (!overflowed && value > 0xffffffff )
  5957. #endif
  5958. ) {
  5959. warn("Octal number > 037777777777 non-portable");
  5960. }
  5961. *len_p = s - start;
  5962. if (!overflowed) {
  5963. *flags = 0;
  5964. return value;
  5965. }
  5966. *flags = PERL_SCAN_GREATER_THAN_UV_MAX;
  5967. if (result)
  5968. *result = value_nv;
  5969. return UV_MAX;
  5970. }
  5971. #endif
  5972. #endif
  5973. #if !defined(my_snprintf)
  5974. #if defined(NEED_my_snprintf)
  5975. static int DPPP_(my_my_snprintf)(char * buffer, const Size_t len, const char * format, ...);
  5976. static
  5977. #else
  5978. extern int DPPP_(my_my_snprintf)(char * buffer, const Size_t len, const char * format, ...);
  5979. #endif
  5980. #define my_snprintf DPPP_(my_my_snprintf)
  5981. #define Perl_my_snprintf DPPP_(my_my_snprintf)
  5982. #if defined(NEED_my_snprintf) || defined(NEED_my_snprintf_GLOBAL)
  5983. int
  5984. DPPP_(my_my_snprintf)(char *buffer, const Size_t len, const char *format, ...)
  5985. {
  5986. dTHX;
  5987. int retval;
  5988. va_list ap;
  5989. va_start(ap, format);
  5990. #ifdef HAS_VSNPRINTF
  5991. retval = vsnprintf(buffer, len, format, ap);
  5992. #else
  5993. retval = vsprintf(buffer, format, ap);
  5994. #endif
  5995. va_end(ap);
  5996. if (retval < 0 || (len > 0 && (Size_t)retval >= len))
  5997. Perl_croak(aTHX_ "panic: my_snprintf buffer overflow");
  5998. return retval;
  5999. }
  6000. #endif
  6001. #endif
  6002. #if !defined(my_sprintf)
  6003. #if defined(NEED_my_sprintf)
  6004. static int DPPP_(my_my_sprintf)(char * buffer, const char * pat, ...);
  6005. static
  6006. #else
  6007. extern int DPPP_(my_my_sprintf)(char * buffer, const char * pat, ...);
  6008. #endif
  6009. #define my_sprintf DPPP_(my_my_sprintf)
  6010. #define Perl_my_sprintf DPPP_(my_my_sprintf)
  6011. #if defined(NEED_my_sprintf) || defined(NEED_my_sprintf_GLOBAL)
  6012. int
  6013. DPPP_(my_my_sprintf)(char *buffer, const char* pat, ...)
  6014. {
  6015. va_list args;
  6016. va_start(args, pat);
  6017. vsprintf(buffer, pat, args);
  6018. va_end(args);
  6019. return strlen(buffer);
  6020. }
  6021. #endif
  6022. #endif
  6023. #ifdef NO_XSLOCKS
  6024. # ifdef dJMPENV
  6025. # define dXCPT dJMPENV; int rEtV = 0
  6026. # define XCPT_TRY_START JMPENV_PUSH(rEtV); if (rEtV == 0)
  6027. # define XCPT_TRY_END JMPENV_POP;
  6028. # define XCPT_CATCH if (rEtV != 0)
  6029. # define XCPT_RETHROW JMPENV_JUMP(rEtV)
  6030. # else
  6031. # define dXCPT Sigjmp_buf oldTOP; int rEtV = 0
  6032. # define XCPT_TRY_START Copy(top_env, oldTOP, 1, Sigjmp_buf); rEtV = Sigsetjmp(top_env, 1); if (rEtV == 0)
  6033. # define XCPT_TRY_END Copy(oldTOP, top_env, 1, Sigjmp_buf);
  6034. # define XCPT_CATCH if (rEtV != 0)
  6035. # define XCPT_RETHROW Siglongjmp(top_env, rEtV)
  6036. # endif
  6037. #endif
  6038. #if !defined(my_strlcat)
  6039. #if defined(NEED_my_strlcat)
  6040. static Size_t DPPP_(my_my_strlcat)(char * dst, const char * src, Size_t size);
  6041. static
  6042. #else
  6043. extern Size_t DPPP_(my_my_strlcat)(char * dst, const char * src, Size_t size);
  6044. #endif
  6045. #define my_strlcat DPPP_(my_my_strlcat)
  6046. #define Perl_my_strlcat DPPP_(my_my_strlcat)
  6047. #if defined(NEED_my_strlcat) || defined(NEED_my_strlcat_GLOBAL)
  6048. Size_t
  6049. DPPP_(my_my_strlcat)(char *dst, const char *src, Size_t size)
  6050. {
  6051. Size_t used, length, copy;
  6052. used = strlen(dst);
  6053. length = strlen(src);
  6054. if (size > 0 && used < size - 1) {
  6055. copy = (length >= size - used) ? size - used - 1 : length;
  6056. memcpy(dst + used, src, copy);
  6057. dst[used + copy] = '\0';
  6058. }
  6059. return used + length;
  6060. }
  6061. #endif
  6062. #endif
  6063. #if !defined(my_strlcpy)
  6064. #if defined(NEED_my_strlcpy)
  6065. static Size_t DPPP_(my_my_strlcpy)(char * dst, const char * src, Size_t size);
  6066. static
  6067. #else
  6068. extern Size_t DPPP_(my_my_strlcpy)(char * dst, const char * src, Size_t size);
  6069. #endif
  6070. #define my_strlcpy DPPP_(my_my_strlcpy)
  6071. #define Perl_my_strlcpy DPPP_(my_my_strlcpy)
  6072. #if defined(NEED_my_strlcpy) || defined(NEED_my_strlcpy_GLOBAL)
  6073. Size_t
  6074. DPPP_(my_my_strlcpy)(char *dst, const char *src, Size_t size)
  6075. {
  6076. Size_t length, copy;
  6077. length = strlen(src);
  6078. if (size > 0) {
  6079. copy = (length >= size) ? size - 1 : length;
  6080. memcpy(dst, src, copy);
  6081. dst[copy] = '\0';
  6082. }
  6083. return length;
  6084. }
  6085. #endif
  6086. #endif
  6087. #ifndef PERL_PV_ESCAPE_QUOTE
  6088. # define PERL_PV_ESCAPE_QUOTE 0x0001
  6089. #endif
  6090. #ifndef PERL_PV_PRETTY_QUOTE
  6091. # define PERL_PV_PRETTY_QUOTE PERL_PV_ESCAPE_QUOTE
  6092. #endif
  6093. #ifndef PERL_PV_PRETTY_ELLIPSES
  6094. # define PERL_PV_PRETTY_ELLIPSES 0x0002
  6095. #endif
  6096. #ifndef PERL_PV_PRETTY_LTGT
  6097. # define PERL_PV_PRETTY_LTGT 0x0004
  6098. #endif
  6099. #ifndef PERL_PV_ESCAPE_FIRSTCHAR
  6100. # define PERL_PV_ESCAPE_FIRSTCHAR 0x0008
  6101. #endif
  6102. #ifndef PERL_PV_ESCAPE_UNI
  6103. # define PERL_PV_ESCAPE_UNI 0x0100
  6104. #endif
  6105. #ifndef PERL_PV_ESCAPE_UNI_DETECT
  6106. # define PERL_PV_ESCAPE_UNI_DETECT 0x0200
  6107. #endif
  6108. #ifndef PERL_PV_ESCAPE_ALL
  6109. # define PERL_PV_ESCAPE_ALL 0x1000
  6110. #endif
  6111. #ifndef PERL_PV_ESCAPE_NOBACKSLASH
  6112. # define PERL_PV_ESCAPE_NOBACKSLASH 0x2000
  6113. #endif
  6114. #ifndef PERL_PV_ESCAPE_NOCLEAR
  6115. # define PERL_PV_ESCAPE_NOCLEAR 0x4000
  6116. #endif
  6117. #ifndef PERL_PV_ESCAPE_RE
  6118. # define PERL_PV_ESCAPE_RE 0x8000
  6119. #endif
  6120. #ifndef PERL_PV_PRETTY_NOCLEAR
  6121. # define PERL_PV_PRETTY_NOCLEAR PERL_PV_ESCAPE_NOCLEAR
  6122. #endif
  6123. #ifndef PERL_PV_PRETTY_DUMP
  6124. # define PERL_PV_PRETTY_DUMP PERL_PV_PRETTY_ELLIPSES|PERL_PV_PRETTY_QUOTE
  6125. #endif
  6126. #ifndef PERL_PV_PRETTY_REGPROP
  6127. # define PERL_PV_PRETTY_REGPROP PERL_PV_PRETTY_ELLIPSES|PERL_PV_PRETTY_LTGT|PERL_PV_ESCAPE_RE
  6128. #endif
  6129. /* Hint: pv_escape
  6130. * Note that unicode functionality is only backported to
  6131. * those perl versions that support it. For older perl
  6132. * versions, the implementation will fall back to bytes.
  6133. */
  6134. #ifndef pv_escape
  6135. #if defined(NEED_pv_escape)
  6136. 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);
  6137. static
  6138. #else
  6139. 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);
  6140. #endif
  6141. #ifdef pv_escape
  6142. # undef pv_escape
  6143. #endif
  6144. #define pv_escape(a,b,c,d,e,f) DPPP_(my_pv_escape)(aTHX_ a,b,c,d,e,f)
  6145. #define Perl_pv_escape DPPP_(my_pv_escape)
  6146. #if defined(NEED_pv_escape) || defined(NEED_pv_escape_GLOBAL)
  6147. char *
  6148. DPPP_(my_pv_escape)(pTHX_ SV *dsv, char const * const str,
  6149. const STRLEN count, const STRLEN max,
  6150. STRLEN * const escaped, const U32 flags)
  6151. {
  6152. const char esc = flags & PERL_PV_ESCAPE_RE ? '%' : '\\';
  6153. const char dq = flags & PERL_PV_ESCAPE_QUOTE ? '"' : esc;
  6154. char octbuf[32] = "%123456789ABCDF";
  6155. STRLEN wrote = 0;
  6156. STRLEN chsize = 0;
  6157. STRLEN readsize = 1;
  6158. #if defined(is_utf8_string) && defined(utf8_to_uvchr)
  6159. bool isuni = flags & PERL_PV_ESCAPE_UNI ? 1 : 0;
  6160. #endif
  6161. const char *pv = str;
  6162. const char * const end = pv + count;
  6163. octbuf[0] = esc;
  6164. if (!(flags & PERL_PV_ESCAPE_NOCLEAR))
  6165. sv_setpvs(dsv, "");
  6166. #if defined(is_utf8_string) && defined(utf8_to_uvchr)
  6167. if ((flags & PERL_PV_ESCAPE_UNI_DETECT) && is_utf8_string((U8*)pv, count))
  6168. isuni = 1;
  6169. #endif
  6170. for (; pv < end && (!max || wrote < max) ; pv += readsize) {
  6171. const UV u =
  6172. #if defined(is_utf8_string) && defined(utf8_to_uvchr)
  6173. isuni ? utf8_to_uvchr((U8*)pv, &readsize) :
  6174. #endif
  6175. (U8)*pv;
  6176. const U8 c = (U8)u & 0xFF;
  6177. if (u > 255 || (flags & PERL_PV_ESCAPE_ALL)) {
  6178. if (flags & PERL_PV_ESCAPE_FIRSTCHAR)
  6179. chsize = my_snprintf(octbuf, sizeof octbuf,
  6180. "%"UVxf, u);
  6181. else
  6182. chsize = my_snprintf(octbuf, sizeof octbuf,
  6183. "%cx{%"UVxf"}", esc, u);
  6184. } else if (flags & PERL_PV_ESCAPE_NOBACKSLASH) {
  6185. chsize = 1;
  6186. } else {
  6187. if (c == dq || c == esc || !isPRINT(c)) {
  6188. chsize = 2;
  6189. switch (c) {
  6190. case '\\' : /* fallthrough */
  6191. case '%' : if (c == esc)
  6192. octbuf[1] = esc;
  6193. else
  6194. chsize = 1;
  6195. break;
  6196. case '\v' : octbuf[1] = 'v'; break;
  6197. case '\t' : octbuf[1] = 't'; break;
  6198. case '\r' : octbuf[1] = 'r'; break;
  6199. case '\n' : octbuf[1] = 'n'; break;
  6200. case '\f' : octbuf[1] = 'f'; break;
  6201. case '"' : if (dq == '"')
  6202. octbuf[1] = '"';
  6203. else
  6204. chsize = 1;
  6205. break;
  6206. default: chsize = my_snprintf(octbuf, sizeof octbuf,
  6207. pv < end && isDIGIT((U8)*(pv+readsize))
  6208. ? "%c%03o" : "%c%o", esc, c);
  6209. }
  6210. } else {
  6211. chsize = 1;
  6212. }
  6213. }
  6214. if (max && wrote + chsize > max) {
  6215. break;
  6216. } else if (chsize > 1) {
  6217. sv_catpvn(dsv, octbuf, chsize);
  6218. wrote += chsize;
  6219. } else {
  6220. char tmp[2];
  6221. my_snprintf(tmp, sizeof tmp, "%c", c);
  6222. sv_catpvn(dsv, tmp, 1);
  6223. wrote++;
  6224. }
  6225. if (flags & PERL_PV_ESCAPE_FIRSTCHAR)
  6226. break;
  6227. }
  6228. if (escaped != NULL)
  6229. *escaped= pv - str;
  6230. return SvPVX(dsv);
  6231. }
  6232. #endif
  6233. #endif
  6234. #ifndef pv_pretty
  6235. #if defined(NEED_pv_pretty)
  6236. 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);
  6237. static
  6238. #else
  6239. 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);
  6240. #endif
  6241. #ifdef pv_pretty
  6242. # undef pv_pretty
  6243. #endif
  6244. #define pv_pretty(a,b,c,d,e,f,g) DPPP_(my_pv_pretty)(aTHX_ a,b,c,d,e,f,g)
  6245. #define Perl_pv_pretty DPPP_(my_pv_pretty)
  6246. #if defined(NEED_pv_pretty) || defined(NEED_pv_pretty_GLOBAL)
  6247. char *
  6248. DPPP_(my_pv_pretty)(pTHX_ SV *dsv, char const * const str, const STRLEN count,
  6249. const STRLEN max, char const * const start_color, char const * const end_color,
  6250. const U32 flags)
  6251. {
  6252. const U8 dq = (flags & PERL_PV_PRETTY_QUOTE) ? '"' : '%';
  6253. STRLEN escaped;
  6254. if (!(flags & PERL_PV_PRETTY_NOCLEAR))
  6255. sv_setpvs(dsv, "");
  6256. if (dq == '"')
  6257. sv_catpvs(dsv, "\"");
  6258. else if (flags & PERL_PV_PRETTY_LTGT)
  6259. sv_catpvs(dsv, "<");
  6260. if (start_color != NULL)
  6261. sv_catpv(dsv, D_PPP_CONSTPV_ARG(start_color));
  6262. pv_escape(dsv, str, count, max, &escaped, flags | PERL_PV_ESCAPE_NOCLEAR);
  6263. if (end_color != NULL)
  6264. sv_catpv(dsv, D_PPP_CONSTPV_ARG(end_color));
  6265. if (dq == '"')
  6266. sv_catpvs(dsv, "\"");
  6267. else if (flags & PERL_PV_PRETTY_LTGT)
  6268. sv_catpvs(dsv, ">");
  6269. if ((flags & PERL_PV_PRETTY_ELLIPSES) && escaped < count)
  6270. sv_catpvs(dsv, "...");
  6271. return SvPVX(dsv);
  6272. }
  6273. #endif
  6274. #endif
  6275. #ifndef pv_display
  6276. #if defined(NEED_pv_display)
  6277. static char * DPPP_(my_pv_display)(pTHX_ SV * dsv, const char * pv, STRLEN cur, STRLEN len, STRLEN pvlim);
  6278. static
  6279. #else
  6280. extern char * DPPP_(my_pv_display)(pTHX_ SV * dsv, const char * pv, STRLEN cur, STRLEN len, STRLEN pvlim);
  6281. #endif
  6282. #ifdef pv_display
  6283. # undef pv_display
  6284. #endif
  6285. #define pv_display(a,b,c,d,e) DPPP_(my_pv_display)(aTHX_ a,b,c,d,e)
  6286. #define Perl_pv_display DPPP_(my_pv_display)
  6287. #if defined(NEED_pv_display) || defined(NEED_pv_display_GLOBAL)
  6288. char *
  6289. DPPP_(my_pv_display)(pTHX_ SV *dsv, const char *pv, STRLEN cur, STRLEN len, STRLEN pvlim)
  6290. {
  6291. pv_pretty(dsv, pv, cur, pvlim, NULL, NULL, PERL_PV_PRETTY_DUMP);
  6292. if (len > cur && pv[cur] == '\0')
  6293. sv_catpvs(dsv, "\\0");
  6294. return SvPVX(dsv);
  6295. }
  6296. #endif
  6297. #endif
  6298. #endif /* _P_P_PORTABILITY_H_ */
  6299. /* End of File ppport.h */