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

#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>

Go to the source code of this file.

Data Structures

struct  list_elem
struct  list

Defines

#define list_entry(LIST_ELEM, STRUCT, MEMBER)
#define LIST_INITIALIZER(NAME)

Typedefs

typedef bool list_less_func (const struct list_elem *a, const struct list_elem *b, void *aux)

Functions

void list_init (struct list *)
struct list_elemlist_begin (struct list *)
struct list_elemlist_next (struct list_elem *)
struct list_elemlist_end (struct list *)
struct list_elemlist_rbegin (struct list *)
struct list_elemlist_prev (struct list_elem *)
struct list_elemlist_rend (struct list *)
struct list_elemlist_head (struct list *)
struct list_elemlist_tail (struct list *)
void list_insert (struct list_elem *, struct list_elem *)
void list_splice (struct list_elem *before, struct list_elem *first, struct list_elem *last)
void list_push_front (struct list *, struct list_elem *)
void list_push_back (struct list *, struct list_elem *)
struct list_elemlist_remove (struct list_elem *)
struct list_elemlist_pop_front (struct list *)
struct list_elemlist_pop_back (struct list *)
struct list_elemlist_front (struct list *)
struct list_elemlist_back (struct list *)
size_t list_size (struct list *)
bool list_empty (struct list *)
void list_reverse (struct list *)
void list_sort (struct list *, list_less_func *, void *aux)
void list_insert_ordered (struct list *, struct list_elem *, list_less_func *, void *aux)
void list_unique (struct list *, struct list *duplicates, list_less_func *, void *aux)
struct list_elemlist_max (struct list *, list_less_func *, void *aux)
struct list_elemlist_min (struct list *, list_less_func *, void *aux)


Define Documentation

#define list_entry ( LIST_ELEM,
STRUCT,
MEMBER   ) 

#define LIST_INITIALIZER ( NAME   ) 

Value:

{ { NULL, &(NAME).tail }, \
                                 { &(NAME).head, NULL } }

Definition at line 122 of file list.h.


Typedef Documentation

typedef bool list_less_func(const struct list_elem *a, const struct list_elem *b, void *aux)

Definition at line 165 of file list.h.


Function Documentation

struct list_elem* list_back ( struct 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  )  [read]

bool list_empty ( struct list  ) 

struct list_elem* list_end ( struct list  )  [read]

struct list_elem* list_front ( struct 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  )  [read]

Definition at line 151 of file list.c.

References ASSERT, list::head, and NULL.

Referenced by hash_first().

void list_init ( struct list  ) 

void list_insert ( struct list_elem ,
struct list_elem  
)

void list_insert_ordered ( struct list ,
struct list_elem ,
list_less_func ,
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_less_func ,
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_less_func ,
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  )  [read]

struct list_elem* list_pop_back ( struct list  )  [read]

Definition at line 278 of file list.c.

References list_back(), and list_remove().

struct list_elem* list_pop_front ( struct 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  )  [read]

void list_push_back ( struct list ,
struct list_elem  
)

void list_push_front ( struct list ,
struct list_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  )  [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  )  [read]

struct list_elem* list_rend ( struct 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  ) 

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  ) 

Definition at line 306 of file list.c.

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

void list_sort ( struct list ,
list_less_func ,
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  )  [read]

Definition at line 159 of file list.c.

References ASSERT, NULL, and list::tail.

void list_unique ( struct list ,
struct list duplicates,
list_less_func ,
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().


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