avrinput/ringbuffer.h

24 lines
407 B
C
Raw Normal View History

2019-01-01 15:48:54 +00:00
#ifndef _RINGBUFFER_H_
#define _RINGBUFFER_H_
#include <stdlib.h>
typedef struct ringbuffer_s
{
size_t length;
size_t head, tail;
unsigned char * buffer;
char ovf;
} * ringbuffer_t;
ringbuffer_t
ringbuffer_new(size_t size);
int
ringbuffer_nonempty(ringbuffer_t buffer);
unsigned char
ringbuffer_get_char(ringbuffer_t buffer);
int
ringbuffer_put_char(ringbuffer_t buffer
, unsigned char c);
#endif