From 7c82fff41d976bffed0577ad6717a6e5477dbdeb Mon Sep 17 00:00:00 2001 From: Leonardo Date: Wed, 20 May 2020 19:33:37 -0300 Subject: [PATCH] Added cor/bitset.h --- src/cmc/bitset.h | 13 +++++-------- src/cor/bitset.h | 28 ++++++++++++++++++++++++++++ src/macro_collections.h | 1 + 3 files changed, 34 insertions(+), 8 deletions(-) create mode 100644 src/cor/bitset.h diff --git a/src/cmc/bitset.h b/src/cmc/bitset.h index 7431636..a4369ac 100644 --- a/src/cmc/bitset.h +++ b/src/cmc/bitset.h @@ -36,17 +36,14 @@ * ------------------------------------------------------------------------- */ #include "../cor/core.h" +/* ------------------------------------------------------------------------- + * BitSet Implementation + * ------------------------------------------------------------------------- */ +#include "../cor/bitset.h" + /* ------------------------------------------------------------------------- * BitSet specific * ------------------------------------------------------------------------- */ -/* Defines the underlaying data type for the bitset array */ -/* Possible values: uint64_t, uint32_t, uint16_t, uint8_t, size_t */ -#ifndef CMC_BITSET_WORD_TYPE -#define CMC_BITSET_WORD_TYPE uint32_t -#endif /* CMC_BITSET_WORD_TYPE */ - -typedef CMC_BITSET_WORD_TYPE cmc_bitset_word; - /* to_string format */ static const char *cmc_string_fmt_bitset = "struct %s " "at %p { " diff --git a/src/cor/bitset.h b/src/cor/bitset.h new file mode 100644 index 0000000..cf42e57 --- /dev/null +++ b/src/cor/bitset.h @@ -0,0 +1,28 @@ +/** + * bitset.h + * + * Creation Date: 20/05/2020 + * + * Authors: + * Leonardo Vencovsky (https://github.com/LeoVen) + * + */ + +/** + * Things commonly used by bitset collections. + */ + +#ifndef CMC_COR_BITSET_H +#define CMC_COR_BITSET_H + +#include + +/* Defines the underlaying data type for the bitset array */ +/* Possible values: uint64_t, uint32_t, uint16_t, uint8_t, size_t */ +#ifndef CMC_BITSET_WORD_TYPE +#define CMC_BITSET_WORD_TYPE uint32_t +#endif /* CMC_BITSET_WORD_TYPE */ + +typedef CMC_BITSET_WORD_TYPE cmc_bitset_word; + +#endif /* CMC_COR_BITSET_H */ diff --git a/src/macro_collections.h b/src/macro_collections.h index 0cd78bd..329d0b2 100644 --- a/src/macro_collections.h +++ b/src/macro_collections.h @@ -25,6 +25,7 @@ #define CMC_COLLECTION_GENERATE_SOURCE(C, PFX, SNAME, K, V) \ CMC_CONCAT(C, SOURCE)(PFX, SNAME, K, V) +#include "cor/bitset.h" /* Added in 20/05/2020 */ #include "cor/core.h" /* Added in 17/03/2020 */ #include "cor/flags.h" /* Added in 14/05/2020 */ #include "cor/hashtable.h" /* Added in 17/03/2020 */