X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pad.h;h=e8390427221d57bcf65a11c0f61ec3b4c52dd476;hb=05106a66598c0f7468245082baf57f74ae89945f;hp=e61b4098797ae31dd89ba433ef58dc6440b957bb;hpb=c5ab0850d11c51d3e7b48a5a420612220e590022;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pad.h b/pad.h index e61b409..e839042 100644 --- a/pad.h +++ b/pad.h @@ -1,6 +1,6 @@ /* pad.h * - * Copyright (c) 2002, Larry Wall + * Copyright (C) 2002, 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. @@ -34,11 +34,9 @@ typedef U64TYPE PADOFFSET; /* flags for the pad_new() function */ -typedef enum { - padnew_CLONE = 1, /* this pad is for a cloned CV */ - padnew_SAVE = 2, /* save old globals */ - padnew_SAVESUB = 4 /* also save extra stuff for start of sub */ -} padnew_flags; +#define padnew_CLONE 1 /* this pad is for a cloned CV */ +#define padnew_SAVE 2 /* save old globals */ +#define padnew_SAVESUB 4 /* also save extra stuff for start of sub */ /* values for the pad_tidy() function */ @@ -107,6 +105,9 @@ Get the value from slot C in the base (DEPTH=1) pad of a padlist Set the current pad to be pad C in the padlist, saving the previous current pad. +=for apidoc m|void|PAD_SET_CUR_NOSAVE |PADLIST padlist|I32 n +like PAD_SET_CUR, but without the save + =for apidoc m|void|PAD_SAVE_SETNULLPAD Save the current pad then set it to null. @@ -135,8 +136,7 @@ Restore the old pad saved into the local variable opad by PAD_SAVE_LOCAL() ? AvARRAY((AV*)(AvARRAY(padlist)[1]))[po] : Nullsv; -#define PAD_SET_CUR(padlist,n) \ - SAVECOMPPAD(); \ +#define PAD_SET_CUR_NOSAVE(padlist,n) \ PL_comppad = (PAD*) (AvARRAY(padlist)[n]); \ PL_curpad = AvARRAY(PL_comppad); \ DEBUG_Xv(PerlIO_printf(Perl_debug_log, \ @@ -144,6 +144,11 @@ Restore the old pad saved into the local variable opad by PAD_SAVE_LOCAL() PTR2UV(PL_comppad), PTR2UV(PL_curpad), (int)(n))); +#define PAD_SET_CUR(padlist,n) \ + SAVECOMPPAD(); \ + PAD_SET_CUR_NOSAVE(padlist,n); + + #define PAD_SAVE_SETNULLPAD() SAVECOMPPAD(); \ PL_comppad = Null(PAD*); PL_curpad = Null(SV**); \ DEBUG_Xv(PerlIO_printf(Perl_debug_log, "Pad set_null\n"));