summaryrefslogtreecommitdiff
path: root/pad.h
diff options
context:
space:
mode:
authorZefram <zefram@fysh.org>2010-12-12 16:08:14 +0000
committerFather Chrysostomos <sprout@cpan.org>2011-07-12 21:46:51 -0700
commitcc76b5cc1552a60539ae1e99cc0b9817087d4bc4 (patch)
tree9409eb07ce6d196f836db8df318042986cf2e4a7 /pad.h
parent68a9cf1a90f1a8fed74fdd419ad1ec538439e1c8 (diff)
downloadperl-cc76b5cc1552a60539ae1e99cc0b9817087d4bc4.tar.gz
APIify pad functions
Move several pad functions into the core API. Document the pad functions more consistently for perlapi. Fix the interface issues around delimitation of lexical variable names, providing _pvn, _pvs, _pv, and _sv forms of pad_add_name and pad_findmy.
Diffstat (limited to 'pad.h')
-rw-r--r--pad.h40
1 files changed, 31 insertions, 9 deletions
diff --git a/pad.h b/pad.h
index 7e130d879d..8c3d76d864 100644
--- a/pad.h
+++ b/pad.h
@@ -10,7 +10,9 @@
* variables, op targets and constants.
*/
-
+/*
+=head1 Pad Data Structures
+*/
/* a padlist is currently just an AV; but that might change,
@@ -118,15 +120,11 @@ typedef enum {
padtidy_FORMAT /* or a format */
} padtidy_type;
-#ifdef PERL_CORE
-
-/* 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. */
+/* flags for pad_add_name_pvn. SVf_UTF8 will also be valid in the future. */
-#endif
+#define padadd_OUR 0x01 /* our declaration. */
+#define padadd_STATE 0x02 /* state declaration. */
+#define padadd_NO_DUP_CHECK 0x04 /* skip warning on dups. */
/* ASSERT_CURPAD_LEGAL and ASSERT_CURPAD_ACTIVE respectively determine
* whether PL_comppad and PL_curpad are consistent and whether they have
@@ -366,6 +364,30 @@ Clone the state variables associated with running and compiling pads.
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