Formatting
This commit is contained in:
parent
db38111b3c
commit
d19917bba7
1 changed files with 8 additions and 6 deletions
14
ringbuf.h
14
ringbuf.h
|
@ -39,6 +39,7 @@ enum ReadResult { Empty, ReadOk }; /** Result of a read */
|
||||||
void rb_init(struct RingBuf *rb, rb_size_t capacity, ALLOC_T alloc,
|
void rb_init(struct RingBuf *rb, rb_size_t capacity, ALLOC_T alloc,
|
||||||
rb_size_t struct_size);
|
rb_size_t struct_size);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Insert data to the ring buffer
|
* @brief Insert data to the ring buffer
|
||||||
* @param rb The ring buffer
|
* @param rb The ring buffer
|
||||||
|
@ -51,17 +52,17 @@ enum WriteResult rb_push_back(struct RingBuf *rb, const void *item,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Insert multiple data to the ring buffer
|
* @brief Insert multiple data to the ring buffer
|
||||||
*
|
*
|
||||||
* @details This function is more efficient than calling rb_push_back multiple
|
* @details This function is more efficient than calling rb_push_back multiple
|
||||||
* times. It only advances the write head once, and attempts to write all the
|
* times. It only advances the write head once, and attempts to write all the
|
||||||
* memory in one go.
|
* memory in one go.
|
||||||
*
|
*
|
||||||
* If n is greater than the capacity, it will return Full.
|
* If n is greater than the capacity, it will return Full.
|
||||||
* If the full write will overflow, it will wrap around.
|
* If the full write will overflow, it will wrap around.
|
||||||
*
|
*
|
||||||
* If the buffer is full, it will return Full and not write
|
* If the buffer is full, it will return Full and not write
|
||||||
* anything.
|
* anything.
|
||||||
*
|
*
|
||||||
* @param rb The ring buffer
|
* @param rb The ring buffer
|
||||||
* @param items The items to insert
|
* @param items The items to insert
|
||||||
* @param memcpy_fn The memcpy function
|
* @param memcpy_fn The memcpy function
|
||||||
|
@ -77,7 +78,8 @@ enum WriteResult rb_push_many(struct RingBuf *rb, const void *items,
|
||||||
* @param item The item to read into
|
* @param item The item to read into
|
||||||
* @return ReadResult
|
* @return ReadResult
|
||||||
*/
|
*/
|
||||||
enum ReadResult rb_pop_front(struct RingBuf *rb, void *item, MEMCPY_T memcpy_fn);
|
enum ReadResult rb_pop_front(struct RingBuf *rb, void *item,
|
||||||
|
MEMCPY_T memcpy_fn);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Free the ring buffer
|
* @brief Free the ring buffer
|
||||||
|
|
Loading…
Reference in a new issue