Functions
listlib.c File Reference

Implementation of a doubly linked list. More...

#include <srio_types.h>
#include <ti/drv/srio/include/listlib.h>

Functions

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

Detailed Description

Implementation of a doubly linked list.

NOTE: (C) Copyright 2008, 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_listThis is the list to which the node is to be added.
[in]ptr_nodeThis is the node which is to be added.
Return values:
NotApplicable
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_dstThis is the head of the destination list.
[in]ptr_srcThis is the head of the source list.
Return values:
NotApplicable
Srio_ListNode* Srio_listGetHead ( Srio_ListNode **  ptr_list)

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

Parameters:
[in]ptr_listThis is the pointer to the list.
Return values:
Headof 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_listThis is the pointer to the node in the list.
Return values:
Nextelement 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_listThis is the pointer to the list from where nodes will be removed.
Return values:
Pointerto 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_listThis is the pointer to the list from where node will be removed.
[in]ptr_removeThis is the node which is to be removed.
Return values:
Success- 0
Error- -1

Copyright 2014, Texas Instruments Incorporated