#ifndef RBUF_RBUF_H_ #define RBUF_RBUF_H_ #include #include #include typedef struct { uint8_t *buffer; size_t tail; size_t head; size_t cap; size_t count; bool full; } RBuf; int32_t rbuf_push(RBuf *rbuf, uint8_t data); int32_t rbuf_pop(RBuf *rbuf, uint8_t *data); void rbuf_init(RBuf *rbuf, uint8_t *buf, size_t bufsize); #endif // RBUF_RBUF_H_