The friendly Operating System for the Internet of Things
cib.h File Reference

Circular integer buffer interface. More...

Detailed Description

This structure provides an organizational interface and combined with an memory array forms a circular buffer.

Author
Kaspar Schleiser kaspa.nosp@m.r@sc.nosp@m.hleis.nosp@m.er.d.nosp@m.e

Definition in file cib.h.

#include "assert.h"
+ Include dependency graph for cib.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  cib_t
 circular integer buffer structure More...
 

Macros

#define CIB_INIT(SIZE)   { 0, 0, (SIZE) - 1 }
 Initialize cib_t to a given size.
 

Functions

static void cib_init (cib_t *__restrict cib, unsigned int size)
 Initialize cib to 0 and set buffer size to size. More...
 
static unsigned int cib_avail (const cib_t *cib)
 Calculates difference between cib_put() and cib_get() accesses. More...
 
static unsigned int cib_full (const cib_t *cib)
 Check if cib is full. More...
 
static int cib_get (cib_t *__restrict cib)
 Get the index of the next item in buffer. More...
 
static int cib_peek (cib_t *__restrict cib)
 Get the index of the next item in buffer without removing it. More...
 
static int cib_get_unsafe (cib_t *cib)
 Get the index of the next item in buffer. More...
 
static int cib_put (cib_t *__restrict cib)
 Get index for item in buffer to put to. More...
 
static int cib_put_unsafe (cib_t *cib)
 Get index for item in buffer to put to. More...