pintos/src/lib/kernel/list.c File Reference

#include "list.h"
#include "../debug.h"

Go to the source code of this file.

Functions

static bool is_sorted (struct list_elem *a, struct list_elem *b, list_less_func *less, void *aux) UNUSED
static bool is_head (struct list_elem *elem)
static bool is_interior (struct list_elem *elem)
static bool is_tail (struct list_elem *elem)
void list_init (struct list *list)
struct list_elemlist_begin (struct list *list)
struct list_elemlist_next (struct list_elem *elem)
struct list_elemlist_end (struct list *list)
struct list_elemlist_rbegin (struct list *list)
struct list_elemlist_prev (struct list_elem *elem)
struct list_elemlist_rend (struct list *list)
struct list_elemlist_head (struct list *list)
struct list_elemlist_tail (struct list *list)
void list_insert (struct list_elem *before, struct list_elem *elem)
void list_splice (struct list_elem *before, struct list_elem *first, struct list_elem *last)
void list_push_front (struct list *list, struct list_elem *elem)
void list_push_back (struct list *list, struct list_elem *elem)
struct list_elemlist_remove (struct list_elem *elem)
struct list_elemlist_pop_front (struct list *list)
struct list_elemlist_pop_back (struct list *list)
struct list_elemlist_front (struct list *list)
struct list_elemlist_back (struct list *list)
size_t list_size (struct list *list)
bool list_empty (struct list *list)
static void swap (struct list_elem **a, struct list_elem **b)
void list_reverse (struct list *list)
static struct list_elemfind_end_of_run (struct list_elem *a, struct list_elem *b, list_less_func *less, void *aux)
static void inplace_merge (struct list_elem *a0, struct list_elem *a1b0, struct list_elem *b1, list_less_func *less, void *aux)
void list_sort (struct list *list, list_less_func *less, void *aux)
void list_insert_ordered (struct list *list, struct list_elem *elem, list_less_func *less, void *aux)
void list_unique (struct list *list, struct list *duplicates, list_less_func *less, void *aux)
struct list_elemlist_max (struct list *list, list_less_func *less, void *aux)
struct list_elemlist_min (struct list *list, list_less_func *less, void *aux)


Function Documentation

static struct list_elem* find_end_of_run ( struct list_elem a,
struct list_elem b,
list_less_func less,
void *  aux 
) [static, read]

Definition at line 366 of file list.c.

References ASSERT, list_next(), list_prev(), and NULL.

Referenced by list_sort().

static void inplace_merge ( struct list_elem a0,
struct list_elem a1b0,
struct list_elem b1,
list_less_func less,
void *  aux 
) [static]

Definition at line 388 of file list.c.

References ASSERT, is_sorted(), list_next(), list_prev(), list_splice(), and NULL.

Referenced by list_sort().

static bool is_head ( struct list_elem elem  )  [inline, static]

Definition at line 39 of file list.c.

References list_elem::next, NULL, and list_elem::prev.

Referenced by list_next().

static bool is_interior ( struct list_elem elem  )  [inline, static]

Definition at line 47 of file list.c.

References list_elem::next, NULL, and list_elem::prev.

Referenced by list_insert(), list_next(), list_prev(), list_remove(), and list_splice().

static bool is_sorted ( struct list_elem a,
struct list_elem b,
list_less_func less,
void *  aux 
) [static]

Definition at line 350 of file list.c.

References list_next(), and list_prev().

Referenced by inplace_merge(), list_sort(), and qsort_bytes().

static bool is_tail ( struct list_elem elem  )  [inline, static]

Definition at line 54 of file list.c.

References list_elem::next, NULL, and list_elem::prev.

Referenced by list_insert(), list_prev(), and list_splice().

struct list_elem* list_back ( struct list list  )  [read]

Definition at line 297 of file list.c.

References ASSERT, list_empty(), list_elem::prev, and list::tail.

Referenced by list_pop_back().

struct list_elem* list_begin ( struct list list  )  [read]

bool list_empty ( struct list list  ) 

