2022-11-19 17:34:56 +01:00
|
|
|
/******************************************************************************/
|
|
|
|
/* HashSet for C99, by LoRd_MuldeR <MuldeR2@GMX.de> */
|
|
|
|
/* This work has been released under the CC0 1.0 Universal license! */
|
|
|
|
/******************************************************************************/
|
|
|
|
|
|
|
|
#ifndef _INC_HASH_SET_H
|
|
|
|
#define _INC_HASH_SET_H
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2022-11-19 23:21:14 +01:00
|
|
|
#define HASHSET_OPT_FAILFAST UINT16_C(0x1)
|
|
|
|
|
2022-11-19 17:34:56 +01:00
|
|
|
struct _hash_set;
|
|
|
|
typedef struct _hash_set hash_set_t;
|
|
|
|
|
2022-11-19 23:21:14 +01:00
|
|
|
hash_set_t *hash_set_create(const size_t initial_capacity, const double load_factor, const uint16_t options);
|
2022-11-20 13:59:41 +01:00
|
|
|
void hash_set_destroy(hash_set_t *instance);
|
2022-11-19 17:34:56 +01:00
|
|
|
|
2022-11-19 20:28:13 +01:00
|
|
|
errno_t hash_set_insert(hash_set_t *const instance, const uint64_t value);
|
2022-11-20 13:59:41 +01:00
|
|
|
errno_t hash_set_remove(hash_set_t *const instance, const uint64_t value);
|
|
|
|
|
|
|
|
errno_t hash_set_contains(const hash_set_t *const instance, const uint64_t value);
|
|
|
|
errno_t hash_set_iterate(const hash_set_t *const instance, size_t *const offset, uint64_t *const value);
|
2022-11-19 17:34:56 +01:00
|
|
|
|
2022-11-19 20:28:13 +01:00
|
|
|
size_t hash_set_size(hash_set_t *const instance);
|
2022-11-21 15:02:07 +01:00
|
|
|
errno_t hash_set_info(hash_set_t *const instance, size_t *const capacity, size_t *const valid, size_t *const deleted, size_t *const limit);
|
2022-11-19 17:34:56 +01:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|