include/ring.h File Reference

Simple and efficient ring buffer implementation. More...

#include <stdbool.h>

Go to the source code of this file.

Data Structures

struct  ring_head
 Ring buffer management data. More...

Functions

static unsigned long ring_get_head (struct ring_head *ring, unsigned int ring_size)
 Get the offset of the next unused entry in the buffer.
static unsigned long ring_get_tail (struct ring_head *ring, unsigned int ring_size)
 Get the offset of the first used entry in the buffer.
static unsigned int ring_entries_used (struct ring_head *ring)
 Get the number of used entries in the buffer.
static unsigned int ring_entries_used_before_end (struct ring_head *ring, unsigned int ring_size)
 Get the number of used entries in the buffer before it wraps.
static unsigned int ring_entries_unused (struct ring_head *ring, unsigned int ring_size)
 Get the number of unused entries in the buffer.
static unsigned int ring_entries_unused_before_end (struct ring_head *ring, unsigned int ring_size)
 Get the number of unused entries in the buffer before it wraps.
static bool ring_is_empty (struct ring_head *ring)
 Test if the ring buffer is empty.
static bool ring_is_full (struct ring_head *ring, unsigned int ring_size)
 Test if the ring buffer is full.
static void ring_insert_entries (struct ring_head *ring, unsigned int nr_entries)
 Insert entries into the ring buffer.
static void ring_extract_entries (struct ring_head *ring, unsigned int nr_entries)
 Extract entries from the ring buffer.
static void ring_reset (struct ring_head *ring)
 Reset the ring buffer.

Detailed Description

Simple and efficient ring buffer implementation.

Copyright (C) 2009 Atmel Corporation. All rights reserved.

Definition in file ring.h.

Generated on Thu Apr 29 14:10:34 2010 for xplain-bc by  doxygen 1.6.3