struct list_elem* list_end ( struct list list  )  [read]

struct list_elem* list_front ( struct list list  )  [read]

Definition at line 288 of file list.c.

References ASSERT, list::head, list_empty(), and list_elem::next.

Referenced by list_pop_front().

struct list_elem* list_head ( struct list list  )  [read]

Definition at line 151 of file list.c.

References ASSERT, list::head, and NULL.

Referenced by hash_first().

void list_init ( struct list list  ) 

void list_insert ( struct list_elem before,
struct list_elem elem 
)

void list_insert_ordered ( struct list list,
struct list_elem elem,
list_less_func less,
void *  aux 
)

Definition at line 454 of file list.c.

References ASSERT, list_begin(), list_end(), list_insert(), list_next(), and NULL.

Referenced by test().

struct list_elem* list_max ( struct list list,
list_less_func less,
void *  aux 
) [read]

Definition at line 501 of file list.c.

References list_begin(), list_end(), and list_next().

Referenced by test().

struct list_elem* list_min ( struct list list,
list_less_func less,
void *  aux 
) [read]

Definition at line 520 of file list.c.

References list_begin(), list_end(), and list_next().

Referenced by test().

struct list_elem* list_next ( struct list_elem elem  )  [read]

struct list_elem* list_pop_back ( struct list list  )  [read]

Definition at line 278 of file list.c.

References list_back(), and list_remove().

struct list_elem* list_pop_front ( struct list list  )  [read]

Definition at line 268 of file list.c.

References list_front(), and list_remove().

Referenced by cond_signal(), hash_clear(), malloc(), next_thread_to_run(), and sema_up().

struct list_elem* list_prev ( struct list_elem elem  )  [read]

void list_push_back ( struct list list,
struct list_elem elem 
)

void list_push_front ( struct list list,
struct list_elem elem 
)

Definition at line 209 of file list.c.

References list_begin(), and list_insert().

Referenced by free(), inode_open(), insert_elem(), and rehash().

struct list_elem* list_rbegin ( struct list list  )  [read]

Definition at line 103 of file list.c.

References ASSERT, NULL, list_elem::prev, and list::tail.

Referenced by verify_list_bkwd().

struct list_elem* list_remove ( struct list_elem elem  )  [read]

struct list_elem* list_rend ( struct list list  )  [read]

Definition at line 133 of file list.c.

References ASSERT, list::head, and NULL.

Referenced by verify_list_bkwd().

void list_reverse ( struct list list  ) 

Definition at line 334 of file list.c.

References list::head, list_begin(), list_empty(), list_end(), list_elem::next, list_elem::prev, swap(), and list::tail.

Referenced by test().

size_t list_size ( struct list list  ) 

Definition at line 306 of file list.c.

References list_begin(), list_end(), and list_next().

void list_sort ( struct list list,
list_less_func less,
void *  aux 
)

Definition at line 413 of file list.c.

References ASSERT, find_end_of_run(), inplace_merge(), is_sorted(), list_begin(), list_end(), and NULL.

Referenced by test().

void list_splice ( struct list_elem before,
struct list_elem first,
struct list_elem last 
)

Definition at line 184 of file list.c.

References ASSERT, is_interior(), is_tail(), list_prev(), list_elem::next, and list_elem::prev.

Referenced by inplace_merge().

struct list_elem* list_tail ( struct list list  )  [read]

Definition at line 159 of file list.c.

References ASSERT, NULL, and list::tail.

void list_unique ( struct list list,
struct list duplicates,
list_less_func less,
void *  aux 
)

Definition at line 474 of file list.c.

References ASSERT, list_begin(), list_empty(), list_end(), list_next(), list_push_back(), list_remove(), next(), and NULL.

Referenced by test().

static void swap ( struct list_elem **  a,
struct list_elem **  b 
) [static]

Definition at line 325 of file list.c.

Referenced by list_reverse(), partition(), and shuffle().


Generated on Mon Jan 10 16:43:58 2011 for Pintos by  doxygen 1.5.6