00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef CUCON_PSET_H
00019 #define CUCON_PSET_H
00020
00021 #include <cucon/umap.h>
00022
00023 CU_BEGIN_DECLARATIONS
00024
00025
00026
00027
00028
00029 struct cucon_pset { struct cucon_umap impl; };
00030
00031
00032 CU_SINLINE void cucon_pset_init(cucon_pset_t set)
00033 { cucon_umap_init(&set->impl); }
00034
00035
00036 CU_SINLINE cucon_pset_t cucon_pset_new(void)
00037 { return (cucon_pset_t)cucon_umap_new(); }
00038
00039
00040 CU_SINLINE void cucon_pset_init_copy(cucon_pset_t set, cucon_pset_t src_set)
00041 { cucon_umap_init_copy_void(&set->impl, &src_set->impl); }
00042
00043
00044 CU_SINLINE cucon_pset_t cucon_pset_new_copy(cucon_pset_t src_set)
00045 { return (cucon_pset_t)cucon_umap_new_copy_void(&src_set->impl); }
00046
00047
00048 CU_SINLINE void cucon_pset_swap(cucon_pset_t set0, cucon_pset_t set1)
00049 { cucon_umap_swap(&set0->impl, &set1->impl); }
00050
00051
00052 CU_SINLINE cu_bool_t cucon_pset_eq(cucon_pset_t set0, cucon_pset_t set1)
00053 { return cucon_umap_eq_keys(&set0->impl, &set1->impl); }
00054
00055
00056 CU_SINLINE cu_hash_t cucon_pset_hash(cucon_pset_t set)
00057 { return cucon_umap_hash_keys(&set->impl); }
00058
00059
00060 CU_SINLINE size_t cucon_pset_size(cucon_pset_t set)
00061 { return cucon_umap_size(&set->impl); }
00062
00063
00064 CU_SINLINE cu_bool_t cucon_pset_is_empty(cucon_pset_t set)
00065 { return cucon_umap_is_empty(&set->impl); }
00066
00067
00068
00069
00070
00071 CU_SINLINE cu_bool_t cucon_pset_insert(cucon_pset_t set, void *key)
00072 { return cucon_umap_insert_void(&set->impl, (uintptr_t)key); }
00073
00074
00075 CU_SINLINE cu_bool_t cucon_pset_erase(cucon_pset_t set, void *key)
00076 { return cucon_umap_erase(&set->impl, (uintptr_t)key); }
00077
00078
00079
00080
00081 CU_SINLINE cu_bool_t cucon_pset_erase_keep_cap(cucon_pset_t set, void *key)
00082 { return cucon_umap_erase_keep_cap(&set->impl, (uintptr_t)key); }
00083
00084
00085 CU_SINLINE void cucon_pset_update_cap(cucon_pset_t set)
00086 { cucon_umap_update_cap(&set->impl); }
00087
00088
00089 CU_SINLINE void *cucon_pset_pop_any(cucon_pset_t set)
00090 { return (void *)cucon_umap_pop_any_key(&set->impl); }
00091
00092
00093 CU_SINLINE cu_bool_t cucon_pset_find(cucon_pset_t set, void *key)
00094 { return cucon_umap_find_void(&set->impl, (uintptr_t)key); }
00095
00096 #ifndef CU_IN_DOXYGEN
00097 void cucon_pmap_iter_keys(cucon_pmap_t, cu_clop(, void, void const *));
00098 cu_bool_t cucon_pmap_conj_keys(cucon_pmap_t,
00099 cu_clop(, cu_bool_t, void const *));
00100 #endif
00101
00102
00103 CU_SINLINE void
00104 cucon_pset_iter(cucon_pset_t set, cu_clop(cb, void, void const *key))
00105 { cucon_pmap_iter_keys((cucon_pmap_t)set, cb); }
00106
00107
00108 CU_SINLINE cu_bool_t
00109 cucon_pset_conj(cucon_pset_t set, cu_clop(cb, cu_bool_t, void const *key))
00110 { return cucon_pmap_conj_keys((cucon_pmap_t)set, cb); }
00111
00112
00113
00114
00115
00116 CU_SINLINE void
00117 cucon_pset_assign_isecn_union(cucon_pset_t set0, cucon_pset_t set1)
00118 { cucon_umap_assign_isecn_union(&set0->impl, &set1->impl); }
00119
00120
00121
00122 CU_SINLINE void
00123 cucon_pset_move_isecn(cucon_pset_t dst, cucon_pset_t src0, cucon_pset_t src1)
00124 { cucon_umap_move_isecn(&dst->impl, &src0->impl, &src1->impl); }
00125
00126
00127 CU_SINLINE void
00128 cucon_pset_assign_isecn(cucon_pset_t dst, cucon_pset_t src)
00129 { cucon_umap_assign_isecn(&dst->impl, &src->impl); }
00130
00131
00132 CU_SINLINE void
00133 cucon_pset_assign_union(cucon_pset_t dst, cucon_pset_t src)
00134 { cucon_umap_assign_union_void(&dst->impl, &src->impl); }
00135
00136
00137 #define cucon_pset_cct cucon_pset_init
00138
00139 #define cucon_pset_cct_copy cucon_pset_init_copy
00140
00141
00142 CU_END_DECLARATIONS
00143
00144 #endif