KVIrc 5.2.4
Developer APIs
ppport.h
Go to the documentation of this file.
1#if 0
2my $void = <<'SKIP';
3#endif
4/*
5----------------------------------------------------------------------
6
7 ppport.h -- Perl/Pollution/Portability Version 3.71
8
9 Automatically created by Devel::PPPort running under perl 5.038000.
10
11 Version 3.x, Copyright (c) 2004-2013, Marcus Holland-Moritz.
12
13 Version 2.x, Copyright (C) 2001, Paul Marquess.
14
15 Version 1.x, Copyright (C) 1999, Kenneth Albanowski.
16
17 This program is free software; you can redistribute it and/or
18 modify it under the same terms as Perl itself.
19
20----------------------------------------------------------------------
21
22SKIP
23if (@ARGV && $ARGV[0] eq '--unstrip') {
24 eval { require Devel::PPPort };
25 $@ and die "Cannot require Devel::PPPort, please install.\n";
26 if (eval $Devel::PPPort::VERSION < 3.71) {
27 die "ppport.h was originally generated with Devel::PPPort 3.71.\n"
28 . "Your Devel::PPPort is only version $Devel::PPPort::VERSION.\n"
29 . "Please install a newer version, or --unstrip will not work.\n";
30 }
31 Devel::PPPort::WriteFile($0);
32 exit 0;
33}
34print <<END;
35
36Sorry, but this is a stripped version of $0.
37
38To be able to use its original script and doc functionality,
39please try to regenerate this file using:
40
41 $^X $0 --unstrip
42
43END
44__DATA__*/
45#ifndef _P_P_PORTABILITY_H_
46#define _P_P_PORTABILITY_H_
47#ifndef DPPP_NAMESPACE
48#define DPPP_NAMESPACE DPPP_
49#endif
50#define DPPP_CAT2(x,y) CAT2(x,y)
51#define DPPP_(name) DPPP_CAT2(DPPP_NAMESPACE, name)
52#define D_PPP_RELEASE_DATE 1647561600
53#if ! defined(PERL_REVISION) && ! defined(PERL_VERSION_MAJOR)
54#if ! defined(__PATCHLEVEL_H_INCLUDED__) \
55&& ! ( defined(PATCHLEVEL) && defined(SUBVERSION))
56#define PERL_PATCHLEVEL_H_IMPLICIT
57#include <patchlevel.h>
58#endif
59#if ! defined(PERL_VERSION) \
60&& ! defined(PERL_VERSION_MAJOR) \
61&& ( ! defined(SUBVERSION) || ! defined(PATCHLEVEL) )
62#include <could_not_find_Perl_patchlevel.h>
63#endif
64#endif
65#ifdef PERL_VERSION_MAJOR
66#define D_PPP_MAJOR PERL_VERSION_MAJOR
67#elif defined(PERL_REVISION)
68#define D_PPP_MAJOR PERL_REVISION
69#else
70#define D_PPP_MAJOR 5
71#endif
72#ifdef PERL_VERSION_MINOR
73#define D_PPP_MINOR PERL_VERSION_MINOR
74#elif defined(PERL_VERSION)
75#define D_PPP_MINOR PERL_VERSION
76#elif defined(PATCHLEVEL)
77#define D_PPP_MINOR PATCHLEVEL
78#define PERL_VERSION PATCHLEVEL
79#else
80#error Could not find a source for PERL_VERSION_MINOR
81#endif
82#ifdef PERL_VERSION_PATCH
83#define D_PPP_PATCH PERL_VERSION_PATCH
84#elif defined(PERL_SUBVERSION)
85#define D_PPP_PATCH PERL_SUBVERSION
86#elif defined(SUBVERSION)
87#define D_PPP_PATCH SUBVERSION
88#define PERL_SUBVERSION SUBVERSION
89#else
90#error Could not find a source for PERL_VERSION_PATCH
91#endif
92#if D_PPP_MAJOR < 5 || D_PPP_MAJOR == 6
93#error Devel::PPPort works only on Perl 5, Perl 7, ...
94#elif D_PPP_MAJOR != 5
95#undef PERL_REVISION
96#undef PERL_VERSION
97#undef PERL_SUBVERSION
98#define D_PPP_REVISION 5
99#define D_PPP_VERSION 201
100#define D_PPP_SUBVERSION 201
101#if (defined(__clang__) \
102&& ( (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \
103|| defined(_STDC_C99) \
104|| defined(__c99)))
105#define D_PPP_STRINGIFY(x) #x
106#define D_PPP_deprecate(xyz) _Pragma(D_PPP_STRINGIFY(GCC warning(D_PPP_STRINGIFY(xyz) " is deprecated")))
107#define PERL_REVISION (D_PPP_REVISION D_PPP_deprecate(PERL_REVISION))
108#define PERL_VERSION (D_PPP_REVISION D_PPP_deprecate(PERL_VERSION))
109#define PERL_SUBVERSION (D_PPP_SUBVERSION D_PPP_deprecate(PERL_SUBVERSION))
110#else
111#define PERL_REVISION D_PPP_REVISION
112#define PERL_VERSION D_PPP_REVISION
113#define PERL_SUBVERSION D_PPP_SUBVERSION
114#endif
115#endif
116#define D_PPP_DEC2BCD(dec) ((((dec)/100)<<8)|((((dec)%100)/10)<<4)|((dec)%10))
117#define D_PPP_JNP_TO_BCD(j,n,p) ((D_PPP_DEC2BCD(j)<<24)|(D_PPP_DEC2BCD(n)<<12)|D_PPP_DEC2BCD(p))
118#define PERL_BCDVERSION D_PPP_JNP_TO_BCD(D_PPP_MAJOR, \
119D_PPP_MINOR, \
120D_PPP_PATCH)
121#undef PERL_VERSION_EQ
122#undef PERL_VERSION_NE
123#undef PERL_VERSION_LT
124#undef PERL_VERSION_GE
125#undef PERL_VERSION_LE
126#undef PERL_VERSION_GT
127#ifndef PERL_VERSION_EQ
128#define PERL_VERSION_EQ(j,n,p) \
129(((p) == '*') ? ( (j) == D_PPP_VERSION_MAJOR \
130&& (n) == D_PPP_VERSION_MINOR) \
131: (PERL_BCDVERSION == D_PPP_JNP_TO_BCD(j,n,p)))
132#endif
133#ifndef PERL_VERSION_NE
134#define PERL_VERSION_NE(j,n,p) (! PERL_VERSION_EQ(j,n,p))
135#endif
136#ifndef PERL_VERSION_LT
137#define PERL_VERSION_LT(j,n,p) \
138(PERL_BCDVERSION < D_PPP_JNP_TO_BCD( (j), \
139(n), \
140(((p) == '*') ? 0 : (p))))
141#endif
142#ifndef PERL_VERSION_GE
143#define PERL_VERSION_GE(j,n,p) (! PERL_VERSION_LT(j,n,p))
144#endif
145#ifndef PERL_VERSION_LE
146#define PERL_VERSION_LE(j,n,p) \
147(PERL_BCDVERSION < D_PPP_JNP_TO_BCD( (j), \
148(((p) == '*') ? ((n)+1) : (n)), \
149(((p) == '*') ? 0 : (p))))
150#endif
151#ifndef PERL_VERSION_GT
152#define PERL_VERSION_GT(j,n,p) (! PERL_VERSION_LE(j,n,p))
153#endif
154#ifndef dTHR
155#define dTHR dNOOP
156#endif
157#ifndef dTHX
158#define dTHX dNOOP
159#endif
160#ifndef dTHXa
161#define dTHXa(x) dNOOP
162#endif
163#ifndef pTHX
164#define pTHX void
165#endif
166#ifndef pTHX_
167#define pTHX_
168#endif
169#ifndef aTHX
170#define aTHX
171#endif
172#ifndef aTHX_
173#define aTHX_
174#endif
175#if (PERL_BCDVERSION < 0x5006000)
176#ifdef USE_THREADS
177#define aTHXR thr
178#define aTHXR_ thr,
179#else
180#define aTHXR
181#define aTHXR_
182#endif
183#define dTHXR dTHR
184#else
185#define aTHXR aTHX
186#define aTHXR_ aTHX_
187#define dTHXR dTHX
188#endif
189#ifndef dTHXoa
190#define dTHXoa(x) dTHXa(x)
191#endif
192#ifdef I_LIMITS
193#include <limits.h>
194#endif
195#ifndef PERL_UCHAR_MIN
196#define PERL_UCHAR_MIN ((unsigned char)0)
197#endif
198#ifndef PERL_UCHAR_MAX
199#ifdef UCHAR_MAX
200#define PERL_UCHAR_MAX ((unsigned char)UCHAR_MAX)
201#else
202#ifdef MAXUCHAR
203#define PERL_UCHAR_MAX ((unsigned char)MAXUCHAR)
204#else
205#define PERL_UCHAR_MAX ((unsigned char)~(unsigned)0)
206#endif
207#endif
208#endif
209#ifndef PERL_USHORT_MIN
210#define PERL_USHORT_MIN ((unsigned short)0)
211#endif
212#ifndef PERL_USHORT_MAX
213#ifdef USHORT_MAX
214#define PERL_USHORT_MAX ((unsigned short)USHORT_MAX)
215#else
216#ifdef MAXUSHORT
217#define PERL_USHORT_MAX ((unsigned short)MAXUSHORT)
218#else
219#ifdef USHRT_MAX
220#define PERL_USHORT_MAX ((unsigned short)USHRT_MAX)
221#else
222#define PERL_USHORT_MAX ((unsigned short)~(unsigned)0)
223#endif
224#endif
225#endif
226#endif
227#ifndef PERL_SHORT_MAX
228#ifdef SHORT_MAX
229#define PERL_SHORT_MAX ((short)SHORT_MAX)
230#else
231#ifdef MAXSHORT
232#define PERL_SHORT_MAX ((short)MAXSHORT)
233#else
234#ifdef SHRT_MAX
235#define PERL_SHORT_MAX ((short)SHRT_MAX)
236#else
237#define PERL_SHORT_MAX ((short) (PERL_USHORT_MAX >> 1))
238#endif
239#endif
240#endif
241#endif
242#ifndef PERL_SHORT_MIN
243#ifdef SHORT_MIN
244#define PERL_SHORT_MIN ((short)SHORT_MIN)
245#else
246#ifdef MINSHORT
247#define PERL_SHORT_MIN ((short)MINSHORT)
248#else
249#ifdef SHRT_MIN
250#define PERL_SHORT_MIN ((short)SHRT_MIN)
251#else
252#define PERL_SHORT_MIN (-PERL_SHORT_MAX - ((3 & -1) == 3))
253#endif
254#endif
255#endif
256#endif
257#ifndef PERL_UINT_MAX
258#ifdef UINT_MAX
259#define PERL_UINT_MAX ((unsigned int)UINT_MAX)
260#else
261#ifdef MAXUINT
262#define PERL_UINT_MAX ((unsigned int)MAXUINT)
263#else
264#define PERL_UINT_MAX (~(unsigned int)0)
265#endif
266#endif
267#endif
268#ifndef PERL_UINT_MIN
269#define PERL_UINT_MIN ((unsigned int)0)
270#endif
271#ifndef PERL_INT_MAX
272#ifdef INT_MAX
273#define PERL_INT_MAX ((int)INT_MAX)
274#else
275#ifdef MAXINT
276#define PERL_INT_MAX ((int)MAXINT)
277#else
278#define PERL_INT_MAX ((int)(PERL_UINT_MAX >> 1))
279#endif
280#endif
281#endif
282#ifndef PERL_INT_MIN
283#ifdef INT_MIN
284#define PERL_INT_MIN ((int)INT_MIN)
285#else
286#ifdef MININT
287#define PERL_INT_MIN ((int)MININT)
288#else
289#define PERL_INT_MIN (-PERL_INT_MAX - ((3 & -1) == 3))
290#endif
291#endif
292#endif
293#ifndef PERL_ULONG_MAX
294#ifdef ULONG_MAX
295#define PERL_ULONG_MAX ((unsigned long)ULONG_MAX)
296#else
297#ifdef MAXULONG
298#define PERL_ULONG_MAX ((unsigned long)MAXULONG)
299#else
300#define PERL_ULONG_MAX (~(unsigned long)0)
301#endif
302#endif
303#endif
304#ifndef PERL_ULONG_MIN
305#define PERL_ULONG_MIN ((unsigned long)0L)
306#endif
307#ifndef PERL_LONG_MAX
308#ifdef LONG_MAX
309#define PERL_LONG_MAX ((long)LONG_MAX)
310#else
311#ifdef MAXLONG
312#define PERL_LONG_MAX ((long)MAXLONG)
313#else
314#define PERL_LONG_MAX ((long) (PERL_ULONG_MAX >> 1))
315#endif
316#endif
317#endif
318#ifndef PERL_LONG_MIN
319#ifdef LONG_MIN
320#define PERL_LONG_MIN ((long)LONG_MIN)
321#else
322#ifdef MINLONG
323#define PERL_LONG_MIN ((long)MINLONG)
324#else
325#define PERL_LONG_MIN (-PERL_LONG_MAX - ((3 & -1) == 3))
326#endif
327#endif
328#endif
329#if defined(HAS_QUAD) && (defined(convex) || defined(uts))
330#ifndef PERL_UQUAD_MAX
331#ifdef ULONGLONG_MAX
332#define PERL_UQUAD_MAX ((unsigned long long)ULONGLONG_MAX)
333#else
334#ifdef MAXULONGLONG
335#define PERL_UQUAD_MAX ((unsigned long long)MAXULONGLONG)
336#else
337#define PERL_UQUAD_MAX (~(unsigned long long)0)
338#endif
339#endif
340#endif
341#ifndef PERL_UQUAD_MIN
342#define PERL_UQUAD_MIN ((unsigned long long)0L)
343#endif
344#ifndef PERL_QUAD_MAX
345#ifdef LONGLONG_MAX
346#define PERL_QUAD_MAX ((long long)LONGLONG_MAX)
347#else
348#ifdef MAXLONGLONG
349#define PERL_QUAD_MAX ((long long)MAXLONGLONG)
350#else
351#define PERL_QUAD_MAX ((long long) (PERL_UQUAD_MAX >> 1))
352#endif
353#endif
354#endif
355#ifndef PERL_QUAD_MIN
356#ifdef LONGLONG_MIN
357#define PERL_QUAD_MIN ((long long)LONGLONG_MIN)
358#else
359#ifdef MINLONGLONG
360#define PERL_QUAD_MIN ((long long)MINLONGLONG)
361#else
362#define PERL_QUAD_MIN (-PERL_QUAD_MAX - ((3 & -1) == 3))
363#endif
364#endif
365#endif
366#endif
367#ifdef HAS_QUAD
368#ifdef cray
369#ifndef IVTYPE
370#define IVTYPE int
371#endif
372#ifndef IV_MIN
373#define IV_MIN PERL_INT_MIN
374#endif
375#ifndef IV_MAX
376#define IV_MAX PERL_INT_MAX
377#endif
378#ifndef UV_MIN
379#define UV_MIN PERL_UINT_MIN
380#endif
381#ifndef UV_MAX
382#define UV_MAX PERL_UINT_MAX
383#endif
384#ifdef INTSIZE
385#ifndef IVSIZE
386#define IVSIZE INTSIZE
387#endif
388#endif
389#else
390#if defined(convex) || defined(uts)
391#ifndef IVTYPE
392#define IVTYPE long long
393#endif
394#ifndef IV_MIN
395#define IV_MIN PERL_QUAD_MIN
396#endif
397#ifndef IV_MAX
398#define IV_MAX PERL_QUAD_MAX
399#endif
400#ifndef UV_MIN
401#define UV_MIN PERL_UQUAD_MIN
402#endif
403#ifndef UV_MAX
404#define UV_MAX PERL_UQUAD_MAX
405#endif
406#ifdef LONGLONGSIZE
407#ifndef IVSIZE
408#define IVSIZE LONGLONGSIZE
409#endif
410#endif
411#else
412#ifndef IVTYPE
413#define IVTYPE long
414#endif
415#ifndef IV_MIN
416#define IV_MIN PERL_LONG_MIN
417#endif
418#ifndef IV_MAX
419#define IV_MAX PERL_LONG_MAX
420#endif
421#ifndef UV_MIN
422#define UV_MIN PERL_ULONG_MIN
423#endif
424#ifndef UV_MAX
425#define UV_MAX PERL_ULONG_MAX
426#endif
427#ifdef LONGSIZE
428#ifndef IVSIZE
429#define IVSIZE LONGSIZE
430#endif
431#endif
432#endif
433#endif
434#ifndef IVSIZE
435#define IVSIZE 8
436#endif
437#ifndef LONGSIZE
438#define LONGSIZE 8
439#endif
440#ifndef PERL_QUAD_MIN
441#define PERL_QUAD_MIN IV_MIN
442#endif
443#ifndef PERL_QUAD_MAX
444#define PERL_QUAD_MAX IV_MAX
445#endif
446#ifndef PERL_UQUAD_MIN
447#define PERL_UQUAD_MIN UV_MIN
448#endif
449#ifndef PERL_UQUAD_MAX
450#define PERL_UQUAD_MAX UV_MAX
451#endif
452#else
453#ifndef IVTYPE
454#define IVTYPE long
455#endif
456#ifndef LONGSIZE
457#define LONGSIZE 4
458#endif
459#ifndef IV_MIN
460#define IV_MIN PERL_LONG_MIN
461#endif
462#ifndef IV_MAX
463#define IV_MAX PERL_LONG_MAX
464#endif
465#ifndef UV_MIN
466#define UV_MIN PERL_ULONG_MIN
467#endif
468#ifndef UV_MAX
469#define UV_MAX PERL_ULONG_MAX
470#endif
471#endif
472#ifndef IVSIZE
473#ifdef LONGSIZE
474#define IVSIZE LONGSIZE
475#else
476#define IVSIZE 4
477#endif
478#endif
479#ifndef UVTYPE
480#define UVTYPE unsigned IVTYPE
481#endif
482#ifndef UVSIZE
483#define UVSIZE IVSIZE
484#endif
485#ifndef PERL_SIGNALS_UNSAFE_FLAG
486#define PERL_SIGNALS_UNSAFE_FLAG 0x0001
487#if (PERL_BCDVERSION < 0x5008000)
488#define D_PPP_PERL_SIGNALS_INIT PERL_SIGNALS_UNSAFE_FLAG
489#else
490#define D_PPP_PERL_SIGNALS_INIT 0
491#endif
492#if defined(NEED_PL_signals)
493static U32 DPPP_(my_PL_signals) = D_PPP_PERL_SIGNALS_INIT;
494#elif defined(NEED_PL_signals_GLOBAL)
495U32 DPPP_(my_PL_signals) = D_PPP_PERL_SIGNALS_INIT;
496#else
497extern U32 DPPP_(my_PL_signals);
498#endif
499#define PL_signals DPPP_(my_PL_signals)
500#endif
501#if (PERL_BCDVERSION <= 0x5005005)
502#define PL_ppaddr ppaddr
503#define PL_no_modify no_modify
504#endif
505#if (PERL_BCDVERSION <= 0x5004005)
506#define PL_DBsignal DBsignal
507#define PL_DBsingle DBsingle
508#define PL_DBsub DBsub
509#define PL_DBtrace DBtrace
510#define PL_Sv Sv
511#define PL_Xpv Xpv
512#define PL_bufend bufend
513#define PL_bufptr bufptr
514#define PL_compiling compiling
515#define PL_copline copline
516#define PL_curcop curcop
517#define PL_curstash curstash
518#define PL_debstash debstash
519#define PL_defgv defgv
520#define PL_diehook diehook
521#define PL_dirty dirty
522#define PL_dowarn dowarn
523#define PL_errgv errgv
524#define PL_error_count error_count
525#define PL_expect expect
526#define PL_hexdigit hexdigit
527#define PL_hints hints
528#define PL_in_my in_my
529#define PL_laststatval laststatval
530#define PL_lex_state lex_state
531#define PL_lex_stuff lex_stuff
532#define PL_linestr linestr
533#define PL_na na
534#define PL_perl_destruct_level perl_destruct_level
535#define PL_perldb perldb
536#define PL_rsfp_filters rsfp_filters
537#define PL_rsfp rsfp
538#define PL_stack_base stack_base
539#define PL_stack_sp stack_sp
540#define PL_statcache statcache
541#define PL_stdingv stdingv
542#define PL_sv_arenaroot sv_arenaroot
543#define PL_sv_no sv_no
544#define PL_sv_undef sv_undef
545#define PL_sv_yes sv_yes
546#define PL_tainted tainted
547#define PL_tainting tainting
548#define PL_tokenbuf tokenbuf
549#define PL_mess_sv mess_sv
550#endif
551#if (PERL_BCDVERSION >= 0x5009005)
552#ifdef DPPP_PL_parser_NO_DUMMY
553#define D_PPP_my_PL_parser_var(var) ((PL_parser ? PL_parser : \
554(croak("panic: PL_parser == NULL in %s:%d", \
555__FILE__, __LINE__), (yy_parser *) NULL))->var)
556#else
557#ifdef DPPP_PL_parser_NO_DUMMY_WARNING
558#define D_PPP_parser_dummy_warning(var)
559#else
560#define D_PPP_parser_dummy_warning(var) \
561warn("warning: dummy PL_" #var " used in %s:%d", __FILE__, __LINE__),
562#endif
563#define D_PPP_my_PL_parser_var(var) ((PL_parser ? PL_parser : \
564(D_PPP_parser_dummy_warning(var) &DPPP_(dummy_PL_parser)))->var)
565#if defined(NEED_PL_parser)
566static yy_parser DPPP_(dummy_PL_parser);
567#elif defined(NEED_PL_parser_GLOBAL)
568yy_parser DPPP_(dummy_PL_parser);
569#else
570extern yy_parser DPPP_(dummy_PL_parser);
571#endif
572#endif
573#define PL_expect D_PPP_my_PL_parser_var(expect)
574#define PL_copline D_PPP_my_PL_parser_var(copline)
575#define PL_rsfp D_PPP_my_PL_parser_var(rsfp)
576#define PL_rsfp_filters D_PPP_my_PL_parser_var(rsfp_filters)
577#define PL_linestr D_PPP_my_PL_parser_var(linestr)
578#define PL_bufptr D_PPP_my_PL_parser_var(bufptr)
579#define PL_bufend D_PPP_my_PL_parser_var(bufend)
580#define PL_lex_state D_PPP_my_PL_parser_var(lex_state)
581#define PL_lex_stuff D_PPP_my_PL_parser_var(lex_stuff)
582#define PL_tokenbuf D_PPP_my_PL_parser_var(tokenbuf)
583#define PL_in_my D_PPP_my_PL_parser_var(in_my)
584#define PL_in_my_stash D_PPP_my_PL_parser_var(in_my_stash)
585#define PL_error_count D_PPP_my_PL_parser_var(error_count)
586#else
587#define PL_parser ((void *) 1)
588#endif
589#if (PERL_BCDVERSION <= 0x5003022)
590#undef start_subparse
591#if (PERL_BCDVERSION < 0x5003022)
592#ifndef start_subparse
593#define start_subparse(a, b) Perl_start_subparse()
594#endif
595#else
596#ifndef start_subparse
597#define start_subparse(a, b) Perl_start_subparse(b)
598#endif
599#endif
600#if (PERL_BCDVERSION < 0x5003007)
601foo
602#endif
603#endif
604#if (PERL_BCDVERSION < 0x5004063) && (PERL_BCDVERSION != 0x5004005)
605#define NEED_newCONSTSUB
606#if defined(NEED_newCONSTSUB)
607static CV * DPPP_(my_newCONSTSUB)(HV * stash, const char * name, SV * sv);
608static
609#else
610extern CV * DPPP_(my_newCONSTSUB)(HV * stash, const char * name, SV * sv);
611#endif
612#if defined(NEED_newCONSTSUB) || defined(NEED_newCONSTSUB_GLOBAL)
613#ifdef newCONSTSUB
614#undef newCONSTSUB
615#endif
616#define newCONSTSUB(a,b,c) DPPP_(my_newCONSTSUB)(aTHX_ a,b,c)
617#define Perl_newCONSTSUB DPPP_(my_newCONSTSUB)
618#define D_PPP_PL_copline PL_copline
619CV *
620DPPP_(my_newCONSTSUB)(HV *stash, const char *name, SV *sv)
621{
622CV *cv;
623U32 oldhints = PL_hints;
624HV *old_cop_stash = PL_curcop->cop_stash;
625HV *old_curstash = PL_curstash;
626line_t oldline = PL_curcop->cop_line;
627PL_curcop->cop_line = D_PPP_PL_copline;
628PL_hints &= ~HINT_BLOCK_SCOPE;
629if (stash)
630PL_curstash = PL_curcop->cop_stash = stash;
631cv = newSUB(
632start_subparse(FALSE, 0),
633newSVOP(OP_CONST, 0, newSVpv((char *) name, 0)),
634newSVOP(OP_CONST, 0, &PL_sv_no),
635newSTATEOP(0, Nullch, newSVOP(OP_CONST, 0, sv))
636);
637PL_hints = oldhints;
638PL_curcop->cop_stash = old_cop_stash;
639PL_curstash = old_curstash;
640PL_curcop->cop_line = oldline;
641return cv;
642}
643#endif
644#endif
645#ifndef PERL_MAGIC_sv
646#define PERL_MAGIC_sv '\0'
647#endif
648#ifndef PERL_MAGIC_overload
649#define PERL_MAGIC_overload 'A'
650#endif
651#ifndef PERL_MAGIC_overload_elem
652#define PERL_MAGIC_overload_elem 'a'
653#endif
654#ifndef PERL_MAGIC_overload_table
655#define PERL_MAGIC_overload_table 'c'
656#endif
657#ifndef PERL_MAGIC_bm
658#define PERL_MAGIC_bm 'B'
659#endif
660#ifndef PERL_MAGIC_regdata
661#define PERL_MAGIC_regdata 'D'
662#endif
663#ifndef PERL_MAGIC_regdatum
664#define PERL_MAGIC_regdatum 'd'
665#endif
666#ifndef PERL_MAGIC_env
667#define PERL_MAGIC_env 'E'
668#endif
669#ifndef PERL_MAGIC_envelem
670#define PERL_MAGIC_envelem 'e'
671#endif
672#ifndef PERL_MAGIC_fm
673#define PERL_MAGIC_fm 'f'
674#endif
675#ifndef PERL_MAGIC_regex_global
676#define PERL_MAGIC_regex_global 'g'
677#endif
678#ifndef PERL_MAGIC_isa
679#define PERL_MAGIC_isa 'I'
680#endif
681#ifndef PERL_MAGIC_isaelem
682#define PERL_MAGIC_isaelem 'i'
683#endif
684#ifndef PERL_MAGIC_nkeys
685#define PERL_MAGIC_nkeys 'k'
686#endif
687#ifndef PERL_MAGIC_dbfile
688#define PERL_MAGIC_dbfile 'L'
689#endif
690#ifndef PERL_MAGIC_dbline
691#define PERL_MAGIC_dbline 'l'
692#endif
693#ifndef PERL_MAGIC_mutex
694#define PERL_MAGIC_mutex 'm'
695#endif
696#ifndef PERL_MAGIC_shared
697#define PERL_MAGIC_shared 'N'
698#endif
699#ifndef PERL_MAGIC_shared_scalar
700#define PERL_MAGIC_shared_scalar 'n'
701#endif
702#ifndef PERL_MAGIC_collxfrm
703#define PERL_MAGIC_collxfrm 'o'
704#endif
705#ifndef PERL_MAGIC_tied
706#define PERL_MAGIC_tied 'P'
707#endif
708#ifndef PERL_MAGIC_tiedelem
709#define PERL_MAGIC_tiedelem 'p'
710#endif
711#ifndef PERL_MAGIC_tiedscalar
712#define PERL_MAGIC_tiedscalar 'q'
713#endif
714#ifndef PERL_MAGIC_qr
715#define PERL_MAGIC_qr 'r'
716#endif
717#ifndef PERL_MAGIC_sig
718#define PERL_MAGIC_sig 'S'
719#endif
720#ifndef PERL_MAGIC_sigelem
721#define PERL_MAGIC_sigelem 's'
722#endif
723#ifndef PERL_MAGIC_taint
724#define PERL_MAGIC_taint 't'
725#endif
726#ifndef PERL_MAGIC_uvar
727#define PERL_MAGIC_uvar 'U'
728#endif
729#ifndef PERL_MAGIC_uvar_elem
730#define PERL_MAGIC_uvar_elem 'u'
731#endif
732#ifndef PERL_MAGIC_vstring
733#define PERL_MAGIC_vstring 'V'
734#endif
735#ifndef PERL_MAGIC_vec
736#define PERL_MAGIC_vec 'v'
737#endif
738#ifndef PERL_MAGIC_utf8
739#define PERL_MAGIC_utf8 'w'
740#endif
741#ifndef PERL_MAGIC_substr
742#define PERL_MAGIC_substr 'x'
743#endif
744#ifndef PERL_MAGIC_defelem
745#define PERL_MAGIC_defelem 'y'
746#endif
747#ifndef PERL_MAGIC_glob
748#define PERL_MAGIC_glob '*'
749#endif
750#ifndef PERL_MAGIC_arylen
751#define PERL_MAGIC_arylen '#'
752#endif
753#ifndef PERL_MAGIC_pos
754#define PERL_MAGIC_pos '.'
755#endif
756#ifndef PERL_MAGIC_backref
757#define PERL_MAGIC_backref '<'
758#endif
759#ifndef PERL_MAGIC_ext
760#define PERL_MAGIC_ext '~'
761#endif
762#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
763#ifndef PERL_STATIC_INLINE
764#define PERL_STATIC_INLINE static inline
765#endif
766#else
767#ifndef PERL_STATIC_INLINE
768#define PERL_STATIC_INLINE static
769#endif
770#endif
771#ifndef cBOOL
772#define cBOOL(cbool) ((cbool) ? (bool)1 : (bool)0)
773#endif
774#ifndef OpHAS_SIBLING
775#define OpHAS_SIBLING(o) (cBOOL((o)->op_sibling))
776#endif
777#ifndef OpSIBLING
778#define OpSIBLING(o) (0 + (o)->op_sibling)
779#endif
780#ifndef OpMORESIB_set
781#define OpMORESIB_set(o, sib) ((o)->op_sibling = (sib))
782#endif
783#ifndef OpLASTSIB_set
784#define OpLASTSIB_set(o, parent) ((o)->op_sibling = NULL)
785#endif
786#ifndef OpMAYBESIB_set
787#define OpMAYBESIB_set(o, sib, parent) ((o)->op_sibling = (sib))
788#endif
789#ifndef HEf_SVKEY
790#define HEf_SVKEY -2
791#endif
792#if defined(DEBUGGING) && !defined(__COVERITY__)
793#ifndef __ASSERT_
794#define __ASSERT_(statement) assert(statement),
795#endif
796#else
797#ifndef __ASSERT_
798#define __ASSERT_(statement)
799#endif
800#endif
801#ifndef __has_builtin
802#define __has_builtin(x) 0
803#endif
804#if __has_builtin(__builtin_unreachable)
805#define D_PPP_HAS_BUILTIN_UNREACHABLE
806#elif (defined(__GNUC__) && ( __GNUC__ > 4 \
807|| __GNUC__ == 4 && __GNUC_MINOR__ >= 5))
808#define D_PPP_HAS_BUILTIN_UNREACHABLE
809#endif
810#ifndef ASSUME
811#ifdef DEBUGGING
812#define ASSUME(x) assert(x)
813#elif defined(_MSC_VER)
814#define ASSUME(x) __assume(x)
815#elif defined(__ARMCC_VERSION)
816#define ASSUME(x) __promise(x)
817#elif defined(D_PPP_HAS_BUILTIN_UNREACHABLE)
818#define ASSUME(x) ((x) ? (void) 0 : __builtin_unreachable())
819#else
820#define ASSUME(x) assert(x)
821#endif
822#endif
823#ifndef NOT_REACHED
824#ifdef D_PPP_HAS_BUILTIN_UNREACHABLE
825#define NOT_REACHED \
826STMT_START { \
827ASSUME(!"UNREACHABLE"); __builtin_unreachable(); \
828} STMT_END
829#elif ! defined(__GNUC__) && (defined(__sun) || defined(__hpux))
830#define NOT_REACHED
831#else
832#define NOT_REACHED ASSUME(!"UNREACHABLE")
833#endif
834#endif
835#ifndef WIDEST_UTYPE
836#ifdef QUADKIND
837#ifdef U64TYPE
838#define WIDEST_UTYPE U64TYPE
839#else
840#define WIDEST_UTYPE unsigned Quad_t
841#endif
842#else
843#define WIDEST_UTYPE U32
844#endif
845#endif
846#ifndef withinCOUNT
847#define withinCOUNT(c, l, n) \
848(((WIDEST_UTYPE) (((c)) - ((l) | 0))) <= (((WIDEST_UTYPE) ((n) | 0))))
849#endif
850#ifndef inRANGE
851#define inRANGE(c, l, u) \
852( (sizeof(c) == sizeof(U8)) ? withinCOUNT(((U8) (c)), (l), ((u) - (l))) \
853: (sizeof(c) == sizeof(U32)) ? withinCOUNT(((U32) (c)), (l), ((u) - (l))) \
854: (withinCOUNT(((WIDEST_UTYPE) (c)), (l), ((u) - (l)))))
855#endif
856#undef FITS_IN_8_BITS
857#ifndef FITS_IN_8_BITS
858#define FITS_IN_8_BITS(c) ( (sizeof(c) == 1) \
859|| !(((WIDEST_UTYPE)((c) | 0)) & ~0xFF))
860#endif
861#define D_PPP_IS_GENERIC_UTF8_SAFE(s, e, macro) \
862(((e) - (s)) <= 0 \
863? 0 \
864: UTF8_IS_INVARIANT((s)[0]) \
865? is ## macro ## _L1((s)[0]) \
866: (((e) - (s)) < UTF8SKIP(s)) \
867? 0 \
868: UTF8_IS_DOWNGRADEABLE_START((s)[0]) \
869\
870? is ## macro ## _L1((WIDEST_UTYPE) LATIN1_TO_NATIVE( \
871UTF8_ACCUMULATE(NATIVE_UTF8_TO_I8((s)[0]) \
872& UTF_START_MASK(2), \
873(s)[1]))) \
874: is ## macro ## _utf8(s))
875#define D_PPP_IS_GENERIC_LC_UTF8_SAFE(s, e, macro) \
876(((e) - (s)) <= 0 \
877? 0 \
878: UTF8_IS_INVARIANT((s)[0]) \
879? is ## macro ## _LC((s)[0]) \
880: (((e) - (s)) < UTF8SKIP(s)) \
881? 0 \
882: UTF8_IS_DOWNGRADEABLE_START((s)[0]) \
883\
884? is ## macro ## _LC((WIDEST_UTYPE) LATIN1_TO_NATIVE( \
885UTF8_ACCUMULATE(NATIVE_UTF8_TO_I8((s)[0]) \
886& UTF_START_MASK(2), \
887(s)[1]))) \
888: is ## macro ## _utf8(s))
889#define D_PPP_IS_GENERIC_LC_UTF8_SAFE_BROKEN(s, e, macro) \
890(((e) - (s)) <= 0 \
891? 0 \
892: UTF8_IS_INVARIANT((s)[0]) \
893? is ## macro ## _LC((s)[0]) \
894: (((e) - (s)) < UTF8SKIP(s)) \
895? 0 \
896: UTF8_IS_DOWNGRADEABLE_START((s)[0]) \
897\
898? is ## macro ## _LC((WIDEST_UTYPE) LATIN1_TO_NATIVE( \
899UTF8_ACCUMULATE(NATIVE_UTF8_TO_I8((s)[0]) \
900& UTF_START_MASK(2), \
901(s)[1]))) \
902: is ## macro ## _utf8_safe(s, e))
903#ifndef SvRX
904#define SvRX(rv) (SvROK((rv)) ? (SvMAGICAL(SvRV((rv))) ? (mg_find(SvRV((rv)), PERL_MAGIC_qr) ? mg_find(SvRV((rv)), PERL_MAGIC_qr)->mg_obj : NULL) : NULL) : NULL)
905#endif
906#ifndef SvRXOK
907#define SvRXOK(sv) (!!SvRX(sv))
908#endif
909#ifndef PERL_UNUSED_DECL
910#ifdef HASATTRIBUTE
911#if (defined(__GNUC__) && defined(__cplusplus)) || defined(__INTEL_COMPILER)
912#define PERL_UNUSED_DECL
913#else
914#define PERL_UNUSED_DECL __attribute__((unused))
915#endif
916#else
917#define PERL_UNUSED_DECL
918#endif
919#endif
920#ifndef PERL_UNUSED_ARG
921#if defined(lint) && defined(S_SPLINT_S)
922#include <note.h>
923#define PERL_UNUSED_ARG(x) NOTE(ARGUNUSED(x))
924#else
925#define PERL_UNUSED_ARG(x) ((void)x)
926#endif
927#endif
928#ifndef PERL_UNUSED_VAR
929#define PERL_UNUSED_VAR(x) ((void)x)
930#endif
931#ifndef PERL_UNUSED_CONTEXT
932#ifdef USE_ITHREADS
933#define PERL_UNUSED_CONTEXT PERL_UNUSED_ARG(my_perl)
934#else
935#define PERL_UNUSED_CONTEXT
936#endif
937#endif
938#ifndef PERL_UNUSED_RESULT
939#if defined(__GNUC__) && defined(HASATTRIBUTE_WARN_UNUSED_RESULT)
940#define PERL_UNUSED_RESULT(v) STMT_START { __typeof__(v) z = (v); (void)sizeof(z); } STMT_END
941#else
942#define PERL_UNUSED_RESULT(v) ((void)(v))
943#endif
944#endif
945#ifndef NOOP
946#define NOOP (void)0
947#endif
948#if (PERL_BCDVERSION < 0x5006001) && (PERL_BCDVERSION < 0x5027007)
949#undef dNOOP
950#ifndef dNOOP
951#define dNOOP struct Perl___notused_struct
952#endif
953#endif
954#ifndef NVTYPE
955#if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
956#define NVTYPE long double
957#else
958#define NVTYPE double
959#endif
960typedef NVTYPE NV;
961#endif
962#ifndef INT2PTR
963#if (IVSIZE == PTRSIZE) && (UVSIZE == PTRSIZE)
964#define PTRV UV
965#define INT2PTR(any,d) (any)(d)
966#else
967#if PTRSIZE == LONGSIZE
968#define PTRV unsigned long
969#else
970#define PTRV unsigned
971#endif
972#define INT2PTR(any,d) (any)(PTRV)(d)
973#endif
974#endif
975#ifndef PTR2ul
976#if PTRSIZE == LONGSIZE
977#define PTR2ul(p) (unsigned long)(p)
978#else
979#define PTR2ul(p) INT2PTR(unsigned long,p)
980#endif
981#endif
982#ifndef PTR2nat
983#define PTR2nat(p) (PTRV)(p)
984#endif
985#ifndef NUM2PTR
986#define NUM2PTR(any,d) (any)PTR2nat(d)
987#endif
988#ifndef PTR2IV
989#define PTR2IV(p) INT2PTR(IV,p)
990#endif
991#ifndef PTR2UV
992#define PTR2UV(p) INT2PTR(UV,p)
993#endif
994#ifndef PTR2NV
995#define PTR2NV(p) NUM2PTR(NV,p)
996#endif
997#undef START_EXTERN_C
998#undef END_EXTERN_C
999#undef EXTERN_C
1000#ifdef __cplusplus
1001#define START_EXTERN_C extern "C" {
1002#define END_EXTERN_C }
1003#define EXTERN_C extern "C"
1004#else
1005#define START_EXTERN_C
1006#define END_EXTERN_C
1007#define EXTERN_C extern
1008#endif
1009#if (PERL_BCDVERSION < 0x5004000) || defined(PERL_GCC_PEDANTIC)
1010#ifndef PERL_GCC_BRACE_GROUPS_FORBIDDEN
1011#ifndef PERL_GCC_BRACE_GROUPS_FORBIDDEN
1012#define PERL_GCC_BRACE_GROUPS_FORBIDDEN
1013#endif
1014#endif
1015#endif
1016#if ! defined(__GNUC__) || defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN) || defined(__cplusplus)
1017#undef PERL_USE_GCC_BRACE_GROUPS
1018#else
1019#ifndef PERL_USE_GCC_BRACE_GROUPS
1020#define PERL_USE_GCC_BRACE_GROUPS
1021#endif
1022#endif
1023#undef STMT_START
1024#undef STMT_END
1025#if defined(VOIDFLAGS) && (VOIDFLAGS) && (defined(sun) || defined(__sun__)) && !defined(__GNUC__)
1026#define STMT_START if (1)
1027#define STMT_END else (void)0
1028#else
1029#define STMT_START do
1030#define STMT_END while (0)
1031#endif
1032#ifndef boolSV
1033#define boolSV(b) ((b) ? &PL_sv_yes : &PL_sv_no)
1034#endif
1035#ifndef DEFSV
1036#define DEFSV GvSV(PL_defgv)
1037#endif
1038#ifndef SAVE_DEFSV
1039#define SAVE_DEFSV SAVESPTR(GvSV(PL_defgv))
1040#endif
1041#ifndef DEFSV_set
1042#define DEFSV_set(sv) (DEFSV = (sv))
1043#endif
1044#ifndef AvFILLp
1045#define AvFILLp AvFILL
1046#endif
1047#ifndef av_tindex
1048#define av_tindex AvFILL
1049#endif
1050#ifndef av_top_index
1051#define av_top_index AvFILL
1052#endif
1053#ifndef av_count
1054#define av_count(av) (AvFILL(av)+1)
1055#endif
1056#ifndef ERRSV
1057#define ERRSV get_sv("@",FALSE)
1058#endif
1059#ifndef gv_stashpvn
1060#define gv_stashpvn(str,len,create) gv_stashpv(str,create)
1061#endif
1062#ifndef get_cv
1063#define get_cv perl_get_cv
1064#endif
1065#ifndef get_sv
1066#define get_sv perl_get_sv
1067#endif
1068#ifndef get_av
1069#define get_av perl_get_av
1070#endif
1071#ifndef get_hv
1072#define get_hv perl_get_hv
1073#endif
1074#ifndef dUNDERBAR
1075#define dUNDERBAR dNOOP
1076#endif
1077#ifndef UNDERBAR
1078#define UNDERBAR DEFSV
1079#endif
1080#ifndef dAX
1081#define dAX I32 ax = MARK - PL_stack_base + 1
1082#endif
1083#ifndef dITEMS
1084#define dITEMS I32 items = SP - MARK
1085#endif
1086#ifndef dXSTARG
1087#define dXSTARG SV * targ = sv_newmortal()
1088#endif
1089#ifndef dAXMARK
1090#define dAXMARK I32 ax = POPMARK; \
1091SV ** const mark = PL_stack_base + ax++
1092#endif
1093#ifndef XSprePUSH
1094#define XSprePUSH (sp = PL_stack_base + ax - 1)
1095#endif
1096#if (PERL_BCDVERSION < 0x5005000)
1097#undef XSRETURN
1098#define XSRETURN(off) \
1099STMT_START { \
1100PL_stack_sp = PL_stack_base + ax + ((off) - 1); \
1101return; \
1102} STMT_END
1103#endif
1104#ifndef XSPROTO
1105#define XSPROTO(name) void name(pTHX_ CV* cv)
1106#endif
1107#ifndef SVfARG
1108#define SVfARG(p) ((void*)(p))
1109#endif
1110#ifndef PERL_ABS
1111#define PERL_ABS(x) ((x) < 0 ? -(x) : (x))
1112#endif
1113#ifndef dVAR
1114#define dVAR dNOOP
1115#endif
1116#ifndef SVf
1117#define SVf "_"
1118#endif
1119#ifndef CPERLscope
1120#define CPERLscope(x) x
1121#endif
1122#ifndef PERL_HASH
1123#define PERL_HASH(hash,str,len) \
1124STMT_START { \
1125const char *s_PeRlHaSh = str; \
1126I32 i_PeRlHaSh = len; \
1127U32 hash_PeRlHaSh = 0; \
1128while (i_PeRlHaSh--) \
1129hash_PeRlHaSh = hash_PeRlHaSh * 33 + *s_PeRlHaSh++; \
1130(hash) = hash_PeRlHaSh; \
1131} STMT_END
1132#endif
1133#ifndef PERLIO_FUNCS_DECL
1134#ifdef PERLIO_FUNCS_CONST
1135#define PERLIO_FUNCS_DECL(funcs) const PerlIO_funcs funcs
1136#define PERLIO_FUNCS_CAST(funcs) (PerlIO_funcs*)(funcs)
1137#else
1138#define PERLIO_FUNCS_DECL(funcs) PerlIO_funcs funcs
1139#define PERLIO_FUNCS_CAST(funcs) (funcs)
1140#endif
1141#endif
1142#if (PERL_BCDVERSION < 0x5009003)
1143#ifdef ARGSproto
1144typedef OP* (CPERLscope(*Perl_ppaddr_t))(ARGSproto);
1145#else
1147#endif
1148typedef OP* (CPERLscope(*Perl_check_t)) (pTHX_ OP*);
1149#endif
1150#if defined(EBCDIC) && defined(NATIVE_TO_ASCI)
1151#ifndef NATIVE_TO_LATIN1
1152#define NATIVE_TO_LATIN1(c) NATIVE_TO_ASCII(c)
1153#endif
1154#ifndef LATIN1_TO_NATIVE
1155#define LATIN1_TO_NATIVE(c) ASCII_TO_NATIVE(c)
1156#endif
1157#ifndef NATIVE_TO_UNI
1158#define NATIVE_TO_UNI(c) ((c) > 255 ? (c) : NATIVE_TO_LATIN1(c))
1159#endif
1160#ifndef UNI_TO_NATIVE
1161#define UNI_TO_NATIVE(c) ((c) > 255 ? (c) : LATIN1_TO_NATIVE(c))
1162#endif
1163#else
1164#ifndef NATIVE_TO_LATIN1
1165#define NATIVE_TO_LATIN1(c) (c)
1166#endif
1167#ifndef LATIN1_TO_NATIVE
1168#define LATIN1_TO_NATIVE(c) (c)
1169#endif
1170#ifndef NATIVE_TO_UNI
1171#define NATIVE_TO_UNI(c) (c)
1172#endif
1173#ifndef UNI_TO_NATIVE
1174#define UNI_TO_NATIVE(c) (c)
1175#endif
1176#endif
1177#undef isPSXSPC
1178#undef isPSXSPC_A
1179#undef isPSXSPC_L1
1180#ifdef EBCDIC
1181#if (PERL_BCDVERSION < 0x5022000)
1182#undef isALNUM
1183#undef isALNUM_A
1184#undef isALNUM_L1
1185#undef isALNUMC
1186#undef isALNUMC_A
1187#undef isALNUMC_L1
1188#undef isALPHA
1189#undef isALPHA_A
1190#undef isALPHA_L1
1191#undef isALPHANUMERIC
1192#undef isALPHANUMERIC_A
1193#undef isALPHANUMERIC_L1
1194#undef isASCII
1195#undef isASCII_A
1196#undef isASCII_L1
1197#undef isBLANK
1198#undef isBLANK_A
1199#undef isBLANK_L1
1200#undef isCNTRL
1201#undef isCNTRL_A
1202#undef isCNTRL_L1
1203#undef isDIGIT
1204#undef isDIGIT_A
1205#undef isDIGIT_L1
1206#undef isGRAPH
1207#undef isGRAPH_A
1208#undef isGRAPH_L1
1209#undef isIDCONT
1210#undef isIDCONT_A
1211#undef isIDCONT_L1
1212#undef isIDFIRST
1213#undef isIDFIRST_A
1214#undef isIDFIRST_L1
1215#undef isLOWER
1216#undef isLOWER_A
1217#undef isLOWER_L1
1218#undef isOCTAL
1219#undef isOCTAL_A
1220#undef isOCTAL_L1
1221#undef isPRINT
1222#undef isPRINT_A
1223#undef isPRINT_L1
1224#undef isPUNCT
1225#undef isPUNCT_A
1226#undef isPUNCT_L1
1227#undef isSPACE
1228#undef isSPACE_A
1229#undef isSPACE_L1
1230#undef isUPPER
1231#undef isUPPER_A
1232#undef isUPPER_L1
1233#undef isWORDCHAR
1234#undef isWORDCHAR_A
1235#undef isWORDCHAR_L1
1236#undef isXDIGIT
1237#undef isXDIGIT_A
1238#undef isXDIGIT_L1
1239#endif
1240#ifndef isASCII
1241#define isASCII(c) (isCNTRL(c) || isPRINT(c))
1242#endif
1243#ifndef isCNTRL
1244#define isCNTRL(c) ( (c) == '\0' || (c) == '\a' || (c) == '\b' \
1245|| (c) == '\f' || (c) == '\n' || (c) == '\r' \
1246|| (c) == '\t' || (c) == '\v' \
1247|| ((c) <= 3 && (c) >= 1) \
1248|| (c) == 7 \
1249|| ((c) <= 0x13 && (c) >= 0x0E) \
1250\
1251|| (c) == 0x18 \
1252|| (c) == 0x19 \
1253|| ((c) <= 0x1F && (c) >= 0x1C) \
1254|| (c) == 0x26 \
1255|| (c) == 0x27 \
1256|| (c) == 0x2D \
1257|| (c) == 0x2E \
1258|| (c) == 0x32 \
1259|| (c) == 0x37 \
1260|| (c) == 0x3C \
1261|| (c) == 0x3D \
1262|| (c) == 0x3F \
1263)
1264#endif
1265#if '^' == 106
1266#define D_PPP_OUTLIER_CONTROL 0x5F
1267#else
1268#define D_PPP_OUTLIER_CONTROL 0xFF
1269#endif
1270#ifndef isCNTRL_L1
1271#define isCNTRL_L1(c) ((WIDEST_UTYPE) (c) < ' ' \
1272|| (WIDEST_UTYPE) (c) == D_PPP_OUTLIER_CONTROL)
1273#endif
1274#ifndef isLOWER
1275#define isLOWER(c) ( (c) >= 'a' && (c) <= 'z' \
1276&& ( (c) <= 'i' \
1277|| ((c) >= 'j' && (c) <= 'r') \
1278|| (c) >= 's'))
1279#endif
1280#ifndef isUPPER
1281#define isUPPER(c) ( (c) >= 'A' && (c) <= 'Z' \
1282&& ( (c) <= 'I' \
1283|| ((c) >= 'J' && (c) <= 'R') \
1284|| (c) >= 'S'))
1285#endif
1286#else
1287#if (PERL_BCDVERSION < 0x5004000)
1288#undef isALNUM
1289#undef isALNUM_A
1290#undef isALPHA
1291#undef isALPHA_A
1292#undef isDIGIT
1293#undef isDIGIT_A
1294#undef isIDFIRST
1295#undef isIDFIRST_A
1296#undef isLOWER
1297#undef isLOWER_A
1298#undef isUPPER
1299#undef isUPPER_A
1300#endif
1301#if (PERL_BCDVERSION == 0x5007000)
1302#undef isGRAPH
1303#endif
1304#if (PERL_BCDVERSION < 0x5008000)
1305#undef isCNTRL
1306#endif
1307#if (PERL_BCDVERSION < 0x5010000)
1308#undef isPRINT
1309#undef isPRINT_A
1310#endif
1311#if (PERL_BCDVERSION < 0x5014000)
1312#undef isASCII
1313#undef isASCII_A
1314#endif
1315#if (PERL_BCDVERSION < 0x5017008)
1316#undef isPUNCT_L1
1317#endif
1318#if (PERL_BCDVERSION < 0x5013007)
1319#undef isALNUMC_L1
1320#endif
1321#if (PERL_BCDVERSION < 0x5020000)
1322#undef isSPACE
1323#undef isSPACE_A
1324#undef isSPACE_L1
1325#endif
1326#ifndef isASCII
1327#define isASCII(c) ((WIDEST_UTYPE) (c) <= 127)
1328#endif
1329#ifndef isCNTRL
1330#define isCNTRL(c) ((WIDEST_UTYPE) (c) < ' ' || (c) == 127)
1331#endif
1332#ifndef isCNTRL_L1
1333#define isCNTRL_L1(c) ( (WIDEST_UTYPE) (c) < ' ' \
1334|| inRANGE((c), 0x7F, 0x9F))
1335#endif
1336#ifndef isLOWER
1337#define isLOWER(c) inRANGE((c), 'a', 'z')
1338#endif
1339#ifndef isUPPER
1340#define isUPPER(c) inRANGE((c), 'A', 'Z')
1341#endif
1342#endif
1343#ifndef isASCII_L1
1344#define isASCII_L1(c) isASCII(c)
1345#endif
1346#ifndef isASCII_LC
1347#define isASCII_LC(c) isASCII(c)
1348#endif
1349#ifndef isALNUM
1350#define isALNUM(c) isWORDCHAR(c)
1351#endif
1352#ifndef isALNUMC
1353#define isALNUMC(c) isALPHANUMERIC(c)
1354#endif
1355#ifndef isALNUMC_L1
1356#define isALNUMC_L1(c) isALPHANUMERIC_L1(c)
1357#endif
1358#ifndef isALPHA
1359#define isALPHA(c) (isUPPER(c) || isLOWER(c))
1360#endif
1361#ifndef isALPHA_L1
1362#define isALPHA_L1(c) (isUPPER_L1(c) || isLOWER_L1(c))
1363#endif
1364#ifndef isALPHANUMERIC
1365#define isALPHANUMERIC(c) (isALPHA(c) || isDIGIT(c))
1366#endif
1367#ifndef isALPHANUMERIC_L1
1368#define isALPHANUMERIC_L1(c) (isALPHA_L1(c) || isDIGIT(c))
1369#endif
1370#ifndef isALPHANUMERIC_LC
1371#define isALPHANUMERIC_LC(c) (isALPHA_LC(c) || isDIGIT_LC(c))
1372#endif
1373#ifndef isBLANK
1374#define isBLANK(c) ((c) == ' ' || (c) == '\t')
1375#endif
1376#ifndef isBLANK_L1
1377#define isBLANK_L1(c) ( isBLANK(c) \
1378|| ( FITS_IN_8_BITS(c) \
1379&& NATIVE_TO_LATIN1((U8) c) == 0xA0))
1380#endif
1381#ifndef isBLANK_LC
1382#define isBLANK_LC(c) isBLANK(c)
1383#endif
1384#ifndef isDIGIT
1385#define isDIGIT(c) inRANGE(c, '0', '9')
1386#endif
1387#ifndef isDIGIT_L1
1388#define isDIGIT_L1(c) isDIGIT(c)
1389#endif
1390#ifndef isGRAPH
1391#define isGRAPH(c) (isWORDCHAR(c) || isPUNCT(c))
1392#endif
1393#ifndef isGRAPH_L1
1394#define isGRAPH_L1(c) ( isPRINT_L1(c) \
1395&& (c) != ' ' \
1396&& NATIVE_TO_LATIN1((U8) c) != 0xA0)
1397#endif
1398#ifndef isIDCONT
1399#define isIDCONT(c) isWORDCHAR(c)
1400#endif
1401#ifndef isIDCONT_L1
1402#define isIDCONT_L1(c) isWORDCHAR_L1(c)
1403#endif
1404#ifndef isIDCONT_LC
1405#define isIDCONT_LC(c) isWORDCHAR_LC(c)
1406#endif
1407#ifndef isIDFIRST
1408#define isIDFIRST(c) (isALPHA(c) || (c) == '_')
1409#endif
1410#ifndef isIDFIRST_L1
1411#define isIDFIRST_L1(c) (isALPHA_L1(c) || (U8) (c) == '_')
1412#endif
1413#ifndef isIDFIRST_LC
1414#define isIDFIRST_LC(c) (isALPHA_LC(c) || (U8) (c) == '_')
1415#endif
1416#ifndef isLOWER_L1
1417#define isLOWER_L1(c) ( isLOWER(c) \
1418|| ( FITS_IN_8_BITS(c) \
1419&& ( ( NATIVE_TO_LATIN1((U8) c) >= 0xDF \
1420&& NATIVE_TO_LATIN1((U8) c) != 0xF7) \
1421|| NATIVE_TO_LATIN1((U8) c) == 0xAA \
1422|| NATIVE_TO_LATIN1((U8) c) == 0xBA \
1423|| NATIVE_TO_LATIN1((U8) c) == 0xB5)))
1424#endif
1425#ifndef isOCTAL
1426#define isOCTAL(c) (((WIDEST_UTYPE)((c)) & ~7) == '0')
1427#endif
1428#ifndef isOCTAL_L1
1429#define isOCTAL_L1(c) isOCTAL(c)
1430#endif
1431#ifndef isPRINT
1432#define isPRINT(c) (isGRAPH(c) || (c) == ' ')
1433#endif
1434#ifndef isPRINT_L1
1435#define isPRINT_L1(c) (FITS_IN_8_BITS(c) && ! isCNTRL_L1(c))
1436#endif
1437#ifndef isPSXSPC
1438#define isPSXSPC(c) isSPACE(c)
1439#endif
1440#ifndef isPSXSPC_L1
1441#define isPSXSPC_L1(c) isSPACE_L1(c)
1442#endif
1443#ifndef isPUNCT
1444#define isPUNCT(c) ( (c) == '-' || (c) == '!' || (c) == '"' \
1445|| (c) == '#' || (c) == '$' || (c) == '%' \
1446|| (c) == '&' || (c) == '\'' || (c) == '(' \
1447|| (c) == ')' || (c) == '*' || (c) == '+' \
1448|| (c) == ',' || (c) == '.' || (c) == '/' \
1449|| (c) == ':' || (c) == ';' || (c) == '<' \
1450|| (c) == '=' || (c) == '>' || (c) == '?' \
1451|| (c) == '@' || (c) == '[' || (c) == '\\' \
1452|| (c) == ']' || (c) == '^' || (c) == '_' \
1453|| (c) == '`' || (c) == '{' || (c) == '|' \
1454|| (c) == '}' || (c) == '~')
1455#endif
1456#ifndef isPUNCT_L1
1457#define isPUNCT_L1(c) ( isPUNCT(c) \
1458|| ( FITS_IN_8_BITS(c) \
1459&& ( NATIVE_TO_LATIN1((U8) c) == 0xA1 \
1460|| NATIVE_TO_LATIN1((U8) c) == 0xA7 \
1461|| NATIVE_TO_LATIN1((U8) c) == 0xAB \
1462|| NATIVE_TO_LATIN1((U8) c) == 0xB6 \
1463|| NATIVE_TO_LATIN1((U8) c) == 0xB7 \
1464|| NATIVE_TO_LATIN1((U8) c) == 0xBB \
1465|| NATIVE_TO_LATIN1((U8) c) == 0xBF)))
1466#endif
1467#ifndef isSPACE
1468#define isSPACE(c) ( isBLANK(c) || (c) == '\n' || (c) == '\r' \
1469|| (c) == '\v' || (c) == '\f')
1470#endif
1471#ifndef isSPACE_L1
1472#define isSPACE_L1(c) ( isSPACE(c) \
1473|| (FITS_IN_8_BITS(c) \
1474&& ( NATIVE_TO_LATIN1((U8) c) == 0x85 \
1475|| NATIVE_TO_LATIN1((U8) c) == 0xA0)))
1476#endif
1477#ifndef isUPPER_L1
1478#define isUPPER_L1(c) ( isUPPER(c) \
1479|| (FITS_IN_8_BITS(c) \
1480&& ( NATIVE_TO_LATIN1((U8) c) >= 0xC0 \
1481&& NATIVE_TO_LATIN1((U8) c) <= 0xDE \
1482&& NATIVE_TO_LATIN1((U8) c) != 0xD7)))
1483#endif
1484#ifndef isWORDCHAR
1485#define isWORDCHAR(c) (isALPHANUMERIC(c) || (c) == '_')
1486#endif
1487#ifndef isWORDCHAR_L1
1488#define isWORDCHAR_L1(c) (isIDFIRST_L1(c) || isDIGIT(c))
1489#endif
1490#ifndef isWORDCHAR_LC
1491#define isWORDCHAR_LC(c) (isIDFIRST_LC(c) || isDIGIT_LC(c))
1492#endif
1493#ifndef isXDIGIT
1494#define isXDIGIT(c) ( isDIGIT(c) \
1495|| inRANGE((c), 'a', 'f') \
1496|| inRANGE((c), 'A', 'F'))
1497#endif
1498#ifndef isXDIGIT_L1
1499#define isXDIGIT_L1(c) isXDIGIT(c)
1500#endif
1501#ifndef isXDIGIT_LC
1502#define isXDIGIT_LC(c) isxdigit(c)
1503#endif
1504#ifndef isALNUM_A
1505#define isALNUM_A(c) isALNUM(c)
1506#endif
1507#ifndef isALNUMC_A
1508#define isALNUMC_A(c) isALNUMC(c)
1509#endif
1510#ifndef isALPHA_A
1511#define isALPHA_A(c) isALPHA(c)
1512#endif
1513#ifndef isALPHANUMERIC_A
1514#define isALPHANUMERIC_A(c) isALPHANUMERIC(c)
1515#endif
1516#ifndef isASCII_A
1517#define isASCII_A(c) isASCII(c)
1518#endif
1519#ifndef isBLANK_A
1520#define isBLANK_A(c) isBLANK(c)
1521#endif
1522#ifndef isCNTRL_A
1523#define isCNTRL_A(c) isCNTRL(c)
1524#endif
1525#ifndef isDIGIT_A
1526#define isDIGIT_A(c) isDIGIT(c)
1527#endif
1528#ifndef isGRAPH_A
1529#define isGRAPH_A(c) isGRAPH(c)
1530#endif
1531#ifndef isIDCONT_A
1532#define isIDCONT_A(c) isIDCONT(c)
1533#endif
1534#ifndef isIDFIRST_A
1535#define isIDFIRST_A(c) isIDFIRST(c)
1536#endif
1537#ifndef isLOWER_A
1538#define isLOWER_A(c) isLOWER(c)
1539#endif
1540#ifndef isOCTAL_A
1541#define isOCTAL_A(c) isOCTAL(c)
1542#endif
1543#ifndef isPRINT_A
1544#define isPRINT_A(c) isPRINT(c)
1545#endif
1546#ifndef isPSXSPC_A
1547#define isPSXSPC_A(c) isPSXSPC(c)
1548#endif
1549#ifndef isPUNCT_A
1550#define isPUNCT_A(c) isPUNCT(c)
1551#endif
1552#ifndef isSPACE_A
1553#define isSPACE_A(c) isSPACE(c)
1554#endif
1555#ifndef isUPPER_A
1556#define isUPPER_A(c) isUPPER(c)
1557#endif
1558#ifndef isWORDCHAR_A
1559#define isWORDCHAR_A(c) isWORDCHAR(c)
1560#endif
1561#ifndef isXDIGIT_A
1562#define isXDIGIT_A(c) isXDIGIT(c)
1563#endif
1564#ifndef isASCII_utf8_safe
1565#define isASCII_utf8_safe(s,e) (((e) - (s)) <= 0 ? 0 : isASCII(*(s)))
1566#endif
1567#ifndef isASCII_uvchr
1568#define isASCII_uvchr(c) (FITS_IN_8_BITS(c) ? isASCII_L1(c) : 0)
1569#endif
1570#if (PERL_BCDVERSION >= 0x5006000)
1571#ifdef isALPHA_uni
1572#define D_PPP_is_ctype(upper, lower, c) \
1573(FITS_IN_8_BITS(c) \
1574? is ## upper ## _L1(c) \
1575: is ## upper ## _uni((UV) (c)))
1576#else
1577#define D_PPP_is_ctype(upper, lower, c) \
1578(FITS_IN_8_BITS(c) \
1579? is ## upper ## _L1(c) \
1580: is_uni_ ## lower((UV) (c)))
1581#endif
1582#ifndef isALPHA_uvchr
1583#define isALPHA_uvchr(c) D_PPP_is_ctype(ALPHA, alpha, c)
1584#endif
1585#ifndef isALPHANUMERIC_uvchr
1586#define isALPHANUMERIC_uvchr(c) (isALPHA_uvchr(c) || isDIGIT_uvchr(c))
1587#endif
1588#ifdef is_uni_blank
1589#ifndef isBLANK_uvchr
1590#define isBLANK_uvchr(c) D_PPP_is_ctype(BLANK, blank, c)
1591#endif
1592#else
1593#ifndef isBLANK_uvchr
1594#define isBLANK_uvchr(c) (FITS_IN_8_BITS(c) \
1595? isBLANK_L1(c) \
1596: ( (UV) (c) == 0x1680 \
1597|| inRANGE((UV) (c), 0x2000, 0x200A) \
1598|| (UV) (c) == 0x202F \
1599|| (UV) (c) == 0x205F \
1600|| (UV) (c) == 0x3000))
1601#endif
1602#endif
1603#ifndef isCNTRL_uvchr
1604#define isCNTRL_uvchr(c) D_PPP_is_ctype(CNTRL, cntrl, c)
1605#endif
1606#ifndef isDIGIT_uvchr
1607#define isDIGIT_uvchr(c) D_PPP_is_ctype(DIGIT, digit, c)
1608#endif
1609#ifndef isGRAPH_uvchr
1610#define isGRAPH_uvchr(c) D_PPP_is_ctype(GRAPH, graph, c)
1611#endif
1612#ifndef isIDCONT_uvchr
1613#define isIDCONT_uvchr(c) isWORDCHAR_uvchr(c)
1614#endif
1615#ifndef isIDFIRST_uvchr
1616#define isIDFIRST_uvchr(c) D_PPP_is_ctype(IDFIRST, idfirst, c)
1617#endif
1618#ifndef isLOWER_uvchr
1619#define isLOWER_uvchr(c) D_PPP_is_ctype(LOWER, lower, c)
1620#endif
1621#ifndef isPRINT_uvchr
1622#define isPRINT_uvchr(c) D_PPP_is_ctype(PRINT, print, c)
1623#endif
1624#ifndef isPSXSPC_uvchr
1625#define isPSXSPC_uvchr(c) isSPACE_uvchr(c)
1626#endif
1627#ifndef isPUNCT_uvchr
1628#define isPUNCT_uvchr(c) D_PPP_is_ctype(PUNCT, punct, c)
1629#endif
1630#ifndef isSPACE_uvchr
1631#define isSPACE_uvchr(c) D_PPP_is_ctype(SPACE, space, c)
1632#endif
1633#ifndef isUPPER_uvchr
1634#define isUPPER_uvchr(c) D_PPP_is_ctype(UPPER, upper, c)
1635#endif
1636#ifndef isXDIGIT_uvchr
1637#define isXDIGIT_uvchr(c) D_PPP_is_ctype(XDIGIT, xdigit, c)
1638#endif
1639#ifndef isWORDCHAR_uvchr
1640#define isWORDCHAR_uvchr(c) (FITS_IN_8_BITS(c) \
1641? isWORDCHAR_L1(c) : isALPHANUMERIC_uvchr(c))
1642#endif
1643#ifndef isALPHA_utf8_safe
1644#define isALPHA_utf8_safe(s,e) D_PPP_IS_GENERIC_UTF8_SAFE(s, e, ALPHA)
1645#endif
1646#ifdef isALPHANUMERIC_utf8
1647#ifndef isALPHANUMERIC_utf8_safe
1648#define isALPHANUMERIC_utf8_safe(s,e) \
1649D_PPP_IS_GENERIC_UTF8_SAFE(s, e, ALPHANUMERIC)
1650#endif
1651#else
1652#ifndef isALPHANUMERIC_utf8_safe
1653#define isALPHANUMERIC_utf8_safe(s,e) \
1654(isALPHA_utf8_safe(s,e) || isDIGIT_utf8_safe(s,e))
1655#endif
1656#endif
1657#if 'A' == 65
1658#ifndef isBLANK_utf8_safe
1659#define isBLANK_utf8_safe(s,e) \
1660( ( LIKELY((e) > (s)) ) ? \
1661( ( 0x09 == ((const U8*)s)[0] || 0x20 == ((const U8*)s)[0] ) ? 1 \
1662: ( LIKELY(((e) - (s)) >= UTF8SKIP(s)) ) ? \
1663( ( 0xC2 == ((const U8*)s)[0] ) ? \
1664( ( 0xA0 == ((const U8*)s)[1] ) ? 2 : 0 ) \
1665: ( 0xE1 == ((const U8*)s)[0] ) ? \
1666( ( ( 0x9A == ((const U8*)s)[1] ) && ( 0x80 == ((const U8*)s)[2] ) ) ? 3 : 0 )\
1667: ( 0xE2 == ((const U8*)s)[0] ) ? \
1668( ( 0x80 == ((const U8*)s)[1] ) ? \
1669( ( inRANGE(((const U8*)s)[2], 0x80, 0x8A ) || 0xAF == ((const U8*)s)[2] ) ? 3 : 0 )\
1670: ( ( 0x81 == ((const U8*)s)[1] ) && ( 0x9F == ((const U8*)s)[2] ) ) ? 3 : 0 )\
1671: ( ( ( 0xE3 == ((const U8*)s)[0] ) && ( 0x80 == ((const U8*)s)[1] ) ) && ( 0x80 == ((const U8*)s)[2] ) ) ? 3 : 0 )\
1672: 0 ) \
1673: 0 )
1674#endif
1675#elif 'A' == 193 && '^' == 95
1676#ifndef isBLANK_utf8_safe
1677#define isBLANK_utf8_safe(s,e) \
1678( ( LIKELY((e) > (s)) ) ? \
1679( ( 0x05 == ((const U8*)s)[0] || 0x40 == ((const U8*)s)[0] ) ? 1 \
1680: ( LIKELY(((e) - (s)) >= UTF8SKIP(s)) ) ? \
1681( ( 0x80 == ((const U8*)s)[0] ) ? \
1682( ( 0x41 == ((const U8*)s)[1] ) ? 2 : 0 ) \
1683: ( 0xBC == ((const U8*)s)[0] ) ? \
1684( ( ( 0x63 == ((const U8*)s)[1] ) && ( 0x41 == ((const U8*)s)[2] ) ) ? 3 : 0 )\
1685: ( 0xCA == ((const U8*)s)[0] ) ? \
1686( ( 0x41 == ((const U8*)s)[1] ) ? \
1687( ( inRANGE(((const U8*)s)[2], 0x41, 0x4A ) || 0x51 == ((const U8*)s)[2] ) ? 3 : 0 )\
1688: ( 0x42 == ((const U8*)s)[1] ) ? \
1689( ( 0x56 == ((const U8*)s)[2] ) ? 3 : 0 ) \
1690: ( ( 0x43 == ((const U8*)s)[1] ) && ( 0x73 == ((const U8*)s)[2] ) ) ? 3 : 0 )\
1691: ( ( ( 0xCE == ((const U8*)s)[0] ) && ( 0x41 == ((const U8*)s)[1] ) ) && ( 0x41 == ((const U8*)s)[2] ) ) ? 3 : 0 )\
1692: 0 ) \
1693: 0 )
1694#endif
1695#elif 'A' == 193 && '^' == 176
1696#ifndef isBLANK_utf8_safe
1697#define isBLANK_utf8_safe(s,e) \
1698( ( LIKELY((e) > (s)) ) ? \
1699( ( 0x05 == ((const U8*)s)[0] || 0x40 == ((const U8*)s)[0] ) ? 1 \
1700: ( LIKELY(((e) - (s)) >= UTF8SKIP(s)) ) ? \
1701( ( 0x78 == ((const U8*)s)[0] ) ? \
1702( ( 0x41 == ((const U8*)s)[1] ) ? 2 : 0 ) \
1703: ( 0xBD == ((const U8*)s)[0] ) ? \
1704( ( ( 0x62 == ((const U8*)s)[1] ) && ( 0x41 == ((const U8*)s)[2] ) ) ? 3 : 0 )\
1705: ( 0xCA == ((const U8*)s)[0] ) ? \
1706( ( 0x41 == ((const U8*)s)[1] ) ? \
1707( ( inRANGE(((const U8*)s)[2], 0x41, 0x4A ) || 0x51 == ((const U8*)s)[2] ) ? 3 : 0 )\
1708: ( 0x42 == ((const U8*)s)[1] ) ? \
1709( ( 0x56 == ((const U8*)s)[2] ) ? 3 : 0 ) \
1710: ( ( 0x43 == ((const U8*)s)[1] ) && ( 0x72 == ((const U8*)s)[2] ) ) ? 3 : 0 )\
1711: ( ( ( 0xCE == ((const U8*)s)[0] ) && ( 0x41 == ((const U8*)s)[1] ) ) && ( 0x41 == ((const U8*)s)[2] ) ) ? 3 : 0 )\
1712: 0 ) \
1713: 0 )
1714#endif
1715#else
1716#error Unknown character set
1717#endif
1718#ifndef isCNTRL_utf8_safe
1719#define isCNTRL_utf8_safe(s,e) D_PPP_IS_GENERIC_UTF8_SAFE(s, e, CNTRL)
1720#endif
1721#ifndef isDIGIT_utf8_safe
1722#define isDIGIT_utf8_safe(s,e) D_PPP_IS_GENERIC_UTF8_SAFE(s, e, DIGIT)
1723#endif
1724#ifndef isGRAPH_utf8_safe
1725#define isGRAPH_utf8_safe(s,e) D_PPP_IS_GENERIC_UTF8_SAFE(s, e, GRAPH)
1726#endif
1727#ifdef isIDCONT_utf8
1728#ifndef isIDCONT_utf8_safe
1729#define isIDCONT_utf8_safe(s,e) D_PPP_IS_GENERIC_UTF8_SAFE(s, e, IDCONT)
1730#endif
1731#else
1732#ifndef isIDCONT_utf8_safe
1733#define isIDCONT_utf8_safe(s,e) isWORDCHAR_utf8_safe(s,e)
1734#endif
1735#endif
1736#ifndef isIDFIRST_utf8_safe
1737#define isIDFIRST_utf8_safe(s,e) D_PPP_IS_GENERIC_UTF8_SAFE(s, e, IDFIRST)
1738#endif
1739#ifndef isLOWER_utf8_safe
1740#define isLOWER_utf8_safe(s,e) D_PPP_IS_GENERIC_UTF8_SAFE(s, e, LOWER)
1741#endif
1742#ifndef isPRINT_utf8_safe
1743#define isPRINT_utf8_safe(s,e) D_PPP_IS_GENERIC_UTF8_SAFE(s, e, PRINT)
1744#endif
1745#undef isPSXSPC_utf8_safe
1746#ifndef isPSXSPC_utf8_safe
1747#define isPSXSPC_utf8_safe(s,e) isSPACE_utf8_safe(s,e)
1748#endif
1749#ifndef isPUNCT_utf8_safe
1750#define isPUNCT_utf8_safe(s,e) D_PPP_IS_GENERIC_UTF8_SAFE(s, e, PUNCT)
1751#endif
1752#ifndef isSPACE_utf8_safe
1753#define isSPACE_utf8_safe(s,e) D_PPP_IS_GENERIC_UTF8_SAFE(s, e, SPACE)
1754#endif
1755#ifndef isUPPER_utf8_safe
1756#define isUPPER_utf8_safe(s,e) D_PPP_IS_GENERIC_UTF8_SAFE(s, e, UPPER)
1757#endif
1758#ifdef isWORDCHAR_utf8
1759#ifndef isWORDCHAR_utf8_safe
1760#define isWORDCHAR_utf8_safe(s,e) D_PPP_IS_GENERIC_UTF8_SAFE(s, e, WORDCHAR)
1761#endif
1762#else
1763#ifndef isWORDCHAR_utf8_safe
1764#define isWORDCHAR_utf8_safe(s,e) \
1765(isALPHANUMERIC_utf8_safe(s,e) || (*(s)) == '_')
1766#endif
1767#endif
1768#if 'A' == 65
1769#ifndef isXDIGIT_utf8_safe
1770#define isXDIGIT_utf8_safe(s,e) \
1771( ( LIKELY((e) > (s)) ) ? \
1772( ( inRANGE(((const U8*)s)[0], 0x30, 0x39 ) || inRANGE(((const U8*)s)[0], 0x41, 0x46 ) || inRANGE(((const U8*)s)[0], 0x61, 0x66 ) ) ? 1\
1773: ( ( LIKELY(((e) - (s)) >= UTF8SKIP(s)) ) && ( 0xEF == ((const U8*)s)[0] ) ) ? ( ( 0xBC == ((const U8*)s)[1] ) ?\
1774( ( inRANGE(((const U8*)s)[2], 0x90, 0x99 ) || inRANGE(((const U8*)s)[2], 0xA1, 0xA6 ) ) ? 3 : 0 )\
1775: ( ( 0xBD == ((const U8*)s)[1] ) && ( inRANGE(((const U8*)s)[2], 0x81, 0x86 ) ) ) ? 3 : 0 ) : 0 )\
1776: 0 )
1777#endif
1778#elif 'A' == 193 && '^' == 95
1779#ifndef isXDIGIT_utf8_safe
1780#define isXDIGIT_utf8_safe(s,e) \
1781( ( LIKELY((e) > (s)) ) ? \
1782( ( inRANGE(((const U8*)s)[0], 0x81, 0x86 ) || inRANGE(((const U8*)s)[0], 0xC1, 0xC6 ) || inRANGE(((const U8*)s)[0], 0xF0, 0xF9 ) ) ? 1\
1783: ( ( ( LIKELY(((e) - (s)) >= UTF8SKIP(s)) ) && ( 0xDD == ((const U8*)s)[0] ) ) && ( 0x73 == ((const U8*)s)[1] ) ) ? ( ( 0x67 == ((const U8*)s)[2] ) ?\
1784( ( inRANGE(((const U8*)s)[3], 0x57, 0x59 ) || inRANGE(((const U8*)s)[3], 0x62, 0x68 ) ) ? 4 : 0 )\
1785: ( ( inRANGE(((const U8*)s)[2], 0x68, 0x69 ) ) && ( inRANGE(((const U8*)s)[3], 0x42, 0x47 ) ) ) ? 4 : 0 ) : 0 )\
1786: 0 )
1787#endif
1788#elif 'A' == 193 && '^' == 176
1789#ifndef isXDIGIT_utf8_safe
1790#define isXDIGIT_utf8_safe(s,e) \
1791( ( LIKELY((e) > (s)) ) ? \
1792( ( inRANGE(((const U8*)s)[0], 0x81, 0x86 ) || inRANGE(((const U8*)s)[0], 0xC1, 0xC6 ) || inRANGE(((const U8*)s)[0], 0xF0, 0xF9 ) ) ? 1\
1793: ( ( ( LIKELY(((e) - (s)) >= UTF8SKIP(s)) ) && ( 0xDD == ((const U8*)s)[0] ) ) && ( 0x72 == ((const U8*)s)[1] ) ) ? ( ( 0x66 == ((const U8*)s)[2] ) ?\
1794( ( inRANGE(((const U8*)s)[3], 0x57, 0x59 ) || 0x5F == ((const U8*)s)[3] || inRANGE(((const U8*)s)[3], 0x62, 0x67 ) ) ? 4 : 0 )\
1795: ( ( inRANGE(((const U8*)s)[2], 0x67, 0x68 ) ) && ( inRANGE(((const U8*)s)[3], 0x42, 0x47 ) ) ) ? 4 : 0 ) : 0 )\
1796: 0 )
1797#endif
1798#else
1799#error Unknown character set
1800#endif
1801#ifndef isALPHA_LC_utf8_safe
1802#define isALPHA_LC_utf8_safe(s,e) D_PPP_IS_GENERIC_LC_UTF8_SAFE(s, e, ALPHA)
1803#endif
1804#ifdef isALPHANUMERIC_utf8
1805#ifndef isALPHANUMERIC_LC_utf8_safe
1806#define isALPHANUMERIC_LC_utf8_safe(s,e) \
1807D_PPP_IS_GENERIC_LC_UTF8_SAFE(s, e, ALPHANUMERIC)
1808#endif
1809#else
1810#ifndef isALPHANUMERIC_LC_utf8_safe
1811#define isALPHANUMERIC_LC_utf8_safe(s,e) \
1812(isALPHA_LC_utf8_safe(s,e) || isDIGIT_LC_utf8_safe(s,e))
1813#endif
1814#endif
1815#ifndef isBLANK_LC_utf8_safe
1816#define isBLANK_LC_utf8_safe(s,e) \
1817D_PPP_IS_GENERIC_LC_UTF8_SAFE_BROKEN(s, e, BLANK)
1818#endif
1819#ifndef isCNTRL_LC_utf8_safe
1820#define isCNTRL_LC_utf8_safe(s,e) D_PPP_IS_GENERIC_LC_UTF8_SAFE(s, e, CNTRL)
1821#endif
1822#ifndef isDIGIT_LC_utf8_safe
1823#define isDIGIT_LC_utf8_safe(s,e) D_PPP_IS_GENERIC_LC_UTF8_SAFE(s, e, DIGIT)
1824#endif
1825#ifndef isGRAPH_LC_utf8_safe
1826#define isGRAPH_LC_utf8_safe(s,e) D_PPP_IS_GENERIC_LC_UTF8_SAFE(s, e, GRAPH)
1827#endif
1828#ifdef isIDCONT_utf8
1829#ifndef isIDCONT_LC_utf8_safe
1830#define isIDCONT_LC_utf8_safe(s,e) D_PPP_IS_GENERIC_LC_UTF8_SAFE(s, e, IDCONT)
1831#endif
1832#else
1833#ifndef isIDCONT_LC_utf8_safe
1834#define isIDCONT_LC_utf8_safe(s,e) isWORDCHAR_LC_utf8_safe(s,e)
1835#endif
1836#endif
1837#ifndef isIDFIRST_LC_utf8_safe
1838#define isIDFIRST_LC_utf8_safe(s,e) D_PPP_IS_GENERIC_LC_UTF8_SAFE(s, e, IDFIRST)
1839#endif
1840#ifndef isLOWER_LC_utf8_safe
1841#define isLOWER_LC_utf8_safe(s,e) D_PPP_IS_GENERIC_LC_UTF8_SAFE(s, e, LOWER)
1842#endif
1843#ifndef isPRINT_LC_utf8_safe
1844#define isPRINT_LC_utf8_safe(s,e) D_PPP_IS_GENERIC_LC_UTF8_SAFE(s, e, PRINT)
1845#endif
1846#undef isPSXSPC_LC_utf8_safe
1847#ifndef isPSXSPC_LC_utf8_safe
1848#define isPSXSPC_LC_utf8_safe(s,e) isSPACE_LC_utf8_safe(s,e)
1849#endif
1850#ifndef isPUNCT_LC_utf8_safe
1851#define isPUNCT_LC_utf8_safe(s,e) D_PPP_IS_GENERIC_LC_UTF8_SAFE(s, e, PUNCT)
1852#endif
1853#ifndef isSPACE_LC_utf8_safe
1854#define isSPACE_LC_utf8_safe(s,e) D_PPP_IS_GENERIC_LC_UTF8_SAFE(s, e, SPACE)
1855#endif
1856#ifndef isUPPER_LC_utf8_safe
1857#define isUPPER_LC_utf8_safe(s,e) D_PPP_IS_GENERIC_LC_UTF8_SAFE(s, e, UPPER)
1858#endif
1859#ifdef isWORDCHAR_utf8
1860#ifndef isWORDCHAR_LC_utf8_safe
1861#define isWORDCHAR_LC_utf8_safe(s,e) D_PPP_IS_GENERIC_LC_UTF8_SAFE(s, e, WORDCHAR)
1862#endif
1863#else
1864#ifndef isWORDCHAR_LC_utf8_safe
1865#define isWORDCHAR_LC_utf8_safe(s,e) \
1866(isALPHANUMERIC_LC_utf8_safe(s,e) || (*(s)) == '_')
1867#endif
1868#endif
1869#ifndef isXDIGIT_LC_utf8_safe
1870#define isXDIGIT_LC_utf8_safe(s,e) \
1871D_PPP_IS_GENERIC_LC_UTF8_SAFE_BROKEN(s, e, XDIGIT)
1872#endif
1873#endif
1874#define D_PPP_TOO_SHORT_MSG "Malformed UTF-8 character starting with:" \
1875" \\x%02x (too short; %d bytes available, need" \
1876" %d)\n"
1877#if (PERL_BCDVERSION >= 0x5007003)
1878#ifndef toLOWER_uvchr
1879#define toLOWER_uvchr(c, s, l) UNI_TO_NATIVE(to_uni_lower(NATIVE_TO_UNI(c), s, l))
1880#endif
1881#ifndef toUPPER_uvchr
1882#define toUPPER_uvchr(c, s, l) UNI_TO_NATIVE(to_uni_upper(NATIVE_TO_UNI(c), s, l))
1883#endif
1884#ifndef toTITLE_uvchr
1885#define toTITLE_uvchr(c, s, l) UNI_TO_NATIVE(to_uni_title(NATIVE_TO_UNI(c), s, l))
1886#endif
1887#ifndef toFOLD_uvchr
1888#define toFOLD_uvchr(c, s, l) UNI_TO_NATIVE(to_uni_fold( NATIVE_TO_UNI(c), s, l))
1889#endif
1890#if (PERL_BCDVERSION != 0x5015006)
1891#if defined toLOWER_utf8
1892#define D_PPP_TO_LOWER_CALLEE(s,r,l) toLOWER_utf8(s,r,l)
1893#else
1894#define D_PPP_TO_LOWER_CALLEE(s,r,l) to_utf8_lower(s,r,l)
1895#endif
1896#if defined toTITLE_utf8
1897#define D_PPP_TO_TITLE_CALLEE(s,r,l) toTITLE_utf8(s,r,l)
1898#else
1899#define D_PPP_TO_TITLE_CALLEE(s,r,l) to_utf8_title(s,r,l)
1900#endif
1901#if defined toUPPER_utf8
1902#define D_PPP_TO_UPPER_CALLEE(s,r,l) toUPPER_utf8(s,r,l)
1903#else
1904#define D_PPP_TO_UPPER_CALLEE(s,r,l) to_utf8_upper(s,r,l)
1905#endif
1906#if defined toFOLD_utf8
1907#define D_PPP_TO_FOLD_CALLEE(s,r,l) toFOLD_utf8(s,r,l)
1908#else
1909#define D_PPP_TO_FOLD_CALLEE(s,r,l) to_utf8_fold(s,r,l)
1910#endif
1911#else
1912#define D_PPP_TO_LOWER_CALLEE(s,r,l) \
1913Perl__to_utf8_lower_flags(aTHX_ s, r, l, 0, NULL)
1914#define D_PPP_TO_TITLE_CALLEE(s,r,l) \
1915Perl__to_utf8_title_flags(aTHX_ s, r, l, 0, NULL)
1916#define D_PPP_TO_UPPER_CALLEE(s,r,l) \
1917Perl__to_utf8_upper_flags(aTHX_ s, r, l, 0, NULL)
1918#define D_PPP_TO_FOLD_CALLEE(s,r,l) \
1919Perl__to_utf8_fold_flags(aTHX_ s, r, l, FOLD_FLAGS_FULL, NULL)
1920#endif
1921#define D_PPP_GENERIC_MULTI_ARG_TO(name, s, e,r,l) \
1922(((((e) - (s)) <= 0) \
1923\
1924? (croak("Attempting case change on zero length string"), \
19250) \
1926: ((e) - (s)) < UTF8SKIP(s)) \
1927? (croak(D_PPP_TOO_SHORT_MSG, \
1928s[0], (int) ((e) - (s)), (int) UTF8SKIP(s)), \
19290) \
1930: D_PPP_TO_ ## name ## _CALLEE(s,r,l))
1931#ifndef toUPPER_utf8_safe
1932#define toUPPER_utf8_safe(s,e,r,l) \
1933D_PPP_GENERIC_MULTI_ARG_TO(UPPER,s,e,r,l)
1934#endif
1935#ifndef toLOWER_utf8_safe
1936#define toLOWER_utf8_safe(s,e,r,l) \
1937D_PPP_GENERIC_MULTI_ARG_TO(LOWER,s,e,r,l)
1938#endif
1939#ifndef toTITLE_utf8_safe
1940#define toTITLE_utf8_safe(s,e,r,l) \
1941D_PPP_GENERIC_MULTI_ARG_TO(TITLE,s,e,r,l)
1942#endif
1943#ifndef toFOLD_utf8_safe
1944#define toFOLD_utf8_safe(s,e,r,l) \
1945D_PPP_GENERIC_MULTI_ARG_TO(FOLD,s,e,r,l)
1946#endif
1947#elif (PERL_BCDVERSION >= 0x5006000)
1948#ifdef uvchr_to_utf8
1949#define D_PPP_UV_TO_UTF8 uvchr_to_utf8
1950#else
1951#define D_PPP_UV_TO_UTF8 uv_to_utf8
1952#endif
1953#define D_PPP_GENERIC_SINGLE_ARG_TO_UVCHR(name, c, s, l) \
1954(*(l) = (D_PPP_UV_TO_UTF8(s, \
1955UNI_TO_NATIVE(to_uni_ ## name(NATIVE_TO_UNI(c)))) - (s)), \
1956UNI_TO_NATIVE(to_uni_ ## name(NATIVE_TO_UNI(c))))
1957#ifndef toLOWER_uvchr
1958#define toLOWER_uvchr(c, s, l) \
1959D_PPP_GENERIC_SINGLE_ARG_TO_UVCHR(lower, c, s, l)
1960#endif
1961#ifndef toUPPER_uvchr
1962#define toUPPER_uvchr(c, s, l) \
1963D_PPP_GENERIC_SINGLE_ARG_TO_UVCHR(upper, c, s, l)
1964#endif
1965#ifndef toTITLE_uvchr
1966#define toTITLE_uvchr(c, s, l) \
1967D_PPP_GENERIC_SINGLE_ARG_TO_UVCHR(title, c, s, l)
1968#endif
1969#ifndef toFOLD_uvchr
1970#define toFOLD_uvchr(c, s, l) toLOWER_uvchr(c, s, l)
1971#endif
1972#define D_PPP_GENERIC_SINGLE_ARG_TO_UTF8(name, s, e, r, l) \
1973(((((e) - (s)) <= 0) \
1974? (croak("Attempting case change on zero length string"), \
19750) \
1976: ((e) - (s)) < UTF8SKIP(s)) \
1977? (croak(D_PPP_TOO_SHORT_MSG, \
1978s[0], (int) ((e) - (s)), (int) UTF8SKIP(s)), \
19790) \
1980\
1981: D_PPP_UV_TO_UTF8(r, to_utf8_ ## name(s)), \
1982\
1983*(l) = UTF8SKIP(r), to_utf8_ ## name(r))
1984#ifndef toUPPER_utf8_safe
1985#define toUPPER_utf8_safe(s,e,r,l) \
1986D_PPP_GENERIC_SINGLE_ARG_TO_UTF8(upper, s, e, r, l)
1987#endif
1988#ifndef toLOWER_utf8_safe
1989#define toLOWER_utf8_safe(s,e,r,l) \
1990D_PPP_GENERIC_SINGLE_ARG_TO_UTF8(lower, s, e, r, l)
1991#endif
1992#ifndef toTITLE_utf8_safe
1993#define toTITLE_utf8_safe(s,e,r,l) \
1994D_PPP_GENERIC_SINGLE_ARG_TO_UTF8(title, s, e, r, l)
1995#endif
1996#ifndef toFOLD_utf8_safe
1997#define toFOLD_utf8_safe(s,e,r,l) toLOWER_utf8_safe(s,e,r,l)
1998#endif
1999#endif
2000#if (PERL_BCDVERSION >= 0x5008000)
2001#ifndef HeUTF8
2002#define HeUTF8(he) ((HeKLEN(he) == HEf_SVKEY) ? \
2003SvUTF8(HeKEY_sv(he)) : \
2004(U32)HeKUTF8(he))
2005#endif
2006#endif
2007#ifndef C_ARRAY_LENGTH
2008#define C_ARRAY_LENGTH(a) (sizeof(a)/sizeof((a)[0]))
2009#endif
2010#ifndef C_ARRAY_END
2011#define C_ARRAY_END(a) ((a) + C_ARRAY_LENGTH(a))
2012#endif
2013#ifndef LIKELY
2014#define LIKELY(x) (x)
2015#endif
2016#ifndef UNLIKELY
2017#define UNLIKELY(x) (x)
2018#endif
2019#ifndef MUTABLE_PTR
2020#if defined(PERL_USE_GCC_BRACE_GROUPS)
2021#define MUTABLE_PTR(p) ({ void *_p = (p); _p; })
2022#else
2023#define MUTABLE_PTR(p) ((void *) (p))
2024#endif
2025#endif
2026#ifndef MUTABLE_AV
2027#define MUTABLE_AV(p) ((AV *)MUTABLE_PTR(p))
2028#endif
2029#ifndef MUTABLE_CV
2030#define MUTABLE_CV(p) ((CV *)MUTABLE_PTR(p))
2031#endif
2032#ifndef MUTABLE_GV
2033#define MUTABLE_GV(p) ((GV *)MUTABLE_PTR(p))
2034#endif
2035#ifndef MUTABLE_HV
2036#define MUTABLE_HV(p) ((HV *)MUTABLE_PTR(p))
2037#endif
2038#ifndef MUTABLE_IO
2039#define MUTABLE_IO(p) ((IO *)MUTABLE_PTR(p))
2040#endif
2041#ifndef MUTABLE_SV
2042#define MUTABLE_SV(p) ((SV *)MUTABLE_PTR(p))
2043#endif
2044#if (PERL_BCDVERSION >= 0x5004000) && !defined(vnewSVpvf)
2045#if defined(PERL_USE_GCC_BRACE_GROUPS)
2046#define vnewSVpvf(pat, args) ({ SV *_sv = newSV(0); sv_vsetpvfn(_sv, (pat), strlen((pat)), (args), Null(SV**), 0, Null(bool*)); _sv; })
2047#else
2048#define vnewSVpvf(pat, args) ((PL_Sv = newSV(0)), sv_vsetpvfn(PL_Sv, (pat), strlen((pat)), (args), Null(SV**), 0, Null(bool*)), PL_Sv)
2049#endif
2050#endif
2051#if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vcatpvf)
2052#define sv_vcatpvf(sv, pat, args) sv_vcatpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*))
2053#endif
2054#if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vsetpvf)
2055#define sv_vsetpvf(sv, pat, args) sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*))
2056#endif
2057#if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_catpvf_mg)
2058#if defined(NEED_sv_catpvf_mg)
2059static void DPPP_(my_sv_catpvf_mg)(pTHX_ SV * const sv, const char * const pat, ...);
2060static
2061#else
2062extern void DPPP_(my_sv_catpvf_mg)(pTHX_ SV * const sv, const char * const pat, ...);
2063#endif
2064#if defined(NEED_sv_catpvf_mg) || defined(NEED_sv_catpvf_mg_GLOBAL)
2065#define Perl_sv_catpvf_mg DPPP_(my_sv_catpvf_mg)
2066void
2067DPPP_(my_sv_catpvf_mg)(pTHX_ SV * const sv, const char * const pat, ...)
2068{
2069va_list args;
2070va_start(args, pat);
2071sv_vcatpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*));
2072SvSETMAGIC(sv);
2073va_end(args);
2074}
2075#endif
2076#endif
2077#ifdef PERL_IMPLICIT_CONTEXT
2078#if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_catpvf_mg_nocontext)
2079#if defined(NEED_sv_catpvf_mg_nocontext)
2080static void DPPP_(my_sv_catpvf_mg_nocontext)(SV * const sv, const char * const pat, ...);
2081static
2082#else
2083extern void DPPP_(my_sv_catpvf_mg_nocontext)(SV * const sv, const char * const pat, ...);
2084#endif
2085#if defined(NEED_sv_catpvf_mg_nocontext) || defined(NEED_sv_catpvf_mg_nocontext_GLOBAL)
2086#define sv_catpvf_mg_nocontext DPPP_(my_sv_catpvf_mg_nocontext)
2087#define Perl_sv_catpvf_mg_nocontext DPPP_(my_sv_catpvf_mg_nocontext)
2088void
2089DPPP_(my_sv_catpvf_mg_nocontext)(SV * const sv, const char * const pat, ...)
2090{
2091dTHX;
2092va_list args;
2093va_start(args, pat);
2094sv_vcatpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*));
2095SvSETMAGIC(sv);
2096va_end(args);
2097}
2098#endif
2099#endif
2100#endif
2101#ifndef sv_catpvf_mg
2102#ifdef PERL_IMPLICIT_CONTEXT
2103#define sv_catpvf_mg Perl_sv_catpvf_mg_nocontext
2104#else
2105#define sv_catpvf_mg Perl_sv_catpvf_mg
2106#endif
2107#endif
2108#if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vcatpvf_mg)
2109#define sv_vcatpvf_mg(sv, pat, args) \
2110STMT_START { \
2111sv_vcatpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*)); \
2112SvSETMAGIC(sv); \
2113} STMT_END
2114#endif
2115#if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_setpvf_mg)
2116#if defined(NEED_sv_setpvf_mg)
2117static void DPPP_(my_sv_setpvf_mg)(pTHX_ SV * const sv, const char * const pat, ...);
2118static
2119#else
2120extern void DPPP_(my_sv_setpvf_mg)(pTHX_ SV * const sv, const char * const pat, ...);
2121#endif
2122#if defined(NEED_sv_setpvf_mg) || defined(NEED_sv_setpvf_mg_GLOBAL)
2123#define Perl_sv_setpvf_mg DPPP_(my_sv_setpvf_mg)
2124void
2125DPPP_(my_sv_setpvf_mg)(pTHX_ SV * const sv, const char * const pat, ...)
2126{
2127va_list args;
2128va_start(args, pat);
2129sv_vsetpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*));
2130SvSETMAGIC(sv);
2131va_end(args);
2132}
2133#endif
2134#endif
2135#ifdef PERL_IMPLICIT_CONTEXT
2136#if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_setpvf_mg_nocontext)
2137#if defined(NEED_sv_setpvf_mg_nocontext)
2138static void DPPP_(my_sv_setpvf_mg_nocontext)(SV * const sv, const char * const pat, ...);
2139static
2140#else
2141extern void DPPP_(my_sv_setpvf_mg_nocontext)(SV * const sv, const char * const pat, ...);
2142#endif
2143#if defined(NEED_sv_setpvf_mg_nocontext) || defined(NEED_sv_setpvf_mg_nocontext_GLOBAL)
2144#define sv_setpvf_mg_nocontext DPPP_(my_sv_setpvf_mg_nocontext)
2145#define Perl_sv_setpvf_mg_nocontext DPPP_(my_sv_setpvf_mg_nocontext)
2146void
2147DPPP_(my_sv_setpvf_mg_nocontext)(SV * const sv, const char * const pat, ...)
2148{
2149dTHX;
2150va_list args;
2151va_start(args, pat);
2152sv_vsetpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*));
2153SvSETMAGIC(sv);
2154va_end(args);
2155}
2156#endif
2157#endif
2158#endif
2159#ifndef sv_setpvf_mg
2160#ifdef PERL_IMPLICIT_CONTEXT
2161#define sv_setpvf_mg Perl_sv_setpvf_mg_nocontext
2162#else
2163#define sv_setpvf_mg Perl_sv_setpvf_mg
2164#endif
2165#endif
2166#if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vsetpvf_mg)
2167#define sv_vsetpvf_mg(sv, pat, args) \
2168STMT_START { \
2169sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*)); \
2170SvSETMAGIC(sv); \
2171} STMT_END
2172#endif
2173#ifndef sv_2pv_nolen
2174#define sv_2pv_nolen(sv) SvPV_nolen(sv)
2175#endif
2176#ifdef SvPVbyte
2177#if (PERL_BCDVERSION < 0x5007000)
2178#ifndef sv_2pvbyte
2179#define sv_2pvbyte(sv, lp) (sv_utf8_downgrade((sv), 0), SvPV((sv), *(lp)))
2180#endif
2181#undef SvPVbyte
2182#define SvPVbyte(sv, lp) \
2183((SvFLAGS(sv) & (SVf_POK|SVf_UTF8)) == (SVf_POK) \
2184? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_2pvbyte(sv, &lp))
2185#endif
2186#else
2187#define SvPVbyte SvPV
2188#define sv_2pvbyte sv_2pv
2189#endif
2190#ifndef sv_2pvbyte_nolen
2191#define sv_2pvbyte_nolen(sv) sv_2pv_nolen(sv)
2192#endif
2193#ifndef SV_IMMEDIATE_UNREF
2194#define SV_IMMEDIATE_UNREF 0
2195#endif
2196#ifndef SV_GMAGIC
2197#define SV_GMAGIC 0
2198#endif
2199#ifndef SV_COW_DROP_PV
2200#define SV_COW_DROP_PV 0
2201#endif
2202#ifndef SV_UTF8_NO_ENCODING
2203#define SV_UTF8_NO_ENCODING 0
2204#endif
2205#ifndef SV_CONST_RETURN
2206#define SV_CONST_RETURN 0
2207#endif
2208#ifndef SV_MUTABLE_RETURN
2209#define SV_MUTABLE_RETURN 0
2210#endif
2211#ifndef SV_SMAGIC
2212#define SV_SMAGIC 0
2213#endif
2214#ifndef SV_HAS_TRAILING_NUL
2215#define SV_HAS_TRAILING_NUL 0
2216#endif
2217#ifndef SV_COW_SHARED_HASH_KEYS
2218#define SV_COW_SHARED_HASH_KEYS 0
2219#endif
2220#if defined(PERL_USE_GCC_BRACE_GROUPS)
2221#ifndef sv_2pv_flags
2222#define sv_2pv_flags(sv, lp, flags) ({ SV *_sv = (sv); const I32 _flags = (flags); STRLEN *_lp = lp; _lp = _lp ? : &PL_na; (!(_flags & SV_GMAGIC) && SvGMAGICAL(_sv)) ? ({ char *_pv; SvGMAGICAL_off(_sv); _pv = sv_2pv(_sv, _lp); SvGMAGICAL_on(_sv); _pv; }) : sv_2pv(_sv, _lp); })
2223#endif
2224#ifndef sv_pvn_force_flags
2225#define sv_pvn_force_flags(sv, lp, flags) ({ SV *_sv = (sv); const I32 _flags = (flags); STRLEN *_lp = lp; _lp = _lp ? : &PL_na; (!(_flags & SV_GMAGIC) && SvGMAGICAL(_sv)) ? ({ char *_pv; SvGMAGICAL_off(_sv); _pv = sv_pvn_force(_sv, _lp); SvGMAGICAL_on(_sv); _pv; }) : sv_pvn_force(_sv, _lp); })
2226#endif
2227#else
2228#ifndef sv_2pv_flags
2229#define sv_2pv_flags(sv, lp, flags) ((PL_Sv = (sv)), (!((flags) & SV_GMAGIC) && SvGMAGICAL(PL_Sv)) ? (SvGMAGICAL_off(PL_Sv), (PL_Xpv = (XPV *)sv_2pv(PL_Sv, (lp) ? (lp) : &PL_na)), SvGMAGICAL_on(PL_Sv), (char *)PL_Xpv) : sv_2pv(PL_Sv, (lp) ? (lp) : &PL_na))
2230#endif
2231#ifndef sv_pvn_force_flags
2232#define sv_pvn_force_flags(sv, lp, flags) ((PL_Sv = (sv)), (!((flags) & SV_GMAGIC) && SvGMAGICAL(PL_Sv)) ? (SvGMAGICAL_off(PL_Sv), (PL_Xpv = (XPV *)sv_pvn_force(PL_Sv, (lp) ? (lp) : &PL_na)), SvGMAGICAL_on(PL_Sv), (char *)PL_Xpv) : sv_pvn_force(PL_Sv, (lp) ? (lp) : &PL_na))
2233#endif
2234#endif
2235#if (PERL_BCDVERSION < 0x5008008) || ( (PERL_BCDVERSION >= 0x5009000) && (PERL_BCDVERSION < 0x5009003) )
2236#define D_PPP_SVPV_NOLEN_LP_ARG &PL_na
2237#else
2238#define D_PPP_SVPV_NOLEN_LP_ARG 0
2239#endif
2240#ifndef SvPV_const
2241#define SvPV_const(sv, lp) SvPV_flags_const(sv, lp, SV_GMAGIC)
2242#endif
2243#ifndef SvPV_mutable
2244#define SvPV_mutable(sv, lp) SvPV_flags_mutable(sv, lp, SV_GMAGIC)
2245#endif
2246#ifndef SvPV_flags
2247#define SvPV_flags(sv, lp, flags) \
2248((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
2249? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_2pv_flags(sv, &lp, flags))
2250#endif
2251#ifndef SvPV_flags_const
2252#define SvPV_flags_const(sv, lp, flags) \
2253((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
2254? ((lp = SvCUR(sv)), SvPVX_const(sv)) : \
2255(const char*) sv_2pv_flags(sv, &lp, flags|SV_CONST_RETURN))
2256#endif
2257#ifndef SvPV_flags_const_nolen
2258#define SvPV_flags_const_nolen(sv, flags) \
2259((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
2260? SvPVX_const(sv) : \
2261(const char*) sv_2pv_flags(sv, D_PPP_SVPV_NOLEN_LP_ARG, flags|SV_CONST_RETURN))
2262#endif
2263#ifndef SvPV_flags_mutable
2264#define SvPV_flags_mutable(sv, lp, flags) \
2265((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
2266? ((lp = SvCUR(sv)), SvPVX_mutable(sv)) : \
2267sv_2pv_flags(sv, &lp, flags|SV_MUTABLE_RETURN))
2268#endif
2269#ifndef SvPV_force
2270#define SvPV_force(sv, lp) SvPV_force_flags(sv, lp, SV_GMAGIC)
2271#endif
2272#ifndef SvPV_force_nolen
2273#define SvPV_force_nolen(sv) SvPV_force_flags_nolen(sv, SV_GMAGIC)
2274#endif
2275#ifndef SvPV_force_mutable
2276#define SvPV_force_mutable(sv, lp) SvPV_force_flags_mutable(sv, lp, SV_GMAGIC)
2277#endif
2278#ifndef SvPV_force_nomg
2279#define SvPV_force_nomg(sv, lp) SvPV_force_flags(sv, lp, 0)
2280#endif
2281#ifndef SvPV_force_nomg_nolen
2282#define SvPV_force_nomg_nolen(sv) SvPV_force_flags_nolen(sv, 0)
2283#endif
2284#ifndef SvPV_force_flags
2285#define SvPV_force_flags(sv, lp, flags) \
2286((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == SVf_POK \
2287? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_pvn_force_flags(sv, &lp, flags))
2288#endif
2289#ifndef SvPV_force_flags_nolen
2290#define SvPV_force_flags_nolen(sv, flags) \
2291((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == SVf_POK \
2292? SvPVX(sv) : sv_pvn_force_flags(sv, D_PPP_SVPV_NOLEN_LP_ARG, flags))
2293#endif
2294#ifndef SvPV_force_flags_mutable
2295#define SvPV_force_flags_mutable(sv, lp, flags) \
2296((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == SVf_POK \
2297? ((lp = SvCUR(sv)), SvPVX_mutable(sv)) \
2298: sv_pvn_force_flags(sv, &lp, flags|SV_MUTABLE_RETURN))
2299#endif
2300#ifndef SvPV_nolen
2301#define SvPV_nolen(sv) \
2302((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
2303? SvPVX(sv) : sv_2pv_flags(sv, D_PPP_SVPV_NOLEN_LP_ARG, SV_GMAGIC))
2304#endif
2305#ifndef SvPV_nolen_const
2306#define SvPV_nolen_const(sv) \
2307((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
2308? SvPVX_const(sv) : sv_2pv_flags(sv, D_PPP_SVPV_NOLEN_LP_ARG, SV_GMAGIC|SV_CONST_RETURN))
2309#endif
2310#if defined(PERL_USE_GCC_BRACE_GROUPS)
2311#ifndef SvPVx_nolen_const
2312#define SvPVx_nolen_const(sv) ({SV *sV_ = (sv); SvPV_nolen_const(sV_); })
2313#endif
2314#else
2315#ifndef SvPVx_nolen_const
2316#define SvPVx_nolen_const(sv) (PL_Sv = sv, SvPV_nolen_const(PL_Sv))
2317#endif
2318#endif
2319#ifndef SvPV_nomg
2320#define SvPV_nomg(sv, lp) SvPV_flags(sv, lp, 0)
2321#endif
2322#ifndef SvPV_nomg_const
2323#define SvPV_nomg_const(sv, lp) SvPV_flags_const(sv, lp, 0)
2324#endif
2325#ifndef SvPV_nomg_const_nolen
2326#define SvPV_nomg_const_nolen(sv) SvPV_flags_const_nolen(sv, 0)
2327#endif
2328#ifndef SvPV_nomg_nolen
2329#define SvPV_nomg_nolen(sv) ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
2330? SvPVX(sv) : sv_2pv_flags(sv, D_PPP_SVPV_NOLEN_LP_ARG, 0))
2331#endif
2332#ifndef SvPV_renew
2333#define SvPV_renew(sv,n) STMT_START { SvLEN_set(sv, n); \
2334SvPV_set((sv), (char *) saferealloc( \
2335(Malloc_t)SvPVX(sv), (MEM_SIZE)((n)))); \
2336} STMT_END
2337#endif
2338#ifndef SvPVCLEAR
2339#define SvPVCLEAR(sv) sv_setpvs((sv), "")
2340#endif
2341#ifndef WARN_ALL
2342#define WARN_ALL 0
2343#endif
2344#ifndef WARN_CLOSURE
2345#define WARN_CLOSURE 1
2346#endif
2347#ifndef WARN_DEPRECATED
2348#define WARN_DEPRECATED 2
2349#endif
2350#ifndef WARN_EXITING
2351#define WARN_EXITING 3
2352#endif
2353#ifndef WARN_GLOB
2354#define WARN_GLOB 4
2355#endif
2356#ifndef WARN_IO
2357#define WARN_IO 5
2358#endif
2359#ifndef WARN_CLOSED
2360#define WARN_CLOSED 6
2361#endif
2362#ifndef WARN_EXEC
2363#define WARN_EXEC 7
2364#endif
2365#ifndef WARN_LAYER
2366#define WARN_LAYER 8
2367#endif
2368#ifndef WARN_NEWLINE
2369#define WARN_NEWLINE 9
2370#endif
2371#ifndef WARN_PIPE
2372#define WARN_PIPE 10
2373#endif
2374#ifndef WARN_UNOPENED
2375#define WARN_UNOPENED 11
2376#endif
2377#ifndef WARN_MISC
2378#define WARN_MISC 12
2379#endif
2380#ifndef WARN_NUMERIC
2381#define WARN_NUMERIC 13
2382#endif
2383#ifndef WARN_ONCE
2384#define WARN_ONCE 14
2385#endif
2386#ifndef WARN_OVERFLOW
2387#define WARN_OVERFLOW 15
2388#endif
2389#ifndef WARN_PACK
2390#define WARN_PACK 16
2391#endif
2392#ifndef WARN_PORTABLE
2393#define WARN_PORTABLE 17
2394#endif
2395#ifndef WARN_RECURSION
2396#define WARN_RECURSION 18
2397#endif
2398#ifndef WARN_REDEFINE
2399#define WARN_REDEFINE 19
2400#endif
2401#ifndef WARN_REGEXP
2402#define WARN_REGEXP 20
2403#endif
2404#ifndef WARN_SEVERE
2405#define WARN_SEVERE 21
2406#endif
2407#ifndef WARN_DEBUGGING
2408#define WARN_DEBUGGING 22
2409#endif
2410#ifndef WARN_INPLACE
2411#define WARN_INPLACE 23
2412#endif
2413#ifndef WARN_INTERNAL
2414#define WARN_INTERNAL 24
2415#endif
2416#ifndef WARN_MALLOC
2417#define WARN_MALLOC 25
2418#endif
2419#ifndef WARN_SIGNAL
2420#define WARN_SIGNAL 26
2421#endif
2422#ifndef WARN_SUBSTR
2423#define WARN_SUBSTR 27
2424#endif
2425#ifndef WARN_SYNTAX
2426#define WARN_SYNTAX 28
2427#endif
2428#ifndef WARN_AMBIGUOUS
2429#define WARN_AMBIGUOUS 29
2430#endif
2431#ifndef WARN_BAREWORD
2432#define WARN_BAREWORD 30
2433#endif
2434#ifndef WARN_DIGIT
2435#define WARN_DIGIT 31
2436#endif
2437#ifndef WARN_PARENTHESIS
2438#define WARN_PARENTHESIS 32
2439#endif
2440#ifndef WARN_PRECEDENCE
2441#define WARN_PRECEDENCE 33
2442#endif
2443#ifndef WARN_PRINTF
2444#define WARN_PRINTF 34
2445#endif
2446#ifndef WARN_PROTOTYPE
2447#define WARN_PROTOTYPE 35
2448#endif
2449#ifndef WARN_QW
2450#define WARN_QW 36
2451#endif
2452#ifndef WARN_RESERVED
2453#define WARN_RESERVED 37
2454#endif
2455#ifndef WARN_SEMICOLON
2456#define WARN_SEMICOLON 38
2457#endif
2458#ifndef WARN_TAINT
2459#define WARN_TAINT 39
2460#endif
2461#ifndef WARN_THREADS
2462#define WARN_THREADS 40
2463#endif
2464#ifndef WARN_UNINITIALIZED
2465#define WARN_UNINITIALIZED 41
2466#endif
2467#ifndef WARN_UNPACK
2468#define WARN_UNPACK 42
2469#endif
2470#ifndef WARN_UNTIE
2471#define WARN_UNTIE 43
2472#endif
2473#ifndef WARN_UTF8
2474#define WARN_UTF8 44
2475#endif
2476#ifndef WARN_VOID
2477#define WARN_VOID 45
2478#endif
2479#ifndef WARN_ASSERTIONS
2480#define WARN_ASSERTIONS 46
2481#endif
2482#ifndef packWARN
2483#define packWARN(a) (a)
2484#endif
2485#ifndef packWARN2
2486#define packWARN2(a,b) (packWARN(a) << 8 | (b))
2487#endif
2488#ifndef packWARN3
2489#define packWARN3(a,b,c) (packWARN2(a,b) << 8 | (c))
2490#endif
2491#ifndef packWARN4
2492#define packWARN4(a,b,c,d) (packWARN3(a,b,c) << 8 | (d))
2493#endif
2494#ifndef ckWARN
2495#ifdef G_WARN_ON
2496#define ckWARN(a) (PL_dowarn & G_WARN_ON)
2497#else
2498#define ckWARN(a) PL_dowarn
2499#endif
2500#endif
2501#ifndef ckWARN2
2502#define ckWARN2(a,b) (ckWARN(a) || ckWARN(b))
2503#endif
2504#ifndef ckWARN3
2505#define ckWARN3(a,b,c) (ckWARN(c) || ckWARN2(a,b))
2506#endif
2507#ifndef ckWARN4
2508#define ckWARN4(a,b,c,d) (ckWARN(d) || ckWARN3(a,b,c))
2509#endif
2510#ifndef ckWARN_d
2511#ifdef isLEXWARN_off
2512#define ckWARN_d(a) (isLEXWARN_off || ckWARN(a))
2513#else
2514#define ckWARN_d(a) 1
2515#endif
2516#endif
2517#ifndef ckWARN2_d
2518#define ckWARN2_d(a,b) (ckWARN_d(a) || ckWARN_d(b))
2519#endif
2520#ifndef ckWARN3_d
2521#define ckWARN3_d(a,b,c) (ckWARN_d(c) || ckWARN2_d(a,b))
2522#endif
2523#ifndef ckWARN4_d
2524#define ckWARN4_d(a,b,c,d) (ckWARN_d(d) || ckWARN3_d(a,b,c))
2525#endif
2526#ifndef vwarner
2527#define vwarner(err, pat, argsp) \
2528STMT_START { SV *sv; \
2529PERL_UNUSED_ARG(err); \
2530sv = vnewSVpvf(pat, argsp); \
2531sv_2mortal(sv); \
2532warn("%s", SvPV_nolen(sv)); \
2533} STMT_END
2534#endif
2535#if (PERL_BCDVERSION >= 0x5004000) && !defined(warner)
2536#if defined(NEED_warner)
2537static void DPPP_(my_warner)(U32 err, const char * pat, ...);
2538static
2539#else
2540extern void DPPP_(my_warner)(U32 err, const char * pat, ...);
2541#endif
2542#if defined(NEED_warner) || defined(NEED_warner_GLOBAL)
2543#define Perl_warner DPPP_(my_warner)
2544void
2545DPPP_(my_warner)(U32 err, const char *pat, ...)
2546{
2547va_list args;
2548va_start(args, pat);
2549vwarner(err, pat, &args);
2550va_end(args);
2551}
2552#define warner Perl_warner
2553#define Perl_warner_nocontext Perl_warner
2554#endif
2555#endif
2556#if (PERL_BCDVERSION >= 0x5004000) && !defined(ck_warner)
2557#if defined(NEED_ck_warner)
2558static void DPPP_(my_ck_warner)(pTHX_ U32 err, const char * pat, ...);
2559static
2560#else
2561extern void DPPP_(my_ck_warner)(pTHX_ U32 err, const char * pat, ...);
2562#endif
2563#if defined(NEED_ck_warner) || defined(NEED_ck_warner_GLOBAL)
2564#define Perl_ck_warner DPPP_(my_ck_warner)
2565void
2566DPPP_(my_ck_warner)(pTHX_ U32 err, const char *pat, ...)
2567{
2568va_list args;
2569if ( ! ckWARN((err ) & 0xFF)
2570&& ! ckWARN((err >> 8) & 0xFF)
2571&& ! ckWARN((err >> 16) & 0xFF)
2572&& ! ckWARN((err >> 24) & 0xFF))
2573{
2574return;
2575}
2576va_start(args, pat);
2577vwarner(err, pat, &args);
2578va_end(args);
2579}
2580#define ck_warner Perl_ck_warner
2581#endif
2582#endif
2583#if (PERL_BCDVERSION >= 0x5004000) && !defined(ck_warner_d)
2584#if defined(NEED_ck_warner_d)
2585static void DPPP_(my_ck_warner_d)(pTHX_ U32 err, const char * pat, ...);
2586static
2587#else
2588extern void DPPP_(my_ck_warner_d)(pTHX_ U32 err, const char * pat, ...);
2589#endif
2590#if defined(NEED_ck_warner_d) || defined(NEED_ck_warner_d_GLOBAL)
2591#define Perl_ck_warner_d DPPP_(my_ck_warner_d)
2592void
2593DPPP_(my_ck_warner_d)(pTHX_ U32 err, const char *pat, ...)
2594{
2595va_list args;
2596if ( ! ckWARN_d((err ) & 0xFF)
2597&& ! ckWARN_d((err >> 8) & 0xFF)
2598&& ! ckWARN_d((err >> 16) & 0xFF)
2599&& ! ckWARN_d((err >> 24) & 0xFF))
2600{
2601return;
2602}
2603va_start(args, pat);
2604vwarner(err, pat, &args);
2605va_end(args);
2606}
2607#define ck_warner_d Perl_ck_warner_d
2608#endif
2609#endif
2610#ifndef IVdf
2611#if IVSIZE == LONGSIZE
2612#define IVdf "ld"
2613#define UVuf "lu"
2614#define UVof "lo"
2615#define UVxf "lx"
2616#define UVXf "lX"
2617#elif IVSIZE == INTSIZE
2618#define IVdf "d"
2619#define UVuf "u"
2620#define UVof "o"
2621#define UVxf "x"
2622#define UVXf "X"
2623#else
2624#error "cannot define IV/UV formats"
2625#endif
2626#endif
2627#ifndef NVef
2628#if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) && \
2629defined(PERL_PRIfldbl) && (PERL_BCDVERSION != 0x5006000)
2630#define NVef PERL_PRIeldbl
2631#define NVff PERL_PRIfldbl
2632#define NVgf PERL_PRIgldbl
2633#else
2634#define NVef "e"
2635#define NVff "f"
2636#define NVgf "g"
2637#endif
2638#endif
2639#ifndef sv_setuv
2640#define sv_setuv(sv, uv) \
2641STMT_START { \
2642UV TeMpUv = uv; \
2643if (TeMpUv <= IV_MAX) \
2644sv_setiv(sv, TeMpUv); \
2645else \
2646sv_setnv(sv, (double)TeMpUv); \
2647} STMT_END
2648#endif
2649#ifndef newSVuv
2650#define newSVuv(uv) ((uv) <= IV_MAX ? newSViv((IV)uv) : newSVnv((NV)uv))
2651#endif
2652#if defined(PERL_USE_GCC_BRACE_GROUPS)
2653#ifndef sv_2uv
2654#define sv_2uv(sv) ({ SV *_sv = (sv); (UV) (SvNOK(_sv) ? SvNV(_sv) : sv_2nv(_sv)); })
2655#endif
2656#else
2657#ifndef sv_2uv
2658#define sv_2uv(sv) ((PL_Sv = (sv)), (UV) (SvNOK(PL_Sv) ? SvNV(PL_Sv) : sv_2nv(PL_Sv)))
2659#endif
2660#endif
2661#ifndef SvUVX
2662#define SvUVX(sv) ((UV)SvIVX(sv))
2663#endif
2664#ifndef SvUVXx
2665#define SvUVXx(sv) SvUVX(sv)
2666#endif
2667#ifndef SvUV
2668#define SvUV(sv) (SvIOK(sv) ? SvUVX(sv) : sv_2uv(sv))
2669#endif
2670#if defined(PERL_USE_GCC_BRACE_GROUPS)
2671#ifndef SvUVx
2672#define SvUVx(sv) ({ SV *_sv = (sv)); SvUV(_sv); })
2673#endif
2674#else
2675#ifndef SvUVx
2676#define SvUVx(sv) ((PL_Sv = (sv)), SvUV(PL_Sv))
2677#endif
2678#endif
2679#ifndef sv_uv
2680#define sv_uv(sv) SvUVx(sv)
2681#endif
2682#if !defined(SvUOK) && defined(SvIOK_UV)
2683#define SvUOK(sv) SvIOK_UV(sv)
2684#endif
2685#ifndef XST_mUV
2686#define XST_mUV(i,v) (ST(i) = sv_2mortal(newSVuv(v)) )
2687#endif
2688#ifndef XSRETURN_UV
2689#define XSRETURN_UV(v) STMT_START { XST_mUV(0,v); XSRETURN(1); } STMT_END
2690#endif
2691#ifndef PUSHu
2692#define PUSHu(u) STMT_START { sv_setuv(TARG, (UV)(u)); PUSHTARG; } STMT_END
2693#endif
2694#ifndef XPUSHu
2695#define XPUSHu(u) STMT_START { sv_setuv(TARG, (UV)(u)); XPUSHTARG; } STMT_END
2696#endif
2697#if !defined(my_strnlen)
2698#if defined(NEED_my_strnlen)
2699static Size_t DPPP_(my_my_strnlen)(const char * str, Size_t maxlen);
2700static
2701#else
2702extern Size_t DPPP_(my_my_strnlen)(const char * str, Size_t maxlen);
2703#endif
2704#if defined(NEED_my_strnlen) || defined(NEED_my_strnlen_GLOBAL)
2705#define my_strnlen DPPP_(my_my_strnlen)
2706#define Perl_my_strnlen DPPP_(my_my_strnlen)
2707Size_t
2708DPPP_(my_my_strnlen)(const char *str, Size_t maxlen)
2709{
2710const char *p = str;
2711while(maxlen-- && *p)
2712p++;
2713return p - str;
2714}
2715#endif
2716#endif
2717#ifdef HAS_MEMCMP
2718#ifndef memNE
2719#define memNE(s1,s2,l) (memcmp(s1,s2,l))
2720#endif
2721#ifndef memEQ
2722#define memEQ(s1,s2,l) (!memcmp(s1,s2,l))
2723#endif
2724#else
2725#ifndef memNE
2726#define memNE(s1,s2,l) (bcmp(s1,s2,l))
2727#endif
2728#ifndef memEQ
2729#define memEQ(s1,s2,l) (!bcmp(s1,s2,l))
2730#endif
2731#endif
2732#ifndef memEQs
2733#define memEQs(s1, l, s2) \
2734(sizeof(s2)-1 == l && memEQ(s1, (s2 ""), (sizeof(s2)-1)))
2735#endif
2736#ifndef memNEs
2737#define memNEs(s1, l, s2) !memEQs(s1, l, s2)
2738#endif
2739#ifndef memCHRs
2740#define memCHRs(s, c) ((const char *) memchr("" s "" , c, sizeof(s)-1))
2741#endif
2742#ifndef MoveD
2743#define MoveD(s,d,n,t) memmove((char*)(d),(char*)(s), (n) * sizeof(t))
2744#endif
2745#ifndef CopyD
2746#define CopyD(s,d,n,t) memcpy((char*)(d),(char*)(s), (n) * sizeof(t))
2747#endif
2748#ifdef HAS_MEMSET
2749#ifndef ZeroD
2750#define ZeroD(d,n,t) memzero((char*)(d), (n) * sizeof(t))
2751#endif
2752#else
2753#ifndef ZeroD
2754#define ZeroD(d,n,t) ((void)memzero((char*)(d), (n) * sizeof(t)), d)
2755#endif
2756#endif
2757#ifndef PoisonWith
2758#define PoisonWith(d,n,t,b) (void)memset((char*)(d), (U8)(b), (n) * sizeof(t))
2759#endif
2760#ifndef PoisonNew
2761#define PoisonNew(d,n,t) PoisonWith(d,n,t,0xAB)
2762#endif
2763#ifndef PoisonFree
2764#define PoisonFree(d,n,t) PoisonWith(d,n,t,0xEF)
2765#endif
2766#ifndef Poison
2767#define Poison(d,n,t) PoisonFree(d,n,t)
2768#endif
2769#ifndef Newx
2770#define Newx(v,n,t) New(0,v,n,t)
2771#endif
2772#ifndef Newxc
2773#define Newxc(v,n,t,c) Newc(0,v,n,t,c)
2774#endif
2775#ifndef Newxz
2776#define Newxz(v,n,t) Newz(0,v,n,t)
2777#endif
2778#ifdef NEED_mess_sv
2779#define NEED_mess
2780#endif
2781#ifdef NEED_mess
2782#define NEED_mess_nocontext
2783#define NEED_vmess
2784#endif
2785#ifndef croak_sv
2786#if (PERL_BCDVERSION >= 0x5007003) || ( (PERL_BCDVERSION >= 0x5006001) && (PERL_BCDVERSION < 0x5007000) )
2787#if ( (PERL_BCDVERSION >= 0x5008000) && (PERL_BCDVERSION < 0x5008009) ) || ( (PERL_BCDVERSION >= 0x5009000) && (PERL_BCDVERSION < 0x5010001) )
2788#define D_PPP_FIX_UTF8_ERRSV_FOR_SV(sv) \
2789STMT_START { \
2790SV *_errsv = ERRSV; \
2791SvFLAGS(_errsv) = (SvFLAGS(_errsv) & ~SVf_UTF8) | \
2792(SvFLAGS(sv) & SVf_UTF8); \
2793} STMT_END
2794#else
2795#define D_PPP_FIX_UTF8_ERRSV_FOR_SV(sv) STMT_START {} STMT_END
2796#endif
2797PERL_STATIC_INLINE void D_PPP_croak_sv(SV *sv) {
2798dTHX;
2799SV *_sv = (sv);
2800if (SvROK(_sv)) {
2801sv_setsv(ERRSV, _sv);
2802croak(NULL);
2803} else {
2804D_PPP_FIX_UTF8_ERRSV_FOR_SV(_sv);
2805croak("%" SVf, SVfARG(_sv));
2806}
2807}
2808#define croak_sv(sv) D_PPP_croak_sv(sv)
2809#elif (PERL_BCDVERSION >= 0x5004000)
2810#define croak_sv(sv) croak("%" SVf, SVfARG(sv))
2811#else
2812#define croak_sv(sv) croak("%s", SvPV_nolen(sv))
2813#endif
2814#endif
2815#ifndef die_sv
2816#if defined(NEED_die_sv)
2817static OP * DPPP_(my_die_sv)(pTHX_ SV * baseex);
2818static
2819#else
2820extern OP * DPPP_(my_die_sv)(pTHX_ SV * baseex);
2821#endif
2822#if defined(NEED_die_sv) || defined(NEED_die_sv_GLOBAL)
2823#ifdef die_sv
2824#undef die_sv
2825#endif
2826#define die_sv(a) DPPP_(my_die_sv)(aTHX_ a)
2827#define Perl_die_sv DPPP_(my_die_sv)
2828OP *
2829DPPP_(my_die_sv)(pTHX_ SV *baseex)
2830{
2831croak_sv(baseex);
2832return (OP *)NULL;
2833}
2834#endif
2835#endif
2836#ifndef warn_sv
2837#if (PERL_BCDVERSION >= 0x5004000)
2838#define warn_sv(sv) warn("%" SVf, SVfARG(sv))
2839#else
2840#define warn_sv(sv) warn("%s", SvPV_nolen(sv))
2841#endif
2842#endif
2843#if ! defined vmess && (PERL_BCDVERSION >= 0x5004000)
2844#if defined(NEED_vmess)
2845static SV * DPPP_(my_vmess)(pTHX_ const char * pat, va_list * args);
2846static
2847#else
2848extern SV * DPPP_(my_vmess)(pTHX_ const char * pat, va_list * args);
2849#endif
2850#if defined(NEED_vmess) || defined(NEED_vmess_GLOBAL)
2851#ifdef vmess
2852#undef vmess
2853#endif
2854#define vmess(a,b) DPPP_(my_vmess)(aTHX_ a,b)
2855#define Perl_vmess DPPP_(my_vmess)
2856SV*
2857DPPP_(my_vmess)(pTHX_ const char* pat, va_list* args)
2858{
2859mess(pat, args);
2860return PL_mess_sv;
2861}
2862#endif
2863#endif
2864#if (PERL_BCDVERSION < 0x5006000) && (PERL_BCDVERSION >= 0x5004000)
2865#undef mess
2866#endif
2867#if !defined(mess_nocontext) && !defined(Perl_mess_nocontext) && (PERL_BCDVERSION >= 0x5004000)
2868#if defined(NEED_mess_nocontext)
2869static SV * DPPP_(my_mess_nocontext)(const char * pat, ...);
2870static
2871#else
2872extern SV * DPPP_(my_mess_nocontext)(const char * pat, ...);
2873#endif
2874#if defined(NEED_mess_nocontext) || defined(NEED_mess_nocontext_GLOBAL)
2875#define mess_nocontext DPPP_(my_mess_nocontext)
2876#define Perl_mess_nocontext DPPP_(my_mess_nocontext)
2877SV*
2878DPPP_(my_mess_nocontext)(const char* pat, ...)
2879{
2880dTHX;
2881SV *sv;
2882va_list args;
2883va_start(args, pat);
2884sv = vmess(pat, &args);
2885va_end(args);
2886return sv;
2887}
2888#endif
2889#endif
2890#ifndef mess
2891#if defined(NEED_mess)
2892static SV * DPPP_(my_mess)(pTHX_ const char * pat, ...);
2893static
2894#else
2895extern SV * DPPP_(my_mess)(pTHX_ const char * pat, ...);
2896#endif
2897#if defined(NEED_mess) || defined(NEED_mess_GLOBAL)
2898#define Perl_mess DPPP_(my_mess)
2899SV*
2900DPPP_(my_mess)(pTHX_ const char* pat, ...)
2901{
2902SV *sv;
2903va_list args;
2904va_start(args, pat);
2905sv = vmess(pat, &args);
2906va_end(args);
2907return sv;
2908}
2909#ifdef mess_nocontext
2910#define mess mess_nocontext
2911#else
2912#define mess Perl_mess_nocontext
2913#endif
2914#endif
2915#endif
2916#if ! defined mess_sv && (PERL_BCDVERSION >= 0x5004000)
2917#if defined(NEED_mess_sv)
2918static SV * DPPP_(my_mess_sv)(pTHX_ SV * basemsg, bool consume);
2919static
2920#else
2921extern SV * DPPP_(my_mess_sv)(pTHX_ SV * basemsg, bool consume);
2922#endif
2923#if defined(NEED_mess_sv) || defined(NEED_mess_sv_GLOBAL)
2924#ifdef mess_sv
2925#undef mess_sv
2926#endif
2927#define mess_sv(a,b) DPPP_(my_mess_sv)(aTHX_ a,b)
2928#define Perl_mess_sv DPPP_(my_mess_sv)
2929SV *
2930DPPP_(my_mess_sv)(pTHX_ SV *basemsg, bool consume)
2931{
2932SV *tmp;
2933SV *ret;
2934if (SvPOK(basemsg) && SvCUR(basemsg) && *(SvEND(basemsg)-1) == '\n') {
2935if (consume)
2936return basemsg;
2937ret = mess("");
2938SvSetSV_nosteal(ret, basemsg);
2939return ret;
2940}
2941if (consume) {
2942sv_catsv(basemsg, mess(""));
2943return basemsg;
2944}
2945ret = mess("");
2946tmp = newSVsv(ret);
2947SvSetSV_nosteal(ret, basemsg);
2948sv_catsv(ret, tmp);
2949sv_dec(tmp);
2950return ret;
2951}
2952#endif
2953#endif
2954#ifndef warn_nocontext
2955#define warn_nocontext warn
2956#endif
2957#ifndef croak_nocontext
2958#define croak_nocontext croak
2959#endif
2960#ifndef croak_no_modify
2961#define croak_no_modify() croak_nocontext("%s", PL_no_modify)
2962#define Perl_croak_no_modify() croak_no_modify()
2963#endif
2964#ifndef croak_memory_wrap
2965#if (PERL_BCDVERSION >= 0x5009002) || ( (PERL_BCDVERSION >= 0x5008006) && (PERL_BCDVERSION < 0x5009000) )
2966#define croak_memory_wrap() croak_nocontext("%s", PL_memory_wrap)
2967#else
2968#define croak_memory_wrap() croak_nocontext("panic: memory wrap")
2969#endif
2970#endif
2971#ifndef croak_xs_usage
2972#if defined(NEED_croak_xs_usage)
2973static void DPPP_(my_croak_xs_usage)(const CV * const cv, const char * const params);
2974static
2975#else
2976extern void DPPP_(my_croak_xs_usage)(const CV * const cv, const char * const params);
2977#endif
2978#if defined(NEED_croak_xs_usage) || defined(NEED_croak_xs_usage_GLOBAL)
2979#define croak_xs_usage DPPP_(my_croak_xs_usage)
2980#define Perl_croak_xs_usage DPPP_(my_croak_xs_usage)
2981#ifndef PERL_ARGS_ASSERT_CROAK_XS_USAGE
2982#define PERL_ARGS_ASSERT_CROAK_XS_USAGE assert(cv); assert(params)
2983void
2984DPPP_(my_croak_xs_usage)(const CV *const cv, const char *const params)
2985{
2986dTHX;
2987const GV *const gv = CvGV(cv);
2988PERL_ARGS_ASSERT_CROAK_XS_USAGE;
2989if (gv) {
2990const char *const gvname = GvNAME(gv);
2991const HV *const stash = GvSTASH(gv);
2992const char *const hvname = stash ? HvNAME(stash) : NULL;
2993if (hvname)
2994croak("Usage: %s::%s(%s)", hvname, gvname, params);
2995else
2996croak("Usage: %s(%s)", gvname, params);
2997} else {
2998croak("Usage: CODE(0x%" UVxf ")(%s)", PTR2UV(cv), params);
2999}
3000}
3001#endif
3002#endif
3003#endif
3004#ifndef mPUSHs
3005#define mPUSHs(s) PUSHs(sv_2mortal(s))
3006#endif
3007#ifndef PUSHmortal
3008#define PUSHmortal PUSHs(sv_newmortal())
3009#endif
3010#ifndef mPUSHp
3011#define mPUSHp(p,l) sv_setpvn(PUSHmortal, (p), (l))
3012#endif
3013#ifndef mPUSHn
3014#define mPUSHn(n) sv_setnv(PUSHmortal, (NV)(n))
3015#endif
3016#ifndef mPUSHi
3017#define mPUSHi(i) sv_setiv(PUSHmortal, (IV)(i))
3018#endif
3019#ifndef mPUSHu
3020#define mPUSHu(u) sv_setuv(PUSHmortal, (UV)(u))
3021#endif
3022#ifndef mXPUSHs
3023#define mXPUSHs(s) XPUSHs(sv_2mortal(s))
3024#endif
3025#ifndef XPUSHmortal
3026#define XPUSHmortal XPUSHs(sv_newmortal())
3027#endif
3028#ifndef mXPUSHp
3029#define mXPUSHp(p,l) STMT_START { EXTEND(sp,1); sv_setpvn(PUSHmortal, (p), (l)); } STMT_END
3030#endif
3031#ifndef mXPUSHn
3032#define mXPUSHn(n) STMT_START { EXTEND(sp,1); sv_setnv(PUSHmortal, (NV)(n)); } STMT_END
3033#endif
3034#ifndef mXPUSHi
3035#define mXPUSHi(i) STMT_START { EXTEND(sp,1); sv_setiv(PUSHmortal, (IV)(i)); } STMT_END
3036#endif
3037#ifndef mXPUSHu
3038#define mXPUSHu(u) STMT_START { EXTEND(sp,1); sv_setuv(PUSHmortal, (UV)(u)); } STMT_END
3039#endif
3040#ifndef call_sv
3041#define call_sv perl_call_sv
3042#endif
3043#ifndef call_pv
3044#define call_pv perl_call_pv
3045#endif
3046#ifndef call_argv
3047#define call_argv perl_call_argv
3048#endif
3049#ifndef call_method
3050#define call_method perl_call_method
3051#endif
3052#ifndef eval_sv
3053#define eval_sv perl_eval_sv
3054#endif
3055#if (PERL_BCDVERSION >= 0x5003098) && (PERL_BCDVERSION < 0x5006000)
3056#ifndef eval_pv
3057#define eval_pv perl_eval_pv
3058#endif
3059#endif
3060#if (PERL_BCDVERSION < 0x5006000)
3061#ifndef Perl_eval_sv
3062#define Perl_eval_sv perl_eval_sv
3063#endif
3064#if (PERL_BCDVERSION >= 0x5003098)
3065#ifndef Perl_eval_pv
3066#define Perl_eval_pv perl_eval_pv
3067#endif
3068#endif
3069#endif
3070#ifndef G_LIST
3071#define G_LIST G_ARRAY
3072#endif
3073#ifndef PERL_LOADMOD_DENY
3074#define PERL_LOADMOD_DENY 0x1
3075#endif
3076#ifndef PERL_LOADMOD_NOIMPORT
3077#define PERL_LOADMOD_NOIMPORT 0x2
3078#endif
3079#ifndef PERL_LOADMOD_IMPORT_OPS
3080#define PERL_LOADMOD_IMPORT_OPS 0x4
3081#endif
3082#if defined(PERL_USE_GCC_BRACE_GROUPS)
3083#define D_PPP_CROAK_IF_ERROR(cond) ({ \
3084SV *_errsv; \
3085( (cond) \
3086&& (_errsv = ERRSV) \
3087&& (SvROK(_errsv) || SvTRUE(_errsv)) \
3088&& (croak_sv(_errsv), 1)); \
3089})
3090#else
3091PERL_STATIC_INLINE void D_PPP_CROAK_IF_ERROR(int cond) {
3092dTHX;
3093SV *errsv;
3094if (!cond) return;
3095errsv = ERRSV;
3096if (SvROK(errsv) || SvTRUE(errsv)) croak_sv(errsv);
3097}
3098#define D_PPP_CROAK_IF_ERROR(cond) D_PPP_CROAK_IF_ERROR(cond)
3099#endif
3100#ifndef G_METHOD
3101#define G_METHOD 64
3102#ifdef call_sv
3103#undef call_sv
3104#endif
3105#if (PERL_BCDVERSION < 0x5006000)
3106#define call_sv(sv, flags) ((flags) & G_METHOD ? perl_call_method((char *) SvPV_nolen_const(sv), \
3107(flags) & ~G_METHOD) : perl_call_sv(sv, flags))
3108#else
3109#define call_sv(sv, flags) ((flags) & G_METHOD ? Perl_call_method(aTHX_ (char *) SvPV_nolen_const(sv), \
3110(flags) & ~G_METHOD) : Perl_call_sv(aTHX_ sv, flags))
3111#endif
3112#endif
3113#ifndef G_RETHROW
3114#define G_RETHROW 8192
3115#ifdef eval_sv
3116#undef eval_sv
3117#endif
3118#if defined(PERL_USE_GCC_BRACE_GROUPS)
3119#define eval_sv(sv, flags) ({ I32 _flags = (flags); I32 _ret = Perl_eval_sv(aTHX_ sv, (_flags & ~G_RETHROW)); D_PPP_CROAK_IF_ERROR(_flags & G_RETHROW); _ret; })
3120#else
3121#define eval_sv(sv, flags) ((PL_na = Perl_eval_sv(aTHX_ sv, ((flags) & ~G_RETHROW))), D_PPP_CROAK_IF_ERROR((flags) & G_RETHROW), (I32)PL_na)
3122#endif
3123#endif
3124#if (PERL_BCDVERSION < 0x5031002)
3125#ifdef eval_pv
3126#undef eval_pv
3127#if defined(PERL_USE_GCC_BRACE_GROUPS)
3128#define eval_pv(p, croak_on_error) ({ SV *_sv = Perl_eval_pv(aTHX_ p, 0); D_PPP_CROAK_IF_ERROR(croak_on_error); _sv; })
3129#else
3130#define eval_pv(p, croak_on_error) ((PL_Sv = Perl_eval_pv(aTHX_ p, 0)), D_PPP_CROAK_IF_ERROR(croak_on_error), PL_Sv)
3131#endif
3132#endif
3133#endif
3134#ifndef eval_pv
3135#if defined(NEED_eval_pv)
3136static SV * DPPP_(my_eval_pv)(const char * p, I32 croak_on_error);
3137static
3138#else
3139extern SV * DPPP_(my_eval_pv)(const char * p, I32 croak_on_error);
3140#endif
3141#if defined(NEED_eval_pv) || defined(NEED_eval_pv_GLOBAL)
3142#ifdef eval_pv
3143#undef eval_pv
3144#endif
3145#define eval_pv(a,b) DPPP_(my_eval_pv)(aTHX_ a,b)
3146#define Perl_eval_pv DPPP_(my_eval_pv)
3147SV*
3148DPPP_(my_eval_pv)(const char *p, I32 croak_on_error)
3149{
3150dSP;
3151SV* sv = newSVpv(p, 0);
3152PUSHMARK(sp);
3153eval_sv(sv, G_SCALAR);
3154SvREFCNT_dec(sv);
3155SPAGAIN;
3156sv = POPs;
3157PUTBACK;
3158D_PPP_CROAK_IF_ERROR(croak_on_error);
3159return sv;
3160}
3161#endif
3162#endif
3163#if ! defined(vload_module) && defined(start_subparse)
3164#if defined(NEED_vload_module)
3165static void DPPP_(my_vload_module)(U32 flags, SV * name, SV * ver, va_list * args);
3166static
3167#else
3168extern void DPPP_(my_vload_module)(U32 flags, SV * name, SV * ver, va_list * args);
3169#endif
3170#if defined(NEED_vload_module) || defined(NEED_vload_module_GLOBAL)
3171#ifdef vload_module
3172#undef vload_module
3173#endif
3174#define vload_module(a,b,c,d) DPPP_(my_vload_module)(aTHX_ a,b,c,d)
3175#define Perl_vload_module DPPP_(my_vload_module)
3176void
3177DPPP_(my_vload_module)(U32 flags, SV *name, SV *ver, va_list *args)
3178{
3179dTHR;
3180dVAR;
3181OP *veop, *imop;
3182OP * const modname = newSVOP(OP_CONST, 0, name);
3183SvREADONLY_off(((SVOP*)modname)->op_sv);
3184modname->op_private |= OPpCONST_BARE;
3185if (ver) {
3186veop = newSVOP(OP_CONST, 0, ver);
3187}
3188else
3189veop = NULL;
3190if (flags & PERL_LOADMOD_NOIMPORT) {
3191imop = sawparens(newNULLLIST());
3192}
3193else if (flags & PERL_LOADMOD_IMPORT_OPS) {
3194imop = va_arg(*args, OP*);
3195}
3196else {
3197SV *sv;
3198imop = NULL;
3199sv = va_arg(*args, SV*);
3200while (sv) {
3201imop = append_elem(OP_LIST, imop, newSVOP(OP_CONST, 0, sv));
3202sv = va_arg(*args, SV*);
3203}
3204}
3205{
3206const line_t ocopline = PL_copline;
3207COP * const ocurcop = PL_curcop;
3208const int oexpect = PL_expect;
3209utilize(!(flags & PERL_LOADMOD_DENY), start_subparse(FALSE, 0),
3210#if (PERL_BCDVERSION > 0x5003000)
3211veop,
3212#endif
3213modname, imop);
3214PL_expect = oexpect;
3215PL_copline = ocopline;
3216PL_curcop = ocurcop;
3217}
3218}
3219#endif
3220#endif
3221#ifndef load_module
3222#if defined(NEED_load_module)
3223static void DPPP_(my_load_module)(U32 flags, SV * name, SV * ver, ...);
3224static
3225#else
3226extern void DPPP_(my_load_module)(U32 flags, SV * name, SV * ver, ...);
3227#endif
3228#if defined(NEED_load_module) || defined(NEED_load_module_GLOBAL)
3229#ifdef load_module
3230#undef load_module
3231#endif
3232#define load_module DPPP_(my_load_module)
3233#define Perl_load_module DPPP_(my_load_module)
3234void
3235DPPP_(my_load_module)(U32 flags, SV *name, SV *ver, ...)
3236{
3237va_list args;
3238va_start(args, ver);
3239vload_module(flags, name, ver, &args);
3240va_end(args);
3241}
3242#endif
3243#endif
3244#ifndef newRV_inc
3245#define newRV_inc(sv) newRV(sv)
3246#endif
3247#ifndef newRV_noinc
3248#if defined(PERL_USE_GCC_BRACE_GROUPS)
3249#define newRV_noinc(sv) ({ SV *_sv = (SV *)newRV((sv)); SvREFCNT_dec((sv)); _sv; })
3250#else
3251#define newRV_noinc(sv) ((PL_Sv = (SV *)newRV((sv))), SvREFCNT_dec((sv)), PL_Sv)
3252#endif
3253#endif
3254#if defined(MULTIPLICITY) || defined(PERL_OBJECT) || \
3255defined(PERL_CAPI) || defined(PERL_IMPLICIT_CONTEXT)
3256#ifndef START_MY_CXT
3257#define START_MY_CXT
3258#if (PERL_BCDVERSION < 0x5004068)
3259#define dMY_CXT_SV \
3260SV *my_cxt_sv = get_sv(MY_CXT_KEY, FALSE)
3261#else
3262#define dMY_CXT_SV \
3263SV *my_cxt_sv = *hv_fetch(PL_modglobal, MY_CXT_KEY, \
3264sizeof(MY_CXT_KEY)-1, TRUE)
3265#endif
3266#define dMY_CXT \
3267dMY_CXT_SV; \
3268my_cxt_t *my_cxtp = INT2PTR(my_cxt_t*,SvUV(my_cxt_sv))
3269#define MY_CXT_INIT \
3270dMY_CXT_SV; \
3271\
3272my_cxt_t *my_cxtp = (my_cxt_t*)SvPVX(newSV(sizeof(my_cxt_t)-1));\
3273Zero(my_cxtp, 1, my_cxt_t); \
3274sv_setuv(my_cxt_sv, PTR2UV(my_cxtp))
3275#define MY_CXT (*my_cxtp)
3276#define pMY_CXT my_cxt_t *my_cxtp
3277#define pMY_CXT_ pMY_CXT,
3278#define _pMY_CXT ,pMY_CXT
3279#define aMY_CXT my_cxtp
3280#define aMY_CXT_ aMY_CXT,
3281#define _aMY_CXT ,aMY_CXT
3282#endif
3283#ifndef MY_CXT_CLONE
3284#define MY_CXT_CLONE \
3285dMY_CXT_SV; \
3286my_cxt_t *my_cxtp = (my_cxt_t*)SvPVX(newSV(sizeof(my_cxt_t)-1));\
3287Copy(INT2PTR(my_cxt_t*, SvUV(my_cxt_sv)), my_cxtp, 1, my_cxt_t);\
3288sv_setuv(my_cxt_sv, PTR2UV(my_cxtp))
3289#endif
3290#else
3291#ifndef START_MY_CXT
3292#define START_MY_CXT static my_cxt_t my_cxt;
3293#define dMY_CXT_SV dNOOP
3294#define dMY_CXT dNOOP
3295#define MY_CXT_INIT NOOP
3296#define MY_CXT my_cxt
3297#define pMY_CXT void
3298#define pMY_CXT_
3299#define _pMY_CXT
3300#define aMY_CXT
3301#define aMY_CXT_
3302#define _aMY_CXT
3303#endif
3304#ifndef MY_CXT_CLONE
3305#define MY_CXT_CLONE NOOP
3306#endif
3307#endif
3308#ifndef SvREFCNT_inc
3309#ifdef PERL_USE_GCC_BRACE_GROUPS
3310#define SvREFCNT_inc(sv) \
3311({ \
3312SV * const _sv = (SV*)(sv); \
3313if (_sv) \
3314(SvREFCNT(_sv))++; \
3315_sv; \
3316})
3317#else
3318#define SvREFCNT_inc(sv) \
3319((PL_Sv=(SV*)(sv)) ? (++(SvREFCNT(PL_Sv)),PL_Sv) : NULL)
3320#endif
3321#endif
3322#ifndef SvREFCNT_inc_simple
3323#ifdef PERL_USE_GCC_BRACE_GROUPS
3324#define SvREFCNT_inc_simple(sv) \
3325({ \
3326if (sv) \
3327(SvREFCNT(sv))++; \
3328(SV *)(sv); \
3329})
3330#else
3331#define SvREFCNT_inc_simple(sv) \
3332((sv) ? (SvREFCNT(sv)++,(SV*)(sv)) : NULL)
3333#endif
3334#endif
3335#ifndef SvREFCNT_inc_NN
3336#ifdef PERL_USE_GCC_BRACE_GROUPS
3337#define SvREFCNT_inc_NN(sv) \
3338({ \
3339SV * const _sv = (SV*)(sv); \
3340SvREFCNT(_sv)++; \
3341_sv; \
3342})
3343#else
3344#define SvREFCNT_inc_NN(sv) \
3345(PL_Sv=(SV*)(sv),++(SvREFCNT(PL_Sv)),PL_Sv)
3346#endif
3347#endif
3348#ifndef SvREFCNT_inc_void
3349#ifdef PERL_USE_GCC_BRACE_GROUPS
3350#define SvREFCNT_inc_void(sv) \
3351({ \
3352SV * const _sv = (SV*)(sv); \
3353if (_sv) \
3354(void)(SvREFCNT(_sv)++); \
3355})
3356#else
3357#define SvREFCNT_inc_void(sv) \
3358(void)((PL_Sv=(SV*)(sv)) ? ++(SvREFCNT(PL_Sv)) : 0)
3359#endif
3360#endif
3361#ifndef SvREFCNT_inc_simple_void
3362#define SvREFCNT_inc_simple_void(sv) STMT_START { if (sv) SvREFCNT(sv)++; } STMT_END
3363#endif
3364#ifndef SvREFCNT_inc_simple_NN
3365#define SvREFCNT_inc_simple_NN(sv) (++SvREFCNT(sv), (SV*)(sv))
3366#endif
3367#ifndef SvREFCNT_inc_void_NN
3368#define SvREFCNT_inc_void_NN(sv) (void)(++SvREFCNT((SV*)(sv)))
3369#endif
3370#ifndef SvREFCNT_inc_simple_void_NN
3371#define SvREFCNT_inc_simple_void_NN(sv) (void)(++SvREFCNT((SV*)(sv)))
3372#endif
3373#ifndef newSV_type
3374#if defined(PERL_USE_GCC_BRACE_GROUPS)
3375#define newSV_type(t) ({ SV *_sv = newSV(0); sv_upgrade(_sv, (t)); _sv; })
3376#else
3377#define newSV_type(t) ((PL_Sv = newSV(0)), sv_upgrade(PL_Sv, (t)), PL_Sv)
3378#endif
3379#endif
3380#if (PERL_BCDVERSION < 0x5006000)
3381#define D_PPP_CONSTPV_ARG(x) ((char *) (x))
3382#else
3383#define D_PPP_CONSTPV_ARG(x) (x)
3384#endif
3385#ifndef newSVpvn
3386#define newSVpvn(data,len) ((data) \
3387? ((len) ? newSVpv((data), (len)) : newSVpv("", 0)) \
3388: newSV(0))
3389#endif
3390#ifndef newSVpvn_utf8
3391#define newSVpvn_utf8(s, len, u) newSVpvn_flags((s), (len), (u) ? SVf_UTF8 : 0)
3392#endif
3393#ifndef SVf_UTF8
3394#define SVf_UTF8 0
3395#endif
3396#ifndef newSVpvn_flags
3397#if defined(PERL_USE_GCC_BRACE_GROUPS)
3398#define newSVpvn_flags(s, len, flags) \
3399({ \
3400SV * sv = newSVpvn(D_PPP_CONSTPV_ARG(s), (len)); \
3401SvFLAGS(sv) |= ((flags) & SVf_UTF8); \
3402if ((flags) & SVs_TEMP) sv = sv_2mortal(sv); \
3403sv; \
3404})
3405#else
3406PERL_STATIC_INLINE SV* D_PPP_newSVpvn_flags(const char *const s, const STRLEN len, const U32 flags)
3407{
3408dTHX;
3409SV * sv = newSVpvn(s, len);
3410SvFLAGS(sv) |= (flags & SVf_UTF8);
3411if (flags & SVs_TEMP) return sv_2mortal(sv);
3412return sv;
3413}
3414#define newSVpvn_flags(s, len, flags) D_PPP_newSVpvn_flags((s), (len), (flags))
3415#endif
3416#endif
3417#ifndef SV_NOSTEAL
3418#define SV_NOSTEAL 16
3419#endif
3420#if ( (PERL_BCDVERSION >= 0x5007003) && (PERL_BCDVERSION < 0x5008007) ) || ( (PERL_BCDVERSION >= 0x5009000) && (PERL_BCDVERSION < 0x5009002) )
3421#undef sv_setsv_flags
3422#if defined(PERL_USE_GCC_BRACE_GROUPS)
3423#define sv_setsv_flags(dstr, sstr, flags) \
3424STMT_START { \
3425if (((flags) & SV_NOSTEAL) && (sstr) && (SvFLAGS((SV *)(sstr)) & SVs_TEMP)) { \
3426SvTEMP_off((SV *)(sstr)); \
3427Perl_sv_setsv_flags(aTHX_ (dstr), (sstr), (flags) & ~SV_NOSTEAL); \
3428SvTEMP_on((SV *)(sstr)); \
3429} else { \
3430Perl_sv_setsv_flags(aTHX_ (dstr), (sstr), (flags) & ~SV_NOSTEAL); \
3431} \
3432} STMT_END
3433#else
3434#define sv_setsv_flags(dstr, sstr, flags) \
3435( \
3436(((flags) & SV_NOSTEAL) && (sstr) && (SvFLAGS((SV *)(sstr)) & SVs_TEMP)) ? ( \
3437SvTEMP_off((SV *)(sstr)), \
3438Perl_sv_setsv_flags(aTHX_ (dstr), (sstr), (flags) & ~SV_NOSTEAL), \
3439SvTEMP_on((SV *)(sstr)), \
34401 \
3441) : ( \
3442Perl_sv_setsv_flags(aTHX_ (dstr), (sstr), (flags) & ~SV_NOSTEAL), \
34431 \
3444) \
3445)
3446#endif
3447#endif
3448#if defined(PERL_USE_GCC_BRACE_GROUPS)
3449#ifndef sv_setsv_flags
3450#define sv_setsv_flags(dstr, sstr, flags) \
3451STMT_START { \
3452if (((flags) & SV_NOSTEAL) && (sstr) && (SvFLAGS((SV *)(sstr)) & SVs_TEMP)) { \
3453SvTEMP_off((SV *)(sstr)); \
3454if (!((flags) & SV_GMAGIC) && (sstr) && SvGMAGICAL((SV *)(sstr))) { \
3455SvGMAGICAL_off((SV *)(sstr)); \
3456sv_setsv((dstr), (sstr)); \
3457SvGMAGICAL_on((SV *)(sstr)); \
3458} else { \
3459sv_setsv((dstr), (sstr)); \
3460} \
3461SvTEMP_on((SV *)(sstr)); \
3462} else { \
3463if (!((flags) & SV_GMAGIC) && (sstr) && SvGMAGICAL((SV *)(sstr))) { \
3464SvGMAGICAL_off((SV *)(sstr)); \
3465sv_setsv((dstr), (sstr)); \
3466SvGMAGICAL_on((SV *)(sstr)); \
3467} else { \
3468sv_setsv((dstr), (sstr)); \
3469} \
3470} \
3471} STMT_END
3472#endif
3473#else
3474#ifndef sv_setsv_flags
3475#define sv_setsv_flags(dstr, sstr, flags) \
3476( \
3477(((flags) & SV_NOSTEAL) && (sstr) && (SvFLAGS((SV *)(sstr)) & SVs_TEMP)) ? ( \
3478SvTEMP_off((SV *)(sstr)), \
3479(!((flags) & SV_GMAGIC) && (sstr) && SvGMAGICAL((SV *)(sstr))) ? ( \
3480SvGMAGICAL_off((SV *)(sstr)), \
3481sv_setsv((dstr), (sstr)), \
3482SvGMAGICAL_on((SV *)(sstr)), \
34831 \
3484) : ( \
3485sv_setsv((dstr), (sstr)), \
34861 \
3487), \
3488SvTEMP_on((SV *)(sstr)), \
34891 \
3490) : ( \
3491(!((flags) & SV_GMAGIC) && (sstr) && SvGMAGICAL((SV *)(sstr))) ? ( \
3492SvGMAGICAL_off((SV *)(sstr)), \
3493sv_setsv((dstr), (sstr)), \
3494SvGMAGICAL_on((SV *)(sstr)), \
34951 \
3496) : ( \
3497sv_setsv((dstr), (sstr)), \
34981 \
3499) \
3500) \
3501)
3502#endif
3503#endif
3504#ifndef newSVsv_flags
3505#if defined(PERL_USE_GCC_BRACE_GROUPS)
3506#define newSVsv_flags(sv, flags) \
3507({ \
3508SV *n= newSV(0); \
3509sv_setsv_flags(n, (sv), (flags)); \
3510n; \
3511})
3512#else
3513PERL_STATIC_INLINE SV* D_PPP_newSVsv_flags(SV *const old, I32 flags)
3514{
3515dTHX;
3516SV *n= newSV(0);
3517sv_setsv_flags(n, old, flags);
3518return n;
3519}
3520#define newSVsv_flags(sv, flags) D_PPP_newSVsv_flags(sv, flags)
3521#endif
3522#endif
3523#ifndef newSVsv_nomg
3524#define newSVsv_nomg(sv) newSVsv_flags((sv), SV_NOSTEAL)
3525#endif
3526#if (PERL_BCDVERSION >= 0x5017005)
3527#ifndef sv_mortalcopy_flags
3528#define sv_mortalcopy_flags(sv, flags) Perl_sv_mortalcopy_flags(aTHX_ (sv), (flags))
3529#endif
3530#else
3531#ifndef sv_mortalcopy_flags
3532#define sv_mortalcopy_flags(sv, flags) sv_2mortal(newSVsv_flags((sv), (flags)))
3533#endif
3534#endif
3535#ifndef SvMAGIC_set
3536#define SvMAGIC_set(sv, val) \
3537STMT_START { assert(SvTYPE(sv) >= SVt_PVMG); \
3538(((XPVMG*) SvANY(sv))->xmg_magic = (val)); } STMT_END
3539#endif
3540#if (PERL_BCDVERSION < 0x5009003)
3541#ifndef SvPVX_const
3542#define SvPVX_const(sv) ((const char*) (0 + SvPVX(sv)))
3543#endif
3544#ifndef SvPVX_mutable
3545#define SvPVX_mutable(sv) (0 + SvPVX(sv))
3546#endif
3547#ifndef SvRV_set
3548#define SvRV_set(sv, val) \
3549STMT_START { assert(SvTYPE(sv) >= SVt_RV); \
3550(((XRV*) SvANY(sv))->xrv_rv = (val)); } STMT_END
3551#endif
3552#else
3553#ifndef SvPVX_const
3554#define SvPVX_const(sv) ((const char*)((sv)->sv_u.svu_pv))
3555#endif
3556#ifndef SvPVX_mutable
3557#define SvPVX_mutable(sv) ((sv)->sv_u.svu_pv)
3558#endif
3559#ifndef SvRV_set
3560#define SvRV_set(sv, val) \
3561STMT_START { assert(SvTYPE(sv) >= SVt_RV); \
3562((sv)->sv_u.svu_rv = (val)); } STMT_END
3563#endif
3564#endif
3565#ifndef SvSTASH_set
3566#define SvSTASH_set(sv, val) \
3567STMT_START { assert(SvTYPE(sv) >= SVt_PVMG); \
3568(((XPVMG*) SvANY(sv))->xmg_stash = (val)); } STMT_END
3569#endif
3570#if (PERL_BCDVERSION < 0x5004000)
3571#ifndef SvUV_set
3572#define SvUV_set(sv, val) \
3573STMT_START { assert(SvTYPE(sv) == SVt_IV || SvTYPE(sv) >= SVt_PVIV); \
3574(((XPVIV*) SvANY(sv))->xiv_iv = (IV) (val)); } STMT_END
3575#endif
3576#else
3577#ifndef SvUV_set
3578#define SvUV_set(sv, val) \
3579STMT_START { assert(SvTYPE(sv) == SVt_IV || SvTYPE(sv) >= SVt_PVIV); \
3580(((XPVUV*) SvANY(sv))->xuv_uv = (val)); } STMT_END
3581#endif
3582#endif
3583#ifndef newSVpvn_share
3584#if defined(NEED_newSVpvn_share)
3585static SV * DPPP_(my_newSVpvn_share)(pTHX_ const char * s, I32 len, U32 hash);
3586static
3587#else
3588extern SV * DPPP_(my_newSVpvn_share)(pTHX_ const char * s, I32 len, U32 hash);
3589#endif
3590#if defined(NEED_newSVpvn_share) || defined(NEED_newSVpvn_share_GLOBAL)
3591#ifdef newSVpvn_share
3592#undef newSVpvn_share
3593#endif
3594#define newSVpvn_share(a,b,c) DPPP_(my_newSVpvn_share)(aTHX_ a,b,c)
3595#define Perl_newSVpvn_share DPPP_(my_newSVpvn_share)
3596SV *
3597DPPP_(my_newSVpvn_share)(pTHX_ const char *s, I32 len, U32 hash)
3598{
3599SV *sv;
3600if (len < 0)
3601len = -len;
3602if (!hash)
3603PERL_HASH(hash, (char*) s, len);
3604sv = newSVpvn((char *) s, len);
3605sv_upgrade(sv, SVt_PVIV);
3606SvIVX(sv) = hash;
3607SvREADONLY_on(sv);
3608SvPOK_on(sv);
3609return sv;
3610}
3611#endif
3612#endif
3613#ifndef SvSHARED_HASH
3614#define SvSHARED_HASH(sv) (0 + SvUVX(sv))
3615#endif
3616#ifndef HvNAME_get
3617#define HvNAME_get(hv) HvNAME(hv)
3618#endif
3619#ifndef HvNAMELEN_get
3620#define HvNAMELEN_get(hv) (HvNAME_get(hv) ? (I32)strlen(HvNAME_get(hv)) : 0)
3621#endif
3622#if (PERL_BCDVERSION >= 0x5009002) && (PERL_BCDVERSION <= 0x5009003)
3623#undef gv_fetchpvn_flags
3624#endif
3625#ifdef GV_NOADD_MASK
3626#define D_PPP_GV_NOADD_MASK GV_NOADD_MASK
3627#else
3628#define D_PPP_GV_NOADD_MASK 0xE0
3629#endif
3630#ifndef gv_fetchpvn_flags
3631#define gv_fetchpvn_flags(name, len, flags, sv_type) gv_fetchpv(SvPVX(sv_2mortal(newSVpvn((name), (len)))), ((flags) & D_PPP_GV_NOADD_MASK) ? FALSE : TRUE, (I32)(sv_type))
3632#endif
3633#ifndef GvSVn
3634#define GvSVn(gv) GvSV(gv)
3635#endif
3636#ifndef isGV_with_GP
3637#define isGV_with_GP(gv) isGV(gv)
3638#endif
3639#ifndef gv_fetchsv
3640#define gv_fetchsv(name, flags, svt) gv_fetchpv(SvPV_nolen_const(name), flags, svt)
3641#endif
3642#ifndef get_cvn_flags
3643#define get_cvn_flags(name, namelen, flags) get_cv(name, flags)
3644#endif
3645#ifndef gv_init_pvn
3646#define gv_init_pvn(gv, stash, ptr, len, flags) gv_init(gv, stash, ptr, len, flags & GV_ADDMULTI ? TRUE : FALSE)
3647#endif
3648#ifndef STR_WITH_LEN
3649#define STR_WITH_LEN(s) (s ""), (sizeof(s)-1)
3650#endif
3651#ifndef newSVpvs
3652#define newSVpvs(str) newSVpvn(str "", sizeof(str) - 1)
3653#endif
3654#ifndef newSVpvs_flags
3655#define newSVpvs_flags(str, flags) newSVpvn_flags(str "", sizeof(str) - 1, flags)
3656#endif
3657#ifndef newSVpvs_share
3658#define newSVpvs_share(str) newSVpvn_share(str "", sizeof(str) - 1, 0)
3659#endif
3660#ifndef sv_catpvs
3661#define sv_catpvs(sv, str) sv_catpvn(sv, str "", sizeof(str) - 1)
3662#endif
3663#ifndef sv_setpvs
3664#define sv_setpvs(sv, str) sv_setpvn(sv, str "", sizeof(str) - 1)
3665#endif
3666#ifndef hv_fetchs
3667#define hv_fetchs(hv, key, lval) hv_fetch(hv, key "", sizeof(key) - 1, lval)
3668#endif
3669#ifndef hv_stores
3670#define hv_stores(hv, key, val) hv_store(hv, key "", sizeof(key) - 1, val, 0)
3671#endif
3672#ifndef gv_fetchpvs
3673#define gv_fetchpvs(name, flags, svt) gv_fetchpvn_flags(name "", sizeof(name) - 1, flags, svt)
3674#endif
3675#ifndef gv_stashpvs
3676#define gv_stashpvs(name, flags) gv_stashpvn(name "", sizeof(name) - 1, flags)
3677#endif
3678#ifndef get_cvs
3679#define get_cvs(name, flags) get_cvn_flags(name "", sizeof(name)-1, flags)
3680#endif
3681#undef SvGETMAGIC
3682#ifndef SvGETMAGIC
3683#define SvGETMAGIC(x) ((void)(UNLIKELY(SvGMAGICAL(x)) && mg_get(x)))
3684#endif
3685#ifndef sv_catpvn_nomg
3686#define sv_catpvn_nomg sv_catpvn
3687#endif
3688#ifndef sv_catsv_nomg
3689#define sv_catsv_nomg sv_catsv
3690#endif
3691#ifndef sv_setsv_nomg
3692#define sv_setsv_nomg sv_setsv
3693#endif
3694#ifndef sv_pvn_nomg
3695#define sv_pvn_nomg sv_pvn
3696#endif
3697#ifdef SVf_IVisUV
3698#if defined(PERL_USE_GCC_BRACE_GROUPS)
3699#ifndef SvIV_nomg
3700#define SvIV_nomg(sv) (!SvGMAGICAL((sv)) ? SvIV((sv)) : ({ SV *_sviv = sv_mortalcopy_flags((sv), SV_NOSTEAL); IV _iv = SvIV(_sviv); SvFLAGS((sv)) = (SvFLAGS((sv)) & ~SVf_IVisUV) | (SvFLAGS(_sviv) & SVf_IVisUV); _iv; }))
3701#endif
3702#ifndef SvUV_nomg
3703#define SvUV_nomg(sv) (!SvGMAGICAL((sv)) ? SvUV((sv)) : ({ SV *_svuv = sv_mortalcopy_flags((sv), SV_NOSTEAL); UV _uv = SvUV(_svuv); SvFLAGS((sv)) = (SvFLAGS((sv)) & ~SVf_IVisUV) | (SvFLAGS(_svuv) & SVf_IVisUV); _uv; }))
3704#endif
3705#else
3706#ifndef SvIV_nomg
3707#define SvIV_nomg(sv) (!SvGMAGICAL((sv)) ? SvIV((sv)) : ((PL_Sv = sv_mortalcopy_flags((sv), SV_NOSTEAL)), sv_upgrade(PL_Sv, SVt_PVIV), (SvIVX(PL_Sv) = SvIV(PL_Sv)), (SvFLAGS((sv)) = (SvFLAGS((sv)) & ~SVf_IVisUV) | (SvFLAGS(PL_Sv) & SVf_IVisUV)), SvIVX(PL_Sv)))
3708#endif
3709#ifndef SvUV_nomg
3710#define SvUV_nomg(sv) (!SvGMAGICAL((sv)) ? SvIV((sv)) : ((PL_Sv = sv_mortalcopy_flags((sv), SV_NOSTEAL)), sv_upgrade(PL_Sv, SVt_PVIV), (SvUVX(PL_Sv) = SvUV(PL_Sv)), (SvFLAGS((sv)) = (SvFLAGS((sv)) & ~SVf_IVisUV) | (SvFLAGS(PL_Sv) & SVf_IVisUV)), SvUVX(PL_Sv)))
3711#endif
3712#endif
3713#else
3714#ifndef SvIV_nomg
3715#define SvIV_nomg(sv) (!SvGMAGICAL((sv)) ? SvIV((sv)) : SvIVx(sv_mortalcopy_flags((sv), SV_NOSTEAL)))
3716#endif
3717#ifndef SvUV_nomg
3718#define SvUV_nomg(sv) (!SvGMAGICAL((sv)) ? SvUV((sv)) : SvUVx(sv_mortalcopy_flags((sv), SV_NOSTEAL)))
3719#endif
3720#endif
3721#ifndef SvNV_nomg
3722#define SvNV_nomg(sv) (!SvGMAGICAL((sv)) ? SvNV((sv)) : SvNVx(sv_mortalcopy_flags((sv), SV_NOSTEAL)))
3723#endif
3724#ifndef SvTRUE_nomg
3725#define SvTRUE_nomg(sv) (!SvGMAGICAL((sv)) ? SvTRUE((sv)) : SvTRUEx(sv_mortalcopy_flags((sv), SV_NOSTEAL)))
3726#endif
3727#ifndef sv_catpv_mg
3728#define sv_catpv_mg(sv, ptr) \
3729STMT_START { \
3730SV *TeMpSv = sv; \
3731sv_catpv(TeMpSv,ptr); \
3732SvSETMAGIC(TeMpSv); \
3733} STMT_END
3734#endif
3735#ifndef sv_catpvn_mg
3736#define sv_catpvn_mg(sv, ptr, len) \
3737STMT_START { \
3738SV *TeMpSv = sv; \
3739sv_catpvn(TeMpSv,ptr,len); \
3740SvSETMAGIC(TeMpSv); \
3741} STMT_END
3742#endif
3743#ifndef sv_catsv_mg
3744#define sv_catsv_mg(dsv, ssv) \
3745STMT_START { \
3746SV *TeMpSv = dsv; \
3747sv_catsv(TeMpSv,ssv); \
3748SvSETMAGIC(TeMpSv); \
3749} STMT_END
3750#endif
3751#ifndef sv_setiv_mg
3752#define sv_setiv_mg(sv, i) \
3753STMT_START { \
3754SV *TeMpSv = sv; \
3755sv_setiv(TeMpSv,i); \
3756SvSETMAGIC(TeMpSv); \
3757} STMT_END
3758#endif
3759#ifndef sv_setnv_mg
3760#define sv_setnv_mg(sv, num) \
3761STMT_START { \
3762SV *TeMpSv = sv; \
3763sv_setnv(TeMpSv,num); \
3764SvSETMAGIC(TeMpSv); \
3765} STMT_END
3766#endif
3767#ifndef sv_setpv_mg
3768#define sv_setpv_mg(sv, ptr) \
3769STMT_START { \
3770SV *TeMpSv = sv; \
3771sv_setpv(TeMpSv,ptr); \
3772SvSETMAGIC(TeMpSv); \
3773} STMT_END
3774#endif
3775#ifndef sv_setpvn_mg
3776#define sv_setpvn_mg(sv, ptr, len) \
3777STMT_START { \
3778SV *TeMpSv = sv; \
3779sv_setpvn(TeMpSv,ptr,len); \
3780SvSETMAGIC(TeMpSv); \
3781} STMT_END
3782#endif
3783#ifndef sv_setsv_mg
3784#define sv_setsv_mg(dsv, ssv) \
3785STMT_START { \
3786SV *TeMpSv = dsv; \
3787sv_setsv(TeMpSv,ssv); \
3788SvSETMAGIC(TeMpSv); \
3789} STMT_END
3790#endif
3791#ifndef sv_setuv_mg
3792#define sv_setuv_mg(sv, i) \
3793STMT_START { \
3794SV *TeMpSv = sv; \
3795sv_setuv(TeMpSv,i); \
3796SvSETMAGIC(TeMpSv); \
3797} STMT_END
3798#endif
3799#ifndef sv_usepvn_mg
3800#define sv_usepvn_mg(sv, ptr, len) \
3801STMT_START { \
3802SV *TeMpSv = sv; \
3803sv_usepvn(TeMpSv,ptr,len); \
3804SvSETMAGIC(TeMpSv); \
3805} STMT_END
3806#endif
3807#ifndef SvVSTRING_mg
3808#define SvVSTRING_mg(sv) (SvMAGICAL(sv) ? mg_find(sv, PERL_MAGIC_vstring) : NULL)
3809#endif
3810#if (PERL_BCDVERSION < 0x5004000)
3811#elif (PERL_BCDVERSION < 0x5008000)
3812#define sv_magic_portable(sv, obj, how, name, namlen) \
3813STMT_START { \
3814SV *SvMp_sv = (sv); \
3815char *SvMp_name = (char *) (name); \
3816I32 SvMp_namlen = (namlen); \
3817if (SvMp_name && SvMp_namlen == 0) \
3818{ \
3819MAGIC *mg; \
3820sv_magic(SvMp_sv, obj, how, 0, 0); \
3821mg = SvMAGIC(SvMp_sv); \
3822mg->mg_len = -42; \
3823mg->mg_ptr = SvMp_name; \
3824} \
3825else \
3826{ \
3827sv_magic(SvMp_sv, obj, how, SvMp_name, SvMp_namlen); \
3828} \
3829} STMT_END
3830#else
3831#define sv_magic_portable(a, b, c, d, e) sv_magic(a, b, c, d, e)
3832#endif
3833#if !defined(mg_findext)
3834#if defined(NEED_mg_findext)
3835static MAGIC * DPPP_(my_mg_findext)(const SV * sv, int type, const MGVTBL * vtbl);
3836static
3837#else
3838extern MAGIC * DPPP_(my_mg_findext)(const SV * sv, int type, const MGVTBL * vtbl);
3839#endif
3840#if defined(NEED_mg_findext) || defined(NEED_mg_findext_GLOBAL)
3841#define mg_findext DPPP_(my_mg_findext)
3842#define Perl_mg_findext DPPP_(my_mg_findext)
3843MAGIC *
3844DPPP_(my_mg_findext)(const SV * sv, int type, const MGVTBL *vtbl) {
3845if (sv) {
3846MAGIC *mg;
3847#ifdef AvPAD_NAMELIST
3848assert(!(SvTYPE(sv) == SVt_PVAV && AvPAD_NAMELIST(sv)));
3849#endif
3850for (mg = SvMAGIC (sv); mg; mg = mg->mg_moremagic) {
3851if (mg->mg_type == type && mg->mg_virtual == vtbl)
3852return mg;
3853}
3854}
3855return NULL;
3856}
3857#endif
3858#endif
3859#if !defined(sv_unmagicext)
3860#if defined(NEED_sv_unmagicext)
3861static int DPPP_(my_sv_unmagicext)(pTHX_ SV * const sv, const int type, const MGVTBL * vtbl);
3862static
3863#else
3864extern int DPPP_(my_sv_unmagicext)(pTHX_ SV * const sv, const int type, const MGVTBL * vtbl);
3865#endif
3866#if defined(NEED_sv_unmagicext) || defined(NEED_sv_unmagicext_GLOBAL)
3867#ifdef sv_unmagicext
3868#undef sv_unmagicext
3869#endif
3870#define sv_unmagicext(a,b,c) DPPP_(my_sv_unmagicext)(aTHX_ a,b,c)
3871#define Perl_sv_unmagicext DPPP_(my_sv_unmagicext)
3872int
3873DPPP_(my_sv_unmagicext)(pTHX_ SV *const sv, const int type, const MGVTBL *vtbl)
3874{
3875MAGIC* mg;
3876MAGIC** mgp;
3877if (SvTYPE(sv) < SVt_PVMG || !SvMAGIC(sv))
3878return 0;
3879mgp = &(SvMAGIC(sv));
3880for (mg = *mgp; mg; mg = *mgp) {
3881const MGVTBL* const virt = mg->mg_virtual;
3882if (mg->mg_type == type && virt == vtbl) {
3883*mgp = mg->mg_moremagic;
3884if (virt && virt->svt_free)
3885virt->svt_free(aTHX_ sv, mg);
3886if (mg->mg_ptr && mg->mg_type != PERL_MAGIC_regex_global) {
3887if (mg->mg_len > 0)
3888Safefree(mg->mg_ptr);
3889else if (mg->mg_len == HEf_SVKEY)
3890SvREFCNT_dec(MUTABLE_SV(mg->mg_ptr));
3891else if (mg->mg_type == PERL_MAGIC_utf8)
3892Safefree(mg->mg_ptr);
3893}
3894if (mg->mg_flags & MGf_REFCOUNTED)
3895SvREFCNT_dec(mg->mg_obj);
3896Safefree(mg);
3897}
3898else
3899mgp = &mg->mg_moremagic;
3900}
3901if (SvMAGIC(sv)) {
3902if (SvMAGICAL(sv))
3903mg_magical(sv);
3904}
3905else {
3906SvMAGICAL_off(sv);
3907SvFLAGS(sv) |= (SvFLAGS(sv) & (SVp_IOK|SVp_NOK|SVp_POK)) >> PRIVSHIFT;
3908}
3909return 0;
3910}
3911#endif
3912#endif
3913#ifdef USE_ITHREADS
3914#ifndef CopFILE
3915#define CopFILE(c) ((c)->cop_file)
3916#endif
3917#ifndef CopFILEGV
3918#define CopFILEGV(c) (CopFILE(c) ? gv_fetchfile(CopFILE(c)) : Nullgv)
3919#endif
3920#ifndef CopFILE_set
3921#define CopFILE_set(c,pv) ((c)->cop_file = savepv(pv))
3922#endif
3923#ifndef CopFILESV
3924#define CopFILESV(c) (CopFILE(c) ? GvSV(gv_fetchfile(CopFILE(c))) : Nullsv)
3925#endif
3926#ifndef CopFILEAV
3927#define CopFILEAV(c) (CopFILE(c) ? GvAV(gv_fetchfile(CopFILE(c))) : Nullav)
3928#endif
3929#ifndef CopSTASHPV
3930#define CopSTASHPV(c) ((c)->cop_stashpv)
3931#endif
3932#ifndef CopSTASHPV_set
3933#define CopSTASHPV_set(c,pv) ((c)->cop_stashpv = ((pv) ? savepv(pv) : Nullch))
3934#endif
3935#ifndef CopSTASH
3936#define CopSTASH(c) (CopSTASHPV(c) ? gv_stashpv(CopSTASHPV(c),GV_ADD) : Nullhv)
3937#endif
3938#ifndef CopSTASH_set
3939#define CopSTASH_set(c,hv) CopSTASHPV_set(c, (hv) ? HvNAME(hv) : Nullch)
3940#endif
3941#ifndef CopSTASH_eq
3942#define CopSTASH_eq(c,hv) ((hv) && (CopSTASHPV(c) == HvNAME(hv) \
3943|| (CopSTASHPV(c) && HvNAME(hv) \
3944&& strEQ(CopSTASHPV(c), HvNAME(hv)))))
3945#endif
3946#else
3947#ifndef CopFILEGV
3948#define CopFILEGV(c) ((c)->cop_filegv)
3949#endif
3950#ifndef CopFILEGV_set
3951#define CopFILEGV_set(c,gv) ((c)->cop_filegv = (GV*)SvREFCNT_inc(gv))
3952#endif
3953#ifndef CopFILE_set
3954#define CopFILE_set(c,pv) CopFILEGV_set((c), gv_fetchfile(pv))
3955#endif
3956#ifndef CopFILESV
3957#define CopFILESV(c) (CopFILEGV(c) ? GvSV(CopFILEGV(c)) : Nullsv)
3958#endif
3959#ifndef CopFILEAV
3960#define CopFILEAV(c) (CopFILEGV(c) ? GvAV(CopFILEGV(c)) : Nullav)
3961#endif
3962#ifndef CopFILE
3963#define CopFILE(c) (CopFILESV(c) ? SvPVX(CopFILESV(c)) : Nullch)
3964#endif
3965#ifndef CopSTASH
3966#define CopSTASH(c) ((c)->cop_stash)
3967#endif
3968#ifndef CopSTASH_set
3969#define CopSTASH_set(c,hv) ((c)->cop_stash = (hv))
3970#endif
3971#ifndef CopSTASHPV
3972#define CopSTASHPV(c) (CopSTASH(c) ? HvNAME(CopSTASH(c)) : Nullch)
3973#endif
3974#ifndef CopSTASHPV_set
3975#define CopSTASHPV_set(c,pv) CopSTASH_set((c), gv_stashpv(pv,GV_ADD))
3976#endif
3977#ifndef CopSTASH_eq
3978#define CopSTASH_eq(c,hv) (CopSTASH(c) == (hv))
3979#endif
3980#endif
3981#if (PERL_BCDVERSION >= 0x5006000)
3982#ifndef caller_cx
3983#if defined(NEED_caller_cx) || defined(NEED_caller_cx_GLOBAL)
3984static I32
3985DPPP_dopoptosub_at(const PERL_CONTEXT *cxstk, I32 startingblock)
3986{
3987I32 i;
3988for (i = startingblock; i >= 0; i--) {
3989const PERL_CONTEXT * const cx = &cxstk[i];
3990switch (CxTYPE(cx)) {
3991default:
3992continue;
3993case CXt_EVAL:
3994case CXt_SUB:
3995case CXt_FORMAT:
3996return i;
3997}
3998}
3999return i;
4000}
4001#endif
4002#if defined(NEED_caller_cx)
4003static const PERL_CONTEXT * DPPP_(my_caller_cx)(pTHX_ I32 level, const PERL_CONTEXT * * dbcxp);
4004static
4005#else
4006extern const PERL_CONTEXT * DPPP_(my_caller_cx)(pTHX_ I32 level, const PERL_CONTEXT * * dbcxp);
4007#endif
4008#if defined(NEED_caller_cx) || defined(NEED_caller_cx_GLOBAL)
4009#ifdef caller_cx
4010#undef caller_cx
4011#endif
4012#define caller_cx(a,b) DPPP_(my_caller_cx)(aTHX_ a,b)
4013#define Perl_caller_cx DPPP_(my_caller_cx)
4014const PERL_CONTEXT *
4015DPPP_(my_caller_cx)(pTHX_ I32 level, const PERL_CONTEXT **dbcxp)
4016{
4017I32 cxix = DPPP_dopoptosub_at(cxstack, cxstack_ix);
4018const PERL_CONTEXT *cx;
4019const PERL_CONTEXT *ccstack = cxstack;
4020const PERL_SI *top_si = PL_curstackinfo;
4021for (;;) {
4022while (cxix < 0 && top_si->si_type != PERLSI_MAIN) {
4023top_si = top_si->si_prev;
4024ccstack = top_si->si_cxstack;
4025cxix = DPPP_dopoptosub_at(ccstack, top_si->si_cxix);
4026}
4027if (cxix < 0)
4028return NULL;
4029if (PL_DBsub && GvCV(PL_DBsub) && cxix >= 0 &&
4030ccstack[cxix].blk_sub.cv == GvCV(PL_DBsub))
4031level++;
4032if (!level--)
4033break;
4034cxix = DPPP_dopoptosub_at(ccstack, cxix - 1);
4035}
4036cx = &ccstack[cxix];
4037if (dbcxp) *dbcxp = cx;
4038if (CxTYPE(cx) == CXt_SUB || CxTYPE(cx) == CXt_FORMAT) {
4039const I32 dbcxix = DPPP_dopoptosub_at(ccstack, cxix - 1);
4040if (PL_DBsub && GvCV(PL_DBsub) && dbcxix >= 0 && ccstack[dbcxix].blk_sub.cv == GvCV(PL_DBsub))
4041cx = &ccstack[dbcxix];
4042}
4043return cx;
4044}
4045#endif
4046#endif
4047#endif
4048#ifndef IN_PERL_COMPILETIME
4049#define IN_PERL_COMPILETIME (PL_curcop == &PL_compiling)
4050#endif
4051#ifndef IN_LOCALE_RUNTIME
4052#define IN_LOCALE_RUNTIME (PL_curcop->op_private & HINT_LOCALE)
4053#endif
4054#ifndef IN_LOCALE_COMPILETIME
4055#define IN_LOCALE_COMPILETIME (PL_hints & HINT_LOCALE)
4056#endif
4057#ifndef IN_LOCALE
4058#define IN_LOCALE (IN_PERL_COMPILETIME ? IN_LOCALE_COMPILETIME : IN_LOCALE_RUNTIME)
4059#endif
4060#ifndef IS_NUMBER_IN_UV
4061#define IS_NUMBER_IN_UV 0x01
4062#endif
4063#ifndef IS_NUMBER_GREATER_THAN_UV_MAX
4064#define IS_NUMBER_GREATER_THAN_UV_MAX 0x02
4065#endif
4066#ifndef IS_NUMBER_NOT_INT
4067#define IS_NUMBER_NOT_INT 0x04
4068#endif
4069#ifndef IS_NUMBER_NEG
4070#define IS_NUMBER_NEG 0x08
4071#endif
4072#ifndef IS_NUMBER_INFINITY
4073#define IS_NUMBER_INFINITY 0x10
4074#endif
4075#ifndef IS_NUMBER_NAN
4076#define IS_NUMBER_NAN 0x20
4077#endif
4078#ifndef GROK_NUMERIC_RADIX
4079#define GROK_NUMERIC_RADIX(sp, send) grok_numeric_radix(sp, send)
4080#endif
4081#ifndef PERL_SCAN_GREATER_THAN_UV_MAX
4082#define PERL_SCAN_GREATER_THAN_UV_MAX 0x02
4083#endif
4084#ifndef PERL_SCAN_SILENT_ILLDIGIT
4085#define PERL_SCAN_SILENT_ILLDIGIT 0x04
4086#endif
4087#ifndef PERL_SCAN_ALLOW_UNDERSCORES
4088#define PERL_SCAN_ALLOW_UNDERSCORES 0x01
4089#endif
4090#ifndef PERL_SCAN_DISALLOW_PREFIX
4091#define PERL_SCAN_DISALLOW_PREFIX 0x02
4092#endif
4093#ifndef grok_numeric_radix
4094#if defined(NEED_grok_numeric_radix)
4095static bool DPPP_(my_grok_numeric_radix)(pTHX_ const char * * sp, const char * send);
4096static
4097#else
4098extern bool DPPP_(my_grok_numeric_radix)(pTHX_ const char * * sp, const char * send);
4099#endif
4100#if defined(NEED_grok_numeric_radix) || defined(NEED_grok_numeric_radix_GLOBAL)
4101#ifdef grok_numeric_radix
4102#undef grok_numeric_radix
4103#endif
4104#define grok_numeric_radix(a,b) DPPP_(my_grok_numeric_radix)(aTHX_ a,b)
4105#define Perl_grok_numeric_radix DPPP_(my_grok_numeric_radix)
4106bool
4107DPPP_(my_grok_numeric_radix)(pTHX_ const char **sp, const char *send)
4108{
4109#ifdef USE_LOCALE_NUMERIC
4110#ifdef PL_numeric_radix_sv
4111if (PL_numeric_radix_sv && IN_LOCALE) {
4112STRLEN len;
4113char* radix = SvPV(PL_numeric_radix_sv, len);
4114if (*sp + len <= send && memEQ(*sp, radix, len)) {
4115*sp += len;
4116return TRUE;
4117}
4118}
4119#else
4120#include <locale.h>
4121dTHR;
4122struct lconv *lc = localeconv();
4123char *radix = lc->decimal_point;
4124if (radix && IN_LOCALE) {
4125STRLEN len = strlen(radix);
4126if (*sp + len <= send && memEQ(*sp, radix, len)) {
4127*sp += len;
4128return TRUE;
4129}
4130}
4131#endif
4132#endif
4133if (*sp < send && **sp == '.') {
4134++*sp;
4135return TRUE;
4136}
4137return FALSE;
4138}
4139#endif
4140#endif
4141#ifndef grok_number
4142#if defined(NEED_grok_number)
4143static int DPPP_(my_grok_number)(pTHX_ const char * pv, STRLEN len, UV * valuep);
4144static
4145#else
4146extern int DPPP_(my_grok_number)(pTHX_ const char * pv, STRLEN len, UV * valuep);
4147#endif
4148#if defined(NEED_grok_number) || defined(NEED_grok_number_GLOBAL)
4149#ifdef grok_number
4150#undef grok_number
4151#endif
4152#define grok_number(a,b,c) DPPP_(my_grok_number)(aTHX_ a,b,c)
4153#define Perl_grok_number DPPP_(my_grok_number)
4154int
4155DPPP_(my_grok_number)(pTHX_ const char *pv, STRLEN len, UV *valuep)
4156{
4157const char *s = pv;
4158const char *send = pv + len;
4159const UV max_div_10 = UV_MAX / 10;
4160const char max_mod_10 = UV_MAX % 10;
4161int numtype = 0;
4162int sawinf = 0;
4163int sawnan = 0;
4164while (s < send && isSPACE(*s))
4165s++;
4166if (s == send) {
4167return 0;
4168} else if (*s == '-') {
4169s++;
4170numtype = IS_NUMBER_NEG;
4171}
4172else if (*s == '+')
4173s++;
4174if (s == send)
4175return 0;
4176if (isDIGIT(*s)) {
4177UV value = *s - '0';
4178if (++s < send) {
4179int digit = *s - '0';
4180if (digit >= 0 && digit <= 9) {
4181value = value * 10 + digit;
4182if (++s < send) {
4183digit = *s - '0';
4184if (digit >= 0 && digit <= 9) {
4185value = value * 10 + digit;
4186if (++s < send) {
4187digit = *s - '0';
4188if (digit >= 0 && digit <= 9) {
4189value = value * 10 + digit;
4190if (++s < send) {
4191digit = *s - '0';
4192if (digit >= 0 && digit <= 9) {
4193value = value * 10 + digit;
4194if (++s < send) {
4195digit = *s - '0';
4196if (digit >= 0 && digit <= 9) {
4197value = value * 10 + digit;
4198if (++s < send) {
4199digit = *s - '0';
4200if (digit >= 0 && digit <= 9) {
4201value = value * 10 + digit;
4202if (++s < send) {
4203digit = *s - '0';
4204if (digit >= 0 && digit <= 9) {
4205value = value * 10 + digit;
4206if (++s < send) {
4207digit = *s - '0';
4208if (digit >= 0 && digit <= 9) {
4209value = value * 10 + digit;
4210if (++s < send) {
4211digit = *s - '0';
4212while (digit >= 0 && digit <= 9
4213&& (value < max_div_10
4214|| (value == max_div_10
4215&& digit <= max_mod_10))) {
4216value = value * 10 + digit;
4217if (++s < send)
4218digit = *s - '0';
4219else
4220break;
4221}
4222if (digit >= 0 && digit <= 9
4223&& (s < send)) {
4224do {
4225s++;
4226} while (s < send && isDIGIT(*s));
4227numtype |=
4228IS_NUMBER_GREATER_THAN_UV_MAX;
4229goto skip_value;
4230}
4231}
4232}
4233}
4234}
4235}
4236}
4237}
4238}
4239}
4240}
4241}
4242}
4243}
4244}
4245}
4246}
4247}
4248numtype |= IS_NUMBER_IN_UV;
4249if (valuep)
4250*valuep = value;
4251skip_value:
4252if (GROK_NUMERIC_RADIX(&s, send)) {
4253numtype |= IS_NUMBER_NOT_INT;
4254while (s < send && isDIGIT(*s))
4255s++;
4256}
4257}
4258else if (GROK_NUMERIC_RADIX(&s, send)) {
4259numtype |= IS_NUMBER_NOT_INT | IS_NUMBER_IN_UV;
4260if (s < send && isDIGIT(*s)) {
4261do {
4262s++;
4263} while (s < send && isDIGIT(*s));
4264if (valuep) {
4265*valuep = 0;
4266}
4267}
4268else
4269return 0;
4270} else if (*s == 'I' || *s == 'i') {
4271s++; if (s == send || (*s != 'N' && *s != 'n')) return 0;
4272s++; if (s == send || (*s != 'F' && *s != 'f')) return 0;
4273s++; if (s < send && (*s == 'I' || *s == 'i')) {
4274s++; if (s == send || (*s != 'N' && *s != 'n')) return 0;
4275s++; if (s == send || (*s != 'I' && *s != 'i')) return 0;
4276s++; if (s == send || (*s != 'T' && *s != 't')) return 0;
4277s++; if (s == send || (*s != 'Y' && *s != 'y')) return 0;
4278s++;
4279}
4280sawinf = 1;
4281} else if (*s == 'N' || *s == 'n') {
4282s++; if (s == send || (*s != 'A' && *s != 'a')) return 0;
4283s++; if (s == send || (*s != 'N' && *s != 'n')) return 0;
4284s++;
4285sawnan = 1;
4286} else
4287return 0;
4288if (sawinf) {
4289numtype &= IS_NUMBER_NEG;
4290numtype |= IS_NUMBER_INFINITY | IS_NUMBER_NOT_INT;
4291} else if (sawnan) {
4292numtype &= IS_NUMBER_NEG;
4293numtype |= IS_NUMBER_NAN | IS_NUMBER_NOT_INT;
4294} else if (s < send) {
4295if (*s == 'e' || *s == 'E') {
4296numtype &= IS_NUMBER_NEG;
4297numtype |= IS_NUMBER_NOT_INT;
4298s++;
4299if (s < send && (*s == '-' || *s == '+'))
4300s++;
4301if (s < send && isDIGIT(*s)) {
4302do {
4303s++;
4304} while (s < send && isDIGIT(*s));
4305}
4306else
4307return 0;
4308}
4309}
4310while (s < send && isSPACE(*s))
4311s++;
4312if (s >= send)
4313return numtype;
4314if (len == 10 && memEQ(pv, "0 but true", 10)) {
4315if (valuep)
4316*valuep = 0;
4317return IS_NUMBER_IN_UV;
4318}
4319return 0;
4320}
4321#endif
4322#endif
4323#ifndef grok_bin
4324#if defined(NEED_grok_bin)
4325static UV DPPP_(my_grok_bin)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
4326static
4327#else
4328extern UV DPPP_(my_grok_bin)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
4329#endif
4330#if defined(NEED_grok_bin) || defined(NEED_grok_bin_GLOBAL)
4331#ifdef grok_bin
4332#undef grok_bin
4333#endif
4334#define grok_bin(a,b,c,d) DPPP_(my_grok_bin)(aTHX_ a,b,c,d)
4335#define Perl_grok_bin DPPP_(my_grok_bin)
4336UV
4337DPPP_(my_grok_bin)(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result)
4338{
4339const char *s = start;
4340STRLEN len = *len_p;
4341UV value = 0;
4342NV value_nv = 0;
4343const UV max_div_2 = UV_MAX / 2;
4344bool allow_underscores = *flags & PERL_SCAN_ALLOW_UNDERSCORES;
4345bool overflowed = FALSE;
4346if (!(*flags & PERL_SCAN_DISALLOW_PREFIX)) {
4347if (len >= 1) {
4348if (s[0] == 'b') {
4349s++;
4350len--;
4351}
4352else if (len >= 2 && s[0] == '0' && s[1] == 'b') {
4353s+=2;
4354len-=2;
4355}
4356}
4357}
4358for (; len-- && *s; s++) {
4359char bit = *s;
4360if (bit == '0' || bit == '1') {
4361redo:
4362if (!overflowed) {
4363if (value <= max_div_2) {
4364value = (value << 1) | (bit - '0');
4365continue;
4366}
4367warn("Integer overflow in binary number");
4368overflowed = TRUE;
4369value_nv = (NV) value;
4370}
4371value_nv *= 2.0;
4372value_nv += (NV)(bit - '0');
4373continue;
4374}
4375if (bit == '_' && len && allow_underscores && (bit = s[1])
4376&& (bit == '0' || bit == '1'))
4377{
4378--len;
4379++s;
4380goto redo;
4381}
4382if (!(*flags & PERL_SCAN_SILENT_ILLDIGIT))
4383warn("Illegal binary digit '%c' ignored", *s);
4384break;
4385}
4386if ( ( overflowed && value_nv > 4294967295.0)
4387#if UVSIZE > 4
4388|| (!overflowed && value > 0xffffffff )
4389#endif
4390) {
4391warn("Binary number > 0b11111111111111111111111111111111 non-portable");
4392}
4393*len_p = s - start;
4394if (!overflowed) {
4395*flags = 0;
4396return value;
4397}
4398*flags = PERL_SCAN_GREATER_THAN_UV_MAX;
4399if (result)
4400*result = value_nv;
4401return UV_MAX;
4402}
4403#endif
4404#endif
4405#ifndef grok_hex
4406#if defined(NEED_grok_hex)
4407static UV DPPP_(my_grok_hex)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
4408static
4409#else
4410extern UV DPPP_(my_grok_hex)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
4411#endif
4412#if defined(NEED_grok_hex) || defined(NEED_grok_hex_GLOBAL)
4413#ifdef grok_hex
4414#undef grok_hex
4415#endif
4416#define grok_hex(a,b,c,d) DPPP_(my_grok_hex)(aTHX_ a,b,c,d)
4417#define Perl_grok_hex DPPP_(my_grok_hex)
4418UV
4419DPPP_(my_grok_hex)(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result)
4420{
4421const char *s = start;
4422STRLEN len = *len_p;
4423UV value = 0;
4424NV value_nv = 0;
4425const UV max_div_16 = UV_MAX / 16;
4426bool allow_underscores = *flags & PERL_SCAN_ALLOW_UNDERSCORES;
4427bool overflowed = FALSE;
4428const char *xdigit;
4429if (!(*flags & PERL_SCAN_DISALLOW_PREFIX)) {
4430if (len >= 1) {
4431if (s[0] == 'x') {
4432s++;
4433len--;
4434}
4435else if (len >= 2 && s[0] == '0' && s[1] == 'x') {
4436s+=2;
4437len-=2;
4438}
4439}
4440}
4441for (; len-- && *s; s++) {
4442xdigit = strchr((char *) PL_hexdigit, *s);
4443if (xdigit) {
4444redo:
4445if (!overflowed) {
4446if (value <= max_div_16) {
4447value = (value << 4) | ((xdigit - PL_hexdigit) & 15);
4448continue;
4449}
4450warn("Integer overflow in hexadecimal number");
4451overflowed = TRUE;
4452value_nv = (NV) value;
4453}
4454value_nv *= 16.0;
4455value_nv += (NV)((xdigit - PL_hexdigit) & 15);
4456continue;
4457}
4458if (*s == '_' && len && allow_underscores && s[1]
4459&& (xdigit = strchr((char *) PL_hexdigit, s[1])))
4460{
4461--len;
4462++s;
4463goto redo;
4464}
4465if (!(*flags & PERL_SCAN_SILENT_ILLDIGIT))
4466warn("Illegal hexadecimal digit '%c' ignored", *s);
4467break;
4468}
4469if ( ( overflowed && value_nv > 4294967295.0)
4470#if UVSIZE > 4
4471|| (!overflowed && value > 0xffffffff )
4472#endif
4473) {
4474warn("Hexadecimal number > 0xffffffff non-portable");
4475}
4476*len_p = s - start;
4477if (!overflowed) {
4478*flags = 0;
4479return value;
4480}
4481*flags = PERL_SCAN_GREATER_THAN_UV_MAX;
4482if (result)
4483*result = value_nv;
4484return UV_MAX;
4485}
4486#endif
4487#endif
4488#ifndef grok_oct
4489#if defined(NEED_grok_oct)
4490static UV DPPP_(my_grok_oct)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
4491static
4492#else
4493extern UV DPPP_(my_grok_oct)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
4494#endif
4495#if defined(NEED_grok_oct) || defined(NEED_grok_oct_GLOBAL)
4496#ifdef grok_oct
4497#undef grok_oct
4498#endif
4499#define grok_oct(a,b,c,d) DPPP_(my_grok_oct)(aTHX_ a,b,c,d)
4500#define Perl_grok_oct DPPP_(my_grok_oct)
4501UV
4502DPPP_(my_grok_oct)(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result)
4503{
4504const char *s = start;
4505STRLEN len = *len_p;
4506UV value = 0;
4507NV value_nv = 0;
4508const UV max_div_8 = UV_MAX / 8;
4509bool allow_underscores = *flags & PERL_SCAN_ALLOW_UNDERSCORES;
4510bool overflowed = FALSE;
4511for (; len-- && *s; s++) {
4512int digit = *s - '0';
4513if (digit >= 0 && digit <= 7) {
4514redo:
4515if (!overflowed) {
4516if (value <= max_div_8) {
4517value = (value << 3) | digit;
4518continue;
4519}
4520warn("Integer overflow in octal number");
4521overflowed = TRUE;
4522value_nv = (NV) value;
4523}
4524value_nv *= 8.0;
4525value_nv += (NV)digit;
4526continue;
4527}
4528if (digit == ('_' - '0') && len && allow_underscores
4529&& (digit = s[1] - '0') && (digit >= 0 && digit <= 7))
4530{
4531--len;
4532++s;
4533goto redo;
4534}
4535if (digit == 8 || digit == 9) {
4536if (!(*flags & PERL_SCAN_SILENT_ILLDIGIT))
4537warn("Illegal octal digit '%c' ignored", *s);
4538}
4539break;
4540}
4541if ( ( overflowed && value_nv > 4294967295.0)
4542#if UVSIZE > 4
4543|| (!overflowed && value > 0xffffffff )
4544#endif
4545) {
4546warn("Octal number > 037777777777 non-portable");
4547}
4548*len_p = s - start;
4549if (!overflowed) {
4550*flags = 0;
4551return value;
4552}
4553*flags = PERL_SCAN_GREATER_THAN_UV_MAX;
4554if (result)
4555*result = value_nv;
4556return UV_MAX;
4557}
4558#endif
4559#endif
4560#if !defined(my_snprintf)
4561#if defined(NEED_my_snprintf)
4562static int DPPP_(my_my_snprintf)(char * buffer, const Size_t len, const char * format, ...);
4563static
4564#else
4565extern int DPPP_(my_my_snprintf)(char * buffer, const Size_t len, const char * format, ...);
4566#endif
4567#if defined(NEED_my_snprintf) || defined(NEED_my_snprintf_GLOBAL)
4568#define my_snprintf DPPP_(my_my_snprintf)
4569#define Perl_my_snprintf DPPP_(my_my_snprintf)
4570int
4571DPPP_(my_my_snprintf)(char *buffer, const Size_t len, const char *format, ...)
4572{
4573dTHX;
4574int retval;
4575va_list ap;
4576va_start(ap, format);
4577#ifdef HAS_VSNPRINTF
4578retval = vsnprintf(buffer, len, format, ap);
4579#else
4580retval = vsprintf(buffer, format, ap);
4581#endif
4582va_end(ap);
4583if (retval < 0 || (len > 0 && (Size_t)retval >= len))
4584Perl_croak(aTHX_ "panic: my_snprintf buffer overflow");
4585return retval;
4586}
4587#endif
4588#endif
4589#if !defined(my_sprintf)
4590#if defined(NEED_my_sprintf)
4591static int DPPP_(my_my_sprintf)(char * buffer, const char * pat, ...);
4592static
4593#else
4594extern int DPPP_(my_my_sprintf)(char * buffer, const char * pat, ...);
4595#endif
4596#if defined(NEED_my_sprintf) || defined(NEED_my_sprintf_GLOBAL)
4597#define my_sprintf DPPP_(my_my_sprintf)
4598int
4599DPPP_(my_my_sprintf)(char *buffer, const char* pat, ...)
4600{
4601va_list args;
4602va_start(args, pat);
4603vsprintf(buffer, pat, args);
4604va_end(args);
4605return strlen(buffer);
4606}
4607#endif
4608#endif
4609#ifdef NO_XSLOCKS
4610#ifdef dJMPENV
4611#define dXCPT dJMPENV; int rEtV = 0
4612#define XCPT_TRY_START JMPENV_PUSH(rEtV); if (rEtV == 0)
4613#define XCPT_TRY_END JMPENV_POP;
4614#define XCPT_CATCH if (rEtV != 0)
4615#define XCPT_RETHROW JMPENV_JUMP(rEtV)
4616#else
4617#define dXCPT Sigjmp_buf oldTOP; int rEtV = 0
4618#define XCPT_TRY_START Copy(top_env, oldTOP, 1, Sigjmp_buf); rEtV = Sigsetjmp(top_env, 1); if (rEtV == 0)
4619#define XCPT_TRY_END Copy(oldTOP, top_env, 1, Sigjmp_buf);
4620#define XCPT_CATCH if (rEtV != 0)
4621#define XCPT_RETHROW Siglongjmp(top_env, rEtV)
4622#endif
4623#endif
4624#if !defined(my_strlcat)
4625#if defined(NEED_my_strlcat)
4626static Size_t DPPP_(my_my_strlcat)(char * dst, const char * src, Size_t size);
4627static
4628#else
4629extern Size_t DPPP_(my_my_strlcat)(char * dst, const char * src, Size_t size);
4630#endif
4631#if defined(NEED_my_strlcat) || defined(NEED_my_strlcat_GLOBAL)
4632#define my_strlcat DPPP_(my_my_strlcat)
4633#define Perl_my_strlcat DPPP_(my_my_strlcat)
4634Size_t
4635DPPP_(my_my_strlcat)(char *dst, const char *src, Size_t size)
4636{
4637Size_t used, length, copy;
4638used = strlen(dst);
4639length = strlen(src);
4640if (size > 0 && used < size - 1) {
4641copy = (length >= size - used) ? size - used - 1 : length;
4642memcpy(dst + used, src, copy);
4643dst[used + copy] = '\0';
4644}
4645return used + length;
4646}
4647#endif
4648#endif
4649#if !defined(my_strlcpy)
4650#if defined(NEED_my_strlcpy)
4651static Size_t DPPP_(my_my_strlcpy)(char * dst, const char * src, Size_t size);
4652static
4653#else
4654extern Size_t DPPP_(my_my_strlcpy)(char * dst, const char * src, Size_t size);
4655#endif
4656#if defined(NEED_my_strlcpy) || defined(NEED_my_strlcpy_GLOBAL)
4657#define my_strlcpy DPPP_(my_my_strlcpy)
4658#define Perl_my_strlcpy DPPP_(my_my_strlcpy)
4659Size_t
4660DPPP_(my_my_strlcpy)(char *dst, const char *src, Size_t size)
4661{
4662Size_t length, copy;
4663length = strlen(src);
4664if (size > 0) {
4665copy = (length >= size) ? size - 1 : length;
4666memcpy(dst, src, copy);
4667dst[copy] = '\0';
4668}
4669return length;
4670}
4671#endif
4672#endif
4673#ifdef SVf_UTF8
4674#ifndef SvUTF8
4675#define SvUTF8(sv) (SvFLAGS(sv) & SVf_UTF8)
4676#endif
4677#endif
4678#if (PERL_BCDVERSION == 0x5019001)
4679#undef UTF8f
4680#endif
4681#ifdef SVf_UTF8
4682#ifndef UTF8f
4683#define UTF8f SVf
4684#endif
4685#ifndef UTF8fARG
4686#define UTF8fARG(u,l,p) newSVpvn_flags((p), (l), ((u) ? SVf_UTF8 : 0) | SVs_TEMP)
4687#endif
4688#endif
4689#define D_PPP_MIN(a,b) (((a) <= (b)) ? (a) : (b))
4690#ifndef UNICODE_REPLACEMENT
4691#define UNICODE_REPLACEMENT 0xFFFD
4692#endif
4693#ifdef UTF8_MAXLEN
4694#ifndef UTF8_MAXBYTES
4695#define UTF8_MAXBYTES UTF8_MAXLEN
4696#endif
4697#endif
4698#ifndef UTF_START_MARK
4699#define UTF_START_MARK(len) \
4700(((len) > 7) ? 0xFF : (0xFF & (0xFE << (7-(len)))))
4701#endif
4702#if (PERL_BCDVERSION < 0x5018000)
4703#undef UTF8_MAXBYTES_CASE
4704#endif
4705#if 'A' == 65
4706#define D_PPP_BYTE_INFO_BITS 6
4707#ifndef UTF8_MAXBYTES_CASE
4708#define UTF8_MAXBYTES_CASE 13
4709#endif
4710#else
4711#define D_PPP_BYTE_INFO_BITS 5
4712#ifndef UTF8_MAXBYTES_CASE
4713#define UTF8_MAXBYTES_CASE 15
4714#endif
4715#endif
4716#ifndef UTF_ACCUMULATION_SHIFT
4717#define UTF_ACCUMULATION_SHIFT D_PPP_BYTE_INFO_BITS
4718#endif
4719#ifdef NATIVE_TO_UTF
4720#ifndef NATIVE_UTF8_TO_I8
4721#define NATIVE_UTF8_TO_I8(c) NATIVE_TO_UTF(c)
4722#endif
4723#else
4724#ifndef NATIVE_UTF8_TO_I8
4725#define NATIVE_UTF8_TO_I8(c) (c)
4726#endif
4727#endif
4728#ifdef UTF_TO_NATIVE
4729#ifndef I8_TO_NATIVE_UTF8
4730#define I8_TO_NATIVE_UTF8(c) UTF_TO_NATIVE(c)
4731#endif
4732#else
4733#ifndef I8_TO_NATIVE_UTF8
4734#define I8_TO_NATIVE_UTF8(c) (c)
4735#endif
4736#endif
4737#ifndef UTF_START_MASK
4738#define UTF_START_MASK(len) \
4739(((len) >= 7) ? 0x00 : (0x1F >> ((len)-2)))
4740#endif
4741#ifndef UTF_IS_CONTINUATION_MASK
4742#define UTF_IS_CONTINUATION_MASK \
4743((U8) (0xFF << UTF_ACCUMULATION_SHIFT))
4744#endif
4745#ifndef UTF_CONTINUATION_MARK
4746#define UTF_CONTINUATION_MARK \
4747(UTF_IS_CONTINUATION_MASK & 0xB0)
4748#endif
4749#ifndef UTF_MIN_START_BYTE
4750#define UTF_MIN_START_BYTE \
4751((UTF_CONTINUATION_MARK >> UTF_ACCUMULATION_SHIFT) | UTF_START_MARK(2))
4752#endif
4753#ifndef UTF_MIN_ABOVE_LATIN1_BYTE
4754#define UTF_MIN_ABOVE_LATIN1_BYTE \
4755((0x100 >> UTF_ACCUMULATION_SHIFT) | UTF_START_MARK(2))
4756#endif
4757#if (PERL_BCDVERSION < 0x5007000)
4758#undef UTF8_IS_DOWNGRADEABLE_START
4759#endif
4760#ifndef UTF8_IS_DOWNGRADEABLE_START
4761#define UTF8_IS_DOWNGRADEABLE_START(c) \
4762inRANGE(NATIVE_UTF8_TO_I8(c), \
4763UTF_MIN_START_BYTE, UTF_MIN_ABOVE_LATIN1_BYTE - 1)
4764#endif
4765#ifndef UTF_CONTINUATION_MASK
4766#define UTF_CONTINUATION_MASK \
4767((U8) ((1U << UTF_ACCUMULATION_SHIFT) - 1))
4768#endif
4769#ifndef UTF8_ACCUMULATE
4770#define UTF8_ACCUMULATE(base, added) \
4771(((base) << UTF_ACCUMULATION_SHIFT) \
4772| ((NATIVE_UTF8_TO_I8(added)) \
4773& UTF_CONTINUATION_MASK))
4774#endif
4775#ifndef UTF8_ALLOW_ANYUV
4776#define UTF8_ALLOW_ANYUV 0
4777#endif
4778#ifndef UTF8_ALLOW_EMPTY
4779#define UTF8_ALLOW_EMPTY 0x0001
4780#endif
4781#ifndef UTF8_ALLOW_CONTINUATION
4782#define UTF8_ALLOW_CONTINUATION 0x0002
4783#endif
4784#ifndef UTF8_ALLOW_NON_CONTINUATION
4785#define UTF8_ALLOW_NON_CONTINUATION 0x0004
4786#endif
4787#ifndef UTF8_ALLOW_SHORT
4788#define UTF8_ALLOW_SHORT 0x0008
4789#endif
4790#ifndef UTF8_ALLOW_LONG
4791#define UTF8_ALLOW_LONG 0x0010
4792#endif
4793#ifndef UTF8_ALLOW_OVERFLOW
4794#define UTF8_ALLOW_OVERFLOW 0x0080
4795#endif
4796#ifndef UTF8_ALLOW_ANY
4797#define UTF8_ALLOW_ANY ( UTF8_ALLOW_CONTINUATION \
4798|UTF8_ALLOW_NON_CONTINUATION \
4799|UTF8_ALLOW_SHORT \
4800|UTF8_ALLOW_LONG \
4801|UTF8_ALLOW_OVERFLOW)
4802#endif
4803#if defined UTF8SKIP
4804#undef UTF8_SAFE_SKIP
4805#undef UTF8_CHK_SKIP
4806#ifndef UTF8_SAFE_SKIP
4807#define UTF8_SAFE_SKIP(s, e) ( \
4808((((e) - (s)) <= 0) \
4809? 0 \
4810: D_PPP_MIN(((e) - (s)), UTF8SKIP(s))))
4811#endif
4812#ifndef UTF8_CHK_SKIP
4813#define UTF8_CHK_SKIP(s) \
4814(s[0] == '\0' ? 1 : ((U8) D_PPP_MIN(my_strnlen((char *) (s), UTF8SKIP(s)), \
4815UTF8SKIP(s))))
4816#endif
4817#ifndef UTF8_SKIP
4818#define UTF8_SKIP(s) UTF8SKIP(s)
4819#endif
4820#endif
4821#if 'A' == 65
4822#ifndef UTF8_IS_INVARIANT
4823#define UTF8_IS_INVARIANT(c) isASCII(c)
4824#endif
4825#else
4826#ifndef UTF8_IS_INVARIANT
4827#define UTF8_IS_INVARIANT(c) (isASCII(c) || isCNTRL_L1(c))
4828#endif
4829#endif
4830#ifndef UVCHR_IS_INVARIANT
4831#define UVCHR_IS_INVARIANT(c) UTF8_IS_INVARIANT(c)
4832#endif
4833#ifdef UVCHR_IS_INVARIANT
4834#if 'A' != 65 || UVSIZE < 8
4835#define D_PPP_UVCHR_SKIP_UPPER(c) 7
4836#else
4837#define D_PPP_UVCHR_SKIP_UPPER(c) \
4838(((WIDEST_UTYPE) (c)) < \
4839(((WIDEST_UTYPE) 1) << (6 * D_PPP_BYTE_INFO_BITS)) ? 7 : 13)
4840#endif
4841#ifndef UVCHR_SKIP
4842#define UVCHR_SKIP(c) \
4843UVCHR_IS_INVARIANT(c) ? 1 : \
4844(WIDEST_UTYPE) (c) < (32 * (1U << ( D_PPP_BYTE_INFO_BITS))) ? 2 : \
4845(WIDEST_UTYPE) (c) < (16 * (1U << (2 * D_PPP_BYTE_INFO_BITS))) ? 3 : \
4846(WIDEST_UTYPE) (c) < ( 8 * (1U << (3 * D_PPP_BYTE_INFO_BITS))) ? 4 : \
4847(WIDEST_UTYPE) (c) < ( 4 * (1U << (4 * D_PPP_BYTE_INFO_BITS))) ? 5 : \
4848(WIDEST_UTYPE) (c) < ( 2 * (1U << (5 * D_PPP_BYTE_INFO_BITS))) ? 6 : \
4849D_PPP_UVCHR_SKIP_UPPER(c)
4850#endif
4851#endif
4852#ifdef is_ascii_string
4853#ifndef is_invariant_string
4854#define is_invariant_string(s,l) is_ascii_string(s,l)
4855#endif
4856#ifndef is_utf8_invariant_string
4857#define is_utf8_invariant_string(s,l) is_ascii_string(s,l)
4858#endif
4859#endif
4860#ifdef ibcmp_utf8
4861#ifndef foldEQ_utf8
4862#define foldEQ_utf8(s1,pe1,l1,u1,s2,pe2,l2,u2) \
4863cBOOL(! ibcmp_utf8(s1,pe1,l1,u1,s2,pe2,l2,u2))
4864#endif
4865#endif
4866#if defined(is_utf8_string) && defined(UTF8SKIP)
4867#ifndef isUTF8_CHAR
4868#define isUTF8_CHAR(s, e) ( \
4869(e) <= (s) || ! is_utf8_string(s, UTF8_SAFE_SKIP(s, e)) \
4870? 0 \
4871: UTF8SKIP(s))
4872#endif
4873#endif
4874#if 'A' == 65
4875#ifndef BOM_UTF8
4876#define BOM_UTF8 "\xEF\xBB\xBF"
4877#endif
4878#ifndef REPLACEMENT_CHARACTER_UTF8
4879#define REPLACEMENT_CHARACTER_UTF8 "\xEF\xBF\xBD"
4880#endif
4881#elif '^' == 95
4882#ifndef BOM_UTF8
4883#define BOM_UTF8 "\xDD\x73\x66\x73"
4884#endif
4885#ifndef REPLACEMENT_CHARACTER_UTF8
4886#define REPLACEMENT_CHARACTER_UTF8 "\xDD\x73\x73\x71"
4887#endif
4888#elif '^' == 176
4889#ifndef BOM_UTF8
4890#define BOM_UTF8 "\xDD\x72\x65\x72"
4891#endif
4892#ifndef REPLACEMENT_CHARACTER_UTF8
4893#define REPLACEMENT_CHARACTER_UTF8 "\xDD\x72\x72\x70"
4894#endif
4895#else
4896#error Unknown character set
4897#endif
4898#if (PERL_BCDVERSION < 0x5035010)
4899#undef utf8_to_uvchr_buf
4900#endif
4901#if (PERL_BCDVERSION >= 0x5006001) && ! defined(utf8_to_uvchr_buf)
4902#if defined(utf8n_to_uvchr) || defined(utf8_to_uvchr) || defined(utf8_to_uv)
4903#if defined(utf8n_to_uvchr)
4904#define D_PPP_utf8_to_uvchr_buf_callee utf8n_to_uvchr
4905#elif \
4906defined(utf8_to_uv) && defined(utf8_to_uv_simple)
4907#define D_PPP_utf8_to_uvchr_buf_callee utf8_to_uv
4908#elif defined(utf8_to_uvchr)
4909#define D_PPP_utf8_to_uvchr_buf_callee(s, curlen, retlen, flags) \
4910utf8_to_uvchr((U8 *)(s), (retlen))
4911#else
4912#define D_PPP_utf8_to_uvchr_buf_callee(s, curlen, retlen, flags) \
4913utf8_to_uv((U8 *)(s), (retlen))
4914#endif
4915#endif
4916#if defined(NEED_utf8_to_uvchr_buf)
4917static UV DPPP_(my_utf8_to_uvchr_buf)(pTHX_ const U8 * s, const U8 * send, STRLEN * retlen);
4918static
4919#else
4920extern UV DPPP_(my_utf8_to_uvchr_buf)(pTHX_ const U8 * s, const U8 * send, STRLEN * retlen);
4921#endif
4922#if defined(NEED_utf8_to_uvchr_buf) || defined(NEED_utf8_to_uvchr_buf_GLOBAL)
4923#ifdef utf8_to_uvchr_buf
4924#undef utf8_to_uvchr_buf
4925#endif
4926#define utf8_to_uvchr_buf(a,b,c) DPPP_(my_utf8_to_uvchr_buf)(aTHX_ a,b,c)
4927#define Perl_utf8_to_uvchr_buf DPPP_(my_utf8_to_uvchr_buf)
4928UV
4929DPPP_(my_utf8_to_uvchr_buf)(pTHX_ const U8 *s, const U8 *send, STRLEN *retlen)
4930{
4931#if (PERL_BCDVERSION >= 0x5031004)
4932#if (PERL_BCDVERSION != 0x5035009)
4933if (send <= s) s = send = (U8 *) "?";
4934return Perl_utf8_to_uvchr_buf_helper(aTHX_ s, send, retlen);
4935#else
4936if (send > s) return Perl_utf8_to_uvchr_buf_helper(aTHX_ s, send, retlen);
4937if (! ckWARN_d(WARN_UTF8)) {
4938if (retlen) *retlen = 0;
4939return UNICODE_REPLACEMENT;
4940}
4941else {
4942s = send = (U8 *) "?";
4943(void) Perl__utf8n_to_uvchr_msgs_helper(s, 0, NULL, 0, NULL, NULL);
4944if (retlen) *retlen = (STRLEN) -1;
4945return 0;
4946}
4947#endif
4948#else
4949UV ret;
4950STRLEN curlen;
4951bool overflows = 0;
4952const U8 *cur_s = s;
4953const bool do_warnings = ckWARN_d(WARN_UTF8);
4954#if (PERL_BCDVERSION < 0x5026000) && ! defined(EBCDIC)
4955STRLEN overflow_length = 0;
4956#endif
4957if (send > s) {
4958curlen = send - s;
4959}
4960else {
4961assert(0);
4962curlen = 0;
4963if (! do_warnings) {
4964if (retlen) *retlen = 0;
4965return UNICODE_REPLACEMENT;
4966}
4967}
4968#if (PERL_BCDVERSION < 0x5026000) && ! defined(EBCDIC)
4969if (curlen > 0 && UNLIKELY(*s >= 0xFE)) {
4970if (sizeof(ret) < 8) {
4971overflows = 1;
4972overflow_length = (*s == 0xFE) ? 7 : 13;
4973}
4974else {
4975const U8 highest[] =
4976"\xFF\x80\x87\xBF\xBF\xBF\xBF\xBF\xBF\xBF\xBF\xBF\xBF";
4977const U8 *cur_h = highest;
4978for (cur_s = s; cur_s < send; cur_s++, cur_h++) {
4979if (UNLIKELY(*cur_s == *cur_h)) {
4980continue;
4981}
4982overflows = *cur_s > *cur_h;
4983break;
4984}
4985overflow_length = 13;
4986}
4987}
4988if (UNLIKELY(overflows)) {
4989ret = 0;
4990if (! do_warnings && retlen) {
4991*retlen = overflow_length;
4992}
4993}
4994else
4995#endif
4996ret = D_PPP_utf8_to_uvchr_buf_callee(
4997(U8 *)
4998s, curlen, retlen, (UTF8_ALLOW_ANYUV
4999& ~(UTF8_ALLOW_LONG|UTF8_ALLOW_EMPTY)));
5000#if (PERL_BCDVERSION >= 0x5026000) && (PERL_BCDVERSION < 0x5028000)
5001if (UNLIKELY(ret > IV_MAX)) {
5002overflows = 1;
5003}
5004#endif
5005if (UNLIKELY(overflows)) {
5006if (! do_warnings) {
5007if (retlen) {
5008*retlen = D_PPP_MIN(*retlen, UTF8SKIP(s));
5009*retlen = D_PPP_MIN(*retlen, curlen);
5010}
5011return UNICODE_REPLACEMENT;
5012}
5013else {
5014Perl_warner(aTHX_ packWARN(WARN_UTF8),
5015"Malformed UTF-8 character (overflow at 0x%" UVxf
5016", byte 0x%02x, after start byte 0x%02x)",
5017ret, *cur_s, *s);
5018if (retlen) {
5019*retlen = (STRLEN) -1;
5020}
5021return 0;
5022}
5023}
5024if (UNLIKELY(ret == 0 && (curlen == 0 || *s != '\0'))) {
5025if (do_warnings) {
5026if (retlen) {
5027*retlen = (STRLEN) -1;
5028}
5029}
5030else {
5031ret = D_PPP_utf8_to_uvchr_buf_callee(
5032(U8 *)
5033s, curlen, retlen, UTF8_ALLOW_ANY);
5034ret = UNICODE_REPLACEMENT;
5035#if (PERL_BCDVERSION < 0x5016000)
5036if (retlen && (IV) *retlen >= 0) {
5037unsigned int i = 1;
5038*retlen = D_PPP_MIN(*retlen, curlen);
5039*retlen = D_PPP_MIN(*retlen, UTF8SKIP(s));
5040do {
5041#ifdef UTF8_IS_CONTINUATION
5042if (! UTF8_IS_CONTINUATION(s[i]))
5043#else
5044if (s[i] < 0x80 || s[i] > 0xBF)
5045#endif
5046{
5047*retlen = i;
5048break;
5049}
5050} while (++i < *retlen);
5051}
5052#endif
5053}
5054}
5055return ret;
5056#endif
5057}
5058#endif
5059#endif
5060#if defined(UTF8SKIP) && defined(utf8_to_uvchr_buf)
5061#undef utf8_to_uvchr
5062#ifndef utf8_to_uvchr
5063#define utf8_to_uvchr(s, lp) \
5064((*(s) == '\0') \
5065? utf8_to_uvchr_buf(s,((s)+1), lp) \
5066: utf8_to_uvchr_buf(s, (s) + UTF8_CHK_SKIP(s), (lp)))
5067#endif
5068#endif
5069#ifdef sv_len_utf8
5070#if (PERL_BCDVERSION >= 0x5017005)
5071#ifndef sv_len_utf8_nomg
5072#if defined(PERL_USE_GCC_BRACE_GROUPS)
5073#define sv_len_utf8_nomg(sv) \
5074({ \
5075SV *sv_ = (sv); \
5076sv_len_utf8(!SvGMAGICAL(sv_) \
5077? sv_ \
5078: sv_mortalcopy_flags(sv_, SV_NOSTEAL)); \
5079})
5080#else
5081PERL_STATIC_INLINE STRLEN D_PPP_sv_len_utf8_nomg(SV * sv)
5082{
5083dTHX;
5084if (SvGMAGICAL(sv))
5085return sv_len_utf8(sv_mortalcopy_flags(sv,
5086SV_NOSTEAL));
5087else return sv_len_utf8(sv);
5088}
5089#define sv_len_utf8_nomg(sv) D_PPP_sv_len_utf8_nomg(sv)
5090#endif
5091#endif
5092#else
5093#undef sv_len_utf8
5094#if defined(PERL_USE_GCC_BRACE_GROUPS)
5095#define sv_len_utf8_nomg(sv) \
5096({ \
5097SV *sv2 = (sv); \
5098STRLEN len; \
5099if (SvUTF8(sv2)) { \
5100if (SvGMAGICAL(sv2)) \
5101len = Perl_sv_len_utf8(aTHX_ \
5102sv_mortalcopy_flags(sv2, \
5103SV_NOSTEAL));\
5104else \
5105len = Perl_sv_len_utf8(aTHX_ sv2); \
5106} \
5107else SvPV_nomg(sv2, len); \
5108len; \
5109})
5110#define sv_len_utf8(sv) ({ SV *_sv1 = (sv); \
5111SvGETMAGIC(_sv1); \
5112sv_len_utf8_nomg(_sv1); \
5113})
5114#else
5115PERL_STATIC_INLINE STRLEN D_PPP_sv_len_utf8_nomg(SV * sv)
5116{
5117dTHX;
5118STRLEN len;
5119if (SvUTF8(sv)) {
5120if (SvGMAGICAL(sv))
5121len = Perl_sv_len_utf8(aTHX_
5122sv_mortalcopy_flags(sv,
5123SV_NOSTEAL));
5124else
5125len = Perl_sv_len_utf8(aTHX_ sv);
5126}
5127else SvPV_nomg(sv, len);
5128return len;
5129}
5130#define sv_len_utf8_nomg(sv) D_PPP_sv_len_utf8_nomg(sv)
5131PERL_STATIC_INLINE STRLEN D_PPP_sv_len_utf8(SV * sv)
5132{
5133dTHX;
5134SvGETMAGIC(sv);
5135return sv_len_utf8_nomg(sv);
5136}
5137#define sv_len_utf8(sv) D_PPP_sv_len_utf8(sv)
5138#endif
5139#endif
5140#endif
5141#ifndef PERL_PV_ESCAPE_QUOTE
5142#define PERL_PV_ESCAPE_QUOTE 0x0001
5143#endif
5144#ifndef PERL_PV_PRETTY_QUOTE
5145#define PERL_PV_PRETTY_QUOTE PERL_PV_ESCAPE_QUOTE
5146#endif
5147#ifndef PERL_PV_PRETTY_ELLIPSES
5148#define PERL_PV_PRETTY_ELLIPSES 0x0002
5149#endif
5150#ifndef PERL_PV_PRETTY_LTGT
5151#define PERL_PV_PRETTY_LTGT 0x0004
5152#endif
5153#ifndef PERL_PV_ESCAPE_FIRSTCHAR
5154#define PERL_PV_ESCAPE_FIRSTCHAR 0x0008
5155#endif
5156#ifndef PERL_PV_ESCAPE_UNI
5157#define PERL_PV_ESCAPE_UNI 0x0100
5158#endif
5159#ifndef PERL_PV_ESCAPE_UNI_DETECT
5160#define PERL_PV_ESCAPE_UNI_DETECT 0x0200
5161#endif
5162#ifndef PERL_PV_ESCAPE_ALL
5163#define PERL_PV_ESCAPE_ALL 0x1000
5164#endif
5165#ifndef PERL_PV_ESCAPE_NOBACKSLASH
5166#define PERL_PV_ESCAPE_NOBACKSLASH 0x2000
5167#endif
5168#ifndef PERL_PV_ESCAPE_NOCLEAR
5169#define PERL_PV_ESCAPE_NOCLEAR 0x4000
5170#endif
5171#ifndef PERL_PV_ESCAPE_RE
5172#define PERL_PV_ESCAPE_RE 0x8000
5173#endif
5174#ifndef PERL_PV_PRETTY_NOCLEAR
5175#define PERL_PV_PRETTY_NOCLEAR PERL_PV_ESCAPE_NOCLEAR
5176#endif
5177#ifndef PERL_PV_PRETTY_DUMP
5178#define PERL_PV_PRETTY_DUMP PERL_PV_PRETTY_ELLIPSES|PERL_PV_PRETTY_QUOTE
5179#endif
5180#ifndef PERL_PV_PRETTY_REGPROP
5181#define PERL_PV_PRETTY_REGPROP PERL_PV_PRETTY_ELLIPSES|PERL_PV_PRETTY_LTGT|PERL_PV_ESCAPE_RE
5182#endif
5183#ifndef pv_escape
5184#if defined(NEED_pv_escape)
5185static char * DPPP_(my_pv_escape)(pTHX_ SV * dsv, char const * const str, const STRLEN count, const STRLEN max, STRLEN * const escaped, const U32 flags);
5186static
5187#else
5188extern char * DPPP_(my_pv_escape)(pTHX_ SV * dsv, char const * const str, const STRLEN count, const STRLEN max, STRLEN * const escaped, const U32 flags);
5189#endif
5190#if defined(NEED_pv_escape) || defined(NEED_pv_escape_GLOBAL)
5191#ifdef pv_escape
5192#undef pv_escape
5193#endif
5194#define pv_escape(a,b,c,d,e,f) DPPP_(my_pv_escape)(aTHX_ a,b,c,d,e,f)
5195#define Perl_pv_escape DPPP_(my_pv_escape)
5196char *
5197DPPP_(my_pv_escape)(pTHX_ SV *dsv, char const * const str,
5198const STRLEN count, const STRLEN max,
5199STRLEN * const escaped, const U32 flags)
5200{
5201const char esc = flags & PERL_PV_ESCAPE_RE ? '%' : '\\';
5202const char dq = flags & PERL_PV_ESCAPE_QUOTE ? '"' : esc;
5203char octbuf[32] = "%123456789ABCDF";
5204STRLEN wrote = 0;
5205STRLEN chsize = 0;
5206STRLEN readsize = 1;
5207#if defined(is_utf8_string) && defined(utf8_to_uvchr_buf)
5208bool isuni = flags & PERL_PV_ESCAPE_UNI ? 1 : 0;
5209#endif
5210const char *pv = str;
5211const char * const end = pv + count;
5212octbuf[0] = esc;
5213if (!(flags & PERL_PV_ESCAPE_NOCLEAR))
5214sv_setpvs(dsv, "");
5215#if defined(is_utf8_string) && defined(utf8_to_uvchr_buf)
5216if ((flags & PERL_PV_ESCAPE_UNI_DETECT) && is_utf8_string((U8*)pv, count))
5217isuni = 1;
5218#endif
5219for (; pv < end && (!max || wrote < max) ; pv += readsize) {
5220const UV u =
5221#if defined(is_utf8_string) && defined(utf8_to_uvchr_buf)
5222isuni ? utf8_to_uvchr_buf((U8*)pv, end, &readsize) :
5223#endif
5224(U8)*pv;
5225const U8 c = (U8)u & 0xFF;
5226if (u > 255 || (flags & PERL_PV_ESCAPE_ALL)) {
5227if (flags & PERL_PV_ESCAPE_FIRSTCHAR)
5228chsize = my_snprintf(octbuf, sizeof octbuf,
5229"%" UVxf, u);
5230else
5231chsize = my_snprintf(octbuf, sizeof octbuf,
5232"%cx{%" UVxf "}", esc, u);
5233} else if (flags & PERL_PV_ESCAPE_NOBACKSLASH) {
5234chsize = 1;
5235} else {
5236if (c == dq || c == esc || !isPRINT(c)) {
5237chsize = 2;
5238switch (c) {
5239case '\\' :
5240case '%' : if (c == esc)
5241octbuf[1] = esc;
5242else
5243chsize = 1;
5244break;
5245case '\v' : octbuf[1] = 'v'; break;
5246case '\t' : octbuf[1] = 't'; break;
5247case '\r' : octbuf[1] = 'r'; break;
5248case '\n' : octbuf[1] = 'n'; break;
5249case '\f' : octbuf[1] = 'f'; break;
5250case '"' : if (dq == '"')
5251octbuf[1] = '"';
5252else
5253chsize = 1;
5254break;
5255default: chsize = my_snprintf(octbuf, sizeof octbuf,
5256pv < end && isDIGIT((U8)*(pv+readsize))
5257? "%c%03o" : "%c%o", esc, c);
5258}
5259} else {
5260chsize = 1;
5261}
5262}
5263if (max && wrote + chsize > max) {
5264break;
5265} else if (chsize > 1) {
5266sv_catpvn(dsv, octbuf, chsize);
5267wrote += chsize;
5268} else {
5269char tmp[2];
5270my_snprintf(tmp, sizeof tmp, "%c", c);
5271sv_catpvn(dsv, tmp, 1);
5272wrote++;
5273}
5274if (flags & PERL_PV_ESCAPE_FIRSTCHAR)
5275break;
5276}
5277if (escaped != NULL)
5278*escaped= pv - str;
5279return SvPVX(dsv);
5280}
5281#endif
5282#endif
5283#ifndef pv_pretty
5284#if defined(NEED_pv_pretty)
5285static 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);
5286static
5287#else
5288extern 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);
5289#endif
5290#if defined(NEED_pv_pretty) || defined(NEED_pv_pretty_GLOBAL)
5291#ifdef pv_pretty
5292#undef pv_pretty
5293#endif
5294#define pv_pretty(a,b,c,d,e,f,g) DPPP_(my_pv_pretty)(aTHX_ a,b,c,d,e,f,g)
5295#define Perl_pv_pretty DPPP_(my_pv_pretty)
5296char *
5297DPPP_(my_pv_pretty)(pTHX_ SV *dsv, char const * const str, const STRLEN count,
5298const STRLEN max, char const * const start_color, char const * const end_color,
5299const U32 flags)
5300{
5301const U8 dq = (flags & PERL_PV_PRETTY_QUOTE) ? '"' : '%';
5302STRLEN escaped;
5303if (!(flags & PERL_PV_PRETTY_NOCLEAR))
5304sv_setpvs(dsv, "");
5305if (dq == '"')
5306sv_catpvs(dsv, "\"");
5307else if (flags & PERL_PV_PRETTY_LTGT)
5308sv_catpvs(dsv, "<");
5309if (start_color != NULL)
5310sv_catpv(dsv, D_PPP_CONSTPV_ARG(start_color));
5311pv_escape(dsv, str, count, max, &escaped, flags | PERL_PV_ESCAPE_NOCLEAR);
5312if (end_color != NULL)
5313sv_catpv(dsv, D_PPP_CONSTPV_ARG(end_color));
5314if (dq == '"')
5315sv_catpvs(dsv, "\"");
5316else if (flags & PERL_PV_PRETTY_LTGT)
5317sv_catpvs(dsv, ">");
5318if ((flags & PERL_PV_PRETTY_ELLIPSES) && escaped < count)
5319sv_catpvs(dsv, "...");
5320return SvPVX(dsv);
5321}
5322#endif
5323#endif
5324#ifndef pv_display
5325#if defined(NEED_pv_display)
5326static char * DPPP_(my_pv_display)(pTHX_ SV * dsv, const char * pv, STRLEN cur, STRLEN len, STRLEN pvlim);
5327static
5328#else
5329extern char * DPPP_(my_pv_display)(pTHX_ SV * dsv, const char * pv, STRLEN cur, STRLEN len, STRLEN pvlim);
5330#endif
5331#if defined(NEED_pv_display) || defined(NEED_pv_display_GLOBAL)
5332#ifdef pv_display
5333#undef pv_display
5334#endif
5335#define pv_display(a,b,c,d,e) DPPP_(my_pv_display)(aTHX_ a,b,c,d,e)
5336#define Perl_pv_display DPPP_(my_pv_display)
5337char *
5338DPPP_(my_pv_display)(pTHX_ SV *dsv, const char *pv, STRLEN cur, STRLEN len, STRLEN pvlim)
5339{
5340pv_pretty(dsv, pv, cur, pvlim, NULL, NULL, PERL_PV_PRETTY_DUMP);
5341if (len > cur && pv[cur] == '\0')
5342sv_catpvs(dsv, "\\0");
5343return SvPVX(dsv);
5344}
5345#endif
5346#endif
5347#if PERL_VERSION_LT(5,27,9)
5348#ifndef LC_NUMERIC_LOCK
5349#define LC_NUMERIC_LOCK
5350#endif
5351#ifndef LC_NUMERIC_UNLOCK
5352#define LC_NUMERIC_UNLOCK
5353#endif
5354#if PERL_VERSION_LT(5,19,0)
5355#undef STORE_LC_NUMERIC_SET_STANDARD
5356#undef RESTORE_LC_NUMERIC
5357#undef DECLARATION_FOR_LC_NUMERIC_MANIPULATION
5358#ifdef USE_LOCALE
5359#ifndef DECLARATION_FOR_LC_NUMERIC_MANIPULATION
5360#define DECLARATION_FOR_LC_NUMERIC_MANIPULATION char *LoC_
5361#endif
5362#ifndef STORE_NUMERIC_SET_STANDARD
5363#define STORE_NUMERIC_SET_STANDARD() \
5364LoC_ = savepv(setlocale(LC_NUMERIC, NULL)); \
5365SAVEFREEPV(LoC_); \
5366setlocale(LC_NUMERIC, "C");
5367#endif
5368#ifndef RESTORE_LC_NUMERIC
5369#define RESTORE_LC_NUMERIC() \
5370setlocale(LC_NUMERIC, LoC_);
5371#endif
5372#else
5373#ifndef DECLARATION_FOR_LC_NUMERIC_MANIPULATION
5374#define DECLARATION_FOR_LC_NUMERIC_MANIPULATION
5375#endif
5376#ifndef STORE_LC_NUMERIC_SET_STANDARD
5377#define STORE_LC_NUMERIC_SET_STANDARD()
5378#endif
5379#ifndef RESTORE_LC_NUMERIC
5380#define RESTORE_LC_NUMERIC()
5381#endif
5382#endif
5383#endif
5384#endif
5385#ifndef LOCK_NUMERIC_STANDARD
5386#define LOCK_NUMERIC_STANDARD()
5387#endif
5388#ifndef UNLOCK_NUMERIC_STANDARD
5389#define UNLOCK_NUMERIC_STANDARD()
5390#endif
5391#ifndef LOCK_LC_NUMERIC_STANDARD
5392#define LOCK_LC_NUMERIC_STANDARD LOCK_NUMERIC_STANDARD
5393#endif
5394#ifndef UNLOCK_LC_NUMERIC_STANDARD
5395#define UNLOCK_LC_NUMERIC_STANDARD UNLOCK_NUMERIC_STANDARD
5396#endif
5397#ifndef switch_to_global_locale
5398#define switch_to_global_locale()
5399#endif
5400#ifdef sync_locale
5401#if (PERL_BCDVERSION < 0x5027009)
5402#if (PERL_BCDVERSION >= 0x5021003)
5403#undef sync_locale
5404#define sync_locale() (Perl_sync_locale(aTHX), 1)
5405#elif defined(sync_locale)
5406#undef sync_locale
5407#define sync_locale() (new_ctype(setlocale(LC_CTYPE, NULL)), \
5408new_collate(setlocale(LC_COLLATE, NULL)), \
5409set_numeric_local(), \
5410new_numeric(setlocale(LC_NUMERIC, NULL)), \
54111)
5412#elif defined(new_ctype) && defined(LC_CTYPE)
5413#define sync_locale() (new_ctype(setlocale(LC_CTYPE, NULL)), 1)
5414#endif
5415#endif
5416#endif
5417#ifndef sync_locale
5418#define sync_locale() 1
5419#endif
5420#endif
KviPtrListIterator< T > end(KviPointerList< T > *ptrList)
Definition KviPtrListIterator.h:68
#define u
Definition detector.cpp:86
#define UVxf
Definition ppport.h:2615
NVTYPE NV
Definition ppport.h:960
#define pTHX
Definition ppport.h:164
#define CPERLscope(x)
Definition ppport.h:1120
#define PERL_PV_PRETTY_QUOTE
Definition ppport.h:5145
#define D_PPP_CONSTPV_ARG(x)
Definition ppport.h:3381
#define sv_catpvs(sv, str)
Definition ppport.h:3661
#define PERL_PV_ESCAPE_ALL
Definition ppport.h:5163
OP *CPERLscope Perl_ppaddr_t(pTHX)
Definition ppport.h:1146
#define PERL_PV_PRETTY_DUMP
Definition ppport.h:5178
#define PERL_PV_ESCAPE_UNI
Definition ppport.h:5157
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)
#define D_PPP_PERL_SIGNALS_INIT
Definition ppport.h:488
char *DPPP_() my_pv_display(pTHX_ SV *dsv, const char *pv, STRLEN cur, STRLEN len, STRLEN pvlim)
OP *CPERLscope Perl_check_t(pTHX_ OP *)
Definition ppport.h:1148
#define PL_hints
Definition ppport.h:527
#define PERL_PV_PRETTY_ELLIPSES
Definition ppport.h:5148
#define PERL_PV_ESCAPE_FIRSTCHAR
Definition ppport.h:5154
#define start_subparse(a, b)
Definition ppport.h:593
#define PL_curcop
Definition ppport.h:516
#define PERL_PV_PRETTY_LTGT
Definition ppport.h:5151
#define isDIGIT(c)
Definition ppport.h:1385
#define PERL_PV_PRETTY_NOCLEAR
Definition ppport.h:5175
#define isPRINT(c)
Definition ppport.h:1432
#define PL_sv_no
Definition ppport.h:543
#define PERL_PV_ESCAPE_NOCLEAR
Definition ppport.h:5169
#define PERL_PV_ESCAPE_UNI_DETECT
Definition ppport.h:5160
#define DPPP_(name)
Definition ppport.h:51
static CV *DPPP_() my_newCONSTSUB(HV *stash, const char *name, SV *sv)
Definition ppport.h:620
#define pTHX_
Definition ppport.h:167
#define D_PPP_PL_copline
Definition ppport.h:618
#define sv_setpvs(sv, str)
Definition ppport.h:3664
#define PERL_PV_ESCAPE_NOBACKSLASH
Definition ppport.h:5166
#define PL_curstash
Definition ppport.h:517
#define NVTYPE
Definition ppport.h:958