OpenClovis Logo

Files | Classes | Macros | Typedefs | Enumerations | Functions
API Reference Pages
Rule Based Engine (RBE)

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

Files

file  clRuleApi.h
 Header file of RBE related APIs.
file  clRuleErrors.h
 Header file of Rule Based Engine related Error Codes.

Classes

struct  ClRuleExpr
 Rule to filter data.Expression definition. More...

Macros

#define CL_RULE_EXPR_FLAG_BITS   (2)
 cl.rbe
#define CL_RULE_SWAP32(x)
 Macros to convert big-to-little endian and vice versa.

Typedefs

typedef struct ClRuleExpr ClRuleExprT
 Rule to filter data.Expression definition.

Enumerations

enum  ClRuleExprFlagsT {
  CL_RULE_LITTLE_END = 0x1,
  CL_RULE_BIG_END = 0x2,
  CL_RULE_NON_ZERO_MATCH = 0x4,
  CL_RULE_MATCH_EXACT = 0x8,
  CL_RULE_EXPR_CHAIN_AND = 0x10,
  CL_RULE_EXPR_CHAIN_GROUP_OR = 0x40
}
 Its filters acc, filter the data based on the rule.Expression qualification. More...
enum  ClRuleResultT {
  CL_RULE_FALSE = 0,
  CL_RULE_TRUE,
  CL_RULE_UNKNOWN
}
 RBE result enum. More...

Functions

ClRuleResultT clRuleDoubleExprEvaluate (CL_IN ClRuleExprT *pExpr1, CL_IN ClRuleExprT *pExpr2)
 Evaluates Double RBE Expressions.
ClRcT clRuleExprAllocate (CL_IN ClUint8T len, CL_OUT ClRuleExprT **ppExpr)
 Allocates RBE expression.
ClRcT clRuleExprAppend (CL_IN ClRuleExprT *pFirstExpr, CL_IN ClRuleExprT *pNextExpr)
 Appends a RBE expression.
ClRcT clRuleExprDeallocate (CL_IN ClRuleExprT *pExpr)
 Frees an RBE expression.
ClRuleResultT clRuleExprEvaluate (CL_IN ClRuleExprT *pExpr, CL_IN ClUint32T *pData, CL_IN int dataLen)
 Evaluates a complex RBE Expression.
ClRcT clRuleExprFlagsGet (CL_IN ClRuleExprT *pExpr, CL_OUT ClRuleExprFlagsT *pFlags)
 Gets RBE expression flags.
ClRcT clRuleExprFlagsSet (CL_IN ClRuleExprT *pExpr, CL_IN ClRuleExprFlagsT flags)
 Sets Flags of an RBE expression.
ClRcT clRuleExprMaskGet (CL_IN ClRuleExprT *pExpr, CL_IN ClUint16T offset, CL_OUT ClUint32T *pMask)
 Get RBE expression Mask value.
ClRcT clRuleExprMaskSet (CL_IN ClRuleExprT *pExpr, CL_IN ClUint16T offset, CL_IN ClUint32T mask)
 Set Mask of an RBE expression.
ClUint32T clRuleExprMemLenGet (CL_IN ClRuleExprT *pExpr)
 Get the total memory used by the expression.
ClRcT clRuleExprOffsetGet (CL_IN ClRuleExprT *pExpr, CL_OUT ClUint16T *pOffset)
 Get RBE expression Offset value.
ClRcT clRuleExprOffsetSet (CL_IN ClRuleExprT *pExpr, CL_IN ClUint16T offset)
 Sets offset of a RBE expression.
ClRcT clRuleExprPack (CL_IN ClRuleExprT *pSrcExpr, CL_OUT ClUint8T **ppBuf, CL_OUT ClUint32T *pLen)
 Pack an RBE Expression into the given memory area.
ClRcT clRuleExprPrint (CL_IN ClRuleExprT *pExpr)
 Prints a complex RBE Expression.
