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

📄 apr::brigade.3

📁 视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.
💻 3
📖 第 1 页 / 共 2 页
字号:
.el .IP "obj: \f(CW$bb\fR ( \f(CWAPR::Brigade object\fR )" 4.IX Item "obj: $bb ( APR::Brigade object )".PD 0.ie n .IP "arg1: $buffer ( \s-1SCALAR\s0 )" 4.el .IP "arg1: \f(CW$buffer\fR ( \s-1SCALAR\s0 )" 4.IX Item "arg1: $buffer ( SCALAR )".PDThe buffer to fill. All previous data will be lost..ie n .IP "opt arg2: $wanted ( number )" 4.el .IP "opt arg2: \f(CW$wanted\fR ( number )" 4.IX Item "opt arg2: $wanted ( number )"If no argument is passed then all data will be returned. If \f(CW$wanted\fRis specified \*(-- that number or less bytes will be returned..ie n .IP "ret: $len ( number )" 4.el .IP "ret: \f(CW$len\fR ( number )" 4.IX Item "ret: $len ( number )"How many bytes were actually read..Sp\&\f(CW$buffer\fR gets populated with the string that is read. It willcontain an empty string if there was nothing to read..IP "since: 2.0.00" 4.IX Item "since: 2.0.00".PD 0.ie n .IP "excpt: ""APR::Error""" 4.el .IP "excpt: \f(CWAPR::Error\fR" 4.IX Item "excpt: APR::Error".PD.ie n .Sh """insert_head""".el .Sh "\f(CWinsert_head\fP".IX Subsection "insert_head"Insert a list of buckets at the front of a brigade.PP.Vb 1\&  $bb\->insert_head($b);.Ve.ie n .IP "obj: $bb\fR ( \f(CW""APR::Brigade object"" )" 4.el .IP "obj: \f(CW$bb\fR ( \f(CWAPR::Brigade object\fR )" 4.IX Item "obj: $bb ( APR::Brigade object )"Brigade to insert into.ie n .IP "arg1: $b\fR ( \f(CW""APR::Bucket object"" )" 4.el .IP "arg1: \f(CW$b\fR ( \f(CWAPR::Bucket object\fR )" 4.IX Item "arg1: $b ( APR::Bucket object )"the bucket to insert. More buckets could be attached to that bucket..IP "ret: no return value" 4.IX Item "ret: no return value".PD 0.IP "since: 2.0.00" 4.IX Item "since: 2.0.00".PD.ie n .Sh """insert_tail""".el .Sh "\f(CWinsert_tail\fP".IX Subsection "insert_tail"Insert a list of buckets at the end of a brigade.PP.Vb 1\&  $bb\->insert_tail($b);.Ve.ie n .IP "obj: $bb\fR ( \f(CW""APR::Brigade object"" )" 4.el .IP "obj: \f(CW$bb\fR ( \f(CWAPR::Brigade object\fR )" 4.IX Item "obj: $bb ( APR::Brigade object )"Brigade to insert into.ie n .IP "arg1: $b\fR ( \f(CW""APR::Bucket object"" )" 4.el .IP "arg1: \f(CW$b\fR ( \f(CWAPR::Bucket object\fR )" 4.IX Item "arg1: $b ( APR::Bucket object )"the bucket to insert. More buckets could be attached to that bucket..IP "ret: no return value" 4.IX Item "ret: no return value".PD 0.IP "since: 2.0.00" 4.IX Item "since: 2.0.00".PD.ie n .Sh """last""".el .Sh "\f(CWlast\fP".IX Subsection "last"Return the last bucket in the brigade.PP.Vb 1\&  $b_last = $bb\->last;.Ve.ie n .IP "obj: $bb\fR ( \f(CW""APR::Brigade object"" )" 4.el .IP "obj: \f(CW$bb\fR ( \f(CWAPR::Brigade object\fR )" 4.IX Item "obj: $bb ( APR::Brigade object )".PD 0.ie n .IP "ret: $b_last\fR ( \f(CW""APR::Bucket object"" )" 4.el .IP "ret: \f(CW$b_last\fR ( \f(CWAPR::Bucket object\fR )" 4.IX Item "ret: $b_last ( APR::Bucket object )".PDThe last bucket in the bucket brigade \f(CW$bb\fR..Sp\&\f(CW\*(C`undef\*(C'\fR is returned if there are no buckets in \f(CW$bb\fR..IP "since: 2.0.00" 4.IX Item "since: 2.0.00".ie n .Sh """length""".el .Sh "\f(CWlength\fP".IX Subsection "length"Return the total length of the data in the brigade (not the number ofbuckets).PP.Vb 1\&  $len = $bb\->length;.Ve.ie n .IP "obj: $bb\fR ( \f(CW""APR::Brigade object"" )" 4.el .IP "obj: \f(CW$bb\fR ( \f(CWAPR::Brigade object\fR )" 4.IX Item "obj: $bb ( APR::Brigade object )".PD 0.ie n .IP "ret: $len ( number )" 4.el .IP "ret: \f(CW$len\fR ( number )" 4.IX Item "ret: $len ( number )".IP "since: 2.0.00" 4.IX Item "since: 2.0.00".PD.ie n .Sh """new""".el .Sh "\f(CWnew\fP".IX Subsection "new".Vb 2\&  my $nbb = APR::Brigade\->new($p, $bucket_alloc);\&  my $nbb =          $bb\->new($p, $bucket_alloc);.Ve.ie n .IP "obj: $bb\fR ( \f(CW""APR::Brigade object or class"" )" 4.el .IP "obj: \f(CW$bb\fR ( \f(CWAPR::Brigade object or class\fR )" 4.IX Item "obj: $bb ( APR::Brigade object or class )".PD 0.ie n .IP "arg1: $p\fR ( \f(CW""APR::Pool object"" )" 4.el .IP "arg1: \f(CW$p\fR ( \f(CWAPR::Pool object\fR )" 4.IX Item "arg1: $p ( APR::Pool object )".ie n .IP "arg2: $bucket_alloc\fR ( \f(CW""APR::BucketAlloc object"" )" 4.el .IP "arg2: \f(CW$bucket_alloc\fR ( \f(CWAPR::BucketAlloc object\fR )" 4.IX Item "arg2: $bucket_alloc ( APR::BucketAlloc object )".ie n .IP "ret: $nbb\fR ( \f(CW""APR::Brigade object"" )" 4.el .IP "ret: \f(CW$nbb\fR ( \f(CWAPR::Brigade object\fR )" 4.IX Item "ret: $nbb ( APR::Brigade object )".PDa newly created bucket brigade object.IP "since: 2.0.00" 4.IX Item "since: 2.0.00".PPExample:.PPCreate a new bucket brigade, using the request object's pool:.PP.Vb 4\&  use Apache2::Connection ();\&  use Apache2::RequestRec ();\&  use APR::Brigade ();\&  my $bb = APR::Brigade\->new($r\->pool, $r\->connection\->bucket_alloc);.Ve.ie n .Sh """bucket_alloc""".el .Sh "\f(CWbucket_alloc\fP".IX Subsection "bucket_alloc"Get the bucket allocator associated with this brigade..PP.Vb 1\&  my $ba = $bb\->bucket_alloc();.Ve.ie n .IP "obj: $bb\fR ( \f(CW""APR::Brigade object or class"" )" 4.el .IP "obj: \f(CW$bb\fR ( \f(CWAPR::Brigade object or class\fR )" 4.IX Item "obj: $bb ( APR::Brigade object or class )".PD 0.ie n .IP "ret: $ba\fR ( \f(CW""APR::BucketAlloc object"" )" 4.el .IP "ret: \f(CW$ba\fR ( \f(CWAPR::BucketAlloc object\fR )" 4.IX Item "ret: $ba ( APR::BucketAlloc object )".IP "since: 2.0.00" 4.IX Item "since: 2.0.00".PD.ie n .Sh """next""".el .Sh "\f(CWnext\fP".IX Subsection "next"Return the next bucket in a brigade.PP.Vb 1\&  $b_next = $bb\->next($b);.Ve.ie n .IP "obj: $bb\fR ( \f(CW""APR::Brigade object"" )" 4.el .IP "obj: \f(CW$bb\fR ( \f(CWAPR::Brigade object\fR )" 4.IX Item "obj: $bb ( APR::Brigade object )".PD 0.ie n .IP "arg1: $b\fR ( \f(CW""APR::Bucket object"" )" 4.el .IP "arg1: \f(CW$b\fR ( \f(CWAPR::Bucket object\fR )" 4.IX Item "arg1: $b ( APR::Bucket object )".PDThe bucket after which the next bucket \f(CW$b_next\fR is located.ie n .IP "ret: $b_next\fR ( \f(CW""APR::Bucket object"" )" 4.el .IP "ret: \f(CW$b_next\fR ( \f(CWAPR::Bucket object\fR )" 4.IX Item "ret: $b_next ( APR::Bucket object )"The next bucket after bucket \f(CW$b\fR..Sp\&\f(CW\*(C`undef\*(C'\fR is returned if there is no next bucket (i.e. \f(CW$b\fR is thelast bucket)..IP "since: 2.0.00" 4.IX Item "since: 2.0.00".ie n .Sh """pool""".el .Sh "\f(CWpool\fP".IX Subsection "pool"The pool the brigade is associated with..PP.Vb 1\&  $pool = $bb\->pool;.Ve.ie n .IP "obj: $bb\fR ( \f(CW""APR::Brigade object"" )" 4.el .IP "obj: \f(CW$bb\fR ( \f(CWAPR::Brigade object\fR )" 4.IX Item "obj: $bb ( APR::Brigade object )".PD 0.ie n .IP "ret: $pool\fR ( \f(CW""APR::Pool object"" )" 4.el .IP "ret: \f(CW$pool\fR ( \f(CWAPR::Pool object\fR )" 4.IX Item "ret: $pool ( APR::Pool object )".IP "since: 2.0.00" 4.IX Item "since: 2.0.00".PD.PPThe data is not allocated out of the pool, but a cleanup is registeredwith this pool.  If the brigade is destroyed by some mechanism otherthan pool destruction, the destroying function is responsible forkilling the registered cleanup..ie n .Sh """prev""".el .Sh "\f(CWprev\fP".IX Subsection "prev"Return the previous bucket in the brigade.PP.Vb 1\&  $b_prev = $bb\->prev($b);.Ve.ie n .IP "obj: $bb\fR ( \f(CW""APR::Brigade object"" )" 4.el .IP "obj: \f(CW$bb\fR ( \f(CWAPR::Brigade object\fR )" 4.IX Item "obj: $bb ( APR::Brigade object )".PD 0.ie n .IP "arg1: $b\fR ( \f(CW""APR::Bucket object"" )" 4.el .IP "arg1: \f(CW$b\fR ( \f(CWAPR::Bucket object\fR )" 4.IX Item "arg1: $b ( APR::Bucket object )".PDThe bucket located after bucket \f(CW$b_prev\fR.ie n .IP "ret: $b_prev\fR ( \f(CW""APR::Bucket object"" )" 4.el .IP "ret: \f(CW$b_prev\fR ( \f(CWAPR::Bucket object\fR )" 4.IX Item "ret: $b_prev ( APR::Bucket object )"The bucket located before bucket \f(CW$b\fR..Sp\&\f(CW\*(C`undef\*(C'\fR is returned if there is no previous bucket (i.e. \f(CW$b\fR is thefirst bucket)..IP "since: 2.0.00" 4.IX Item "since: 2.0.00".ie n .Sh """split""".el .Sh "\f(CWsplit\fP".IX Subsection "split"Split a bucket brigade into two, such that the given bucket is thefirst in the new bucket brigade..PP.Vb 1\&  $bb2 = $bb\->split($b);.Ve.ie n .IP "obj: $bb\fR ( \f(CW""APR::Brigade object"" )" 4.el .IP "obj: \f(CW$bb\fR ( \f(CWAPR::Brigade object\fR )" 4.IX Item "obj: $bb ( APR::Brigade object )"The brigade to split.ie n .IP "arg1: $b\fR ( \f(CW""APR::Bucket object"" )" 4.el .IP "arg1: \f(CW$b\fR ( \f(CWAPR::Bucket object\fR )" 4.IX Item "arg1: $b ( APR::Bucket object )"The first bucket of the new brigade.ie n .IP "ret: $bb2\fR ( \f(CW""APR::Brigade object"" )" 4.el .IP "ret: \f(CW$bb2\fR ( \f(CWAPR::Brigade object\fR )" 4.IX Item "ret: $bb2 ( APR::Brigade object )"The new brigade..IP "since: 2.0.00" 4.IX Item "since: 2.0.00".PPThis function is useful when a filter wants to pass only the initialpart of a brigade to the next filter..PPExample:.PPCreate a bucket brigade with three buckets, and split it into twobrigade such that the second brigade will have the last two buckets..PP.Vb 5\&  my $bb1 = APR::Brigade\->new($r\->pool, $c\->bucket_alloc);\&  my $ba  = $c\->bucket_alloc();\&  $bb1\->insert_tail(APR::Bucket\->new($ba, "1"));\&  $bb1\->insert_tail(APR::Bucket\->new($ba, "2"));\&  $bb1\->insert_tail(APR::Bucket\->new($ba, "3"));.Ve.PP\&\f(CW$bb1\fR now contains buckets \*(L"1\*(R", \*(L"2\*(R", \*(L"3\*(R". Now do the split at thesecond bucket:.PP.Vb 3\&  my $b = $bb1\->first; # 1\&  $b = $bb1\->next($b); # 2\&  my $bb2 = $bb1\->split($b);.Ve.PPNow \f(CW$bb1\fR contains bucket \*(L"1\*(R".  \f(CW$bb2\fR contains buckets: \*(L"2\*(R", \*(L"3\*(R".SH "See Also".IX Header "See Also"mod_perl 2.0 documentation..SH "Copyright".IX Header "Copyright"mod_perl 2.0 and its core modules are copyrighted underThe Apache Software License, Version 2.0..SH "Authors".IX Header "Authors"The mod_perl development team and numerouscontributors.

⌨️ 快捷键说明

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