Guardtime KSI c SDK
|
Macros | |
#define | KSI_LIST(type) type##List |
#define | KSI_NEW_LIST(type, list) KSI_List_new(type##_free, (list)) |
#define | KSI_NEW_REFLIST(type, list) KSI_RefList_new(type##_free, type##_ref, (list)) |
#define | KSI_LIST_FN_NAME(type, name) type##List_##name |
#define | KSI_DEFINE_LIST_STRUCT(ltype, rtype) |
#define | KSI_DEFINE_LIST(type) |
#define | KSI_IMPLEMENT_LIST(type, free_fn) |
Typedefs | |
typedef struct KSI_List_st | KSI_List |
Functions | |
void | KSI_List_free (KSI_List *list) |
int | KSI_List_new (void(*obj_free)(void *), KSI_List **list) |
int | KSI_List_append (KSI_List *list, void *o) |
int | KSI_List_remove (KSI_List *list, size_t pos, void **o) |
int | KSI_List_indexOf (KSI_List *list, void *o, size_t **i) |
int | KSI_List_insertAt (KSI_List *list, size_t pos, void *o) |
int | KSI_List_replaceAt (KSI_List *list, size_t pos, void *o) |
int | KSI_List_elementAt (KSI_List *list, size_t pos, void **o) |
size_t | KSI_List_length (KSI_List *list) |
int | KSI_List_sort (KSI_List *list, int(*)(const void **, const void **)) |
int | KSI_List_foldl (KSI_List *list, void *foldCtx, int(*fn)(void *el, void *foldCtx)) |
int | KSI_List_find (KSI_List *list, void *el, int *found, size_t *pos) |
#define KSI_DEFINE_LIST | ( | type | ) |
This macro defines a new list of given type.
[in] | type | Type of the elements stored in the list. |
#define KSI_DEFINE_LIST_STRUCT | ( | ltype, | |
rtype | |||
) |
#define KSI_IMPLEMENT_LIST | ( | type, | |
free_fn | |||
) |
This macro implements all the functions of a list for a given type.
[in] | type | The type of the elements stored in the list. |
[in] | free_fn | Function pointer to the free method of stored elements. May be NULL |
#define KSI_LIST | ( | type | ) | type##List |
Macro to get the list type name for a given type.
[in] | type | Type of the list. |
#define KSI_LIST_FN_NAME | ( | type, | |
name | |||
) | type##List_##name |
Generates the function name for a list with a given type.
[in] | type | Type of the list. |
[in] | name | Name of the function. |
#define KSI_NEW_LIST | ( | type, | |
list | |||
) | KSI_List_new(type##_free, (list)) |
Experimental macro for creating lists.
[in] | type | Type of the list. |
[out] | list | Pointer to the receiving pointer. |
#define KSI_NEW_REFLIST | ( | type, | |
list | |||
) | KSI_RefList_new(type##_free, type##_ref, (list)) |
Experimental macro for creating lists.
[in] | type | Type of the list. |
[out] | list | Pointer to the receiving pointer. |
typedef struct KSI_List_st KSI_List |
Generic list type for storing void* pointers.
int KSI_List_append | ( | KSI_List * | list, |
void * | o | ||
) |
int KSI_List_elementAt | ( | KSI_List * | list, |
size_t | pos, | ||
void ** | o | ||
) |
int KSI_List_find | ( | KSI_List * | list, |
void * | el, | ||
int * | found, | ||
size_t * | pos | ||
) |
int KSI_List_foldl | ( | KSI_List * | list, |
void * | foldCtx, | ||
int(*)(void *el, void *foldCtx) | fn | ||
) |
void KSI_List_free | ( | KSI_List * | list | ) |
int KSI_List_indexOf | ( | KSI_List * | list, |
void * | o, | ||
size_t ** | i | ||
) |
int KSI_List_insertAt | ( | KSI_List * | list, |
size_t | pos, | ||
void * | o | ||
) |
size_t KSI_List_length | ( | KSI_List * | list | ) |
int KSI_List_new | ( | void(*)(void *) | obj_free, |
KSI_List ** | list | ||
) |
int KSI_List_remove | ( | KSI_List * | list, |
size_t | pos, | ||
void ** | o | ||
) |
int KSI_List_replaceAt | ( | KSI_List * | list, |
size_t | pos, | ||
void * | o | ||
) |
int KSI_List_sort | ( | KSI_List * | list, |
int(*)(const void **, const void **) | |||
) |