ClRcT clRuleExprUnpack (CL_IN ClUint8T *pBuf, CL_IN ClUint32T len, CL_OUT ClRuleExprT **ppDstExpr)
 UnPack a RBE Expression.
ClRcT clRuleExprValueGet (CL_IN ClRuleExprT *pExpr, CL_IN ClUint16T offset, CL_OUT ClUint32T *pValue)
 Get RBE expression value.
ClRcT clRuleExprValueSet (CL_IN ClRuleExprT *pExpr, CL_IN ClUint16T offset, CL_IN ClUint32T value)
 Set Value of a RBE expression.

Detailed Description

Defines, Structures, Typedefs, Functions.

Enumeration Type Documentation

Its filters acc, filter the data based on the rule.Expression qualification.

Enumerator:
CL_RULE_LITTLE_END 

Little endian.

CL_RULE_BIG_END 

Big endian.

CL_RULE_NON_ZERO_MATCH 

Non-zero match.

CL_RULE_MATCH_EXACT 

Exact match.

CL_RULE_EXPR_CHAIN_AND 

Appending two RBE expression with AND relation.

CL_RULE_EXPR_CHAIN_GROUP_OR 

Appending a grouping expression with a AND/OR.

RBE result enum.

Enumerator:
CL_RULE_FALSE 

Expression evaluated failed.

CL_RULE_TRUE 

Expression evaluation passed.

CL_RULE_UNKNOWN 

Unknown result (not used).

Function Documentation

ClRuleResultT clRuleDoubleExprEvaluate ( CL_IN ClRuleExprT pExpr1,
CL_IN ClRuleExprT pExpr2 
)

Evaluates Double RBE Expressions.

Header File:
clRuleApi.h
Library Name:
Parameters
pExpr1First RBE Expression to be evaluated.
pExpr2Second RBE Expression to be evaluated.
dataLenLength of the data in multiples of 4 bytes.
Return values
CL_RULE_TRUEOn true.
CL_RULE_FALSEOn false.
Description:
This function evaluates a RBE Expression against another RBE expr. Both expressions are assumed to be of simple type.
See Also
clRuleExprEvaluate()
ClRcT clRuleExprAllocate ( CL_IN ClUint8T  len,
CL_OUT ClRuleExprT **  ppExpr 
)

Allocates RBE expression.

Header File:
clRuleApi.h
Library Name:
libClUtils
Parameters
lenLength of the mask or value in multiple of four bytes.
ppExpr(out) Allocated expression is returned here.
Return values
CL_OKThe API executed successfully.
CL_ERR_NULL_POINTERError
CL_ERR_NO_MEMORYError
Description:
This function allocates a RBE expression and initializes it appropriately.
See Also
clRuleExprDeallocate()
ClRcT clRuleExprAppend ( CL_IN ClRuleExprT pFirstExpr,
CL_IN ClRuleExprT pNextExpr 
)

Appends a RBE expression.

Header File:
clRuleApi.h
Library Name:
Parameters
pFirstExprRBE Expression on which pNextExpr needs to be appended.
pNextExprRBE Expression which will be appended to pFirstExpr.
Return values
CL_OKThe API executed successfully.
CL_ERR_NULL_POINTERIf any one of the two input expressions is null.
Description:
This function appends a expression to another. It is used to create more complex expression by combining existing expressions.
See Also
clRuleExprAllocate()
ClRcT clRuleExprDeallocate ( CL_IN ClRuleExprT pExpr)

Frees an RBE expression.

Header File:
clRuleApi.h
Library Name:
Parameters
ExprRBE Expression to be freed.
Return values
CL_OKThe API executed successfully.
CL_ERR_NULL_POINTERwhen the pExpr is NULL.
Description:
This function Frees an RBE Expression (memory or structures used by RBE expression).
See Also
clRuleExprAllocate()
ClRuleResultT clRuleExprEvaluate ( CL_IN ClRuleExprT pExpr,
CL_IN ClUint32T *  pData,
CL_IN int  dataLen 
)

Evaluates a complex RBE Expression.

