blob: 9cf1ad0f4769e8dfd8c057729cfea0533783dded (
plain) (
tree)
|
|
#include <stddef.h>
#include "list.h"
struct _list {
LINKEDLIST;
};
void list_init(struct list *list) {
list->tail = list;
list->head = list;
list->end = list;
}
void list_insert(void *_next, void *_node) {
struct _list *node = _node;
struct _list *next = _next;
struct _list *prev = next->prev;
next->prev = node;
prev->next = node;
node->next = next;
node->prev = prev;
}
void list_remove(void *_node) {
struct _list *node = _node;
struct _list *next = node->next;
struct _list *prev = node->prev;
next->prev = prev;
prev->next = next;
node->next = NULL;
node->prev = NULL;
}
|