aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2025-01-04 14:25:44 -0800
committerGarrett D'Amore <garrett@damore.org>2025-01-04 16:40:37 -0800
commita40b421d39a64c285a4ac23304538690aaa90739 (patch)
tree8b55dad260cafe6c02938fd1850f0a2e88e776ce /include
parent7cdba9654117b4be1bf43925c10bae1a2a510cfa (diff)
downloadnng-a40b421d39a64c285a4ac23304538690aaa90739.tar.gz
nng-a40b421d39a64c285a4ac23304538690aaa90739.tar.bz2
nng-a40b421d39a64c285a4ac23304538690aaa90739.zip
api: Promote idhash supplemental API to core
Diffstat (limited to 'include')
-rw-r--r--include/nng/nng.h14
-rw-r--r--include/nng/supplemental/util/idhash.h36
2 files changed, 14 insertions, 36 deletions
diff --git a/include/nng/nng.h b/include/nng/nng.h
index 43824d61..980e527a 100644
--- a/include/nng/nng.h
+++ b/include/nng/nng.h
@@ -1604,6 +1604,20 @@ NNG_DECL const char *nng_tls_engine_description(void);
// nng_tls_engine_fips_mode returns true if the engine is in FIPS 140 mode.
NNG_DECL bool nng_tls_engine_fips_mode(void);
+// Public ID map support.
+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);
+NNG_DECL bool nng_id_visit(nng_id_map *, uint64_t *, void **, uint32_t *);
+
// Protocol specific values. These were formerly located in protocol specific
// headers, but we are bringing them here for ease of use.
diff --git a/include/nng/supplemental/util/idhash.h b/include/nng/supplemental/util/idhash.h
deleted file mode 100644
index f231a554..00000000
--- a/include/nng/supplemental/util/idhash.h
+++ /dev/null
@@ -1,36 +0,0 @@
-//
-// 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
-// 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
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#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);
-NNG_DECL bool nng_id_visit(nng_id_map *, uint64_t *, void **, uint32_t *);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // NNG_SUPPLEMENTAL_IDHASH_IDHASH_H