This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
As SVs can't both be in a pad, and the name of a variable in the pad,
[perl5.git] / pad.h
diff --git a/pad.h b/pad.h
index ce53b3b..b234e63 100644 (file)
--- a/pad.h
+++ b/pad.h
@@ -1,6 +1,6 @@
 /*    pad.h
  *
- *    Copyright (C) 2002, by Larry Wall and others
+ *    Copyright (C) 2002, 2003, 2005, by Larry Wall and others
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
@@ -77,7 +77,7 @@ Save a pad slot (used to restore after an iteration)
 
 XXX DAPM it would make more sense to make the arg a PADOFFSET
 =for apidoc m|void|SAVECLEARSV |SV **svp
-Clear the pointed to pad value on scope exit. (ie the runtime action of 'my')
+Clear the pointed to pad value on scope exit. (i.e. the runtime action of 'my')
 
 =for apidoc m|void|SAVECOMPPAD
 save PL_comppad and PL_curpad
@@ -138,7 +138,7 @@ Restore the old pad saved into the local variable opad by PAD_SAVE_LOCAL()
 
 #define PAD_BASE_SV(padlist, po) \
        (AvARRAY(padlist)[1])   \
-           ? AvARRAY((AV*)(AvARRAY(padlist)[1]))[po] : Nullsv;
+           ? AvARRAY((AV*)(AvARRAY(padlist)[1]))[po] : NULL;
     
 
 #define PAD_SET_CUR_NOSAVE(padlist,n) \
@@ -155,20 +155,20 @@ Restore the old pad saved into the local variable opad by PAD_SAVE_LOCAL()
 
 
 #define PAD_SAVE_SETNULLPAD()  SAVECOMPPAD(); \
-       PL_comppad = Null(PAD*); PL_curpad = Null(SV**);        \
+       PL_comppad = NULL; PL_curpad = NULL;    \
        DEBUG_Xv(PerlIO_printf(Perl_debug_log, "Pad set_null\n"));
 
 #define PAD_SAVE_LOCAL(opad,npad) \
        opad = PL_comppad;                                      \
        PL_comppad = (npad);                                    \
-       PL_curpad =  PL_comppad ? AvARRAY(PL_comppad) : Null(SV**); \
+       PL_curpad =  PL_comppad ? AvARRAY(PL_comppad) : NULL;   \
        DEBUG_Xv(PerlIO_printf(Perl_debug_log,                  \
              "Pad 0x%"UVxf"[0x%"UVxf"] save_local\n",          \
              PTR2UV(PL_comppad), PTR2UV(PL_curpad)));
 
 #define PAD_RESTORE_LOCAL(opad) \
        PL_comppad = opad;                                      \
-       PL_curpad =  PL_comppad ? AvARRAY(PL_comppad) : Null(SV**); \
+       PL_curpad =  PL_comppad ? AvARRAY(PL_comppad) : NULL;   \
        DEBUG_Xv(PerlIO_printf(Perl_debug_log,                  \
              "Pad 0x%"UVxf"[0x%"UVxf"] restore_local\n",       \
              PTR2UV(PL_comppad), PTR2UV(PL_curpad)));
@@ -219,6 +219,8 @@ ling pad (lvalue) to C<gen>.  Note that C<SvCUR_set> is hijacked for this purpos
 */
 
 #define PAD_COMPNAME_FLAGS(po) SvFLAGS(*av_fetch(PL_comppad_name, (po), FALSE))
+#define PAD_COMPNAME_FLAGS_isOUR(po) \
+  ((PAD_COMPNAME_FLAGS(po) & (SVpad_NAME|SVpad_OUR)) == (SVpad_NAME|SVpad_OUR))
 #define PAD_COMPNAME_PV(po) SvPV_nolen(*av_fetch(PL_comppad_name, (po), FALSE))
 
 #define PAD_COMPNAME_TYPE(po) pad_compname_type(po)
@@ -264,7 +266,7 @@ Clone the state variables associated with running and compiling pads.
 
 #define PAD_CLONE_VARS(proto_perl, param)                              \
     PL_comppad = (AV *) ptr_table_fetch(PL_ptr_table, proto_perl->Icomppad); \
-    PL_curpad = PL_comppad ?  AvARRAY(PL_comppad) : Null(SV**);                \
+    PL_curpad = PL_comppad ?  AvARRAY(PL_comppad) : NULL;              \
     PL_comppad_name            = av_dup(proto_perl->Icomppad_name, param); \
     PL_comppad_name_fill       = proto_perl->Icomppad_name_fill;       \
     PL_comppad_name_floor      = proto_perl->Icomppad_name_floor;      \