SysLink API Reference  2.21.03.11
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Data Structures | Macros | Typedefs | Functions
List.h File Reference

Detailed Description

Creates a doubly linked list. It works as utils for other modules.

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  List_Elem_tag
 Structure defining object for the list element. More...
struct  List_Object_tag
 Structure defining object for the list. More...
struct  List_Params_tag
 Structure defining params for the list. More...

Macros

#define List_traverse(x, y)
 Traverse the full list till the last element.

Typedefs

typedef struct List_Elem_tag List_Elem
 Structure defining object for the list element.
typedef struct List_Object_tag List_Object
 Structure defining object for the list.
typedef List_ObjectList_Handle
 Defines List handle type.
typedef struct List_Params_tag List_Params
 Structure defining params for the list.

Functions

Void List_Params_init (List_Params *params)
 Initialize this config-params structure with supplier-specified defaults before instance creation.
List_Handle List_create (List_Params *params, Error_Block *eb)
 Function to create a list object.
Void List_delete (List_Handle *handlePtr)
 Function to delete a list object.
Void List_construct (List_Object *obj, List_Params *params)
 Function to construct a list object. This function is used when memory for the list object is not to be allocated by the List API.
Void List_destruct (List_Object *obj)
 Function to destruct a list object.
Void List_elemClear (List_Elem *elem)
 Function to clear element contents.
Bool List_empty (List_Handle handle)
 Function to check if list is empty.
Ptr List_get (List_Handle handle)
 Function to get first element of List.
Void List_put (List_Handle handle, List_Elem *elem)
 Function to insert element at the end of List.
Ptr List_next (List_Handle handle, List_Elem *elem)
 Function to traverse to the next element in the list (non atomic)
Ptr List_prev (List_Handle handle, List_Elem *elem)
 Function to traverse to the previous element in the list (non atomic)
Void List_insert (List_Handle handle, List_Elem *newElem, List_Elem *curElem)
 Function to insert element before the existing element in the list.
Void List_remove (List_Handle handle, List_Elem *elem)
 Function to removes element from the List.
Void List_putHead (List_Handle handle, List_Elem *elem)
 Function to put the element before head.
Ptr List_dequeue (List_Handle handle)
 Get element from front of List (non-atomic)
Void List_enqueue (List_Handle handle, List_Elem *elem)
 Put element at end of List (non-atomic)
Void List_enqueueHead (List_Handle handle, List_Elem *elem)
 Put element at head of List (non-atomic)

Macro Definition Documentation

#define List_traverse (   x,
 
)
Value:
for(x = (List_Elem *)((List_Object *)y)->elem.next; \
(UInt32) x != (UInt32)&((List_Object *)y)->elem;\
x = x->next)

Traverse the full list till the last element.


Typedef Documentation

typedef struct List_Elem_tag List_Elem

Structure defining object for the list element.

typedef struct List_Object_tag List_Object

Structure defining object for the list.

Defines List handle type.

typedef struct List_Params_tag List_Params

Structure defining params for the list.


Function Documentation

Void List_Params_init ( List_Params params)

Initialize this config-params structure with supplier-specified defaults before instance creation.

Parameters:
paramsInstance config-params structure.
See also:
List_create
List_Handle List_create ( List_Params params,
Error_Block eb 
)

Function to create a list object.

Parameters:
paramsPointer to list creation parameters. If NULL is passed, default parameters are used.
ebUnused
Return values:
List-handleHandle to the list object
See also:
List_delete
Void List_delete ( List_Handle handlePtr)

Function to delete a list object.

Parameters:
handlePtrPointer to the list handle
See also:
List_delete
Void List_construct ( List_Object obj,
List_Params params 
)

Function to construct a list object. This function is used when memory for the list object is not to be allocated by the List API.

Parameters:
objPointer to the list object to be constructed
paramsPointer to list construction parameters. If NULL is passed, default parameters are used.
See also:
List_destruct
Void List_destruct ( List_Object obj)

Function to destruct a list object.

Parameters:
objPointer to the list object to be destructed
See also:
List_construct
Void List_elemClear ( List_Elem elem)

Function to clear element contents.

Parameters:
elemElement to be cleared
See also:
Bool List_empty ( List_Handle  handle)

Function to check if list is empty.

Parameters:
handlePointer to the list
Return values:
TRUEList is empty
FALSEList is not empty
See also:
Ptr List_get ( List_Handle  handle)

Function to get first element of List.

Parameters:
handlePointer to the list
Return values:
NULLOperation failed
Valid-pointerPointer to first element
See also:
List_put
Void List_put ( List_Handle  handle,
List_Elem elem 
)

Function to insert element at the end of List.

Parameters:
handlePointer to the list
elemElement to be inserted
See also:
List_get
Ptr List_next ( List_Handle  handle,
List_Elem elem 
)

Function to traverse to the next element in the list (non atomic)

Parameters:
handlePointer to the list
elemPointer to the current element
Return values:
NULLOperation failed
Valid-pointerPointer to next element
See also:
List_prev
Ptr List_prev ( List_Handle  handle,
List_Elem elem 
)

Function to traverse to the previous element in the list (non atomic)

Parameters:
handlePointer to the list
elemPointer to the current element
Return values:
NULLOperation failed
Valid-pointerPointer to previous element
See also:
List_next
Void List_insert ( List_Handle  handle,
List_Elem newElem,
List_Elem curElem 
)

Function to insert element before the existing element in the list.

Parameters:
handlePointer to the list
newElemElement to be inserted
curElemExisting element before which new one is to be inserted
See also:
List_remove
Void List_remove ( List_Handle  handle,
List_Elem elem 
)

Function to removes element from the List.

Parameters:
handlePointer to the list
elemElement to be removed
See also:
List_insert
Void List_putHead ( List_Handle  handle,
List_Elem elem 
)

Function to put the element before head.

Parameters:
handlePointer to the list
elemElement to be added at the head
See also:
List_put
Ptr List_dequeue ( List_Handle  handle)

Get element from front of List (non-atomic)

Parameters:
handlePointer to the list
Return values:
NULLOperation failed
Valid-pointerPointer to removed element
See also:
List_enqueue, List_enqueueHead
Void List_enqueue ( List_Handle  handle,
List_Elem elem 
)

Put element at end of List (non-atomic)

Parameters:
handlePointer to the list
elemElement to be put
See also:
List_dequeue
Void List_enqueueHead ( List_Handle  handle,
List_Elem elem 
)

Put element at head of List (non-atomic)

Parameters:
handlePointer to the list
elemElement to be added
See also:
List_dequeue
Copyright 2014, Texas Instruments Incorporated