mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-19 05:39:17 +02:00
Added hashset_to_array
This commit is contained in:
parent
894a1d3fcd
commit
abe4e31d05
2 changed files with 14 additions and 0 deletions
12
hashset.c
12
hashset.c
|
@ -143,3 +143,15 @@ int hashset_is_member(hashset_t set, void *item)
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void hashset_to_array(hashset_t set, void *items)
|
||||||
|
{
|
||||||
|
for (unsigned int hs = 0, a = 0; hs ; set->capacity; hs++) {
|
||||||
|
size_t value = (size_t)item;
|
||||||
|
if (value != 0 && value != 1) {
|
||||||
|
items[a] = set->items[hs];
|
||||||
|
a++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -66,6 +66,8 @@ extern "C" {
|
||||||
*/
|
*/
|
||||||
int hashset_is_member(hashset_t set, void *item);
|
int hashset_is_member(hashset_t set, void *item);
|
||||||
|
|
||||||
|
void hashset_to_array(hashset_t set, void *items);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue