#include <types.h>
|
| int(* | append )(KSI_PublicationsHeaderList *, KSI_PublicationsHeader *) |
| |
| int(* | removeElement )(KSI_PublicationsHeaderList *, size_t, KSI_PublicationsHeader **) |
| |
| int(* | indexOf )(KSI_PublicationsHeaderList *, KSI_PublicationsHeader *, size_t **) |
| |
| int(* | insertAt )(KSI_PublicationsHeaderList *, size_t, KSI_PublicationsHeader *) |
| |
| int(* | replaceAt )(KSI_PublicationsHeaderList *, size_t, KSI_PublicationsHeader *) |
| |
| int(* | elementAt )(KSI_PublicationsHeaderList *, size_t pos, KSI_PublicationsHeader **) |
| |
| size_t(* | length )(KSI_PublicationsHeaderList *list) |
| |
| void(* | obj_free )(KSI_PublicationsHeader *) |
| |
| int(* | sort )(KSI_PublicationsHeaderList *list, int(*cmp)(const KSI_PublicationsHeader **, const KSI_PublicationsHeader **)) |
| |
| int(* | foldl )(KSI_PublicationsHeaderList *list, void *foldCtx, int(*fn)(KSI_PublicationsHeader *el, void *foldCtx)) |
| |
| void * | pImpl |
| |
| int(* | find )(KSI_PublicationsHeaderList *list, KSI_PublicationsHeader *el, int *found, size_t *pos) |
| |
◆ append
Appends the element to the list.
- Parameters
-
| [in] | list | Pointer to the list. |
| [in] | el | Pointer to the element being added. |
- Returns
- status code (KSI_OK, when operation succeeded, otherwise an error code).
- Note
- After appending the element to the list, the element belongs to the list and it will be freed if the list is freed.
◆ elementAt
Method for accessing an element at any given position.
- Parameters
-
| [in] | list | Pointer to the list. |
| [in] | pos | Position of the element. |
| [out] | el | Pointer to the receiving pointer. |
- Returns
- status code (KSI_OK, when operation succeeded, otherwise an error code).
- Note
- The returned element still belongs to the list and may not be freed by the caller.
◆ find
- Find the index of the given element. If the element is found, the
found output variable * will be evaluated to 1 and the index of the element is stored in pos. If the element is * not present, the parameter found is evaluated to 0 and the output variable pos remains * unchanged. If the process fails with an error neither pos nor found will be changed. *- Parameters
-
| [in] | list | Pointer to the list. * |
| [in] | el | Pointer to the element. * |
| [out] | found | Output pointer for a boolean value whether the object was found or not. * |
| [out] | pos | Output pointer for the index value if the element was found. |
◆ foldl
- Applies each element in the list and the foldCtx to the function fn. *
- Parameters
-
| [in] | list | Pointer to the list. * |
| [in] | foldCtx | The fold context. * |
| [in] | fn | Function to be applied. |
◆ indexOf
This function finds the index of a given element.
- Parameters
-
| [in] | list | Pointer to the list. |
| [in] | el | Pointer to the element. |
| [out] | pos | Pointer to the receiving pointer. |
- Returns
- status code (KSI_OK, when operation succeeded, otherwise an error code).
- Note
- For fewer allocations use the *List_find function instead.
◆ insertAt
Add the element to the given position in the list. All elements with equal or greater indices are shifted.
- Parameters
-
| [in] | list | Pointer to the list. |
| [in] | pos | Position where to insert the element. |
| [in] | el | Pointer to the element being added. |
- Returns
- status code (KSI_OK, when operation succeeded, otherwise an error code).
- Note
- After add the element to the list, the element belongs to the list and it will be freed if the list is freed.
◆ length
Returns the list of the element.
- Parameters
-
| [in] | list | Pointer to the list. |
- Returns
- Returns the length of the list or 0 if the list is
NULL.
◆ obj_free
◆ pImpl
| void* KSI_PublicationsHeader_list_st::pImpl |
Internal implementation of the list.
◆ removeElement
Removes an element at the given position. If the out parameter is set to NULL, the removed element is freed implicitly with type_free.
- Parameters
-
| [in] | list | Pointer to the list. |
| [in] | pos | Position of the element to be removed. |
| [out] | el | Pointer to the receiving pointer. |
- Returns
- status code (KSI_OK, when operation succeeded, otherwise an error code).
- Note
- If the element is removed from the list and returned via output parameter to the caller, the caller is responsible for freeing the element.
◆ replaceAt
Replace the element at the given position in the list. The old element will be freed.
- Parameters
-
| [in] | list | Pointer to the list. |
| [in] | pos | Position where to insert the element. |
| [in] | el | Pointer to the element being added. |
- Returns
- status code (KSI_OK, when operation succeeded, otherwise an error code).
- Note
- After add the element to the list, the element belongs to the list and it will be freed if the list is freed.
◆ sort
Sorts the list using the comparison function cmp. *
- Parameters
-
| [in] | list | Pointer to the list. * |
| [in] | cmp | The comparison function. |
The documentation for this struct was generated from the following file:
- /Users/henri/dev/libksi/src/ksi/types.h