📄 perlintern.1
字号:
.IX Xref "pad_alloc".IX Item "pad_alloc"Allocate a new my or tmp pad entry. For a my, simply push a null \s-1SV\s0 ontothe end of PL_comppad, but for a tmp, scan the pad from PL_padix upwardsfor a slot which has no name and no active value..Sp.Vb 1\& PADOFFSET pad_alloc(I32 optype, U32 tmptype).Ve.IP "pad_block_start" 8.IX Xref "pad_block_start".IX Item "pad_block_start"Update the pad compilation state variables on entry to a new block.Sp.Vb 1\& void pad_block_start(int full).Ve.IP "pad_check_dup" 8.IX Xref "pad_check_dup".IX Item "pad_check_dup"Check for duplicate declarations: report any of: * a my in the current scope with the same name; * an our (anywhere in the pad) with the same name and the same stash as \f(CW\*(C`ourstash\*(C'\fR\&\f(CW\*(C`is_our\*(C'\fR indicates that the name to check is an 'our' declaration.Sp.Vb 1\& void pad_check_dup(const char* name, bool is_our, const HV* ourstash).Ve.IP "pad_findlex" 8.IX Xref "pad_findlex".IX Item "pad_findlex"Find a named lexical anywhere in a chain of nested pads. Add fake entriesin the inner pads if it's found in an outer one..SpReturns the offset in the bottom pad of the lex or the fake lex.cv is the \s-1CV\s0 in which to start the search, and seq is the current cop_seqto match against. If warn is true, print appropriate warnings. The out_*vars return values, and so are pointers to where the returned valuesshould be stored. out_capture, if non-null, requests that the innermostinstance of the lexical is captured; out_name_sv is set to the innermostmatched namesv or fake namesv; out_flags returns the flags normallyassociated with the \s-1IVX\s0 field of a fake namesv..SpNote that \fIpad_findlex()\fR is recursive; it recurses up the chain of CVs,then comes back down, adding fake entries as it goes. It has to be this waybecause fake namesvs in anon protoypes have to store in xlow the index intothe parent pad..Sp.Vb 1\& PADOFFSET pad_findlex(const char *name, const CV* cv, U32 seq, int warn, SV** out_capture, SV** out_name_sv, int *out_flags).Ve.IP "pad_findmy" 8.IX Xref "pad_findmy".IX Item "pad_findmy"Given a lexical name, try to find its offset, first in the current pad,or failing that, in the pads of any lexically enclosing subs (includingthe complications introduced by eval). If the name is found in an outer pad,then a fake entry is added to the current pad.Returns the offset in the current pad, or \s-1NOT_IN_PAD\s0 on failure..Sp.Vb 1\& PADOFFSET pad_findmy(const char* name).Ve.IP "pad_fixup_inner_anons" 8.IX Xref "pad_fixup_inner_anons".IX Item "pad_fixup_inner_anons"For any anon CVs in the pad, change CvOUTSIDE of that \s-1CV\s0 fromold_cv to new_cv if necessary. Needed when a newly-compiled \s-1CV\s0 has to bemoved to a pre-existing \s-1CV\s0 struct..Sp.Vb 1\& void pad_fixup_inner_anons(PADLIST *padlist, CV *old_cv, CV *new_cv).Ve.IP "pad_free" 8.IX Xref "pad_free".IX Item "pad_free"Free the \s-1SV\s0 at offset po in the current pad..Sp.Vb 1\& void pad_free(PADOFFSET po).Ve.IP "pad_leavemy" 8.IX Xref "pad_leavemy".IX Item "pad_leavemy"Cleanup at end of scope during compilation: set the max seq number forlexicals in this scope and warn of any lexicals that never got introduced..Sp.Vb 1\& void pad_leavemy().Ve.IP "pad_new" 8.IX Xref "pad_new".IX Item "pad_new"Create a new compiling padlist, saving and updating the various globalvars at the same time as creating the pad itself. The following flagscan be \s-1OR\s0'ed together:.Sp.Vb 3\& padnew_CLONE this pad is for a cloned CV\& padnew_SAVE save old globals\& padnew_SAVESUB also save extra stuff for start of sub\&\& PADLIST* pad_new(int flags).Ve.IP "pad_push" 8.IX Xref "pad_push".IX Item "pad_push"Push a new pad frame onto the padlist, unless there's already a pad atthis depth, in which case don't bother creating a new one. Then givethe new pad an \f(CW@_\fR in slot zero..Sp.Vb 1\& void pad_push(PADLIST *padlist, int depth).Ve.IP "pad_reset" 8.IX Xref "pad_reset".IX Item "pad_reset"Mark all the current temporaries for reuse.Sp.Vb 1\& void pad_reset().Ve.IP "pad_setsv" 8.IX Xref "pad_setsv".IX Item "pad_setsv"Set the entry at offset po in the current pad to sv.Use the macro \s-1\fIPAD_SETSV\s0()\fR rather than calling this function directly..Sp.Vb 1\& void pad_setsv(PADOFFSET po, SV* sv).Ve.IP "pad_swipe" 8.IX Xref "pad_swipe".IX Item "pad_swipe"Abandon the tmp in the current pad at offset po and replace with anew one..Sp.Vb 1\& void pad_swipe(PADOFFSET po, bool refadjust).Ve.IP "pad_tidy" 8.IX Xref "pad_tidy".IX Item "pad_tidy"Tidy up a pad after we've finished compiling it: * remove most stuff from the pads of anonsub prototypes; * give it a \f(CW@_\fR; * mark tmps as such..Sp.Vb 1\& void pad_tidy(padtidy_type type).Ve.IP "pad_undef" 8.IX Xref "pad_undef".IX Item "pad_undef"Free the padlist associated with a \s-1CV\s0.If parts of it happen to be current, we null the relevantPL_*pad* global vars so that we don't have any dangling references left.We also repoint the CvOUTSIDE of any about-to-be-orphanedinner subs to the outer of this cv..Sp(This function should really be called pad_free, but the name was alreadytaken).Sp.Vb 1\& void pad_undef(CV* cv).Ve.SH "Per-Interpreter Variables".IX Header "Per-Interpreter Variables".IP "PL_DBsingle" 8.IX Xref "PL_DBsingle".IX Item "PL_DBsingle"When Perl is run in debugging mode, with the \fB\-d\fR switch, this \s-1SV\s0 is aboolean which indicates whether subs are being single-stepped.Single-stepping is automatically turned on after every step. This is the Cvariable which corresponds to Perl's \f(CW$DB::single\fR variable. See\&\f(CW\*(C`PL_DBsub\*(C'\fR..Sp.Vb 1\& SV * PL_DBsingle.Ve.IP "PL_DBsub" 8.IX Xref "PL_DBsub".IX Item "PL_DBsub"When Perl is run in debugging mode, with the \fB\-d\fR switch, this \s-1GV\s0 containsthe \s-1SV\s0 which holds the name of the sub being debugged. This is the Cvariable which corresponds to Perl's \f(CW$DB::sub\fR variable. See\&\f(CW\*(C`PL_DBsingle\*(C'\fR..Sp.Vb 1\& GV * PL_DBsub.Ve.IP "PL_DBtrace" 8.IX Xref "PL_DBtrace".IX Item "PL_DBtrace"Trace variable used when Perl is run in debugging mode, with the \fB\-d\fRswitch. This is the C variable which corresponds to Perl's \f(CW$DB::trace\fRvariable. See \f(CW\*(C`PL_DBsingle\*(C'\fR..Sp.Vb 1\& SV * PL_DBtrace.Ve.IP "PL_dowarn" 8.IX Xref "PL_dowarn".IX Item "PL_dowarn"The C variable which corresponds to Perl's $^W warning variable..Sp.Vb 1\& bool PL_dowarn.Ve.IP "PL_last_in_gv" 8.IX Xref "PL_last_in_gv".IX Item "PL_last_in_gv"The \s-1GV\s0 which was last used for a filehandle input operation. (\f(CW\*(C`<FH>\*(C'\fR).Sp.Vb 1\& GV* PL_last_in_gv.Ve.IP "PL_ofs_sv" 8.IX Xref "PL_ofs_sv".IX Item "PL_ofs_sv"The output field separator \- \f(CW$,\fR in Perl space..Sp.Vb 1\& SV* PL_ofs_sv.Ve.IP "PL_rs" 8.IX Xref "PL_rs".IX Item "PL_rs"The input record separator \- \f(CW$/\fR in Perl space..Sp.Vb 1\& SV* PL_rs.Ve.SH "Stack Manipulation Macros".IX Header "Stack Manipulation Macros".IP "djSP" 8.IX Xref "djSP".IX Item "djSP"Declare Just \f(CW\*(C`SP\*(C'\fR. This is actually identical to \f(CW\*(C`dSP\*(C'\fR, and declaresa local copy of perl's stack pointer, available via the \f(CW\*(C`SP\*(C'\fR macro.See \f(CW\*(C`SP\*(C'\fR. (Available for backward source code compatibility with theold (Perl 5.005) thread model.).Sp.Vb 1\& djSP;.Ve.IP "\s-1LVRET\s0" 8.IX Xref "LVRET".IX Item "LVRET"True if this op will be the return value of an lvalue subroutine.SH "SV Manipulation Functions".IX Header "SV Manipulation Functions".IP "sv_add_arena" 8.IX Xref "sv_add_arena".IX Item "sv_add_arena"Given a chunk of memory, link it to the head of the list of arenas,and split it into a list of free SVs..Sp.Vb 1\& void sv_add_arena(char* ptr, U32 size, U32 flags).Ve.IP "sv_clean_all" 8.IX Xref "sv_clean_all".IX Item "sv_clean_all"Decrement the refcnt of each remaining \s-1SV\s0, possibly triggering acleanup. This function may have to be called multiple times to freeSVs which are in complex self-referential hierarchies..Sp.Vb 1\& I32 sv_clean_all().Ve.IP "sv_clean_objs" 8.IX Xref "sv_clean_objs".IX Item "sv_clean_objs"Attempt to destroy all objects not yet freed.Sp.Vb 1\& void sv_clean_objs().Ve.IP "sv_free_arenas" 8.IX Xref "sv_free_arenas".IX Item "sv_free_arenas"Deallocate the memory used by all arenas. Note that all the individual \s-1SV\s0heads and bodies within the arenas must already have been freed..Sp.Vb 1\& void sv_free_arenas().Ve.SH "SV-Body Allocation".IX Header "SV-Body Allocation".IP "sv_2num" 8.IX Xref "sv_2num".IX Item "sv_2num"Return an \s-1SV\s0 with the numeric value of the source \s-1SV\s0, doing any necessaryreference or overload conversion. You must use the \f(CW\*(C`SvNUM(sv)\*(C'\fR macro toaccess this function..Sp.Vb 1\& SV* sv_2num(SV* sv).Ve.SH "Unicode Support".IX Header "Unicode Support".IP "find_uninit_var" 8.IX Xref "find_uninit_var".IX Item "find_uninit_var"Find the name of the undefined variable (if any) that caused the operator oto issue a \*(L"Use of uninitialized value\*(R" warning.If match is true, only return a name if it's value matches uninit_sv.So roughly speaking, if a unary operator (such as \s-1OP_COS\s0) generates awarning, then following the direct child of the op may yield an\&\s-1OP_PADSV\s0 or \s-1OP_GV\s0 that gives the name of the undefined variable. On theother hand, with \s-1OP_ADD\s0 there are two branches to follow, so we only printthe variable name if we get an exact match..SpThe name is returned as a mortal \s-1SV\s0..SpAssumes that PL_op is the op that originally triggered the error, and thatPL_comppad/PL_curpad points to the currently executing pad..Sp.Vb 1\& SV* find_uninit_var(OP* obase, SV* uninit_sv, bool top).Ve.IP "report_uninit" 8.IX Xref "report_uninit".IX Item "report_uninit"Print appropriate \*(L"Use of uninitialized variable\*(R" warning.Sp.Vb 1\& void report_uninit(SV* uninit_sv).Ve.SH "AUTHORS".IX Header "AUTHORS"The autodocumentation system was originally added to the Perl core byBenjamin Stuhl. Documentation is by whoever was kind enough todocument their functions..SH "SEE ALSO".IX Header "SEE ALSO"\&\fIperlguts\fR\|(1), \fIperlapi\fR\|(1)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -