librfn
An ad-hoc utility library
Data Structures | Macros | Functions
ringbuf.h File Reference
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include "atomic.h"

Go to the source code of this file.

Data Structures

struct  ringbuf_t
 Ring buffer descriptor. More...
 

Macros

#define RINGBUF_VAR_INIT(bufp, buf_len)
 Static initializer for a ring buffer descriptor. More...
 

Functions

void ringbuf_init (ringbuf_t *rb, void *bufp, size_t buf_len)
 Runtime initializer for a ring buffer descriptor. More...
 
int ringbuf_get (ringbuf_t *rb)
 Extract a byte from the ring buffer. More...
 
bool ringbuf_empty (ringbuf_t *rb)
 Test whether the ring buffer contains any data. More...
 
bool ringbuf_put (ringbuf_t *rb, uint8_t d)
 Insert a byte into the ring buffer. More...
 
void ringbuf_putchar (void *rb, char c)
 Insert a character into the ring buffer. More...