From cebda9790bfa7d109014d5871d79e9ecd88c7d50 Mon Sep 17 00:00:00 2001 From: Magnus Auvinen Date: Thu, 2 Oct 2008 12:29:19 +0000 Subject: some cleanups. splitted e_network.c into several files. continued on the ban support --- src/engine/e_ringbuffer.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/engine/e_ringbuffer.h') diff --git a/src/engine/e_ringbuffer.h b/src/engine/e_ringbuffer.h index 40043492..71b5831b 100644 --- a/src/engine/e_ringbuffer.h +++ b/src/engine/e_ringbuffer.h @@ -1,18 +1,16 @@ #ifndef _RINGBUFFER_H #define _RINGBUFFER_H -typedef struct RINGBUFFER +typedef struct RINGBUFFER RINGBUFFER; + +enum { - /* what you need */ - struct RBITEM_t *next_alloc; - struct RBITEM_t *last_alloc; - struct RBITEM_t *first; - struct RBITEM_t *last; - void *memory; - int size; -} RINGBUFFER; + /* Will start to destroy items to try to fit the next one */ + RINGBUF_FLAG_RECYCLE=1 +}; -RINGBUFFER *ringbuf_init(void *memory, int size); +RINGBUFFER *ringbuf_init(void *memory, int size, int flags); +void ringbuf_clear(RINGBUFFER *rb); void *ringbuf_allocate(RINGBUFFER *rb, int size); void ringbuf_validate(RINGBUFFER *rb); @@ -23,4 +21,6 @@ void *ringbuf_next(RINGBUFFER *rb, void *current); void *ringbuf_first(RINGBUFFER *rb); void *ringbuf_last(RINGBUFFER *rb); +void ringbuf_popfirst(RINGBUFFER *rb); + #endif -- cgit 1.4.1