<trclass="memdesc:ga2460ea15a51a37433b5f2e1503667e8f"><tdclass="mdescLeft"> </td><tdclass="mdescRight">The name used everywhere. <ahref="#ga2460ea15a51a37433b5f2e1503667e8f"></a><br/></td></tr>
<trclass="memdesc:ga55e468b36750f28308b7fa5dfea5b564"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Create a new buffer. <ahref="#ga55e468b36750f28308b7fa5dfea5b564"></a><br/></td></tr>
<trclass="memdesc:ga770f9c4e3caf1bcf315666a56312246f"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Create a new string buffer. <ahref="#ga770f9c4e3caf1bcf315666a56312246f"></a><br/></td></tr>
<trclass="memdesc:ga924b013cdf1e6f7b38ba9d10b3b7112e"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Create a new buffer from existing data. <ahref="#ga924b013cdf1e6f7b38ba9d10b3b7112e"></a><br/></td></tr>
<trclass="memdesc:gaa1c00049898e0ea7d6570748bf9a0e9e"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Clears and frees the Buffer. <ahref="#gaa1c00049898e0ea7d6570748bf9a0e9e"></a><br/></td></tr>
<trclass="memdesc:ga96b992409df040ca36ac65c83c748e71"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Clears the Buffer. <ahref="#ga96b992409df040ca36ac65c83c748e71"></a><br/></td></tr>
<trclass="memdesc:gaf8731a858abb423ad9cbecc8666b79dd"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Put read offset back to start. <ahref="#gaf8731a858abb423ad9cbecc8666b79dd"></a><br/></td></tr>
<trclass="memdesc:ga17edc4ffe7ea459a42ffdd6540d5f213"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Add data to the buffer. <ahref="#ga17edc4ffe7ea459a42ffdd6540d5f213"></a><br/></td></tr>
<trclass="memdesc:gab3b5de7a9eb3cca96a9df0b8f90766eb"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Add data to the buffer. <ahref="#gab3b5de7a9eb3cca96a9df0b8f90766eb"></a><br/></td></tr>
<trclass="memdesc:ga5b99c0ae55b2e279339c745b6fd7bb21"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Add a formated string to the buffer. <ahref="#ga5b99c0ae55b2e279339c745b6fd7bb21"></a><br/></td></tr>
<trclass="memdesc:ga3a57658aba6c18d93219334b369e8663"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Add data as hex string to the buffer. <ahref="#ga3a57658aba6c18d93219334b369e8663"></a><br/></td></tr>
<trclass="memdesc:ga914506665c6fac92ccb17f92cefd0914"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Tell if there are no more bytes to read. <ahref="#ga914506665c6fac92ccb17f92cefd0914"></a><br/></td></tr>
<trclass="memdesc:gaddf2e52378c6cd765b940617cdef2bd2"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Read some chunk of data from the Buffer. <ahref="#gaddf2e52378c6cd765b940617cdef2bd2"></a><br/></td></tr>
<trclass="memdesc:ga8c89e4ab5d03dff079b7b861a1e04a7f"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Read the whole Buffer content as string. <ahref="#ga8c89e4ab5d03dff079b7b861a1e04a7f"></a><br/></td></tr>
<trclass="memdesc:gaeafab0893e204b624eb5181954cbc9ca"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Read the remaining data after current read offset. <ahref="#gaeafab0893e204b624eb5181954cbc9ca"></a><br/></td></tr>
<trclass="memdesc:gab91a95b51ecfa067bdcca086f7afe4e4"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Read some data inside the Buffer. <ahref="#gab91a95b51ecfa067bdcca086f7afe4e4"></a><br/></td></tr>
<trclass="memdesc:ga0e0f433cbd077d3048ebdda35aa9ccb6"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Dump the Buffer contents to stderr in hex form. <ahref="#ga0e0f433cbd077d3048ebdda35aa9ccb6"></a><br/></td></tr>
<trclass="memdesc:ga714b0a831d0f31a33e66e8ef76a26e46"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Tell how much data there is in the buffer available. <ahref="#ga714b0a831d0f31a33e66e8ef76a26e46"></a><br/></td></tr>
<trclass="memdesc:gaedba431c6b8e302e0d94cd9fafc3d292"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Tell how much data is left to read in the Buffer. <ahref="#gaedba431c6b8e302e0d94cd9fafc3d292"></a><br/></td></tr>
<trclass="memdesc:gae6a7aec563f6d66a94abc1fd3e10bf1e"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Read 1 byte (8 bit) number from a Buffer. <ahref="#gae6a7aec563f6d66a94abc1fd3e10bf1e"></a><br/></td></tr>
<trclass="memdesc:ga5b9bd1a6b474438db8cf4901ed750b92"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Read 2 bytes (16 bit) number from a Buffer. <ahref="#ga5b9bd1a6b474438db8cf4901ed750b92"></a><br/></td></tr>
<trclass="memdesc:ga42354f61519e2c7d6ae81a695f36d580"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Read 4 byte (32 bit) number from a Buffer. <ahref="#ga42354f61519e2c7d6ae81a695f36d580"></a><br/></td></tr>
<trclass="memdesc:gaf4da4b1c370490997c9d7103cfd20a83"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Read 8 byte (64 bit) from a Buffer. <ahref="#gaf4da4b1c370490997c9d7103cfd20a83"></a><br/></td></tr>
<trclass="memdesc:ga1d71a1ae861f7d9763f8f59ca317ad49"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Read 2 bytes (16 bit) number from a Buffer, converted to host endian. <ahref="#ga1d71a1ae861f7d9763f8f59ca317ad49"></a><br/></td></tr>
<trclass="memdesc:ga46f10bed24ace6987844d4b12b39362f"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Read 4 byte (32 bit) number from a Buffer, converted to host endian. <ahref="#ga46f10bed24ace6987844d4b12b39362f"></a><br/></td></tr>
<trclass="memdesc:ga3c32fbab871258600bbdc848358c28cb"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Read 8 byte (64 bit) from a Buffer, converted to host endian. <ahref="#ga3c32fbab871258600bbdc848358c28cb"></a><br/></td></tr>
<trclass="memdesc:ga29dc7e7f34028600a92f8b85c8f94c38"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Read the last 1 byte (8 bit) number from a Buffer. <ahref="#ga29dc7e7f34028600a92f8b85c8f94c38"></a><br/></td></tr>
<trclass="memdesc:ga32959cf4cfad7c456e46fa93175508e4"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Read the last 2 byte (16 bit) number from a Buffer. <ahref="#ga32959cf4cfad7c456e46fa93175508e4"></a><br/></td></tr>
<trclass="memdesc:gafe524705c638959590e08ed3f63da37e"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Read the last 4 byte (32 bit) number from a Buffer. <ahref="#gafe524705c638959590e08ed3f63da37e"></a><br/></td></tr>
<trclass="memdesc:ga48e50f95c09c029c265c37f2af7755f3"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Read the last 8 byte (64 bit) number from a Buffer. <ahref="#ga48e50f95c09c029c265c37f2af7755f3"></a><br/></td></tr>
<trclass="memdesc:ga2330b241d4fd267d193b05b508035935"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Read data from a file directly into a Buffer. <ahref="#ga2330b241d4fd267d193b05b508035935"></a><br/></td></tr>
<trclass="memdesc:ga9125df8f37c49ae4443364acf711ae36"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Write a 1 byte (8 bit) number in binary form into the buffer. <ahref="#ga9125df8f37c49ae4443364acf711ae36"></a><br/></td></tr>
<trclass="memdesc:ga5f1e47affe629232ebdabb1070f9c8c6"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Write a 2 byte (16 bit) number in binary form into the buffer. <ahref="#ga5f1e47affe629232ebdabb1070f9c8c6"></a><br/></td></tr>
<trclass="memdesc:ga2f36174e848271c8b0c525ea36d884fa"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Write a 4 byte (32 bit) number in binary form into the buffer. <ahref="#ga2f36174e848271c8b0c525ea36d884fa"></a><br/></td></tr>
<trclass="memdesc:ga4d37d8261c678d747472e47b30c6299f"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Write a 8 byte (64 bit) number in binary form into the buffer. <ahref="#ga4d37d8261c678d747472e47b30c6299f"></a><br/></td></tr>
<trclass="memdesc:gab2141b987b8eb383da3f336f285384c5"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Write a 2 byte (16 bit) number in binary form into the buffer, converted to big endian. <ahref="#gab2141b987b8eb383da3f336f285384c5"></a><br/></td></tr>
<trclass="memdesc:ga601c4d9cd62c52639f0536524830dfa5"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Write a 4 byte (32 bit) number in binary form into the buffer, converted to big endian. <ahref="#ga601c4d9cd62c52639f0536524830dfa5"></a><br/></td></tr>
<trclass="memdesc:ga6bbc5298e3c0a31eda31d48bfd63943a"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Write a 8 byte (64 bit) number in binary form into the buffer, converted to big endian. <ahref="#ga6bbc5298e3c0a31eda31d48bfd63943a"></a><br/></td></tr>
<p>Flexible buffer management, idea from openssh/buffer.c. </p>
<p>This class allows us to dissect buffers into parts at will whithout the hassle of boundary checking in each and every line. Therefore it is more secure, since this system wraps all this stuff from us, so in case we're attemt to overflow a buffer or the like, the buffer functions will catch this, warn us and die. </p>
<p>Adds data from the given Buffer src to the buffer and resizes the buffer, if neccessary. The write position ('end' field) will be updated accordingly.</p>
<p>Data will be copied, you can <aclass="el"href="group__Buffer.html#gaa1c00049898e0ea7d6570748bf9a0e9e"title="Clears and frees the Buffer.">buffer_free()</a> the given src Buffer after the copying.</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramdir">[out]</td><tdclass="paramname">dst</td><td>The destination Buffer object to copy data into.</td></tr>
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">src</td><td>The source Buffer object to copy data from. </td></tr>
<p>Adds data of the size len to the buffer and resizes the buffer, if neccessary. The write position ('end' field) will be updated accordingly. Each byte will be put in its HEX form into the buffer (%02x).</p>
<p>Data will be copied, you can free() the given pointer after copying..</p>
<p>Use printf() like syntax to add a formatted string to the buffer. Refer to the documentation of printf() for details.</p>
<p>Data will be copied, you can free() the given format string and params after copying.</p>
<p>Example: </p>
<divclass="fragment"><divclass="line"><aclass="code"href="struct__pcp__buffer.html"title="A flexible buffer object wich automatically resizes, if neccessary.">Buffer</a> *x = <aclass="code"href="group__Buffer.html#ga770f9c4e3caf1bcf315666a56312246f"title="Create a new string buffer.">buffer_new_str</a>(<spanclass="stringliteral">"test"</span>);</div>
<divclass="line"><aclass="code"href="group__Buffer.html#ga5b99c0ae55b2e279339c745b6fd7bb21"title="Add a formated string to the buffer.">buffer_add_str</a>(x, <spanclass="stringliteral">"There are %d elements left in %s\n"</span>, 4, <spanclass="stringliteral">"list"</span>);</div>
</div><!-- fragment --><dlclass="params"><dt>Parameters</dt><dd>
<p>This clears the buffer by filling it with zeroes and resetting all counters. Memory will not be free'd. Called from <aclass="el"href="group__Buffer.html#gaa1c00049898e0ea7d6570748bf9a0e9e"title="Clears and frees the Buffer.">buffer_free()</a> before free'ing memory.</p>
<p>Same as <aclass="el"href="group__Buffer.html#ga4411acab20dfabc5834fe11322bee661"title="Read the whole Buffer content.">buffer_get()</a> but fetch some data chunk from somewhere in the middle of the buffer.</p>
<p>The returned pointer has to be allocated by the caller to at least a size of len bytes.</p>
<p>The read offset will be left untouched by this function.</p>
<p>Example: suppose you've got a buffer with the following content:</p>
<divclass="line"><aclass="code"href="group__Buffer.html#gab91a95b51ecfa067bdcca086f7afe4e4"title="Read some data inside the Buffer.">buffer_extract</a>(b, g, 4, 4); <spanclass="comment">// => g now contains 'BBBB'</span></div>
</div><!-- fragment --><dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">b</td><td>The Buffer object to read from.</td></tr>
<tr><tdclass="paramdir">[out]</td><tdclass="paramname">buf</td><td>The buffer to copy data to.</td></tr>
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">offset</td><td>Where to start copying.</td></tr>
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">len</td><td>How mush data to copy.</td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>Returns the size of bytes read. Returns 0 in case of an overflow, which can be catched with <aclass="el"href="group__FATALS.html#ga0ea01da59af8a06c55258d78da6cb0cb"title="Prints error messages to STDERR, if there are some.">fatals_ifany()</a>. </dd></dl>
<p>Read data from a file directly into a Buffer. </p>
<p>This function reads in len bytes from the FILE stream 'in' into the Buffer. The file must already be opened by the caller.</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramdir">[in,out]</td><tdclass="paramname">b</td><td>The Buffer object to read from.</td></tr>
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">in</td><td>The FILE stream to read from.</td></tr>
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">len</td><td>The number of bytes to read.</td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>Returns the number of bytes read or 0 in case of an error or EOF. Use feof() and ferror() to check this afterwards, call <aclass="el"href="group__FATALS.html#ga0ea01da59af8a06c55258d78da6cb0cb"title="Prints error messages to STDERR, if there are some.">fatals_ifany()</a> in case of errors. </dd></dl>
<p>This clears the buffer by filling it with zeroes and frees any allocated memory, including the Buffer object itself. Use this function instead of directly calling free(Buffer).</p>
<p>This function returns the whole buffer contents as a pointer to the internal data member (Buffer->buf). The returned pointer is allocated and filled with data up to buffer_size(Buffer), however, the allocated memory might be more than size, in fact it will be a multitude of Buffer-blocksize.</p>
<p>Don't free() the pointer directly, use <aclass="el"href="group__Buffer.html#gaa1c00049898e0ea7d6570748bf9a0e9e"title="Clears and frees the Buffer.">buffer_free()</a> always.</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">b</td><td>The Buffer object to read from.</td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>Pointer to the buffer data storage. </dd></dl>
<p>Read the remaining data after current read offset. </p>
<p>Fetch whatever is left in the buffer. This works like <aclass="el"href="group__Buffer.html#ga4411acab20dfabc5834fe11322bee661"title="Read the whole Buffer content.">buffer_get()</a> but instead doesn't return everything, but only the part of the buffer, which follows after the current read offset.</p>
<p>The returned pointer will be allocated by <aclass="el"href="group__Buffer.html#gaeafab0893e204b624eb5181954cbc9ca"title="Read the remaining data after current read offset.">buffer_get_remainder()</a> with a size of <aclass="el"href="group__Buffer.html#gaedba431c6b8e302e0d94cd9fafc3d292"title="Tell how much data is left to read in the Buffer.">buffer_left()</a>. It's up to the caller to free() the returned pointer later on.</p>
<p>Example: suppose you've got a buffer with the following content:</p>
<divclass="line"><aclass="code"href="group__Buffer.html#gaddf2e52378c6cd765b940617cdef2bd2"title="Read some chunk of data from the Buffer.">buffer_get_chunk</a>(b, g, 4); <spanclass="comment">// => g now contains 'AAAA'</span></div>
<divclass="line"><spanclass="keywordtype">size_t</span> rs = <aclass="code"href="group__Buffer.html#gaedba431c6b8e302e0d94cd9fafc3d292"title="Tell how much data is left to read in the Buffer.">buffer_left</a>(b); <spanclass="comment">// => rs = 8</span></div>
<divclass="line">r = <aclass="code"href="group__Buffer.html#gaeafab0893e204b624eb5181954cbc9ca"title="Read the remaining data after current read offset.">buffer_get_remainder</a>(b); <spanclass="comment">// => r now contains 'BBBBCCCC' and has a size of 8</span></div>
<p>Access the Buffer content as string (char *).</p>
<p>The returned pointer is allocated and filled with data up to buffer_size(Buffer), however, the allocated memory might be more than size, in fact it will be a multitude of Buffer-blocksize.</p>
<p>The byte after buffer_size(Buffer) will be a \0.</p>
<p>Don't free() the pointer directly, use <aclass="el"href="group__Buffer.html#gaa1c00049898e0ea7d6570748bf9a0e9e"title="Clears and frees the Buffer.">buffer_free()</a> always.</p>
<p>Sample usage:</p>
<divclass="fragment"><divclass="line">[..]</div>
<divclass="line">fprintf(stdout, <spanclass="stringliteral">"Our buffer content: %s\n"</span>, <aclass="code"href="group__Buffer.html#ga8c89e4ab5d03dff079b7b861a1e04a7f"title="Read the whole Buffer content as string.">buffer_get_str</a>(b));</div>
</div><!-- fragment --><dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">b</td><td>The Buffer object to read from.</td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>Pointer to the buffer data storage. </dd></dl>
<divclass="line"><aclass="code"href="group__Buffer.html#gaddf2e52378c6cd765b940617cdef2bd2"title="Read some chunk of data from the Buffer.">buffer_get_chunk</a>(b, g, 4); <spanclass="comment">// => g now contains 'BBBB'</span></div>
<divclass="line"><spanclass="keywordflow">if</span>(<aclass="code"href="group__Buffer.html#gaedba431c6b8e302e0d94cd9fafc3d292"title="Tell how much data is left to read in the Buffer.">buffer_left</a>(b) >= 16) <spanclass="comment">// => will return 8 and therefore fail</span></div>
<divclass="line"><aclass="code"href="group__Buffer.html#gaddf2e52378c6cd765b940617cdef2bd2"title="Read some chunk of data from the Buffer.">buffer_get_chunk</a>(b, x, 16);</div>
<p>Create a new buffer, initially alloc'd to blocksize and zero-filled.</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">blocksize</td><td>Initial blocksize. The smaller the more often the buffer will be resized. Choose with care.</td></tr>
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">name</td><td>A name for the Buffer. Just used for debugging purposes or in error messages.</td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>Returns a new Buffer object. </dd></dl>
<p>Create a new buffer, but don't allocate memory nor copy data. Instead the provided data pointer will be used as internal storage directly.</p>
<p>This kind of buffer can be used to put the Buffer API into use with existing data from other sources. In most cases you'll use it for reading. However, please be aware, that it can be used for writing as well and in this case the data pointer maybe resized (by calling realloc()).</p>
<p>When calling <aclass="el"href="group__Buffer.html#gaa1c00049898e0ea7d6570748bf9a0e9e"title="Clears and frees the Buffer.">buffer_free()</a> on this Buffer, the memory pointed to by the given data pointer will not be free'd and remains accessible. It's the responsibility of the caller to do so.</p>
<divclass="line">*rb = <aclass="code"href="group__Buffer.html#ga924b013cdf1e6f7b38ba9d10b3b7112e"title="Create a new buffer from existing data.">buffer_new_buf</a>(<spanclass="stringliteral">"r"</span>, r, rs);</div>
<divclass="line"><spanclass="keywordflow">while</span>(<aclass="code"href="group__Buffer.html#ga914506665c6fac92ccb17f92cefd0914"title="Tell if there are no more bytes to read.">buffer_done</a>(rb) != 1) {</div>
<divclass="line"><spanclass="keywordflow">if</span>(<aclass="code"href="group__Buffer.html#gaedba431c6b8e302e0d94cd9fafc3d292"title="Tell how much data is left to read in the Buffer.">buffer_left</a>(rb) < blocksize)</div>
<divclass="line"> blocksize = <aclass="code"href="group__Buffer.html#gaedba431c6b8e302e0d94cd9fafc3d292"title="Tell how much data is left to read in the Buffer.">buffer_left</a>(rb);</div>
<divclass="line"><aclass="code"href="group__Buffer.html#gaddf2e52378c6cd765b940617cdef2bd2"title="Read some chunk of data from the Buffer.">buffer_get_chunk</a>(rb, chunk, blocksize);</div>
<divclass="line"><aclass="code"href="group__UTILs.html#ga3dcb1fcb0f840869eab341598da50b55"title="Dump binary data as hex to stderr.">_dump</a>(<spanclass="stringliteral">"chunk"</span>, chunk, blocksize); <spanclass="comment">// or do something else with it</span></div>
<divclass="line">}</div>
<divclass="line"></div>
<divclass="line"><aclass="code"href="group__Buffer.html#gaa1c00049898e0ea7d6570748bf9a0e9e"title="Clears and frees the Buffer.">buffer_free</a>(rb);</div>
<divclass="line"></div>
<divclass="line">munmap(r, rs);</div>
<divclass="line">fclose(RFD);</div>
</div><!-- fragment --><dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">name</td><td>A name for the Buffer. Just used for debugging purposes or in error messages.</td></tr>
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">data</td><td>The data pointer to use by the buffer.</td></tr>
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">datasize</td><td>The size of the data.</td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>Returns a new Buffer object. </dd></dl>
<p>Create a new buffer, initially alloc'd to a blocksize of 32 bytes and zero-filled. The buffer will be a string buffer. See <aclass="el"href="group__Buffer.html#ga8c89e4ab5d03dff079b7b861a1e04a7f"title="Read the whole Buffer content as string.">buffer_get_str()</a>.</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">name</td><td>A name for the Buffer. Just used for debugging purposes or in error messages.</td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>Returns a new Buffer object. </dd></dl>
<p>Tell how much data there is in the buffer available. </p>
<p>This function returns the number of bytes stored in the buffer so far. Please note, that the actual allocation might be bigger, because we always allocate memory blockwise.</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">b</td><td>The Buffer object to get the size from.</td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>The number of bytes stored in the Buffer. </dd></dl>