OpenClovis Logo

Files | Typedefs | Enumerations | Functions
API Reference Pages
Circular List Management

Defines, Structures, Typedefs, Functions. More...

Files

file  clClistApi.h
 Header file of Circular List Management related APIs.
file  clClistErrors.h
 Header file of Circular List Management related Error Codes.

Typedefs

typedef ClPtrT ClClistDataT
 The type of the handle for the user-data.
typedef void(* ClClistDeleteCallbackT )(CL_IN ClClistDataT userData)
 Delete callback gets called, whenever a Node is getting deleted.
typedef ClPtrT ClClistNodeT
 The type of the handle for the circular node.
typedef ClPtrT ClClistT
 The type of the handle for the circular list.
typedef ClRcT(* ClClistWalkCallbackT )(CL_IN ClClistDataT userData, CL_IN void *userArg)
 Walk Callback gets called, whenever traverse happens on the Circular linked list.

Enumerations

enum  ClClistDropPolicyT {
  CL_NO_DROP = 0,
  CL_DROP_FIRST,
  CL_DROP_MAX_TYPE
}
 link list with x nodes. More...

Functions

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 clClistBeforeNodeAdd (CL_IN ClClistT listHead, CL_IN ClClistNodeT currentNode, CL_IN ClClistDataT userData)
 Adds a node before a specified node in 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 clClistDataGet (CL_IN ClClistT listHead, CL_IN ClClistNodeT node, CL_OUT ClClistDataT *pUserData)
 Retrieves data from a node in the list.
ClRcT clClistDelete (CL_IN ClClistT *pListHead)
 Destroys the list.
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.
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 clClistNodeDelete (CL_IN ClClistT listHead, CL_IN ClClistNodeT node)
 Deletes a node from the list.
ClRcT clClistPreviousNodeGet (CL_IN ClClistT listHead, CL_IN ClClistNodeT currentNode, CL_OUT ClClistNodeT *pPreviousNode)
 Returns next node from the list.
ClRcT clClistSizeGet (CL_IN ClClistT listHead, CL_OUT ClUint32T *pSize)
 Returns number of data elements (nodes) in the list.
ClRcT clClistWalk (CL_IN ClClistT listHead, CL_IN ClClistWalkCallbackT fpUserWalkCallBack, CL_IN void *userArg)
 Walks through the list.

Detailed Description

Defines, Structures, Typedefs, Functions.

Typedef Documentation

typedef void(* ClClistDeleteCallbackT)(CL_IN ClClistDataT userData)

Delete callback gets called, whenever a Node is getting deleted.

Header File:
clClistApi.h
Parameters
userData(in) Data of the node is being deleted.
Return values
none
Description:
This dequeue callback function gets called, whenever user performs node deletion on the Circular list. The Data of the node will be exposed to the user on the callback. This is the place where user can cleanup their data.
Library File:
ClUtil
See Also
clQueueCreate(), clQueueDelete()
typedef ClRcT(* ClClistWalkCallbackT)(CL_IN ClClistDataT userData, CL_IN void *userArg)

Walk Callback gets called, whenever traverse happens on the Circular linked list.

Header File:
clCntApi.h
Parameters
userData(in) Data of the node is being accessed.
userArg(in) User arg of the callback function
Return values
none
Description:
This Walk callback function gets called, whenever user performs traverse on the Circular Linked List. User can pass any cookie variable as UserArgument, that will be passed as part of the callback function.
Library File:
ClUtil
See Also
clQueueCreate(), clQueueDelete()

Enumeration Type Documentation

link list with x nodes.

It decides the action to be taken when the linked list is full. The values of the ClClistDropPolicyT enumeration type have the following interpretation:

Enumerator:
CL_NO_DROP 

If the first node not to be dropped even if the list is full.

CL_DROP_FIRST 

Drops the first node if the list is full.

CL_DROP_MAX_TYPE 

Adds a new drop policy types before this.

Function Documentation

ClRcT clClistAfterNodeAdd ( CL_IN ClClistT  listHead,
CL_IN ClClistNodeT  currentNode,
CL_IN ClClistDataT  userData 
)

Adds a node after a specified node in the list.

Header File:
clClistApi.h
Parameters
listHead(in) Handle of list returned by the create API.
currentNode(in) Handle of node after which the specified data must be added.
userData(in) User-data. Memory allocation and de-allocation for user-data must be done by you.
Return values
CL_OKThe API executed successfully.
CL_ERR_NO_MEMORYOn memory allocation failure.
CL_ERR_MAXSIZE_REACHEDIf the maximum size is reached.
CL_ERR_INVALID_HANDLEOn passing an invalid handle.
Note
Returned error is a combination of the Component Identifier and Error Code. Here as Return values only the Error Codes are listed. Use CL_GET_ERROR_CODE(RET_CODE) defined in clCommonErrors.h to get the error code.
Description:
This API adds a node after a specified node in the Circular Linked list.
Library File:
ClUtil
See Also
clClistDelete(), clClistCreate(), clClistLastNodeAdd(), clClistFirstNodeAdd()
ClRcT clClistBeforeNodeAdd ( CL_IN ClClistT  listHead,
CL_IN ClClistNodeT  currentNode,
CL_IN ClClistDataT  userData 
)

