Code Examples.
Code Examples.
The Container library is used as a repository of data. The following scenarios can be used to perform various functions with a linked list Container:
void* key = XXXX;
void* data = malloc(10);
int retCode;
}
}
{
}
else {
}
}
retCode = cclKeyDelete(containerHandle, key);
}
}
ClRcT clCntNodeUserDataGet(CL_IN ClCntHandleT containerHandle, CL_IN ClCntNodeHandleT nodeHandle, CL_OUT ClCntDataHandleT *pUserDataHandle)
Returns the user-data from the node.
ClRcT clCntNodeUserKeyGet(CL_IN ClCntHandleT containerHandle, CL_IN ClCntNodeHandleT nodeHandle, CL_OUT ClCntKeyHandleT *pUserKey)
Returns the user-key from the node.
ClPtrT ClCntNodeHandleT
Handle of the container Node.
Definition: clCntApi.h:93
ClPtrT ClCntHandleT
Handle of the container.
Definition: clCntApi.h:88
ClRcT clCntNodeAdd(CL_IN ClCntHandleT containerHandle, CL_IN ClCntKeyHandleT userKey, CL_IN ClCntDataHandleT userData, CL_IN ClRuleExprT *rbeExpression)
Adds a new node to Container.
ClRcT clCntLlistCreate(CL_IN ClCntKeyCompareCallbackT fpKeyCompare, CL_IN ClCntDeleteCallbackT fpUserDeleteCallback, CL_IN ClCntDeleteCallbackT fpUserDestroyCallback, CL_IN ClCntKeyTypeT containerKeyType, CL_OUT ClCntHandleT *pContainerHandle)
Creates the container doubly linked list.
ClRcT clCntNodeFind(CL_IN ClCntHandleT containerHandle, CL_IN ClCntKeyHandleT userKey, CL_IN ClCntNodeHandleT *pNodeHandle)
Finds a specific node in the Container.
@ CL_CNT_NON_UNIQUE_KEY
Container contains non unique key.
Definition: clCntApi.h:119
#define CL_OK
Every thing is OK.
Definition: clCommonErrors.h:68
Use the following scenario to traverse through the Container .
unsigned int key = XXXX;
void* data = YYYYYY;
int retCode;
}
for(i = 0; i < 100; i++)
{
break;
}
}
if(nodeHandle !=0){
nodeHandle, &data);
}
nodeHandle, &key);
}
}
for ( i = 0; i < 100; i++)
{
&nodeHandle);
if(nodeHankle == 0){
break;
}
}
ClRcT clCntFirstNodeGet(CL_IN ClCntHandleT containerHandle, CL_OUT ClCntNodeHandleT *pNodeHandle)
Returns the first node from the Container.
ClRcT clCntNextNodeGet(CL_IN ClCntHandleT containerHandle, CL_IN ClCntNodeHandleT currentNodeHandle, CL_OUT ClCntNodeHandleT *pNextNodeHandle)
Returns the next node from the Container.
ClRcT clCntPreviousNodeGet(CL_IN ClCntHandleT containerHandle, CL_IN ClCntNodeHandleT currentNodeHandle, CL_OUT ClCntNodeHandleT *pPreviousNodeHandle)
Returns the previous node from the Container.
ClRcT clCntLastNodeGet(CL_IN ClCntHandleT containerHandle, CL_OUT ClCntNodeHandleT *pNodeHandle)
Returns the last node from the Container.