Header File:
clRuleApi.h
Library Name:
Parameters
pExprRBE Expression to be evaluated.
pDataData pointer against which the RBE needs to be compared.
dataLenLength of the data in multiples of 4 bytes.
Return values
CL_RULE_TRUEOn true.
CL_RULE_FALSEOn false.
Description:
This function evaluates a RBE Expression. RBE expression could be a complex expression, i.e., multiple expressions can be chained together against a flat buffer pData of dataLen length.
See Also
clRuleDoubleExprEvaluate()
ClRcT clRuleExprFlagsGet ( CL_IN ClRuleExprT pExpr,
CL_OUT ClRuleExprFlagsT pFlags 
)

Gets RBE expression flags.

Header File:
clRuleApi.h
Library Name:
Parameters
pExprRBE Expression for which flags to be set.
pFlagsFlags to be returned.
Return values
CL_OKThe API executed successfully.
CL_ERR_NULL_POINTERIf pExpr is null.
Description:
This function gets the flags of a RBE expression.
See Also
clRuleExprFlagsSet()
ClRcT clRuleExprFlagsSet ( CL_IN ClRuleExprT pExpr,
CL_IN ClRuleExprFlagsT  flags 
)

Sets Flags of an RBE expression.

Header File:
clRuleApi.h
Library Name:
Parameters
pExprRBE Expression for which flags to be set.
flagsFlags to be set.
Return values
CL_OKThe API executed successfully.
CL_ERR_NULL_POINTERIf pExpr is null.
Description:
This function sets the RBE expression flags as specified by the parameter flags.
See Also
clRuleExprFlagsGet()
ClRcT clRuleExprMaskGet ( CL_IN ClRuleExprT pExpr,
CL_IN ClUint16T  offset,
CL_OUT ClUint32T *  pMask 
)

Get RBE expression Mask value.

Header File:
clRuleApi.h
Library Name:
Parameters
pExprRBE Expression for which flags to be set.
offsetGet Mask from this Offset.
pMaskMask to be returned.
Return values
CL_OKThe API executed successfully.
CL_ERR_NULL_POINTERIf any one of the two input expressions is null.
Description:
This function gets the Mask of an RBE expression set using clRuleExprMaskSet().
Note
Offset is in multiple of 4 bytes. Offset here is overall offset, i.e., mask returned is expr->mask[offset - expr->offset].
See Also
clRuleExprMaskSet()
ClRcT clRuleExprMaskSet ( CL_IN ClRuleExprT pExpr,
CL_IN ClUint16T  offset,
CL_IN ClUint32T  mask 
)

Set Mask of an RBE expression.

Header File:
clRuleApi.h
Library Name:
Parameters
pExprRBE Expression for which flags to be set.
offsetOffset at which the mask to be set.
maskMask value to be set.
Return values
CL_OKThe API executed successfully.
CL_ERR_NULL_POINTERIf pExpr is null.
Description:
This function sets the Mask field of an RBE expression as specified by the parameter mask.
Note
Offset is in multiple of 4 bytes. Offset here is overall offset, i.e., mask set is expr->mask[offset - expr->offset].
See Also
clRuleExprMaskGet()
ClUint32T clRuleExprMemLenGet ( CL_IN ClRuleExprT pExpr)

Get the total memory used by the expression.

Header File:
clRuleApi.h
Library Name:
Parameters
pExprRBE Expression.
Return Value:
Length in bytes needed to pack an expression.
Description:
This function returns the memory needed to pack an expression into contiguous memory location.
See Also
clRuleExprPack()
ClRcT clRuleExprOffsetGet ( CL_IN ClRuleExprT pExpr,
CL_OUT ClUint16T *  pOffset 
)

Get RBE expression Offset value.

