TORCS  1.3.10
The Open Racing Car Simulator
Loading...
Searching...
No Matches
List.cpp File Reference
#include <learning/List.h>
#include <learning/learn_debug.h>
Include dependency graph for List.cpp:

Go to the source code of this file.

Functions

LIST * List (void)
 Create a new list.
LISTITEM * ListAppend (LIST *list, void *p)
 Append an item to the list.
LISTITEM * ListAppend (LIST *list, void *p, void(*free_obj)(void *obj))
 Append an item to the list with free hook.
LISTITEM * NextListItem (LIST *list)
 Advance one item.
LISTITEM * FirstListItem (LIST *list)
 Move to the first list item.
LISTITEM * LastListItem (LIST *list)
 Move to the last list item.
LISTITEM * GetNextItem (LISTITEM *ptr)
LISTITEM * GetPrevItem (LISTITEM *ptr)
LISTITEM * LinkNext (LISTITEM *src, void *ptr, void(*free_obj)(void *obj))
LISTITEM * LinkPrev (LISTITEM *src, void *ptr, void(*free_obj)(void *obj))
LISTITEM * ListItem (void *ptr, void(*free_obj)(void *obj))
int FreeListItem (LIST *list, LISTITEM *ptr)
int RemoveListItem (LIST *list, LISTITEM *ptr)
int PopItem (LIST *list)
 Remove the topmost item of the list (also frees obj memory)
int ClearList (LIST *list)
 Clear the list.
LISTITEM * FindItem (LIST *list, void *ptr)
 Finds the LISTITEM pointer corresponding to the data.
LISTITEM * ListLinearSearchRetrieve (struct List *list, void *ptr)
int ListSize (LIST *list)
 Get the size of the list.
LISTITEM * GetItem (LIST *list, int n)
 Get the nth item of the list.

Function Documentation

◆ ClearList()

int ClearList ( LIST * list)

Clear the list.

Definition at line 291 of file List.cpp.

Here is the call graph for this function:

◆ FindItem()

LISTITEM * FindItem ( LIST * list,
void * ptr )

Finds the LISTITEM pointer corresponding to the data.

Definition at line 318 of file List.cpp.

◆ FirstListItem()

LISTITEM * FirstListItem ( LIST * list)

Move to the first list item.

Definition at line 81 of file List.cpp.

◆ FreeListItem()

int FreeListItem ( LIST * list,
LISTITEM * ptr )

Definition at line 182 of file List.cpp.

Here is the call graph for this function:

◆ GetItem()

LISTITEM * GetItem ( LIST * list,
int n )

Get the nth item of the list.

Definition at line 345 of file List.cpp.

Here is the call graph for this function:

◆ GetNextItem()

LISTITEM * GetNextItem ( LISTITEM * ptr)

Definition at line 115 of file List.cpp.

◆ GetPrevItem()

LISTITEM * GetPrevItem ( LISTITEM * ptr)

Definition at line 126 of file List.cpp.

◆ LastListItem()

LISTITEM * LastListItem ( LIST * list)

Move to the last list item.

Definition at line 98 of file List.cpp.

◆ LinkNext()

LISTITEM * LinkNext ( LISTITEM * src,
void * ptr,
void(* free_obj )(void *obj) )

Definition at line 136 of file List.cpp.

Here is the call graph for this function:

◆ LinkPrev()

LISTITEM * LinkPrev ( LISTITEM * src,
void * ptr,
void(* free_obj )(void *obj) )

Definition at line 158 of file List.cpp.

◆ List()

LIST * List ( void )

Create a new list.

Definition at line 16 of file List.cpp.

Here is the call graph for this function:

◆ ListAppend() [1/2]

LISTITEM * ListAppend ( LIST * list,
void * p )

Append an item to the list.

Definition at line 34 of file List.cpp.

Here is the call graph for this function:

◆ ListAppend() [2/2]

LISTITEM * ListAppend ( LIST * list,
void * p,
void(* free_obj )(void *obj) )

Append an item to the list with free hook.

Definition at line 38 of file List.cpp.

Here is the call graph for this function:

◆ ListItem()

LISTITEM * ListItem ( void * ptr,
void(* free_obj )(void *obj) )

Definition at line 164 of file List.cpp.

◆ ListLinearSearchRetrieve()

LISTITEM * ListLinearSearchRetrieve ( struct List * list,
void * ptr )

Definition at line 324 of file List.cpp.

Here is the call graph for this function:

◆ ListSize()

int ListSize ( LIST * list)

Get the size of the list.

Definition at line 341 of file List.cpp.

◆ NextListItem()

LISTITEM * NextListItem ( LIST * list)

Advance one item.

Definition at line 67 of file List.cpp.

Here is the call graph for this function:

◆ PopItem()

int PopItem ( LIST * list)

Remove the topmost item of the list (also frees obj memory)

Definition at line 252 of file List.cpp.

Here is the call graph for this function:

◆ RemoveListItem()

int RemoveListItem ( LIST * list,
LISTITEM * ptr )

Definition at line 201 of file List.cpp.

Here is the call graph for this function: