diff options
| author | Garrett D'Amore <garrett@damore.org> | 2024-01-06 19:22:56 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2024-01-06 19:36:02 -0800 |
| commit | f4908daaaad443834d9f270e7ddc5e2e23d0f7a5 (patch) | |
| tree | d98f33bda4eff47a6561f6fdebe23b9d3909e178 /src | |
| parent | d7e0072a8ef453d6fd06311f6253ba869977e214 (diff) | |
| download | nng-f4908daaaad443834d9f270e7ddc5e2e23d0f7a5.tar.gz nng-f4908daaaad443834d9f270e7ddc5e2e23d0f7a5.tar.bz2 nng-f4908daaaad443834d9f270e7ddc5e2e23d0f7a5.zip | |
fix idhash not public
We accidentally made idhash not public by not publishing its header
in the right place. This is really generic utility stuff, so we
have posted it in the nng/supplemental/util/ directory.
We've also removed the ability to remove this -- its a very small amount
of additional code, as its just a wrapper on top of mandatory functionality.
Diffstat (limited to 'src')
| -rw-r--r-- | src/supplemental/CMakeLists.txt | 5 | ||||
| -rw-r--r-- | src/supplemental/idhash/CMakeLists.txt | 11 | ||||
| -rw-r--r-- | src/supplemental/idhash/idhash.h | 27 | ||||
| -rw-r--r-- | src/supplemental/util/CMakeLists.txt | 10 | ||||
| -rw-r--r-- | src/supplemental/util/idhash.c (renamed from src/supplemental/idhash/idhash.c) | 6 | ||||
| -rw-r--r-- | src/supplemental/util/idhash_test.c (renamed from src/supplemental/idhash/idhash_test.c) | 4 |
6 files changed, 15 insertions, 48 deletions
diff --git a/src/supplemental/CMakeLists.txt b/src/supplemental/CMakeLists.txt index 3fa254e7..2dcf228e 100644 --- a/src/supplemental/CMakeLists.txt +++ b/src/supplemental/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright 2021 Staysail Systems, Inc. <info@staystail.tech> +# Copyright 2024 Staysail Systems, Inc. <info@staystail.tech> # # This software is supplied under the terms of the MIT License, a # copy of which should be located in the distribution where this @@ -11,8 +11,7 @@ nng_directory(supplemental) add_subdirectory(base64) add_subdirectory(http) -add_subdirectory(idhash) add_subdirectory(sha1) add_subdirectory(tls) add_subdirectory(util) -add_subdirectory(websocket)
\ No newline at end of file +add_subdirectory(websocket) diff --git a/src/supplemental/idhash/CMakeLists.txt b/src/supplemental/idhash/CMakeLists.txt deleted file mode 100644 index 3a9bbb0b..00000000 --- a/src/supplemental/idhash/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -# -# Copyright 2023 Staysail Systems, Inc. <info@staysail.tech> -# -# This software is supplied under the terms of the MIT License, a -# copy of which should be located in the distribution where this -# file was obtained (LICENSE.txt). A copy of the license may also be -# found online at https://opensource.org/licenses/MIT. -# - -nng_sources_if(NNG_SUPP_IDHASH idhash.c idhash.h) -nng_test_if(NNG_SUPP_IDHASH idhash_test) diff --git a/src/supplemental/idhash/idhash.h b/src/supplemental/idhash/idhash.h deleted file mode 100644 index 5fd8f235..00000000 --- a/src/supplemental/idhash/idhash.h +++ /dev/null @@ -1,27 +0,0 @@ -// -// Copyright 2023 Staysail Systems, Inc. <info@staysail.tech> -// -// This software is supplied under the terms of the MIT License, a -// copy of which should be located in the distribution where this -// file was obtained (LICENSE.txt). A copy of the license may also be -// found online at https://opensource.org/licenses/MIT. -// - -#ifndef NNG_SUPPLEMENTAL_IDHASH_IDHASH_H -#define NNG_SUPPLEMENTAL_IDHASH_IDHASH_H - -#include <nng/nng.h> - -typedef struct nng_id_map_s nng_id_map; - -#define NNG_MAP_RANDOM 1 - -NNG_DECL int nng_id_map_alloc( - nng_id_map **map, uint64_t lo, uint64_t hi, int flags); -NNG_DECL void nng_id_map_free(nng_id_map *map); -NNG_DECL void *nng_id_get(nng_id_map *, uint64_t); -NNG_DECL int nng_id_set(nng_id_map *, uint64_t, void *); -NNG_DECL int nng_id_alloc(nng_id_map *, uint64_t *, void *); -NNG_DECL int nng_id_remove(nng_id_map *, uint64_t); - -#endif // NNG_SUPPLEMENTAL_IDHASH_IDHASH_H diff --git a/src/supplemental/util/CMakeLists.txt b/src/supplemental/util/CMakeLists.txt index 5a144da9..f62026fb 100644 --- a/src/supplemental/util/CMakeLists.txt +++ b/src/supplemental/util/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright 2019 Staysail Systems, Inc. <info@staysail.tech> +# Copyright 2024 Staysail Systems, Inc. <info@staysail.tech> # # This software is supplied under the terms of the MIT License, a # copy of which should be located in the distribution where this @@ -7,5 +7,9 @@ # found online at https://opensource.org/licenses/MIT. # -nng_sources(options.c platform.c) -nng_headers(nng/supplemental/util/options.h nng/supplemental/util/platform.h) +nng_sources(idhash.c options.c platform.c) +nng_headers( + nng/supplemental/util/idhash.h + nng/supplemental/util/options.h + nng/supplemental/util/platform.h) +nng_test(idhash_test) diff --git a/src/supplemental/idhash/idhash.c b/src/supplemental/util/idhash.c index 051b686a..cf48df3e 100644 --- a/src/supplemental/idhash/idhash.c +++ b/src/supplemental/util/idhash.c @@ -1,5 +1,5 @@ // -// Copyright 2023 Staysail Systems, Inc. <info@staysail.tech> +// Copyright 2024 Staysail Systems, Inc. <info@staysail.tech> // // This software is supplied under the terms of the MIT License, a // copy of which should be located in the distribution where this @@ -7,7 +7,9 @@ // found online at https://opensource.org/licenses/MIT. // -#include "supplemental/idhash/idhash.h" +#include <nng/nng.h> +#include <nng/supplemental/util/idhash.h> + #include "core/nng_impl.h" struct nng_id_map_s { diff --git a/src/supplemental/idhash/idhash_test.c b/src/supplemental/util/idhash_test.c index 367f34bc..5bbdc4fb 100644 --- a/src/supplemental/idhash/idhash_test.c +++ b/src/supplemental/util/idhash_test.c @@ -1,5 +1,5 @@ // -// Copyright 2023 Staysail Systems, Inc. <info@staysail.tech> +// Copyright 2024 Staysail Systems, Inc. <info@staysail.tech> // // This software is supplied under the terms of the MIT License, a // copy of which should be located in the distribution where this @@ -9,7 +9,7 @@ #include <nuts.h> -#include "idhash.h" +#include <nng/supplemental/util/idhash.h> void test_id_basic(void) |
