diff --git a/hashset/src/main.c b/hashset/src/main.c index dce6e31..f8094d7 100644 --- a/hashset/src/main.c +++ b/hashset/src/main.c @@ -394,7 +394,8 @@ static int test_function_4(hash_set_t *const hash_set) int main(void) { - printf("LibHashSet Test [%s]\n\n", __DATE__); + printf("LibHashSet Test v%" PRIu16 ".%" PRIu16 ".%" PRIu16 " [%s]\n\n", + HASHSET_VERSION_MAJOR, HASHSET_VERSION_MINOR, HASHSET_VERSION_PATCH, HASHSET_BUILD_DATE); hash_set_t *const hash_set = hash_set_create(0U, -1.0); if (!hash_set) diff --git a/libhashset/include/hash_set.h b/libhashset/include/hash_set.h index 455c510..b3a45ef 100644 --- a/libhashset/include/hash_set.h +++ b/libhashset/include/hash_set.h @@ -30,6 +30,13 @@ typedef int errno_t; struct _hash_set; typedef struct _hash_set hash_set_t; +HASHSET_API const uint16_t HASHSET_VERSION_MAJOR; +HASHSET_API const uint16_t HASHSET_VERSION_MINOR; +HASHSET_API const uint16_t HASHSET_VERSION_PATCH; + +HASHSET_API const char *const HASHSET_BUILD_DATE; +HASHSET_API const char *const HASHSET_BUILD_TIME; + HASHSET_API hash_set_t *hash_set_create(const size_t initial_capacity, const double load_factor); HASHSET_API void hash_set_destroy(hash_set_t *const instance); diff --git a/libhashset/src/hash_set.c b/libhashset/src/hash_set.c index 2cb025c..9ca6123 100644 --- a/libhashset/src/hash_set.c +++ b/libhashset/src/hash_set.c @@ -27,6 +27,13 @@ typedef int bool_t; # define INLINE #endif +const uint16_t HASHSET_VERSION_MAJOR = UINT16_C(1); +const uint16_t HASHSET_VERSION_MINOR = UINT16_C(0); +const uint16_t HASHSET_VERSION_PATCH = UINT16_C(0); + +const char *const HASHSET_BUILD_DATE = __DATE__; +const char *const HASHSET_BUILD_TIME = __TIME__; + struct _hash_set_data { uint64_t *values;