* variables, op targets and constants.
*/
-
+/*
+=head1 Pad Data Structures
+*/
/* a padlist is currently just an AV; but that might change,
#endif
#define NOT_IN_PAD ((PADOFFSET) -1)
+/* a value that PL_cop_seqmax is guaranteed never to be,
+ * flagging that a lexical is being introduced, or has not yet left scope
+ */
+#define PERL_PADSEQ_INTRO U32_MAX
+
+
/* B.xs needs these for the benefit of B::Deparse */
/* Low range end is exclusive (valid from the cop seq after this one) */
/* High range end is inclusive (valid up to this cop seq) */
padtidy_FORMAT /* or a format */
} padtidy_type;
-#ifdef PERL_CORE
+/* flags for pad_add_name_pvn. */
-/* flags for pad_add_name. SVf_UTF8 will also be valid in the future. */
-
-# define padadd_OUR 0x01 /* our declaration. */
-# define padadd_STATE 0x02 /* state declaration. */
-# define padadd_NO_DUP_CHECK 0x04 /* skip warning on dups. */
-
-#endif
+#define padadd_OUR 0x01 /* our declaration. */
+#define padadd_STATE 0x02 /* state declaration. */
+#define padadd_NO_DUP_CHECK 0x04 /* skip warning on dups. */
+#define padadd_UTF8_NAME SVf_UTF8 /* name is UTF-8 encoded. */
/* ASSERT_CURPAD_LEGAL and ASSERT_CURPAD_ACTIVE respectively determine
* whether PL_comppad and PL_curpad are consistent and whether they have
PTR2UV(PL_comppad), PTR2UV(PL_curpad)));
#define PAD_RESTORE_LOCAL(opad) \
- PL_comppad = opad && SvIS_FREED(opad) ? NULL : opad; \
+ assert(!opad || !SvIS_FREED(opad)); \
+ PL_comppad = opad; \
PL_curpad = PL_comppad ? AvARRAY(PL_comppad) : NULL; \
DEBUG_Xv(PerlIO_printf(Perl_debug_log, \
"Pad 0x%"UVxf"[0x%"UVxf"] restore_local\n", \
#define PAD_COMPNAME_SV(po) (*av_fetch(PL_comppad_name, (po), FALSE))
#define PAD_COMPNAME_FLAGS(po) SvFLAGS(PAD_COMPNAME_SV(po))
-#define PAD_COMPNAME_FLAGS_isOUR(po) \
- ((PAD_COMPNAME_FLAGS(po) & (SVpad_NAME|SVpad_OUR)) == (SVpad_NAME|SVpad_OUR))
+#define PAD_COMPNAME_FLAGS_isOUR(po) SvPAD_OUR(PAD_COMPNAME_SV(po))
#define PAD_COMPNAME_PV(po) SvPV_nolen(PAD_COMPNAME_SV(po))
#define PAD_COMPNAME_TYPE(po) pad_compname_type(po)
PL_cop_seqmax = proto_perl->Icop_seqmax;
/*
+=for apidoc Am|PADOFFSET|pad_add_name_pvs|const char *name|U32 flags|HV *typestash|HV *ourstash
+
+Exactly like L</pad_add_name_pvn>, but takes a literal string instead
+of a string/length pair.
+
+=cut
+*/
+
+#define pad_add_name_pvs(name,flags,typestash,ourstash) \
+ Perl_pad_add_name_pvn(aTHX_ STR_WITH_LEN(name), flags, typestash, ourstash)
+
+/*
+=for apidoc Am|PADOFFSET|pad_findmy_pvs|const char *name|U32 flags
+
+Exactly like L</pad_findmy_pvn>, but takes a literal string instead
+of a string/length pair.
+
+=cut
+*/
+
+#define pad_findmy_pvs(name,flags) \
+ Perl_pad_findmy_pvn(aTHX_ STR_WITH_LEN(name), flags)
+
+/*
* Local variables:
* c-indentation-style: bsd
* c-basic-offset: 4