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=88ed5952650a033de6d36a84e171eb79dc502f3b;hpb=14e6db7261e0ee86f10632eff475df27aea31b67;p=pintos-anon diff --git a/src/lib/kernel/list.h b/src/lib/kernel/list.h index 88ed595..262d5b5 100644 --- a/src/lib/kernel/list.h +++ b/src/lib/kernel/list.h @@ -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); +/* 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 */