Skip to content

Commit

Permalink
fix idhash not public
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
gdamore committed Jan 7, 2024
1 parent d7e0072 commit f4908da
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 32 deletions.
7 changes: 1 addition & 6 deletions cmake/NNGOptions.cmake
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -141,8 +141,3 @@ if (NNG_TRANSPORT_WS OR NNG_TRANSPORT_WSS)
set(NNG_SUPP_BASE64 ON)
set(NNG_SUPP_SHA1 ON)
endif()

# ID hash API is small wrapper around core, probably should always be enabled unless memory
# is extraordinarily constrained.
option(NNG_SUPP_IDHASH "Enable application IDHASH API" ON)
mark_as_advanced(NNG_SUPP_IDHASH)
4 changes: 2 additions & 2 deletions docs/man/nng_id_map.3supp.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
= nng_id_map(3supp)
//
// Copyright 2023 Staysail Systems, Inc. <info@staysail.tech>
// Copyright 2024 Staysail Systems, Inc. <info@staysail.tech>
//
// This document is supplied under the terms of the MIT License, a
// copy of which should be located in the distribution where this
Expand All @@ -17,7 +17,7 @@ nng_id_map - identifier based mapping table
[source, c]
----
#include <nng/nng.h>
#include <nng/supplemental/idhash/idhash.h>
#include <nng/supplemental/util/idhash.h>
typedef struct nng_id_map_s nng_id_map;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
//
// 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
// 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
#ifndef NNG_SUPPLEMENTAL_UTIL_IDHASH_H
#define NNG_SUPPLEMENTAL_UTIL_IDHASH_H

#include <nng/nng.h>

Expand Down
5 changes: 2 additions & 3 deletions src/supplemental/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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)
add_subdirectory(websocket)
11 changes: 0 additions & 11 deletions src/supplemental/idhash/CMakeLists.txt

This file was deleted.

10 changes: 7 additions & 3 deletions src/supplemental/util/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
#
# 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
# file was obtained (LICENSE.txt). A copy of the license may also be
# 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)
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
//
// 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
// file was obtained (LICENSE.txt). A copy of the license may also be
// 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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -9,7 +9,7 @@

#include <nuts.h>

#include "idhash.h"
#include <nng/supplemental/util/idhash.h>

void
test_id_basic(void)
Expand Down

0 comments on commit f4908da

Please sign in to comment.