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

📄 extutils::xsbuilder.osc2002.3

📁 视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.
💻 3
📖 第 1 页 / 共 2 页
字号:
.\" 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 "xsbuilder.osc2002 3".TH xsbuilder.osc2002 3 "2002-08-05" "perl v5.10.0" "User Contributed Perl Documentation".\" For nroff, turn off justification.  Always turn off hyphenation; it makes.\" way too many mistakes in technical documents..if n .ad l.nh.SH "XSBuilder \- Autogenerating XS-glue Code".IX Header "XSBuilder - Autogenerating XS-glue Code"O'Reilly OpenSource Convention 2002.PPGerald Richter.PPecos gmbh.PPhttp://www.ecos.de.SH "XSBuilder \- What is it?".IX Header "XSBuilder - What is it?".Sh "It's purpose is to automaticly generate a Perl interface to C Code".IX Subsection "It's purpose is to automaticly generate a Perl interface to C Code".Sh "Solves the problem, that the Perl interface is not always uptodate with the C interface".IX Subsection "Solves the problem, that the Perl interface is not always uptodate with the C interface".Sh "Saves a lot of Copy&Paste work".IX Subsection "Saves a lot of Copy&Paste work".Sh "Systematical changes have to be done only once".IX Subsection "Systematical changes have to be done only once"For example changes in the memory management of strings..Sh "Is part of mod_perl 2.0 build system".IX Subsection "Is part of mod_perl 2.0 build system"Most code is developed by Doug MacEachern. Additionaly I have.IP "abstracted the code from mod_perl so it's useable for any C code" 4.IX Item "abstracted the code from mod_perl so it's useable for any C code".PD 0.IP "added new features like callbacks and the ability to parse comments" 4.IX Item "added new features like callbacks and the ability to parse comments".IP "Replaced C::Scan with a Parse::RecDescent to be platform and compiler independend" 4.IX Item "Replaced C::Scan with a Parse::RecDescent to be platform and compiler independend".PD.PPGoal is to replace the current mod_perl \s-1XS\s0 generation code with XSBuilder.Sh "Inline versus XSBuilder".IX Subsection "Inline versus XSBuilder".IP "Inline: embed C\-Code into Perl" 4.IX Item "Inline: embed C-Code into Perl".PD 0.IP "XSBuilder: Create interface for existing C\-libraries/applicationen" 4.IX Item "XSBuilder: Create interface for existing C-libraries/applicationen".PD.SH "XSBuilder \- What does it do?".IX Header "XSBuilder - What does it do?".Sh "Create Perl functions/methods for every C function".IX Subsection "Create Perl functions/methods for every C function"The function can be assigned to different packages, also automaticlyby inspecting the first parameter.Sh "Create a Perl class for every C structure".IX Subsection "Create a Perl class for every C structure"Every element of structure becomes a Perl method to get/set it's value.The object can be either a scalar reference (used by mod_perl) ora reference to a hash (use by Embperl), which allows to store extra data by the Perl code into this hash..Sh "Create glue code to handle callbacks".IX Subsection "Create glue code to handle callbacks"There several sorts of callback, not all are implemented right now.Sh "Create Perl constant subs".IX Subsection "Create Perl constant subs"Coming soon....SH "XSBuilder \- How does it work?".IX Header "XSBuilder - How does it work?".Sh "Parse the C header files".IX Subsection "Parse the C header files"Extract.IP "Functions, their arguments and return types" 4.IX Item "Functions, their arguments and return types".PD 0.IP "Structures and it's members" 4.IX Item "Structures and it's members".IP "Constants" 4.IX Item "Constants".IP "Callbacks" 4.IX Item "Callbacks".PD.PPand create four tables which contains the results.Sh "Create the \s-1XS\s0 code".IX Subsection "Create the XS code"Input is.IP "The source tables" 4.IX Item "The source tables".PD 0.IP "Mapfiles which contains the mapping from C to Perl" 4.IX Item "Mapfiles which contains the mapping from C to Perl".IP "Addtional C and Perl code that can be used to customize the interface" 4.IX Item "Addtional C and Perl code that can be used to customize the interface".PD.PPOutput is.IP "The \s-1XS\s0 files (one form every generated class)" 4.IX Item "The XS files (one form every generated class)".PD 0.IP "Makefile.PL for every class" 4.IX Item "Makefile.PL for every class".IP "pm files" 4.IX Item "pm files".PD.SH "Parse the source".IX Header "Parse the source".Sh "Create your own ParseSource class and override methods...".IX Subsection "Create your own ParseSource class and override methods...".Vb 1\&    package Apache::DAV::ParseSource;\&\&    use strict;\&    use vars qw{@ISA $VERSION} ;\&    use ExtUtils::XSBuilder::ParseSource  ;\&\&    @ISA = (\*(AqExtUtils::XSBuilder::ParseSource\*(Aq) ;\&    $VERSION = \*(Aq0.01\*(Aq;\&\&    my $dav_dir = \*(AqC:\eperl\emsrc\ecvs\emod_dav\*(Aq ;\&    my $ap_dir  = \*(Aqc:\eprogramme\eapache group\eapache\*(Aq ;\&\&    # ============================================================================\&    sub find_includes {\&        my $self = shift;\&        return $self\->{includes} if $self\->{includes};\&        my @includes = ("$ap_dir/include/ap_alloc.h", "$dav_dir/mod_dav.h") ;\&        return $self\->{includes} = $self \-> sort_includes (\e@includes) ;\&        }\&\&    # ============================================================================\&    sub package     { \*(AqApache::DAV\*(Aq } \&\&    # ============================================================================\&    sub preprocess {\&        my $self     = shift ;\&        $_[0] =~ s/(?:API_EXPORT)(?:_NONSTD)?\es*\e(\es*(.*?)\es*\e)/$1/g ;\&    }\&\&\&    1;.Ve.Sh "...run it".IX Subsection "...run it".Vb 2\&    use FindBin ;\&    use lib ($FindBin::Bin) ;\&\&    require ParseSource ; \&\&    Apache::DAV::ParseSource \-> run ;.Ve.Sh "...and you get".IX Subsection "...and you get".Vb 10\&    C:\eperl\emsrc\edavint>perl xsbuilder\esource_scan.pl\&    Will use mod_dav in C:\eperl\emsrc\ecvs\emod_dav\&    Will use Apache in c:\eprogramme\eapache group\eapache\&    Initialize parser\&    scan c:\eprogramme\eapache group\eapache/include/ap_alloc.h ...\&    constant: APACHE_ALLOC_H\&    func:     ap_init_alloc\&    func:     ap_cleanup_alloc\&    func:     ap_make_sub_pool\&    func:     ap_destroy_pool\&    constant: ap_pool_join\&    func:     ap_pool_join\&    func:     ap_find_pool\&    func:     ap_pool_is_ancestor\&    func:     ap_clear_pool\&    func:     ap_cleanup_for_exec\&    func:     ap_palloc\&    func:     ap_pcalloc\&    func:     ap_pstrdup\&    func:     ap_pstrndup\&    func:     ap_pstrcat\&    func:     ap_pvsprintf\&      valuefield: ap_pool * : pool\&      valuefield: int : elt_size\&      valuefield: int : nelts\&      valuefield: int : nalloc\&      valuefield: char * : elts\&    struct:    (type=array_header)\&    ....Ve.Sh "The result is stored in four tables".IX Subsection "The result is stored in four tables".IP "xsbuilder/tables/Apache/DAV/FuntionTable.pm" 4.IX Item "xsbuilder/tables/Apache/DAV/FuntionTable.pm"Contains all function, it arguments and comments.IP "xsbuilder/tables/Apache/DAV/ConstantTable.pm" 4.IX Item "xsbuilder/tables/Apache/DAV/ConstantTable.pm"Contains all constants.IP "xsbuilder/tables/Apache/DAV/StructureTable.pm" 4.IX Item "xsbuilder/tables/Apache/DAV/StructureTable.pm"Contains all structures, it's members and their comments.IP "xsbuilder/tables/Apache/DAV/CallbackTable.pm" 4.IX Item "xsbuilder/tables/Apache/DAV/CallbackTable.pm"Contains all callback function definitions.SH "Create the map files".IX Header "Create the map files".Sh "Mapfiles are used to tell XSBuilder how C datatypes, structures and function aruments should be mapped into Perl ones.".IX Subsection "Mapfiles are used to tell XSBuilder how C datatypes, structures and function aruments should be mapped into Perl ones.".Sh "Create your own WrapXS class and override methods".IX Subsection "Create your own WrapXS class and override methods".Vb 3\&    package Apache::DAV::WrapXS ;\&    use strict;\&    use vars qw{@ISA $VERSION} ;\&\&    use ExtUtils::XSBuilder::WrapXS ;\&\&    @ISA = (\*(AqExtUtils::XSBuilder::WrapXS\*(Aq) ;\&    $VERSION = \*(Aq0.01\*(Aq;\&\&    # ============================================================================\&    sub new_parsesource  { [ Apache::DAV::ParseSource\->new ] }\&\&    # ============================================================================\&    sub my_xs_prefix  { \*(Aqdavxs_\*(Aq }\&\&    # ============================================================================\&    sub h_filename_prefix  { \*(Aqmoddav_xs_\*(Aq }\&\&    # ============================================================================\&    sub xs_includes {\&        my $self = shift ;\&        my $i = $self \-> SUPER::xs_includes ;\&        my @i = grep (!/ap_alloc/, @$i) ;\&        return \e@i ;\&    }.Ve.Sh "XSBuilder can create/update initial maps for you".IX Subsection "XSBuilder can create/update initial maps for you".Vb 2\&    use FindBin ;\&    use lib ($FindBin::Bin) ;\&\&    require ParseSource ; \&    require WrapXS ; \&\&    Apache::DAV::WrapXS\->checkmaps (\*(Aq \*(Aq);.Ve.Sh "run it".IX Subsection "run it".Vb 11\&    C:\eperl\emsrc\edavint>perl xsbuilder\exs_check.pl

⌨️ 快捷键说明

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