btmux/autom4te.cache/
btmux/doc/.svn/
btmux/event/.svn/
btmux/game/.svn/
btmux/game/bin/.svn/
btmux/game/data/.svn/
btmux/game/logs/.svn/
btmux/game/maps/
btmux/game/maps/.svn/
btmux/game/maps/.svn/prop-base/
btmux/game/maps/.svn/props/
btmux/game/maps/.svn/text-base/
btmux/game/maps/.svn/wcprops/
btmux/game/mechs/
btmux/game/mechs/.svn/
btmux/game/mechs/.svn/prop-base/
btmux/game/mechs/.svn/props/
btmux/game/mechs/.svn/text-base/
btmux/game/mechs/.svn/wcprops/
btmux/game/text/.svn/
btmux/include/.svn/
btmux/misc/
btmux/misc/.svn/
btmux/misc/.svn/prop-base/
btmux/misc/.svn/props/
btmux/misc/.svn/text-base/
btmux/misc/.svn/wcprops/
btmux/python/
btmux/python/.svn/
btmux/python/.svn/prop-base/
btmux/python/.svn/props/
btmux/python/.svn/text-base/
btmux/python/.svn/wcprops/
btmux/src/.svn/prop-base/
btmux/src/.svn/props/
btmux/src/.svn/text-base/
btmux/src/.svn/wcprops/
btmux/src/hcode/.svn/
btmux/src/hcode/btech/
btmux/src/hcode/btech/.svn/
btmux/src/hcode/btech/.svn/prop-base/
btmux/src/hcode/btech/.svn/props/
btmux/src/hcode/btech/.svn/text-base/
btmux/src/hcode/btech/.svn/wcprops/
btmux/src/hcode/include/.svn/
/*
 * Doubly Linked List
 */

/* Doubly Linked List Node */
typedef struct dllist_node_t {
    struct dllist_node_t *next, *prev;
    void *data;
} dllist_node;

/* DLLIST - Doesn't store data just
 * size of list and has pointer to
 * head node and tail node */
typedef struct dllist_t {
    struct dllist_node_t *head, *tail;
    unsigned int size;
} dllist;

/* The various create functions */
dllist *dllist_create_list();
dllist_node *dllist_create_node(void *data);

/* The different destroy functions
 * destroy_node returns the data */
int dllist_destroy_list(dllist *ddlist);
void *dllist_destroy_node(dllist_node *node);   /* Shouldn't include this one but whatever */

/* The various insert functions */
void dllist_insert_after(dllist *dllist, dllist_node *node, dllist_node *newnode);
void dllist_insert_before(dllist *dllist, dllist_node *node, dllist_node *newnode);
void dllist_insert_beginning(dllist *dllist, dllist_node *newnode);
void dllist_insert_end(dllist *dllist, dllist_node *newnode);

/* Remove nodes and return the data */
void *dllist_remove(dllist *dllist, dllist_node *node);
void *dllist_remove_node_at_pos(dllist *dllist, int pos);

/* Utility functions */
dllist_node *dllist_head(dllist *dllist);
dllist_node *dllist_tail(dllist *dllist);
dllist_node *dllist_next(dllist_node *node);
dllist_node *dllist_prev(dllist_node *node);

void *dllist_data(dllist_node *node);
int dllist_size(dllist *dllist);
void *dllist_get_node(dllist *dllist, int pos);