Header File:
clRuleApi.h
Library Name:
Parameters
pExprRBE Expression for which flags to be set.
pOffsetOffset to be returned.
Return values
CL_OKThe API executed successfully.
CL_ERR_NULL_POINTERIf any one of the two input expressions is null.
Description:
This function gets the offset value of a RBE expression set using clRuleExprOffsetSet().
See Also
clRuleExprOffsetSet()
ClRcT clRuleExprOffsetSet ( CL_IN ClRuleExprT pExpr,
CL_IN ClUint16T  offset 
)

Sets offset of a RBE expression.

Header File:
clRuleApi.h
Library Name:
Parameters
pExprRBE Expression for which flags to be set.
offsetOffset value (multiples of 4 bytes).
Return values
CL_OKThe API executed successfully.
CL_ERR_NULL_POINTERIf pExpr is null.
Description:
This function sets the offset field of a RBE expression as specified by the offset parameter.
See Also
clRuleExprOffsetGet()
ClRcT clRuleExprPack ( CL_IN ClRuleExprT pSrcExpr,
CL_OUT ClUint8T **  ppBuf,
CL_OUT ClUint32T *  pLen 
)

Pack an RBE Expression into the given memory area.

Header File:
clRuleApi.h
Library Name:
Parameters
pSrcExprSource RBE Expression to pack.
pBufPointer to the memory location where to pack.
Return values
CL_OKThe API executed successfully.
CL_ERR_NULL_POINTEROn failure.
Description:
This function packs the given RBE Expression. The expression is packed at the given memory pointed by pBuf. It is assumed that the pBuf contains enough space to accomodate srcExpr. Caller can call clRuleExprMemLenGet() to get the memory needed to pack the srcExpr.
See Also
clRuleExprMemLenGet(), clRuleExprUnpack()
ClRcT clRuleExprPrint ( CL_IN ClRuleExprT pExpr)

Prints a complex RBE Expression.

Header File:
clRuleApi.h
Library Name:
Parameters
pExprRBE Expression to be printed.
Return Value:
None.
Description:
This function prints the given RBE Expression which could be a complex expression.
Related APIs:
None.
ClRcT clRuleExprUnpack ( CL_IN ClUint8T *  pBuf,
CL_IN ClUint32T  len,
CL_OUT ClRuleExprT **  ppDstExpr 
)

UnPack a RBE Expression.

Header File:
clRuleApi.h
Library Name:
Parameters
pSrcExprSource RBE Expression to unpack.
pDstExprPointer to a new copy of the expression.
Return values
CL_OKThe API executed successfully.
CL_ERR_NULL_POINTEROn failure.
Description:
This function makes unpack of the given RBE Expression.
See Also
clRuleExprPack()
ClRcT clRuleExprValueGet ( CL_IN ClRuleExprT pExpr,
CL_IN ClUint16T  offset,
CL_OUT ClUint32T *  pValue 
)

Get RBE expression value.

Header File:
clRuleApi.h
Library Name:
Parameters
pExprRBE Expression for which flags to be set.
offsetGet Mask from this Offset.
pValuevalue to be returned.
Return values
CL_OKThe API executed successfully.
CL_ERR_NULL_POINTERIf any one of the two input expressions is null.
Description:
This function gets the value of a RBE expression set using clRuleExprValueSet().
Note
Offset is in multiple of 4 bytes. Offset here is overall offset, i.e., mask returned is expr->mask[offset - expr->offset].
See Also
clRuleExprValueSet()
ClRcT clRuleExprValueSet ( CL_IN ClRuleExprT pExpr,
CL_IN ClUint16T  offset,
CL_IN ClUint32T  value 
)

Set Value of a RBE expression.

Header File:
clRuleApi.h
Library Name:
Parameters
pExprRBE Expression for which flags to be set.
offsetOffset at which the value is to be set.
maskMask value to be set.
Return values
CL_OKThe API executed successfully.
CL_ERR_NULL_POINTERIf pExpr is null.
Description:
This function sets the value field of a RBE expression to the value specified by the parameter value.
Note
Offset is in multiple of 4 bytes. Offset here is overall offset, i.e., mask set is expr->mask[offset - expr->offset].
See Also
clRuleExprValueGet()

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