From f4908daaaad443834d9f270e7ddc5e2e23d0f7a5 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sat, 6 Jan 2024 19:22:56 -0800 Subject: 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. --- include/nng/supplemental/util/idhash.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 include/nng/supplemental/util/idhash.h (limited to 'include') diff --git a/include/nng/supplemental/util/idhash.h b/include/nng/supplemental/util/idhash.h new file mode 100644 index 00000000..7939ab1c --- /dev/null +++ b/include/nng/supplemental/util/idhash.h @@ -0,0 +1,27 @@ +// +// Copyright 2024 Staysail Systems, Inc. +// +// 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_UTIL_IDHASH_H +#define NNG_SUPPLEMENTAL_UTIL_IDHASH_H + +#include + +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 -- cgit v1.2.3-70-g09d2