#define CALLREGFREE_PVT(prog) \
if(prog) CALL_FPTR((prog)->engine->free)(aTHX_ (prog))
+#define CALLREG_NUMBUF(rx,paren,usesv) \
+ CALL_FPTR((rx)->engine->numbered_buff_get)(aTHX_ (rx),(paren),(usesv))
+
+#define CALLREG_NAMEDBUF(rx,name,flags) \
+ CALL_FPTR((rx)->engine->named_buff_get)(aTHX_ (rx),(name),(flags))
+
+
#if defined(USE_ITHREADS)
#define CALLREGDUPE(prog,param) \
Perl_re_dup(aTHX_ (prog),(param))
: (REGEXP *)NULL)
#endif
+
+
+
+
/*
* Because of backward compatibility reasons the PERL_UNUSED_DECL
* cannot be changed from postfix to PERL_UNUSED_DECL(x). Sigh.
#define DBL_DIG 15 /* A guess that works lots of places */
#endif
#endif
-#ifdef I_FLOAT
-#include <float.h>
-#endif
-#ifndef HAS_DBL_DIG
-#define DBL_DIG 15 /* A guess that works lots of places */
-#endif
#ifdef OVR_LDBL_DIG
/* Use an overridden LDBL_DIG */
# endif
#endif
-#if defined(_MSC_VER) && (_MSC_VER >= 1300) && (_MSC_VER < 1400) && (WINVER < 0x0500)
-/* VC7 or 7.1, building with pre-VC7 runtime libraries. */
-long _ftol( double ); /* Defined by VC6 C libs. */
-long _ftol2( double dblSource ) { return _ftol( dblSource ); }
-#endif
-
/* The default is to use Perl's own atof() implementation (in numeric.c).
* Usually that is the one to use but for some platforms (e.g. UNICOS)
* it is however best to use the native implementation of atof.
# define SVf256 SVf_(256)
#endif
+#define SVfARG(p) ((void*)(p))
+
#ifndef vdNUMBER
# define vdNUMBER 1
#endif
# define VDf "vd"
# endif
#endif
-
+
+#ifdef PERL_CORE
/* not used; but needed for backward compatibilty with XS code? - RMB */
-#ifndef UVf
-# define UVf UVuf
+# ifndef UVf
+# define UVf UVuf
+# endif
+#else
+# undef UVf
#endif
#ifdef HASATTRIBUTE_FORMAT
#define U_I(what) ((unsigned int)U_32(what))
#define U_L(what) U_32(what)
+#ifdef HAS_SIGNBIT
+# define Perl_signbit signbit
+#endif
+
/* These do not care about the fractional part, only about the range. */
#define NV_WITHIN_IV(nv) (I_V(nv) >= IV_MIN && I_V(nv) <= IV_MAX)
#define NV_WITHIN_UV(nv) ((nv)>=0.0 && U_V(nv) >= UV_MIN && U_V(nv) <= UV_MAX)
#define PERL_MAGIC_overload_elem 'a' /* %OVERLOAD hash element */
#define PERL_MAGIC_overload_table 'c' /* Holds overload table (AMT) on stash */
#define PERL_MAGIC_bm 'B' /* Boyer-Moore (fast string search) */
-#define PERL_MAGIC_regdata_names '+' /* Regex named capture buffer hash
- (%+ support) */
#define PERL_MAGIC_regdata 'D' /* Regex match position data
(@+ and @- vars) */
#define PERL_MAGIC_regdatum 'd' /* Regex match position data element */
#define HINT_NEW_STRING 0x00008000
#define HINT_NEW_RE 0x00010000
#define HINT_LOCALIZE_HH 0x00020000 /* %^H needs to be copied */
-#define HINT_LEXICAL_IO 0x00040000 /* ${^OPEN} is set */
+#define HINT_LEXICAL_IO_IN 0x00040000 /* ${^OPEN} is set for input */
+#define HINT_LEXICAL_IO_OUT 0x00080000 /* ${^OPEN} is set for output */
#define HINT_RE_TAINT 0x00100000 /* re pragma */
#define HINT_RE_EVAL 0x00200000 /* re pragma */
# define MGVTBL_SET_CONST_MAGIC_GET(var,a,b,c,d,e,f,g,h) EXT_MGVTBL var
#endif
+/* These all need to be 0, not NULL, as NULL can be (void*)0, which is a
+ * pointer to data, whereas we're assigning pointers to functions, which are
+ * not the same beast. ANSI doesn't allow the assignment from one to the other.
+ * (although most, but not all, compilers are prepared to do it)
+ */
MGVTBL_SET(
PL_vtbl_sv,
MEMBER_TO_FPTR(Perl_magic_get),
MEMBER_TO_FPTR(Perl_magic_set),
MEMBER_TO_FPTR(Perl_magic_len),
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
);
MGVTBL_SET(
PL_vtbl_env,
- NULL,
+ 0,
MEMBER_TO_FPTR(Perl_magic_set_all_env),
- NULL,
+ 0,
MEMBER_TO_FPTR(Perl_magic_clear_all_env),
- NULL,
- NULL,
- NULL,
- NULL
+ 0,
+ 0,
+ 0,
+ 0
);
MGVTBL_SET(
PL_vtbl_envelem,
- NULL,
+ 0,
MEMBER_TO_FPTR(Perl_magic_setenv),
- NULL,
+ 0,
MEMBER_TO_FPTR(Perl_magic_clearenv),
- NULL,
- NULL,
- NULL,
- NULL
+ 0,
+ 0,
+ 0,
+ 0
);
-/* For now, hints magic will also use vtbl_sig, because it is all NULL */
+/* For now, hints magic will also use vtbl_sig, because it is all 0 */
MGVTBL_SET(
PL_vtbl_sig,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
);
#ifdef PERL_MICRO
MGVTBL_SET(
PL_vtbl_sigelem,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
);
#else
PL_vtbl_sigelem,
MEMBER_TO_FPTR(Perl_magic_getsig),
MEMBER_TO_FPTR(Perl_magic_setsig),
- NULL,
+ 0,
MEMBER_TO_FPTR(Perl_magic_clearsig),
- NULL,
- NULL,
- NULL,
- NULL
+ 0,
+ 0,
+ 0,
+ 0
);
#endif
MGVTBL_SET(
PL_vtbl_pack,
- NULL,
- NULL,
+ 0,
+ 0,
MEMBER_TO_FPTR(Perl_magic_sizepack),
MEMBER_TO_FPTR(Perl_magic_wipepack),
- NULL,
- NULL,
- NULL,
- NULL
+ 0,
+ 0,
+ 0,
+ 0
);
MGVTBL_SET(
PL_vtbl_packelem,
MEMBER_TO_FPTR(Perl_magic_getpack),
MEMBER_TO_FPTR(Perl_magic_setpack),
- NULL,
+ 0,
MEMBER_TO_FPTR(Perl_magic_clearpack),
- NULL,
- NULL,
- NULL,
- NULL
+ 0,
+ 0,
+ 0,
+ 0
);
MGVTBL_SET(
PL_vtbl_dbline,
- NULL,
+ 0,
MEMBER_TO_FPTR(Perl_magic_setdbline),
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
);
MGVTBL_SET(
PL_vtbl_isa,
- NULL,
+ 0,
MEMBER_TO_FPTR(Perl_magic_setisa),
- NULL,
+ 0,
MEMBER_TO_FPTR(Perl_magic_setisa),
- NULL,
- NULL,
- NULL,
- NULL
+ 0,
+ 0,
+ 0,
+ 0
);
MGVTBL_SET(
PL_vtbl_isaelem,
- NULL,
+ 0,
MEMBER_TO_FPTR(Perl_magic_setisa),
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
);
MGVTBL_SET_CONST_MAGIC_GET(
PL_vtbl_arylen,
MEMBER_TO_FPTR(Perl_magic_getarylen),
MEMBER_TO_FPTR(Perl_magic_setarylen),
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
);
MGVTBL_SET(
PL_vtbl_arylen_p,
- NULL,
- NULL,
- NULL,
- NULL,
+ 0,
+ 0,
+ 0,
+ 0,
MEMBER_TO_FPTR(Perl_magic_freearylen_p),
- NULL,
- NULL,
- NULL
+ 0,
+ 0,
+ 0
);
MGVTBL_SET(
PL_vtbl_mglob,
- NULL,
+ 0,
MEMBER_TO_FPTR(Perl_magic_setmglob),
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
);
MGVTBL_SET(
PL_vtbl_nkeys,
MEMBER_TO_FPTR(Perl_magic_getnkeys),
MEMBER_TO_FPTR(Perl_magic_setnkeys),
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
);
MGVTBL_SET(
PL_vtbl_taint,
MEMBER_TO_FPTR(Perl_magic_gettaint),
MEMBER_TO_FPTR(Perl_magic_settaint),
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
);
MGVTBL_SET(
PL_vtbl_substr,
MEMBER_TO_FPTR(Perl_magic_getsubstr),
MEMBER_TO_FPTR(Perl_magic_setsubstr),
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
);
MGVTBL_SET(
PL_vtbl_vec,
MEMBER_TO_FPTR(Perl_magic_getvec),
MEMBER_TO_FPTR(Perl_magic_setvec),
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
);
MGVTBL_SET(
PL_vtbl_pos,
MEMBER_TO_FPTR(Perl_magic_getpos),
MEMBER_TO_FPTR(Perl_magic_setpos),
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
);
MGVTBL_SET(
PL_vtbl_bm,
- NULL,
+ 0,
MEMBER_TO_FPTR(Perl_magic_setbm),
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
);
MGVTBL_SET(
PL_vtbl_fm,
- NULL,
+ 0,
MEMBER_TO_FPTR(Perl_magic_setfm),
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
);
MGVTBL_SET(
PL_vtbl_uvar,
MEMBER_TO_FPTR(Perl_magic_getuvar),
MEMBER_TO_FPTR(Perl_magic_setuvar),
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
);
MGVTBL_SET(
PL_vtbl_defelem,
MEMBER_TO_FPTR(Perl_magic_getdefelem),
MEMBER_TO_FPTR(Perl_magic_setdefelem),
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
);
MGVTBL_SET(
PL_vtbl_regexp,
- NULL,
+ 0,
MEMBER_TO_FPTR(Perl_magic_setregexp),
- NULL,
- NULL,
+ 0,
+ 0,
MEMBER_TO_FPTR(Perl_magic_freeregexp),
- NULL,
- NULL,
- NULL
-);
-
-MGVTBL_SET(
- PL_vtbl_regdata_names,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
+ 0,
+ 0,
+ 0
);
MGVTBL_SET(
PL_vtbl_regdata,
- NULL,
- NULL,
+ 0,
+ 0,
MEMBER_TO_FPTR(Perl_magic_regdata_cnt),
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
);
MGVTBL_SET(
PL_vtbl_regdatum,
MEMBER_TO_FPTR(Perl_magic_regdatum_get),
MEMBER_TO_FPTR(Perl_magic_regdatum_set),
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
);
MGVTBL_SET(
PL_vtbl_amagic,
- NULL,
+ 0,
MEMBER_TO_FPTR(Perl_magic_setamagic),
- NULL,
- NULL,
+ 0,
+ 0,
MEMBER_TO_FPTR(Perl_magic_setamagic),
- NULL,
- NULL,
- NULL
+ 0,
+ 0,
+ 0
);
MGVTBL_SET(
PL_vtbl_amagicelem,
- NULL,
+ 0,
MEMBER_TO_FPTR(Perl_magic_setamagic),
- NULL,
- NULL,
+ 0,
+ 0,
MEMBER_TO_FPTR(Perl_magic_setamagic),
- NULL,
- NULL,
- NULL
+ 0,
+ 0,
+ 0
);
MGVTBL_SET(
PL_vtbl_backref,
- NULL,
- NULL,
- NULL,
- NULL,
+ 0,
+ 0,
+ 0,
+ 0,
MEMBER_TO_FPTR(Perl_magic_killbackrefs),
- NULL,
- NULL,
- NULL
+ 0,
+ 0,
+ 0
);
MGVTBL_SET(
PL_vtbl_ovrld,
- NULL,
- NULL,
- NULL,
- NULL,
+ 0,
+ 0,
+ 0,
+ 0,
MEMBER_TO_FPTR(Perl_magic_freeovrld),
- NULL,
- NULL,
- NULL
+ 0,
+ 0,
+ 0
);
MGVTBL_SET(
PL_vtbl_utf8,
- NULL,
+ 0,
MEMBER_TO_FPTR(Perl_magic_setutf8),
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
);
#ifdef USE_LOCALE_COLLATE
MGVTBL_SET(
PL_vtbl_collxfrm,
- NULL,
+ 0,
MEMBER_TO_FPTR(Perl_magic_setcollxfrm),
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
);
#endif
MGVTBL_SET(
PL_vtbl_hintselem,
- NULL,
+ 0,
MEMBER_TO_FPTR(Perl_magic_sethint),
- NULL,
+ 0,
MEMBER_TO_FPTR(Perl_magic_clearhint),
- NULL,
- NULL,
- NULL,
- NULL
+ 0,
+ 0,
+ 0,
+ 0
);
#include "overload.h"
#define PERL_PV_ESCAPE_ALL 0x1000
#define PERL_PV_ESCAPE_NOBACKSLASH 0x2000
#define PERL_PV_ESCAPE_NOCLEAR 0x4000
+#define PERL_PV_ESCAPE_RE 0x8000
/* used by pv_display in dump.c*/
#define PERL_PV_PRETTY_DUMP PERL_PV_PRETTY_ELIPSES|PERL_PV_PRETTY_QUOTE
-#define PERL_PV_PRETTY_REGPROP PERL_PV_PRETTY_ELIPSES|PERL_PV_PRETTY_LTGT
+#define PERL_PV_PRETTY_REGPROP PERL_PV_PRETTY_ELIPSES|PERL_PV_PRETTY_LTGT|PERL_PV_ESCAPE_RE
/*