X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pad.h;h=f746eae7beb6495164974b976eb2d1bd87a85166;hb=4df4e287246babaf287cf6336ca862ceeead8e46;hp=daaa50953b04fe040c4c8471555016e34412082f;hpb=8f77bfdb1ccc695676a1e8260398001deb0b18cf;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pad.h b/pad.h index daaa509..f746eae 100644 --- a/pad.h +++ b/pad.h @@ -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 @@ -103,7 +103,12 @@ Get the value from slot C in the base (DEPTH=1) pad of a padlist =for apidoc m|void|PAD_SET_CUR |PADLIST padlist|I32 n Set the current pad to be pad C in the padlist, saving -the previous current pad. +the previous current pad. NB currently this macro expands to a string too +long for some compilers, so it's best to replace it with + + SAVECOMPPAD(); + PAD_SET_CUR_NOSAVE(padlist,n); + =for apidoc m|void|PAD_SET_CUR_NOSAVE |PADLIST padlist|I32 n like PAD_SET_CUR, but without the save @@ -205,23 +210,25 @@ Assumes the slot entry is a valid C lexical. The generation number of the name at offset C in the current compiling pad (lvalue). Note that C is hijacked for this purpose. +=for apidoc m|STRLEN|PAD_COMPNAME_GEN_set|PADOFFSET po|int gen +Sets the generation number of the name at offset C in the current +ling pad (lvalue) to C. Note that C is hijacked for this purpose. + =cut + */ #define PAD_COMPNAME_FLAGS(po) SvFLAGS(*av_fetch(PL_comppad_name, (po), FALSE)) #define PAD_COMPNAME_PV(po) SvPV_nolen(*av_fetch(PL_comppad_name, (po), FALSE)) -/* XXX DAPM yuk - using av_fetch twice. Is there a better way? */ -#define PAD_COMPNAME_TYPE(po) \ - ((SvFLAGS(*av_fetch(PL_comppad_name, (po), FALSE)) & SVpad_TYPED) \ - ? (SvSTASH(*av_fetch(PL_comppad_name, (po), FALSE))) : Nullhv) +#define PAD_COMPNAME_TYPE(po) pad_compname_type(po) #define PAD_COMPNAME_OURSTASH(po) \ (GvSTASH(*av_fetch(PL_comppad_name, (po), FALSE))) #define PAD_COMPNAME_GEN(po) SvCUR(AvARRAY(PL_comppad_name)[po]) - +#define PAD_COMPNAME_GEN_set(po, gen) SvCUR_set(AvARRAY(PL_comppad_name)[po], gen) /*