Go to the documentation of this file.
30 #ifndef UBICLIB_CIRBUF_H_
31 #define UBICLIB_CIRBUF_H_
46 #include <ubinos_config.h>
50 #define CIRBUF_OPT__NOOVERWRITE 0x0001
53 #define CIRBUF_OPT__MTPROTECTION 0x0002
82 #define cirbuf_init(cirbuf, maxsize) \
84 (cirbuf)->maxsize = maxsize; \
85 (cirbuf)->buf = (unsigned char *) ((unsigned int) cirbuf + sizeof(cirbuf_t)); \
87 (cirbuf)->head = (cirbuf)->buf; \
88 (cirbuf)->tail = (cirbuf)->buf; \
91 (cirbuf)->overflowcount = 0; \
92 (cirbuf)->mtprotection = 0; \
93 (cirbuf)->overwrite = 0; \
94 (cirbuf)->reserved = 0; \
127 unsigned int option);
159 unsigned int * written_p);
178 unsigned int * read_p);
unsigned char * head
Definition: cirbuf.h:58
int cirbuf_delete(cirbuf_pt *cirbuf_p)
unsigned int size
Definition: cirbuf.h:60
int cirbuf_create(cirbuf_pt *cirbuf_p, unsigned int maxsize)
unsigned char * tail
Definition: cirbuf.h:59
int cirbuf_clear(cirbuf_pt cirbuf)
int cirbuf_read(cirbuf_pt cirbuf, unsigned char *buf, unsigned int size, unsigned int *read_p)
cirbuf_t * cirbuf_pt
Definition: cirbuf.h:73
unsigned int overflowcount
Definition: cirbuf.h:62
unsigned int reserved
Definition: cirbuf.h:66
unsigned int mtprotection
Definition: cirbuf.h:64
int cirbuf_create_ext(cirbuf_pt *cirbuf_p, unsigned int maxsize, unsigned int option)
int cirbuf_write(cirbuf_pt cirbuf, unsigned char *buf, unsigned int size, unsigned int *written_p)
struct _cirbuf_t cirbuf_t
unsigned int overwrite
Definition: cirbuf.h:65
unsigned int maxsize
Definition: cirbuf.h:68
unsigned char * buf
Definition: cirbuf.h:69