FreeRDP
LinkedList.c File Reference
#include <winpr/config.h>
#include <winpr/collections.h>
#include <winpr/assert.h>

Functions

size_t LinkedList_Count (wLinkedList *list)
 Return the current number of elements in the linked list. More...
 
void * LinkedList_First (wLinkedList *list)
 Return the first element of the list, ownership stays with the list. More...
 
void * LinkedList_Last (wLinkedList *list)
 Return the last element of the list, ownership stays with the list. More...
 
BOOL LinkedList_Contains (wLinkedList *list, const void *value)
 Check if the linked list contains a value. More...
 
static wLinkedListNode * LinkedList_FreeNode (wLinkedList *list, wLinkedListNode *node)
 
void LinkedList_Clear (wLinkedList *list)
 Remove all elements of the linked list. fnObjectUninit and fnObjectFree are called for each entry. More...
 
static wLinkedListNode * LinkedList_Create (wLinkedList *list, const void *value)
 
BOOL LinkedList_AddFirst (wLinkedList *list, const void *value)
 Add a new element at the start of the linked list. fnObjectNew and fnObjectInit is called for the new entry. More...
 
BOOL LinkedList_AddLast (wLinkedList *list, const void *value)
 Add a new element at the end of the linked list. fnObjectNew and fnObjectInit is called for the new entry. More...
 
BOOL LinkedList_Remove (wLinkedList *list, const void *value)
 Remove a element identified by value from the linked list. fnObjectUninit and fnObjectFree is called for the entry. More...
 
void LinkedList_RemoveFirst (wLinkedList *list)
 Remove the first element from the linked list. fnObjectUninit and fnObjectFree is called for the entry. More...
 
void LinkedList_RemoveLast (wLinkedList *list)
 Remove the last element from the linked list. fnObjectUninit and fnObjectFree is called for the entry. More...
 
void LinkedList_Enumerator_Reset (wLinkedList *list)
 Move enumerator to the first element. More...
 
void * LinkedList_Enumerator_Current (wLinkedList *list)
 Return the value for the current position of the enumerator. More...
 
BOOL LinkedList_Enumerator_MoveNext (wLinkedList *list)
 Move enumerator to the next element. More...
 
static BOOL default_equal_function (const void *objA, const void *objB)
 
wLinkedList * LinkedList_New (void)
 Allocate a linked list. More...
 
void LinkedList_Free (wLinkedList *list)
 Free a linked list. More...
 
wObjectLinkedList_Object (wLinkedList *list)
 Return the wObject function pointers for list elements. More...
 

Function Documentation

◆ default_equal_function()

static BOOL default_equal_function ( const void *  objA,
const void *  objB 
)
static
Here is the caller graph for this function:

◆ LinkedList_AddFirst()

BOOL LinkedList_AddFirst ( wLinkedList *  list,
const void *  value 
)

Add a new element at the start of the linked list. fnObjectNew and fnObjectInit is called for the new entry.

Adds a new node containing the specified value at the start of the LinkedList.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ LinkedList_AddLast()

BOOL LinkedList_AddLast ( wLinkedList *  list,
const void *  value 
)

Add a new element at the end of the linked list. fnObjectNew and fnObjectInit is called for the new entry.

Adds a new node containing the specified value at the end of the LinkedList.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ LinkedList_Clear()

void LinkedList_Clear ( wLinkedList *  list)

Remove all elements of the linked list. fnObjectUninit and fnObjectFree are called for each entry.

Removes all entries from the LinkedList.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ LinkedList_Contains()

BOOL LinkedList_Contains ( wLinkedList *  list,
const void *  value 
)

Check if the linked list contains a value.

Methods Determines whether the LinkedList contains a specific value.

Here is the call graph for this function:

◆ LinkedList_Count()

size_t LinkedList_Count ( wLinkedList *  list)

Return the current number of elements in the linked list.

C equivalent of the C# LinkedList<T> Class: http://msdn.microsoft.com/en-us/library/he2s3bh7.aspx

Internal implementation uses a doubly-linked list Properties Gets the number of nodes actually contained in the LinkedList.

Here is the caller graph for this function:

◆ LinkedList_Create()

static wLinkedListNode* LinkedList_Create ( wLinkedList *  list,
const void *  value 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LinkedList_Enumerator_Current()

void* LinkedList_Enumerator_Current ( wLinkedList *  list)

Return the value for the current position of the enumerator.

Parameters
listA pointer to the list, must not be NULL
Returns
A pointer to the current entry or NULL
Here is the caller graph for this function:

◆ LinkedList_Enumerator_MoveNext()

BOOL LinkedList_Enumerator_MoveNext ( wLinkedList *  list)

Move enumerator to the next element.

Parameters
listA pointer to the list, must not be NULL
Returns
TRUE if the move was successful, FALSE if not (e.g. no more entries)
Here is the caller graph for this function:

◆ LinkedList_Enumerator_Reset()

void LinkedList_Enumerator_Reset ( wLinkedList *  list)

Move enumerator to the first element.

Sets the enumerator to its initial position, which is before the first element in the collection.

Here is the caller graph for this function:

◆ LinkedList_First()

void* LinkedList_First ( wLinkedList *  list)

Return the first element of the list, ownership stays with the list.

Gets the first node of the LinkedList.

Here is the caller graph for this function:

◆ LinkedList_Free()

void LinkedList_Free ( wLinkedList *  list)

Free a linked list.

Parameters
listA pointer to the list, may be NULL
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LinkedList_FreeNode()

static wLinkedListNode* LinkedList_FreeNode ( wLinkedList *  list,
wLinkedListNode *  node 
)
static
Here is the caller graph for this function:

◆ LinkedList_Last()

void* LinkedList_Last ( wLinkedList *  list)

Return the last element of the list, ownership stays with the list.

Gets the last node of the LinkedList.

Here is the caller graph for this function:

◆ LinkedList_New()

wLinkedList* LinkedList_New ( void  )

Allocate a linked list.

Construction, Destruction

Here is the call graph for this function:
Here is the caller graph for this function:

◆ LinkedList_Object()

wObject* LinkedList_Object ( wLinkedList *  list)

Return the wObject function pointers for list elements.

Parameters
listA pointer to the list, must not be NULL
Returns
A pointer to the wObject or NULL in case of failure

◆ LinkedList_Remove()

BOOL LinkedList_Remove ( wLinkedList *  list,
const void *  value 
)

Remove a element identified by value from the linked list. fnObjectUninit and fnObjectFree is called for the entry.

Removes the first occurrence of the specified value from the LinkedList.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ LinkedList_RemoveFirst()

void LinkedList_RemoveFirst ( wLinkedList *  list)

Remove the first element from the linked list. fnObjectUninit and fnObjectFree is called for the entry.

Removes the node at the start of the LinkedList.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ LinkedList_RemoveLast()

void LinkedList_RemoveLast ( wLinkedList *  list)

Remove the last element from the linked list. fnObjectUninit and fnObjectFree is called for the entry.

Removes the node at the end of the LinkedList.

Here is the call graph for this function:
Here is the caller graph for this function: