1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00
RIOT/sys/lib/ringbuffer.h
2010-09-22 17:25:19 +02:00

17 lines
411 B
C
Executable File

#ifndef __RINGBUFFER_H
#define __RINGBUFFER_H
typedef struct ringbuffer {
char* buf;
unsigned int start;
unsigned int end;
unsigned int size;
unsigned int avail;
} ringbuffer;
void ringbuffer_init(ringbuffer *rb, char* buffer, unsigned int bufsize);
void rb_add_element(ringbuffer* rb, char c);
int rb_get_element(ringbuffer *rb);
#endif /* __RINGBUFFER_H */