smset.h: set handling (key-only storage)


Set functions handle key-only storage, which is implemented as a Red-Black tree (O(n log n) maximum complexity for insert/read/delete).

Supported set modes (enum eSMS_Type):

        SMS_I32: int32_t key
        SMS_U32: uint32_t key
        SMS_I: int64_t key
        SMS_F: float (single-precision floating point) key
        SMS_D: double (double-precision floating point) key
        SMS_S: string key

Callback types for the sm_itr_*() functions:

        typedef srt_bool (*srt_set_it_i32)(int32_t k, void *context);
        typedef srt_bool (*srt_set_it_u32)(uint32_t k, void *context);
        typedef srt_bool (*srt_set_it_i)(int64_t k, void *context);
        typedef srt_bool (*srt_set_it_f)(float k, void *context);
        typedef srt_bool (*srt_set_it_d)(double k, void *context);
        typedef srt_bool (*srt_set_it_s)(const srt_string *, void *context);

 sms_alloc  sms_count_i32  sms_delete_s  sms_insert_i  sms_it_s  sms_reserve 
 sms_alloca  sms_count_s  sms_delete_u32  sms_insert_i32  sms_it_u32  sms_shrink 
 sms_capacity  sms_count_u32  sms_dup  sms_insert_s  sms_itr_d  sms_size 
 sms_capacity_left  sms_cpy  sms_empty  sms_insert_u32  sms_itr_f 
 sms_clear  sms_delete_d  sms_free  sms_it_d  sms_itr_i 
 sms_count_d  sms_delete_f  sms_grow  sms_it_f  sms_itr_i32 
 sms_count_f  sms_delete_i  sms_insert_d  sms_it_i  sms_itr_s 
 sms_count_i  sms_delete_i32  sms_insert_f  sms_it_i32  sms_itr_u32 


srt_set *sms_alloc(enum eSMS_Type t, size_t initial_num_elems_reserve)



srt_set *sms_alloca(enum eSMS_Type t, size_t n)



size_t sms_capacity(const srt_set *s)



size_t sms_capacity_left(const srt_set *s)



void sms_clear(srt_set *s)



size_t sms_count_d(const srt_set *s, double k)



size_t sms_count_f(const srt_set *s, float k)



size_t sms_count_i(const srt_set *s, int64_t k)



size_t sms_count_i32(const srt_set *s, int32_t k)



size_t sms_count_s(const srt_set *s, const srt_string *k)



size_t sms_count_u32(const srt_set *s, uint32_t k)



srt_set *sms_cpy(srt_set **s, const srt_set *src)



srt_bool sms_delete_d(srt_set *s, double k)



srt_bool sms_delete_f(srt_set *s, float k)



srt_bool sms_delete_i(srt_set *s, int64_t k)



srt_bool sms_delete_i32(srt_set *s, int32_t k)



srt_bool sms_delete_s(srt_set *s, const srt_string *k)



srt_bool sms_delete_u32(srt_set *s, uint32_t k)



srt_set *sms_dup(const srt_set *src)



srt_bool sms_empty(const srt_set *s)



void sms_free(srt_map **s, ...)



size_t sms_grow(srt_set **s, size_t extra_elems)



srt_bool sms_insert_d(srt_set **s, double k)



srt_bool sms_insert_f(srt_set **s, float k)



srt_bool sms_insert_i(srt_set **s, int64_t k)



srt_bool sms_insert_i32(srt_set **s, int32_t k)



srt_bool sms_insert_s(srt_set **s, const srt_string *k)



srt_bool sms_insert_u32(srt_set **s, uint32_t k)



double sms_it_d(const srt_set *s, srt_tndx i)



float sms_it_f(const srt_set *s, srt_tndx i)



int32_t sms_it_i(const srt_set *s, srt_tndx i)



int32_t sms_it_i32(const srt_set *s, srt_tndx i)



int32_t sms_it_s(const srt_set *s, srt_tndx i)



uint32_t sms_it_u32(const srt_set *s, srt_tndx i)



size_t sms_itr_d(const srt_set *s, double key_min, double key_max, srt_set_it_d f, void *context)



size_t sms_itr_f(const srt_set *s, float key_min, float key_max, srt_set_it_f f, void *context)



size_t sms_itr_i(const srt_set *s, int64_t key_min, int64_t key_max, srt_set_it_i f, void *context)



size_t sms_itr_i32(const srt_set *s, int32_t key_min, int32_t key_max, srt_set_it_i32 f, void *context)



size_t sms_itr_s(const srt_set *s, const srt_string *key_min, const srt_string *key_max, srt_set_it_s f, void *context)



size_t sms_itr_u32(const srt_set *s, uint32_t key_min, uint32_t key_max, srt_set_it_u32 f, void *context)



size_t sms_reserve(srt_set **s, size_t max_elems)



srt_set *sms_shrink(srt_set **s)



size_t sms_size(const srt_set *s)