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

📄 perlapi.1

📁 视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.
💻 1
📖 第 1 页 / 共 5 页
字号:
Same as \fIgv_fetchmeth()\fR, but looks for autoloaded subroutines too.Returns a glob for the subroutine..SpFor an autoloaded subroutine without a \s-1GV\s0, will create a \s-1GV\s0 evenif \f(CW\*(C`level < 0\*(C'\fR.  For an autoloaded subroutine without a stub, \fIGvCV()\fRof the result may be zero..Sp.Vb 1\&        GV*     gv_fetchmeth_autoload(HV* stash, const char* name, STRLEN len, I32 level).Ve.IP "gv_stashpv" 8.IX Xref "gv_stashpv".IX Item "gv_stashpv"Returns a pointer to the stash for a specified package.  Uses \f(CW\*(C`strlen\*(C'\fR todetermine the length of \f(CW\*(C`name\*(C'\fR, then calls \f(CW\*(C`gv_stashpvn()\*(C'\fR..Sp.Vb 1\&        HV*     gv_stashpv(const char* name, I32 flags).Ve.IP "gv_stashpvn" 8.IX Xref "gv_stashpvn".IX Item "gv_stashpvn"Returns a pointer to the stash for a specified package.  The \f(CW\*(C`namelen\*(C'\fRparameter indicates the length of the \f(CW\*(C`name\*(C'\fR, in bytes.  \f(CW\*(C`flags\*(C'\fR is passedto \f(CW\*(C`gv_fetchpvn_flags()\*(C'\fR, so if set to \f(CW\*(C`GV_ADD\*(C'\fR then the package will becreated if it does not already exist.  If the package does not exist and\&\f(CW\*(C`flags\*(C'\fR is 0 (or any other setting that does not create packages) then \s-1NULL\s0is returned..Sp.Vb 1\&        HV*     gv_stashpvn(const char* name, U32 namelen, I32 flags).Ve.IP "gv_stashpvs" 8.IX Xref "gv_stashpvs".IX Item "gv_stashpvs"Like \f(CW\*(C`gv_stashpvn\*(C'\fR, but takes a literal string instead of a string/length pair..Sp.Vb 1\&        HV*     gv_stashpvs(const char* name, I32 create).Ve.IP "gv_stashsv" 8.IX Xref "gv_stashsv".IX Item "gv_stashsv"Returns a pointer to the stash for a specified package.  See \f(CW\*(C`gv_stashpvn\*(C'\fR..Sp.Vb 1\&        HV*     gv_stashsv(SV* sv, I32 flags).Ve.SH "Handy Values".IX Header "Handy Values".IP "Nullav" 8.IX Xref "Nullav".IX Item "Nullav"Null \s-1AV\s0 pointer..IP "Nullch" 8.IX Xref "Nullch".IX Item "Nullch"Null character pointer..IP "Nullcv" 8.IX Xref "Nullcv".IX Item "Nullcv"Null \s-1CV\s0 pointer..IP "Nullhv" 8.IX Xref "Nullhv".IX Item "Nullhv"Null \s-1HV\s0 pointer..IP "Nullsv" 8.IX Xref "Nullsv".IX Item "Nullsv"Null \s-1SV\s0 pointer..SH "Hash Manipulation Functions".IX Header "Hash Manipulation Functions".IP "get_hv" 8.IX Xref "get_hv".IX Item "get_hv"Returns the \s-1HV\s0 of the specified Perl hash.  If \f(CW\*(C`create\*(C'\fR is set and thePerl variable does not exist then it will be created.  If \f(CW\*(C`create\*(C'\fR is notset and the variable does not exist then \s-1NULL\s0 is returned..Sp\&\s-1NOTE:\s0 the perl_ form of this function is deprecated..Sp.Vb 1\&        HV*     get_hv(const char* name, I32 create).Ve.IP "HEf_SVKEY" 8.IX Xref "HEf_SVKEY".IX Item "HEf_SVKEY"This flag, used in the length slot of hash entries and magic structures,specifies the structure contains an \f(CW\*(C`SV*\*(C'\fR pointer where a \f(CW\*(C`char*\*(C'\fR pointeris to be expected. (For information only\*(--not to be used)..IP "HeHASH" 8.IX Xref "HeHASH".IX Item "HeHASH"Returns the computed hash stored in the hash entry..Sp.Vb 1\&        U32     HeHASH(HE* he).Ve.IP "HeKEY" 8.IX Xref "HeKEY".IX Item "HeKEY"Returns the actual pointer stored in the key slot of the hash entry. Thepointer may be either \f(CW\*(C`char*\*(C'\fR or \f(CW\*(C`SV*\*(C'\fR, depending on the value of\&\f(CW\*(C`HeKLEN()\*(C'\fR.  Can be assigned to.  The \f(CW\*(C`HePV()\*(C'\fR or \f(CW\*(C`HeSVKEY()\*(C'\fR macros areusually preferable for finding the value of a key..Sp.Vb 1\&        void*   HeKEY(HE* he).Ve.IP "HeKLEN" 8.IX Xref "HeKLEN".IX Item "HeKLEN"If this is negative, and amounts to \f(CW\*(C`HEf_SVKEY\*(C'\fR, it indicates the entryholds an \f(CW\*(C`SV*\*(C'\fR key.  Otherwise, holds the actual length of the key.  Canbe assigned to. The \f(CW\*(C`HePV()\*(C'\fR macro is usually preferable for finding keylengths..Sp.Vb 1\&        STRLEN  HeKLEN(HE* he).Ve.IP "HePV" 8.IX Xref "HePV".IX Item "HePV"Returns the key slot of the hash entry as a \f(CW\*(C`char*\*(C'\fR value, doing anynecessary dereferencing of possibly \f(CW\*(C`SV*\*(C'\fR keys.  The length of the stringis placed in \f(CW\*(C`len\*(C'\fR (this is a macro, so do \fInot\fR use \f(CW&len\fR).  If you donot care about what the length of the key is, you may use the globalvariable \f(CW\*(C`PL_na\*(C'\fR, though this is rather less efficient than using a localvariable.  Remember though, that hash keys in perl are free to containembedded nulls, so using \f(CW\*(C`strlen()\*(C'\fR or similar is not a good way to findthe length of hash keys. This is very similar to the \f(CW\*(C`SvPV()\*(C'\fR macrodescribed elsewhere in this document..Sp.Vb 1\&        char*   HePV(HE* he, STRLEN len).Ve.IP "HeSVKEY" 8.IX Xref "HeSVKEY".IX Item "HeSVKEY"Returns the key as an \f(CW\*(C`SV*\*(C'\fR, or \f(CW\*(C`NULL\*(C'\fR if the hash entry does notcontain an \f(CW\*(C`SV*\*(C'\fR key..Sp.Vb 1\&        SV*     HeSVKEY(HE* he).Ve.IP "HeSVKEY_force" 8.IX Xref "HeSVKEY_force".IX Item "HeSVKEY_force"Returns the key as an \f(CW\*(C`SV*\*(C'\fR.  Will create and return a temporary mortal\&\f(CW\*(C`SV*\*(C'\fR if the hash entry contains only a \f(CW\*(C`char*\*(C'\fR key..Sp.Vb 1\&        SV*     HeSVKEY_force(HE* he).Ve.IP "HeSVKEY_set" 8.IX Xref "HeSVKEY_set".IX Item "HeSVKEY_set"Sets the key to a given \f(CW\*(C`SV*\*(C'\fR, taking care to set the appropriate flags toindicate the presence of an \f(CW\*(C`SV*\*(C'\fR key, and returns the same\&\f(CW\*(C`SV*\*(C'\fR..Sp.Vb 1\&        SV*     HeSVKEY_set(HE* he, SV* sv).Ve.IP "HeVAL" 8.IX Xref "HeVAL".IX Item "HeVAL"Returns the value slot (type \f(CW\*(C`SV*\*(C'\fR) stored in the hash entry..Sp.Vb 1\&        SV*     HeVAL(HE* he).Ve.IP "HvNAME" 8.IX Xref "HvNAME".IX Item "HvNAME"Returns the package name of a stash, or \s-1NULL\s0 if \f(CW\*(C`stash\*(C'\fR isn't a stash.See \f(CW\*(C`SvSTASH\*(C'\fR, \f(CW\*(C`CvSTASH\*(C'\fR..Sp.Vb 1\&        char*   HvNAME(HV* stash).Ve.IP "hv_assert" 8.IX Xref "hv_assert".IX Item "hv_assert"Check that a hash is in an internally consistent state..Sp.Vb 1\&        void    hv_assert(HV* tb).Ve.IP "hv_clear" 8.IX Xref "hv_clear".IX Item "hv_clear"Clears a hash, making it empty..Sp.Vb 1\&        void    hv_clear(HV* tb).Ve.IP "hv_clear_placeholders" 8.IX Xref "hv_clear_placeholders".IX Item "hv_clear_placeholders"Clears any placeholders from a hash.  If a restricted hash has any of its keysmarked as readonly and the key is subsequently deleted, the key is not actuallydeleted but is marked by assigning it a value of &PL_sv_placeholder.  This tagsit so it will be ignored by future operations such as iterating over the hash,but will still allow the hash to have a value reassigned to the key at somefuture point.  This function clears any such placeholder keys from the hash.See \fIHash::Util::lock_keys()\fR for an example of its use..Sp.Vb 1\&        void    hv_clear_placeholders(HV* hb).Ve.IP "hv_delete" 8.IX Xref "hv_delete".IX Item "hv_delete"Deletes a key/value pair in the hash.  The value \s-1SV\s0 is removed from thehash and returned to the caller.  The \f(CW\*(C`klen\*(C'\fR is the length of the key.The \f(CW\*(C`flags\*(C'\fR value will normally be zero; if set to G_DISCARD then \s-1NULL\s0will be returned..Sp.Vb 1\&        SV*     hv_delete(HV* tb, const char* key, I32 klen, I32 flags).Ve.IP "hv_delete_ent" 8.IX Xref "hv_delete_ent".IX Item "hv_delete_ent"Deletes a key/value pair in the hash.  The value \s-1SV\s0 is removed from thehash and returned to the caller.  The \f(CW\*(C`flags\*(C'\fR value will normally be zero;if set to G_DISCARD then \s-1NULL\s0 will be returned.  \f(CW\*(C`hash\*(C'\fR can be a validprecomputed hash value, or 0 to ask for it to be computed..Sp.Vb 1\&        SV*     hv_delete_ent(HV* tb, SV* key, I32 flags, U32 hash).Ve.IP "hv_exists" 8.IX Xref "hv_exists".IX Item "hv_exists"Returns a boolean indicating whether the specified hash key exists.  The\&\f(CW\*(C`klen\*(C'\fR is the length of the key..Sp.Vb 1\&        bool    hv_exists(HV* tb, const char* key, I32 klen).Ve.IP "hv_exists_ent" 8.IX Xref "hv_exists_ent".IX Item "hv_exists_ent"Returns a boolean indicating whether the specified hash key exists. \f(CW\*(C`hash\*(C'\fRcan be a valid precomputed hash value, or 0 to ask for it to becomputed..Sp.Vb 1\&        bool    hv_exists_ent(HV* tb, SV* key, U32 hash).Ve.IP "hv_fetch" 8.IX Xref "hv_fetch".IX Item "hv_fetch"Returns the \s-1SV\s0 which corresponds to the specified key in the hash.  The\&\f(CW\*(C`klen\*(C'\fR is the length of the key.  If \f(CW\*(C`lval\*(C'\fR is set then the fetch will bepart of a store.  Check that the return value is non-null beforedereferencing it to an \f(CW\*(C`SV*\*(C'\fR..SpSee \*(L"Understanding the Magic of Tied Hashes and Arrays\*(R" in perlguts for moreinformation on how to use this function on tied hashes..Sp.Vb 1\&        SV**    hv_fetch(HV* tb, const char* key, I32 klen, I32 lval).Ve.IP "hv_fetchs" 8.IX Xref "hv_fetchs".IX Item "hv_fetchs"Like \f(CW\*(C`hv_fetch\*(C'\fR, but takes a literal string instead of a string/length pair..Sp.Vb 1\&        SV**    hv_fetchs(HV* tb, const char* key, I32 lval).Ve.IP "hv_fetch_ent" 8.IX Xref "hv_fetch_ent".IX Item "hv_fetch_ent"Returns the hash entry which corresponds to the specified key in the hash.\&\f(CW\*(C`hash\*(C'\fR must be a valid precomputed hash number for the given \f(CW\*(C`key\*(C'\fR, or 0if you want the function to compute it.  \s-1IF\s0 \f(CW\*(C`lval\*(C'\fR is set then the fetchwill be part of a store.  Make sure the return value is non-null beforeaccessing it.  The return value when \f(CW\*(C`tb\*(C'\fR 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..SpSee \*(L"Understanding the Magic of Tied Hashes and Arrays\*(R" in perlguts for moreinformation on how to use this function on tied hashes..Sp.Vb 1\&        HE*     hv_fetch_ent(HV* tb, SV* key, I32 lval, U32 hash).Ve.IP "hv_iterinit" 8.IX Xref "hv_iterinit".IX Item "hv_iterinit"Prepares a starting point to traverse a hash table.  Returns the number ofkeys in the hash (i.e. the same as \f(CW\*(C`HvKEYS(tb)\*(C'\fR).  The return value iscurrently only meaningful for hashes without tie magic..Sp\&\s-1NOTE:\s0 Before version 5.004_65, \f(CW\*(C`hv_iterinit\*(C'\fR 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 \f(CW\*(C`HvFILL(tb)\*(C'\fR..Sp.Vb 1\&        I32     hv_iterinit(HV* tb).Ve.IP "hv_iterkey" 8.IX Xref "hv_iterkey".IX Item "hv_iterkey"Returns the key from the current position of the hash iterator.  See\&\f(CW\*(C`hv_iterinit\*(C'\fR..Sp.Vb 1\&        char*   hv_iterkey(HE* entry, I32* retlen).Ve.IP "hv_iterkeysv" 8.IX Xref "hv_iterkeysv".IX Item "hv_iterkeysv"Returns the key as an \f(CW\*(C`SV*\*(C'\fR from the current position of the hashiterator.  The return value will always be a mortal copy of the key.  Alsosee \f(CW\*(C`hv_iterinit\*(C'\fR..Sp.Vb 1\&        SV*     hv_iterkeysv(HE* entry).Ve.IP "hv_iternext" 8.IX Xref "hv_iternext".IX Item "hv_iternext"Returns entries from a hash iterator.  See \f(CW\*(C`hv_iterinit\*(C'\fR..SpYou may call \f(CW\*(C`hv_delete\*(C'\fR or \f(CW\*(C`hv_delete_ent\*(C'\fR on the hash entry that theiterator currently points to, without losing your place or invalidating youriterator.  Note that in this case the current entry is deleted from the hashwith your iterator holding the last reference to it.  Your iterator is flaggedto free the entry on the next call to \f(CW\*(C`hv_iternext\*(C'\fR, so you must not discardyour iterator immediately else the entry will leak \- call \f(CW\*(C`hv_iternext\*(C'\fR totrigger the resource deallocation..Sp.Vb 1\&        HE*     hv_iternext(HV* tb).Ve.IP "hv_iternextsv" 8.IX Xref "hv_iternextsv".IX Item "hv_iternextsv"Performs an \f(CW\*(C`hv_iternext\*(C'\fR, \f(CW\*(C`hv_iterkey\*(C'\fR, and \f(CW\*(C`hv_iterval\*(C'\fR in oneoperation..Sp.Vb 1\&        SV*     hv_iternextsv(HV* hv, char** key, I32* retlen).Ve.IP "hv_iternext_flags" 8.IX Xref "hv_iternext_flags".IX Item "hv_iternext_flags"Returns entries from a hash iterator.  See \f(CW\*(C`hv_iterinit\*(C'\fR and \f(CW\*(C`hv_iternext\*(C'\fR.The \f(CW\*(C`flags\*(C'\fR value will normally be zero; if \s-1HV_ITERNEXT_WANTPLACEHOLDERS\s0 isset the placeholders keys (for restricted hashes) will be returned in additionto normal keys. By default placeholders are automatically skipped over.Currently a placeholder is implemented with a value that is\&\f(CW&Perl_sv_placeholder\fR. Note that the implementation of placeholders andrestricted hashes may change, and the implementation currently isinsufficiently abstracted for any change to be tidy..Sp\&\s-1NOTE:\s0 this function is experimental and may change or beremoved without notice..Sp.Vb 1\&        HE*     hv_iternext_flags(HV* tb, I32 flags).Ve.IP "hv_iterval" 8.IX Xref "hv_iterval".IX Item "hv_iterval"Returns the value from the current position of the hash iterator.  See\&\f(CW\*(C`hv_iterkey\*(C'\fR..Sp.Vb 1\&        SV*     hv_iterval(HV* tb, HE* entry).Ve.IP "hv_magic" 8.IX Xref "hv_magic".IX Item "hv_magic"Adds magic to a hash.  See \f(CW\*(C`sv_magic\*(C'\fR..Sp.Vb 1\&        void    hv_magic(HV* hv, GV* gv, int how).Ve.IP "hv_scalar" 8.IX Xref "hv_scalar".IX Item "hv_scalar"Evaluates the hash in scalar context and returns the result. Handles magic when the hash is tied..Sp.Vb 1\&        SV*     hv_scalar(HV* hv).Ve.IP "hv_store" 8.IX Xref "hv_store".IX Item "hv_store"Stores an \s-1SV\s0 in a hash.  The hash key is specified as \f(CW\*(C`key\*(C'\fR and \f(CW\*(C`klen\*(C'\fR isthe length of the key.  The \f(CW\*(C`hash\*(C'\fR parameter is the precomputed hashvalue; if it is zero then Perl will compute it.  The return value will be\&\s-1NULL\s0 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 \f(CW\*(C`SV*\*(C'\fR.  Note that the caller is

⌨️ 快捷键说明

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