/* Copyright (c) 2008-2011 Freescale Semiconductor, Inc.1* All rights reserved.2*3* Redistribution and use in source and binary forms, with or without4* modification, are permitted provided that the following conditions are met:5* * Redistributions of source code must retain the above copyright6* notice, this list of conditions and the following disclaimer.7* * Redistributions in binary form must reproduce the above copyright8* notice, this list of conditions and the following disclaimer in the9* documentation and/or other materials provided with the distribution.10* * Neither the name of Freescale Semiconductor nor the11* names of its contributors may be used to endorse or promote products12* derived from this software without specific prior written permission.13*14*15* ALTERNATIVELY, this software may be distributed under the terms of the16* GNU General Public License ("GPL") as published by the Free Software17* Foundation, either version 2 of that License or (at your option) any18* later version.19*20* THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY21* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED22* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE23* DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY24* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES25* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;26* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND27* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT28* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS29* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.30*/3132/**************************************************************************//**3334@File list.c3536@Description Implementation of list.37*//***************************************************************************/38#include "std_ext.h"39#include "list_ext.h"404142void NCSW_LIST_Append(t_List *p_NewList, t_List *p_Head)43{44t_List *p_First = NCSW_LIST_FIRST(p_NewList);4546if (p_First != p_NewList)47{48t_List *p_Last = NCSW_LIST_LAST(p_NewList);49t_List *p_Cur = NCSW_LIST_NEXT(p_Head);5051NCSW_LIST_PREV(p_First) = p_Head;52NCSW_LIST_FIRST(p_Head) = p_First;53NCSW_LIST_NEXT(p_Last) = p_Cur;54NCSW_LIST_LAST(p_Cur) = p_Last;55}56}575859int NCSW_LIST_NumOfObjs(t_List *p_List)60{61t_List *p_Tmp;62int numOfObjs = 0;6364if (!NCSW_LIST_IsEmpty(p_List))65NCSW_LIST_FOR_EACH(p_Tmp, p_List)66numOfObjs++;6768return numOfObjs;69}707172