diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-10-02 12:29:19 +0000 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-10-02 12:29:19 +0000 |
| commit | cebda9790bfa7d109014d5871d79e9ecd88c7d50 (patch) | |
| tree | d315b73baf879c0414cf652b89690796cc2f1f3b /src/engine/e_ringbuffer.h | |
| parent | bddc6ec6cc369e87d9dd0c0d1749bb871e1537a8 (diff) | |
| download | zcatch-cebda9790bfa7d109014d5871d79e9ecd88c7d50.tar.gz zcatch-cebda9790bfa7d109014d5871d79e9ecd88c7d50.zip | |
some cleanups. splitted e_network.c into several files. continued on the ban support
Diffstat (limited to 'src/engine/e_ringbuffer.h')
| -rw-r--r-- | src/engine/e_ringbuffer.h | 20 |
1 files changed, 10 insertions, 10 deletions
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 |