OpenClovis Logo

clClistApi.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2002-2012 OpenClovis Solutions Inc. All Rights Reserved.
3  *
4  * This file is available under a commercial license from the
5  * copyright holder or the GNU General Public License Version 2.0.
6  *
7  * The source code for this program is not published or otherwise
8  * divested of its trade secrets, irrespective of what has been
9  * deposited with the U.S. Copyright office.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * General Public License for more details.
15  *
16  * For more information, see the file COPYING provided with this
17  * material.
18  */
19 /*******************************************************************************
20  * ModuleName : utils
21  * File : clClistApi.h
22  *******************************************************************************/
23 
24 /*******************************************************************************
25  * Description :
26  *
27  * This file contains essential definitions for the Circular Linked List
28  * implementation.
29  *
30  *
31  *****************************************************************************/
32 
33 
34 /********************************************************************************/
35 /******************************** Clist APIs ************************************/
36 /********************************************************************************/
37 /* */
38 /* clClistCreate */
39 /* clClistFirstNodeAdd */
40 /* clClistLastNodeAdd */
41 /* clClistAfterNodeAdd */
42 /* clClistBeforeNodeAdd */
43 /* clClistNodeDelete */
44 /* clClistFirstNodeGet */
45 /* clClistLastNodeGet */
46 /* clClistNextNodeGet */
47 /* clClistPreviousNodeGet */
48 /* clClistWalk */
49 /* clClistDataGet */
50 /* clClistSizeGet */
51 /* clClistDelete */
52 /* */
53 /********************************************************************************/
54 
55 
67 #ifndef _CL_CLIST_API_H_
68 #define _CL_CLIST_API_H_
69 
70 #ifdef __cplusplus
71 extern "C" {
72 #endif
73 
74 #include <clCommon.h>
75 
76 
77 /******************************************************************************
78  * Data Types
79  *****************************************************************************/
83 typedef ClPtrT ClClistT;
84 
88 typedef ClPtrT ClClistNodeT;
89 
93 typedef ClPtrT ClClistDataT;
94 
99 typedef enum
100 {
114 
137  typedef void (*ClClistDeleteCallbackT)(CL_IN ClClistDataT userData);
138 
164  CL_IN void* userArg);
165 
166 
167 /************************************/
219 extern ClRcT clClistCreate(CL_IN ClUint32T maxSize,
220  CL_IN ClClistDropPolicyT dropPolicy,
221  CL_IN ClClistDeleteCallbackT fpUserDeleteCallBack,
222  CL_IN ClClistDeleteCallbackT fpUserDestroyCallBack,
223  CL_OUT ClClistT *pListHead);
224 
256  CL_IN ClClistDataT userData);
257 
289  CL_IN ClClistDataT userData);
290 
324  CL_IN ClClistNodeT currentNode,
325  CL_IN ClClistDataT userData);
359  CL_IN ClClistNodeT currentNode,
360  CL_IN ClClistDataT userData);
361 
392  CL_IN ClClistNodeT node);
425  CL_IN ClClistNodeT* pFirstNode);
458  CL_OUT ClClistNodeT *pLastNode);
459 
493  CL_IN ClClistNodeT currentNode,
494  CL_OUT ClClistNodeT* pNextNode);
528  CL_IN ClClistNodeT currentNode,
529  CL_OUT ClClistNodeT* pPreviousNode);
568 extern ClRcT clClistWalk(CL_IN ClClistT listHead,
569  CL_IN ClClistWalkCallbackT fpUserWalkCallBack,
570  CL_IN void* userArg);
603  CL_IN ClClistNodeT node,
604  CL_OUT ClClistDataT *pUserData);
636  CL_OUT ClUint32T *pSize);
668 extern ClRcT clClistDelete(CL_IN ClClistT* pListHead);
669 
670 #ifdef __cplusplus
671 }
672 #endif
673 
674 #endif /* _CL_CLIST_API_H_ */
675 
676 
Typical defines found in any software project.
ClPtrT ClClistNodeT
The type of the handle for the circular node.
Definition: clClistApi.h:88
ClClistDropPolicyT
link list with x nodes.
Definition: clClistApi.h:100
ClRcT clClistPreviousNodeGet(CL_IN ClClistT listHead, CL_IN ClClistNodeT currentNode, CL_OUT ClClistNodeT *pPreviousNode)
Returns next node from the list.
ClRcT clClistLastNodeGet(CL_IN ClClistT listHead, CL_OUT ClClistNodeT *pLastNode)
Returns last node from the list.
ClRcT clClistNextNodeGet(CL_IN ClClistT listHead, CL_IN ClClistNodeT currentNode, CL_OUT ClClistNodeT *pNextNode)
Returns next node from the list.
ClRcT clClistAfterNodeAdd(CL_IN ClClistT listHead, CL_IN ClClistNodeT currentNode, CL_IN ClClistDataT userData)
Adds a node after a specified node in the list.
ClRcT clClistNodeDelete(CL_IN ClClistT listHead, CL_IN ClClistNodeT node)
Deletes a node from the list.
ClRcT clClistDataGet(CL_IN ClClistT listHead, CL_IN ClClistNodeT node, CL_OUT ClClistDataT *pUserData)
Retrieves data from a node in the list.
ClPtrT ClClistT
The type of the handle for the circular list.
Definition: clClistApi.h:83
ClRcT clClistSizeGet(CL_IN ClClistT listHead, CL_OUT ClUint32T *pSize)
Returns number of data elements (nodes) in the list.
ClRcT clClistBeforeNodeAdd(CL_IN ClClistT listHead, CL_IN ClClistNodeT currentNode, CL_IN ClClistDataT userData)
Adds a node before a specified node in the list.
ClRcT clClistWalk(CL_IN ClClistT listHead, CL_IN ClClistWalkCallbackT fpUserWalkCallBack, CL_IN void *userArg)
Walks through the list.
void(* ClClistDeleteCallbackT)(CL_IN ClClistDataT userData)
Delete callback gets called, whenever a Node is getting deleted.
Definition: clClistApi.h:137
ClPtrT ClClistDataT
The type of the handle for the user-data.
Definition: clClistApi.h:93
ClRcT clClistDelete(CL_IN ClClistT *pListHead)
Destroys the list.
ClRcT clClistCreate(CL_IN ClUint32T maxSize, CL_IN ClClistDropPolicyT dropPolicy, CL_IN ClClistDeleteCallbackT fpUserDeleteCallBack, CL_IN ClClistDeleteCallbackT fpUserDestroyCallBack, CL_OUT ClClistT *pListHead)
Creates a Circular Linked List.
ClRcT(* ClClistWalkCallbackT)(CL_IN ClClistDataT userData, CL_IN void *userArg)
Walk Callback gets called, whenever traverse happens on the Circular linked list.
Definition: clClistApi.h:163
ClRcT clClistFirstNodeAdd(CL_IN ClClistT listHead, CL_IN ClClistDataT userData)
Adds a node at the beginning of the list.
ClRcT clClistFirstNodeGet(CL_IN ClClistT listHead, CL_IN ClClistNodeT *pFirstNode)
Returns the first node from the list.
ClRcT clClistLastNodeAdd(CL_IN ClClistT listHead, CL_IN ClClistDataT userData)
Adds a node at the end of the list.
@ CL_NO_DROP
If the first node not to be dropped even if the list is full.
Definition: clClistApi.h:104
@ CL_DROP_FIRST
Drops the first node if the list is full.
Definition: clClistApi.h:108
@ CL_DROP_MAX_TYPE
Adds a new drop policy types before this.
Definition: clClistApi.h:112
ClUint32T ClRcT
Clovis return code type.
Definition: clCommon.h:168
#define CL_OUT
CL_OUT macro assists in clearly defining arguments of an API, but has no actual meaning.
Definition: clCommon.h:110
#define CL_IN
CL_IN macro assists in clearly defining arguments of an API, but has no actual meaning.
Definition: clCommon.h:106

Generated on Tue Jan 10 10:29:15 PST 2012 for OpenClovis SDK using Doxygen