⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 perlintern.pod

📁 视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.
💻 POD
📖 第 1 页 / 共 2 页
字号:
Iterating over the names AV iterates over all possible paditems. Pad slots that are SVs_PADTMP (targets/GVs/constants) end up having&PL_sv_undef "names" (see pad_alloc()).Only my/our variable (SVs_PADMY/SVs_PADOUR) slots get valid names.The rest are op targets/GVs/constants which are statically allocatedor resolved at compile time.  These don't have names by which theycan be looked up from Perl code at run time through eval"" likemy/our variables can be.  Since they can't be looked up by "name"but only by their index allocated at compile time (which is usuallyin PL_op->op_targ), wasting a name SV for them doesn't make sense.The SVs in the names AV have their PV being the name of the variable.xlow+1..xhigh inclusive in the NV union is a range of cop_seq numbers forwhich the name is valid.  For typed lexicals name SV is SVt_PVMG and SvSTASHpoints at the type.  For C<our> lexicals, the type is also SVt_PVMG, with theSvOURSTASH slot pointing at the stash of the associated global (so thatduplicate C<our> declarations in the same package can be detected).  SvUVX issometimes hijacked to store the generation number during compilation.If SvFAKE is set on the name SV, then that slot in the frame AV isa REFCNT'ed reference to a lexical from "outside". In this case,the name SV does not use xlow and xhigh to store a cop_seq range, since it isin scope throughout. Instead xhigh stores some flags containing info aboutthe real lexical (is it declared in an anon, and is it capable of beinginstantiated multiple times?), and for fake ANONs, xlow contains the indexwithin the parent's pad where the lexical's value is stored, to makecloning quicker.If the 'name' is '&' the corresponding entry in frame AVis a CV representing a possible closure.(SvFAKE and name of '&' is not a meaningful combination currently but couldbecome so if C<my sub foo {}> is implemented.)Note that formats are treated as anon subs, and are cloned each timewrite is called (if necessary).The flag SVf_PADSTALE is cleared on lexicals each time the my() is executed,and set on scope exit. This allows the 'Variable $x is not available' warningto be generated in evals, such as     { my $x = 1; sub f { eval '$x'} } f();	AV *	CvPADLIST(CV *cv)=for hackersFound in file pad.c=item cv_cloneX<cv_clone>Clone a CV: make a new CV which points to the same code etc, but whichhas a newly-created pad built by copying the prototype pad and capturingany outer lexicals.	CV*	cv_clone(CV* proto)=for hackersFound in file pad.c=item cv_dumpX<cv_dump>dump the contents of a CV	void	cv_dump(const CV *cv, const char *title)=for hackersFound in file pad.c=item do_dump_padX<do_dump_pad>Dump the contents of a padlist	void	do_dump_pad(I32 level, PerlIO *file, PADLIST *padlist, int full)=for hackersFound in file pad.c=item intro_myX<intro_my>"Introduce" my variables to visible status.	U32	intro_my()=for hackersFound in file pad.c=item pad_add_anonX<pad_add_anon>Add an anon code entry to the current compiling pad	PADOFFSET	pad_add_anon(SV* sv, OPCODE op_type)=for hackersFound in file pad.c=item pad_add_nameX<pad_add_name>Create a new name and associated PADMY SV in the current pad; return theoffset.If C<typestash> is valid, the name is for a typed lexical; set thename's stash to that value.If C<ourstash> is valid, it's an our lexical, set the name'sSvOURSTASH to that valueIf fake, it means we're cloning an existing entry	PADOFFSET	pad_add_name(const char *name, HV* typestash, HV* ourstash, bool clone, bool state)=for hackersFound in file pad.c=item pad_allocX<pad_alloc>Allocate a new my or tmp pad entry. For a my, simply push a null SV 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.	PADOFFSET	pad_alloc(I32 optype, U32 tmptype)=for hackersFound in file pad.c=item pad_block_startX<pad_block_start>Update the pad compilation state variables on entry to a new block	void	pad_block_start(int full)=for hackersFound in file pad.c=item pad_check_dupX<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 C<ourstash>C<is_our> indicates that the name to check is an 'our' declaration	void	pad_check_dup(const char* name, bool is_our, const HV* ourstash)=for hackersFound in file pad.c=item pad_findlexX<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.Returns the offset in the bottom pad of the lex or the fake lex.cv is the CV 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 IVX field of a fake namesv.Note that pad_findlex() 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.	PADOFFSET	pad_findlex(const char *name, const CV* cv, U32 seq, int warn, SV** out_capture, SV** out_name_sv, int *out_flags)=for hackersFound in file pad.c=item pad_findmyX<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 NOT_IN_PAD on failure.	PADOFFSET	pad_findmy(const char* name)=for hackersFound in file pad.c=item pad_fixup_inner_anonsX<pad_fixup_inner_anons>For any anon CVs in the pad, change CvOUTSIDE of that CV fromold_cv to new_cv if necessary. Needed when a newly-compiled CV has to bemoved to a pre-existing CV struct.	void	pad_fixup_inner_anons(PADLIST *padlist, CV *old_cv, CV *new_cv)=for hackersFound in file pad.c=item pad_freeX<pad_free>Free the SV at offset po in the current pad.	void	pad_free(PADOFFSET po)=for hackersFound in file pad.c=item pad_leavemyX<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.	void	pad_leavemy()=for hackersFound in file pad.c=item pad_newX<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 OR'ed together:    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)=for hackersFound in file pad.c=item pad_pushX<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 @_ in slot zero.	void	pad_push(PADLIST *padlist, int depth)=for hackersFound in file pad.c=item pad_resetX<pad_reset>Mark all the current temporaries for reuse	void	pad_reset()=for hackersFound in file pad.c=item pad_setsvX<pad_setsv>Set the entry at offset po in the current pad to sv.Use the macro PAD_SETSV() rather than calling this function directly.	void	pad_setsv(PADOFFSET po, SV* sv)=for hackersFound in file pad.c=item pad_swipeX<pad_swipe>Abandon the tmp in the current pad at offset po and replace with anew one.	void	pad_swipe(PADOFFSET po, bool refadjust)=for hackersFound in file pad.c=item pad_tidyX<pad_tidy>Tidy up a pad after we've finished compiling it:    * remove most stuff from the pads of anonsub prototypes;    * give it a @_;    * mark tmps as such.	void	pad_tidy(padtidy_type type)=for hackersFound in file pad.c=item pad_undefX<pad_undef>Free the padlist associated with a CV.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.(This function should really be called pad_free, but the name was alreadytaken)	void	pad_undef(CV* cv)=for hackersFound in file pad.c=back=head1 Per-Interpreter Variables=over 8=item PL_DBsingleX<PL_DBsingle>When Perl is run in debugging mode, with the B<-d> switch, this SV 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 $DB::single variable.  SeeC<PL_DBsub>.	SV *	PL_DBsingle=for hackersFound in file intrpvar.h=item PL_DBsubX<PL_DBsub>When Perl is run in debugging mode, with the B<-d> switch, this GV containsthe SV which holds the name of the sub being debugged.  This is the Cvariable which corresponds to Perl's $DB::sub variable.  SeeC<PL_DBsingle>.	GV *	PL_DBsub=for hackersFound in file intrpvar.h=item PL_DBtraceX<PL_DBtrace>Trace variable used when Perl is run in debugging mode, with the B<-d>switch.  This is the C variable which corresponds to Perl's $DB::tracevariable.  See C<PL_DBsingle>.	SV *	PL_DBtrace=for hackersFound in file intrpvar.h=item PL_dowarnX<PL_dowarn>The C variable which corresponds to Perl's $^W warning variable.	bool	PL_dowarn=for hackersFound in file intrpvar.h=item PL_last_in_gvX<PL_last_in_gv>The GV which was last used for a filehandle input operation. (C<< <FH> >>)	GV*	PL_last_in_gv=for hackersFound in file intrpvar.h=item PL_ofs_svX<PL_ofs_sv>The output field separator - C<$,> in Perl space.	SV*	PL_ofs_sv=for hackersFound in file intrpvar.h=item PL_rsX<PL_rs>The input record separator - C<$/> in Perl space.	SV*	PL_rs=for hackersFound in file intrpvar.h=back=head1 Stack Manipulation Macros=over 8=item djSPX<djSP>Declare Just C<SP>. This is actually identical to C<dSP>, and declaresa local copy of perl's stack pointer, available via the C<SP> macro.See C<SP>.  (Available for backward source code compatibility with theold (Perl 5.005) thread model.)		djSP;=for hackersFound in file pp.h=item LVRETX<LVRET>True if this op will be the return value of an lvalue subroutine=for hackersFound in file pp.h=back=head1 SV Manipulation Functions=over 8=item sv_add_arenaX<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.	void	sv_add_arena(char* ptr, U32 size, U32 flags)=for hackersFound in file sv.c=item sv_clean_allX<sv_clean_all>Decrement the refcnt of each remaining SV, possibly triggering acleanup. This function may have to be called multiple times to freeSVs which are in complex self-referential hierarchies.	I32	sv_clean_all()=for hackersFound in file sv.c=item sv_clean_objsX<sv_clean_objs>Attempt to destroy all objects not yet freed	void	sv_clean_objs()=for hackersFound in file sv.c=item sv_free_arenasX<sv_free_arenas>Deallocate the memory used by all arenas. Note that all the individual SVheads and bodies within the arenas must already have been freed.	void	sv_free_arenas()=for hackersFound in file sv.c=back=head1 SV-Body Allocation=over 8=item sv_2numX<sv_2num>Return an SV with the numeric value of the source SV, doing any necessaryreference or overload conversion.  You must use the C<SvNUM(sv)> macro toaccess this function.	SV*	sv_2num(SV* sv)=for hackersFound in file sv.c=back=head1 Unicode Support=over 8=item find_uninit_varX<find_uninit_var>Find the name of the undefined variable (if any) that caused the operator oto issue a "Use of uninitialized value" 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 OP_COS) generates awarning, then following the direct child of the op may yield anOP_PADSV or OP_GV that gives the name of the undefined variable. On theother hand, with OP_ADD there are two branches to follow, so we only printthe variable name if we get an exact match.The name is returned as a mortal SV.Assumes that PL_op is the op that originally triggered the error, and thatPL_comppad/PL_curpad points to the currently executing pad.	SV*	find_uninit_var(OP* obase, SV* uninit_sv, bool top)=for hackersFound in file sv.c=item report_uninitX<report_uninit>Print appropriate "Use of uninitialized variable" warning	void	report_uninit(SV* uninit_sv)=for hackersFound in file sv.c=back=head1 AUTHORSThe autodocumentation system was originally added to the Perl core byBenjamin Stuhl. Documentation is by whoever was kind enough todocument their functions.=head1 SEE ALSOperlguts(1), perlapi(1)=cut ex: set ro:

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -