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 
163 typedef ClRcT (*ClClistWalkCallbackT)(CL_IN ClClistDataT userData,
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 
255 extern ClRcT clClistFirstNodeAdd(CL_IN ClClistT listHead,
256  CL_IN ClClistDataT userData);
257 
288 extern ClRcT clClistLastNodeAdd(CL_IN ClClistT listHead,
289  CL_IN ClClistDataT userData);
290 
323 extern ClRcT clClistAfterNodeAdd(CL_IN ClClistT listHead,
324  CL_IN ClClistNodeT currentNode,
325  CL_IN ClClistDataT userData);
358 extern ClRcT clClistBeforeNodeAdd(CL_IN ClClistT listHead,
359  CL_IN ClClistNodeT currentNode,
360  CL_IN ClClistDataT userData);
361 
391 extern ClRcT clClistNodeDelete(CL_IN ClClistT listHead,
392  CL_IN ClClistNodeT node);
424 extern ClRcT clClistFirstNodeGet(CL_IN ClClistT listHead,
425  CL_IN ClClistNodeT* pFirstNode);
457 extern ClRcT clClistLastNodeGet(CL_IN ClClistT listHead,
458  CL_OUT ClClistNodeT *pLastNode);
459 
492 extern ClRcT clClistNextNodeGet(CL_IN ClClistT listHead,
493  CL_IN ClClistNodeT currentNode,
494  CL_OUT ClClistNodeT* pNextNode);
527 extern ClRcT clClistPreviousNodeGet(CL_IN ClClistT listHead,
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);
602 extern ClRcT clClistDataGet(CL_IN ClClistT listHead,
603  CL_IN ClClistNodeT node,
604  CL_OUT ClClistDataT *pUserData);
635 extern ClRcT clClistSizeGet(CL_IN ClClistT listHead,
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 

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