diff options
Diffstat (limited to 'mru.h')
-rw-r--r-- | mru.h | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/mru.h b/mru.h deleted file mode 100644 index 80a589eb4c..0000000000 --- a/mru.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef MRU_H -#define MRU_H - -#include "list.h" - -/** - * A simple most-recently-used cache, backed by a doubly-linked list. - * - * Usage is roughly: - * - * // Create a list. Zero-initialization is required. - * static struct mru cache; - * INIT_LIST_HEAD(&cache.list); - * - * // Add new item to the end of the list. - * void *item; - * ... - * mru_append(&cache, item); - * - * // Mark an item as used, moving it to the front of the list. - * mru_mark(&cache, item); - * - * // Reset the list to empty, cleaning up all resources. - * mru_clear(&cache); - * - * Note that you SHOULD NOT call mru_mark() and then continue traversing the - * list; it reorders the marked item to the front of the list, and therefore - * you will begin traversing the whole list again. - */ - -struct mru { - struct list_head list; - void *item; -}; - -void mru_append(struct mru *head, void *item); -void mru_mark(struct mru *head, struct mru *entry); -void mru_clear(struct mru *head); - -#endif /* MRU_H */ |