added buffer_fwd_offset() so I don't have to alloc mem to ignore some chunk of a buffer

This commit is contained in:
git@daemon.de
2014-08-06 20:19:28 +02:00
parent 7542128486
commit a3f1bdaa2e
2 changed files with 24 additions and 0 deletions

View File

@@ -415,6 +415,17 @@ byte *buffer_get_remainder(Buffer *b);
*/
size_t buffer_extract(Buffer *b, void *buf, size_t offset, size_t len);
/** Forward read offset of given buffer. Use to ignore a couple of bytes.
\param[in] b The Buffer object to read from.
\param[in] fwdby Bytes to forward read offset.
\return Returns the size of bytes forwarded. Returns 0 in case of
an overflow, which can be catched with fatals_ifany().
*/
size_t buffer_fwd_offset(Buffer *b, size_t fwdby);
/** Dump the Buffer contents to stderr in hex form.
\param[in] b The Buffer object to dump.