void * clist_insert(struct clist *clist, void *item, unsigned long index)
Insert an item.
size_t clist_free(struct clist *clist)
Frees a list.
Definition: clist.c:51
size_t clist_length(const struct clist *clist)
Returns the length of the list.
void * clist_pop(struct clist *clist)
Pops the last item from a clist.
Definition: clist.c:94
void * clist_append(struct clist *clist, const void *item)
Append an item.
Definition: clist.c:76
struct clist * clist_init(size_t item_size)
Create a clist.
Definition: clist.c:35
void * clist_remove(struct clist *clist, unsigned long index)
Remove an item.
void * clist_jump(struct clist *clist, unsigned long index)
Jump to the given index.
void * clist_write(const struct clist *clist, void *item)
Replace the item on the current index.
void * clist_read(const struct clist *clist)
Return the item on the current index.
A double-way linked list.
Definition: clist.h:79
unsigned long current_index
Definition: clist.h:116
struct node * begin
Definition: clist.h:112
size_t item_size
Definition: clist.h:115
struct node * current
Definition: clist.h:113
struct node * end
Definition: clist.h:114
size_t list_length
Definition: clist.h:117
A single node element for the list.
Definition: clist.h:48
void * item
Definition: clist.h:74
struct node * prev
Definition: clist.h:73
struct node * next
Definition: clist.h:75