FreeRDP
list.h File Reference
#include <freerdp/api.h>
This graph shows which files directly or indirectly include this file:

Data Structures

struct  LIST_ITEM
struct  LIST

Defines

#define list_add(_l, _d)   list_enqueue(_l, _d)

Functions

FREERDP_API LIST * list_new (void)
FREERDP_API void list_free (LIST *list)
FREERDP_API void list_enqueue (LIST *list, void *data)
FREERDP_API voidlist_dequeue (LIST *list)
FREERDP_API voidlist_peek (LIST *list)
FREERDP_API voidlist_next (LIST *list, void *data)
FREERDP_API voidlist_remove (LIST *list, void *data)
FREERDP_API int list_size (LIST *list)

Define Documentation

#define list_add (   _l,
  _d 
)    list_enqueue(_l, _d)

Function Documentation

FREERDP_API void* list_dequeue ( LIST *  list)

Removes the first element of a list, and returns a pointer to it. The list-specific resources associated to this element are freed in the process.

Parameters:
list- pointer to a valid LIST structure
Returns:
a pointer to the data of the first element of this list. NULL if the list is empty.

Here is the caller graph for this function:

FREERDP_API void list_enqueue ( LIST *  list,
void data 
)

Add an element at the end of an existing list.

Parameters:
list- pointer to the LIST that will contain the new element
data- pointer to the buffer that will be added to the list

Here is the call graph for this function:

Here is the caller graph for this function:

FREERDP_API void list_free ( LIST *  list)

Deallocates a LIST structure. All elements of the list will be removed (but not deallocated). Only the list-specific resources are freed.

Parameters:
list- pointer to the LIST that must be deallocated.

Here is the call graph for this function:

Here is the caller graph for this function:

FREERDP_API LIST* list_new ( void  )

Allocates a new LIST structure. The list_*() API implements a chainlist and allows to store data of arbitrary type in FIFO mode.

See also:
list_enqueue() to add elements to the list.
list_dequeue() to remove the first element of the list and get a pointer to it.
list_peek() to retrieve the first element of the list (and keep it there).
list_free() to deallocate the list.
list_size() to get the current number of elements in the list.
Returns:
A pointer to the allocated LIST structure. It must be deallocated by a call to list_free().

Here is the caller graph for this function:

FREERDP_API void* list_next ( LIST *  list,
void data 
)

Searches for the data provided in parameter, and returns a pointer to the element next to it. If the item is not found, or if it is the last in the list, the function will return NULL.

Parameters:
list- pointer to the list that must be searched.
data- pointer to the buffer that must be found. The comparison is done on the pointer value - not the buffer's content.
Returns:
a pointer to the data of the element that resides after the 'data' parameter in the list. NULL if 'data' was not found in the list, or if it is the last element.
See also:
list_item_find() for more information on list item searches.

Here is the call graph for this function:

FREERDP_API void* list_peek ( LIST *  list)

Returns a pointer to the data from the first element of the list. The element itself is not removed from the list by this call.

Parameters:
list- pointerto a valid LIST structure
Returns:
a pointer to the data of the first element of this list. NULL if the list is empty.
FREERDP_API void* list_remove ( LIST *  list,
void data 
)

Searches for the data provided in parameter, and removes it from the list if it is found.

Parameters:
list- pointer to the list that must be searched.
data- pointer to the buffer that must be found. The comparison is done on the pointer value - not the buffer's content.
Returns:
the 'data' pointer, if the element was found, and successfully removed from the list. NULL if the element was not found.

Here is the call graph for this function:

Here is the caller graph for this function:

FREERDP_API int list_size ( LIST *  list)

Returns the current size of the list (number of elements). This number is kept up to date by the list_enqueue and list_dequeue functions.

Parameters:
list- pointer to a valide LIST structure.
Returns:
the number of elements in that list.

Here is the caller graph for this function:

All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Defines