listlib.h File Reference

Header file for the linked list library. More...

Functions

void Srio_listAdd (Srio_ListNode **ptr_list, Srio_ListNode *ptr_node)
Srio_ListNode * Srio_listRemove (Srio_ListNode **ptr_list)
Srio_ListNode * Srio_listGetHead (Srio_ListNode **ptr_list)
Srio_ListNode * Srio_listGetNext (Srio_ListNode *ptr_list)
int32_t Srio_listRemoveNode (Srio_ListNode **ptr_list, Srio_ListNode *ptr_remove)
void Srio_listCat (Srio_ListNode **ptr_dst, Srio_ListNode **ptr_src)

Detailed Description

Header file for the linked list library.

NOTE: (C) Copyright 2009 Texas Instruments, Inc.

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.


Function Documentation

void Srio_listAdd ( Srio_ListNode **  ptr_list,
Srio_ListNode *  ptr_node 
)

Description
The function is called to add a node to the list.

Parameters:
[in] ptr_list This is the list to which the node is to be added.
[in] ptr_node This is the node which is to be added.
Return values:
Not Applicable
void Srio_listCat ( Srio_ListNode **  ptr_dst,
Srio_ListNode **  ptr_src 
)

Description
The function is called to concatenate the src list to the end of the destination list.

Parameters:
[in] ptr_dst This is the head of the destination list.
[in] ptr_src This is the head of the source list.
Return values:
Not Applicable
Srio_ListNode* Srio_listGetHead ( Srio_ListNode **  ptr_list  ) 

Description
The function is used to get the head of the specific list

Parameters:
[in] ptr_list This is the pointer to the list.
Return values:
Head of the list (could be NULL if the list is empty)
Srio_ListNode* Srio_listGetNext ( Srio_ListNode *  ptr_list  ) 

Description
The function is used to get the next element in the list.

Parameters:
[in] ptr_list This is the pointer to the node in the list.
Return values:
Next element in the list. (could be NULL if this is the last element)
Srio_ListNode* Srio_listRemove ( Srio_ListNode **  ptr_list  ) 

Description
The function is called to remove the head node from the list.

Parameters:
[in] ptr_list This is the pointer to the list from where nodes will be removed.
Return values:
Pointer to the head of the list.
int32_t Srio_listRemoveNode ( Srio_ListNode **  ptr_list,
Srio_ListNode *  ptr_remove 
)

Description
The function is called to remove the specified node from the list.

Parameters:
[in] ptr_list This is the pointer to the list from where node will be removed.
[in] ptr_remove This is the node which is to be removed.
Return values:
Success - 0
Error - -1

Copyright 2012, Texas Instruments Incorporated