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

📄 perlapi.pod

📁 MSYS在windows下模拟了一个类unix的终端
💻 POD
📖 第 1 页 / 共 5 页
字号:
Found in file cop.h=item HEf_SVKEYThis flag, used in the length slot of hash entries and magic structures,specifies the structure contains a C<SV*> pointer where a C<char*> pointeris to be expected. (For information only--not to be used).=for hackersFound in file hv.h=item HeHASHReturns the computed hash stored in the hash entry.	U32	HeHASH(HE* he)=for hackersFound in file hv.h=item HeKEYReturns the actual pointer stored in the key slot of the hash entry. Thepointer may be either C<char*> or C<SV*>, depending on the value ofC<HeKLEN()>.  Can be assigned to.  The C<HePV()> or C<HeSVKEY()> macros areusually preferable for finding the value of a key.	void*	HeKEY(HE* he)=for hackersFound in file hv.h=item HeKLENIf this is negative, and amounts to C<HEf_SVKEY>, it indicates the entryholds an C<SV*> key.  Otherwise, holds the actual length of the key.  Canbe assigned to. The C<HePV()> macro is usually preferable for finding keylengths.	STRLEN	HeKLEN(HE* he)=for hackersFound in file hv.h=item HePVReturns the key slot of the hash entry as a C<char*> value, doing anynecessary dereferencing of possibly C<SV*> keys.  The length of the stringis placed in C<len> (this is a macro, so do I<not> use C<&len>).  If you donot care about what the length of the key is, you may use the globalvariable C<PL_na>, though this is rather less efficient than using a localvariable.  Remember though, that hash keys in perl are free to containembedded nulls, so using C<strlen()> or similar is not a good way to findthe length of hash keys. This is very similar to the C<SvPV()> macrodescribed elsewhere in this document.	char*	HePV(HE* he, STRLEN len)=for hackersFound in file hv.h=item HeSVKEYReturns the key as an C<SV*>, or C<Nullsv> if the hash entry does notcontain an C<SV*> key.	SV*	HeSVKEY(HE* he)=for hackersFound in file hv.h=item HeSVKEY_forceReturns the key as an C<SV*>.  Will create and return a temporary mortalC<SV*> if the hash entry contains only a C<char*> key.	SV*	HeSVKEY_force(HE* he)=for hackersFound in file hv.h=item HeSVKEY_setSets the key to a given C<SV*>, taking care to set the appropriate flags toindicate the presence of an C<SV*> key, and returns the sameC<SV*>.	SV*	HeSVKEY_set(HE* he, SV* sv)=for hackersFound in file hv.h=item HeVALReturns the value slot (type C<SV*>) stored in the hash entry.	SV*	HeVAL(HE* he)=for hackersFound in file hv.h=item HvNAMEReturns the package name of a stash.  See C<SvSTASH>, C<CvSTASH>.	char*	HvNAME(HV* stash)=for hackersFound in file hv.h=item hv_clearClears a hash, making it empty.	void	hv_clear(HV* tb)=for hackersFound in file hv.c=item hv_deleteDeletes a key/value pair in the hash.  The value SV is removed from thehash and returned to the caller.  The C<klen> is the length of the key. The C<flags> value will normally be zero; if set to G_DISCARD then NULLwill be returned.	SV*	hv_delete(HV* tb, const char* key, U32 klen, I32 flags)=for hackersFound in file hv.c=item hv_delete_entDeletes a key/value pair in the hash.  The value SV is removed from thehash and returned to the caller.  The C<flags> value will normally be zero;if set to G_DISCARD then NULL will be returned.  C<hash> can be a validprecomputed hash value, or 0 to ask for it to be computed.	SV*	hv_delete_ent(HV* tb, SV* key, I32 flags, U32 hash)=for hackersFound in file hv.c=item hv_existsReturns a boolean indicating whether the specified hash key exists.  TheC<klen> is the length of the key.	bool	hv_exists(HV* tb, const char* key, U32 klen)=for hackersFound in file hv.c=item hv_exists_entReturns a boolean indicating whether the specified hash key exists. C<hash>can be a valid precomputed hash value, or 0 to ask for it to becomputed.	bool	hv_exists_ent(HV* tb, SV* key, U32 hash)=for hackersFound in file hv.c=item hv_fetchReturns the SV which corresponds to the specified key in the hash.  TheC<klen> is the length of the key.  If C<lval> is set then the fetch will bepart of a store.  Check that the return value is non-null beforedereferencing it to a C<SV*>. See L<perlguts/"Understanding the Magic of Tied Hashes and Arrays"> for moreinformation on how to use this function on tied hashes.	SV**	hv_fetch(HV* tb, const char* key, U32 klen, I32 lval)=for hackersFound in file hv.c=item hv_fetch_entReturns the hash entry which corresponds to the specified key in the hash.C<hash> must be a valid precomputed hash number for the given C<key>, or 0if you want the function to compute it.  IF C<lval> is set then the fetchwill be part of a store.  Make sure the return value is non-null beforeaccessing it.  The return value when C<tb> is a tied hash is a pointer to astatic location, so be sure to make a copy of the structure if you need tostore it somewhere. See L<perlguts/"Understanding the Magic of Tied Hashes and Arrays"> for moreinformation on how to use this function on tied hashes.	HE*	hv_fetch_ent(HV* tb, SV* key, I32 lval, U32 hash)=for hackersFound in file hv.c=item hv_iterinitPrepares a starting point to traverse a hash table.  Returns the number ofkeys in the hash (i.e. the same as C<HvKEYS(tb)>).  The return value iscurrently only meaningful for hashes without tie magic. NOTE: Before version 5.004_65, C<hv_iterinit> used to return the number ofhash buckets that happen to be in use.  If you still need that esotericvalue, you can get it through the macro C<HvFILL(tb)>.	I32	hv_iterinit(HV* tb)=for hackersFound in file hv.c=item hv_iterkeyReturns the key from the current position of the hash iterator.  SeeC<hv_iterinit>.	char*	hv_iterkey(HE* entry, I32* retlen)=for hackersFound in file hv.c=item hv_iterkeysvReturns the key as an C<SV*> from the current position of the hashiterator.  The return value will always be a mortal copy of the key.  Alsosee C<hv_iterinit>.	SV*	hv_iterkeysv(HE* entry)=for hackersFound in file hv.c=item hv_iternextReturns entries from a hash iterator.  See C<hv_iterinit>.	HE*	hv_iternext(HV* tb)=for hackersFound in file hv.c=item hv_iternextsvPerforms an C<hv_iternext>, C<hv_iterkey>, and C<hv_iterval> in oneoperation.	SV*	hv_iternextsv(HV* hv, char** key, I32* retlen)=for hackersFound in file hv.c=item hv_itervalReturns the value from the current position of the hash iterator.  SeeC<hv_iterkey>.	SV*	hv_iterval(HV* tb, HE* entry)=for hackersFound in file hv.c=item hv_magicAdds magic to a hash.  See C<sv_magic>.	void	hv_magic(HV* hv, GV* gv, int how)=for hackersFound in file hv.c=item hv_storeStores an SV in a hash.  The hash key is specified as C<key> and C<klen> isthe length of the key.  The C<hash> parameter is the precomputed hashvalue; if it is zero then Perl will compute it.  The return value will beNULL if the operation failed or if the value did not need to be actuallystored within the hash (as in the case of tied hashes).  Otherwise it canbe dereferenced to get the original C<SV*>.  Note that the caller isresponsible for suitably incrementing the reference count of C<val> beforethe call, and decrementing it if the function returned NULL.  See L<perlguts/"Understanding the Magic of Tied Hashes and Arrays"> for moreinformation on how to use this function on tied hashes.	SV**	hv_store(HV* tb, const char* key, U32 klen, SV* val, U32 hash)=for hackersFound in file hv.c=item hv_store_entStores C<val> in a hash.  The hash key is specified as C<key>.  The C<hash>parameter is the precomputed hash value; if it is zero then Perl willcompute it.  The return value is the new hash entry so created.  It will beNULL if the operation failed or if the value did not need to be actuallystored within the hash (as in the case of tied hashes).  Otherwise thecontents of the return value can be accessed using the C<He???> macrosdescribed here.  Note that the caller is responsible for suitablyincrementing the reference count of C<val> before the call, anddecrementing it if the function returned NULL. See L<perlguts/"Understanding the Magic of Tied Hashes and Arrays"> for moreinformation on how to use this function on tied hashes.	HE*	hv_store_ent(HV* tb, SV* key, SV* val, U32 hash)=for hackersFound in file hv.c=item hv_undefUndefines the hash.	void	hv_undef(HV* tb)=for hackersFound in file hv.c=item isALNUMReturns a boolean indicating whether the C C<char> is an ASCII alphanumericcharacter (including underscore) or digit.	bool	isALNUM(char ch)=for hackersFound in file handy.h=item isALPHAReturns a boolean indicating whether the C C<char> is an ASCII alphabeticcharacter.	bool	isALPHA(char ch)=for hackersFound in file handy.h=item isDIGITReturns a boolean indicating whether the C C<char> is an ASCIIdigit.	bool	isDIGIT(char ch)=for hackersFound in file handy.h=item isLOWERReturns a boolean indicating whether the C C<char> is a lowercasecharacter.	bool	isLOWER(char ch)=for hackersFound in file handy.h=item isSPACEReturns a boolean indicating whether the C C<char> is whitespace.	bool	isSPACE(char ch)=for hackersFound in file handy.h=item isUPPERReturns a boolean indicating whether the C C<char> is an uppercasecharacter.	bool	isUPPER(char ch)=for hackersFound in file handy.h=item is_utf8_charTests if some arbitrary number of bytes begins in a valid UTF-8 character.The actual number of bytes in the UTF-8 character will be returned if itis valid, otherwise 0.  	STRLEN	is_utf8_char(U8 *p)=for hackersFound in file utf8.c=item is_utf8_stringReturns true if first C<len> bytes of the given string form valid a UTF8string, false otherwise.	bool	is_utf8_string(U8 *s, STRLEN len)=for hackersFound in file utf8.c=item itemsVariable which is setup by C<xsubpp> to indicate the number of items on the stack.  See L<perlxs/"Variable-length Parameter Lists">.	I32	items=for hackersFound in file XSUB.h=item ixVariable which is setup by C<xsubpp> to indicate which of an XSUB's aliases was used to invoke it.  See L<perlxs/"The ALIAS: Keyword">.	I32	ix=for hackersFound in file XSUB.h=item LEAVEClosing bracket on a callback.  See C<ENTER> and L<perlcall>.		LEAVE;=for hackersFound in file scope.h=item looks_like_numberTest if an the content of an SV looks like a number (or is anumber).	I32	looks_like_number(SV* sv)=for hackersFound in file sv.c=item MARKStack marker variable for the XSUB.  See C<dMARK>.=for hackersFound in file pp.h=item mg_clearClear something magical that the SV represents.  See C<sv_magic>.	int	mg_clear(SV* sv)=for hackersFound in file mg.c=item mg_copyCopies the magic from one SV to another.  See C<sv_magic>.	int	mg_copy(SV* sv, SV* nsv, const char* key, I32 klen)=for hackersFound in file mg.c=item mg_findFinds the magic pointer for type matching the SV.  See C<sv_magic>.	MAGIC*	mg_find(SV* sv, int type)=for hackersFound in file mg.c=item mg_freeFree any magic storage used by the SV.  See C<sv_magic>.	int	mg_free(SV* sv)=for hackersFound in file mg.c=item mg_getDo magic after a value is retrieved from the SV.  See C<sv_magic>.	int	mg_get(SV* sv)=for hackersFound in file mg.c=item mg_lengthReport on the SV's length.  See C<sv_magic>.	U32	mg_length(SV* sv)=for hackersFound in file mg.c=item mg_magicalTurns on the magical status of an SV.  See C<sv_magic>.	void	mg_magical(SV* sv)=for hackersFound in file mg.c=item mg_setDo magic after a value is assigned to the SV.  See C<sv_magic>.	int	mg_set(SV* sv)=for hackersFound in file mg.c=item MoveThe XSUB-writer's interface to the C C<memmove> function.  The C<src> is thesource, C<dest> is the destination, C<nitems> is the number of items, and C<type> isthe type.  Can do overlapping moves.  See also C<Copy>.	void	Move(void* src, void* dest, int nitems, type)=for hackersFound in file handy.h=item NewThe XSUB-writer's interface to the C C<malloc> function.	void	New(int id, void* ptr, int nitems, type)=for hackersFound in file handy.h=item newAVCreates a new AV.  The reference count is set to 1.	AV*	newAV()=for hackersFound in file av.c=item NewcThe XSUB-writer's interface to the C C<malloc> function, withcast.	void	Newc(int id, void* ptr, int nitems, type, cast)=for hackersFound in file handy.h=item newCONSTSUBCreates a constant sub equivalent to Perl C<sub FOO () { 123 }> which iseligible for inlining at compile-time.	void	newCONSTSUB(HV* stash, char* name, SV* sv)=for hackersFound in file op.c=item newHVCreates a new HV.  The reference count is set to 1.	HV*	newHV()=for hackersFound in file hv.c=item newRV_incCreates an RV wrapper for an SV.  The reference count for the original SV isincremented.	SV*	newRV_inc(SV* sv)=for hackersFound in file sv.h=item newRV_noincCreates an RV wrapper for an SV.  The reference count for the originalSV is B<not> incremented.	SV*	newRV_noinc(SV *sv)=for hackersFound in file sv.c=item NEWSVCreates a new SV.  A non-zero C<len> parameter indicates the number ofbytes of preallocated string space the SV should have.  An extra byte for atailing NUL is also reserved.  (SvPOK is not set for the SV even if stringspace is allocated.)  The reference count for the new SV is set to 1.C<id> is an integer id between 0 and 1299 (used to identify leaks).	SV*	NEWSV(int id, STRLEN len)=for hackersFound in file handy.h=item newSVivCreates a new SV and copies an integer into it.  The reference count for theSV is set to 1.	SV*	newSViv(IV i)=for hackersFound in file sv.c=item newSVnvCreates a new SV and copies a floating point value into it.The reference count for the SV is set to 1.	SV*	newSVnv(NV n)=for hackersFound in file sv.c=item newSVpvCreates a new SV and copies a string into it.  The reference count for theSV is set to 1.  If C<len> is zero, Perl will compute the length usingstrlen().  For efficiency, consider using C<newSVpvn> instead.	SV*	newSVpv(const char* s, STRLEN len)=for hackersFound in file sv.c=item newSVpvfCreates a new SV an initialize it with the string formatted likeC<sprintf>.

⌨️ 快捷键说明

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