Adds a node before a specified node in the list.

Header File:
clClistApi.h
Parameters
listHead(in) Handle of list returned by the create API.
currentNode(in) Handle of node before which the specified data must be added.
userData(in) User-data. Memory allocation and de-allocation for user-data must be done by you.
Return values
CL_OKThe API executed successfully.
CL_ERR_NO_MEMORYOn memory allocation failure.
CL_ERR_MAXSIZE_REACHEDIf the maximum size is reached.
CL_ERR_INVALID_HANDLEOn passing an invalid handle.
Note
Returned error is a combination of the Component Identifier and Error Code. Here as Return values only the Error Codes are listed. Use CL_GET_ERROR_CODE(RET_CODE) defined in clCommonErrors.h to get the error code.
Description:
This API adds a node before a specified node in the Circular Linked list.
Library File:
ClUtil
See Also
clClistDelete(), clClistCreate(), clClistNextNodeGet() clClistFirstNodeAdd(), clClistLastNodeAdd()
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.

Header File
clClistApi.h
Parameters
maxSize(in) Maximum size of the list. It specifies the maximum number of nodes that can exist at any point of time in the list. This must be an unsigned integer. You can add nodes into the list until this maximum limit is reached. If you specify this parameter as 0, then, there is no limit on the size of the list.
dropPolicy(in) Drop policy for the list. Whenever you try to add a node in the list and the list is full, if this policy is set to CL_DROP_FIRST, the first node is dropped and the specified node is added. If this parameter is set to CL_NO_DROP, then an error is returned. This parameter is valid, only if the list is of fixed size.
fpUserDeleteCallBack(in) Pointer to the delete callback function of the user. This function accepts a parameter of type ClClistDataT. After deleting the specified node, the user data stored in that node is passed as an argument to the call back function.
fpUserDestroyCallBacK(in) Pointer to the user's destroy callback function. This function accepts a parameter of type ClClistDataT. When destroying, the user data stored in each node is passed as an argument to the call back function, one by one.
pListHead(out) Pointer to the variable of type ClClistT in which the function returns a valid list handle on successful creation of the list.
Return values
CL_OKThe API executed successfully.
CL_ERR_NULL_POINTEROn passing a NULL pointer.
CL_ERR_NO_MEMORYOn memory allocation failure.
Note
Returned error is a combination of the Component Identifier and Error Code. Here as Return values only the Error Codes are listed. Use CL_GET_ERROR_CODE(RET_CODE) defined in clCommonErrors.h to get the error code.
Description:
This API creates and initializes the Circular Linked list.
Library File:
ClUtil
See Also
clClistDelete()
ClRcT clClistDataGet ( CL_IN ClClistT  listHead,
CL_IN ClClistNodeT  node,
CL_OUT ClClistDataT pUserData 
)

Retrieves data from a node in the list.

Header File:
clClistApi.h
Parameters
listHead(in) Handle of list returned by the create API.
node(in) Handle of the node.
pUserData(out) Pointer to variable of type ClClistDataT.
Return values
CL_OKThe API executed successfully.
CL_ERR_NULL_POINTEROn passing a NULL pointer.
CL_ERR_INVALID_HANDLEOn passing an invalid handle.
Note
Returned error is a combination of the Component Identifier and Error Code. Here as Return values only the Error Codes are listed. Use CL_GET_ERROR_CODE(RET_CODE) defined in clCommonErrors.h to get the error code.
Description:
This API retrieves data from the specified node in the list.
Library File:
ClUtil
See Also
clClistDelete(), clClistCreate(), clClistFirstNodeGet(), clClistLastNodeGet()
ClRcT clClistDelete ( CL_IN ClClistT pListHead)

Destroys the list.

Header File:
clClistApi.h
Parameters
pListHead(in) Handle of list returned by the create API.
Return values
CL_OKThe API executed successfully.
CL_ERR_NULL_POINTEROn passing a NULL pointer.
CL_ERR_INVALID_HANDLEOn passing an invalid handle.
Note
Returned error is a combination of the Component Identifier and Error Code. Here as Return values only the Error Codes are listed. Use CL_GET_ERROR_CODE(RET_CODE) defined in clCommonErrors.h to get the error code.
Description:
This API deletes all the nodes in the list. The destroy callback function, registered during the creation, is called for every node in the list with the corresponding data.
Library File:
ClUtil
See Also
clClistDelete(), clClistCreate(), clClistFirstNodeGet(), clClistLastNodeGet()
ClRcT clClistFirstNodeAdd ( CL_IN ClClistT  listHead,
CL_IN ClClistDataT  userData 
)

