m2.alobe/src/fifo.h
glenux 5ca782e8b1 alobe: inital import (test).
git-svn-id: https://websvn.glenux.net/svn/Upoc/alobe/trunk@1348 eaee96b3-f302-0410-b096-c6cfd47f7835
2009-05-02 07:36:25 +00:00

40 lines
679 B
C

/* vim: set sw=4 ts=4 si et: */
#ifndef _FIFO_H
#define _FIFO_H
#include "config.h"
typedef struct {
nodeindex_t * _data;
nodeindex_t _fill;
nodeindex_t _size;
nodeindex_t _head;
nodeindex_t _tail;
} Fifo_t;
Fifo_t * fifo_create(nodeindex_t size);
void fifo_push(Fifo_t * fifo, nodeindex_t node);
Fifo_t * fifo_copy(Fifo_t * fifo);
void fifo_reverse(Fifo_t * fifo);
bool fifo_is_empty(Fifo_t * fifo);
nodeindex_t fifo_front(Fifo_t * fifo);
nodeindex_t fifo_pop(Fifo_t * fifo);
nodeindex_t fifo_get_size(Fifo_t * fifo);
void fifo_display(Fifo_t * fifo);
void fifo_destroy(Fifo_t * fifo);
nodeindex_t fifo_get_random(Fifo_t * fifo);
#endif // _FIFO_H