1 #ifndef __RING_BUFFER_H__
2 #define __RING_BUFFER_H__
5 #include <geekos/ktypes.h>
19 void init_ring_buffer(struct ring_buffer * ring, uint_t size);
20 struct ring_buffer * create_ring_buffer(uint_t size);
22 void free_ring_buffer(struct ring_buffer * ring);
25 int rb_read(struct ring_buffer * ring, char * dst, uint_t len);
26 int rb_peek(struct ring_buffer * ring, char * dst, uint_t len);
27 int rb_delete(struct ring_buffer * ring, uint_t len);
28 int rb_write(struct ring_buffer * ring, char * src, uint_t len);
29 int rb_data_len(struct ring_buffer * ring);
30 int rb_capacity(struct ring_buffer * ring);
33 void print_ring_buffer(struct ring_buffer * ring);
36 #endif // ! __RING_BUFFER_H__