Turnstone Operating System
|
set interface More...
Macros | |
#define | ___SET_H 0 |
#define | set_destroy(s) set_destroy_with_callback(s, NULL); |
Typedefs | |
typedef int8_t(* | set_comparator_f) (const void *item1, const void *item2) |
set comparator More... | |
typedef struct set_t | set_t |
typedef boolean_t(* | set_destroy_callback_f) (void *item) |
set destroy callback More... | |
Functions | |
set_t * | set_create (set_comparator_f cmp) |
creates set More... | |
set_t * | set_string (void) |
creates string set More... | |
set_t * | set_integer (void) |
creates integer set More... | |
boolean_t | set_append (set_t *s, void *value) |
append the value to the set if not exists More... | |
boolean_t | set_remove (set_t *s, void *value) |
remove the value from the set More... | |
boolean_t | set_exists (set_t *s, void *value) |
check value if in the the set More... | |
uint64_t | set_size (set_t *s) |
returns size of the set More... | |
boolean_t | set_destroy_with_callback (set_t *s, set_destroy_callback_f cb) |
destroys set More... | |
iterator_t * | set_create_iterator (set_t *s) |
creates set iterator More... | |
set interface
This work is licensed under TURNSTONE OS Public License. Please read and understand latest version of Licence.
#define set_destroy | ( | s | ) | set_destroy_with_callback(s, NULL); |
destroys set without callback
typedef int8_t(* set_comparator_f) (const void *item1, const void *item2) |
set comparator
[in] | item1 | item 1 |
[in] | item2 | item 2 |
typedef boolean_t(* set_destroy_callback_f) (void *item) |
set destroy callback
[in] | item | item to destroy |
boolean_t set_append | ( | set_t * | s, |
void * | value | ||
) |
append the value to the set if not exists
[in] | s | the set |
[in] | value | item to append |
set_t * set_create | ( | set_comparator_f | cmp | ) |
creates set
[in] | cmp | set comparator |
iterator_t * set_create_iterator | ( | set_t * | s | ) |
creates set iterator
[in] | s | the set |
boolean_t set_destroy_with_callback | ( | set_t * | s, |
set_destroy_callback_f | cb | ||
) |
destroys set
[in] | s | the set |
[in] | cb | destroy callback which frees items. |
boolean_t set_exists | ( | set_t * | s, |
void * | value | ||
) |
check value if in the the set
[in] | s | the set |
[in] | value | item to check |
set_t * set_integer | ( | void | ) |
creates integer set
boolean_t set_remove | ( | set_t * | s, |
void * | value | ||
) |
remove the value from the set
[in] | s | the set |
[in] | value | item to remove |
set_t * set_string | ( | void | ) |
creates string set