📄 perlapi.pod
字号:
SV* newSVpvf(const char* pat, ...)=for hackersFound in file sv.c=item newSVpvnCreates a new SV and copies a string into it. The reference count for theSV is set to 1. Note that if C<len> is zero, Perl will create a zero length string. You are responsible for ensuring that the source string is at leastC<len> bytes long. SV* newSVpvn(const char* s, STRLEN len)=for hackersFound in file sv.c=item newSVrvCreates a new SV for the RV, C<rv>, to point to. If C<rv> is not an RV thenit will be upgraded to one. If C<classname> is non-null then the new SV willbe blessed in the specified package. The new SV is returned and itsreference count is 1. SV* newSVrv(SV* rv, const char* classname)=for hackersFound in file sv.c=item newSVsvCreates a new SV which is an exact duplicate of the original SV. SV* newSVsv(SV* old)=for hackersFound in file sv.c=item newSVuvCreates a new SV and copies an unsigned integer into it.The reference count for the SV is set to 1. SV* newSVuv(UV u)=for hackersFound in file sv.c=item newXSUsed by C<xsubpp> to hook up XSUBs as Perl subs.=for hackersFound in file op.c=item newXSprotoUsed by C<xsubpp> to hook up XSUBs as Perl subs. Adds Perl prototypes tothe subs.=for hackersFound in file XSUB.h=item NewzThe XSUB-writer's interface to the C C<malloc> function. The allocatedmemory is zeroed with C<memzero>. void Newz(int id, void* ptr, int nitems, type)=for hackersFound in file handy.h=item NullavNull AV pointer.=for hackersFound in file av.h=item NullchNull character pointer.=for hackersFound in file handy.h=item NullcvNull CV pointer.=for hackersFound in file cv.h=item NullhvNull HV pointer.=for hackersFound in file hv.h=item NullsvNull SV pointer.=for hackersFound in file handy.h=item ORIGMARKThe original stack mark for the XSUB. See C<dORIGMARK>.=for hackersFound in file pp.h=item perl_allocAllocates a new Perl interpreter. See L<perlembed>. PerlInterpreter* perl_alloc()=for hackersFound in file perl.c=item perl_constructInitializes a new Perl interpreter. See L<perlembed>. void perl_construct(PerlInterpreter* interp)=for hackersFound in file perl.c=item perl_destructShuts down a Perl interpreter. See L<perlembed>. void perl_destruct(PerlInterpreter* interp)=for hackersFound in file perl.c=item perl_freeReleases a Perl interpreter. See L<perlembed>. void perl_free(PerlInterpreter* interp)=for hackersFound in file perl.c=item perl_parseTells a Perl interpreter to parse a Perl script. See L<perlembed>. int perl_parse(PerlInterpreter* interp, XSINIT_t xsinit, int argc, char** argv, char** env)=for hackersFound in file perl.c=item perl_runTells a Perl interpreter to run. See L<perlembed>. int perl_run(PerlInterpreter* interp)=for hackersFound in file perl.c=item PL_modglobalC<PL_modglobal> is a general purpose, interpreter global HV for use by extensions that need to keep information on a per-interpreter basis.In a pinch, it can also be used as a symbol table for extensions to share data among each other. It is a good idea to use keys prefixed by the package name of the extension that owns the data. HV* PL_modglobal=for hackersFound in file intrpvar.h=item PL_naA convenience variable which is typically used with C<SvPV> when onedoesn't care about the length of the string. It is usually more efficientto either declare a local variable and use that instead or to use theC<SvPV_nolen> macro. STRLEN PL_na=for hackersFound in file thrdvar.h=item PL_sv_noThis is the C<false> SV. See C<PL_sv_yes>. Always refer to this asC<&PL_sv_no>. SV PL_sv_no=for hackersFound in file intrpvar.h=item PL_sv_undefThis is the C<undef> SV. Always refer to this as C<&PL_sv_undef>. SV PL_sv_undef=for hackersFound in file intrpvar.h=item PL_sv_yesThis is the C<true> SV. See C<PL_sv_no>. Always refer to this asC<&PL_sv_yes>. SV PL_sv_yes=for hackersFound in file intrpvar.h=item POPiPops an integer off the stack. IV POPi=for hackersFound in file pp.h=item POPlPops a long off the stack. long POPl=for hackersFound in file pp.h=item POPnPops a double off the stack. NV POPn=for hackersFound in file pp.h=item POPpPops a string off the stack. char* POPp=for hackersFound in file pp.h=item POPsPops an SV off the stack. SV* POPs=for hackersFound in file pp.h=item PUSHiPush an integer onto the stack. The stack must have room for this element.Handles 'set' magic. See C<XPUSHi>. void PUSHi(IV iv)=for hackersFound in file pp.h=item PUSHMARKOpening bracket for arguments on a callback. See C<PUTBACK> andL<perlcall>. PUSHMARK;=for hackersFound in file pp.h=item PUSHnPush a double onto the stack. The stack must have room for this element.Handles 'set' magic. See C<XPUSHn>. void PUSHn(NV nv)=for hackersFound in file pp.h=item PUSHpPush a string onto the stack. The stack must have room for this element.The C<len> indicates the length of the string. Handles 'set' magic. SeeC<XPUSHp>. void PUSHp(char* str, STRLEN len)=for hackersFound in file pp.h=item PUSHsPush an SV onto the stack. The stack must have room for this element.Does not handle 'set' magic. See C<XPUSHs>. void PUSHs(SV* sv)=for hackersFound in file pp.h=item PUSHuPush an unsigned integer onto the stack. The stack must have room for thiselement. See C<XPUSHu>. void PUSHu(UV uv)=for hackersFound in file pp.h=item PUTBACKClosing bracket for XSUB arguments. This is usually handled by C<xsubpp>.See C<PUSHMARK> and L<perlcall> for other uses. PUTBACK;=for hackersFound in file pp.h=item RenewThe XSUB-writer's interface to the C C<realloc> function. void Renew(void* ptr, int nitems, type)=for hackersFound in file handy.h=item RenewcThe XSUB-writer's interface to the C C<realloc> function, withcast. void Renewc(void* ptr, int nitems, type, cast)=for hackersFound in file handy.h=item require_pvTells Perl to C<require> a module.NOTE: the perl_ form of this function is deprecated. void require_pv(const char* pv)=for hackersFound in file perl.c=item RETVALVariable which is setup by C<xsubpp> to hold the return value for an XSUB. This is always the proper type for the XSUB. See L<perlxs/"The RETVAL Variable">. (whatever) RETVAL=for hackersFound in file XSUB.h=item SafefreeThe XSUB-writer's interface to the C C<free> function. void Safefree(void* ptr)=for hackersFound in file handy.h=item savepvCopy a string to a safe spot. This does not use an SV. char* savepv(const char* sv)=for hackersFound in file util.c=item savepvnCopy a string to a safe spot. The C<len> indicates number of bytes tocopy. This does not use an SV. char* savepvn(const char* sv, I32 len)=for hackersFound in file util.c=item SAVETMPSOpening bracket for temporaries on a callback. See C<FREETMPS> andL<perlcall>. SAVETMPS;=for hackersFound in file scope.h=item SPStack pointer. This is usually handled by C<xsubpp>. See C<dSP> andC<SPAGAIN>.=for hackersFound in file pp.h=item SPAGAINRefetch the stack pointer. Used after a callback. See L<perlcall>. SPAGAIN;=for hackersFound in file pp.h=item STUsed to access elements on the XSUB's stack. SV* ST(int ix)=for hackersFound in file XSUB.h=item strEQTest 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 strGETest 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 strGTTest 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 strLETest 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 strLTTest 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 strNETest two strings to see if they are different. Returns true orfalse. bool strNE(char* s1, char* s2)=for hackersFound in file handy.h=item strnEQTest 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 strnNETest 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 StructCopyThis 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 SvCURReturns the length of the string which is in the SV. See C<SvLEN>. STRLEN SvCUR(SV* sv)=for hackersFound in file sv.h=item SvCUR_setSet the length of the string which is in the SV. See C<SvCUR>. void SvCUR_set(SV* sv, STRLEN len)=for hackersFound in file sv.h=item SvENDReturns a pointer to the last character in the string which is in the SV.See C<SvCUR>. Access the character as *(SvEND(sv)). char* SvEND(SV* sv)=for hackersFound in file sv.h=item SvGETMAGICInvokes C<mg_get> on an SV if it has 'get' magic. This macro evaluates itsargument more than once. void SvGETMAGIC(SV* sv)=for hackersFound in file sv.h=item SvGROWExpands the character buffer in the SV so that it has room for theindicated number of bytes (remember to reserve space for an extra trailingNUL character). Calls C<sv_grow> to perform the expansion if necessary. Returns a pointer to the character buffer. void SvGROW(SV* sv, STRLEN len)=for hackersFound in file sv.h=item SvIOKReturns a boolean indicating whether the SV contains an integer. bool SvIOK(SV* sv)=for hackersFound in file sv.h=item SvIOKpReturns a boolean indicating whether the SV contains an integer. Checksthe B<private> setting. Use C<SvIOK>. bool SvIOKp(SV* sv)=for hackersFound in file sv.h=item SvIOK_notUVReturns a boolean indicating whether the SV contains an signed integer. void SvIOK_notUV(SV* sv)=for hackersFound in file sv.h=item SvIOK_offUnsets the IV status of an SV. void SvIOK_off(SV* sv)=for hackersFound in file sv.h=item SvIOK_onTells an SV that it is an integer. void SvIOK_on(SV* sv)=for hackersFound in file sv.h=item SvIOK_onlyTells an SV that it is an integer and disables all other OK bits. void SvIOK_only(SV* sv)=for hackersFound in file sv.h=item SvIOK_only_UVTells and SV that it is an unsigned integer and disables all other OK bits. void SvIOK_only_UV(SV* sv)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -