KVIrc  4.9.2
DeveloperAPIs
ppport.h
Go to the documentation of this file.
1 #if 0
2 <<'SKIP';
3 #endif
4 /*
5 ----------------------------------------------------------------------
6 
7  ppport.h -- Perl/Pollution/Portability Version 3.32
8 
9  Automatically created by Devel::PPPort running under perl 5.022001.
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 
22 SKIP
23 if (@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.32) {
27  die "ppport.h was originally generated with Devel::PPPort 3.32.\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 }
34 print <<END;
35 
36 Sorry, but this is a stripped version of $0.
37 
38 To be able to use its original script and doc functionality,
39 please try to regenerate this file using:
40 
41  $^X $0 --unstrip
42 
43 END
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 #ifndef PERL_REVISION
53 #if !defined(__PATCHLEVEL_H_INCLUDED__) && !(defined(PATCHLEVEL) && defined(SUBVERSION))
54 #define PERL_PATCHLEVEL_H_IMPLICIT
55 #include <patchlevel.h>
56 #endif
57 #if !(defined(PERL_VERSION) || (defined(SUBVERSION) && defined(PATCHLEVEL)))
58 #include <could_not_find_Perl_patchlevel.h>
59 #endif
60 #ifndef PERL_REVISION
61 #define PERL_REVISION (5)
62 #define PERL_VERSION PATCHLEVEL
63 #define PERL_SUBVERSION SUBVERSION
64 #endif
65 #endif
66 #define _dpppDEC2BCD(dec) ((((dec)/100)<<8)|((((dec)%100)/10)<<4)|((dec)%10))
67 #define PERL_BCDVERSION ((_dpppDEC2BCD(PERL_REVISION)<<24)|(_dpppDEC2BCD(PERL_VERSION)<<12)|_dpppDEC2BCD(PERL_SUBVERSION))
68 #if PERL_REVISION != 5
69 #error ppport.h only works with Perl version 5
70 #endif
71 #ifndef dTHR
72 #define dTHR dNOOP
73 #endif
74 #ifndef dTHX
75 #define dTHX dNOOP
76 #endif
77 #ifndef dTHXa
78 #define dTHXa(x) dNOOP
79 #endif
80 #ifndef pTHX
81 #define pTHX void
82 #endif
83 #ifndef pTHX_
84 #define pTHX_
85 #endif
86 #ifndef aTHX
87 #define aTHX
88 #endif
89 #ifndef aTHX_
90 #define aTHX_
91 #endif
92 #if (PERL_BCDVERSION < 0x5006000)
93 #ifdef USE_THREADS
94 #define aTHXR thr
95 #define aTHXR_ thr,
96 #else
97 #define aTHXR
98 #define aTHXR_
99 #endif
100 #define dTHXR dTHR
101 #else
102 #define aTHXR aTHX
103 #define aTHXR_ aTHX_
104 #define dTHXR dTHX
105 #endif
106 #ifndef dTHXoa
107 #define dTHXoa(x) dTHXa(x)
108 #endif
109 #ifdef I_LIMITS
110 #include <limits.h>
111 #endif
112 #ifndef PERL_UCHAR_MIN
113 #define PERL_UCHAR_MIN ((unsigned char)0)
114 #endif
115 #ifndef PERL_UCHAR_MAX
116 #ifdef UCHAR_MAX
117 #define PERL_UCHAR_MAX ((unsigned char)UCHAR_MAX)
118 #else
119 #ifdef MAXUCHAR
120 #define PERL_UCHAR_MAX ((unsigned char)MAXUCHAR)
121 #else
122 #define PERL_UCHAR_MAX ((unsigned char)~(unsigned)0)
123 #endif
124 #endif
125 #endif
126 #ifndef PERL_USHORT_MIN
127 #define PERL_USHORT_MIN ((unsigned short)0)
128 #endif
129 #ifndef PERL_USHORT_MAX
130 #ifdef USHORT_MAX
131 #define PERL_USHORT_MAX ((unsigned short)USHORT_MAX)
132 #else
133 #ifdef MAXUSHORT
134 #define PERL_USHORT_MAX ((unsigned short)MAXUSHORT)
135 #else
136 #ifdef USHRT_MAX
137 #define PERL_USHORT_MAX ((unsigned short)USHRT_MAX)
138 #else
139 #define PERL_USHORT_MAX ((unsigned short)~(unsigned)0)
140 #endif
141 #endif
142 #endif
143 #endif
144 #ifndef PERL_SHORT_MAX
145 #ifdef SHORT_MAX
146 #define PERL_SHORT_MAX ((short)SHORT_MAX)
147 #else
148 #ifdef MAXSHORT
149 #define PERL_SHORT_MAX ((short)MAXSHORT)
150 #else
151 #ifdef SHRT_MAX
152 #define PERL_SHORT_MAX ((short)SHRT_MAX)
153 #else
154 #define PERL_SHORT_MAX ((short) (PERL_USHORT_MAX >> 1))
155 #endif
156 #endif
157 #endif
158 #endif
159 #ifndef PERL_SHORT_MIN
160 #ifdef SHORT_MIN
161 #define PERL_SHORT_MIN ((short)SHORT_MIN)
162 #else
163 #ifdef MINSHORT
164 #define PERL_SHORT_MIN ((short)MINSHORT)
165 #else
166 #ifdef SHRT_MIN
167 #define PERL_SHORT_MIN ((short)SHRT_MIN)
168 #else
169 #define PERL_SHORT_MIN (-PERL_SHORT_MAX - ((3 & -1) == 3))
170 #endif
171 #endif
172 #endif
173 #endif
174 #ifndef PERL_UINT_MAX
175 #ifdef UINT_MAX
176 #define PERL_UINT_MAX ((unsigned int)UINT_MAX)
177 #else
178 #ifdef MAXUINT
179 #define PERL_UINT_MAX ((unsigned int)MAXUINT)
180 #else
181 #define PERL_UINT_MAX (~(unsigned int)0)
182 #endif
183 #endif
184 #endif
185 #ifndef PERL_UINT_MIN
186 #define PERL_UINT_MIN ((unsigned int)0)
187 #endif
188 #ifndef PERL_INT_MAX
189 #ifdef INT_MAX
190 #define PERL_INT_MAX ((int)INT_MAX)
191 #else
192 #ifdef MAXINT
193 #define PERL_INT_MAX ((int)MAXINT)
194 #else
195 #define PERL_INT_MAX ((int)(PERL_UINT_MAX >> 1))
196 #endif
197 #endif
198 #endif
199 #ifndef PERL_INT_MIN
200 #ifdef INT_MIN
201 #define PERL_INT_MIN ((int)INT_MIN)
202 #else
203 #ifdef MININT
204 #define PERL_INT_MIN ((int)MININT)
205 #else
206 #define PERL_INT_MIN (-PERL_INT_MAX - ((3 & -1) == 3))
207 #endif
208 #endif
209 #endif
210 #ifndef PERL_ULONG_MAX
211 #ifdef ULONG_MAX
212 #define PERL_ULONG_MAX ((unsigned long)ULONG_MAX)
213 #else
214 #ifdef MAXULONG
215 #define PERL_ULONG_MAX ((unsigned long)MAXULONG)
216 #else
217 #define PERL_ULONG_MAX (~(unsigned long)0)
218 #endif
219 #endif
220 #endif
221 #ifndef PERL_ULONG_MIN
222 #define PERL_ULONG_MIN ((unsigned long)0L)
223 #endif
224 #ifndef PERL_LONG_MAX
225 #ifdef LONG_MAX
226 #define PERL_LONG_MAX ((long)LONG_MAX)
227 #else
228 #ifdef MAXLONG
229 #define PERL_LONG_MAX ((long)MAXLONG)
230 #else
231 #define PERL_LONG_MAX ((long) (PERL_ULONG_MAX >> 1))
232 #endif
233 #endif
234 #endif
235 #ifndef PERL_LONG_MIN
236 #ifdef LONG_MIN
237 #define PERL_LONG_MIN ((long)LONG_MIN)
238 #else
239 #ifdef MINLONG
240 #define PERL_LONG_MIN ((long)MINLONG)
241 #else
242 #define PERL_LONG_MIN (-PERL_LONG_MAX - ((3 & -1) == 3))
243 #endif
244 #endif
245 #endif
246 #if defined(HAS_QUAD) && (defined(convex) || defined(uts))
247 #ifndef PERL_UQUAD_MAX
248 #ifdef ULONGLONG_MAX
249 #define PERL_UQUAD_MAX ((unsigned long long)ULONGLONG_MAX)
250 #else
251 #ifdef MAXULONGLONG
252 #define PERL_UQUAD_MAX ((unsigned long long)MAXULONGLONG)
253 #else
254 #define PERL_UQUAD_MAX (~(unsigned long long)0)
255 #endif
256 #endif
257 #endif
258 #ifndef PERL_UQUAD_MIN
259 #define PERL_UQUAD_MIN ((unsigned long long)0L)
260 #endif
261 #ifndef PERL_QUAD_MAX
262 #ifdef LONGLONG_MAX
263 #define PERL_QUAD_MAX ((long long)LONGLONG_MAX)
264 #else
265 #ifdef MAXLONGLONG
266 #define PERL_QUAD_MAX ((long long)MAXLONGLONG)
267 #else
268 #define PERL_QUAD_MAX ((long long) (PERL_UQUAD_MAX >> 1))
269 #endif
270 #endif
271 #endif
272 #ifndef PERL_QUAD_MIN
273 #ifdef LONGLONG_MIN
274 #define PERL_QUAD_MIN ((long long)LONGLONG_MIN)
275 #else
276 #ifdef MINLONGLONG
277 #define PERL_QUAD_MIN ((long long)MINLONGLONG)
278 #else
279 #define PERL_QUAD_MIN (-PERL_QUAD_MAX - ((3 & -1) == 3))
280 #endif
281 #endif
282 #endif
283 #endif
284 #ifdef HAS_QUAD
285 #ifdef cray
286 #ifndef IVTYPE
287 #define IVTYPE int
288 #endif
289 #ifndef IV_MIN
290 #define IV_MIN PERL_INT_MIN
291 #endif
292 #ifndef IV_MAX
293 #define IV_MAX PERL_INT_MAX
294 #endif
295 #ifndef UV_MIN
296 #define UV_MIN PERL_UINT_MIN
297 #endif
298 #ifndef UV_MAX
299 #define UV_MAX PERL_UINT_MAX
300 #endif
301 #ifdef INTSIZE
302 #ifndef IVSIZE
303 #define IVSIZE INTSIZE
304 #endif
305 #endif
306 #else
307 #if defined(convex) || defined(uts)
308 #ifndef IVTYPE
309 #define IVTYPE long long
310 #endif
311 #ifndef IV_MIN
312 #define IV_MIN PERL_QUAD_MIN
313 #endif
314 #ifndef IV_MAX
315 #define IV_MAX PERL_QUAD_MAX
316 #endif
317 #ifndef UV_MIN
318 #define UV_MIN PERL_UQUAD_MIN
319 #endif
320 #ifndef UV_MAX
321 #define UV_MAX PERL_UQUAD_MAX
322 #endif
323 #ifdef LONGLONGSIZE
324 #ifndef IVSIZE
325 #define IVSIZE LONGLONGSIZE
326 #endif
327 #endif
328 #else
329 #ifndef IVTYPE
330 #define IVTYPE long
331 #endif
332 #ifndef IV_MIN
333 #define IV_MIN PERL_LONG_MIN
334 #endif
335 #ifndef IV_MAX
336 #define IV_MAX PERL_LONG_MAX
337 #endif
338 #ifndef UV_MIN
339 #define UV_MIN PERL_ULONG_MIN
340 #endif
341 #ifndef UV_MAX
342 #define UV_MAX PERL_ULONG_MAX
343 #endif
344 #ifdef LONGSIZE
345 #ifndef IVSIZE
346 #define IVSIZE LONGSIZE
347 #endif
348 #endif
349 #endif
350 #endif
351 #ifndef IVSIZE
352 #define IVSIZE 8
353 #endif
354 #ifndef LONGSIZE
355 #define LONGSIZE 8
356 #endif
357 #ifndef PERL_QUAD_MIN
358 #define PERL_QUAD_MIN IV_MIN
359 #endif
360 #ifndef PERL_QUAD_MAX
361 #define PERL_QUAD_MAX IV_MAX
362 #endif
363 #ifndef PERL_UQUAD_MIN
364 #define PERL_UQUAD_MIN UV_MIN
365 #endif
366 #ifndef PERL_UQUAD_MAX
367 #define PERL_UQUAD_MAX UV_MAX
368 #endif
369 #else
370 #ifndef IVTYPE
371 #define IVTYPE long
372 #endif
373 #ifndef LONGSIZE
374 #define LONGSIZE 4
375 #endif
376 #ifndef IV_MIN
377 #define IV_MIN PERL_LONG_MIN
378 #endif
379 #ifndef IV_MAX
380 #define IV_MAX PERL_LONG_MAX
381 #endif
382 #ifndef UV_MIN
383 #define UV_MIN PERL_ULONG_MIN
384 #endif
385 #ifndef UV_MAX
386 #define UV_MAX PERL_ULONG_MAX
387 #endif
388 #endif
389 #ifndef IVSIZE
390 #ifdef LONGSIZE
391 #define IVSIZE LONGSIZE
392 #else
393 #define IVSIZE 4
394 #endif
395 #endif
396 #ifndef UVTYPE
397 #define UVTYPE unsigned IVTYPE
398 #endif
399 #ifndef UVSIZE
400 #define UVSIZE IVSIZE
401 #endif
402 #ifndef sv_setuv
403 #define sv_setuv(sv, uv) \
404 STMT_START { \
405 UV TeMpUv = uv; \
406 if (TeMpUv <= IV_MAX) \
407 sv_setiv(sv, TeMpUv); \
408 else \
409 sv_setnv(sv, (double)TeMpUv); \
410 } STMT_END
411 #endif
412 #ifndef newSVuv
413 #define newSVuv(uv) ((uv) <= IV_MAX ? newSViv((IV)uv) : newSVnv((NV)uv))
414 #endif
415 #ifndef sv_2uv
416 #define sv_2uv(sv) ((PL_Sv = (sv)), (UV) (SvNOK(PL_Sv) ? SvNV(PL_Sv) : sv_2nv(PL_Sv)))
417 #endif
418 #ifndef SvUVX
419 #define SvUVX(sv) ((UV)SvIVX(sv))
420 #endif
421 #ifndef SvUVXx
422 #define SvUVXx(sv) SvUVX(sv)
423 #endif
424 #ifndef SvUV
425 #define SvUV(sv) (SvIOK(sv) ? SvUVX(sv) : sv_2uv(sv))
426 #endif
427 #ifndef SvUVx
428 #define SvUVx(sv) ((PL_Sv = (sv)), SvUV(PL_Sv))
429 #endif
430 #ifndef sv_uv
431 #define sv_uv(sv) SvUVx(sv)
432 #endif
433 #if !defined(SvUOK) && defined(SvIOK_UV)
434 #define SvUOK(sv) SvIOK_UV(sv)
435 #endif
436 #ifndef XST_mUV
437 #define XST_mUV(i,v) (ST(i) = sv_2mortal(newSVuv(v)) )
438 #endif
439 #ifndef XSRETURN_UV
440 #define XSRETURN_UV(v) STMT_START { XST_mUV(0,v); XSRETURN(1); } STMT_END
441 #endif
442 #ifndef PUSHu
443 #define PUSHu(u) STMT_START { sv_setuv(TARG, (UV)(u)); PUSHTARG; } STMT_END
444 #endif
445 #ifndef XPUSHu
446 #define XPUSHu(u) STMT_START { sv_setuv(TARG, (UV)(u)); XPUSHTARG; } STMT_END
447 #endif
448 #ifdef HAS_MEMCMP
449 #ifndef memNE
450 #define memNE(s1,s2,l) (memcmp(s1,s2,l))
451 #endif
452 #ifndef memEQ
453 #define memEQ(s1,s2,l) (!memcmp(s1,s2,l))
454 #endif
455 #else
456 #ifndef memNE
457 #define memNE(s1,s2,l) (bcmp(s1,s2,l))
458 #endif
459 #ifndef memEQ
460 #define memEQ(s1,s2,l) (!bcmp(s1,s2,l))
461 #endif
462 #endif
463 #ifndef memEQs
464 #define memEQs(s1, l, s2) \
465 (sizeof(s2)-1 == l && memEQ(s1, (s2 ""), (sizeof(s2)-1)))
466 #endif
467 #ifndef memNEs
468 #define memNEs(s1, l, s2) !memEQs(s1, l, s2)
469 #endif
470 #ifndef MoveD
471 #define MoveD(s,d,n,t) memmove((char*)(d),(char*)(s), (n) * sizeof(t))
472 #endif
473 #ifndef CopyD
474 #define CopyD(s,d,n,t) memcpy((char*)(d),(char*)(s), (n) * sizeof(t))
475 #endif
476 #ifdef HAS_MEMSET
477 #ifndef ZeroD
478 #define ZeroD(d,n,t) memzero((char*)(d), (n) * sizeof(t))
479 #endif
480 #else
481 #ifndef ZeroD
482 #define ZeroD(d,n,t) ((void)memzero((char*)(d), (n) * sizeof(t)), d)
483 #endif
484 #endif
485 #ifndef PoisonWith
486 #define PoisonWith(d,n,t,b) (void)memset((char*)(d), (U8)(b), (n) * sizeof(t))
487 #endif
488 #ifndef PoisonNew
489 #define PoisonNew(d,n,t) PoisonWith(d,n,t,0xAB)
490 #endif
491 #ifndef PoisonFree
492 #define PoisonFree(d,n,t) PoisonWith(d,n,t,0xEF)
493 #endif
494 #ifndef Poison
495 #define Poison(d,n,t) PoisonFree(d,n,t)
496 #endif
497 #ifndef Newx
498 #define Newx(v,n,t) New(0,v,n,t)
499 #endif
500 #ifndef Newxc
501 #define Newxc(v,n,t,c) Newc(0,v,n,t,c)
502 #endif
503 #ifndef Newxz
504 #define Newxz(v,n,t) Newz(0,v,n,t)
505 #endif
506 #ifndef PERL_UNUSED_DECL
507 #ifdef HASATTRIBUTE
508 #if (defined(__GNUC__) && defined(__cplusplus)) || defined(__INTEL_COMPILER)
509 #define PERL_UNUSED_DECL
510 #else
511 #define PERL_UNUSED_DECL __attribute__((unused))
512 #endif
513 #else
514 #define PERL_UNUSED_DECL
515 #endif
516 #endif
517 #ifndef PERL_UNUSED_ARG
518 #if defined(lint) && defined(S_SPLINT_S)
519 #include <note.h>
520 #define PERL_UNUSED_ARG(x) NOTE(ARGUNUSED(x))
521 #else
522 #define PERL_UNUSED_ARG(x) ((void)x)
523 #endif
524 #endif
525 #ifndef PERL_UNUSED_VAR
526 #define PERL_UNUSED_VAR(x) ((void)x)
527 #endif
528 #ifndef PERL_UNUSED_CONTEXT
529 #ifdef USE_ITHREADS
530 #define PERL_UNUSED_CONTEXT PERL_UNUSED_ARG(my_perl)
531 #else
532 #define PERL_UNUSED_CONTEXT
533 #endif
534 #endif
535 #ifndef NOOP
536 #define NOOP (void)0
537 #endif
538 #ifndef dNOOP
539 #define dNOOP extern int Perl___notused PERL_UNUSED_DECL
540 #endif
541 #ifndef NVTYPE
542 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
543 #define NVTYPE long double
544 #else
545 #define NVTYPE double
546 #endif
547 typedef NVTYPE NV;
548 #endif
549 #ifndef INT2PTR
550 #if (IVSIZE == PTRSIZE) && (UVSIZE == PTRSIZE)
551 #define PTRV UV
552 #define INT2PTR(any,d) (any)(d)
553 #else
554 #if PTRSIZE == LONGSIZE
555 #define PTRV unsigned long
556 #else
557 #define PTRV unsigned
558 #endif
559 #define INT2PTR(any,d) (any)(PTRV)(d)
560 #endif
561 #endif
562 #ifndef PTR2ul
563 #if PTRSIZE == LONGSIZE
564 #define PTR2ul(p) (unsigned long)(p)
565 #else
566 #define PTR2ul(p) INT2PTR(unsigned long,p)
567 #endif
568 #endif
569 #ifndef PTR2nat
570 #define PTR2nat(p) (PTRV)(p)
571 #endif
572 #ifndef NUM2PTR
573 #define NUM2PTR(any,d) (any)PTR2nat(d)
574 #endif
575 #ifndef PTR2IV
576 #define PTR2IV(p) INT2PTR(IV,p)
577 #endif
578 #ifndef PTR2UV
579 #define PTR2UV(p) INT2PTR(UV,p)
580 #endif
581 #ifndef PTR2NV
582 #define PTR2NV(p) NUM2PTR(NV,p)
583 #endif
584 #undef START_EXTERN_C
585 #undef END_EXTERN_C
586 #undef EXTERN_C
587 #ifdef __cplusplus
588 #define START_EXTERN_C extern "C" {
589 #define END_EXTERN_C }
590 #define EXTERN_C extern "C"
591 #else
592 #define START_EXTERN_C
593 #define END_EXTERN_C
594 #define EXTERN_C extern
595 #endif
596 #if defined(PERL_GCC_PEDANTIC)
597 #ifndef PERL_GCC_BRACE_GROUPS_FORBIDDEN
598 #define PERL_GCC_BRACE_GROUPS_FORBIDDEN
599 #endif
600 #endif
601 #if defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN) && !defined(__cplusplus)
602 #ifndef PERL_USE_GCC_BRACE_GROUPS
603 #define PERL_USE_GCC_BRACE_GROUPS
604 #endif
605 #endif
606 #undef STMT_START
607 #undef STMT_END
608 #ifdef PERL_USE_GCC_BRACE_GROUPS
609 #define STMT_START (void)(
610 #define STMT_END )
611 #else
612 #if defined(VOIDFLAGS) && (VOIDFLAGS) && (defined(sun) || defined(__sun__)) && !defined(__GNUC__)
613 #define STMT_START if (1)
614 #define STMT_END else (void)0
615 #else
616 #define STMT_START do
617 #define STMT_END while (0)
618 #endif
619 #endif
620 #ifndef boolSV
621 #define boolSV(b) ((b) ? &PL_sv_yes : &PL_sv_no)
622 #endif
623 #ifndef DEFSV
624 #define DEFSV GvSV(PL_defgv)
625 #endif
626 #ifndef SAVE_DEFSV
627 #define SAVE_DEFSV SAVESPTR(GvSV(PL_defgv))
628 #endif
629 #ifndef DEFSV_set
630 #define DEFSV_set(sv) (DEFSV = (sv))
631 #endif
632 #ifndef AvFILLp
633 #define AvFILLp AvFILL
634 #endif
635 #ifndef ERRSV
636 #define ERRSV get_sv("@",FALSE)
637 #endif
638 #ifndef gv_stashpvn
639 #define gv_stashpvn(str,len,create) gv_stashpv(str,create)
640 #endif
641 #ifndef get_cv
642 #define get_cv perl_get_cv
643 #endif
644 #ifndef get_sv
645 #define get_sv perl_get_sv
646 #endif
647 #ifndef get_av
648 #define get_av perl_get_av
649 #endif
650 #ifndef get_hv
651 #define get_hv perl_get_hv
652 #endif
653 #ifndef dUNDERBAR
654 #define dUNDERBAR dNOOP
655 #endif
656 #ifndef UNDERBAR
657 #define UNDERBAR DEFSV
658 #endif
659 #ifndef dAX
660 #define dAX I32 ax = MARK - PL_stack_base + 1
661 #endif
662 #ifndef dITEMS
663 #define dITEMS I32 items = SP - MARK
664 #endif
665 #ifndef dXSTARG
666 #define dXSTARG SV * targ = sv_newmortal()
667 #endif
668 #ifndef dAXMARK
669 #define dAXMARK I32 ax = POPMARK; \
670 register SV ** const mark = PL_stack_base + ax++
671 #endif
672 #ifndef XSprePUSH
673 #define XSprePUSH (sp = PL_stack_base + ax - 1)
674 #endif
675 #if (PERL_BCDVERSION < 0x5005000)
676 #undef XSRETURN
677 #define XSRETURN(off) \
678 STMT_START { \
679 PL_stack_sp = PL_stack_base + ax + ((off) - 1); \
680 return; \
681 } STMT_END
682 #endif
683 #ifndef XSPROTO
684 #define XSPROTO(name) void name(pTHX_ CV* cv)
685 #endif
686 #ifndef SVfARG
687 #define SVfARG(p) ((void*)(p))
688 #endif
689 #ifndef PERL_ABS
690 #define PERL_ABS(x) ((x) < 0 ? -(x) : (x))
691 #endif
692 #ifndef dVAR
693 #define dVAR dNOOP
694 #endif
695 #ifndef SVf
696 #define SVf "_"
697 #endif
698 #ifndef UTF8_MAXBYTES
699 #define UTF8_MAXBYTES UTF8_MAXLEN
700 #endif
701 #ifndef CPERLscope
702 #define CPERLscope(x) x
703 #endif
704 #ifndef PERL_HASH
705 #define PERL_HASH(hash,str,len) \
706 STMT_START { \
707 const char *s_PeRlHaSh = str; \
708 I32 i_PeRlHaSh = len; \
709 U32 hash_PeRlHaSh = 0; \
710 while (i_PeRlHaSh--) \
711 hash_PeRlHaSh = hash_PeRlHaSh * 33 + *s_PeRlHaSh++; \
712 (hash) = hash_PeRlHaSh; \
713 } STMT_END
714 #endif
715 #ifndef PERLIO_FUNCS_DECL
716 #ifdef PERLIO_FUNCS_CONST
717 #define PERLIO_FUNCS_DECL(funcs) const PerlIO_funcs funcs
718 #define PERLIO_FUNCS_CAST(funcs) (PerlIO_funcs*)(funcs)
719 #else
720 #define PERLIO_FUNCS_DECL(funcs) PerlIO_funcs funcs
721 #define PERLIO_FUNCS_CAST(funcs) (funcs)
722 #endif
723 #endif
724 #if (PERL_BCDVERSION < 0x5009003)
725 #ifdef ARGSproto
726 typedef OP* (CPERLscope(*Perl_ppaddr_t))(ARGSproto);
727 #else
728 typedef OP* (CPERLscope(*Perl_ppaddr_t))(pTHX);
729 #endif
730 typedef OP* (CPERLscope(*Perl_check_t)) (pTHX_ OP*);
731 #endif
732 #ifndef isPSXSPC
733 #define isPSXSPC(c) (isSPACE(c) || (c) == '\v')
734 #endif
735 #ifndef isBLANK
736 #define isBLANK(c) ((c) == ' ' || (c) == '\t')
737 #endif
738 #ifdef EBCDIC
739 #ifndef isALNUMC
740 #define isALNUMC(c) isalnum(c)
741 #endif
742 #ifndef isASCII
743 #define isASCII(c) isascii(c)
744 #endif
745 #ifndef isCNTRL
746 #define isCNTRL(c) iscntrl(c)
747 #endif
748 #ifndef isGRAPH
749 #define isGRAPH(c) isgraph(c)
750 #endif
751 #ifndef isPRINT
752 #define isPRINT(c) isprint(c)
753 #endif
754 #ifndef isPUNCT
755 #define isPUNCT(c) ispunct(c)
756 #endif
757 #ifndef isXDIGIT
758 #define isXDIGIT(c) isxdigit(c)
759 #endif
760 #else
761 #if (PERL_BCDVERSION < 0x5010000)
762 #undef isPRINT
763 #endif
764 #ifdef HAS_QUAD
765 #ifdef U64TYPE
766 #define WIDEST_UTYPE U64TYPE
767 #else
768 #define WIDEST_UTYPE Quad_t
769 #endif
770 #else
771 #define WIDEST_UTYPE U32
772 #endif
773 #ifndef isALNUMC
774 #define isALNUMC(c) (isALPHA(c) || isDIGIT(c))
775 #endif
776 #ifndef isASCII
777 #define isASCII(c) ((WIDEST_UTYPE) (c) <= 127)
778 #endif
779 #ifndef isCNTRL
780 #define isCNTRL(c) ((WIDEST_UTYPE) (c) < ' ' || (c) == 127)
781 #endif
782 #ifndef isGRAPH
783 #define isGRAPH(c) (isALNUM(c) || isPUNCT(c))
784 #endif
785 #ifndef isPRINT
786 #define isPRINT(c) (((c) >= 32 && (c) < 127))
787 #endif
788 #ifndef isPUNCT
789 #define isPUNCT(c) (((c) >= 33 && (c) <= 47) || ((c) >= 58 && (c) <= 64) || ((c) >= 91 && (c) <= 96) || ((c) >= 123 && (c) <= 126))
790 #endif
791 #ifndef isXDIGIT
792 #define isXDIGIT(c) (isDIGIT(c) || ((c) >= 'a' && (c) <= 'f') || ((c) >= 'A' && (c) <= 'F'))
793 #endif
794 #endif
795 #if (PERL_BCDVERSION >= 0x5008000)
796 #ifndef HeUTF8
797 #define HeUTF8(he) ((HeKLEN(he) == HEf_SVKEY) ? \
798 SvUTF8(HeKEY_sv(he)) : \
799 (U32)HeKUTF8(he))
800 #endif
801 #endif
802 #ifndef PERL_SIGNALS_UNSAFE_FLAG
803 #define PERL_SIGNALS_UNSAFE_FLAG 0x0001
804 #if (PERL_BCDVERSION < 0x5008000)
805 #define D_PPP_PERL_SIGNALS_INIT PERL_SIGNALS_UNSAFE_FLAG
806 #else
807 #define D_PPP_PERL_SIGNALS_INIT 0
808 #endif
809 #if defined(NEED_PL_signals)
810 static U32 DPPP_(my_PL_signals) = D_PPP_PERL_SIGNALS_INIT;
811 #elif defined(NEED_PL_signals_GLOBAL)
812 U32 DPPP_(my_PL_signals) = D_PPP_PERL_SIGNALS_INIT;
813 #else
814 extern U32 DPPP_(my_PL_signals);
815 #endif
816 #define PL_signals DPPP_(my_PL_signals)
817 #endif
818 #if (PERL_BCDVERSION <= 0x5005005)
819 #define PL_ppaddr ppaddr
820 #define PL_no_modify no_modify
821 #endif
822 #if (PERL_BCDVERSION <= 0x5004005)
823 #define PL_DBsignal DBsignal
824 #define PL_DBsingle DBsingle
825 #define PL_DBsub DBsub
826 #define PL_DBtrace DBtrace
827 #define PL_Sv Sv
828 #define PL_bufend bufend
829 #define PL_bufptr bufptr
830 #define PL_compiling compiling
831 #define PL_copline copline
832 #define PL_curcop curcop
833 #define PL_curstash curstash
834 #define PL_debstash debstash
835 #define PL_defgv defgv
836 #define PL_diehook diehook
837 #define PL_dirty dirty
838 #define PL_dowarn dowarn
839 #define PL_errgv errgv
840 #define PL_error_count error_count
841 #define PL_expect expect
842 #define PL_hexdigit hexdigit
843 #define PL_hints hints
844 #define PL_in_my in_my
845 #define PL_laststatval laststatval
846 #define PL_lex_state lex_state
847 #define PL_lex_stuff lex_stuff
848 #define PL_linestr linestr
849 #define PL_na na
850 #define PL_perl_destruct_level perl_destruct_level
851 #define PL_perldb perldb
852 #define PL_rsfp_filters rsfp_filters
853 #define PL_rsfp rsfp
854 #define PL_stack_base stack_base
855 #define PL_stack_sp stack_sp
856 #define PL_statcache statcache
857 #define PL_stdingv stdingv
858 #define PL_sv_arenaroot sv_arenaroot
859 #define PL_sv_no sv_no
860 #define PL_sv_undef sv_undef
861 #define PL_sv_yes sv_yes
862 #define PL_tainted tainted
863 #define PL_tainting tainting
864 #define PL_tokenbuf tokenbuf
865 #endif
866 #if (PERL_BCDVERSION >= 0x5009005)
867 #ifdef DPPP_PL_parser_NO_DUMMY
868 #define D_PPP_my_PL_parser_var(var) ((PL_parser ? PL_parser : \
869 (croak("panic: PL_parser == NULL in %s:%d", \
870 __FILE__, __LINE__), (yy_parser *) NULL))->var)
871 #else
872 #ifdef DPPP_PL_parser_NO_DUMMY_WARNING
873 #define D_PPP_parser_dummy_warning(var)
874 #else
875 #define D_PPP_parser_dummy_warning(var) \
876 warn("warning: dummy PL_" #var " used in %s:%d", __FILE__, __LINE__),
877 #endif
878 #define D_PPP_my_PL_parser_var(var) ((PL_parser ? PL_parser : \
879 (D_PPP_parser_dummy_warning(var) &DPPP_(dummy_PL_parser)))->var)
880 #if defined(NEED_PL_parser)
881 static yy_parser DPPP_(dummy_PL_parser);
882 #elif defined(NEED_PL_parser_GLOBAL)
883 yy_parser DPPP_(dummy_PL_parser);
884 #else
885 extern yy_parser DPPP_(dummy_PL_parser);
886 #endif
887 #endif
888 #define PL_expect D_PPP_my_PL_parser_var(expect)
889 #define PL_copline D_PPP_my_PL_parser_var(copline)
890 #define PL_rsfp D_PPP_my_PL_parser_var(rsfp)
891 #define PL_rsfp_filters D_PPP_my_PL_parser_var(rsfp_filters)
892 #define PL_linestr D_PPP_my_PL_parser_var(linestr)
893 #define PL_bufptr D_PPP_my_PL_parser_var(bufptr)
894 #define PL_bufend D_PPP_my_PL_parser_var(bufend)
895 #define PL_lex_state D_PPP_my_PL_parser_var(lex_state)
896 #define PL_lex_stuff D_PPP_my_PL_parser_var(lex_stuff)
897 #define PL_tokenbuf D_PPP_my_PL_parser_var(tokenbuf)
898 #define PL_in_my D_PPP_my_PL_parser_var(in_my)
899 #define PL_in_my_stash D_PPP_my_PL_parser_var(in_my_stash)
900 #define PL_error_count D_PPP_my_PL_parser_var(error_count)
901 #else
902 #define PL_parser ((void *) 1)
903 #endif
904 #ifndef mPUSHs
905 #define mPUSHs(s) PUSHs(sv_2mortal(s))
906 #endif
907 #ifndef PUSHmortal
908 #define PUSHmortal PUSHs(sv_newmortal())
909 #endif
910 #ifndef mPUSHp
911 #define mPUSHp(p,l) sv_setpvn(PUSHmortal, (p), (l))
912 #endif
913 #ifndef mPUSHn
914 #define mPUSHn(n) sv_setnv(PUSHmortal, (NV)(n))
915 #endif
916 #ifndef mPUSHi
917 #define mPUSHi(i) sv_setiv(PUSHmortal, (IV)(i))
918 #endif
919 #ifndef mPUSHu
920 #define mPUSHu(u) sv_setuv(PUSHmortal, (UV)(u))
921 #endif
922 #ifndef mXPUSHs
923 #define mXPUSHs(s) XPUSHs(sv_2mortal(s))
924 #endif
925 #ifndef XPUSHmortal
926 #define XPUSHmortal XPUSHs(sv_newmortal())
927 #endif
928 #ifndef mXPUSHp
929 #define mXPUSHp(p,l) STMT_START { EXTEND(sp,1); sv_setpvn(PUSHmortal, (p), (l)); } STMT_END
930 #endif
931 #ifndef mXPUSHn
932 #define mXPUSHn(n) STMT_START { EXTEND(sp,1); sv_setnv(PUSHmortal, (NV)(n)); } STMT_END
933 #endif
934 #ifndef mXPUSHi
935 #define mXPUSHi(i) STMT_START { EXTEND(sp,1); sv_setiv(PUSHmortal, (IV)(i)); } STMT_END
936 #endif
937 #ifndef mXPUSHu
938 #define mXPUSHu(u) STMT_START { EXTEND(sp,1); sv_setuv(PUSHmortal, (UV)(u)); } STMT_END
939 #endif
940 #ifndef call_sv
941 #define call_sv perl_call_sv
942 #endif
943 #ifndef call_pv
944 #define call_pv perl_call_pv
945 #endif
946 #ifndef call_argv
947 #define call_argv perl_call_argv
948 #endif
949 #ifndef call_method
950 #define call_method perl_call_method
951 #endif
952 #ifndef eval_sv
953 #define eval_sv perl_eval_sv
954 #endif
955 #ifndef PERL_LOADMOD_DENY
956 #define PERL_LOADMOD_DENY 0x1
957 #endif
958 #ifndef PERL_LOADMOD_NOIMPORT
959 #define PERL_LOADMOD_NOIMPORT 0x2
960 #endif
961 #ifndef PERL_LOADMOD_IMPORT_OPS
962 #define PERL_LOADMOD_IMPORT_OPS 0x4
963 #endif
964 #ifndef G_METHOD
965 #define G_METHOD 64
966 #ifdef call_sv
967 #undef call_sv
968 #endif
969 #if (PERL_BCDVERSION < 0x5006000)
970 #define call_sv(sv, flags) ((flags) & G_METHOD ? perl_call_method((char *) SvPV_nolen_const(sv), \
971 (flags) & ~G_METHOD) : perl_call_sv(sv, flags))
972 #else
973 #define call_sv(sv, flags) ((flags) & G_METHOD ? Perl_call_method(aTHX_ (char *) SvPV_nolen_const(sv), \
974 (flags) & ~G_METHOD) : Perl_call_sv(aTHX_ sv, flags))
975 #endif
976 #endif
977 #ifndef eval_pv
978 #if defined(NEED_eval_pv)
979 static SV* DPPP_(my_eval_pv)(char *p, I32 croak_on_error);
980 static
981 #else
982 extern SV* DPPP_(my_eval_pv)(char *p, I32 croak_on_error);
983 #endif
984 #ifdef eval_pv
985 #undef eval_pv
986 #endif
987 #define eval_pv(a,b) DPPP_(my_eval_pv)(aTHX_ a,b)
988 #define Perl_eval_pv DPPP_(my_eval_pv)
989 #if defined(NEED_eval_pv) || defined(NEED_eval_pv_GLOBAL)
990 SV*
991 DPPP_(my_eval_pv)(char *p, I32 croak_on_error)
992 {
993 dSP;
994 SV* sv = newSVpv(p, 0);
995 PUSHMARK(sp);
996 eval_sv(sv, G_SCALAR);
997 SvREFCNT_dec(sv);
998 SPAGAIN;
999 sv = POPs;
1000 PUTBACK;
1001 if (croak_on_error && SvTRUE(GvSV(errgv)))
1002 croak(SvPVx(GvSV(errgv), na));
1003 return sv;
1004 }
1005 #endif
1006 #endif
1007 #ifndef vload_module
1008 #if defined(NEED_vload_module)
1009 static void DPPP_(my_vload_module)(U32 flags, SV *name, SV *ver, va_list *args);
1010 static
1011 #else
1012 extern void DPPP_(my_vload_module)(U32 flags, SV *name, SV *ver, va_list *args);
1013 #endif
1014 #ifdef vload_module
1015 #undef vload_module
1016 #endif
1017 #define vload_module(a,b,c,d) DPPP_(my_vload_module)(aTHX_ a,b,c,d)
1018 #define Perl_vload_module DPPP_(my_vload_module)
1019 #if defined(NEED_vload_module) || defined(NEED_vload_module_GLOBAL)
1020 void
1021 DPPP_(my_vload_module)(U32 flags, SV *name, SV *ver, va_list *args)
1022 {
1023 dTHR;
1024 dVAR;
1025 OP *veop, *imop;
1026 OP * const modname = newSVOP(OP_CONST, 0, name);
1027 SvREADONLY_off(((SVOP*)modname)->op_sv);
1028 modname->op_private |= OPpCONST_BARE;
1029 if (ver) {
1030 veop = newSVOP(OP_CONST, 0, ver);
1031 }
1032 else
1033 veop = NULL;
1034 if (flags & PERL_LOADMOD_NOIMPORT) {
1035 imop = sawparens(newNULLLIST());
1036 }
1037 else if (flags & PERL_LOADMOD_IMPORT_OPS) {
1038 imop = va_arg(*args, OP*);
1039 }
1040 else {
1041 SV *sv;
1042 imop = NULL;
1043 sv = va_arg(*args, SV*);
1044 while (sv) {
1045 imop = append_elem(OP_LIST, imop, newSVOP(OP_CONST, 0, sv));
1046 sv = va_arg(*args, SV*);
1047 }
1048 }
1049 {
1050 const line_t ocopline = PL_copline;
1051 COP * const ocurcop = PL_curcop;
1052 const int oexpect = PL_expect;
1053 #if (PERL_BCDVERSION >= 0x5004000)
1054 utilize(!(flags & PERL_LOADMOD_DENY), start_subparse(FALSE, 0),
1055 veop, modname, imop);
1056 #elif (PERL_BCDVERSION > 0x5003000)
1057 utilize(!(flags & PERL_LOADMOD_DENY), start_subparse(),
1058 veop, modname, imop);
1059 #else
1060 utilize(!(flags & PERL_LOADMOD_DENY), start_subparse(),
1061 modname, imop);
1062 #endif
1063 PL_expect = oexpect;
1064 PL_copline = ocopline;
1065 PL_curcop = ocurcop;
1066 }
1067 }
1068 #endif
1069 #endif
1070 #ifndef load_module
1071 #if defined(NEED_load_module)
1072 static void DPPP_(my_load_module)(U32 flags, SV *name, SV *ver, ...);
1073 static
1074 #else
1075 extern void DPPP_(my_load_module)(U32 flags, SV *name, SV *ver, ...);
1076 #endif
1077 #ifdef load_module
1078 #undef load_module
1079 #endif
1080 #define load_module DPPP_(my_load_module)
1081 #define Perl_load_module DPPP_(my_load_module)
1082 #if defined(NEED_load_module) || defined(NEED_load_module_GLOBAL)
1083 void
1084 DPPP_(my_load_module)(U32 flags, SV *name, SV *ver, ...)
1085 {
1086 va_list args;
1087 va_start(args, ver);
1088 vload_module(flags, name, ver, &args);
1089 va_end(args);
1090 }
1091 #endif
1092 #endif
1093 #ifndef newRV_inc
1094 #define newRV_inc(sv) newRV(sv)
1095 #endif
1096 #ifndef newRV_noinc
1097 #if defined(NEED_newRV_noinc)
1098 static SV * DPPP_(my_newRV_noinc)(SV *sv);
1099 static
1100 #else
1101 extern SV * DPPP_(my_newRV_noinc)(SV *sv);
1102 #endif
1103 #ifdef newRV_noinc
1104 #undef newRV_noinc
1105 #endif
1106 #define newRV_noinc(a) DPPP_(my_newRV_noinc)(aTHX_ a)
1107 #define Perl_newRV_noinc DPPP_(my_newRV_noinc)
1108 #if defined(NEED_newRV_noinc) || defined(NEED_newRV_noinc_GLOBAL)
1109 SV *
1110 DPPP_(my_newRV_noinc)(SV *sv)
1111 {
1112 SV *rv = (SV *)newRV(sv);
1113 SvREFCNT_dec(sv);
1114 return rv;
1115 }
1116 #endif
1117 #endif
1118 #if (PERL_BCDVERSION < 0x5004063) && (PERL_BCDVERSION != 0x5004005)
1119 #if defined(NEED_newCONSTSUB)
1120 static void DPPP_(my_newCONSTSUB)(HV *stash, const char *name, SV *sv);
1121 static
1122 #else
1123 extern void DPPP_(my_newCONSTSUB)(HV *stash, const char *name, SV *sv);
1124 #endif
1125 #ifdef newCONSTSUB
1126 #undef newCONSTSUB
1127 #endif
1128 #define newCONSTSUB(a,b,c) DPPP_(my_newCONSTSUB)(aTHX_ a,b,c)
1129 #define Perl_newCONSTSUB DPPP_(my_newCONSTSUB)
1130 #if defined(NEED_newCONSTSUB) || defined(NEED_newCONSTSUB_GLOBAL)
1131 #define D_PPP_PL_copline PL_copline
1132 void
1133 DPPP_(my_newCONSTSUB)(HV *stash, const char *name, SV *sv)
1134 {
1135 U32 oldhints = PL_hints;
1136 HV *old_cop_stash = PL_curcop->cop_stash;
1137 HV *old_curstash = PL_curstash;
1138 line_t oldline = PL_curcop->cop_line;
1139 PL_curcop->cop_line = D_PPP_PL_copline;
1140 PL_hints &= ~HINT_BLOCK_SCOPE;
1141 if (stash)
1142 PL_curstash = PL_curcop->cop_stash = stash;
1143 newSUB(
1144 #if (PERL_BCDVERSION < 0x5003022)
1145 start_subparse(),
1146 #elif (PERL_BCDVERSION == 0x5003022)
1147 start_subparse(0),
1148 #else
1149 start_subparse(FALSE, 0),
1150 #endif
1151 newSVOP(OP_CONST, 0, newSVpv((char *) name, 0)),
1152 newSVOP(OP_CONST, 0, &PL_sv_no),
1153 newSTATEOP(0, Nullch, newSVOP(OP_CONST, 0, sv))
1154 );
1155 PL_hints = oldhints;
1156 PL_curcop->cop_stash = old_cop_stash;
1157 PL_curstash = old_curstash;
1158 PL_curcop->cop_line = oldline;
1159 }
1160 #endif
1161 #endif
1162 #if defined(MULTIPLICITY) || defined(PERL_OBJECT) || \
1163 defined(PERL_CAPI) || defined(PERL_IMPLICIT_CONTEXT)
1164 #ifndef START_MY_CXT
1165 #define START_MY_CXT
1166 #if (PERL_BCDVERSION < 0x5004068)
1167 #define dMY_CXT_SV \
1168 SV *my_cxt_sv = get_sv(MY_CXT_KEY, FALSE)
1169 #else
1170 #define dMY_CXT_SV \
1171 SV *my_cxt_sv = *hv_fetch(PL_modglobal, MY_CXT_KEY, \
1172 sizeof(MY_CXT_KEY)-1, TRUE)
1173 #endif
1174 #define dMY_CXT \
1175 dMY_CXT_SV; \
1176 my_cxt_t *my_cxtp = INT2PTR(my_cxt_t*,SvUV(my_cxt_sv))
1177 #define MY_CXT_INIT \
1178 dMY_CXT_SV; \
1179 \
1180 my_cxt_t *my_cxtp = (my_cxt_t*)SvPVX(newSV(sizeof(my_cxt_t)-1));\
1181 Zero(my_cxtp, 1, my_cxt_t); \
1182 sv_setuv(my_cxt_sv, PTR2UV(my_cxtp))
1183 #define MY_CXT (*my_cxtp)
1184 #define pMY_CXT my_cxt_t *my_cxtp
1185 #define pMY_CXT_ pMY_CXT,
1186 #define _pMY_CXT ,pMY_CXT
1187 #define aMY_CXT my_cxtp
1188 #define aMY_CXT_ aMY_CXT,
1189 #define _aMY_CXT ,aMY_CXT
1190 #endif
1191 #ifndef MY_CXT_CLONE
1192 #define MY_CXT_CLONE \
1193 dMY_CXT_SV; \
1194 my_cxt_t *my_cxtp = (my_cxt_t*)SvPVX(newSV(sizeof(my_cxt_t)-1));\
1195 Copy(INT2PTR(my_cxt_t*, SvUV(my_cxt_sv)), my_cxtp, 1, my_cxt_t);\
1196 sv_setuv(my_cxt_sv, PTR2UV(my_cxtp))
1197 #endif
1198 #else
1199 #ifndef START_MY_CXT
1200 #define START_MY_CXT static my_cxt_t my_cxt;
1201 #define dMY_CXT_SV dNOOP
1202 #define dMY_CXT dNOOP
1203 #define MY_CXT_INIT NOOP
1204 #define MY_CXT my_cxt
1205 #define pMY_CXT void
1206 #define pMY_CXT_
1207 #define _pMY_CXT
1208 #define aMY_CXT
1209 #define aMY_CXT_
1210 #define _aMY_CXT
1211 #endif
1212 #ifndef MY_CXT_CLONE
1213 #define MY_CXT_CLONE NOOP
1214 #endif
1215 #endif
1216 #ifndef IVdf
1217 #if IVSIZE == LONGSIZE
1218 #define IVdf "ld"
1219 #define UVuf "lu"
1220 #define UVof "lo"
1221 #define UVxf "lx"
1222 #define UVXf "lX"
1223 #elif IVSIZE == INTSIZE
1224 #define IVdf "d"
1225 #define UVuf "u"
1226 #define UVof "o"
1227 #define UVxf "x"
1228 #define UVXf "X"
1229 #else
1230 #error "cannot define IV/UV formats"
1231 #endif
1232 #endif
1233 #ifndef NVef
1234 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) && \
1235 defined(PERL_PRIfldbl) && (PERL_BCDVERSION != 0x5006000)
1236 #define NVef PERL_PRIeldbl
1237 #define NVff PERL_PRIfldbl
1238 #define NVgf PERL_PRIgldbl
1239 #else
1240 #define NVef "e"
1241 #define NVff "f"
1242 #define NVgf "g"
1243 #endif
1244 #endif
1245 #ifndef SvREFCNT_inc
1246 #ifdef PERL_USE_GCC_BRACE_GROUPS
1247 #define SvREFCNT_inc(sv) \
1248 ({ \
1249 SV * const _sv = (SV*)(sv); \
1250 if (_sv) \
1251 (SvREFCNT(_sv))++; \
1252 _sv; \
1253 })
1254 #else
1255 #define SvREFCNT_inc(sv) \
1256 ((PL_Sv=(SV*)(sv)) ? (++(SvREFCNT(PL_Sv)),PL_Sv) : NULL)
1257 #endif
1258 #endif
1259 #ifndef SvREFCNT_inc_simple
1260 #ifdef PERL_USE_GCC_BRACE_GROUPS
1261 #define SvREFCNT_inc_simple(sv) \
1262 ({ \
1263 if (sv) \
1264 (SvREFCNT(sv))++; \
1265 (SV *)(sv); \
1266 })
1267 #else
1268 #define SvREFCNT_inc_simple(sv) \
1269 ((sv) ? (SvREFCNT(sv)++,(SV*)(sv)) : NULL)
1270 #endif
1271 #endif
1272 #ifndef SvREFCNT_inc_NN
1273 #ifdef PERL_USE_GCC_BRACE_GROUPS
1274 #define SvREFCNT_inc_NN(sv) \
1275 ({ \
1276 SV * const _sv = (SV*)(sv); \
1277 SvREFCNT(_sv)++; \
1278 _sv; \
1279 })
1280 #else
1281 #define SvREFCNT_inc_NN(sv) \
1282 (PL_Sv=(SV*)(sv),++(SvREFCNT(PL_Sv)),PL_Sv)
1283 #endif
1284 #endif
1285 #ifndef SvREFCNT_inc_void
1286 #ifdef PERL_USE_GCC_BRACE_GROUPS
1287 #define SvREFCNT_inc_void(sv) \
1288 ({ \
1289 SV * const _sv = (SV*)(sv); \
1290 if (_sv) \
1291 (void)(SvREFCNT(_sv)++); \
1292 })
1293 #else
1294 #define SvREFCNT_inc_void(sv) \
1295 (void)((PL_Sv=(SV*)(sv)) ? ++(SvREFCNT(PL_Sv)) : 0)
1296 #endif
1297 #endif
1298 #ifndef SvREFCNT_inc_simple_void
1299 #define SvREFCNT_inc_simple_void(sv) STMT_START { if (sv) SvREFCNT(sv)++; } STMT_END
1300 #endif
1301 #ifndef SvREFCNT_inc_simple_NN
1302 #define SvREFCNT_inc_simple_NN(sv) (++SvREFCNT(sv), (SV*)(sv))
1303 #endif
1304 #ifndef SvREFCNT_inc_void_NN
1305 #define SvREFCNT_inc_void_NN(sv) (void)(++SvREFCNT((SV*)(sv)))
1306 #endif
1307 #ifndef SvREFCNT_inc_simple_void_NN
1308 #define SvREFCNT_inc_simple_void_NN(sv) (void)(++SvREFCNT((SV*)(sv)))
1309 #endif
1310 #ifndef newSV_type
1311 #if defined(NEED_newSV_type)
1312 static SV* DPPP_(my_newSV_type)(pTHX_ svtype const t);
1313 static
1314 #else
1315 extern SV* DPPP_(my_newSV_type)(pTHX_ svtype const t);
1316 #endif
1317 #ifdef newSV_type
1318 #undef newSV_type
1319 #endif
1320 #define newSV_type(a) DPPP_(my_newSV_type)(aTHX_ a)
1321 #define Perl_newSV_type DPPP_(my_newSV_type)
1322 #if defined(NEED_newSV_type) || defined(NEED_newSV_type_GLOBAL)
1323 SV*
1324 DPPP_(my_newSV_type)(pTHX_ svtype const t)
1325 {
1326 SV* const sv = newSV(0);
1327 sv_upgrade(sv, t);
1328 return sv;
1329 }
1330 #endif
1331 #endif
1332 #if (PERL_BCDVERSION < 0x5006000)
1333 #define D_PPP_CONSTPV_ARG(x) ((char *) (x))
1334 #else
1335 #define D_PPP_CONSTPV_ARG(x) (x)
1336 #endif
1337 #ifndef newSVpvn
1338 #define newSVpvn(data,len) ((data) \
1339 ? ((len) ? newSVpv((data), (len)) : newSVpv("", 0)) \
1340 : newSV(0))
1341 #endif
1342 #ifndef newSVpvn_utf8
1343 #define newSVpvn_utf8(s, len, u) newSVpvn_flags((s), (len), (u) ? SVf_UTF8 : 0)
1344 #endif
1345 #ifndef SVf_UTF8
1346 #define SVf_UTF8 0
1347 #endif
1348 #ifndef newSVpvn_flags
1349 #if defined(NEED_newSVpvn_flags)
1350 static SV * DPPP_(my_newSVpvn_flags)(pTHX_ const char *s, STRLEN len, U32 flags);
1351 static
1352 #else
1353 extern SV * DPPP_(my_newSVpvn_flags)(pTHX_ const char *s, STRLEN len, U32 flags);
1354 #endif
1355 #ifdef newSVpvn_flags
1356 #undef newSVpvn_flags
1357 #endif
1358 #define newSVpvn_flags(a,b,c) DPPP_(my_newSVpvn_flags)(aTHX_ a,b,c)
1359 #define Perl_newSVpvn_flags DPPP_(my_newSVpvn_flags)
1360 #if defined(NEED_newSVpvn_flags) || defined(NEED_newSVpvn_flags_GLOBAL)
1361 SV *
1362 DPPP_(my_newSVpvn_flags)(pTHX_ const char *s, STRLEN len, U32 flags)
1363 {
1364 SV *sv = newSVpvn(D_PPP_CONSTPV_ARG(s), len);
1365 SvFLAGS(sv) |= (flags & SVf_UTF8);
1366 return (flags & SVs_TEMP) ? sv_2mortal(sv) : sv;
1367 }
1368 #endif
1369 #endif
1370 #if !defined(NEED_sv_2pv_flags) && defined(NEED_sv_2pv_nolen)
1371 #define NEED_sv_2pv_flags
1372 #endif
1373 #if !defined(NEED_sv_2pv_flags_GLOBAL) && defined(NEED_sv_2pv_nolen_GLOBAL)
1374 #define NEED_sv_2pv_flags_GLOBAL
1375 #endif
1376 #ifndef sv_2pv_nolen
1377 #define sv_2pv_nolen(sv) SvPV_nolen(sv)
1378 #endif
1379 #ifdef SvPVbyte
1380 #if (PERL_BCDVERSION < 0x5007000)
1381 #if defined(NEED_sv_2pvbyte)
1382 static char * DPPP_(my_sv_2pvbyte)(pTHX_ SV *sv, STRLEN *lp);
1383 static
1384 #else
1385 extern char * DPPP_(my_sv_2pvbyte)(pTHX_ SV *sv, STRLEN *lp);
1386 #endif
1387 #ifdef sv_2pvbyte
1388 #undef sv_2pvbyte
1389 #endif
1390 #define sv_2pvbyte(a,b) DPPP_(my_sv_2pvbyte)(aTHX_ a,b)
1391 #define Perl_sv_2pvbyte DPPP_(my_sv_2pvbyte)
1392 #if defined(NEED_sv_2pvbyte) || defined(NEED_sv_2pvbyte_GLOBAL)
1393 char *
1394 DPPP_(my_sv_2pvbyte)(pTHX_ SV *sv, STRLEN *lp)
1395 {
1396 sv_utf8_downgrade(sv,0);
1397 return SvPV(sv,*lp);
1398 }
1399 #endif
1400 #undef SvPVbyte
1401 #define SvPVbyte(sv, lp) \
1402 ((SvFLAGS(sv) & (SVf_POK|SVf_UTF8)) == (SVf_POK) \
1403 ? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_2pvbyte(sv, &lp))
1404 #endif
1405 #else
1406 #define SvPVbyte SvPV
1407 #define sv_2pvbyte sv_2pv
1408 #endif
1409 #ifndef sv_2pvbyte_nolen
1410 #define sv_2pvbyte_nolen(sv) sv_2pv_nolen(sv)
1411 #endif
1412 #ifndef SV_IMMEDIATE_UNREF
1413 #define SV_IMMEDIATE_UNREF 0
1414 #endif
1415 #ifndef SV_GMAGIC
1416 #define SV_GMAGIC 0
1417 #endif
1418 #ifndef SV_COW_DROP_PV
1419 #define SV_COW_DROP_PV 0
1420 #endif
1421 #ifndef SV_UTF8_NO_ENCODING
1422 #define SV_UTF8_NO_ENCODING 0
1423 #endif
1424 #ifndef SV_NOSTEAL
1425 #define SV_NOSTEAL 0
1426 #endif
1427 #ifndef SV_CONST_RETURN
1428 #define SV_CONST_RETURN 0
1429 #endif
1430 #ifndef SV_MUTABLE_RETURN
1431 #define SV_MUTABLE_RETURN 0
1432 #endif
1433 #ifndef SV_SMAGIC
1434 #define SV_SMAGIC 0
1435 #endif
1436 #ifndef SV_HAS_TRAILING_NUL
1437 #define SV_HAS_TRAILING_NUL 0
1438 #endif
1439 #ifndef SV_COW_SHARED_HASH_KEYS
1440 #define SV_COW_SHARED_HASH_KEYS 0
1441 #endif
1442 #if (PERL_BCDVERSION < 0x5007002)
1443 #if defined(NEED_sv_2pv_flags)
1444 static char * DPPP_(my_sv_2pv_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags);
1445 static
1446 #else
1447 extern char * DPPP_(my_sv_2pv_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags);
1448 #endif
1449 #ifdef sv_2pv_flags
1450 #undef sv_2pv_flags
1451 #endif
1452 #define sv_2pv_flags(a,b,c) DPPP_(my_sv_2pv_flags)(aTHX_ a,b,c)
1453 #define Perl_sv_2pv_flags DPPP_(my_sv_2pv_flags)
1454 #if defined(NEED_sv_2pv_flags) || defined(NEED_sv_2pv_flags_GLOBAL)
1455 char *
1456 DPPP_(my_sv_2pv_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags)
1457 {
1458 STRLEN n_a = (STRLEN) flags;
1459 return sv_2pv(sv, lp ? lp : &n_a);
1460 }
1461 #endif
1462 #if defined(NEED_sv_pvn_force_flags)
1463 static char * DPPP_(my_sv_pvn_force_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags);
1464 static
1465 #else
1466 extern char * DPPP_(my_sv_pvn_force_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags);
1467 #endif
1468 #ifdef sv_pvn_force_flags
1469 #undef sv_pvn_force_flags
1470 #endif
1471 #define sv_pvn_force_flags(a,b,c) DPPP_(my_sv_pvn_force_flags)(aTHX_ a,b,c)
1472 #define Perl_sv_pvn_force_flags DPPP_(my_sv_pvn_force_flags)
1473 #if defined(NEED_sv_pvn_force_flags) || defined(NEED_sv_pvn_force_flags_GLOBAL)
1474 char *
1475 DPPP_(my_sv_pvn_force_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags)
1476 {
1477 STRLEN n_a = (STRLEN) flags;
1478 return sv_pvn_force(sv, lp ? lp : &n_a);
1479 }
1480 #endif
1481 #endif
1482 #if (PERL_BCDVERSION < 0x5008008) || ( (PERL_BCDVERSION >= 0x5009000) && (PERL_BCDVERSION < 0x5009003) )
1483 #define DPPP_SVPV_NOLEN_LP_ARG &PL_na
1484 #else
1485 #define DPPP_SVPV_NOLEN_LP_ARG 0
1486 #endif
1487 #ifndef SvPV_const
1488 #define SvPV_const(sv, lp) SvPV_flags_const(sv, lp, SV_GMAGIC)
1489 #endif
1490 #ifndef SvPV_mutable
1491 #define SvPV_mutable(sv, lp) SvPV_flags_mutable(sv, lp, SV_GMAGIC)
1492 #endif
1493 #ifndef SvPV_flags
1494 #define SvPV_flags(sv, lp, flags) \
1495 ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
1496 ? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_2pv_flags(sv, &lp, flags))
1497 #endif
1498 #ifndef SvPV_flags_const
1499 #define SvPV_flags_const(sv, lp, flags) \
1500 ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
1501 ? ((lp = SvCUR(sv)), SvPVX_const(sv)) : \
1502 (const char*) sv_2pv_flags(sv, &lp, flags|SV_CONST_RETURN))
1503 #endif
1504 #ifndef SvPV_flags_const_nolen
1505 #define SvPV_flags_const_nolen(sv, flags) \
1506 ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
1507 ? SvPVX_const(sv) : \
1508 (const char*) sv_2pv_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, flags|SV_CONST_RETURN))
1509 #endif
1510 #ifndef SvPV_flags_mutable
1511 #define SvPV_flags_mutable(sv, lp, flags) \
1512 ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
1513 ? ((lp = SvCUR(sv)), SvPVX_mutable(sv)) : \
1514 sv_2pv_flags(sv, &lp, flags|SV_MUTABLE_RETURN))
1515 #endif
1516 #ifndef SvPV_force
1517 #define SvPV_force(sv, lp) SvPV_force_flags(sv, lp, SV_GMAGIC)
1518 #endif
1519 #ifndef SvPV_force_nolen
1520 #define SvPV_force_nolen(sv) SvPV_force_flags_nolen(sv, SV_GMAGIC)
1521 #endif
1522 #ifndef SvPV_force_mutable
1523 #define SvPV_force_mutable(sv, lp) SvPV_force_flags_mutable(sv, lp, SV_GMAGIC)
1524 #endif
1525 #ifndef SvPV_force_nomg
1526 #define SvPV_force_nomg(sv, lp) SvPV_force_flags(sv, lp, 0)
1527 #endif
1528 #ifndef SvPV_force_nomg_nolen
1529 #define SvPV_force_nomg_nolen(sv) SvPV_force_flags_nolen(sv, 0)
1530 #endif
1531 #ifndef SvPV_force_flags
1532 #define SvPV_force_flags(sv, lp, flags) \
1533 ((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == SVf_POK \
1534 ? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_pvn_force_flags(sv, &lp, flags))
1535 #endif
1536 #ifndef SvPV_force_flags_nolen
1537 #define SvPV_force_flags_nolen(sv, flags) \
1538 ((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == SVf_POK \
1539 ? SvPVX(sv) : sv_pvn_force_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, flags))
1540 #endif
1541 #ifndef SvPV_force_flags_mutable
1542 #define SvPV_force_flags_mutable(sv, lp, flags) \
1543 ((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == SVf_POK \
1544 ? ((lp = SvCUR(sv)), SvPVX_mutable(sv)) \
1545 : sv_pvn_force_flags(sv, &lp, flags|SV_MUTABLE_RETURN))
1546 #endif
1547 #ifndef SvPV_nolen
1548 #define SvPV_nolen(sv) \
1549 ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
1550 ? SvPVX(sv) : sv_2pv_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, SV_GMAGIC))
1551 #endif
1552 #ifndef SvPV_nolen_const
1553 #define SvPV_nolen_const(sv) \
1554 ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
1555 ? SvPVX_const(sv) : sv_2pv_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, SV_GMAGIC|SV_CONST_RETURN))
1556 #endif
1557 #ifndef SvPV_nomg
1558 #define SvPV_nomg(sv, lp) SvPV_flags(sv, lp, 0)
1559 #endif
1560 #ifndef SvPV_nomg_const
1561 #define SvPV_nomg_const(sv, lp) SvPV_flags_const(sv, lp, 0)
1562 #endif
1563 #ifndef SvPV_nomg_const_nolen
1564 #define SvPV_nomg_const_nolen(sv) SvPV_flags_const_nolen(sv, 0)
1565 #endif
1566 #ifndef SvPV_nomg_nolen
1567 #define SvPV_nomg_nolen(sv) ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
1568 ? SvPVX(sv) : sv_2pv_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, 0))
1569 #endif
1570 #ifndef SvPV_renew
1571 #define SvPV_renew(sv,n) STMT_START { SvLEN_set(sv, n); \
1572 SvPV_set((sv), (char *) saferealloc( \
1573 (Malloc_t)SvPVX(sv), (MEM_SIZE)((n)))); \
1574 } STMT_END
1575 #endif
1576 #ifndef SvMAGIC_set
1577 #define SvMAGIC_set(sv, val) \
1578 STMT_START { assert(SvTYPE(sv) >= SVt_PVMG); \
1579 (((XPVMG*) SvANY(sv))->xmg_magic = (val)); } STMT_END
1580 #endif
1581 #if (PERL_BCDVERSION < 0x5009003)
1582 #ifndef SvPVX_const
1583 #define SvPVX_const(sv) ((const char*) (0 + SvPVX(sv)))
1584 #endif
1585 #ifndef SvPVX_mutable
1586 #define SvPVX_mutable(sv) (0 + SvPVX(sv))
1587 #endif
1588 #ifndef SvRV_set
1589 #define SvRV_set(sv, val) \
1590 STMT_START { assert(SvTYPE(sv) >= SVt_RV); \
1591 (((XRV*) SvANY(sv))->xrv_rv = (val)); } STMT_END
1592 #endif
1593 #else
1594 #ifndef SvPVX_const
1595 #define SvPVX_const(sv) ((const char*)((sv)->sv_u.svu_pv))
1596 #endif
1597 #ifndef SvPVX_mutable
1598 #define SvPVX_mutable(sv) ((sv)->sv_u.svu_pv)
1599 #endif
1600 #ifndef SvRV_set
1601 #define SvRV_set(sv, val) \
1602 STMT_START { assert(SvTYPE(sv) >= SVt_RV); \
1603 ((sv)->sv_u.svu_rv = (val)); } STMT_END
1604 #endif
1605 #endif
1606 #ifndef SvSTASH_set
1607 #define SvSTASH_set(sv, val) \
1608 STMT_START { assert(SvTYPE(sv) >= SVt_PVMG); \
1609 (((XPVMG*) SvANY(sv))->xmg_stash = (val)); } STMT_END
1610 #endif
1611 #if (PERL_BCDVERSION < 0x5004000)
1612 #ifndef SvUV_set
1613 #define SvUV_set(sv, val) \
1614 STMT_START { assert(SvTYPE(sv) == SVt_IV || SvTYPE(sv) >= SVt_PVIV); \
1615 (((XPVIV*) SvANY(sv))->xiv_iv = (IV) (val)); } STMT_END
1616 #endif
1617 #else
1618 #ifndef SvUV_set
1619 #define SvUV_set(sv, val) \
1620 STMT_START { assert(SvTYPE(sv) == SVt_IV || SvTYPE(sv) >= SVt_PVIV); \
1621 (((XPVUV*) SvANY(sv))->xuv_uv = (val)); } STMT_END
1622 #endif
1623 #endif
1624 #if (PERL_BCDVERSION >= 0x5004000) && !defined(vnewSVpvf)
1625 #if defined(NEED_vnewSVpvf)
1626 static SV * DPPP_(my_vnewSVpvf)(pTHX_ const char *pat, va_list *args);
1627 static
1628 #else
1629 extern SV * DPPP_(my_vnewSVpvf)(pTHX_ const char *pat, va_list *args);
1630 #endif
1631 #ifdef vnewSVpvf
1632 #undef vnewSVpvf
1633 #endif
1634 #define vnewSVpvf(a,b) DPPP_(my_vnewSVpvf)(aTHX_ a,b)
1635 #define Perl_vnewSVpvf DPPP_(my_vnewSVpvf)
1636 #if defined(NEED_vnewSVpvf) || defined(NEED_vnewSVpvf_GLOBAL)
1637 SV *
1638 DPPP_(my_vnewSVpvf)(pTHX_ const char *pat, va_list *args)
1639 {
1640 register SV *sv = newSV(0);
1641 sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*));
1642 return sv;
1643 }
1644 #endif
1645 #endif
1646 #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vcatpvf)
1647 #define sv_vcatpvf(sv, pat, args) sv_vcatpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*))
1648 #endif
1649 #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vsetpvf)
1650 #define sv_vsetpvf(sv, pat, args) sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*))
1651 #endif
1652 #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_catpvf_mg)
1653 #if defined(NEED_sv_catpvf_mg)
1654 static void DPPP_(my_sv_catpvf_mg)(pTHX_ SV *sv, const char *pat, ...);
1655 static
1656 #else
1657 extern void DPPP_(my_sv_catpvf_mg)(pTHX_ SV *sv, const char *pat, ...);
1658 #endif
1659 #define Perl_sv_catpvf_mg DPPP_(my_sv_catpvf_mg)
1660 #if defined(NEED_sv_catpvf_mg) || defined(NEED_sv_catpvf_mg_GLOBAL)
1661 void
1662 DPPP_(my_sv_catpvf_mg)(pTHX_ SV *sv, const char *pat, ...)
1663 {
1664 va_list args;
1665 va_start(args, pat);
1666 sv_vcatpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*));
1667 SvSETMAGIC(sv);
1668 va_end(args);
1669 }
1670 #endif
1671 #endif
1672 #ifdef PERL_IMPLICIT_CONTEXT
1673 #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_catpvf_mg_nocontext)
1674 #if defined(NEED_sv_catpvf_mg_nocontext)
1675 static void DPPP_(my_sv_catpvf_mg_nocontext)(SV *sv, const char *pat, ...);
1676 static
1677 #else
1678 extern void DPPP_(my_sv_catpvf_mg_nocontext)(SV *sv, const char *pat, ...);
1679 #endif
1680 #define sv_catpvf_mg_nocontext DPPP_(my_sv_catpvf_mg_nocontext)
1681 #define Perl_sv_catpvf_mg_nocontext DPPP_(my_sv_catpvf_mg_nocontext)
1682 #if defined(NEED_sv_catpvf_mg_nocontext) || defined(NEED_sv_catpvf_mg_nocontext_GLOBAL)
1683 void
1684 DPPP_(my_sv_catpvf_mg_nocontext)(SV *sv, const char *pat, ...)
1685 {
1686 dTHX;
1687 va_list args;
1688 va_start(args, pat);
1689 sv_vcatpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*));
1690 SvSETMAGIC(sv);
1691 va_end(args);
1692 }
1693 #endif
1694 #endif
1695 #endif
1696 #ifndef sv_catpvf_mg
1697 #ifdef PERL_IMPLICIT_CONTEXT
1698 #define sv_catpvf_mg Perl_sv_catpvf_mg_nocontext
1699 #else
1700 #define sv_catpvf_mg Perl_sv_catpvf_mg
1701 #endif
1702 #endif
1703 #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vcatpvf_mg)
1704 #define sv_vcatpvf_mg(sv, pat, args) \
1705 STMT_START { \
1706 sv_vcatpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*)); \
1707 SvSETMAGIC(sv); \
1708 } STMT_END
1709 #endif
1710 #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_setpvf_mg)
1711 #if defined(NEED_sv_setpvf_mg)
1712 static void DPPP_(my_sv_setpvf_mg)(pTHX_ SV *sv, const char *pat, ...);
1713 static
1714 #else
1715 extern void DPPP_(my_sv_setpvf_mg)(pTHX_ SV *sv, const char *pat, ...);
1716 #endif
1717 #define Perl_sv_setpvf_mg DPPP_(my_sv_setpvf_mg)
1718 #if defined(NEED_sv_setpvf_mg) || defined(NEED_sv_setpvf_mg_GLOBAL)
1719 void
1720 DPPP_(my_sv_setpvf_mg)(pTHX_ SV *sv, const char *pat, ...)
1721 {
1722 va_list args;
1723 va_start(args, pat);
1724 sv_vsetpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*));
1725 SvSETMAGIC(sv);
1726 va_end(args);
1727 }
1728 #endif
1729 #endif
1730 #ifdef PERL_IMPLICIT_CONTEXT
1731 #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_setpvf_mg_nocontext)
1732 #if defined(NEED_sv_setpvf_mg_nocontext)
1733 static void DPPP_(my_sv_setpvf_mg_nocontext)(SV *sv, const char *pat, ...);
1734 static
1735 #else
1736 extern void DPPP_(my_sv_setpvf_mg_nocontext)(SV *sv, const char *pat, ...);
1737 #endif
1738 #define sv_setpvf_mg_nocontext DPPP_(my_sv_setpvf_mg_nocontext)
1739 #define Perl_sv_setpvf_mg_nocontext DPPP_(my_sv_setpvf_mg_nocontext)
1740 #if defined(NEED_sv_setpvf_mg_nocontext) || defined(NEED_sv_setpvf_mg_nocontext_GLOBAL)
1741 void
1742 DPPP_(my_sv_setpvf_mg_nocontext)(SV *sv, const char *pat, ...)
1743 {
1744 dTHX;
1745 va_list args;
1746 va_start(args, pat);
1747 sv_vsetpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*));
1748 SvSETMAGIC(sv);
1749 va_end(args);
1750 }
1751 #endif
1752 #endif
1753 #endif
1754 #ifndef sv_setpvf_mg
1755 #ifdef PERL_IMPLICIT_CONTEXT
1756 #define sv_setpvf_mg Perl_sv_setpvf_mg_nocontext
1757 #else
1758 #define sv_setpvf_mg Perl_sv_setpvf_mg
1759 #endif
1760 #endif
1761 #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vsetpvf_mg)
1762 #define sv_vsetpvf_mg(sv, pat, args) \
1763 STMT_START { \
1764 sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*)); \
1765 SvSETMAGIC(sv); \
1766 } STMT_END
1767 #endif
1768 #ifndef newSVpvn_share
1769 #if defined(NEED_newSVpvn_share)
1770 static SV * DPPP_(my_newSVpvn_share)(pTHX_ const char *src, I32 len, U32 hash);
1771 static
1772 #else
1773 extern SV * DPPP_(my_newSVpvn_share)(pTHX_ const char *src, I32 len, U32 hash);
1774 #endif
1775 #ifdef newSVpvn_share
1776 #undef newSVpvn_share
1777 #endif
1778 #define newSVpvn_share(a,b,c) DPPP_(my_newSVpvn_share)(aTHX_ a,b,c)
1779 #define Perl_newSVpvn_share DPPP_(my_newSVpvn_share)
1780 #if defined(NEED_newSVpvn_share) || defined(NEED_newSVpvn_share_GLOBAL)
1781 SV *
1782 DPPP_(my_newSVpvn_share)(pTHX_ const char *src, I32 len, U32 hash)
1783 {
1784 SV *sv;
1785 if (len < 0)
1786 len = -len;
1787 if (!hash)
1788 PERL_HASH(hash, (char*) src, len);
1789 sv = newSVpvn((char *) src, len);
1790 sv_upgrade(sv, SVt_PVIV);
1791 SvIVX(sv) = hash;
1792 SvREADONLY_on(sv);
1793 SvPOK_on(sv);
1794 return sv;
1795 }
1796 #endif
1797 #endif
1798 #ifndef SvSHARED_HASH
1799 #define SvSHARED_HASH(sv) (0 + SvUVX(sv))
1800 #endif
1801 #ifndef HvNAME_get
1802 #define HvNAME_get(hv) HvNAME(hv)
1803 #endif
1804 #ifndef HvNAMELEN_get
1805 #define HvNAMELEN_get(hv) (HvNAME_get(hv) ? (I32)strlen(HvNAME_get(hv)) : 0)
1806 #endif
1807 #ifndef GvSVn
1808 #define GvSVn(gv) GvSV(gv)
1809 #endif
1810 #ifndef isGV_with_GP
1811 #define isGV_with_GP(gv) isGV(gv)
1812 #endif
1813 #ifndef gv_fetchpvn_flags
1814 #define gv_fetchpvn_flags(name, len, flags, svt) gv_fetchpv(name, flags, svt)
1815 #endif
1816 #ifndef gv_fetchsv
1817 #define gv_fetchsv(name, flags, svt) gv_fetchpv(SvPV_nolen_const(name), flags, svt)
1818 #endif
1819 #ifndef get_cvn_flags
1820 #define get_cvn_flags(name, namelen, flags) get_cv(name, flags)
1821 #endif
1822 #ifndef WARN_ALL
1823 #define WARN_ALL 0
1824 #endif
1825 #ifndef WARN_CLOSURE
1826 #define WARN_CLOSURE 1
1827 #endif
1828 #ifndef WARN_DEPRECATED
1829 #define WARN_DEPRECATED 2
1830 #endif
1831 #ifndef WARN_EXITING
1832 #define WARN_EXITING 3
1833 #endif
1834 #ifndef WARN_GLOB
1835 #define WARN_GLOB 4
1836 #endif
1837 #ifndef WARN_IO
1838 #define WARN_IO 5
1839 #endif
1840 #ifndef WARN_CLOSED
1841 #define WARN_CLOSED 6
1842 #endif
1843 #ifndef WARN_EXEC
1844 #define WARN_EXEC 7
1845 #endif
1846 #ifndef WARN_LAYER
1847 #define WARN_LAYER 8
1848 #endif
1849 #ifndef WARN_NEWLINE
1850 #define WARN_NEWLINE 9
1851 #endif
1852 #ifndef WARN_PIPE
1853 #define WARN_PIPE 10
1854 #endif
1855 #ifndef WARN_UNOPENED
1856 #define WARN_UNOPENED 11
1857 #endif
1858 #ifndef WARN_MISC
1859 #define WARN_MISC 12
1860 #endif
1861 #ifndef WARN_NUMERIC
1862 #define WARN_NUMERIC 13
1863 #endif
1864 #ifndef WARN_ONCE
1865 #define WARN_ONCE 14
1866 #endif
1867 #ifndef WARN_OVERFLOW
1868 #define WARN_OVERFLOW 15
1869 #endif
1870 #ifndef WARN_PACK
1871 #define WARN_PACK 16
1872 #endif
1873 #ifndef WARN_PORTABLE
1874 #define WARN_PORTABLE 17
1875 #endif
1876 #ifndef WARN_RECURSION
1877 #define WARN_RECURSION 18
1878 #endif
1879 #ifndef WARN_REDEFINE
1880 #define WARN_REDEFINE 19
1881 #endif
1882 #ifndef WARN_REGEXP
1883 #define WARN_REGEXP 20
1884 #endif
1885 #ifndef WARN_SEVERE
1886 #define WARN_SEVERE 21
1887 #endif
1888 #ifndef WARN_DEBUGGING
1889 #define WARN_DEBUGGING 22
1890 #endif
1891 #ifndef WARN_INPLACE
1892 #define WARN_INPLACE 23
1893 #endif
1894 #ifndef WARN_INTERNAL
1895 #define WARN_INTERNAL 24
1896 #endif
1897 #ifndef WARN_MALLOC
1898 #define WARN_MALLOC 25
1899 #endif
1900 #ifndef WARN_SIGNAL
1901 #define WARN_SIGNAL 26
1902 #endif
1903 #ifndef WARN_SUBSTR
1904 #define WARN_SUBSTR 27
1905 #endif
1906 #ifndef WARN_SYNTAX
1907 #define WARN_SYNTAX 28
1908 #endif
1909 #ifndef WARN_AMBIGUOUS
1910 #define WARN_AMBIGUOUS 29
1911 #endif
1912 #ifndef WARN_BAREWORD
1913 #define WARN_BAREWORD 30
1914 #endif
1915 #ifndef WARN_DIGIT
1916 #define WARN_DIGIT 31
1917 #endif
1918 #ifndef WARN_PARENTHESIS
1919 #define WARN_PARENTHESIS 32
1920 #endif
1921 #ifndef WARN_PRECEDENCE
1922 #define WARN_PRECEDENCE 33
1923 #endif
1924 #ifndef WARN_PRINTF
1925 #define WARN_PRINTF 34
1926 #endif
1927 #ifndef WARN_PROTOTYPE
1928 #define WARN_PROTOTYPE 35
1929 #endif
1930 #ifndef WARN_QW
1931 #define WARN_QW 36
1932 #endif
1933 #ifndef WARN_RESERVED
1934 #define WARN_RESERVED 37
1935 #endif
1936 #ifndef WARN_SEMICOLON
1937 #define WARN_SEMICOLON 38
1938 #endif
1939 #ifndef WARN_TAINT
1940 #define WARN_TAINT 39
1941 #endif
1942 #ifndef WARN_THREADS
1943 #define WARN_THREADS 40
1944 #endif
1945 #ifndef WARN_UNINITIALIZED
1946 #define WARN_UNINITIALIZED 41
1947 #endif
1948 #ifndef WARN_UNPACK
1949 #define WARN_UNPACK 42
1950 #endif
1951 #ifndef WARN_UNTIE
1952 #define WARN_UNTIE 43
1953 #endif
1954 #ifndef WARN_UTF8
1955 #define WARN_UTF8 44
1956 #endif
1957 #ifndef WARN_VOID
1958 #define WARN_VOID 45
1959 #endif
1960 #ifndef WARN_ASSERTIONS
1961 #define WARN_ASSERTIONS 46
1962 #endif
1963 #ifndef packWARN
1964 #define packWARN(a) (a)
1965 #endif
1966 #ifndef ckWARN
1967 #ifdef G_WARN_ON
1968 #define ckWARN(a) (PL_dowarn & G_WARN_ON)
1969 #else
1970 #define ckWARN(a) PL_dowarn
1971 #endif
1972 #endif
1973 #if (PERL_BCDVERSION >= 0x5004000) && !defined(warner)
1974 #if defined(NEED_warner)
1975 static void DPPP_(my_warner)(U32 err, const char *pat, ...);
1976 static
1977 #else
1978 extern void DPPP_(my_warner)(U32 err, const char *pat, ...);
1979 #endif
1980 #define Perl_warner DPPP_(my_warner)
1981 #if defined(NEED_warner) || defined(NEED_warner_GLOBAL)
1982 void
1983 DPPP_(my_warner)(U32 err, const char *pat, ...)
1984 {
1985 SV *sv;
1986 va_list args;
1987 PERL_UNUSED_ARG(err);
1988 va_start(args, pat);
1989 sv = vnewSVpvf(pat, &args);
1990 va_end(args);
1991 sv_2mortal(sv);
1992 warn("%s", SvPV_nolen(sv));
1993 }
1994 #define warner Perl_warner
1995 #define Perl_warner_nocontext Perl_warner
1996 #endif
1997 #endif
1998 #ifndef STR_WITH_LEN
1999 #define STR_WITH_LEN(s) (s ""), (sizeof(s)-1)
2000 #endif
2001 #ifndef newSVpvs
2002 #define newSVpvs(str) newSVpvn(str "", sizeof(str) - 1)
2003 #endif
2004 #ifndef newSVpvs_flags
2005 #define newSVpvs_flags(str, flags) newSVpvn_flags(str "", sizeof(str) - 1, flags)
2006 #endif
2007 #ifndef newSVpvs_share
2008 #define newSVpvs_share(str) newSVpvn_share(str "", sizeof(str) - 1, 0)
2009 #endif
2010 #ifndef sv_catpvs
2011 #define sv_catpvs(sv, str) sv_catpvn(sv, str "", sizeof(str) - 1)
2012 #endif
2013 #ifndef sv_setpvs
2014 #define sv_setpvs(sv, str) sv_setpvn(sv, str "", sizeof(str) - 1)
2015 #endif
2016 #ifndef hv_fetchs
2017 #define hv_fetchs(hv, key, lval) hv_fetch(hv, key "", sizeof(key) - 1, lval)
2018 #endif
2019 #ifndef hv_stores
2020 #define hv_stores(hv, key, val) hv_store(hv, key "", sizeof(key) - 1, val, 0)
2021 #endif
2022 #ifndef gv_fetchpvs
2023 #define gv_fetchpvs(name, flags, svt) gv_fetchpvn_flags(name "", sizeof(name) - 1, flags, svt)
2024 #endif
2025 #ifndef gv_stashpvs
2026 #define gv_stashpvs(name, flags) gv_stashpvn(name "", sizeof(name) - 1, flags)
2027 #endif
2028 #ifndef get_cvs
2029 #define get_cvs(name, flags) get_cvn_flags(name "", sizeof(name)-1, flags)
2030 #endif
2031 #ifndef SvGETMAGIC
2032 #define SvGETMAGIC(x) STMT_START { if (SvGMAGICAL(x)) mg_get(x); } STMT_END
2033 #endif
2034 #ifndef HEf_SVKEY
2035 #define HEf_SVKEY -2
2036 #endif
2037 #if defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN)
2038 #define MUTABLE_PTR(p) ({ void *_p = (p); _p; })
2039 #else
2040 #define MUTABLE_PTR(p) ((void *) (p))
2041 #endif
2042 #define MUTABLE_SV(p) ((SV *)MUTABLE_PTR(p))
2043 #ifndef PERL_MAGIC_sv
2044 #define PERL_MAGIC_sv '\0'
2045 #endif
2046 #ifndef PERL_MAGIC_overload
2047 #define PERL_MAGIC_overload 'A'
2048 #endif
2049 #ifndef PERL_MAGIC_overload_elem
2050 #define PERL_MAGIC_overload_elem 'a'
2051 #endif
2052 #ifndef PERL_MAGIC_overload_table
2053 #define PERL_MAGIC_overload_table 'c'
2054 #endif
2055 #ifndef PERL_MAGIC_bm
2056 #define PERL_MAGIC_bm 'B'
2057 #endif
2058 #ifndef PERL_MAGIC_regdata
2059 #define PERL_MAGIC_regdata 'D'
2060 #endif
2061 #ifndef PERL_MAGIC_regdatum
2062 #define PERL_MAGIC_regdatum 'd'
2063 #endif
2064 #ifndef PERL_MAGIC_env
2065 #define PERL_MAGIC_env 'E'
2066 #endif
2067 #ifndef PERL_MAGIC_envelem
2068 #define PERL_MAGIC_envelem 'e'
2069 #endif
2070 #ifndef PERL_MAGIC_fm
2071 #define PERL_MAGIC_fm 'f'
2072 #endif
2073 #ifndef PERL_MAGIC_regex_global
2074 #define PERL_MAGIC_regex_global 'g'
2075 #endif
2076 #ifndef PERL_MAGIC_isa
2077 #define PERL_MAGIC_isa 'I'
2078 #endif
2079 #ifndef PERL_MAGIC_isaelem
2080 #define PERL_MAGIC_isaelem 'i'
2081 #endif
2082 #ifndef PERL_MAGIC_nkeys
2083 #define PERL_MAGIC_nkeys 'k'
2084 #endif
2085 #ifndef PERL_MAGIC_dbfile
2086 #define PERL_MAGIC_dbfile 'L'
2087 #endif
2088 #ifndef PERL_MAGIC_dbline
2089 #define PERL_MAGIC_dbline 'l'
2090 #endif
2091 #ifndef PERL_MAGIC_mutex
2092 #define PERL_MAGIC_mutex 'm'
2093 #endif
2094 #ifndef PERL_MAGIC_shared
2095 #define PERL_MAGIC_shared 'N'
2096 #endif
2097 #ifndef PERL_MAGIC_shared_scalar
2098 #define PERL_MAGIC_shared_scalar 'n'
2099 #endif
2100 #ifndef PERL_MAGIC_collxfrm
2101 #define PERL_MAGIC_collxfrm 'o'
2102 #endif
2103 #ifndef PERL_MAGIC_tied
2104 #define PERL_MAGIC_tied 'P'
2105 #endif
2106 #ifndef PERL_MAGIC_tiedelem
2107 #define PERL_MAGIC_tiedelem 'p'
2108 #endif
2109 #ifndef PERL_MAGIC_tiedscalar
2110 #define PERL_MAGIC_tiedscalar 'q'
2111 #endif
2112 #ifndef PERL_MAGIC_qr
2113 #define PERL_MAGIC_qr 'r'
2114 #endif
2115 #ifndef PERL_MAGIC_sig
2116 #define PERL_MAGIC_sig 'S'
2117 #endif
2118 #ifndef PERL_MAGIC_sigelem
2119 #define PERL_MAGIC_sigelem 's'
2120 #endif
2121 #ifndef PERL_MAGIC_taint
2122 #define PERL_MAGIC_taint 't'
2123 #endif
2124 #ifndef PERL_MAGIC_uvar
2125 #define PERL_MAGIC_uvar 'U'
2126 #endif
2127 #ifndef PERL_MAGIC_uvar_elem
2128 #define PERL_MAGIC_uvar_elem 'u'
2129 #endif
2130 #ifndef PERL_MAGIC_vstring
2131 #define PERL_MAGIC_vstring 'V'
2132 #endif
2133 #ifndef PERL_MAGIC_vec
2134 #define PERL_MAGIC_vec 'v'
2135 #endif
2136 #ifndef PERL_MAGIC_utf8
2137 #define PERL_MAGIC_utf8 'w'
2138 #endif
2139 #ifndef PERL_MAGIC_substr
2140 #define PERL_MAGIC_substr 'x'
2141 #endif
2142 #ifndef PERL_MAGIC_defelem
2143 #define PERL_MAGIC_defelem 'y'
2144 #endif
2145 #ifndef PERL_MAGIC_glob
2146 #define PERL_MAGIC_glob '*'
2147 #endif
2148 #ifndef PERL_MAGIC_arylen
2149 #define PERL_MAGIC_arylen '#'
2150 #endif
2151 #ifndef PERL_MAGIC_pos
2152 #define PERL_MAGIC_pos '.'
2153 #endif
2154 #ifndef PERL_MAGIC_backref
2155 #define PERL_MAGIC_backref '<'
2156 #endif
2157 #ifndef PERL_MAGIC_ext
2158 #define PERL_MAGIC_ext '~'
2159 #endif
2160 #ifndef sv_catpvn_nomg
2161 #define sv_catpvn_nomg sv_catpvn
2162 #endif
2163 #ifndef sv_catsv_nomg
2164 #define sv_catsv_nomg sv_catsv
2165 #endif
2166 #ifndef sv_setsv_nomg
2167 #define sv_setsv_nomg sv_setsv
2168 #endif
2169 #ifndef sv_pvn_nomg
2170 #define sv_pvn_nomg sv_pvn
2171 #endif
2172 #ifndef SvIV_nomg
2173 #define SvIV_nomg SvIV
2174 #endif
2175 #ifndef SvUV_nomg
2176 #define SvUV_nomg SvUV
2177 #endif
2178 #ifndef sv_catpv_mg
2179 #define sv_catpv_mg(sv, ptr) \
2180 STMT_START { \
2181 SV *TeMpSv = sv; \
2182 sv_catpv(TeMpSv,ptr); \
2183 SvSETMAGIC(TeMpSv); \
2184 } STMT_END
2185 #endif
2186 #ifndef sv_catpvn_mg
2187 #define sv_catpvn_mg(sv, ptr, len) \
2188 STMT_START { \
2189 SV *TeMpSv = sv; \
2190 sv_catpvn(TeMpSv,ptr,len); \
2191 SvSETMAGIC(TeMpSv); \
2192 } STMT_END
2193 #endif
2194 #ifndef sv_catsv_mg
2195 #define sv_catsv_mg(dsv, ssv) \
2196 STMT_START { \
2197 SV *TeMpSv = dsv; \
2198 sv_catsv(TeMpSv,ssv); \
2199 SvSETMAGIC(TeMpSv); \
2200 } STMT_END
2201 #endif
2202 #ifndef sv_setiv_mg
2203 #define sv_setiv_mg(sv, i) \
2204 STMT_START { \
2205 SV *TeMpSv = sv; \
2206 sv_setiv(TeMpSv,i); \
2207 SvSETMAGIC(TeMpSv); \
2208 } STMT_END
2209 #endif
2210 #ifndef sv_setnv_mg
2211 #define sv_setnv_mg(sv, num) \
2212 STMT_START { \
2213 SV *TeMpSv = sv; \
2214 sv_setnv(TeMpSv,num); \
2215 SvSETMAGIC(TeMpSv); \
2216 } STMT_END
2217 #endif
2218 #ifndef sv_setpv_mg
2219 #define sv_setpv_mg(sv, ptr) \
2220 STMT_START { \
2221 SV *TeMpSv = sv; \
2222 sv_setpv(TeMpSv,ptr); \
2223 SvSETMAGIC(TeMpSv); \
2224 } STMT_END
2225 #endif
2226 #ifndef sv_setpvn_mg
2227 #define sv_setpvn_mg(sv, ptr, len) \
2228 STMT_START { \
2229 SV *TeMpSv = sv; \
2230 sv_setpvn(TeMpSv,ptr,len); \
2231 SvSETMAGIC(TeMpSv); \
2232 } STMT_END
2233 #endif
2234 #ifndef sv_setsv_mg
2235 #define sv_setsv_mg(dsv, ssv) \
2236 STMT_START { \
2237 SV *TeMpSv = dsv; \
2238 sv_setsv(TeMpSv,ssv); \
2239 SvSETMAGIC(TeMpSv); \
2240 } STMT_END
2241 #endif
2242 #ifndef sv_setuv_mg
2243 #define sv_setuv_mg(sv, i) \
2244 STMT_START { \
2245 SV *TeMpSv = sv; \
2246 sv_setuv(TeMpSv,i); \
2247 SvSETMAGIC(TeMpSv); \
2248 } STMT_END
2249 #endif
2250 #ifndef sv_usepvn_mg
2251 #define sv_usepvn_mg(sv, ptr, len) \
2252 STMT_START { \
2253 SV *TeMpSv = sv; \
2254 sv_usepvn(TeMpSv,ptr,len); \
2255 SvSETMAGIC(TeMpSv); \
2256 } STMT_END
2257 #endif
2258 #ifndef SvVSTRING_mg
2259 #define SvVSTRING_mg(sv) (SvMAGICAL(sv) ? mg_find(sv, PERL_MAGIC_vstring) : NULL)
2260 #endif
2261 #if (PERL_BCDVERSION < 0x5004000)
2262 #elif (PERL_BCDVERSION < 0x5008000)
2263 #define sv_magic_portable(sv, obj, how, name, namlen) \
2264 STMT_START { \
2265 SV *SvMp_sv = (sv); \
2266 char *SvMp_name = (char *) (name); \
2267 I32 SvMp_namlen = (namlen); \
2268 if (SvMp_name && SvMp_namlen == 0) \
2269 { \
2270 MAGIC *mg; \
2271 sv_magic(SvMp_sv, obj, how, 0, 0); \
2272 mg = SvMAGIC(SvMp_sv); \
2273 mg->mg_len = -42; \
2274 mg->mg_ptr = SvMp_name; \
2275 } \
2276 else \
2277 { \
2278 sv_magic(SvMp_sv, obj, how, SvMp_name, SvMp_namlen); \
2279 } \
2280 } STMT_END
2281 #else
2282 #define sv_magic_portable(a, b, c, d, e) sv_magic(a, b, c, d, e)
2283 #endif
2284 #if !defined(mg_findext)
2285 #if defined(NEED_mg_findext)
2286 static MAGIC * DPPP_(my_mg_findext)(SV * sv, int type, const MGVTBL *vtbl);
2287 static
2288 #else
2289 extern MAGIC * DPPP_(my_mg_findext)(SV * sv, int type, const MGVTBL *vtbl);
2290 #endif
2291 #define mg_findext DPPP_(my_mg_findext)
2292 #define Perl_mg_findext DPPP_(my_mg_findext)
2293 #if defined(NEED_mg_findext) || defined(NEED_mg_findext_GLOBAL)
2294 MAGIC *
2295 DPPP_(my_mg_findext)(SV * sv, int type, const MGVTBL *vtbl) {
2296 if (sv) {
2297 MAGIC *mg;
2298 #ifdef AvPAD_NAMELIST
2299 assert(!(SvTYPE(sv) == SVt_PVAV && AvPAD_NAMELIST(sv)));
2300 #endif
2301 for (mg = SvMAGIC (sv); mg; mg = mg->mg_moremagic) {
2302 if (mg->mg_type == type && mg->mg_virtual == vtbl)
2303 return mg;
2304 }
2305 }
2306 return NULL;
2307 }
2308 #endif
2309 #endif
2310 #if !defined(sv_unmagicext)
2311 #if defined(NEED_sv_unmagicext)
2312 static int DPPP_(my_sv_unmagicext)(pTHX_ SV * const sv, const int type, MGVTBL * vtbl);
2313 static
2314 #else
2315 extern int DPPP_(my_sv_unmagicext)(pTHX_ SV * const sv, const int type, MGVTBL * vtbl);
2316 #endif
2317 #ifdef sv_unmagicext
2318 #undef sv_unmagicext
2319 #endif
2320 #define sv_unmagicext(a,b,c) DPPP_(my_sv_unmagicext)(aTHX_ a,b,c)
2321 #define Perl_sv_unmagicext DPPP_(my_sv_unmagicext)
2322 #if defined(NEED_sv_unmagicext) || defined(NEED_sv_unmagicext_GLOBAL)
2323 int
2324 DPPP_(my_sv_unmagicext)(pTHX_ SV *const sv, const int type, MGVTBL *vtbl)
2325 {
2326 MAGIC* mg;
2327 MAGIC** mgp;
2328 if (SvTYPE(sv) < SVt_PVMG || !SvMAGIC(sv))
2329 return 0;
2330 mgp = &(SvMAGIC(sv));
2331 for (mg = *mgp; mg; mg = *mgp) {
2332 const MGVTBL* const virt = mg->mg_virtual;
2333 if (mg->mg_type == type && virt == vtbl) {
2334 *mgp = mg->mg_moremagic;
2335 if (virt && virt->svt_free)
2336 virt->svt_free(aTHX_ sv, mg);
2337 if (mg->mg_ptr && mg->mg_type != PERL_MAGIC_regex_global) {
2338 if (mg->mg_len > 0)
2339 Safefree(mg->mg_ptr);
2340 else if (mg->mg_len == HEf_SVKEY)
2341 SvREFCNT_dec(MUTABLE_SV(mg->mg_ptr));
2342 else if (mg->mg_type == PERL_MAGIC_utf8)
2343 Safefree(mg->mg_ptr);
2344 }
2345 if (mg->mg_flags & MGf_REFCOUNTED)
2346 SvREFCNT_dec(mg->mg_obj);
2347 Safefree(mg);
2348 }
2349 else
2350 mgp = &mg->mg_moremagic;
2351 }
2352 if (SvMAGIC(sv)) {
2353 if (SvMAGICAL(sv))
2354 mg_magical(sv);
2355 }
2356 else {
2357 SvMAGICAL_off(sv);
2358 SvFLAGS(sv) |= (SvFLAGS(sv) & (SVp_IOK|SVp_NOK|SVp_POK)) >> PRIVSHIFT;
2359 }
2360 return 0;
2361 }
2362 #endif
2363 #endif
2364 #ifdef USE_ITHREADS
2365 #ifndef CopFILE
2366 #define CopFILE(c) ((c)->cop_file)
2367 #endif
2368 #ifndef CopFILEGV
2369 #define CopFILEGV(c) (CopFILE(c) ? gv_fetchfile(CopFILE(c)) : Nullgv)
2370 #endif
2371 #ifndef CopFILE_set
2372 #define CopFILE_set(c,pv) ((c)->cop_file = savepv(pv))
2373 #endif
2374 #ifndef CopFILESV
2375 #define CopFILESV(c) (CopFILE(c) ? GvSV(gv_fetchfile(CopFILE(c))) : Nullsv)
2376 #endif
2377 #ifndef CopFILEAV
2378 #define CopFILEAV(c) (CopFILE(c) ? GvAV(gv_fetchfile(CopFILE(c))) : Nullav)
2379 #endif
2380 #ifndef CopSTASHPV
2381 #define CopSTASHPV(c) ((c)->cop_stashpv)
2382 #endif
2383 #ifndef CopSTASHPV_set
2384 #define CopSTASHPV_set(c,pv) ((c)->cop_stashpv = ((pv) ? savepv(pv) : Nullch))
2385 #endif
2386 #ifndef CopSTASH
2387 #define CopSTASH(c) (CopSTASHPV(c) ? gv_stashpv(CopSTASHPV(c),GV_ADD) : Nullhv)
2388 #endif
2389 #ifndef CopSTASH_set
2390 #define CopSTASH_set(c,hv) CopSTASHPV_set(c, (hv) ? HvNAME(hv) : Nullch)
2391 #endif
2392 #ifndef CopSTASH_eq
2393 #define CopSTASH_eq(c,hv) ((hv) && (CopSTASHPV(c) == HvNAME(hv) \
2394 || (CopSTASHPV(c) && HvNAME(hv) \
2395 && strEQ(CopSTASHPV(c), HvNAME(hv)))))
2396 #endif
2397 #else
2398 #ifndef CopFILEGV
2399 #define CopFILEGV(c) ((c)->cop_filegv)
2400 #endif
2401 #ifndef CopFILEGV_set
2402 #define CopFILEGV_set(c,gv) ((c)->cop_filegv = (GV*)SvREFCNT_inc(gv))
2403 #endif
2404 #ifndef CopFILE_set
2405 #define CopFILE_set(c,pv) CopFILEGV_set((c), gv_fetchfile(pv))
2406 #endif
2407 #ifndef CopFILESV
2408 #define CopFILESV(c) (CopFILEGV(c) ? GvSV(CopFILEGV(c)) : Nullsv)
2409 #endif
2410 #ifndef CopFILEAV
2411 #define CopFILEAV(c) (CopFILEGV(c) ? GvAV(CopFILEGV(c)) : Nullav)
2412 #endif
2413 #ifndef CopFILE
2414 #define CopFILE(c) (CopFILESV(c) ? SvPVX(CopFILESV(c)) : Nullch)
2415 #endif
2416 #ifndef CopSTASH
2417 #define CopSTASH(c) ((c)->cop_stash)
2418 #endif
2419 #ifndef CopSTASH_set
2420 #define CopSTASH_set(c,hv) ((c)->cop_stash = (hv))
2421 #endif
2422 #ifndef CopSTASHPV
2423 #define CopSTASHPV(c) (CopSTASH(c) ? HvNAME(CopSTASH(c)) : Nullch)
2424 #endif
2425 #ifndef CopSTASHPV_set
2426 #define CopSTASHPV_set(c,pv) CopSTASH_set((c), gv_stashpv(pv,GV_ADD))
2427 #endif
2428 #ifndef CopSTASH_eq
2429 #define CopSTASH_eq(c,hv) (CopSTASH(c) == (hv))
2430 #endif
2431 #endif
2432 #if (PERL_BCDVERSION >= 0x5006000)
2433 #ifndef caller_cx
2434 #if defined(NEED_caller_cx) || defined(NEED_caller_cx_GLOBAL)
2435 static I32
2436 DPPP_dopoptosub_at(const PERL_CONTEXT *cxstk, I32 startingblock)
2437 {
2438 I32 i;
2439 for (i = startingblock; i >= 0; i--) {
2440 register const PERL_CONTEXT * const cx = &cxstk[i];
2441 switch (CxTYPE(cx)) {
2442 default:
2443 continue;
2444 case CXt_EVAL:
2445 case CXt_SUB:
2446 case CXt_FORMAT:
2447 return i;
2448 }
2449 }
2450 return i;
2451 }
2452 #endif
2453 #if defined(NEED_caller_cx)
2454 static const PERL_CONTEXT * DPPP_(my_caller_cx)(pTHX_ I32 count, const PERL_CONTEXT **dbcxp);
2455 static
2456 #else
2457 extern const PERL_CONTEXT * DPPP_(my_caller_cx)(pTHX_ I32 count, const PERL_CONTEXT **dbcxp);
2458 #endif
2459 #ifdef caller_cx
2460 #undef caller_cx
2461 #endif
2462 #define caller_cx(a,b) DPPP_(my_caller_cx)(aTHX_ a,b)
2463 #define Perl_caller_cx DPPP_(my_caller_cx)
2464 #if defined(NEED_caller_cx) || defined(NEED_caller_cx_GLOBAL)
2465 const PERL_CONTEXT *
2466 DPPP_(my_caller_cx)(pTHX_ I32 count, const PERL_CONTEXT **dbcxp)
2467 {
2468 register I32 cxix = DPPP_dopoptosub_at(cxstack, cxstack_ix);
2469 register const PERL_CONTEXT *cx;
2470 register const PERL_CONTEXT *ccstack = cxstack;
2471 const PERL_SI *top_si = PL_curstackinfo;
2472 for (;;) {
2473 while (cxix < 0 && top_si->si_type != PERLSI_MAIN) {
2474 top_si = top_si->si_prev;
2475 ccstack = top_si->si_cxstack;
2476 cxix = DPPP_dopoptosub_at(ccstack, top_si->si_cxix);
2477 }
2478 if (cxix < 0)
2479 return NULL;
2480 if (PL_DBsub && GvCV(PL_DBsub) && cxix >= 0 &&
2481 ccstack[cxix].blk_sub.cv == GvCV(PL_DBsub))
2482 count++;
2483 if (!count--)
2484 break;
2485 cxix = DPPP_dopoptosub_at(ccstack, cxix - 1);
2486 }
2487 cx = &ccstack[cxix];
2488 if (dbcxp) *dbcxp = cx;
2489 if (CxTYPE(cx) == CXt_SUB || CxTYPE(cx) == CXt_FORMAT) {
2490 const I32 dbcxix = DPPP_dopoptosub_at(ccstack, cxix - 1);
2491 if (PL_DBsub && GvCV(PL_DBsub) && dbcxix >= 0 && ccstack[dbcxix].blk_sub.cv == GvCV(PL_DBsub))
2492 cx = &ccstack[dbcxix];
2493 }
2494 return cx;
2495 }
2496 #endif
2497 #endif
2498 #endif
2499 #ifndef IN_PERL_COMPILETIME
2500 #define IN_PERL_COMPILETIME (PL_curcop == &PL_compiling)
2501 #endif
2502 #ifndef IN_LOCALE_RUNTIME
2503 #define IN_LOCALE_RUNTIME (PL_curcop->op_private & HINT_LOCALE)
2504 #endif
2505 #ifndef IN_LOCALE_COMPILETIME
2506 #define IN_LOCALE_COMPILETIME (PL_hints & HINT_LOCALE)
2507 #endif
2508 #ifndef IN_LOCALE
2509 #define IN_LOCALE (IN_PERL_COMPILETIME ? IN_LOCALE_COMPILETIME : IN_LOCALE_RUNTIME)
2510 #endif
2511 #ifndef IS_NUMBER_IN_UV
2512 #define IS_NUMBER_IN_UV 0x01
2513 #endif
2514 #ifndef IS_NUMBER_GREATER_THAN_UV_MAX
2515 #define IS_NUMBER_GREATER_THAN_UV_MAX 0x02
2516 #endif
2517 #ifndef IS_NUMBER_NOT_INT
2518 #define IS_NUMBER_NOT_INT 0x04
2519 #endif
2520 #ifndef IS_NUMBER_NEG
2521 #define IS_NUMBER_NEG 0x08
2522 #endif
2523 #ifndef IS_NUMBER_INFINITY
2524 #define IS_NUMBER_INFINITY 0x10
2525 #endif
2526 #ifndef IS_NUMBER_NAN
2527 #define IS_NUMBER_NAN 0x20
2528 #endif
2529 #ifndef GROK_NUMERIC_RADIX
2530 #define GROK_NUMERIC_RADIX(sp, send) grok_numeric_radix(sp, send)
2531 #endif
2532 #ifndef PERL_SCAN_GREATER_THAN_UV_MAX
2533 #define PERL_SCAN_GREATER_THAN_UV_MAX 0x02
2534 #endif
2535 #ifndef PERL_SCAN_SILENT_ILLDIGIT
2536 #define PERL_SCAN_SILENT_ILLDIGIT 0x04
2537 #endif
2538 #ifndef PERL_SCAN_ALLOW_UNDERSCORES
2539 #define PERL_SCAN_ALLOW_UNDERSCORES 0x01
2540 #endif
2541 #ifndef PERL_SCAN_DISALLOW_PREFIX
2542 #define PERL_SCAN_DISALLOW_PREFIX 0x02
2543 #endif
2544 #ifndef grok_numeric_radix
2545 #if defined(NEED_grok_numeric_radix)
2546 static bool DPPP_(my_grok_numeric_radix)(pTHX_ const char ** sp, const char * send);
2547 static
2548 #else
2549 extern bool DPPP_(my_grok_numeric_radix)(pTHX_ const char ** sp, const char * send);
2550 #endif
2551 #ifdef grok_numeric_radix
2552 #undef grok_numeric_radix
2553 #endif
2554 #define grok_numeric_radix(a,b) DPPP_(my_grok_numeric_radix)(aTHX_ a,b)
2555 #define Perl_grok_numeric_radix DPPP_(my_grok_numeric_radix)
2556 #if defined(NEED_grok_numeric_radix) || defined(NEED_grok_numeric_radix_GLOBAL)
2557 bool
2558 DPPP_(my_grok_numeric_radix)(pTHX_ const char **sp, const char *send)
2559 {
2560 #ifdef USE_LOCALE_NUMERIC
2561 #ifdef PL_numeric_radix_sv
2562 if (PL_numeric_radix_sv && IN_LOCALE) {
2563 STRLEN len;
2564 char* radix = SvPV(PL_numeric_radix_sv, len);
2565 if (*sp + len <= send && memEQ(*sp, radix, len)) {
2566 *sp += len;
2567 return TRUE;
2568 }
2569 }
2570 #else
2571 #include <locale.h>
2572 dTHR;
2573 struct lconv *lc = localeconv();
2574 char *radix = lc->decimal_point;
2575 if (radix && IN_LOCALE) {
2576 STRLEN len = strlen(radix);
2577 if (*sp + len <= send && memEQ(*sp, radix, len)) {
2578 *sp += len;
2579 return TRUE;
2580 }
2581 }
2582 #endif
2583 #endif
2584 if (*sp < send && **sp == '.') {
2585 ++*sp;
2586 return TRUE;
2587 }
2588 return FALSE;
2589 }
2590 #endif
2591 #endif
2592 #ifndef grok_number
2593 #if defined(NEED_grok_number)
2594 static int DPPP_(my_grok_number)(pTHX_ const char * pv, STRLEN len, UV * valuep);
2595 static
2596 #else
2597 extern int DPPP_(my_grok_number)(pTHX_ const char * pv, STRLEN len, UV * valuep);
2598 #endif
2599 #ifdef grok_number
2600 #undef grok_number
2601 #endif
2602 #define grok_number(a,b,c) DPPP_(my_grok_number)(aTHX_ a,b,c)
2603 #define Perl_grok_number DPPP_(my_grok_number)
2604 #if defined(NEED_grok_number) || defined(NEED_grok_number_GLOBAL)
2605 int
2606 DPPP_(my_grok_number)(pTHX_ const char *pv, STRLEN len, UV *valuep)
2607 {
2608 const char *s = pv;
2609 const char *send = pv + len;
2610 const UV max_div_10 = UV_MAX / 10;
2611 const char max_mod_10 = UV_MAX % 10;
2612 int numtype = 0;
2613 int sawinf = 0;
2614 int sawnan = 0;
2615 while (s < send && isSPACE(*s))
2616 s++;
2617 if (s == send) {
2618 return 0;
2619 } else if (*s == '-') {
2620 s++;
2621 numtype = IS_NUMBER_NEG;
2622 }
2623 else if (*s == '+')
2624 s++;
2625 if (s == send)
2626 return 0;
2627 if (isDIGIT(*s)) {
2628 UV value = *s - '0';
2629 if (++s < send) {
2630 int digit = *s - '0';
2631 if (digit >= 0 && digit <= 9) {
2632 value = value * 10 + digit;
2633 if (++s < send) {
2634 digit = *s - '0';
2635 if (digit >= 0 && digit <= 9) {
2636 value = value * 10 + digit;
2637 if (++s < send) {
2638 digit = *s - '0';
2639 if (digit >= 0 && digit <= 9) {
2640 value = value * 10 + digit;
2641 if (++s < send) {
2642 digit = *s - '0';
2643 if (digit >= 0 && digit <= 9) {
2644 value = value * 10 + digit;
2645 if (++s < send) {
2646 digit = *s - '0';
2647 if (digit >= 0 && digit <= 9) {
2648 value = value * 10 + digit;
2649 if (++s < send) {
2650 digit = *s - '0';
2651 if (digit >= 0 && digit <= 9) {
2652 value = value * 10 + digit;
2653 if (++s < send) {
2654 digit = *s - '0';
2655 if (digit >= 0 && digit <= 9) {
2656 value = value * 10 + digit;
2657 if (++s < send) {
2658 digit = *s - '0';
2659 if (digit >= 0 && digit <= 9) {
2660 value = value * 10 + digit;
2661 if (++s < send) {
2662 digit = *s - '0';
2663 while (digit >= 0 && digit <= 9
2664 && (value < max_div_10
2665 || (value == max_div_10
2666 && digit <= max_mod_10))) {
2667 value = value * 10 + digit;
2668 if (++s < send)
2669 digit = *s - '0';
2670 else
2671 break;
2672 }
2673 if (digit >= 0 && digit <= 9
2674 && (s < send)) {
2675 do {
2676 s++;
2677 } while (s < send && isDIGIT(*s));
2678 numtype |=
2680 goto skip_value;
2681 }
2682 }
2683 }
2684 }
2685 }
2686 }
2687 }
2688 }
2689 }
2690 }
2691 }
2692 }
2693 }
2694 }
2695 }
2696 }
2697 }
2698 }
2699 numtype |= IS_NUMBER_IN_UV;
2700 if (valuep)
2701 *valuep = value;
2702 skip_value:
2703 if (GROK_NUMERIC_RADIX(&s, send)) {
2704 numtype |= IS_NUMBER_NOT_INT;
2705 while (s < send && isDIGIT(*s))
2706 s++;
2707 }
2708 }
2709 else if (GROK_NUMERIC_RADIX(&s, send)) {
2710 numtype |= IS_NUMBER_NOT_INT | IS_NUMBER_IN_UV;
2711 if (s < send && isDIGIT(*s)) {
2712 do {
2713 s++;
2714 } while (s < send && isDIGIT(*s));
2715 if (valuep) {
2716 *valuep = 0;
2717 }
2718 }
2719 else
2720 return 0;
2721 } else if (*s == 'I' || *s == 'i') {
2722 s++; if (s == send || (*s != 'N' && *s != 'n')) return 0;
2723 s++; if (s == send || (*s != 'F' && *s != 'f')) return 0;
2724 s++; if (s < send && (*s == 'I' || *s == 'i')) {
2725 s++; if (s == send || (*s != 'N' && *s != 'n')) return 0;
2726 s++; if (s == send || (*s != 'I' && *s != 'i')) return 0;
2727 s++; if (s == send || (*s != 'T' && *s != 't')) return 0;
2728 s++; if (s == send || (*s != 'Y' && *s != 'y')) return 0;
2729 s++;
2730 }
2731 sawinf = 1;
2732 } else if (*s == 'N' || *s == 'n') {
2733 s++; if (s == send || (*s != 'A' && *s != 'a')) return 0;
2734 s++; if (s == send || (*s != 'N' && *s != 'n')) return 0;
2735 s++;
2736 sawnan = 1;
2737 } else
2738 return 0;
2739 if (sawinf) {
2740 numtype &= IS_NUMBER_NEG;
2742 } else if (sawnan) {
2743 numtype &= IS_NUMBER_NEG;
2744 numtype |= IS_NUMBER_NAN | IS_NUMBER_NOT_INT;
2745 } else if (s < send) {
2746 if (*s == 'e' || *s == 'E') {
2747 numtype &= IS_NUMBER_NEG;
2748 numtype |= IS_NUMBER_NOT_INT;
2749 s++;
2750 if (s < send && (*s == '-' || *s == '+'))
2751 s++;
2752 if (s < send && isDIGIT(*s)) {
2753 do {
2754 s++;
2755 } while (s < send && isDIGIT(*s));
2756 }
2757 else
2758 return 0;
2759 }
2760 }
2761 while (s < send && isSPACE(*s))
2762 s++;
2763 if (s >= send)
2764 return numtype;
2765 if (len == 10 && memEQ(pv, "0 but true", 10)) {
2766 if (valuep)
2767 *valuep = 0;
2768 return IS_NUMBER_IN_UV;
2769 }
2770 return 0;
2771 }
2772 #endif
2773 #endif
2774 #ifndef grok_bin
2775 #if defined(NEED_grok_bin)
2776 static UV DPPP_(my_grok_bin)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
2777 static
2778 #else
2779 extern UV DPPP_(my_grok_bin)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
2780 #endif
2781 #ifdef grok_bin
2782 #undef grok_bin
2783 #endif
2784 #define grok_bin(a,b,c,d) DPPP_(my_grok_bin)(aTHX_ a,b,c,d)
2785 #define Perl_grok_bin DPPP_(my_grok_bin)
2786 #if defined(NEED_grok_bin) || defined(NEED_grok_bin_GLOBAL)
2787 UV
2788 DPPP_(my_grok_bin)(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result)
2789 {
2790 const char *s = start;
2791 STRLEN len = *len_p;
2792 UV value = 0;
2793 NV value_nv = 0;
2794 const UV max_div_2 = UV_MAX / 2;
2795 bool allow_underscores = *flags & PERL_SCAN_ALLOW_UNDERSCORES;
2796 bool overflowed = FALSE;
2797 if (!(*flags & PERL_SCAN_DISALLOW_PREFIX)) {
2798 if (len >= 1) {
2799 if (s[0] == 'b') {
2800 s++;
2801 len--;
2802 }
2803 else if (len >= 2 && s[0] == '0' && s[1] == 'b') {
2804 s+=2;
2805 len-=2;
2806 }
2807 }
2808 }
2809 for (; len-- && *s; s++) {
2810 char bit = *s;
2811 if (bit == '0' || bit == '1') {
2812 redo:
2813 if (!overflowed) {
2814 if (value <= max_div_2) {
2815 value = (value << 1) | (bit - '0');
2816 continue;
2817 }
2818 warn("Integer overflow in binary number");
2819 overflowed = TRUE;
2820 value_nv = (NV) value;
2821 }
2822 value_nv *= 2.0;
2823 value_nv += (NV)(bit - '0');
2824 continue;
2825 }
2826 if (bit == '_' && len && allow_underscores && (bit = s[1])
2827 && (bit == '0' || bit == '1'))
2828 {
2829 --len;
2830 ++s;
2831 goto redo;
2832 }
2833 if (!(*flags & PERL_SCAN_SILENT_ILLDIGIT))
2834 warn("Illegal binary digit '%c' ignored", *s);
2835 break;
2836 }
2837 if ( ( overflowed && value_nv > 4294967295.0)
2838 #if UVSIZE > 4
2839 || (!overflowed && value > 0xffffffff )
2840 #endif
2841 ) {
2842 warn("Binary number > 0b11111111111111111111111111111111 non-portable");
2843 }
2844 *len_p = s - start;
2845 if (!overflowed) {
2846 *flags = 0;
2847 return value;
2848 }
2850 if (result)
2851 *result = value_nv;
2852 return UV_MAX;
2853 }
2854 #endif
2855 #endif
2856 #ifndef grok_hex
2857 #if defined(NEED_grok_hex)
2858 static UV DPPP_(my_grok_hex)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
2859 static
2860 #else
2861 extern UV DPPP_(my_grok_hex)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
2862 #endif
2863 #ifdef grok_hex
2864 #undef grok_hex
2865 #endif
2866 #define grok_hex(a,b,c,d) DPPP_(my_grok_hex)(aTHX_ a,b,c,d)
2867 #define Perl_grok_hex DPPP_(my_grok_hex)
2868 #if defined(NEED_grok_hex) || defined(NEED_grok_hex_GLOBAL)
2869 UV
2870 DPPP_(my_grok_hex)(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result)
2871 {
2872 const char *s = start;
2873 STRLEN len = *len_p;
2874 UV value = 0;
2875 NV value_nv = 0;
2876 const UV max_div_16 = UV_MAX / 16;
2877 bool allow_underscores = *flags & PERL_SCAN_ALLOW_UNDERSCORES;
2878 bool overflowed = FALSE;
2879 const char *xdigit;
2880 if (!(*flags & PERL_SCAN_DISALLOW_PREFIX)) {
2881 if (len >= 1) {
2882 if (s[0] == 'x') {
2883 s++;
2884 len--;
2885 }
2886 else if (len >= 2 && s[0] == '0' && s[1] == 'x') {
2887 s+=2;
2888 len-=2;
2889 }
2890 }
2891 }
2892 for (; len-- && *s; s++) {
2893 xdigit = strchr((char *) PL_hexdigit, *s);
2894 if (xdigit) {
2895 redo:
2896 if (!overflowed) {
2897 if (value <= max_div_16) {
2898 value = (value << 4) | ((xdigit - PL_hexdigit) & 15);
2899 continue;
2900 }
2901 warn("Integer overflow in hexadecimal number");
2902 overflowed = TRUE;
2903 value_nv = (NV) value;
2904 }
2905 value_nv *= 16.0;
2906 value_nv += (NV)((xdigit - PL_hexdigit) & 15);
2907 continue;
2908 }
2909 if (*s == '_' && len && allow_underscores && s[1]
2910 && (xdigit = strchr((char *) PL_hexdigit, s[1])))
2911 {
2912 --len;
2913 ++s;
2914 goto redo;
2915 }
2916 if (!(*flags & PERL_SCAN_SILENT_ILLDIGIT))
2917 warn("Illegal hexadecimal digit '%c' ignored", *s);
2918 break;
2919 }
2920 if ( ( overflowed && value_nv > 4294967295.0)
2921 #if UVSIZE > 4
2922 || (!overflowed && value > 0xffffffff )
2923 #endif
2924 ) {
2925 warn("Hexadecimal number > 0xffffffff non-portable");
2926 }
2927 *len_p = s - start;
2928 if (!overflowed) {
2929 *flags = 0;
2930 return value;
2931 }
2933 if (result)
2934 *result = value_nv;
2935 return UV_MAX;
2936 }
2937 #endif
2938 #endif
2939 #ifndef grok_oct
2940 #if defined(NEED_grok_oct)
2941 static UV DPPP_(my_grok_oct)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
2942 static
2943 #else
2944 extern UV DPPP_(my_grok_oct)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
2945 #endif
2946 #ifdef grok_oct
2947 #undef grok_oct
2948 #endif
2949 #define grok_oct(a,b,c,d) DPPP_(my_grok_oct)(aTHX_ a,b,c,d)
2950 #define Perl_grok_oct DPPP_(my_grok_oct)
2951 #if defined(NEED_grok_oct) || defined(NEED_grok_oct_GLOBAL)
2952 UV
2953 DPPP_(my_grok_oct)(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result)
2954 {
2955 const char *s = start;
2956 STRLEN len = *len_p;
2957 UV value = 0;
2958 NV value_nv = 0;
2959 const UV max_div_8 = UV_MAX / 8;
2960 bool allow_underscores = *flags & PERL_SCAN_ALLOW_UNDERSCORES;
2961 bool overflowed = FALSE;
2962 for (; len-- && *s; s++) {
2963 int digit = *s - '0';
2964 if (digit >= 0 && digit <= 7) {
2965 redo:
2966 if (!overflowed) {
2967 if (value <= max_div_8) {
2968 value = (value << 3) | digit;
2969 continue;
2970 }
2971 warn("Integer overflow in octal number");
2972 overflowed = TRUE;
2973 value_nv = (NV) value;
2974 }
2975 value_nv *= 8.0;
2976 value_nv += (NV)digit;
2977 continue;
2978 }
2979 if (digit == ('_' - '0') && len && allow_underscores
2980 && (digit = s[1] - '0') && (digit >= 0 && digit <= 7))
2981 {
2982 --len;
2983 ++s;
2984 goto redo;
2985 }
2986 if (digit == 8 || digit == 9) {
2987 if (!(*flags & PERL_SCAN_SILENT_ILLDIGIT))
2988 warn("Illegal octal digit '%c' ignored", *s);
2989 }
2990 break;
2991 }
2992 if ( ( overflowed && value_nv > 4294967295.0)
2993 #if UVSIZE > 4
2994 || (!overflowed && value > 0xffffffff )
2995 #endif
2996 ) {
2997 warn("Octal number > 037777777777 non-portable");
2998 }
2999 *len_p = s - start;
3000 if (!overflowed) {
3001 *flags = 0;
3002 return value;
3003 }
3005 if (result)
3006 *result = value_nv;
3007 return UV_MAX;
3008 }
3009 #endif
3010 #endif
3011 #if !defined(my_snprintf)
3012 #if defined(NEED_my_snprintf)
3013 static int DPPP_(my_my_snprintf)(char * buffer, const Size_t len, const char * format, ...);
3014 static
3015 #else
3016 extern int DPPP_(my_my_snprintf)(char * buffer, const Size_t len, const char * format, ...);
3017 #endif
3018 #define my_snprintf DPPP_(my_my_snprintf)
3019 #define Perl_my_snprintf DPPP_(my_my_snprintf)
3020 #if defined(NEED_my_snprintf) || defined(NEED_my_snprintf_GLOBAL)
3021 int
3022 DPPP_(my_my_snprintf)(char *buffer, const Size_t len, const char *format, ...)
3023 {
3024 dTHX;
3025 int retval;
3026 va_list ap;
3027 va_start(ap, format);
3028 #ifdef HAS_VSNPRINTF
3029 retval = vsnprintf(buffer, len, format, ap);
3030 #else
3031 retval = vsprintf(buffer, format, ap);
3032 #endif
3033 va_end(ap);
3034 if (retval < 0 || (len > 0 && (Size_t)retval >= len))
3035 Perl_croak(aTHX_ "panic: my_snprintf buffer overflow");
3036 return retval;
3037 }
3038 #endif
3039 #endif
3040 #if !defined(my_sprintf)
3041 #if defined(NEED_my_sprintf)
3042 static int DPPP_(my_my_sprintf)(char * buffer, const char * pat, ...);
3043 static
3044 #else
3045 extern int DPPP_(my_my_sprintf)(char * buffer, const char * pat, ...);
3046 #endif
3047 #define my_sprintf DPPP_(my_my_sprintf)
3048 #define Perl_my_sprintf DPPP_(my_my_sprintf)
3049 #if defined(NEED_my_sprintf) || defined(NEED_my_sprintf_GLOBAL)
3050 int
3051 DPPP_(my_my_sprintf)(char *buffer, const char* pat, ...)
3052 {
3053 va_list args;
3054 va_start(args, pat);
3055 vsprintf(buffer, pat, args);
3056 va_end(args);
3057 return strlen(buffer);
3058 }
3059 #endif
3060 #endif
3061 #ifdef NO_XSLOCKS
3062 #ifdef dJMPENV
3063 #define dXCPT dJMPENV; int rEtV = 0
3064 #define XCPT_TRY_START JMPENV_PUSH(rEtV); if (rEtV == 0)
3065 #define XCPT_TRY_END JMPENV_POP;
3066 #define XCPT_CATCH if (rEtV != 0)
3067 #define XCPT_RETHROW JMPENV_JUMP(rEtV)
3068 #else
3069 #define dXCPT Sigjmp_buf oldTOP; int rEtV = 0
3070 #define XCPT_TRY_START Copy(top_env, oldTOP, 1, Sigjmp_buf); rEtV = Sigsetjmp(top_env, 1); if (rEtV == 0)
3071 #define XCPT_TRY_END Copy(oldTOP, top_env, 1, Sigjmp_buf);
3072 #define XCPT_CATCH if (rEtV != 0)
3073 #define XCPT_RETHROW Siglongjmp(top_env, rEtV)
3074 #endif
3075 #endif
3076 #if !defined(my_strlcat)
3077 #if defined(NEED_my_strlcat)
3078 static Size_t DPPP_(my_my_strlcat)(char * dst, const char * src, Size_t size);
3079 static
3080 #else
3081 extern Size_t DPPP_(my_my_strlcat)(char * dst, const char * src, Size_t size);
3082 #endif
3083 #define my_strlcat DPPP_(my_my_strlcat)
3084 #define Perl_my_strlcat DPPP_(my_my_strlcat)
3085 #if defined(NEED_my_strlcat) || defined(NEED_my_strlcat_GLOBAL)
3086 Size_t
3087 DPPP_(my_my_strlcat)(char *dst, const char *src, Size_t size)
3088 {
3089 Size_t used, length, copy;
3090 used = strlen(dst);
3091 length = strlen(src);
3092 if (size > 0 && used < size - 1) {
3093 copy = (length >= size - used) ? size - used - 1 : length;
3094 memcpy(dst + used, src, copy);
3095 dst[used + copy] = '\0';
3096 }
3097 return used + length;
3098 }
3099 #endif
3100 #endif
3101 #if !defined(my_strlcpy)
3102 #if defined(NEED_my_strlcpy)
3103 static Size_t DPPP_(my_my_strlcpy)(char * dst, const char * src, Size_t size);
3104 static
3105 #else
3106 extern Size_t DPPP_(my_my_strlcpy)(char * dst, const char * src, Size_t size);
3107 #endif
3108 #define my_strlcpy DPPP_(my_my_strlcpy)
3109 #define Perl_my_strlcpy DPPP_(my_my_strlcpy)
3110 #if defined(NEED_my_strlcpy) || defined(NEED_my_strlcpy_GLOBAL)
3111 Size_t
3112 DPPP_(my_my_strlcpy)(char *dst, const char *src, Size_t size)
3113 {
3114 Size_t length, copy;
3115 length = strlen(src);
3116 if (size > 0) {
3117 copy = (length >= size) ? size - 1 : length;
3118 memcpy(dst, src, copy);
3119 dst[copy] = '\0';
3120 }
3121 return length;
3122 }
3123 #endif
3124 #endif
3125 #ifndef PERL_PV_ESCAPE_QUOTE
3126 #define PERL_PV_ESCAPE_QUOTE 0x0001
3127 #endif
3128 #ifndef PERL_PV_PRETTY_QUOTE
3129 #define PERL_PV_PRETTY_QUOTE PERL_PV_ESCAPE_QUOTE
3130 #endif
3131 #ifndef PERL_PV_PRETTY_ELLIPSES
3132 #define PERL_PV_PRETTY_ELLIPSES 0x0002
3133 #endif
3134 #ifndef PERL_PV_PRETTY_LTGT
3135 #define PERL_PV_PRETTY_LTGT 0x0004
3136 #endif
3137 #ifndef PERL_PV_ESCAPE_FIRSTCHAR
3138 #define PERL_PV_ESCAPE_FIRSTCHAR 0x0008
3139 #endif
3140 #ifndef PERL_PV_ESCAPE_UNI
3141 #define PERL_PV_ESCAPE_UNI 0x0100
3142 #endif
3143 #ifndef PERL_PV_ESCAPE_UNI_DETECT
3144 #define PERL_PV_ESCAPE_UNI_DETECT 0x0200
3145 #endif
3146 #ifndef PERL_PV_ESCAPE_ALL
3147 #define PERL_PV_ESCAPE_ALL 0x1000
3148 #endif
3149 #ifndef PERL_PV_ESCAPE_NOBACKSLASH
3150 #define PERL_PV_ESCAPE_NOBACKSLASH 0x2000
3151 #endif
3152 #ifndef PERL_PV_ESCAPE_NOCLEAR
3153 #define PERL_PV_ESCAPE_NOCLEAR 0x4000
3154 #endif
3155 #ifndef PERL_PV_ESCAPE_RE
3156 #define PERL_PV_ESCAPE_RE 0x8000
3157 #endif
3158 #ifndef PERL_PV_PRETTY_NOCLEAR
3159 #define PERL_PV_PRETTY_NOCLEAR PERL_PV_ESCAPE_NOCLEAR
3160 #endif
3161 #ifndef PERL_PV_PRETTY_DUMP
3162 #define PERL_PV_PRETTY_DUMP PERL_PV_PRETTY_ELLIPSES|PERL_PV_PRETTY_QUOTE
3163 #endif
3164 #ifndef PERL_PV_PRETTY_REGPROP
3165 #define PERL_PV_PRETTY_REGPROP PERL_PV_PRETTY_ELLIPSES|PERL_PV_PRETTY_LTGT|PERL_PV_ESCAPE_RE
3166 #endif
3167 #ifndef pv_escape
3168 #if defined(NEED_pv_escape)
3169 static char * DPPP_(my_pv_escape)(pTHX_ SV * dsv, char const * const str, const STRLEN count, const STRLEN max, STRLEN * const escaped, const U32 flags);
3170 static
3171 #else
3172 extern char * DPPP_(my_pv_escape)(pTHX_ SV * dsv, char const * const str, const STRLEN count, const STRLEN max, STRLEN * const escaped, const U32 flags);
3173 #endif
3174 #ifdef pv_escape
3175 #undef pv_escape
3176 #endif
3177 #define pv_escape(a,b,c,d,e,f) DPPP_(my_pv_escape)(aTHX_ a,b,c,d,e,f)
3178 #define Perl_pv_escape DPPP_(my_pv_escape)
3179 #if defined(NEED_pv_escape) || defined(NEED_pv_escape_GLOBAL)
3180 char *
3181 DPPP_(my_pv_escape)(pTHX_ SV *dsv, char const * const str,
3182 const STRLEN count, const STRLEN max,
3183 STRLEN * const escaped, const U32 flags)
3184 {
3185 const char esc = flags & PERL_PV_ESCAPE_RE ? '%' : '\\';
3186 const char dq = flags & PERL_PV_ESCAPE_QUOTE ? '"' : esc;
3187 char octbuf[32] = "%123456789ABCDF";
3188 STRLEN wrote = 0;
3189 STRLEN chsize = 0;
3190 STRLEN readsize = 1;
3191 #if defined(is_utf8_string) && defined(utf8_to_uvchr)
3192 bool isuni = flags & PERL_PV_ESCAPE_UNI ? 1 : 0;
3193 #endif
3194 const char *pv = str;
3195 const char * const end = pv + count;
3196 octbuf[0] = esc;
3197 if (!(flags & PERL_PV_ESCAPE_NOCLEAR))
3198 sv_setpvs(dsv, "");
3199 #if defined(is_utf8_string) && defined(utf8_to_uvchr)
3200 if ((flags & PERL_PV_ESCAPE_UNI_DETECT) && is_utf8_string((U8*)pv, count))
3201 isuni = 1;
3202 #endif
3203 for (; pv < end && (!max || wrote < max) ; pv += readsize) {
3204 const UV u =
3205 #if defined(is_utf8_string) && defined(utf8_to_uvchr)
3206 isuni ? utf8_to_uvchr((U8*)pv, &readsize) :
3207 #endif
3208 (U8)*pv;
3209 const U8 c = (U8)u & 0xFF;
3210 if (u > 255 || (flags & PERL_PV_ESCAPE_ALL)) {
3211 if (flags & PERL_PV_ESCAPE_FIRSTCHAR)
3212 chsize = my_snprintf(octbuf, sizeof octbuf,
3213 "%" UVxf, u);
3214 else
3215 chsize = my_snprintf(octbuf, sizeof octbuf,
3216 "%cx{%" UVxf "}", esc, u);
3217 } else if (flags & PERL_PV_ESCAPE_NOBACKSLASH) {
3218 chsize = 1;
3219 } else {
3220 if (c == dq || c == esc || !isPRINT(c)) {
3221 chsize = 2;
3222 switch (c) {
3223 case '\\' :
3224 case '%' : if (c == esc)
3225 octbuf[1] = esc;
3226 else
3227 chsize = 1;
3228 break;
3229 case '\v' : octbuf[1] = 'v'; break;
3230 case '\t' : octbuf[1] = 't'; break;
3231 case '\r' : octbuf[1] = 'r'; break;
3232 case '\n' : octbuf[1] = 'n'; break;
3233 case '\f' : octbuf[1] = 'f'; break;
3234 case '"' : if (dq == '"')
3235 octbuf[1] = '"';
3236 else
3237 chsize = 1;
3238 break;
3239 default: chsize = my_snprintf(octbuf, sizeof octbuf,
3240 pv < end && isDIGIT((U8)*(pv+readsize))
3241 ? "%c%03o" : "%c%o", esc, c);
3242 }
3243 } else {
3244 chsize = 1;
3245 }
3246 }
3247 if (max && wrote + chsize > max) {
3248 break;
3249 } else if (chsize > 1) {
3250 sv_catpvn(dsv, octbuf, chsize);
3251 wrote += chsize;
3252 } else {
3253 char tmp[2];
3254 my_snprintf(tmp, sizeof tmp, "%c", c);
3255 sv_catpvn(dsv, tmp, 1);
3256 wrote++;
3257 }
3258 if (flags & PERL_PV_ESCAPE_FIRSTCHAR)
3259 break;
3260 }
3261 if (escaped != NULL)
3262 *escaped= pv - str;
3263 return SvPVX(dsv);
3264 }
3265 #endif
3266 #endif
3267 #ifndef pv_pretty
3268 #if defined(NEED_pv_pretty)
3269 static char * DPPP_(my_pv_pretty)(pTHX_ SV * dsv, char const * const str, const STRLEN count, const STRLEN max, char const * const start_color, char const * const end_color, const U32 flags);
3270 static
3271 #else
3272 extern char * DPPP_(my_pv_pretty)(pTHX_ SV * dsv, char const * const str, const STRLEN count, const STRLEN max, char const * const start_color, char const * const end_color, const U32 flags);
3273 #endif
3274 #ifdef pv_pretty
3275 #undef pv_pretty
3276 #endif
3277 #define pv_pretty(a,b,c,d,e,f,g) DPPP_(my_pv_pretty)(aTHX_ a,b,c,d,e,f,g)
3278 #define Perl_pv_pretty DPPP_(my_pv_pretty)
3279 #if defined(NEED_pv_pretty) || defined(NEED_pv_pretty_GLOBAL)
3280 char *
3281 DPPP_(my_pv_pretty)(pTHX_ SV *dsv, char const * const str, const STRLEN count,
3282 const STRLEN max, char const * const start_color, char const * const end_color,
3283 const U32 flags)
3284 {
3285 const U8 dq = (flags & PERL_PV_PRETTY_QUOTE) ? '"' : '%';
3286 STRLEN escaped;
3287 if (!(flags & PERL_PV_PRETTY_NOCLEAR))
3288 sv_setpvs(dsv, "");
3289 if (dq == '"')
3290 sv_catpvs(dsv, "\"");
3291 else if (flags & PERL_PV_PRETTY_LTGT)
3292 sv_catpvs(dsv, "<");
3293 if (start_color != NULL)
3294 sv_catpv(dsv, D_PPP_CONSTPV_ARG(start_color));
3295 pv_escape(dsv, str, count, max, &escaped, flags | PERL_PV_ESCAPE_NOCLEAR);
3296 if (end_color != NULL)
3297 sv_catpv(dsv, D_PPP_CONSTPV_ARG(end_color));
3298 if (dq == '"')
3299 sv_catpvs(dsv, "\"");
3300 else if (flags & PERL_PV_PRETTY_LTGT)
3301 sv_catpvs(dsv, ">");
3302 if ((flags & PERL_PV_PRETTY_ELLIPSES) && escaped < count)
3303 sv_catpvs(dsv, "...");
3304 return SvPVX(dsv);
3305 }
3306 #endif
3307 #endif
3308 #ifndef pv_display
3309 #if defined(NEED_pv_display)
3310 static char * DPPP_(my_pv_display)(pTHX_ SV * dsv, const char * pv, STRLEN cur, STRLEN len, STRLEN pvlim);
3311 static
3312 #else
3313 extern char * DPPP_(my_pv_display)(pTHX_ SV * dsv, const char * pv, STRLEN cur, STRLEN len, STRLEN pvlim);
3314 #endif
3315 #ifdef pv_display
3316 #undef pv_display
3317 #endif
3318 #define pv_display(a,b,c,d,e) DPPP_(my_pv_display)(aTHX_ a,b,c,d,e)
3319 #define Perl_pv_display DPPP_(my_pv_display)
3320 #if defined(NEED_pv_display) || defined(NEED_pv_display_GLOBAL)
3321 char *
3322 DPPP_(my_pv_display)(pTHX_ SV *dsv, const char *pv, STRLEN cur, STRLEN len, STRLEN pvlim)
3323 {
3324 pv_pretty(dsv, pv, cur, pvlim, NULL, NULL, PERL_PV_PRETTY_DUMP);
3325 if (len > cur && pv[cur] == '\0')
3326 sv_catpvs(dsv, "\\0");
3327 return SvPVX(dsv);
3328 }
3329 #endif
3330 #endif
3331 #endif
#define CPERLscope(x)
Definition: ppport.h:702
#define PERL_HASH(hash, str, len)
Definition: ppport.h:705
#define eval_sv
Definition: ppport.h:953
#define sv_catpvs(sv, str)
Definition: ppport.h:2011
#define D_PPP_PERL_SIGNALS_INIT
Definition: ppport.h:805
char s char s char s s s s s char char c s *s c s s s d c s *s d c d d d d c
Definition: KviIrcNumericCodes.h:391
OP *CPERLscope Perl_check_t(pTHX_ OP *)
Definition: ppport.h:730
UV DPPP_() my_grok_bin(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result)
#define dTHX
Definition: ppport.h:75
#define PERL_PV_PRETTY_ELLIPSES
Definition: ppport.h:3132
char * NULL
Definition: KviIrcNumericCodes.h:391
#define PL_hexdigit
Definition: ppport.h:842
char *DPPP_() my_pv_escape(pTHX_ SV *dsv, char const *const str, const STRLEN count, const STRLEN max, STRLEN *const escaped, const U32 flags)
#define PERL_PV_ESCAPE_UNI
Definition: ppport.h:3141
#define PL_curstash
Definition: ppport.h:833
#define isPRINT(c)
Definition: ppport.h:786
#define PERL_SCAN_ALLOW_UNDERSCORES
Definition: ppport.h:2539
Size_t DPPP_() my_my_strlcpy(char *dst, const char *src, Size_t size)
SV *DPPP_() my_newRV_noinc(SV *sv)
UV DPPP_() my_grok_oct(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result)
void DPPP_() my_vload_module(U32 flags, SV *name, SV *ver, va_list *args)
#define PL_hints
Definition: ppport.h:843
#define pv_pretty(a, b, c, d, e, f, g)
Definition: ppport.h:3277
#define aTHX_
Definition: ppport.h:90
#define PERL_LOADMOD_IMPORT_OPS
Definition: ppport.h:962
#define dVAR
Definition: ppport.h:693
#define IN_LOCALE
Definition: ppport.h:2509
#define D_PPP_CONSTPV_ARG(x)
Definition: ppport.h:1333
int DPPP_() my_grok_number(pTHX_ const char *pv, STRLEN len, UV *valuep)
QString type()
Definition: KviRuntimeInfo.cpp:646
#define IS_NUMBER_NOT_INT
Definition: ppport.h:2518
void vsprintf(QString &szSrc, const QString &szFmt, kvi_va_list list)
Writes to the character string.
Definition: KviQString.cpp:634
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 DPPP_(name)
Definition: ppport.h:51
#define i
Definition: detector.cpp:73
NVTYPE NV
Definition: ppport.h:547
UV DPPP_() my_grok_hex(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result)
#define NVTYPE
Definition: ppport.h:545
int DPPP_() my_my_snprintf(char *buffer, const Size_t len, const char *format,...)
#define SvPV_nolen(sv)
Definition: ppport.h:1548
int DPPP_() my_my_sprintf(char *buffer, const char *pat,...)
OP *CPERLscope Perl_ppaddr_t(pTHX)
Definition: ppport.h:728
#define PERL_PV_ESCAPE_NOBACKSLASH
Definition: ppport.h:3150
#define PL_DBsub
Definition: ppport.h:825
#define PERL_MAGIC_regex_global
Definition: ppport.h:2074
char s char s s
Definition: KviIrcNumericCodes.h:391
#define PERL_PV_ESCAPE_ALL
Definition: ppport.h:3147
#define pTHX_
Definition: ppport.h:84
#define PERL_PV_ESCAPE_NOCLEAR
Definition: ppport.h:3153
#define IS_NUMBER_NAN
Definition: ppport.h:2527
#define pv_escape(a, b, c, d, e, f)
Definition: ppport.h:3177
bool DPPP_() my_grok_numeric_radix(pTHX_ const char **sp, const char *send)
#define PERL_SCAN_SILENT_ILLDIGIT
Definition: ppport.h:2536
MAGIC *DPPP_() my_mg_findext(SV *sv, int type, const MGVTBL *vtbl)
#define PL_copline
Definition: ppport.h:831
SV *DPPP_() my_newSVpvn_flags(pTHX_ const char *s, STRLEN len, U32 flags)
#define PERL_PV_ESCAPE_UNI_DETECT
Definition: ppport.h:3144
#define PERL_BCDVERSION
Definition: ppport.h:67
#define vload_module(a, b, c, d)
Definition: ppport.h:1017
#define PERL_SCAN_GREATER_THAN_UV_MAX
Definition: ppport.h:2533
char *DPPP_() my_sv_2pv_flags(pTHX_ SV *sv, STRLEN *lp, I32 flags)
QHashIterator< int, QFile * > t(getDict)
#define PERL_PV_PRETTY_QUOTE
Definition: ppport.h:3129
#define PERL_PV_ESCAPE_QUOTE
Definition: ppport.h:3126
#define MUTABLE_SV(p)
Definition: ppport.h:2042
#define UV_MAX
Definition: ppport.h:386
#define PERL_PV_PRETTY_DUMP
Definition: ppport.h:3162
#define dTHR
Definition: ppport.h:72
#define PERL_PV_PRETTY_LTGT
Definition: ppport.h:3135
#define PERL_SCAN_DISALLOW_PREFIX
Definition: ppport.h:2542
#define PERL_LOADMOD_DENY
Definition: ppport.h:956
#define IS_NUMBER_IN_UV
Definition: ppport.h:2512
Size_t DPPP_() my_my_strlcat(char *dst, const char *src, Size_t size)
#define PERL_PV_PRETTY_NOCLEAR
Definition: ppport.h:3159
#define PERL_PV_ESCAPE_RE
Definition: ppport.h:3156
void DPPP_() my_load_module(U32 flags, SV *name, SV *ver,...)
SV *DPPP_() my_newSV_type(pTHX_ svtype const t)
QString name()
Definition: KviRuntimeInfo.cpp:655
#define PERL_LOADMOD_NOIMPORT
Definition: ppport.h:959
#define PERL_UNUSED_ARG(x)
Definition: ppport.h:522
int DPPP_() my_sv_unmagicext(pTHX_ SV *const sv, const int type, MGVTBL *vtbl)
#define my_snprintf
Definition: ppport.h:3018
#define PL_curcop
Definition: ppport.h:832
SV *DPPP_() my_eval_pv(char *p, I32 croak_on_error)
#define u
Definition: detector.cpp:85
void DPPP_() my_newCONSTSUB(HV *stash, const char *name, SV *sv)
#define GROK_NUMERIC_RADIX(sp, send)
Definition: ppport.h:2530
#define pTHX
Definition: ppport.h:81
#define HEf_SVKEY
Definition: ppport.h:2035
#define PERL_MAGIC_utf8
Definition: ppport.h:2137
#define SVf_UTF8
Definition: ppport.h:1346
#define memEQ(s1, s2, l)
Definition: ppport.h:460
#define IS_NUMBER_NEG
Definition: ppport.h:2521
SV *DPPP_() my_newSVpvn_share(pTHX_ const char *src, I32 len, U32 hash)
#define PL_expect
Definition: ppport.h:841
#define sv_setpvs(sv, str)
Definition: ppport.h:2014
void copy(void *dst_ptr, const void *src_ptr, int len)
Moves len bytes from src_ptr to dst_ptr.
Definition: KviMemory.h:166
#define IS_NUMBER_INFINITY
Definition: ppport.h:2524
#define p
Definition: detector.cpp:80
#define IS_NUMBER_GREATER_THAN_UV_MAX
Definition: ppport.h:2515
char *DPPP_() my_sv_pvn_force_flags(pTHX_ SV *sv, STRLEN *lp, I32 flags)
#define PL_sv_no
Definition: ppport.h:859
#define UVxf
Definition: ppport.h:1221
#define newSVpvn(data, len)
Definition: ppport.h:1338
char *DPPP_() my_pv_display(pTHX_ SV *dsv, const char *pv, STRLEN cur, STRLEN len, STRLEN pvlim)
#define PERL_PV_ESCAPE_FIRSTCHAR
Definition: ppport.h:3138