avrinput/ringbuffer.h

26 lines
460 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);
2019-04-07 18:35:05 +00:00
size_t ringbuffer_empty_bytes(ringbuffer_t buffer);
2019-01-01 15:48:54 +00:00
#endif