ddnet/src/engine/e_ringbuffer.h

24 lines
552 B
C
Raw Normal View History

#ifndef _RINGBUFFER_H
#define _RINGBUFFER_H
2008-02-03 22:42:03 +00:00
typedef struct RINGBUFFER RINGBUFFER;
enum
2008-02-03 22:42:03 +00:00
{
/* Will start to destroy items to try to fit the next one */
RINGBUF_FLAG_RECYCLE=1
};
2008-02-03 22:42:03 +00:00
RINGBUFFER *ringbuf_init(void *memory, int size, int flags);
void ringbuf_clear(RINGBUFFER *rb);
2008-02-03 23:55:37 +00:00
void *ringbuf_allocate(RINGBUFFER *rb, int size);
2008-02-03 22:42:03 +00:00
2008-02-03 23:55:37 +00:00
void *ringbuf_prev(RINGBUFFER *rb, void *current);
void *ringbuf_next(RINGBUFFER *rb, void *current);
void *ringbuf_first(RINGBUFFER *rb);
void *ringbuf_last(RINGBUFFER *rb);
int ringbuf_popfirst(RINGBUFFER *rb);
#endif