📄 ebbuff.html
字号:
<html>
<head>
<!-- E:/eybuild/doc/export//ebbuff.html - generated by refgen from ebbuff.c -->
<title> ebbuff </title>
</head>
<body bgcolor="#FFFFFF"> <hr>
<a name="top"></a>
<p align=right>
<a href="libIndex.htm"><i>eyBuildLib API Reference : eyBuildLib</i></a></p>
</blockquote><h1>ebbuff</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>
<p><strong>ebbuff</strong> - a high efficiency I/O buffer for CSP </p>
</blockquote><h4>ROUTINES</h4><blockquote><p>
<p>
<b><a href="./ebbuff.html#ebBufTlvAdd">ebBufTlvAdd</a>( )</b> - add data to tlv buffer<br>
<b><a href="./ebbuff.html#ebBufReset">ebBufReset</a>( )</b> - reset the state to initialization state<br>
<b><a href="./ebbuff.html#ebBufCreate">ebBufCreate</a>( )</b> - allocate a new tlv buffer then init it<br>
<b><a href="./ebbuff.html#ebBufDistroy">ebBufDistroy</a>( )</b> - free eybuild buffer<br>
<b><a href="./ebbuff.html#ebBufResize">ebBufResize</a>( )</b> - change tlv buffer size to new size<br>
<b><a href="./ebbuff.html#ebBufIsAutoFlush">ebBufIsAutoFlush</a>( )</b> - check allow auto flush or not<br>
<b><a href="./ebbuff.html#ebSetBufAutoFlush">ebSetBufAutoFlush</a>( )</b> - set allow auto flush or not<br>
<b><a href="./ebbuff.html#ebGetBufRemain">ebGetBufRemain</a>( )</b> - get the remain size for data write to avaiable<br>
<b><a href="./ebbuff.html#ebBufFlush">ebBufFlush</a>( )</b> - flush eybuild buffer<br>
<b><a href="./ebbuff.html#ebBufIsFlushed">ebBufIsFlushed</a>( )</b> - check buffer ever flushed or not<br>
<b><a href="./ebbuff.html#ebCheckBufSize">ebCheckBufSize</a>( )</b> - check tlv buffer size<br>
<b><a href="./ebbuff.html#ebBufStringAdd">ebBufStringAdd</a>( )</b> - add a const string to the eybuild buffer<br>
<b><a href="./ebbuff.html#ebprintf">ebprintf</a>( )</b> - write a formatted string to the eybuild buffer<br>
<b><a href="./ebbuff.html#ebvprintf">ebvprintf</a>( )</b> - write a formatted string to the eybuild buffer<br>
<b><a href="./ebbuff.html#ebWriteBlock">ebWriteBlock</a>( )</b> - write binary data block<br>
<p>
</blockquote><h4>DESCRIPTION</h4><blockquote><p>
This module provided a high efficiency I/O buffer. It will be used by
CSP page to buffering data, which is outputed by <b><a href="./ebbuff.html#ebprintf">ebprintf</a>( )</b>, <b>ebEvaluate( )</b>
<b><a href="./ebbuff.html#ebBufStringAdd">ebBufStringAdd</a>( )</b>.
<p>
User can call <b><a href="./ebbuff.html#ebBufIsAutoFlush">ebBufIsAutoFlush</a>( )</b>, <b><a href="./ebbuff.html#ebGetBufRemain">ebGetBufRemain</a>( )</b>, <b><a href="./ebbuff.html#ebCheckBufSize">ebCheckBufSize</a>( )</b> to get
current buffer properties; User can call <b><a href="./ebbuff.html#ebBufResize">ebBufResize</a>( )</b>, <b><a href="./ebbuff.html#ebSetBufAutoFlush">ebSetBufAutoFlush</a>( )</b>,
<b><a href="./ebbuff.html#ebBufFlush">ebBufFlush</a>( )</b>, <b><a href="./ebbuff.html#ebBufReset">ebBufReset</a>( )</b> to set buffer properties; User can call <b><a href="./ebbuff.html#ebprintf">ebprintf</a>( )</b>,
<b><a href="./ebbuff.html#ebBufStringAdd">ebBufStringAdd</a>( )</b>, <b>ebEvaluate( )</b> add data to buffer.
<p>
When you call <b><a href="./ebrespond.html#ebHeader">ebHeader</a>( )</b>, <b><a href="./ebrespond.html#ebRedirect">ebRedirect</a>( )</b>, it will check the buffer state.
If has data flushed before, they will return ERROR. Because those data
should be output before CSP page data output.
<p>
Usually user needn't call <b><a href="./ebbuff.html#ebBufCreate">ebBufCreate</a>( )</b>, <b><a href="./ebbuff.html#ebBufDistroy">ebBufDistroy</a>( )</b> to create and
distory a CSP page buffer.
<p>
</blockquote><h4>INCLUDE</h4><blockquote><p>
<b>ebbuff.h</b>
<p>
</blockquote><h4>ALSO SEE</h4><blockquote><p>
<p>
<b>snprintf( )</b>
<hr>
<a name="ebBufTlvAdd"></a>
<p align=right>
<a href="rtnIndex.htm"><i>eyBuildLib : Routines</i></a></p>
</blockquote><h1>ebBufTlvAdd( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>
<p><strong>ebBufTlvAdd( )</strong> - add data to tlv buffer</p>
</blockquote><h4>SYNOPSIS</h4><blockquote><p>
<pre>int ebBufTlvAdd
(
void * ebfp,
int type,
int len,
char * pdata
)
</pre>
</blockquote><h4>DESCRIPTION</h4><blockquote><p>
this routine will add data to tlv buffer and let current tlv pointer
pointer to next tlv.
Before call it, you should call <b><a href="./ebbuff.html#ebCheckBufSize">ebCheckBufSize</a>( )</b> to check the buffer
size if longer enough.
<p>
</blockquote><h4>RETURNS</h4><blockquote><p>
OK/ERROR
</blockquote><h4>SEE ALSO</h4><blockquote><p>
<b><a href="./ebbuff.html#top">ebbuff</a></b>
<hr>
<a name="ebBufReset"></a>
<p align=right>
<a href="rtnIndex.htm"><i>eyBuildLib : Routines</i></a></p>
</blockquote><h1>ebBufReset( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>
<p><strong>ebBufReset( )</strong> - reset the state to initialization state</p>
</blockquote><h4>SYNOPSIS</h4><blockquote><p>
<pre>int ebBufReset
(
void * ebfp
)
</pre>
</blockquote><h4>DESCRIPTION</h4><blockquote><p>
</blockquote><h4>RETURNS</h4><blockquote><p>
OK/ERROR
</blockquote><h4>SEE ALSO</h4><blockquote><p>
<b><a href="./ebbuff.html#top">ebbuff</a></b>
<hr>
<a name="ebBufCreate"></a>
<p align=right>
<a href="rtnIndex.htm"><i>eyBuildLib : Routines</i></a></p>
</blockquote><h1>ebBufCreate( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>
<p><strong>ebBufCreate( )</strong> - allocate a new tlv buffer then init it</p>
</blockquote><h4>SYNOPSIS</h4><blockquote><p>
<pre>void * ebBufCreate
(
int size
)
</pre>
</blockquote><h4>DESCRIPTION</h4><blockquote><p>
</blockquote><h4>RETURNS</h4><blockquote><p>
the descriptor of new this new buffer, or NULL if error
</blockquote><h4>SEE ALSO</h4><blockquote><p>
<b><a href="./ebbuff.html#top">ebbuff</a></b>
<hr>
<a name="ebBufDistroy"></a>
<p align=right>
<a href="rtnIndex.htm"><i>eyBuildLib : Routines</i></a></p>
</blockquote><h1>ebBufDistroy( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>
<p><strong>ebBufDistroy( )</strong> - free eybuild buffer</p>
</blockquote><h4>SYNOPSIS</h4><blockquote><p>
<pre>void ebBufDistroy
(
void * ebfp
)
</pre>
</blockquote><h4>DESCRIPTION</h4><blockquote><p>
this routine will not auto flush data in buffer, so before call
function you shoud call <b><a href="./ebbuff.html#ebBufFlush">ebBufFlush</a>( )</b> manually to flush data.
<p>
</blockquote><h4>RETURNS</h4><blockquote><p>
NONE
</blockquote><h4>SEE ALSO</h4><blockquote><p>
<b><a href="./ebbuff.html#top">ebbuff</a></b>
<hr>
<a name="ebBufResize"></a>
<p align=right>
<a href="rtnIndex.htm"><i>eyBuildLib : Routines</i></a></p>
</blockquote><h1>ebBufResize( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>
<p><strong>ebBufResize( )</strong> - change tlv buffer size to new size</p>
</blockquote><h4>SYNOPSIS</h4><blockquote><p>
<pre>int ebBufResize
(
void * ebfp,
int size
)
</pre>
</blockquote><h4>DESCRIPTION</h4><blockquote><p>
this routine will not flush the original data, but copy to the new buffer
if no enough dynamic memory will return ERROR
<p>
</blockquote><h4>RETURNS</h4><blockquote><p>
OK/ERROR
</blockquote><h4>SEE ALSO</h4><blockquote><p>
<b><a href="./ebbuff.html#top">ebbuff</a></b>
<hr>
<a name="ebBufIsAutoFlush"></a>
<p align=right>
<a href="rtnIndex.htm"><i>eyBuildLib : Routines</i></a></p>
</blockquote><h1>ebBufIsAutoFlush( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>
<p><strong>ebBufIsAutoFlush( )</strong> - check allow auto flush or not</p>
</blockquote><h4>SYNOPSIS</h4><blockquote><p>
<pre>int ebBufIsAutoFlush
(
void * ebfp
)
</pre>
</blockquote><h4>DESCRIPTION</h4><blockquote><p>
</blockquote><h4>RETURNS</h4><blockquote><p>
TRUE/FALSE
</blockquote><h4>SEE ALSO</h4><blockquote><p>
<b><a href="./ebbuff.html#top">ebbuff</a></b>
<hr>
<a name="ebSetBufAutoFlush"></a>
<p align=right>
<a href="rtnIndex.htm"><i>eyBuildLib : Routines</i></a></p>
</blockquote><h1>ebSetBufAutoFlush( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>
<p><strong>ebSetBufAutoFlush( )</strong> - set allow auto flush or not</p>
</blockquote><h4>SYNOPSIS</h4><blockquote><p>
<pre>int ebSetBufAutoFlush
(
void * ebfp, /* eybuild buffer descriptor */
BOOL autoflush
)
</pre>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -