|
| #define | KSI_TREE_BUILDER_STACK_LEN 0x100 |
| #define | KSI_TreeBuilderLeafProcessorList_append(lst, o) |
| #define | KSI_TreeBuilderLeafProcessorList_remove(lst, pos, o) |
| #define | KSI_TreeBuilderLeafProcessorList_indexOf(lst, o, i) |
| #define | KSI_TreeBuilderLeafProcessorList_insertAt(lst, pos, o) |
| #define | KSI_TreeBuilderLeafProcessorList_replaceAt(lst, pos, o) |
| #define | KSI_TreeBuilderLeafProcessorList_elementAt(lst, pos, o) |
| #define | KSI_TreeBuilderLeafProcessorList_length(lst) |
| #define | KSI_TreeBuilderLeafProcessorList_sort(lst, cmp) |
| #define | KSI_TreeBuilderLeafProcessorList_foldl(lst, foldCtx, foldFn) |
| #define | KSI_TreeBuilderLeafProcessorList_find(lst, o, f, i) |
| #define | KSI_TreeLeafHandleList_append(lst, o) |
| #define | KSI_TreeLeafHandleList_remove(lst, pos, o) |
| #define | KSI_TreeLeafHandleList_indexOf(lst, o, i) |
| #define | KSI_TreeLeafHandleList_insertAt(lst, pos, o) |
| #define | KSI_TreeLeafHandleList_replaceAt(lst, pos, o) |
| #define | KSI_TreeLeafHandleList_elementAt(lst, pos, o) |
| #define | KSI_TreeLeafHandleList_length(lst) |
| #define | KSI_TreeLeafHandleList_sort(lst, cmp) |
| #define | KSI_TreeLeafHandleList_foldl(lst, foldCtx, foldFn) |
| #define | KSI_TreeLeafHandleList_find(lst, o, f, i) |
|
| struct KSI_TreeBuilderLeafProcessor_list_st | KSI_LIST (KSI_TreeBuilderLeafProcessor) |
| int | KSI_LIST_FN_NAME (KSI_TreeBuilderLeafProcessor, new)(KSI_LIST(KSI_TreeBuilderLeafProcessor) **list) |
| void | KSI_LIST_FN_NAME (KSI_TreeBuilderLeafProcessor, free)(KSI_LIST(KSI_TreeBuilderLeafProcessor) *list) |
| struct KSI_TreeLeafHandle_list_st | KSI_LIST (KSI_TreeLeafHandle) |
| int | KSI_LIST_FN_NAME (KSI_TreeLeafHandle, new)(KSI_LIST(KSI_TreeLeafHandle) **list) |
| void | KSI_LIST_FN_NAME (KSI_TreeLeafHandle, free)(KSI_LIST(KSI_TreeLeafHandle) *list) |
| KSI_TreeLeafHandle * | KSI_TreeLeafHandle_ref (KSI_TreeLeafHandle *o) |
| int | KSI_TreeNode_new (KSI_CTX *ctx, KSI_DataHash *hash, KSI_MetaData *metaData, int level, KSI_TreeNode **node) |
| void | KSI_TreeNode_free (KSI_TreeNode *node) |
| void | KSI_TreeLeafHandle_free (KSI_TreeLeafHandle *handle) |
| int | KSI_TreeLeafHandle_getAggregationChain (const KSI_TreeLeafHandle *handle, KSI_AggregationHashChain **chain) |
| int | KSI_TreeLeafHandle_getTreeNode (const KSI_TreeLeafHandle *handle, KSI_TreeNode **node) |
| int | KSI_TreeBuilder_new (KSI_CTX *ctx, KSI_HashAlgorithm algo, KSI_TreeBuilder **builder) |
| void | KSI_TreeBuilder_free (KSI_TreeBuilder *builder) |
| int | KSI_TreeBuilder_addDataHash (KSI_TreeBuilder *builder, KSI_DataHash *hsh, int level, KSI_TreeLeafHandle **leaf) |
| int | KSI_TreeBuilder_addMetaData (KSI_TreeBuilder *builder, KSI_MetaData *metaData, int level, KSI_TreeLeafHandle **leaf) |
| int | KSI_TreeBuilder_close (KSI_TreeBuilder *builder) |
The tree builder is used to create an aggregation tree locally. This can be used to create multiple signatures with a single aggregation request.
◆ KSI_TREE_BUILDER_STACK_LEN
| #define KSI_TREE_BUILDER_STACK_LEN 0x100 |
◆ KSI_TreeBuilderLeafProcessorList_append
| #define KSI_TreeBuilderLeafProcessorList_append |
( |
| lst, |
|
|
| o ) |
Value:
#define KSI_APPLY_TO_NOT_NULL(val, fn, args)
Definition types.h:157
◆ KSI_TreeBuilderLeafProcessorList_elementAt
| #define KSI_TreeBuilderLeafProcessorList_elementAt |
( |
| lst, |
|
|
| pos, |
|
|
| o ) |
◆ KSI_TreeBuilderLeafProcessorList_find
| #define KSI_TreeBuilderLeafProcessorList_find |
( |
| lst, |
|
|
| o, |
|
|
| f, |
|
|
| i ) |
◆ KSI_TreeBuilderLeafProcessorList_foldl
| #define KSI_TreeBuilderLeafProcessorList_foldl |
( |
| lst, |
|
|
| foldCtx, |
|
|
| foldFn ) |
Value:(((lst) != NULL) ? ( ((lst)->foldl != NULL) ? ((lst)->foldl((lst), (foldCtx), (foldFn)))) :
KSI_INVALID_STATE) :
KSI_OK)
@ KSI_OK
Definition ksi.h:49
@ KSI_INVALID_STATE
Definition ksi.h:119
◆ KSI_TreeBuilderLeafProcessorList_indexOf
| #define KSI_TreeBuilderLeafProcessorList_indexOf |
( |
| lst, |
|
|
| o, |
|
|
| i ) |
◆ KSI_TreeBuilderLeafProcessorList_insertAt
| #define KSI_TreeBuilderLeafProcessorList_insertAt |
( |
| lst, |
|
|
| pos, |
|
|
| o ) |
◆ KSI_TreeBuilderLeafProcessorList_length
| #define KSI_TreeBuilderLeafProcessorList_length |
( |
| lst | ) |
|
Value:(((lst) != NULL && (lst)->length != NULL) ? (lst)->length((lst)) : 0)
◆ KSI_TreeBuilderLeafProcessorList_remove
| #define KSI_TreeBuilderLeafProcessorList_remove |
( |
| lst, |
|
|
| pos, |
|
|
| o ) |
◆ KSI_TreeBuilderLeafProcessorList_replaceAt
| #define KSI_TreeBuilderLeafProcessorList_replaceAt |
( |
| lst, |
|
|
| pos, |
|
|
| o ) |
◆ KSI_TreeBuilderLeafProcessorList_sort
| #define KSI_TreeBuilderLeafProcessorList_sort |
( |
| lst, |
|
|
| cmp ) |
◆ KSI_TreeLeafHandleList_append
| #define KSI_TreeLeafHandleList_append |
( |
| lst, |
|
|
| o ) |
◆ KSI_TreeLeafHandleList_elementAt
| #define KSI_TreeLeafHandleList_elementAt |
( |
| lst, |
|
|
| pos, |
|
|
| o ) |
◆ KSI_TreeLeafHandleList_find
| #define KSI_TreeLeafHandleList_find |
( |
| lst, |
|
|
| o, |
|
|
| f, |
|
|
| i ) |
◆ KSI_TreeLeafHandleList_foldl
| #define KSI_TreeLeafHandleList_foldl |
( |
| lst, |
|
|
| foldCtx, |
|
|
| foldFn ) |
Value:(((lst) != NULL) ? ( ((lst)->foldl != NULL) ? ((lst)->foldl((lst), (foldCtx), (foldFn)))) :
KSI_INVALID_STATE) :
KSI_OK)
◆ KSI_TreeLeafHandleList_indexOf
| #define KSI_TreeLeafHandleList_indexOf |
( |
| lst, |
|
|
| o, |
|
|
| i ) |
◆ KSI_TreeLeafHandleList_insertAt
| #define KSI_TreeLeafHandleList_insertAt |
( |
| lst, |
|
|
| pos, |
|
|
| o ) |
◆ KSI_TreeLeafHandleList_length
| #define KSI_TreeLeafHandleList_length |
( |
| lst | ) |
|
Value:(((lst) != NULL && (lst)->length != NULL) ? (lst)->length((lst)) : 0)
◆ KSI_TreeLeafHandleList_remove
| #define KSI_TreeLeafHandleList_remove |
( |
| lst, |
|
|
| pos, |
|
|
| o ) |
◆ KSI_TreeLeafHandleList_replaceAt
| #define KSI_TreeLeafHandleList_replaceAt |
( |
| lst, |
|
|
| pos, |
|
|
| o ) |
◆ KSI_TreeLeafHandleList_sort
| #define KSI_TreeLeafHandleList_sort |
( |
| lst, |
|
|
| cmp ) |
◆ KSI_TreeBuilder
An object for building an aggregation tree on the fly.
◆ KSI_TreeBuilderLeafProcessor
The leaf processor structure contains the function to pre processes the node specified as the input and a context for the preprocessor. The function may alter the input node and optionally generate a new one - usually meaning the input hash has been aggregated and the output node is the root value of the aggregation.
◆ KSI_TreeLeafHandle
The tree leaf handle is used to generate an aggregation hash chain for a specific leaf added to the tree builder.
◆ KSI_TreeNode
A structure to represent the leaf and internal nodes of a hash tree.
◆ KSI_LIST() [1/2]
◆ KSI_LIST() [2/2]
◆ KSI_LIST_FN_NAME() [1/4]
◆ KSI_LIST_FN_NAME() [2/4]
◆ KSI_LIST_FN_NAME() [3/4]
◆ KSI_LIST_FN_NAME() [4/4]
◆ KSI_TreeBuilder_addDataHash()
Adds a new leaf to the tree.
- Parameters
-
| [in] | builder | The builder. |
| [in] | hsh | The data hash of the leaf. |
| [in] | level | The level of the leaf. |
| [out] | leaf | Pointer to the receiving pointer for the handle. |
- Returns
- On success returns KSI_OK, otherwise a status code is returned (see KSI_StatusCode).
- See also
- KSI_TreeLeafHandle_free
◆ KSI_TreeBuilder_addMetaData()
Adds a new leaf to the tree containing a meta-data value instead of the data hash as in KSI_TreeBuilder_addDataHash.
- Parameters
-
| [in] | builder | The builder. |
| [in] | metaData | The meta-data of the leaf. |
| [in] | level | The level of the leaf. |
| [out] | leaf | Pointer to the receiving pointer for the handle. |
- Returns
- On success returns KSI_OK, otherwise a status code is returned (see KSI_StatusCode).
- See also
- KSI_TreeLeafHandle_free
◆ KSI_TreeBuilder_close()
This function finalizes the building of the tree. After calling this function no more leafs may be added to the computation and doing so would result in an error.
- Parameters
-
- Returns
- On success returns KSI_OK, otherwise a status code is returned (see KSI_StatusCode).
◆ KSI_TreeBuilder_free()
Destructor for the KSI_TreeBuilder object.
- Parameters
-
| [in] | builder | Pointer to the object. |
- See also
- KSI_TreeNuilder_new
◆ KSI_TreeBuilder_new()
Constructor for the KSI_TreeBuilder object.
- Parameters
-
| [in] | ctx | KSI context. |
| [in] | algo | Algorithm used for the internal nodes. |
| [out] | builder | Pointer to the receiving pointer. |
- Returns
- On success returns KSI_OK, otherwise a status code is returned (see KSI_StatusCode).
- See also
- KSI_TreeBuilder_free
◆ KSI_TreeLeafHandle_free()
◆ KSI_TreeLeafHandle_getAggregationChain()
Generates an aggregation hash chain starting from the added leaf that the tree leaf handle is based on. The resulting object must be feed by the caller.
- Parameters
-
| [in] | handle | The tree leaf handle. |
| [out] | chain | Pointer to the receiving pointer. |
- Returns
- On success returns KSI_OK, otherwise a status code is returned (see KSI_StatusCode).
- See also
- KSI_AggregationHashChain_free.
◆ KSI_TreeLeafHandle_getTreeNode()
◆ KSI_TreeLeafHandle_ref()
- Increases the inner reference count of that object. *
- Parameters
-
- Returns
- Returns the input pointer on success or
NULL on error. *
- See also
- KSI_TreeLeafHandle_free
◆ KSI_TreeNode_free()
Destructor method for KSI_TreeNode.
- Parameters
-
| [in] | node | Pointer to the object. |
◆ KSI_TreeNode_new()
This is the constructor method for the KSI_TreeNode structure.
- Parameters
-
| [in] | ctx | KSI context. |
| [in] | hash | Input hash. |
| [in] | metaData | Metadata field. |
| [in] | level | The level of the tree node. |
| [out] | node | Pointer to the receiving ponter. |
- Returns
- On success returns KSI_OK, otherwise a status code is returned (see KSI_StatusCode).
- Note
- Exactly one of
hash or metaData must be a not NULL pointer.
-
The function will not take ownership of the
hash or metaData fields and thus the pointers must be freed by the caller.