TORCS  1.3.9
The Open Racing Car Simulator
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

LISTList (void)
 Create a new list. More...
 
LISTITEMListAppend (LIST *list, void *p)
 Append an item to the list. More...
 
LISTITEMListAppend (LIST *list, void *p, void(*free_obj)(void *obj))
 Append an item to the list with free hook. More...
 
LISTITEMNextListItem (LIST *list)
 Advance one item. More...
 
LISTITEMFirstListItem (LIST *list)
 Move to the first list item. More...
 
LISTITEMLastListItem (LIST *list)
 Move to the last list item. More...
 
LISTITEMGetNextItem (LISTITEM *ptr)
 
LISTITEMGetPrevItem (LISTITEM *ptr)
 
LISTITEMLinkNext (LISTITEM *src, void *ptr, void(*free_obj)(void *obj))
 
LISTITEMLinkPrev (LISTITEM *src, void *ptr, void(*free_obj)(void *obj))
 
LISTITEMListItem (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) More...
 
int ClearList (LIST *list)
 Clear the list. More...
 
LISTITEMFindItem (LIST *list, void *ptr)
 Finds the LISTITEM pointer corresponding to the data. More...
 
LISTITEMListLinearSearchRetrieve (struct List *list, void *ptr)
 
int ListSize (LIST *list)
 Get the size of the list. More...
 
LISTITEMGetItem (LIST *list, int n)
 Get the nth item of the list. More...
 

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(*)(void *obj)  free_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(*)(void *obj)  free_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(*)(void *obj)  free_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(*)(void *obj)  free_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: