This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Remove proto magic type
[perl5.git] / pad.h
CommitLineData
dd2155a4
DM
1/* pad.h
2 *
2eee27d7
SS
3 * Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008,
4 * 2009, 2010, 2011 by Larry Wall and others
dd2155a4
DM
5 *
6 * You may distribute under the terms of either the GNU General Public
7 * License or the Artistic License, as specified in the README file.
8 *
9 * This file defines the types and macros associated with the API for
10 * manipulating scratchpads, which are used by perl to store lexical
11 * variables, op targets and constants.
12 */
13
cc76b5cc
Z
14/*
15=head1 Pad Data Structures
16*/
dd2155a4
DM
17
18
dd2155a4
DM
19/* offsets within a pad */
20
21#if PTRSIZE == 4
22typedef U32TYPE PADOFFSET;
23#else
24# if PTRSIZE == 8
25typedef U64TYPE PADOFFSET;
26# endif
27#endif
28#define NOT_IN_PAD ((PADOFFSET) -1)
809abb02 29
9b7476d7
FC
30/* B.xs expects the first members of these two structs to line up
31 (xpadl_max with xpadnl_fill).
32 */
7261499d
FC
33
34struct padlist {
35 SSize_t xpadl_max; /* max index for which array has space */
36 PAD ** xpadl_alloc; /* pointer to beginning of array of AVs */
8771da69 37 PADNAMELIST*xpadl_outid; /* Padnamelist of outer pad; used as ID */
7261499d
FC
38};
39
9b7476d7
FC
40struct padnamelist {
41 SSize_t xpadnl_fill; /* max index in use */
42 PADNAME ** xpadnl_alloc; /* pointer to beginning of array */
43 SSize_t xpadnl_max; /* max index for which array has space */
44 PADOFFSET xpadnl_max_named; /* highest index with len > 0 */
45 U32 xpadnl_refcnt;
46};
47
0f94cb1f
FC
48struct padname {
49 char * xpadn_pv;
50 HV * xpadn_ourstash;
51 union {
52 HV * xpadn_typestash;
53 CV * xpadn_protocv;
54 } xpadn_type_u;
55 U32 xpadn_low;
56 U32 xpadn_high;
57 U32 xpadn_refcnt;
58 int xpadn_gen;
59 U8 xpadn_len;
60 U8 xpadn_flags;
61};
62
63struct padname_with_str {
64 struct padname xpadn_padname;
65 char xpadn_str[1];
66};
67
68#define PADNAME_FROM_PV(s) \
69 ((PADNAME *)((s) - STRUCT_OFFSET(struct padname_with_str, xpadn_str)))
70
7261499d 71
2df5bdd7
DM
72/* a value that PL_cop_seqmax is guaranteed never to be,
73 * flagging that a lexical is being introduced, or has not yet left scope
74 */
75#define PERL_PADSEQ_INTRO U32_MAX
953c8b80
FC
76#define COP_SEQMAX_INC \
77 (PL_cop_seqmax++, \
78 (void)(PL_cop_seqmax == PERL_PADSEQ_INTRO && PL_cop_seqmax++))
2df5bdd7
DM
79
80
7948fc08 81/* B.xs needs these for the benefit of B::Deparse */
809abb02 82/* Low range end is exclusive (valid from the cop seq after this one) */
809abb02 83/* High range end is inclusive (valid up to this cop seq) */
809abb02 84
0f94cb1f
FC
85#define COP_SEQ_RANGE_LOW(pn) (pn)->xpadn_low
86#define COP_SEQ_RANGE_HIGH(pn) (pn)->xpadn_high
87#define PARENT_PAD_INDEX(pn) (pn)->xpadn_low
88#define PARENT_FAKELEX_FLAGS(pn) (pn)->xpadn_high
dd2155a4 89
6c5e080d 90/* Flags set in the SvIVX field of FAKE namesvs */
7948fc08 91
6c5e080d
NC
92#define PAD_FAKELEX_ANON 1 /* the lex is declared in an ANON, or ... */
93#define PAD_FAKELEX_MULTI 2 /* the lex can be instantiated multiple times */
94
dd2155a4
DM
95/* flags for the pad_new() function */
96
c7c737cb
DM
97#define padnew_CLONE 1 /* this pad is for a cloned CV */
98#define padnew_SAVE 2 /* save old globals */
99#define padnew_SAVESUB 4 /* also save extra stuff for start of sub */
dd2155a4
DM
100
101/* values for the pad_tidy() function */
102
103typedef enum {
104 padtidy_SUB, /* tidy up a pad for a sub, */
105 padtidy_SUBCLONE, /* a cloned sub, */
106 padtidy_FORMAT /* or a format */
107} padtidy_type;
108
9f6ec8dd 109/* flags for pad_add_name_pvn. */
35f82371 110
9f6ec8dd
BF
111#define padadd_OUR 0x01 /* our declaration. */
112#define padadd_STATE 0x02 /* state declaration. */
113#define padadd_NO_DUP_CHECK 0x04 /* skip warning on dups. */
7ef30830
FC
114#define padadd_STALEOK 0x08 /* allow stale lexical in active
115 * sub, but only one level up */
35f82371 116
f3548bdc
DM
117/* ASSERT_CURPAD_LEGAL and ASSERT_CURPAD_ACTIVE respectively determine
118 * whether PL_comppad and PL_curpad are consistent and whether they have
119 * active values */
dd2155a4 120
1dba731d 121# define pad_peg(label)
1dba731d 122
f3548bdc
DM
123#ifdef DEBUGGING
124# define ASSERT_CURPAD_LEGAL(label) \
1dba731d 125 pad_peg(label); \
f3548bdc 126 if (PL_comppad ? (AvARRAY(PL_comppad) != PL_curpad) : (PL_curpad != 0)) \
61608bb7 127 Perl_croak(aTHX_ "panic: illegal pad in %s: 0x%" UVxf "[0x%" UVxf "]",\
f3548bdc
DM
128 label, PTR2UV(PL_comppad), PTR2UV(PL_curpad));
129
130
131# define ASSERT_CURPAD_ACTIVE(label) \
1dba731d 132 pad_peg(label); \
f3548bdc 133 if (!PL_comppad || (AvARRAY(PL_comppad) != PL_curpad)) \
61608bb7 134 Perl_croak(aTHX_ "panic: invalid pad in %s: 0x%" UVxf "[0x%" UVxf "]",\
f3548bdc
DM
135 label, PTR2UV(PL_comppad), PTR2UV(PL_curpad));
136#else
137# define ASSERT_CURPAD_LEGAL(label)
138# define ASSERT_CURPAD_ACTIVE(label)
139#endif
140
141
142
143/* Note: the following three macros are actually defined in scope.h, but
dd2155a4
DM
144 * they are documented here for completeness, since they directly or
145 * indirectly affect pads.
146
147=for apidoc m|void|SAVEPADSV |PADOFFSET po
148Save a pad slot (used to restore after an iteration)
149
f3548bdc 150XXX DAPM it would make more sense to make the arg a PADOFFSET
dd2155a4 151=for apidoc m|void|SAVECLEARSV |SV **svp
154e47c8
FC
152Clear the pointed to pad value on scope exit. (i.e. the runtime action of
153'my')
dd2155a4
DM
154
155=for apidoc m|void|SAVECOMPPAD
9c47725a 156save PL_comppad and PL_curpad
dd2155a4 157
dd2155a4 158
86d2498c 159=for apidoc Amx|PAD **|PadlistARRAY|PADLIST padlist
35e035cc
FC
160The C array of a padlist, containing the pads. Only subscript it with
161numbers >= 1, as the 0th entry is not guaranteed to remain usable.
dd2155a4 162
86d2498c 163=for apidoc Amx|SSize_t|PadlistMAX|PADLIST padlist
57ee99bb
FC
164The index of the last allocated space in the padlist. Note that the last
165pad may be in an earlier slot. Any entries following it will be NULL in
166that case.
35e035cc 167
86d2498c 168=for apidoc Amx|PADNAMELIST *|PadlistNAMES|PADLIST padlist
35e035cc
FC
169The names associated with pad entries.
170
86d2498c 171=for apidoc Amx|PADNAME **|PadlistNAMESARRAY|PADLIST padlist
35e035cc
FC
172The C array of pad names.
173
86d2498c 174=for apidoc Amx|SSize_t|PadlistNAMESMAX|PADLIST padlist
35e035cc
FC
175The index of the last pad name.
176
86d2498c 177=for apidoc Amx|U32|PadlistREFCNT|PADLIST padlist
35e035cc
FC
178The reference count of the padlist. Currently this is always 1.
179
86d2498c 180=for apidoc Amx|PADNAME **|PadnamelistARRAY|PADNAMELIST pnl
35e035cc
FC
181The C array of pad names.
182
86d2498c 183=for apidoc Amx|SSize_t|PadnamelistMAX|PADNAMELIST pnl
35e035cc
FC
184The index of the last pad name.
185
9b7476d7
FC
186=for apidoc Amx|SSize_t|PadnamelistREFCNT|PADNAMELIST pnl
187The reference count of the pad name list.
188
189=for apidoc Amx|void|PadnamelistREFCNT_dec|PADNAMELIST pnl
190Lowers the reference count of the pad name list.
191
86d2498c 192=for apidoc Amx|SV **|PadARRAY|PAD pad
35e035cc
FC
193The C array of pad entries.
194
86d2498c 195=for apidoc Amx|SSize_t|PadMAX|PAD pad
35e035cc
FC
196The index of the last pad entry.
197
86d2498c 198=for apidoc Amx|char *|PadnamePV|PADNAME pn
863f2221
FC
199The name stored in the pad name struct. This returns NULL for a target
200slot.
35e035cc 201
86d2498c 202=for apidoc Amx|STRLEN|PadnameLEN|PADNAME pn
35e035cc
FC
203The length of the name.
204
86d2498c 205=for apidoc Amx|bool|PadnameUTF8|PADNAME pn
2502ffdf 206Whether PadnamePV is in UTF8. Currently, this is always true.
35e035cc 207
86d2498c 208=for apidoc Amx|SV *|PadnameSV|PADNAME pn
0f94cb1f 209Returns the pad name as a mortal SV.
97dad6bd 210
86d2498c 211=for apidoc m|bool|PadnameIsOUR|PADNAME pn
35e035cc
FC
212Whether this is an "our" variable.
213
86d2498c 214=for apidoc m|HV *|PadnameOURSTASH
35e035cc
FC
215The stash in which this "our" variable was declared.
216
86d2498c 217=for apidoc m|bool|PadnameOUTER|PADNAME pn
b19cb98d
FC
218Whether this entry belongs to an outer pad. Entries for which this is true
219are often referred to as 'fake'.
c44737a2 220
3f6a9d3a 221=for apidoc m|bool|PadnameIsSTATE|PADNAME pn
643fe368
FC
222Whether this is a "state" variable.
223
86d2498c 224=for apidoc m|HV *|PadnameTYPE|PADNAME pn
35e035cc
FC
225The stash associated with a typed lexical. This returns the %Foo:: hash
226for C<my Foo $bar>.
dd2155a4 227
0f94cb1f
FC
228=for apidoc Amx|SSize_t|PadnameREFCNT|PADNAME pn
229The reference count of the pad name.
230
231=for apidoc Amx|void|PadnameREFCNT_dec|PADNAME pn
232Lowers the reference count of the pad name.
233
dd2155a4
DM
234
235=for apidoc m|SV *|PAD_SETSV |PADOFFSET po|SV* sv
236Set the slot at offset C<po> in the current pad to C<sv>
237
9a0afbbc 238=for apidoc m|SV *|PAD_SV |PADOFFSET po
dd2155a4
DM
239Get the value at offset C<po> in the current pad
240
241=for apidoc m|SV *|PAD_SVl |PADOFFSET po
242Lightweight and lvalue version of C<PAD_SV>.
243Get or set the value at offset C<po> in the current pad.
244Unlike C<PAD_SV>, does not print diagnostics with -DX.
245For internal use only.
246
247=for apidoc m|SV *|PAD_BASE_SV |PADLIST padlist|PADOFFSET po
248Get the value from slot C<po> in the base (DEPTH=1) pad of a padlist
249
250=for apidoc m|void|PAD_SET_CUR |PADLIST padlist|I32 n
251Set the current pad to be pad C<n> in the padlist, saving
154e47c8 252the previous current pad. NB currently this macro expands to a string too
fd617465
DM
253long for some compilers, so it's best to replace it with
254
255 SAVECOMPPAD();
256 PAD_SET_CUR_NOSAVE(padlist,n);
257
dd2155a4 258
4e380990
DM
259=for apidoc m|void|PAD_SET_CUR_NOSAVE |PADLIST padlist|I32 n
260like PAD_SET_CUR, but without the save
261
dd2155a4
DM
262=for apidoc m|void|PAD_SAVE_SETNULLPAD
263Save the current pad then set it to null.
264
f3548bdc
DM
265=for apidoc m|void|PAD_SAVE_LOCAL|PAD *opad|PAD *npad
266Save the current pad to the local variable opad, then make the
267current pad equal to npad
268
269=for apidoc m|void|PAD_RESTORE_LOCAL|PAD *opad
270Restore the old pad saved into the local variable opad by PAD_SAVE_LOCAL()
dd2155a4
DM
271
272=cut
273*/
274
86d2498c
FC
275#define PadlistARRAY(pl) (pl)->xpadl_alloc
276#define PadlistMAX(pl) (pl)->xpadl_max
9b7476d7 277#define PadlistNAMES(pl) ((PADNAMELIST *)*PadlistARRAY(pl))
86d2498c
FC
278#define PadlistNAMESARRAY(pl) PadnamelistARRAY(PadlistNAMES(pl))
279#define PadlistNAMESMAX(pl) PadnamelistMAX(PadlistNAMES(pl))
280#define PadlistREFCNT(pl) 1 /* reserved for future use */
7261499d 281
9b7476d7
FC
282#define PadnamelistARRAY(pnl) (pnl)->xpadnl_alloc
283#define PadnamelistMAX(pnl) (pnl)->xpadnl_fill
284#define PadnamelistMAXNAMED(pnl) (pnl)->xpadnl_max_named
285#define PadnamelistREFCNT(pnl) (pnl)->xpadnl_refcnt
286#define PadnamelistREFCNT_dec(pnl) Perl_padnamelist_free(aTHX_ pnl)
35e035cc 287
86d2498c
FC
288#define PadARRAY(pad) AvARRAY(pad)
289#define PadMAX(pad) AvFILLp(pad)
35e035cc 290
0f94cb1f
FC
291#define PadnamePV(pn) (pn)->xpadn_pv
292#define PadnameLEN(pn) (pn)->xpadn_len
293#define PadnameUTF8(pn) 1
294#define PadnameSV(pn) \
295 newSVpvn_flags(PadnamePV(pn), PadnameLEN(pn), SVs_TEMP|SVf_UTF8)
296#define PadnameFLAGS(pn) (pn)->xpadn_flags
297#define PadnameIsOUR(pn) (!!(pn)->xpadn_ourstash)
298#define PadnameOURSTASH(pn) (pn)->xpadn_ourstash
299#define PadnameTYPE(pn) (pn)->xpadn_type_u.xpadn_typestash
300#define PadnamePROTOCV(pn) (pn)->xpadn_type_u.xpadn_protocv
301#define PadnameREFCNT(pn) (pn)->xpadn_refcnt
302#define PadnameREFCNT_dec(pn) Perl_padname_free(aTHX_ pn)
303#define PadnameOURSTASH_set(pn,s) (PadnameOURSTASH(pn) = (s))
304#define PadnameTYPE_set(pn,s) (PadnameTYPE(pn) = (s))
305#define PadnameOUTER(pn) (PadnameFLAGS(pn) & PADNAMEt_OUTER)
306#define PadnameIsSTATE(pn) (PadnameFLAGS(pn) & PADNAMEt_STATE)
307#define PadnameLVALUE(pn) (PadnameFLAGS(pn) & PADNAMEt_LVALUE)
308
309#define PadnameLVALUE_on(pn) (PadnameFLAGS(pn) |= PADNAMEt_LVALUE)
310#define PadnameIsSTATE_on(pn) (PadnameFLAGS(pn) |= PADNAMEt_STATE)
311
312#define PADNAMEt_OUTER 1 /* outer lexical var */
313#define PADNAMEt_STATE 2 /* state var */
314#define PADNAMEt_LVALUE 4 /* used as lvalue */
315#define PADNAMEt_TYPED 8 /* for B; unused by core */
316#define PADNAMEt_OUR 16 /* for B; unused by core */
317
318/* backward compatibility */
319#define SvPAD_STATE PadnameIsSTATE
320#define SvPAD_TYPED(pn) (!!PadnameTYPE(pn))
321#define SvPAD_OUR(pn) (!!PadnameOURSTASH(pn))
322#define SvPAD_STATE_on PadnameIsSTATE_on
323#define SvPAD_TYPED_on(pn) (PadnameFLAGS(pn) |= PADNAMEt_TYPED)
324#define SvPAD_OUR_on(pn) (PadnameFLAGS(pn) |= PADNAMEt_OUR)
325#define SvOURSTASH PadnameOURSTASH
326#define SvOURSTASH_set PadnameOURSTASH_set
327#define SVpad_STATE PADNAMEt_STATE
328#define SVpad_TYPED PADNAMEt_TYPED
329#define SVpad_OUR PADNAMEt_OUR
35e035cc 330
dd2155a4
DM
331#ifdef DEBUGGING
332# define PAD_SV(po) pad_sv(po)
333# define PAD_SETSV(po,sv) pad_setsv(po,sv)
334#else
335# define PAD_SV(po) (PL_curpad[po])
336# define PAD_SETSV(po,sv) PL_curpad[po] = (sv)
337#endif
338
339#define PAD_SVl(po) (PL_curpad[po])
340
341#define PAD_BASE_SV(padlist, po) \
86d2498c
FC
342 (PadlistARRAY(padlist)[1]) \
343 ? AvARRAY(MUTABLE_AV((PadlistARRAY(padlist)[1])))[po] \
7261499d 344 : NULL;
7948fc08 345
dd2155a4 346
de5e01c2 347#define PAD_SET_CUR_NOSAVE(padlist,nth) \
86d2498c 348 PL_comppad = (PAD*) (PadlistARRAY(padlist)[nth]); \
f3548bdc
DM
349 PL_curpad = AvARRAY(PL_comppad); \
350 DEBUG_Xv(PerlIO_printf(Perl_debug_log, \
61608bb7 351 "Pad 0x%" UVxf "[0x%" UVxf "] set_cur depth=%d\n", \
de5e01c2 352 PTR2UV(PL_comppad), PTR2UV(PL_curpad), (int)(nth)));
f3548bdc
DM
353
354
de5e01c2 355#define PAD_SET_CUR(padlist,nth) \
4e380990 356 SAVECOMPPAD(); \
de5e01c2 357 PAD_SET_CUR_NOSAVE(padlist,nth);
4e380990
DM
358
359
f3548bdc 360#define PAD_SAVE_SETNULLPAD() SAVECOMPPAD(); \
4608196e 361 PL_comppad = NULL; PL_curpad = NULL; \
f3548bdc
DM
362 DEBUG_Xv(PerlIO_printf(Perl_debug_log, "Pad set_null\n"));
363
364#define PAD_SAVE_LOCAL(opad,npad) \
365 opad = PL_comppad; \
366 PL_comppad = (npad); \
4608196e 367 PL_curpad = PL_comppad ? AvARRAY(PL_comppad) : NULL; \
f3548bdc 368 DEBUG_Xv(PerlIO_printf(Perl_debug_log, \
61608bb7 369 "Pad 0x%" UVxf "[0x%" UVxf "] save_local\n", \
f3548bdc
DM
370 PTR2UV(PL_comppad), PTR2UV(PL_curpad)));
371
372#define PAD_RESTORE_LOCAL(opad) \
8c63ea58
GG
373 assert(!opad || !SvIS_FREED(opad)); \
374 PL_comppad = opad; \
4608196e 375 PL_curpad = PL_comppad ? AvARRAY(PL_comppad) : NULL; \
f3548bdc 376 DEBUG_Xv(PerlIO_printf(Perl_debug_log, \
61608bb7 377 "Pad 0x%" UVxf "[0x%" UVxf "] restore_local\n", \
f3548bdc 378 PTR2UV(PL_comppad), PTR2UV(PL_curpad)));
dd2155a4
DM
379
380
381/*
382=for apidoc m|void|CX_CURPAD_SAVE|struct context
383Save the current pad in the given context block structure.
384
f3548bdc 385=for apidoc m|SV *|CX_CURPAD_SV|struct context|PADOFFSET po
dd2155a4
DM
386Access the SV at offset po in the saved current pad in the given
387context block structure (can be used as an lvalue).
388
389=cut
390*/
391
f3548bdc 392#define CX_CURPAD_SAVE(block) (block).oldcomppad = PL_comppad
a062e10d 393#define CX_CURPAD_SV(block,po) (AvARRAY(MUTABLE_AV(((block).oldcomppad)))[po])
dd2155a4
DM
394
395
396/*
397=for apidoc m|U32|PAD_COMPNAME_FLAGS|PADOFFSET po
398Return the flags for the current compiling pad name
154e47c8 399at offset C<po>. Assumes a valid slot entry.
dd2155a4
DM
400
401=for apidoc m|char *|PAD_COMPNAME_PV|PADOFFSET po
402Return the name of the current compiling pad name
154e47c8 403at offset C<po>. Assumes a valid slot entry.
dd2155a4
DM
404
405=for apidoc m|HV *|PAD_COMPNAME_TYPE|PADOFFSET po
406Return the type (stash) of the current compiling pad name at offset
154e47c8 407C<po>. Must be a valid name. Returns null if not typed.
dd2155a4
DM
408
409=for apidoc m|HV *|PAD_COMPNAME_OURSTASH|PADOFFSET po
410Return the stash associated with an C<our> variable.
411Assumes the slot entry is a valid C<our> lexical.
412
413=for apidoc m|STRLEN|PAD_COMPNAME_GEN|PADOFFSET po
414The generation number of the name at offset C<po> in the current
154e47c8 415compiling pad (lvalue). Note that C<SvUVX> is hijacked for this purpose.
dd2155a4 416
b162af07
SP
417=for apidoc m|STRLEN|PAD_COMPNAME_GEN_set|PADOFFSET po|int gen
418Sets the generation number of the name at offset C<po> in the current
931b58fb 419ling pad (lvalue) to C<gen>. Note that C<SvUV_set> is hijacked for this purpose.
b162af07 420
dd2155a4 421=cut
b162af07 422
dd2155a4
DM
423*/
424
35e035cc 425#define PAD_COMPNAME(po) PAD_COMPNAME_SV(po)
9b7476d7 426#define PAD_COMPNAME_SV(po) (PadnamelistARRAY(PL_comppad_name)[(po)])
0f94cb1f 427#define PAD_COMPNAME_FLAGS(po) PadnameFLAGS(PAD_COMPNAME(po))
1979170b 428#define PAD_COMPNAME_FLAGS_isOUR(po) SvPAD_OUR(PAD_COMPNAME_SV(po))
e1c02f84 429#define PAD_COMPNAME_PV(po) PadnamePV(PAD_COMPNAME(po))
dd2155a4 430
afb6e3f5 431#define PAD_COMPNAME_TYPE(po) PadnameTYPE(PAD_COMPNAME(po))
dd2155a4
DM
432
433#define PAD_COMPNAME_OURSTASH(po) \
73d95100 434 (SvOURSTASH(PAD_COMPNAME_SV(po)))
dd2155a4 435
9b7476d7 436#define PAD_COMPNAME_GEN(po) \
0f94cb1f 437 ((STRLEN)PadnamelistARRAY(PL_comppad_name)[po]->xpadn_gen)
dd2155a4 438
9b7476d7 439#define PAD_COMPNAME_GEN_set(po, gen) \
0f94cb1f 440 (PadnamelistARRAY(PL_comppad_name)[po]->xpadn_gen = (gen))
dd2155a4
DM
441
442
443/*
d77cdebf 444=for apidoc m|void|PAD_CLONE_VARS|PerlInterpreter *proto_perl|CLONE_PARAMS* param
dd2155a4
DM
445Clone the state variables associated with running and compiling pads.
446
447=cut
448*/
449
c5ab0850
DM
450/* NB - we set PL_comppad to null unless it points at a value that
451 * has already been dup'ed, ie it points to part of an active padlist.
452 * Otherwise PL_comppad ends up being a leaked scalar in code like
453 * the following:
454 * threads->create(sub { threads->create(sub {...} ) } );
455 * where the second thread dups the outer sub's comppad but not the
456 * sub's CV or padlist. */
f3548bdc 457
dd2155a4 458#define PAD_CLONE_VARS(proto_perl, param) \
253649d9 459 PL_comppad = av_dup(proto_perl->Icomppad, param); \
4608196e 460 PL_curpad = PL_comppad ? AvARRAY(PL_comppad) : NULL; \
9b7476d7
FC
461 PL_comppad_name = \
462 padnamelist_dup(proto_perl->Icomppad_name, param); \
dd2155a4
DM
463 PL_comppad_name_fill = proto_perl->Icomppad_name_fill; \
464 PL_comppad_name_floor = proto_perl->Icomppad_name_floor; \
dd2155a4
DM
465 PL_min_intro_pending = proto_perl->Imin_intro_pending; \
466 PL_max_intro_pending = proto_perl->Imax_intro_pending; \
467 PL_padix = proto_perl->Ipadix; \
468 PL_padix_floor = proto_perl->Ipadix_floor; \
469 PL_pad_reset_pending = proto_perl->Ipad_reset_pending; \
470 PL_cop_seqmax = proto_perl->Icop_seqmax;
e9a8c099
MHM
471
472/*
cc76b5cc
Z
473=for apidoc Am|PADOFFSET|pad_add_name_pvs|const char *name|U32 flags|HV *typestash|HV *ourstash
474
475Exactly like L</pad_add_name_pvn>, but takes a literal string instead
476of a string/length pair.
477
478=cut
479*/
480
481#define pad_add_name_pvs(name,flags,typestash,ourstash) \
482 Perl_pad_add_name_pvn(aTHX_ STR_WITH_LEN(name), flags, typestash, ourstash)
483
484/*
485=for apidoc Am|PADOFFSET|pad_findmy_pvs|const char *name|U32 flags
486
487Exactly like L</pad_findmy_pvn>, but takes a literal string instead
488of a string/length pair.
489
490=cut
491*/
492
493#define pad_findmy_pvs(name,flags) \
494 Perl_pad_findmy_pvn(aTHX_ STR_WITH_LEN(name), flags)
495
496/*
e9a8c099
MHM
497 * Local variables:
498 * c-indentation-style: bsd
499 * c-basic-offset: 4
14d04a33 500 * indent-tabs-mode: nil
e9a8c099
MHM
501 * End:
502 *
14d04a33 503 * ex: set ts=8 sts=4 sw=4 et:
e9a8c099 504 */