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

📄 perlreapi.1

📁 视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.
💻 1
📖 第 1 页 / 共 3 页
字号:
.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05).\".\" Standard preamble:.\" ========================================================================.de Sh \" Subsection heading.br.if t .Sp.ne 5.PP\fB\\$1\fR.PP...de Sp \" Vertical space (when we can't use .PP).if t .sp .5v.if n .sp...de Vb \" Begin verbatim text.ft CW.nf.ne \\$1...de Ve \" End verbatim text.ft R.fi...\" Set up some character translations and predefined strings.  \*(-- will.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left.\" double quote, and \*(R" will give a right double quote.  \*(C+ will.\" give a nicer C++.  Capital omega is used to do unbreakable dashes and.\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,.\" nothing in troff, for use with C<>..tr \(*W-.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'.ie n \{\.    ds -- \(*W-.    ds PI pi.    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch.    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch.    ds L" "".    ds R" "".    ds C` "".    ds C' ""'br\}.el\{\.    ds -- \|\(em\|.    ds PI \(*p.    ds L" ``.    ds R" '''br\}.\".\" Escape single quotes in literal strings from groff's Unicode transform..ie \n(.g .ds Aq \(aq.el       .ds Aq '.\".\" If the F register is turned on, we'll generate index entries on stderr for.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index.\" entries marked with X<> in POD.  Of course, you'll have to process the.\" output yourself in some meaningful fashion..ie \nF \{\.    de IX.    tm Index:\\$1\t\\n%\t"\\$2"...    nr % 0.    rr F.\}.el \{\.    de IX...\}.\".\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2)..\" Fear.  Run.  Save yourself.  No user-serviceable parts..    \" fudge factors for nroff and troff.if n \{\.    ds #H 0.    ds #V .8m.    ds #F .3m.    ds #[ \f1.    ds #] \fP.\}.if t \{\.    ds #H ((1u-(\\\\n(.fu%2u))*.13m).    ds #V .6m.    ds #F 0.    ds #[ \&.    ds #] \&.\}.    \" simple accents for nroff and troff.if n \{\.    ds ' \&.    ds ` \&.    ds ^ \&.    ds , \&.    ds ~ ~.    ds /.\}.if t \{\.    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u".    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'.    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'.    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'.    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'.    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'.\}.    \" troff and (daisy-wheel) nroff accents.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'.ds 8 \h'\*(#H'\(*b\h'-\*(#H'.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#].ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#].ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#].ds ae a\h'-(\w'a'u*4/10)'e.ds Ae A\h'-(\w'A'u*4/10)'E.    \" corrections for vroff.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'.    \" for low resolution devices (crt and lpr).if \n(.H>23 .if \n(.V>19 \\{\.    ds : e.    ds 8 ss.    ds o a.    ds d- d\h'-1'\(ga.    ds D- D\h'-1'\(hy.    ds th \o'bp'.    ds Th \o'LP'.    ds ae ae.    ds Ae AE.\}.rm #[ #] #H #V #F C.\" ========================================================================.\".IX Title "PERLREAPI 1".TH PERLREAPI 1 "2007-12-18" "perl v5.10.0" "Perl Programmers Reference Guide".\" For nroff, turn off justification.  Always turn off hyphenation; it makes.\" way too many mistakes in technical documents..if n .ad l.nh.SH "NAME"perlreapi \- perl regular expression plugin interface.SH "DESCRIPTION".IX Header "DESCRIPTION"As of Perl 5.9.5 there is a new interface for plugging and using otherregular expression engines than the default one..PPEach engine is supposed to provide access to a constant structure of thefollowing format:.PP.Vb 10\&    typedef struct regexp_engine {\&        REGEXP* (*comp) (pTHX_ const SV * const pattern, const U32 flags);\&        I32     (*exec) (pTHX_ REGEXP * const rx, char* stringarg, char* strend,\&                         char* strbeg, I32 minend, SV* screamer,\&                         void* data, U32 flags);\&        char*   (*intuit) (pTHX_ REGEXP * const rx, SV *sv, char *strpos,\&                           char *strend, U32 flags,\&                           struct re_scream_pos_data_s *data);\&        SV*     (*checkstr) (pTHX_ REGEXP * const rx);\&        void    (*free) (pTHX_ REGEXP * const rx);\&        void    (*numbered_buff_FETCH) (pTHX_ REGEXP * const rx, const I32 paren,\&                                 SV * const sv);\&        void    (*numbered_buff_STORE) (pTHX_ REGEXP * const rx, const I32 paren,\&                                       SV const * const value);\&        I32     (*numbered_buff_LENGTH) (pTHX_ REGEXP * const rx, const SV * const sv,\&                                        const I32 paren);\&        SV*     (*named_buff) (pTHX_ REGEXP * const rx, SV * const key,\&                               SV * const value, U32 flags);\&        SV*     (*named_buff_iter) (pTHX_ REGEXP * const rx, const SV * const lastkey,\&                                    const U32 flags);\&        SV*     (*qr_package)(pTHX_ REGEXP * const rx);\&    #ifdef USE_ITHREADS\&        void*   (*dupe) (pTHX_ REGEXP * const rx, CLONE_PARAMS *param);\&    #endif.Ve.PPWhen a regexp is compiled, its \f(CW\*(C`engine\*(C'\fR field is then set to point atthe appropriate structure, so that when it needs to be used Perl can findthe right routines to do so..PPIn order to install a new regexp handler, \f(CW$^H{regcomp}\fR is setto an integer which (when casted appropriately) resolves to one of thesestructures. When compiling, the \f(CW\*(C`comp\*(C'\fR method is executed, and theresulting regexp structure's engine field is expected to point back atthe same structure..PPThe pTHX_ symbol in the definition is a macro used by perl under threadingto provide an extra argument to the routine holding a pointer back tothe interpreter that is executing the regexp. So under threading allroutines get an extra argument..SH "Callbacks".IX Header "Callbacks".Sh "comp".IX Subsection "comp".Vb 1\&    REGEXP* comp(pTHX_ const SV * const pattern, const U32 flags);.Ve.PPCompile the pattern stored in \f(CW\*(C`pattern\*(C'\fR using the given \f(CW\*(C`flags\*(C'\fR andreturn a pointer to a prepared \f(CW\*(C`REGEXP\*(C'\fR structure that can performthe match. See \*(L"The \s-1REGEXP\s0 structure\*(R" below for an explanation ofthe individual fields in the \s-1REGEXP\s0 struct..PPThe \f(CW\*(C`pattern\*(C'\fR parameter is the scalar that was used as thepattern. previous versions of perl would pass two \f(CW\*(C`char*\*(C'\fR indicatingthe start and end of the stringified pattern, the following snippet canbe used to get the old parameters:.PP.Vb 3\&    STRLEN plen;\&    char*  exp = SvPV(pattern, plen);\&    char* xend = exp + plen;.Ve.PPSince any scalar can be passed as a pattern it's possible to implementan engine that does something with an array (\f(CW\*(C`"ook" =~ [ qw/ eekhlagh / ]\*(C'\fR) or with the non-stringified form of a compiled regularexpression (\f(CW\*(C`"ook" =~ qr/eek/\*(C'\fR). perl's own engine will alwaysstringify everything using the snippet above but that doesn't meanother engines have to..PPThe \f(CW\*(C`flags\*(C'\fR parameter is a bitfield which indicates which of the\&\f(CW\*(C`msixp\*(C'\fR flags the regex was compiled with. It also containsadditional info such as whether \f(CW\*(C`use locale\*(C'\fR is in effect..PPThe \f(CW\*(C`eogc\*(C'\fR flags are stripped out before being passed to the comproutine. The regex engine does not need to know whether any of theseare set as those flags should only affect what perl does with thepattern and its match variables, not how it gets compiled andexecuted..PPBy the time the comp callback is called, some of these flags havealready had effect (noted below where applicable). However most oftheir effect occurs after the comp callback has run in routines thatread the \f(CW\*(C`rx\->extflags\*(C'\fR field which it populates..PPIn general the flags should be preserved in \f(CW\*(C`rx\->extflags\*(C'\fR aftercompilation, although the regex engine might want to add or deletesome of them to invoke or disable some special behavior in perl. Theflags along with any special behavior they cause are documented below:.PPThe pattern modifiers:.ie n .IP """/m"" \- RXf_PMf_MULTILINE" 4.el .IP "\f(CW/m\fR \- RXf_PMf_MULTILINE" 4.IX Item "/m - RXf_PMf_MULTILINE"If this is in \f(CW\*(C`rx\->extflags\*(C'\fR it will be passed to\&\f(CW\*(C`Perl_fbm_instr\*(C'\fR by \f(CW\*(C`pp_split\*(C'\fR which will treat the subject stringas a multi-line string..ie n .IP """/s"" \- RXf_PMf_SINGLELINE" 4.el .IP "\f(CW/s\fR \- RXf_PMf_SINGLELINE" 4.IX Item "/s - RXf_PMf_SINGLELINE".PD 0.ie n .IP """/i"" \- RXf_PMf_FOLD" 4.el .IP "\f(CW/i\fR \- RXf_PMf_FOLD" 4.IX Item "/i - RXf_PMf_FOLD".ie n .IP """/x"" \- RXf_PMf_EXTENDED" 4.el .IP "\f(CW/x\fR \- RXf_PMf_EXTENDED" 4.IX Item "/x - RXf_PMf_EXTENDED".PDIf present on a regex \f(CW\*(C`#\*(C'\fR comments will be handled differently by thetokenizer in some cases..Sp\&\s-1TODO:\s0 Document those cases..ie n .IP """/p"" \- RXf_PMf_KEEPCOPY" 4.el .IP "\f(CW/p\fR \- RXf_PMf_KEEPCOPY" 4.IX Item "/p - RXf_PMf_KEEPCOPY".PPAdditional flags:.IP "RXf_PMf_LOCALE" 4.IX Item "RXf_PMf_LOCALE"Set if \f(CW\*(C`use locale\*(C'\fR is in effect. If present in \f(CW\*(C`rx\->extflags\*(C'\fR\&\f(CW\*(C`split\*(C'\fR will use the locale dependent definition of whitespace underwhen RXf_SKIPWHITE or RXf_WHITE are in effect. Under \s-1ASCII\s0 whitespaceis defined as per isSPACE, and by the internalmacros \f(CW\*(C`is_utf8_space\*(C'\fR under \s-1UTF\-8\s0 and \f(CW\*(C`isSPACE_LC\*(C'\fR under \f(CW\*(C`uselocale\*(C'\fR..IP "RXf_UTF8" 4.IX Item "RXf_UTF8"Set if the pattern is \fISvUTF8()\fR, set by Perl_pmruntime..SpA regex engine may want to set or disable this flag duringcompilation. The perl engine for instance may upgrade non\-UTF\-8strings to \s-1UTF\-8\s0 if the pattern includes constructs such as \f(CW\*(C`\ex{...}\*(C'\fRthat can only match Unicode values..IP "RXf_SPLIT" 4.IX Item "RXf_SPLIT"If \f(CW\*(C`split\*(C'\fR is invoked as \f(CW\*(C`split \*(Aq \*(Aq\*(C'\fR or with no arguments (whichreally means \f(CW\*(C`split(\*(Aq \*(Aq, $_)\*(C'\fR, see split), perl willset this flag. The regex engine can then check for it and set the\&\s-1SKIPWHITE\s0 and \s-1WHITE\s0 extflags. To do this the perl engine does:.Sp

⌨️ 快捷键说明

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