Codebase list libcryptx-perl / 9d194de
moving CryptX.xs ppport.h Karel Miko 8 years ago
5 changed file(s) with 8177 addition(s) and 8176 deletion(s). Raw diff Collapse all Expand all
33 use Module::Build;
44 use Config;
55
6 my $flags = '-Isrc/ltc/headers -Isrc/ltm -DLTC_SOURCE -DLTC_NO_TEST -DLTC_NO_PROTOTYPES -DLTM_DESC';
6 my $flags = '-I. -Isrc/ltc/headers -Isrc/ltm -DLTC_SOURCE -DLTC_NO_TEST -DLTC_NO_PROTOTYPES -DLTM_DESC';
77 #$flags .= ' -Wall';
88 #$flags .= ' -DLTC_NO_FAST';
99 #$flags .= ' -DLTC_NO_ASM';
4848 );
4949
5050 my $builder = $class->new(
51 module_name => 'CryptX',
52 dist_abstract => 'Crypto toolkit',
53 dist_author => 'Karel Miko',
54 dist_version_from => 'lib/CryptX.pm',
55 license => 'perl',
56 create_readme => 1,
57 extra_compiler_flags => $flags,
58 c_source => 'src',
59 requires => {
51 module_name => 'CryptX', #0.03
52 dist_abstract => 'Crypto toolkit', #0.20
53 dist_author => 'Karel Miko', #0.20
54 dist_version_from => 'lib/CryptX.pm', #0.11
55 license => 'perl', #0.07
56 create_readme => 1, #0.22
57 extra_compiler_flags => $flags, #0.25
58 c_source => 'src', #0.04
59 xs_files => {'CryptX.xs'=>'CryptX.xs'}, #0.25
60 requires => { #0.21
6061 'perl' => '5.006',
6162 },
62 build_requires => {
63 build_requires => { #0.21
6364 'perl' => '5.006',
6465 'Module::Build' => 0,
6566 },
66 configure_requires => {
67 configure_requires => { #0.30
6768 'perl' => '5.006',
6869 'Module::Build' => 0,
6970 },
70 meta_merge => {
71 meta_merge => { #0.28
7172 resources => {
7273 repository => 'https://github.com/DCIT/perl-CryptX',
7374 }
0 #include "EXTERN.h"
1 #include "perl.h"
2 #include "XSUB.h"
3
4 #define NEED_sv_2pvbyte_GLOBAL
5 #define NEED_sv_2pv_flags_GLOBAL
6 #define NEED_newRV_noinc_GLOBAL
7 #include "ppport.h"
8
9 #undef LTC_SOURCE
10 #include "tomcrypt.h"
11 #include "tommath.h"
12
13 typedef struct cipher_struct { /* used by Crypt::Cipher */
14 symmetric_key skey;
15 int id;
16 struct ltc_cipher_descriptor *desc;
17 } *Crypt__Cipher;
18
19 typedef struct digest_struct { /* used by Crypt::Digest */
20 hash_state state;
21 int id;
22 struct ltc_hash_descriptor *desc;
23 } *Crypt__Digest;
24
25 typedef struct ccm_struct { /* used by Crypt::AuthEnc::CCM */
26 int id;
27 } *Crypt__AuthEnc__CCM;
28
29 typedef struct eax_struct { /* used by Crypt::AuthEnc::EAX */
30 eax_state state;
31 int id;
32 } *Crypt__AuthEnc__EAX;
33
34 typedef struct gcm_struct { /* used by Crypt::AuthEnc::GCM */
35 gcm_state state;
36 int id;
37 } *Crypt__AuthEnc__GCM;
38
39 typedef struct ocb_struct { /* used by Crypt::AuthEnc::OCB */
40 ocb3_state state;
41 int id;
42 } *Crypt__AuthEnc__OCB;
43
44 typedef struct f9_struct { /* used by Crypt::Mac::F9 */
45 f9_state state;
46 int id;
47 } *Crypt__Mac__F9;
48
49 typedef struct hmac_struct { /* used by Crypt::Mac::HMAC */
50 hmac_state state;
51 int id;
52 } *Crypt__Mac__HMAC;
53
54 typedef struct omac_struct { /* used by Crypt::Mac::OMAC */
55 omac_state state;
56 int id;
57 } *Crypt__Mac__OMAC;
58
59 typedef struct pelican_struct { /* used by Crypt::Mac::Pelican */
60 pelican_state state;
61 int id;
62 } *Crypt__Mac__Pelican;
63
64 typedef struct pmac_struct { /* used by Crypt::Mac::PMAC */
65 pmac_state state;
66 int id;
67 } *Crypt__Mac__PMAC;
68
69 typedef struct xcbc_struct { /* used by Crypt::Mac::XCBC */
70 xcbc_state state;
71 int id;
72 } *Crypt__Mac__XCBC;
73
74 typedef struct cbc_struct { /* used by Crypt::Mode::CBC */
75 int cipher_id, cipher_rounds;
76 symmetric_CBC state;
77 unsigned char pad[MAXBLOCKSIZE];
78 int padlen;
79 int padding_mode;
80 int direction;
81 int id;
82 } *Crypt__Mode__CBC;
83
84 typedef struct ecb_struct { /* used by Crypt::Mode::ECB */
85 int cipher_id, cipher_rounds;
86 symmetric_ECB state;
87 unsigned char pad[MAXBLOCKSIZE];
88 int padlen;
89 int padding_mode;
90 int direction;
91 int id;
92 } *Crypt__Mode__ECB;
93
94 typedef struct cfb_struct { /* used by Crypt::Mode::CFB */
95 int cipher_id, cipher_rounds;
96 symmetric_CFB state;
97 int direction;
98 int id;
99 } *Crypt__Mode__CFB;
100
101 typedef struct ctr_struct { /* used by Crypt::Mode::CTR */
102 int cipher_id, cipher_rounds;
103 int ctr_mode_param;
104 symmetric_CTR state;
105 int direction;
106 int id;
107 } *Crypt__Mode__CTR;
108
109 typedef struct f8_struct { /* used by Crypt::Mode::F8 */
110 int cipher_id, cipher_rounds;
111 symmetric_F8 state;
112 int direction;
113 int id;
114 } *Crypt__Mode__F8;
115
116 typedef struct lrw_struct { /* used by Crypt::Mode::LRW */
117 int cipher_id, cipher_rounds;
118 symmetric_LRW state;
119 int direction;
120 int id;
121 } *Crypt__Mode__LRW;
122
123 typedef struct ofb_struct { /* used by Crypt::Mode::OFB */
124 int cipher_id, cipher_rounds;
125 symmetric_OFB state;
126 int direction;
127 int id;
128 } *Crypt__Mode__OFB;
129
130 typedef struct xts_struct { /* used by Crypt::Mode::XTS */
131 int cipher_id, cipher_rounds;
132 symmetric_xts state;
133 int direction;
134 int id;
135 } *Crypt__Mode__XTS;
136
137 typedef struct prng_struct { /* used by Crypt::PRNG */
138 prng_state state;
139 struct ltc_prng_descriptor *desc;
140 IV last_pid;
141 int id;
142 } *Crypt__PRNG;
143
144 typedef struct rsa_struct { /* used by Crypt::PK::RSA */
145 prng_state yarrow_prng_state;
146 int yarrow_prng_index;
147 rsa_key key;
148 int id;
149 } *Crypt__PK__RSA;
150
151 typedef struct dsa_struct { /* used by Crypt::PK::DSA */
152 prng_state yarrow_prng_state;
153 int yarrow_prng_index;
154 dsa_key key;
155 int id;
156 } *Crypt__PK__DSA;
157
158 typedef struct dh_struct { /* used by Crypt::PK::DH */
159 prng_state yarrow_prng_state;
160 int yarrow_prng_index;
161 dh_key key;
162 int id;
163 } *Crypt__PK__DH;
164
165 typedef struct ecc_struct { /* used by Crypt::PK::ECC */
166 prng_state yarrow_prng_state;
167 int yarrow_prng_index;
168 ecc_key key;
169 ltc_ecc_set_type dp;
170 int id;
171 } *Crypt__PK__ECC;
172
173 ltc_ecc_set_type* _ecc_set_dp_from_SV(ltc_ecc_set_type *dp, SV *curve)
174 {
175 HV *h;
176 SV *param, **pref;
177 SV **sv_cofactor, **sv_prime, **sv_A, **sv_B, **sv_order, **sv_Gx, **sv_Gy;
178 int err;
179 char *ch_name;
180 STRLEN l_name;
181
182 if (SvPOK(curve)) {
183 ch_name = SvPV(curve, l_name);
184 if ((h = get_hv("Crypt::PK::ECC::curve", 0)) == NULL) croak("FATAL: generate_key_ex: no curve register");
185 if ((pref = hv_fetch(h, ch_name, l_name, 0)) == NULL) croak("FATAL: generate_key_ex: unknown curve/1 '%s'", ch_name);
186 if (!SvOK(*pref)) croak("FATAL: generate_key_ex: unknown curve/2 '%s'", ch_name);
187 param = *pref;
188 }
189 else if (SvROK(curve)) {
190 param = curve;
191 ch_name = "custom";
192 }
193 else {
194 croak("FATAL: curve has to be a string or a hashref");
195 }
196
197 if ((h = (HV*)(SvRV(param))) == NULL) croak("FATAL: ecparams: param is not valid hashref");
198
199 if ((sv_prime = hv_fetchs(h, "prime", 0)) == NULL) croak("FATAL: ecparams: missing param prime");
200 if ((sv_A = hv_fetchs(h, "A", 0)) == NULL) croak("FATAL: ecparams: missing param A");
201 if ((sv_B = hv_fetchs(h, "B", 0)) == NULL) croak("FATAL: ecparams: missing param B");
202 if ((sv_order = hv_fetchs(h, "order", 0)) == NULL) croak("FATAL: ecparams: missing param order");
203 if ((sv_Gx = hv_fetchs(h, "Gx", 0)) == NULL) croak("FATAL: ecparams: missing param Gx");
204 if ((sv_Gy = hv_fetchs(h, "Gy", 0)) == NULL) croak("FATAL: ecparams: missing param Gy");
205 if ((sv_cofactor = hv_fetchs(h, "cofactor", 0)) == NULL) croak("FATAL: ecparams: missing param cofactor");
206
207 if (!SvOK(*sv_prime )) croak("FATAL: ecparams: undefined param prime");
208 if (!SvOK(*sv_A )) croak("FATAL: ecparams: undefined param A");
209 if (!SvOK(*sv_B )) croak("FATAL: ecparams: undefined param B");
210 if (!SvOK(*sv_order )) croak("FATAL: ecparams: undefined param order");
211 if (!SvOK(*sv_Gx )) croak("FATAL: ecparams: undefined param Gx");
212 if (!SvOK(*sv_Gy )) croak("FATAL: ecparams: undefined param Gy");
213 if (!SvOK(*sv_cofactor)) croak("FATAL: ecparams: undefined param cofactor");
214
215 err = ecc_dp_set( dp,
216 SvPV_nolen(*sv_prime),
217 SvPV_nolen(*sv_A),
218 SvPV_nolen(*sv_B),
219 SvPV_nolen(*sv_order),
220 SvPV_nolen(*sv_Gx),
221 SvPV_nolen(*sv_Gy),
222 (unsigned long)SvUV(*sv_cofactor),
223 ch_name );
224 return err == CRYPT_OK ? dp : NULL;
225 }
226
227 void _ecc_free_key(ecc_key *key, ltc_ecc_set_type *dp)
228 {
229 if(dp) {
230 ecc_dp_clear(dp);
231 }
232 if (key->type != -1) {
233 ecc_free(key);
234 key->type = -1;
235 key->dp = NULL;
236 }
237 }
238
239 MODULE = CryptX PACKAGE = CryptX PREFIX = CryptX_
240
241 BOOT:
242 if(register_cipher(&blowfish_desc)==-1) { croak("FATAL: cannot register_cipher blowfish"); }
243 if(register_cipher(&rc5_desc)==-1) { croak("FATAL: cannot register_cipher rc5"); }
244 if(register_cipher(&rc6_desc)==-1) { croak("FATAL: cannot register_cipher rc6"); }
245 if(register_cipher(&rc2_desc)==-1) { croak("FATAL: cannot register_cipher rc2"); }
246 if(register_cipher(&saferp_desc)==-1) { croak("FATAL: cannot register_cipher saferp"); }
247 if(register_cipher(&safer_k64_desc)==-1) { croak("FATAL: cannot register_cipher safer_k64"); }
248 if(register_cipher(&safer_k128_desc)==-1) { croak("FATAL: cannot register_cipher safer_k128"); }
249 if(register_cipher(&safer_sk64_desc)==-1) { croak("FATAL: cannot register_cipher safer_sk64"); }
250 if(register_cipher(&safer_sk128_desc)==-1) { croak("FATAL: cannot register_cipher safer_sk128"); }
251 if(register_cipher(&aes_desc)==-1) { croak("FATAL: cannot register_cipher aes"); }
252 if(register_cipher(&xtea_desc)==-1) { croak("FATAL: cannot register_cipher xtea"); }
253 if(register_cipher(&twofish_desc)==-1) { croak("FATAL: cannot register_cipher twofish"); }
254 if(register_cipher(&des_desc)==-1) { croak("FATAL: cannot register_cipher des"); }
255 if(register_cipher(&des3_desc)==-1) { croak("FATAL: cannot register_cipher des3"); }
256 if(register_cipher(&cast5_desc)==-1) { croak("FATAL: cannot register_cipher cast5"); }
257 if(register_cipher(&noekeon_desc)==-1) { croak("FATAL: cannot register_cipher noekeon"); }
258 if(register_cipher(&skipjack_desc)==-1) { croak("FATAL: cannot register_cipher skipjack"); }
259 if(register_cipher(&khazad_desc)==-1) { croak("FATAL: cannot register_cipher khazad"); }
260 if(register_cipher(&anubis_desc)==-1) { croak("FATAL: cannot register_cipher anubis"); }
261 if(register_cipher(&kseed_desc)==-1) { croak("FATAL: cannot register_cipher kseed"); }
262 if(register_cipher(&kasumi_desc)==-1) { croak("FATAL: cannot register_cipher kasumi"); }
263 if(register_cipher(&multi2_desc)==-1) { croak("FATAL: cannot register_cipher multi2"); }
264 if(register_cipher(&camellia_desc)==-1) { croak("FATAL: cannot register_cipher camellia"); }
265 /* --- */
266 if(register_hash(&chc_desc)==-1) { croak("FATAL: cannot register_hash chc_hash"); }
267 if(register_hash(&md2_desc)==-1) { croak("FATAL: cannot register_hash md2"); }
268 if(register_hash(&md4_desc)==-1) { croak("FATAL: cannot register_hash md4"); }
269 if(register_hash(&md5_desc)==-1) { croak("FATAL: cannot register_hash md5"); }
270 if(register_hash(&rmd128_desc)==-1) { croak("FATAL: cannot register_hash rmd128"); }
271 if(register_hash(&rmd160_desc)==-1) { croak("FATAL: cannot register_hash rmd160"); }
272 if(register_hash(&rmd256_desc)==-1) { croak("FATAL: cannot register_hash rmd256"); }
273 if(register_hash(&rmd320_desc)==-1) { croak("FATAL: cannot register_hash rmd320"); }
274 if(register_hash(&sha1_desc)==-1) { croak("FATAL: cannot register_hash sha1"); }
275 if(register_hash(&sha224_desc)==-1) { croak("FATAL: cannot register_hash sha224"); }
276 if(register_hash(&sha256_desc)==-1) { croak("FATAL: cannot register_hash sha256"); }
277 if(register_hash(&sha384_desc)==-1) { croak("FATAL: cannot register_hash sha384"); }
278 if(register_hash(&sha512_desc)==-1) { croak("FATAL: cannot register_hash sha512"); }
279 if(register_hash(&sha512_224_desc)==-1) { croak("FATAL: cannot register_hash sha512_224"); }
280 if(register_hash(&sha512_256_desc)==-1) { croak("FATAL: cannot register_hash sha512_256"); }
281 if(register_hash(&tiger_desc)==-1) { croak("FATAL: cannot register_hash tiger"); }
282 if(register_hash(&whirlpool_desc)==-1) { croak("FATAL: cannot register_hash whirlpool"); }
283 /* --- */
284 if(chc_register(find_cipher("aes"))==-1) { croak("FATAL: chc_register failed"); }
285 /* --- */
286 if(register_prng(&fortuna_desc)==-1) { croak("FATAL: cannot register_prng fortuna"); }
287 if(register_prng(&rc4_desc)==-1) { croak("FATAL: cannot register_prng rc4"); }
288 if(register_prng(&sober128_desc)==-1) { croak("FATAL: cannot register_prng sober128"); }
289 if(register_prng(&yarrow_desc)==-1) { croak("FATAL: cannot register_prng yarrow"); }
290 /* --- */
291 #ifdef TFM_DESC
292 ltc_mp = tfm_desc;
293 #else
294 ltc_mp = ltm_desc;
295 #endif
296
297 SV *
298 CryptX__encode_base64url(SV * in)
299 CODE:
300 {
301 STRLEN in_len;
302 unsigned long out_len;
303 unsigned char *out_data, *in_data;
304 int rv;
305
306 if (!SvPOK(in)) XSRETURN_UNDEF;
307 in_data = (unsigned char *) SvPVbyte(in, in_len);
308 out_len = 4 * ((in_len + 2) / 3) + 1;
309 Newz(0, out_data, out_len, unsigned char);
310 if (!out_data) croak("FATAL: Newz failed [%ld]", out_len);
311 rv = base64url_encode(in_data, (unsigned long)in_len, out_data, &out_len);
312 RETVAL = (rv == CRYPT_OK) ? newSVpvn((char *)out_data, out_len) : newSVpvn(NULL, 0);
313 Safefree(out_data);
314 }
315 OUTPUT:
316 RETVAL
317
318 SV *
319 CryptX__decode_base64url(SV * in)
320 CODE:
321 {
322 STRLEN in_len;
323 unsigned long out_len;
324 unsigned char *out_data, *in_data;
325 int rv;
326
327 if (!SvPOK(in)) XSRETURN_UNDEF;
328 in_data = (unsigned char *) SvPVbyte(in, in_len);
329 out_len = in_len;
330 Newz(0, out_data, out_len, unsigned char);
331 if (!out_data) croak("FATAL: Newz failed [%ld]", out_len);
332 rv = base64url_decode(in_data, (unsigned long)in_len, out_data, &out_len);
333 RETVAL = (rv == CRYPT_OK) ? newSVpvn((char *)out_data, out_len) : newSVpvn(NULL, 0);
334 Safefree(out_data);
335 }
336 OUTPUT:
337 RETVAL
338
339 SV *
340 CryptX__encode_base64(SV * in)
341 CODE:
342 {
343 STRLEN in_len;
344 unsigned long out_len;
345 unsigned char *out_data, *in_data;
346 int rv;
347
348 if (!SvPOK(in)) XSRETURN_UNDEF;
349 in_data = (unsigned char *) SvPVbyte(in, in_len);
350 out_len = 4 * ((in_len + 2) / 3) + 1;
351 Newz(0, out_data, out_len, unsigned char);
352 if (!out_data) croak("FATAL: Newz failed [%ld]", out_len);
353 rv = base64_encode(in_data, (unsigned long)in_len, out_data, &out_len);
354 RETVAL = (rv == CRYPT_OK) ? newSVpvn((char *)out_data, out_len) : newSVpvn(NULL, 0);
355 Safefree(out_data);
356 }
357 OUTPUT:
358 RETVAL
359
360 SV *
361 CryptX__decode_base64(SV * in)
362 CODE:
363 {
364 STRLEN in_len;
365 unsigned long out_len;
366 unsigned char *out_data, *in_data;
367 int rv;
368
369 if (!SvPOK(in)) XSRETURN_UNDEF;
370 in_data = (unsigned char *) SvPVbyte(in, in_len);
371 out_len = in_len;
372 Newz(0, out_data, out_len, unsigned char);
373 if (!out_data) croak("FATAL: Newz failed [%ld]", out_len);
374 rv = base64_decode(in_data, (unsigned long)in_len, out_data, &out_len);
375 RETVAL = (rv == CRYPT_OK) ? newSVpvn((char *)out_data, out_len) : newSVpvn(NULL, 0);
376 Safefree(out_data);
377 }
378 OUTPUT:
379 RETVAL
380
381 ###############################################################################
382
383 INCLUDE: lib/CryptX_Digest.xs.inc
384 INCLUDE: lib/CryptX_Cipher.xs.inc
385
386 INCLUDE: lib/CryptX_AuthEnc_EAX.xs.inc
387 INCLUDE: lib/CryptX_AuthEnc_GCM.xs.inc
388 INCLUDE: lib/CryptX_AuthEnc_OCB.xs.inc
389 INCLUDE: lib/CryptX_AuthEnc_CCM.xs.inc
390
391 INCLUDE: lib/CryptX_Mac_F9.xs.inc
392 INCLUDE: lib/CryptX_Mac_HMAC.xs.inc
393 INCLUDE: lib/CryptX_Mac_OMAC.xs.inc
394 INCLUDE: lib/CryptX_Mac_Pelican.xs.inc
395 INCLUDE: lib/CryptX_Mac_PMAC.xs.inc
396 INCLUDE: lib/CryptX_Mac_XCBC.xs.inc
397
398 INCLUDE: lib/CryptX_Mode_CBC.xs.inc
399 INCLUDE: lib/CryptX_Mode_ECB.xs.inc
400 INCLUDE: lib/CryptX_Mode_CFB.xs.inc
401 INCLUDE: lib/CryptX_Mode_OFB.xs.inc
402 INCLUDE: lib/CryptX_Mode_CTR.xs.inc
403 #INCLUDE: lib/CryptX_Mode_F8.xs.inc
404 #INCLUDE: lib/CryptX_Mode_LRW.xs.inc
405 #INCLUDE: lib/CryptX_Mode_XTS.xs.inc
406
407 INCLUDE: lib/CryptX_PRNG.xs.inc
408
409 INCLUDE: lib/CryptX_PK_RSA.xs.inc
410 INCLUDE: lib/CryptX_PK_DSA.xs.inc
411 INCLUDE: lib/CryptX_PK_DH.xs.inc
412 INCLUDE: lib/CryptX_PK_ECC.xs.inc
413
414 INCLUDE: lib/CryptX_KeyDerivation.xs.inc
+0
-415
lib/CryptX.xs less more
0 #include "EXTERN.h"
1 #include "perl.h"
2 #include "XSUB.h"
3
4 #define NEED_sv_2pvbyte_GLOBAL
5 #define NEED_sv_2pv_flags_GLOBAL
6 #define NEED_newRV_noinc_GLOBAL
7 #include "ppport.h"
8
9 #undef LTC_SOURCE
10 #include "tomcrypt.h"
11 #include "tommath.h"
12
13 typedef struct cipher_struct { /* used by Crypt::Cipher */
14 symmetric_key skey;
15 int id;
16 struct ltc_cipher_descriptor *desc;
17 } *Crypt__Cipher;
18
19 typedef struct digest_struct { /* used by Crypt::Digest */
20 hash_state state;
21 int id;
22 struct ltc_hash_descriptor *desc;
23 } *Crypt__Digest;
24
25 typedef struct ccm_struct { /* used by Crypt::AuthEnc::CCM */
26 int id;
27 } *Crypt__AuthEnc__CCM;
28
29 typedef struct eax_struct { /* used by Crypt::AuthEnc::EAX */
30 eax_state state;
31 int id;
32 } *Crypt__AuthEnc__EAX;
33
34 typedef struct gcm_struct { /* used by Crypt::AuthEnc::GCM */
35 gcm_state state;
36 int id;
37 } *Crypt__AuthEnc__GCM;
38
39 typedef struct ocb_struct { /* used by Crypt::AuthEnc::OCB */
40 ocb3_state state;
41 int id;
42 } *Crypt__AuthEnc__OCB;
43
44 typedef struct f9_struct { /* used by Crypt::Mac::F9 */
45 f9_state state;
46 int id;
47 } *Crypt__Mac__F9;
48
49 typedef struct hmac_struct { /* used by Crypt::Mac::HMAC */
50 hmac_state state;
51 int id;
52 } *Crypt__Mac__HMAC;
53
54 typedef struct omac_struct { /* used by Crypt::Mac::OMAC */
55 omac_state state;
56 int id;
57 } *Crypt__Mac__OMAC;
58
59 typedef struct pelican_struct { /* used by Crypt::Mac::Pelican */
60 pelican_state state;
61 int id;
62 } *Crypt__Mac__Pelican;
63
64 typedef struct pmac_struct { /* used by Crypt::Mac::PMAC */
65 pmac_state state;
66 int id;
67 } *Crypt__Mac__PMAC;
68
69 typedef struct xcbc_struct { /* used by Crypt::Mac::XCBC */
70 xcbc_state state;
71 int id;
72 } *Crypt__Mac__XCBC;
73
74 typedef struct cbc_struct { /* used by Crypt::Mode::CBC */
75 int cipher_id, cipher_rounds;
76 symmetric_CBC state;
77 unsigned char pad[MAXBLOCKSIZE];
78 int padlen;
79 int padding_mode;
80 int direction;
81 int id;
82 } *Crypt__Mode__CBC;
83
84 typedef struct ecb_struct { /* used by Crypt::Mode::ECB */
85 int cipher_id, cipher_rounds;
86 symmetric_ECB state;
87 unsigned char pad[MAXBLOCKSIZE];
88 int padlen;
89 int padding_mode;
90 int direction;
91 int id;
92 } *Crypt__Mode__ECB;
93
94 typedef struct cfb_struct { /* used by Crypt::Mode::CFB */
95 int cipher_id, cipher_rounds;
96 symmetric_CFB state;
97 int direction;
98 int id;
99 } *Crypt__Mode__CFB;
100
101 typedef struct ctr_struct { /* used by Crypt::Mode::CTR */
102 int cipher_id, cipher_rounds;
103 int ctr_mode_param;
104 symmetric_CTR state;
105 int direction;
106 int id;
107 } *Crypt__Mode__CTR;
108
109 typedef struct f8_struct { /* used by Crypt::Mode::F8 */
110 int cipher_id, cipher_rounds;
111 symmetric_F8 state;
112 int direction;
113 int id;
114 } *Crypt__Mode__F8;
115
116 typedef struct lrw_struct { /* used by Crypt::Mode::LRW */
117 int cipher_id, cipher_rounds;
118 symmetric_LRW state;
119 int direction;
120 int id;
121 } *Crypt__Mode__LRW;
122
123 typedef struct ofb_struct { /* used by Crypt::Mode::OFB */
124 int cipher_id, cipher_rounds;
125 symmetric_OFB state;
126 int direction;
127 int id;
128 } *Crypt__Mode__OFB;
129
130 typedef struct xts_struct { /* used by Crypt::Mode::XTS */
131 int cipher_id, cipher_rounds;
132 symmetric_xts state;
133 int direction;
134 int id;
135 } *Crypt__Mode__XTS;
136
137 typedef struct prng_struct { /* used by Crypt::PRNG */
138 prng_state state;
139 struct ltc_prng_descriptor *desc;
140 IV last_pid;
141 int id;
142 } *Crypt__PRNG;
143
144 typedef struct rsa_struct { /* used by Crypt::PK::RSA */
145 prng_state yarrow_prng_state;
146 int yarrow_prng_index;
147 rsa_key key;
148 int id;
149 } *Crypt__PK__RSA;
150
151 typedef struct dsa_struct { /* used by Crypt::PK::DSA */
152 prng_state yarrow_prng_state;
153 int yarrow_prng_index;
154 dsa_key key;
155 int id;
156 } *Crypt__PK__DSA;
157
158 typedef struct dh_struct { /* used by Crypt::PK::DH */
159 prng_state yarrow_prng_state;
160 int yarrow_prng_index;
161 dh_key key;
162 int id;
163 } *Crypt__PK__DH;
164
165 typedef struct ecc_struct { /* used by Crypt::PK::ECC */
166 prng_state yarrow_prng_state;
167 int yarrow_prng_index;
168 ecc_key key;
169 ltc_ecc_set_type dp;
170 int id;
171 } *Crypt__PK__ECC;
172
173 ltc_ecc_set_type* _ecc_set_dp_from_SV(ltc_ecc_set_type *dp, SV *curve)
174 {
175 HV *h;
176 SV *param, **pref;
177 SV **sv_cofactor, **sv_prime, **sv_A, **sv_B, **sv_order, **sv_Gx, **sv_Gy;
178 int err;
179 char *ch_name;
180 STRLEN l_name;
181
182 if (SvPOK(curve)) {
183 ch_name = SvPV(curve, l_name);
184 if ((h = get_hv("Crypt::PK::ECC::curve", 0)) == NULL) croak("FATAL: generate_key_ex: no curve register");
185 if ((pref = hv_fetch(h, ch_name, l_name, 0)) == NULL) croak("FATAL: generate_key_ex: unknown curve/1 '%s'", ch_name);
186 if (!SvOK(*pref)) croak("FATAL: generate_key_ex: unknown curve/2 '%s'", ch_name);
187 param = *pref;
188 }
189 else if (SvROK(curve)) {
190 param = curve;
191 ch_name = "custom";
192 }
193 else {
194 croak("FATAL: curve has to be a string or a hashref");
195 }
196
197 if ((h = (HV*)(SvRV(param))) == NULL) croak("FATAL: ecparams: param is not valid hashref");
198
199 if ((sv_prime = hv_fetchs(h, "prime", 0)) == NULL) croak("FATAL: ecparams: missing param prime");
200 if ((sv_A = hv_fetchs(h, "A", 0)) == NULL) croak("FATAL: ecparams: missing param A");
201 if ((sv_B = hv_fetchs(h, "B", 0)) == NULL) croak("FATAL: ecparams: missing param B");
202 if ((sv_order = hv_fetchs(h, "order", 0)) == NULL) croak("FATAL: ecparams: missing param order");
203 if ((sv_Gx = hv_fetchs(h, "Gx", 0)) == NULL) croak("FATAL: ecparams: missing param Gx");
204 if ((sv_Gy = hv_fetchs(h, "Gy", 0)) == NULL) croak("FATAL: ecparams: missing param Gy");
205 if ((sv_cofactor = hv_fetchs(h, "cofactor", 0)) == NULL) croak("FATAL: ecparams: missing param cofactor");
206
207 if (!SvOK(*sv_prime )) croak("FATAL: ecparams: undefined param prime");
208 if (!SvOK(*sv_A )) croak("FATAL: ecparams: undefined param A");
209 if (!SvOK(*sv_B )) croak("FATAL: ecparams: undefined param B");
210 if (!SvOK(*sv_order )) croak("FATAL: ecparams: undefined param order");
211 if (!SvOK(*sv_Gx )) croak("FATAL: ecparams: undefined param Gx");
212 if (!SvOK(*sv_Gy )) croak("FATAL: ecparams: undefined param Gy");
213 if (!SvOK(*sv_cofactor)) croak("FATAL: ecparams: undefined param cofactor");
214
215 err = ecc_dp_set( dp,
216 SvPV_nolen(*sv_prime),
217 SvPV_nolen(*sv_A),
218 SvPV_nolen(*sv_B),
219 SvPV_nolen(*sv_order),
220 SvPV_nolen(*sv_Gx),
221 SvPV_nolen(*sv_Gy),
222 (unsigned long)SvUV(*sv_cofactor),
223 ch_name );
224 return err == CRYPT_OK ? dp : NULL;
225 }
226
227 void _ecc_free_key(ecc_key *key, ltc_ecc_set_type *dp)
228 {
229 if(dp) {
230 ecc_dp_clear(dp);
231 }
232 if (key->type != -1) {
233 ecc_free(key);
234 key->type = -1;
235 key->dp = NULL;
236 }
237 }
238
239 MODULE = CryptX PACKAGE = CryptX PREFIX = CryptX_
240
241 BOOT:
242 if(register_cipher(&blowfish_desc)==-1) { croak("FATAL: cannot register_cipher blowfish"); }
243 if(register_cipher(&rc5_desc)==-1) { croak("FATAL: cannot register_cipher rc5"); }
244 if(register_cipher(&rc6_desc)==-1) { croak("FATAL: cannot register_cipher rc6"); }
245 if(register_cipher(&rc2_desc)==-1) { croak("FATAL: cannot register_cipher rc2"); }
246 if(register_cipher(&saferp_desc)==-1) { croak("FATAL: cannot register_cipher saferp"); }
247 if(register_cipher(&safer_k64_desc)==-1) { croak("FATAL: cannot register_cipher safer_k64"); }
248 if(register_cipher(&safer_k128_desc)==-1) { croak("FATAL: cannot register_cipher safer_k128"); }
249 if(register_cipher(&safer_sk64_desc)==-1) { croak("FATAL: cannot register_cipher safer_sk64"); }
250 if(register_cipher(&safer_sk128_desc)==-1) { croak("FATAL: cannot register_cipher safer_sk128"); }
251 if(register_cipher(&aes_desc)==-1) { croak("FATAL: cannot register_cipher aes"); }
252 if(register_cipher(&xtea_desc)==-1) { croak("FATAL: cannot register_cipher xtea"); }
253 if(register_cipher(&twofish_desc)==-1) { croak("FATAL: cannot register_cipher twofish"); }
254 if(register_cipher(&des_desc)==-1) { croak("FATAL: cannot register_cipher des"); }
255 if(register_cipher(&des3_desc)==-1) { croak("FATAL: cannot register_cipher des3"); }
256 if(register_cipher(&cast5_desc)==-1) { croak("FATAL: cannot register_cipher cast5"); }
257 if(register_cipher(&noekeon_desc)==-1) { croak("FATAL: cannot register_cipher noekeon"); }
258 if(register_cipher(&skipjack_desc)==-1) { croak("FATAL: cannot register_cipher skipjack"); }
259 if(register_cipher(&khazad_desc)==-1) { croak("FATAL: cannot register_cipher khazad"); }
260 if(register_cipher(&anubis_desc)==-1) { croak("FATAL: cannot register_cipher anubis"); }
261 if(register_cipher(&kseed_desc)==-1) { croak("FATAL: cannot register_cipher kseed"); }
262 if(register_cipher(&kasumi_desc)==-1) { croak("FATAL: cannot register_cipher kasumi"); }
263 if(register_cipher(&multi2_desc)==-1) { croak("FATAL: cannot register_cipher multi2"); }
264 if(register_cipher(&camellia_desc)==-1) { croak("FATAL: cannot register_cipher camellia"); }
265 /* --- */
266 if(register_hash(&chc_desc)==-1) { croak("FATAL: cannot register_hash chc_hash"); }
267 if(register_hash(&md2_desc)==-1) { croak("FATAL: cannot register_hash md2"); }
268 if(register_hash(&md4_desc)==-1) { croak("FATAL: cannot register_hash md4"); }
269 if(register_hash(&md5_desc)==-1) { croak("FATAL: cannot register_hash md5"); }
270 if(register_hash(&rmd128_desc)==-1) { croak("FATAL: cannot register_hash rmd128"); }
271 if(register_hash(&rmd160_desc)==-1) { croak("FATAL: cannot register_hash rmd160"); }
272 if(register_hash(&rmd256_desc)==-1) { croak("FATAL: cannot register_hash rmd256"); }
273 if(register_hash(&rmd320_desc)==-1) { croak("FATAL: cannot register_hash rmd320"); }
274 if(register_hash(&sha1_desc)==-1) { croak("FATAL: cannot register_hash sha1"); }
275 if(register_hash(&sha224_desc)==-1) { croak("FATAL: cannot register_hash sha224"); }
276 if(register_hash(&sha256_desc)==-1) { croak("FATAL: cannot register_hash sha256"); }
277 if(register_hash(&sha384_desc)==-1) { croak("FATAL: cannot register_hash sha384"); }
278 if(register_hash(&sha512_desc)==-1) { croak("FATAL: cannot register_hash sha512"); }
279 if(register_hash(&sha512_224_desc)==-1) { croak("FATAL: cannot register_hash sha512_224"); }
280 if(register_hash(&sha512_256_desc)==-1) { croak("FATAL: cannot register_hash sha512_256"); }
281 if(register_hash(&tiger_desc)==-1) { croak("FATAL: cannot register_hash tiger"); }
282 if(register_hash(&whirlpool_desc)==-1) { croak("FATAL: cannot register_hash whirlpool"); }
283 /* --- */
284 if(chc_register(find_cipher("aes"))==-1) { croak("FATAL: chc_register failed"); }
285 /* --- */
286 if(register_prng(&fortuna_desc)==-1) { croak("FATAL: cannot register_prng fortuna"); }
287 if(register_prng(&rc4_desc)==-1) { croak("FATAL: cannot register_prng rc4"); }
288 if(register_prng(&sober128_desc)==-1) { croak("FATAL: cannot register_prng sober128"); }
289 if(register_prng(&yarrow_desc)==-1) { croak("FATAL: cannot register_prng yarrow"); }
290 /* --- */
291 #ifdef TFM_DESC
292 ltc_mp = tfm_desc;
293 #else
294 ltc_mp = ltm_desc;
295 #endif
296
297 SV *
298 CryptX__encode_base64url(SV * in)
299 CODE:
300 {
301 STRLEN in_len;
302 unsigned long out_len;
303 unsigned char *out_data, *in_data;
304 int rv;
305
306 if (!SvPOK(in)) XSRETURN_UNDEF;
307 in_data = (unsigned char *) SvPVbyte(in, in_len);
308 out_len = 4 * ((in_len + 2) / 3) + 1;
309 Newz(0, out_data, out_len, unsigned char);
310 if (!out_data) croak("FATAL: Newz failed [%ld]", out_len);
311 rv = base64url_encode(in_data, (unsigned long)in_len, out_data, &out_len);
312 RETVAL = (rv == CRYPT_OK) ? newSVpvn((char *)out_data, out_len) : newSVpvn(NULL, 0);
313 Safefree(out_data);
314 }
315 OUTPUT:
316 RETVAL
317
318 SV *
319 CryptX__decode_base64url(SV * in)
320 CODE:
321 {
322 STRLEN in_len;
323 unsigned long out_len;
324 unsigned char *out_data, *in_data;
325 int rv;
326
327 if (!SvPOK(in)) XSRETURN_UNDEF;
328 in_data = (unsigned char *) SvPVbyte(in, in_len);
329 out_len = in_len;
330 Newz(0, out_data, out_len, unsigned char);
331 if (!out_data) croak("FATAL: Newz failed [%ld]", out_len);
332 rv = base64url_decode(in_data, (unsigned long)in_len, out_data, &out_len);
333 RETVAL = (rv == CRYPT_OK) ? newSVpvn((char *)out_data, out_len) : newSVpvn(NULL, 0);
334 Safefree(out_data);
335 }
336 OUTPUT:
337 RETVAL
338
339 SV *
340 CryptX__encode_base64(SV * in)
341 CODE:
342 {
343 STRLEN in_len;
344 unsigned long out_len;
345 unsigned char *out_data, *in_data;
346 int rv;
347
348 if (!SvPOK(in)) XSRETURN_UNDEF;
349 in_data = (unsigned char *) SvPVbyte(in, in_len);
350 out_len = 4 * ((in_len + 2) / 3) + 1;
351 Newz(0, out_data, out_len, unsigned char);
352 if (!out_data) croak("FATAL: Newz failed [%ld]", out_len);
353 rv = base64_encode(in_data, (unsigned long)in_len, out_data, &out_len);
354 RETVAL = (rv == CRYPT_OK) ? newSVpvn((char *)out_data, out_len) : newSVpvn(NULL, 0);
355 Safefree(out_data);
356 }
357 OUTPUT:
358 RETVAL
359
360 SV *
361 CryptX__decode_base64(SV * in)
362 CODE:
363 {
364 STRLEN in_len;
365 unsigned long out_len;
366 unsigned char *out_data, *in_data;
367 int rv;
368
369 if (!SvPOK(in)) XSRETURN_UNDEF;
370 in_data = (unsigned char *) SvPVbyte(in, in_len);
371 out_len = in_len;
372 Newz(0, out_data, out_len, unsigned char);
373 if (!out_data) croak("FATAL: Newz failed [%ld]", out_len);
374 rv = base64_decode(in_data, (unsigned long)in_len, out_data, &out_len);
375 RETVAL = (rv == CRYPT_OK) ? newSVpvn((char *)out_data, out_len) : newSVpvn(NULL, 0);
376 Safefree(out_data);
377 }
378 OUTPUT:
379 RETVAL
380
381 ###############################################################################
382
383 INCLUDE: CryptX_Digest.xs.inc
384 INCLUDE: CryptX_Cipher.xs.inc
385
386 INCLUDE: CryptX_AuthEnc_EAX.xs.inc
387 INCLUDE: CryptX_AuthEnc_GCM.xs.inc
388 INCLUDE: CryptX_AuthEnc_OCB.xs.inc
389 INCLUDE: CryptX_AuthEnc_CCM.xs.inc
390
391 INCLUDE: CryptX_Mac_F9.xs.inc
392 INCLUDE: CryptX_Mac_HMAC.xs.inc
393 INCLUDE: CryptX_Mac_OMAC.xs.inc
394 INCLUDE: CryptX_Mac_Pelican.xs.inc
395 INCLUDE: CryptX_Mac_PMAC.xs.inc
396 INCLUDE: CryptX_Mac_XCBC.xs.inc
397
398 INCLUDE: CryptX_Mode_CBC.xs.inc
399 INCLUDE: CryptX_Mode_ECB.xs.inc
400 INCLUDE: CryptX_Mode_CFB.xs.inc
401 INCLUDE: CryptX_Mode_OFB.xs.inc
402 INCLUDE: CryptX_Mode_CTR.xs.inc
403 #INCLUDE: CryptX_Mode_F8.xs.inc
404 #INCLUDE: CryptX_Mode_LRW.xs.inc
405 #INCLUDE: CryptX_Mode_XTS.xs.inc
406
407 INCLUDE: CryptX_PRNG.xs.inc
408
409 INCLUDE: CryptX_PK_RSA.xs.inc
410 INCLUDE: CryptX_PK_DSA.xs.inc
411 INCLUDE: CryptX_PK_DH.xs.inc
412 INCLUDE: CryptX_PK_ECC.xs.inc
413
414 INCLUDE: CryptX_KeyDerivation.xs.inc
+0
-7748
lib/ppport.h less more
0 #if 0
1 <<'SKIP';
2 #endif
3 /*
4 ----------------------------------------------------------------------
5
6 ppport.h -- Perl/Pollution/Portability Version 3.31
7
8 Automatically created by Devel::PPPort running under perl 5.018002.
9
10 Do NOT edit this file directly! -- Edit PPPort_pm.PL and the
11 includes in parts/inc/ instead.
12
13 Use 'perldoc ppport.h' to view the documentation below.
14
15 ----------------------------------------------------------------------
16
17 SKIP
18
19 =pod
20
21 =head1 NAME
22
23 ppport.h - Perl/Pollution/Portability version 3.31
24
25 =head1 SYNOPSIS
26
27 perl ppport.h [options] [source files]
28
29 Searches current directory for files if no [source files] are given
30
31 --help show short help
32
33 --version show version
34
35 --patch=file write one patch file with changes
36 --copy=suffix write changed copies with suffix
37 --diff=program use diff program and options
38
39 --compat-version=version provide compatibility with Perl version
40 --cplusplus accept C++ comments
41
42 --quiet don't output anything except fatal errors
43 --nodiag don't show diagnostics
44 --nohints don't show hints
45 --nochanges don't suggest changes
46 --nofilter don't filter input files
47
48 --strip strip all script and doc functionality from
49 ppport.h
50
51 --list-provided list provided API
52 --list-unsupported list unsupported API
53 --api-info=name show Perl API portability information
54
55 =head1 COMPATIBILITY
56
57 This version of F<ppport.h> is designed to support operation with Perl
58 installations back to 5.003, and has been tested up to 5.20.
59
60 =head1 OPTIONS
61
62 =head2 --help
63
64 Display a brief usage summary.
65
66 =head2 --version
67
68 Display the version of F<ppport.h>.
69
70 =head2 --patch=I<file>
71
72 If this option is given, a single patch file will be created if
73 any changes are suggested. This requires a working diff program
74 to be installed on your system.
75
76 =head2 --copy=I<suffix>
77
78 If this option is given, a copy of each file will be saved with
79 the given suffix that contains the suggested changes. This does
80 not require any external programs. Note that this does not
81 automagically add a dot between the original filename and the
82 suffix. If you want the dot, you have to include it in the option
83 argument.
84
85 If neither C<--patch> or C<--copy> are given, the default is to
86 simply print the diffs for each file. This requires either
87 C<Text::Diff> or a C<diff> program to be installed.
88
89 =head2 --diff=I<program>
90
91 Manually set the diff program and options to use. The default
92 is to use C<Text::Diff>, when installed, and output unified
93 context diffs.
94
95 =head2 --compat-version=I<version>
96
97 Tell F<ppport.h> to check for compatibility with the given
98 Perl version. The default is to check for compatibility with Perl
99 version 5.003. You can use this option to reduce the output
100 of F<ppport.h> if you intend to be backward compatible only
101 down to a certain Perl version.
102
103 =head2 --cplusplus
104
105 Usually, F<ppport.h> will detect C++ style comments and
106 replace them with C style comments for portability reasons.
107 Using this option instructs F<ppport.h> to leave C++
108 comments untouched.
109
110 =head2 --quiet
111
112 Be quiet. Don't print anything except fatal errors.
113
114 =head2 --nodiag
115
116 Don't output any diagnostic messages. Only portability
117 alerts will be printed.
118
119 =head2 --nohints
120
121 Don't output any hints. Hints often contain useful portability
122 notes. Warnings will still be displayed.
123
124 =head2 --nochanges
125
126 Don't suggest any changes. Only give diagnostic output and hints
127 unless these are also deactivated.
128
129 =head2 --nofilter
130
131 Don't filter the list of input files. By default, files not looking
132 like source code (i.e. not *.xs, *.c, *.cc, *.cpp or *.h) are skipped.
133
134 =head2 --strip
135
136 Strip all script and documentation functionality from F<ppport.h>.
137 This reduces the size of F<ppport.h> dramatically and may be useful
138 if you want to include F<ppport.h> in smaller modules without
139 increasing their distribution size too much.
140
141 The stripped F<ppport.h> will have a C<--unstrip> option that allows
142 you to undo the stripping, but only if an appropriate C<Devel::PPPort>
143 module is installed.
144
145 =head2 --list-provided
146
147 Lists the API elements for which compatibility is provided by
148 F<ppport.h>. Also lists if it must be explicitly requested,
149 if it has dependencies, and if there are hints or warnings for it.
150
151 =head2 --list-unsupported
152
153 Lists the API elements that are known not to be supported by
154 F<ppport.h> and below which version of Perl they probably
155 won't be available or work.
156
157 =head2 --api-info=I<name>
158
159 Show portability information for API elements matching I<name>.
160 If I<name> is surrounded by slashes, it is interpreted as a regular
161 expression.
162
163 =head1 DESCRIPTION
164
165 In order for a Perl extension (XS) module to be as portable as possible
166 across differing versions of Perl itself, certain steps need to be taken.
167
168 =over 4
169
170 =item *
171
172 Including this header is the first major one. This alone will give you
173 access to a large part of the Perl API that hasn't been available in
174 earlier Perl releases. Use
175
176 perl ppport.h --list-provided
177
178 to see which API elements are provided by ppport.h.
179
180 =item *
181
182 You should avoid using deprecated parts of the API. For example, using
183 global Perl variables without the C<PL_> prefix is deprecated. Also,
184 some API functions used to have a C<perl_> prefix. Using this form is
185 also deprecated. You can safely use the supported API, as F<ppport.h>
186 will provide wrappers for older Perl versions.
187
188 =item *
189
190 If you use one of a few functions or variables that were not present in
191 earlier versions of Perl, and that can't be provided using a macro, you
192 have to explicitly request support for these functions by adding one or
193 more C<#define>s in your source code before the inclusion of F<ppport.h>.
194
195 These functions or variables will be marked C<explicit> in the list shown
196 by C<--list-provided>.
197
198 Depending on whether you module has a single or multiple files that
199 use such functions or variables, you want either C<static> or global
200 variants.
201
202 For a C<static> function or variable (used only in a single source
203 file), use:
204
205 #define NEED_function
206 #define NEED_variable
207
208 For a global function or variable (used in multiple source files),
209 use:
210
211 #define NEED_function_GLOBAL
212 #define NEED_variable_GLOBAL
213
214 Note that you mustn't have more than one global request for the
215 same function or variable in your project.
216
217 Function / Variable Static Request Global Request
218 -----------------------------------------------------------------------------------------
219 PL_parser NEED_PL_parser NEED_PL_parser_GLOBAL
220 PL_signals NEED_PL_signals NEED_PL_signals_GLOBAL
221 caller_cx() NEED_caller_cx NEED_caller_cx_GLOBAL
222 eval_pv() NEED_eval_pv NEED_eval_pv_GLOBAL
223 grok_bin() NEED_grok_bin NEED_grok_bin_GLOBAL
224 grok_hex() NEED_grok_hex NEED_grok_hex_GLOBAL
225 grok_number() NEED_grok_number NEED_grok_number_GLOBAL
226 grok_numeric_radix() NEED_grok_numeric_radix NEED_grok_numeric_radix_GLOBAL
227 grok_oct() NEED_grok_oct NEED_grok_oct_GLOBAL
228 load_module() NEED_load_module NEED_load_module_GLOBAL
229 mg_findext() NEED_mg_findext NEED_mg_findext_GLOBAL
230 my_snprintf() NEED_my_snprintf NEED_my_snprintf_GLOBAL
231 my_sprintf() NEED_my_sprintf NEED_my_sprintf_GLOBAL
232 my_strlcat() NEED_my_strlcat NEED_my_strlcat_GLOBAL
233 my_strlcpy() NEED_my_strlcpy NEED_my_strlcpy_GLOBAL
234 newCONSTSUB() NEED_newCONSTSUB NEED_newCONSTSUB_GLOBAL
235 newRV_noinc() NEED_newRV_noinc NEED_newRV_noinc_GLOBAL
236 newSV_type() NEED_newSV_type NEED_newSV_type_GLOBAL
237 newSVpvn_flags() NEED_newSVpvn_flags NEED_newSVpvn_flags_GLOBAL
238 newSVpvn_share() NEED_newSVpvn_share NEED_newSVpvn_share_GLOBAL
239 pv_display() NEED_pv_display NEED_pv_display_GLOBAL
240 pv_escape() NEED_pv_escape NEED_pv_escape_GLOBAL
241 pv_pretty() NEED_pv_pretty NEED_pv_pretty_GLOBAL
242 sv_2pv_flags() NEED_sv_2pv_flags NEED_sv_2pv_flags_GLOBAL
243 sv_2pvbyte() NEED_sv_2pvbyte NEED_sv_2pvbyte_GLOBAL
244 sv_catpvf_mg() NEED_sv_catpvf_mg NEED_sv_catpvf_mg_GLOBAL
245 sv_catpvf_mg_nocontext() NEED_sv_catpvf_mg_nocontext NEED_sv_catpvf_mg_nocontext_GLOBAL
246 sv_pvn_force_flags() NEED_sv_pvn_force_flags NEED_sv_pvn_force_flags_GLOBAL
247 sv_setpvf_mg() NEED_sv_setpvf_mg NEED_sv_setpvf_mg_GLOBAL
248 sv_setpvf_mg_nocontext() NEED_sv_setpvf_mg_nocontext NEED_sv_setpvf_mg_nocontext_GLOBAL
249 sv_unmagicext() NEED_sv_unmagicext NEED_sv_unmagicext_GLOBAL
250 vload_module() NEED_vload_module NEED_vload_module_GLOBAL
251 vnewSVpvf() NEED_vnewSVpvf NEED_vnewSVpvf_GLOBAL
252 warner() NEED_warner NEED_warner_GLOBAL
253
254 To avoid namespace conflicts, you can change the namespace of the
255 explicitly exported functions / variables using the C<DPPP_NAMESPACE>
256 macro. Just C<#define> the macro before including C<ppport.h>:
257
258 #define DPPP_NAMESPACE MyOwnNamespace_
259 #include "ppport.h"
260
261 The default namespace is C<DPPP_>.
262
263 =back
264
265 The good thing is that most of the above can be checked by running
266 F<ppport.h> on your source code. See the next section for
267 details.
268
269 =head1 EXAMPLES
270
271 To verify whether F<ppport.h> is needed for your module, whether you
272 should make any changes to your code, and whether any special defines
273 should be used, F<ppport.h> can be run as a Perl script to check your
274 source code. Simply say:
275
276 perl ppport.h
277
278 The result will usually be a list of patches suggesting changes
279 that should at least be acceptable, if not necessarily the most
280 efficient solution, or a fix for all possible problems.
281
282 If you know that your XS module uses features only available in
283 newer Perl releases, if you're aware that it uses C++ comments,
284 and if you want all suggestions as a single patch file, you could
285 use something like this:
286
287 perl ppport.h --compat-version=5.6.0 --cplusplus --patch=test.diff
288
289 If you only want your code to be scanned without any suggestions
290 for changes, use:
291
292 perl ppport.h --nochanges
293
294 You can specify a different C<diff> program or options, using
295 the C<--diff> option:
296
297 perl ppport.h --diff='diff -C 10'
298
299 This would output context diffs with 10 lines of context.
300
301 If you want to create patched copies of your files instead, use:
302
303 perl ppport.h --copy=.new
304
305 To display portability information for the C<newSVpvn> function,
306 use:
307
308 perl ppport.h --api-info=newSVpvn
309
310 Since the argument to C<--api-info> can be a regular expression,
311 you can use
312
313 perl ppport.h --api-info=/_nomg$/
314
315 to display portability information for all C<_nomg> functions or
316
317 perl ppport.h --api-info=/./
318
319 to display information for all known API elements.
320
321 =head1 BUGS
322
323 If this version of F<ppport.h> is causing failure during
324 the compilation of this module, please check if newer versions
325 of either this module or C<Devel::PPPort> are available on CPAN
326 before sending a bug report.
327
328 If F<ppport.h> was generated using the latest version of
329 C<Devel::PPPort> and is causing failure of this module, please
330 file a bug report here: L<https://github.com/mhx/Devel-PPPort/issues/>
331
332 Please include the following information:
333
334 =over 4
335
336 =item 1.
337
338 The complete output from running "perl -V"
339
340 =item 2.
341
342 This file.
343
344 =item 3.
345
346 The name and version of the module you were trying to build.
347
348 =item 4.
349
350 A full log of the build that failed.
351
352 =item 5.
353
354 Any other information that you think could be relevant.
355
356 =back
357
358 For the latest version of this code, please get the C<Devel::PPPort>
359 module from CPAN.
360
361 =head1 COPYRIGHT
362
363 Version 3.x, Copyright (c) 2004-2013, Marcus Holland-Moritz.
364
365 Version 2.x, Copyright (C) 2001, Paul Marquess.
366
367 Version 1.x, Copyright (C) 1999, Kenneth Albanowski.
368
369 This program is free software; you can redistribute it and/or
370 modify it under the same terms as Perl itself.
371
372 =head1 SEE ALSO
373
374 See L<Devel::PPPort>.
375
376 =cut
377
378 use strict;
379
380 # Disable broken TRIE-optimization
381 BEGIN { eval '${^RE_TRIE_MAXBUF} = -1' if $] >= 5.009004 && $] <= 5.009005 }
382
383 my $VERSION = 3.31;
384
385 my %opt = (
386 quiet => 0,
387 diag => 1,
388 hints => 1,
389 changes => 1,
390 cplusplus => 0,
391 filter => 1,
392 strip => 0,
393 version => 0,
394 );
395
396 my($ppport) = $0 =~ /([\w.]+)$/;
397 my $LF = '(?:\r\n|[\r\n])'; # line feed
398 my $HS = "[ \t]"; # horizontal whitespace
399
400 # Never use C comments in this file!
401 my $ccs = '/'.'*';
402 my $cce = '*'.'/';
403 my $rccs = quotemeta $ccs;
404 my $rcce = quotemeta $cce;
405
406 eval {
407 require Getopt::Long;
408 Getopt::Long::GetOptions(\%opt, qw(
409 help quiet diag! filter! hints! changes! cplusplus strip version
410 patch=s copy=s diff=s compat-version=s
411 list-provided list-unsupported api-info=s
412 )) or usage();
413 };
414
415 if ($@ and grep /^-/, @ARGV) {
416 usage() if "@ARGV" =~ /^--?h(?:elp)?$/;
417 die "Getopt::Long not found. Please don't use any options.\n";
418 }
419
420 if ($opt{version}) {
421 print "This is $0 $VERSION.\n";
422 exit 0;
423 }
424
425 usage() if $opt{help};
426 strip() if $opt{strip};
427
428 if (exists $opt{'compat-version'}) {
429 my($r,$v,$s) = eval { parse_version($opt{'compat-version'}) };
430 if ($@) {
431 die "Invalid version number format: '$opt{'compat-version'}'\n";
432 }
433 die "Only Perl 5 is supported\n" if $r != 5;
434 die "Invalid version number: $opt{'compat-version'}\n" if $v >= 1000 || $s >= 1000;
435 $opt{'compat-version'} = sprintf "%d.%03d%03d", $r, $v, $s;
436 }
437 else {
438 $opt{'compat-version'} = 5;
439 }
440
441 my %API = map { /^(\w+)\|([^|]*)\|([^|]*)\|(\w*)$/
442 ? ( $1 => {
443 ($2 ? ( base => $2 ) : ()),
444 ($3 ? ( todo => $3 ) : ()),
445 (index($4, 'v') >= 0 ? ( varargs => 1 ) : ()),
446 (index($4, 'p') >= 0 ? ( provided => 1 ) : ()),
447 (index($4, 'n') >= 0 ? ( nothxarg => 1 ) : ()),
448 } )
449 : die "invalid spec: $_" } qw(
450 ASCII_TO_NEED||5.007001|n
451 AvFILLp|5.004050||p
452 AvFILL|||
453 BhkDISABLE||5.021008|
454 BhkENABLE||5.021008|
455 BhkENTRY_set||5.021008|
456 BhkENTRY|||
457 BhkFLAGS|||
458 CALL_BLOCK_HOOKS|||
459 CLASS|||n
460 CPERLscope|5.005000||p
461 CX_CURPAD_SAVE|||
462 CX_CURPAD_SV|||
463 CopFILEAV|5.006000||p
464 CopFILEGV_set|5.006000||p
465 CopFILEGV|5.006000||p
466 CopFILESV|5.006000||p
467 CopFILE_set|5.006000||p
468 CopFILE|5.006000||p
469 CopSTASHPV_set|5.006000||p
470 CopSTASHPV|5.006000||p
471 CopSTASH_eq|5.006000||p
472 CopSTASH_set|5.006000||p
473 CopSTASH|5.006000||p
474 CopyD|5.009002|5.004050|p
475 Copy|||
476 CvPADLIST||5.008001|
477 CvSTASH|||
478 CvWEAKOUTSIDE|||
479 DEFSV_set|5.010001||p
480 DEFSV|5.004050||p
481 END_EXTERN_C|5.005000||p
482 ENTER|||
483 ERRSV|5.004050||p
484 EXTEND|||
485 EXTERN_C|5.005000||p
486 F0convert|||n
487 FREETMPS|||
488 GIMME_V||5.004000|n
489 GIMME|||n
490 GROK_NUMERIC_RADIX|5.007002||p
491 G_ARRAY|||
492 G_DISCARD|||
493 G_EVAL|||
494 G_METHOD|5.006001||p
495 G_NOARGS|||
496 G_SCALAR|||
497 G_VOID||5.004000|
498 GetVars|||
499 GvAV|||
500 GvCV|||
501 GvHV|||
502 GvSVn|5.009003||p
503 GvSV|||
504 Gv_AMupdate||5.011000|
505 HEf_SVKEY|5.003070||p
506 HeHASH||5.003070|
507 HeKEY||5.003070|
508 HeKLEN||5.003070|
509 HePV||5.004000|
510 HeSVKEY_force||5.003070|
511 HeSVKEY_set||5.004000|
512 HeSVKEY||5.003070|
513 HeUTF8|5.010001|5.008000|p
514 HeVAL||5.003070|
515 HvENAMELEN||5.015004|
516 HvENAMEUTF8||5.015004|
517 HvENAME||5.013007|
518 HvNAMELEN_get|5.009003||p
519 HvNAMELEN||5.015004|
520 HvNAMEUTF8||5.015004|
521 HvNAME_get|5.009003||p
522 HvNAME|||
523 INT2PTR|5.006000||p
524 IN_LOCALE_COMPILETIME|5.007002||p
525 IN_LOCALE_RUNTIME|5.007002||p
526 IN_LOCALE|5.007002||p
527 IN_PERL_COMPILETIME|5.008001||p
528 IS_NUMBER_GREATER_THAN_UV_MAX|5.007002||p
529 IS_NUMBER_INFINITY|5.007002||p
530 IS_NUMBER_IN_UV|5.007002||p
531 IS_NUMBER_NAN|5.007003||p
532 IS_NUMBER_NEG|5.007002||p
533 IS_NUMBER_NOT_INT|5.007002||p
534 IVSIZE|5.006000||p
535 IVTYPE|5.006000||p
536 IVdf|5.006000||p
537 LEAVE|||
538 LINKLIST||5.013006|
539 LVRET|||
540 MARK|||
541 MULTICALL||5.021008|
542 MUTABLE_PTR|5.010001||p
543 MUTABLE_SV|5.010001||p
544 MY_CXT_CLONE|5.009002||p
545 MY_CXT_INIT|5.007003||p
546 MY_CXT|5.007003||p
547 MoveD|5.009002|5.004050|p
548 Move|||
549 NATIVE_TO_NEED||5.007001|n
550 NOOP|5.005000||p
551 NUM2PTR|5.006000||p
552 NVTYPE|5.006000||p
553 NVef|5.006001||p
554 NVff|5.006001||p
555 NVgf|5.006001||p
556 Newxc|5.009003||p
557 Newxz|5.009003||p
558 Newx|5.009003||p
559 Nullav|||
560 Nullch|||
561 Nullcv|||
562 Nullhv|||
563 Nullsv|||
564 OP_CLASS||5.013007|
565 OP_DESC||5.007003|
566 OP_NAME||5.007003|
567 OP_TYPE_IS_OR_WAS||5.019010|
568 OP_TYPE_IS||5.019007|
569 ORIGMARK|||
570 OpHAS_SIBLING||5.021007|
571 OpSIBLING_set||5.021007|
572 OpSIBLING||5.021007|
573 PAD_BASE_SV|||
574 PAD_CLONE_VARS|||
575 PAD_COMPNAME_FLAGS|||
576 PAD_COMPNAME_GEN_set|||
577 PAD_COMPNAME_GEN|||
578 PAD_COMPNAME_OURSTASH|||
579 PAD_COMPNAME_PV|||
580 PAD_COMPNAME_TYPE|||
581 PAD_RESTORE_LOCAL|||
582 PAD_SAVE_LOCAL|||
583 PAD_SAVE_SETNULLPAD|||
584 PAD_SETSV|||
585 PAD_SET_CUR_NOSAVE|||
586 PAD_SET_CUR|||
587 PAD_SVl|||
588 PAD_SV|||
589 PERLIO_FUNCS_CAST|5.009003||p
590 PERLIO_FUNCS_DECL|5.009003||p
591 PERL_ABS|5.008001||p
592 PERL_BCDVERSION|5.021008||p
593 PERL_GCC_BRACE_GROUPS_FORBIDDEN|5.008001||p
594 PERL_HASH|5.003070||p
595 PERL_INT_MAX|5.003070||p
596 PERL_INT_MIN|5.003070||p
597 PERL_LONG_MAX|5.003070||p
598 PERL_LONG_MIN|5.003070||p
599 PERL_MAGIC_arylen|5.007002||p
600 PERL_MAGIC_backref|5.007002||p
601 PERL_MAGIC_bm|5.007002||p
602 PERL_MAGIC_collxfrm|5.007002||p
603 PERL_MAGIC_dbfile|5.007002||p
604 PERL_MAGIC_dbline|5.007002||p
605 PERL_MAGIC_defelem|5.007002||p
606 PERL_MAGIC_envelem|5.007002||p
607 PERL_MAGIC_env|5.007002||p
608 PERL_MAGIC_ext|5.007002||p
609 PERL_MAGIC_fm|5.007002||p
610 PERL_MAGIC_glob|5.021008||p
611 PERL_MAGIC_isaelem|5.007002||p
612 PERL_MAGIC_isa|5.007002||p
613 PERL_MAGIC_mutex|5.021008||p
614 PERL_MAGIC_nkeys|5.007002||p
615 PERL_MAGIC_overload_elem|5.021008||p
616 PERL_MAGIC_overload_table|5.007002||p
617 PERL_MAGIC_overload|5.021008||p
618 PERL_MAGIC_pos|5.007002||p
619 PERL_MAGIC_qr|5.007002||p
620 PERL_MAGIC_regdata|5.007002||p
621 PERL_MAGIC_regdatum|5.007002||p
622 PERL_MAGIC_regex_global|5.007002||p
623 PERL_MAGIC_shared_scalar|5.007003||p
624 PERL_MAGIC_shared|5.007003||p
625 PERL_MAGIC_sigelem|5.007002||p
626 PERL_MAGIC_sig|5.007002||p
627 PERL_MAGIC_substr|5.007002||p
628 PERL_MAGIC_sv|5.007002||p
629 PERL_MAGIC_taint|5.007002||p
630 PERL_MAGIC_tiedelem|5.007002||p
631 PERL_MAGIC_tiedscalar|5.007002||p
632 PERL_MAGIC_tied|5.007002||p
633 PERL_MAGIC_utf8|5.008001||p
634 PERL_MAGIC_uvar_elem|5.007003||p
635 PERL_MAGIC_uvar|5.007002||p
636 PERL_MAGIC_vec|5.007002||p
637 PERL_MAGIC_vstring|5.008001||p
638 PERL_PV_ESCAPE_ALL|5.009004||p
639 PERL_PV_ESCAPE_FIRSTCHAR|5.009004||p
640 PERL_PV_ESCAPE_NOBACKSLASH|5.009004||p
641 PERL_PV_ESCAPE_NOCLEAR|5.009004||p
642 PERL_PV_ESCAPE_QUOTE|5.009004||p
643 PERL_PV_ESCAPE_RE|5.009005||p
644 PERL_PV_ESCAPE_UNI_DETECT|5.009004||p
645 PERL_PV_ESCAPE_UNI|5.009004||p
646 PERL_PV_PRETTY_DUMP|5.009004||p
647 PERL_PV_PRETTY_ELLIPSES|5.010000||p
648 PERL_PV_PRETTY_LTGT|5.009004||p
649 PERL_PV_PRETTY_NOCLEAR|5.010000||p
650 PERL_PV_PRETTY_QUOTE|5.009004||p
651 PERL_PV_PRETTY_REGPROP|5.009004||p
652 PERL_QUAD_MAX|5.003070||p
653 PERL_QUAD_MIN|5.003070||p
654 PERL_REVISION|5.006000||p
655 PERL_SCAN_ALLOW_UNDERSCORES|5.007003||p
656 PERL_SCAN_DISALLOW_PREFIX|5.007003||p
657 PERL_SCAN_GREATER_THAN_UV_MAX|5.007003||p
658 PERL_SCAN_SILENT_ILLDIGIT|5.008001||p
659 PERL_SHORT_MAX|5.003070||p
660 PERL_SHORT_MIN|5.003070||p
661 PERL_SIGNALS_UNSAFE_FLAG|5.008001||p
662 PERL_SUBVERSION|5.006000||p
663 PERL_SYS_INIT3||5.006000|
664 PERL_SYS_INIT|||
665 PERL_SYS_TERM||5.021008|
666 PERL_UCHAR_MAX|5.003070||p
667 PERL_UCHAR_MIN|5.003070||p
668 PERL_UINT_MAX|5.003070||p
669 PERL_UINT_MIN|5.003070||p
670 PERL_ULONG_MAX|5.003070||p
671 PERL_ULONG_MIN|5.003070||p
672 PERL_UNUSED_ARG|5.009003||p
673 PERL_UNUSED_CONTEXT|5.009004||p
674 PERL_UNUSED_DECL|5.007002||p
675 PERL_UNUSED_VAR|5.007002||p
676 PERL_UQUAD_MAX|5.003070||p
677 PERL_UQUAD_MIN|5.003070||p
678 PERL_USE_GCC_BRACE_GROUPS|5.009004||p
679 PERL_USHORT_MAX|5.003070||p
680 PERL_USHORT_MIN|5.003070||p
681 PERL_VERSION|5.006000||p
682 PL_DBsignal|5.005000||p
683 PL_DBsingle|||pn
684 PL_DBsub|||pn
685 PL_DBtrace|||pn
686 PL_Sv|5.005000||p
687 PL_bufend|5.021008||p
688 PL_bufptr|5.021008||p
689 PL_check||5.006000|
690 PL_compiling|5.004050||p
691 PL_comppad_name||5.017004|
692 PL_comppad||5.008001|
693 PL_copline|5.021008||p
694 PL_curcop|5.004050||p
695 PL_curpad||5.005000|
696 PL_curstash|5.004050||p
697 PL_debstash|5.004050||p
698 PL_defgv|5.004050||p
699 PL_diehook|5.004050||p
700 PL_dirty|5.004050||p
701 PL_dowarn|||pn
702 PL_errgv|5.004050||p
703 PL_error_count|5.021008||p
704 PL_expect|5.021008||p
705 PL_hexdigit|5.005000||p
706 PL_hints|5.005000||p
707 PL_in_my_stash|5.021008||p
708 PL_in_my|5.021008||p
709 PL_keyword_plugin||5.011002|
710 PL_last_in_gv|||n
711 PL_laststatval|5.005000||p
712 PL_lex_state|5.021008||p
713 PL_lex_stuff|5.021008||p
714 PL_linestr|5.021008||p
715 PL_modglobal||5.005000|n
716 PL_na|5.004050||pn
717 PL_no_modify|5.006000||p
718 PL_ofsgv|||n
719 PL_opfreehook||5.011000|n
720 PL_parser|5.009005||p
721 PL_peepp||5.007003|n
722 PL_perl_destruct_level|5.004050||p
723 PL_perldb|5.004050||p
724 PL_ppaddr|5.006000||p
725 PL_rpeepp||5.013005|n
726 PL_rsfp_filters|5.021008||p
727 PL_rsfp|5.021008||p
728 PL_rs|||n
729 PL_signals|5.008001||p
730 PL_stack_base|5.004050||p
731 PL_stack_sp|5.004050||p
732 PL_statcache|5.005000||p
733 PL_stdingv|5.004050||p
734 PL_sv_arenaroot|5.004050||p
735 PL_sv_no|5.004050||pn
736 PL_sv_undef|5.004050||pn
737 PL_sv_yes|5.004050||pn
738 PL_tainted|5.004050||p
739 PL_tainting|5.004050||p
740 PL_tokenbuf|5.021008||p
741 POP_MULTICALL||5.021008|
742 POPi|||n
743 POPl|||n
744 POPn|||n
745 POPpbytex||5.007001|n
746 POPpx||5.005030|n
747 POPp|||n
748 POPs|||n
749 PTR2IV|5.006000||p
750 PTR2NV|5.006000||p
751 PTR2UV|5.006000||p
752 PTR2nat|5.009003||p
753 PTR2ul|5.007001||p
754 PTRV|5.006000||p
755 PUSHMARK|||
756 PUSH_MULTICALL||5.021008|
757 PUSHi|||
758 PUSHmortal|5.009002||p
759 PUSHn|||
760 PUSHp|||
761 PUSHs|||
762 PUSHu|5.004000||p
763 PUTBACK|||
764 PadARRAY||5.021008|
765 PadMAX||5.021008|
766 PadlistARRAY||5.021008|
767 PadlistMAX||5.021008|
768 PadlistNAMESARRAY||5.021008|
769 PadlistNAMESMAX||5.021008|
770 PadlistNAMES||5.021008|
771 PadlistREFCNT||5.017004|
772 PadnameIsOUR|||
773 PadnameIsSTATE|||
774 PadnameLEN||5.021008|
775 PadnameOURSTASH|||
776 PadnameOUTER|||
777 PadnamePV||5.021008|
778 PadnameREFCNT_dec||5.021008|
779 PadnameREFCNT||5.021008|
780 PadnameSV||5.021008|
781 PadnameTYPE|||
782 PadnameUTF8||5.021007|
783 PadnamelistARRAY||5.021008|
784 PadnamelistMAX||5.021008|
785 PadnamelistREFCNT_dec||5.021008|
786 PadnamelistREFCNT||5.021008|
787 PerlIO_clearerr||5.007003|
788 PerlIO_close||5.007003|
789 PerlIO_context_layers||5.009004|
790 PerlIO_eof||5.007003|
791 PerlIO_error||5.007003|
792 PerlIO_fileno||5.007003|
793 PerlIO_fill||5.007003|
794 PerlIO_flush||5.007003|
795 PerlIO_get_base||5.007003|
796 PerlIO_get_bufsiz||5.007003|
797 PerlIO_get_cnt||5.007003|
798 PerlIO_get_ptr||5.007003|
799 PerlIO_read||5.007003|
800 PerlIO_restore_errno|||
801 PerlIO_save_errno|||
802 PerlIO_seek||5.007003|
803 PerlIO_set_cnt||5.007003|
804 PerlIO_set_ptrcnt||5.007003|
805 PerlIO_setlinebuf||5.007003|
806 PerlIO_stderr||5.007003|
807 PerlIO_stdin||5.007003|
808 PerlIO_stdout||5.007003|
809 PerlIO_tell||5.007003|
810 PerlIO_unread||5.007003|
811 PerlIO_write||5.007003|
812 Perl_signbit||5.009005|n
813 PoisonFree|5.009004||p
814 PoisonNew|5.009004||p
815 PoisonWith|5.009004||p
816 Poison|5.008000||p
817 READ_XDIGIT||5.017006|
818 RETVAL|||n
819 Renewc|||
820 Renew|||
821 SAVECLEARSV|||
822 SAVECOMPPAD|||
823 SAVEPADSV|||
824 SAVETMPS|||
825 SAVE_DEFSV|5.004050||p
826 SPAGAIN|||
827 SP|||
828 START_EXTERN_C|5.005000||p
829 START_MY_CXT|5.007003||p
830 STMT_END|||p
831 STMT_START|||p
832 STR_WITH_LEN|5.009003||p
833 ST|||
834 SV_CONST_RETURN|5.009003||p
835 SV_COW_DROP_PV|5.008001||p
836 SV_COW_SHARED_HASH_KEYS|5.009005||p
837 SV_GMAGIC|5.007002||p
838 SV_HAS_TRAILING_NUL|5.009004||p
839 SV_IMMEDIATE_UNREF|5.007001||p
840 SV_MUTABLE_RETURN|5.009003||p
841 SV_NOSTEAL|5.009002||p
842 SV_SMAGIC|5.009003||p
843 SV_UTF8_NO_ENCODING|5.008001||p
844 SVfARG|5.009005||p
845 SVf_UTF8|5.006000||p
846 SVf|5.006000||p
847 SVt_INVLIST||5.019002|
848 SVt_IV|||
849 SVt_NULL|||
850 SVt_NV|||
851 SVt_PVAV|||
852 SVt_PVCV|||
853 SVt_PVFM|||
854 SVt_PVGV|||
855 SVt_PVHV|||
856 SVt_PVIO|||
857 SVt_PVIV|||
858 SVt_PVLV|||
859 SVt_PVMG|||
860 SVt_PVNV|||
861 SVt_PV|||
862 SVt_REGEXP||5.011000|
863 Safefree|||
864 Slab_Alloc|||
865 Slab_Free|||
866 Slab_to_ro|||
867 Slab_to_rw|||
868 StructCopy|||
869 SvCUR_set|||
870 SvCUR|||
871 SvEND|||
872 SvGAMAGIC||5.006001|
873 SvGETMAGIC|5.004050||p
874 SvGROW|||
875 SvIOK_UV||5.006000|
876 SvIOK_notUV||5.006000|
877 SvIOK_off|||
878 SvIOK_only_UV||5.006000|
879 SvIOK_only|||
880 SvIOK_on|||
881 SvIOKp|||
882 SvIOK|||
883 SvIVX|||
884 SvIV_nomg|5.009001||p
885 SvIV_set|||
886 SvIVx|||
887 SvIV|||
888 SvIsCOW_shared_hash||5.008003|
889 SvIsCOW||5.008003|
890 SvLEN_set|||
891 SvLEN|||
892 SvLOCK||5.007003|
893 SvMAGIC_set|5.009003||p
894 SvNIOK_off|||
895 SvNIOKp|||
896 SvNIOK|||
897 SvNOK_off|||
898 SvNOK_only|||
899 SvNOK_on|||
900 SvNOKp|||
901 SvNOK|||
902 SvNVX|||
903 SvNV_nomg||5.013002|
904 SvNV_set|||
905 SvNVx|||
906 SvNV|||
907 SvOK|||
908 SvOOK_offset||5.011000|
909 SvOOK|||
910 SvPOK_off|||
911 SvPOK_only_UTF8||5.006000|
912 SvPOK_only|||
913 SvPOK_on|||
914 SvPOKp|||
915 SvPOK|||
916 SvPVX_const|5.009003||p
917 SvPVX_mutable|5.009003||p
918 SvPVX|||
919 SvPV_const|5.009003||p
920 SvPV_flags_const_nolen|5.009003||p
921 SvPV_flags_const|5.009003||p
922 SvPV_flags_mutable|5.009003||p
923 SvPV_flags|5.007002||p
924 SvPV_force_flags_mutable|5.009003||p
925 SvPV_force_flags_nolen|5.009003||p
926 SvPV_force_flags|5.007002||p
927 SvPV_force_mutable|5.009003||p
928 SvPV_force_nolen|5.009003||p
929 SvPV_force_nomg_nolen|5.009003||p
930 SvPV_force_nomg|5.007002||p
931 SvPV_force|||p
932 SvPV_mutable|5.009003||p
933 SvPV_nolen_const|5.009003||p
934 SvPV_nolen|5.006000||p
935 SvPV_nomg_const_nolen|5.009003||p
936 SvPV_nomg_const|5.009003||p
937 SvPV_nomg_nolen|5.013007||p
938 SvPV_nomg|5.007002||p
939 SvPV_renew|5.009003||p
940 SvPV_set|||
941 SvPVbyte_force||5.009002|
942 SvPVbyte_nolen||5.006000|
943 SvPVbytex_force||5.006000|
944 SvPVbytex||5.006000|
945 SvPVbyte|5.006000||p
946 SvPVutf8_force||5.006000|
947 SvPVutf8_nolen||5.006000|
948 SvPVutf8x_force||5.006000|
949 SvPVutf8x||5.006000|
950 SvPVutf8||5.006000|
951 SvPVx|||
952 SvPV|||
953 SvREFCNT_dec_NN||5.017007|
954 SvREFCNT_dec|||
955 SvREFCNT_inc_NN|5.009004||p
956 SvREFCNT_inc_simple_NN|5.009004||p
957 SvREFCNT_inc_simple_void_NN|5.009004||p
958 SvREFCNT_inc_simple_void|5.009004||p
959 SvREFCNT_inc_simple|5.009004||p
960 SvREFCNT_inc_void_NN|5.009004||p
961 SvREFCNT_inc_void|5.009004||p
962 SvREFCNT_inc|||p
963 SvREFCNT|||
964 SvROK_off|||
965 SvROK_on|||
966 SvROK|||
967 SvRV_set|5.009003||p
968 SvRV|||
969 SvRXOK||5.009005|
970 SvRX||5.009005|
971 SvSETMAGIC|||
972 SvSHARED_HASH|5.009003||p
973 SvSHARE||5.007003|
974 SvSTASH_set|5.009003||p
975 SvSTASH|||
976 SvSetMagicSV_nosteal||5.004000|
977 SvSetMagicSV||5.004000|
978 SvSetSV_nosteal||5.004000|
979 SvSetSV|||
980 SvTAINTED_off||5.004000|
981 SvTAINTED_on||5.004000|
982 SvTAINTED||5.004000|
983 SvTAINT|||
984 SvTHINKFIRST|||
985 SvTRUE_nomg||5.013006|
986 SvTRUE|||
987 SvTYPE|||
988 SvUNLOCK||5.007003|
989 SvUOK|5.007001|5.006000|p
990 SvUPGRADE|||
991 SvUTF8_off||5.006000|
992 SvUTF8_on||5.006000|
993 SvUTF8||5.006000|
994 SvUVXx|5.004000||p
995 SvUVX|5.004000||p
996 SvUV_nomg|5.009001||p
997 SvUV_set|5.009003||p
998 SvUVx|5.004000||p
999 SvUV|5.004000||p
1000 SvVOK||5.008001|
1001 SvVSTRING_mg|5.009004||p
1002 THIS|||n
1003 UNDERBAR|5.009002||p
1004 UTF8_MAXBYTES|5.009002||p
1005 UVSIZE|5.006000||p
1006 UVTYPE|5.006000||p
1007 UVXf|5.007001||p
1008 UVof|5.006000||p
1009 UVuf|5.006000||p
1010 UVxf|5.006000||p
1011 WARN_ALL|5.006000||p
1012 WARN_AMBIGUOUS|5.006000||p
1013 WARN_ASSERTIONS|5.021008||p
1014 WARN_BAREWORD|5.006000||p
1015 WARN_CLOSED|5.006000||p
1016 WARN_CLOSURE|5.006000||p
1017 WARN_DEBUGGING|5.006000||p
1018 WARN_DEPRECATED|5.006000||p
1019 WARN_DIGIT|5.006000||p
1020 WARN_EXEC|5.006000||p
1021 WARN_EXITING|5.006000||p
1022 WARN_GLOB|5.006000||p
1023 WARN_INPLACE|5.006000||p
1024 WARN_INTERNAL|5.006000||p
1025 WARN_IO|5.006000||p
1026 WARN_LAYER|5.008000||p
1027 WARN_MALLOC|5.006000||p
1028 WARN_MISC|5.006000||p
1029 WARN_NEWLINE|5.006000||p
1030 WARN_NUMERIC|5.006000||p
1031 WARN_ONCE|5.006000||p
1032 WARN_OVERFLOW|5.006000||p
1033 WARN_PACK|5.006000||p
1034 WARN_PARENTHESIS|5.006000||p
1035 WARN_PIPE|5.006000||p
1036 WARN_PORTABLE|5.006000||p
1037 WARN_PRECEDENCE|5.006000||p
1038 WARN_PRINTF|5.006000||p
1039 WARN_PROTOTYPE|5.006000||p
1040 WARN_QW|5.006000||p
1041 WARN_RECURSION|5.006000||p
1042 WARN_REDEFINE|5.006000||p
1043 WARN_REGEXP|5.006000||p
1044 WARN_RESERVED|5.006000||p
1045 WARN_SEMICOLON|5.006000||p
1046 WARN_SEVERE|5.006000||p
1047 WARN_SIGNAL|5.006000||p
1048 WARN_SUBSTR|5.006000||p
1049 WARN_SYNTAX|5.006000||p
1050 WARN_TAINT|5.006000||p
1051 WARN_THREADS|5.008000||p
1052 WARN_UNINITIALIZED|5.006000||p
1053 WARN_UNOPENED|5.006000||p
1054 WARN_UNPACK|5.006000||p
1055 WARN_UNTIE|5.006000||p
1056 WARN_UTF8|5.006000||p
1057 WARN_VOID|5.006000||p
1058 WIDEST_UTYPE|5.015004||p
1059 XCPT_CATCH|5.009002||p
1060 XCPT_RETHROW|5.009002||p
1061 XCPT_TRY_END|5.009002||p
1062 XCPT_TRY_START|5.009002||p
1063 XPUSHi|||
1064 XPUSHmortal|5.009002||p
1065 XPUSHn|||
1066 XPUSHp|||
1067 XPUSHs|||
1068 XPUSHu|5.004000||p
1069 XSPROTO|5.010000||p
1070 XSRETURN_EMPTY|||
1071 XSRETURN_IV|||
1072 XSRETURN_NO|||
1073 XSRETURN_NV|||
1074 XSRETURN_PV|||
1075 XSRETURN_UNDEF|||
1076 XSRETURN_UV|5.008001||p
1077 XSRETURN_YES|||
1078 XSRETURN|||p
1079 XST_mIV|||
1080 XST_mNO|||
1081 XST_mNV|||
1082 XST_mPV|||
1083 XST_mUNDEF|||
1084 XST_mUV|5.008001||p
1085 XST_mYES|||
1086 XS_APIVERSION_BOOTCHECK||5.021008|
1087 XS_EXTERNAL||5.021008|
1088 XS_INTERNAL||5.021008|
1089 XS_VERSION_BOOTCHECK||5.021008|
1090 XS_VERSION|||
1091 XSprePUSH|5.006000||p
1092 XS|||
1093 XopDISABLE||5.021008|
1094 XopENABLE||5.021008|
1095 XopENTRYCUSTOM||5.021008|
1096 XopENTRY_set||5.021008|
1097 XopENTRY||5.021008|
1098 XopFLAGS||5.013007|
1099 ZeroD|5.009002||p
1100 Zero|||
1101 _aMY_CXT|5.007003||p
1102 _add_range_to_invlist|||
1103 _append_range_to_invlist|||
1104 _core_swash_init|||
1105 _get_encoding|||
1106 _get_regclass_nonbitmap_data|||
1107 _get_swash_invlist|||
1108 _invlist_array_init|||n
1109 _invlist_contains_cp|||n
1110 _invlist_contents|||
1111 _invlist_dump|||
1112 _invlist_intersection_maybe_complement_2nd|||
1113 _invlist_intersection|||
1114 _invlist_invert|||
1115 _invlist_len|||n
1116 _invlist_populate_swatch|||n
1117 _invlist_search|||n
1118 _invlist_subtract|||
1119 _invlist_union_maybe_complement_2nd|||
1120 _invlist_union|||
1121 _is_cur_LC_category_utf8|||
1122 _is_in_locale_category||5.021001|
1123 _is_uni_FOO||5.017008|
1124 _is_uni_perl_idcont||5.017008|
1125 _is_uni_perl_idstart||5.017007|
1126 _is_utf8_FOO||5.017008|
1127 _is_utf8_char_slow||5.021001|n
1128 _is_utf8_idcont||5.021001|
1129 _is_utf8_idstart||5.021001|
1130 _is_utf8_mark||5.017008|
1131 _is_utf8_perl_idcont||5.017008|
1132 _is_utf8_perl_idstart||5.017007|
1133 _is_utf8_xidcont||5.021001|
1134 _is_utf8_xidstart||5.021001|
1135 _load_PL_utf8_foldclosures|||
1136 _make_exactf_invlist|||
1137 _new_invlist_C_array|||
1138 _new_invlist|||
1139 _pMY_CXT|5.007003||p
1140 _setup_canned_invlist|||
1141 _swash_inversion_hash|||
1142 _swash_to_invlist|||
1143 _to_fold_latin1|||
1144 _to_uni_fold_flags||5.014000|
1145 _to_upper_title_latin1|||
1146 _to_utf8_fold_flags||5.019009|
1147 _to_utf8_lower_flags||5.019009|
1148 _to_utf8_title_flags||5.019009|
1149 _to_utf8_upper_flags||5.019009|
1150 _warn_problematic_locale|||n
1151 aMY_CXT_|5.007003||p
1152 aMY_CXT|5.007003||p
1153 aTHXR_|5.021008||p
1154 aTHXR|5.021008||p
1155 aTHX_|5.006000||p
1156 aTHX|5.006000||p
1157 aassign_common_vars|||
1158 add_above_Latin1_folds|||
1159 add_cp_to_invlist|||
1160 add_data|||n
1161 add_multi_match|||
1162 add_utf16_textfilter|||
1163 adjust_size_and_find_bucket|||n
1164 advance_one_SB|||
1165 advance_one_WB|||
1166 alloc_maybe_populate_EXACT|||
1167 alloccopstash|||
1168 allocmy|||
1169 amagic_call|||
1170 amagic_cmp_locale|||
1171 amagic_cmp|||
1172 amagic_deref_call||5.013007|
1173 amagic_i_ncmp|||
1174 amagic_is_enabled|||
1175 amagic_ncmp|||
1176 anonymise_cv_maybe|||
1177 any_dup|||
1178 ao|||
1179 append_utf8_from_native_byte||5.019004|n
1180 apply_attrs_my|||
1181 apply_attrs_string||5.006001|
1182 apply_attrs|||
1183 apply|||
1184 assert_uft8_cache_coherent|||
1185 assignment_type|||
1186 atfork_lock||5.007003|n
1187 atfork_unlock||5.007003|n
1188 av_arylen_p||5.009003|
1189 av_clear|||
1190 av_create_and_push||5.009005|
1191 av_create_and_unshift_one||5.009005|
1192 av_delete||5.006000|
1193 av_exists||5.006000|
1194 av_extend_guts|||
1195 av_extend|||
1196 av_fetch|||
1197 av_fill|||
1198 av_iter_p||5.011000|
1199 av_len|||
1200 av_make|||
1201 av_pop|||
1202 av_push|||
1203 av_reify|||
1204 av_shift|||
1205 av_store|||
1206 av_tindex||5.017009|
1207 av_top_index||5.017009|
1208 av_undef|||
1209 av_unshift|||
1210 ax|||n
1211 backup_one_SB|||
1212 backup_one_WB|||
1213 bad_type_gv|||
1214 bad_type_pv|||
1215 bind_match|||
1216 block_end||5.004000|
1217 block_gimme||5.004000|
1218 block_start||5.004000|
1219 blockhook_register||5.013003|
1220 boolSV|5.004000||p
1221 boot_core_PerlIO|||
1222 boot_core_UNIVERSAL|||
1223 boot_core_mro|||
1224 bytes_cmp_utf8||5.013007|
1225 bytes_from_utf8||5.007001|
1226 bytes_to_utf8||5.006001|
1227 call_argv|5.006000||p
1228 call_atexit||5.006000|
1229 call_list||5.004000|
1230 call_method|5.006000||p
1231 call_pv|5.006000||p
1232 call_sv|5.006000||p
1233 caller_cx|5.013005|5.006000|p
1234 calloc||5.007002|n
1235 cando|||
1236 cast_i32||5.006000|n
1237 cast_iv||5.006000|n
1238 cast_ulong||5.006000|n
1239 cast_uv||5.006000|n
1240 check_locale_boundary_crossing|||
1241 check_type_and_open|||
1242 check_uni|||
1243 check_utf8_print|||
1244 checkcomma|||
1245 ckWARN|5.006000||p
1246 ck_entersub_args_core|||
1247 ck_entersub_args_list||5.013006|
1248 ck_entersub_args_proto_or_list||5.013006|
1249 ck_entersub_args_proto||5.013006|
1250 ck_warner_d||5.011001|v
1251 ck_warner||5.011001|v
1252 ckwarn_common|||
1253 ckwarn_d||5.009003|
1254 ckwarn||5.009003|
1255 clear_placeholders|||
1256 clear_special_blocks|||
1257 clone_params_del|||n
1258 clone_params_new|||n
1259 closest_cop|||
1260 cntrl_to_mnemonic|||n
1261 compute_EXACTish|||n
1262 construct_ahocorasick_from_trie|||
1263 cop_fetch_label||5.015001|
1264 cop_free|||
1265 cop_hints_2hv||5.013007|
1266 cop_hints_fetch_pvn||5.013007|
1267 cop_hints_fetch_pvs||5.013007|
1268 cop_hints_fetch_pv||5.013007|
1269 cop_hints_fetch_sv||5.013007|
1270 cop_store_label||5.015001|
1271 cophh_2hv||5.013007|
1272 cophh_copy||5.013007|
1273 cophh_delete_pvn||5.013007|
1274 cophh_delete_pvs||5.013007|
1275 cophh_delete_pv||5.013007|
1276 cophh_delete_sv||5.013007|
1277 cophh_fetch_pvn||5.013007|
1278 cophh_fetch_pvs||5.013007|
1279 cophh_fetch_pv||5.013007|
1280 cophh_fetch_sv||5.013007|
1281 cophh_free||5.013007|
1282 cophh_new_empty||5.021008|
1283 cophh_store_pvn||5.013007|
1284 cophh_store_pvs||5.013007|
1285 cophh_store_pv||5.013007|
1286 cophh_store_sv||5.013007|
1287 core_prototype|||
1288 coresub_op|||
1289 could_it_be_a_POSIX_class|||n
1290 cr_textfilter|||
1291 create_eval_scope|||
1292 croak_memory_wrap||5.019003|n
1293 croak_no_mem|||n
1294 croak_no_modify||5.013003|n
1295 croak_nocontext|||vn
1296 croak_popstack|||n
1297 croak_sv||5.013001|
1298 croak_xs_usage||5.010001|n
1299 croak|||v
1300 csighandler||5.009003|n
1301 current_re_engine|||
1302 curse|||
1303 custom_op_desc||5.007003|
1304 custom_op_get_field|||
1305 custom_op_name||5.007003|
1306 custom_op_register||5.013007|
1307 custom_op_xop||5.013007|
1308 cv_ckproto_len_flags|||
1309 cv_clone_into|||
1310 cv_clone|||
1311 cv_const_sv_or_av|||n
1312 cv_const_sv||5.003070|n
1313 cv_dump|||
1314 cv_forget_slab|||
1315 cv_get_call_checker||5.013006|
1316 cv_name||5.021005|
1317 cv_set_call_checker_flags||5.021004|
1318 cv_set_call_checker||5.013006|
1319 cv_undef_flags|||
1320 cv_undef|||
1321 cvgv_from_hek|||
1322 cvgv_set|||
1323 cvstash_set|||
1324 cx_dump||5.005000|
1325 cx_dup|||
1326 cxinc|||
1327 dAXMARK|5.009003||p
1328 dAX|5.007002||p
1329 dITEMS|5.007002||p
1330 dMARK|||
1331 dMULTICALL||5.009003|
1332 dMY_CXT_SV|5.007003||p
1333 dMY_CXT|5.007003||p
1334 dNOOP|5.006000||p
1335 dORIGMARK|||
1336 dSP|||
1337 dTHR|5.004050||p
1338 dTHXR|5.021008||p
1339 dTHXa|5.006000||p
1340 dTHXoa|5.006000||p
1341 dTHX|5.006000||p
1342 dUNDERBAR|5.009002||p
1343 dVAR|5.009003||p
1344 dXCPT|5.009002||p
1345 dXSARGS|||
1346 dXSI32|||
1347 dXSTARG|5.006000||p
1348 deb_curcv|||
1349 deb_nocontext|||vn
1350 deb_stack_all|||
1351 deb_stack_n|||
1352 debop||5.005000|
1353 debprofdump||5.005000|
1354 debprof|||
1355 debstackptrs||5.007003|
1356 debstack||5.007003|
1357 debug_start_match|||
1358 deb||5.007003|v
1359 defelem_target|||
1360 del_sv|||
1361 delete_eval_scope|||
1362 delimcpy||5.004000|n
1363 deprecate_commaless_var_list|||
1364 despatch_signals||5.007001|
1365 destroy_matcher|||
1366 die_nocontext|||vn
1367 die_sv||5.013001|
1368 die_unwind|||
1369 die|||v
1370 dirp_dup|||
1371 div128|||
1372 djSP|||
1373 do_aexec5|||
1374 do_aexec|||
1375 do_aspawn|||
1376 do_binmode||5.004050|
1377 do_chomp|||
1378 do_close|||
1379 do_delete_local|||
1380 do_dump_pad|||
1381 do_eof|||
1382 do_exec3|||
1383 do_execfree|||
1384 do_exec|||
1385 do_gv_dump||5.006000|
1386 do_gvgv_dump||5.006000|
1387 do_hv_dump||5.006000|
1388 do_ipcctl|||
1389 do_ipcget|||
1390 do_join|||
1391 do_magic_dump||5.006000|
1392 do_msgrcv|||
1393 do_msgsnd|||
1394 do_ncmp|||
1395 do_oddball|||
1396 do_op_dump||5.006000|
1397 do_open6|||
1398 do_open9||5.006000|
1399 do_open_raw|||
1400 do_openn||5.007001|
1401 do_open||5.003070|
1402 do_pmop_dump||5.006000|
1403 do_print|||
1404 do_readline|||
1405 do_seek|||
1406 do_semop|||
1407 do_shmio|||
1408 do_smartmatch|||
1409 do_spawn_nowait|||
1410 do_spawn|||
1411 do_sprintf|||
1412 do_sv_dump||5.006000|
1413 do_sysseek|||
1414 do_tell|||
1415 do_trans_complex_utf8|||
1416 do_trans_complex|||
1417 do_trans_count_utf8|||
1418 do_trans_count|||
1419 do_trans_simple_utf8|||
1420 do_trans_simple|||
1421 do_trans|||
1422 do_vecget|||
1423 do_vecset|||
1424 do_vop|||
1425 docatch|||
1426 doeval|||
1427 dofile|||
1428 dofindlabel|||
1429 doform|||
1430 doing_taint||5.008001|n
1431 dooneliner|||
1432 doopen_pm|||
1433 doparseform|||
1434 dopoptoeval|||
1435 dopoptogiven|||
1436 dopoptolabel|||
1437 dopoptoloop|||
1438 dopoptosub_at|||
1439 dopoptowhen|||
1440 doref||5.009003|
1441 dounwind|||
1442 dowantarray|||
1443 drand48_init_r|||n
1444 drand48_r|||n
1445 dump_all_perl|||
1446 dump_all||5.006000|
1447 dump_c_backtrace|||
1448 dump_eval||5.006000|
1449 dump_exec_pos|||
1450 dump_form||5.006000|
1451 dump_indent||5.006000|v
1452 dump_mstats|||
1453 dump_packsubs_perl|||
1454 dump_packsubs||5.006000|
1455 dump_sub_perl|||
1456 dump_sub||5.006000|
1457 dump_sv_child|||
1458 dump_trie_interim_list|||
1459 dump_trie_interim_table|||
1460 dump_trie|||
1461 dump_vindent||5.006000|
1462 dumpuntil|||
1463 dup_attrlist|||
1464 emulate_cop_io|||
1465 eval_pv|5.006000||p
1466 eval_sv|5.006000||p
1467 exec_failed|||
1468 expect_number|||
1469 fbm_compile||5.005000|
1470 fbm_instr||5.005000|
1471 feature_is_enabled|||
1472 filter_add|||
1473 filter_del|||
1474 filter_gets|||
1475 filter_read|||
1476 finalize_optree|||
1477 finalize_op|||
1478 find_and_forget_pmops|||
1479 find_array_subscript|||
1480 find_beginning|||
1481 find_byclass|||
1482 find_default_stash|||
1483 find_hash_subscript|||
1484 find_in_my_stash|||
1485 find_lexical_cv|||
1486 find_runcv_where|||
1487 find_runcv||5.008001|
1488 find_rundefsv2|||
1489 find_rundefsvoffset||5.009002|
1490 find_rundefsv||5.013002|
1491 find_script|||
1492 find_uninit_var|||
1493 first_symbol|||n
1494 fixup_errno_string|||
1495 foldEQ_latin1||5.013008|n
1496 foldEQ_locale||5.013002|n
1497 foldEQ_utf8_flags||5.013010|
1498 foldEQ_utf8||5.013002|
1499 foldEQ||5.013002|n
1500 fold_constants|||
1501 forbid_setid|||
1502 force_ident_maybe_lex|||
1503 force_ident|||
1504 force_list|||
1505 force_next|||
1506 force_strict_version|||
1507 force_version|||
1508 force_word|||
1509 forget_pmop|||
1510 form_nocontext|||vn
1511 form_short_octal_warning|||
1512 form||5.004000|v
1513 fp_dup|||
1514 fprintf_nocontext|||vn
1515 free_c_backtrace|||
1516 free_global_struct|||
1517 free_tied_hv_pool|||
1518 free_tmps|||
1519 gen_constant_list|||
1520 get_ANYOF_cp_list_for_ssc|||
1521 get_and_check_backslash_N_name|||
1522 get_aux_mg|||
1523 get_av|5.006000||p
1524 get_c_backtrace_dump|||
1525 get_c_backtrace|||
1526 get_context||5.006000|n
1527 get_cvn_flags|5.009005||p
1528 get_cvs|5.011000||p
1529 get_cv|5.006000||p
1530 get_db_sub|||
1531 get_debug_opts|||
1532 get_hash_seed|||
1533 get_hv|5.006000||p
1534 get_invlist_iter_addr|||n
1535 get_invlist_offset_addr|||n
1536 get_invlist_previous_index_addr|||n
1537 get_mstats|||
1538 get_no_modify|||
1539 get_num|||
1540 get_op_descs||5.005000|
1541 get_op_names||5.005000|
1542 get_opargs|||
1543 get_ppaddr||5.006000|
1544 get_re_arg|||
1545 get_sv|5.006000||p
1546 get_vtbl||5.005030|
1547 getcwd_sv||5.007002|
1548 getenv_len|||
1549 glob_2number|||
1550 glob_assign_glob|||
1551 gp_dup|||
1552 gp_free|||
1553 gp_ref|||
1554 grok_atoUV|||n
1555 grok_bin|5.007003||p
1556 grok_bslash_N|||
1557 grok_bslash_c|||
1558 grok_bslash_o|||
1559 grok_bslash_x|||
1560 grok_hex|5.007003||p
1561 grok_infnan||5.021004|
1562 grok_number_flags||5.021002|
1563 grok_number|5.007002||p
1564 grok_numeric_radix|5.007002||p
1565 grok_oct|5.007003||p
1566 group_end|||
1567 gv_AVadd|||
1568 gv_HVadd|||
1569 gv_IOadd|||
1570 gv_SVadd|||
1571 gv_add_by_type||5.011000|
1572 gv_autoload4||5.004000|
1573 gv_autoload_pvn||5.015004|
1574 gv_autoload_pv||5.015004|
1575 gv_autoload_sv||5.015004|
1576 gv_check|||
1577 gv_const_sv||5.009003|
1578 gv_dump||5.006000|
1579 gv_efullname3||5.003070|
1580 gv_efullname4||5.006001|
1581 gv_efullname|||
1582 gv_fetchfile_flags||5.009005|
1583 gv_fetchfile|||
1584 gv_fetchmeth_autoload||5.007003|
1585 gv_fetchmeth_internal|||
1586 gv_fetchmeth_pv_autoload||5.015004|
1587 gv_fetchmeth_pvn_autoload||5.015004|
1588 gv_fetchmeth_pvn||5.015004|
1589 gv_fetchmeth_pv||5.015004|
1590 gv_fetchmeth_sv_autoload||5.015004|
1591 gv_fetchmeth_sv||5.015004|
1592 gv_fetchmethod_autoload||5.004000|
1593 gv_fetchmethod_pv_flags||5.015004|
1594 gv_fetchmethod_pvn_flags||5.015004|
1595 gv_fetchmethod_sv_flags||5.015004|
1596 gv_fetchmethod|||
1597 gv_fetchmeth|||
1598 gv_fetchpvn_flags|5.009002||p
1599 gv_fetchpvs|5.009004||p
1600 gv_fetchpv|||
1601 gv_fetchsv|5.009002||p
1602 gv_fullname3||5.003070|
1603 gv_fullname4||5.006001|
1604 gv_fullname|||
1605 gv_handler||5.007001|
1606 gv_init_pvn||5.015004|
1607 gv_init_pv||5.015004|
1608 gv_init_svtype|||
1609 gv_init_sv||5.015004|
1610 gv_init|||
1611 gv_is_in_main|||
1612 gv_magicalize_isa|||
1613 gv_magicalize|||
1614 gv_name_set||5.009004|
1615 gv_override|||
1616 gv_setref|||
1617 gv_stashpvn_internal|||
1618 gv_stashpvn|5.003070||p
1619 gv_stashpvs|5.009003||p
1620 gv_stashpv|||
1621 gv_stashsvpvn_cached|||
1622 gv_stashsv|||
1623 gv_try_downgrade|||
1624 handle_regex_sets|||
1625 he_dup|||
1626 hek_dup|||
1627 hfree_next_entry|||
1628 hfreeentries|||
1629 hsplit|||
1630 hv_assert|||
1631 hv_auxinit_internal|||n
1632 hv_auxinit|||
1633 hv_backreferences_p|||
1634 hv_clear_placeholders||5.009001|
1635 hv_clear|||
1636 hv_common_key_len||5.010000|
1637 hv_common||5.010000|
1638 hv_copy_hints_hv||5.009004|
1639 hv_delayfree_ent||5.004000|
1640 hv_delete_common|||
1641 hv_delete_ent||5.003070|
1642 hv_delete|||
1643 hv_eiter_p||5.009003|
1644 hv_eiter_set||5.009003|
1645 hv_ename_add|||
1646 hv_ename_delete|||
1647 hv_exists_ent||5.003070|
1648 hv_exists|||
1649 hv_fetch_ent||5.003070|
1650 hv_fetchs|5.009003||p
1651 hv_fetch|||
1652 hv_fill||5.013002|
1653 hv_free_ent_ret|||
1654 hv_free_ent||5.004000|
1655 hv_iterinit|||
1656 hv_iterkeysv||5.003070|
1657 hv_iterkey|||
1658 hv_iternext_flags||5.008000|
1659 hv_iternextsv|||
1660 hv_iternext|||
1661 hv_iterval|||
1662 hv_kill_backrefs|||
1663 hv_ksplit||5.003070|
1664 hv_magic_check|||n
1665 hv_magic|||
1666 hv_name_set||5.009003|
1667 hv_notallowed|||
1668 hv_placeholders_get||5.009003|
1669 hv_placeholders_p|||
1670 hv_placeholders_set||5.009003|
1671 hv_rand_set||5.018000|
1672 hv_riter_p||5.009003|
1673 hv_riter_set||5.009003|
1674 hv_scalar||5.009001|
1675 hv_store_ent||5.003070|
1676 hv_store_flags||5.008000|
1677 hv_stores|5.009004||p
1678 hv_store|||
1679 hv_undef_flags|||
1680 hv_undef|||
1681 ibcmp_locale||5.004000|
1682 ibcmp_utf8||5.007003|
1683 ibcmp|||
1684 incline|||
1685 incpush_if_exists|||
1686 incpush_use_sep|||
1687 incpush|||
1688 ingroup|||
1689 init_argv_symbols|||
1690 init_constants|||
1691 init_dbargs|||
1692 init_debugger|||
1693 init_global_struct|||
1694 init_i18nl10n||5.006000|
1695 init_i18nl14n||5.006000|
1696 init_ids|||
1697 init_interp|||
1698 init_main_stash|||
1699 init_perllib|||
1700 init_postdump_symbols|||
1701 init_predump_symbols|||
1702 init_stacks||5.005000|
1703 init_tm||5.007002|
1704 inplace_aassign|||
1705 instr|||n
1706 intro_my||5.004000|
1707 intuit_method|||
1708 intuit_more|||
1709 invert|||
1710 invlist_array|||n
1711 invlist_clone|||
1712 invlist_extend|||
1713 invlist_highest|||n
1714 invlist_is_iterating|||n
1715 invlist_iterfinish|||n
1716 invlist_iterinit|||n
1717 invlist_iternext|||n
1718 invlist_max|||n
1719 invlist_previous_index|||n
1720 invlist_set_len|||
1721 invlist_set_previous_index|||n
1722 invlist_trim|||n
1723 invoke_exception_hook|||
1724 io_close|||
1725 isALNUMC|5.006000||p
1726 isALNUM_lazy||5.021001|
1727 isALPHANUMERIC||5.017008|
1728 isALPHA|||
1729 isASCII|5.006000||p
1730 isBLANK|5.006001||p
1731 isCNTRL|5.006000||p
1732 isDIGIT|||
1733 isFOO_lc|||
1734 isFOO_utf8_lc|||
1735 isGCB|||n
1736 isGRAPH|5.006000||p
1737 isGV_with_GP|5.009004||p
1738 isIDCONT||5.017008|
1739 isIDFIRST_lazy||5.021001|
1740 isIDFIRST|||
1741 isLOWER|||
1742 isOCTAL||5.013005|
1743 isPRINT|5.004000||p
1744 isPSXSPC|5.006001||p
1745 isPUNCT|5.006000||p
1746 isSB|||
1747 isSPACE|||
1748 isUPPER|||
1749 isUTF8_CHAR||5.021001|
1750 isWB|||
1751 isWORDCHAR||5.013006|
1752 isXDIGIT|5.006000||p
1753 is_an_int|||
1754 is_ascii_string||5.011000|
1755 is_handle_constructor|||n
1756 is_invariant_string||5.021007|n
1757 is_lvalue_sub||5.007001|
1758 is_safe_syscall||5.019004|
1759 is_ssc_worth_it|||n
1760 is_uni_alnum_lc||5.006000|
1761 is_uni_alnumc_lc||5.017007|
1762 is_uni_alnumc||5.017007|
1763 is_uni_alnum||5.006000|
1764 is_uni_alpha_lc||5.006000|
1765 is_uni_alpha||5.006000|
1766 is_uni_ascii_lc||5.006000|
1767 is_uni_ascii||5.006000|
1768 is_uni_blank_lc||5.017002|
1769 is_uni_blank||5.017002|
1770 is_uni_cntrl_lc||5.006000|
1771 is_uni_cntrl||5.006000|
1772 is_uni_digit_lc||5.006000|
1773 is_uni_digit||5.006000|
1774 is_uni_graph_lc||5.006000|
1775 is_uni_graph||5.006000|
1776 is_uni_idfirst_lc||5.006000|
1777 is_uni_idfirst||5.006000|
1778 is_uni_lower_lc||5.006000|
1779 is_uni_lower||5.006000|
1780 is_uni_print_lc||5.006000|
1781 is_uni_print||5.006000|
1782 is_uni_punct_lc||5.006000|
1783 is_uni_punct||5.006000|
1784 is_uni_space_lc||5.006000|
1785 is_uni_space||5.006000|
1786 is_uni_upper_lc||5.006000|
1787 is_uni_upper||5.006000|
1788 is_uni_xdigit_lc||5.006000|
1789 is_uni_xdigit||5.006000|
1790 is_utf8_alnumc||5.017007|
1791 is_utf8_alnum||5.006000|
1792 is_utf8_alpha||5.006000|
1793 is_utf8_ascii||5.006000|
1794 is_utf8_blank||5.017002|
1795 is_utf8_char_buf||5.015008|n
1796 is_utf8_char||5.006000|n
1797 is_utf8_cntrl||5.006000|
1798 is_utf8_common|||
1799 is_utf8_digit||5.006000|
1800 is_utf8_graph||5.006000|
1801 is_utf8_idcont||5.008000|
1802 is_utf8_idfirst||5.006000|
1803 is_utf8_lower||5.006000|
1804 is_utf8_mark||5.006000|
1805 is_utf8_perl_space||5.011001|
1806 is_utf8_perl_word||5.011001|
1807 is_utf8_posix_digit||5.011001|
1808 is_utf8_print||5.006000|
1809 is_utf8_punct||5.006000|
1810 is_utf8_space||5.006000|
1811 is_utf8_string_loclen||5.009003|n
1812 is_utf8_string_loc||5.008001|n
1813 is_utf8_string||5.006001|n
1814 is_utf8_upper||5.006000|
1815 is_utf8_xdigit||5.006000|
1816 is_utf8_xidcont||5.013010|
1817 is_utf8_xidfirst||5.013010|
1818 isa_lookup|||
1819 isinfnansv|||
1820 isinfnan||5.021004|n
1821 items|||n
1822 ix|||n
1823 jmaybe|||
1824 join_exact|||
1825 keyword_plugin_standard|||
1826 keyword|||
1827 leave_common|||
1828 leave_scope|||
1829 lex_bufutf8||5.011002|
1830 lex_discard_to||5.011002|
1831 lex_grow_linestr||5.011002|
1832 lex_next_chunk||5.011002|
1833 lex_peek_unichar||5.011002|
1834 lex_read_space||5.011002|
1835 lex_read_to||5.011002|
1836 lex_read_unichar||5.011002|
1837 lex_start||5.009005|
1838 lex_stuff_pvn||5.011002|
1839 lex_stuff_pvs||5.013005|
1840 lex_stuff_pv||5.013006|
1841 lex_stuff_sv||5.011002|
1842 lex_unstuff||5.011002|
1843 listkids|||
1844 list|||
1845 load_module_nocontext|||vn
1846 load_module|5.006000||pv
1847 localize|||
1848 looks_like_bool|||
1849 looks_like_number|||
1850 lop|||
1851 mPUSHi|5.009002||p
1852 mPUSHn|5.009002||p
1853 mPUSHp|5.009002||p
1854 mPUSHs|5.010001||p
1855 mPUSHu|5.009002||p
1856 mXPUSHi|5.009002||p
1857 mXPUSHn|5.009002||p
1858 mXPUSHp|5.009002||p
1859 mXPUSHs|5.010001||p
1860 mXPUSHu|5.009002||p
1861 magic_clear_all_env|||
1862 magic_cleararylen_p|||
1863 magic_clearenv|||
1864 magic_clearhints|||
1865 magic_clearhint|||
1866 magic_clearisa|||
1867 magic_clearpack|||
1868 magic_clearsig|||
1869 magic_copycallchecker|||
1870 magic_dump||5.006000|
1871 magic_existspack|||
1872 magic_freearylen_p|||
1873 magic_freeovrld|||
1874 magic_getarylen|||
1875 magic_getdebugvar|||
1876 magic_getdefelem|||
1877 magic_getnkeys|||
1878 magic_getpack|||
1879 magic_getpos|||
1880 magic_getsig|||
1881 magic_getsubstr|||
1882 magic_gettaint|||
1883 magic_getuvar|||
1884 magic_getvec|||
1885 magic_get|||
1886 magic_killbackrefs|||
1887 magic_methcall1|||
1888 magic_methcall|||v
1889 magic_methpack|||
1890 magic_nextpack|||
1891 magic_regdata_cnt|||
1892 magic_regdatum_get|||
1893 magic_regdatum_set|||
1894 magic_scalarpack|||
1895 magic_set_all_env|||
1896 magic_setarylen|||
1897 magic_setcollxfrm|||
1898 magic_setdbline|||
1899 magic_setdebugvar|||
1900 magic_setdefelem|||
1901 magic_setenv|||
1902 magic_sethint|||
1903 magic_setisa|||
1904 magic_setlvref|||
1905 magic_setmglob|||
1906 magic_setnkeys|||
1907 magic_setpack|||
1908 magic_setpos|||
1909 magic_setregexp|||
1910 magic_setsig|||
1911 magic_setsubstr|||
1912 magic_settaint|||
1913 magic_setutf8|||
1914 magic_setuvar|||
1915 magic_setvec|||
1916 magic_set|||
1917 magic_sizepack|||
1918 magic_wipepack|||
1919 make_matcher|||
1920 make_trie|||
1921 malloc_good_size|||n
1922 malloced_size|||n
1923 malloc||5.007002|n
1924 markstack_grow||5.021001|
1925 matcher_matches_sv|||
1926 maybe_multimagic_gv|||
1927 mayberelocate|||
1928 measure_struct|||
1929 memEQs|5.009005||p
1930 memEQ|5.004000||p
1931 memNEs|5.009005||p
1932 memNE|5.004000||p
1933 mem_collxfrm|||
1934 mem_log_common|||n
1935 mess_alloc|||
1936 mess_nocontext|||vn
1937 mess_sv||5.013001|
1938 mess||5.006000|v
1939 mfree||5.007002|n
1940 mg_clear|||
1941 mg_copy|||
1942 mg_dup|||
1943 mg_find_mglob|||
1944 mg_findext|5.013008||pn
1945 mg_find|||n
1946 mg_free_type||5.013006|
1947 mg_free|||
1948 mg_get|||
1949 mg_length||5.005000|
1950 mg_localize|||
1951 mg_magical|||n
1952 mg_set|||
1953 mg_size||5.005000|
1954 mini_mktime||5.007002|n
1955 minus_v|||
1956 missingterm|||
1957 mode_from_discipline|||
1958 modkids|||
1959 more_bodies|||
1960 more_sv|||
1961 moreswitches|||
1962 move_proto_attr|||
1963 mro_clean_isarev|||
1964 mro_gather_and_rename|||
1965 mro_get_from_name||5.010001|
1966 mro_get_linear_isa_dfs|||
1967 mro_get_linear_isa||5.009005|
1968 mro_get_private_data||5.010001|
1969 mro_isa_changed_in|||
1970 mro_meta_dup|||
1971 mro_meta_init|||
1972 mro_method_changed_in||5.009005|
1973 mro_package_moved|||
1974 mro_register||5.010001|
1975 mro_set_mro||5.010001|
1976 mro_set_private_data||5.010001|
1977 mul128|||
1978 mulexp10|||n
1979 multideref_stringify|||
1980 my_atof2||5.007002|
1981 my_atof||5.006000|
1982 my_attrs|||
1983 my_bcopy|||n
1984 my_bytes_to_utf8|||n
1985 my_bzero|||n
1986 my_chsize|||
1987 my_clearenv|||
1988 my_cxt_index|||
1989 my_cxt_init|||
1990 my_dirfd||5.009005|n
1991 my_exit_jump|||
1992 my_exit|||
1993 my_failure_exit||5.004000|
1994 my_fflush_all||5.006000|
1995 my_fork||5.007003|n
1996 my_kid|||
1997 my_lstat_flags|||
1998 my_lstat||5.021008|
1999 my_memcmp|||n
2000 my_memset|||n
2001 my_pclose||5.003070|
2002 my_popen_list||5.007001|
2003 my_popen||5.003070|
2004 my_setenv|||
2005 my_setlocale|||
2006 my_snprintf|5.009004||pvn
2007 my_socketpair||5.007003|n
2008 my_sprintf|5.009003||pvn
2009 my_stat_flags|||
2010 my_stat||5.021008|
2011 my_strerror||5.021001|
2012 my_strftime||5.007002|
2013 my_strlcat|5.009004||pn
2014 my_strlcpy|5.009004||pn
2015 my_unexec|||
2016 my_vsnprintf||5.009004|n
2017 need_utf8|||n
2018 newANONATTRSUB||5.006000|
2019 newANONHASH|||
2020 newANONLIST|||
2021 newANONSUB|||
2022 newASSIGNOP|||
2023 newATTRSUB_x|||
2024 newATTRSUB||5.006000|
2025 newAVREF|||
2026 newAV|||
2027 newBINOP|||
2028 newCONDOP|||
2029 newCONSTSUB_flags||5.015006|
2030 newCONSTSUB|5.004050||p
2031 newCVREF|||
2032 newDEFSVOP||5.021006|
2033 newFORM|||
2034 newFOROP||5.013007|
2035 newGIVENOP||5.009003|
2036 newGIVWHENOP|||
2037 newGP|||
2038 newGVOP|||
2039 newGVREF|||
2040 newGVgen_flags||5.015004|
2041 newGVgen|||
2042 newHVREF|||
2043 newHVhv||5.005000|
2044 newHV|||
2045 newIO|||
2046 newLISTOP|||
2047 newLOGOP|||
2048 newLOOPEX|||
2049 newLOOPOP|||
2050 newMETHOP_internal|||
2051 newMETHOP_named||5.021005|
2052 newMETHOP||5.021005|
2053 newMYSUB||5.017004|
2054 newNULLLIST|||
2055 newOP|||
2056 newPADNAMELIST||5.021007|n
2057 newPADNAMEouter||5.021007|n
2058 newPADNAMEpvn||5.021007|n
2059 newPADOP|||
2060 newPMOP|||
2061 newPROG|||
2062 newPVOP|||
2063 newRANGE|||
2064 newRV_inc|5.004000||p
2065 newRV_noinc|5.004000||p
2066 newRV|||
2067 newSLICEOP|||
2068 newSTATEOP|||
2069 newSTUB|||
2070 newSUB|||
2071 newSVOP|||
2072 newSVREF|||
2073 newSV_type|5.009005||p
2074 newSVavdefelem|||
2075 newSVhek||5.009003|
2076 newSViv|||
2077 newSVnv|||
2078 newSVpadname||5.017004|
2079 newSVpv_share||5.013006|
2080 newSVpvf_nocontext|||vn
2081 newSVpvf||5.004000|v
2082 newSVpvn_flags|5.010001||p
2083 newSVpvn_share|5.007001||p
2084 newSVpvn_utf8|5.010001||p
2085 newSVpvn|5.004050||p
2086 newSVpvs_flags|5.010001||p
2087 newSVpvs_share|5.009003||p
2088 newSVpvs|5.009003||p
2089 newSVpv|||
2090 newSVrv|||
2091 newSVsv|||
2092 newSVuv|5.006000||p
2093 newSV|||
2094 newUNOP_AUX||5.021007|
2095 newUNOP|||
2096 newWHENOP||5.009003|
2097 newWHILEOP||5.013007|
2098 newXS_deffile|||
2099 newXS_flags||5.009004|
2100 newXS_len_flags|||
2101 newXSproto||5.006000|
2102 newXS||5.006000|
2103 new_collate||5.006000|
2104 new_constant|||
2105 new_ctype||5.006000|
2106 new_he|||
2107 new_logop|||
2108 new_numeric||5.006000|
2109 new_stackinfo||5.005000|
2110 new_version||5.009000|
2111 new_warnings_bitfield|||
2112 next_symbol|||
2113 nextargv|||
2114 nextchar|||
2115 ninstr|||n
2116 no_bareword_allowed|||
2117 no_fh_allowed|||
2118 no_op|||
2119 noperl_die|||vn
2120 not_a_number|||
2121 not_incrementable|||
2122 nothreadhook||5.008000|
2123 nuke_stacks|||
2124 num_overflow|||n
2125 oopsAV|||
2126 oopsHV|||
2127 op_append_elem||5.013006|
2128 op_append_list||5.013006|
2129 op_clear|||
2130 op_contextualize||5.013006|
2131 op_convert_list||5.021006|
2132 op_dump||5.006000|
2133 op_free|||
2134 op_integerize|||
2135 op_linklist||5.013006|
2136 op_lvalue_flags|||
2137 op_lvalue||5.013007|
2138 op_null||5.007002|
2139 op_parent||5.021002|n
2140 op_prepend_elem||5.013006|
2141 op_refcnt_dec|||
2142 op_refcnt_inc|||
2143 op_refcnt_lock||5.009002|
2144 op_refcnt_unlock||5.009002|
2145 op_relocate_sv|||
2146 op_scope||5.013007|
2147 op_sibling_splice||5.021002|n
2148 op_std_init|||
2149 op_unscope|||
2150 open_script|||
2151 openn_cleanup|||
2152 openn_setup|||
2153 opmethod_stash|||
2154 opslab_force_free|||
2155 opslab_free_nopad|||
2156 opslab_free|||
2157 pMY_CXT_|5.007003||p
2158 pMY_CXT|5.007003||p
2159 pTHX_|5.006000||p
2160 pTHX|5.006000||p
2161 packWARN|5.007003||p
2162 pack_cat||5.007003|
2163 pack_rec|||
2164 package_version|||
2165 package|||
2166 packlist||5.008001|
2167 pad_add_anon||5.008001|
2168 pad_add_name_pvn||5.015001|
2169 pad_add_name_pvs||5.015001|
2170 pad_add_name_pv||5.015001|
2171 pad_add_name_sv||5.015001|
2172 pad_add_weakref|||
2173 pad_alloc_name|||
2174 pad_alloc|||
2175 pad_block_start|||
2176 pad_check_dup|||
2177 pad_compname_type||5.009003|
2178 pad_findlex|||
2179 pad_findmy_pvn||5.015001|
2180 pad_findmy_pvs||5.015001|
2181 pad_findmy_pv||5.015001|
2182 pad_findmy_sv||5.015001|
2183 pad_fixup_inner_anons|||
2184 pad_free|||
2185 pad_leavemy|||
2186 pad_new||5.008001|
2187 pad_push|||
2188 pad_reset|||
2189 pad_setsv|||
2190 pad_sv|||
2191 pad_swipe|||
2192 pad_tidy||5.008001|
2193 padlist_dup|||
2194 padlist_store|||
2195 padname_dup|||
2196 padname_free|||
2197 padnamelist_dup|||
2198 padnamelist_fetch||5.021007|n
2199 padnamelist_free|||
2200 padnamelist_store||5.021007|
2201 parse_arithexpr||5.013008|
2202 parse_barestmt||5.013007|
2203 parse_block||5.013007|
2204 parse_body|||
2205 parse_fullexpr||5.013008|
2206 parse_fullstmt||5.013005|
2207 parse_gv_stash_name|||
2208 parse_ident|||
2209 parse_label||5.013007|
2210 parse_listexpr||5.013008|
2211 parse_lparen_question_flags|||
2212 parse_stmtseq||5.013006|
2213 parse_subsignature|||
2214 parse_termexpr||5.013008|
2215 parse_unicode_opts|||
2216 parser_dup|||
2217 parser_free_nexttoke_ops|||
2218 parser_free|||
2219 path_is_searchable|||n
2220 peep|||
2221 pending_ident|||
2222 perl_alloc_using|||n
2223 perl_alloc|||n
2224 perl_clone_using|||n
2225 perl_clone|||n
2226 perl_construct|||n
2227 perl_destruct||5.007003|n
2228 perl_free|||n
2229 perl_parse||5.006000|n
2230 perl_run|||n
2231 pidgone|||
2232 pm_description|||
2233 pmop_dump||5.006000|
2234 pmruntime|||
2235 pmtrans|||
2236 pop_scope|||
2237 populate_ANYOF_from_invlist|||
2238 populate_isa|||v
2239 pregcomp||5.009005|
2240 pregexec|||
2241 pregfree2||5.011000|
2242 pregfree|||
2243 prescan_version||5.011004|
2244 printbuf|||
2245 printf_nocontext|||vn
2246 process_special_blocks|||
2247 ptr_hash|||n
2248 ptr_table_clear||5.009005|
2249 ptr_table_fetch||5.009005|
2250 ptr_table_find|||n
2251 ptr_table_free||5.009005|
2252 ptr_table_new||5.009005|
2253 ptr_table_split||5.009005|
2254 ptr_table_store||5.009005|
2255 push_scope|||
2256 put_charclass_bitmap_innards|||
2257 put_code_point|||
2258 put_range|||
2259 pv_display|5.006000||p
2260 pv_escape|5.009004||p
2261 pv_pretty|5.009004||p
2262 pv_uni_display||5.007003|
2263 qerror|||
2264 qsortsvu|||
2265 quadmath_format_needed|||n
2266 quadmath_format_single|||n
2267 re_compile||5.009005|
2268 re_croak2|||
2269 re_dup_guts|||
2270 re_intuit_start||5.019001|
2271 re_intuit_string||5.006000|
2272 re_op_compile|||
2273 realloc||5.007002|n
2274 reentrant_free||5.021008|
2275 reentrant_init||5.021008|
2276 reentrant_retry||5.021008|vn
2277 reentrant_size||5.021008|
2278 ref_array_or_hash|||
2279 refcounted_he_chain_2hv|||
2280 refcounted_he_fetch_pvn|||
2281 refcounted_he_fetch_pvs|||
2282 refcounted_he_fetch_pv|||
2283 refcounted_he_fetch_sv|||
2284 refcounted_he_free|||
2285 refcounted_he_inc|||
2286 refcounted_he_new_pvn|||
2287 refcounted_he_new_pvs|||
2288 refcounted_he_new_pv|||
2289 refcounted_he_new_sv|||
2290 refcounted_he_value|||
2291 refkids|||
2292 refto|||
2293 ref||5.021008|
2294 reg2Lanode|||
2295 reg_check_named_buff_matched|||n
2296 reg_named_buff_all||5.009005|
2297 reg_named_buff_exists||5.009005|
2298 reg_named_buff_fetch||5.009005|
2299 reg_named_buff_firstkey||5.009005|
2300 reg_named_buff_iter|||
2301 reg_named_buff_nextkey||5.009005|
2302 reg_named_buff_scalar||5.009005|
2303 reg_named_buff|||
2304 reg_node|||
2305 reg_numbered_buff_fetch|||
2306 reg_numbered_buff_length|||
2307 reg_numbered_buff_store|||
2308 reg_qr_package|||
2309 reg_recode|||
2310 reg_scan_name|||
2311 reg_skipcomment|||n
2312 reg_temp_copy|||
2313 reganode|||
2314 regatom|||
2315 regbranch|||
2316 regclass_swash||5.009004|
2317 regclass|||
2318 regcppop|||
2319 regcppush|||
2320 regcurly|||n
2321 regdump_extflags|||
2322 regdump_intflags|||
2323 regdump||5.005000|
2324 regdupe_internal|||
2325 regexec_flags||5.005000|
2326 regfree_internal||5.009005|
2327 reghop3|||n
2328 reghop4|||n
2329 reghopmaybe3|||n
2330 reginclass|||
2331 reginitcolors||5.006000|
2332 reginsert|||
2333 regmatch|||
2334 regnext||5.005000|
2335 regnode_guts|||
2336 regpatws|||n
2337 regpiece|||
2338 regpposixcc|||
2339 regprop|||
2340 regrepeat|||
2341 regtail_study|||
2342 regtail|||
2343 regtry|||
2344 reg|||
2345 repeatcpy|||n
2346 report_evil_fh|||
2347 report_redefined_cv|||
2348 report_uninit|||
2349 report_wrongway_fh|||
2350 require_pv||5.006000|
2351 require_tie_mod|||
2352 restore_magic|||
2353 rninstr|||n
2354 rpeep|||
2355 rsignal_restore|||
2356 rsignal_save|||
2357 rsignal_state||5.004000|
2358 rsignal||5.004000|
2359 run_body|||
2360 run_user_filter|||
2361 runops_debug||5.005000|
2362 runops_standard||5.005000|
2363 rv2cv_op_cv||5.013006|
2364 rvpv_dup|||
2365 rxres_free|||
2366 rxres_restore|||
2367 rxres_save|||
2368 safesyscalloc||5.006000|n
2369 safesysfree||5.006000|n
2370 safesysmalloc||5.006000|n
2371 safesysrealloc||5.006000|n
2372 same_dirent|||
2373 save_I16||5.004000|
2374 save_I32|||
2375 save_I8||5.006000|
2376 save_adelete||5.011000|
2377 save_aelem_flags||5.011000|
2378 save_aelem||5.004050|
2379 save_aliased_sv|||
2380 save_alloc||5.006000|
2381 save_aptr|||
2382 save_ary|||
2383 save_bool||5.008001|
2384 save_clearsv|||
2385 save_delete|||
2386 save_destructor_x||5.006000|
2387 save_destructor||5.006000|
2388 save_freeop|||
2389 save_freepv|||
2390 save_freesv|||
2391 save_generic_pvref||5.006001|
2392 save_generic_svref||5.005030|
2393 save_gp||5.004000|
2394 save_hash|||
2395 save_hdelete||5.011000|
2396 save_hek_flags|||n
2397 save_helem_flags||5.011000|
2398 save_helem||5.004050|
2399 save_hints||5.010001|
2400 save_hptr|||
2401 save_int|||
2402 save_item|||
2403 save_iv||5.005000|
2404 save_lines|||
2405 save_list|||
2406 save_long|||
2407 save_magic_flags|||
2408 save_mortalizesv||5.007001|
2409 save_nogv|||
2410 save_op||5.005000|
2411 save_padsv_and_mortalize||5.010001|
2412 save_pptr|||
2413 save_pushi32ptr||5.010001|
2414 save_pushptri32ptr|||
2415 save_pushptrptr||5.010001|
2416 save_pushptr||5.010001|
2417 save_re_context||5.006000|
2418 save_scalar_at|||
2419 save_scalar|||
2420 save_set_svflags||5.009000|
2421 save_shared_pvref||5.007003|
2422 save_sptr|||
2423 save_strlen|||
2424 save_svref|||
2425 save_vptr||5.006000|
2426 savepvn|||
2427 savepvs||5.009003|
2428 savepv|||
2429 savesharedpvn||5.009005|
2430 savesharedpvs||5.013006|
2431 savesharedpv||5.007003|
2432 savesharedsvpv||5.013006|
2433 savestack_grow_cnt||5.008001|
2434 savestack_grow|||
2435 savesvpv||5.009002|
2436 sawparens|||
2437 scalar_mod_type|||n
2438 scalarboolean|||
2439 scalarkids|||
2440 scalarseq|||
2441 scalarvoid|||
2442 scalar|||
2443 scan_bin||5.006000|
2444 scan_commit|||
2445 scan_const|||
2446 scan_formline|||
2447 scan_heredoc|||
2448 scan_hex|||
2449 scan_ident|||
2450 scan_inputsymbol|||
2451 scan_num||5.007001|
2452 scan_oct|||
2453 scan_pat|||
2454 scan_str|||
2455 scan_subst|||
2456 scan_trans|||
2457 scan_version||5.009001|
2458 scan_vstring||5.009005|
2459 scan_word|||
2460 search_const|||
2461 seed||5.008001|
2462 sequence_num|||
2463 set_ANYOF_arg|||
2464 set_caret_X|||
2465 set_context||5.006000|n
2466 set_numeric_local||5.006000|
2467 set_numeric_radix||5.006000|
2468 set_numeric_standard||5.006000|
2469 set_padlist|||n
2470 setdefout|||
2471 share_hek_flags|||
2472 share_hek||5.004000|
2473 should_warn_nl|||n
2474 si_dup|||
2475 sighandler|||n
2476 simplify_sort|||
2477 skipspace_flags|||
2478 softref2xv|||
2479 sortcv_stacked|||
2480 sortcv_xsub|||
2481 sortcv|||
2482 sortsv_flags||5.009003|
2483 sortsv||5.007003|
2484 space_join_names_mortal|||
2485 ss_dup|||
2486 ssc_add_range|||
2487 ssc_and|||
2488 ssc_anything|||
2489 ssc_clear_locale|||n
2490 ssc_cp_and|||
2491 ssc_finalize|||
2492 ssc_init|||
2493 ssc_intersection|||
2494 ssc_is_anything|||n
2495 ssc_is_cp_posixl_init|||n
2496 ssc_or|||
2497 ssc_union|||
2498 stack_grow|||
2499 start_glob|||
2500 start_subparse||5.004000|
2501 stdize_locale|||
2502 strEQ|||
2503 strGE|||
2504 strGT|||
2505 strLE|||
2506 strLT|||
2507 strNE|||
2508 str_to_version||5.006000|
2509 strip_return|||
2510 strnEQ|||
2511 strnNE|||
2512 study_chunk|||
2513 sub_crush_depth|||
2514 sublex_done|||
2515 sublex_push|||
2516 sublex_start|||
2517 sv_2bool_flags||5.013006|
2518 sv_2bool|||
2519 sv_2cv|||
2520 sv_2io|||
2521 sv_2iuv_common|||
2522 sv_2iuv_non_preserve|||
2523 sv_2iv_flags||5.009001|
2524 sv_2iv|||
2525 sv_2mortal|||
2526 sv_2num|||
2527 sv_2nv_flags||5.013001|
2528 sv_2pv_flags|5.007002||p
2529 sv_2pv_nolen|5.006000||p
2530 sv_2pvbyte_nolen|5.006000||p
2531 sv_2pvbyte|5.006000||p
2532 sv_2pvutf8_nolen||5.006000|
2533 sv_2pvutf8||5.006000|
2534 sv_2pv|||
2535 sv_2uv_flags||5.009001|
2536 sv_2uv|5.004000||p
2537 sv_add_arena|||
2538 sv_add_backref|||
2539 sv_backoff|||n
2540 sv_bless|||
2541 sv_buf_to_ro|||
2542 sv_buf_to_rw|||
2543 sv_cat_decode||5.008001|
2544 sv_catpv_flags||5.013006|
2545 sv_catpv_mg|5.004050||p
2546 sv_catpv_nomg||5.013006|
2547 sv_catpvf_mg_nocontext|||pvn
2548 sv_catpvf_mg|5.006000|5.004000|pv
2549 sv_catpvf_nocontext|||vn
2550 sv_catpvf||5.004000|v
2551 sv_catpvn_flags||5.007002|
2552 sv_catpvn_mg|5.004050||p
2553 sv_catpvn_nomg|5.007002||p
2554 sv_catpvn|||
2555 sv_catpvs_flags||5.013006|
2556 sv_catpvs_mg||5.013006|
2557 sv_catpvs_nomg||5.013006|
2558 sv_catpvs|5.009003||p
2559 sv_catpv|||
2560 sv_catsv_flags||5.007002|
2561 sv_catsv_mg|5.004050||p
2562 sv_catsv_nomg|5.007002||p
2563 sv_catsv|||
2564 sv_chop|||
2565 sv_clean_all|||
2566 sv_clean_objs|||
2567 sv_clear|||
2568 sv_cmp_flags||5.013006|
2569 sv_cmp_locale_flags||5.013006|
2570 sv_cmp_locale||5.004000|
2571 sv_cmp|||
2572 sv_collxfrm_flags||5.013006|
2573 sv_collxfrm|||
2574 sv_copypv_flags||5.017002|
2575 sv_copypv_nomg||5.017002|
2576 sv_copypv|||
2577 sv_dec_nomg||5.013002|
2578 sv_dec|||
2579 sv_del_backref|||
2580 sv_derived_from_pvn||5.015004|
2581 sv_derived_from_pv||5.015004|
2582 sv_derived_from_sv||5.015004|
2583 sv_derived_from||5.004000|
2584 sv_destroyable||5.010000|
2585 sv_display|||
2586 sv_does_pvn||5.015004|
2587 sv_does_pv||5.015004|
2588 sv_does_sv||5.015004|
2589 sv_does||5.009004|
2590 sv_dump|||
2591 sv_dup_common|||
2592 sv_dup_inc_multiple|||
2593 sv_dup_inc|||
2594 sv_dup|||
2595 sv_eq_flags||5.013006|
2596 sv_eq|||
2597 sv_exp_grow|||
2598 sv_force_normal_flags||5.007001|
2599 sv_force_normal||5.006000|
2600 sv_free2|||
2601 sv_free_arenas|||
2602 sv_free|||
2603 sv_get_backrefs||5.021008|n
2604 sv_gets||5.003070|
2605 sv_grow|||
2606 sv_i_ncmp|||
2607 sv_inc_nomg||5.013002|
2608 sv_inc|||
2609 sv_insert_flags||5.010001|
2610 sv_insert|||
2611 sv_isa|||
2612 sv_isobject|||
2613 sv_iv||5.005000|
2614 sv_kill_backrefs|||
2615 sv_len_utf8_nomg|||
2616 sv_len_utf8||5.006000|
2617 sv_len|||
2618 sv_magic_portable|5.021008|5.004000|p
2619 sv_magicext_mglob|||
2620 sv_magicext||5.007003|
2621 sv_magic|||
2622 sv_mortalcopy_flags|||
2623 sv_mortalcopy|||
2624 sv_ncmp|||
2625 sv_newmortal|||
2626 sv_newref|||
2627 sv_nolocking||5.007003|
2628 sv_nosharing||5.007003|
2629 sv_nounlocking|||
2630 sv_nv||5.005000|
2631 sv_only_taint_gmagic|||n
2632 sv_or_pv_pos_u2b|||
2633 sv_peek||5.005000|
2634 sv_pos_b2u_flags||5.019003|
2635 sv_pos_b2u_midway|||
2636 sv_pos_b2u||5.006000|
2637 sv_pos_u2b_cached|||
2638 sv_pos_u2b_flags||5.011005|
2639 sv_pos_u2b_forwards|||n
2640 sv_pos_u2b_midway|||n
2641 sv_pos_u2b||5.006000|
2642 sv_pvbyten_force||5.006000|
2643 sv_pvbyten||5.006000|
2644 sv_pvbyte||5.006000|
2645 sv_pvn_force_flags|5.007002||p
2646 sv_pvn_force|||
2647 sv_pvn_nomg|5.007003|5.005000|p
2648 sv_pvn||5.005000|
2649 sv_pvutf8n_force||5.006000|
2650 sv_pvutf8n||5.006000|
2651 sv_pvutf8||5.006000|
2652 sv_pv||5.006000|
2653 sv_recode_to_utf8||5.007003|
2654 sv_reftype|||
2655 sv_ref|||
2656 sv_release_COW|||
2657 sv_replace|||
2658 sv_report_used|||
2659 sv_resetpvn|||
2660 sv_reset|||
2661 sv_rvweaken||5.006000|
2662 sv_sethek|||
2663 sv_setiv_mg|5.004050||p
2664 sv_setiv|||
2665 sv_setnv_mg|5.006000||p
2666 sv_setnv|||
2667 sv_setpv_mg|5.004050||p
2668 sv_setpvf_mg_nocontext|||pvn
2669 sv_setpvf_mg|5.006000|5.004000|pv
2670 sv_setpvf_nocontext|||vn
2671 sv_setpvf||5.004000|v
2672 sv_setpviv_mg||5.008001|
2673 sv_setpviv||5.008001|
2674 sv_setpvn_mg|5.004050||p
2675 sv_setpvn|||
2676 sv_setpvs_mg||5.013006|
2677 sv_setpvs|5.009004||p
2678 sv_setpv|||
2679 sv_setref_iv|||
2680 sv_setref_nv|||
2681 sv_setref_pvn|||
2682 sv_setref_pvs||5.021008|
2683 sv_setref_pv|||
2684 sv_setref_uv||5.007001|
2685 sv_setsv_cow|||
2686 sv_setsv_flags||5.007002|
2687 sv_setsv_mg|5.004050||p
2688 sv_setsv_nomg|5.007002||p
2689 sv_setsv|||
2690 sv_setuv_mg|5.004050||p
2691 sv_setuv|5.004000||p
2692 sv_tainted||5.004000|
2693 sv_taint||5.004000|
2694 sv_true||5.005000|
2695 sv_unglob|||
2696 sv_uni_display||5.007003|
2697 sv_unmagicext|5.013008||p
2698 sv_unmagic|||
2699 sv_unref_flags||5.007001|
2700 sv_unref|||
2701 sv_untaint||5.004000|
2702 sv_upgrade|||
2703 sv_usepvn_flags||5.009004|
2704 sv_usepvn_mg|5.004050||p
2705 sv_usepvn|||
2706 sv_utf8_decode||5.006000|
2707 sv_utf8_downgrade||5.006000|
2708 sv_utf8_encode||5.006000|
2709 sv_utf8_upgrade_flags_grow||5.011000|
2710 sv_utf8_upgrade_flags||5.007002|
2711 sv_utf8_upgrade_nomg||5.007002|
2712 sv_utf8_upgrade||5.007001|
2713 sv_uv|5.005000||p
2714 sv_vcatpvf_mg|5.006000|5.004000|p
2715 sv_vcatpvfn_flags||5.017002|
2716 sv_vcatpvfn||5.004000|
2717 sv_vcatpvf|5.006000|5.004000|p
2718 sv_vsetpvf_mg|5.006000|5.004000|p
2719 sv_vsetpvfn||5.004000|
2720 sv_vsetpvf|5.006000|5.004000|p
2721 svtype|||
2722 swallow_bom|||
2723 swash_fetch||5.007002|
2724 swash_init||5.006000|
2725 swash_scan_list_line|||
2726 swatch_get|||
2727 sync_locale||5.021004|
2728 sys_init3||5.010000|n
2729 sys_init||5.010000|n
2730 sys_intern_clear|||
2731 sys_intern_dup|||
2732 sys_intern_init|||
2733 sys_term||5.010000|n
2734 taint_env|||
2735 taint_proper|||
2736 tied_method|||v
2737 tmps_grow_p|||
2738 toFOLD_uni||5.007003|
2739 toFOLD_utf8||5.019001|
2740 toFOLD||5.019001|
2741 toLOWER_L1||5.019001|
2742 toLOWER_LC||5.004000|
2743 toLOWER_uni||5.007003|
2744 toLOWER_utf8||5.015007|
2745 toLOWER|||
2746 toTITLE_uni||5.007003|
2747 toTITLE_utf8||5.015007|
2748 toTITLE||5.019001|
2749 toUPPER_uni||5.007003|
2750 toUPPER_utf8||5.015007|
2751 toUPPER|||
2752 to_byte_substr|||
2753 to_lower_latin1|||n
2754 to_uni_fold||5.007003|
2755 to_uni_lower_lc||5.006000|
2756 to_uni_lower||5.007003|
2757 to_uni_title_lc||5.006000|
2758 to_uni_title||5.007003|
2759 to_uni_upper_lc||5.006000|
2760 to_uni_upper||5.007003|
2761 to_utf8_case||5.007003|
2762 to_utf8_fold||5.015007|
2763 to_utf8_lower||5.015007|
2764 to_utf8_substr|||
2765 to_utf8_title||5.015007|
2766 to_utf8_upper||5.015007|
2767 tokenize_use|||
2768 tokeq|||
2769 tokereport|||
2770 too_few_arguments_pv|||
2771 too_many_arguments_pv|||
2772 translate_substr_offsets|||n
2773 try_amagic_bin|||
2774 try_amagic_un|||
2775 uiv_2buf|||n
2776 unlnk|||
2777 unpack_rec|||
2778 unpack_str||5.007003|
2779 unpackstring||5.008001|
2780 unreferenced_to_tmp_stack|||
2781 unshare_hek_or_pvn|||
2782 unshare_hek|||
2783 unsharepvn||5.003070|
2784 unwind_handler_stack|||
2785 update_debugger_info|||
2786 upg_version||5.009005|
2787 usage|||
2788 utf16_textfilter|||
2789 utf16_to_utf8_reversed||5.006001|
2790 utf16_to_utf8||5.006001|
2791 utf8_distance||5.006000|
2792 utf8_hop||5.006000|n
2793 utf8_length||5.007001|
2794 utf8_mg_len_cache_update|||
2795 utf8_mg_pos_cache_update|||
2796 utf8_to_bytes||5.006001|
2797 utf8_to_uvchr_buf||5.015009|
2798 utf8_to_uvchr||5.007001|
2799 utf8_to_uvuni_buf||5.015009|
2800 utf8_to_uvuni||5.007001|
2801 utf8n_to_uvchr||5.007001|
2802 utf8n_to_uvuni||5.007001|
2803 utilize|||
2804 uvchr_to_utf8_flags||5.007003|
2805 uvchr_to_utf8||5.007001|
2806 uvoffuni_to_utf8_flags||5.019004|
2807 uvuni_to_utf8_flags||5.007003|
2808 uvuni_to_utf8||5.007001|
2809 valid_utf8_to_uvchr||5.015009|
2810 valid_utf8_to_uvuni||5.015009|
2811 validate_proto|||
2812 validate_suid|||
2813 varname|||
2814 vcmp||5.009000|
2815 vcroak||5.006000|
2816 vdeb||5.007003|
2817 vform||5.006000|
2818 visit|||
2819 vivify_defelem|||
2820 vivify_ref|||
2821 vload_module|5.006000||p
2822 vmess||5.006000|
2823 vnewSVpvf|5.006000|5.004000|p
2824 vnormal||5.009002|
2825 vnumify||5.009000|
2826 vstringify||5.009000|
2827 vverify||5.009003|
2828 vwarner||5.006000|
2829 vwarn||5.006000|
2830 wait4pid|||
2831 warn_nocontext|||vn
2832 warn_sv||5.013001|
2833 warner_nocontext|||vn
2834 warner|5.006000|5.004000|pv
2835 warn|||v
2836 was_lvalue_sub|||
2837 watch|||
2838 whichsig_pvn||5.015004|
2839 whichsig_pv||5.015004|
2840 whichsig_sv||5.015004|
2841 whichsig|||
2842 win32_croak_not_implemented|||n
2843 with_queued_errors|||
2844 wrap_op_checker||5.015008|
2845 write_to_stderr|||
2846 xs_boot_epilog|||
2847 xs_handshake|||vn
2848 xs_version_bootcheck|||
2849 yyerror_pvn|||
2850 yyerror_pv|||
2851 yyerror|||
2852 yylex|||
2853 yyparse|||
2854 yyunlex|||
2855 yywarn|||
2856 );
2857
2858 if (exists $opt{'list-unsupported'}) {
2859 my $f;
2860 for $f (sort { lc $a cmp lc $b } keys %API) {
2861 next unless $API{$f}{todo};
2862 print "$f ", '.'x(40-length($f)), " ", format_version($API{$f}{todo}), "\n";
2863 }
2864 exit 0;
2865 }
2866
2867 # Scan for possible replacement candidates
2868
2869 my(%replace, %need, %hints, %warnings, %depends);
2870 my $replace = 0;
2871 my($hint, $define, $function);
2872
2873 sub find_api
2874 {
2875 my $code = shift;
2876 $code =~ s{
2877 / (?: \*[^*]*\*+(?:[^$ccs][^*]*\*+)* / | /[^\r\n]*)
2878 | "[^"\\]*(?:\\.[^"\\]*)*"
2879 | '[^'\\]*(?:\\.[^'\\]*)*' }{}egsx;
2880 grep { exists $API{$_} } $code =~ /(\w+)/mg;
2881 }
2882
2883 while (<DATA>) {
2884 if ($hint) {
2885 my $h = $hint->[0] eq 'Hint' ? \%hints : \%warnings;
2886 if (m{^\s*\*\s(.*?)\s*$}) {
2887 for (@{$hint->[1]}) {
2888 $h->{$_} ||= ''; # suppress warning with older perls
2889 $h->{$_} .= "$1\n";
2890 }
2891 }
2892 else { undef $hint }
2893 }
2894
2895 $hint = [$1, [split /,?\s+/, $2]]
2896 if m{^\s*$rccs\s+(Hint|Warning):\s+(\w+(?:,?\s+\w+)*)\s*$};
2897
2898 if ($define) {
2899 if ($define->[1] =~ /\\$/) {
2900 $define->[1] .= $_;
2901 }
2902 else {
2903 if (exists $API{$define->[0]} && $define->[1] !~ /^DPPP_\(/) {
2904 my @n = find_api($define->[1]);
2905 push @{$depends{$define->[0]}}, @n if @n
2906 }
2907 undef $define;
2908 }
2909 }
2910
2911 $define = [$1, $2] if m{^\s*#\s*define\s+(\w+)(?:\([^)]*\))?\s+(.*)};
2912
2913 if ($function) {
2914 if (/^}/) {
2915 if (exists $API{$function->[0]}) {
2916 my @n = find_api($function->[1]);
2917 push @{$depends{$function->[0]}}, @n if @n
2918 }
2919 undef $function;
2920 }
2921 else {
2922 $function->[1] .= $_;
2923 }
2924 }
2925
2926 $function = [$1, ''] if m{^DPPP_\(my_(\w+)\)};
2927
2928 $replace = $1 if m{^\s*$rccs\s+Replace:\s+(\d+)\s+$rcce\s*$};
2929 $replace{$2} = $1 if $replace and m{^\s*#\s*define\s+(\w+)(?:\([^)]*\))?\s+(\w+)};
2930 $replace{$2} = $1 if m{^\s*#\s*define\s+(\w+)(?:\([^)]*\))?\s+(\w+).*$rccs\s+Replace\s+$rcce};
2931 $replace{$1} = $2 if m{^\s*$rccs\s+Replace (\w+) with (\w+)\s+$rcce\s*$};
2932
2933 if (m{^\s*$rccs\s+(\w+(\s*,\s*\w+)*)\s+depends\s+on\s+(\w+(\s*,\s*\w+)*)\s+$rcce\s*$}) {
2934 my @deps = map { s/\s+//g; $_ } split /,/, $3;
2935 my $d;
2936 for $d (map { s/\s+//g; $_ } split /,/, $1) {
2937 push @{$depends{$d}}, @deps;
2938 }
2939 }
2940
2941 $need{$1} = 1 if m{^#if\s+defined\(NEED_(\w+)(?:_GLOBAL)?\)};
2942 }
2943
2944 for (values %depends) {
2945 my %s;
2946 $_ = [sort grep !$s{$_}++, @$_];
2947 }
2948
2949 if (exists $opt{'api-info'}) {
2950 my $f;
2951 my $count = 0;
2952 my $match = $opt{'api-info'} =~ m!^/(.*)/$! ? $1 : "^\Q$opt{'api-info'}\E\$";
2953 for $f (sort { lc $a cmp lc $b } keys %API) {
2954 next unless $f =~ /$match/;
2955 print "\n=== $f ===\n\n";
2956 my $info = 0;
2957 if ($API{$f}{base} || $API{$f}{todo}) {
2958 my $base = format_version($API{$f}{base} || $API{$f}{todo});
2959 print "Supported at least starting from perl-$base.\n";
2960 $info++;
2961 }
2962 if ($API{$f}{provided}) {
2963 my $todo = $API{$f}{todo} ? format_version($API{$f}{todo}) : "5.003";
2964 print "Support by $ppport provided back to perl-$todo.\n";
2965 print "Support needs to be explicitly requested by NEED_$f.\n" if exists $need{$f};
2966 print "Depends on: ", join(', ', @{$depends{$f}}), ".\n" if exists $depends{$f};
2967 print "\n$hints{$f}" if exists $hints{$f};
2968 print "\nWARNING:\n$warnings{$f}" if exists $warnings{$f};
2969 $info++;
2970 }
2971 print "No portability information available.\n" unless $info;
2972 $count++;
2973 }
2974 $count or print "Found no API matching '$opt{'api-info'}'.";
2975 print "\n";
2976 exit 0;
2977 }
2978
2979 if (exists $opt{'list-provided'}) {
2980 my $f;
2981 for $f (sort { lc $a cmp lc $b } keys %API) {
2982 next unless $API{$f}{provided};
2983 my @flags;
2984 push @flags, 'explicit' if exists $need{$f};
2985 push @flags, 'depend' if exists $depends{$f};
2986 push @flags, 'hint' if exists $hints{$f};
2987 push @flags, 'warning' if exists $warnings{$f};
2988 my $flags = @flags ? ' ['.join(', ', @flags).']' : '';
2989 print "$f$flags\n";
2990 }
2991 exit 0;
2992 }
2993
2994 my @files;
2995 my @srcext = qw( .xs .c .h .cc .cpp -c.inc -xs.inc );
2996 my $srcext = join '|', map { quotemeta $_ } @srcext;
2997
2998 if (@ARGV) {
2999 my %seen;
3000 for (@ARGV) {
3001 if (-e) {
3002 if (-f) {
3003 push @files, $_ unless $seen{$_}++;
3004 }
3005 else { warn "'$_' is not a file.\n" }
3006 }
3007 else {
3008 my @new = grep { -f } glob $_
3009 or warn "'$_' does not exist.\n";
3010 push @files, grep { !$seen{$_}++ } @new;
3011 }
3012 }
3013 }
3014 else {
3015 eval {
3016 require File::Find;
3017 File::Find::find(sub {
3018 $File::Find::name =~ /($srcext)$/i
3019 and push @files, $File::Find::name;
3020 }, '.');
3021 };
3022 if ($@) {
3023 @files = map { glob "*$_" } @srcext;
3024 }
3025 }
3026
3027 if (!@ARGV || $opt{filter}) {
3028 my(@in, @out);
3029 my %xsc = map { /(.*)\.xs$/ ? ("$1.c" => 1, "$1.cc" => 1) : () } @files;
3030 for (@files) {
3031 my $out = exists $xsc{$_} || /\b\Q$ppport\E$/i || !/($srcext)$/i;
3032 push @{ $out ? \@out : \@in }, $_;
3033 }
3034 if (@ARGV && @out) {
3035 warning("Skipping the following files (use --nofilter to avoid this):\n| ", join "\n| ", @out);
3036 }
3037 @files = @in;
3038 }
3039
3040 die "No input files given!\n" unless @files;
3041
3042 my(%files, %global, %revreplace);
3043 %revreplace = reverse %replace;
3044 my $filename;
3045 my $patch_opened = 0;
3046
3047 for $filename (@files) {
3048 unless (open IN, "<$filename") {
3049 warn "Unable to read from $filename: $!\n";
3050 next;
3051 }
3052
3053 info("Scanning $filename ...");
3054
3055 my $c = do { local $/; <IN> };
3056 close IN;
3057
3058 my %file = (orig => $c, changes => 0);
3059
3060 # Temporarily remove C/XS comments and strings from the code
3061 my @ccom;
3062
3063 $c =~ s{
3064 ( ^$HS*\#$HS*include\b[^\r\n]+\b(?:\Q$ppport\E|XSUB\.h)\b[^\r\n]*
3065 | ^$HS*\#$HS*(?:define|elif|if(?:def)?)\b[^\r\n]* )
3066 | ( ^$HS*\#[^\r\n]*
3067 | "[^"\\]*(?:\\.[^"\\]*)*"
3068 | '[^'\\]*(?:\\.[^'\\]*)*'
3069 | / (?: \*[^*]*\*+(?:[^$ccs][^*]*\*+)* / | /[^\r\n]* ) )
3070 }{ defined $2 and push @ccom, $2;
3071 defined $1 ? $1 : "$ccs$#ccom$cce" }mgsex;
3072
3073 $file{ccom} = \@ccom;
3074 $file{code} = $c;
3075 $file{has_inc_ppport} = $c =~ /^$HS*#$HS*include[^\r\n]+\b\Q$ppport\E\b/m;
3076
3077 my $func;
3078
3079 for $func (keys %API) {
3080 my $match = $func;
3081 $match .= "|$revreplace{$func}" if exists $revreplace{$func};
3082 if ($c =~ /\b(?:Perl_)?($match)\b/) {
3083 $file{uses_replace}{$1}++ if exists $revreplace{$func} && $1 eq $revreplace{$func};
3084 $file{uses_Perl}{$func}++ if $c =~ /\bPerl_$func\b/;
3085 if (exists $API{$func}{provided}) {
3086 $file{uses_provided}{$func}++;
3087 if (!exists $API{$func}{base} || $API{$func}{base} > $opt{'compat-version'}) {
3088 $file{uses}{$func}++;
3089 my @deps = rec_depend($func);
3090 if (@deps) {
3091 $file{uses_deps}{$func} = \@deps;
3092 for (@deps) {
3093 $file{uses}{$_} = 0 unless exists $file{uses}{$_};
3094 }
3095 }
3096 for ($func, @deps) {
3097 $file{needs}{$_} = 'static' if exists $need{$_};
3098 }
3099 }
3100 }
3101 if (exists $API{$func}{todo} && $API{$func}{todo} > $opt{'compat-version'}) {
3102 if ($c =~ /\b$func\b/) {
3103 $file{uses_todo}{$func}++;
3104 }
3105 }
3106 }
3107 }
3108
3109 while ($c =~ /^$HS*#$HS*define$HS+(NEED_(\w+?)(_GLOBAL)?)\b/mg) {
3110 if (exists $need{$2}) {
3111 $file{defined $3 ? 'needed_global' : 'needed_static'}{$2}++;
3112 }
3113 else { warning("Possibly wrong #define $1 in $filename") }
3114 }
3115
3116 for (qw(uses needs uses_todo needed_global needed_static)) {
3117 for $func (keys %{$file{$_}}) {
3118 push @{$global{$_}{$func}}, $filename;
3119 }
3120 }
3121
3122 $files{$filename} = \%file;
3123 }
3124
3125 # Globally resolve NEED_'s
3126 my $need;
3127 for $need (keys %{$global{needs}}) {
3128 if (@{$global{needs}{$need}} > 1) {
3129 my @targets = @{$global{needs}{$need}};
3130 my @t = grep $files{$_}{needed_global}{$need}, @targets;
3131 @targets = @t if @t;
3132 @t = grep /\.xs$/i, @targets;
3133 @targets = @t if @t;
3134 my $target = shift @targets;
3135 $files{$target}{needs}{$need} = 'global';
3136 for (@{$global{needs}{$need}}) {
3137 $files{$_}{needs}{$need} = 'extern' if $_ ne $target;
3138 }
3139 }
3140 }
3141
3142 for $filename (@files) {
3143 exists $files{$filename} or next;
3144
3145 info("=== Analyzing $filename ===");
3146
3147 my %file = %{$files{$filename}};
3148 my $func;
3149 my $c = $file{code};
3150 my $warnings = 0;
3151
3152 for $func (sort keys %{$file{uses_Perl}}) {
3153 if ($API{$func}{varargs}) {
3154 unless ($API{$func}{nothxarg}) {
3155 my $changes = ($c =~ s{\b(Perl_$func\s*\(\s*)(?!aTHX_?)(\)|[^\s)]*\))}
3156 { $1 . ($2 eq ')' ? 'aTHX' : 'aTHX_ ') . $2 }ge);
3157 if ($changes) {
3158 warning("Doesn't pass interpreter argument aTHX to Perl_$func");
3159 $file{changes} += $changes;
3160 }
3161 }
3162 }
3163 else {
3164 warning("Uses Perl_$func instead of $func");
3165 $file{changes} += ($c =~ s{\bPerl_$func(\s*)\((\s*aTHX_?)?\s*}
3166 {$func$1(}g);
3167 }
3168 }
3169
3170 for $func (sort keys %{$file{uses_replace}}) {
3171 warning("Uses $func instead of $replace{$func}");
3172 $file{changes} += ($c =~ s/\b$func\b/$replace{$func}/g);
3173 }
3174
3175 for $func (sort keys %{$file{uses_provided}}) {
3176 if ($file{uses}{$func}) {
3177 if (exists $file{uses_deps}{$func}) {
3178 diag("Uses $func, which depends on ", join(', ', @{$file{uses_deps}{$func}}));
3179 }
3180 else {
3181 diag("Uses $func");
3182 }
3183 }
3184 $warnings += hint($func);
3185 }
3186
3187 unless ($opt{quiet}) {
3188 for $func (sort keys %{$file{uses_todo}}) {
3189 print "*** WARNING: Uses $func, which may not be portable below perl ",
3190 format_version($API{$func}{todo}), ", even with '$ppport'\n";
3191 $warnings++;
3192 }
3193 }
3194
3195 for $func (sort keys %{$file{needed_static}}) {
3196 my $message = '';
3197 if (not exists $file{uses}{$func}) {
3198 $message = "No need to define NEED_$func if $func is never used";
3199 }
3200 elsif (exists $file{needs}{$func} && $file{needs}{$func} ne 'static') {
3201 $message = "No need to define NEED_$func when already needed globally";
3202 }
3203 if ($message) {
3204 diag($message);
3205 $file{changes} += ($c =~ s/^$HS*#$HS*define$HS+NEED_$func\b.*$LF//mg);
3206 }
3207 }
3208
3209 for $func (sort keys %{$file{needed_global}}) {
3210 my $message = '';
3211 if (not exists $global{uses}{$func}) {
3212 $message = "No need to define NEED_${func}_GLOBAL if $func is never used";
3213 }
3214 elsif (exists $file{needs}{$func}) {
3215 if ($file{needs}{$func} eq 'extern') {
3216 $message = "No need to define NEED_${func}_GLOBAL when already needed globally";
3217 }
3218 elsif ($file{needs}{$func} eq 'static') {
3219 $message = "No need to define NEED_${func}_GLOBAL when only used in this file";
3220 }
3221 }
3222 if ($message) {
3223 diag($message);
3224 $file{changes} += ($c =~ s/^$HS*#$HS*define$HS+NEED_${func}_GLOBAL\b.*$LF//mg);
3225 }
3226 }
3227
3228 $file{needs_inc_ppport} = keys %{$file{uses}};
3229
3230 if ($file{needs_inc_ppport}) {
3231 my $pp = '';
3232
3233 for $func (sort keys %{$file{needs}}) {
3234 my $type = $file{needs}{$func};
3235 next if $type eq 'extern';
3236 my $suffix = $type eq 'global' ? '_GLOBAL' : '';
3237 unless (exists $file{"needed_$type"}{$func}) {
3238 if ($type eq 'global') {
3239 diag("Files [@{$global{needs}{$func}}] need $func, adding global request");
3240 }
3241 else {
3242 diag("File needs $func, adding static request");
3243 }
3244 $pp .= "#define NEED_$func$suffix\n";
3245 }
3246 }
3247
3248 if ($pp && ($c =~ s/^(?=$HS*#$HS*define$HS+NEED_\w+)/$pp/m)) {
3249 $pp = '';
3250 $file{changes}++;
3251 }
3252
3253 unless ($file{has_inc_ppport}) {
3254 diag("Needs to include '$ppport'");
3255 $pp .= qq(#include "$ppport"\n)
3256 }
3257
3258 if ($pp) {
3259 $file{changes} += ($c =~ s/^($HS*#$HS*define$HS+NEED_\w+.*?)^/$1$pp/ms)
3260 || ($c =~ s/^(?=$HS*#$HS*include.*\Q$ppport\E)/$pp/m)
3261 || ($c =~ s/^($HS*#$HS*include.*XSUB.*\s*?)^/$1$pp/m)
3262 || ($c =~ s/^/$pp/);
3263 }
3264 }
3265 else {
3266 if ($file{has_inc_ppport}) {
3267 diag("No need to include '$ppport'");
3268 $file{changes} += ($c =~ s/^$HS*?#$HS*include.*\Q$ppport\E.*?$LF//m);
3269 }
3270 }
3271
3272 # put back in our C comments
3273 my $ix;
3274 my $cppc = 0;
3275 my @ccom = @{$file{ccom}};
3276 for $ix (0 .. $#ccom) {
3277 if (!$opt{cplusplus} && $ccom[$ix] =~ s!^//!!) {
3278 $cppc++;
3279 $file{changes} += $c =~ s/$rccs$ix$rcce/$ccs$ccom[$ix] $cce/;
3280 }
3281 else {
3282 $c =~ s/$rccs$ix$rcce/$ccom[$ix]/;
3283 }
3284 }
3285
3286 if ($cppc) {
3287 my $s = $cppc != 1 ? 's' : '';
3288 warning("Uses $cppc C++ style comment$s, which is not portable");
3289 }
3290
3291 my $s = $warnings != 1 ? 's' : '';
3292 my $warn = $warnings ? " ($warnings warning$s)" : '';
3293 info("Analysis completed$warn");
3294
3295 if ($file{changes}) {
3296 if (exists $opt{copy}) {
3297 my $newfile = "$filename$opt{copy}";
3298 if (-e $newfile) {
3299 error("'$newfile' already exists, refusing to write copy of '$filename'");
3300 }
3301 else {
3302 local *F;
3303 if (open F, ">$newfile") {
3304 info("Writing copy of '$filename' with changes to '$newfile'");
3305 print F $c;
3306 close F;
3307 }
3308 else {
3309 error("Cannot open '$newfile' for writing: $!");
3310 }
3311 }
3312 }
3313 elsif (exists $opt{patch} || $opt{changes}) {
3314 if (exists $opt{patch}) {
3315 unless ($patch_opened) {
3316 if (open PATCH, ">$opt{patch}") {
3317 $patch_opened = 1;
3318 }
3319 else {
3320 error("Cannot open '$opt{patch}' for writing: $!");
3321 delete $opt{patch};
3322 $opt{changes} = 1;
3323 goto fallback;
3324 }
3325 }
3326 mydiff(\*PATCH, $filename, $c);
3327 }
3328 else {
3329 fallback:
3330 info("Suggested changes:");
3331 mydiff(\*STDOUT, $filename, $c);
3332 }
3333 }
3334 else {
3335 my $s = $file{changes} == 1 ? '' : 's';
3336 info("$file{changes} potentially required change$s detected");
3337 }
3338 }
3339 else {
3340 info("Looks good");
3341 }
3342 }
3343
3344 close PATCH if $patch_opened;
3345
3346 exit 0;
3347
3348
3349 sub try_use { eval "use @_;"; return $@ eq '' }
3350
3351 sub mydiff
3352 {
3353 local *F = shift;
3354 my($file, $str) = @_;
3355 my $diff;
3356
3357 if (exists $opt{diff}) {
3358 $diff = run_diff($opt{diff}, $file, $str);
3359 }
3360
3361 if (!defined $diff and try_use('Text::Diff')) {
3362 $diff = Text::Diff::diff($file, \$str, { STYLE => 'Unified' });
3363 $diff = <<HEADER . $diff;
3364 --- $file
3365 +++ $file.patched
3366 HEADER
3367 }
3368
3369 if (!defined $diff) {
3370 $diff = run_diff('diff -u', $file, $str);
3371 }
3372
3373 if (!defined $diff) {
3374 $diff = run_diff('diff', $file, $str);
3375 }
3376
3377 if (!defined $diff) {
3378 error("Cannot generate a diff. Please install Text::Diff or use --copy.");
3379 return;
3380 }
3381
3382 print F $diff;
3383 }
3384
3385 sub run_diff
3386 {
3387 my($prog, $file, $str) = @_;
3388 my $tmp = 'dppptemp';
3389 my $suf = 'aaa';
3390 my $diff = '';
3391 local *F;
3392
3393 while (-e "$tmp.$suf") { $suf++ }
3394 $tmp = "$tmp.$suf";
3395
3396 if (open F, ">$tmp") {
3397 print F $str;
3398 close F;
3399
3400 if (open F, "$prog $file $tmp |") {
3401 while (<F>) {
3402 s/\Q$tmp\E/$file.patched/;
3403 $diff .= $_;
3404 }
3405 close F;
3406 unlink $tmp;
3407 return $diff;
3408 }
3409
3410 unlink $tmp;
3411 }
3412 else {
3413 error("Cannot open '$tmp' for writing: $!");
3414 }
3415
3416 return undef;
3417 }
3418
3419 sub rec_depend
3420 {
3421 my($func, $seen) = @_;
3422 return () unless exists $depends{$func};
3423 $seen = {%{$seen||{}}};
3424 return () if $seen->{$func}++;
3425 my %s;
3426 grep !$s{$_}++, map { ($_, rec_depend($_, $seen)) } @{$depends{$func}};
3427 }
3428
3429 sub parse_version
3430 {
3431 my $ver = shift;
3432
3433 if ($ver =~ /^(\d+)\.(\d+)\.(\d+)$/) {
3434 return ($1, $2, $3);
3435 }
3436 elsif ($ver !~ /^\d+\.[\d_]+$/) {
3437 die "cannot parse version '$ver'\n";
3438 }
3439
3440 $ver =~ s/_//g;
3441 $ver =~ s/$/000000/;
3442
3443 my($r,$v,$s) = $ver =~ /(\d+)\.(\d{3})(\d{3})/;
3444
3445 $v = int $v;
3446 $s = int $s;
3447
3448 if ($r < 5 || ($r == 5 && $v < 6)) {
3449 if ($s % 10) {
3450 die "cannot parse version '$ver'\n";
3451 }
3452 }
3453
3454 return ($r, $v, $s);
3455 }
3456
3457 sub format_version
3458 {
3459 my $ver = shift;
3460
3461 $ver =~ s/$/000000/;
3462 my($r,$v,$s) = $ver =~ /(\d+)\.(\d{3})(\d{3})/;
3463
3464 $v = int $v;
3465 $s = int $s;
3466
3467 if ($r < 5 || ($r == 5 && $v < 6)) {
3468 if ($s % 10) {
3469 die "invalid version '$ver'\n";
3470 }
3471 $s /= 10;
3472
3473 $ver = sprintf "%d.%03d", $r, $v;
3474 $s > 0 and $ver .= sprintf "_%02d", $s;
3475
3476 return $ver;
3477 }
3478
3479 return sprintf "%d.%d.%d", $r, $v, $s;
3480 }
3481
3482 sub info
3483 {
3484 $opt{quiet} and return;
3485 print @_, "\n";
3486 }
3487
3488 sub diag
3489 {
3490 $opt{quiet} and return;
3491 $opt{diag} and print @_, "\n";
3492 }
3493
3494 sub warning
3495 {
3496 $opt{quiet} and return;
3497 print "*** ", @_, "\n";
3498 }
3499
3500 sub error
3501 {
3502 print "*** ERROR: ", @_, "\n";
3503 }
3504
3505 my %given_hints;
3506 my %given_warnings;
3507 sub hint
3508 {
3509 $opt{quiet} and return;
3510 my $func = shift;
3511 my $rv = 0;
3512 if (exists $warnings{$func} && !$given_warnings{$func}++) {
3513 my $warn = $warnings{$func};
3514 $warn =~ s!^!*** !mg;
3515 print "*** WARNING: $func\n", $warn;
3516 $rv++;
3517 }
3518 if ($opt{hints} && exists $hints{$func} && !$given_hints{$func}++) {
3519 my $hint = $hints{$func};
3520 $hint =~ s/^/ /mg;
3521 print " --- hint for $func ---\n", $hint;
3522 }
3523 $rv;
3524 }
3525
3526 sub usage
3527 {
3528 my($usage) = do { local(@ARGV,$/)=($0); <> } =~ /^=head\d$HS+SYNOPSIS\s*^(.*?)\s*^=/ms;
3529 my %M = ( 'I' => '*' );
3530 $usage =~ s/^\s*perl\s+\S+/$^X $0/;
3531 $usage =~ s/([A-Z])<([^>]+)>/$M{$1}$2$M{$1}/g;
3532
3533 print <<ENDUSAGE;
3534
3535 Usage: $usage
3536
3537 See perldoc $0 for details.
3538
3539 ENDUSAGE
3540
3541 exit 2;
3542 }
3543
3544 sub strip
3545 {
3546 my $self = do { local(@ARGV,$/)=($0); <> };
3547 my($copy) = $self =~ /^=head\d\s+COPYRIGHT\s*^(.*?)^=\w+/ms;
3548 $copy =~ s/^(?=\S+)/ /gms;
3549 $self =~ s/^$HS+Do NOT edit.*?(?=^-)/$copy/ms;
3550 $self =~ s/^SKIP.*(?=^__DATA__)/SKIP
3551 if (\@ARGV && \$ARGV[0] eq '--unstrip') {
3552 eval { require Devel::PPPort };
3553 \$@ and die "Cannot require Devel::PPPort, please install.\\n";
3554 if (eval \$Devel::PPPort::VERSION < $VERSION) {
3555 die "$0 was originally generated with Devel::PPPort $VERSION.\\n"
3556 . "Your Devel::PPPort is only version \$Devel::PPPort::VERSION.\\n"
3557 . "Please install a newer version, or --unstrip will not work.\\n";
3558 }
3559 Devel::PPPort::WriteFile(\$0);
3560 exit 0;
3561 }
3562 print <<END;
3563
3564 Sorry, but this is a stripped version of \$0.
3565
3566 To be able to use its original script and doc functionality,
3567 please try to regenerate this file using:
3568
3569 \$^X \$0 --unstrip
3570
3571 END
3572 /ms;
3573 my($pl, $c) = $self =~ /(.*^__DATA__)(.*)/ms;
3574 $c =~ s{
3575 / (?: \*[^*]*\*+(?:[^$ccs][^*]*\*+)* / | /[^\r\n]*)
3576 | ( "[^"\\]*(?:\\.[^"\\]*)*"
3577 | '[^'\\]*(?:\\.[^'\\]*)*' )
3578 | ($HS+) }{ defined $2 ? ' ' : ($1 || '') }gsex;
3579 $c =~ s!\s+$!!mg;
3580 $c =~ s!^$LF!!mg;
3581 $c =~ s!^\s*#\s*!#!mg;
3582 $c =~ s!^\s+!!mg;
3583
3584 open OUT, ">$0" or die "cannot strip $0: $!\n";
3585 print OUT "$pl$c\n";
3586
3587 exit 0;
3588 }
3589
3590 __DATA__
3591 */
3592
3593 #ifndef _P_P_PORTABILITY_H_
3594 #define _P_P_PORTABILITY_H_
3595
3596 #ifndef DPPP_NAMESPACE
3597 # define DPPP_NAMESPACE DPPP_
3598 #endif
3599
3600 #define DPPP_CAT2(x,y) CAT2(x,y)
3601 #define DPPP_(name) DPPP_CAT2(DPPP_NAMESPACE, name)
3602
3603 #ifndef PERL_REVISION
3604 # if !defined(__PATCHLEVEL_H_INCLUDED__) && !(defined(PATCHLEVEL) && defined(SUBVERSION))
3605 # define PERL_PATCHLEVEL_H_IMPLICIT
3606 # include <patchlevel.h>
3607 # endif
3608 # if !(defined(PERL_VERSION) || (defined(SUBVERSION) && defined(PATCHLEVEL)))
3609 # include <could_not_find_Perl_patchlevel.h>
3610 # endif
3611 # ifndef PERL_REVISION
3612 # define PERL_REVISION (5)
3613 /* Replace: 1 */
3614 # define PERL_VERSION PATCHLEVEL
3615 # define PERL_SUBVERSION SUBVERSION
3616 /* Replace PERL_PATCHLEVEL with PERL_VERSION */
3617 /* Replace: 0 */
3618 # endif
3619 #endif
3620
3621 #define _dpppDEC2BCD(dec) ((((dec)/100)<<8)|((((dec)%100)/10)<<4)|((dec)%10))
3622 #define PERL_BCDVERSION ((_dpppDEC2BCD(PERL_REVISION)<<24)|(_dpppDEC2BCD(PERL_VERSION)<<12)|_dpppDEC2BCD(PERL_SUBVERSION))
3623
3624 /* It is very unlikely that anyone will try to use this with Perl 6
3625 (or greater), but who knows.
3626 */
3627 #if PERL_REVISION != 5
3628 # error ppport.h only works with Perl version 5
3629 #endif /* PERL_REVISION != 5 */
3630 #ifndef dTHR
3631 # define dTHR dNOOP
3632 #endif
3633 #ifndef dTHX
3634 # define dTHX dNOOP
3635 #endif
3636
3637 #ifndef dTHXa
3638 # define dTHXa(x) dNOOP
3639 #endif
3640 #ifndef pTHX
3641 # define pTHX void
3642 #endif
3643
3644 #ifndef pTHX_
3645 # define pTHX_
3646 #endif
3647
3648 #ifndef aTHX
3649 # define aTHX
3650 #endif
3651
3652 #ifndef aTHX_
3653 # define aTHX_
3654 #endif
3655
3656 #if (PERL_BCDVERSION < 0x5006000)
3657 # ifdef USE_THREADS
3658 # define aTHXR thr
3659 # define aTHXR_ thr,
3660 # else
3661 # define aTHXR
3662 # define aTHXR_
3663 # endif
3664 # define dTHXR dTHR
3665 #else
3666 # define aTHXR aTHX
3667 # define aTHXR_ aTHX_
3668 # define dTHXR dTHX
3669 #endif
3670 #ifndef dTHXoa
3671 # define dTHXoa(x) dTHXa(x)
3672 #endif
3673
3674 #ifdef I_LIMITS
3675 # include <limits.h>
3676 #endif
3677
3678 #ifndef PERL_UCHAR_MIN
3679 # define PERL_UCHAR_MIN ((unsigned char)0)
3680 #endif
3681
3682 #ifndef PERL_UCHAR_MAX
3683 # ifdef UCHAR_MAX
3684 # define PERL_UCHAR_MAX ((unsigned char)UCHAR_MAX)
3685 # else
3686 # ifdef MAXUCHAR
3687 # define PERL_UCHAR_MAX ((unsigned char)MAXUCHAR)
3688 # else
3689 # define PERL_UCHAR_MAX ((unsigned char)~(unsigned)0)
3690 # endif
3691 # endif
3692 #endif
3693
3694 #ifndef PERL_USHORT_MIN
3695 # define PERL_USHORT_MIN ((unsigned short)0)
3696 #endif
3697
3698 #ifndef PERL_USHORT_MAX
3699 # ifdef USHORT_MAX
3700 # define PERL_USHORT_MAX ((unsigned short)USHORT_MAX)
3701 # else
3702 # ifdef MAXUSHORT
3703 # define PERL_USHORT_MAX ((unsigned short)MAXUSHORT)
3704 # else
3705 # ifdef USHRT_MAX
3706 # define PERL_USHORT_MAX ((unsigned short)USHRT_MAX)
3707 # else
3708 # define PERL_USHORT_MAX ((unsigned short)~(unsigned)0)
3709 # endif
3710 # endif
3711 # endif
3712 #endif
3713
3714 #ifndef PERL_SHORT_MAX
3715 # ifdef SHORT_MAX
3716 # define PERL_SHORT_MAX ((short)SHORT_MAX)
3717 # else
3718 # ifdef MAXSHORT /* Often used in <values.h> */
3719 # define PERL_SHORT_MAX ((short)MAXSHORT)
3720 # else
3721 # ifdef SHRT_MAX
3722 # define PERL_SHORT_MAX ((short)SHRT_MAX)
3723 # else
3724 # define PERL_SHORT_MAX ((short) (PERL_USHORT_MAX >> 1))
3725 # endif
3726 # endif
3727 # endif
3728 #endif
3729
3730 #ifndef PERL_SHORT_MIN
3731 # ifdef SHORT_MIN
3732 # define PERL_SHORT_MIN ((short)SHORT_MIN)
3733 # else
3734 # ifdef MINSHORT
3735 # define PERL_SHORT_MIN ((short)MINSHORT)
3736 # else
3737 # ifdef SHRT_MIN
3738 # define PERL_SHORT_MIN ((short)SHRT_MIN)
3739 # else
3740 # define PERL_SHORT_MIN (-PERL_SHORT_MAX - ((3 & -1) == 3))
3741 # endif
3742 # endif
3743 # endif
3744 #endif
3745
3746 #ifndef PERL_UINT_MAX
3747 # ifdef UINT_MAX
3748 # define PERL_UINT_MAX ((unsigned int)UINT_MAX)
3749 # else
3750 # ifdef MAXUINT
3751 # define PERL_UINT_MAX ((unsigned int)MAXUINT)
3752 # else
3753 # define PERL_UINT_MAX (~(unsigned int)0)
3754 # endif
3755 # endif
3756 #endif
3757
3758 #ifndef PERL_UINT_MIN
3759 # define PERL_UINT_MIN ((unsigned int)0)
3760 #endif
3761
3762 #ifndef PERL_INT_MAX
3763 # ifdef INT_MAX
3764 # define PERL_INT_MAX ((int)INT_MAX)
3765 # else
3766 # ifdef MAXINT /* Often used in <values.h> */
3767 # define PERL_INT_MAX ((int)MAXINT)
3768 # else
3769 # define PERL_INT_MAX ((int)(PERL_UINT_MAX >> 1))
3770 # endif
3771 # endif
3772 #endif
3773
3774 #ifndef PERL_INT_MIN
3775 # ifdef INT_MIN
3776 # define PERL_INT_MIN ((int)INT_MIN)
3777 # else
3778 # ifdef MININT
3779 # define PERL_INT_MIN ((int)MININT)
3780 # else
3781 # define PERL_INT_MIN (-PERL_INT_MAX - ((3 & -1) == 3))
3782 # endif
3783 # endif
3784 #endif
3785
3786 #ifndef PERL_ULONG_MAX
3787 # ifdef ULONG_MAX
3788 # define PERL_ULONG_MAX ((unsigned long)ULONG_MAX)
3789 # else
3790 # ifdef MAXULONG
3791 # define PERL_ULONG_MAX ((unsigned long)MAXULONG)
3792 # else
3793 # define PERL_ULONG_MAX (~(unsigned long)0)
3794 # endif
3795 # endif
3796 #endif
3797
3798 #ifndef PERL_ULONG_MIN
3799 # define PERL_ULONG_MIN ((unsigned long)0L)
3800 #endif
3801
3802 #ifndef PERL_LONG_MAX
3803 # ifdef LONG_MAX
3804 # define PERL_LONG_MAX ((long)LONG_MAX)
3805 # else
3806 # ifdef MAXLONG
3807 # define PERL_LONG_MAX ((long)MAXLONG)
3808 # else
3809 # define PERL_LONG_MAX ((long) (PERL_ULONG_MAX >> 1))
3810 # endif
3811 # endif
3812 #endif
3813
3814 #ifndef PERL_LONG_MIN
3815 # ifdef LONG_MIN
3816 # define PERL_LONG_MIN ((long)LONG_MIN)
3817 # else
3818 # ifdef MINLONG
3819 # define PERL_LONG_MIN ((long)MINLONG)
3820 # else
3821 # define PERL_LONG_MIN (-PERL_LONG_MAX - ((3 & -1) == 3))
3822 # endif
3823 # endif
3824 #endif
3825
3826 #if defined(HAS_QUAD) && (defined(convex) || defined(uts))
3827 # ifndef PERL_UQUAD_MAX
3828 # ifdef ULONGLONG_MAX
3829 # define PERL_UQUAD_MAX ((unsigned long long)ULONGLONG_MAX)
3830 # else
3831 # ifdef MAXULONGLONG
3832 # define PERL_UQUAD_MAX ((unsigned long long)MAXULONGLONG)
3833 # else
3834 # define PERL_UQUAD_MAX (~(unsigned long long)0)
3835 # endif
3836 # endif
3837 # endif
3838
3839 # ifndef PERL_UQUAD_MIN
3840 # define PERL_UQUAD_MIN ((unsigned long long)0L)
3841 # endif
3842
3843 # ifndef PERL_QUAD_MAX
3844 # ifdef LONGLONG_MAX
3845 # define PERL_QUAD_MAX ((long long)LONGLONG_MAX)
3846 # else
3847 # ifdef MAXLONGLONG
3848 # define PERL_QUAD_MAX ((long long)MAXLONGLONG)
3849 # else
3850 # define PERL_QUAD_MAX ((long long) (PERL_UQUAD_MAX >> 1))
3851 # endif
3852 # endif
3853 # endif
3854
3855 # ifndef PERL_QUAD_MIN
3856 # ifdef LONGLONG_MIN
3857 # define PERL_QUAD_MIN ((long long)LONGLONG_MIN)
3858 # else
3859 # ifdef MINLONGLONG
3860 # define PERL_QUAD_MIN ((long long)MINLONGLONG)
3861 # else
3862 # define PERL_QUAD_MIN (-PERL_QUAD_MAX - ((3 & -1) == 3))
3863 # endif
3864 # endif
3865 # endif
3866 #endif
3867
3868 /* This is based on code from 5.003 perl.h */
3869 #ifdef HAS_QUAD
3870 # ifdef cray
3871 #ifndef IVTYPE
3872 # define IVTYPE int
3873 #endif
3874
3875 #ifndef IV_MIN
3876 # define IV_MIN PERL_INT_MIN
3877 #endif
3878
3879 #ifndef IV_MAX
3880 # define IV_MAX PERL_INT_MAX
3881 #endif
3882
3883 #ifndef UV_MIN
3884 # define UV_MIN PERL_UINT_MIN
3885 #endif
3886
3887 #ifndef UV_MAX
3888 # define UV_MAX PERL_UINT_MAX
3889 #endif
3890
3891 # ifdef INTSIZE
3892 #ifndef IVSIZE
3893 # define IVSIZE INTSIZE
3894 #endif
3895
3896 # endif
3897 # else
3898 # if defined(convex) || defined(uts)
3899 #ifndef IVTYPE
3900 # define IVTYPE long long
3901 #endif
3902
3903 #ifndef IV_MIN
3904 # define IV_MIN PERL_QUAD_MIN
3905 #endif
3906
3907 #ifndef IV_MAX
3908 # define IV_MAX PERL_QUAD_MAX
3909 #endif
3910
3911 #ifndef UV_MIN
3912 # define UV_MIN PERL_UQUAD_MIN
3913 #endif
3914
3915 #ifndef UV_MAX
3916 # define UV_MAX PERL_UQUAD_MAX
3917 #endif
3918
3919 # ifdef LONGLONGSIZE
3920 #ifndef IVSIZE
3921 # define IVSIZE LONGLONGSIZE
3922 #endif
3923
3924 # endif
3925 # else
3926 #ifndef IVTYPE
3927 # define IVTYPE long
3928 #endif
3929
3930 #ifndef IV_MIN
3931 # define IV_MIN PERL_LONG_MIN
3932 #endif
3933
3934 #ifndef IV_MAX
3935 # define IV_MAX PERL_LONG_MAX
3936 #endif
3937
3938 #ifndef UV_MIN
3939 # define UV_MIN PERL_ULONG_MIN
3940 #endif
3941
3942 #ifndef UV_MAX
3943 # define UV_MAX PERL_ULONG_MAX
3944 #endif
3945
3946 # ifdef LONGSIZE
3947 #ifndef IVSIZE
3948 # define IVSIZE LONGSIZE
3949 #endif
3950
3951 # endif
3952 # endif
3953 # endif
3954 #ifndef IVSIZE
3955 # define IVSIZE 8
3956 #endif
3957
3958 #ifndef LONGSIZE
3959 # define LONGSIZE 8
3960 #endif
3961
3962 #ifndef PERL_QUAD_MIN
3963 # define PERL_QUAD_MIN IV_MIN
3964 #endif
3965
3966 #ifndef PERL_QUAD_MAX
3967 # define PERL_QUAD_MAX IV_MAX
3968 #endif
3969
3970 #ifndef PERL_UQUAD_MIN
3971 # define PERL_UQUAD_MIN UV_MIN
3972 #endif
3973
3974 #ifndef PERL_UQUAD_MAX
3975 # define PERL_UQUAD_MAX UV_MAX
3976 #endif
3977
3978 #else
3979 #ifndef IVTYPE
3980 # define IVTYPE long
3981 #endif
3982
3983 #ifndef LONGSIZE
3984 # define LONGSIZE 4
3985 #endif
3986
3987 #ifndef IV_MIN
3988 # define IV_MIN PERL_LONG_MIN
3989 #endif
3990
3991 #ifndef IV_MAX
3992 # define IV_MAX PERL_LONG_MAX
3993 #endif
3994
3995 #ifndef UV_MIN
3996 # define UV_MIN PERL_ULONG_MIN
3997 #endif
3998
3999 #ifndef UV_MAX
4000 # define UV_MAX PERL_ULONG_MAX
4001 #endif
4002
4003 #endif
4004
4005 #ifndef IVSIZE
4006 # ifdef LONGSIZE
4007 # define IVSIZE LONGSIZE
4008 # else
4009 # define IVSIZE 4 /* A bold guess, but the best we can make. */
4010 # endif
4011 #endif
4012 #ifndef UVTYPE
4013 # define UVTYPE unsigned IVTYPE
4014 #endif
4015
4016 #ifndef UVSIZE
4017 # define UVSIZE IVSIZE
4018 #endif
4019 #ifndef sv_setuv
4020 # define sv_setuv(sv, uv) \
4021 STMT_START { \
4022 UV TeMpUv = uv; \
4023 if (TeMpUv <= IV_MAX) \
4024 sv_setiv(sv, TeMpUv); \
4025 else \
4026 sv_setnv(sv, (double)TeMpUv); \
4027 } STMT_END
4028 #endif
4029 #ifndef newSVuv
4030 # define newSVuv(uv) ((uv) <= IV_MAX ? newSViv((IV)uv) : newSVnv((NV)uv))
4031 #endif
4032 #ifndef sv_2uv
4033 # define sv_2uv(sv) ((PL_Sv = (sv)), (UV) (SvNOK(PL_Sv) ? SvNV(PL_Sv) : sv_2nv(PL_Sv)))
4034 #endif
4035
4036 #ifndef SvUVX
4037 # define SvUVX(sv) ((UV)SvIVX(sv))
4038 #endif
4039
4040 #ifndef SvUVXx
4041 # define SvUVXx(sv) SvUVX(sv)
4042 #endif
4043
4044 #ifndef SvUV
4045 # define SvUV(sv) (SvIOK(sv) ? SvUVX(sv) : sv_2uv(sv))
4046 #endif
4047
4048 #ifndef SvUVx
4049 # define SvUVx(sv) ((PL_Sv = (sv)), SvUV(PL_Sv))
4050 #endif
4051
4052 /* Hint: sv_uv
4053 * Always use the SvUVx() macro instead of sv_uv().
4054 */
4055 #ifndef sv_uv
4056 # define sv_uv(sv) SvUVx(sv)
4057 #endif
4058
4059 #if !defined(SvUOK) && defined(SvIOK_UV)
4060 # define SvUOK(sv) SvIOK_UV(sv)
4061 #endif
4062 #ifndef XST_mUV
4063 # define XST_mUV(i,v) (ST(i) = sv_2mortal(newSVuv(v)) )
4064 #endif
4065
4066 #ifndef XSRETURN_UV
4067 # define XSRETURN_UV(v) STMT_START { XST_mUV(0,v); XSRETURN(1); } STMT_END
4068 #endif
4069 #ifndef PUSHu
4070 # define PUSHu(u) STMT_START { sv_setuv(TARG, (UV)(u)); PUSHTARG; } STMT_END
4071 #endif
4072
4073 #ifndef XPUSHu
4074 # define XPUSHu(u) STMT_START { sv_setuv(TARG, (UV)(u)); XPUSHTARG; } STMT_END
4075 #endif
4076
4077 #ifdef HAS_MEMCMP
4078 #ifndef memNE
4079 # define memNE(s1,s2,l) (memcmp(s1,s2,l))
4080 #endif
4081
4082 #ifndef memEQ
4083 # define memEQ(s1,s2,l) (!memcmp(s1,s2,l))
4084 #endif
4085
4086 #else
4087 #ifndef memNE
4088 # define memNE(s1,s2,l) (bcmp(s1,s2,l))
4089 #endif
4090
4091 #ifndef memEQ
4092 # define memEQ(s1,s2,l) (!bcmp(s1,s2,l))
4093 #endif
4094
4095 #endif
4096 #ifndef memEQs
4097 # define memEQs(s1, l, s2) \
4098 (sizeof(s2)-1 == l && memEQ(s1, (s2 ""), (sizeof(s2)-1)))
4099 #endif
4100
4101 #ifndef memNEs
4102 # define memNEs(s1, l, s2) !memEQs(s1, l, s2)
4103 #endif
4104 #ifndef MoveD
4105 # define MoveD(s,d,n,t) memmove((char*)(d),(char*)(s), (n) * sizeof(t))
4106 #endif
4107
4108 #ifndef CopyD
4109 # define CopyD(s,d,n,t) memcpy((char*)(d),(char*)(s), (n) * sizeof(t))
4110 #endif
4111
4112 #ifdef HAS_MEMSET
4113 #ifndef ZeroD
4114 # define ZeroD(d,n,t) memzero((char*)(d), (n) * sizeof(t))
4115 #endif
4116
4117 #else
4118 #ifndef ZeroD
4119 # define ZeroD(d,n,t) ((void)memzero((char*)(d), (n) * sizeof(t)), d)
4120 #endif
4121
4122 #endif
4123 #ifndef PoisonWith
4124 # define PoisonWith(d,n,t,b) (void)memset((char*)(d), (U8)(b), (n) * sizeof(t))
4125 #endif
4126
4127 #ifndef PoisonNew
4128 # define PoisonNew(d,n,t) PoisonWith(d,n,t,0xAB)
4129 #endif
4130
4131 #ifndef PoisonFree
4132 # define PoisonFree(d,n,t) PoisonWith(d,n,t,0xEF)
4133 #endif
4134
4135 #ifndef Poison
4136 # define Poison(d,n,t) PoisonFree(d,n,t)
4137 #endif
4138 #ifndef Newx
4139 # define Newx(v,n,t) New(0,v,n,t)
4140 #endif
4141
4142 #ifndef Newxc
4143 # define Newxc(v,n,t,c) Newc(0,v,n,t,c)
4144 #endif
4145
4146 #ifndef Newxz
4147 # define Newxz(v,n,t) Newz(0,v,n,t)
4148 #endif
4149
4150 #ifndef PERL_UNUSED_DECL
4151 # ifdef HASATTRIBUTE
4152 # if (defined(__GNUC__) && defined(__cplusplus)) || defined(__INTEL_COMPILER)
4153 # define PERL_UNUSED_DECL
4154 # else
4155 # define PERL_UNUSED_DECL __attribute__((unused))
4156 # endif
4157 # else
4158 # define PERL_UNUSED_DECL
4159 # endif
4160 #endif
4161
4162 #ifndef PERL_UNUSED_ARG
4163 # if defined(lint) && defined(S_SPLINT_S) /* www.splint.org */
4164 # include <note.h>
4165 # define PERL_UNUSED_ARG(x) NOTE(ARGUNUSED(x))
4166 # else
4167 # define PERL_UNUSED_ARG(x) ((void)x)
4168 # endif
4169 #endif
4170
4171 #ifndef PERL_UNUSED_VAR
4172 # define PERL_UNUSED_VAR(x) ((void)x)
4173 #endif
4174
4175 #ifndef PERL_UNUSED_CONTEXT
4176 # ifdef USE_ITHREADS
4177 # define PERL_UNUSED_CONTEXT PERL_UNUSED_ARG(my_perl)
4178 # else
4179 # define PERL_UNUSED_CONTEXT
4180 # endif
4181 #endif
4182 #ifndef NOOP
4183 # define NOOP /*EMPTY*/(void)0
4184 #endif
4185
4186 #ifndef dNOOP
4187 # define dNOOP extern int /*@unused@*/ Perl___notused PERL_UNUSED_DECL
4188 #endif
4189
4190 #ifndef NVTYPE
4191 # if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
4192 # define NVTYPE long double
4193 # else
4194 # define NVTYPE double
4195 # endif
4196 typedef NVTYPE NV;
4197 #endif
4198
4199 #ifndef INT2PTR
4200 # if (IVSIZE == PTRSIZE) && (UVSIZE == PTRSIZE)
4201 # define PTRV UV
4202 # define INT2PTR(any,d) (any)(d)
4203 # else
4204 # if PTRSIZE == LONGSIZE
4205 # define PTRV unsigned long
4206 # else
4207 # define PTRV unsigned
4208 # endif
4209 # define INT2PTR(any,d) (any)(PTRV)(d)
4210 # endif
4211 #endif
4212
4213 #ifndef PTR2ul
4214 # if PTRSIZE == LONGSIZE
4215 # define PTR2ul(p) (unsigned long)(p)
4216 # else
4217 # define PTR2ul(p) INT2PTR(unsigned long,p)
4218 # endif
4219 #endif
4220 #ifndef PTR2nat
4221 # define PTR2nat(p) (PTRV)(p)
4222 #endif
4223
4224 #ifndef NUM2PTR
4225 # define NUM2PTR(any,d) (any)PTR2nat(d)
4226 #endif
4227
4228 #ifndef PTR2IV
4229 # define PTR2IV(p) INT2PTR(IV,p)
4230 #endif
4231
4232 #ifndef PTR2UV
4233 # define PTR2UV(p) INT2PTR(UV,p)
4234 #endif
4235
4236 #ifndef PTR2NV
4237 # define PTR2NV(p) NUM2PTR(NV,p)
4238 #endif
4239
4240 #undef START_EXTERN_C
4241 #undef END_EXTERN_C
4242 #undef EXTERN_C
4243 #ifdef __cplusplus
4244 # define START_EXTERN_C extern "C" {
4245 # define END_EXTERN_C }
4246 # define EXTERN_C extern "C"
4247 #else
4248 # define START_EXTERN_C
4249 # define END_EXTERN_C
4250 # define EXTERN_C extern
4251 #endif
4252
4253 #if defined(PERL_GCC_PEDANTIC)
4254 # ifndef PERL_GCC_BRACE_GROUPS_FORBIDDEN
4255 # define PERL_GCC_BRACE_GROUPS_FORBIDDEN
4256 # endif
4257 #endif
4258
4259 #if defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN) && !defined(__cplusplus)
4260 # ifndef PERL_USE_GCC_BRACE_GROUPS
4261 # define PERL_USE_GCC_BRACE_GROUPS
4262 # endif
4263 #endif
4264
4265 #undef STMT_START
4266 #undef STMT_END
4267 #ifdef PERL_USE_GCC_BRACE_GROUPS
4268 # define STMT_START (void)( /* gcc supports ``({ STATEMENTS; })'' */
4269 # define STMT_END )
4270 #else
4271 # if defined(VOIDFLAGS) && (VOIDFLAGS) && (defined(sun) || defined(__sun__)) && !defined(__GNUC__)
4272 # define STMT_START if (1)
4273 # define STMT_END else (void)0
4274 # else
4275 # define STMT_START do
4276 # define STMT_END while (0)
4277 # endif
4278 #endif
4279 #ifndef boolSV
4280 # define boolSV(b) ((b) ? &PL_sv_yes : &PL_sv_no)
4281 #endif
4282
4283 /* DEFSV appears first in 5.004_56 */
4284 #ifndef DEFSV
4285 # define DEFSV GvSV(PL_defgv)
4286 #endif
4287
4288 #ifndef SAVE_DEFSV
4289 # define SAVE_DEFSV SAVESPTR(GvSV(PL_defgv))
4290 #endif
4291
4292 #ifndef DEFSV_set
4293 # define DEFSV_set(sv) (DEFSV = (sv))
4294 #endif
4295
4296 /* Older perls (<=5.003) lack AvFILLp */
4297 #ifndef AvFILLp
4298 # define AvFILLp AvFILL
4299 #endif
4300 #ifndef ERRSV
4301 # define ERRSV get_sv("@",FALSE)
4302 #endif
4303
4304 /* Hint: gv_stashpvn
4305 * This function's backport doesn't support the length parameter, but
4306 * rather ignores it. Portability can only be ensured if the length
4307 * parameter is used for speed reasons, but the length can always be
4308 * correctly computed from the string argument.
4309 */
4310 #ifndef gv_stashpvn
4311 # define gv_stashpvn(str,len,create) gv_stashpv(str,create)
4312 #endif
4313
4314 /* Replace: 1 */
4315 #ifndef get_cv
4316 # define get_cv perl_get_cv
4317 #endif
4318
4319 #ifndef get_sv
4320 # define get_sv perl_get_sv
4321 #endif
4322
4323 #ifndef get_av
4324 # define get_av perl_get_av
4325 #endif
4326
4327 #ifndef get_hv
4328 # define get_hv perl_get_hv
4329 #endif
4330
4331 /* Replace: 0 */
4332 #ifndef dUNDERBAR
4333 # define dUNDERBAR dNOOP
4334 #endif
4335
4336 #ifndef UNDERBAR
4337 # define UNDERBAR DEFSV
4338 #endif
4339 #ifndef dAX
4340 # define dAX I32 ax = MARK - PL_stack_base + 1
4341 #endif
4342
4343 #ifndef dITEMS
4344 # define dITEMS I32 items = SP - MARK
4345 #endif
4346 #ifndef dXSTARG
4347 # define dXSTARG SV * targ = sv_newmortal()
4348 #endif
4349 #ifndef dAXMARK
4350 # define dAXMARK I32 ax = POPMARK; \
4351 register SV ** const mark = PL_stack_base + ax++
4352 #endif
4353 #ifndef XSprePUSH
4354 # define XSprePUSH (sp = PL_stack_base + ax - 1)
4355 #endif
4356
4357 #if (PERL_BCDVERSION < 0x5005000)
4358 # undef XSRETURN
4359 # define XSRETURN(off) \
4360 STMT_START { \
4361 PL_stack_sp = PL_stack_base + ax + ((off) - 1); \
4362 return; \
4363 } STMT_END
4364 #endif
4365 #ifndef XSPROTO
4366 # define XSPROTO(name) void name(pTHX_ CV* cv)
4367 #endif
4368
4369 #ifndef SVfARG
4370 # define SVfARG(p) ((void*)(p))
4371 #endif
4372 #ifndef PERL_ABS
4373 # define PERL_ABS(x) ((x) < 0 ? -(x) : (x))
4374 #endif
4375 #ifndef dVAR
4376 # define dVAR dNOOP
4377 #endif
4378 #ifndef SVf
4379 # define SVf "_"
4380 #endif
4381 #ifndef UTF8_MAXBYTES
4382 # define UTF8_MAXBYTES UTF8_MAXLEN
4383 #endif
4384 #ifndef CPERLscope
4385 # define CPERLscope(x) x
4386 #endif
4387 #ifndef PERL_HASH
4388 # define PERL_HASH(hash,str,len) \
4389 STMT_START { \
4390 const char *s_PeRlHaSh = str; \
4391 I32 i_PeRlHaSh = len; \
4392 U32 hash_PeRlHaSh = 0; \
4393 while (i_PeRlHaSh--) \
4394 hash_PeRlHaSh = hash_PeRlHaSh * 33 + *s_PeRlHaSh++; \
4395 (hash) = hash_PeRlHaSh; \
4396 } STMT_END
4397 #endif
4398
4399 #ifndef PERLIO_FUNCS_DECL
4400 # ifdef PERLIO_FUNCS_CONST
4401 # define PERLIO_FUNCS_DECL(funcs) const PerlIO_funcs funcs
4402 # define PERLIO_FUNCS_CAST(funcs) (PerlIO_funcs*)(funcs)
4403 # else
4404 # define PERLIO_FUNCS_DECL(funcs) PerlIO_funcs funcs
4405 # define PERLIO_FUNCS_CAST(funcs) (funcs)
4406 # endif
4407 #endif
4408
4409 /* provide these typedefs for older perls */
4410 #if (PERL_BCDVERSION < 0x5009003)
4411
4412 # ifdef ARGSproto
4413 typedef OP* (CPERLscope(*Perl_ppaddr_t))(ARGSproto);
4414 # else
4415 typedef OP* (CPERLscope(*Perl_ppaddr_t))(pTHX);
4416 # endif
4417
4418 typedef OP* (CPERLscope(*Perl_check_t)) (pTHX_ OP*);
4419
4420 #endif
4421 #ifndef isPSXSPC
4422 # define isPSXSPC(c) (isSPACE(c) || (c) == '\v')
4423 #endif
4424
4425 #ifndef isBLANK
4426 # define isBLANK(c) ((c) == ' ' || (c) == '\t')
4427 #endif
4428
4429 #ifdef EBCDIC
4430 #ifndef isALNUMC
4431 # define isALNUMC(c) isalnum(c)
4432 #endif
4433
4434 #ifndef isASCII
4435 # define isASCII(c) isascii(c)
4436 #endif
4437
4438 #ifndef isCNTRL
4439 # define isCNTRL(c) iscntrl(c)
4440 #endif
4441
4442 #ifndef isGRAPH
4443 # define isGRAPH(c) isgraph(c)
4444 #endif
4445
4446 #ifndef isPRINT
4447 # define isPRINT(c) isprint(c)
4448 #endif
4449
4450 #ifndef isPUNCT
4451 # define isPUNCT(c) ispunct(c)
4452 #endif
4453
4454 #ifndef isXDIGIT
4455 # define isXDIGIT(c) isxdigit(c)
4456 #endif
4457
4458 #else
4459 # if (PERL_BCDVERSION < 0x5010000)
4460 /* Hint: isPRINT
4461 * The implementation in older perl versions includes all of the
4462 * isSPACE() characters, which is wrong. The version provided by
4463 * Devel::PPPort always overrides a present buggy version.
4464 */
4465 # undef isPRINT
4466 # endif
4467
4468 #ifdef HAS_QUAD
4469 # ifdef U64TYPE
4470 # define WIDEST_UTYPE U64TYPE
4471 # else
4472 # define WIDEST_UTYPE Quad_t
4473 # endif
4474 #else
4475 # define WIDEST_UTYPE U32
4476 #endif
4477 #ifndef isALNUMC
4478 # define isALNUMC(c) (isALPHA(c) || isDIGIT(c))
4479 #endif
4480
4481 #ifndef isASCII
4482 # define isASCII(c) ((WIDEST_UTYPE) (c) <= 127)
4483 #endif
4484
4485 #ifndef isCNTRL
4486 # define isCNTRL(c) ((WIDEST_UTYPE) (c) < ' ' || (c) == 127)
4487 #endif
4488
4489 #ifndef isGRAPH
4490 # define isGRAPH(c) (isALNUM(c) || isPUNCT(c))
4491 #endif
4492
4493 #ifndef isPRINT
4494 # define isPRINT(c) (((c) >= 32 && (c) < 127))
4495 #endif
4496
4497 #ifndef isPUNCT
4498 # define isPUNCT(c) (((c) >= 33 && (c) <= 47) || ((c) >= 58 && (c) <= 64) || ((c) >= 91 && (c) <= 96) || ((c) >= 123 && (c) <= 126))
4499 #endif
4500
4501 #ifndef isXDIGIT
4502 # define isXDIGIT(c) (isDIGIT(c) || ((c) >= 'a' && (c) <= 'f') || ((c) >= 'A' && (c) <= 'F'))
4503 #endif
4504
4505 #endif
4506
4507 /* Until we figure out how to support this in older perls... */
4508 #if (PERL_BCDVERSION >= 0x5008000)
4509 #ifndef HeUTF8
4510 # define HeUTF8(he) ((HeKLEN(he) == HEf_SVKEY) ? \
4511 SvUTF8(HeKEY_sv(he)) : \
4512 (U32)HeKUTF8(he))
4513 #endif
4514
4515 #endif
4516
4517 #ifndef PERL_SIGNALS_UNSAFE_FLAG
4518
4519 #define PERL_SIGNALS_UNSAFE_FLAG 0x0001
4520
4521 #if (PERL_BCDVERSION < 0x5008000)
4522 # define D_PPP_PERL_SIGNALS_INIT PERL_SIGNALS_UNSAFE_FLAG
4523 #else
4524 # define D_PPP_PERL_SIGNALS_INIT 0
4525 #endif
4526
4527 #if defined(NEED_PL_signals)
4528 static U32 DPPP_(my_PL_signals) = D_PPP_PERL_SIGNALS_INIT;
4529 #elif defined(NEED_PL_signals_GLOBAL)
4530 U32 DPPP_(my_PL_signals) = D_PPP_PERL_SIGNALS_INIT;
4531 #else
4532 extern U32 DPPP_(my_PL_signals);
4533 #endif
4534 #define PL_signals DPPP_(my_PL_signals)
4535
4536 #endif
4537
4538 /* Hint: PL_ppaddr
4539 * Calling an op via PL_ppaddr requires passing a context argument
4540 * for threaded builds. Since the context argument is different for
4541 * 5.005 perls, you can use aTHXR (supplied by ppport.h), which will
4542 * automatically be defined as the correct argument.
4543 */
4544
4545 #if (PERL_BCDVERSION <= 0x5005005)
4546 /* Replace: 1 */
4547 # define PL_ppaddr ppaddr
4548 # define PL_no_modify no_modify
4549 /* Replace: 0 */
4550 #endif
4551
4552 #if (PERL_BCDVERSION <= 0x5004005)
4553 /* Replace: 1 */
4554 # define PL_DBsignal DBsignal
4555 # define PL_DBsingle DBsingle
4556 # define PL_DBsub DBsub
4557 # define PL_DBtrace DBtrace
4558 # define PL_Sv Sv
4559 # define PL_bufend bufend
4560 # define PL_bufptr bufptr
4561 # define PL_compiling compiling
4562 # define PL_copline copline
4563 # define PL_curcop curcop
4564 # define PL_curstash curstash
4565 # define PL_debstash debstash
4566 # define PL_defgv defgv
4567 # define PL_diehook diehook
4568 # define PL_dirty dirty
4569 # define PL_dowarn dowarn
4570 # define PL_errgv errgv
4571 # define PL_error_count error_count
4572 # define PL_expect expect
4573 # define PL_hexdigit hexdigit
4574 # define PL_hints hints
4575 # define PL_in_my in_my
4576 # define PL_laststatval laststatval
4577 # define PL_lex_state lex_state
4578 # define PL_lex_stuff lex_stuff
4579 # define PL_linestr linestr
4580 # define PL_na na
4581 # define PL_perl_destruct_level perl_destruct_level
4582 # define PL_perldb perldb
4583 # define PL_rsfp_filters rsfp_filters
4584 # define PL_rsfp rsfp
4585 # define PL_stack_base stack_base
4586 # define PL_stack_sp stack_sp
4587 # define PL_statcache statcache
4588 # define PL_stdingv stdingv
4589 # define PL_sv_arenaroot sv_arenaroot
4590 # define PL_sv_no sv_no
4591 # define PL_sv_undef sv_undef
4592 # define PL_sv_yes sv_yes
4593 # define PL_tainted tainted
4594 # define PL_tainting tainting
4595 # define PL_tokenbuf tokenbuf
4596 /* Replace: 0 */
4597 #endif
4598
4599 /* Warning: PL_parser
4600 * For perl versions earlier than 5.9.5, this is an always
4601 * non-NULL dummy. Also, it cannot be dereferenced. Don't
4602 * use it if you can avoid is and unless you absolutely know
4603 * what you're doing.
4604 * If you always check that PL_parser is non-NULL, you can
4605 * define DPPP_PL_parser_NO_DUMMY to avoid the creation of
4606 * a dummy parser structure.
4607 */
4608
4609 #if (PERL_BCDVERSION >= 0x5009005)
4610 # ifdef DPPP_PL_parser_NO_DUMMY
4611 # define D_PPP_my_PL_parser_var(var) ((PL_parser ? PL_parser : \
4612 (croak("panic: PL_parser == NULL in %s:%d", \
4613 __FILE__, __LINE__), (yy_parser *) NULL))->var)
4614 # else
4615 # ifdef DPPP_PL_parser_NO_DUMMY_WARNING
4616 # define D_PPP_parser_dummy_warning(var)
4617 # else
4618 # define D_PPP_parser_dummy_warning(var) \
4619 warn("warning: dummy PL_" #var " used in %s:%d", __FILE__, __LINE__),
4620 # endif
4621 # define D_PPP_my_PL_parser_var(var) ((PL_parser ? PL_parser : \
4622 (D_PPP_parser_dummy_warning(var) &DPPP_(dummy_PL_parser)))->var)
4623 #if defined(NEED_PL_parser)
4624 static yy_parser DPPP_(dummy_PL_parser);
4625 #elif defined(NEED_PL_parser_GLOBAL)
4626 yy_parser DPPP_(dummy_PL_parser);
4627 #else
4628 extern yy_parser DPPP_(dummy_PL_parser);
4629 #endif
4630
4631 # endif
4632
4633 /* 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 */
4634 /* Warning: PL_expect, PL_copline, PL_rsfp, PL_rsfp_filters, PL_linestr, PL_bufptr, PL_bufend, PL_lex_state, PL_lex_stuff, PL_tokenbuf
4635 * Do not use this variable unless you know exactly what you're
4636 * doint. It is internal to the perl parser and may change or even
4637 * be removed in the future. As of perl 5.9.5, you have to check
4638 * for (PL_parser != NULL) for this variable to have any effect.
4639 * An always non-NULL PL_parser dummy is provided for earlier
4640 * perl versions.
4641 * If PL_parser is NULL when you try to access this variable, a
4642 * dummy is being accessed instead and a warning is issued unless
4643 * you define DPPP_PL_parser_NO_DUMMY_WARNING.
4644 * If DPPP_PL_parser_NO_DUMMY is defined, the code trying to access
4645 * this variable will croak with a panic message.
4646 */
4647
4648 # define PL_expect D_PPP_my_PL_parser_var(expect)
4649 # define PL_copline D_PPP_my_PL_parser_var(copline)
4650 # define PL_rsfp D_PPP_my_PL_parser_var(rsfp)
4651 # define PL_rsfp_filters D_PPP_my_PL_parser_var(rsfp_filters)
4652 # define PL_linestr D_PPP_my_PL_parser_var(linestr)
4653 # define PL_bufptr D_PPP_my_PL_parser_var(bufptr)
4654 # define PL_bufend D_PPP_my_PL_parser_var(bufend)
4655 # define PL_lex_state D_PPP_my_PL_parser_var(lex_state)
4656 # define PL_lex_stuff D_PPP_my_PL_parser_var(lex_stuff)
4657 # define PL_tokenbuf D_PPP_my_PL_parser_var(tokenbuf)
4658 # define PL_in_my D_PPP_my_PL_parser_var(in_my)
4659 # define PL_in_my_stash D_PPP_my_PL_parser_var(in_my_stash)
4660 # define PL_error_count D_PPP_my_PL_parser_var(error_count)
4661
4662
4663 #else
4664
4665 /* ensure that PL_parser != NULL and cannot be dereferenced */
4666 # define PL_parser ((void *) 1)
4667
4668 #endif
4669 #ifndef mPUSHs
4670 # define mPUSHs(s) PUSHs(sv_2mortal(s))
4671 #endif
4672
4673 #ifndef PUSHmortal
4674 # define PUSHmortal PUSHs(sv_newmortal())
4675 #endif
4676
4677 #ifndef mPUSHp
4678 # define mPUSHp(p,l) sv_setpvn(PUSHmortal, (p), (l))
4679 #endif
4680
4681 #ifndef mPUSHn
4682 # define mPUSHn(n) sv_setnv(PUSHmortal, (NV)(n))
4683 #endif
4684
4685 #ifndef mPUSHi
4686 # define mPUSHi(i) sv_setiv(PUSHmortal, (IV)(i))
4687 #endif
4688
4689 #ifndef mPUSHu
4690 # define mPUSHu(u) sv_setuv(PUSHmortal, (UV)(u))
4691 #endif
4692 #ifndef mXPUSHs
4693 # define mXPUSHs(s) XPUSHs(sv_2mortal(s))
4694 #endif
4695
4696 #ifndef XPUSHmortal
4697 # define XPUSHmortal XPUSHs(sv_newmortal())
4698 #endif
4699
4700 #ifndef mXPUSHp
4701 # define mXPUSHp(p,l) STMT_START { EXTEND(sp,1); sv_setpvn(PUSHmortal, (p), (l)); } STMT_END
4702 #endif
4703
4704 #ifndef mXPUSHn
4705 # define mXPUSHn(n) STMT_START { EXTEND(sp,1); sv_setnv(PUSHmortal, (NV)(n)); } STMT_END
4706 #endif
4707
4708 #ifndef mXPUSHi
4709 # define mXPUSHi(i) STMT_START { EXTEND(sp,1); sv_setiv(PUSHmortal, (IV)(i)); } STMT_END
4710 #endif
4711
4712 #ifndef mXPUSHu
4713 # define mXPUSHu(u) STMT_START { EXTEND(sp,1); sv_setuv(PUSHmortal, (UV)(u)); } STMT_END
4714 #endif
4715
4716 /* Replace: 1 */
4717 #ifndef call_sv
4718 # define call_sv perl_call_sv
4719 #endif
4720
4721 #ifndef call_pv
4722 # define call_pv perl_call_pv
4723 #endif
4724
4725 #ifndef call_argv
4726 # define call_argv perl_call_argv
4727 #endif
4728
4729 #ifndef call_method
4730 # define call_method perl_call_method
4731 #endif
4732 #ifndef eval_sv
4733 # define eval_sv perl_eval_sv
4734 #endif
4735
4736 /* Replace: 0 */
4737 #ifndef PERL_LOADMOD_DENY
4738 # define PERL_LOADMOD_DENY 0x1
4739 #endif
4740
4741 #ifndef PERL_LOADMOD_NOIMPORT
4742 # define PERL_LOADMOD_NOIMPORT 0x2
4743 #endif
4744
4745 #ifndef PERL_LOADMOD_IMPORT_OPS
4746 # define PERL_LOADMOD_IMPORT_OPS 0x4
4747 #endif
4748
4749 #ifndef G_METHOD
4750 # define G_METHOD 64
4751 # ifdef call_sv
4752 # undef call_sv
4753 # endif
4754 # if (PERL_BCDVERSION < 0x5006000)
4755 # define call_sv(sv, flags) ((flags) & G_METHOD ? perl_call_method((char *) SvPV_nolen_const(sv), \
4756 (flags) & ~G_METHOD) : perl_call_sv(sv, flags))
4757 # else
4758 # define call_sv(sv, flags) ((flags) & G_METHOD ? Perl_call_method(aTHX_ (char *) SvPV_nolen_const(sv), \
4759 (flags) & ~G_METHOD) : Perl_call_sv(aTHX_ sv, flags))
4760 # endif
4761 #endif
4762
4763 /* Replace perl_eval_pv with eval_pv */
4764
4765 #ifndef eval_pv
4766 #if defined(NEED_eval_pv)
4767 static SV* DPPP_(my_eval_pv)(char *p, I32 croak_on_error);
4768 static
4769 #else
4770 extern SV* DPPP_(my_eval_pv)(char *p, I32 croak_on_error);
4771 #endif
4772
4773 #ifdef eval_pv
4774 # undef eval_pv
4775 #endif
4776 #define eval_pv(a,b) DPPP_(my_eval_pv)(aTHX_ a,b)
4777 #define Perl_eval_pv DPPP_(my_eval_pv)
4778
4779 #if defined(NEED_eval_pv) || defined(NEED_eval_pv_GLOBAL)
4780
4781 SV*
4782 DPPP_(my_eval_pv)(char *p, I32 croak_on_error)
4783 {
4784 dSP;
4785 SV* sv = newSVpv(p, 0);
4786
4787 PUSHMARK(sp);
4788 eval_sv(sv, G_SCALAR);
4789 SvREFCNT_dec(sv);
4790
4791 SPAGAIN;
4792 sv = POPs;
4793 PUTBACK;
4794
4795 if (croak_on_error && SvTRUE(GvSV(errgv)))
4796 croak(SvPVx(GvSV(errgv), na));
4797
4798 return sv;
4799 }
4800
4801 #endif
4802 #endif
4803
4804 #ifndef vload_module
4805 #if defined(NEED_vload_module)
4806 static void DPPP_(my_vload_module)(U32 flags, SV *name, SV *ver, va_list *args);
4807 static
4808 #else
4809 extern void DPPP_(my_vload_module)(U32 flags, SV *name, SV *ver, va_list *args);
4810 #endif
4811
4812 #ifdef vload_module
4813 # undef vload_module
4814 #endif
4815 #define vload_module(a,b,c,d) DPPP_(my_vload_module)(aTHX_ a,b,c,d)
4816 #define Perl_vload_module DPPP_(my_vload_module)
4817
4818 #if defined(NEED_vload_module) || defined(NEED_vload_module_GLOBAL)
4819
4820 void
4821 DPPP_(my_vload_module)(U32 flags, SV *name, SV *ver, va_list *args)
4822 {
4823 dTHR;
4824 dVAR;
4825 OP *veop, *imop;
4826
4827 OP * const modname = newSVOP(OP_CONST, 0, name);
4828 /* 5.005 has a somewhat hacky force_normal that doesn't croak on
4829 SvREADONLY() if PL_compling is true. Current perls take care in
4830 ck_require() to correctly turn off SvREADONLY before calling
4831 force_normal_flags(). This seems a better fix than fudging PL_compling
4832 */
4833 SvREADONLY_off(((SVOP*)modname)->op_sv);
4834 modname->op_private |= OPpCONST_BARE;
4835 if (ver) {
4836 veop = newSVOP(OP_CONST, 0, ver);
4837 }
4838 else
4839 veop = NULL;
4840 if (flags & PERL_LOADMOD_NOIMPORT) {
4841 imop = sawparens(newNULLLIST());
4842 }
4843 else if (flags & PERL_LOADMOD_IMPORT_OPS) {
4844 imop = va_arg(*args, OP*);
4845 }
4846 else {
4847 SV *sv;
4848 imop = NULL;
4849 sv = va_arg(*args, SV*);
4850 while (sv) {
4851 imop = append_elem(OP_LIST, imop, newSVOP(OP_CONST, 0, sv));
4852 sv = va_arg(*args, SV*);
4853 }
4854 }
4855 {
4856 const line_t ocopline = PL_copline;
4857 COP * const ocurcop = PL_curcop;
4858 const int oexpect = PL_expect;
4859
4860 #if (PERL_BCDVERSION >= 0x5004000)
4861 utilize(!(flags & PERL_LOADMOD_DENY), start_subparse(FALSE, 0),
4862 veop, modname, imop);
4863 #elif (PERL_BCDVERSION > 0x5003000)
4864 utilize(!(flags & PERL_LOADMOD_DENY), start_subparse(),
4865 veop, modname, imop);
4866 #else
4867 utilize(!(flags & PERL_LOADMOD_DENY), start_subparse(),
4868 modname, imop);
4869 #endif
4870 PL_expect = oexpect;
4871 PL_copline = ocopline;
4872 PL_curcop = ocurcop;
4873 }
4874 }
4875
4876 #endif
4877 #endif
4878
4879 #ifndef load_module
4880 #if defined(NEED_load_module)
4881 static void DPPP_(my_load_module)(U32 flags, SV *name, SV *ver, ...);
4882 static
4883 #else
4884 extern void DPPP_(my_load_module)(U32 flags, SV *name, SV *ver, ...);
4885 #endif
4886
4887 #ifdef load_module
4888 # undef load_module
4889 #endif
4890 #define load_module DPPP_(my_load_module)
4891 #define Perl_load_module DPPP_(my_load_module)
4892
4893 #if defined(NEED_load_module) || defined(NEED_load_module_GLOBAL)
4894
4895 void
4896 DPPP_(my_load_module)(U32 flags, SV *name, SV *ver, ...)
4897 {
4898 va_list args;
4899 va_start(args, ver);
4900 vload_module(flags, name, ver, &args);
4901 va_end(args);
4902 }
4903
4904 #endif
4905 #endif
4906 #ifndef newRV_inc
4907 # define newRV_inc(sv) newRV(sv) /* Replace */
4908 #endif
4909
4910 #ifndef newRV_noinc
4911 #if defined(NEED_newRV_noinc)
4912 static SV * DPPP_(my_newRV_noinc)(SV *sv);
4913 static
4914 #else
4915 extern SV * DPPP_(my_newRV_noinc)(SV *sv);
4916 #endif
4917
4918 #ifdef newRV_noinc
4919 # undef newRV_noinc
4920 #endif
4921 #define newRV_noinc(a) DPPP_(my_newRV_noinc)(aTHX_ a)
4922 #define Perl_newRV_noinc DPPP_(my_newRV_noinc)
4923
4924 #if defined(NEED_newRV_noinc) || defined(NEED_newRV_noinc_GLOBAL)
4925 SV *
4926 DPPP_(my_newRV_noinc)(SV *sv)
4927 {
4928 SV *rv = (SV *)newRV(sv);
4929 SvREFCNT_dec(sv);
4930 return rv;
4931 }
4932 #endif
4933 #endif
4934
4935 /* Hint: newCONSTSUB
4936 * Returns a CV* as of perl-5.7.1. This return value is not supported
4937 * by Devel::PPPort.
4938 */
4939
4940 /* newCONSTSUB from IO.xs is in the core starting with 5.004_63 */
4941 #if (PERL_BCDVERSION < 0x5004063) && (PERL_BCDVERSION != 0x5004005)
4942 #if defined(NEED_newCONSTSUB)
4943 static void DPPP_(my_newCONSTSUB)(HV *stash, const char *name, SV *sv);
4944 static
4945 #else
4946 extern void DPPP_(my_newCONSTSUB)(HV *stash, const char *name, SV *sv);
4947 #endif
4948
4949 #ifdef newCONSTSUB
4950 # undef newCONSTSUB
4951 #endif
4952 #define newCONSTSUB(a,b,c) DPPP_(my_newCONSTSUB)(aTHX_ a,b,c)
4953 #define Perl_newCONSTSUB DPPP_(my_newCONSTSUB)
4954
4955 #if defined(NEED_newCONSTSUB) || defined(NEED_newCONSTSUB_GLOBAL)
4956
4957 /* This is just a trick to avoid a dependency of newCONSTSUB on PL_parser */
4958 /* (There's no PL_parser in perl < 5.005, so this is completely safe) */
4959 #define D_PPP_PL_copline PL_copline
4960
4961 void
4962 DPPP_(my_newCONSTSUB)(HV *stash, const char *name, SV *sv)
4963 {
4964 U32 oldhints = PL_hints;
4965 HV *old_cop_stash = PL_curcop->cop_stash;
4966 HV *old_curstash = PL_curstash;
4967 line_t oldline = PL_curcop->cop_line;
4968 PL_curcop->cop_line = D_PPP_PL_copline;
4969
4970 PL_hints &= ~HINT_BLOCK_SCOPE;
4971 if (stash)
4972 PL_curstash = PL_curcop->cop_stash = stash;
4973
4974 newSUB(
4975
4976 #if (PERL_BCDVERSION < 0x5003022)
4977 start_subparse(),
4978 #elif (PERL_BCDVERSION == 0x5003022)
4979 start_subparse(0),
4980 #else /* 5.003_23 onwards */
4981 start_subparse(FALSE, 0),
4982 #endif
4983
4984 newSVOP(OP_CONST, 0, newSVpv((char *) name, 0)),
4985 newSVOP(OP_CONST, 0, &PL_sv_no), /* SvPV(&PL_sv_no) == "" -- GMB */
4986 newSTATEOP(0, Nullch, newSVOP(OP_CONST, 0, sv))
4987 );
4988
4989 PL_hints = oldhints;
4990 PL_curcop->cop_stash = old_cop_stash;
4991 PL_curstash = old_curstash;
4992 PL_curcop->cop_line = oldline;
4993 }
4994 #endif
4995 #endif
4996
4997 /*
4998 * Boilerplate macros for initializing and accessing interpreter-local
4999 * data from C. All statics in extensions should be reworked to use
5000 * this, if you want to make the extension thread-safe. See ext/re/re.xs
5001 * for an example of the use of these macros.
5002 *
5003 * Code that uses these macros is responsible for the following:
5004 * 1. #define MY_CXT_KEY to a unique string, e.g. "DynaLoader_guts"
5005 * 2. Declare a typedef named my_cxt_t that is a structure that contains
5006 * all the data that needs to be interpreter-local.
5007 * 3. Use the START_MY_CXT macro after the declaration of my_cxt_t.
5008 * 4. Use the MY_CXT_INIT macro such that it is called exactly once
5009 * (typically put in the BOOT: section).
5010 * 5. Use the members of the my_cxt_t structure everywhere as
5011 * MY_CXT.member.
5012 * 6. Use the dMY_CXT macro (a declaration) in all the functions that
5013 * access MY_CXT.
5014 */
5015
5016 #if defined(MULTIPLICITY) || defined(PERL_OBJECT) || \
5017 defined(PERL_CAPI) || defined(PERL_IMPLICIT_CONTEXT)
5018
5019 #ifndef START_MY_CXT
5020
5021 /* This must appear in all extensions that define a my_cxt_t structure,
5022 * right after the definition (i.e. at file scope). The non-threads
5023 * case below uses it to declare the data as static. */
5024 #define START_MY_CXT
5025
5026 #if (PERL_BCDVERSION < 0x5004068)
5027 /* Fetches the SV that keeps the per-interpreter data. */
5028 #define dMY_CXT_SV \
5029 SV *my_cxt_sv = get_sv(MY_CXT_KEY, FALSE)
5030 #else /* >= perl5.004_68 */
5031 #define dMY_CXT_SV \
5032 SV *my_cxt_sv = *hv_fetch(PL_modglobal, MY_CXT_KEY, \
5033 sizeof(MY_CXT_KEY)-1, TRUE)
5034 #endif /* < perl5.004_68 */
5035
5036 /* This declaration should be used within all functions that use the
5037 * interpreter-local data. */
5038 #define dMY_CXT \
5039 dMY_CXT_SV; \
5040 my_cxt_t *my_cxtp = INT2PTR(my_cxt_t*,SvUV(my_cxt_sv))
5041
5042 /* Creates and zeroes the per-interpreter data.
5043 * (We allocate my_cxtp in a Perl SV so that it will be released when
5044 * the interpreter goes away.) */
5045 #define MY_CXT_INIT \
5046 dMY_CXT_SV; \
5047 /* newSV() allocates one more than needed */ \
5048 my_cxt_t *my_cxtp = (my_cxt_t*)SvPVX(newSV(sizeof(my_cxt_t)-1));\
5049 Zero(my_cxtp, 1, my_cxt_t); \
5050 sv_setuv(my_cxt_sv, PTR2UV(my_cxtp))
5051
5052 /* This macro must be used to access members of the my_cxt_t structure.
5053 * e.g. MYCXT.some_data */
5054 #define MY_CXT (*my_cxtp)
5055
5056 /* Judicious use of these macros can reduce the number of times dMY_CXT
5057 * is used. Use is similar to pTHX, aTHX etc. */
5058 #define pMY_CXT my_cxt_t *my_cxtp
5059 #define pMY_CXT_ pMY_CXT,
5060 #define _pMY_CXT ,pMY_CXT
5061 #define aMY_CXT my_cxtp
5062 #define aMY_CXT_ aMY_CXT,
5063 #define _aMY_CXT ,aMY_CXT
5064
5065 #endif /* START_MY_CXT */
5066
5067 #ifndef MY_CXT_CLONE
5068 /* Clones the per-interpreter data. */
5069 #define MY_CXT_CLONE \
5070 dMY_CXT_SV; \
5071 my_cxt_t *my_cxtp = (my_cxt_t*)SvPVX(newSV(sizeof(my_cxt_t)-1));\
5072 Copy(INT2PTR(my_cxt_t*, SvUV(my_cxt_sv)), my_cxtp, 1, my_cxt_t);\
5073 sv_setuv(my_cxt_sv, PTR2UV(my_cxtp))
5074 #endif
5075
5076 #else /* single interpreter */
5077
5078 #ifndef START_MY_CXT
5079
5080 #define START_MY_CXT static my_cxt_t my_cxt;
5081 #define dMY_CXT_SV dNOOP
5082 #define dMY_CXT dNOOP
5083 #define MY_CXT_INIT NOOP
5084 #define MY_CXT my_cxt
5085
5086 #define pMY_CXT void
5087 #define pMY_CXT_
5088 #define _pMY_CXT
5089 #define aMY_CXT
5090 #define aMY_CXT_
5091 #define _aMY_CXT
5092
5093 #endif /* START_MY_CXT */
5094
5095 #ifndef MY_CXT_CLONE
5096 #define MY_CXT_CLONE NOOP
5097 #endif
5098
5099 #endif
5100
5101 #ifndef IVdf
5102 # if IVSIZE == LONGSIZE
5103 # define IVdf "ld"
5104 # define UVuf "lu"
5105 # define UVof "lo"
5106 # define UVxf "lx"
5107 # define UVXf "lX"
5108 # elif IVSIZE == INTSIZE
5109 # define IVdf "d"
5110 # define UVuf "u"
5111 # define UVof "o"
5112 # define UVxf "x"
5113 # define UVXf "X"
5114 # else
5115 # error "cannot define IV/UV formats"
5116 # endif
5117 #endif
5118
5119 #ifndef NVef
5120 # if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) && \
5121 defined(PERL_PRIfldbl) && (PERL_BCDVERSION != 0x5006000)
5122 /* Not very likely, but let's try anyway. */
5123 # define NVef PERL_PRIeldbl
5124 # define NVff PERL_PRIfldbl
5125 # define NVgf PERL_PRIgldbl
5126 # else
5127 # define NVef "e"
5128 # define NVff "f"
5129 # define NVgf "g"
5130 # endif
5131 #endif
5132
5133 #ifndef SvREFCNT_inc
5134 # ifdef PERL_USE_GCC_BRACE_GROUPS
5135 # define SvREFCNT_inc(sv) \
5136 ({ \
5137 SV * const _sv = (SV*)(sv); \
5138 if (_sv) \
5139 (SvREFCNT(_sv))++; \
5140 _sv; \
5141 })
5142 # else
5143 # define SvREFCNT_inc(sv) \
5144 ((PL_Sv=(SV*)(sv)) ? (++(SvREFCNT(PL_Sv)),PL_Sv) : NULL)
5145 # endif
5146 #endif
5147
5148 #ifndef SvREFCNT_inc_simple
5149 # ifdef PERL_USE_GCC_BRACE_GROUPS
5150 # define SvREFCNT_inc_simple(sv) \
5151 ({ \
5152 if (sv) \
5153 (SvREFCNT(sv))++; \
5154 (SV *)(sv); \
5155 })
5156 # else
5157 # define SvREFCNT_inc_simple(sv) \
5158 ((sv) ? (SvREFCNT(sv)++,(SV*)(sv)) : NULL)
5159 # endif
5160 #endif
5161
5162 #ifndef SvREFCNT_inc_NN
5163 # ifdef PERL_USE_GCC_BRACE_GROUPS
5164 # define SvREFCNT_inc_NN(sv) \
5165 ({ \
5166 SV * const _sv = (SV*)(sv); \
5167 SvREFCNT(_sv)++; \
5168 _sv; \
5169 })
5170 # else
5171 # define SvREFCNT_inc_NN(sv) \
5172 (PL_Sv=(SV*)(sv),++(SvREFCNT(PL_Sv)),PL_Sv)
5173 # endif
5174 #endif
5175
5176 #ifndef SvREFCNT_inc_void
5177 # ifdef PERL_USE_GCC_BRACE_GROUPS
5178 # define SvREFCNT_inc_void(sv) \
5179 ({ \
5180 SV * const _sv = (SV*)(sv); \
5181 if (_sv) \
5182 (void)(SvREFCNT(_sv)++); \
5183 })
5184 # else
5185 # define SvREFCNT_inc_void(sv) \
5186 (void)((PL_Sv=(SV*)(sv)) ? ++(SvREFCNT(PL_Sv)) : 0)
5187 # endif
5188 #endif
5189 #ifndef SvREFCNT_inc_simple_void
5190 # define SvREFCNT_inc_simple_void(sv) STMT_START { if (sv) SvREFCNT(sv)++; } STMT_END
5191 #endif
5192
5193 #ifndef SvREFCNT_inc_simple_NN
5194 # define SvREFCNT_inc_simple_NN(sv) (++SvREFCNT(sv), (SV*)(sv))
5195 #endif
5196
5197 #ifndef SvREFCNT_inc_void_NN
5198 # define SvREFCNT_inc_void_NN(sv) (void)(++SvREFCNT((SV*)(sv)))
5199 #endif
5200
5201 #ifndef SvREFCNT_inc_simple_void_NN
5202 # define SvREFCNT_inc_simple_void_NN(sv) (void)(++SvREFCNT((SV*)(sv)))
5203 #endif
5204
5205 #ifndef newSV_type
5206
5207 #if defined(NEED_newSV_type)
5208 static SV* DPPP_(my_newSV_type)(pTHX_ svtype const t);
5209 static
5210 #else
5211 extern SV* DPPP_(my_newSV_type)(pTHX_ svtype const t);
5212 #endif
5213
5214 #ifdef newSV_type
5215 # undef newSV_type
5216 #endif
5217 #define newSV_type(a) DPPP_(my_newSV_type)(aTHX_ a)
5218 #define Perl_newSV_type DPPP_(my_newSV_type)
5219
5220 #if defined(NEED_newSV_type) || defined(NEED_newSV_type_GLOBAL)
5221
5222 SV*
5223 DPPP_(my_newSV_type)(pTHX_ svtype const t)
5224 {
5225 SV* const sv = newSV(0);
5226 sv_upgrade(sv, t);
5227 return sv;
5228 }
5229
5230 #endif
5231
5232 #endif
5233
5234 #if (PERL_BCDVERSION < 0x5006000)
5235 # define D_PPP_CONSTPV_ARG(x) ((char *) (x))
5236 #else
5237 # define D_PPP_CONSTPV_ARG(x) (x)
5238 #endif
5239 #ifndef newSVpvn
5240 # define newSVpvn(data,len) ((data) \
5241 ? ((len) ? newSVpv((data), (len)) : newSVpv("", 0)) \
5242 : newSV(0))
5243 #endif
5244 #ifndef newSVpvn_utf8
5245 # define newSVpvn_utf8(s, len, u) newSVpvn_flags((s), (len), (u) ? SVf_UTF8 : 0)
5246 #endif
5247 #ifndef SVf_UTF8
5248 # define SVf_UTF8 0
5249 #endif
5250
5251 #ifndef newSVpvn_flags
5252
5253 #if defined(NEED_newSVpvn_flags)
5254 static SV * DPPP_(my_newSVpvn_flags)(pTHX_ const char *s, STRLEN len, U32 flags);
5255 static
5256 #else
5257 extern SV * DPPP_(my_newSVpvn_flags)(pTHX_ const char *s, STRLEN len, U32 flags);
5258 #endif
5259
5260 #ifdef newSVpvn_flags
5261 # undef newSVpvn_flags
5262 #endif
5263 #define newSVpvn_flags(a,b,c) DPPP_(my_newSVpvn_flags)(aTHX_ a,b,c)
5264 #define Perl_newSVpvn_flags DPPP_(my_newSVpvn_flags)
5265
5266 #if defined(NEED_newSVpvn_flags) || defined(NEED_newSVpvn_flags_GLOBAL)
5267
5268 SV *
5269 DPPP_(my_newSVpvn_flags)(pTHX_ const char *s, STRLEN len, U32 flags)
5270 {
5271 SV *sv = newSVpvn(D_PPP_CONSTPV_ARG(s), len);
5272 SvFLAGS(sv) |= (flags & SVf_UTF8);
5273 return (flags & SVs_TEMP) ? sv_2mortal(sv) : sv;
5274 }
5275
5276 #endif
5277
5278 #endif
5279
5280 /* Backwards compatibility stuff... :-( */
5281 #if !defined(NEED_sv_2pv_flags) && defined(NEED_sv_2pv_nolen)
5282 # define NEED_sv_2pv_flags
5283 #endif
5284 #if !defined(NEED_sv_2pv_flags_GLOBAL) && defined(NEED_sv_2pv_nolen_GLOBAL)
5285 # define NEED_sv_2pv_flags_GLOBAL
5286 #endif
5287
5288 /* Hint: sv_2pv_nolen
5289 * Use the SvPV_nolen() or SvPV_nolen_const() macros instead of sv_2pv_nolen().
5290 */
5291 #ifndef sv_2pv_nolen
5292 # define sv_2pv_nolen(sv) SvPV_nolen(sv)
5293 #endif
5294
5295 #ifdef SvPVbyte
5296
5297 /* Hint: SvPVbyte
5298 * Does not work in perl-5.6.1, ppport.h implements a version
5299 * borrowed from perl-5.7.3.
5300 */
5301
5302 #if (PERL_BCDVERSION < 0x5007000)
5303
5304 #if defined(NEED_sv_2pvbyte)
5305 static char * DPPP_(my_sv_2pvbyte)(pTHX_ SV *sv, STRLEN *lp);
5306 static
5307 #else
5308 extern char * DPPP_(my_sv_2pvbyte)(pTHX_ SV *sv, STRLEN *lp);
5309 #endif
5310
5311 #ifdef sv_2pvbyte
5312 # undef sv_2pvbyte
5313 #endif
5314 #define sv_2pvbyte(a,b) DPPP_(my_sv_2pvbyte)(aTHX_ a,b)
5315 #define Perl_sv_2pvbyte DPPP_(my_sv_2pvbyte)
5316
5317 #if defined(NEED_sv_2pvbyte) || defined(NEED_sv_2pvbyte_GLOBAL)
5318
5319 char *
5320 DPPP_(my_sv_2pvbyte)(pTHX_ SV *sv, STRLEN *lp)
5321 {
5322 sv_utf8_downgrade(sv,0);
5323 return SvPV(sv,*lp);
5324 }
5325
5326 #endif
5327
5328 /* Hint: sv_2pvbyte
5329 * Use the SvPVbyte() macro instead of sv_2pvbyte().
5330 */
5331
5332 #undef SvPVbyte
5333
5334 #define SvPVbyte(sv, lp) \
5335 ((SvFLAGS(sv) & (SVf_POK|SVf_UTF8)) == (SVf_POK) \
5336 ? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_2pvbyte(sv, &lp))
5337
5338 #endif
5339
5340 #else
5341
5342 # define SvPVbyte SvPV
5343 # define sv_2pvbyte sv_2pv
5344
5345 #endif
5346 #ifndef sv_2pvbyte_nolen
5347 # define sv_2pvbyte_nolen(sv) sv_2pv_nolen(sv)
5348 #endif
5349
5350 /* Hint: sv_pvn
5351 * Always use the SvPV() macro instead of sv_pvn().
5352 */
5353
5354 /* Hint: sv_pvn_force
5355 * Always use the SvPV_force() macro instead of sv_pvn_force().
5356 */
5357
5358 /* If these are undefined, they're not handled by the core anyway */
5359 #ifndef SV_IMMEDIATE_UNREF
5360 # define SV_IMMEDIATE_UNREF 0
5361 #endif
5362
5363 #ifndef SV_GMAGIC
5364 # define SV_GMAGIC 0
5365 #endif
5366
5367 #ifndef SV_COW_DROP_PV
5368 # define SV_COW_DROP_PV 0
5369 #endif
5370
5371 #ifndef SV_UTF8_NO_ENCODING
5372 # define SV_UTF8_NO_ENCODING 0
5373 #endif
5374
5375 #ifndef SV_NOSTEAL
5376 # define SV_NOSTEAL 0
5377 #endif
5378
5379 #ifndef SV_CONST_RETURN
5380 # define SV_CONST_RETURN 0
5381 #endif
5382
5383 #ifndef SV_MUTABLE_RETURN
5384 # define SV_MUTABLE_RETURN 0
5385 #endif
5386
5387 #ifndef SV_SMAGIC
5388 # define SV_SMAGIC 0
5389 #endif
5390
5391 #ifndef SV_HAS_TRAILING_NUL
5392 # define SV_HAS_TRAILING_NUL 0
5393 #endif
5394
5395 #ifndef SV_COW_SHARED_HASH_KEYS
5396 # define SV_COW_SHARED_HASH_KEYS 0
5397 #endif
5398
5399 #if (PERL_BCDVERSION < 0x5007002)
5400
5401 #if defined(NEED_sv_2pv_flags)
5402 static char * DPPP_(my_sv_2pv_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags);
5403 static
5404 #else
5405 extern char * DPPP_(my_sv_2pv_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags);
5406 #endif
5407
5408 #ifdef sv_2pv_flags
5409 # undef sv_2pv_flags
5410 #endif
5411 #define sv_2pv_flags(a,b,c) DPPP_(my_sv_2pv_flags)(aTHX_ a,b,c)
5412 #define Perl_sv_2pv_flags DPPP_(my_sv_2pv_flags)
5413
5414 #if defined(NEED_sv_2pv_flags) || defined(NEED_sv_2pv_flags_GLOBAL)
5415
5416 char *
5417 DPPP_(my_sv_2pv_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags)
5418 {
5419 STRLEN n_a = (STRLEN) flags;
5420 return sv_2pv(sv, lp ? lp : &n_a);
5421 }
5422
5423 #endif
5424
5425 #if defined(NEED_sv_pvn_force_flags)
5426 static char * DPPP_(my_sv_pvn_force_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags);
5427 static
5428 #else
5429 extern char * DPPP_(my_sv_pvn_force_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags);
5430 #endif
5431
5432 #ifdef sv_pvn_force_flags
5433 # undef sv_pvn_force_flags
5434 #endif
5435 #define sv_pvn_force_flags(a,b,c) DPPP_(my_sv_pvn_force_flags)(aTHX_ a,b,c)
5436 #define Perl_sv_pvn_force_flags DPPP_(my_sv_pvn_force_flags)
5437
5438 #if defined(NEED_sv_pvn_force_flags) || defined(NEED_sv_pvn_force_flags_GLOBAL)
5439
5440 char *
5441 DPPP_(my_sv_pvn_force_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags)
5442 {
5443 STRLEN n_a = (STRLEN) flags;
5444 return sv_pvn_force(sv, lp ? lp : &n_a);
5445 }
5446
5447 #endif
5448
5449 #endif
5450
5451 #if (PERL_BCDVERSION < 0x5008008) || ( (PERL_BCDVERSION >= 0x5009000) && (PERL_BCDVERSION < 0x5009003) )
5452 # define DPPP_SVPV_NOLEN_LP_ARG &PL_na
5453 #else
5454 # define DPPP_SVPV_NOLEN_LP_ARG 0
5455 #endif
5456 #ifndef SvPV_const
5457 # define SvPV_const(sv, lp) SvPV_flags_const(sv, lp, SV_GMAGIC)
5458 #endif
5459
5460 #ifndef SvPV_mutable
5461 # define SvPV_mutable(sv, lp) SvPV_flags_mutable(sv, lp, SV_GMAGIC)
5462 #endif
5463 #ifndef SvPV_flags
5464 # define SvPV_flags(sv, lp, flags) \
5465 ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
5466 ? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_2pv_flags(sv, &lp, flags))
5467 #endif
5468 #ifndef SvPV_flags_const
5469 # define SvPV_flags_const(sv, lp, flags) \
5470 ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
5471 ? ((lp = SvCUR(sv)), SvPVX_const(sv)) : \
5472 (const char*) sv_2pv_flags(sv, &lp, flags|SV_CONST_RETURN))
5473 #endif
5474 #ifndef SvPV_flags_const_nolen
5475 # define SvPV_flags_const_nolen(sv, flags) \
5476 ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
5477 ? SvPVX_const(sv) : \
5478 (const char*) sv_2pv_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, flags|SV_CONST_RETURN))
5479 #endif
5480 #ifndef SvPV_flags_mutable
5481 # define SvPV_flags_mutable(sv, lp, flags) \
5482 ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
5483 ? ((lp = SvCUR(sv)), SvPVX_mutable(sv)) : \
5484 sv_2pv_flags(sv, &lp, flags|SV_MUTABLE_RETURN))
5485 #endif
5486 #ifndef SvPV_force
5487 # define SvPV_force(sv, lp) SvPV_force_flags(sv, lp, SV_GMAGIC)
5488 #endif
5489
5490 #ifndef SvPV_force_nolen
5491 # define SvPV_force_nolen(sv) SvPV_force_flags_nolen(sv, SV_GMAGIC)
5492 #endif
5493
5494 #ifndef SvPV_force_mutable
5495 # define SvPV_force_mutable(sv, lp) SvPV_force_flags_mutable(sv, lp, SV_GMAGIC)
5496 #endif
5497
5498 #ifndef SvPV_force_nomg
5499 # define SvPV_force_nomg(sv, lp) SvPV_force_flags(sv, lp, 0)
5500 #endif
5501
5502 #ifndef SvPV_force_nomg_nolen
5503 # define SvPV_force_nomg_nolen(sv) SvPV_force_flags_nolen(sv, 0)
5504 #endif
5505 #ifndef SvPV_force_flags
5506 # define SvPV_force_flags(sv, lp, flags) \
5507 ((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == SVf_POK \
5508 ? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_pvn_force_flags(sv, &lp, flags))
5509 #endif
5510 #ifndef SvPV_force_flags_nolen
5511 # define SvPV_force_flags_nolen(sv, flags) \
5512 ((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == SVf_POK \
5513 ? SvPVX(sv) : sv_pvn_force_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, flags))
5514 #endif
5515 #ifndef SvPV_force_flags_mutable
5516 # define SvPV_force_flags_mutable(sv, lp, flags) \
5517 ((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == SVf_POK \
5518 ? ((lp = SvCUR(sv)), SvPVX_mutable(sv)) \
5519 : sv_pvn_force_flags(sv, &lp, flags|SV_MUTABLE_RETURN))
5520 #endif
5521 #ifndef SvPV_nolen
5522 # define SvPV_nolen(sv) \
5523 ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
5524 ? SvPVX(sv) : sv_2pv_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, SV_GMAGIC))
5525 #endif
5526 #ifndef SvPV_nolen_const
5527 # define SvPV_nolen_const(sv) \
5528 ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
5529 ? SvPVX_const(sv) : sv_2pv_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, SV_GMAGIC|SV_CONST_RETURN))
5530 #endif
5531 #ifndef SvPV_nomg
5532 # define SvPV_nomg(sv, lp) SvPV_flags(sv, lp, 0)
5533 #endif
5534
5535 #ifndef SvPV_nomg_const
5536 # define SvPV_nomg_const(sv, lp) SvPV_flags_const(sv, lp, 0)
5537 #endif
5538
5539 #ifndef SvPV_nomg_const_nolen
5540 # define SvPV_nomg_const_nolen(sv) SvPV_flags_const_nolen(sv, 0)
5541 #endif
5542
5543 #ifndef SvPV_nomg_nolen
5544 # define SvPV_nomg_nolen(sv) ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
5545 ? SvPVX(sv) : sv_2pv_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, 0))
5546 #endif
5547 #ifndef SvPV_renew
5548 # define SvPV_renew(sv,n) STMT_START { SvLEN_set(sv, n); \
5549 SvPV_set((sv), (char *) saferealloc( \
5550 (Malloc_t)SvPVX(sv), (MEM_SIZE)((n)))); \
5551 } STMT_END
5552 #endif
5553 #ifndef SvMAGIC_set
5554 # define SvMAGIC_set(sv, val) \
5555 STMT_START { assert(SvTYPE(sv) >= SVt_PVMG); \
5556 (((XPVMG*) SvANY(sv))->xmg_magic = (val)); } STMT_END
5557 #endif
5558
5559 #if (PERL_BCDVERSION < 0x5009003)
5560 #ifndef SvPVX_const
5561 # define SvPVX_const(sv) ((const char*) (0 + SvPVX(sv)))
5562 #endif
5563
5564 #ifndef SvPVX_mutable
5565 # define SvPVX_mutable(sv) (0 + SvPVX(sv))
5566 #endif
5567 #ifndef SvRV_set
5568 # define SvRV_set(sv, val) \
5569 STMT_START { assert(SvTYPE(sv) >= SVt_RV); \
5570 (((XRV*) SvANY(sv))->xrv_rv = (val)); } STMT_END
5571 #endif
5572
5573 #else
5574 #ifndef SvPVX_const
5575 # define SvPVX_const(sv) ((const char*)((sv)->sv_u.svu_pv))
5576 #endif
5577
5578 #ifndef SvPVX_mutable
5579 # define SvPVX_mutable(sv) ((sv)->sv_u.svu_pv)
5580 #endif
5581 #ifndef SvRV_set
5582 # define SvRV_set(sv, val) \
5583 STMT_START { assert(SvTYPE(sv) >= SVt_RV); \
5584 ((sv)->sv_u.svu_rv = (val)); } STMT_END
5585 #endif
5586
5587 #endif
5588 #ifndef SvSTASH_set
5589 # define SvSTASH_set(sv, val) \
5590 STMT_START { assert(SvTYPE(sv) >= SVt_PVMG); \
5591 (((XPVMG*) SvANY(sv))->xmg_stash = (val)); } STMT_END
5592 #endif
5593
5594 #if (PERL_BCDVERSION < 0x5004000)
5595 #ifndef SvUV_set
5596 # define SvUV_set(sv, val) \
5597 STMT_START { assert(SvTYPE(sv) == SVt_IV || SvTYPE(sv) >= SVt_PVIV); \
5598 (((XPVIV*) SvANY(sv))->xiv_iv = (IV) (val)); } STMT_END
5599 #endif
5600
5601 #else
5602 #ifndef SvUV_set
5603 # define SvUV_set(sv, val) \
5604 STMT_START { assert(SvTYPE(sv) == SVt_IV || SvTYPE(sv) >= SVt_PVIV); \
5605 (((XPVUV*) SvANY(sv))->xuv_uv = (val)); } STMT_END
5606 #endif
5607
5608 #endif
5609
5610 #if (PERL_BCDVERSION >= 0x5004000) && !defined(vnewSVpvf)
5611 #if defined(NEED_vnewSVpvf)
5612 static SV * DPPP_(my_vnewSVpvf)(pTHX_ const char *pat, va_list *args);
5613 static
5614 #else
5615 extern SV * DPPP_(my_vnewSVpvf)(pTHX_ const char *pat, va_list *args);
5616 #endif
5617
5618 #ifdef vnewSVpvf
5619 # undef vnewSVpvf
5620 #endif
5621 #define vnewSVpvf(a,b) DPPP_(my_vnewSVpvf)(aTHX_ a,b)
5622 #define Perl_vnewSVpvf DPPP_(my_vnewSVpvf)
5623
5624 #if defined(NEED_vnewSVpvf) || defined(NEED_vnewSVpvf_GLOBAL)
5625
5626 SV *
5627 DPPP_(my_vnewSVpvf)(pTHX_ const char *pat, va_list *args)
5628 {
5629 register SV *sv = newSV(0);
5630 sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*));
5631 return sv;
5632 }
5633
5634 #endif
5635 #endif
5636
5637 #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vcatpvf)
5638 # define sv_vcatpvf(sv, pat, args) sv_vcatpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*))
5639 #endif
5640
5641 #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vsetpvf)
5642 # define sv_vsetpvf(sv, pat, args) sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*))
5643 #endif
5644
5645 #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_catpvf_mg)
5646 #if defined(NEED_sv_catpvf_mg)
5647 static void DPPP_(my_sv_catpvf_mg)(pTHX_ SV *sv, const char *pat, ...);
5648 static
5649 #else
5650 extern void DPPP_(my_sv_catpvf_mg)(pTHX_ SV *sv, const char *pat, ...);
5651 #endif
5652
5653 #define Perl_sv_catpvf_mg DPPP_(my_sv_catpvf_mg)
5654
5655 #if defined(NEED_sv_catpvf_mg) || defined(NEED_sv_catpvf_mg_GLOBAL)
5656
5657 void
5658 DPPP_(my_sv_catpvf_mg)(pTHX_ SV *sv, const char *pat, ...)
5659 {
5660 va_list args;
5661 va_start(args, pat);
5662 sv_vcatpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*));
5663 SvSETMAGIC(sv);
5664 va_end(args);
5665 }
5666
5667 #endif
5668 #endif
5669
5670 #ifdef PERL_IMPLICIT_CONTEXT
5671 #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_catpvf_mg_nocontext)
5672 #if defined(NEED_sv_catpvf_mg_nocontext)
5673 static void DPPP_(my_sv_catpvf_mg_nocontext)(SV *sv, const char *pat, ...);
5674 static
5675 #else
5676 extern void DPPP_(my_sv_catpvf_mg_nocontext)(SV *sv, const char *pat, ...);
5677 #endif
5678
5679 #define sv_catpvf_mg_nocontext DPPP_(my_sv_catpvf_mg_nocontext)
5680 #define Perl_sv_catpvf_mg_nocontext DPPP_(my_sv_catpvf_mg_nocontext)
5681
5682 #if defined(NEED_sv_catpvf_mg_nocontext) || defined(NEED_sv_catpvf_mg_nocontext_GLOBAL)
5683
5684 void
5685 DPPP_(my_sv_catpvf_mg_nocontext)(SV *sv, const char *pat, ...)
5686 {
5687 dTHX;
5688 va_list args;
5689 va_start(args, pat);
5690 sv_vcatpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*));
5691 SvSETMAGIC(sv);
5692 va_end(args);
5693 }
5694
5695 #endif
5696 #endif
5697 #endif
5698
5699 /* sv_catpvf_mg depends on sv_catpvf_mg_nocontext */
5700 #ifndef sv_catpvf_mg
5701 # ifdef PERL_IMPLICIT_CONTEXT
5702 # define sv_catpvf_mg Perl_sv_catpvf_mg_nocontext
5703 # else
5704 # define sv_catpvf_mg Perl_sv_catpvf_mg
5705 # endif
5706 #endif
5707
5708 #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vcatpvf_mg)
5709 # define sv_vcatpvf_mg(sv, pat, args) \
5710 STMT_START { \
5711 sv_vcatpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*)); \
5712 SvSETMAGIC(sv); \
5713 } STMT_END
5714 #endif
5715
5716 #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_setpvf_mg)
5717 #if defined(NEED_sv_setpvf_mg)
5718 static void DPPP_(my_sv_setpvf_mg)(pTHX_ SV *sv, const char *pat, ...);
5719 static
5720 #else
5721 extern void DPPP_(my_sv_setpvf_mg)(pTHX_ SV *sv, const char *pat, ...);
5722 #endif
5723
5724 #define Perl_sv_setpvf_mg DPPP_(my_sv_setpvf_mg)
5725
5726 #if defined(NEED_sv_setpvf_mg) || defined(NEED_sv_setpvf_mg_GLOBAL)
5727
5728 void
5729 DPPP_(my_sv_setpvf_mg)(pTHX_ SV *sv, const char *pat, ...)
5730 {
5731 va_list args;
5732 va_start(args, pat);
5733 sv_vsetpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*));
5734 SvSETMAGIC(sv);
5735 va_end(args);
5736 }
5737
5738 #endif
5739 #endif
5740
5741 #ifdef PERL_IMPLICIT_CONTEXT
5742 #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_setpvf_mg_nocontext)
5743 #if defined(NEED_sv_setpvf_mg_nocontext)
5744 static void DPPP_(my_sv_setpvf_mg_nocontext)(SV *sv, const char *pat, ...);
5745 static
5746 #else
5747 extern void DPPP_(my_sv_setpvf_mg_nocontext)(SV *sv, const char *pat, ...);
5748 #endif
5749
5750 #define sv_setpvf_mg_nocontext DPPP_(my_sv_setpvf_mg_nocontext)
5751 #define Perl_sv_setpvf_mg_nocontext DPPP_(my_sv_setpvf_mg_nocontext)
5752
5753 #if defined(NEED_sv_setpvf_mg_nocontext) || defined(NEED_sv_setpvf_mg_nocontext_GLOBAL)
5754
5755 void
5756 DPPP_(my_sv_setpvf_mg_nocontext)(SV *sv, const char *pat, ...)
5757 {
5758 dTHX;
5759 va_list args;
5760 va_start(args, pat);
5761 sv_vsetpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*));
5762 SvSETMAGIC(sv);
5763 va_end(args);
5764 }
5765
5766 #endif
5767 #endif
5768 #endif
5769
5770 /* sv_setpvf_mg depends on sv_setpvf_mg_nocontext */
5771 #ifndef sv_setpvf_mg
5772 # ifdef PERL_IMPLICIT_CONTEXT
5773 # define sv_setpvf_mg Perl_sv_setpvf_mg_nocontext
5774 # else
5775 # define sv_setpvf_mg Perl_sv_setpvf_mg
5776 # endif
5777 #endif
5778
5779 #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vsetpvf_mg)
5780 # define sv_vsetpvf_mg(sv, pat, args) \
5781 STMT_START { \
5782 sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*)); \
5783 SvSETMAGIC(sv); \
5784 } STMT_END
5785 #endif
5786
5787 /* Hint: newSVpvn_share
5788 * The SVs created by this function only mimic the behaviour of
5789 * shared PVs without really being shared. Only use if you know
5790 * what you're doing.
5791 */
5792
5793 #ifndef newSVpvn_share
5794
5795 #if defined(NEED_newSVpvn_share)
5796 static SV * DPPP_(my_newSVpvn_share)(pTHX_ const char *src, I32 len, U32 hash);
5797 static
5798 #else
5799 extern SV * DPPP_(my_newSVpvn_share)(pTHX_ const char *src, I32 len, U32 hash);
5800 #endif
5801
5802 #ifdef newSVpvn_share
5803 # undef newSVpvn_share
5804 #endif
5805 #define newSVpvn_share(a,b,c) DPPP_(my_newSVpvn_share)(aTHX_ a,b,c)
5806 #define Perl_newSVpvn_share DPPP_(my_newSVpvn_share)
5807
5808 #if defined(NEED_newSVpvn_share) || defined(NEED_newSVpvn_share_GLOBAL)
5809
5810 SV *
5811 DPPP_(my_newSVpvn_share)(pTHX_ const char *src, I32 len, U32 hash)
5812 {
5813 SV *sv;
5814 if (len < 0)
5815 len = -len;
5816 if (!hash)
5817 PERL_HASH(hash, (char*) src, len);
5818 sv = newSVpvn((char *) src, len);
5819 sv_upgrade(sv, SVt_PVIV);
5820 SvIVX(sv) = hash;
5821 SvREADONLY_on(sv);
5822 SvPOK_on(sv);
5823 return sv;
5824 }
5825
5826 #endif
5827
5828 #endif
5829 #ifndef SvSHARED_HASH
5830 # define SvSHARED_HASH(sv) (0 + SvUVX(sv))
5831 #endif
5832 #ifndef HvNAME_get
5833 # define HvNAME_get(hv) HvNAME(hv)
5834 #endif
5835 #ifndef HvNAMELEN_get
5836 # define HvNAMELEN_get(hv) (HvNAME_get(hv) ? (I32)strlen(HvNAME_get(hv)) : 0)
5837 #endif
5838 #ifndef GvSVn
5839 # define GvSVn(gv) GvSV(gv)
5840 #endif
5841
5842 #ifndef isGV_with_GP
5843 # define isGV_with_GP(gv) isGV(gv)
5844 #endif
5845
5846 #ifndef gv_fetchpvn_flags
5847 # define gv_fetchpvn_flags(name, len, flags, svt) gv_fetchpv(name, flags, svt)
5848 #endif
5849
5850 #ifndef gv_fetchsv
5851 # define gv_fetchsv(name, flags, svt) gv_fetchpv(SvPV_nolen_const(name), flags, svt)
5852 #endif
5853 #ifndef get_cvn_flags
5854 # define get_cvn_flags(name, namelen, flags) get_cv(name, flags)
5855 #endif
5856 #ifndef WARN_ALL
5857 # define WARN_ALL 0
5858 #endif
5859
5860 #ifndef WARN_CLOSURE
5861 # define WARN_CLOSURE 1
5862 #endif
5863
5864 #ifndef WARN_DEPRECATED
5865 # define WARN_DEPRECATED 2
5866 #endif
5867
5868 #ifndef WARN_EXITING
5869 # define WARN_EXITING 3
5870 #endif
5871
5872 #ifndef WARN_GLOB
5873 # define WARN_GLOB 4
5874 #endif
5875
5876 #ifndef WARN_IO
5877 # define WARN_IO 5
5878 #endif
5879
5880 #ifndef WARN_CLOSED
5881 # define WARN_CLOSED 6
5882 #endif
5883
5884 #ifndef WARN_EXEC
5885 # define WARN_EXEC 7
5886 #endif
5887
5888 #ifndef WARN_LAYER
5889 # define WARN_LAYER 8
5890 #endif
5891
5892 #ifndef WARN_NEWLINE
5893 # define WARN_NEWLINE 9
5894 #endif
5895
5896 #ifndef WARN_PIPE
5897 # define WARN_PIPE 10
5898 #endif
5899
5900 #ifndef WARN_UNOPENED
5901 # define WARN_UNOPENED 11
5902 #endif
5903
5904 #ifndef WARN_MISC
5905 # define WARN_MISC 12
5906 #endif
5907
5908 #ifndef WARN_NUMERIC
5909 # define WARN_NUMERIC 13
5910 #endif
5911
5912 #ifndef WARN_ONCE
5913 # define WARN_ONCE 14
5914 #endif
5915
5916 #ifndef WARN_OVERFLOW
5917 # define WARN_OVERFLOW 15
5918 #endif
5919
5920 #ifndef WARN_PACK
5921 # define WARN_PACK 16
5922 #endif
5923
5924 #ifndef WARN_PORTABLE
5925 # define WARN_PORTABLE 17
5926 #endif
5927
5928 #ifndef WARN_RECURSION
5929 # define WARN_RECURSION 18
5930 #endif
5931
5932 #ifndef WARN_REDEFINE
5933 # define WARN_REDEFINE 19
5934 #endif
5935
5936 #ifndef WARN_REGEXP
5937 # define WARN_REGEXP 20
5938 #endif
5939
5940 #ifndef WARN_SEVERE
5941 # define WARN_SEVERE 21
5942 #endif
5943
5944 #ifndef WARN_DEBUGGING
5945 # define WARN_DEBUGGING 22
5946 #endif
5947
5948 #ifndef WARN_INPLACE
5949 # define WARN_INPLACE 23
5950 #endif
5951
5952 #ifndef WARN_INTERNAL
5953 # define WARN_INTERNAL 24
5954 #endif
5955
5956 #ifndef WARN_MALLOC
5957 # define WARN_MALLOC 25
5958 #endif
5959
5960 #ifndef WARN_SIGNAL
5961 # define WARN_SIGNAL 26
5962 #endif
5963
5964 #ifndef WARN_SUBSTR
5965 # define WARN_SUBSTR 27
5966 #endif
5967
5968 #ifndef WARN_SYNTAX
5969 # define WARN_SYNTAX 28
5970 #endif
5971
5972 #ifndef WARN_AMBIGUOUS
5973 # define WARN_AMBIGUOUS 29
5974 #endif
5975
5976 #ifndef WARN_BAREWORD
5977 # define WARN_BAREWORD 30
5978 #endif
5979
5980 #ifndef WARN_DIGIT
5981 # define WARN_DIGIT 31
5982 #endif
5983
5984 #ifndef WARN_PARENTHESIS
5985 # define WARN_PARENTHESIS 32
5986 #endif
5987
5988 #ifndef WARN_PRECEDENCE
5989 # define WARN_PRECEDENCE 33
5990 #endif
5991
5992 #ifndef WARN_PRINTF
5993 # define WARN_PRINTF 34
5994 #endif
5995
5996 #ifndef WARN_PROTOTYPE
5997 # define WARN_PROTOTYPE 35
5998 #endif
5999
6000 #ifndef WARN_QW
6001 # define WARN_QW 36
6002 #endif
6003
6004 #ifndef WARN_RESERVED
6005 # define WARN_RESERVED 37
6006 #endif
6007
6008 #ifndef WARN_SEMICOLON
6009 # define WARN_SEMICOLON 38
6010 #endif
6011
6012 #ifndef WARN_TAINT
6013 # define WARN_TAINT 39
6014 #endif
6015
6016 #ifndef WARN_THREADS
6017 # define WARN_THREADS 40
6018 #endif
6019
6020 #ifndef WARN_UNINITIALIZED
6021 # define WARN_UNINITIALIZED 41
6022 #endif
6023
6024 #ifndef WARN_UNPACK
6025 # define WARN_UNPACK 42
6026 #endif
6027
6028 #ifndef WARN_UNTIE
6029 # define WARN_UNTIE 43
6030 #endif
6031
6032 #ifndef WARN_UTF8
6033 # define WARN_UTF8 44
6034 #endif
6035
6036 #ifndef WARN_VOID
6037 # define WARN_VOID 45
6038 #endif
6039
6040 #ifndef WARN_ASSERTIONS
6041 # define WARN_ASSERTIONS 46
6042 #endif
6043 #ifndef packWARN
6044 # define packWARN(a) (a)
6045 #endif
6046
6047 #ifndef ckWARN
6048 # ifdef G_WARN_ON
6049 # define ckWARN(a) (PL_dowarn & G_WARN_ON)
6050 # else
6051 # define ckWARN(a) PL_dowarn
6052 # endif
6053 #endif
6054
6055 #if (PERL_BCDVERSION >= 0x5004000) && !defined(warner)
6056 #if defined(NEED_warner)
6057 static void DPPP_(my_warner)(U32 err, const char *pat, ...);
6058 static
6059 #else
6060 extern void DPPP_(my_warner)(U32 err, const char *pat, ...);
6061 #endif
6062
6063 #define Perl_warner DPPP_(my_warner)
6064
6065 #if defined(NEED_warner) || defined(NEED_warner_GLOBAL)
6066
6067 void
6068 DPPP_(my_warner)(U32 err, const char *pat, ...)
6069 {
6070 SV *sv;
6071 va_list args;
6072
6073 PERL_UNUSED_ARG(err);
6074
6075 va_start(args, pat);
6076 sv = vnewSVpvf(pat, &args);
6077 va_end(args);
6078 sv_2mortal(sv);
6079 warn("%s", SvPV_nolen(sv));
6080 }
6081
6082 #define warner Perl_warner
6083
6084 #define Perl_warner_nocontext Perl_warner
6085
6086 #endif
6087 #endif
6088
6089 /* concatenating with "" ensures that only literal strings are accepted as argument
6090 * note that STR_WITH_LEN() can't be used as argument to macros or functions that
6091 * under some configurations might be macros
6092 */
6093 #ifndef STR_WITH_LEN
6094 # define STR_WITH_LEN(s) (s ""), (sizeof(s)-1)
6095 #endif
6096 #ifndef newSVpvs
6097 # define newSVpvs(str) newSVpvn(str "", sizeof(str) - 1)
6098 #endif
6099
6100 #ifndef newSVpvs_flags
6101 # define newSVpvs_flags(str, flags) newSVpvn_flags(str "", sizeof(str) - 1, flags)
6102 #endif
6103
6104 #ifndef newSVpvs_share
6105 # define newSVpvs_share(str) newSVpvn_share(str "", sizeof(str) - 1, 0)
6106 #endif
6107
6108 #ifndef sv_catpvs
6109 # define sv_catpvs(sv, str) sv_catpvn(sv, str "", sizeof(str) - 1)
6110 #endif
6111
6112 #ifndef sv_setpvs
6113 # define sv_setpvs(sv, str) sv_setpvn(sv, str "", sizeof(str) - 1)
6114 #endif
6115
6116 #ifndef hv_fetchs
6117 # define hv_fetchs(hv, key, lval) hv_fetch(hv, key "", sizeof(key) - 1, lval)
6118 #endif
6119
6120 #ifndef hv_stores
6121 # define hv_stores(hv, key, val) hv_store(hv, key "", sizeof(key) - 1, val, 0)
6122 #endif
6123 #ifndef gv_fetchpvs
6124 # define gv_fetchpvs(name, flags, svt) gv_fetchpvn_flags(name "", sizeof(name) - 1, flags, svt)
6125 #endif
6126
6127 #ifndef gv_stashpvs
6128 # define gv_stashpvs(name, flags) gv_stashpvn(name "", sizeof(name) - 1, flags)
6129 #endif
6130 #ifndef get_cvs
6131 # define get_cvs(name, flags) get_cvn_flags(name "", sizeof(name)-1, flags)
6132 #endif
6133 #ifndef SvGETMAGIC
6134 # define SvGETMAGIC(x) STMT_START { if (SvGMAGICAL(x)) mg_get(x); } STMT_END
6135 #endif
6136
6137 /* Some random bits for sv_unmagicext. These should probably be pulled in for
6138 real and organized at some point */
6139 #ifndef HEf_SVKEY
6140 # define HEf_SVKEY -2
6141 #endif
6142
6143 #if defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN)
6144 # define MUTABLE_PTR(p) ({ void *_p = (p); _p; })
6145 #else
6146 # define MUTABLE_PTR(p) ((void *) (p))
6147 #endif
6148
6149 #define MUTABLE_SV(p) ((SV *)MUTABLE_PTR(p))
6150
6151 /* end of random bits */
6152 #ifndef PERL_MAGIC_sv
6153 # define PERL_MAGIC_sv '\0'
6154 #endif
6155
6156 #ifndef PERL_MAGIC_overload
6157 # define PERL_MAGIC_overload 'A'
6158 #endif
6159
6160 #ifndef PERL_MAGIC_overload_elem
6161 # define PERL_MAGIC_overload_elem 'a'
6162 #endif
6163
6164 #ifndef PERL_MAGIC_overload_table
6165 # define PERL_MAGIC_overload_table 'c'
6166 #endif
6167
6168 #ifndef PERL_MAGIC_bm
6169 # define PERL_MAGIC_bm 'B'
6170 #endif
6171
6172 #ifndef PERL_MAGIC_regdata
6173 # define PERL_MAGIC_regdata 'D'
6174 #endif
6175
6176 #ifndef PERL_MAGIC_regdatum
6177 # define PERL_MAGIC_regdatum 'd'
6178 #endif
6179
6180 #ifndef PERL_MAGIC_env
6181 # define PERL_MAGIC_env 'E'
6182 #endif
6183
6184 #ifndef PERL_MAGIC_envelem
6185 # define PERL_MAGIC_envelem 'e'
6186 #endif
6187
6188 #ifndef PERL_MAGIC_fm
6189 # define PERL_MAGIC_fm 'f'
6190 #endif
6191
6192 #ifndef PERL_MAGIC_regex_global
6193 # define PERL_MAGIC_regex_global 'g'
6194 #endif
6195
6196 #ifndef PERL_MAGIC_isa
6197 # define PERL_MAGIC_isa 'I'
6198 #endif
6199
6200 #ifndef PERL_MAGIC_isaelem
6201 # define PERL_MAGIC_isaelem 'i'
6202 #endif
6203
6204 #ifndef PERL_MAGIC_nkeys
6205 # define PERL_MAGIC_nkeys 'k'
6206 #endif
6207
6208 #ifndef PERL_MAGIC_dbfile
6209 # define PERL_MAGIC_dbfile 'L'
6210 #endif
6211
6212 #ifndef PERL_MAGIC_dbline
6213 # define PERL_MAGIC_dbline 'l'
6214 #endif
6215
6216 #ifndef PERL_MAGIC_mutex
6217 # define PERL_MAGIC_mutex 'm'
6218 #endif
6219
6220 #ifndef PERL_MAGIC_shared
6221 # define PERL_MAGIC_shared 'N'
6222 #endif
6223
6224 #ifndef PERL_MAGIC_shared_scalar
6225 # define PERL_MAGIC_shared_scalar 'n'
6226 #endif
6227
6228 #ifndef PERL_MAGIC_collxfrm
6229 # define PERL_MAGIC_collxfrm 'o'
6230 #endif
6231
6232 #ifndef PERL_MAGIC_tied
6233 # define PERL_MAGIC_tied 'P'
6234 #endif
6235
6236 #ifndef PERL_MAGIC_tiedelem
6237 # define PERL_MAGIC_tiedelem 'p'
6238 #endif
6239
6240 #ifndef PERL_MAGIC_tiedscalar
6241 # define PERL_MAGIC_tiedscalar 'q'
6242 #endif
6243
6244 #ifndef PERL_MAGIC_qr
6245 # define PERL_MAGIC_qr 'r'
6246 #endif
6247
6248 #ifndef PERL_MAGIC_sig
6249 # define PERL_MAGIC_sig 'S'
6250 #endif
6251
6252 #ifndef PERL_MAGIC_sigelem
6253 # define PERL_MAGIC_sigelem 's'
6254 #endif
6255
6256 #ifndef PERL_MAGIC_taint
6257 # define PERL_MAGIC_taint 't'
6258 #endif
6259
6260 #ifndef PERL_MAGIC_uvar
6261 # define PERL_MAGIC_uvar 'U'
6262 #endif
6263
6264 #ifndef PERL_MAGIC_uvar_elem
6265 # define PERL_MAGIC_uvar_elem 'u'
6266 #endif
6267
6268 #ifndef PERL_MAGIC_vstring
6269 # define PERL_MAGIC_vstring 'V'
6270 #endif
6271
6272 #ifndef PERL_MAGIC_vec
6273 # define PERL_MAGIC_vec 'v'
6274 #endif
6275
6276 #ifndef PERL_MAGIC_utf8
6277 # define PERL_MAGIC_utf8 'w'
6278 #endif
6279
6280 #ifndef PERL_MAGIC_substr
6281 # define PERL_MAGIC_substr 'x'
6282 #endif
6283
6284 #ifndef PERL_MAGIC_defelem
6285 # define PERL_MAGIC_defelem 'y'
6286 #endif
6287
6288 #ifndef PERL_MAGIC_glob
6289 # define PERL_MAGIC_glob '*'
6290 #endif
6291
6292 #ifndef PERL_MAGIC_arylen
6293 # define PERL_MAGIC_arylen '#'
6294 #endif
6295
6296 #ifndef PERL_MAGIC_pos
6297 # define PERL_MAGIC_pos '.'
6298 #endif
6299
6300 #ifndef PERL_MAGIC_backref
6301 # define PERL_MAGIC_backref '<'
6302 #endif
6303
6304 #ifndef PERL_MAGIC_ext
6305 # define PERL_MAGIC_ext '~'
6306 #endif
6307
6308 /* That's the best we can do... */
6309 #ifndef sv_catpvn_nomg
6310 # define sv_catpvn_nomg sv_catpvn
6311 #endif
6312
6313 #ifndef sv_catsv_nomg
6314 # define sv_catsv_nomg sv_catsv
6315 #endif
6316
6317 #ifndef sv_setsv_nomg
6318 # define sv_setsv_nomg sv_setsv
6319 #endif
6320
6321 #ifndef sv_pvn_nomg
6322 # define sv_pvn_nomg sv_pvn
6323 #endif
6324
6325 #ifndef SvIV_nomg
6326 # define SvIV_nomg SvIV
6327 #endif
6328
6329 #ifndef SvUV_nomg
6330 # define SvUV_nomg SvUV
6331 #endif
6332
6333 #ifndef sv_catpv_mg
6334 # define sv_catpv_mg(sv, ptr) \
6335 STMT_START { \
6336 SV *TeMpSv = sv; \
6337 sv_catpv(TeMpSv,ptr); \
6338 SvSETMAGIC(TeMpSv); \
6339 } STMT_END
6340 #endif
6341
6342 #ifndef sv_catpvn_mg
6343 # define sv_catpvn_mg(sv, ptr, len) \
6344 STMT_START { \
6345 SV *TeMpSv = sv; \
6346 sv_catpvn(TeMpSv,ptr,len); \
6347 SvSETMAGIC(TeMpSv); \
6348 } STMT_END
6349 #endif
6350
6351 #ifndef sv_catsv_mg
6352 # define sv_catsv_mg(dsv, ssv) \
6353 STMT_START { \
6354 SV *TeMpSv = dsv; \
6355 sv_catsv(TeMpSv,ssv); \
6356 SvSETMAGIC(TeMpSv); \
6357 } STMT_END
6358 #endif
6359
6360 #ifndef sv_setiv_mg
6361 # define sv_setiv_mg(sv, i) \
6362 STMT_START { \
6363 SV *TeMpSv = sv; \
6364 sv_setiv(TeMpSv,i); \
6365 SvSETMAGIC(TeMpSv); \
6366 } STMT_END
6367 #endif
6368
6369 #ifndef sv_setnv_mg
6370 # define sv_setnv_mg(sv, num) \
6371 STMT_START { \
6372 SV *TeMpSv = sv; \
6373 sv_setnv(TeMpSv,num); \
6374 SvSETMAGIC(TeMpSv); \
6375 } STMT_END
6376 #endif
6377
6378 #ifndef sv_setpv_mg
6379 # define sv_setpv_mg(sv, ptr) \
6380 STMT_START { \
6381 SV *TeMpSv = sv; \
6382 sv_setpv(TeMpSv,ptr); \
6383 SvSETMAGIC(TeMpSv); \
6384 } STMT_END
6385 #endif
6386
6387 #ifndef sv_setpvn_mg
6388 # define sv_setpvn_mg(sv, ptr, len) \
6389 STMT_START { \
6390 SV *TeMpSv = sv; \
6391 sv_setpvn(TeMpSv,ptr,len); \
6392 SvSETMAGIC(TeMpSv); \
6393 } STMT_END
6394 #endif
6395
6396 #ifndef sv_setsv_mg
6397 # define sv_setsv_mg(dsv, ssv) \
6398 STMT_START { \
6399 SV *TeMpSv = dsv; \
6400 sv_setsv(TeMpSv,ssv); \
6401 SvSETMAGIC(TeMpSv); \
6402 } STMT_END
6403 #endif
6404
6405 #ifndef sv_setuv_mg
6406 # define sv_setuv_mg(sv, i) \
6407 STMT_START { \
6408 SV *TeMpSv = sv; \
6409 sv_setuv(TeMpSv,i); \
6410 SvSETMAGIC(TeMpSv); \
6411 } STMT_END
6412 #endif
6413
6414 #ifndef sv_usepvn_mg
6415 # define sv_usepvn_mg(sv, ptr, len) \
6416 STMT_START { \
6417 SV *TeMpSv = sv; \
6418 sv_usepvn(TeMpSv,ptr,len); \
6419 SvSETMAGIC(TeMpSv); \
6420 } STMT_END
6421 #endif
6422 #ifndef SvVSTRING_mg
6423 # define SvVSTRING_mg(sv) (SvMAGICAL(sv) ? mg_find(sv, PERL_MAGIC_vstring) : NULL)
6424 #endif
6425
6426 /* Hint: sv_magic_portable
6427 * This is a compatibility function that is only available with
6428 * Devel::PPPort. It is NOT in the perl core.
6429 * Its purpose is to mimic the 5.8.0 behaviour of sv_magic() when
6430 * it is being passed a name pointer with namlen == 0. In that
6431 * case, perl 5.8.0 and later store the pointer, not a copy of it.
6432 * The compatibility can be provided back to perl 5.004. With
6433 * earlier versions, the code will not compile.
6434 */
6435
6436 #if (PERL_BCDVERSION < 0x5004000)
6437
6438 /* code that uses sv_magic_portable will not compile */
6439
6440 #elif (PERL_BCDVERSION < 0x5008000)
6441
6442 # define sv_magic_portable(sv, obj, how, name, namlen) \
6443 STMT_START { \
6444 SV *SvMp_sv = (sv); \
6445 char *SvMp_name = (char *) (name); \
6446 I32 SvMp_namlen = (namlen); \
6447 if (SvMp_name && SvMp_namlen == 0) \
6448 { \
6449 MAGIC *mg; \
6450 sv_magic(SvMp_sv, obj, how, 0, 0); \
6451 mg = SvMAGIC(SvMp_sv); \
6452 mg->mg_len = -42; /* XXX: this is the tricky part */ \
6453 mg->mg_ptr = SvMp_name; \
6454 } \
6455 else \
6456 { \
6457 sv_magic(SvMp_sv, obj, how, SvMp_name, SvMp_namlen); \
6458 } \
6459 } STMT_END
6460
6461 #else
6462
6463 # define sv_magic_portable(a, b, c, d, e) sv_magic(a, b, c, d, e)
6464
6465 #endif
6466
6467 #if !defined(mg_findext)
6468 #if defined(NEED_mg_findext)
6469 static MAGIC * DPPP_(my_mg_findext)(SV * sv, int type, const MGVTBL *vtbl);
6470 static
6471 #else
6472 extern MAGIC * DPPP_(my_mg_findext)(SV * sv, int type, const MGVTBL *vtbl);
6473 #endif
6474
6475 #define mg_findext DPPP_(my_mg_findext)
6476 #define Perl_mg_findext DPPP_(my_mg_findext)
6477
6478 #if defined(NEED_mg_findext) || defined(NEED_mg_findext_GLOBAL)
6479
6480 MAGIC *
6481 DPPP_(my_mg_findext)(SV * sv, int type, const MGVTBL *vtbl) {
6482 if (sv) {
6483 MAGIC *mg;
6484
6485 #ifdef AvPAD_NAMELIST
6486 assert(!(SvTYPE(sv) == SVt_PVAV && AvPAD_NAMELIST(sv)));
6487 #endif
6488
6489 for (mg = SvMAGIC (sv); mg; mg = mg->mg_moremagic) {
6490 if (mg->mg_type == type && mg->mg_virtual == vtbl)
6491 return mg;
6492 }
6493 }
6494
6495 return NULL;
6496 }
6497
6498 #endif
6499 #endif
6500
6501 #if !defined(sv_unmagicext)
6502 #if defined(NEED_sv_unmagicext)
6503 static int DPPP_(my_sv_unmagicext)(pTHX_ SV * const sv, const int type, MGVTBL * vtbl);
6504 static
6505 #else
6506 extern int DPPP_(my_sv_unmagicext)(pTHX_ SV * const sv, const int type, MGVTBL * vtbl);
6507 #endif
6508
6509 #ifdef sv_unmagicext
6510 # undef sv_unmagicext
6511 #endif
6512 #define sv_unmagicext(a,b,c) DPPP_(my_sv_unmagicext)(aTHX_ a,b,c)
6513 #define Perl_sv_unmagicext DPPP_(my_sv_unmagicext)
6514
6515 #if defined(NEED_sv_unmagicext) || defined(NEED_sv_unmagicext_GLOBAL)
6516
6517 int
6518 DPPP_(my_sv_unmagicext)(pTHX_ SV *const sv, const int type, MGVTBL *vtbl)
6519 {
6520 MAGIC* mg;
6521 MAGIC** mgp;
6522
6523 if (SvTYPE(sv) < SVt_PVMG || !SvMAGIC(sv))
6524 return 0;
6525 mgp = &(SvMAGIC(sv));
6526 for (mg = *mgp; mg; mg = *mgp) {
6527 const MGVTBL* const virt = mg->mg_virtual;
6528 if (mg->mg_type == type && virt == vtbl) {
6529 *mgp = mg->mg_moremagic;
6530 if (virt && virt->svt_free)
6531 virt->svt_free(aTHX_ sv, mg);
6532 if (mg->mg_ptr && mg->mg_type != PERL_MAGIC_regex_global) {
6533 if (mg->mg_len > 0)
6534 Safefree(mg->mg_ptr);
6535 else if (mg->mg_len == HEf_SVKEY) /* Questionable on older perls... */
6536 SvREFCNT_dec(MUTABLE_SV(mg->mg_ptr));
6537 else if (mg->mg_type == PERL_MAGIC_utf8)
6538 Safefree(mg->mg_ptr);
6539 }
6540 if (mg->mg_flags & MGf_REFCOUNTED)
6541 SvREFCNT_dec(mg->mg_obj);
6542 Safefree(mg);
6543 }
6544 else
6545 mgp = &mg->mg_moremagic;
6546 }
6547 if (SvMAGIC(sv)) {
6548 if (SvMAGICAL(sv)) /* if we're under save_magic, wait for restore_magic; */
6549 mg_magical(sv); /* else fix the flags now */
6550 }
6551 else {
6552 SvMAGICAL_off(sv);
6553 SvFLAGS(sv) |= (SvFLAGS(sv) & (SVp_IOK|SVp_NOK|SVp_POK)) >> PRIVSHIFT;
6554 }
6555 return 0;
6556 }
6557
6558 #endif
6559 #endif
6560
6561 #ifdef USE_ITHREADS
6562 #ifndef CopFILE
6563 # define CopFILE(c) ((c)->cop_file)
6564 #endif
6565
6566 #ifndef CopFILEGV
6567 # define CopFILEGV(c) (CopFILE(c) ? gv_fetchfile(CopFILE(c)) : Nullgv)
6568 #endif
6569
6570 #ifndef CopFILE_set
6571 # define CopFILE_set(c,pv) ((c)->cop_file = savepv(pv))
6572 #endif
6573
6574 #ifndef CopFILESV
6575 # define CopFILESV(c) (CopFILE(c) ? GvSV(gv_fetchfile(CopFILE(c))) : Nullsv)
6576 #endif
6577
6578 #ifndef CopFILEAV
6579 # define CopFILEAV(c) (CopFILE(c) ? GvAV(gv_fetchfile(CopFILE(c))) : Nullav)
6580 #endif
6581
6582 #ifndef CopSTASHPV
6583 # define CopSTASHPV(c) ((c)->cop_stashpv)
6584 #endif
6585
6586 #ifndef CopSTASHPV_set
6587 # define CopSTASHPV_set(c,pv) ((c)->cop_stashpv = ((pv) ? savepv(pv) : Nullch))
6588 #endif
6589
6590 #ifndef CopSTASH
6591 # define CopSTASH(c) (CopSTASHPV(c) ? gv_stashpv(CopSTASHPV(c),GV_ADD) : Nullhv)
6592 #endif
6593
6594 #ifndef CopSTASH_set
6595 # define CopSTASH_set(c,hv) CopSTASHPV_set(c, (hv) ? HvNAME(hv) : Nullch)
6596 #endif
6597
6598 #ifndef CopSTASH_eq
6599 # define CopSTASH_eq(c,hv) ((hv) && (CopSTASHPV(c) == HvNAME(hv) \
6600 || (CopSTASHPV(c) && HvNAME(hv) \
6601 && strEQ(CopSTASHPV(c), HvNAME(hv)))))
6602 #endif
6603
6604 #else
6605 #ifndef CopFILEGV
6606 # define CopFILEGV(c) ((c)->cop_filegv)
6607 #endif
6608
6609 #ifndef CopFILEGV_set
6610 # define CopFILEGV_set(c,gv) ((c)->cop_filegv = (GV*)SvREFCNT_inc(gv))
6611 #endif
6612
6613 #ifndef CopFILE_set
6614 # define CopFILE_set(c,pv) CopFILEGV_set((c), gv_fetchfile(pv))
6615 #endif
6616
6617 #ifndef CopFILESV
6618 # define CopFILESV(c) (CopFILEGV(c) ? GvSV(CopFILEGV(c)) : Nullsv)
6619 #endif
6620
6621 #ifndef CopFILEAV
6622 # define CopFILEAV(c) (CopFILEGV(c) ? GvAV(CopFILEGV(c)) : Nullav)
6623 #endif
6624
6625 #ifndef CopFILE
6626 # define CopFILE(c) (CopFILESV(c) ? SvPVX(CopFILESV(c)) : Nullch)
6627 #endif
6628
6629 #ifndef CopSTASH
6630 # define CopSTASH(c) ((c)->cop_stash)
6631 #endif
6632
6633 #ifndef CopSTASH_set
6634 # define CopSTASH_set(c,hv) ((c)->cop_stash = (hv))
6635 #endif
6636
6637 #ifndef CopSTASHPV
6638 # define CopSTASHPV(c) (CopSTASH(c) ? HvNAME(CopSTASH(c)) : Nullch)
6639 #endif
6640
6641 #ifndef CopSTASHPV_set
6642 # define CopSTASHPV_set(c,pv) CopSTASH_set((c), gv_stashpv(pv,GV_ADD))
6643 #endif
6644
6645 #ifndef CopSTASH_eq
6646 # define CopSTASH_eq(c,hv) (CopSTASH(c) == (hv))
6647 #endif
6648
6649 #endif /* USE_ITHREADS */
6650
6651 #if (PERL_BCDVERSION >= 0x5006000)
6652 #ifndef caller_cx
6653
6654 # if defined(NEED_caller_cx) || defined(NEED_caller_cx_GLOBAL)
6655 static I32
6656 DPPP_dopoptosub_at(const PERL_CONTEXT *cxstk, I32 startingblock)
6657 {
6658 I32 i;
6659
6660 for (i = startingblock; i >= 0; i--) {
6661 register const PERL_CONTEXT * const cx = &cxstk[i];
6662 switch (CxTYPE(cx)) {
6663 default:
6664 continue;
6665 case CXt_EVAL:
6666 case CXt_SUB:
6667 case CXt_FORMAT:
6668 return i;
6669 }
6670 }
6671 return i;
6672 }
6673 # endif
6674
6675 # if defined(NEED_caller_cx)
6676 static const PERL_CONTEXT * DPPP_(my_caller_cx)(pTHX_ I32 count, const PERL_CONTEXT **dbcxp);
6677 static
6678 #else
6679 extern const PERL_CONTEXT * DPPP_(my_caller_cx)(pTHX_ I32 count, const PERL_CONTEXT **dbcxp);
6680 #endif
6681
6682 #ifdef caller_cx
6683 # undef caller_cx
6684 #endif
6685 #define caller_cx(a,b) DPPP_(my_caller_cx)(aTHX_ a,b)
6686 #define Perl_caller_cx DPPP_(my_caller_cx)
6687
6688 #if defined(NEED_caller_cx) || defined(NEED_caller_cx_GLOBAL)
6689
6690 const PERL_CONTEXT *
6691 DPPP_(my_caller_cx)(pTHX_ I32 count, const PERL_CONTEXT **dbcxp)
6692 {
6693 register I32 cxix = DPPP_dopoptosub_at(cxstack, cxstack_ix);
6694 register const PERL_CONTEXT *cx;
6695 register const PERL_CONTEXT *ccstack = cxstack;
6696 const PERL_SI *top_si = PL_curstackinfo;
6697
6698 for (;;) {
6699 /* we may be in a higher stacklevel, so dig down deeper */
6700 while (cxix < 0 && top_si->si_type != PERLSI_MAIN) {
6701 top_si = top_si->si_prev;
6702 ccstack = top_si->si_cxstack;
6703 cxix = DPPP_dopoptosub_at(ccstack, top_si->si_cxix);
6704 }
6705 if (cxix < 0)
6706 return NULL;
6707 /* caller() should not report the automatic calls to &DB::sub */
6708 if (PL_DBsub && GvCV(PL_DBsub) && cxix >= 0 &&
6709 ccstack[cxix].blk_sub.cv == GvCV(PL_DBsub))
6710 count++;
6711 if (!count--)
6712 break;
6713 cxix = DPPP_dopoptosub_at(ccstack, cxix - 1);
6714 }
6715
6716 cx = &ccstack[cxix];
6717 if (dbcxp) *dbcxp = cx;
6718
6719 if (CxTYPE(cx) == CXt_SUB || CxTYPE(cx) == CXt_FORMAT) {
6720 const I32 dbcxix = DPPP_dopoptosub_at(ccstack, cxix - 1);
6721 /* We expect that ccstack[dbcxix] is CXt_SUB, anyway, the
6722 field below is defined for any cx. */
6723 /* caller() should not report the automatic calls to &DB::sub */
6724 if (PL_DBsub && GvCV(PL_DBsub) && dbcxix >= 0 && ccstack[dbcxix].blk_sub.cv == GvCV(PL_DBsub))
6725 cx = &ccstack[dbcxix];
6726 }
6727
6728 return cx;
6729 }
6730
6731 # endif
6732 #endif /* caller_cx */
6733 #endif /* 5.6.0 */
6734 #ifndef IN_PERL_COMPILETIME
6735 # define IN_PERL_COMPILETIME (PL_curcop == &PL_compiling)
6736 #endif
6737
6738 #ifndef IN_LOCALE_RUNTIME
6739 # define IN_LOCALE_RUNTIME (PL_curcop->op_private & HINT_LOCALE)
6740 #endif
6741
6742 #ifndef IN_LOCALE_COMPILETIME
6743 # define IN_LOCALE_COMPILETIME (PL_hints & HINT_LOCALE)
6744 #endif
6745
6746 #ifndef IN_LOCALE
6747 # define IN_LOCALE (IN_PERL_COMPILETIME ? IN_LOCALE_COMPILETIME : IN_LOCALE_RUNTIME)
6748 #endif
6749 #ifndef IS_NUMBER_IN_UV
6750 # define IS_NUMBER_IN_UV 0x01
6751 #endif
6752
6753 #ifndef IS_NUMBER_GREATER_THAN_UV_MAX
6754 # define IS_NUMBER_GREATER_THAN_UV_MAX 0x02
6755 #endif
6756
6757 #ifndef IS_NUMBER_NOT_INT
6758 # define IS_NUMBER_NOT_INT 0x04
6759 #endif
6760
6761 #ifndef IS_NUMBER_NEG
6762 # define IS_NUMBER_NEG 0x08
6763 #endif
6764
6765 #ifndef IS_NUMBER_INFINITY
6766 # define IS_NUMBER_INFINITY 0x10
6767 #endif
6768
6769 #ifndef IS_NUMBER_NAN
6770 # define IS_NUMBER_NAN 0x20
6771 #endif
6772 #ifndef GROK_NUMERIC_RADIX
6773 # define GROK_NUMERIC_RADIX(sp, send) grok_numeric_radix(sp, send)
6774 #endif
6775 #ifndef PERL_SCAN_GREATER_THAN_UV_MAX
6776 # define PERL_SCAN_GREATER_THAN_UV_MAX 0x02
6777 #endif
6778
6779 #ifndef PERL_SCAN_SILENT_ILLDIGIT
6780 # define PERL_SCAN_SILENT_ILLDIGIT 0x04
6781 #endif
6782
6783 #ifndef PERL_SCAN_ALLOW_UNDERSCORES
6784 # define PERL_SCAN_ALLOW_UNDERSCORES 0x01
6785 #endif
6786
6787 #ifndef PERL_SCAN_DISALLOW_PREFIX
6788 # define PERL_SCAN_DISALLOW_PREFIX 0x02
6789 #endif
6790
6791 #ifndef grok_numeric_radix
6792 #if defined(NEED_grok_numeric_radix)
6793 static bool DPPP_(my_grok_numeric_radix)(pTHX_ const char ** sp, const char * send);
6794 static
6795 #else
6796 extern bool DPPP_(my_grok_numeric_radix)(pTHX_ const char ** sp, const char * send);
6797 #endif
6798
6799 #ifdef grok_numeric_radix
6800 # undef grok_numeric_radix
6801 #endif
6802 #define grok_numeric_radix(a,b) DPPP_(my_grok_numeric_radix)(aTHX_ a,b)
6803 #define Perl_grok_numeric_radix DPPP_(my_grok_numeric_radix)
6804
6805 #if defined(NEED_grok_numeric_radix) || defined(NEED_grok_numeric_radix_GLOBAL)
6806 bool
6807 DPPP_(my_grok_numeric_radix)(pTHX_ const char **sp, const char *send)
6808 {
6809 #ifdef USE_LOCALE_NUMERIC
6810 #ifdef PL_numeric_radix_sv
6811 if (PL_numeric_radix_sv && IN_LOCALE) {
6812 STRLEN len;
6813 char* radix = SvPV(PL_numeric_radix_sv, len);
6814 if (*sp + len <= send && memEQ(*sp, radix, len)) {
6815 *sp += len;
6816 return TRUE;
6817 }
6818 }
6819 #else
6820 /* older perls don't have PL_numeric_radix_sv so the radix
6821 * must manually be requested from locale.h
6822 */
6823 #include <locale.h>
6824 dTHR; /* needed for older threaded perls */
6825 struct lconv *lc = localeconv();
6826 char *radix = lc->decimal_point;
6827 if (radix && IN_LOCALE) {
6828 STRLEN len = strlen(radix);
6829 if (*sp + len <= send && memEQ(*sp, radix, len)) {
6830 *sp += len;
6831 return TRUE;
6832 }
6833 }
6834 #endif
6835 #endif /* USE_LOCALE_NUMERIC */
6836 /* always try "." if numeric radix didn't match because
6837 * we may have data from different locales mixed */
6838 if (*sp < send && **sp == '.') {
6839 ++*sp;
6840 return TRUE;
6841 }
6842 return FALSE;
6843 }
6844 #endif
6845 #endif
6846
6847 #ifndef grok_number
6848 #if defined(NEED_grok_number)
6849 static int DPPP_(my_grok_number)(pTHX_ const char * pv, STRLEN len, UV * valuep);
6850 static
6851 #else
6852 extern int DPPP_(my_grok_number)(pTHX_ const char * pv, STRLEN len, UV * valuep);
6853 #endif
6854
6855 #ifdef grok_number
6856 # undef grok_number
6857 #endif
6858 #define grok_number(a,b,c) DPPP_(my_grok_number)(aTHX_ a,b,c)
6859 #define Perl_grok_number DPPP_(my_grok_number)
6860
6861 #if defined(NEED_grok_number) || defined(NEED_grok_number_GLOBAL)
6862 int
6863 DPPP_(my_grok_number)(pTHX_ const char *pv, STRLEN len, UV *valuep)
6864 {
6865 const char *s = pv;
6866 const char *send = pv + len;
6867 const UV max_div_10 = UV_MAX / 10;
6868 const char max_mod_10 = UV_MAX % 10;
6869 int numtype = 0;
6870 int sawinf = 0;
6871 int sawnan = 0;
6872
6873 while (s < send && isSPACE(*s))
6874 s++;
6875 if (s == send) {
6876 return 0;
6877 } else if (*s == '-') {
6878 s++;
6879 numtype = IS_NUMBER_NEG;
6880 }
6881 else if (*s == '+')
6882 s++;
6883
6884 if (s == send)
6885 return 0;
6886
6887 /* next must be digit or the radix separator or beginning of infinity */
6888 if (isDIGIT(*s)) {
6889 /* UVs are at least 32 bits, so the first 9 decimal digits cannot
6890 overflow. */
6891 UV value = *s - '0';
6892 /* This construction seems to be more optimiser friendly.
6893 (without it gcc does the isDIGIT test and the *s - '0' separately)
6894 With it gcc on arm is managing 6 instructions (6 cycles) per digit.
6895 In theory the optimiser could deduce how far to unroll the loop
6896 before checking for overflow. */
6897 if (++s < send) {
6898 int digit = *s - '0';
6899 if (digit >= 0 && digit <= 9) {
6900 value = value * 10 + digit;
6901 if (++s < send) {
6902 digit = *s - '0';
6903 if (digit >= 0 && digit <= 9) {
6904 value = value * 10 + digit;
6905 if (++s < send) {
6906 digit = *s - '0';
6907 if (digit >= 0 && digit <= 9) {
6908 value = value * 10 + digit;
6909 if (++s < send) {
6910 digit = *s - '0';
6911 if (digit >= 0 && digit <= 9) {
6912 value = value * 10 + digit;
6913 if (++s < send) {
6914 digit = *s - '0';
6915 if (digit >= 0 && digit <= 9) {
6916 value = value * 10 + digit;
6917 if (++s < send) {
6918 digit = *s - '0';
6919 if (digit >= 0 && digit <= 9) {
6920 value = value * 10 + digit;
6921 if (++s < send) {
6922 digit = *s - '0';
6923 if (digit >= 0 && digit <= 9) {
6924 value = value * 10 + digit;
6925 if (++s < send) {
6926 digit = *s - '0';
6927 if (digit >= 0 && digit <= 9) {
6928 value = value * 10 + digit;
6929 if (++s < send) {
6930 /* Now got 9 digits, so need to check
6931 each time for overflow. */
6932 digit = *s - '0';
6933 while (digit >= 0 && digit <= 9
6934 && (value < max_div_10
6935 || (value == max_div_10
6936 && digit <= max_mod_10))) {
6937 value = value * 10 + digit;
6938 if (++s < send)
6939 digit = *s - '0';
6940 else
6941 break;
6942 }
6943 if (digit >= 0 && digit <= 9
6944 && (s < send)) {
6945 /* value overflowed.
6946 skip the remaining digits, don't
6947 worry about setting *valuep. */
6948 do {
6949 s++;
6950 } while (s < send && isDIGIT(*s));
6951 numtype |=
6952 IS_NUMBER_GREATER_THAN_UV_MAX;
6953 goto skip_value;
6954 }
6955 }
6956 }
6957 }
6958 }
6959 }
6960 }
6961 }
6962 }
6963 }
6964 }
6965 }
6966 }
6967 }
6968 }
6969 }
6970 }
6971 }
6972 numtype |= IS_NUMBER_IN_UV;
6973 if (valuep)
6974 *valuep = value;
6975
6976 skip_value:
6977 if (GROK_NUMERIC_RADIX(&s, send)) {
6978 numtype |= IS_NUMBER_NOT_INT;
6979 while (s < send && isDIGIT(*s)) /* optional digits after the radix */
6980 s++;
6981 }
6982 }
6983 else if (GROK_NUMERIC_RADIX(&s, send)) {
6984 numtype |= IS_NUMBER_NOT_INT | IS_NUMBER_IN_UV; /* valuep assigned below */
6985 /* no digits before the radix means we need digits after it */
6986 if (s < send && isDIGIT(*s)) {
6987 do {
6988 s++;
6989 } while (s < send && isDIGIT(*s));
6990 if (valuep) {
6991 /* integer approximation is valid - it's 0. */
6992 *valuep = 0;
6993 }
6994 }
6995 else
6996 return 0;
6997 } else if (*s == 'I' || *s == 'i') {
6998 s++; if (s == send || (*s != 'N' && *s != 'n')) return 0;
6999 s++; if (s == send || (*s != 'F' && *s != 'f')) return 0;
7000 s++; if (s < send && (*s == 'I' || *s == 'i')) {
7001 s++; if (s == send || (*s != 'N' && *s != 'n')) return 0;
7002 s++; if (s == send || (*s != 'I' && *s != 'i')) return 0;
7003 s++; if (s == send || (*s != 'T' && *s != 't')) return 0;
7004 s++; if (s == send || (*s != 'Y' && *s != 'y')) return 0;
7005 s++;
7006 }
7007 sawinf = 1;
7008 } else if (*s == 'N' || *s == 'n') {
7009 /* XXX TODO: There are signaling NaNs and quiet NaNs. */
7010 s++; if (s == send || (*s != 'A' && *s != 'a')) return 0;
7011 s++; if (s == send || (*s != 'N' && *s != 'n')) return 0;
7012 s++;
7013 sawnan = 1;
7014 } else
7015 return 0;
7016
7017 if (sawinf) {
7018 numtype &= IS_NUMBER_NEG; /* Keep track of sign */
7019 numtype |= IS_NUMBER_INFINITY | IS_NUMBER_NOT_INT;
7020 } else if (sawnan) {
7021 numtype &= IS_NUMBER_NEG; /* Keep track of sign */
7022 numtype |= IS_NUMBER_NAN | IS_NUMBER_NOT_INT;
7023 } else if (s < send) {
7024 /* we can have an optional exponent part */
7025 if (*s == 'e' || *s == 'E') {
7026 /* The only flag we keep is sign. Blow away any "it's UV" */
7027 numtype &= IS_NUMBER_NEG;
7028 numtype |= IS_NUMBER_NOT_INT;
7029 s++;
7030 if (s < send && (*s == '-' || *s == '+'))
7031 s++;
7032 if (s < send && isDIGIT(*s)) {
7033 do {
7034 s++;
7035 } while (s < send && isDIGIT(*s));
7036 }
7037 else
7038 return 0;
7039 }
7040 }
7041 while (s < send && isSPACE(*s))
7042 s++;
7043 if (s >= send)
7044 return numtype;
7045 if (len == 10 && memEQ(pv, "0 but true", 10)) {
7046 if (valuep)
7047 *valuep = 0;
7048 return IS_NUMBER_IN_UV;
7049 }
7050 return 0;
7051 }
7052 #endif
7053 #endif
7054
7055 /*
7056 * The grok_* routines have been modified to use warn() instead of
7057 * Perl_warner(). Also, 'hexdigit' was the former name of PL_hexdigit,
7058 * which is why the stack variable has been renamed to 'xdigit'.
7059 */
7060
7061 #ifndef grok_bin
7062 #if defined(NEED_grok_bin)
7063 static UV DPPP_(my_grok_bin)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
7064 static
7065 #else
7066 extern UV DPPP_(my_grok_bin)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
7067 #endif
7068
7069 #ifdef grok_bin
7070 # undef grok_bin
7071 #endif
7072 #define grok_bin(a,b,c,d) DPPP_(my_grok_bin)(aTHX_ a,b,c,d)
7073 #define Perl_grok_bin DPPP_(my_grok_bin)
7074
7075 #if defined(NEED_grok_bin) || defined(NEED_grok_bin_GLOBAL)
7076 UV
7077 DPPP_(my_grok_bin)(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result)
7078 {
7079 const char *s = start;
7080 STRLEN len = *len_p;
7081 UV value = 0;
7082 NV value_nv = 0;
7083
7084 const UV max_div_2 = UV_MAX / 2;
7085 bool allow_underscores = *flags & PERL_SCAN_ALLOW_UNDERSCORES;
7086 bool overflowed = FALSE;
7087
7088 if (!(*flags & PERL_SCAN_DISALLOW_PREFIX)) {
7089 /* strip off leading b or 0b.
7090 for compatibility silently suffer "b" and "0b" as valid binary
7091 numbers. */
7092 if (len >= 1) {
7093 if (s[0] == 'b') {
7094 s++;
7095 len--;
7096 }
7097 else if (len >= 2 && s[0] == '0' && s[1] == 'b') {
7098 s+=2;
7099 len-=2;
7100 }
7101 }
7102 }
7103
7104 for (; len-- && *s; s++) {
7105 char bit = *s;
7106 if (bit == '0' || bit == '1') {
7107 /* Write it in this wonky order with a goto to attempt to get the
7108 compiler to make the common case integer-only loop pretty tight.
7109 With gcc seems to be much straighter code than old scan_bin. */
7110 redo:
7111 if (!overflowed) {
7112 if (value <= max_div_2) {
7113 value = (value << 1) | (bit - '0');
7114 continue;
7115 }
7116 /* Bah. We're just overflowed. */
7117 warn("Integer overflow in binary number");
7118 overflowed = TRUE;
7119 value_nv = (NV) value;
7120 }
7121 value_nv *= 2.0;
7122 /* If an NV has not enough bits in its mantissa to
7123 * represent a UV this summing of small low-order numbers
7124 * is a waste of time (because the NV cannot preserve
7125 * the low-order bits anyway): we could just remember when
7126 * did we overflow and in the end just multiply value_nv by the
7127 * right amount. */
7128 value_nv += (NV)(bit - '0');
7129 continue;
7130 }
7131 if (bit == '_' && len && allow_underscores && (bit = s[1])
7132 && (bit == '0' || bit == '1'))
7133 {
7134 --len;
7135 ++s;
7136 goto redo;
7137 }
7138 if (!(*flags & PERL_SCAN_SILENT_ILLDIGIT))
7139 warn("Illegal binary digit '%c' ignored", *s);
7140 break;
7141 }
7142
7143 if ( ( overflowed && value_nv > 4294967295.0)
7144 #if UVSIZE > 4
7145 || (!overflowed && value > 0xffffffff )
7146 #endif
7147 ) {
7148 warn("Binary number > 0b11111111111111111111111111111111 non-portable");
7149 }
7150 *len_p = s - start;
7151 if (!overflowed) {
7152 *flags = 0;
7153 return value;
7154 }
7155 *flags = PERL_SCAN_GREATER_THAN_UV_MAX;
7156 if (result)
7157 *result = value_nv;
7158 return UV_MAX;
7159 }
7160 #endif
7161 #endif
7162
7163 #ifndef grok_hex
7164 #if defined(NEED_grok_hex)
7165 static UV DPPP_(my_grok_hex)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
7166 static
7167 #else
7168 extern UV DPPP_(my_grok_hex)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
7169 #endif
7170
7171 #ifdef grok_hex
7172 # undef grok_hex
7173 #endif
7174 #define grok_hex(a,b,c,d) DPPP_(my_grok_hex)(aTHX_ a,b,c,d)
7175 #define Perl_grok_hex DPPP_(my_grok_hex)
7176
7177 #if defined(NEED_grok_hex) || defined(NEED_grok_hex_GLOBAL)
7178 UV
7179 DPPP_(my_grok_hex)(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result)
7180 {
7181 const char *s = start;
7182 STRLEN len = *len_p;
7183 UV value = 0;
7184 NV value_nv = 0;
7185
7186 const UV max_div_16 = UV_MAX / 16;
7187 bool allow_underscores = *flags & PERL_SCAN_ALLOW_UNDERSCORES;
7188 bool overflowed = FALSE;
7189 const char *xdigit;
7190
7191 if (!(*flags & PERL_SCAN_DISALLOW_PREFIX)) {
7192 /* strip off leading x or 0x.
7193 for compatibility silently suffer "x" and "0x" as valid hex numbers.
7194 */
7195 if (len >= 1) {
7196 if (s[0] == 'x') {
7197 s++;
7198 len--;
7199 }
7200 else if (len >= 2 && s[0] == '0' && s[1] == 'x') {
7201 s+=2;
7202 len-=2;
7203 }
7204 }
7205 }
7206
7207 for (; len-- && *s; s++) {
7208 xdigit = strchr((char *) PL_hexdigit, *s);
7209 if (xdigit) {
7210 /* Write it in this wonky order with a goto to attempt to get the
7211 compiler to make the common case integer-only loop pretty tight.
7212 With gcc seems to be much straighter code than old scan_hex. */
7213 redo:
7214 if (!overflowed) {
7215 if (value <= max_div_16) {
7216 value = (value << 4) | ((xdigit - PL_hexdigit) & 15);
7217 continue;
7218 }
7219 warn("Integer overflow in hexadecimal number");
7220 overflowed = TRUE;
7221 value_nv = (NV) value;
7222 }
7223 value_nv *= 16.0;
7224 /* If an NV has not enough bits in its mantissa to
7225 * represent a UV this summing of small low-order numbers
7226 * is a waste of time (because the NV cannot preserve
7227 * the low-order bits anyway): we could just remember when
7228 * did we overflow and in the end just multiply value_nv by the
7229 * right amount of 16-tuples. */
7230 value_nv += (NV)((xdigit - PL_hexdigit) & 15);
7231 continue;
7232 }
7233 if (*s == '_' && len && allow_underscores && s[1]
7234 && (xdigit = strchr((char *) PL_hexdigit, s[1])))
7235 {
7236 --len;
7237 ++s;
7238 goto redo;
7239 }
7240 if (!(*flags & PERL_SCAN_SILENT_ILLDIGIT))
7241 warn("Illegal hexadecimal digit '%c' ignored", *s);
7242 break;
7243 }
7244
7245 if ( ( overflowed && value_nv > 4294967295.0)
7246 #if UVSIZE > 4
7247 || (!overflowed && value > 0xffffffff )
7248 #endif
7249 ) {
7250 warn("Hexadecimal number > 0xffffffff non-portable");
7251 }
7252 *len_p = s - start;
7253 if (!overflowed) {
7254 *flags = 0;
7255 return value;
7256 }
7257 *flags = PERL_SCAN_GREATER_THAN_UV_MAX;
7258 if (result)
7259 *result = value_nv;
7260 return UV_MAX;
7261 }
7262 #endif
7263 #endif
7264
7265 #ifndef grok_oct
7266 #if defined(NEED_grok_oct)
7267 static UV DPPP_(my_grok_oct)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
7268 static
7269 #else
7270 extern UV DPPP_(my_grok_oct)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
7271 #endif
7272
7273 #ifdef grok_oct
7274 # undef grok_oct
7275 #endif
7276 #define grok_oct(a,b,c,d) DPPP_(my_grok_oct)(aTHX_ a,b,c,d)
7277 #define Perl_grok_oct DPPP_(my_grok_oct)
7278
7279 #if defined(NEED_grok_oct) || defined(NEED_grok_oct_GLOBAL)
7280 UV
7281 DPPP_(my_grok_oct)(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result)
7282 {
7283 const char *s = start;
7284 STRLEN len = *len_p;
7285 UV value = 0;
7286 NV value_nv = 0;
7287
7288 const UV max_div_8 = UV_MAX / 8;
7289 bool allow_underscores = *flags & PERL_SCAN_ALLOW_UNDERSCORES;
7290 bool overflowed = FALSE;
7291
7292 for (; len-- && *s; s++) {
7293 /* gcc 2.95 optimiser not smart enough to figure that this subtraction
7294 out front allows slicker code. */
7295 int digit = *s - '0';
7296 if (digit >= 0 && digit <= 7) {
7297 /* Write it in this wonky order with a goto to attempt to get the
7298 compiler to make the common case integer-only loop pretty tight.
7299 */
7300 redo:
7301 if (!overflowed) {
7302 if (value <= max_div_8) {
7303 value = (value << 3) | digit;
7304 continue;
7305 }
7306 /* Bah. We're just overflowed. */
7307 warn("Integer overflow in octal number");
7308 overflowed = TRUE;
7309 value_nv = (NV) value;
7310 }
7311 value_nv *= 8.0;
7312 /* If an NV has not enough bits in its mantissa to
7313 * represent a UV this summing of small low-order numbers
7314 * is a waste of time (because the NV cannot preserve
7315 * the low-order bits anyway): we could just remember when
7316 * did we overflow and in the end just multiply value_nv by the
7317 * right amount of 8-tuples. */
7318 value_nv += (NV)digit;
7319 continue;
7320 }
7321 if (digit == ('_' - '0') && len && allow_underscores
7322 && (digit = s[1] - '0') && (digit >= 0 && digit <= 7))
7323 {
7324 --len;
7325 ++s;
7326 goto redo;
7327 }
7328 /* Allow \octal to work the DWIM way (that is, stop scanning
7329 * as soon as non-octal characters are seen, complain only iff
7330 * someone seems to want to use the digits eight and nine). */
7331 if (digit == 8 || digit == 9) {
7332 if (!(*flags & PERL_SCAN_SILENT_ILLDIGIT))
7333 warn("Illegal octal digit '%c' ignored", *s);
7334 }
7335 break;
7336 }
7337
7338 if ( ( overflowed && value_nv > 4294967295.0)
7339 #if UVSIZE > 4
7340 || (!overflowed && value > 0xffffffff )
7341 #endif
7342 ) {
7343 warn("Octal number > 037777777777 non-portable");
7344 }
7345 *len_p = s - start;
7346 if (!overflowed) {
7347 *flags = 0;
7348 return value;
7349 }
7350 *flags = PERL_SCAN_GREATER_THAN_UV_MAX;
7351 if (result)
7352 *result = value_nv;
7353 return UV_MAX;
7354 }
7355 #endif
7356 #endif
7357
7358 #if !defined(my_snprintf)
7359 #if defined(NEED_my_snprintf)
7360 static int DPPP_(my_my_snprintf)(char * buffer, const Size_t len, const char * format, ...);
7361 static
7362 #else
7363 extern int DPPP_(my_my_snprintf)(char * buffer, const Size_t len, const char * format, ...);
7364 #endif
7365
7366 #define my_snprintf DPPP_(my_my_snprintf)
7367 #define Perl_my_snprintf DPPP_(my_my_snprintf)
7368
7369 #if defined(NEED_my_snprintf) || defined(NEED_my_snprintf_GLOBAL)
7370
7371 int
7372 DPPP_(my_my_snprintf)(char *buffer, const Size_t len, const char *format, ...)
7373 {
7374 dTHX;
7375 int retval;
7376 va_list ap;
7377 va_start(ap, format);
7378 #ifdef HAS_VSNPRINTF
7379 retval = vsnprintf(buffer, len, format, ap);
7380 #else
7381 retval = vsprintf(buffer, format, ap);
7382 #endif
7383 va_end(ap);
7384 if (retval < 0 || (len > 0 && (Size_t)retval >= len))
7385 Perl_croak(aTHX_ "panic: my_snprintf buffer overflow");
7386 return retval;
7387 }
7388
7389 #endif
7390 #endif
7391
7392 #if !defined(my_sprintf)
7393 #if defined(NEED_my_sprintf)
7394 static int DPPP_(my_my_sprintf)(char * buffer, const char * pat, ...);
7395 static
7396 #else
7397 extern int DPPP_(my_my_sprintf)(char * buffer, const char * pat, ...);
7398 #endif
7399
7400 #define my_sprintf DPPP_(my_my_sprintf)
7401 #define Perl_my_sprintf DPPP_(my_my_sprintf)
7402
7403 #if defined(NEED_my_sprintf) || defined(NEED_my_sprintf_GLOBAL)
7404
7405 int
7406 DPPP_(my_my_sprintf)(char *buffer, const char* pat, ...)
7407 {
7408 va_list args;
7409 va_start(args, pat);
7410 vsprintf(buffer, pat, args);
7411 va_end(args);
7412 return strlen(buffer);
7413 }
7414
7415 #endif
7416 #endif
7417
7418 #ifdef NO_XSLOCKS
7419 # ifdef dJMPENV
7420 # define dXCPT dJMPENV; int rEtV = 0
7421 # define XCPT_TRY_START JMPENV_PUSH(rEtV); if (rEtV == 0)
7422 # define XCPT_TRY_END JMPENV_POP;
7423 # define XCPT_CATCH if (rEtV != 0)
7424 # define XCPT_RETHROW JMPENV_JUMP(rEtV)
7425 # else
7426 # define dXCPT Sigjmp_buf oldTOP; int rEtV = 0
7427 # define XCPT_TRY_START Copy(top_env, oldTOP, 1, Sigjmp_buf); rEtV = Sigsetjmp(top_env, 1); if (rEtV == 0)
7428 # define XCPT_TRY_END Copy(oldTOP, top_env, 1, Sigjmp_buf);
7429 # define XCPT_CATCH if (rEtV != 0)
7430 # define XCPT_RETHROW Siglongjmp(top_env, rEtV)
7431 # endif
7432 #endif
7433
7434 #if !defined(my_strlcat)
7435 #if defined(NEED_my_strlcat)
7436 static Size_t DPPP_(my_my_strlcat)(char * dst, const char * src, Size_t size);
7437 static
7438 #else
7439 extern Size_t DPPP_(my_my_strlcat)(char * dst, const char * src, Size_t size);
7440 #endif
7441
7442 #define my_strlcat DPPP_(my_my_strlcat)
7443 #define Perl_my_strlcat DPPP_(my_my_strlcat)
7444
7445 #if defined(NEED_my_strlcat) || defined(NEED_my_strlcat_GLOBAL)
7446
7447 Size_t
7448 DPPP_(my_my_strlcat)(char *dst, const char *src, Size_t size)
7449 {
7450 Size_t used, length, copy;
7451
7452 used = strlen(dst);
7453 length = strlen(src);
7454 if (size > 0 && used < size - 1) {
7455 copy = (length >= size - used) ? size - used - 1 : length;
7456 memcpy(dst + used, src, copy);
7457 dst[used + copy] = '\0';
7458 }
7459 return used + length;
7460 }
7461 #endif
7462 #endif
7463
7464 #if !defined(my_strlcpy)
7465 #if defined(NEED_my_strlcpy)
7466 static Size_t DPPP_(my_my_strlcpy)(char * dst, const char * src, Size_t size);
7467 static
7468 #else
7469 extern Size_t DPPP_(my_my_strlcpy)(char * dst, const char * src, Size_t size);
7470 #endif
7471
7472 #define my_strlcpy DPPP_(my_my_strlcpy)
7473 #define Perl_my_strlcpy DPPP_(my_my_strlcpy)
7474
7475 #if defined(NEED_my_strlcpy) || defined(NEED_my_strlcpy_GLOBAL)
7476
7477 Size_t
7478 DPPP_(my_my_strlcpy)(char *dst, const char *src, Size_t size)
7479 {
7480 Size_t length, copy;
7481
7482 length = strlen(src);
7483 if (size > 0) {
7484 copy = (length >= size) ? size - 1 : length;
7485 memcpy(dst, src, copy);
7486 dst[copy] = '\0';
7487 }
7488 return length;
7489 }
7490
7491 #endif
7492 #endif
7493 #ifndef PERL_PV_ESCAPE_QUOTE
7494 # define PERL_PV_ESCAPE_QUOTE 0x0001
7495 #endif
7496
7497 #ifndef PERL_PV_PRETTY_QUOTE
7498 # define PERL_PV_PRETTY_QUOTE PERL_PV_ESCAPE_QUOTE
7499 #endif
7500
7501 #ifndef PERL_PV_PRETTY_ELLIPSES
7502 # define PERL_PV_PRETTY_ELLIPSES 0x0002
7503 #endif
7504
7505 #ifndef PERL_PV_PRETTY_LTGT
7506 # define PERL_PV_PRETTY_LTGT 0x0004
7507 #endif
7508
7509 #ifndef PERL_PV_ESCAPE_FIRSTCHAR
7510 # define PERL_PV_ESCAPE_FIRSTCHAR 0x0008
7511 #endif
7512
7513 #ifndef PERL_PV_ESCAPE_UNI
7514 # define PERL_PV_ESCAPE_UNI 0x0100
7515 #endif
7516
7517 #ifndef PERL_PV_ESCAPE_UNI_DETECT
7518 # define PERL_PV_ESCAPE_UNI_DETECT 0x0200
7519 #endif
7520
7521 #ifndef PERL_PV_ESCAPE_ALL
7522 # define PERL_PV_ESCAPE_ALL 0x1000
7523 #endif
7524
7525 #ifndef PERL_PV_ESCAPE_NOBACKSLASH
7526 # define PERL_PV_ESCAPE_NOBACKSLASH 0x2000
7527 #endif
7528
7529 #ifndef PERL_PV_ESCAPE_NOCLEAR
7530 # define PERL_PV_ESCAPE_NOCLEAR 0x4000
7531 #endif
7532
7533 #ifndef PERL_PV_ESCAPE_RE
7534 # define PERL_PV_ESCAPE_RE 0x8000
7535 #endif
7536
7537 #ifndef PERL_PV_PRETTY_NOCLEAR
7538 # define PERL_PV_PRETTY_NOCLEAR PERL_PV_ESCAPE_NOCLEAR
7539 #endif
7540 #ifndef PERL_PV_PRETTY_DUMP
7541 # define PERL_PV_PRETTY_DUMP PERL_PV_PRETTY_ELLIPSES|PERL_PV_PRETTY_QUOTE
7542 #endif
7543
7544 #ifndef PERL_PV_PRETTY_REGPROP
7545 # define PERL_PV_PRETTY_REGPROP PERL_PV_PRETTY_ELLIPSES|PERL_PV_PRETTY_LTGT|PERL_PV_ESCAPE_RE
7546 #endif
7547
7548 /* Hint: pv_escape
7549 * Note that unicode functionality is only backported to
7550 * those perl versions that support it. For older perl
7551 * versions, the implementation will fall back to bytes.
7552 */
7553
7554 #ifndef pv_escape
7555 #if defined(NEED_pv_escape)
7556 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);
7557 static
7558 #else
7559 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);
7560 #endif
7561
7562 #ifdef pv_escape
7563 # undef pv_escape
7564 #endif
7565 #define pv_escape(a,b,c,d,e,f) DPPP_(my_pv_escape)(aTHX_ a,b,c,d,e,f)
7566 #define Perl_pv_escape DPPP_(my_pv_escape)
7567
7568 #if defined(NEED_pv_escape) || defined(NEED_pv_escape_GLOBAL)
7569
7570 char *
7571 DPPP_(my_pv_escape)(pTHX_ SV *dsv, char const * const str,
7572 const STRLEN count, const STRLEN max,
7573 STRLEN * const escaped, const U32 flags)
7574 {
7575 const char esc = flags & PERL_PV_ESCAPE_RE ? '%' : '\\';
7576 const char dq = flags & PERL_PV_ESCAPE_QUOTE ? '"' : esc;
7577 char octbuf[32] = "%123456789ABCDF";
7578 STRLEN wrote = 0;
7579 STRLEN chsize = 0;
7580 STRLEN readsize = 1;
7581 #if defined(is_utf8_string) && defined(utf8_to_uvchr)
7582 bool isuni = flags & PERL_PV_ESCAPE_UNI ? 1 : 0;
7583 #endif
7584 const char *pv = str;
7585 const char * const end = pv + count;
7586 octbuf[0] = esc;
7587
7588 if (!(flags & PERL_PV_ESCAPE_NOCLEAR))
7589 sv_setpvs(dsv, "");
7590
7591 #if defined(is_utf8_string) && defined(utf8_to_uvchr)
7592 if ((flags & PERL_PV_ESCAPE_UNI_DETECT) && is_utf8_string((U8*)pv, count))
7593 isuni = 1;
7594 #endif
7595
7596 for (; pv < end && (!max || wrote < max) ; pv += readsize) {
7597 const UV u =
7598 #if defined(is_utf8_string) && defined(utf8_to_uvchr)
7599 isuni ? utf8_to_uvchr((U8*)pv, &readsize) :
7600 #endif
7601 (U8)*pv;
7602 const U8 c = (U8)u & 0xFF;
7603
7604 if (u > 255 || (flags & PERL_PV_ESCAPE_ALL)) {
7605 if (flags & PERL_PV_ESCAPE_FIRSTCHAR)
7606 chsize = my_snprintf(octbuf, sizeof octbuf,
7607 "%" UVxf, u);
7608 else
7609 chsize = my_snprintf(octbuf, sizeof octbuf,
7610 "%cx{%" UVxf "}", esc, u);
7611 } else if (flags & PERL_PV_ESCAPE_NOBACKSLASH) {
7612 chsize = 1;
7613 } else {
7614 if (c == dq || c == esc || !isPRINT(c)) {
7615 chsize = 2;
7616 switch (c) {
7617 case '\\' : /* fallthrough */
7618 case '%' : if (c == esc)
7619 octbuf[1] = esc;
7620 else
7621 chsize = 1;
7622 break;
7623 case '\v' : octbuf[1] = 'v'; break;
7624 case '\t' : octbuf[1] = 't'; break;
7625 case '\r' : octbuf[1] = 'r'; break;
7626 case '\n' : octbuf[1] = 'n'; break;
7627 case '\f' : octbuf[1] = 'f'; break;
7628 case '"' : if (dq == '"')
7629 octbuf[1] = '"';
7630 else
7631 chsize = 1;
7632 break;
7633 default: chsize = my_snprintf(octbuf, sizeof octbuf,
7634 pv < end && isDIGIT((U8)*(pv+readsize))
7635 ? "%c%03o" : "%c%o", esc, c);
7636 }
7637 } else {
7638 chsize = 1;
7639 }
7640 }
7641 if (max && wrote + chsize > max) {
7642 break;
7643 } else if (chsize > 1) {
7644 sv_catpvn(dsv, octbuf, chsize);
7645 wrote += chsize;
7646 } else {
7647 char tmp[2];
7648 my_snprintf(tmp, sizeof tmp, "%c", c);
7649 sv_catpvn(dsv, tmp, 1);
7650 wrote++;
7651 }
7652 if (flags & PERL_PV_ESCAPE_FIRSTCHAR)
7653 break;
7654 }
7655 if (escaped != NULL)
7656 *escaped= pv - str;
7657 return SvPVX(dsv);
7658 }
7659
7660 #endif
7661 #endif
7662
7663 #ifndef pv_pretty
7664 #if defined(NEED_pv_pretty)
7665 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);
7666 static
7667 #else
7668 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);
7669 #endif
7670
7671 #ifdef pv_pretty
7672 # undef pv_pretty
7673 #endif
7674 #define pv_pretty(a,b,c,d,e,f,g) DPPP_(my_pv_pretty)(aTHX_ a,b,c,d,e,f,g)
7675 #define Perl_pv_pretty DPPP_(my_pv_pretty)
7676
7677 #if defined(NEED_pv_pretty) || defined(NEED_pv_pretty_GLOBAL)
7678
7679 char *
7680 DPPP_(my_pv_pretty)(pTHX_ SV *dsv, char const * const str, const STRLEN count,
7681 const STRLEN max, char const * const start_color, char const * const end_color,
7682 const U32 flags)
7683 {
7684 const U8 dq = (flags & PERL_PV_PRETTY_QUOTE) ? '"' : '%';
7685 STRLEN escaped;
7686
7687 if (!(flags & PERL_PV_PRETTY_NOCLEAR))
7688 sv_setpvs(dsv, "");
7689
7690 if (dq == '"')
7691 sv_catpvs(dsv, "\"");
7692 else if (flags & PERL_PV_PRETTY_LTGT)
7693 sv_catpvs(dsv, "<");
7694
7695 if (start_color != NULL)
7696 sv_catpv(dsv, D_PPP_CONSTPV_ARG(start_color));
7697
7698 pv_escape(dsv, str, count, max, &escaped, flags | PERL_PV_ESCAPE_NOCLEAR);
7699
7700 if (end_color != NULL)
7701 sv_catpv(dsv, D_PPP_CONSTPV_ARG(end_color));
7702
7703 if (dq == '"')
7704 sv_catpvs(dsv, "\"");
7705 else if (flags & PERL_PV_PRETTY_LTGT)
7706 sv_catpvs(dsv, ">");
7707
7708 if ((flags & PERL_PV_PRETTY_ELLIPSES) && escaped < count)
7709 sv_catpvs(dsv, "...");
7710
7711 return SvPVX(dsv);
7712 }
7713
7714 #endif
7715 #endif
7716
7717 #ifndef pv_display
7718 #if defined(NEED_pv_display)
7719 static char * DPPP_(my_pv_display)(pTHX_ SV * dsv, const char * pv, STRLEN cur, STRLEN len, STRLEN pvlim);
7720 static
7721 #else
7722 extern char * DPPP_(my_pv_display)(pTHX_ SV * dsv, const char * pv, STRLEN cur, STRLEN len, STRLEN pvlim);
7723 #endif
7724
7725 #ifdef pv_display
7726 # undef pv_display
7727 #endif
7728 #define pv_display(a,b,c,d,e) DPPP_(my_pv_display)(aTHX_ a,b,c,d,e)
7729 #define Perl_pv_display DPPP_(my_pv_display)
7730
7731 #if defined(NEED_pv_display) || defined(NEED_pv_display_GLOBAL)
7732
7733 char *
7734 DPPP_(my_pv_display)(pTHX_ SV *dsv, const char *pv, STRLEN cur, STRLEN len, STRLEN pvlim)
7735 {
7736 pv_pretty(dsv, pv, cur, pvlim, NULL, NULL, PERL_PV_PRETTY_DUMP);
7737 if (len > cur && pv[cur] == '\0')
7738 sv_catpvs(dsv, "\\0");
7739 return SvPVX(dsv);
7740 }
7741
7742 #endif
7743 #endif
7744
7745 #endif /* _P_P_PORTABILITY_H_ */
7746
7747 /* End of File ppport.h */
0 #if 0
1 <<'SKIP';
2 #endif
3 /*
4 ----------------------------------------------------------------------
5
6 ppport.h -- Perl/Pollution/Portability Version 3.31
7
8 Automatically created by Devel::PPPort running under perl 5.018002.
9
10 Do NOT edit this file directly! -- Edit PPPort_pm.PL and the
11 includes in parts/inc/ instead.
12
13 Use 'perldoc ppport.h' to view the documentation below.
14
15 ----------------------------------------------------------------------
16
17 SKIP
18
19 =pod
20
21 =head1 NAME
22
23 ppport.h - Perl/Pollution/Portability version 3.31
24
25 =head1 SYNOPSIS
26
27 perl ppport.h [options] [source files]
28
29 Searches current directory for files if no [source files] are given
30
31 --help show short help
32
33 --version show version
34
35 --patch=file write one patch file with changes
36 --copy=suffix write changed copies with suffix
37 --diff=program use diff program and options
38
39 --compat-version=version provide compatibility with Perl version
40 --cplusplus accept C++ comments
41
42 --quiet don't output anything except fatal errors
43 --nodiag don't show diagnostics
44 --nohints don't show hints
45 --nochanges don't suggest changes
46 --nofilter don't filter input files
47
48 --strip strip all script and doc functionality from
49 ppport.h
50
51 --list-provided list provided API
52 --list-unsupported list unsupported API
53 --api-info=name show Perl API portability information
54
55 =head1 COMPATIBILITY
56
57 This version of F<ppport.h> is designed to support operation with Perl
58 installations back to 5.003, and has been tested up to 5.20.
59
60 =head1 OPTIONS
61
62 =head2 --help
63
64 Display a brief usage summary.
65
66 =head2 --version
67
68 Display the version of F<ppport.h>.
69
70 =head2 --patch=I<file>
71
72 If this option is given, a single patch file will be created if
73 any changes are suggested. This requires a working diff program
74 to be installed on your system.
75
76 =head2 --copy=I<suffix>
77
78 If this option is given, a copy of each file will be saved with
79 the given suffix that contains the suggested changes. This does
80 not require any external programs. Note that this does not
81 automagically add a dot between the original filename and the
82 suffix. If you want the dot, you have to include it in the option
83 argument.
84
85 If neither C<--patch> or C<--copy> are given, the default is to
86 simply print the diffs for each file. This requires either
87 C<Text::Diff> or a C<diff> program to be installed.
88
89 =head2 --diff=I<program>
90
91 Manually set the diff program and options to use. The default
92 is to use C<Text::Diff>, when installed, and output unified
93 context diffs.
94
95 =head2 --compat-version=I<version>
96
97 Tell F<ppport.h> to check for compatibility with the given
98 Perl version. The default is to check for compatibility with Perl
99 version 5.003. You can use this option to reduce the output
100 of F<ppport.h> if you intend to be backward compatible only
101 down to a certain Perl version.
102
103 =head2 --cplusplus
104
105 Usually, F<ppport.h> will detect C++ style comments and
106 replace them with C style comments for portability reasons.
107 Using this option instructs F<ppport.h> to leave C++
108 comments untouched.
109
110 =head2 --quiet
111
112 Be quiet. Don't print anything except fatal errors.
113
114 =head2 --nodiag
115
116 Don't output any diagnostic messages. Only portability
117 alerts will be printed.
118
119 =head2 --nohints
120
121 Don't output any hints. Hints often contain useful portability
122 notes. Warnings will still be displayed.
123
124 =head2 --nochanges
125
126 Don't suggest any changes. Only give diagnostic output and hints
127 unless these are also deactivated.
128
129 =head2 --nofilter
130
131 Don't filter the list of input files. By default, files not looking
132 like source code (i.e. not *.xs, *.c, *.cc, *.cpp or *.h) are skipped.
133
134 =head2 --strip
135
136 Strip all script and documentation functionality from F<ppport.h>.
137 This reduces the size of F<ppport.h> dramatically and may be useful
138 if you want to include F<ppport.h> in smaller modules without
139 increasing their distribution size too much.
140
141 The stripped F<ppport.h> will have a C<--unstrip> option that allows
142 you to undo the stripping, but only if an appropriate C<Devel::PPPort>
143 module is installed.
144
145 =head2 --list-provided
146
147 Lists the API elements for which compatibility is provided by
148 F<ppport.h>. Also lists if it must be explicitly requested,
149 if it has dependencies, and if there are hints or warnings for it.
150
151 =head2 --list-unsupported
152
153 Lists the API elements that are known not to be supported by
154 F<ppport.h> and below which version of Perl they probably
155 won't be available or work.
156
157 =head2 --api-info=I<name>
158
159 Show portability information for API elements matching I<name>.
160 If I<name> is surrounded by slashes, it is interpreted as a regular
161 expression.
162
163 =head1 DESCRIPTION
164
165 In order for a Perl extension (XS) module to be as portable as possible
166 across differing versions of Perl itself, certain steps need to be taken.
167
168 =over 4
169
170 =item *
171
172 Including this header is the first major one. This alone will give you
173 access to a large part of the Perl API that hasn't been available in
174 earlier Perl releases. Use
175
176 perl ppport.h --list-provided
177
178 to see which API elements are provided by ppport.h.
179
180 =item *
181
182 You should avoid using deprecated parts of the API. For example, using
183 global Perl variables without the C<PL_> prefix is deprecated. Also,
184 some API functions used to have a C<perl_> prefix. Using this form is
185 also deprecated. You can safely use the supported API, as F<ppport.h>
186 will provide wrappers for older Perl versions.
187
188 =item *
189
190 If you use one of a few functions or variables that were not present in
191 earlier versions of Perl, and that can't be provided using a macro, you
192 have to explicitly request support for these functions by adding one or
193 more C<#define>s in your source code before the inclusion of F<ppport.h>.
194
195 These functions or variables will be marked C<explicit> in the list shown
196 by C<--list-provided>.
197
198 Depending on whether you module has a single or multiple files that
199 use such functions or variables, you want either C<static> or global
200 variants.
201
202 For a C<static> function or variable (used only in a single source
203 file), use:
204
205 #define NEED_function
206 #define NEED_variable
207
208 For a global function or variable (used in multiple source files),
209 use:
210
211 #define NEED_function_GLOBAL
212 #define NEED_variable_GLOBAL
213
214 Note that you mustn't have more than one global request for the
215 same function or variable in your project.
216
217 Function / Variable Static Request Global Request
218 -----------------------------------------------------------------------------------------
219 PL_parser NEED_PL_parser NEED_PL_parser_GLOBAL
220 PL_signals NEED_PL_signals NEED_PL_signals_GLOBAL
221 caller_cx() NEED_caller_cx NEED_caller_cx_GLOBAL
222 eval_pv() NEED_eval_pv NEED_eval_pv_GLOBAL
223 grok_bin() NEED_grok_bin NEED_grok_bin_GLOBAL
224 grok_hex() NEED_grok_hex NEED_grok_hex_GLOBAL
225 grok_number() NEED_grok_number NEED_grok_number_GLOBAL
226 grok_numeric_radix() NEED_grok_numeric_radix NEED_grok_numeric_radix_GLOBAL
227 grok_oct() NEED_grok_oct NEED_grok_oct_GLOBAL
228 load_module() NEED_load_module NEED_load_module_GLOBAL
229 mg_findext() NEED_mg_findext NEED_mg_findext_GLOBAL
230 my_snprintf() NEED_my_snprintf NEED_my_snprintf_GLOBAL
231 my_sprintf() NEED_my_sprintf NEED_my_sprintf_GLOBAL
232 my_strlcat() NEED_my_strlcat NEED_my_strlcat_GLOBAL
233 my_strlcpy() NEED_my_strlcpy NEED_my_strlcpy_GLOBAL
234 newCONSTSUB() NEED_newCONSTSUB NEED_newCONSTSUB_GLOBAL
235 newRV_noinc() NEED_newRV_noinc NEED_newRV_noinc_GLOBAL
236 newSV_type() NEED_newSV_type NEED_newSV_type_GLOBAL
237 newSVpvn_flags() NEED_newSVpvn_flags NEED_newSVpvn_flags_GLOBAL
238 newSVpvn_share() NEED_newSVpvn_share NEED_newSVpvn_share_GLOBAL
239 pv_display() NEED_pv_display NEED_pv_display_GLOBAL
240 pv_escape() NEED_pv_escape NEED_pv_escape_GLOBAL
241 pv_pretty() NEED_pv_pretty NEED_pv_pretty_GLOBAL
242 sv_2pv_flags() NEED_sv_2pv_flags NEED_sv_2pv_flags_GLOBAL
243 sv_2pvbyte() NEED_sv_2pvbyte NEED_sv_2pvbyte_GLOBAL
244 sv_catpvf_mg() NEED_sv_catpvf_mg NEED_sv_catpvf_mg_GLOBAL
245 sv_catpvf_mg_nocontext() NEED_sv_catpvf_mg_nocontext NEED_sv_catpvf_mg_nocontext_GLOBAL
246 sv_pvn_force_flags() NEED_sv_pvn_force_flags NEED_sv_pvn_force_flags_GLOBAL
247 sv_setpvf_mg() NEED_sv_setpvf_mg NEED_sv_setpvf_mg_GLOBAL
248 sv_setpvf_mg_nocontext() NEED_sv_setpvf_mg_nocontext NEED_sv_setpvf_mg_nocontext_GLOBAL
249 sv_unmagicext() NEED_sv_unmagicext NEED_sv_unmagicext_GLOBAL
250 vload_module() NEED_vload_module NEED_vload_module_GLOBAL
251 vnewSVpvf() NEED_vnewSVpvf NEED_vnewSVpvf_GLOBAL
252 warner() NEED_warner NEED_warner_GLOBAL
253
254 To avoid namespace conflicts, you can change the namespace of the
255 explicitly exported functions / variables using the C<DPPP_NAMESPACE>
256 macro. Just C<#define> the macro before including C<ppport.h>:
257
258 #define DPPP_NAMESPACE MyOwnNamespace_
259 #include "ppport.h"
260
261 The default namespace is C<DPPP_>.
262
263 =back
264
265 The good thing is that most of the above can be checked by running
266 F<ppport.h> on your source code. See the next section for
267 details.
268
269 =head1 EXAMPLES
270
271 To verify whether F<ppport.h> is needed for your module, whether you
272 should make any changes to your code, and whether any special defines
273 should be used, F<ppport.h> can be run as a Perl script to check your
274 source code. Simply say:
275
276 perl ppport.h
277
278 The result will usually be a list of patches suggesting changes
279 that should at least be acceptable, if not necessarily the most
280 efficient solution, or a fix for all possible problems.
281
282 If you know that your XS module uses features only available in
283 newer Perl releases, if you're aware that it uses C++ comments,
284 and if you want all suggestions as a single patch file, you could
285 use something like this:
286
287 perl ppport.h --compat-version=5.6.0 --cplusplus --patch=test.diff
288
289 If you only want your code to be scanned without any suggestions
290 for changes, use:
291
292 perl ppport.h --nochanges
293
294 You can specify a different C<diff> program or options, using
295 the C<--diff> option:
296
297 perl ppport.h --diff='diff -C 10'
298
299 This would output context diffs with 10 lines of context.
300
301 If you want to create patched copies of your files instead, use:
302
303 perl ppport.h --copy=.new
304
305 To display portability information for the C<newSVpvn> function,
306 use:
307
308 perl ppport.h --api-info=newSVpvn
309
310 Since the argument to C<--api-info> can be a regular expression,
311 you can use
312
313 perl ppport.h --api-info=/_nomg$/
314
315 to display portability information for all C<_nomg> functions or
316
317 perl ppport.h --api-info=/./
318
319 to display information for all known API elements.
320
321 =head1 BUGS
322
323 If this version of F<ppport.h> is causing failure during
324 the compilation of this module, please check if newer versions
325 of either this module or C<Devel::PPPort> are available on CPAN
326 before sending a bug report.
327
328 If F<ppport.h> was generated using the latest version of
329 C<Devel::PPPort> and is causing failure of this module, please
330 file a bug report here: L<https://github.com/mhx/Devel-PPPort/issues/>
331
332 Please include the following information:
333
334 =over 4
335
336 =item 1.
337
338 The complete output from running "perl -V"
339
340 =item 2.
341
342 This file.
343
344 =item 3.
345
346 The name and version of the module you were trying to build.
347
348 =item 4.
349
350 A full log of the build that failed.
351
352 =item 5.
353
354 Any other information that you think could be relevant.
355
356 =back
357
358 For the latest version of this code, please get the C<Devel::PPPort>
359 module from CPAN.
360
361 =head1 COPYRIGHT
362
363 Version 3.x, Copyright (c) 2004-2013, Marcus Holland-Moritz.
364
365 Version 2.x, Copyright (C) 2001, Paul Marquess.
366
367 Version 1.x, Copyright (C) 1999, Kenneth Albanowski.
368
369 This program is free software; you can redistribute it and/or
370 modify it under the same terms as Perl itself.
371
372 =head1 SEE ALSO
373
374 See L<Devel::PPPort>.
375
376 =cut
377
378 use strict;
379
380 # Disable broken TRIE-optimization
381 BEGIN { eval '${^RE_TRIE_MAXBUF} = -1' if $] >= 5.009004 && $] <= 5.009005 }
382
383 my $VERSION = 3.31;
384
385 my %opt = (
386 quiet => 0,
387 diag => 1,
388 hints => 1,
389 changes => 1,
390 cplusplus => 0,
391 filter => 1,
392 strip => 0,
393 version => 0,
394 );
395
396 my($ppport) = $0 =~ /([\w.]+)$/;
397 my $LF = '(?:\r\n|[\r\n])'; # line feed
398 my $HS = "[ \t]"; # horizontal whitespace
399
400 # Never use C comments in this file!
401 my $ccs = '/'.'*';
402 my $cce = '*'.'/';
403 my $rccs = quotemeta $ccs;
404 my $rcce = quotemeta $cce;
405
406 eval {
407 require Getopt::Long;
408 Getopt::Long::GetOptions(\%opt, qw(
409 help quiet diag! filter! hints! changes! cplusplus strip version
410 patch=s copy=s diff=s compat-version=s
411 list-provided list-unsupported api-info=s
412 )) or usage();
413 };
414
415 if ($@ and grep /^-/, @ARGV) {
416 usage() if "@ARGV" =~ /^--?h(?:elp)?$/;
417 die "Getopt::Long not found. Please don't use any options.\n";
418 }
419
420 if ($opt{version}) {
421 print "This is $0 $VERSION.\n";
422 exit 0;
423 }
424
425 usage() if $opt{help};
426 strip() if $opt{strip};
427
428 if (exists $opt{'compat-version'}) {
429 my($r,$v,$s) = eval { parse_version($opt{'compat-version'}) };
430 if ($@) {
431 die "Invalid version number format: '$opt{'compat-version'}'\n";
432 }
433 die "Only Perl 5 is supported\n" if $r != 5;
434 die "Invalid version number: $opt{'compat-version'}\n" if $v >= 1000 || $s >= 1000;
435 $opt{'compat-version'} = sprintf "%d.%03d%03d", $r, $v, $s;
436 }
437 else {
438 $opt{'compat-version'} = 5;
439 }
440
441 my %API = map { /^(\w+)\|([^|]*)\|([^|]*)\|(\w*)$/
442 ? ( $1 => {
443 ($2 ? ( base => $2 ) : ()),
444 ($3 ? ( todo => $3 ) : ()),
445 (index($4, 'v') >= 0 ? ( varargs => 1 ) : ()),
446 (index($4, 'p') >= 0 ? ( provided => 1 ) : ()),
447 (index($4, 'n') >= 0 ? ( nothxarg => 1 ) : ()),
448 } )
449 : die "invalid spec: $_" } qw(
450 ASCII_TO_NEED||5.007001|n
451 AvFILLp|5.004050||p
452 AvFILL|||
453 BhkDISABLE||5.021008|
454 BhkENABLE||5.021008|
455 BhkENTRY_set||5.021008|
456 BhkENTRY|||
457 BhkFLAGS|||
458 CALL_BLOCK_HOOKS|||
459 CLASS|||n
460 CPERLscope|5.005000||p
461 CX_CURPAD_SAVE|||
462 CX_CURPAD_SV|||
463 CopFILEAV|5.006000||p
464 CopFILEGV_set|5.006000||p
465 CopFILEGV|5.006000||p
466 CopFILESV|5.006000||p
467 CopFILE_set|5.006000||p
468 CopFILE|5.006000||p
469 CopSTASHPV_set|5.006000||p
470 CopSTASHPV|5.006000||p
471 CopSTASH_eq|5.006000||p
472 CopSTASH_set|5.006000||p
473 CopSTASH|5.006000||p
474 CopyD|5.009002|5.004050|p
475 Copy|||
476 CvPADLIST||5.008001|
477 CvSTASH|||
478 CvWEAKOUTSIDE|||
479 DEFSV_set|5.010001||p
480 DEFSV|5.004050||p
481 END_EXTERN_C|5.005000||p
482 ENTER|||
483 ERRSV|5.004050||p
484 EXTEND|||
485 EXTERN_C|5.005000||p
486 F0convert|||n
487 FREETMPS|||
488 GIMME_V||5.004000|n
489 GIMME|||n
490 GROK_NUMERIC_RADIX|5.007002||p
491 G_ARRAY|||
492 G_DISCARD|||
493 G_EVAL|||
494 G_METHOD|5.006001||p
495 G_NOARGS|||
496 G_SCALAR|||
497 G_VOID||5.004000|
498 GetVars|||
499 GvAV|||
500 GvCV|||
501 GvHV|||
502 GvSVn|5.009003||p
503 GvSV|||
504 Gv_AMupdate||5.011000|
505 HEf_SVKEY|5.003070||p
506 HeHASH||5.003070|
507 HeKEY||5.003070|
508 HeKLEN||5.003070|
509 HePV||5.004000|
510 HeSVKEY_force||5.003070|
511 HeSVKEY_set||5.004000|
512 HeSVKEY||5.003070|
513 HeUTF8|5.010001|5.008000|p
514 HeVAL||5.003070|
515 HvENAMELEN||5.015004|
516 HvENAMEUTF8||5.015004|
517 HvENAME||5.013007|
518 HvNAMELEN_get|5.009003||p
519 HvNAMELEN||5.015004|
520 HvNAMEUTF8||5.015004|
521 HvNAME_get|5.009003||p
522 HvNAME|||
523 INT2PTR|5.006000||p
524 IN_LOCALE_COMPILETIME|5.007002||p
525 IN_LOCALE_RUNTIME|5.007002||p
526 IN_LOCALE|5.007002||p
527 IN_PERL_COMPILETIME|5.008001||p
528 IS_NUMBER_GREATER_THAN_UV_MAX|5.007002||p
529 IS_NUMBER_INFINITY|5.007002||p
530 IS_NUMBER_IN_UV|5.007002||p
531 IS_NUMBER_NAN|5.007003||p
532 IS_NUMBER_NEG|5.007002||p
533 IS_NUMBER_NOT_INT|5.007002||p
534 IVSIZE|5.006000||p
535 IVTYPE|5.006000||p
536 IVdf|5.006000||p
537 LEAVE|||
538 LINKLIST||5.013006|
539 LVRET|||
540 MARK|||
541 MULTICALL||5.021008|
542 MUTABLE_PTR|5.010001||p
543 MUTABLE_SV|5.010001||p
544 MY_CXT_CLONE|5.009002||p
545 MY_CXT_INIT|5.007003||p
546 MY_CXT|5.007003||p
547 MoveD|5.009002|5.004050|p
548 Move|||
549 NATIVE_TO_NEED||5.007001|n
550 NOOP|5.005000||p
551 NUM2PTR|5.006000||p
552 NVTYPE|5.006000||p
553 NVef|5.006001||p
554 NVff|5.006001||p
555 NVgf|5.006001||p
556 Newxc|5.009003||p
557 Newxz|5.009003||p
558 Newx|5.009003||p
559 Nullav|||
560 Nullch|||
561 Nullcv|||
562 Nullhv|||
563 Nullsv|||
564 OP_CLASS||5.013007|
565 OP_DESC||5.007003|
566 OP_NAME||5.007003|
567 OP_TYPE_IS_OR_WAS||5.019010|
568 OP_TYPE_IS||5.019007|
569 ORIGMARK|||
570 OpHAS_SIBLING||5.021007|
571 OpSIBLING_set||5.021007|
572 OpSIBLING||5.021007|
573 PAD_BASE_SV|||
574 PAD_CLONE_VARS|||
575 PAD_COMPNAME_FLAGS|||
576 PAD_COMPNAME_GEN_set|||
577 PAD_COMPNAME_GEN|||
578 PAD_COMPNAME_OURSTASH|||
579 PAD_COMPNAME_PV|||
580 PAD_COMPNAME_TYPE|||
581 PAD_RESTORE_LOCAL|||
582 PAD_SAVE_LOCAL|||
583 PAD_SAVE_SETNULLPAD|||
584 PAD_SETSV|||
585 PAD_SET_CUR_NOSAVE|||
586 PAD_SET_CUR|||
587 PAD_SVl|||
588 PAD_SV|||
589 PERLIO_FUNCS_CAST|5.009003||p
590 PERLIO_FUNCS_DECL|5.009003||p
591 PERL_ABS|5.008001||p
592 PERL_BCDVERSION|5.021008||p
593 PERL_GCC_BRACE_GROUPS_FORBIDDEN|5.008001||p
594 PERL_HASH|5.003070||p
595 PERL_INT_MAX|5.003070||p
596 PERL_INT_MIN|5.003070||p
597 PERL_LONG_MAX|5.003070||p
598 PERL_LONG_MIN|5.003070||p
599 PERL_MAGIC_arylen|5.007002||p
600 PERL_MAGIC_backref|5.007002||p
601 PERL_MAGIC_bm|5.007002||p
602 PERL_MAGIC_collxfrm|5.007002||p
603 PERL_MAGIC_dbfile|5.007002||p
604 PERL_MAGIC_dbline|5.007002||p
605 PERL_MAGIC_defelem|5.007002||p
606 PERL_MAGIC_envelem|5.007002||p
607 PERL_MAGIC_env|5.007002||p
608 PERL_MAGIC_ext|5.007002||p
609 PERL_MAGIC_fm|5.007002||p
610 PERL_MAGIC_glob|5.021008||p
611 PERL_MAGIC_isaelem|5.007002||p
612 PERL_MAGIC_isa|5.007002||p
613 PERL_MAGIC_mutex|5.021008||p
614 PERL_MAGIC_nkeys|5.007002||p
615 PERL_MAGIC_overload_elem|5.021008||p
616 PERL_MAGIC_overload_table|5.007002||p
617 PERL_MAGIC_overload|5.021008||p
618 PERL_MAGIC_pos|5.007002||p
619 PERL_MAGIC_qr|5.007002||p
620 PERL_MAGIC_regdata|5.007002||p
621 PERL_MAGIC_regdatum|5.007002||p
622 PERL_MAGIC_regex_global|5.007002||p
623 PERL_MAGIC_shared_scalar|5.007003||p
624 PERL_MAGIC_shared|5.007003||p
625 PERL_MAGIC_sigelem|5.007002||p
626 PERL_MAGIC_sig|5.007002||p
627 PERL_MAGIC_substr|5.007002||p
628 PERL_MAGIC_sv|5.007002||p
629 PERL_MAGIC_taint|5.007002||p
630 PERL_MAGIC_tiedelem|5.007002||p
631 PERL_MAGIC_tiedscalar|5.007002||p
632 PERL_MAGIC_tied|5.007002||p
633 PERL_MAGIC_utf8|5.008001||p
634 PERL_MAGIC_uvar_elem|5.007003||p
635 PERL_MAGIC_uvar|5.007002||p
636 PERL_MAGIC_vec|5.007002||p
637 PERL_MAGIC_vstring|5.008001||p
638 PERL_PV_ESCAPE_ALL|5.009004||p
639 PERL_PV_ESCAPE_FIRSTCHAR|5.009004||p
640 PERL_PV_ESCAPE_NOBACKSLASH|5.009004||p
641 PERL_PV_ESCAPE_NOCLEAR|5.009004||p
642 PERL_PV_ESCAPE_QUOTE|5.009004||p
643 PERL_PV_ESCAPE_RE|5.009005||p
644 PERL_PV_ESCAPE_UNI_DETECT|5.009004||p
645 PERL_PV_ESCAPE_UNI|5.009004||p
646 PERL_PV_PRETTY_DUMP|5.009004||p
647 PERL_PV_PRETTY_ELLIPSES|5.010000||p
648 PERL_PV_PRETTY_LTGT|5.009004||p
649 PERL_PV_PRETTY_NOCLEAR|5.010000||p
650 PERL_PV_PRETTY_QUOTE|5.009004||p
651 PERL_PV_PRETTY_REGPROP|5.009004||p
652 PERL_QUAD_MAX|5.003070||p
653 PERL_QUAD_MIN|5.003070||p
654 PERL_REVISION|5.006000||p
655 PERL_SCAN_ALLOW_UNDERSCORES|5.007003||p
656 PERL_SCAN_DISALLOW_PREFIX|5.007003||p
657 PERL_SCAN_GREATER_THAN_UV_MAX|5.007003||p
658 PERL_SCAN_SILENT_ILLDIGIT|5.008001||p
659 PERL_SHORT_MAX|5.003070||p
660 PERL_SHORT_MIN|5.003070||p
661 PERL_SIGNALS_UNSAFE_FLAG|5.008001||p
662 PERL_SUBVERSION|5.006000||p
663 PERL_SYS_INIT3||5.006000|
664 PERL_SYS_INIT|||
665 PERL_SYS_TERM||5.021008|
666 PERL_UCHAR_MAX|5.003070||p
667 PERL_UCHAR_MIN|5.003070||p
668 PERL_UINT_MAX|5.003070||p
669 PERL_UINT_MIN|5.003070||p
670 PERL_ULONG_MAX|5.003070||p
671 PERL_ULONG_MIN|5.003070||p
672 PERL_UNUSED_ARG|5.009003||p
673 PERL_UNUSED_CONTEXT|5.009004||p
674 PERL_UNUSED_DECL|5.007002||p
675 PERL_UNUSED_VAR|5.007002||p
676 PERL_UQUAD_MAX|5.003070||p
677 PERL_UQUAD_MIN|5.003070||p
678 PERL_USE_GCC_BRACE_GROUPS|5.009004||p
679 PERL_USHORT_MAX|5.003070||p
680 PERL_USHORT_MIN|5.003070||p
681 PERL_VERSION|5.006000||p
682 PL_DBsignal|5.005000||p
683 PL_DBsingle|||pn
684 PL_DBsub|||pn
685 PL_DBtrace|||pn
686 PL_Sv|5.005000||p
687 PL_bufend|5.021008||p
688 PL_bufptr|5.021008||p
689 PL_check||5.006000|
690 PL_compiling|5.004050||p
691 PL_comppad_name||5.017004|
692 PL_comppad||5.008001|
693 PL_copline|5.021008||p
694 PL_curcop|5.004050||p
695 PL_curpad||5.005000|
696 PL_curstash|5.004050||p
697 PL_debstash|5.004050||p
698 PL_defgv|5.004050||p
699 PL_diehook|5.004050||p
700 PL_dirty|5.004050||p
701 PL_dowarn|||pn
702 PL_errgv|5.004050||p
703 PL_error_count|5.021008||p
704 PL_expect|5.021008||p
705 PL_hexdigit|5.005000||p
706 PL_hints|5.005000||p
707 PL_in_my_stash|5.021008||p
708 PL_in_my|5.021008||p
709 PL_keyword_plugin||5.011002|
710 PL_last_in_gv|||n
711 PL_laststatval|5.005000||p
712 PL_lex_state|5.021008||p
713 PL_lex_stuff|5.021008||p
714 PL_linestr|5.021008||p
715 PL_modglobal||5.005000|n
716 PL_na|5.004050||pn
717 PL_no_modify|5.006000||p
718 PL_ofsgv|||n
719 PL_opfreehook||5.011000|n
720 PL_parser|5.009005||p
721 PL_peepp||5.007003|n
722 PL_perl_destruct_level|5.004050||p
723 PL_perldb|5.004050||p
724 PL_ppaddr|5.006000||p
725 PL_rpeepp||5.013005|n
726 PL_rsfp_filters|5.021008||p
727 PL_rsfp|5.021008||p
728 PL_rs|||n
729 PL_signals|5.008001||p
730 PL_stack_base|5.004050||p
731 PL_stack_sp|5.004050||p
732 PL_statcache|5.005000||p
733 PL_stdingv|5.004050||p
734 PL_sv_arenaroot|5.004050||p
735 PL_sv_no|5.004050||pn
736 PL_sv_undef|5.004050||pn
737 PL_sv_yes|5.004050||pn
738 PL_tainted|5.004050||p
739 PL_tainting|5.004050||p
740 PL_tokenbuf|5.021008||p
741 POP_MULTICALL||5.021008|
742 POPi|||n
743 POPl|||n
744 POPn|||n
745 POPpbytex||5.007001|n
746 POPpx||5.005030|n
747 POPp|||n
748 POPs|||n
749 PTR2IV|5.006000||p
750 PTR2NV|5.006000||p
751 PTR2UV|5.006000||p
752 PTR2nat|5.009003||p
753 PTR2ul|5.007001||p
754 PTRV|5.006000||p
755 PUSHMARK|||
756 PUSH_MULTICALL||5.021008|
757 PUSHi|||
758 PUSHmortal|5.009002||p
759 PUSHn|||
760 PUSHp|||
761 PUSHs|||
762 PUSHu|5.004000||p
763 PUTBACK|||
764 PadARRAY||5.021008|
765 PadMAX||5.021008|
766 PadlistARRAY||5.021008|
767 PadlistMAX||5.021008|
768 PadlistNAMESARRAY||5.021008|
769 PadlistNAMESMAX||5.021008|
770 PadlistNAMES||5.021008|
771 PadlistREFCNT||5.017004|
772 PadnameIsOUR|||
773 PadnameIsSTATE|||
774 PadnameLEN||5.021008|
775 PadnameOURSTASH|||
776 PadnameOUTER|||
777 PadnamePV||5.021008|
778 PadnameREFCNT_dec||5.021008|
779 PadnameREFCNT||5.021008|
780 PadnameSV||5.021008|
781 PadnameTYPE|||
782 PadnameUTF8||5.021007|
783 PadnamelistARRAY||5.021008|
784 PadnamelistMAX||5.021008|
785 PadnamelistREFCNT_dec||5.021008|
786 PadnamelistREFCNT||5.021008|
787 PerlIO_clearerr||5.007003|
788 PerlIO_close||5.007003|
789 PerlIO_context_layers||5.009004|
790 PerlIO_eof||5.007003|
791 PerlIO_error||5.007003|
792 PerlIO_fileno||5.007003|
793 PerlIO_fill||5.007003|
794 PerlIO_flush||5.007003|
795 PerlIO_get_base||5.007003|
796 PerlIO_get_bufsiz||5.007003|
797 PerlIO_get_cnt||5.007003|
798 PerlIO_get_ptr||5.007003|
799 PerlIO_read||5.007003|
800 PerlIO_restore_errno|||
801 PerlIO_save_errno|||
802 PerlIO_seek||5.007003|
803 PerlIO_set_cnt||5.007003|
804 PerlIO_set_ptrcnt||5.007003|
805 PerlIO_setlinebuf||5.007003|
806 PerlIO_stderr||5.007003|
807 PerlIO_stdin||5.007003|
808 PerlIO_stdout||5.007003|
809 PerlIO_tell||5.007003|
810 PerlIO_unread||5.007003|
811 PerlIO_write||5.007003|
812 Perl_signbit||5.009005|n
813 PoisonFree|5.009004||p
814 PoisonNew|5.009004||p
815 PoisonWith|5.009004||p
816 Poison|5.008000||p
817 READ_XDIGIT||5.017006|
818 RETVAL|||n
819 Renewc|||
820 Renew|||
821 SAVECLEARSV|||
822 SAVECOMPPAD|||
823 SAVEPADSV|||
824 SAVETMPS|||
825 SAVE_DEFSV|5.004050||p
826 SPAGAIN|||
827 SP|||
828 START_EXTERN_C|5.005000||p
829 START_MY_CXT|5.007003||p
830 STMT_END|||p
831 STMT_START|||p
832 STR_WITH_LEN|5.009003||p
833 ST|||
834 SV_CONST_RETURN|5.009003||p
835 SV_COW_DROP_PV|5.008001||p
836 SV_COW_SHARED_HASH_KEYS|5.009005||p
837 SV_GMAGIC|5.007002||p
838 SV_HAS_TRAILING_NUL|5.009004||p
839 SV_IMMEDIATE_UNREF|5.007001||p
840 SV_MUTABLE_RETURN|5.009003||p
841 SV_NOSTEAL|5.009002||p
842 SV_SMAGIC|5.009003||p
843 SV_UTF8_NO_ENCODING|5.008001||p
844 SVfARG|5.009005||p
845 SVf_UTF8|5.006000||p
846 SVf|5.006000||p
847 SVt_INVLIST||5.019002|
848 SVt_IV|||
849 SVt_NULL|||
850 SVt_NV|||
851 SVt_PVAV|||
852 SVt_PVCV|||
853 SVt_PVFM|||
854 SVt_PVGV|||
855 SVt_PVHV|||
856 SVt_PVIO|||
857 SVt_PVIV|||
858 SVt_PVLV|||
859 SVt_PVMG|||
860 SVt_PVNV|||
861 SVt_PV|||
862 SVt_REGEXP||5.011000|
863 Safefree|||
864 Slab_Alloc|||
865 Slab_Free|||
866 Slab_to_ro|||
867 Slab_to_rw|||
868 StructCopy|||
869 SvCUR_set|||
870 SvCUR|||
871 SvEND|||
872 SvGAMAGIC||5.006001|
873 SvGETMAGIC|5.004050||p
874 SvGROW|||
875 SvIOK_UV||5.006000|
876 SvIOK_notUV||5.006000|
877 SvIOK_off|||
878 SvIOK_only_UV||5.006000|
879 SvIOK_only|||
880 SvIOK_on|||
881 SvIOKp|||
882 SvIOK|||
883 SvIVX|||
884 SvIV_nomg|5.009001||p
885 SvIV_set|||
886 SvIVx|||
887 SvIV|||
888 SvIsCOW_shared_hash||5.008003|
889 SvIsCOW||5.008003|
890 SvLEN_set|||
891 SvLEN|||
892 SvLOCK||5.007003|
893 SvMAGIC_set|5.009003||p
894 SvNIOK_off|||
895 SvNIOKp|||
896 SvNIOK|||
897 SvNOK_off|||
898 SvNOK_only|||
899 SvNOK_on|||
900 SvNOKp|||
901 SvNOK|||
902 SvNVX|||
903 SvNV_nomg||5.013002|
904 SvNV_set|||
905 SvNVx|||
906 SvNV|||
907 SvOK|||
908 SvOOK_offset||5.011000|
909 SvOOK|||
910 SvPOK_off|||
911 SvPOK_only_UTF8||5.006000|
912 SvPOK_only|||
913 SvPOK_on|||
914 SvPOKp|||
915 SvPOK|||
916 SvPVX_const|5.009003||p
917 SvPVX_mutable|5.009003||p
918 SvPVX|||
919 SvPV_const|5.009003||p
920 SvPV_flags_const_nolen|5.009003||p
921 SvPV_flags_const|5.009003||p
922 SvPV_flags_mutable|5.009003||p
923 SvPV_flags|5.007002||p
924 SvPV_force_flags_mutable|5.009003||p
925 SvPV_force_flags_nolen|5.009003||p
926 SvPV_force_flags|5.007002||p
927 SvPV_force_mutable|5.009003||p
928 SvPV_force_nolen|5.009003||p
929 SvPV_force_nomg_nolen|5.009003||p
930 SvPV_force_nomg|5.007002||p
931 SvPV_force|||p
932 SvPV_mutable|5.009003||p
933 SvPV_nolen_const|5.009003||p
934 SvPV_nolen|5.006000||p
935 SvPV_nomg_const_nolen|5.009003||p
936 SvPV_nomg_const|5.009003||p
937 SvPV_nomg_nolen|5.013007||p
938 SvPV_nomg|5.007002||p
939 SvPV_renew|5.009003||p
940 SvPV_set|||
941 SvPVbyte_force||5.009002|
942 SvPVbyte_nolen||5.006000|
943 SvPVbytex_force||5.006000|
944 SvPVbytex||5.006000|
945 SvPVbyte|5.006000||p
946 SvPVutf8_force||5.006000|
947 SvPVutf8_nolen||5.006000|
948 SvPVutf8x_force||5.006000|
949 SvPVutf8x||5.006000|
950 SvPVutf8||5.006000|
951 SvPVx|||
952 SvPV|||
953 SvREFCNT_dec_NN||5.017007|
954 SvREFCNT_dec|||
955 SvREFCNT_inc_NN|5.009004||p
956 SvREFCNT_inc_simple_NN|5.009004||p
957 SvREFCNT_inc_simple_void_NN|5.009004||p
958 SvREFCNT_inc_simple_void|5.009004||p
959 SvREFCNT_inc_simple|5.009004||p
960 SvREFCNT_inc_void_NN|5.009004||p
961 SvREFCNT_inc_void|5.009004||p
962 SvREFCNT_inc|||p
963 SvREFCNT|||
964 SvROK_off|||
965 SvROK_on|||
966 SvROK|||
967 SvRV_set|5.009003||p
968 SvRV|||
969 SvRXOK||5.009005|
970 SvRX||5.009005|
971 SvSETMAGIC|||
972 SvSHARED_HASH|5.009003||p
973 SvSHARE||5.007003|
974 SvSTASH_set|5.009003||p
975 SvSTASH|||
976 SvSetMagicSV_nosteal||5.004000|
977 SvSetMagicSV||5.004000|
978 SvSetSV_nosteal||5.004000|
979 SvSetSV|||
980 SvTAINTED_off||5.004000|
981 SvTAINTED_on||5.004000|
982 SvTAINTED||5.004000|
983 SvTAINT|||
984 SvTHINKFIRST|||
985 SvTRUE_nomg||5.013006|
986 SvTRUE|||
987 SvTYPE|||
988 SvUNLOCK||5.007003|
989 SvUOK|5.007001|5.006000|p
990 SvUPGRADE|||
991 SvUTF8_off||5.006000|
992 SvUTF8_on||5.006000|
993 SvUTF8||5.006000|
994 SvUVXx|5.004000||p
995 SvUVX|5.004000||p
996 SvUV_nomg|5.009001||p
997 SvUV_set|5.009003||p
998 SvUVx|5.004000||p
999 SvUV|5.004000||p
1000 SvVOK||5.008001|
1001 SvVSTRING_mg|5.009004||p
1002 THIS|||n
1003 UNDERBAR|5.009002||p
1004 UTF8_MAXBYTES|5.009002||p
1005 UVSIZE|5.006000||p
1006 UVTYPE|5.006000||p
1007 UVXf|5.007001||p
1008 UVof|5.006000||p
1009 UVuf|5.006000||p
1010 UVxf|5.006000||p
1011 WARN_ALL|5.006000||p
1012 WARN_AMBIGUOUS|5.006000||p
1013 WARN_ASSERTIONS|5.021008||p
1014 WARN_BAREWORD|5.006000||p
1015 WARN_CLOSED|5.006000||p
1016 WARN_CLOSURE|5.006000||p
1017 WARN_DEBUGGING|5.006000||p
1018 WARN_DEPRECATED|5.006000||p
1019 WARN_DIGIT|5.006000||p
1020 WARN_EXEC|5.006000||p
1021 WARN_EXITING|5.006000||p
1022 WARN_GLOB|5.006000||p
1023 WARN_INPLACE|5.006000||p
1024 WARN_INTERNAL|5.006000||p
1025 WARN_IO|5.006000||p
1026 WARN_LAYER|5.008000||p
1027 WARN_MALLOC|5.006000||p
1028 WARN_MISC|5.006000||p
1029 WARN_NEWLINE|5.006000||p
1030 WARN_NUMERIC|5.006000||p
1031 WARN_ONCE|5.006000||p
1032 WARN_OVERFLOW|5.006000||p
1033 WARN_PACK|5.006000||p
1034 WARN_PARENTHESIS|5.006000||p
1035 WARN_PIPE|5.006000||p
1036 WARN_PORTABLE|5.006000||p
1037 WARN_PRECEDENCE|5.006000||p
1038 WARN_PRINTF|5.006000||p
1039 WARN_PROTOTYPE|5.006000||p
1040 WARN_QW|5.006000||p
1041 WARN_RECURSION|5.006000||p
1042 WARN_REDEFINE|5.006000||p
1043 WARN_REGEXP|5.006000||p
1044 WARN_RESERVED|5.006000||p
1045 WARN_SEMICOLON|5.006000||p
1046 WARN_SEVERE|5.006000||p
1047 WARN_SIGNAL|5.006000||p
1048 WARN_SUBSTR|5.006000||p
1049 WARN_SYNTAX|5.006000||p
1050 WARN_TAINT|5.006000||p
1051 WARN_THREADS|5.008000||p
1052 WARN_UNINITIALIZED|5.006000||p
1053 WARN_UNOPENED|5.006000||p
1054 WARN_UNPACK|5.006000||p
1055 WARN_UNTIE|5.006000||p
1056 WARN_UTF8|5.006000||p
1057 WARN_VOID|5.006000||p
1058 WIDEST_UTYPE|5.015004||p
1059 XCPT_CATCH|5.009002||p
1060 XCPT_RETHROW|5.009002||p
1061 XCPT_TRY_END|5.009002||p
1062 XCPT_TRY_START|5.009002||p
1063 XPUSHi|||
1064 XPUSHmortal|5.009002||p
1065 XPUSHn|||
1066 XPUSHp|||
1067 XPUSHs|||
1068 XPUSHu|5.004000||p
1069 XSPROTO|5.010000||p
1070 XSRETURN_EMPTY|||
1071 XSRETURN_IV|||
1072 XSRETURN_NO|||
1073 XSRETURN_NV|||
1074 XSRETURN_PV|||
1075 XSRETURN_UNDEF|||
1076 XSRETURN_UV|5.008001||p
1077 XSRETURN_YES|||
1078 XSRETURN|||p
1079 XST_mIV|||
1080 XST_mNO|||
1081 XST_mNV|||
1082 XST_mPV|||
1083 XST_mUNDEF|||
1084 XST_mUV|5.008001||p
1085 XST_mYES|||
1086 XS_APIVERSION_BOOTCHECK||5.021008|
1087 XS_EXTERNAL||5.021008|
1088 XS_INTERNAL||5.021008|
1089 XS_VERSION_BOOTCHECK||5.021008|
1090 XS_VERSION|||
1091 XSprePUSH|5.006000||p
1092 XS|||
1093 XopDISABLE||5.021008|
1094 XopENABLE||5.021008|
1095 XopENTRYCUSTOM||5.021008|
1096 XopENTRY_set||5.021008|
1097 XopENTRY||5.021008|
1098 XopFLAGS||5.013007|
1099 ZeroD|5.009002||p
1100 Zero|||
1101 _aMY_CXT|5.007003||p
1102 _add_range_to_invlist|||
1103 _append_range_to_invlist|||
1104 _core_swash_init|||
1105 _get_encoding|||
1106 _get_regclass_nonbitmap_data|||
1107 _get_swash_invlist|||
1108 _invlist_array_init|||n
1109 _invlist_contains_cp|||n
1110 _invlist_contents|||
1111 _invlist_dump|||
1112 _invlist_intersection_maybe_complement_2nd|||
1113 _invlist_intersection|||
1114 _invlist_invert|||
1115 _invlist_len|||n
1116 _invlist_populate_swatch|||n
1117 _invlist_search|||n
1118 _invlist_subtract|||
1119 _invlist_union_maybe_complement_2nd|||
1120 _invlist_union|||
1121 _is_cur_LC_category_utf8|||
1122 _is_in_locale_category||5.021001|
1123 _is_uni_FOO||5.017008|
1124 _is_uni_perl_idcont||5.017008|
1125 _is_uni_perl_idstart||5.017007|
1126 _is_utf8_FOO||5.017008|
1127 _is_utf8_char_slow||5.021001|n
1128 _is_utf8_idcont||5.021001|
1129 _is_utf8_idstart||5.021001|
1130 _is_utf8_mark||5.017008|
1131 _is_utf8_perl_idcont||5.017008|
1132 _is_utf8_perl_idstart||5.017007|
1133 _is_utf8_xidcont||5.021001|
1134 _is_utf8_xidstart||5.021001|
1135 _load_PL_utf8_foldclosures|||
1136 _make_exactf_invlist|||
1137 _new_invlist_C_array|||
1138 _new_invlist|||
1139 _pMY_CXT|5.007003||p
1140 _setup_canned_invlist|||
1141 _swash_inversion_hash|||
1142 _swash_to_invlist|||
1143 _to_fold_latin1|||
1144 _to_uni_fold_flags||5.014000|
1145 _to_upper_title_latin1|||
1146 _to_utf8_fold_flags||5.019009|
1147 _to_utf8_lower_flags||5.019009|
1148 _to_utf8_title_flags||5.019009|
1149 _to_utf8_upper_flags||5.019009|
1150 _warn_problematic_locale|||n
1151 aMY_CXT_|5.007003||p
1152 aMY_CXT|5.007003||p
1153 aTHXR_|5.021008||p
1154 aTHXR|5.021008||p
1155 aTHX_|5.006000||p
1156 aTHX|5.006000||p
1157 aassign_common_vars|||
1158 add_above_Latin1_folds|||
1159 add_cp_to_invlist|||
1160 add_data|||n
1161 add_multi_match|||
1162 add_utf16_textfilter|||
1163 adjust_size_and_find_bucket|||n
1164 advance_one_SB|||
1165 advance_one_WB|||
1166 alloc_maybe_populate_EXACT|||
1167 alloccopstash|||
1168 allocmy|||
1169 amagic_call|||
1170 amagic_cmp_locale|||
1171 amagic_cmp|||
1172 amagic_deref_call||5.013007|
1173 amagic_i_ncmp|||
1174 amagic_is_enabled|||
1175 amagic_ncmp|||
1176 anonymise_cv_maybe|||
1177 any_dup|||
1178 ao|||
1179 append_utf8_from_native_byte||5.019004|n
1180 apply_attrs_my|||
1181 apply_attrs_string||5.006001|
1182 apply_attrs|||
1183 apply|||
1184 assert_uft8_cache_coherent|||
1185 assignment_type|||
1186 atfork_lock||5.007003|n
1187 atfork_unlock||5.007003|n
1188 av_arylen_p||5.009003|
1189 av_clear|||
1190 av_create_and_push||5.009005|
1191 av_create_and_unshift_one||5.009005|
1192 av_delete||5.006000|
1193 av_exists||5.006000|
1194 av_extend_guts|||
1195 av_extend|||
1196 av_fetch|||
1197 av_fill|||
1198 av_iter_p||5.011000|
1199 av_len|||
1200 av_make|||
1201 av_pop|||
1202 av_push|||
1203 av_reify|||
1204 av_shift|||
1205 av_store|||
1206 av_tindex||5.017009|
1207 av_top_index||5.017009|
1208 av_undef|||
1209 av_unshift|||
1210 ax|||n
1211 backup_one_SB|||
1212 backup_one_WB|||
1213 bad_type_gv|||
1214 bad_type_pv|||
1215 bind_match|||
1216 block_end||5.004000|
1217 block_gimme||5.004000|
1218 block_start||5.004000|
1219 blockhook_register||5.013003|
1220 boolSV|5.004000||p
1221 boot_core_PerlIO|||
1222 boot_core_UNIVERSAL|||
1223 boot_core_mro|||
1224 bytes_cmp_utf8||5.013007|
1225 bytes_from_utf8||5.007001|
1226 bytes_to_utf8||5.006001|
1227 call_argv|5.006000||p
1228 call_atexit||5.006000|
1229 call_list||5.004000|
1230 call_method|5.006000||p
1231 call_pv|5.006000||p
1232 call_sv|5.006000||p
1233 caller_cx|5.013005|5.006000|p
1234 calloc||5.007002|n
1235 cando|||
1236 cast_i32||5.006000|n
1237 cast_iv||5.006000|n
1238 cast_ulong||5.006000|n
1239 cast_uv||5.006000|n
1240 check_locale_boundary_crossing|||
1241 check_type_and_open|||
1242 check_uni|||
1243 check_utf8_print|||
1244 checkcomma|||
1245 ckWARN|5.006000||p
1246 ck_entersub_args_core|||
1247 ck_entersub_args_list||5.013006|
1248 ck_entersub_args_proto_or_list||5.013006|
1249 ck_entersub_args_proto||5.013006|
1250 ck_warner_d||5.011001|v
1251 ck_warner||5.011001|v
1252 ckwarn_common|||
1253 ckwarn_d||5.009003|
1254 ckwarn||5.009003|
1255 clear_placeholders|||
1256 clear_special_blocks|||
1257 clone_params_del|||n
1258 clone_params_new|||n
1259 closest_cop|||
1260 cntrl_to_mnemonic|||n
1261 compute_EXACTish|||n
1262 construct_ahocorasick_from_trie|||
1263 cop_fetch_label||5.015001|
1264 cop_free|||
1265 cop_hints_2hv||5.013007|
1266 cop_hints_fetch_pvn||5.013007|
1267 cop_hints_fetch_pvs||5.013007|
1268 cop_hints_fetch_pv||5.013007|
1269 cop_hints_fetch_sv||5.013007|
1270 cop_store_label||5.015001|
1271 cophh_2hv||5.013007|
1272 cophh_copy||5.013007|
1273 cophh_delete_pvn||5.013007|
1274 cophh_delete_pvs||5.013007|
1275 cophh_delete_pv||5.013007|
1276 cophh_delete_sv||5.013007|
1277 cophh_fetch_pvn||5.013007|
1278 cophh_fetch_pvs||5.013007|
1279 cophh_fetch_pv||5.013007|
1280 cophh_fetch_sv||5.013007|
1281 cophh_free||5.013007|
1282 cophh_new_empty||5.021008|
1283 cophh_store_pvn||5.013007|
1284 cophh_store_pvs||5.013007|
1285 cophh_store_pv||5.013007|
1286 cophh_store_sv||5.013007|
1287 core_prototype|||
1288 coresub_op|||
1289 could_it_be_a_POSIX_class|||n
1290 cr_textfilter|||
1291 create_eval_scope|||
1292 croak_memory_wrap||5.019003|n
1293 croak_no_mem|||n
1294 croak_no_modify||5.013003|n
1295 croak_nocontext|||vn
1296 croak_popstack|||n
1297 croak_sv||5.013001|
1298 croak_xs_usage||5.010001|n
1299 croak|||v
1300 csighandler||5.009003|n
1301 current_re_engine|||
1302 curse|||
1303 custom_op_desc||5.007003|
1304 custom_op_get_field|||
1305 custom_op_name||5.007003|
1306 custom_op_register||5.013007|
1307 custom_op_xop||5.013007|
1308 cv_ckproto_len_flags|||
1309 cv_clone_into|||
1310 cv_clone|||
1311 cv_const_sv_or_av|||n
1312 cv_const_sv||5.003070|n
1313 cv_dump|||
1314 cv_forget_slab|||
1315 cv_get_call_checker||5.013006|
1316 cv_name||5.021005|
1317 cv_set_call_checker_flags||5.021004|
1318 cv_set_call_checker||5.013006|
1319 cv_undef_flags|||
1320 cv_undef|||
1321 cvgv_from_hek|||
1322 cvgv_set|||
1323 cvstash_set|||
1324 cx_dump||5.005000|
1325 cx_dup|||
1326 cxinc|||
1327 dAXMARK|5.009003||p
1328 dAX|5.007002||p
1329 dITEMS|5.007002||p
1330 dMARK|||
1331 dMULTICALL||5.009003|
1332 dMY_CXT_SV|5.007003||p
1333 dMY_CXT|5.007003||p
1334 dNOOP|5.006000||p
1335 dORIGMARK|||
1336 dSP|||
1337 dTHR|5.004050||p
1338 dTHXR|5.021008||p
1339 dTHXa|5.006000||p
1340 dTHXoa|5.006000||p
1341 dTHX|5.006000||p
1342 dUNDERBAR|5.009002||p
1343 dVAR|5.009003||p
1344 dXCPT|5.009002||p
1345 dXSARGS|||
1346 dXSI32|||
1347 dXSTARG|5.006000||p
1348 deb_curcv|||
1349 deb_nocontext|||vn
1350 deb_stack_all|||
1351 deb_stack_n|||
1352 debop||5.005000|
1353 debprofdump||5.005000|
1354 debprof|||
1355 debstackptrs||5.007003|
1356 debstack||5.007003|
1357 debug_start_match|||
1358 deb||5.007003|v
1359 defelem_target|||
1360 del_sv|||
1361 delete_eval_scope|||
1362 delimcpy||5.004000|n
1363 deprecate_commaless_var_list|||
1364 despatch_signals||5.007001|
1365 destroy_matcher|||
1366 die_nocontext|||vn
1367 die_sv||5.013001|
1368 die_unwind|||
1369 die|||v
1370 dirp_dup|||
1371 div128|||
1372 djSP|||
1373 do_aexec5|||
1374 do_aexec|||
1375 do_aspawn|||
1376 do_binmode||5.004050|
1377 do_chomp|||
1378 do_close|||
1379 do_delete_local|||
1380 do_dump_pad|||
1381 do_eof|||
1382 do_exec3|||
1383 do_execfree|||
1384 do_exec|||
1385 do_gv_dump||5.006000|
1386 do_gvgv_dump||5.006000|
1387 do_hv_dump||5.006000|
1388 do_ipcctl|||
1389 do_ipcget|||
1390 do_join|||
1391 do_magic_dump||5.006000|
1392 do_msgrcv|||
1393 do_msgsnd|||
1394 do_ncmp|||
1395 do_oddball|||
1396 do_op_dump||5.006000|
1397 do_open6|||
1398 do_open9||5.006000|
1399 do_open_raw|||
1400 do_openn||5.007001|
1401 do_open||5.003070|
1402 do_pmop_dump||5.006000|
1403 do_print|||
1404 do_readline|||
1405 do_seek|||
1406 do_semop|||
1407 do_shmio|||
1408 do_smartmatch|||
1409 do_spawn_nowait|||
1410 do_spawn|||
1411 do_sprintf|||
1412 do_sv_dump||5.006000|
1413 do_sysseek|||
1414 do_tell|||
1415 do_trans_complex_utf8|||
1416 do_trans_complex|||
1417 do_trans_count_utf8|||
1418 do_trans_count|||
1419 do_trans_simple_utf8|||
1420 do_trans_simple|||
1421 do_trans|||
1422 do_vecget|||
1423 do_vecset|||
1424 do_vop|||
1425 docatch|||
1426 doeval|||
1427 dofile|||
1428 dofindlabel|||
1429 doform|||
1430 doing_taint||5.008001|n
1431 dooneliner|||
1432 doopen_pm|||
1433 doparseform|||
1434 dopoptoeval|||
1435 dopoptogiven|||
1436 dopoptolabel|||
1437 dopoptoloop|||
1438 dopoptosub_at|||
1439 dopoptowhen|||
1440 doref||5.009003|
1441 dounwind|||
1442 dowantarray|||
1443 drand48_init_r|||n
1444 drand48_r|||n
1445 dump_all_perl|||
1446 dump_all||5.006000|
1447 dump_c_backtrace|||
1448 dump_eval||5.006000|
1449 dump_exec_pos|||
1450 dump_form||5.006000|
1451 dump_indent||5.006000|v
1452 dump_mstats|||
1453 dump_packsubs_perl|||
1454 dump_packsubs||5.006000|
1455 dump_sub_perl|||
1456 dump_sub||5.006000|
1457 dump_sv_child|||
1458 dump_trie_interim_list|||
1459 dump_trie_interim_table|||
1460 dump_trie|||
1461 dump_vindent||5.006000|
1462 dumpuntil|||
1463 dup_attrlist|||
1464 emulate_cop_io|||
1465 eval_pv|5.006000||p
1466 eval_sv|5.006000||p
1467 exec_failed|||
1468 expect_number|||
1469 fbm_compile||5.005000|
1470 fbm_instr||5.005000|
1471 feature_is_enabled|||
1472 filter_add|||
1473 filter_del|||
1474 filter_gets|||
1475 filter_read|||
1476 finalize_optree|||
1477 finalize_op|||
1478 find_and_forget_pmops|||
1479 find_array_subscript|||
1480 find_beginning|||
1481 find_byclass|||
1482 find_default_stash|||
1483 find_hash_subscript|||
1484 find_in_my_stash|||
1485 find_lexical_cv|||
1486 find_runcv_where|||
1487 find_runcv||5.008001|
1488 find_rundefsv2|||
1489 find_rundefsvoffset||5.009002|
1490 find_rundefsv||5.013002|
1491 find_script|||
1492 find_uninit_var|||
1493 first_symbol|||n
1494 fixup_errno_string|||
1495 foldEQ_latin1||5.013008|n
1496 foldEQ_locale||5.013002|n
1497 foldEQ_utf8_flags||5.013010|
1498 foldEQ_utf8||5.013002|
1499 foldEQ||5.013002|n
1500 fold_constants|||
1501 forbid_setid|||
1502 force_ident_maybe_lex|||
1503 force_ident|||
1504 force_list|||
1505 force_next|||
1506 force_strict_version|||
1507 force_version|||
1508 force_word|||
1509 forget_pmop|||
1510 form_nocontext|||vn
1511 form_short_octal_warning|||
1512 form||5.004000|v
1513 fp_dup|||
1514 fprintf_nocontext|||vn
1515 free_c_backtrace|||
1516 free_global_struct|||
1517 free_tied_hv_pool|||
1518 free_tmps|||
1519 gen_constant_list|||
1520 get_ANYOF_cp_list_for_ssc|||
1521 get_and_check_backslash_N_name|||
1522 get_aux_mg|||
1523 get_av|5.006000||p
1524 get_c_backtrace_dump|||
1525 get_c_backtrace|||
1526 get_context||5.006000|n
1527 get_cvn_flags|5.009005||p
1528 get_cvs|5.011000||p
1529 get_cv|5.006000||p
1530 get_db_sub|||
1531 get_debug_opts|||
1532 get_hash_seed|||
1533 get_hv|5.006000||p
1534 get_invlist_iter_addr|||n
1535 get_invlist_offset_addr|||n
1536 get_invlist_previous_index_addr|||n
1537 get_mstats|||
1538 get_no_modify|||
1539 get_num|||
1540 get_op_descs||5.005000|
1541 get_op_names||5.005000|
1542 get_opargs|||
1543 get_ppaddr||5.006000|
1544 get_re_arg|||
1545 get_sv|5.006000||p
1546 get_vtbl||5.005030|
1547 getcwd_sv||5.007002|
1548 getenv_len|||
1549 glob_2number|||
1550 glob_assign_glob|||
1551 gp_dup|||
1552 gp_free|||
1553 gp_ref|||
1554 grok_atoUV|||n
1555 grok_bin|5.007003||p
1556 grok_bslash_N|||
1557 grok_bslash_c|||
1558 grok_bslash_o|||
1559 grok_bslash_x|||
1560 grok_hex|5.007003||p
1561 grok_infnan||5.021004|
1562 grok_number_flags||5.021002|
1563 grok_number|5.007002||p
1564 grok_numeric_radix|5.007002||p
1565 grok_oct|5.007003||p
1566 group_end|||
1567 gv_AVadd|||
1568 gv_HVadd|||
1569 gv_IOadd|||
1570 gv_SVadd|||
1571 gv_add_by_type||5.011000|
1572 gv_autoload4||5.004000|
1573 gv_autoload_pvn||5.015004|
1574 gv_autoload_pv||5.015004|
1575 gv_autoload_sv||5.015004|
1576 gv_check|||
1577 gv_const_sv||5.009003|
1578 gv_dump||5.006000|
1579 gv_efullname3||5.003070|
1580 gv_efullname4||5.006001|
1581 gv_efullname|||
1582 gv_fetchfile_flags||5.009005|
1583 gv_fetchfile|||
1584 gv_fetchmeth_autoload||5.007003|
1585 gv_fetchmeth_internal|||
1586 gv_fetchmeth_pv_autoload||5.015004|
1587 gv_fetchmeth_pvn_autoload||5.015004|
1588 gv_fetchmeth_pvn||5.015004|
1589 gv_fetchmeth_pv||5.015004|
1590 gv_fetchmeth_sv_autoload||5.015004|
1591 gv_fetchmeth_sv||5.015004|
1592 gv_fetchmethod_autoload||5.004000|
1593 gv_fetchmethod_pv_flags||5.015004|
1594 gv_fetchmethod_pvn_flags||5.015004|
1595 gv_fetchmethod_sv_flags||5.015004|
1596 gv_fetchmethod|||
1597 gv_fetchmeth|||
1598 gv_fetchpvn_flags|5.009002||p
1599 gv_fetchpvs|5.009004||p
1600 gv_fetchpv|||
1601 gv_fetchsv|5.009002||p
1602 gv_fullname3||5.003070|
1603 gv_fullname4||5.006001|
1604 gv_fullname|||
1605 gv_handler||5.007001|
1606 gv_init_pvn||5.015004|
1607 gv_init_pv||5.015004|
1608 gv_init_svtype|||
1609 gv_init_sv||5.015004|
1610 gv_init|||
1611 gv_is_in_main|||
1612 gv_magicalize_isa|||
1613 gv_magicalize|||
1614 gv_name_set||5.009004|
1615 gv_override|||
1616 gv_setref|||
1617 gv_stashpvn_internal|||
1618 gv_stashpvn|5.003070||p
1619 gv_stashpvs|5.009003||p
1620 gv_stashpv|||
1621 gv_stashsvpvn_cached|||
1622 gv_stashsv|||
1623 gv_try_downgrade|||
1624 handle_regex_sets|||
1625 he_dup|||
1626 hek_dup|||
1627 hfree_next_entry|||
1628 hfreeentries|||
1629 hsplit|||
1630 hv_assert|||
1631 hv_auxinit_internal|||n
1632 hv_auxinit|||
1633 hv_backreferences_p|||
1634 hv_clear_placeholders||5.009001|
1635 hv_clear|||
1636 hv_common_key_len||5.010000|
1637 hv_common||5.010000|
1638 hv_copy_hints_hv||5.009004|
1639 hv_delayfree_ent||5.004000|
1640 hv_delete_common|||
1641 hv_delete_ent||5.003070|
1642 hv_delete|||
1643 hv_eiter_p||5.009003|
1644 hv_eiter_set||5.009003|
1645 hv_ename_add|||
1646 hv_ename_delete|||
1647 hv_exists_ent||5.003070|
1648 hv_exists|||
1649 hv_fetch_ent||5.003070|
1650 hv_fetchs|5.009003||p
1651 hv_fetch|||
1652 hv_fill||5.013002|
1653 hv_free_ent_ret|||
1654 hv_free_ent||5.004000|
1655 hv_iterinit|||
1656 hv_iterkeysv||5.003070|
1657 hv_iterkey|||
1658 hv_iternext_flags||5.008000|
1659 hv_iternextsv|||
1660 hv_iternext|||
1661 hv_iterval|||
1662 hv_kill_backrefs|||
1663 hv_ksplit||5.003070|
1664 hv_magic_check|||n
1665 hv_magic|||
1666 hv_name_set||5.009003|
1667 hv_notallowed|||
1668 hv_placeholders_get||5.009003|
1669 hv_placeholders_p|||
1670 hv_placeholders_set||5.009003|
1671 hv_rand_set||5.018000|
1672 hv_riter_p||5.009003|
1673 hv_riter_set||5.009003|
1674 hv_scalar||5.009001|
1675 hv_store_ent||5.003070|
1676 hv_store_flags||5.008000|
1677 hv_stores|5.009004||p
1678 hv_store|||
1679 hv_undef_flags|||
1680 hv_undef|||
1681 ibcmp_locale||5.004000|
1682 ibcmp_utf8||5.007003|
1683 ibcmp|||
1684 incline|||
1685 incpush_if_exists|||
1686 incpush_use_sep|||
1687 incpush|||
1688 ingroup|||
1689 init_argv_symbols|||
1690 init_constants|||
1691 init_dbargs|||
1692 init_debugger|||
1693 init_global_struct|||
1694 init_i18nl10n||5.006000|
1695 init_i18nl14n||5.006000|
1696 init_ids|||
1697 init_interp|||
1698 init_main_stash|||
1699 init_perllib|||
1700 init_postdump_symbols|||
1701 init_predump_symbols|||
1702 init_stacks||5.005000|
1703 init_tm||5.007002|
1704 inplace_aassign|||
1705 instr|||n
1706 intro_my||5.004000|
1707 intuit_method|||
1708 intuit_more|||
1709 invert|||
1710 invlist_array|||n
1711 invlist_clone|||
1712 invlist_extend|||
1713 invlist_highest|||n
1714 invlist_is_iterating|||n
1715 invlist_iterfinish|||n
1716 invlist_iterinit|||n
1717 invlist_iternext|||n
1718 invlist_max|||n
1719 invlist_previous_index|||n
1720 invlist_set_len|||
1721 invlist_set_previous_index|||n
1722 invlist_trim|||n
1723 invoke_exception_hook|||
1724 io_close|||
1725 isALNUMC|5.006000||p
1726 isALNUM_lazy||5.021001|
1727 isALPHANUMERIC||5.017008|
1728 isALPHA|||
1729 isASCII|5.006000||p
1730 isBLANK|5.006001||p
1731 isCNTRL|5.006000||p
1732 isDIGIT|||
1733 isFOO_lc|||
1734 isFOO_utf8_lc|||
1735 isGCB|||n
1736 isGRAPH|5.006000||p
1737 isGV_with_GP|5.009004||p
1738 isIDCONT||5.017008|
1739 isIDFIRST_lazy||5.021001|
1740 isIDFIRST|||
1741 isLOWER|||
1742 isOCTAL||5.013005|
1743 isPRINT|5.004000||p
1744 isPSXSPC|5.006001||p
1745 isPUNCT|5.006000||p
1746 isSB|||
1747 isSPACE|||
1748 isUPPER|||
1749 isUTF8_CHAR||5.021001|
1750 isWB|||
1751 isWORDCHAR||5.013006|
1752 isXDIGIT|5.006000||p
1753 is_an_int|||
1754 is_ascii_string||5.011000|
1755 is_handle_constructor|||n
1756 is_invariant_string||5.021007|n
1757 is_lvalue_sub||5.007001|
1758 is_safe_syscall||5.019004|
1759 is_ssc_worth_it|||n
1760 is_uni_alnum_lc||5.006000|
1761 is_uni_alnumc_lc||5.017007|
1762 is_uni_alnumc||5.017007|
1763 is_uni_alnum||5.006000|
1764 is_uni_alpha_lc||5.006000|
1765 is_uni_alpha||5.006000|
1766 is_uni_ascii_lc||5.006000|
1767 is_uni_ascii||5.006000|
1768 is_uni_blank_lc||5.017002|
1769 is_uni_blank||5.017002|
1770 is_uni_cntrl_lc||5.006000|
1771 is_uni_cntrl||5.006000|
1772 is_uni_digit_lc||5.006000|
1773 is_uni_digit||5.006000|
1774 is_uni_graph_lc||5.006000|
1775 is_uni_graph||5.006000|
1776 is_uni_idfirst_lc||5.006000|
1777 is_uni_idfirst||5.006000|
1778 is_uni_lower_lc||5.006000|
1779 is_uni_lower||5.006000|
1780 is_uni_print_lc||5.006000|
1781 is_uni_print||5.006000|
1782 is_uni_punct_lc||5.006000|
1783 is_uni_punct||5.006000|
1784 is_uni_space_lc||5.006000|
1785 is_uni_space||5.006000|
1786 is_uni_upper_lc||5.006000|
1787 is_uni_upper||5.006000|
1788 is_uni_xdigit_lc||5.006000|
1789 is_uni_xdigit||5.006000|
1790 is_utf8_alnumc||5.017007|
1791 is_utf8_alnum||5.006000|
1792 is_utf8_alpha||5.006000|
1793 is_utf8_ascii||5.006000|
1794 is_utf8_blank||5.017002|
1795 is_utf8_char_buf||5.015008|n
1796 is_utf8_char||5.006000|n
1797 is_utf8_cntrl||5.006000|
1798 is_utf8_common|||
1799 is_utf8_digit||5.006000|
1800 is_utf8_graph||5.006000|
1801 is_utf8_idcont||5.008000|
1802 is_utf8_idfirst||5.006000|
1803 is_utf8_lower||5.006000|
1804 is_utf8_mark||5.006000|
1805 is_utf8_perl_space||5.011001|
1806 is_utf8_perl_word||5.011001|
1807 is_utf8_posix_digit||5.011001|
1808 is_utf8_print||5.006000|
1809 is_utf8_punct||5.006000|
1810 is_utf8_space||5.006000|
1811 is_utf8_string_loclen||5.009003|n
1812 is_utf8_string_loc||5.008001|n
1813 is_utf8_string||5.006001|n
1814 is_utf8_upper||5.006000|
1815 is_utf8_xdigit||5.006000|
1816 is_utf8_xidcont||5.013010|
1817 is_utf8_xidfirst||5.013010|
1818 isa_lookup|||
1819 isinfnansv|||
1820 isinfnan||5.021004|n
1821 items|||n
1822 ix|||n
1823 jmaybe|||
1824 join_exact|||
1825 keyword_plugin_standard|||
1826 keyword|||
1827 leave_common|||
1828 leave_scope|||
1829 lex_bufutf8||5.011002|
1830 lex_discard_to||5.011002|
1831 lex_grow_linestr||5.011002|
1832 lex_next_chunk||5.011002|
1833 lex_peek_unichar||5.011002|
1834 lex_read_space||5.011002|
1835 lex_read_to||5.011002|
1836 lex_read_unichar||5.011002|
1837 lex_start||5.009005|
1838 lex_stuff_pvn||5.011002|
1839 lex_stuff_pvs||5.013005|
1840 lex_stuff_pv||5.013006|
1841 lex_stuff_sv||5.011002|
1842 lex_unstuff||5.011002|
1843 listkids|||
1844 list|||
1845 load_module_nocontext|||vn
1846 load_module|5.006000||pv
1847 localize|||
1848 looks_like_bool|||
1849 looks_like_number|||
1850 lop|||
1851 mPUSHi|5.009002||p
1852 mPUSHn|5.009002||p
1853 mPUSHp|5.009002||p
1854 mPUSHs|5.010001||p
1855 mPUSHu|5.009002||p
1856 mXPUSHi|5.009002||p
1857 mXPUSHn|5.009002||p
1858 mXPUSHp|5.009002||p
1859 mXPUSHs|5.010001||p
1860 mXPUSHu|5.009002||p
1861 magic_clear_all_env|||
1862 magic_cleararylen_p|||
1863 magic_clearenv|||
1864 magic_clearhints|||
1865 magic_clearhint|||
1866 magic_clearisa|||
1867 magic_clearpack|||
1868 magic_clearsig|||
1869 magic_copycallchecker|||
1870 magic_dump||5.006000|
1871 magic_existspack|||
1872 magic_freearylen_p|||
1873 magic_freeovrld|||
1874 magic_getarylen|||
1875 magic_getdebugvar|||
1876 magic_getdefelem|||
1877 magic_getnkeys|||
1878 magic_getpack|||
1879 magic_getpos|||
1880 magic_getsig|||
1881 magic_getsubstr|||
1882 magic_gettaint|||
1883 magic_getuvar|||
1884 magic_getvec|||
1885 magic_get|||
1886 magic_killbackrefs|||
1887 magic_methcall1|||
1888 magic_methcall|||v
1889 magic_methpack|||
1890 magic_nextpack|||
1891 magic_regdata_cnt|||
1892 magic_regdatum_get|||
1893 magic_regdatum_set|||
1894 magic_scalarpack|||
1895 magic_set_all_env|||
1896 magic_setarylen|||
1897 magic_setcollxfrm|||
1898 magic_setdbline|||
1899 magic_setdebugvar|||
1900 magic_setdefelem|||
1901 magic_setenv|||
1902 magic_sethint|||
1903 magic_setisa|||
1904 magic_setlvref|||
1905 magic_setmglob|||
1906 magic_setnkeys|||
1907 magic_setpack|||
1908 magic_setpos|||
1909 magic_setregexp|||
1910 magic_setsig|||
1911 magic_setsubstr|||
1912 magic_settaint|||
1913 magic_setutf8|||
1914 magic_setuvar|||
1915 magic_setvec|||
1916 magic_set|||
1917 magic_sizepack|||
1918 magic_wipepack|||
1919 make_matcher|||
1920 make_trie|||
1921 malloc_good_size|||n
1922 malloced_size|||n
1923 malloc||5.007002|n
1924 markstack_grow||5.021001|
1925 matcher_matches_sv|||
1926 maybe_multimagic_gv|||
1927 mayberelocate|||
1928 measure_struct|||
1929 memEQs|5.009005||p
1930 memEQ|5.004000||p
1931 memNEs|5.009005||p
1932 memNE|5.004000||p
1933 mem_collxfrm|||
1934 mem_log_common|||n
1935 mess_alloc|||
1936 mess_nocontext|||vn
1937 mess_sv||5.013001|
1938 mess||5.006000|v
1939 mfree||5.007002|n
1940 mg_clear|||
1941 mg_copy|||
1942 mg_dup|||
1943 mg_find_mglob|||
1944 mg_findext|5.013008||pn
1945 mg_find|||n
1946 mg_free_type||5.013006|
1947 mg_free|||
1948 mg_get|||
1949 mg_length||5.005000|
1950 mg_localize|||
1951 mg_magical|||n
1952 mg_set|||
1953 mg_size||5.005000|
1954 mini_mktime||5.007002|n
1955 minus_v|||
1956 missingterm|||
1957 mode_from_discipline|||
1958 modkids|||
1959 more_bodies|||
1960 more_sv|||
1961 moreswitches|||
1962 move_proto_attr|||
1963 mro_clean_isarev|||
1964 mro_gather_and_rename|||
1965 mro_get_from_name||5.010001|
1966 mro_get_linear_isa_dfs|||
1967 mro_get_linear_isa||5.009005|
1968 mro_get_private_data||5.010001|
1969 mro_isa_changed_in|||
1970 mro_meta_dup|||
1971 mro_meta_init|||
1972 mro_method_changed_in||5.009005|
1973 mro_package_moved|||
1974 mro_register||5.010001|
1975 mro_set_mro||5.010001|
1976 mro_set_private_data||5.010001|
1977 mul128|||
1978 mulexp10|||n
1979 multideref_stringify|||
1980 my_atof2||5.007002|
1981 my_atof||5.006000|
1982 my_attrs|||
1983 my_bcopy|||n
1984 my_bytes_to_utf8|||n
1985 my_bzero|||n
1986 my_chsize|||
1987 my_clearenv|||
1988 my_cxt_index|||
1989 my_cxt_init|||
1990 my_dirfd||5.009005|n
1991 my_exit_jump|||
1992 my_exit|||
1993 my_failure_exit||5.004000|
1994 my_fflush_all||5.006000|
1995 my_fork||5.007003|n
1996 my_kid|||
1997 my_lstat_flags|||
1998 my_lstat||5.021008|
1999 my_memcmp|||n
2000 my_memset|||n
2001 my_pclose||5.003070|
2002 my_popen_list||5.007001|
2003 my_popen||5.003070|
2004 my_setenv|||
2005 my_setlocale|||
2006 my_snprintf|5.009004||pvn
2007 my_socketpair||5.007003|n
2008 my_sprintf|5.009003||pvn
2009 my_stat_flags|||
2010 my_stat||5.021008|
2011 my_strerror||5.021001|
2012 my_strftime||5.007002|
2013 my_strlcat|5.009004||pn
2014 my_strlcpy|5.009004||pn
2015 my_unexec|||
2016 my_vsnprintf||5.009004|n
2017 need_utf8|||n
2018 newANONATTRSUB||5.006000|
2019 newANONHASH|||
2020 newANONLIST|||
2021 newANONSUB|||
2022 newASSIGNOP|||
2023 newATTRSUB_x|||
2024 newATTRSUB||5.006000|
2025 newAVREF|||
2026 newAV|||
2027 newBINOP|||
2028 newCONDOP|||
2029 newCONSTSUB_flags||5.015006|
2030 newCONSTSUB|5.004050||p
2031 newCVREF|||
2032 newDEFSVOP||5.021006|
2033 newFORM|||
2034 newFOROP||5.013007|
2035 newGIVENOP||5.009003|
2036 newGIVWHENOP|||
2037 newGP|||
2038 newGVOP|||
2039 newGVREF|||
2040 newGVgen_flags||5.015004|
2041 newGVgen|||
2042 newHVREF|||
2043 newHVhv||5.005000|
2044 newHV|||
2045 newIO|||
2046 newLISTOP|||
2047 newLOGOP|||
2048 newLOOPEX|||
2049 newLOOPOP|||
2050 newMETHOP_internal|||
2051 newMETHOP_named||5.021005|
2052 newMETHOP||5.021005|
2053 newMYSUB||5.017004|
2054 newNULLLIST|||
2055 newOP|||
2056 newPADNAMELIST||5.021007|n
2057 newPADNAMEouter||5.021007|n
2058 newPADNAMEpvn||5.021007|n
2059 newPADOP|||
2060 newPMOP|||
2061 newPROG|||
2062 newPVOP|||
2063 newRANGE|||
2064 newRV_inc|5.004000||p
2065 newRV_noinc|5.004000||p
2066 newRV|||
2067 newSLICEOP|||
2068 newSTATEOP|||
2069 newSTUB|||
2070 newSUB|||
2071 newSVOP|||
2072 newSVREF|||
2073 newSV_type|5.009005||p
2074 newSVavdefelem|||
2075 newSVhek||5.009003|
2076 newSViv|||
2077 newSVnv|||
2078 newSVpadname||5.017004|
2079 newSVpv_share||5.013006|
2080 newSVpvf_nocontext|||vn
2081 newSVpvf||5.004000|v
2082 newSVpvn_flags|5.010001||p
2083 newSVpvn_share|5.007001||p
2084 newSVpvn_utf8|5.010001||p
2085 newSVpvn|5.004050||p
2086 newSVpvs_flags|5.010001||p
2087 newSVpvs_share|5.009003||p
2088 newSVpvs|5.009003||p
2089 newSVpv|||
2090 newSVrv|||
2091 newSVsv|||
2092 newSVuv|5.006000||p
2093 newSV|||
2094 newUNOP_AUX||5.021007|
2095 newUNOP|||
2096 newWHENOP||5.009003|
2097 newWHILEOP||5.013007|
2098 newXS_deffile|||
2099 newXS_flags||5.009004|
2100 newXS_len_flags|||
2101 newXSproto||5.006000|
2102 newXS||5.006000|
2103 new_collate||5.006000|
2104 new_constant|||
2105 new_ctype||5.006000|
2106 new_he|||
2107 new_logop|||
2108 new_numeric||5.006000|
2109 new_stackinfo||5.005000|
2110 new_version||5.009000|
2111 new_warnings_bitfield|||
2112 next_symbol|||
2113 nextargv|||
2114 nextchar|||
2115 ninstr|||n
2116 no_bareword_allowed|||
2117 no_fh_allowed|||
2118 no_op|||
2119 noperl_die|||vn
2120 not_a_number|||
2121 not_incrementable|||
2122 nothreadhook||5.008000|
2123 nuke_stacks|||
2124 num_overflow|||n
2125 oopsAV|||
2126 oopsHV|||
2127 op_append_elem||5.013006|
2128 op_append_list||5.013006|
2129 op_clear|||
2130 op_contextualize||5.013006|
2131 op_convert_list||5.021006|
2132 op_dump||5.006000|
2133 op_free|||
2134 op_integerize|||
2135 op_linklist||5.013006|
2136 op_lvalue_flags|||
2137 op_lvalue||5.013007|
2138 op_null||5.007002|
2139 op_parent||5.021002|n
2140 op_prepend_elem||5.013006|
2141 op_refcnt_dec|||
2142 op_refcnt_inc|||
2143 op_refcnt_lock||5.009002|
2144 op_refcnt_unlock||5.009002|
2145 op_relocate_sv|||
2146 op_scope||5.013007|
2147 op_sibling_splice||5.021002|n
2148 op_std_init|||
2149 op_unscope|||
2150 open_script|||
2151 openn_cleanup|||
2152 openn_setup|||
2153 opmethod_stash|||
2154 opslab_force_free|||
2155 opslab_free_nopad|||
2156 opslab_free|||
2157 pMY_CXT_|5.007003||p
2158 pMY_CXT|5.007003||p
2159 pTHX_|5.006000||p
2160 pTHX|5.006000||p
2161 packWARN|5.007003||p
2162 pack_cat||5.007003|
2163 pack_rec|||
2164 package_version|||
2165 package|||
2166 packlist||5.008001|
2167 pad_add_anon||5.008001|
2168 pad_add_name_pvn||5.015001|
2169 pad_add_name_pvs||5.015001|
2170 pad_add_name_pv||5.015001|
2171 pad_add_name_sv||5.015001|
2172 pad_add_weakref|||
2173 pad_alloc_name|||
2174 pad_alloc|||
2175 pad_block_start|||
2176 pad_check_dup|||
2177 pad_compname_type||5.009003|
2178 pad_findlex|||
2179 pad_findmy_pvn||5.015001|
2180 pad_findmy_pvs||5.015001|
2181 pad_findmy_pv||5.015001|
2182 pad_findmy_sv||5.015001|
2183 pad_fixup_inner_anons|||
2184 pad_free|||
2185 pad_leavemy|||
2186 pad_new||5.008001|
2187 pad_push|||
2188 pad_reset|||
2189 pad_setsv|||
2190 pad_sv|||
2191 pad_swipe|||
2192 pad_tidy||5.008001|
2193 padlist_dup|||
2194 padlist_store|||
2195 padname_dup|||
2196 padname_free|||
2197 padnamelist_dup|||
2198 padnamelist_fetch||5.021007|n
2199 padnamelist_free|||
2200 padnamelist_store||5.021007|
2201 parse_arithexpr||5.013008|
2202 parse_barestmt||5.013007|
2203 parse_block||5.013007|
2204 parse_body|||
2205 parse_fullexpr||5.013008|
2206 parse_fullstmt||5.013005|
2207 parse_gv_stash_name|||
2208 parse_ident|||
2209 parse_label||5.013007|
2210 parse_listexpr||5.013008|
2211 parse_lparen_question_flags|||
2212 parse_stmtseq||5.013006|
2213 parse_subsignature|||
2214 parse_termexpr||5.013008|
2215 parse_unicode_opts|||
2216 parser_dup|||
2217 parser_free_nexttoke_ops|||
2218 parser_free|||
2219 path_is_searchable|||n
2220 peep|||
2221 pending_ident|||
2222 perl_alloc_using|||n
2223 perl_alloc|||n
2224 perl_clone_using|||n
2225 perl_clone|||n
2226 perl_construct|||n
2227 perl_destruct||5.007003|n
2228 perl_free|||n
2229 perl_parse||5.006000|n
2230 perl_run|||n
2231 pidgone|||
2232 pm_description|||
2233 pmop_dump||5.006000|
2234 pmruntime|||
2235 pmtrans|||
2236 pop_scope|||
2237 populate_ANYOF_from_invlist|||
2238 populate_isa|||v
2239 pregcomp||5.009005|
2240 pregexec|||
2241 pregfree2||5.011000|
2242 pregfree|||
2243 prescan_version||5.011004|
2244 printbuf|||
2245 printf_nocontext|||vn
2246 process_special_blocks|||
2247 ptr_hash|||n
2248 ptr_table_clear||5.009005|
2249 ptr_table_fetch||5.009005|
2250 ptr_table_find|||n
2251 ptr_table_free||5.009005|
2252 ptr_table_new||5.009005|
2253 ptr_table_split||5.009005|
2254 ptr_table_store||5.009005|
2255 push_scope|||
2256 put_charclass_bitmap_innards|||
2257 put_code_point|||
2258 put_range|||
2259 pv_display|5.006000||p
2260 pv_escape|5.009004||p
2261 pv_pretty|5.009004||p
2262 pv_uni_display||5.007003|
2263 qerror|||
2264 qsortsvu|||
2265 quadmath_format_needed|||n
2266 quadmath_format_single|||n
2267 re_compile||5.009005|
2268 re_croak2|||
2269 re_dup_guts|||
2270 re_intuit_start||5.019001|
2271 re_intuit_string||5.006000|
2272 re_op_compile|||
2273 realloc||5.007002|n
2274 reentrant_free||5.021008|
2275 reentrant_init||5.021008|
2276 reentrant_retry||5.021008|vn
2277 reentrant_size||5.021008|
2278 ref_array_or_hash|||
2279 refcounted_he_chain_2hv|||
2280 refcounted_he_fetch_pvn|||
2281 refcounted_he_fetch_pvs|||
2282 refcounted_he_fetch_pv|||
2283 refcounted_he_fetch_sv|||
2284 refcounted_he_free|||
2285 refcounted_he_inc|||
2286 refcounted_he_new_pvn|||
2287 refcounted_he_new_pvs|||
2288 refcounted_he_new_pv|||
2289 refcounted_he_new_sv|||
2290 refcounted_he_value|||
2291 refkids|||
2292 refto|||
2293 ref||5.021008|
2294 reg2Lanode|||
2295 reg_check_named_buff_matched|||n
2296 reg_named_buff_all||5.009005|
2297 reg_named_buff_exists||5.009005|
2298 reg_named_buff_fetch||5.009005|
2299 reg_named_buff_firstkey||5.009005|
2300 reg_named_buff_iter|||
2301 reg_named_buff_nextkey||5.009005|
2302 reg_named_buff_scalar||5.009005|
2303 reg_named_buff|||
2304 reg_node|||
2305 reg_numbered_buff_fetch|||
2306 reg_numbered_buff_length|||
2307 reg_numbered_buff_store|||
2308 reg_qr_package|||
2309 reg_recode|||
2310 reg_scan_name|||
2311 reg_skipcomment|||n
2312 reg_temp_copy|||
2313 reganode|||
2314 regatom|||
2315 regbranch|||
2316 regclass_swash||5.009004|
2317 regclass|||
2318 regcppop|||
2319 regcppush|||
2320 regcurly|||n
2321 regdump_extflags|||
2322 regdump_intflags|||
2323 regdump||5.005000|
2324 regdupe_internal|||
2325 regexec_flags||5.005000|
2326 regfree_internal||5.009005|
2327 reghop3|||n
2328 reghop4|||n
2329 reghopmaybe3|||n
2330 reginclass|||
2331 reginitcolors||5.006000|
2332 reginsert|||
2333 regmatch|||
2334 regnext||5.005000|
2335 regnode_guts|||
2336 regpatws|||n
2337 regpiece|||
2338 regpposixcc|||
2339 regprop|||
2340 regrepeat|||
2341 regtail_study|||
2342 regtail|||
2343 regtry|||
2344 reg|||
2345 repeatcpy|||n
2346 report_evil_fh|||
2347 report_redefined_cv|||
2348 report_uninit|||
2349 report_wrongway_fh|||
2350 require_pv||5.006000|
2351 require_tie_mod|||
2352 restore_magic|||
2353 rninstr|||n
2354 rpeep|||
2355 rsignal_restore|||
2356 rsignal_save|||
2357 rsignal_state||5.004000|
2358 rsignal||5.004000|
2359 run_body|||
2360 run_user_filter|||
2361 runops_debug||5.005000|
2362 runops_standard||5.005000|
2363 rv2cv_op_cv||5.013006|
2364 rvpv_dup|||
2365 rxres_free|||
2366 rxres_restore|||
2367 rxres_save|||
2368 safesyscalloc||5.006000|n
2369 safesysfree||5.006000|n
2370 safesysmalloc||5.006000|n
2371 safesysrealloc||5.006000|n
2372 same_dirent|||
2373 save_I16||5.004000|
2374 save_I32|||
2375 save_I8||5.006000|
2376 save_adelete||5.011000|
2377 save_aelem_flags||5.011000|
2378 save_aelem||5.004050|
2379 save_aliased_sv|||
2380 save_alloc||5.006000|
2381 save_aptr|||
2382 save_ary|||
2383 save_bool||5.008001|
2384 save_clearsv|||
2385 save_delete|||
2386 save_destructor_x||5.006000|
2387 save_destructor||5.006000|
2388 save_freeop|||
2389 save_freepv|||
2390 save_freesv|||
2391 save_generic_pvref||5.006001|
2392 save_generic_svref||5.005030|
2393 save_gp||5.004000|
2394 save_hash|||
2395 save_hdelete||5.011000|
2396 save_hek_flags|||n
2397 save_helem_flags||5.011000|
2398 save_helem||5.004050|
2399 save_hints||5.010001|
2400 save_hptr|||
2401 save_int|||
2402 save_item|||
2403 save_iv||5.005000|
2404 save_lines|||
2405 save_list|||
2406 save_long|||
2407 save_magic_flags|||
2408 save_mortalizesv||5.007001|
2409 save_nogv|||
2410 save_op||5.005000|
2411 save_padsv_and_mortalize||5.010001|
2412 save_pptr|||
2413 save_pushi32ptr||5.010001|
2414 save_pushptri32ptr|||
2415 save_pushptrptr||5.010001|
2416 save_pushptr||5.010001|
2417 save_re_context||5.006000|
2418 save_scalar_at|||
2419 save_scalar|||
2420 save_set_svflags||5.009000|
2421 save_shared_pvref||5.007003|
2422 save_sptr|||
2423 save_strlen|||
2424 save_svref|||
2425 save_vptr||5.006000|
2426 savepvn|||
2427 savepvs||5.009003|
2428 savepv|||
2429 savesharedpvn||5.009005|
2430 savesharedpvs||5.013006|
2431 savesharedpv||5.007003|
2432 savesharedsvpv||5.013006|
2433 savestack_grow_cnt||5.008001|
2434 savestack_grow|||
2435 savesvpv||5.009002|
2436 sawparens|||
2437 scalar_mod_type|||n
2438 scalarboolean|||
2439 scalarkids|||
2440 scalarseq|||
2441 scalarvoid|||
2442 scalar|||
2443 scan_bin||5.006000|
2444 scan_commit|||
2445 scan_const|||
2446 scan_formline|||
2447 scan_heredoc|||
2448 scan_hex|||
2449 scan_ident|||
2450 scan_inputsymbol|||
2451 scan_num||5.007001|
2452 scan_oct|||
2453 scan_pat|||
2454 scan_str|||
2455 scan_subst|||
2456 scan_trans|||
2457 scan_version||5.009001|
2458 scan_vstring||5.009005|
2459 scan_word|||
2460 search_const|||
2461 seed||5.008001|
2462 sequence_num|||
2463 set_ANYOF_arg|||
2464 set_caret_X|||
2465 set_context||5.006000|n
2466 set_numeric_local||5.006000|
2467 set_numeric_radix||5.006000|
2468 set_numeric_standard||5.006000|
2469 set_padlist|||n
2470 setdefout|||
2471 share_hek_flags|||
2472 share_hek||5.004000|
2473 should_warn_nl|||n
2474 si_dup|||
2475 sighandler|||n
2476 simplify_sort|||
2477 skipspace_flags|||
2478 softref2xv|||
2479 sortcv_stacked|||
2480 sortcv_xsub|||
2481 sortcv|||
2482 sortsv_flags||5.009003|
2483 sortsv||5.007003|
2484 space_join_names_mortal|||
2485 ss_dup|||
2486 ssc_add_range|||
2487 ssc_and|||
2488 ssc_anything|||
2489 ssc_clear_locale|||n
2490 ssc_cp_and|||
2491 ssc_finalize|||
2492 ssc_init|||
2493 ssc_intersection|||
2494 ssc_is_anything|||n
2495 ssc_is_cp_posixl_init|||n
2496 ssc_or|||
2497 ssc_union|||
2498 stack_grow|||
2499 start_glob|||
2500 start_subparse||5.004000|
2501 stdize_locale|||
2502 strEQ|||
2503 strGE|||
2504 strGT|||
2505 strLE|||
2506 strLT|||
2507 strNE|||
2508 str_to_version||5.006000|
2509 strip_return|||
2510 strnEQ|||
2511 strnNE|||
2512 study_chunk|||
2513 sub_crush_depth|||
2514 sublex_done|||
2515 sublex_push|||
2516 sublex_start|||
2517 sv_2bool_flags||5.013006|
2518 sv_2bool|||
2519 sv_2cv|||
2520 sv_2io|||
2521 sv_2iuv_common|||
2522 sv_2iuv_non_preserve|||
2523 sv_2iv_flags||5.009001|
2524 sv_2iv|||
2525 sv_2mortal|||
2526 sv_2num|||
2527 sv_2nv_flags||5.013001|
2528 sv_2pv_flags|5.007002||p
2529 sv_2pv_nolen|5.006000||p
2530 sv_2pvbyte_nolen|5.006000||p
2531 sv_2pvbyte|5.006000||p
2532 sv_2pvutf8_nolen||5.006000|
2533 sv_2pvutf8||5.006000|
2534 sv_2pv|||
2535 sv_2uv_flags||5.009001|
2536 sv_2uv|5.004000||p
2537 sv_add_arena|||
2538 sv_add_backref|||
2539 sv_backoff|||n
2540 sv_bless|||
2541 sv_buf_to_ro|||
2542 sv_buf_to_rw|||
2543 sv_cat_decode||5.008001|
2544 sv_catpv_flags||5.013006|
2545 sv_catpv_mg|5.004050||p
2546 sv_catpv_nomg||5.013006|
2547 sv_catpvf_mg_nocontext|||pvn
2548 sv_catpvf_mg|5.006000|5.004000|pv
2549 sv_catpvf_nocontext|||vn
2550 sv_catpvf||5.004000|v
2551 sv_catpvn_flags||5.007002|
2552 sv_catpvn_mg|5.004050||p
2553 sv_catpvn_nomg|5.007002||p
2554 sv_catpvn|||
2555 sv_catpvs_flags||5.013006|
2556 sv_catpvs_mg||5.013006|
2557 sv_catpvs_nomg||5.013006|
2558 sv_catpvs|5.009003||p
2559 sv_catpv|||
2560 sv_catsv_flags||5.007002|
2561 sv_catsv_mg|5.004050||p
2562 sv_catsv_nomg|5.007002||p
2563 sv_catsv|||
2564 sv_chop|||
2565 sv_clean_all|||
2566 sv_clean_objs|||
2567 sv_clear|||
2568 sv_cmp_flags||5.013006|
2569 sv_cmp_locale_flags||5.013006|
2570 sv_cmp_locale||5.004000|
2571 sv_cmp|||
2572 sv_collxfrm_flags||5.013006|
2573 sv_collxfrm|||
2574 sv_copypv_flags||5.017002|
2575 sv_copypv_nomg||5.017002|
2576 sv_copypv|||
2577 sv_dec_nomg||5.013002|
2578 sv_dec|||
2579 sv_del_backref|||
2580 sv_derived_from_pvn||5.015004|
2581 sv_derived_from_pv||5.015004|
2582 sv_derived_from_sv||5.015004|
2583 sv_derived_from||5.004000|
2584 sv_destroyable||5.010000|
2585 sv_display|||
2586 sv_does_pvn||5.015004|
2587 sv_does_pv||5.015004|
2588 sv_does_sv||5.015004|
2589 sv_does||5.009004|
2590 sv_dump|||
2591 sv_dup_common|||
2592 sv_dup_inc_multiple|||
2593 sv_dup_inc|||
2594 sv_dup|||
2595 sv_eq_flags||5.013006|
2596 sv_eq|||
2597 sv_exp_grow|||
2598 sv_force_normal_flags||5.007001|
2599 sv_force_normal||5.006000|
2600 sv_free2|||
2601 sv_free_arenas|||
2602 sv_free|||
2603 sv_get_backrefs||5.021008|n
2604 sv_gets||5.003070|
2605 sv_grow|||
2606 sv_i_ncmp|||
2607 sv_inc_nomg||5.013002|
2608 sv_inc|||
2609 sv_insert_flags||5.010001|
2610 sv_insert|||
2611 sv_isa|||
2612 sv_isobject|||
2613 sv_iv||5.005000|
2614 sv_kill_backrefs|||
2615 sv_len_utf8_nomg|||
2616 sv_len_utf8||5.006000|
2617 sv_len|||
2618 sv_magic_portable|5.021008|5.004000|p
2619 sv_magicext_mglob|||
2620 sv_magicext||5.007003|
2621 sv_magic|||
2622 sv_mortalcopy_flags|||
2623 sv_mortalcopy|||
2624 sv_ncmp|||
2625 sv_newmortal|||
2626 sv_newref|||
2627 sv_nolocking||5.007003|
2628 sv_nosharing||5.007003|
2629 sv_nounlocking|||
2630 sv_nv||5.005000|
2631 sv_only_taint_gmagic|||n
2632 sv_or_pv_pos_u2b|||
2633 sv_peek||5.005000|
2634 sv_pos_b2u_flags||5.019003|
2635 sv_pos_b2u_midway|||
2636 sv_pos_b2u||5.006000|
2637 sv_pos_u2b_cached|||
2638 sv_pos_u2b_flags||5.011005|
2639 sv_pos_u2b_forwards|||n
2640 sv_pos_u2b_midway|||n
2641 sv_pos_u2b||5.006000|
2642 sv_pvbyten_force||5.006000|
2643 sv_pvbyten||5.006000|
2644 sv_pvbyte||5.006000|
2645 sv_pvn_force_flags|5.007002||p
2646 sv_pvn_force|||
2647 sv_pvn_nomg|5.007003|5.005000|p
2648 sv_pvn||5.005000|
2649 sv_pvutf8n_force||5.006000|
2650 sv_pvutf8n||5.006000|
2651 sv_pvutf8||5.006000|
2652 sv_pv||5.006000|
2653 sv_recode_to_utf8||5.007003|
2654 sv_reftype|||
2655 sv_ref|||
2656 sv_release_COW|||
2657 sv_replace|||
2658 sv_report_used|||
2659 sv_resetpvn|||
2660 sv_reset|||
2661 sv_rvweaken||5.006000|
2662 sv_sethek|||
2663 sv_setiv_mg|5.004050||p
2664 sv_setiv|||
2665 sv_setnv_mg|5.006000||p
2666 sv_setnv|||
2667 sv_setpv_mg|5.004050||p
2668 sv_setpvf_mg_nocontext|||pvn
2669 sv_setpvf_mg|5.006000|5.004000|pv
2670 sv_setpvf_nocontext|||vn
2671 sv_setpvf||5.004000|v
2672 sv_setpviv_mg||5.008001|
2673 sv_setpviv||5.008001|
2674 sv_setpvn_mg|5.004050||p
2675 sv_setpvn|||
2676 sv_setpvs_mg||5.013006|
2677 sv_setpvs|5.009004||p
2678 sv_setpv|||
2679 sv_setref_iv|||
2680 sv_setref_nv|||
2681 sv_setref_pvn|||
2682 sv_setref_pvs||5.021008|
2683 sv_setref_pv|||
2684 sv_setref_uv||5.007001|
2685 sv_setsv_cow|||
2686 sv_setsv_flags||5.007002|
2687 sv_setsv_mg|5.004050||p
2688 sv_setsv_nomg|5.007002||p
2689 sv_setsv|||
2690 sv_setuv_mg|5.004050||p
2691 sv_setuv|5.004000||p
2692 sv_tainted||5.004000|
2693 sv_taint||5.004000|
2694 sv_true||5.005000|
2695 sv_unglob|||
2696 sv_uni_display||5.007003|
2697 sv_unmagicext|5.013008||p
2698 sv_unmagic|||
2699 sv_unref_flags||5.007001|
2700 sv_unref|||
2701 sv_untaint||5.004000|
2702 sv_upgrade|||
2703 sv_usepvn_flags||5.009004|
2704 sv_usepvn_mg|5.004050||p
2705 sv_usepvn|||
2706 sv_utf8_decode||5.006000|
2707 sv_utf8_downgrade||5.006000|
2708 sv_utf8_encode||5.006000|
2709 sv_utf8_upgrade_flags_grow||5.011000|
2710 sv_utf8_upgrade_flags||5.007002|
2711 sv_utf8_upgrade_nomg||5.007002|
2712 sv_utf8_upgrade||5.007001|
2713 sv_uv|5.005000||p
2714 sv_vcatpvf_mg|5.006000|5.004000|p
2715 sv_vcatpvfn_flags||5.017002|
2716 sv_vcatpvfn||5.004000|
2717 sv_vcatpvf|5.006000|5.004000|p
2718 sv_vsetpvf_mg|5.006000|5.004000|p
2719 sv_vsetpvfn||5.004000|
2720 sv_vsetpvf|5.006000|5.004000|p
2721 svtype|||
2722 swallow_bom|||
2723 swash_fetch||5.007002|
2724 swash_init||5.006000|
2725 swash_scan_list_line|||
2726 swatch_get|||
2727 sync_locale||5.021004|
2728 sys_init3||5.010000|n
2729 sys_init||5.010000|n
2730 sys_intern_clear|||
2731 sys_intern_dup|||
2732 sys_intern_init|||
2733 sys_term||5.010000|n
2734 taint_env|||
2735 taint_proper|||
2736 tied_method|||v
2737 tmps_grow_p|||
2738 toFOLD_uni||5.007003|
2739 toFOLD_utf8||5.019001|
2740 toFOLD||5.019001|
2741 toLOWER_L1||5.019001|
2742 toLOWER_LC||5.004000|
2743 toLOWER_uni||5.007003|
2744 toLOWER_utf8||5.015007|
2745 toLOWER|||
2746 toTITLE_uni||5.007003|
2747 toTITLE_utf8||5.015007|
2748 toTITLE||5.019001|
2749 toUPPER_uni||5.007003|
2750 toUPPER_utf8||5.015007|
2751 toUPPER|||
2752 to_byte_substr|||
2753 to_lower_latin1|||n
2754 to_uni_fold||5.007003|
2755 to_uni_lower_lc||5.006000|
2756 to_uni_lower||5.007003|
2757 to_uni_title_lc||5.006000|
2758 to_uni_title||5.007003|
2759 to_uni_upper_lc||5.006000|
2760 to_uni_upper||5.007003|
2761 to_utf8_case||5.007003|
2762 to_utf8_fold||5.015007|
2763 to_utf8_lower||5.015007|
2764 to_utf8_substr|||
2765 to_utf8_title||5.015007|
2766 to_utf8_upper||5.015007|
2767 tokenize_use|||
2768 tokeq|||
2769 tokereport|||
2770 too_few_arguments_pv|||
2771 too_many_arguments_pv|||
2772 translate_substr_offsets|||n
2773 try_amagic_bin|||
2774 try_amagic_un|||
2775 uiv_2buf|||n
2776 unlnk|||
2777 unpack_rec|||
2778 unpack_str||5.007003|
2779 unpackstring||5.008001|
2780 unreferenced_to_tmp_stack|||
2781 unshare_hek_or_pvn|||
2782 unshare_hek|||
2783 unsharepvn||5.003070|
2784 unwind_handler_stack|||
2785 update_debugger_info|||
2786 upg_version||5.009005|
2787 usage|||
2788 utf16_textfilter|||
2789 utf16_to_utf8_reversed||5.006001|
2790 utf16_to_utf8||5.006001|
2791 utf8_distance||5.006000|
2792 utf8_hop||5.006000|n
2793 utf8_length||5.007001|
2794 utf8_mg_len_cache_update|||
2795 utf8_mg_pos_cache_update|||
2796 utf8_to_bytes||5.006001|
2797 utf8_to_uvchr_buf||5.015009|
2798 utf8_to_uvchr||5.007001|
2799 utf8_to_uvuni_buf||5.015009|
2800 utf8_to_uvuni||5.007001|
2801 utf8n_to_uvchr||5.007001|
2802 utf8n_to_uvuni||5.007001|
2803 utilize|||
2804 uvchr_to_utf8_flags||5.007003|
2805 uvchr_to_utf8||5.007001|
2806 uvoffuni_to_utf8_flags||5.019004|
2807 uvuni_to_utf8_flags||5.007003|
2808 uvuni_to_utf8||5.007001|
2809 valid_utf8_to_uvchr||5.015009|
2810 valid_utf8_to_uvuni||5.015009|
2811 validate_proto|||
2812 validate_suid|||
2813 varname|||
2814 vcmp||5.009000|
2815 vcroak||5.006000|
2816 vdeb||5.007003|
2817 vform||5.006000|
2818 visit|||
2819 vivify_defelem|||
2820 vivify_ref|||
2821 vload_module|5.006000||p
2822 vmess||5.006000|
2823 vnewSVpvf|5.006000|5.004000|p
2824 vnormal||5.009002|
2825 vnumify||5.009000|
2826 vstringify||5.009000|
2827 vverify||5.009003|
2828 vwarner||5.006000|
2829 vwarn||5.006000|
2830 wait4pid|||
2831 warn_nocontext|||vn
2832 warn_sv||5.013001|
2833 warner_nocontext|||vn
2834 warner|5.006000|5.004000|pv
2835 warn|||v
2836 was_lvalue_sub|||
2837 watch|||
2838 whichsig_pvn||5.015004|
2839 whichsig_pv||5.015004|
2840 whichsig_sv||5.015004|
2841 whichsig|||
2842 win32_croak_not_implemented|||n
2843 with_queued_errors|||
2844 wrap_op_checker||5.015008|
2845 write_to_stderr|||
2846 xs_boot_epilog|||
2847 xs_handshake|||vn
2848 xs_version_bootcheck|||
2849 yyerror_pvn|||
2850 yyerror_pv|||
2851 yyerror|||
2852 yylex|||
2853 yyparse|||
2854 yyunlex|||
2855 yywarn|||
2856 );
2857
2858 if (exists $opt{'list-unsupported'}) {
2859 my $f;
2860 for $f (sort { lc $a cmp lc $b } keys %API) {
2861 next unless $API{$f}{todo};
2862 print "$f ", '.'x(40-length($f)), " ", format_version($API{$f}{todo}), "\n";
2863 }
2864 exit 0;
2865 }
2866
2867 # Scan for possible replacement candidates
2868
2869 my(%replace, %need, %hints, %warnings, %depends);
2870 my $replace = 0;
2871 my($hint, $define, $function);
2872
2873 sub find_api
2874 {
2875 my $code = shift;
2876 $code =~ s{
2877 / (?: \*[^*]*\*+(?:[^$ccs][^*]*\*+)* / | /[^\r\n]*)
2878 | "[^"\\]*(?:\\.[^"\\]*)*"
2879 | '[^'\\]*(?:\\.[^'\\]*)*' }{}egsx;
2880 grep { exists $API{$_} } $code =~ /(\w+)/mg;
2881 }
2882
2883 while (<DATA>) {
2884 if ($hint) {
2885 my $h = $hint->[0] eq 'Hint' ? \%hints : \%warnings;
2886 if (m{^\s*\*\s(.*?)\s*$}) {
2887 for (@{$hint->[1]}) {
2888 $h->{$_} ||= ''; # suppress warning with older perls
2889 $h->{$_} .= "$1\n";
2890 }
2891 }
2892 else { undef $hint }
2893 }
2894
2895 $hint = [$1, [split /,?\s+/, $2]]
2896 if m{^\s*$rccs\s+(Hint|Warning):\s+(\w+(?:,?\s+\w+)*)\s*$};
2897
2898 if ($define) {
2899 if ($define->[1] =~ /\\$/) {
2900 $define->[1] .= $_;
2901 }
2902 else {
2903 if (exists $API{$define->[0]} && $define->[1] !~ /^DPPP_\(/) {
2904 my @n = find_api($define->[1]);
2905 push @{$depends{$define->[0]}}, @n if @n
2906 }
2907 undef $define;
2908 }
2909 }
2910
2911 $define = [$1, $2] if m{^\s*#\s*define\s+(\w+)(?:\([^)]*\))?\s+(.*)};
2912
2913 if ($function) {
2914 if (/^}/) {
2915 if (exists $API{$function->[0]}) {
2916 my @n = find_api($function->[1]);
2917 push @{$depends{$function->[0]}}, @n if @n
2918 }
2919 undef $function;
2920 }
2921 else {
2922 $function->[1] .= $_;
2923 }
2924 }
2925
2926 $function = [$1, ''] if m{^DPPP_\(my_(\w+)\)};
2927
2928 $replace = $1 if m{^\s*$rccs\s+Replace:\s+(\d+)\s+$rcce\s*$};
2929 $replace{$2} = $1 if $replace and m{^\s*#\s*define\s+(\w+)(?:\([^)]*\))?\s+(\w+)};
2930 $replace{$2} = $1 if m{^\s*#\s*define\s+(\w+)(?:\([^)]*\))?\s+(\w+).*$rccs\s+Replace\s+$rcce};
2931 $replace{$1} = $2 if m{^\s*$rccs\s+Replace (\w+) with (\w+)\s+$rcce\s*$};
2932
2933 if (m{^\s*$rccs\s+(\w+(\s*,\s*\w+)*)\s+depends\s+on\s+(\w+(\s*,\s*\w+)*)\s+$rcce\s*$}) {
2934 my @deps = map { s/\s+//g; $_ } split /,/, $3;
2935 my $d;
2936 for $d (map { s/\s+//g; $_ } split /,/, $1) {
2937 push @{$depends{$d}}, @deps;
2938 }
2939 }
2940
2941 $need{$1} = 1 if m{^#if\s+defined\(NEED_(\w+)(?:_GLOBAL)?\)};
2942 }
2943
2944 for (values %depends) {
2945 my %s;
2946 $_ = [sort grep !$s{$_}++, @$_];
2947 }
2948
2949 if (exists $opt{'api-info'}) {
2950 my $f;
2951 my $count = 0;
2952 my $match = $opt{'api-info'} =~ m!^/(.*)/$! ? $1 : "^\Q$opt{'api-info'}\E\$";
2953 for $f (sort { lc $a cmp lc $b } keys %API) {
2954 next unless $f =~ /$match/;
2955 print "\n=== $f ===\n\n";
2956 my $info = 0;
2957 if ($API{$f}{base} || $API{$f}{todo}) {
2958 my $base = format_version($API{$f}{base} || $API{$f}{todo});
2959 print "Supported at least starting from perl-$base.\n";
2960 $info++;
2961 }
2962 if ($API{$f}{provided}) {
2963 my $todo = $API{$f}{todo} ? format_version($API{$f}{todo}) : "5.003";
2964 print "Support by $ppport provided back to perl-$todo.\n";
2965 print "Support needs to be explicitly requested by NEED_$f.\n" if exists $need{$f};
2966 print "Depends on: ", join(', ', @{$depends{$f}}), ".\n" if exists $depends{$f};
2967 print "\n$hints{$f}" if exists $hints{$f};
2968 print "\nWARNING:\n$warnings{$f}" if exists $warnings{$f};
2969 $info++;
2970 }
2971 print "No portability information available.\n" unless $info;
2972 $count++;
2973 }
2974 $count or print "Found no API matching '$opt{'api-info'}'.";
2975 print "\n";
2976 exit 0;
2977 }
2978
2979 if (exists $opt{'list-provided'}) {
2980 my $f;
2981 for $f (sort { lc $a cmp lc $b } keys %API) {
2982 next unless $API{$f}{provided};
2983 my @flags;
2984 push @flags, 'explicit' if exists $need{$f};
2985 push @flags, 'depend' if exists $depends{$f};
2986 push @flags, 'hint' if exists $hints{$f};
2987 push @flags, 'warning' if exists $warnings{$f};
2988 my $flags = @flags ? ' ['.join(', ', @flags).']' : '';
2989 print "$f$flags\n";
2990 }
2991 exit 0;
2992 }
2993
2994 my @files;
2995 my @srcext = qw( .xs .c .h .cc .cpp -c.inc -xs.inc );
2996 my $srcext = join '|', map { quotemeta $_ } @srcext;
2997
2998 if (@ARGV) {
2999 my %seen;
3000 for (@ARGV) {
3001 if (-e) {
3002 if (-f) {
3003 push @files, $_ unless $seen{$_}++;
3004 }
3005 else { warn "'$_' is not a file.\n" }
3006 }
3007 else {
3008 my @new = grep { -f } glob $_
3009 or warn "'$_' does not exist.\n";
3010 push @files, grep { !$seen{$_}++ } @new;
3011 }
3012 }
3013 }
3014 else {
3015 eval {
3016 require File::Find;
3017 File::Find::find(sub {
3018 $File::Find::name =~ /($srcext)$/i
3019 and push @files, $File::Find::name;
3020 }, '.');
3021 };
3022 if ($@) {
3023 @files = map { glob "*$_" } @srcext;
3024 }
3025 }
3026
3027 if (!@ARGV || $opt{filter}) {
3028 my(@in, @out);
3029 my %xsc = map { /(.*)\.xs$/ ? ("$1.c" => 1, "$1.cc" => 1) : () } @files;
3030 for (@files) {
3031 my $out = exists $xsc{$_} || /\b\Q$ppport\E$/i || !/($srcext)$/i;
3032 push @{ $out ? \@out : \@in }, $_;
3033 }
3034 if (@ARGV && @out) {
3035 warning("Skipping the following files (use --nofilter to avoid this):\n| ", join "\n| ", @out);
3036 }
3037 @files = @in;
3038 }
3039
3040 die "No input files given!\n" unless @files;
3041
3042 my(%files, %global, %revreplace);
3043 %revreplace = reverse %replace;
3044 my $filename;
3045 my $patch_opened = 0;
3046
3047 for $filename (@files) {
3048 unless (open IN, "<$filename") {
3049 warn "Unable to read from $filename: $!\n";
3050 next;
3051 }
3052
3053 info("Scanning $filename ...");
3054
3055 my $c = do { local $/; <IN> };
3056 close IN;
3057
3058 my %file = (orig => $c, changes => 0);
3059
3060 # Temporarily remove C/XS comments and strings from the code
3061 my @ccom;
3062
3063 $c =~ s{
3064 ( ^$HS*\#$HS*include\b[^\r\n]+\b(?:\Q$ppport\E|XSUB\.h)\b[^\r\n]*
3065 | ^$HS*\#$HS*(?:define|elif|if(?:def)?)\b[^\r\n]* )
3066 | ( ^$HS*\#[^\r\n]*
3067 | "[^"\\]*(?:\\.[^"\\]*)*"
3068 | '[^'\\]*(?:\\.[^'\\]*)*'
3069 | / (?: \*[^*]*\*+(?:[^$ccs][^*]*\*+)* / | /[^\r\n]* ) )
3070 }{ defined $2 and push @ccom, $2;
3071 defined $1 ? $1 : "$ccs$#ccom$cce" }mgsex;
3072
3073 $file{ccom} = \@ccom;
3074 $file{code} = $c;
3075 $file{has_inc_ppport} = $c =~ /^$HS*#$HS*include[^\r\n]+\b\Q$ppport\E\b/m;
3076
3077 my $func;
3078
3079 for $func (keys %API) {
3080 my $match = $func;
3081 $match .= "|$revreplace{$func}" if exists $revreplace{$func};
3082 if ($c =~ /\b(?:Perl_)?($match)\b/) {
3083 $file{uses_replace}{$1}++ if exists $revreplace{$func} && $1 eq $revreplace{$func};
3084 $file{uses_Perl}{$func}++ if $c =~ /\bPerl_$func\b/;
3085 if (exists $API{$func}{provided}) {
3086 $file{uses_provided}{$func}++;
3087 if (!exists $API{$func}{base} || $API{$func}{base} > $opt{'compat-version'}) {
3088 $file{uses}{$func}++;
3089 my @deps = rec_depend($func);
3090 if (@deps) {
3091 $file{uses_deps}{$func} = \@deps;
3092 for (@deps) {
3093 $file{uses}{$_} = 0 unless exists $file{uses}{$_};
3094 }
3095 }
3096 for ($func, @deps) {
3097 $file{needs}{$_} = 'static' if exists $need{$_};
3098 }
3099 }
3100 }
3101 if (exists $API{$func}{todo} && $API{$func}{todo} > $opt{'compat-version'}) {
3102 if ($c =~ /\b$func\b/) {
3103 $file{uses_todo}{$func}++;
3104 }
3105 }
3106 }
3107 }
3108
3109 while ($c =~ /^$HS*#$HS*define$HS+(NEED_(\w+?)(_GLOBAL)?)\b/mg) {
3110 if (exists $need{$2}) {
3111 $file{defined $3 ? 'needed_global' : 'needed_static'}{$2}++;
3112 }
3113 else { warning("Possibly wrong #define $1 in $filename") }
3114 }
3115
3116 for (qw(uses needs uses_todo needed_global needed_static)) {
3117 for $func (keys %{$file{$_}}) {
3118 push @{$global{$_}{$func}}, $filename;
3119 }
3120 }
3121
3122 $files{$filename} = \%file;
3123 }
3124
3125 # Globally resolve NEED_'s
3126 my $need;
3127 for $need (keys %{$global{needs}}) {
3128 if (@{$global{needs}{$need}} > 1) {
3129 my @targets = @{$global{needs}{$need}};
3130 my @t = grep $files{$_}{needed_global}{$need}, @targets;
3131 @targets = @t if @t;
3132 @t = grep /\.xs$/i, @targets;
3133 @targets = @t if @t;
3134 my $target = shift @targets;
3135 $files{$target}{needs}{$need} = 'global';
3136 for (@{$global{needs}{$need}}) {
3137 $files{$_}{needs}{$need} = 'extern' if $_ ne $target;
3138 }
3139 }
3140 }
3141
3142 for $filename (@files) {
3143 exists $files{$filename} or next;
3144
3145 info("=== Analyzing $filename ===");
3146
3147 my %file = %{$files{$filename}};
3148 my $func;
3149 my $c = $file{code};
3150 my $warnings = 0;
3151
3152 for $func (sort keys %{$file{uses_Perl}}) {
3153 if ($API{$func}{varargs}) {
3154 unless ($API{$func}{nothxarg}) {
3155 my $changes = ($c =~ s{\b(Perl_$func\s*\(\s*)(?!aTHX_?)(\)|[^\s)]*\))}
3156 { $1 . ($2 eq ')' ? 'aTHX' : 'aTHX_ ') . $2 }ge);
3157 if ($changes) {
3158 warning("Doesn't pass interpreter argument aTHX to Perl_$func");
3159 $file{changes} += $changes;
3160 }
3161 }
3162 }
3163 else {
3164 warning("Uses Perl_$func instead of $func");
3165 $file{changes} += ($c =~ s{\bPerl_$func(\s*)\((\s*aTHX_?)?\s*}
3166 {$func$1(}g);
3167 }
3168 }
3169
3170 for $func (sort keys %{$file{uses_replace}}) {
3171 warning("Uses $func instead of $replace{$func}");
3172 $file{changes} += ($c =~ s/\b$func\b/$replace{$func}/g);
3173 }
3174
3175 for $func (sort keys %{$file{uses_provided}}) {
3176 if ($file{uses}{$func}) {
3177 if (exists $file{uses_deps}{$func}) {
3178 diag("Uses $func, which depends on ", join(', ', @{$file{uses_deps}{$func}}));
3179 }
3180 else {
3181 diag("Uses $func");
3182 }
3183 }
3184 $warnings += hint($func);
3185 }
3186
3187 unless ($opt{quiet}) {
3188 for $func (sort keys %{$file{uses_todo}}) {
3189 print "*** WARNING: Uses $func, which may not be portable below perl ",
3190 format_version($API{$func}{todo}), ", even with '$ppport'\n";
3191 $warnings++;
3192 }
3193 }
3194
3195 for $func (sort keys %{$file{needed_static}}) {
3196 my $message = '';
3197 if (not exists $file{uses}{$func}) {
3198 $message = "No need to define NEED_$func if $func is never used";
3199 }
3200 elsif (exists $file{needs}{$func} && $file{needs}{$func} ne 'static') {
3201 $message = "No need to define NEED_$func when already needed globally";
3202 }
3203 if ($message) {
3204 diag($message);
3205 $file{changes} += ($c =~ s/^$HS*#$HS*define$HS+NEED_$func\b.*$LF//mg);
3206 }
3207 }
3208
3209 for $func (sort keys %{$file{needed_global}}) {
3210 my $message = '';
3211 if (not exists $global{uses}{$func}) {
3212 $message = "No need to define NEED_${func}_GLOBAL if $func is never used";
3213 }
3214 elsif (exists $file{needs}{$func}) {
3215 if ($file{needs}{$func} eq 'extern') {
3216 $message = "No need to define NEED_${func}_GLOBAL when already needed globally";
3217 }
3218 elsif ($file{needs}{$func} eq 'static') {
3219 $message = "No need to define NEED_${func}_GLOBAL when only used in this file";
3220 }
3221 }
3222 if ($message) {
3223 diag($message);
3224 $file{changes} += ($c =~ s/^$HS*#$HS*define$HS+NEED_${func}_GLOBAL\b.*$LF//mg);
3225 }
3226 }
3227
3228 $file{needs_inc_ppport} = keys %{$file{uses}};
3229
3230 if ($file{needs_inc_ppport}) {
3231 my $pp = '';
3232
3233 for $func (sort keys %{$file{needs}}) {
3234 my $type = $file{needs}{$func};
3235 next if $type eq 'extern';
3236 my $suffix = $type eq 'global' ? '_GLOBAL' : '';
3237 unless (exists $file{"needed_$type"}{$func}) {
3238 if ($type eq 'global') {
3239 diag("Files [@{$global{needs}{$func}}] need $func, adding global request");
3240 }
3241 else {
3242 diag("File needs $func, adding static request");
3243 }
3244 $pp .= "#define NEED_$func$suffix\n";
3245 }
3246 }
3247
3248 if ($pp && ($c =~ s/^(?=$HS*#$HS*define$HS+NEED_\w+)/$pp/m)) {
3249 $pp = '';
3250 $file{changes}++;
3251 }
3252
3253 unless ($file{has_inc_ppport}) {
3254 diag("Needs to include '$ppport'");
3255 $pp .= qq(#include "$ppport"\n)
3256 }
3257
3258 if ($pp) {
3259 $file{changes} += ($c =~ s/^($HS*#$HS*define$HS+NEED_\w+.*?)^/$1$pp/ms)
3260 || ($c =~ s/^(?=$HS*#$HS*include.*\Q$ppport\E)/$pp/m)
3261 || ($c =~ s/^($HS*#$HS*include.*XSUB.*\s*?)^/$1$pp/m)
3262 || ($c =~ s/^/$pp/);
3263 }
3264 }
3265 else {
3266 if ($file{has_inc_ppport}) {
3267 diag("No need to include '$ppport'");
3268 $file{changes} += ($c =~ s/^$HS*?#$HS*include.*\Q$ppport\E.*?$LF//m);
3269 }
3270 }
3271
3272 # put back in our C comments
3273 my $ix;
3274 my $cppc = 0;
3275 my @ccom = @{$file{ccom}};
3276 for $ix (0 .. $#ccom) {
3277 if (!$opt{cplusplus} && $ccom[$ix] =~ s!^//!!) {
3278 $cppc++;
3279 $file{changes} += $c =~ s/$rccs$ix$rcce/$ccs$ccom[$ix] $cce/;
3280 }
3281 else {
3282 $c =~ s/$rccs$ix$rcce/$ccom[$ix]/;
3283 }
3284 }
3285
3286 if ($cppc) {
3287 my $s = $cppc != 1 ? 's' : '';
3288 warning("Uses $cppc C++ style comment$s, which is not portable");
3289 }
3290
3291 my $s = $warnings != 1 ? 's' : '';
3292 my $warn = $warnings ? " ($warnings warning$s)" : '';
3293 info("Analysis completed$warn");
3294
3295 if ($file{changes}) {
3296 if (exists $opt{copy}) {
3297 my $newfile = "$filename$opt{copy}";
3298 if (-e $newfile) {
3299 error("'$newfile' already exists, refusing to write copy of '$filename'");
3300 }
3301 else {
3302 local *F;
3303 if (open F, ">$newfile") {
3304 info("Writing copy of '$filename' with changes to '$newfile'");
3305 print F $c;
3306 close F;
3307 }
3308 else {
3309 error("Cannot open '$newfile' for writing: $!");
3310 }
3311 }
3312 }
3313 elsif (exists $opt{patch} || $opt{changes}) {
3314 if (exists $opt{patch}) {
3315 unless ($patch_opened) {
3316 if (open PATCH, ">$opt{patch}") {
3317 $patch_opened = 1;
3318 }
3319 else {
3320 error("Cannot open '$opt{patch}' for writing: $!");
3321 delete $opt{patch};
3322 $opt{changes} = 1;
3323 goto fallback;
3324 }
3325 }
3326 mydiff(\*PATCH, $filename, $c);
3327 }
3328 else {
3329 fallback:
3330 info("Suggested changes:");
3331 mydiff(\*STDOUT, $filename, $c);
3332 }
3333 }
3334 else {
3335 my $s = $file{changes} == 1 ? '' : 's';
3336 info("$file{changes} potentially required change$s detected");
3337 }
3338 }
3339 else {
3340 info("Looks good");
3341 }
3342 }
3343
3344 close PATCH if $patch_opened;
3345
3346 exit 0;
3347
3348
3349 sub try_use { eval "use @_;"; return $@ eq '' }
3350
3351 sub mydiff
3352 {
3353 local *F = shift;
3354 my($file, $str) = @_;
3355 my $diff;
3356
3357 if (exists $opt{diff}) {
3358 $diff = run_diff($opt{diff}, $file, $str);
3359 }
3360
3361 if (!defined $diff and try_use('Text::Diff')) {
3362 $diff = Text::Diff::diff($file, \$str, { STYLE => 'Unified' });
3363 $diff = <<HEADER . $diff;
3364 --- $file
3365 +++ $file.patched
3366 HEADER
3367 }
3368
3369 if (!defined $diff) {
3370 $diff = run_diff('diff -u', $file, $str);
3371 }
3372
3373 if (!defined $diff) {
3374 $diff = run_diff('diff', $file, $str);
3375 }
3376
3377 if (!defined $diff) {
3378 error("Cannot generate a diff. Please install Text::Diff or use --copy.");
3379 return;
3380 }
3381
3382 print F $diff;
3383 }
3384
3385 sub run_diff
3386 {
3387 my($prog, $file, $str) = @_;
3388 my $tmp = 'dppptemp';
3389 my $suf = 'aaa';
3390 my $diff = '';
3391 local *F;
3392
3393 while (-e "$tmp.$suf") { $suf++ }
3394 $tmp = "$tmp.$suf";
3395
3396 if (open F, ">$tmp") {
3397 print F $str;
3398 close F;
3399
3400 if (open F, "$prog $file $tmp |") {
3401 while (<F>) {
3402 s/\Q$tmp\E/$file.patched/;
3403 $diff .= $_;
3404 }
3405 close F;
3406 unlink $tmp;
3407 return $diff;
3408 }
3409
3410 unlink $tmp;
3411 }
3412 else {
3413 error("Cannot open '$tmp' for writing: $!");
3414 }
3415
3416 return undef;
3417 }
3418
3419 sub rec_depend
3420 {
3421 my($func, $seen) = @_;
3422 return () unless exists $depends{$func};
3423 $seen = {%{$seen||{}}};
3424 return () if $seen->{$func}++;
3425 my %s;
3426 grep !$s{$_}++, map { ($_, rec_depend($_, $seen)) } @{$depends{$func}};
3427 }
3428
3429 sub parse_version
3430 {
3431 my $ver = shift;
3432
3433 if ($ver =~ /^(\d+)\.(\d+)\.(\d+)$/) {
3434 return ($1, $2, $3);
3435 }
3436 elsif ($ver !~ /^\d+\.[\d_]+$/) {
3437 die "cannot parse version '$ver'\n";
3438 }
3439
3440 $ver =~ s/_//g;
3441 $ver =~ s/$/000000/;
3442
3443 my($r,$v,$s) = $ver =~ /(\d+)\.(\d{3})(\d{3})/;
3444
3445 $v = int $v;
3446 $s = int $s;
3447
3448 if ($r < 5 || ($r == 5 && $v < 6)) {
3449 if ($s % 10) {
3450 die "cannot parse version '$ver'\n";
3451 }
3452 }
3453
3454 return ($r, $v, $s);
3455 }
3456
3457 sub format_version
3458 {
3459 my $ver = shift;
3460
3461 $ver =~ s/$/000000/;
3462 my($r,$v,$s) = $ver =~ /(\d+)\.(\d{3})(\d{3})/;
3463
3464 $v = int $v;
3465 $s = int $s;
3466
3467 if ($r < 5 || ($r == 5 && $v < 6)) {
3468 if ($s % 10) {
3469 die "invalid version '$ver'\n";
3470 }
3471 $s /= 10;
3472
3473 $ver = sprintf "%d.%03d", $r, $v;
3474 $s > 0 and $ver .= sprintf "_%02d", $s;
3475
3476 return $ver;
3477 }
3478
3479 return sprintf "%d.%d.%d", $r, $v, $s;
3480 }
3481
3482 sub info
3483 {
3484 $opt{quiet} and return;
3485 print @_, "\n";
3486 }
3487
3488 sub diag
3489 {
3490 $opt{quiet} and return;
3491 $opt{diag} and print @_, "\n";
3492 }
3493
3494 sub warning
3495 {
3496 $opt{quiet} and return;
3497 print "*** ", @_, "\n";
3498 }
3499
3500 sub error
3501 {
3502 print "*** ERROR: ", @_, "\n";
3503 }
3504
3505 my %given_hints;
3506 my %given_warnings;
3507 sub hint
3508 {
3509 $opt{quiet} and return;
3510 my $func = shift;
3511 my $rv = 0;
3512 if (exists $warnings{$func} && !$given_warnings{$func}++) {
3513 my $warn = $warnings{$func};
3514 $warn =~ s!^!*** !mg;
3515 print "*** WARNING: $func\n", $warn;
3516 $rv++;
3517 }
3518 if ($opt{hints} && exists $hints{$func} && !$given_hints{$func}++) {
3519 my $hint = $hints{$func};
3520 $hint =~ s/^/ /mg;
3521 print " --- hint for $func ---\n", $hint;
3522 }
3523 $rv;
3524 }
3525
3526 sub usage
3527 {
3528 my($usage) = do { local(@ARGV,$/)=($0); <> } =~ /^=head\d$HS+SYNOPSIS\s*^(.*?)\s*^=/ms;
3529 my %M = ( 'I' => '*' );
3530 $usage =~ s/^\s*perl\s+\S+/$^X $0/;
3531 $usage =~ s/([A-Z])<([^>]+)>/$M{$1}$2$M{$1}/g;
3532
3533 print <<ENDUSAGE;
3534
3535 Usage: $usage
3536
3537 See perldoc $0 for details.
3538
3539 ENDUSAGE
3540
3541 exit 2;
3542 }
3543
3544 sub strip
3545 {
3546 my $self = do { local(@ARGV,$/)=($0); <> };
3547 my($copy) = $self =~ /^=head\d\s+COPYRIGHT\s*^(.*?)^=\w+/ms;
3548 $copy =~ s/^(?=\S+)/ /gms;
3549 $self =~ s/^$HS+Do NOT edit.*?(?=^-)/$copy/ms;
3550 $self =~ s/^SKIP.*(?=^__DATA__)/SKIP
3551 if (\@ARGV && \$ARGV[0] eq '--unstrip') {
3552 eval { require Devel::PPPort };
3553 \$@ and die "Cannot require Devel::PPPort, please install.\\n";
3554 if (eval \$Devel::PPPort::VERSION < $VERSION) {
3555 die "$0 was originally generated with Devel::PPPort $VERSION.\\n"
3556 . "Your Devel::PPPort is only version \$Devel::PPPort::VERSION.\\n"
3557 . "Please install a newer version, or --unstrip will not work.\\n";
3558 }
3559 Devel::PPPort::WriteFile(\$0);
3560 exit 0;
3561 }
3562 print <<END;
3563
3564 Sorry, but this is a stripped version of \$0.
3565
3566 To be able to use its original script and doc functionality,
3567 please try to regenerate this file using:
3568
3569 \$^X \$0 --unstrip
3570
3571 END
3572 /ms;
3573 my($pl, $c) = $self =~ /(.*^__DATA__)(.*)/ms;
3574 $c =~ s{
3575 / (?: \*[^*]*\*+(?:[^$ccs][^*]*\*+)* / | /[^\r\n]*)
3576 | ( "[^"\\]*(?:\\.[^"\\]*)*"
3577 | '[^'\\]*(?:\\.[^'\\]*)*' )
3578 | ($HS+) }{ defined $2 ? ' ' : ($1 || '') }gsex;
3579 $c =~ s!\s+$!!mg;
3580 $c =~ s!^$LF!!mg;
3581 $c =~ s!^\s*#\s*!#!mg;
3582 $c =~ s!^\s+!!mg;
3583
3584 open OUT, ">$0" or die "cannot strip $0: $!\n";
3585 print OUT "$pl$c\n";
3586
3587 exit 0;
3588 }
3589
3590 __DATA__
3591 */
3592
3593 #ifndef _P_P_PORTABILITY_H_
3594 #define _P_P_PORTABILITY_H_
3595
3596 #ifndef DPPP_NAMESPACE
3597 # define DPPP_NAMESPACE DPPP_
3598 #endif
3599
3600 #define DPPP_CAT2(x,y) CAT2(x,y)
3601 #define DPPP_(name) DPPP_CAT2(DPPP_NAMESPACE, name)
3602
3603 #ifndef PERL_REVISION
3604 # if !defined(__PATCHLEVEL_H_INCLUDED__) && !(defined(PATCHLEVEL) && defined(SUBVERSION))
3605 # define PERL_PATCHLEVEL_H_IMPLICIT
3606 # include <patchlevel.h>
3607 # endif
3608 # if !(defined(PERL_VERSION) || (defined(SUBVERSION) && defined(PATCHLEVEL)))
3609 # include <could_not_find_Perl_patchlevel.h>
3610 # endif
3611 # ifndef PERL_REVISION
3612 # define PERL_REVISION (5)
3613 /* Replace: 1 */
3614 # define PERL_VERSION PATCHLEVEL
3615 # define PERL_SUBVERSION SUBVERSION
3616 /* Replace PERL_PATCHLEVEL with PERL_VERSION */
3617 /* Replace: 0 */
3618 # endif
3619 #endif
3620
3621 #define _dpppDEC2BCD(dec) ((((dec)/100)<<8)|((((dec)%100)/10)<<4)|((dec)%10))
3622 #define PERL_BCDVERSION ((_dpppDEC2BCD(PERL_REVISION)<<24)|(_dpppDEC2BCD(PERL_VERSION)<<12)|_dpppDEC2BCD(PERL_SUBVERSION))
3623
3624 /* It is very unlikely that anyone will try to use this with Perl 6
3625 (or greater), but who knows.
3626 */
3627 #if PERL_REVISION != 5
3628 # error ppport.h only works with Perl version 5
3629 #endif /* PERL_REVISION != 5 */
3630 #ifndef dTHR
3631 # define dTHR dNOOP
3632 #endif
3633 #ifndef dTHX
3634 # define dTHX dNOOP
3635 #endif
3636
3637 #ifndef dTHXa
3638 # define dTHXa(x) dNOOP
3639 #endif
3640 #ifndef pTHX
3641 # define pTHX void
3642 #endif
3643
3644 #ifndef pTHX_
3645 # define pTHX_
3646 #endif
3647
3648 #ifndef aTHX
3649 # define aTHX
3650 #endif
3651
3652 #ifndef aTHX_
3653 # define aTHX_
3654 #endif
3655
3656 #if (PERL_BCDVERSION < 0x5006000)
3657 # ifdef USE_THREADS
3658 # define aTHXR thr
3659 # define aTHXR_ thr,
3660 # else
3661 # define aTHXR
3662 # define aTHXR_
3663 # endif
3664 # define dTHXR dTHR
3665 #else
3666 # define aTHXR aTHX
3667 # define aTHXR_ aTHX_
3668 # define dTHXR dTHX
3669 #endif
3670 #ifndef dTHXoa
3671 # define dTHXoa(x) dTHXa(x)
3672 #endif
3673
3674 #ifdef I_LIMITS
3675 # include <limits.h>
3676 #endif
3677
3678 #ifndef PERL_UCHAR_MIN
3679 # define PERL_UCHAR_MIN ((unsigned char)0)
3680 #endif
3681
3682 #ifndef PERL_UCHAR_MAX
3683 # ifdef UCHAR_MAX
3684 # define PERL_UCHAR_MAX ((unsigned char)UCHAR_MAX)
3685 # else
3686 # ifdef MAXUCHAR
3687 # define PERL_UCHAR_MAX ((unsigned char)MAXUCHAR)
3688 # else
3689 # define PERL_UCHAR_MAX ((unsigned char)~(unsigned)0)
3690 # endif
3691 # endif
3692 #endif
3693
3694 #ifndef PERL_USHORT_MIN
3695 # define PERL_USHORT_MIN ((unsigned short)0)
3696 #endif
3697
3698 #ifndef PERL_USHORT_MAX
3699 # ifdef USHORT_MAX
3700 # define PERL_USHORT_MAX ((unsigned short)USHORT_MAX)
3701 # else
3702 # ifdef MAXUSHORT
3703 # define PERL_USHORT_MAX ((unsigned short)MAXUSHORT)
3704 # else
3705 # ifdef USHRT_MAX
3706 # define PERL_USHORT_MAX ((unsigned short)USHRT_MAX)
3707 # else
3708 # define PERL_USHORT_MAX ((unsigned short)~(unsigned)0)
3709 # endif
3710 # endif
3711 # endif
3712 #endif
3713
3714 #ifndef PERL_SHORT_MAX
3715 # ifdef SHORT_MAX
3716 # define PERL_SHORT_MAX ((short)SHORT_MAX)
3717 # else
3718 # ifdef MAXSHORT /* Often used in <values.h> */
3719 # define PERL_SHORT_MAX ((short)MAXSHORT)
3720 # else
3721 # ifdef SHRT_MAX
3722 # define PERL_SHORT_MAX ((short)SHRT_MAX)
3723 # else
3724 # define PERL_SHORT_MAX ((short) (PERL_USHORT_MAX >> 1))
3725 # endif
3726 # endif
3727 # endif
3728 #endif
3729
3730 #ifndef PERL_SHORT_MIN
3731 # ifdef SHORT_MIN
3732 # define PERL_SHORT_MIN ((short)SHORT_MIN)
3733 # else
3734 # ifdef MINSHORT
3735 # define PERL_SHORT_MIN ((short)MINSHORT)
3736 # else
3737 # ifdef SHRT_MIN
3738 # define PERL_SHORT_MIN ((short)SHRT_MIN)
3739 # else
3740 # define PERL_SHORT_MIN (-PERL_SHORT_MAX - ((3 & -1) == 3))
3741 # endif
3742 # endif
3743 # endif
3744 #endif
3745
3746 #ifndef PERL_UINT_MAX
3747 # ifdef UINT_MAX
3748 # define PERL_UINT_MAX ((unsigned int)UINT_MAX)
3749 # else
3750 # ifdef MAXUINT
3751 # define PERL_UINT_MAX ((unsigned int)MAXUINT)
3752 # else
3753 # define PERL_UINT_MAX (~(unsigned int)0)
3754 # endif
3755 # endif
3756 #endif
3757
3758 #ifndef PERL_UINT_MIN
3759 # define PERL_UINT_MIN ((unsigned int)0)
3760 #endif
3761
3762 #ifndef PERL_INT_MAX
3763 # ifdef INT_MAX
3764 # define PERL_INT_MAX ((int)INT_MAX)
3765 # else
3766 # ifdef MAXINT /* Often used in <values.h> */
3767 # define PERL_INT_MAX ((int)MAXINT)
3768 # else
3769 # define PERL_INT_MAX ((int)(PERL_UINT_MAX >> 1))
3770 # endif
3771 # endif
3772 #endif
3773
3774 #ifndef PERL_INT_MIN
3775 # ifdef INT_MIN
3776 # define PERL_INT_MIN ((int)INT_MIN)
3777 # else
3778 # ifdef MININT
3779 # define PERL_INT_MIN ((int)MININT)
3780 # else
3781 # define PERL_INT_MIN (-PERL_INT_MAX - ((3 & -1) == 3))
3782 # endif
3783 # endif
3784 #endif
3785
3786 #ifndef PERL_ULONG_MAX
3787 # ifdef ULONG_MAX
3788 # define PERL_ULONG_MAX ((unsigned long)ULONG_MAX)
3789 # else
3790 # ifdef MAXULONG
3791 # define PERL_ULONG_MAX ((unsigned long)MAXULONG)
3792 # else
3793 # define PERL_ULONG_MAX (~(unsigned long)0)
3794 # endif
3795 # endif
3796 #endif
3797
3798 #ifndef PERL_ULONG_MIN
3799 # define PERL_ULONG_MIN ((unsigned long)0L)
3800 #endif
3801
3802 #ifndef PERL_LONG_MAX
3803 # ifdef LONG_MAX
3804 # define PERL_LONG_MAX ((long)LONG_MAX)
3805 # else
3806 # ifdef MAXLONG
3807 # define PERL_LONG_MAX ((long)MAXLONG)
3808 # else
3809 # define PERL_LONG_MAX ((long) (PERL_ULONG_MAX >> 1))
3810 # endif
3811 # endif
3812 #endif
3813
3814 #ifndef PERL_LONG_MIN
3815 # ifdef LONG_MIN
3816 # define PERL_LONG_MIN ((long)LONG_MIN)
3817 # else
3818 # ifdef MINLONG
3819 # define PERL_LONG_MIN ((long)MINLONG)
3820 # else
3821 # define PERL_LONG_MIN (-PERL_LONG_MAX - ((3 & -1) == 3))
3822 # endif
3823 # endif
3824 #endif
3825
3826 #if defined(HAS_QUAD) && (defined(convex) || defined(uts))
3827 # ifndef PERL_UQUAD_MAX
3828 # ifdef ULONGLONG_MAX
3829 # define PERL_UQUAD_MAX ((unsigned long long)ULONGLONG_MAX)
3830 # else
3831 # ifdef MAXULONGLONG
3832 # define PERL_UQUAD_MAX ((unsigned long long)MAXULONGLONG)
3833 # else
3834 # define PERL_UQUAD_MAX (~(unsigned long long)0)
3835 # endif
3836 # endif
3837 # endif
3838
3839 # ifndef PERL_UQUAD_MIN
3840 # define PERL_UQUAD_MIN ((unsigned long long)0L)
3841 # endif
3842
3843 # ifndef PERL_QUAD_MAX
3844 # ifdef LONGLONG_MAX
3845 # define PERL_QUAD_MAX ((long long)LONGLONG_MAX)
3846 # else
3847 # ifdef MAXLONGLONG
3848 # define PERL_QUAD_MAX ((long long)MAXLONGLONG)
3849 # else
3850 # define PERL_QUAD_MAX ((long long) (PERL_UQUAD_MAX >> 1))
3851 # endif
3852 # endif
3853 # endif
3854
3855 # ifndef PERL_QUAD_MIN
3856 # ifdef LONGLONG_MIN
3857 # define PERL_QUAD_MIN ((long long)LONGLONG_MIN)
3858 # else
3859 # ifdef MINLONGLONG
3860 # define PERL_QUAD_MIN ((long long)MINLONGLONG)
3861 # else
3862 # define PERL_QUAD_MIN (-PERL_QUAD_MAX - ((3 & -1) == 3))
3863 # endif
3864 # endif
3865 # endif
3866 #endif
3867
3868 /* This is based on code from 5.003 perl.h */
3869 #ifdef HAS_QUAD
3870 # ifdef cray
3871 #ifndef IVTYPE
3872 # define IVTYPE int
3873 #endif
3874
3875 #ifndef IV_MIN
3876 # define IV_MIN PERL_INT_MIN
3877 #endif
3878
3879 #ifndef IV_MAX
3880 # define IV_MAX PERL_INT_MAX
3881 #endif
3882
3883 #ifndef UV_MIN
3884 # define UV_MIN PERL_UINT_MIN
3885 #endif
3886
3887 #ifndef UV_MAX
3888 # define UV_MAX PERL_UINT_MAX
3889 #endif
3890
3891 # ifdef INTSIZE
3892 #ifndef IVSIZE
3893 # define IVSIZE INTSIZE
3894 #endif
3895
3896 # endif
3897 # else
3898 # if defined(convex) || defined(uts)
3899 #ifndef IVTYPE
3900 # define IVTYPE long long
3901 #endif
3902
3903 #ifndef IV_MIN
3904 # define IV_MIN PERL_QUAD_MIN
3905 #endif
3906
3907 #ifndef IV_MAX
3908 # define IV_MAX PERL_QUAD_MAX
3909 #endif
3910
3911 #ifndef UV_MIN
3912 # define UV_MIN PERL_UQUAD_MIN
3913 #endif
3914
3915 #ifndef UV_MAX
3916 # define UV_MAX PERL_UQUAD_MAX
3917 #endif
3918
3919 # ifdef LONGLONGSIZE
3920 #ifndef IVSIZE
3921 # define IVSIZE LONGLONGSIZE
3922 #endif
3923
3924 # endif
3925 # else
3926 #ifndef IVTYPE
3927 # define IVTYPE long
3928 #endif
3929
3930 #ifndef IV_MIN
3931 # define IV_MIN PERL_LONG_MIN
3932 #endif
3933
3934 #ifndef IV_MAX
3935 # define IV_MAX PERL_LONG_MAX
3936 #endif
3937
3938 #ifndef UV_MIN
3939 # define UV_MIN PERL_ULONG_MIN
3940 #endif
3941
3942 #ifndef UV_MAX
3943 # define UV_MAX PERL_ULONG_MAX
3944 #endif
3945
3946 # ifdef LONGSIZE
3947 #ifndef IVSIZE
3948 # define IVSIZE LONGSIZE
3949 #endif
3950
3951 # endif
3952 # endif
3953 # endif
3954 #ifndef IVSIZE
3955 # define IVSIZE 8
3956 #endif
3957
3958 #ifndef LONGSIZE
3959 # define LONGSIZE 8
3960 #endif
3961
3962 #ifndef PERL_QUAD_MIN
3963 # define PERL_QUAD_MIN IV_MIN
3964 #endif
3965
3966 #ifndef PERL_QUAD_MAX
3967 # define PERL_QUAD_MAX IV_MAX
3968 #endif
3969
3970 #ifndef PERL_UQUAD_MIN
3971 # define PERL_UQUAD_MIN UV_MIN
3972 #endif
3973
3974 #ifndef PERL_UQUAD_MAX
3975 # define PERL_UQUAD_MAX UV_MAX
3976 #endif
3977
3978 #else
3979 #ifndef IVTYPE
3980 # define IVTYPE long
3981 #endif
3982
3983 #ifndef LONGSIZE
3984 # define LONGSIZE 4
3985 #endif
3986
3987 #ifndef IV_MIN
3988 # define IV_MIN PERL_LONG_MIN
3989 #endif
3990
3991 #ifndef IV_MAX
3992 # define IV_MAX PERL_LONG_MAX
3993 #endif
3994
3995 #ifndef UV_MIN
3996 # define UV_MIN PERL_ULONG_MIN
3997 #endif
3998
3999 #ifndef UV_MAX
4000 # define UV_MAX PERL_ULONG_MAX
4001 #endif
4002
4003 #endif
4004
4005 #ifndef IVSIZE
4006 # ifdef LONGSIZE
4007 # define IVSIZE LONGSIZE
4008 # else
4009 # define IVSIZE 4 /* A bold guess, but the best we can make. */
4010 # endif
4011 #endif
4012 #ifndef UVTYPE
4013 # define UVTYPE unsigned IVTYPE
4014 #endif
4015
4016 #ifndef UVSIZE
4017 # define UVSIZE IVSIZE
4018 #endif
4019 #ifndef sv_setuv
4020 # define sv_setuv(sv, uv) \
4021 STMT_START { \
4022 UV TeMpUv = uv; \
4023 if (TeMpUv <= IV_MAX) \
4024 sv_setiv(sv, TeMpUv); \
4025 else \
4026 sv_setnv(sv, (double)TeMpUv); \
4027 } STMT_END
4028 #endif
4029 #ifndef newSVuv
4030 # define newSVuv(uv) ((uv) <= IV_MAX ? newSViv((IV)uv) : newSVnv((NV)uv))
4031 #endif
4032 #ifndef sv_2uv
4033 # define sv_2uv(sv) ((PL_Sv = (sv)), (UV) (SvNOK(PL_Sv) ? SvNV(PL_Sv) : sv_2nv(PL_Sv)))
4034 #endif
4035
4036 #ifndef SvUVX
4037 # define SvUVX(sv) ((UV)SvIVX(sv))
4038 #endif
4039
4040 #ifndef SvUVXx
4041 # define SvUVXx(sv) SvUVX(sv)
4042 #endif
4043
4044 #ifndef SvUV
4045 # define SvUV(sv) (SvIOK(sv) ? SvUVX(sv) : sv_2uv(sv))
4046 #endif
4047
4048 #ifndef SvUVx
4049 # define SvUVx(sv) ((PL_Sv = (sv)), SvUV(PL_Sv))
4050 #endif
4051
4052 /* Hint: sv_uv
4053 * Always use the SvUVx() macro instead of sv_uv().
4054 */
4055 #ifndef sv_uv
4056 # define sv_uv(sv) SvUVx(sv)
4057 #endif
4058
4059 #if !defined(SvUOK) && defined(SvIOK_UV)
4060 # define SvUOK(sv) SvIOK_UV(sv)
4061 #endif
4062 #ifndef XST_mUV
4063 # define XST_mUV(i,v) (ST(i) = sv_2mortal(newSVuv(v)) )
4064 #endif
4065
4066 #ifndef XSRETURN_UV
4067 # define XSRETURN_UV(v) STMT_START { XST_mUV(0,v); XSRETURN(1); } STMT_END
4068 #endif
4069 #ifndef PUSHu
4070 # define PUSHu(u) STMT_START { sv_setuv(TARG, (UV)(u)); PUSHTARG; } STMT_END
4071 #endif
4072
4073 #ifndef XPUSHu
4074 # define XPUSHu(u) STMT_START { sv_setuv(TARG, (UV)(u)); XPUSHTARG; } STMT_END
4075 #endif
4076
4077 #ifdef HAS_MEMCMP
4078 #ifndef memNE
4079 # define memNE(s1,s2,l) (memcmp(s1,s2,l))
4080 #endif
4081
4082 #ifndef memEQ
4083 # define memEQ(s1,s2,l) (!memcmp(s1,s2,l))
4084 #endif
4085
4086 #else
4087 #ifndef memNE
4088 # define memNE(s1,s2,l) (bcmp(s1,s2,l))
4089 #endif
4090
4091 #ifndef memEQ
4092 # define memEQ(s1,s2,l) (!bcmp(s1,s2,l))
4093 #endif
4094
4095 #endif
4096 #ifndef memEQs
4097 # define memEQs(s1, l, s2) \
4098 (sizeof(s2)-1 == l && memEQ(s1, (s2 ""), (sizeof(s2)-1)))
4099 #endif
4100
4101 #ifndef memNEs
4102 # define memNEs(s1, l, s2) !memEQs(s1, l, s2)
4103 #endif
4104 #ifndef MoveD
4105 # define MoveD(s,d,n,t) memmove((char*)(d),(char*)(s), (n) * sizeof(t))
4106 #endif
4107
4108 #ifndef CopyD
4109 # define CopyD(s,d,n,t) memcpy((char*)(d),(char*)(s), (n) * sizeof(t))
4110 #endif
4111
4112 #ifdef HAS_MEMSET
4113 #ifndef ZeroD
4114 # define ZeroD(d,n,t) memzero((char*)(d), (n) * sizeof(t))
4115 #endif
4116
4117 #else
4118 #ifndef ZeroD
4119 # define ZeroD(d,n,t) ((void)memzero((char*)(d), (n) * sizeof(t)), d)
4120 #endif
4121
4122 #endif
4123 #ifndef PoisonWith
4124 # define PoisonWith(d,n,t,b) (void)memset((char*)(d), (U8)(b), (n) * sizeof(t))
4125 #endif
4126
4127 #ifndef PoisonNew
4128 # define PoisonNew(d,n,t) PoisonWith(d,n,t,0xAB)
4129 #endif
4130
4131 #ifndef PoisonFree
4132 # define PoisonFree(d,n,t) PoisonWith(d,n,t,0xEF)
4133 #endif
4134
4135 #ifndef Poison
4136 # define Poison(d,n,t) PoisonFree(d,n,t)
4137 #endif
4138 #ifndef Newx
4139 # define Newx(v,n,t) New(0,v,n,t)
4140 #endif
4141
4142 #ifndef Newxc
4143 # define Newxc(v,n,t,c) Newc(0,v,n,t,c)
4144 #endif
4145
4146 #ifndef Newxz
4147 # define Newxz(v,n,t) Newz(0,v,n,t)
4148 #endif
4149
4150 #ifndef PERL_UNUSED_DECL
4151 # ifdef HASATTRIBUTE
4152 # if (defined(__GNUC__) && defined(__cplusplus)) || defined(__INTEL_COMPILER)
4153 # define PERL_UNUSED_DECL
4154 # else
4155 # define PERL_UNUSED_DECL __attribute__((unused))
4156 # endif
4157 # else
4158 # define PERL_UNUSED_DECL
4159 # endif
4160 #endif
4161
4162 #ifndef PERL_UNUSED_ARG
4163 # if defined(lint) && defined(S_SPLINT_S) /* www.splint.org */
4164 # include <note.h>
4165 # define PERL_UNUSED_ARG(x) NOTE(ARGUNUSED(x))
4166 # else
4167 # define PERL_UNUSED_ARG(x) ((void)x)
4168 # endif
4169 #endif
4170
4171 #ifndef PERL_UNUSED_VAR
4172 # define PERL_UNUSED_VAR(x) ((void)x)
4173 #endif
4174
4175 #ifndef PERL_UNUSED_CONTEXT
4176 # ifdef USE_ITHREADS
4177 # define PERL_UNUSED_CONTEXT PERL_UNUSED_ARG(my_perl)
4178 # else
4179 # define PERL_UNUSED_CONTEXT
4180 # endif
4181 #endif
4182 #ifndef NOOP
4183 # define NOOP /*EMPTY*/(void)0
4184 #endif
4185
4186 #ifndef dNOOP
4187 # define dNOOP extern int /*@unused@*/ Perl___notused PERL_UNUSED_DECL
4188 #endif
4189
4190 #ifndef NVTYPE
4191 # if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
4192 # define NVTYPE long double
4193 # else
4194 # define NVTYPE double
4195 # endif
4196 typedef NVTYPE NV;
4197 #endif
4198
4199 #ifndef INT2PTR
4200 # if (IVSIZE == PTRSIZE) && (UVSIZE == PTRSIZE)
4201 # define PTRV UV
4202 # define INT2PTR(any,d) (any)(d)
4203 # else
4204 # if PTRSIZE == LONGSIZE
4205 # define PTRV unsigned long
4206 # else
4207 # define PTRV unsigned
4208 # endif
4209 # define INT2PTR(any,d) (any)(PTRV)(d)
4210 # endif
4211 #endif
4212
4213 #ifndef PTR2ul
4214 # if PTRSIZE == LONGSIZE
4215 # define PTR2ul(p) (unsigned long)(p)
4216 # else
4217 # define PTR2ul(p) INT2PTR(unsigned long,p)
4218 # endif
4219 #endif
4220 #ifndef PTR2nat
4221 # define PTR2nat(p) (PTRV)(p)
4222 #endif
4223
4224 #ifndef NUM2PTR
4225 # define NUM2PTR(any,d) (any)PTR2nat(d)
4226 #endif
4227
4228 #ifndef PTR2IV
4229 # define PTR2IV(p) INT2PTR(IV,p)
4230 #endif
4231
4232 #ifndef PTR2UV
4233 # define PTR2UV(p) INT2PTR(UV,p)
4234 #endif
4235
4236 #ifndef PTR2NV
4237 # define PTR2NV(p) NUM2PTR(NV,p)
4238 #endif
4239
4240 #undef START_EXTERN_C
4241 #undef END_EXTERN_C
4242 #undef EXTERN_C
4243 #ifdef __cplusplus
4244 # define START_EXTERN_C extern "C" {
4245 # define END_EXTERN_C }
4246 # define EXTERN_C extern "C"
4247 #else
4248 # define START_EXTERN_C
4249 # define END_EXTERN_C
4250 # define EXTERN_C extern
4251 #endif
4252
4253 #if defined(PERL_GCC_PEDANTIC)
4254 # ifndef PERL_GCC_BRACE_GROUPS_FORBIDDEN
4255 # define PERL_GCC_BRACE_GROUPS_FORBIDDEN
4256 # endif
4257 #endif
4258
4259 #if defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN) && !defined(__cplusplus)
4260 # ifndef PERL_USE_GCC_BRACE_GROUPS
4261 # define PERL_USE_GCC_BRACE_GROUPS
4262 # endif
4263 #endif
4264
4265 #undef STMT_START
4266 #undef STMT_END
4267 #ifdef PERL_USE_GCC_BRACE_GROUPS
4268 # define STMT_START (void)( /* gcc supports ``({ STATEMENTS; })'' */
4269 # define STMT_END )
4270 #else
4271 # if defined(VOIDFLAGS) && (VOIDFLAGS) && (defined(sun) || defined(__sun__)) && !defined(__GNUC__)
4272 # define STMT_START if (1)
4273 # define STMT_END else (void)0
4274 # else
4275 # define STMT_START do
4276 # define STMT_END while (0)
4277 # endif
4278 #endif
4279 #ifndef boolSV
4280 # define boolSV(b) ((b) ? &PL_sv_yes : &PL_sv_no)
4281 #endif
4282
4283 /* DEFSV appears first in 5.004_56 */
4284 #ifndef DEFSV
4285 # define DEFSV GvSV(PL_defgv)
4286 #endif
4287
4288 #ifndef SAVE_DEFSV
4289 # define SAVE_DEFSV SAVESPTR(GvSV(PL_defgv))
4290 #endif
4291
4292 #ifndef DEFSV_set
4293 # define DEFSV_set(sv) (DEFSV = (sv))
4294 #endif
4295
4296 /* Older perls (<=5.003) lack AvFILLp */
4297 #ifndef AvFILLp
4298 # define AvFILLp AvFILL
4299 #endif
4300 #ifndef ERRSV
4301 # define ERRSV get_sv("@",FALSE)
4302 #endif
4303
4304 /* Hint: gv_stashpvn
4305 * This function's backport doesn't support the length parameter, but
4306 * rather ignores it. Portability can only be ensured if the length
4307 * parameter is used for speed reasons, but the length can always be
4308 * correctly computed from the string argument.
4309 */
4310 #ifndef gv_stashpvn
4311 # define gv_stashpvn(str,len,create) gv_stashpv(str,create)
4312 #endif
4313
4314 /* Replace: 1 */
4315 #ifndef get_cv
4316 # define get_cv perl_get_cv
4317 #endif
4318
4319 #ifndef get_sv
4320 # define get_sv perl_get_sv
4321 #endif
4322
4323 #ifndef get_av
4324 # define get_av perl_get_av
4325 #endif
4326
4327 #ifndef get_hv
4328 # define get_hv perl_get_hv
4329 #endif
4330
4331 /* Replace: 0 */
4332 #ifndef dUNDERBAR
4333 # define dUNDERBAR dNOOP
4334 #endif
4335
4336 #ifndef UNDERBAR
4337 # define UNDERBAR DEFSV
4338 #endif
4339 #ifndef dAX
4340 # define dAX I32 ax = MARK - PL_stack_base + 1
4341 #endif
4342
4343 #ifndef dITEMS
4344 # define dITEMS I32 items = SP - MARK
4345 #endif
4346 #ifndef dXSTARG
4347 # define dXSTARG SV * targ = sv_newmortal()
4348 #endif
4349 #ifndef dAXMARK
4350 # define dAXMARK I32 ax = POPMARK; \
4351 register SV ** const mark = PL_stack_base + ax++
4352 #endif
4353 #ifndef XSprePUSH
4354 # define XSprePUSH (sp = PL_stack_base + ax - 1)
4355 #endif
4356
4357 #if (PERL_BCDVERSION < 0x5005000)
4358 # undef XSRETURN
4359 # define XSRETURN(off) \
4360 STMT_START { \
4361 PL_stack_sp = PL_stack_base + ax + ((off) - 1); \
4362 return; \
4363 } STMT_END
4364 #endif
4365 #ifndef XSPROTO
4366 # define XSPROTO(name) void name(pTHX_ CV* cv)
4367 #endif
4368
4369 #ifndef SVfARG
4370 # define SVfARG(p) ((void*)(p))
4371 #endif
4372 #ifndef PERL_ABS
4373 # define PERL_ABS(x) ((x) < 0 ? -(x) : (x))
4374 #endif
4375 #ifndef dVAR
4376 # define dVAR dNOOP
4377 #endif
4378 #ifndef SVf
4379 # define SVf "_"
4380 #endif
4381 #ifndef UTF8_MAXBYTES
4382 # define UTF8_MAXBYTES UTF8_MAXLEN
4383 #endif
4384 #ifndef CPERLscope
4385 # define CPERLscope(x) x
4386 #endif
4387 #ifndef PERL_HASH
4388 # define PERL_HASH(hash,str,len) \
4389 STMT_START { \
4390 const char *s_PeRlHaSh = str; \
4391 I32 i_PeRlHaSh = len; \
4392 U32 hash_PeRlHaSh = 0; \
4393 while (i_PeRlHaSh--) \
4394 hash_PeRlHaSh = hash_PeRlHaSh * 33 + *s_PeRlHaSh++; \
4395 (hash) = hash_PeRlHaSh; \
4396 } STMT_END
4397 #endif
4398
4399 #ifndef PERLIO_FUNCS_DECL
4400 # ifdef PERLIO_FUNCS_CONST
4401 # define PERLIO_FUNCS_DECL(funcs) const PerlIO_funcs funcs
4402 # define PERLIO_FUNCS_CAST(funcs) (PerlIO_funcs*)(funcs)
4403 # else
4404 # define PERLIO_FUNCS_DECL(funcs) PerlIO_funcs funcs
4405 # define PERLIO_FUNCS_CAST(funcs) (funcs)
4406 # endif
4407 #endif
4408
4409 /* provide these typedefs for older perls */
4410 #if (PERL_BCDVERSION < 0x5009003)
4411
4412 # ifdef ARGSproto
4413 typedef OP* (CPERLscope(*Perl_ppaddr_t))(ARGSproto);
4414 # else
4415 typedef OP* (CPERLscope(*Perl_ppaddr_t))(pTHX);
4416 # endif
4417
4418 typedef OP* (CPERLscope(*Perl_check_t)) (pTHX_ OP*);
4419
4420 #endif
4421 #ifndef isPSXSPC
4422 # define isPSXSPC(c) (isSPACE(c) || (c) == '\v')
4423 #endif
4424
4425 #ifndef isBLANK
4426 # define isBLANK(c) ((c) == ' ' || (c) == '\t')
4427 #endif
4428
4429 #ifdef EBCDIC
4430 #ifndef isALNUMC
4431 # define isALNUMC(c) isalnum(c)
4432 #endif
4433
4434 #ifndef isASCII
4435 # define isASCII(c) isascii(c)
4436 #endif
4437
4438 #ifndef isCNTRL
4439 # define isCNTRL(c) iscntrl(c)
4440 #endif
4441
4442 #ifndef isGRAPH
4443 # define isGRAPH(c) isgraph(c)
4444 #endif
4445
4446 #ifndef isPRINT
4447 # define isPRINT(c) isprint(c)
4448 #endif
4449
4450 #ifndef isPUNCT
4451 # define isPUNCT(c) ispunct(c)
4452 #endif
4453
4454 #ifndef isXDIGIT
4455 # define isXDIGIT(c) isxdigit(c)
4456 #endif
4457
4458 #else
4459 # if (PERL_BCDVERSION < 0x5010000)
4460 /* Hint: isPRINT
4461 * The implementation in older perl versions includes all of the
4462 * isSPACE() characters, which is wrong. The version provided by
4463 * Devel::PPPort always overrides a present buggy version.
4464 */
4465 # undef isPRINT
4466 # endif
4467
4468 #ifdef HAS_QUAD
4469 # ifdef U64TYPE
4470 # define WIDEST_UTYPE U64TYPE
4471 # else
4472 # define WIDEST_UTYPE Quad_t
4473 # endif
4474 #else
4475 # define WIDEST_UTYPE U32
4476 #endif
4477 #ifndef isALNUMC
4478 # define isALNUMC(c) (isALPHA(c) || isDIGIT(c))
4479 #endif
4480
4481 #ifndef isASCII
4482 # define isASCII(c) ((WIDEST_UTYPE) (c) <= 127)
4483 #endif
4484
4485 #ifndef isCNTRL
4486 # define isCNTRL(c) ((WIDEST_UTYPE) (c) < ' ' || (c) == 127)
4487 #endif
4488
4489 #ifndef isGRAPH
4490 # define isGRAPH(c) (isALNUM(c) || isPUNCT(c))
4491 #endif
4492
4493 #ifndef isPRINT
4494 # define isPRINT(c) (((c) >= 32 && (c) < 127))
4495 #endif
4496
4497 #ifndef isPUNCT
4498 # define isPUNCT(c) (((c) >= 33 && (c) <= 47) || ((c) >= 58 && (c) <= 64) || ((c) >= 91 && (c) <= 96) || ((c) >= 123 && (c) <= 126))
4499 #endif
4500
4501 #ifndef isXDIGIT
4502 # define isXDIGIT(c) (isDIGIT(c) || ((c) >= 'a' && (c) <= 'f') || ((c) >= 'A' && (c) <= 'F'))
4503 #endif
4504
4505 #endif
4506
4507 /* Until we figure out how to support this in older perls... */
4508 #if (PERL_BCDVERSION >= 0x5008000)
4509 #ifndef HeUTF8
4510 # define HeUTF8(he) ((HeKLEN(he) == HEf_SVKEY) ? \
4511 SvUTF8(HeKEY_sv(he)) : \
4512 (U32)HeKUTF8(he))
4513 #endif
4514
4515 #endif
4516
4517 #ifndef PERL_SIGNALS_UNSAFE_FLAG
4518
4519 #define PERL_SIGNALS_UNSAFE_FLAG 0x0001
4520
4521 #if (PERL_BCDVERSION < 0x5008000)
4522 # define D_PPP_PERL_SIGNALS_INIT PERL_SIGNALS_UNSAFE_FLAG
4523 #else
4524 # define D_PPP_PERL_SIGNALS_INIT 0
4525 #endif
4526
4527 #if defined(NEED_PL_signals)
4528 static U32 DPPP_(my_PL_signals) = D_PPP_PERL_SIGNALS_INIT;
4529 #elif defined(NEED_PL_signals_GLOBAL)
4530 U32 DPPP_(my_PL_signals) = D_PPP_PERL_SIGNALS_INIT;
4531 #else
4532 extern U32 DPPP_(my_PL_signals);
4533 #endif
4534 #define PL_signals DPPP_(my_PL_signals)
4535
4536 #endif
4537
4538 /* Hint: PL_ppaddr
4539 * Calling an op via PL_ppaddr requires passing a context argument
4540 * for threaded builds. Since the context argument is different for
4541 * 5.005 perls, you can use aTHXR (supplied by ppport.h), which will
4542 * automatically be defined as the correct argument.
4543 */
4544
4545 #if (PERL_BCDVERSION <= 0x5005005)
4546 /* Replace: 1 */
4547 # define PL_ppaddr ppaddr
4548 # define PL_no_modify no_modify
4549 /* Replace: 0 */
4550 #endif
4551
4552 #if (PERL_BCDVERSION <= 0x5004005)
4553 /* Replace: 1 */
4554 # define PL_DBsignal DBsignal
4555 # define PL_DBsingle DBsingle
4556 # define PL_DBsub DBsub
4557 # define PL_DBtrace DBtrace
4558 # define PL_Sv Sv
4559 # define PL_bufend bufend
4560 # define PL_bufptr bufptr
4561 # define PL_compiling compiling
4562 # define PL_copline copline
4563 # define PL_curcop curcop
4564 # define PL_curstash curstash
4565 # define PL_debstash debstash
4566 # define PL_defgv defgv
4567 # define PL_diehook diehook
4568 # define PL_dirty dirty
4569 # define PL_dowarn dowarn
4570 # define PL_errgv errgv
4571 # define PL_error_count error_count
4572 # define PL_expect expect
4573 # define PL_hexdigit hexdigit
4574 # define PL_hints hints
4575 # define PL_in_my in_my
4576 # define PL_laststatval laststatval
4577 # define PL_lex_state lex_state
4578 # define PL_lex_stuff lex_stuff
4579 # define PL_linestr linestr
4580 # define PL_na na
4581 # define PL_perl_destruct_level perl_destruct_level
4582 # define PL_perldb perldb
4583 # define PL_rsfp_filters rsfp_filters
4584 # define PL_rsfp rsfp
4585 # define PL_stack_base stack_base
4586 # define PL_stack_sp stack_sp
4587 # define PL_statcache statcache
4588 # define PL_stdingv stdingv
4589 # define PL_sv_arenaroot sv_arenaroot
4590 # define PL_sv_no sv_no
4591 # define PL_sv_undef sv_undef
4592 # define PL_sv_yes sv_yes
4593 # define PL_tainted tainted
4594 # define PL_tainting tainting
4595 # define PL_tokenbuf tokenbuf
4596 /* Replace: 0 */
4597 #endif
4598
4599 /* Warning: PL_parser
4600 * For perl versions earlier than 5.9.5, this is an always
4601 * non-NULL dummy. Also, it cannot be dereferenced. Don't
4602 * use it if you can avoid is and unless you absolutely know
4603 * what you're doing.
4604 * If you always check that PL_parser is non-NULL, you can
4605 * define DPPP_PL_parser_NO_DUMMY to avoid the creation of
4606 * a dummy parser structure.
4607 */
4608
4609 #if (PERL_BCDVERSION >= 0x5009005)
4610 # ifdef DPPP_PL_parser_NO_DUMMY
4611 # define D_PPP_my_PL_parser_var(var) ((PL_parser ? PL_parser : \
4612 (croak("panic: PL_parser == NULL in %s:%d", \
4613 __FILE__, __LINE__), (yy_parser *) NULL))->var)
4614 # else
4615 # ifdef DPPP_PL_parser_NO_DUMMY_WARNING
4616 # define D_PPP_parser_dummy_warning(var)
4617 # else
4618 # define D_PPP_parser_dummy_warning(var) \
4619 warn("warning: dummy PL_" #var " used in %s:%d", __FILE__, __LINE__),
4620 # endif
4621 # define D_PPP_my_PL_parser_var(var) ((PL_parser ? PL_parser : \
4622 (D_PPP_parser_dummy_warning(var) &DPPP_(dummy_PL_parser)))->var)
4623 #if defined(NEED_PL_parser)
4624 static yy_parser DPPP_(dummy_PL_parser);
4625 #elif defined(NEED_PL_parser_GLOBAL)
4626 yy_parser DPPP_(dummy_PL_parser);
4627 #else
4628 extern yy_parser DPPP_(dummy_PL_parser);
4629 #endif
4630
4631 # endif
4632
4633 /* 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 */
4634 /* Warning: PL_expect, PL_copline, PL_rsfp, PL_rsfp_filters, PL_linestr, PL_bufptr, PL_bufend, PL_lex_state, PL_lex_stuff, PL_tokenbuf
4635 * Do not use this variable unless you know exactly what you're
4636 * doint. It is internal to the perl parser and may change or even
4637 * be removed in the future. As of perl 5.9.5, you have to check
4638 * for (PL_parser != NULL) for this variable to have any effect.
4639 * An always non-NULL PL_parser dummy is provided for earlier
4640 * perl versions.
4641 * If PL_parser is NULL when you try to access this variable, a
4642 * dummy is being accessed instead and a warning is issued unless
4643 * you define DPPP_PL_parser_NO_DUMMY_WARNING.
4644 * If DPPP_PL_parser_NO_DUMMY is defined, the code trying to access
4645 * this variable will croak with a panic message.
4646 */
4647
4648 # define PL_expect D_PPP_my_PL_parser_var(expect)
4649 # define PL_copline D_PPP_my_PL_parser_var(copline)
4650 # define PL_rsfp D_PPP_my_PL_parser_var(rsfp)
4651 # define PL_rsfp_filters D_PPP_my_PL_parser_var(rsfp_filters)
4652 # define PL_linestr D_PPP_my_PL_parser_var(linestr)
4653 # define PL_bufptr D_PPP_my_PL_parser_var(bufptr)
4654 # define PL_bufend D_PPP_my_PL_parser_var(bufend)
4655 # define PL_lex_state D_PPP_my_PL_parser_var(lex_state)
4656 # define PL_lex_stuff D_PPP_my_PL_parser_var(lex_stuff)
4657 # define PL_tokenbuf D_PPP_my_PL_parser_var(tokenbuf)
4658 # define PL_in_my D_PPP_my_PL_parser_var(in_my)
4659 # define PL_in_my_stash D_PPP_my_PL_parser_var(in_my_stash)
4660 # define PL_error_count D_PPP_my_PL_parser_var(error_count)
4661
4662
4663 #else
4664
4665 /* ensure that PL_parser != NULL and cannot be dereferenced */
4666 # define PL_parser ((void *) 1)
4667
4668 #endif
4669 #ifndef mPUSHs
4670 # define mPUSHs(s) PUSHs(sv_2mortal(s))
4671 #endif
4672
4673 #ifndef PUSHmortal
4674 # define PUSHmortal PUSHs(sv_newmortal())
4675 #endif
4676
4677 #ifndef mPUSHp
4678 # define mPUSHp(p,l) sv_setpvn(PUSHmortal, (p), (l))
4679 #endif
4680
4681 #ifndef mPUSHn
4682 # define mPUSHn(n) sv_setnv(PUSHmortal, (NV)(n))
4683 #endif
4684
4685 #ifndef mPUSHi
4686 # define mPUSHi(i) sv_setiv(PUSHmortal, (IV)(i))
4687 #endif
4688
4689 #ifndef mPUSHu
4690 # define mPUSHu(u) sv_setuv(PUSHmortal, (UV)(u))
4691 #endif
4692 #ifndef mXPUSHs
4693 # define mXPUSHs(s) XPUSHs(sv_2mortal(s))
4694 #endif
4695
4696 #ifndef XPUSHmortal
4697 # define XPUSHmortal XPUSHs(sv_newmortal())
4698 #endif
4699
4700 #ifndef mXPUSHp
4701 # define mXPUSHp(p,l) STMT_START { EXTEND(sp,1); sv_setpvn(PUSHmortal, (p), (l)); } STMT_END
4702 #endif
4703
4704 #ifndef mXPUSHn
4705 # define mXPUSHn(n) STMT_START { EXTEND(sp,1); sv_setnv(PUSHmortal, (NV)(n)); } STMT_END
4706 #endif
4707
4708 #ifndef mXPUSHi
4709 # define mXPUSHi(i) STMT_START { EXTEND(sp,1); sv_setiv(PUSHmortal, (IV)(i)); } STMT_END
4710 #endif
4711
4712 #ifndef mXPUSHu
4713 # define mXPUSHu(u) STMT_START { EXTEND(sp,1); sv_setuv(PUSHmortal, (UV)(u)); } STMT_END
4714 #endif
4715
4716 /* Replace: 1 */
4717 #ifndef call_sv
4718 # define call_sv perl_call_sv
4719 #endif
4720
4721 #ifndef call_pv
4722 # define call_pv perl_call_pv
4723 #endif
4724
4725 #ifndef call_argv
4726 # define call_argv perl_call_argv
4727 #endif
4728
4729 #ifndef call_method
4730 # define call_method perl_call_method
4731 #endif
4732 #ifndef eval_sv
4733 # define eval_sv perl_eval_sv
4734 #endif
4735
4736 /* Replace: 0 */
4737 #ifndef PERL_LOADMOD_DENY
4738 # define PERL_LOADMOD_DENY 0x1
4739 #endif
4740
4741 #ifndef PERL_LOADMOD_NOIMPORT
4742 # define PERL_LOADMOD_NOIMPORT 0x2
4743 #endif
4744
4745 #ifndef PERL_LOADMOD_IMPORT_OPS
4746 # define PERL_LOADMOD_IMPORT_OPS 0x4
4747 #endif
4748
4749 #ifndef G_METHOD
4750 # define G_METHOD 64
4751 # ifdef call_sv
4752 # undef call_sv
4753 # endif
4754 # if (PERL_BCDVERSION < 0x5006000)
4755 # define call_sv(sv, flags) ((flags) & G_METHOD ? perl_call_method((char *) SvPV_nolen_const(sv), \
4756 (flags) & ~G_METHOD) : perl_call_sv(sv, flags))
4757 # else
4758 # define call_sv(sv, flags) ((flags) & G_METHOD ? Perl_call_method(aTHX_ (char *) SvPV_nolen_const(sv), \
4759 (flags) & ~G_METHOD) : Perl_call_sv(aTHX_ sv, flags))
4760 # endif
4761 #endif
4762
4763 /* Replace perl_eval_pv with eval_pv */
4764
4765 #ifndef eval_pv
4766 #if defined(NEED_eval_pv)
4767 static SV* DPPP_(my_eval_pv)(char *p, I32 croak_on_error);
4768 static
4769 #else
4770 extern SV* DPPP_(my_eval_pv)(char *p, I32 croak_on_error);
4771 #endif
4772
4773 #ifdef eval_pv
4774 # undef eval_pv
4775 #endif
4776 #define eval_pv(a,b) DPPP_(my_eval_pv)(aTHX_ a,b)
4777 #define Perl_eval_pv DPPP_(my_eval_pv)
4778
4779 #if defined(NEED_eval_pv) || defined(NEED_eval_pv_GLOBAL)
4780
4781 SV*
4782 DPPP_(my_eval_pv)(char *p, I32 croak_on_error)
4783 {
4784 dSP;
4785 SV* sv = newSVpv(p, 0);
4786
4787 PUSHMARK(sp);
4788 eval_sv(sv, G_SCALAR);
4789 SvREFCNT_dec(sv);
4790
4791 SPAGAIN;
4792 sv = POPs;
4793 PUTBACK;
4794
4795 if (croak_on_error && SvTRUE(GvSV(errgv)))
4796 croak(SvPVx(GvSV(errgv), na));
4797
4798 return sv;
4799 }
4800
4801 #endif
4802 #endif
4803
4804 #ifndef vload_module
4805 #if defined(NEED_vload_module)
4806 static void DPPP_(my_vload_module)(U32 flags, SV *name, SV *ver, va_list *args);
4807 static
4808 #else
4809 extern void DPPP_(my_vload_module)(U32 flags, SV *name, SV *ver, va_list *args);
4810 #endif
4811
4812 #ifdef vload_module
4813 # undef vload_module
4814 #endif
4815 #define vload_module(a,b,c,d) DPPP_(my_vload_module)(aTHX_ a,b,c,d)
4816 #define Perl_vload_module DPPP_(my_vload_module)
4817
4818 #if defined(NEED_vload_module) || defined(NEED_vload_module_GLOBAL)
4819
4820 void
4821 DPPP_(my_vload_module)(U32 flags, SV *name, SV *ver, va_list *args)
4822 {
4823 dTHR;
4824 dVAR;
4825 OP *veop, *imop;
4826
4827 OP * const modname = newSVOP(OP_CONST, 0, name);
4828 /* 5.005 has a somewhat hacky force_normal that doesn't croak on
4829 SvREADONLY() if PL_compling is true. Current perls take care in
4830 ck_require() to correctly turn off SvREADONLY before calling
4831 force_normal_flags(). This seems a better fix than fudging PL_compling
4832 */
4833 SvREADONLY_off(((SVOP*)modname)->op_sv);
4834 modname->op_private |= OPpCONST_BARE;
4835 if (ver) {
4836 veop = newSVOP(OP_CONST, 0, ver);
4837 }
4838 else
4839 veop = NULL;
4840 if (flags & PERL_LOADMOD_NOIMPORT) {
4841 imop = sawparens(newNULLLIST());
4842 }
4843 else if (flags & PERL_LOADMOD_IMPORT_OPS) {
4844 imop = va_arg(*args, OP*);
4845 }
4846 else {
4847 SV *sv;
4848 imop = NULL;
4849 sv = va_arg(*args, SV*);
4850 while (sv) {
4851 imop = append_elem(OP_LIST, imop, newSVOP(OP_CONST, 0, sv));
4852 sv = va_arg(*args, SV*);
4853 }
4854 }
4855 {
4856 const line_t ocopline = PL_copline;
4857 COP * const ocurcop = PL_curcop;
4858 const int oexpect = PL_expect;
4859
4860 #if (PERL_BCDVERSION >= 0x5004000)
4861 utilize(!(flags & PERL_LOADMOD_DENY), start_subparse(FALSE, 0),
4862 veop, modname, imop);
4863 #elif (PERL_BCDVERSION > 0x5003000)
4864 utilize(!(flags & PERL_LOADMOD_DENY), start_subparse(),
4865 veop, modname, imop);
4866 #else
4867 utilize(!(flags & PERL_LOADMOD_DENY), start_subparse(),
4868 modname, imop);
4869 #endif
4870 PL_expect = oexpect;
4871 PL_copline = ocopline;
4872 PL_curcop = ocurcop;
4873 }
4874 }
4875
4876 #endif
4877 #endif
4878
4879 #ifndef load_module
4880 #if defined(NEED_load_module)
4881 static void DPPP_(my_load_module)(U32 flags, SV *name, SV *ver, ...);
4882 static
4883 #else
4884 extern void DPPP_(my_load_module)(U32 flags, SV *name, SV *ver, ...);
4885 #endif
4886
4887 #ifdef load_module
4888 # undef load_module
4889 #endif
4890 #define load_module DPPP_(my_load_module)
4891 #define Perl_load_module DPPP_(my_load_module)
4892
4893 #if defined(NEED_load_module) || defined(NEED_load_module_GLOBAL)
4894
4895 void
4896 DPPP_(my_load_module)(U32 flags, SV *name, SV *ver, ...)
4897 {
4898 va_list args;
4899 va_start(args, ver);
4900 vload_module(flags, name, ver, &args);
4901 va_end(args);
4902 }
4903
4904 #endif
4905 #endif
4906 #ifndef newRV_inc
4907 # define newRV_inc(sv) newRV(sv) /* Replace */
4908 #endif
4909
4910 #ifndef newRV_noinc
4911 #if defined(NEED_newRV_noinc)
4912 static SV * DPPP_(my_newRV_noinc)(SV *sv);
4913 static
4914 #else
4915 extern SV * DPPP_(my_newRV_noinc)(SV *sv);
4916 #endif
4917
4918 #ifdef newRV_noinc
4919 # undef newRV_noinc
4920 #endif
4921 #define newRV_noinc(a) DPPP_(my_newRV_noinc)(aTHX_ a)
4922 #define Perl_newRV_noinc DPPP_(my_newRV_noinc)
4923
4924 #if defined(NEED_newRV_noinc) || defined(NEED_newRV_noinc_GLOBAL)
4925 SV *
4926 DPPP_(my_newRV_noinc)(SV *sv)
4927 {
4928 SV *rv = (SV *)newRV(sv);
4929 SvREFCNT_dec(sv);
4930 return rv;
4931 }
4932 #endif
4933 #endif
4934
4935 /* Hint: newCONSTSUB
4936 * Returns a CV* as of perl-5.7.1. This return value is not supported
4937 * by Devel::PPPort.
4938 */
4939
4940 /* newCONSTSUB from IO.xs is in the core starting with 5.004_63 */
4941 #if (PERL_BCDVERSION < 0x5004063) && (PERL_BCDVERSION != 0x5004005)
4942 #if defined(NEED_newCONSTSUB)
4943 static void DPPP_(my_newCONSTSUB)(HV *stash, const char *name, SV *sv);
4944 static
4945 #else
4946 extern void DPPP_(my_newCONSTSUB)(HV *stash, const char *name, SV *sv);
4947 #endif
4948
4949 #ifdef newCONSTSUB
4950 # undef newCONSTSUB
4951 #endif
4952 #define newCONSTSUB(a,b,c) DPPP_(my_newCONSTSUB)(aTHX_ a,b,c)
4953 #define Perl_newCONSTSUB DPPP_(my_newCONSTSUB)
4954
4955 #if defined(NEED_newCONSTSUB) || defined(NEED_newCONSTSUB_GLOBAL)
4956
4957 /* This is just a trick to avoid a dependency of newCONSTSUB on PL_parser */
4958 /* (There's no PL_parser in perl < 5.005, so this is completely safe) */
4959 #define D_PPP_PL_copline PL_copline
4960
4961 void
4962 DPPP_(my_newCONSTSUB)(HV *stash, const char *name, SV *sv)
4963 {
4964 U32 oldhints = PL_hints;
4965 HV *old_cop_stash = PL_curcop->cop_stash;
4966 HV *old_curstash = PL_curstash;
4967 line_t oldline = PL_curcop->cop_line;
4968 PL_curcop->cop_line = D_PPP_PL_copline;
4969
4970 PL_hints &= ~HINT_BLOCK_SCOPE;
4971 if (stash)
4972 PL_curstash = PL_curcop->cop_stash = stash;
4973
4974 newSUB(
4975
4976 #if (PERL_BCDVERSION < 0x5003022)
4977 start_subparse(),
4978 #elif (PERL_BCDVERSION == 0x5003022)
4979 start_subparse(0),
4980 #else /* 5.003_23 onwards */
4981 start_subparse(FALSE, 0),
4982 #endif
4983
4984 newSVOP(OP_CONST, 0, newSVpv((char *) name, 0)),
4985 newSVOP(OP_CONST, 0, &PL_sv_no), /* SvPV(&PL_sv_no) == "" -- GMB */
4986 newSTATEOP(0, Nullch, newSVOP(OP_CONST, 0, sv))
4987 );
4988
4989 PL_hints = oldhints;
4990 PL_curcop->cop_stash = old_cop_stash;
4991 PL_curstash = old_curstash;
4992 PL_curcop->cop_line = oldline;
4993 }
4994 #endif
4995 #endif
4996
4997 /*
4998 * Boilerplate macros for initializing and accessing interpreter-local
4999 * data from C. All statics in extensions should be reworked to use
5000 * this, if you want to make the extension thread-safe. See ext/re/re.xs
5001 * for an example of the use of these macros.
5002 *
5003 * Code that uses these macros is responsible for the following:
5004 * 1. #define MY_CXT_KEY to a unique string, e.g. "DynaLoader_guts"
5005 * 2. Declare a typedef named my_cxt_t that is a structure that contains
5006 * all the data that needs to be interpreter-local.
5007 * 3. Use the START_MY_CXT macro after the declaration of my_cxt_t.
5008 * 4. Use the MY_CXT_INIT macro such that it is called exactly once
5009 * (typically put in the BOOT: section).
5010 * 5. Use the members of the my_cxt_t structure everywhere as
5011 * MY_CXT.member.
5012 * 6. Use the dMY_CXT macro (a declaration) in all the functions that
5013 * access MY_CXT.
5014 */
5015
5016 #if defined(MULTIPLICITY) || defined(PERL_OBJECT) || \
5017 defined(PERL_CAPI) || defined(PERL_IMPLICIT_CONTEXT)
5018
5019 #ifndef START_MY_CXT
5020
5021 /* This must appear in all extensions that define a my_cxt_t structure,
5022 * right after the definition (i.e. at file scope). The non-threads
5023 * case below uses it to declare the data as static. */
5024 #define START_MY_CXT
5025
5026 #if (PERL_BCDVERSION < 0x5004068)
5027 /* Fetches the SV that keeps the per-interpreter data. */
5028 #define dMY_CXT_SV \
5029 SV *my_cxt_sv = get_sv(MY_CXT_KEY, FALSE)
5030 #else /* >= perl5.004_68 */
5031 #define dMY_CXT_SV \
5032 SV *my_cxt_sv = *hv_fetch(PL_modglobal, MY_CXT_KEY, \
5033 sizeof(MY_CXT_KEY)-1, TRUE)
5034 #endif /* < perl5.004_68 */
5035
5036 /* This declaration should be used within all functions that use the
5037 * interpreter-local data. */
5038 #define dMY_CXT \
5039 dMY_CXT_SV; \
5040 my_cxt_t *my_cxtp = INT2PTR(my_cxt_t*,SvUV(my_cxt_sv))
5041
5042 /* Creates and zeroes the per-interpreter data.
5043 * (We allocate my_cxtp in a Perl SV so that it will be released when
5044 * the interpreter goes away.) */
5045 #define MY_CXT_INIT \
5046 dMY_CXT_SV; \
5047 /* newSV() allocates one more than needed */ \
5048 my_cxt_t *my_cxtp = (my_cxt_t*)SvPVX(newSV(sizeof(my_cxt_t)-1));\
5049 Zero(my_cxtp, 1, my_cxt_t); \
5050 sv_setuv(my_cxt_sv, PTR2UV(my_cxtp))
5051
5052 /* This macro must be used to access members of the my_cxt_t structure.
5053 * e.g. MYCXT.some_data */
5054 #define MY_CXT (*my_cxtp)
5055
5056 /* Judicious use of these macros can reduce the number of times dMY_CXT
5057 * is used. Use is similar to pTHX, aTHX etc. */
5058 #define pMY_CXT my_cxt_t *my_cxtp
5059 #define pMY_CXT_ pMY_CXT,
5060 #define _pMY_CXT ,pMY_CXT
5061 #define aMY_CXT my_cxtp
5062 #define aMY_CXT_ aMY_CXT,
5063 #define _aMY_CXT ,aMY_CXT
5064
5065 #endif /* START_MY_CXT */
5066
5067 #ifndef MY_CXT_CLONE
5068 /* Clones the per-interpreter data. */
5069 #define MY_CXT_CLONE \
5070 dMY_CXT_SV; \
5071 my_cxt_t *my_cxtp = (my_cxt_t*)SvPVX(newSV(sizeof(my_cxt_t)-1));\
5072 Copy(INT2PTR(my_cxt_t*, SvUV(my_cxt_sv)), my_cxtp, 1, my_cxt_t);\
5073 sv_setuv(my_cxt_sv, PTR2UV(my_cxtp))
5074 #endif
5075
5076 #else /* single interpreter */
5077
5078 #ifndef START_MY_CXT
5079
5080 #define START_MY_CXT static my_cxt_t my_cxt;
5081 #define dMY_CXT_SV dNOOP
5082 #define dMY_CXT dNOOP
5083 #define MY_CXT_INIT NOOP
5084 #define MY_CXT my_cxt
5085
5086 #define pMY_CXT void
5087 #define pMY_CXT_
5088 #define _pMY_CXT
5089 #define aMY_CXT
5090 #define aMY_CXT_
5091 #define _aMY_CXT
5092
5093 #endif /* START_MY_CXT */
5094
5095 #ifndef MY_CXT_CLONE
5096 #define MY_CXT_CLONE NOOP
5097 #endif
5098
5099 #endif
5100
5101 #ifndef IVdf
5102 # if IVSIZE == LONGSIZE
5103 # define IVdf "ld"
5104 # define UVuf "lu"
5105 # define UVof "lo"
5106 # define UVxf "lx"
5107 # define UVXf "lX"
5108 # elif IVSIZE == INTSIZE
5109 # define IVdf "d"
5110 # define UVuf "u"
5111 # define UVof "o"
5112 # define UVxf "x"
5113 # define UVXf "X"
5114 # else
5115 # error "cannot define IV/UV formats"
5116 # endif
5117 #endif
5118
5119 #ifndef NVef
5120 # if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) && \
5121 defined(PERL_PRIfldbl) && (PERL_BCDVERSION != 0x5006000)
5122 /* Not very likely, but let's try anyway. */
5123 # define NVef PERL_PRIeldbl
5124 # define NVff PERL_PRIfldbl
5125 # define NVgf PERL_PRIgldbl
5126 # else
5127 # define NVef "e"
5128 # define NVff "f"
5129 # define NVgf "g"
5130 # endif
5131 #endif
5132
5133 #ifndef SvREFCNT_inc
5134 # ifdef PERL_USE_GCC_BRACE_GROUPS
5135 # define SvREFCNT_inc(sv) \
5136 ({ \
5137 SV * const _sv = (SV*)(sv); \
5138 if (_sv) \
5139 (SvREFCNT(_sv))++; \
5140 _sv; \
5141 })
5142 # else
5143 # define SvREFCNT_inc(sv) \
5144 ((PL_Sv=(SV*)(sv)) ? (++(SvREFCNT(PL_Sv)),PL_Sv) : NULL)
5145 # endif
5146 #endif
5147
5148 #ifndef SvREFCNT_inc_simple
5149 # ifdef PERL_USE_GCC_BRACE_GROUPS
5150 # define SvREFCNT_inc_simple(sv) \
5151 ({ \
5152 if (sv) \
5153 (SvREFCNT(sv))++; \
5154 (SV *)(sv); \
5155 })
5156 # else
5157 # define SvREFCNT_inc_simple(sv) \
5158 ((sv) ? (SvREFCNT(sv)++,(SV*)(sv)) : NULL)
5159 # endif
5160 #endif
5161
5162 #ifndef SvREFCNT_inc_NN
5163 # ifdef PERL_USE_GCC_BRACE_GROUPS
5164 # define SvREFCNT_inc_NN(sv) \
5165 ({ \
5166 SV * const _sv = (SV*)(sv); \
5167 SvREFCNT(_sv)++; \
5168 _sv; \
5169 })
5170 # else
5171 # define SvREFCNT_inc_NN(sv) \
5172 (PL_Sv=(SV*)(sv),++(SvREFCNT(PL_Sv)),PL_Sv)
5173 # endif
5174 #endif
5175
5176 #ifndef SvREFCNT_inc_void
5177 # ifdef PERL_USE_GCC_BRACE_GROUPS
5178 # define SvREFCNT_inc_void(sv) \
5179 ({ \
5180 SV * const _sv = (SV*)(sv); \
5181 if (_sv) \
5182 (void)(SvREFCNT(_sv)++); \
5183 })
5184 # else
5185 # define SvREFCNT_inc_void(sv) \
5186 (void)((PL_Sv=(SV*)(sv)) ? ++(SvREFCNT(PL_Sv)) : 0)
5187 # endif
5188 #endif
5189 #ifndef SvREFCNT_inc_simple_void
5190 # define SvREFCNT_inc_simple_void(sv) STMT_START { if (sv) SvREFCNT(sv)++; } STMT_END
5191 #endif
5192
5193 #ifndef SvREFCNT_inc_simple_NN
5194 # define SvREFCNT_inc_simple_NN(sv) (++SvREFCNT(sv), (SV*)(sv))
5195 #endif
5196
5197 #ifndef SvREFCNT_inc_void_NN
5198 # define SvREFCNT_inc_void_NN(sv) (void)(++SvREFCNT((SV*)(sv)))
5199 #endif
5200
5201 #ifndef SvREFCNT_inc_simple_void_NN
5202 # define SvREFCNT_inc_simple_void_NN(sv) (void)(++SvREFCNT((SV*)(sv)))
5203 #endif
5204
5205 #ifndef newSV_type
5206
5207 #if defined(NEED_newSV_type)
5208 static SV* DPPP_(my_newSV_type)(pTHX_ svtype const t);
5209 static
5210 #else
5211 extern SV* DPPP_(my_newSV_type)(pTHX_ svtype const t);
5212 #endif
5213
5214 #ifdef newSV_type
5215 # undef newSV_type
5216 #endif
5217 #define newSV_type(a) DPPP_(my_newSV_type)(aTHX_ a)
5218 #define Perl_newSV_type DPPP_(my_newSV_type)
5219
5220 #if defined(NEED_newSV_type) || defined(NEED_newSV_type_GLOBAL)
5221
5222 SV*
5223 DPPP_(my_newSV_type)(pTHX_ svtype const t)
5224 {
5225 SV* const sv = newSV(0);
5226 sv_upgrade(sv, t);
5227 return sv;
5228 }
5229
5230 #endif
5231
5232 #endif
5233
5234 #if (PERL_BCDVERSION < 0x5006000)
5235 # define D_PPP_CONSTPV_ARG(x) ((char *) (x))
5236 #else
5237 # define D_PPP_CONSTPV_ARG(x) (x)
5238 #endif
5239 #ifndef newSVpvn
5240 # define newSVpvn(data,len) ((data) \
5241 ? ((len) ? newSVpv((data), (len)) : newSVpv("", 0)) \
5242 : newSV(0))
5243 #endif
5244 #ifndef newSVpvn_utf8
5245 # define newSVpvn_utf8(s, len, u) newSVpvn_flags((s), (len), (u) ? SVf_UTF8 : 0)
5246 #endif
5247 #ifndef SVf_UTF8
5248 # define SVf_UTF8 0
5249 #endif
5250
5251 #ifndef newSVpvn_flags
5252
5253 #if defined(NEED_newSVpvn_flags)
5254 static SV * DPPP_(my_newSVpvn_flags)(pTHX_ const char *s, STRLEN len, U32 flags);
5255 static
5256 #else
5257 extern SV * DPPP_(my_newSVpvn_flags)(pTHX_ const char *s, STRLEN len, U32 flags);
5258 #endif
5259
5260 #ifdef newSVpvn_flags
5261 # undef newSVpvn_flags
5262 #endif
5263 #define newSVpvn_flags(a,b,c) DPPP_(my_newSVpvn_flags)(aTHX_ a,b,c)
5264 #define Perl_newSVpvn_flags DPPP_(my_newSVpvn_flags)
5265
5266 #if defined(NEED_newSVpvn_flags) || defined(NEED_newSVpvn_flags_GLOBAL)
5267
5268 SV *
5269 DPPP_(my_newSVpvn_flags)(pTHX_ const char *s, STRLEN len, U32 flags)
5270 {
5271 SV *sv = newSVpvn(D_PPP_CONSTPV_ARG(s), len);
5272 SvFLAGS(sv) |= (flags & SVf_UTF8);
5273 return (flags & SVs_TEMP) ? sv_2mortal(sv) : sv;
5274 }
5275
5276 #endif
5277
5278 #endif
5279
5280 /* Backwards compatibility stuff... :-( */
5281 #if !defined(NEED_sv_2pv_flags) && defined(NEED_sv_2pv_nolen)
5282 # define NEED_sv_2pv_flags
5283 #endif
5284 #if !defined(NEED_sv_2pv_flags_GLOBAL) && defined(NEED_sv_2pv_nolen_GLOBAL)
5285 # define NEED_sv_2pv_flags_GLOBAL
5286 #endif
5287
5288 /* Hint: sv_2pv_nolen
5289 * Use the SvPV_nolen() or SvPV_nolen_const() macros instead of sv_2pv_nolen().
5290 */
5291 #ifndef sv_2pv_nolen
5292 # define sv_2pv_nolen(sv) SvPV_nolen(sv)
5293 #endif
5294
5295 #ifdef SvPVbyte
5296
5297 /* Hint: SvPVbyte
5298 * Does not work in perl-5.6.1, ppport.h implements a version
5299 * borrowed from perl-5.7.3.
5300 */
5301
5302 #if (PERL_BCDVERSION < 0x5007000)
5303
5304 #if defined(NEED_sv_2pvbyte)
5305 static char * DPPP_(my_sv_2pvbyte)(pTHX_ SV *sv, STRLEN *lp);
5306 static
5307 #else
5308 extern char * DPPP_(my_sv_2pvbyte)(pTHX_ SV *sv, STRLEN *lp);
5309 #endif
5310
5311 #ifdef sv_2pvbyte
5312 # undef sv_2pvbyte
5313 #endif
5314 #define sv_2pvbyte(a,b) DPPP_(my_sv_2pvbyte)(aTHX_ a,b)
5315 #define Perl_sv_2pvbyte DPPP_(my_sv_2pvbyte)
5316
5317 #if defined(NEED_sv_2pvbyte) || defined(NEED_sv_2pvbyte_GLOBAL)
5318
5319 char *
5320 DPPP_(my_sv_2pvbyte)(pTHX_ SV *sv, STRLEN *lp)
5321 {
5322 sv_utf8_downgrade(sv,0);
5323 return SvPV(sv,*lp);
5324 }
5325
5326 #endif
5327
5328 /* Hint: sv_2pvbyte
5329 * Use the SvPVbyte() macro instead of sv_2pvbyte().
5330 */
5331
5332 #undef SvPVbyte
5333
5334 #define SvPVbyte(sv, lp) \
5335 ((SvFLAGS(sv) & (SVf_POK|SVf_UTF8)) == (SVf_POK) \
5336 ? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_2pvbyte(sv, &lp))
5337
5338 #endif
5339
5340 #else
5341
5342 # define SvPVbyte SvPV
5343 # define sv_2pvbyte sv_2pv
5344
5345 #endif
5346 #ifndef sv_2pvbyte_nolen
5347 # define sv_2pvbyte_nolen(sv) sv_2pv_nolen(sv)
5348 #endif
5349
5350 /* Hint: sv_pvn
5351 * Always use the SvPV() macro instead of sv_pvn().
5352 */
5353
5354 /* Hint: sv_pvn_force
5355 * Always use the SvPV_force() macro instead of sv_pvn_force().
5356 */
5357
5358 /* If these are undefined, they're not handled by the core anyway */
5359 #ifndef SV_IMMEDIATE_UNREF
5360 # define SV_IMMEDIATE_UNREF 0
5361 #endif
5362
5363 #ifndef SV_GMAGIC
5364 # define SV_GMAGIC 0
5365 #endif
5366
5367 #ifndef SV_COW_DROP_PV
5368 # define SV_COW_DROP_PV 0
5369 #endif
5370
5371 #ifndef SV_UTF8_NO_ENCODING
5372 # define SV_UTF8_NO_ENCODING 0
5373 #endif
5374
5375 #ifndef SV_NOSTEAL
5376 # define SV_NOSTEAL 0
5377 #endif
5378
5379 #ifndef SV_CONST_RETURN
5380 # define SV_CONST_RETURN 0
5381 #endif
5382
5383 #ifndef SV_MUTABLE_RETURN
5384 # define SV_MUTABLE_RETURN 0
5385 #endif
5386
5387 #ifndef SV_SMAGIC
5388 # define SV_SMAGIC 0
5389 #endif
5390
5391 #ifndef SV_HAS_TRAILING_NUL
5392 # define SV_HAS_TRAILING_NUL 0
5393 #endif
5394
5395 #ifndef SV_COW_SHARED_HASH_KEYS
5396 # define SV_COW_SHARED_HASH_KEYS 0
5397 #endif
5398
5399 #if (PERL_BCDVERSION < 0x5007002)
5400
5401 #if defined(NEED_sv_2pv_flags)
5402 static char * DPPP_(my_sv_2pv_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags);
5403 static
5404 #else
5405 extern char * DPPP_(my_sv_2pv_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags);
5406 #endif
5407
5408 #ifdef sv_2pv_flags
5409 # undef sv_2pv_flags
5410 #endif
5411 #define sv_2pv_flags(a,b,c) DPPP_(my_sv_2pv_flags)(aTHX_ a,b,c)
5412 #define Perl_sv_2pv_flags DPPP_(my_sv_2pv_flags)
5413
5414 #if defined(NEED_sv_2pv_flags) || defined(NEED_sv_2pv_flags_GLOBAL)
5415
5416 char *
5417 DPPP_(my_sv_2pv_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags)
5418 {
5419 STRLEN n_a = (STRLEN) flags;
5420 return sv_2pv(sv, lp ? lp : &n_a);
5421 }
5422
5423 #endif
5424
5425 #if defined(NEED_sv_pvn_force_flags)
5426 static char * DPPP_(my_sv_pvn_force_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags);
5427 static
5428 #else
5429 extern char * DPPP_(my_sv_pvn_force_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags);
5430 #endif
5431
5432 #ifdef sv_pvn_force_flags
5433 # undef sv_pvn_force_flags
5434 #endif
5435 #define sv_pvn_force_flags(a,b,c) DPPP_(my_sv_pvn_force_flags)(aTHX_ a,b,c)
5436 #define Perl_sv_pvn_force_flags DPPP_(my_sv_pvn_force_flags)
5437
5438 #if defined(NEED_sv_pvn_force_flags) || defined(NEED_sv_pvn_force_flags_GLOBAL)
5439
5440 char *
5441 DPPP_(my_sv_pvn_force_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags)
5442 {
5443 STRLEN n_a = (STRLEN) flags;
5444 return sv_pvn_force(sv, lp ? lp : &n_a);
5445 }
5446
5447 #endif
5448
5449 #endif
5450
5451 #if (PERL_BCDVERSION < 0x5008008) || ( (PERL_BCDVERSION >= 0x5009000) && (PERL_BCDVERSION < 0x5009003) )
5452 # define DPPP_SVPV_NOLEN_LP_ARG &PL_na
5453 #else
5454 # define DPPP_SVPV_NOLEN_LP_ARG 0
5455 #endif
5456 #ifndef SvPV_const
5457 # define SvPV_const(sv, lp) SvPV_flags_const(sv, lp, SV_GMAGIC)
5458 #endif
5459
5460 #ifndef SvPV_mutable
5461 # define SvPV_mutable(sv, lp) SvPV_flags_mutable(sv, lp, SV_GMAGIC)
5462 #endif
5463 #ifndef SvPV_flags
5464 # define SvPV_flags(sv, lp, flags) \
5465 ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
5466 ? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_2pv_flags(sv, &lp, flags))
5467 #endif
5468 #ifndef SvPV_flags_const
5469 # define SvPV_flags_const(sv, lp, flags) \
5470 ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
5471 ? ((lp = SvCUR(sv)), SvPVX_const(sv)) : \
5472 (const char*) sv_2pv_flags(sv, &lp, flags|SV_CONST_RETURN))
5473 #endif
5474 #ifndef SvPV_flags_const_nolen
5475 # define SvPV_flags_const_nolen(sv, flags) \
5476 ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
5477 ? SvPVX_const(sv) : \
5478 (const char*) sv_2pv_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, flags|SV_CONST_RETURN))
5479 #endif
5480 #ifndef SvPV_flags_mutable
5481 # define SvPV_flags_mutable(sv, lp, flags) \
5482 ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
5483 ? ((lp = SvCUR(sv)), SvPVX_mutable(sv)) : \
5484 sv_2pv_flags(sv, &lp, flags|SV_MUTABLE_RETURN))
5485 #endif
5486 #ifndef SvPV_force
5487 # define SvPV_force(sv, lp) SvPV_force_flags(sv, lp, SV_GMAGIC)
5488 #endif
5489
5490 #ifndef SvPV_force_nolen
5491 # define SvPV_force_nolen(sv) SvPV_force_flags_nolen(sv, SV_GMAGIC)
5492 #endif
5493
5494 #ifndef SvPV_force_mutable
5495 # define SvPV_force_mutable(sv, lp) SvPV_force_flags_mutable(sv, lp, SV_GMAGIC)
5496 #endif
5497
5498 #ifndef SvPV_force_nomg
5499 # define SvPV_force_nomg(sv, lp) SvPV_force_flags(sv, lp, 0)
5500 #endif
5501
5502 #ifndef SvPV_force_nomg_nolen
5503 # define SvPV_force_nomg_nolen(sv) SvPV_force_flags_nolen(sv, 0)
5504 #endif
5505 #ifndef SvPV_force_flags
5506 # define SvPV_force_flags(sv, lp, flags) \
5507 ((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == SVf_POK \
5508 ? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_pvn_force_flags(sv, &lp, flags))
5509 #endif
5510 #ifndef SvPV_force_flags_nolen
5511 # define SvPV_force_flags_nolen(sv, flags) \
5512 ((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == SVf_POK \
5513 ? SvPVX(sv) : sv_pvn_force_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, flags))
5514 #endif
5515 #ifndef SvPV_force_flags_mutable
5516 # define SvPV_force_flags_mutable(sv, lp, flags) \
5517 ((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == SVf_POK \
5518 ? ((lp = SvCUR(sv)), SvPVX_mutable(sv)) \
5519 : sv_pvn_force_flags(sv, &lp, flags|SV_MUTABLE_RETURN))
5520 #endif
5521 #ifndef SvPV_nolen
5522 # define SvPV_nolen(sv) \
5523 ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
5524 ? SvPVX(sv) : sv_2pv_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, SV_GMAGIC))
5525 #endif
5526 #ifndef SvPV_nolen_const
5527 # define SvPV_nolen_const(sv) \
5528 ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
5529 ? SvPVX_const(sv) : sv_2pv_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, SV_GMAGIC|SV_CONST_RETURN))
5530 #endif
5531 #ifndef SvPV_nomg
5532 # define SvPV_nomg(sv, lp) SvPV_flags(sv, lp, 0)
5533 #endif
5534
5535 #ifndef SvPV_nomg_const
5536 # define SvPV_nomg_const(sv, lp) SvPV_flags_const(sv, lp, 0)
5537 #endif
5538
5539 #ifndef SvPV_nomg_const_nolen
5540 # define SvPV_nomg_const_nolen(sv) SvPV_flags_const_nolen(sv, 0)
5541 #endif
5542
5543 #ifndef SvPV_nomg_nolen
5544 # define SvPV_nomg_nolen(sv) ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
5545 ? SvPVX(sv) : sv_2pv_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, 0))
5546 #endif
5547 #ifndef SvPV_renew
5548 # define SvPV_renew(sv,n) STMT_START { SvLEN_set(sv, n); \
5549 SvPV_set((sv), (char *) saferealloc( \
5550 (Malloc_t)SvPVX(sv), (MEM_SIZE)((n)))); \
5551 } STMT_END
5552 #endif
5553 #ifndef SvMAGIC_set
5554 # define SvMAGIC_set(sv, val) \
5555 STMT_START { assert(SvTYPE(sv) >= SVt_PVMG); \
5556 (((XPVMG*) SvANY(sv))->xmg_magic = (val)); } STMT_END
5557 #endif
5558
5559 #if (PERL_BCDVERSION < 0x5009003)
5560 #ifndef SvPVX_const
5561 # define SvPVX_const(sv) ((const char*) (0 + SvPVX(sv)))
5562 #endif
5563
5564 #ifndef SvPVX_mutable
5565 # define SvPVX_mutable(sv) (0 + SvPVX(sv))
5566 #endif
5567 #ifndef SvRV_set
5568 # define SvRV_set(sv, val) \
5569 STMT_START { assert(SvTYPE(sv) >= SVt_RV); \
5570 (((XRV*) SvANY(sv))->xrv_rv = (val)); } STMT_END
5571 #endif
5572
5573 #else
5574 #ifndef SvPVX_const
5575 # define SvPVX_const(sv) ((const char*)((sv)->sv_u.svu_pv))
5576 #endif
5577
5578 #ifndef SvPVX_mutable
5579 # define SvPVX_mutable(sv) ((sv)->sv_u.svu_pv)
5580 #endif
5581 #ifndef SvRV_set
5582 # define SvRV_set(sv, val) \
5583 STMT_START { assert(SvTYPE(sv) >= SVt_RV); \
5584 ((sv)->sv_u.svu_rv = (val)); } STMT_END
5585 #endif
5586
5587 #endif
5588 #ifndef SvSTASH_set
5589 # define SvSTASH_set(sv, val) \
5590 STMT_START { assert(SvTYPE(sv) >= SVt_PVMG); \
5591 (((XPVMG*) SvANY(sv))->xmg_stash = (val)); } STMT_END
5592 #endif
5593
5594 #if (PERL_BCDVERSION < 0x5004000)
5595 #ifndef SvUV_set
5596 # define SvUV_set(sv, val) \
5597 STMT_START { assert(SvTYPE(sv) == SVt_IV || SvTYPE(sv) >= SVt_PVIV); \
5598 (((XPVIV*) SvANY(sv))->xiv_iv = (IV) (val)); } STMT_END
5599 #endif
5600
5601 #else
5602 #ifndef SvUV_set
5603 # define SvUV_set(sv, val) \
5604 STMT_START { assert(SvTYPE(sv) == SVt_IV || SvTYPE(sv) >= SVt_PVIV); \
5605 (((XPVUV*) SvANY(sv))->xuv_uv = (val)); } STMT_END
5606 #endif
5607
5608 #endif
5609
5610 #if (PERL_BCDVERSION >= 0x5004000) && !defined(vnewSVpvf)
5611 #if defined(NEED_vnewSVpvf)
5612 static SV * DPPP_(my_vnewSVpvf)(pTHX_ const char *pat, va_list *args);
5613 static
5614 #else
5615 extern SV * DPPP_(my_vnewSVpvf)(pTHX_ const char *pat, va_list *args);
5616 #endif
5617
5618 #ifdef vnewSVpvf
5619 # undef vnewSVpvf
5620 #endif
5621 #define vnewSVpvf(a,b) DPPP_(my_vnewSVpvf)(aTHX_ a,b)
5622 #define Perl_vnewSVpvf DPPP_(my_vnewSVpvf)
5623
5624 #if defined(NEED_vnewSVpvf) || defined(NEED_vnewSVpvf_GLOBAL)
5625
5626 SV *
5627 DPPP_(my_vnewSVpvf)(pTHX_ const char *pat, va_list *args)
5628 {
5629 register SV *sv = newSV(0);
5630 sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*));
5631 return sv;
5632 }
5633
5634 #endif
5635 #endif
5636
5637 #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vcatpvf)
5638 # define sv_vcatpvf(sv, pat, args) sv_vcatpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*))
5639 #endif
5640
5641 #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vsetpvf)
5642 # define sv_vsetpvf(sv, pat, args) sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*))
5643 #endif
5644
5645 #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_catpvf_mg)
5646 #if defined(NEED_sv_catpvf_mg)
5647 static void DPPP_(my_sv_catpvf_mg)(pTHX_ SV *sv, const char *pat, ...);
5648 static
5649 #else
5650 extern void DPPP_(my_sv_catpvf_mg)(pTHX_ SV *sv, const char *pat, ...);
5651 #endif
5652
5653 #define Perl_sv_catpvf_mg DPPP_(my_sv_catpvf_mg)
5654
5655 #if defined(NEED_sv_catpvf_mg) || defined(NEED_sv_catpvf_mg_GLOBAL)
5656
5657 void
5658 DPPP_(my_sv_catpvf_mg)(pTHX_ SV *sv, const char *pat, ...)
5659 {
5660 va_list args;
5661 va_start(args, pat);
5662 sv_vcatpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*));
5663 SvSETMAGIC(sv);
5664 va_end(args);
5665 }
5666
5667 #endif
5668 #endif
5669
5670 #ifdef PERL_IMPLICIT_CONTEXT
5671 #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_catpvf_mg_nocontext)
5672 #if defined(NEED_sv_catpvf_mg_nocontext)
5673 static void DPPP_(my_sv_catpvf_mg_nocontext)(SV *sv, const char *pat, ...);
5674 static
5675 #else
5676 extern void DPPP_(my_sv_catpvf_mg_nocontext)(SV *sv, const char *pat, ...);
5677 #endif
5678
5679 #define sv_catpvf_mg_nocontext DPPP_(my_sv_catpvf_mg_nocontext)
5680 #define Perl_sv_catpvf_mg_nocontext DPPP_(my_sv_catpvf_mg_nocontext)
5681
5682 #if defined(NEED_sv_catpvf_mg_nocontext) || defined(NEED_sv_catpvf_mg_nocontext_GLOBAL)
5683
5684 void
5685 DPPP_(my_sv_catpvf_mg_nocontext)(SV *sv, const char *pat, ...)
5686 {
5687 dTHX;
5688 va_list args;
5689 va_start(args, pat);
5690 sv_vcatpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*));
5691 SvSETMAGIC(sv);
5692 va_end(args);
5693 }
5694
5695 #endif
5696 #endif
5697 #endif
5698
5699 /* sv_catpvf_mg depends on sv_catpvf_mg_nocontext */
5700 #ifndef sv_catpvf_mg
5701 # ifdef PERL_IMPLICIT_CONTEXT
5702 # define sv_catpvf_mg Perl_sv_catpvf_mg_nocontext
5703 # else
5704 # define sv_catpvf_mg Perl_sv_catpvf_mg
5705 # endif
5706 #endif
5707
5708 #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vcatpvf_mg)
5709 # define sv_vcatpvf_mg(sv, pat, args) \
5710 STMT_START { \
5711 sv_vcatpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*)); \
5712 SvSETMAGIC(sv); \
5713 } STMT_END
5714 #endif
5715
5716 #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_setpvf_mg)
5717 #if defined(NEED_sv_setpvf_mg)
5718 static void DPPP_(my_sv_setpvf_mg)(pTHX_ SV *sv, const char *pat, ...);
5719 static
5720 #else
5721 extern void DPPP_(my_sv_setpvf_mg)(pTHX_ SV *sv, const char *pat, ...);
5722 #endif
5723
5724 #define Perl_sv_setpvf_mg DPPP_(my_sv_setpvf_mg)
5725
5726 #if defined(NEED_sv_setpvf_mg) || defined(NEED_sv_setpvf_mg_GLOBAL)
5727
5728 void
5729 DPPP_(my_sv_setpvf_mg)(pTHX_ SV *sv, const char *pat, ...)
5730 {
5731 va_list args;
5732 va_start(args, pat);
5733 sv_vsetpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*));
5734 SvSETMAGIC(sv);
5735 va_end(args);
5736 }
5737
5738 #endif
5739 #endif
5740
5741 #ifdef PERL_IMPLICIT_CONTEXT
5742 #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_setpvf_mg_nocontext)
5743 #if defined(NEED_sv_setpvf_mg_nocontext)
5744 static void DPPP_(my_sv_setpvf_mg_nocontext)(SV *sv, const char *pat, ...);
5745 static
5746 #else
5747 extern void DPPP_(my_sv_setpvf_mg_nocontext)(SV *sv, const char *pat, ...);
5748 #endif
5749
5750 #define sv_setpvf_mg_nocontext DPPP_(my_sv_setpvf_mg_nocontext)
5751 #define Perl_sv_setpvf_mg_nocontext DPPP_(my_sv_setpvf_mg_nocontext)
5752
5753 #if defined(NEED_sv_setpvf_mg_nocontext) || defined(NEED_sv_setpvf_mg_nocontext_GLOBAL)
5754
5755 void
5756 DPPP_(my_sv_setpvf_mg_nocontext)(SV *sv, const char *pat, ...)
5757 {
5758 dTHX;
5759 va_list args;
5760 va_start(args, pat);
5761 sv_vsetpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*));
5762 SvSETMAGIC(sv);
5763 va_end(args);
5764 }
5765
5766 #endif
5767 #endif
5768 #endif
5769
5770 /* sv_setpvf_mg depends on sv_setpvf_mg_nocontext */
5771 #ifndef sv_setpvf_mg
5772 # ifdef PERL_IMPLICIT_CONTEXT
5773 # define sv_setpvf_mg Perl_sv_setpvf_mg_nocontext
5774 # else
5775 # define sv_setpvf_mg Perl_sv_setpvf_mg
5776 # endif
5777 #endif
5778
5779 #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vsetpvf_mg)
5780 # define sv_vsetpvf_mg(sv, pat, args) \
5781 STMT_START { \
5782 sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*)); \
5783 SvSETMAGIC(sv); \
5784 } STMT_END
5785 #endif
5786
5787 /* Hint: newSVpvn_share
5788 * The SVs created by this function only mimic the behaviour of
5789 * shared PVs without really being shared. Only use if you know
5790 * what you're doing.
5791 */
5792
5793 #ifndef newSVpvn_share
5794
5795 #if defined(NEED_newSVpvn_share)
5796 static SV * DPPP_(my_newSVpvn_share)(pTHX_ const char *src, I32 len, U32 hash);
5797 static
5798 #else
5799 extern SV * DPPP_(my_newSVpvn_share)(pTHX_ const char *src, I32 len, U32 hash);
5800 #endif
5801
5802 #ifdef newSVpvn_share
5803 # undef newSVpvn_share
5804 #endif
5805 #define newSVpvn_share(a,b,c) DPPP_(my_newSVpvn_share)(aTHX_ a,b,c)
5806 #define Perl_newSVpvn_share DPPP_(my_newSVpvn_share)
5807
5808 #if defined(NEED_newSVpvn_share) || defined(NEED_newSVpvn_share_GLOBAL)
5809
5810 SV *
5811 DPPP_(my_newSVpvn_share)(pTHX_ const char *src, I32 len, U32 hash)
5812 {
5813 SV *sv;
5814 if (len < 0)
5815 len = -len;
5816 if (!hash)
5817 PERL_HASH(hash, (char*) src, len);
5818 sv = newSVpvn((char *) src, len);
5819 sv_upgrade(sv, SVt_PVIV);
5820 SvIVX(sv) = hash;
5821 SvREADONLY_on(sv);
5822 SvPOK_on(sv);
5823 return sv;
5824 }
5825
5826 #endif
5827
5828 #endif
5829 #ifndef SvSHARED_HASH
5830 # define SvSHARED_HASH(sv) (0 + SvUVX(sv))
5831 #endif
5832 #ifndef HvNAME_get
5833 # define HvNAME_get(hv) HvNAME(hv)
5834 #endif
5835 #ifndef HvNAMELEN_get
5836 # define HvNAMELEN_get(hv) (HvNAME_get(hv) ? (I32)strlen(HvNAME_get(hv)) : 0)
5837 #endif
5838 #ifndef GvSVn
5839 # define GvSVn(gv) GvSV(gv)
5840 #endif
5841
5842 #ifndef isGV_with_GP
5843 # define isGV_with_GP(gv) isGV(gv)
5844 #endif
5845
5846 #ifndef gv_fetchpvn_flags
5847 # define gv_fetchpvn_flags(name, len, flags, svt) gv_fetchpv(name, flags, svt)
5848 #endif
5849
5850 #ifndef gv_fetchsv
5851 # define gv_fetchsv(name, flags, svt) gv_fetchpv(SvPV_nolen_const(name), flags, svt)
5852 #endif
5853 #ifndef get_cvn_flags
5854 # define get_cvn_flags(name, namelen, flags) get_cv(name, flags)
5855 #endif
5856 #ifndef WARN_ALL
5857 # define WARN_ALL 0
5858 #endif
5859
5860 #ifndef WARN_CLOSURE
5861 # define WARN_CLOSURE 1
5862 #endif
5863
5864 #ifndef WARN_DEPRECATED
5865 # define WARN_DEPRECATED 2
5866 #endif
5867
5868 #ifndef WARN_EXITING
5869 # define WARN_EXITING 3
5870 #endif
5871
5872 #ifndef WARN_GLOB
5873 # define WARN_GLOB 4
5874 #endif
5875
5876 #ifndef WARN_IO
5877 # define WARN_IO 5
5878 #endif
5879
5880 #ifndef WARN_CLOSED
5881 # define WARN_CLOSED 6
5882 #endif
5883
5884 #ifndef WARN_EXEC
5885 # define WARN_EXEC 7
5886 #endif
5887
5888 #ifndef WARN_LAYER
5889 # define WARN_LAYER 8
5890 #endif
5891
5892 #ifndef WARN_NEWLINE
5893 # define WARN_NEWLINE 9
5894 #endif
5895
5896 #ifndef WARN_PIPE
5897 # define WARN_PIPE 10
5898 #endif
5899
5900 #ifndef WARN_UNOPENED
5901 # define WARN_UNOPENED 11
5902 #endif
5903
5904 #ifndef WARN_MISC
5905 # define WARN_MISC 12
5906 #endif
5907
5908 #ifndef WARN_NUMERIC
5909 # define WARN_NUMERIC 13
5910 #endif
5911
5912 #ifndef WARN_ONCE
5913 # define WARN_ONCE 14
5914 #endif
5915
5916 #ifndef WARN_OVERFLOW
5917 # define WARN_OVERFLOW 15
5918 #endif
5919
5920 #ifndef WARN_PACK
5921 # define WARN_PACK 16
5922 #endif
5923
5924 #ifndef WARN_PORTABLE
5925 # define WARN_PORTABLE 17
5926 #endif
5927
5928 #ifndef WARN_RECURSION
5929 # define WARN_RECURSION 18
5930 #endif
5931
5932 #ifndef WARN_REDEFINE
5933 # define WARN_REDEFINE 19
5934 #endif
5935
5936 #ifndef WARN_REGEXP
5937 # define WARN_REGEXP 20
5938 #endif
5939
5940 #ifndef WARN_SEVERE
5941 # define WARN_SEVERE 21
5942 #endif
5943
5944 #ifndef WARN_DEBUGGING
5945 # define WARN_DEBUGGING 22
5946 #endif
5947
5948 #ifndef WARN_INPLACE
5949 # define WARN_INPLACE 23
5950 #endif
5951
5952 #ifndef WARN_INTERNAL
5953 # define WARN_INTERNAL 24
5954 #endif
5955
5956 #ifndef WARN_MALLOC
5957 # define WARN_MALLOC 25
5958 #endif
5959
5960 #ifndef WARN_SIGNAL
5961 # define WARN_SIGNAL 26
5962 #endif
5963
5964 #ifndef WARN_SUBSTR
5965 # define WARN_SUBSTR 27
5966 #endif
5967
5968 #ifndef WARN_SYNTAX
5969 # define WARN_SYNTAX 28
5970 #endif
5971
5972 #ifndef WARN_AMBIGUOUS
5973 # define WARN_AMBIGUOUS 29
5974 #endif
5975
5976 #ifndef WARN_BAREWORD
5977 # define WARN_BAREWORD 30
5978 #endif
5979
5980 #ifndef WARN_DIGIT
5981 # define WARN_DIGIT 31
5982 #endif
5983
5984 #ifndef WARN_PARENTHESIS
5985 # define WARN_PARENTHESIS 32
5986 #endif
5987
5988 #ifndef WARN_PRECEDENCE
5989 # define WARN_PRECEDENCE 33
5990 #endif
5991
5992 #ifndef WARN_PRINTF
5993 # define WARN_PRINTF 34
5994 #endif
5995
5996 #ifndef WARN_PROTOTYPE
5997 # define WARN_PROTOTYPE 35
5998 #endif
5999
6000 #ifndef WARN_QW
6001 # define WARN_QW 36
6002 #endif
6003
6004 #ifndef WARN_RESERVED
6005 # define WARN_RESERVED 37
6006 #endif
6007
6008 #ifndef WARN_SEMICOLON
6009 # define WARN_SEMICOLON 38
6010 #endif
6011
6012 #ifndef WARN_TAINT
6013 # define WARN_TAINT 39
6014 #endif
6015
6016 #ifndef WARN_THREADS
6017 # define WARN_THREADS 40
6018 #endif
6019
6020 #ifndef WARN_UNINITIALIZED
6021 # define WARN_UNINITIALIZED 41
6022 #endif
6023
6024 #ifndef WARN_UNPACK
6025 # define WARN_UNPACK 42
6026 #endif
6027
6028 #ifndef WARN_UNTIE
6029 # define WARN_UNTIE 43
6030 #endif
6031
6032 #ifndef WARN_UTF8
6033 # define WARN_UTF8 44
6034 #endif
6035
6036 #ifndef WARN_VOID
6037 # define WARN_VOID 45
6038 #endif
6039
6040 #ifndef WARN_ASSERTIONS
6041 # define WARN_ASSERTIONS 46
6042 #endif
6043 #ifndef packWARN
6044 # define packWARN(a) (a)
6045 #endif
6046
6047 #ifndef ckWARN
6048 # ifdef G_WARN_ON
6049 # define ckWARN(a) (PL_dowarn & G_WARN_ON)
6050 # else
6051 # define ckWARN(a) PL_dowarn
6052 # endif
6053 #endif
6054
6055 #if (PERL_BCDVERSION >= 0x5004000) && !defined(warner)
6056 #if defined(NEED_warner)
6057 static void DPPP_(my_warner)(U32 err, const char *pat, ...);
6058 static
6059 #else
6060 extern void DPPP_(my_warner)(U32 err, const char *pat, ...);
6061 #endif
6062
6063 #define Perl_warner DPPP_(my_warner)
6064
6065 #if defined(NEED_warner) || defined(NEED_warner_GLOBAL)
6066
6067 void
6068 DPPP_(my_warner)(U32 err, const char *pat, ...)
6069 {
6070 SV *sv;
6071 va_list args;
6072
6073 PERL_UNUSED_ARG(err);
6074
6075 va_start(args, pat);
6076 sv = vnewSVpvf(pat, &args);
6077 va_end(args);
6078 sv_2mortal(sv);
6079 warn("%s", SvPV_nolen(sv));
6080 }
6081
6082 #define warner Perl_warner
6083
6084 #define Perl_warner_nocontext Perl_warner
6085
6086 #endif
6087 #endif
6088
6089 /* concatenating with "" ensures that only literal strings are accepted as argument
6090 * note that STR_WITH_LEN() can't be used as argument to macros or functions that
6091 * under some configurations might be macros
6092 */
6093 #ifndef STR_WITH_LEN
6094 # define STR_WITH_LEN(s) (s ""), (sizeof(s)-1)
6095 #endif
6096 #ifndef newSVpvs
6097 # define newSVpvs(str) newSVpvn(str "", sizeof(str) - 1)
6098 #endif
6099
6100 #ifndef newSVpvs_flags
6101 # define newSVpvs_flags(str, flags) newSVpvn_flags(str "", sizeof(str) - 1, flags)
6102 #endif
6103
6104 #ifndef newSVpvs_share
6105 # define newSVpvs_share(str) newSVpvn_share(str "", sizeof(str) - 1, 0)
6106 #endif
6107
6108 #ifndef sv_catpvs
6109 # define sv_catpvs(sv, str) sv_catpvn(sv, str "", sizeof(str) - 1)
6110 #endif
6111
6112 #ifndef sv_setpvs
6113 # define sv_setpvs(sv, str) sv_setpvn(sv, str "", sizeof(str) - 1)
6114 #endif
6115
6116 #ifndef hv_fetchs
6117 # define hv_fetchs(hv, key, lval) hv_fetch(hv, key "", sizeof(key) - 1, lval)
6118 #endif
6119
6120 #ifndef hv_stores
6121 # define hv_stores(hv, key, val) hv_store(hv, key "", sizeof(key) - 1, val, 0)
6122 #endif
6123 #ifndef gv_fetchpvs
6124 # define gv_fetchpvs(name, flags, svt) gv_fetchpvn_flags(name "", sizeof(name) - 1, flags, svt)
6125 #endif
6126
6127 #ifndef gv_stashpvs
6128 # define gv_stashpvs(name, flags) gv_stashpvn(name "", sizeof(name) - 1, flags)
6129 #endif
6130 #ifndef get_cvs
6131 # define get_cvs(name, flags) get_cvn_flags(name "", sizeof(name)-1, flags)
6132 #endif
6133 #ifndef SvGETMAGIC
6134 # define SvGETMAGIC(x) STMT_START { if (SvGMAGICAL(x)) mg_get(x); } STMT_END
6135 #endif
6136
6137 /* Some random bits for sv_unmagicext. These should probably be pulled in for
6138 real and organized at some point */
6139 #ifndef HEf_SVKEY
6140 # define HEf_SVKEY -2
6141 #endif
6142
6143 #if defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN)
6144 # define MUTABLE_PTR(p) ({ void *_p = (p); _p; })
6145 #else
6146 # define MUTABLE_PTR(p) ((void *) (p))
6147 #endif
6148
6149 #define MUTABLE_SV(p) ((SV *)MUTABLE_PTR(p))
6150
6151 /* end of random bits */
6152 #ifndef PERL_MAGIC_sv
6153 # define PERL_MAGIC_sv '\0'
6154 #endif
6155
6156 #ifndef PERL_MAGIC_overload
6157 # define PERL_MAGIC_overload 'A'
6158 #endif
6159
6160 #ifndef PERL_MAGIC_overload_elem
6161 # define PERL_MAGIC_overload_elem 'a'
6162 #endif
6163
6164 #ifndef PERL_MAGIC_overload_table
6165 # define PERL_MAGIC_overload_table 'c'
6166 #endif
6167
6168 #ifndef PERL_MAGIC_bm
6169 # define PERL_MAGIC_bm 'B'
6170 #endif
6171
6172 #ifndef PERL_MAGIC_regdata
6173 # define PERL_MAGIC_regdata 'D'
6174 #endif
6175
6176 #ifndef PERL_MAGIC_regdatum
6177 # define PERL_MAGIC_regdatum 'd'
6178 #endif
6179
6180 #ifndef PERL_MAGIC_env
6181 # define PERL_MAGIC_env 'E'
6182 #endif
6183
6184 #ifndef PERL_MAGIC_envelem
6185 # define PERL_MAGIC_envelem 'e'
6186 #endif
6187
6188 #ifndef PERL_MAGIC_fm
6189 # define PERL_MAGIC_fm 'f'
6190 #endif
6191
6192 #ifndef PERL_MAGIC_regex_global
6193 # define PERL_MAGIC_regex_global 'g'
6194 #endif
6195
6196 #ifndef PERL_MAGIC_isa
6197 # define PERL_MAGIC_isa 'I'
6198 #endif
6199
6200 #ifndef PERL_MAGIC_isaelem
6201 # define PERL_MAGIC_isaelem 'i'
6202 #endif
6203
6204 #ifndef PERL_MAGIC_nkeys
6205 # define PERL_MAGIC_nkeys 'k'
6206 #endif
6207
6208 #ifndef PERL_MAGIC_dbfile
6209 # define PERL_MAGIC_dbfile 'L'
6210 #endif
6211
6212 #ifndef PERL_MAGIC_dbline
6213 # define PERL_MAGIC_dbline 'l'
6214 #endif
6215
6216 #ifndef PERL_MAGIC_mutex
6217 # define PERL_MAGIC_mutex 'm'
6218 #endif
6219
6220 #ifndef PERL_MAGIC_shared
6221 # define PERL_MAGIC_shared 'N'
6222 #endif
6223
6224 #ifndef PERL_MAGIC_shared_scalar
6225 # define PERL_MAGIC_shared_scalar 'n'
6226 #endif
6227
6228 #ifndef PERL_MAGIC_collxfrm
6229 # define PERL_MAGIC_collxfrm 'o'
6230 #endif
6231
6232 #ifndef PERL_MAGIC_tied
6233 # define PERL_MAGIC_tied 'P'
6234 #endif
6235
6236 #ifndef PERL_MAGIC_tiedelem
6237 # define PERL_MAGIC_tiedelem 'p'
6238 #endif
6239
6240 #ifndef PERL_MAGIC_tiedscalar
6241 # define PERL_MAGIC_tiedscalar 'q'
6242 #endif
6243
6244 #ifndef PERL_MAGIC_qr
6245 # define PERL_MAGIC_qr 'r'
6246 #endif
6247
6248 #ifndef PERL_MAGIC_sig
6249 # define PERL_MAGIC_sig 'S'
6250 #endif
6251
6252 #ifndef PERL_MAGIC_sigelem
6253 # define PERL_MAGIC_sigelem 's'
6254 #endif
6255
6256 #ifndef PERL_MAGIC_taint
6257 # define PERL_MAGIC_taint 't'
6258 #endif
6259
6260 #ifndef PERL_MAGIC_uvar
6261 # define PERL_MAGIC_uvar 'U'
6262 #endif
6263
6264 #ifndef PERL_MAGIC_uvar_elem
6265 # define PERL_MAGIC_uvar_elem 'u'
6266 #endif
6267
6268 #ifndef PERL_MAGIC_vstring
6269 # define PERL_MAGIC_vstring 'V'
6270 #endif
6271
6272 #ifndef PERL_MAGIC_vec
6273 # define PERL_MAGIC_vec 'v'
6274 #endif
6275
6276 #ifndef PERL_MAGIC_utf8
6277 # define PERL_MAGIC_utf8 'w'
6278 #endif
6279
6280 #ifndef PERL_MAGIC_substr
6281 # define PERL_MAGIC_substr 'x'
6282 #endif
6283
6284 #ifndef PERL_MAGIC_defelem
6285 # define PERL_MAGIC_defelem 'y'
6286 #endif
6287
6288 #ifndef PERL_MAGIC_glob
6289 # define PERL_MAGIC_glob '*'
6290 #endif
6291
6292 #ifndef PERL_MAGIC_arylen
6293 # define PERL_MAGIC_arylen '#'
6294 #endif
6295
6296 #ifndef PERL_MAGIC_pos
6297 # define PERL_MAGIC_pos '.'
6298 #endif
6299
6300 #ifndef PERL_MAGIC_backref
6301 # define PERL_MAGIC_backref '<'
6302 #endif
6303
6304 #ifndef PERL_MAGIC_ext
6305 # define PERL_MAGIC_ext '~'
6306 #endif
6307
6308 /* That's the best we can do... */
6309 #ifndef sv_catpvn_nomg
6310 # define sv_catpvn_nomg sv_catpvn
6311 #endif
6312
6313 #ifndef sv_catsv_nomg
6314 # define sv_catsv_nomg sv_catsv
6315 #endif
6316
6317 #ifndef sv_setsv_nomg
6318 # define sv_setsv_nomg sv_setsv
6319 #endif
6320
6321 #ifndef sv_pvn_nomg
6322 # define sv_pvn_nomg sv_pvn
6323 #endif
6324
6325 #ifndef SvIV_nomg
6326 # define SvIV_nomg SvIV
6327 #endif
6328
6329 #ifndef SvUV_nomg
6330 # define SvUV_nomg SvUV
6331 #endif
6332
6333 #ifndef sv_catpv_mg
6334 # define sv_catpv_mg(sv, ptr) \
6335 STMT_START { \
6336 SV *TeMpSv = sv; \
6337 sv_catpv(TeMpSv,ptr); \
6338 SvSETMAGIC(TeMpSv); \
6339 } STMT_END
6340 #endif
6341
6342 #ifndef sv_catpvn_mg
6343 # define sv_catpvn_mg(sv, ptr, len) \
6344 STMT_START { \
6345 SV *TeMpSv = sv; \
6346 sv_catpvn(TeMpSv,ptr,len); \
6347 SvSETMAGIC(TeMpSv); \
6348 } STMT_END
6349 #endif
6350
6351 #ifndef sv_catsv_mg
6352 # define sv_catsv_mg(dsv, ssv) \
6353 STMT_START { \
6354 SV *TeMpSv = dsv; \
6355 sv_catsv(TeMpSv,ssv); \
6356 SvSETMAGIC(TeMpSv); \
6357 } STMT_END
6358 #endif
6359
6360 #ifndef sv_setiv_mg
6361 # define sv_setiv_mg(sv, i) \
6362 STMT_START { \
6363 SV *TeMpSv = sv; \
6364 sv_setiv(TeMpSv,i); \
6365 SvSETMAGIC(TeMpSv); \
6366 } STMT_END
6367 #endif
6368
6369 #ifndef sv_setnv_mg
6370 # define sv_setnv_mg(sv, num) \
6371 STMT_START { \
6372 SV *TeMpSv = sv; \
6373 sv_setnv(TeMpSv,num); \
6374 SvSETMAGIC(TeMpSv); \
6375 } STMT_END
6376 #endif
6377
6378 #ifndef sv_setpv_mg
6379 # define sv_setpv_mg(sv, ptr) \
6380 STMT_START { \
6381 SV *TeMpSv = sv; \
6382 sv_setpv(TeMpSv,ptr); \
6383 SvSETMAGIC(TeMpSv); \
6384 } STMT_END
6385 #endif
6386
6387 #ifndef sv_setpvn_mg
6388 # define sv_setpvn_mg(sv, ptr, len) \
6389 STMT_START { \
6390 SV *TeMpSv = sv; \
6391 sv_setpvn(TeMpSv,ptr,len); \
6392 SvSETMAGIC(TeMpSv); \
6393 } STMT_END
6394 #endif
6395
6396 #ifndef sv_setsv_mg
6397 # define sv_setsv_mg(dsv, ssv) \
6398 STMT_START { \
6399 SV *TeMpSv = dsv; \
6400 sv_setsv(TeMpSv,ssv); \
6401 SvSETMAGIC(TeMpSv); \
6402 } STMT_END
6403 #endif
6404
6405 #ifndef sv_setuv_mg
6406 # define sv_setuv_mg(sv, i) \
6407 STMT_START { \
6408 SV *TeMpSv = sv; \
6409 sv_setuv(TeMpSv,i); \
6410 SvSETMAGIC(TeMpSv); \
6411 } STMT_END
6412 #endif
6413
6414 #ifndef sv_usepvn_mg
6415 # define sv_usepvn_mg(sv, ptr, len) \
6416 STMT_START { \
6417 SV *TeMpSv = sv; \
6418 sv_usepvn(TeMpSv,ptr,len); \
6419 SvSETMAGIC(TeMpSv); \
6420 } STMT_END
6421 #endif
6422 #ifndef SvVSTRING_mg
6423 # define SvVSTRING_mg(sv) (SvMAGICAL(sv) ? mg_find(sv, PERL_MAGIC_vstring) : NULL)
6424 #endif
6425
6426 /* Hint: sv_magic_portable
6427 * This is a compatibility function that is only available with
6428 * Devel::PPPort. It is NOT in the perl core.
6429 * Its purpose is to mimic the 5.8.0 behaviour of sv_magic() when
6430 * it is being passed a name pointer with namlen == 0. In that
6431 * case, perl 5.8.0 and later store the pointer, not a copy of it.
6432 * The compatibility can be provided back to perl 5.004. With
6433 * earlier versions, the code will not compile.
6434 */
6435
6436 #if (PERL_BCDVERSION < 0x5004000)
6437
6438 /* code that uses sv_magic_portable will not compile */
6439
6440 #elif (PERL_BCDVERSION < 0x5008000)
6441
6442 # define sv_magic_portable(sv, obj, how, name, namlen) \
6443 STMT_START { \
6444 SV *SvMp_sv = (sv); \
6445 char *SvMp_name = (char *) (name); \
6446 I32 SvMp_namlen = (namlen); \
6447 if (SvMp_name && SvMp_namlen == 0) \
6448 { \
6449 MAGIC *mg; \
6450 sv_magic(SvMp_sv, obj, how, 0, 0); \
6451 mg = SvMAGIC(SvMp_sv); \
6452 mg->mg_len = -42; /* XXX: this is the tricky part */ \
6453 mg->mg_ptr = SvMp_name; \
6454 } \
6455 else \
6456 { \
6457 sv_magic(SvMp_sv, obj, how, SvMp_name, SvMp_namlen); \
6458 } \
6459 } STMT_END
6460
6461 #else
6462
6463 # define sv_magic_portable(a, b, c, d, e) sv_magic(a, b, c, d, e)
6464
6465 #endif
6466
6467 #if !defined(mg_findext)
6468 #if defined(NEED_mg_findext)
6469 static MAGIC * DPPP_(my_mg_findext)(SV * sv, int type, const MGVTBL *vtbl);
6470 static
6471 #else
6472 extern MAGIC * DPPP_(my_mg_findext)(SV * sv, int type, const MGVTBL *vtbl);
6473 #endif
6474
6475 #define mg_findext DPPP_(my_mg_findext)
6476 #define Perl_mg_findext DPPP_(my_mg_findext)
6477
6478 #if defined(NEED_mg_findext) || defined(NEED_mg_findext_GLOBAL)
6479
6480 MAGIC *
6481 DPPP_(my_mg_findext)(SV * sv, int type, const MGVTBL *vtbl) {
6482 if (sv) {
6483 MAGIC *mg;
6484
6485 #ifdef AvPAD_NAMELIST
6486 assert(!(SvTYPE(sv) == SVt_PVAV && AvPAD_NAMELIST(sv)));
6487 #endif
6488
6489 for (mg = SvMAGIC (sv); mg; mg = mg->mg_moremagic) {
6490 if (mg->mg_type == type && mg->mg_virtual == vtbl)
6491 return mg;
6492 }
6493 }
6494
6495 return NULL;
6496 }
6497
6498 #endif
6499 #endif
6500
6501 #if !defined(sv_unmagicext)
6502 #if defined(NEED_sv_unmagicext)
6503 static int DPPP_(my_sv_unmagicext)(pTHX_ SV * const sv, const int type, MGVTBL * vtbl);
6504 static
6505 #else
6506 extern int DPPP_(my_sv_unmagicext)(pTHX_ SV * const sv, const int type, MGVTBL * vtbl);
6507 #endif
6508
6509 #ifdef sv_unmagicext
6510 # undef sv_unmagicext
6511 #endif
6512 #define sv_unmagicext(a,b,c) DPPP_(my_sv_unmagicext)(aTHX_ a,b,c)
6513 #define Perl_sv_unmagicext DPPP_(my_sv_unmagicext)
6514
6515 #if defined(NEED_sv_unmagicext) || defined(NEED_sv_unmagicext_GLOBAL)
6516
6517 int
6518 DPPP_(my_sv_unmagicext)(pTHX_ SV *const sv, const int type, MGVTBL *vtbl)
6519 {
6520 MAGIC* mg;
6521 MAGIC** mgp;
6522
6523 if (SvTYPE(sv) < SVt_PVMG || !SvMAGIC(sv))
6524 return 0;
6525 mgp = &(SvMAGIC(sv));
6526 for (mg = *mgp; mg; mg = *mgp) {
6527 const MGVTBL* const virt = mg->mg_virtual;
6528 if (mg->mg_type == type && virt == vtbl) {
6529 *mgp = mg->mg_moremagic;
6530 if (virt && virt->svt_free)
6531 virt->svt_free(aTHX_ sv, mg);
6532 if (mg->mg_ptr && mg->mg_type != PERL_MAGIC_regex_global) {
6533 if (mg->mg_len > 0)
6534 Safefree(mg->mg_ptr);
6535 else if (mg->mg_len == HEf_SVKEY) /* Questionable on older perls... */
6536 SvREFCNT_dec(MUTABLE_SV(mg->mg_ptr));
6537 else if (mg->mg_type == PERL_MAGIC_utf8)
6538 Safefree(mg->mg_ptr);
6539 }
6540 if (mg->mg_flags & MGf_REFCOUNTED)
6541 SvREFCNT_dec(mg->mg_obj);
6542 Safefree(mg);
6543 }
6544 else
6545 mgp = &mg->mg_moremagic;
6546 }
6547 if (SvMAGIC(sv)) {
6548 if (SvMAGICAL(sv)) /* if we're under save_magic, wait for restore_magic; */
6549 mg_magical(sv); /* else fix the flags now */
6550 }
6551 else {
6552 SvMAGICAL_off(sv);
6553 SvFLAGS(sv) |= (SvFLAGS(sv) & (SVp_IOK|SVp_NOK|SVp_POK)) >> PRIVSHIFT;
6554 }
6555 return 0;
6556 }
6557
6558 #endif
6559 #endif
6560
6561 #ifdef USE_ITHREADS
6562 #ifndef CopFILE
6563 # define CopFILE(c) ((c)->cop_file)
6564 #endif
6565
6566 #ifndef CopFILEGV
6567 # define CopFILEGV(c) (CopFILE(c) ? gv_fetchfile(CopFILE(c)) : Nullgv)
6568 #endif
6569
6570 #ifndef CopFILE_set
6571 # define CopFILE_set(c,pv) ((c)->cop_file = savepv(pv))
6572 #endif
6573
6574 #ifndef CopFILESV
6575 # define CopFILESV(c) (CopFILE(c) ? GvSV(gv_fetchfile(CopFILE(c))) : Nullsv)
6576 #endif
6577
6578 #ifndef CopFILEAV
6579 # define CopFILEAV(c) (CopFILE(c) ? GvAV(gv_fetchfile(CopFILE(c))) : Nullav)
6580 #endif
6581
6582 #ifndef CopSTASHPV
6583 # define CopSTASHPV(c) ((c)->cop_stashpv)
6584 #endif
6585
6586 #ifndef CopSTASHPV_set
6587 # define CopSTASHPV_set(c,pv) ((c)->cop_stashpv = ((pv) ? savepv(pv) : Nullch))
6588 #endif
6589
6590 #ifndef CopSTASH
6591 # define CopSTASH(c) (CopSTASHPV(c) ? gv_stashpv(CopSTASHPV(c),GV_ADD) : Nullhv)
6592 #endif
6593
6594 #ifndef CopSTASH_set
6595 # define CopSTASH_set(c,hv) CopSTASHPV_set(c, (hv) ? HvNAME(hv) : Nullch)
6596 #endif
6597
6598 #ifndef CopSTASH_eq
6599 # define CopSTASH_eq(c,hv) ((hv) && (CopSTASHPV(c) == HvNAME(hv) \
6600 || (CopSTASHPV(c) && HvNAME(hv) \
6601 && strEQ(CopSTASHPV(c), HvNAME(hv)))))
6602 #endif
6603
6604 #else
6605 #ifndef CopFILEGV
6606 # define CopFILEGV(c) ((c)->cop_filegv)
6607 #endif
6608
6609 #ifndef CopFILEGV_set
6610 # define CopFILEGV_set(c,gv) ((c)->cop_filegv = (GV*)SvREFCNT_inc(gv))
6611 #endif
6612
6613 #ifndef CopFILE_set
6614 # define CopFILE_set(c,pv) CopFILEGV_set((c), gv_fetchfile(pv))
6615 #endif
6616
6617 #ifndef CopFILESV
6618 # define CopFILESV(c) (CopFILEGV(c) ? GvSV(CopFILEGV(c)) : Nullsv)
6619 #endif
6620
6621 #ifndef CopFILEAV
6622 # define CopFILEAV(c) (CopFILEGV(c) ? GvAV(CopFILEGV(c)) : Nullav)
6623 #endif
6624
6625 #ifndef CopFILE
6626 # define CopFILE(c) (CopFILESV(c) ? SvPVX(CopFILESV(c)) : Nullch)
6627 #endif
6628
6629 #ifndef CopSTASH
6630 # define CopSTASH(c) ((c)->cop_stash)
6631 #endif
6632
6633 #ifndef CopSTASH_set
6634 # define CopSTASH_set(c,hv) ((c)->cop_stash = (hv))
6635 #endif
6636
6637 #ifndef CopSTASHPV
6638 # define CopSTASHPV(c) (CopSTASH(c) ? HvNAME(CopSTASH(c)) : Nullch)
6639 #endif
6640
6641 #ifndef CopSTASHPV_set
6642 # define CopSTASHPV_set(c,pv) CopSTASH_set((c), gv_stashpv(pv,GV_ADD))
6643 #endif
6644
6645 #ifndef CopSTASH_eq
6646 # define CopSTASH_eq(c,hv) (CopSTASH(c) == (hv))
6647 #endif
6648
6649 #endif /* USE_ITHREADS */
6650
6651 #if (PERL_BCDVERSION >= 0x5006000)
6652 #ifndef caller_cx
6653
6654 # if defined(NEED_caller_cx) || defined(NEED_caller_cx_GLOBAL)
6655 static I32
6656 DPPP_dopoptosub_at(const PERL_CONTEXT *cxstk, I32 startingblock)
6657 {
6658 I32 i;
6659
6660 for (i = startingblock; i >= 0; i--) {
6661 register const PERL_CONTEXT * const cx = &cxstk[i];
6662 switch (CxTYPE(cx)) {
6663 default:
6664 continue;
6665 case CXt_EVAL:
6666 case CXt_SUB:
6667 case CXt_FORMAT:
6668 return i;
6669 }
6670 }
6671 return i;
6672 }
6673 # endif
6674
6675 # if defined(NEED_caller_cx)
6676 static const PERL_CONTEXT * DPPP_(my_caller_cx)(pTHX_ I32 count, const PERL_CONTEXT **dbcxp);
6677 static
6678 #else
6679 extern const PERL_CONTEXT * DPPP_(my_caller_cx)(pTHX_ I32 count, const PERL_CONTEXT **dbcxp);
6680 #endif
6681
6682 #ifdef caller_cx
6683 # undef caller_cx
6684 #endif
6685 #define caller_cx(a,b) DPPP_(my_caller_cx)(aTHX_ a,b)
6686 #define Perl_caller_cx DPPP_(my_caller_cx)
6687
6688 #if defined(NEED_caller_cx) || defined(NEED_caller_cx_GLOBAL)
6689
6690 const PERL_CONTEXT *
6691 DPPP_(my_caller_cx)(pTHX_ I32 count, const PERL_CONTEXT **dbcxp)
6692 {
6693 register I32 cxix = DPPP_dopoptosub_at(cxstack, cxstack_ix);
6694 register const PERL_CONTEXT *cx;
6695 register const PERL_CONTEXT *ccstack = cxstack;
6696 const PERL_SI *top_si = PL_curstackinfo;
6697
6698 for (;;) {
6699 /* we may be in a higher stacklevel, so dig down deeper */
6700 while (cxix < 0 && top_si->si_type != PERLSI_MAIN) {
6701 top_si = top_si->si_prev;
6702 ccstack = top_si->si_cxstack;
6703 cxix = DPPP_dopoptosub_at(ccstack, top_si->si_cxix);
6704 }
6705 if (cxix < 0)
6706 return NULL;
6707 /* caller() should not report the automatic calls to &DB::sub */
6708 if (PL_DBsub && GvCV(PL_DBsub) && cxix >= 0 &&
6709 ccstack[cxix].blk_sub.cv == GvCV(PL_DBsub))
6710 count++;
6711 if (!count--)
6712 break;
6713 cxix = DPPP_dopoptosub_at(ccstack, cxix - 1);
6714 }
6715
6716 cx = &ccstack[cxix];
6717 if (dbcxp) *dbcxp = cx;
6718
6719 if (CxTYPE(cx) == CXt_SUB || CxTYPE(cx) == CXt_FORMAT) {
6720 const I32 dbcxix = DPPP_dopoptosub_at(ccstack, cxix - 1);
6721 /* We expect that ccstack[dbcxix] is CXt_SUB, anyway, the
6722 field below is defined for any cx. */
6723 /* caller() should not report the automatic calls to &DB::sub */
6724 if (PL_DBsub && GvCV(PL_DBsub) && dbcxix >= 0 && ccstack[dbcxix].blk_sub.cv == GvCV(PL_DBsub))
6725 cx = &ccstack[dbcxix];
6726 }
6727
6728 return cx;
6729 }
6730
6731 # endif
6732 #endif /* caller_cx */
6733 #endif /* 5.6.0 */
6734 #ifndef IN_PERL_COMPILETIME
6735 # define IN_PERL_COMPILETIME (PL_curcop == &PL_compiling)
6736 #endif
6737
6738 #ifndef IN_LOCALE_RUNTIME
6739 # define IN_LOCALE_RUNTIME (PL_curcop->op_private & HINT_LOCALE)
6740 #endif
6741
6742 #ifndef IN_LOCALE_COMPILETIME
6743 # define IN_LOCALE_COMPILETIME (PL_hints & HINT_LOCALE)
6744 #endif
6745
6746 #ifndef IN_LOCALE
6747 # define IN_LOCALE (IN_PERL_COMPILETIME ? IN_LOCALE_COMPILETIME : IN_LOCALE_RUNTIME)
6748 #endif
6749 #ifndef IS_NUMBER_IN_UV
6750 # define IS_NUMBER_IN_UV 0x01
6751 #endif
6752
6753 #ifndef IS_NUMBER_GREATER_THAN_UV_MAX
6754 # define IS_NUMBER_GREATER_THAN_UV_MAX 0x02
6755 #endif
6756
6757 #ifndef IS_NUMBER_NOT_INT
6758 # define IS_NUMBER_NOT_INT 0x04
6759 #endif
6760
6761 #ifndef IS_NUMBER_NEG
6762 # define IS_NUMBER_NEG 0x08
6763 #endif
6764
6765 #ifndef IS_NUMBER_INFINITY
6766 # define IS_NUMBER_INFINITY 0x10
6767 #endif
6768
6769 #ifndef IS_NUMBER_NAN
6770 # define IS_NUMBER_NAN 0x20
6771 #endif
6772 #ifndef GROK_NUMERIC_RADIX
6773 # define GROK_NUMERIC_RADIX(sp, send) grok_numeric_radix(sp, send)
6774 #endif
6775 #ifndef PERL_SCAN_GREATER_THAN_UV_MAX
6776 # define PERL_SCAN_GREATER_THAN_UV_MAX 0x02
6777 #endif
6778
6779 #ifndef PERL_SCAN_SILENT_ILLDIGIT
6780 # define PERL_SCAN_SILENT_ILLDIGIT 0x04
6781 #endif
6782
6783 #ifndef PERL_SCAN_ALLOW_UNDERSCORES
6784 # define PERL_SCAN_ALLOW_UNDERSCORES 0x01
6785 #endif
6786
6787 #ifndef PERL_SCAN_DISALLOW_PREFIX
6788 # define PERL_SCAN_DISALLOW_PREFIX 0x02
6789 #endif
6790
6791 #ifndef grok_numeric_radix
6792 #if defined(NEED_grok_numeric_radix)
6793 static bool DPPP_(my_grok_numeric_radix)(pTHX_ const char ** sp, const char * send);
6794 static
6795 #else
6796 extern bool DPPP_(my_grok_numeric_radix)(pTHX_ const char ** sp, const char * send);
6797 #endif
6798
6799 #ifdef grok_numeric_radix
6800 # undef grok_numeric_radix
6801 #endif
6802 #define grok_numeric_radix(a,b) DPPP_(my_grok_numeric_radix)(aTHX_ a,b)
6803 #define Perl_grok_numeric_radix DPPP_(my_grok_numeric_radix)
6804
6805 #if defined(NEED_grok_numeric_radix) || defined(NEED_grok_numeric_radix_GLOBAL)
6806 bool
6807 DPPP_(my_grok_numeric_radix)(pTHX_ const char **sp, const char *send)
6808 {
6809 #ifdef USE_LOCALE_NUMERIC
6810 #ifdef PL_numeric_radix_sv
6811 if (PL_numeric_radix_sv && IN_LOCALE) {
6812 STRLEN len;
6813 char* radix = SvPV(PL_numeric_radix_sv, len);
6814 if (*sp + len <= send && memEQ(*sp, radix, len)) {
6815 *sp += len;
6816 return TRUE;
6817 }
6818 }
6819 #else
6820 /* older perls don't have PL_numeric_radix_sv so the radix
6821 * must manually be requested from locale.h
6822 */
6823 #include <locale.h>
6824 dTHR; /* needed for older threaded perls */
6825 struct lconv *lc = localeconv();
6826 char *radix = lc->decimal_point;
6827 if (radix && IN_LOCALE) {
6828 STRLEN len = strlen(radix);
6829 if (*sp + len <= send && memEQ(*sp, radix, len)) {
6830 *sp += len;
6831 return TRUE;
6832 }
6833 }
6834 #endif
6835 #endif /* USE_LOCALE_NUMERIC */
6836 /* always try "." if numeric radix didn't match because
6837 * we may have data from different locales mixed */
6838 if (*sp < send && **sp == '.') {
6839 ++*sp;
6840 return TRUE;
6841 }
6842 return FALSE;
6843 }
6844 #endif
6845 #endif
6846
6847 #ifndef grok_number
6848 #if defined(NEED_grok_number)
6849 static int DPPP_(my_grok_number)(pTHX_ const char * pv, STRLEN len, UV * valuep);
6850 static
6851 #else
6852 extern int DPPP_(my_grok_number)(pTHX_ const char * pv, STRLEN len, UV * valuep);
6853 #endif
6854
6855 #ifdef grok_number
6856 # undef grok_number
6857 #endif
6858 #define grok_number(a,b,c) DPPP_(my_grok_number)(aTHX_ a,b,c)
6859 #define Perl_grok_number DPPP_(my_grok_number)
6860
6861 #if defined(NEED_grok_number) || defined(NEED_grok_number_GLOBAL)
6862 int
6863 DPPP_(my_grok_number)(pTHX_ const char *pv, STRLEN len, UV *valuep)
6864 {
6865 const char *s = pv;
6866 const char *send = pv + len;
6867 const UV max_div_10 = UV_MAX / 10;
6868 const char max_mod_10 = UV_MAX % 10;
6869 int numtype = 0;
6870 int sawinf = 0;
6871 int sawnan = 0;
6872
6873 while (s < send && isSPACE(*s))
6874 s++;
6875 if (s == send) {
6876 return 0;
6877 } else if (*s == '-') {
6878 s++;
6879 numtype = IS_NUMBER_NEG;
6880 }
6881 else if (*s == '+')
6882 s++;
6883
6884 if (s == send)
6885 return 0;
6886
6887 /* next must be digit or the radix separator or beginning of infinity */
6888 if (isDIGIT(*s)) {
6889 /* UVs are at least 32 bits, so the first 9 decimal digits cannot
6890 overflow. */
6891 UV value = *s - '0';
6892 /* This construction seems to be more optimiser friendly.
6893 (without it gcc does the isDIGIT test and the *s - '0' separately)
6894 With it gcc on arm is managing 6 instructions (6 cycles) per digit.
6895 In theory the optimiser could deduce how far to unroll the loop
6896 before checking for overflow. */
6897 if (++s < send) {
6898 int digit = *s - '0';
6899 if (digit >= 0 && digit <= 9) {
6900 value = value * 10 + digit;
6901 if (++s < send) {
6902 digit = *s - '0';
6903 if (digit >= 0 && digit <= 9) {
6904 value = value * 10 + digit;
6905 if (++s < send) {
6906 digit = *s - '0';
6907 if (digit >= 0 && digit <= 9) {
6908 value = value * 10 + digit;
6909 if (++s < send) {
6910 digit = *s - '0';
6911 if (digit >= 0 && digit <= 9) {
6912 value = value * 10 + digit;
6913 if (++s < send) {
6914 digit = *s - '0';
6915 if (digit >= 0 && digit <= 9) {
6916 value = value * 10 + digit;
6917 if (++s < send) {
6918 digit = *s - '0';
6919 if (digit >= 0 && digit <= 9) {
6920 value = value * 10 + digit;
6921 if (++s < send) {
6922 digit = *s - '0';
6923 if (digit >= 0 && digit <= 9) {
6924 value = value * 10 + digit;
6925 if (++s < send) {
6926 digit = *s - '0';
6927 if (digit >= 0 && digit <= 9) {
6928 value = value * 10 + digit;
6929 if (++s < send) {
6930 /* Now got 9 digits, so need to check
6931 each time for overflow. */
6932 digit = *s - '0';
6933 while (digit >= 0 && digit <= 9
6934 && (value < max_div_10
6935 || (value == max_div_10
6936 && digit <= max_mod_10))) {
6937 value = value * 10 + digit;
6938 if (++s < send)
6939 digit = *s - '0';
6940 else
6941 break;
6942 }
6943 if (digit >= 0 && digit <= 9
6944 && (s < send)) {
6945 /* value overflowed.
6946 skip the remaining digits, don't
6947 worry about setting *valuep. */
6948 do {
6949 s++;
6950 } while (s < send && isDIGIT(*s));
6951 numtype |=
6952 IS_NUMBER_GREATER_THAN_UV_MAX;
6953 goto skip_value;
6954 }
6955 }
6956 }
6957 }
6958 }
6959 }
6960 }
6961 }
6962 }
6963 }
6964 }
6965 }
6966 }
6967 }
6968 }
6969 }
6970 }
6971 }
6972 numtype |= IS_NUMBER_IN_UV;
6973 if (valuep)
6974 *valuep = value;
6975
6976 skip_value:
6977 if (GROK_NUMERIC_RADIX(&s, send)) {
6978 numtype |= IS_NUMBER_NOT_INT;
6979 while (s < send && isDIGIT(*s)) /* optional digits after the radix */
6980 s++;
6981 }
6982 }
6983 else if (GROK_NUMERIC_RADIX(&s, send)) {
6984 numtype |= IS_NUMBER_NOT_INT | IS_NUMBER_IN_UV; /* valuep assigned below */
6985 /* no digits before the radix means we need digits after it */
6986 if (s < send && isDIGIT(*s)) {
6987 do {
6988 s++;
6989 } while (s < send && isDIGIT(*s));
6990 if (valuep) {
6991 /* integer approximation is valid - it's 0. */
6992 *valuep = 0;
6993 }
6994 }
6995 else
6996 return 0;
6997 } else if (*s == 'I' || *s == 'i') {
6998 s++; if (s == send || (*s != 'N' && *s != 'n')) return 0;
6999 s++; if (s == send || (*s != 'F' && *s != 'f')) return 0;
7000 s++; if (s < send && (*s == 'I' || *s == 'i')) {
7001 s++; if (s == send || (*s != 'N' && *s != 'n')) return 0;
7002 s++; if (s == send || (*s != 'I' && *s != 'i')) return 0;
7003 s++; if (s == send || (*s != 'T' && *s != 't')) return 0;
7004 s++; if (s == send || (*s != 'Y' && *s != 'y')) return 0;
7005 s++;
7006 }
7007 sawinf = 1;
7008 } else if (*s == 'N' || *s == 'n') {
7009 /* XXX TODO: There are signaling NaNs and quiet NaNs. */
7010 s++; if (s == send || (*s != 'A' && *s != 'a')) return 0;
7011 s++; if (s == send || (*s != 'N' && *s != 'n')) return 0;
7012 s++;
7013 sawnan = 1;
7014 } else
7015 return 0;
7016
7017 if (sawinf) {
7018 numtype &= IS_NUMBER_NEG; /* Keep track of sign */
7019 numtype |= IS_NUMBER_INFINITY | IS_NUMBER_NOT_INT;
7020 } else if (sawnan) {
7021 numtype &= IS_NUMBER_NEG; /* Keep track of sign */
7022 numtype |= IS_NUMBER_NAN | IS_NUMBER_NOT_INT;
7023 } else if (s < send) {
7024 /* we can have an optional exponent part */
7025 if (*s == 'e' || *s == 'E') {
7026 /* The only flag we keep is sign. Blow away any "it's UV" */
7027 numtype &= IS_NUMBER_NEG;
7028 numtype |= IS_NUMBER_NOT_INT;
7029 s++;
7030 if (s < send && (*s == '-' || *s == '+'))
7031 s++;
7032 if (s < send && isDIGIT(*s)) {
7033 do {
7034 s++;
7035 } while (s < send && isDIGIT(*s));
7036 }
7037 else
7038 return 0;
7039 }
7040 }
7041 while (s < send && isSPACE(*s))
7042 s++;
7043 if (s >= send)
7044 return numtype;
7045 if (len == 10 && memEQ(pv, "0 but true", 10)) {
7046 if (valuep)
7047 *valuep = 0;
7048 return IS_NUMBER_IN_UV;
7049 }
7050 return 0;
7051 }
7052 #endif
7053 #endif
7054
7055 /*
7056 * The grok_* routines have been modified to use warn() instead of
7057 * Perl_warner(). Also, 'hexdigit' was the former name of PL_hexdigit,
7058 * which is why the stack variable has been renamed to 'xdigit'.
7059 */
7060
7061 #ifndef grok_bin
7062 #if defined(NEED_grok_bin)
7063 static UV DPPP_(my_grok_bin)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
7064 static
7065 #else
7066 extern UV DPPP_(my_grok_bin)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
7067 #endif
7068
7069 #ifdef grok_bin
7070 # undef grok_bin
7071 #endif
7072 #define grok_bin(a,b,c,d) DPPP_(my_grok_bin)(aTHX_ a,b,c,d)
7073 #define Perl_grok_bin DPPP_(my_grok_bin)
7074
7075 #if defined(NEED_grok_bin) || defined(NEED_grok_bin_GLOBAL)
7076 UV
7077 DPPP_(my_grok_bin)(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result)
7078 {
7079 const char *s = start;
7080 STRLEN len = *len_p;
7081 UV value = 0;
7082 NV value_nv = 0;
7083
7084 const UV max_div_2 = UV_MAX / 2;
7085 bool allow_underscores = *flags & PERL_SCAN_ALLOW_UNDERSCORES;
7086 bool overflowed = FALSE;
7087
7088 if (!(*flags & PERL_SCAN_DISALLOW_PREFIX)) {
7089 /* strip off leading b or 0b.
7090 for compatibility silently suffer "b" and "0b" as valid binary
7091 numbers. */
7092 if (len >= 1) {
7093 if (s[0] == 'b') {
7094 s++;
7095 len--;
7096 }
7097 else if (len >= 2 && s[0] == '0' && s[1] == 'b') {
7098 s+=2;
7099 len-=2;
7100 }
7101 }
7102 }
7103
7104 for (; len-- && *s; s++) {
7105 char bit = *s;
7106 if (bit == '0' || bit == '1') {
7107 /* Write it in this wonky order with a goto to attempt to get the
7108 compiler to make the common case integer-only loop pretty tight.
7109 With gcc seems to be much straighter code than old scan_bin. */
7110 redo:
7111 if (!overflowed) {
7112 if (value <= max_div_2) {
7113 value = (value << 1) | (bit - '0');
7114 continue;
7115 }
7116 /* Bah. We're just overflowed. */
7117 warn("Integer overflow in binary number");
7118 overflowed = TRUE;
7119 value_nv = (NV) value;
7120 }
7121 value_nv *= 2.0;
7122 /* If an NV has not enough bits in its mantissa to
7123 * represent a UV this summing of small low-order numbers
7124 * is a waste of time (because the NV cannot preserve
7125 * the low-order bits anyway): we could just remember when
7126 * did we overflow and in the end just multiply value_nv by the
7127 * right amount. */
7128 value_nv += (NV)(bit - '0');
7129 continue;
7130 }
7131 if (bit == '_' && len && allow_underscores && (bit = s[1])
7132 && (bit == '0' || bit == '1'))
7133 {
7134 --len;
7135 ++s;
7136 goto redo;
7137 }
7138 if (!(*flags & PERL_SCAN_SILENT_ILLDIGIT))
7139 warn("Illegal binary digit '%c' ignored", *s);
7140 break;
7141 }
7142
7143 if ( ( overflowed && value_nv > 4294967295.0)
7144 #if UVSIZE > 4
7145 || (!overflowed && value > 0xffffffff )
7146 #endif
7147 ) {
7148 warn("Binary number > 0b11111111111111111111111111111111 non-portable");
7149 }
7150 *len_p = s - start;
7151 if (!overflowed) {
7152 *flags = 0;
7153 return value;
7154 }
7155 *flags = PERL_SCAN_GREATER_THAN_UV_MAX;
7156 if (result)
7157 *result = value_nv;
7158 return UV_MAX;
7159 }
7160 #endif
7161 #endif
7162
7163 #ifndef grok_hex
7164 #if defined(NEED_grok_hex)
7165 static UV DPPP_(my_grok_hex)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
7166 static
7167 #else
7168 extern UV DPPP_(my_grok_hex)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
7169 #endif
7170
7171 #ifdef grok_hex
7172 # undef grok_hex
7173 #endif
7174 #define grok_hex(a,b,c,d) DPPP_(my_grok_hex)(aTHX_ a,b,c,d)
7175 #define Perl_grok_hex DPPP_(my_grok_hex)
7176
7177 #if defined(NEED_grok_hex) || defined(NEED_grok_hex_GLOBAL)
7178 UV
7179 DPPP_(my_grok_hex)(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result)
7180 {
7181 const char *s = start;
7182 STRLEN len = *len_p;
7183 UV value = 0;
7184 NV value_nv = 0;
7185
7186 const UV max_div_16 = UV_MAX / 16;
7187 bool allow_underscores = *flags & PERL_SCAN_ALLOW_UNDERSCORES;
7188 bool overflowed = FALSE;
7189 const char *xdigit;
7190
7191 if (!(*flags & PERL_SCAN_DISALLOW_PREFIX)) {
7192 /* strip off leading x or 0x.
7193 for compatibility silently suffer "x" and "0x" as valid hex numbers.
7194 */
7195 if (len >= 1) {
7196 if (s[0] == 'x') {
7197 s++;
7198 len--;
7199 }
7200 else if (len >= 2 && s[0] == '0' && s[1] == 'x') {
7201 s+=2;
7202 len-=2;
7203 }
7204 }
7205 }
7206
7207 for (; len-- && *s; s++) {
7208 xdigit = strchr((char *) PL_hexdigit, *s);
7209 if (xdigit) {
7210 /* Write it in this wonky order with a goto to attempt to get the
7211 compiler to make the common case integer-only loop pretty tight.
7212 With gcc seems to be much straighter code than old scan_hex. */
7213 redo:
7214 if (!overflowed) {
7215 if (value <= max_div_16) {
7216 value = (value << 4) | ((xdigit - PL_hexdigit) & 15);
7217 continue;
7218 }
7219 warn("Integer overflow in hexadecimal number");
7220 overflowed = TRUE;
7221 value_nv = (NV) value;
7222 }
7223 value_nv *= 16.0;
7224 /* If an NV has not enough bits in its mantissa to
7225 * represent a UV this summing of small low-order numbers
7226 * is a waste of time (because the NV cannot preserve
7227 * the low-order bits anyway): we could just remember when
7228 * did we overflow and in the end just multiply value_nv by the
7229 * right amount of 16-tuples. */
7230 value_nv += (NV)((xdigit - PL_hexdigit) & 15);
7231 continue;
7232 }
7233 if (*s == '_' && len && allow_underscores && s[1]
7234 && (xdigit = strchr((char *) PL_hexdigit, s[1])))
7235 {
7236 --len;
7237 ++s;
7238 goto redo;
7239 }
7240 if (!(*flags & PERL_SCAN_SILENT_ILLDIGIT))
7241 warn("Illegal hexadecimal digit '%c' ignored", *s);
7242 break;
7243 }
7244
7245 if ( ( overflowed && value_nv > 4294967295.0)
7246 #if UVSIZE > 4
7247 || (!overflowed && value > 0xffffffff )
7248 #endif
7249 ) {
7250 warn("Hexadecimal number > 0xffffffff non-portable");
7251 }
7252 *len_p = s - start;
7253 if (!overflowed) {
7254 *flags = 0;
7255 return value;
7256 }
7257 *flags = PERL_SCAN_GREATER_THAN_UV_MAX;
7258 if (result)
7259 *result = value_nv;
7260 return UV_MAX;
7261 }
7262 #endif
7263 #endif
7264
7265 #ifndef grok_oct
7266 #if defined(NEED_grok_oct)
7267 static UV DPPP_(my_grok_oct)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
7268 static
7269 #else
7270 extern UV DPPP_(my_grok_oct)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
7271 #endif
7272
7273 #ifdef grok_oct
7274 # undef grok_oct
7275 #endif
7276 #define grok_oct(a,b,c,d) DPPP_(my_grok_oct)(aTHX_ a,b,c,d)
7277 #define Perl_grok_oct DPPP_(my_grok_oct)
7278
7279 #if defined(NEED_grok_oct) || defined(NEED_grok_oct_GLOBAL)
7280 UV
7281 DPPP_(my_grok_oct)(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result)
7282 {
7283 const char *s = start;
7284 STRLEN len = *len_p;
7285 UV value = 0;
7286 NV value_nv = 0;
7287
7288 const UV max_div_8 = UV_MAX / 8;
7289 bool allow_underscores = *flags & PERL_SCAN_ALLOW_UNDERSCORES;
7290 bool overflowed = FALSE;
7291
7292 for (; len-- && *s; s++) {
7293 /* gcc 2.95 optimiser not smart enough to figure that this subtraction
7294 out front allows slicker code. */
7295 int digit = *s - '0';
7296 if (digit >= 0 && digit <= 7) {
7297 /* Write it in this wonky order with a goto to attempt to get the
7298 compiler to make the common case integer-only loop pretty tight.
7299 */
7300 redo:
7301 if (!overflowed) {
7302 if (value <= max_div_8) {
7303 value = (value << 3) | digit;
7304 continue;
7305 }
7306 /* Bah. We're just overflowed. */
7307 warn("Integer overflow in octal number");
7308 overflowed = TRUE;
7309 value_nv = (NV) value;
7310 }
7311 value_nv *= 8.0;
7312 /* If an NV has not enough bits in its mantissa to
7313 * represent a UV this summing of small low-order numbers
7314 * is a waste of time (because the NV cannot preserve
7315 * the low-order bits anyway): we could just remember when
7316 * did we overflow and in the end just multiply value_nv by the
7317 * right amount of 8-tuples. */
7318 value_nv += (NV)digit;
7319 continue;
7320 }
7321 if (digit == ('_' - '0') && len && allow_underscores
7322 && (digit = s[1] - '0') && (digit >= 0 && digit <= 7))
7323 {
7324 --len;
7325 ++s;
7326 goto redo;
7327 }
7328 /* Allow \octal to work the DWIM way (that is, stop scanning
7329 * as soon as non-octal characters are seen, complain only iff
7330 * someone seems to want to use the digits eight and nine). */
7331 if (digit == 8 || digit == 9) {
7332 if (!(*flags & PERL_SCAN_SILENT_ILLDIGIT))
7333 warn("Illegal octal digit '%c' ignored", *s);
7334 }
7335 break;
7336 }
7337
7338 if ( ( overflowed && value_nv > 4294967295.0)
7339 #if UVSIZE > 4
7340 || (!overflowed && value > 0xffffffff )
7341 #endif
7342 ) {
7343 warn("Octal number > 037777777777 non-portable");
7344 }
7345 *len_p = s - start;
7346 if (!overflowed) {
7347 *flags = 0;
7348 return value;
7349 }
7350 *flags = PERL_SCAN_GREATER_THAN_UV_MAX;
7351 if (result)
7352 *result = value_nv;
7353 return UV_MAX;
7354 }
7355 #endif
7356 #endif
7357
7358 #if !defined(my_snprintf)
7359 #if defined(NEED_my_snprintf)
7360 static int DPPP_(my_my_snprintf)(char * buffer, const Size_t len, const char * format, ...);
7361 static
7362 #else
7363 extern int DPPP_(my_my_snprintf)(char * buffer, const Size_t len, const char * format, ...);
7364 #endif
7365
7366 #define my_snprintf DPPP_(my_my_snprintf)
7367 #define Perl_my_snprintf DPPP_(my_my_snprintf)
7368
7369 #if defined(NEED_my_snprintf) || defined(NEED_my_snprintf_GLOBAL)
7370
7371 int
7372 DPPP_(my_my_snprintf)(char *buffer, const Size_t len, const char *format, ...)
7373 {
7374 dTHX;
7375 int retval;
7376 va_list ap;
7377 va_start(ap, format);
7378 #ifdef HAS_VSNPRINTF
7379 retval = vsnprintf(buffer, len, format, ap);
7380 #else
7381 retval = vsprintf(buffer, format, ap);
7382 #endif
7383 va_end(ap);
7384 if (retval < 0 || (len > 0 && (Size_t)retval >= len))
7385 Perl_croak(aTHX_ "panic: my_snprintf buffer overflow");
7386 return retval;
7387 }
7388
7389 #endif
7390 #endif
7391
7392 #if !defined(my_sprintf)
7393 #if defined(NEED_my_sprintf)
7394 static int DPPP_(my_my_sprintf)(char * buffer, const char * pat, ...);
7395 static
7396 #else
7397 extern int DPPP_(my_my_sprintf)(char * buffer, const char * pat, ...);
7398 #endif
7399
7400 #define my_sprintf DPPP_(my_my_sprintf)
7401 #define Perl_my_sprintf DPPP_(my_my_sprintf)
7402
7403 #if defined(NEED_my_sprintf) || defined(NEED_my_sprintf_GLOBAL)
7404
7405 int
7406 DPPP_(my_my_sprintf)(char *buffer, const char* pat, ...)
7407 {
7408 va_list args;
7409 va_start(args, pat);
7410 vsprintf(buffer, pat, args);
7411 va_end(args);
7412 return strlen(buffer);
7413 }
7414
7415 #endif
7416 #endif
7417
7418 #ifdef NO_XSLOCKS
7419 # ifdef dJMPENV
7420 # define dXCPT dJMPENV; int rEtV = 0
7421 # define XCPT_TRY_START JMPENV_PUSH(rEtV); if (rEtV == 0)
7422 # define XCPT_TRY_END JMPENV_POP;
7423 # define XCPT_CATCH if (rEtV != 0)
7424 # define XCPT_RETHROW JMPENV_JUMP(rEtV)
7425 # else
7426 # define dXCPT Sigjmp_buf oldTOP; int rEtV = 0
7427 # define XCPT_TRY_START Copy(top_env, oldTOP, 1, Sigjmp_buf); rEtV = Sigsetjmp(top_env, 1); if (rEtV == 0)
7428 # define XCPT_TRY_END Copy(oldTOP, top_env, 1, Sigjmp_buf);
7429 # define XCPT_CATCH if (rEtV != 0)
7430 # define XCPT_RETHROW Siglongjmp(top_env, rEtV)
7431 # endif
7432 #endif
7433
7434 #if !defined(my_strlcat)
7435 #if defined(NEED_my_strlcat)
7436 static Size_t DPPP_(my_my_strlcat)(char * dst, const char * src, Size_t size);
7437 static
7438 #else
7439 extern Size_t DPPP_(my_my_strlcat)(char * dst, const char * src, Size_t size);
7440 #endif
7441
7442 #define my_strlcat DPPP_(my_my_strlcat)
7443 #define Perl_my_strlcat DPPP_(my_my_strlcat)
7444
7445 #if defined(NEED_my_strlcat) || defined(NEED_my_strlcat_GLOBAL)
7446
7447 Size_t
7448 DPPP_(my_my_strlcat)(char *dst, const char *src, Size_t size)
7449 {
7450 Size_t used, length, copy;
7451
7452 used = strlen(dst);
7453 length = strlen(src);
7454 if (size > 0 && used < size - 1) {
7455 copy = (length >= size - used) ? size - used - 1 : length;
7456 memcpy(dst + used, src, copy);
7457 dst[used + copy] = '\0';
7458 }
7459 return used + length;
7460 }
7461 #endif
7462 #endif
7463
7464 #if !defined(my_strlcpy)
7465 #if defined(NEED_my_strlcpy)
7466 static Size_t DPPP_(my_my_strlcpy)(char * dst, const char * src, Size_t size);
7467 static
7468 #else
7469 extern Size_t DPPP_(my_my_strlcpy)(char * dst, const char * src, Size_t size);
7470 #endif
7471
7472 #define my_strlcpy DPPP_(my_my_strlcpy)
7473 #define Perl_my_strlcpy DPPP_(my_my_strlcpy)
7474
7475 #if defined(NEED_my_strlcpy) || defined(NEED_my_strlcpy_GLOBAL)
7476
7477 Size_t
7478 DPPP_(my_my_strlcpy)(char *dst, const char *src, Size_t size)
7479 {
7480 Size_t length, copy;
7481
7482 length = strlen(src);
7483 if (size > 0) {
7484 copy = (length >= size) ? size - 1 : length;
7485 memcpy(dst, src, copy);
7486 dst[copy] = '\0';
7487 }
7488 return length;
7489 }
7490
7491 #endif
7492 #endif
7493 #ifndef PERL_PV_ESCAPE_QUOTE
7494 # define PERL_PV_ESCAPE_QUOTE 0x0001
7495 #endif
7496
7497 #ifndef PERL_PV_PRETTY_QUOTE
7498 # define PERL_PV_PRETTY_QUOTE PERL_PV_ESCAPE_QUOTE
7499 #endif
7500
7501 #ifndef PERL_PV_PRETTY_ELLIPSES
7502 # define PERL_PV_PRETTY_ELLIPSES 0x0002
7503 #endif
7504
7505 #ifndef PERL_PV_PRETTY_LTGT
7506 # define PERL_PV_PRETTY_LTGT 0x0004
7507 #endif
7508
7509 #ifndef PERL_PV_ESCAPE_FIRSTCHAR
7510 # define PERL_PV_ESCAPE_FIRSTCHAR 0x0008
7511 #endif
7512
7513 #ifndef PERL_PV_ESCAPE_UNI
7514 # define PERL_PV_ESCAPE_UNI 0x0100
7515 #endif
7516
7517 #ifndef PERL_PV_ESCAPE_UNI_DETECT
7518 # define PERL_PV_ESCAPE_UNI_DETECT 0x0200
7519 #endif
7520
7521 #ifndef PERL_PV_ESCAPE_ALL
7522 # define PERL_PV_ESCAPE_ALL 0x1000
7523 #endif
7524
7525 #ifndef PERL_PV_ESCAPE_NOBACKSLASH
7526 # define PERL_PV_ESCAPE_NOBACKSLASH 0x2000
7527 #endif
7528
7529 #ifndef PERL_PV_ESCAPE_NOCLEAR
7530 # define PERL_PV_ESCAPE_NOCLEAR 0x4000
7531 #endif
7532
7533 #ifndef PERL_PV_ESCAPE_RE
7534 # define PERL_PV_ESCAPE_RE 0x8000
7535 #endif
7536
7537 #ifndef PERL_PV_PRETTY_NOCLEAR
7538 # define PERL_PV_PRETTY_NOCLEAR PERL_PV_ESCAPE_NOCLEAR
7539 #endif
7540 #ifndef PERL_PV_PRETTY_DUMP
7541 # define PERL_PV_PRETTY_DUMP PERL_PV_PRETTY_ELLIPSES|PERL_PV_PRETTY_QUOTE
7542 #endif
7543
7544 #ifndef PERL_PV_PRETTY_REGPROP
7545 # define PERL_PV_PRETTY_REGPROP PERL_PV_PRETTY_ELLIPSES|PERL_PV_PRETTY_LTGT|PERL_PV_ESCAPE_RE
7546 #endif
7547
7548 /* Hint: pv_escape
7549 * Note that unicode functionality is only backported to
7550 * those perl versions that support it. For older perl
7551 * versions, the implementation will fall back to bytes.
7552 */
7553
7554 #ifndef pv_escape
7555 #if defined(NEED_pv_escape)
7556 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);
7557 static
7558 #else
7559 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);
7560 #endif
7561
7562 #ifdef pv_escape
7563 # undef pv_escape
7564 #endif
7565 #define pv_escape(a,b,c,d,e,f) DPPP_(my_pv_escape)(aTHX_ a,b,c,d,e,f)
7566 #define Perl_pv_escape DPPP_(my_pv_escape)
7567
7568 #if defined(NEED_pv_escape) || defined(NEED_pv_escape_GLOBAL)
7569
7570 char *
7571 DPPP_(my_pv_escape)(pTHX_ SV *dsv, char const * const str,
7572 const STRLEN count, const STRLEN max,
7573 STRLEN * const escaped, const U32 flags)
7574 {
7575 const char esc = flags & PERL_PV_ESCAPE_RE ? '%' : '\\';
7576 const char dq = flags & PERL_PV_ESCAPE_QUOTE ? '"' : esc;
7577 char octbuf[32] = "%123456789ABCDF";
7578 STRLEN wrote = 0;
7579 STRLEN chsize = 0;
7580 STRLEN readsize = 1;
7581 #if defined(is_utf8_string) && defined(utf8_to_uvchr)
7582 bool isuni = flags & PERL_PV_ESCAPE_UNI ? 1 : 0;
7583 #endif
7584 const char *pv = str;
7585 const char * const end = pv + count;
7586 octbuf[0] = esc;
7587
7588 if (!(flags & PERL_PV_ESCAPE_NOCLEAR))
7589 sv_setpvs(dsv, "");
7590
7591 #if defined(is_utf8_string) && defined(utf8_to_uvchr)
7592 if ((flags & PERL_PV_ESCAPE_UNI_DETECT) && is_utf8_string((U8*)pv, count))
7593 isuni = 1;
7594 #endif
7595
7596 for (; pv < end && (!max || wrote < max) ; pv += readsize) {
7597 const UV u =
7598 #if defined(is_utf8_string) && defined(utf8_to_uvchr)
7599 isuni ? utf8_to_uvchr((U8*)pv, &readsize) :
7600 #endif
7601 (U8)*pv;
7602 const U8 c = (U8)u & 0xFF;
7603
7604 if (u > 255 || (flags & PERL_PV_ESCAPE_ALL)) {
7605 if (flags & PERL_PV_ESCAPE_FIRSTCHAR)
7606 chsize = my_snprintf(octbuf, sizeof octbuf,
7607 "%" UVxf, u);
7608 else
7609 chsize = my_snprintf(octbuf, sizeof octbuf,
7610 "%cx{%" UVxf "}", esc, u);
7611 } else if (flags & PERL_PV_ESCAPE_NOBACKSLASH) {
7612 chsize = 1;
7613 } else {
7614 if (c == dq || c == esc || !isPRINT(c)) {
7615 chsize = 2;
7616 switch (c) {
7617 case '\\' : /* fallthrough */
7618 case '%' : if (c == esc)
7619 octbuf[1] = esc;
7620 else
7621 chsize = 1;
7622 break;
7623 case '\v' : octbuf[1] = 'v'; break;
7624 case '\t' : octbuf[1] = 't'; break;
7625 case '\r' : octbuf[1] = 'r'; break;
7626 case '\n' : octbuf[1] = 'n'; break;
7627 case '\f' : octbuf[1] = 'f'; break;
7628 case '"' : if (dq == '"')
7629 octbuf[1] = '"';
7630 else
7631 chsize = 1;
7632 break;
7633 default: chsize = my_snprintf(octbuf, sizeof octbuf,
7634 pv < end && isDIGIT((U8)*(pv+readsize))
7635 ? "%c%03o" : "%c%o", esc, c);
7636 }
7637 } else {
7638 chsize = 1;
7639 }
7640 }
7641 if (max && wrote + chsize > max) {
7642 break;
7643 } else if (chsize > 1) {
7644 sv_catpvn(dsv, octbuf, chsize);
7645 wrote += chsize;
7646 } else {
7647 char tmp[2];
7648 my_snprintf(tmp, sizeof tmp, "%c", c);
7649 sv_catpvn(dsv, tmp, 1);
7650 wrote++;
7651 }
7652 if (flags & PERL_PV_ESCAPE_FIRSTCHAR)
7653 break;
7654 }
7655 if (escaped != NULL)
7656 *escaped= pv - str;
7657 return SvPVX(dsv);
7658 }
7659
7660 #endif
7661 #endif
7662
7663 #ifndef pv_pretty
7664 #if defined(NEED_pv_pretty)
7665 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);
7666 static
7667 #else
7668 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);
7669 #endif
7670
7671 #ifdef pv_pretty
7672 # undef pv_pretty
7673 #endif
7674 #define pv_pretty(a,b,c,d,e,f,g) DPPP_(my_pv_pretty)(aTHX_ a,b,c,d,e,f,g)
7675 #define Perl_pv_pretty DPPP_(my_pv_pretty)
7676
7677 #if defined(NEED_pv_pretty) || defined(NEED_pv_pretty_GLOBAL)
7678
7679 char *
7680 DPPP_(my_pv_pretty)(pTHX_ SV *dsv, char const * const str, const STRLEN count,
7681 const STRLEN max, char const * const start_color, char const * const end_color,
7682 const U32 flags)
7683 {
7684 const U8 dq = (flags & PERL_PV_PRETTY_QUOTE) ? '"' : '%';
7685 STRLEN escaped;
7686
7687 if (!(flags & PERL_PV_PRETTY_NOCLEAR))
7688 sv_setpvs(dsv, "");
7689
7690 if (dq == '"')
7691 sv_catpvs(dsv, "\"");
7692 else if (flags & PERL_PV_PRETTY_LTGT)
7693 sv_catpvs(dsv, "<");
7694
7695 if (start_color != NULL)
7696 sv_catpv(dsv, D_PPP_CONSTPV_ARG(start_color));
7697
7698 pv_escape(dsv, str, count, max, &escaped, flags | PERL_PV_ESCAPE_NOCLEAR);
7699
7700 if (end_color != NULL)
7701 sv_catpv(dsv, D_PPP_CONSTPV_ARG(end_color));
7702
7703 if (dq == '"')
7704 sv_catpvs(dsv, "\"");
7705 else if (flags & PERL_PV_PRETTY_LTGT)
7706 sv_catpvs(dsv, ">");
7707
7708 if ((flags & PERL_PV_PRETTY_ELLIPSES) && escaped < count)
7709 sv_catpvs(dsv, "...");
7710
7711 return SvPVX(dsv);
7712 }
7713
7714 #endif
7715 #endif
7716
7717 #ifndef pv_display
7718 #if defined(NEED_pv_display)
7719 static char * DPPP_(my_pv_display)(pTHX_ SV * dsv, const char * pv, STRLEN cur, STRLEN len, STRLEN pvlim);
7720 static
7721 #else
7722 extern char * DPPP_(my_pv_display)(pTHX_ SV * dsv, const char * pv, STRLEN cur, STRLEN len, STRLEN pvlim);
7723 #endif
7724
7725 #ifdef pv_display
7726 # undef pv_display
7727 #endif
7728 #define pv_display(a,b,c,d,e) DPPP_(my_pv_display)(aTHX_ a,b,c,d,e)
7729 #define Perl_pv_display DPPP_(my_pv_display)
7730
7731 #if defined(NEED_pv_display) || defined(NEED_pv_display_GLOBAL)
7732
7733 char *
7734 DPPP_(my_pv_display)(pTHX_ SV *dsv, const char *pv, STRLEN cur, STRLEN len, STRLEN pvlim)
7735 {
7736 pv_pretty(dsv, pv, cur, pvlim, NULL, NULL, PERL_PV_PRETTY_DUMP);
7737 if (len > cur && pv[cur] == '\0')
7738 sv_catpvs(dsv, "\\0");
7739 return SvPVX(dsv);
7740 }
7741
7742 #endif
7743 #endif
7744
7745 #endif /* _P_P_PORTABILITY_H_ */
7746
7747 /* End of File ppport.h */