1N/A * Copyright (C) 2002, by Larry Wall and others 1N/A * You may distribute under the terms of either the GNU General Public 1N/A * License or the Artistic License, as specified in the README file. 1N/A * This file defines the types and macros associated with the API for 1N/A * manipulating scratchpads, which are used by perl to store lexical 1N/A * variables, op targets and constants. 1N/A/* a padlist is currently just an AV; but that might change, 1N/A * so hide the type. Ditto a pad. */ 1N/A/* offsets within a pad */ 1N/A/* flags for the pad_new() function */ 1N/A/* values for the pad_tidy() function */ 1N/A/* ASSERT_CURPAD_LEGAL and ASSERT_CURPAD_ACTIVE respectively determine 1N/A * whether PL_comppad and PL_curpad are consistent and whether they have 1N/A/* Note: the following three macros are actually defined in scope.h, but 1N/A * they are documented here for completeness, since they directly or 1N/A * indirectly affect pads. 1N/A=for apidoc m|void|SAVEPADSV |PADOFFSET po 1N/ASave a pad slot (used to restore after an iteration) 1N/AXXX DAPM it would make more sense to make the arg a PADOFFSET 1N/A=for apidoc m|void|SAVECLEARSV |SV **svp 1N/AClear the pointed to pad value on scope exit. (ie the runtime action of 'my') 1N/A=for apidoc m|void|SAVECOMPPAD 1N/Asave PL_comppad and PL_curpad 1N/A=for apidoc m|SV *|PAD_SETSV |PADOFFSET po|SV* sv 1N/ASet the slot at offset C<po> in the current pad to C<sv> 1N/A=for apidoc m|void|PAD_SV |PADOFFSET po 1N/AGet the value at offset C<po> in the current pad 1N/A=for apidoc m|SV *|PAD_SVl |PADOFFSET po 1N/ALightweight and lvalue version of C<PAD_SV>. 1N/AGet or set the value at offset C<po> in the current pad. 1N/AUnlike C<PAD_SV>, does not print diagnostics with -DX. 1N/AFor internal use only. 1N/A=for apidoc m|SV *|PAD_BASE_SV |PADLIST padlist|PADOFFSET po 1N/AGet the value from slot C<po> in the base (DEPTH=1) pad of a padlist 1N/A=for apidoc m|void|PAD_SET_CUR |PADLIST padlist|I32 n 1N/ASet the current pad to be pad C<n> in the padlist, saving 1N/Athe previous current pad. 1N/A=for apidoc m|void|PAD_SET_CUR_NOSAVE |PADLIST padlist|I32 n 1N/Alike PAD_SET_CUR, but without the save 1N/A=for apidoc m|void|PAD_SAVE_SETNULLPAD 1N/ASave the current pad then set it to null. 1N/A=for apidoc m|void|PAD_SAVE_LOCAL|PAD *opad|PAD *npad 1N/ASave the current pad to the local variable opad, then make the 1N/Acurrent pad equal to npad 1N/A=for apidoc m|void|PAD_RESTORE_LOCAL|PAD *opad 1N/ARestore the old pad saved into the local variable opad by PAD_SAVE_LOCAL() 1N/A=for apidoc m|void|CX_CURPAD_SAVE|struct context 1N/ASave the current pad in the given context block structure. 1N/A=for apidoc m|SV *|CX_CURPAD_SV|struct context|PADOFFSET po 1N/AAccess the SV at offset po in the saved current pad in the given 1N/Acontext block structure (can be used as an lvalue). 1N/A=for apidoc m|U32|PAD_COMPNAME_FLAGS|PADOFFSET po 1N/AReturn the flags for the current compiling pad name 1N/Aat offset C<po>. Assumes a valid slot entry. 1N/A=for apidoc m|char *|PAD_COMPNAME_PV|PADOFFSET po 1N/AReturn the name of the current compiling pad name 1N/Aat offset C<po>. Assumes a valid slot entry. 1N/A=for apidoc m|HV *|PAD_COMPNAME_TYPE|PADOFFSET po 1N/AReturn the type (stash) of the current compiling pad name at offset 1N/AC<po>. Must be a valid name. Returns null if not typed. 1N/A=for apidoc m|HV *|PAD_COMPNAME_OURSTASH|PADOFFSET po 1N/AReturn the stash associated with an C<our> variable. 1N/AAssumes the slot entry is a valid C<our> lexical. 1N/A=for apidoc m|STRLEN|PAD_COMPNAME_GEN|PADOFFSET po 1N/AThe generation number of the name at offset C<po> in the current 1N/Acompiling pad (lvalue). Note that C<SvCUR> is hijacked for this purpose. 1N/A/* XXX DAPM yuk - using av_fetch twice. Is there a better way? */ 1N/A=for apidoc m|void|PAD_DUP|PADLIST dstpad|PADLIST srcpad|CLONE_PARAMS* param 1N/A=for apidoc m|void|PAD_CLONE_VARS|PerlInterpreter *proto_perl \ 1N/AClone the state variables associated with running and compiling pads. 1N/A /* XXX padlists are real, but pretend to be not */ \
1N/A/* NB - we set PL_comppad to null unless it points at a value that 1N/A * has already been dup'ed, ie it points to part of an active padlist. 1N/A * Otherwise PL_comppad ends up being a leaked scalar in code like 1N/A * threads->create(sub { threads->create(sub {...} ) } ); 1N/A * where the second thread dups the outer sub's comppad but not the 1N/A * sub's CV or padlist. */