Adds a node at the beginning of the list.

Header File:
clClistApi.h
Parameters
listHead(in) Handle of list returned by the create API.
userData(in) User-data. Memory allocation and de-allocation for user-data must be done by you.
Return values
CL_OKThe API executed successfully.
CL_ERR_NO_MEMORYOn memory allocation failure.
CL_ERR_MAXSIZE_REACHEDIf the maximum size is reached.
CL_ERR_INVALID_HANDLEOn passing an invalid handle.
Note
Returned error is a combination of the Component Identifier and Error Code. Here as Return values only the Error Codes are listed. Use CL_GET_ERROR_CODE(RET_CODE) defined in clCommonErrors.h to get the error code.
Description:
This API adds a node at the beginning of the Circular Linked list.
Library File:
ClUtil
See Also
clClistCreate(), clClistDelete()
ClRcT clClistFirstNodeGet ( CL_IN ClClistT  listHead,
CL_IN ClClistNodeT pFirstNode 
)

Returns the first node from the list.

Header File:
clClistApi.h
Parameters
listHead(in) Handle of list returned by the create API.
pFirstNode(out) Pointer to variable of type ClClistNodeT.
Return values
CL_OKThe API executed successfully.
CL_ERR_NULL_POINTEROn passing a NULL pointer.
CL_ERR_INVALID_HANDLEOn passing an invalid handle.
CL_ERR_NOT_EXISTIf the list is empty (an acceptable way to check for length 0 lists).
Note
Returned error is a combination of the Component Identifier and Error Code. Here as Return values only the Error Codes are listed. Use CL_GET_ERROR_CODE(RET_CODE) defined in clCommonErrors.h to get the error code.
Description:
This API returns the first node from the Circular Linked list.
Library File:
ClUtil
See Also
clClistDelete()
ClRcT clClistLastNodeAdd ( CL_IN ClClistT  listHead,
CL_IN ClClistDataT  userData 
)

Adds a node at the end of the list.

Header File:
clClistApi.h
Parameters
listHead(in) Handle of list returned by the create API.
userData(in) User-data. Memory allocation and de-allocation for user-data must be done by you.
Return values
CL_OKThe API executed successfully.
CL_ERR_NO_MEMORYOn memory allocation failure.
CL_ERR_MAXSIZE_REACHEDIf the maximum size is reached.
CL_ERR_INVALID_HANDLEOn passing an invalid handle.
Note
Returned error is a combination of the Component Identifier and Error Code. Here as Return values only the Error Codes are listed. Use CL_GET_ERROR_CODE(RET_CODE) defined in clCommonErrors.h to get the error code.
Description:
This API adds a node at the end of the Circular Linked list.
Library File:
ClUtil
See Also
clClistDelete(), clClistCreate(), clClistFirstNodeAdd()
ClRcT clClistLastNodeGet ( CL_IN ClClistT  listHead,
CL_OUT ClClistNodeT pLastNode 
)

Returns last node from the list.

Header File:
clClistApi.h
Parameters
listHead(in) Handle of list returned by the create API.
pLastNode(out) Pointer to variable of type ClClistNodeT.
Return values
CL_OKThe API executed successfully.
CL_ERR_NULL_POINTEROn passing a NULL pointer.
CL_ERR_INVALID_HANDLEOn passing an invalid handle.
CL_ERR_NOT_EXISTIf the list is empty.
Note
Returned error is a combination of the Component Identifier and Error Code. Here as Return values only the Error Codes are listed. Use CL_GET_ERROR_CODE(RET_CODE) defined in clCommonErrors.h to get the error code.
Description:
This API is used to return the last node from the Circular Linked list.
Library File:
ClUtil
See Also
clClistDelete(), clClistCreate(), clClistFirstNodeGet(), clClistLastNodeGet()
ClRcT clClistNextNodeGet ( CL_IN ClClistT  listHead,
CL_IN ClClistNodeT  currentNode,
CL_OUT ClClistNodeT pNextNode 
)

Returns next node from the list.

