Main Page | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

List.h File Reference


Detailed Description

Creates a doubly linked list.

It works as utils for other modules

02.00.00.68_beta1

============================================================================

Copyright (c) 2008-2009, Texas Instruments Incorporated

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

* Neither the name of Texas Instruments Incorporated nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Contact information for paper mail: Texas Instruments Post Office Box 655303 Dallas, Texas 75265 Contact information: http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm? DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact ============================================================================

Definition in file List.h.

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...

Defines

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

Typedefs

typedef List_Elem_tag List_Elem
 Structure defining object for the list element.
typedef List_Object_tag List_Object
 Structure defining object for the list.
typedef List_ObjectList_Handle
 Defines List handle type.
typedef 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).


Define 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.

Definition at line 70 of file List.h.


Typedef Documentation

typedef struct List_Elem_tag List_Elem
 

Structure defining object for the list element.

typedef List_Object* List_Handle
 

Defines List handle type.

Definition at line 91 of file List.h.

typedef struct List_Object_tag List_Object
 

Structure defining object for the list.

typedef struct List_Params_tag List_Params
 

Structure defining params for the list.


Function Documentation

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:
obj Pointer to the list object to be constructed
params Pointer to list construction parameters. If NULL is passed, default parameters are used.
See also:
List_destruct

List_Handle List_create List_Params params,
Error_Block eb
 

Function to create a list object.

Parameters:
params Pointer to list creation parameters. If NULL is passed, default parameters are used.
Return values:
List-handle Handle to the list object
See also:
List_delete

Void List_delete List_Handle handlePtr  ) 
 

Function to delete a list object.

Parameters:
handlePtr Pointer to the list handle
See also:
List_delete

Ptr List_dequeue List_Handle  handle  ) 
 

Get element from front of List (non-atomic).

Parameters:
handle Pointer to the list
Return values:
NULL Operation failed
Valid-pointer Pointer to removed element
See also:
List_enqueue, List_enqueueHead

Void List_destruct List_Object obj  ) 
 

Function to destruct a list object.

Parameters:
obj Pointer to the list object to be destructed
See also:
List_construct

Void List_elemClear List_Elem elem  ) 
 

Function to clear element contents.

Parameters:
elem Element to be cleared
See also:

Bool List_empty List_Handle  handle  ) 
 

Function to check if list is empty.

Parameters:
handle Pointer to the list
Return values:
TRUE List is empty
FALSE List is not empty
See also:

Void List_enqueue List_Handle  handle,
List_Elem elem
 

Put element at end of List (non-atomic).

Parameters:
handle Pointer to the list
elem Element 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:
handle Pointer to the list
elem Element to be added
See also:
List_dequeue

Ptr List_get List_Handle  handle  ) 
 

Function to get first element of List.

Parameters:
handle Pointer to the list
Return values:
NULL Operation failed
Valid-pointer Pointer to first element
See also:
List_put

Void List_insert List_Handle  handle,
List_Elem newElem,
List_Elem curElem
 

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

Parameters:
handle Pointer to the list
newElem Element to be inserted
curElem Existing element before which new one is to be inserted
See also:
List_remove

Ptr List_next List_Handle  handle,
List_Elem elem
 

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

Parameters:
handle Pointer to the list
elem Pointer to the current element
Return values:
NULL Operation failed
Valid-pointer Pointer to next element
See also:
List_prev

Void List_Params_init List_Params params  ) 
 

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

Parameters:
params Instance config-params structure.
See also:
List_create

Ptr List_prev List_Handle  handle,
List_Elem elem
 

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

Parameters:
handle Pointer to the list
elem Pointer to the current element
Return values:
NULL Operation failed
Valid-pointer Pointer to previous element
See also:
List_next

Void List_put List_Handle  handle,
List_Elem elem
 

Function to insert element at the end of List.

Parameters:
handle Pointer to the list
elem Element to be inserted
See also:
List_get

Void List_putHead List_Handle  handle,
List_Elem elem
 

Function to put the element before head.

Parameters:
handle Pointer to the list
elem Element to be added at the head
See also:
List_put

Void List_remove List_Handle  handle,
List_Elem elem
 

Function to removes element from the List.

Parameters:
handle Pointer to the list
elem Element to be removed
See also:
List_insert


Generated on Mon Mar 14 11:59:47 2011 for Syslink by  doxygen 1.4.4