DSMCC  15.3.1
source/dscore/src/linkList.h
Go to the documentation of this file.
00001 /*******************************************************************************
00002  * Copyright © 2014 The DTVKit Open Software Foundation Ltd (www.dtvkit.org)
00003  * Copyright © 2004 Ocean Blue Software Ltd
00004  * Copyright © 2001 Koninklijke Philips Electronics N.V
00005  *
00006  * This file is part of a DTVKit Software Component
00007  * You are permitted to copy, modify or distribute this file subject to the terms
00008  * of the DTVKit 1.0 Licence which can be found in licence.txt or at www.dtvkit.org
00009  * 
00010  * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
00011  * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
00012  * OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
00013  * 
00014  * If you or your organisation is not a member of DTVKit then you have access
00015  * to this source code outside of the terms of the licence agreement
00016  * and you are expected to delete this and any associated files immediately.
00017  * Further information on DTVKit, membership and terms can be found at www.dtvkit.org
00018  *******************************************************************************/
00026 #ifndef _LINKLIST_H_
00027 #define _LINKLIST_H_
00028 
00029 
00030 /*--------------------------------  Includes  --------------------------------*/
00031 #include "clDsmSystem.h"
00032 
00033 #ifdef __cplusplus
00034 extern "C" {
00035 #endif
00036 
00037 
00038 /*-----------------------------  Exported Macros  ----------------------------*/
00039 
00040 
00041 /*------------------------------  Exported Types  ----------------------------*/
00042 typedef U16BIT ListId_t;
00043 
00044 typedef struct s_LLObject  *P_LLObject;
00045 typedef void*  H_Object;
00046 
00047 typedef struct s_LLObject
00048 {
00049     P_LLControl   pLLCtrl;
00050     P_LLObject    pNext;
00051     P_LLObject    pPrev;
00052 } S_LLObject;
00053 
00054 
00055 typedef struct s_LLControl
00056 {
00057     P_LLObject pHead;
00058     P_LLObject pTail;
00059     ListId_t   listId;
00060     U16BIT     count;
00061     H_Object   hParent;
00062 } S_LLControl;
00063 
00064 
00065 /*------------------------------  Exported Data  -----------------------------*/
00066 
00067 
00068 /*---------------------------  Exported Prototypes  --------------------------*/
00069 
00070 /* LinkList Control Block functions */
00071 clDsmErr_t LLCreate( pclDsmInstData_t idp,
00072                     H_Object hParent, ListId_t listId, P_LLControl *phLlCtrl );
00073 
00074 void LLDestroy( pclDsmInstData_t idp, P_LLControl *phLlCtrl );
00075 
00076 H_Object LLHead( P_LLControl pCtrlObj );
00077 H_Object LLTail( P_LLControl pCtrlObj );
00078 
00079 BOOLEAN LLInsertHead( P_LLControl pCtrlObj, H_Object hNewObj );
00080 BOOLEAN LLInsertTail( P_LLControl pCtrlObj, H_Object hNewObj );
00081 
00082 H_Object LLRemoveHead( P_LLControl pCtrlObj );
00083 H_Object LLRemoveTail( P_LLControl pCtrlObj );
00084 
00085 U16BIT LLCount( P_LLControl pCtrlObj );
00086 U16BIT LListId( P_LLControl pCtrlObj );
00087 
00088 /* LinkList object functions */
00089 void llLinkInit( P_LLObject pLinks, U32BIT numLists );
00090 
00091 BOOLEAN LLRemove( H_Object hListObj, ListId_t listId );
00092 void LLRemoveFromAll( H_Object hListObj, U16BIT numLists );
00093 
00094 H_Object LLNext( H_Object obj, ListId_t listId );
00095 H_Object LLPrev( H_Object obj, ListId_t listId );
00096 
00097 void LLReplaceAll( H_Object oldobj, H_Object newobj, U16BIT numLists );
00098 
00099 BOOLEAN LLCheckInListCtrl( P_LLControl pCtrlBlk, H_Object obj );
00100 BOOLEAN LLCheckInListId( ListId_t listId, H_Object obj );
00101 
00102 H_Object LLParent( H_Object obj, ListId_t listId );
00103 
00104 
00105 /*----------------------------------------------------------------------------*/
00106 
00107 #ifdef __cplusplus
00108 }
00109 #endif
00110 #endif /* _LINKLIST_H_ */
 All Data Structures Files Functions Typedefs