Change zap_buffer_read_loop() to always try to read the full amount of bytes we wanted to get; add zap_buffer_seek() to skip n bytes from the beginning of the buffer (zap_buffer_toss works relative to the current position only)

git-svn-id: http://svn.openzap.org/svn/openzap/trunk@539 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
Stefan Knoblich
2008-09-06 20:41:50 +00:00
parent 82318fc434
commit 081cc2e75b
2 changed files with 31 additions and 3 deletions

View File

@@ -122,6 +122,13 @@ void zap_buffer_zero(zap_buffer_t *buffer);
*/
void zap_buffer_destroy(zap_buffer_t **buffer);
/*! \brief Seek to offset from the beginning of the buffer
* \param buffer buffer to seek
* \param datalen offset in bytes
* \return new position
*/
zap_size_t zap_buffer_seek(zap_buffer_t *buffer, zap_size_t datalen);
/** @} */
zap_size_t zap_buffer_zwrite(zap_buffer_t *buffer, const void *data, zap_size_t datalen);