dxx-rebirth/include/dl_list.h
md2211 324c0df6a1 * Huge SDL_mixer refactoring; sound backend now selectable at runtime, in D1X & D2X
* Sound system now uses a set of function pointers (digi.c) as a single interface to either SDL or SDL_mixer
* Ported jukebox functionality to D2X
2007-09-18 13:37:39 +00:00

31 lines
578 B
C

/*
* Doubly-linked list implementation
* MD 2211 <md2211@users.sourceforge.net>, 2007
*/
#ifndef __DL_LIST__
#define __DL_LIST__
struct dl_list_elem {
void *data;
struct dl_list_elem *prev;
struct dl_list_elem *next;
};
typedef struct dl_list_elem dl_item;
typedef struct {
struct dl_list_elem *first;
struct dl_list_elem *last;
struct dl_list_elem *current;
} dl_list;
dl_list *dl_init();
void dl_add(dl_list *, void *);
void dl_remove(dl_list *, dl_item *);
int dl_is_empty(dl_list *);
int dl_forward(dl_list *);
int dl_backward(dl_list *);
#endif