Header File:
clClistApi.h
Parameters
listHead(in) Handle of list returned by the create API.
currentNode(in) Handle of the current node.
pNextNode(out) Pointer to variable of type ClClistNodeT.
Return values
CL_OKThe API executed successfully.
CL_ERR_NULL_POINTEROn passing a NULL pointer.
CL_ERR_INVALID_HANDLEOn passing an invalid handle.
CL_ERR_NOT_EXISTIf the list is empty.
Note
Returned error is a combination of the Component Identifier and Error Code. Here as Return values only the Error Codes are listed. Use CL_GET_ERROR_CODE(RET_CODE) defined in clCommonErrors.h to get the error code.
Description:
This API is used to return the next node of the specified node from the Circular Linked list.
Library File:
ClUtil
See Also
clClistDelete(), clClistCreate(), clClistFirstNodeGet(), clClistLastNodeGet()
ClRcT clClistNodeDelete ( CL_IN ClClistT  listHead,
CL_IN ClClistNodeT  node 
)

Deletes a node from the list.

Header File:
clClistApi.h
Parameters
listHead(in) Handle of list returned by the create API.
node(in) Handle of node which is to be deleted.
Return values
CL_OKThe API executed successfully.
CL_ERR_INVALID_HANDLEOn passing an invalid handle.
Note
Returned error is a combination of the Component Identifier and Error Code. Here as Return values only the Error Codes are listed. Use CL_GET_ERROR_CODE(RET_CODE) defined in clCommonErrors.h to get the error code.
Description:
This API deletes the specified node from the Circular Linked list. The delete callback function, registered during the creation is called with the data in the node to be deleted.
Library File:
ClUtil
See Also
clClistDelete()
ClRcT clClistPreviousNodeGet ( CL_IN ClClistT  listHead,
CL_IN ClClistNodeT  currentNode,
CL_OUT ClClistNodeT pPreviousNode 
)

Returns next node from the list.

Header File:
clClistApi.h
Parameters
listHead(in) Handle of list returned by the create API.
currentNode(in) Handle of the current node.
pPreviousNode(out) Pointer to variable of type ClClistNodeT.
Return values
CL_OKThe API executed successfully.
CL_ERR_NULL_POINTEROn passing a NULL pointer.
CL_ERR_INVALID_HANDLEOn passing an invalid handle.
CL_ERR_NOT_EXISTIf the list is empty.
Note
Returned error is a combination of the Component Identifier and Error Code. Here as Return values only the Error Codes are listed. Use CL_GET_ERROR_CODE(RET_CODE) defined in clCommonErrors.h to get the error code.
Description:
This API is used to return the previous node of the specified node from the Circular Linked list.
Library File:
ClUtil
See Also
clClistDelete(), clClistCreate(), clClistFirstNodeGet(), clClistLastNodeGet()
ClRcT clClistSizeGet ( CL_IN ClClistT  listHead,
CL_OUT ClUint32T *  pSize 
)

Returns number of data elements (nodes) in the list.

Header File:
clClistApi.h
Parameters
listHead(in) Handle of list returned by the create API.
pSize(out) Pointer to variable of type ClUint32T.
Return values
CL_OKThe API executed successfully.
CL_ERR_NULL_POINTEROn passing a NULL pointer.
CL_ERR_INVALID_HANDLEOn passing an invalid handle.
Note
Returned error is a combination of the Component Identifier and Error Code. Here as Return values only the Error Codes are listed. Use CL_GET_ERROR_CODE(RET_CODE) defined in clCommonErrors.h to get the error code.
Description:
This API is used to return the number of data elements (nodes) in the list.
Library File:
ClUtil
See Also
clClistDelete(), clClistCreate(), clClistFirstNodeGet(), clClistLastNodeGet()
ClRcT clClistWalk ( CL_IN ClClistT  listHead,
CL_IN ClClistWalkCallbackT  fpUserWalkCallBack,
CL_IN void *  userArg 
)

Walks through the list.

Header File:
clClistApi.h
Parameters
listHead(in) Handle of list returned by the create API.
fpUserWalkCallBack(in) Pointer to user callback function. It can have two values:
  • The first parameter must be of type ClClistDataT.
  • The second parameter must be of type void *.
    The user-data stored in each node is passed one-by-one as the first argument to the callback function.
userArg(in) User-specified argument. This variable is passed as the second argument to the callback function.
Return values
CL_OKThe API executed successfully.
CL_ERR_NULL_POINTEROn passing a NULL pointer.
CL_ERR_INVALID_HANDLEOn passing an invalid handle.
Note
Returned error is a combination of the Component Identifier and Error Code. Here as Return values only the Error Codes are listed. Use CL_GET_ERROR_CODE(RET_CODE) defined in clCommonErrors.h to get the error code.
Description:
This API performs a walk on the Circular Linked list. The user-specified callback function is called with every node's data.
Library File:
ClUtil
See Also
clClistDelete(), clClistCreate(), clClistFirstNodeGet(), clClistLastNodeGet()

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