7 #ifndef UBICLIB_CBUF_H_
8 #define UBICLIB_CBUF_H_
23 #include <ubinos_config.h>
45 #define cbuf_def_init(_name, _size) \
46 uint8_t _name##_cbuf_buf[_size]; \
47 cbuf_t _name##_cbuf = { \
51 .buf = _name##_cbuf_buf, \
53 cbuf_pt _name = &_name##_cbuf;
uint8_t cbuf_align_head(cbuf_pt cbuf, uint8_t align)
uint32_t cbuf_get_empty_len(cbuf_pt cbuf)
ubi_st_t cbuf_delete(cbuf_pt *cbuf_p)
ubi_st_t cbuf_view(cbuf_pt cbuf, uint8_t *buf, uint32_t len, uint32_t *read_p)
uint8_t * cbuf_get_tail_addr(cbuf_pt cbuf)
cbuf_t * cbuf_pt
Definition: cbuf.h:36
ubi_st_t cbuf_create(cbuf_pt *cbuf_p, uint32_t size)
uint32_t cbuf_get_len(cbuf_pt cbuf)
uint8_t * cbuf_get_head_addr(cbuf_pt cbuf)
ubi_st_t cbuf_clear(cbuf_pt cbuf)
ubi_st_t cbuf_read(cbuf_pt cbuf, uint8_t *buf, uint32_t len, uint32_t *read_p)
uint32_t cbuf_get_contig_empty_len(cbuf_pt cbuf)
uint32_t cbuf_get_contig_len(cbuf_pt cbuf)
ubi_st_t cbuf_write(cbuf_pt cbuf, const uint8_t *buf, uint32_t len, uint32_t *written_p)
uint8_t cbuf_is_full(cbuf_pt cbuf)
uint32_t head
Definition: cbuf.h:29
uint32_t size
Definition: cbuf.h:31
uint32_t tail
Definition: cbuf.h:30
uint8_t * buf
Definition: cbuf.h:32
ubi_st_t
Definition: type.h:140