DSMCC  17.9.0
 All Data Structures Files Functions Typedefs
linkList.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright © 2014 The DTVKit Open Software Foundation Ltd (www.dtvkit.org)
3  * Copyright © 2004 Ocean Blue Software Ltd
4  * Copyright © 2001 Koninklijke Philips Electronics N.V
5  *
6  * This file is part of a DTVKit Software Component
7  * You are permitted to copy, modify or distribute this file subject to the terms
8  * of the DTVKit 1.0 Licence which can be found in licence.txt or at www.dtvkit.org
9  *
10  * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
11  * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
12  * OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
13  *
14  * If you or your organisation is not a member of DTVKit then you have access
15  * to this source code outside of the terms of the licence agreement
16  * and you are expected to delete this and any associated files immediately.
17  * Further information on DTVKit, membership and terms can be found at www.dtvkit.org
18  *******************************************************************************/
26 #ifndef _LINKLIST_H_
27 #define _LINKLIST_H_
28 
29 
30 /*-------------------------------- Includes --------------------------------*/
31 #include "clDsmSystem.h"
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 
38 /*----------------------------- Exported Macros ----------------------------*/
39 
40 
41 /*------------------------------ Exported Types ----------------------------*/
42 typedef U16BIT ListId_t;
43 
44 typedef struct s_LLObject *P_LLObject;
45 typedef void *H_Object;
46 
47 typedef struct s_LLObject
48 {
49  P_LLControl pLLCtrl;
50  P_LLObject pNext;
51  P_LLObject pPrev;
52 } S_LLObject;
53 
54 
55 typedef struct s_LLControl
56 {
57  P_LLObject pHead;
58  P_LLObject pTail;
59  ListId_t listId;
60  U16BIT count;
61  H_Object hParent;
62 } S_LLControl;
63 
64 
65 /*------------------------------ Exported Data -----------------------------*/
66 
67 
68 /*--------------------------- Exported Prototypes --------------------------*/
69 
70 /* LinkList Control Block functions */
71 void LLCtrlBlockInit( P_LLControl pCtrl, ListId_t listId, H_Object hParent );
72 
73 E_DscError LLCreate( P_DsmCoreInst idp,
74  H_Object hParent, ListId_t listId, P_LLControl *phLlCtrl );
75 
76 void LLDestroy( P_DsmCoreInst idp, P_LLControl *phLlCtrl );
77 
78 H_Object LLHead( P_LLControl pCtrlObj );
79 H_Object LLTail( P_LLControl pCtrlObj );
80 
81 BOOLEAN LLInsertHead( P_LLControl pCtrlObj, H_Object hNewObj );
82 BOOLEAN LLInsertTail( P_LLControl pCtrlObj, H_Object hNewObj );
83 
84 H_Object LLRemoveHead( P_LLControl pCtrlObj );
85 H_Object LLRemoveTail( P_LLControl pCtrlObj );
86 
87 U16BIT LLCount( P_LLControl pCtrlObj );
88 U16BIT LListId( P_LLControl pCtrlObj );
89 
90 /* LinkList object functions */
91 void llLinkInit( P_LLObject pLinks, U32BIT numLists );
92 
93 BOOLEAN LLRemove( H_Object hListObj, ListId_t listId );
94 void LLRemoveFromAll( H_Object hListObj, U16BIT numLists );
95 
96 H_Object LLNext( H_Object obj, ListId_t listId );
97 H_Object LLPrev( H_Object obj, ListId_t listId );
98 
99 void LLReplaceAll( H_Object oldobj, H_Object newobj, U16BIT numLists );
100 
101 BOOLEAN LLCheckInListCtrl( P_LLControl pCtrlBlk, H_Object obj );
102 BOOLEAN LLCheckInListId( ListId_t listId, H_Object obj );
103 BOOLEAN LLIsObjectInList( P_LLControl pCtrlBlk, H_Object obj );
104 
105 H_Object LLParent( H_Object obj, ListId_t listId );
106 
107 
108 /*----------------------------------------------------------------------------*/
109 
110 #ifdef __cplusplus
111 }
112 #endif
113 #endif /* _LINKLIST_H_ */
General include file for clDsm library internal definitions.