X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flib%2Fkernel%2Flist.h;h=262d5b5c8ef78bb4d3fefe7f808f550591d1ab38;hb=9b027546c7ee1921aea0024b5a88209992471714;hp=1bf66312553cc4ec271840f6fb39c287dd7a2735;hpb=f2f8875638593bd5365cfd6a5ba7c9578e52322f;p=pintos-anon diff --git a/src/lib/kernel/list.h b/src/lib/kernel/list.h index 1bf6631..262d5b5 100644 --- a/src/lib/kernel/list.h +++ b/src/lib/kernel/list.h @@ -1,5 +1,5 @@ -#ifndef HEADER_LIST_H -#define HEADER_LIST_H 1 +#ifndef __LIB_KERNEL_LIST_H +#define __LIB_KERNEL_LIST_H /* Doubly linked list. @@ -143,16 +143,16 @@ list_elem *list_back (struct list *); size_t list_size (struct list *); bool list_empty (struct list *); -/* Weirdness. */ +/* Miscellaneous. */ void list_reverse (struct list *); -/* Operations on lists with ordered elements. */ - /* Compares the value of two list elements A and B, given auxiliary data AUX. Returns true if A is less than B, or false if A is greater than or equal to B. */ typedef bool list_less_func (const list_elem *a, const list_elem *b, void *aux); + +/* Operations on lists with ordered elements. */ void list_merge (struct list *, struct list *, list_less_func *, void *aux); void list_sort (struct list *, @@ -162,4 +162,8 @@ void list_insert_ordered (struct list *, list_elem *, void list_unique (struct list *, struct list *duplicates, list_less_func *, void *aux); -#endif /* list.h */ +/* Max and min. */ +list_elem *list_max (struct list *, list_less_func *, void *aux); +list_elem *list_min (struct list *, list_less_func *, void *aux); + +#endif /* lib/kernel/list.h */