64 (*Klist)->Counter = 0;
69 if (++((*Klist)->Counter) == 0) {
70 (*Klist)->Counter = 1;
73 }
while (!((*Klist)->Clean) &&
77 Node->
Key = (*Klist)->Counter;
80 return (*Klist)->Counter;
void dList_insert_sorted(Dlist *lp, void *data, dCompareFunc func)
Insert an element into a sorted list.
Dlist * dList_new(int size)
Create a new empty list.
int dList_length(Dlist *lp)
For completing the ADT.
void * dList_nth_data(Dlist *lp, int n0)
Return the nth data item, NULL when not found or 'n0' is out of range.
void dList_remove_fast(Dlist *lp, const void *data)
Remove a data item without preserving order.
void * dList_find_sorted(Dlist *lp, const void *data, dCompareFunc func)
Search a sorted list.
void dList_free(Dlist *lp)
Free a list (not its elements)
void dList_remove(Dlist *lp, const void *data)
#define dNew(type, count)
void a_Klist_remove(Klist_t *Klist, int Key)
Remove data by Key.
static int Klist_node_by_node_cmp(const void *Node1, const void *Node2)
Compare function for searching data by node.
static int Klist_node_by_key_cmp(const void *Node, const void *key)
Compare function for searching data by its key.
void * a_Klist_get_data(Klist_t *Klist, int Key)
Return the data pointer for a given Key (or NULL if not found)
void a_Klist_free(Klist_t **KlistPtr)
Free a Klist.
int a_Klist_insert(Klist_t **Klist, void *Data)
Insert a data pointer and return a key for it.
int a_Klist_length(Klist_t *Klist)
Return the number of elements in the Klist.
void * Data
data reference