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

📄 perlapi.pod

📁 视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.
💻 POD
📖 第 1 页 / 共 5 页
字号:
=for hackersFound in file handy.h=item savesharedpvX<savesharedpv>A version of C<savepv()> which allocates the duplicate string in memorywhich is shared between threads.	char*	savesharedpv(const char* pv)=for hackersFound in file util.c=item savesharedpvnX<savesharedpvn>A version of C<savepvn()> which allocates the duplicate string in memorywhich is shared between threads. (With the specific difference that a NULLpointer is not acceptable)	char*	savesharedpvn(const char *const pv, const STRLEN len)=for hackersFound in file util.c=item savesvpvX<savesvpv>A version of C<savepv()>/C<savepvn()> which gets the string to duplicate fromthe passed in SV using C<SvPV()>	char*	savesvpv(SV* sv)=for hackersFound in file util.c=item StructCopyX<StructCopy>This is an architecture-independent macro to copy one structure to another.	void	StructCopy(type src, type dest, type)=for hackersFound in file handy.h=item ZeroX<Zero>The XSUB-writer's interface to the C C<memzero> function.  The C<dest> is thedestination, C<nitems> is the number of items, and C<type> is the type.	void	Zero(void* dest, int nitems, type)=for hackersFound in file handy.h=item ZeroDX<ZeroD>Like C<Zero> but returns dest. Useful for encouraging compilers to tail-calloptimise.	void *	ZeroD(void* dest, int nitems, type)=for hackersFound in file handy.h=back=head1 Miscellaneous Functions=over 8=item fbm_compileX<fbm_compile>Analyses the string in order to make fast searches on it using fbm_instr()-- the Boyer-Moore algorithm.	void	fbm_compile(SV* sv, U32 flags)=for hackersFound in file util.c=item fbm_instrX<fbm_instr>Returns the location of the SV in the string delimited by C<str> andC<strend>.  It returns C<NULL> if the string can't be found.  The C<sv>does not have to be fbm_compiled, but the search will not be as fastthen.	char*	fbm_instr(unsigned char* big, unsigned char* bigend, SV* littlesv, U32 flags)=for hackersFound in file util.c=item formX<form>Takes a sprintf-style format pattern and conventional(non-SV) arguments and returns the formatted string.    (char *) Perl_form(pTHX_ const char* pat, ...)can be used any place a string (char *) is required:    char * s = Perl_form("%d.%d",major,minor);Uses a single private buffer so if you want to format several strings youmust explicitly copy the earlier strings away (and free the copies when youare done).	char*	form(const char* pat, ...)=for hackersFound in file util.c=item getcwd_svX<getcwd_sv>Fill the sv with current working directory	int	getcwd_sv(SV* sv)=for hackersFound in file util.c=item my_snprintfX<my_snprintf>The C library C<snprintf> functionality, if available andstandards-compliant (uses C<vsnprintf>, actually).  However, if theC<vsnprintf> is not available, will unfortunately use the unsafeC<vsprintf> which can overrun the buffer (there is an overrun check,but that may be too late).  Consider using C<sv_vcatpvf> instead, orgetting C<vsnprintf>.	int	my_snprintf(char *buffer, const Size_t len, const char *format, ...)=for hackersFound in file util.c=item my_sprintfX<my_sprintf>The C library C<sprintf>, wrapped if necessary, to ensure that it will returnthe length of the string written to the buffer. Only rare pre-ANSI systemsneed the wrapper function - usually this is a direct call to C<sprintf>.	int	my_sprintf(char *buffer, const char *pat, ...)=for hackersFound in file util.c=item my_vsnprintfX<my_vsnprintf>The C library C<vsnprintf> if available and standards-compliant.However, if if the C<vsnprintf> is not available, will unfortunatelyuse the unsafe C<vsprintf> which can overrun the buffer (there is anoverrun check, but that may be too late).  Consider usingC<sv_vcatpvf> instead, or getting C<vsnprintf>.	int	my_vsnprintf(char *buffer, const Size_t len, const char *format, va_list ap)=for hackersFound in file util.c=item new_versionX<new_version>Returns a new version object based on the passed in SV:    SV *sv = new_version(SV *ver);Does not alter the passed in ver SV.  See "upg_version" if youwant to upgrade the SV.	SV*	new_version(SV *ver)=for hackersFound in file util.c=item scan_versionX<scan_version>Returns a pointer to the next character after the parsedversion string, as well as upgrading the passed in SV toan RV.Function must be called with an already existing SV like    sv = newSV(0);    s = scan_version(s, SV *sv, bool qv);Performs some preprocessing to the string to ensure thatit has the correct characteristics of a version.  Flags theobject if it contains an underscore (which denotes thisis an alpha version).  The boolean qv denotes that the versionshould be interpreted as if it had multiple decimals, even ifit doesn't.	const char*	scan_version(const char *vstr, SV *sv, bool qv)=for hackersFound in file util.c=item strEQX<strEQ>Test two strings to see if they are equal.  Returns true or false.	bool	strEQ(char* s1, char* s2)=for hackersFound in file handy.h=item strGEX<strGE>Test two strings to see if the first, C<s1>, is greater than or equal tothe second, C<s2>.  Returns true or false.	bool	strGE(char* s1, char* s2)=for hackersFound in file handy.h=item strGTX<strGT>Test two strings to see if the first, C<s1>, is greater than the second,C<s2>.  Returns true or false.	bool	strGT(char* s1, char* s2)=for hackersFound in file handy.h=item strLEX<strLE>Test two strings to see if the first, C<s1>, is less than or equal to thesecond, C<s2>.  Returns true or false.	bool	strLE(char* s1, char* s2)=for hackersFound in file handy.h=item strLTX<strLT>Test two strings to see if the first, C<s1>, is less than the second,C<s2>.  Returns true or false.	bool	strLT(char* s1, char* s2)=for hackersFound in file handy.h=item strNEX<strNE>Test two strings to see if they are different.  Returns true orfalse.	bool	strNE(char* s1, char* s2)=for hackersFound in file handy.h=item strnEQX<strnEQ>Test two strings to see if they are equal.  The C<len> parameter indicatesthe number of bytes to compare.  Returns true or false. (A wrapper forC<strncmp>).	bool	strnEQ(char* s1, char* s2, STRLEN len)=for hackersFound in file handy.h=item strnNEX<strnNE>Test two strings to see if they are different.  The C<len> parameterindicates the number of bytes to compare.  Returns true or false. (Awrapper for C<strncmp>).	bool	strnNE(char* s1, char* s2, STRLEN len)=for hackersFound in file handy.h=item sv_destroyableX<sv_destroyable>Dummy routine which reports that object can be destroyed when there is nosharing module present.  It ignores its single SV argument, and returns'true'.  Exists to avoid test for a NULL function pointer and because itcould potentially warn under some level of strict-ness.	bool	sv_destroyable(SV *sv)=for hackersFound in file util.c=item sv_nosharingX<sv_nosharing>Dummy routine which "shares" an SV when there is no sharing module present.Or "locks" it. Or "unlocks" it. In other words, ignores its single SV argument.Exists to avoid test for a NULL function pointer and because it couldpotentially warn under some level of strict-ness.	void	sv_nosharing(SV *sv)=for hackersFound in file util.c=item upg_versionX<upg_version>In-place upgrade of the supplied SV to a version object.    SV *sv = upg_version(SV *sv, bool qv);Returns a pointer to the upgraded SV.  Set the boolean qv if you wantto force this SV to be interpreted as an "extended" version.	SV*	upg_version(SV *ver, bool qv)=for hackersFound in file util.c=item vcmpX<vcmp>Version object aware cmp.  Both operands must already have been converted into version objects.	int	vcmp(SV *lvs, SV *rvs)=for hackersFound in file util.c=item vnormalX<vnormal>Accepts a version object and returns the normalized stringrepresentation.  Call like:    sv = vnormal(rv);NOTE: you can pass either the object directly or the SVcontained within the RV.	SV*	vnormal(SV *vs)=for hackersFound in file util.c=item vnumifyX<vnumify>Accepts a version object and returns the normalized floatingpoint representation.  Call like:    sv = vnumify(rv);NOTE: you can pass either the object directly or the SVcontained within the RV.	SV*	vnumify(SV *vs)=for hackersFound in file util.c=item vstringifyX<vstringify>In order to maintain maximum compatibility with earlier versionsof Perl, this function will return either the floating pointnotation or the multiple dotted notation, depending on whetherthe original version contained 1 or more dots, respectively	SV*	vstringify(SV *vs)=for hackersFound in file util.c=item vverifyX<vverify>Validates that the SV contains a valid version object.    bool vverify(SV *vobj);Note that it only confirms the bare minimum structure (so as not to getconfused by derived classes which may contain additional hash entries):	bool	vverify(SV *vs)=for hackersFound in file util.c=back=head1 MRO Functions=over 8=item mro_get_linear_isaX<mro_get_linear_isa>Returns either C<mro_get_linear_isa_c3> orC<mro_get_linear_isa_dfs> for the given stash,dependant upon which MRO is in effectfor that stash.  The return value is aread-only AV*.You are responsible for C<SvREFCNT_inc()> on thereturn value if you plan to store it anywheresemi-permanently (otherwise it might be deletedout from under you the next time the cache isinvalidated).	AV*	mro_get_linear_isa(HV* stash)=for hackersFound in file mro.c=item mro_method_changed_inX<mro_method_changed_in>Invalidates method caching on any child classesof the given stash, so that they might noticethe changes in this one.Ideally, all instances of C<PL_sub_generation++> inperl source outside of C<mro.c> should bereplaced by calls to this.Perl automatically handles most of the commonways a method might be redefined.  However, thereare a few ways you could change a method in a stashwithout the cache code noticing, in which case youneed to call this method afterwards:1) Directly manipulating the stash HV entries fromXS code.2) Assigning a reference to a readonly scalarconstant into a stash entry in order to createa constant subroutine (like constant.pmdoes).This same method is available from pure perlvia, C<mro::method_changed_in(classname)>.	void	mro_method_changed_in(HV* stash)=for hackersFound in file mro.c=back=head1 Multicall Functions=over 8=item dMULTICALLX<dMULTICALL>Declare local variables for a multicall. See L<perlcall/Lightweight Callbacks>.		dMULTICALL;=for hackersFound in file cop.h=item MULTICALLX<MULTICALL>Make a lightweight callback. See L<perlcall/Lightweight Callbacks>.		MULTICALL;=for hackersFound in file cop.h=item POP_MULTICALLX<POP_MULTICALL>Closing bracket for a lightweight callback.See L<perlcall/Lightweight Callbacks>.		POP_MULTICALL;=for hackersFound in file cop.h=item PUSH_MULTICALLX<PUSH_MULTICALL>Opening bracket for a lightweight callback.See L<perlcall/Lightweight Callbacks>.		PUSH_MULTICALL;=for hackersFound in file cop.h=back=head1 Numeric functions=over 8=item grok_binX<grok_bin>converts a string representing a binary number to numeric form.On entry I<start> and I<*len> give the string to scan, I<*flags> givesconversion flags, and I<result> should be NULL or a pointer to an NV.The scan stops at the end of the string, or the first invalid character.Unless C<PERL_SCAN_SILENT_ILLDIGIT> is set in I<*flags>, encountering aninvalid character will also trigger a warning.On return I<*len> is set to the length of the scanned string,and I<*flags> gives output flags.If the value is <= C<UV_MAX> it is returned as a UV, the output flags are clear,and nothing is written to I<*result>. If the value is > UV_MAX C<grok_bin>returns UV_MAX, sets C<PERL_SCAN_GREATER_THAN_UV_MAX> in the output flags,and writes the value to I<*result> (or the value is discarded if I<result>is NULL).The binary number may optionally be prefixed with "0b" or "b" unlessC<PERL_SCAN_DISALLOW_PREFIX> is set in I<*flags> on entry. IfC<PERL_SCAN_ALLOW_UNDERSCORES> is set in I<*flags> then the binarynumber may use '_' characters to separate digits.	UV	grok_bin(const char* start, STRLEN* len_p, I32* flags, NV *result)=for hackersFound in file numeric.c=item grok_hexX<grok_hex>converts a string representing a hex number to numeric form.On entry I<start> and I<*len> give the string to scan, I<*flags> givesconversion flags, and I<result> should be NULL or a pointer to an NV.The scan stops at the end of the string, or the first invalid character.Unless C<PERL_SCAN_SILENT_ILLDIGIT> is set in I<*flags>, encountering aninvalid character will also trigger a warning.On return I<*len> is set to the length of the scanned string,and I<*flags> gives output flags.If the value is <= UV_MAX it is returned as a UV, the output flags are clear,and nothing is written to I<*result>. If the value is > UV_MAX C<grok_hex>returns UV_MAX, sets C<PERL_SCAN_GREATER_THAN_UV_MAX> in the output flags,and writes the value to I<*result> (or the value is discarded if 

⌨️ 快捷键说明

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