1 #ifndef EVE_RBUF_H_INCLUDED 2 #define EVE_RBUF_H_INCLUDED Structure that holds the state of a ring buffer.
void rbuf_commitwrite(struct rbuf_t *r, uint32_t l)
Advance the write pointer of the buffer after direct write. Note that length cannot be larger than th...
uint32_t rbuf_contfree(struct rbuf_t *r, uint8_t **ptr)
Get the length of a continuous free part of the buffer and a pointer to its beginning.
void rbuf_init(struct rbuf_t *r, uint8_t *a, uint32_t size)
Initialize a ring buffer.
uint32_t rbuf_free(struct rbuf_t *r)
Get the number of free bytes currently in the ring buffer.
bool rbuf_pull(struct rbuf_t *r, uint8_t *a, uint32_t l)
Get an array of bytes from the ring buffer.
bool rbuf_push(struct rbuf_t *r, const uint8_t *a, uint32_t l)
Put an array of bytes to the ring buffer.
uint32_t rbuf_size(struct rbuf_t *r)
Get the size of a ring buffer.
void rbuf_commitread(struct rbuf_t *r, uint32_t l)
Advance the read pointer of the buffer after direct read. Note that length cannot be larger than the ...
uint32_t rbuf_used(struct rbuf_t *r)
Get the number of bytes currently used in the ring buffer.
uint32_t rbuf_contused(struct rbuf_t *r, uint8_t **ptr)
Get the length of a continuous used part of the buffer and a pointer to its beginning.