iankronquist / kernel-of-truth

A simple kernel written in C and a platform to play with x86_64 extensions
MIT License
30 stars 5 forks source link

Standard flexible linked list implementation #79

Closed iankronquist closed 7 years ago

iankronquist commented 7 years ago

Currently there are separate linked list implementations scattered about the code base. Implement a standardized linked list which can be reused in different situations. Also implement the following functions:

void ll_insert(struct link *); // Does insertion sort
status_t checked ll_remove(struct link *);
struct link *ll_closest(struct link *, int (*compare)(void *a, void *b));
struct link *ll_find(void *, int (*compare)(void *a, void *b));
bool ll_contains(struct link *, void*);
void ll_push(struct link *, void *);
struct link *ll_pop(struct link *);

Also, replace at least one of the following:

iankronquist commented 7 years ago

The names of those functions, their arguments, and return values are all flexible. Use your best judgement.

This should be a singly linked list.