aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/nng/compat/nanomsg/bus.h (renamed from src/compat/nanomsg/bus.h)0
-rw-r--r--include/nng/compat/nanomsg/inproc.h (renamed from src/compat/nanomsg/inproc.h)0
-rw-r--r--include/nng/compat/nanomsg/ipc.h (renamed from src/compat/nanomsg/ipc.h)0
-rw-r--r--include/nng/compat/nanomsg/nn.h (renamed from src/compat/nanomsg/nn.h)0
-rw-r--r--include/nng/compat/nanomsg/pair.h (renamed from src/compat/nanomsg/pair.h)0
-rw-r--r--include/nng/compat/nanomsg/pipeline.h (renamed from src/compat/nanomsg/pipeline.h)0
-rw-r--r--include/nng/compat/nanomsg/pubsub.h (renamed from src/compat/nanomsg/pubsub.h)0
-rw-r--r--include/nng/compat/nanomsg/reqrep.h (renamed from src/compat/nanomsg/reqrep.h)0
-rw-r--r--include/nng/compat/nanomsg/survey.h (renamed from src/compat/nanomsg/survey.h)0
-rw-r--r--include/nng/compat/nanomsg/tcp.h (renamed from src/compat/nanomsg/tcp.h)0
-rw-r--r--include/nng/compat/nanomsg/ws.h (renamed from src/compat/nanomsg/ws.h)0
-rw-r--r--include/nng/nng.h (renamed from src/nng.h)0
-rw-r--r--include/nng/protocol/bus0/bus.h (renamed from src/protocol/bus0/bus.h)0
-rw-r--r--include/nng/protocol/pair0/pair.h (renamed from src/protocol/pair0/pair.h)0
-rw-r--r--include/nng/protocol/pair1/pair.h (renamed from src/protocol/pair1/pair.h)0
-rw-r--r--include/nng/protocol/pipeline0/pull.h (renamed from src/protocol/pipeline0/pull.h)0
-rw-r--r--include/nng/protocol/pipeline0/push.h (renamed from src/protocol/pipeline0/push.h)0
-rw-r--r--include/nng/protocol/pubsub0/pub.h (renamed from src/protocol/pubsub0/pub.h)0
-rw-r--r--include/nng/protocol/pubsub0/sub.h (renamed from src/protocol/pubsub0/sub.h)0
-rw-r--r--include/nng/protocol/reqrep0/rep.h (renamed from src/protocol/reqrep0/rep.h)0
-rw-r--r--include/nng/protocol/reqrep0/req.h (renamed from src/protocol/reqrep0/req.h)0
-rw-r--r--include/nng/protocol/survey0/respond.h (renamed from src/protocol/survey0/respond.h)0
-rw-r--r--include/nng/protocol/survey0/survey.h (renamed from src/protocol/survey0/survey.h)0
-rw-r--r--include/nng/supplemental/http/http.h (renamed from src/supplemental/http/http.h)0
-rw-r--r--include/nng/supplemental/tls/tls.h (renamed from src/supplemental/tls/tls.h)0
-rw-r--r--include/nng/supplemental/util/options.h (renamed from src/supplemental/util/options.h)0
-rw-r--r--include/nng/supplemental/util/platform.h (renamed from src/supplemental/util/platform.h)0
-rw-r--r--include/nng/transport/inproc/inproc.h (renamed from src/transport/inproc/inproc.h)0
-rw-r--r--include/nng/transport/ipc/ipc.h (renamed from src/transport/ipc/ipc.h)0
-rw-r--r--include/nng/transport/tcp/tcp.h (renamed from src/transport/tcp/tcp.h)0
-rw-r--r--include/nng/transport/tls/tls.h (renamed from src/transport/tls/tls.h)0
-rw-r--r--include/nng/transport/ws/websocket.h (renamed from src/transport/ws/websocket.h)0
-rw-r--r--include/nng/transport/zerotier/zerotier.h (renamed from src/transport/zerotier/zerotier.h)0
-rw-r--r--perf/perf.c9
-rw-r--r--src/CMakeLists.txt22
-rw-r--r--src/compat/nanomsg/CMakeLists.txt13
-rw-r--r--src/compat/nanomsg/nn.c44
-rw-r--r--src/core/nng_impl.h2
-rw-r--r--src/core/transport.c12
-rw-r--r--src/nng.c2
-rw-r--r--src/protocol/bus0/CMakeLists.txt4
-rw-r--r--src/protocol/bus0/bus.c2
-rw-r--r--src/protocol/pair0/CMakeLists.txt4
-rw-r--r--src/protocol/pair0/pair.c2
-rw-r--r--src/protocol/pair1/CMakeLists.txt4
-rw-r--r--src/protocol/pair1/pair.c2
-rw-r--r--src/protocol/pipeline0/CMakeLists.txt10
-rw-r--r--src/protocol/pipeline0/pull.c2
-rw-r--r--src/protocol/pipeline0/push.c2
-rw-r--r--src/protocol/pubsub0/CMakeLists.txt10
-rw-r--r--src/protocol/pubsub0/pub.c2
-rw-r--r--src/protocol/pubsub0/sub.c2
-rw-r--r--src/protocol/reqrep0/CMakeLists.txt10
-rw-r--r--src/protocol/reqrep0/rep.c2
-rw-r--r--src/protocol/reqrep0/req.c2
-rw-r--r--src/protocol/reqrep0/xrep.c2
-rw-r--r--src/protocol/reqrep0/xreq.c2
-rw-r--r--src/protocol/survey0/CMakeLists.txt10
-rw-r--r--src/protocol/survey0/respond.c2
-rw-r--r--src/protocol/survey0/survey.c2
-rw-r--r--src/protocol/survey0/xrespond.c2
-rw-r--r--src/protocol/survey0/xsurvey.c2
-rw-r--r--src/supplemental/http/CMakeLists.txt7
-rw-r--r--src/supplemental/http/http_api.h4
-rw-r--r--src/supplemental/http/http_client.c2
-rw-r--r--src/supplemental/http/http_conn.c2
-rw-r--r--src/supplemental/http/http_public.c4
-rw-r--r--src/supplemental/http/http_server.c2
-rw-r--r--src/supplemental/tls/CMakeLists.txt5
-rw-r--r--src/supplemental/tls/mbedtls/tls.c2
-rw-r--r--src/supplemental/tls/none/tls.c2
-rw-r--r--src/supplemental/util/CMakeLists.txt7
-rw-r--r--src/supplemental/util/options.c2
-rw-r--r--src/supplemental/util/platform.c2
-rw-r--r--src/transport/inproc/CMakeLists.txt4
-rw-r--r--src/transport/ipc/CMakeLists.txt4
-rw-r--r--src/transport/ipc/ipc.c2
-rw-r--r--src/transport/tcp/CMakeLists.txt4
-rw-r--r--src/transport/tls/CMakeLists.txt4
-rw-r--r--src/transport/tls/tls.c4
-rw-r--r--src/transport/ws/CMakeLists.txt4
-rw-r--r--src/transport/ws/websocket.c4
-rw-r--r--src/transport/zerotier/CMakeLists.txt4
-rw-r--r--src/transport/zerotier/zerotier.c3
-rw-r--r--tests/aio.c11
-rw-r--r--tests/base64.c4
-rw-r--r--tests/bufsz.c18
-rw-r--r--tests/bus.c13
-rw-r--r--tests/compat_block.c4
-rw-r--r--tests/compat_bug777.c4
-rw-r--r--tests/compat_bus.c4
-rw-r--r--tests/compat_cmsg.c6
-rw-r--r--tests/compat_device.c10
-rw-r--r--tests/compat_iovec.c4
-rw-r--r--tests/compat_msg.c4
-rw-r--r--tests/compat_options.c7
-rw-r--r--tests/compat_pair.c4
-rw-r--r--tests/compat_pipeline.c4
-rw-r--r--tests/compat_poll.c6
-rw-r--r--tests/compat_reqrep.c4
-rw-r--r--tests/compat_reqttl.c6
-rw-r--r--tests/compat_shutdown.c6
-rw-r--r--tests/compat_survey.c4
-rw-r--r--tests/compat_surveyttl.c6
-rw-r--r--tests/compat_tcp.c8
-rw-r--r--tests/compat_testutil.c2
-rw-r--r--tests/compat_ws.c6
-rw-r--r--tests/cplusplus_pair.cc4
-rw-r--r--tests/device.c11
-rw-r--r--tests/errors.c8
-rw-r--r--tests/httpclient.c15
-rw-r--r--tests/httpserver.c11
-rw-r--r--tests/idhash.c4
-rw-r--r--tests/inproc.c3
-rw-r--r--tests/ipc.c8
-rw-r--r--tests/ipcperms.c21
-rw-r--r--tests/ipcwinsec.c14
-rw-r--r--tests/message.c6
-rw-r--r--tests/multistress.c37
-rw-r--r--tests/nonblock.c18
-rw-r--r--tests/options.c7
-rw-r--r--tests/pair1.c13
-rw-r--r--tests/pipe.c15
-rw-r--r--tests/pipeline.c13
-rw-r--r--tests/platform.c7
-rw-r--r--tests/pollfd.c12
-rw-r--r--tests/pubsub.c13
-rw-r--r--tests/reconnect.c13
-rw-r--r--tests/reqctx.c13
-rw-r--r--tests/reqpoll.c10
-rw-r--r--tests/reqrep.c14
-rw-r--r--tests/reqstress.c21
-rw-r--r--tests/resolv.c4
-rw-r--r--tests/respondpoll.c10
-rw-r--r--tests/scalability.c14
-rw-r--r--tests/sha1.c10
-rw-r--r--tests/sock.c17
-rw-r--r--tests/stats.c17
-rw-r--r--tests/survey.c14
-rw-r--r--tests/surveyctx.c13
-rw-r--r--tests/surveypoll.c10
-rw-r--r--tests/synch.c6
-rw-r--r--tests/tcp.c15
-rw-r--r--tests/tcp6.c10
-rw-r--r--tests/tls.c22
-rw-r--r--tests/transport.c11
-rw-r--r--tests/trantest.h16
-rw-r--r--tests/udp.c8
-rw-r--r--tests/url.c6
-rw-r--r--tests/ws.c18
-rw-r--r--tests/wss.c20
-rw-r--r--tests/wssfile.c21
-rw-r--r--tests/zt.c8
-rw-r--r--tools/nngcat/nngcat.c32
154 files changed, 483 insertions, 539 deletions
diff --git a/src/compat/nanomsg/bus.h b/include/nng/compat/nanomsg/bus.h
index 004a9ac6..004a9ac6 100644
--- a/src/compat/nanomsg/bus.h
+++ b/include/nng/compat/nanomsg/bus.h
diff --git a/src/compat/nanomsg/inproc.h b/include/nng/compat/nanomsg/inproc.h
index 9c71a1ee..9c71a1ee 100644
--- a/src/compat/nanomsg/inproc.h
+++ b/include/nng/compat/nanomsg/inproc.h
diff --git a/src/compat/nanomsg/ipc.h b/include/nng/compat/nanomsg/ipc.h
index c935b50c..c935b50c 100644
--- a/src/compat/nanomsg/ipc.h
+++ b/include/nng/compat/nanomsg/ipc.h
diff --git a/src/compat/nanomsg/nn.h b/include/nng/compat/nanomsg/nn.h
index 63431728..63431728 100644
--- a/src/compat/nanomsg/nn.h
+++ b/include/nng/compat/nanomsg/nn.h
diff --git a/src/compat/nanomsg/pair.h b/include/nng/compat/nanomsg/pair.h
index 458aac8c..458aac8c 100644
--- a/src/compat/nanomsg/pair.h
+++ b/include/nng/compat/nanomsg/pair.h
diff --git a/src/compat/nanomsg/pipeline.h b/include/nng/compat/nanomsg/pipeline.h
index 187a4b4e..187a4b4e 100644
--- a/src/compat/nanomsg/pipeline.h
+++ b/include/nng/compat/nanomsg/pipeline.h
diff --git a/src/compat/nanomsg/pubsub.h b/include/nng/compat/nanomsg/pubsub.h
index 43118f68..43118f68 100644
--- a/src/compat/nanomsg/pubsub.h
+++ b/include/nng/compat/nanomsg/pubsub.h
diff --git a/src/compat/nanomsg/reqrep.h b/include/nng/compat/nanomsg/reqrep.h
index 9490a8f1..9490a8f1 100644
--- a/src/compat/nanomsg/reqrep.h
+++ b/include/nng/compat/nanomsg/reqrep.h
diff --git a/src/compat/nanomsg/survey.h b/include/nng/compat/nanomsg/survey.h
index fdef10cb..fdef10cb 100644
--- a/src/compat/nanomsg/survey.h
+++ b/include/nng/compat/nanomsg/survey.h
diff --git a/src/compat/nanomsg/tcp.h b/include/nng/compat/nanomsg/tcp.h
index 5a305c49..5a305c49 100644
--- a/src/compat/nanomsg/tcp.h
+++ b/include/nng/compat/nanomsg/tcp.h
diff --git a/src/compat/nanomsg/ws.h b/include/nng/compat/nanomsg/ws.h
index 3072a3b5..3072a3b5 100644
--- a/src/compat/nanomsg/ws.h
+++ b/include/nng/compat/nanomsg/ws.h
diff --git a/src/nng.h b/include/nng/nng.h
index 47560134..47560134 100644
--- a/src/nng.h
+++ b/include/nng/nng.h
diff --git a/src/protocol/bus0/bus.h b/include/nng/protocol/bus0/bus.h
index c8c23d84..c8c23d84 100644
--- a/src/protocol/bus0/bus.h
+++ b/include/nng/protocol/bus0/bus.h
diff --git a/src/protocol/pair0/pair.h b/include/nng/protocol/pair0/pair.h
index 1356f1cd..1356f1cd 100644
--- a/src/protocol/pair0/pair.h
+++ b/include/nng/protocol/pair0/pair.h
diff --git a/src/protocol/pair1/pair.h b/include/nng/protocol/pair1/pair.h
index 85da9d45..85da9d45 100644
--- a/src/protocol/pair1/pair.h
+++ b/include/nng/protocol/pair1/pair.h
diff --git a/src/protocol/pipeline0/pull.h b/include/nng/protocol/pipeline0/pull.h
index 1c5d63e3..1c5d63e3 100644
--- a/src/protocol/pipeline0/pull.h
+++ b/include/nng/protocol/pipeline0/pull.h
diff --git a/src/protocol/pipeline0/push.h b/include/nng/protocol/pipeline0/push.h
index a1384e0a..a1384e0a 100644
--- a/src/protocol/pipeline0/push.h
+++ b/include/nng/protocol/pipeline0/push.h
diff --git a/src/protocol/pubsub0/pub.h b/include/nng/protocol/pubsub0/pub.h
index 877f2f1c..877f2f1c 100644
--- a/src/protocol/pubsub0/pub.h
+++ b/include/nng/protocol/pubsub0/pub.h
diff --git a/src/protocol/pubsub0/sub.h b/include/nng/protocol/pubsub0/sub.h
index acb5cda3..acb5cda3 100644
--- a/src/protocol/pubsub0/sub.h
+++ b/include/nng/protocol/pubsub0/sub.h
diff --git a/src/protocol/reqrep0/rep.h b/include/nng/protocol/reqrep0/rep.h
index 612127a2..612127a2 100644
--- a/src/protocol/reqrep0/rep.h
+++ b/include/nng/protocol/reqrep0/rep.h
diff --git a/src/protocol/reqrep0/req.h b/include/nng/protocol/reqrep0/req.h
index 392c7932..392c7932 100644
--- a/src/protocol/reqrep0/req.h
+++ b/include/nng/protocol/reqrep0/req.h
diff --git a/src/protocol/survey0/respond.h b/include/nng/protocol/survey0/respond.h
index b865b2ac..b865b2ac 100644
--- a/src/protocol/survey0/respond.h
+++ b/include/nng/protocol/survey0/respond.h
diff --git a/src/protocol/survey0/survey.h b/include/nng/protocol/survey0/survey.h
index 37f76fbf..37f76fbf 100644
--- a/src/protocol/survey0/survey.h
+++ b/include/nng/protocol/survey0/survey.h
diff --git a/src/supplemental/http/http.h b/include/nng/supplemental/http/http.h
index d0854981..d0854981 100644
--- a/src/supplemental/http/http.h
+++ b/include/nng/supplemental/http/http.h
diff --git a/src/supplemental/tls/tls.h b/include/nng/supplemental/tls/tls.h
index 5983f3b6..5983f3b6 100644
--- a/src/supplemental/tls/tls.h
+++ b/include/nng/supplemental/tls/tls.h
diff --git a/src/supplemental/util/options.h b/include/nng/supplemental/util/options.h
index 83969a90..83969a90 100644
--- a/src/supplemental/util/options.h
+++ b/include/nng/supplemental/util/options.h
diff --git a/src/supplemental/util/platform.h b/include/nng/supplemental/util/platform.h
index 0fcc7d16..0fcc7d16 100644
--- a/src/supplemental/util/platform.h
+++ b/include/nng/supplemental/util/platform.h
diff --git a/src/transport/inproc/inproc.h b/include/nng/transport/inproc/inproc.h
index bfd6e1ca..bfd6e1ca 100644
--- a/src/transport/inproc/inproc.h
+++ b/include/nng/transport/inproc/inproc.h
diff --git a/src/transport/ipc/ipc.h b/include/nng/transport/ipc/ipc.h
index 497fb2b5..497fb2b5 100644
--- a/src/transport/ipc/ipc.h
+++ b/include/nng/transport/ipc/ipc.h
diff --git a/src/transport/tcp/tcp.h b/include/nng/transport/tcp/tcp.h
index 6975109f..6975109f 100644
--- a/src/transport/tcp/tcp.h
+++ b/include/nng/transport/tcp/tcp.h
diff --git a/src/transport/tls/tls.h b/include/nng/transport/tls/tls.h
index a3fa0eb9..a3fa0eb9 100644
--- a/src/transport/tls/tls.h
+++ b/include/nng/transport/tls/tls.h
diff --git a/src/transport/ws/websocket.h b/include/nng/transport/ws/websocket.h
index 8179beab..8179beab 100644
--- a/src/transport/ws/websocket.h
+++ b/include/nng/transport/ws/websocket.h
diff --git a/src/transport/zerotier/zerotier.h b/include/nng/transport/zerotier/zerotier.h
index ab4d8511..ab4d8511 100644
--- a/src/transport/zerotier/zerotier.h
+++ b/include/nng/transport/zerotier/zerotier.h
diff --git a/perf/perf.c b/perf/perf.c
index 6bf6a2aa..79cda361 100644
--- a/perf/perf.c
+++ b/perf/perf.c
@@ -8,8 +8,6 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "nng.h"
-
#include <ctype.h>
#include <stdarg.h>
#include <stdint.h>
@@ -17,13 +15,14 @@
#include <stdlib.h>
#include <string.h>
-#include "supplemental/util/platform.h"
+#include <nng/nng.h>
+#include <nng/supplemental/util/platform.h>
#if defined(NNG_HAVE_PAIR1)
-#include "protocol/pair1/pair.h"
+#include <nng/protocol/pair1/pair.h>
#elif defined(NNG_HAVE_PAIR0)
-#include "protocol/pair0/pair.h"
+#include <nng/protocol/pair0/pair.h>
#else
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 960e912c..dff34f9f 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -24,10 +24,9 @@
# IN THE SOFTWARE.
#
-set (NNG_HDRS nng.h)
set (NNG_SRCS
nng.c
- nng.h
+ ${PROJECT_SOURCE_DIR}/include/nng/nng.h
core/defs.h
@@ -246,7 +245,10 @@ set_target_properties (${PROJECT_NAME} ${PROJECT_NAME}
target_link_libraries (${PROJECT_NAME} PRIVATE ${NNG_LIBS})
-target_include_directories (${PROJECT_NAME} INTERFACE $<INSTALL_INTERFACE:include> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
+target_include_directories (${PROJECT_NAME} INTERFACE $<INSTALL_INTERFACE:include>
+$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>)
+
+target_include_directories (${PROJECT_NAME} PRIVATE ${PROJECT_SOURCE_DIR}/include)
install (TARGETS ${PROJECT_NAME}
EXPORT ${PROJECT_NAME}-target
@@ -263,14 +265,10 @@ install (EXPORT ${PROJECT_NAME}-target
COMPONENT Library
)
-# Install the header files. It would be much better if we could use
-# the PUBLIC_HEADER facility, but it stupidly flattens the directories.
-foreach (f ${NNG_HDRS})
- get_filename_component(d ${f} DIRECTORY)
- install(FILES ${f}
- DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/nng/${d}
- COMPONENT Headers)
-endforeach()
+# Install the header files.
+install(DIRECTORY ../include/nng
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
+ COMPONENT Headers)
# Promote settings to parent
set(NNG_LIBS ${NNG_LIBS} PARENT_SCOPE)
@@ -296,7 +294,7 @@ write_basic_package_version_file("${version_config}"
VERSION ${NNG_PACKAGE_VERSION}
COMPATIBILITY SameMajorVersion
)
-configure_package_config_file(${CMAKE_SOURCE_DIR}/cmake/${PROJECT_NAME}-config.cmake.in "${project_config}"
+configure_package_config_file(${PROJECT_SOURCE_DIR}/cmake/${PROJECT_NAME}-config.cmake.in "${project_config}"
INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
PATH_VARS INCLUDE_INSTALL_DIRS)
diff --git a/src/compat/nanomsg/CMakeLists.txt b/src/compat/nanomsg/CMakeLists.txt
index cdd6fb01..1608741d 100644
--- a/src/compat/nanomsg/CMakeLists.txt
+++ b/src/compat/nanomsg/CMakeLists.txt
@@ -9,18 +9,5 @@
#
set(COMPAT_SOURCES compat/nanomsg/nn.c)
-set(COMPAT_HEADERS compat/nanomsg/nn.h
- compat/nanomsg/bus.h
- compat/nanomsg/inproc.h
- compat/nanomsg/ipc.h
- compat/nanomsg/pair.h
- compat/nanomsg/pipeline.h
- compat/nanomsg/pubsub.h
- compat/nanomsg/reqrep.h
- compat/nanomsg/survey.h
- compat/nanomsg/tcp.h
- compat/nanomsg/ws.h
-)
set(NNG_SRCS ${NNG_SRCS} ${COMPAT_SOURCES} PARENT_SCOPE)
-set(NNG_HDRS ${NNG_HDRS} ${COMPAT_HEADERS} PARENT_SCOPE)
diff --git a/src/compat/nanomsg/nn.c b/src/compat/nanomsg/nn.c
index bc27832e..22990996 100644
--- a/src/compat/nanomsg/nn.c
+++ b/src/compat/nanomsg/nn.c
@@ -8,34 +8,34 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "nn.h"
+#include "nng/compat/nanomsg/nn.h"
// transports
-#include "inproc.h"
-#include "ipc.h"
-#include "tcp.h"
-#include "ws.h"
+#include "nng/compat/nanomsg/inproc.h"
+#include "nng/compat/nanomsg/ipc.h"
+#include "nng/compat/nanomsg/tcp.h"
+#include "nng/compat/nanomsg/ws.h"
// protocols
-#include "bus.h"
-#include "pair.h"
-#include "pipeline.h"
-#include "pubsub.h"
-#include "reqrep.h"
-#include "survey.h"
+#include "nng/compat/nanomsg/bus.h"
+#include "nng/compat/nanomsg/pair.h"
+#include "nng/compat/nanomsg/pipeline.h"
+#include "nng/compat/nanomsg/pubsub.h"
+#include "nng/compat/nanomsg/reqrep.h"
+#include "nng/compat/nanomsg/survey.h"
// underlying NNG headers
-#include "nng.h"
-#include "protocol/bus0/bus.h"
-#include "protocol/pair0/pair.h"
-#include "protocol/pipeline0/pull.h"
-#include "protocol/pipeline0/push.h"
-#include "protocol/pubsub0/pub.h"
-#include "protocol/pubsub0/sub.h"
-#include "protocol/reqrep0/rep.h"
-#include "protocol/reqrep0/req.h"
-#include "protocol/survey0/respond.h"
-#include "protocol/survey0/survey.h"
+#include "nng/nng.h"
+#include "nng/protocol/bus0/bus.h"
+#include "nng/protocol/pair0/pair.h"
+#include "nng/protocol/pipeline0/pull.h"
+#include "nng/protocol/pipeline0/push.h"
+#include "nng/protocol/pubsub0/pub.h"
+#include "nng/protocol/pubsub0/sub.h"
+#include "nng/protocol/reqrep0/rep.h"
+#include "nng/protocol/reqrep0/req.h"
+#include "nng/protocol/survey0/respond.h"
+#include "nng/protocol/survey0/survey.h"
#include "core/nng_impl.h"
diff --git a/src/core/nng_impl.h b/src/core/nng_impl.h
index f28ddf8c..abf47f49 100644
--- a/src/core/nng_impl.h
+++ b/src/core/nng_impl.h
@@ -10,7 +10,7 @@
#ifndef CORE_NNG_IMPL_H
#define CORE_NNG_IMPL_H
-#include "nng.h"
+#include "nng/nng.h"
// Internal implementation things for NNG, common definitions, etc.
// All internal modules wind up including this file to avoid having
diff --git a/src/core/transport.c b/src/core/transport.c
index 8485d048..e27c349e 100644
--- a/src/core/transport.c
+++ b/src/core/transport.c
@@ -11,22 +11,22 @@
#include "core/nng_impl.h"
#ifdef NNG_TRANSPORT_INPROC
-#include "transport/inproc/inproc.h"
+#include "nng/transport/inproc/inproc.h"
#endif
#ifdef NNG_TRANSPORT_IPC
-#include "transport/ipc/ipc.h"
+#include "nng/transport/ipc/ipc.h"
#endif
#ifdef NNG_TRANSPORT_TCP
-#include "transport/tcp/tcp.h"
+#include "nng/transport/tcp/tcp.h"
#endif
#ifdef NNG_TRANSPORT_TLS
-#include "transport/tls/tls.h"
+#include "nng/transport/tls/tls.h"
#endif
#ifdef NNG_TRANSPORT_WS
-#include "transport/ws/websocket.h"
+#include "nng/transport/ws/websocket.h"
#endif
#ifdef NNG_TRANSPORT_ZEROTIER
-#include "transport/zerotier/zerotier.h"
+#include "nng/transport/zerotier/zerotier.h"
#endif
#include <stdio.h>
diff --git a/src/nng.c b/src/nng.c
index a8d4bd24..5e8ec384 100644
--- a/src/nng.c
+++ b/src/nng.c
@@ -8,7 +8,7 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "nng.h"
+#include "nng/nng.h"
#include "core/nng_impl.h"
// This file provides the "public" API. This is a thin wrapper around
diff --git a/src/protocol/bus0/CMakeLists.txt b/src/protocol/bus0/CMakeLists.txt
index 73acdf11..1f144438 100644
--- a/src/protocol/bus0/CMakeLists.txt
+++ b/src/protocol/bus0/CMakeLists.txt
@@ -14,10 +14,8 @@ mark_as_advanced(NNG_PROTO_BUS0)
if (NNG_PROTO_BUS0)
set(_DEFS -DNNG_HAVE_BUS0)
- set(_SRCS protocol/bus0/bus.c protocol/bus0/bus.h)
- set(_HDRS protocol/bus0/bus.h)
+ set(_SRCS protocol/bus0/bus.c ${PROJECT_SOURCE_DIR}/include/nng/protocol/bus0/bus.h)
set(NNG_DEFS ${NNG_DEFS} ${_DEFS} PARENT_SCOPE)
set(NNG_SRCS ${NNG_SRCS} ${_SRCS} PARENT_SCOPE)
- set(NNG_HDRS ${NNG_HDRS} ${_HDRS} PARENT_SCOPE)
endif()
diff --git a/src/protocol/bus0/bus.c b/src/protocol/bus0/bus.c
index 2426abba..ed2a244f 100644
--- a/src/protocol/bus0/bus.c
+++ b/src/protocol/bus0/bus.c
@@ -13,7 +13,7 @@
#include <string.h>
#include "core/nng_impl.h"
-#include "protocol/bus0/bus.h"
+#include "nng/protocol/bus0/bus.h"
// Bus protocol. The BUS protocol, each peer sends a message to its peers.
// However, bus protocols do not "forward" (absent a device). So in order
diff --git a/src/protocol/pair0/CMakeLists.txt b/src/protocol/pair0/CMakeLists.txt
index c453b07f..72d04888 100644
--- a/src/protocol/pair0/CMakeLists.txt
+++ b/src/protocol/pair0/CMakeLists.txt
@@ -14,10 +14,8 @@ mark_as_advanced(NNG_PROTO_PAIR0)
if (NNG_PROTO_PAIR0)
set(_DEFS -DNNG_HAVE_PAIR0)
- set(_SRCS protocol/pair0/pair.c protocol/pair0/pair.h)
- set(_HDRS protocol/pair0/pair.h)
+ set(_SRCS protocol/pair0/pair.c ${PROJECT_SOURCE_DIR}/include/nng/protocol/pair0/pair.h)
set(NNG_DEFS ${NNG_DEFS} ${_DEFS} PARENT_SCOPE)
set(NNG_SRCS ${NNG_SRCS} ${_SRCS} PARENT_SCOPE)
- set(NNG_HDRS ${NNG_HDRS} ${_HDRS} PARENT_SCOPE)
endif()
diff --git a/src/protocol/pair0/pair.c b/src/protocol/pair0/pair.c
index d663c5e2..fef2acaf 100644
--- a/src/protocol/pair0/pair.c
+++ b/src/protocol/pair0/pair.c
@@ -12,7 +12,7 @@
#include <string.h>
#include "core/nng_impl.h"
-#include "protocol/pair0/pair.h"
+#include "nng/protocol/pair0/pair.h"
// Pair protocol. The PAIR protocol is a simple 1:1 messaging pattern.
// While a peer is connected to the server, all other peer connection
diff --git a/src/protocol/pair1/CMakeLists.txt b/src/protocol/pair1/CMakeLists.txt
index 5c8813bf..cbcb2bc2 100644
--- a/src/protocol/pair1/CMakeLists.txt
+++ b/src/protocol/pair1/CMakeLists.txt
@@ -14,10 +14,8 @@ mark_as_advanced(NNG_PROTO_PAIR1)
if (NNG_PROTO_PAIR1)
set(_DEFS -DNNG_HAVE_PAIR1)
- set(_SRCS protocol/pair1/pair.c protocol/pair1/pair.h)
- set(_HDRS protocol/pair1/pair.h)
+ set(_SRCS protocol/pair1/pair.c ${PROJECT_SOURCE_DIR}/include/nng/protocol/pair1/pair.h)
set(NNG_DEFS ${NNG_DEFS} ${_DEFS} PARENT_SCOPE)
set(NNG_SRCS ${NNG_SRCS} ${_SRCS} PARENT_SCOPE)
- set(NNG_HDRS ${NNG_HDRS} ${_HDRS} PARENT_SCOPE)
endif()
diff --git a/src/protocol/pair1/pair.c b/src/protocol/pair1/pair.c
index 3033b196..a474f0d9 100644
--- a/src/protocol/pair1/pair.c
+++ b/src/protocol/pair1/pair.c
@@ -13,7 +13,7 @@
#include "core/nng_impl.h"
-#include "protocol/pair1/pair.h"
+#include "nng/protocol/pair1/pair.h"
// Pair protocol. The PAIRv1 protocol is a simple 1:1 messaging pattern,
// usually, but it can support a polyamorous mode where a single server can
diff --git a/src/protocol/pipeline0/CMakeLists.txt b/src/protocol/pipeline0/CMakeLists.txt
index 675cb961..f4de4475 100644
--- a/src/protocol/pipeline0/CMakeLists.txt
+++ b/src/protocol/pipeline0/CMakeLists.txt
@@ -16,21 +16,19 @@ option (NNG_PROTO_PULL0 "Enable PULLv0 protocol." ON)
mark_as_advanced(NNG_PROTO_PULL0)
set(_DEFS)
-set(_HDRS)
set(_SRCS)
if (NNG_PROTO_PUSH0)
- list(APPEND _SRCS protocol/pipeline0/push.c protocol/pipeline0/push.h)
- list(APPEND _HDRS protocol/pipeline0/push.h)
+ list(APPEND _SRCS protocol/pipeline0/push.c ${PROJECT_SOURCE_DIR}/include/nng/protocol/pipeline0/push.h)
+
list(APPEND _DEFS -DNNG_HAVE_PUSH0)
endif()
if (NNG_PROTO_PULL0)
- list(APPEND _SRCS protocol/pipeline0/pull.c protocol/pipeline0/pull.h)
- list(APPEND _HDRS protocol/pipeline0/pull.h)
+ list(APPEND _SRCS protocol/pipeline0/pull.c ${PROJECT_SOURCE_DIR}/include/nng/protocol/pipeline0/pull.h)
+
list(APPEND _DEFS -DNNG_HAVE_PULL0)
endif()
set(NNG_DEFS ${NNG_DEFS} ${_DEFS} PARENT_SCOPE)
set(NNG_SRCS ${NNG_SRCS} ${_SRCS} PARENT_SCOPE)
-set(NNG_HDRS ${NNG_HDRS} ${_HDRS} PARENT_SCOPE)
diff --git a/src/protocol/pipeline0/pull.c b/src/protocol/pipeline0/pull.c
index a713bc80..b0f089b1 100644
--- a/src/protocol/pipeline0/pull.c
+++ b/src/protocol/pipeline0/pull.c
@@ -12,7 +12,7 @@
#include <string.h>
#include "core/nng_impl.h"
-#include "protocol/pipeline0/pull.h"
+#include "nng/protocol/pipeline0/pull.h"
// Pull protocol. The PULL protocol is the "read" side of a pipeline.
diff --git a/src/protocol/pipeline0/push.c b/src/protocol/pipeline0/push.c
index 00e9212c..c31bec4e 100644
--- a/src/protocol/pipeline0/push.c
+++ b/src/protocol/pipeline0/push.c
@@ -12,7 +12,7 @@
#include <string.h>
#include "core/nng_impl.h"
-#include "protocol/pipeline0/push.h"
+#include "nng/protocol/pipeline0/push.h"
// Push protocol. The PUSH protocol is the "write" side of a pipeline.
// Push distributes fairly, or tries to, by giving messages in round-robin
diff --git a/src/protocol/pubsub0/CMakeLists.txt b/src/protocol/pubsub0/CMakeLists.txt
index 29f64049..1ea0cacf 100644
--- a/src/protocol/pubsub0/CMakeLists.txt
+++ b/src/protocol/pubsub0/CMakeLists.txt
@@ -17,20 +17,18 @@ mark_as_advanced(NNG_PROTO_SUB0)
set(_DEFS)
set(_SRCS)
-set(_HDRS)
if (NNG_PROTO_PUB0)
list(APPEND _DEFS -DNNG_HAVE_PUB0)
- list(APPEND _SRCS protocol/pubsub0/pub.c protocol/pubsub0/pub.h)
- list(APPEND _HDRS protocol/pubsub0/pub.h)
+ list(APPEND _SRCS protocol/pubsub0/pub.c ${PROJECT_SOURCE_DIR}/include/nng/protocol/pubsub0/pub.h)
+
endif()
if (NNG_PROTO_SUB0)
list(APPEND _DEFS -DNNG_HAVE_SUB0)
- list(APPEND _SRCS protocol/pubsub0/sub.c protocol/pubsub0/sub.h)
- list(APPEND _HDRS protocol/pubsub0/sub.h)
+ list(APPEND _SRCS protocol/pubsub0/sub.c ${PROJECT_SOURCE_DIR}/include/nng/protocol/pubsub0/sub.h)
+
endif()
set(NNG_DEFS ${NNG_DEFS} ${_DEFS} PARENT_SCOPE)
set(NNG_SRCS ${NNG_SRCS} ${_SRCS} PARENT_SCOPE)
-set(NNG_HDRS ${NNG_HDRS} ${_HDRS} PARENT_SCOPE)
diff --git a/src/protocol/pubsub0/pub.c b/src/protocol/pubsub0/pub.c
index cbc8acea..e1c182e8 100644
--- a/src/protocol/pubsub0/pub.c
+++ b/src/protocol/pubsub0/pub.c
@@ -12,7 +12,7 @@
#include <string.h>
#include "core/nng_impl.h"
-#include "protocol/pubsub0/pub.h"
+#include "nng/protocol/pubsub0/pub.h"
// Publish protocol. The PUB protocol simply sends messages out, as
// a broadcast. It has nothing more sophisticated because it does not
diff --git a/src/protocol/pubsub0/sub.c b/src/protocol/pubsub0/sub.c
index aeccfd25..7bb4485a 100644
--- a/src/protocol/pubsub0/sub.c
+++ b/src/protocol/pubsub0/sub.c
@@ -12,7 +12,7 @@
#include <string.h>
#include "core/nng_impl.h"
-#include "protocol/pubsub0/sub.h"
+#include "nng/protocol/pubsub0/sub.h"
// Subscriber protocol. The SUB protocol receives messages sent to
// it from publishers, and filters out those it is not interested in,
diff --git a/src/protocol/reqrep0/CMakeLists.txt b/src/protocol/reqrep0/CMakeLists.txt
index 70c075c1..bae31433 100644
--- a/src/protocol/reqrep0/CMakeLists.txt
+++ b/src/protocol/reqrep0/CMakeLists.txt
@@ -17,24 +17,22 @@ mark_as_advanced(NNG_PROTO_REP0)
set(_DEFS)
set(_SRCS)
-set(_HDRS)
if (NNG_PROTO_REQ0)
list(APPEND _DEFS -DNNG_HAVE_REQ0)
list(APPEND _SRCS
protocol/reqrep0/req.c protocol/reqrep0/xreq.c
- protocol/reqrep0/req.h)
- list(APPEND _HDRS protocol/reqrep0/req.h)
+ ${PROJECT_SOURCE_DIR}/include/nng/protocol/reqrep0/req.h)
+
endif()
if (NNG_PROTO_REP0)
list(APPEND _DEFS -DNNG_HAVE_REP0)
list(APPEND _SRCS
protocol/reqrep0/rep.c protocol/reqrep0/xrep.c
- protocol/reqrep0/rep.h)
- list(APPEND _HDRS protocol/reqrep0/rep.h)
+ ${PROJECT_SOURCE_DIR}/include/nng/protocol/reqrep0/rep.h)
+
endif()
set(NNG_DEFS ${NNG_DEFS} ${_DEFS} PARENT_SCOPE)
set(NNG_SRCS ${NNG_SRCS} ${_SRCS} PARENT_SCOPE)
-set(NNG_HDRS ${NNG_HDRS} ${_HDRS} PARENT_SCOPE)
diff --git a/src/protocol/reqrep0/rep.c b/src/protocol/reqrep0/rep.c
index 586f7143..875918f5 100644
--- a/src/protocol/reqrep0/rep.c
+++ b/src/protocol/reqrep0/rep.c
@@ -12,7 +12,7 @@
#include <string.h>
#include "core/nng_impl.h"
-#include "protocol/reqrep0/rep.h"
+#include "nng/protocol/reqrep0/rep.h"
// Response protocol. The REP protocol is the "reply" side of a
// request-reply pair. This is useful for building RPC servers, for
diff --git a/src/protocol/reqrep0/req.c b/src/protocol/reqrep0/req.c
index 49d0ea66..139427a2 100644
--- a/src/protocol/reqrep0/req.c
+++ b/src/protocol/reqrep0/req.c
@@ -13,7 +13,7 @@
#include <string.h>
#include "core/nng_impl.h"
-#include "protocol/reqrep0/req.h"
+#include "nng/protocol/reqrep0/req.h"
// Request protocol. The REQ protocol is the "request" side of a
// request-reply pair. This is useful for building RPC clients, for example.
diff --git a/src/protocol/reqrep0/xrep.c b/src/protocol/reqrep0/xrep.c
index 1fe81ac5..d89722d6 100644
--- a/src/protocol/reqrep0/xrep.c
+++ b/src/protocol/reqrep0/xrep.c
@@ -12,7 +12,7 @@
#include <string.h>
#include "core/nng_impl.h"
-#include "protocol/reqrep0/rep.h"
+#include "nng/protocol/reqrep0/rep.h"
// Response protocol in raw mode. The REP protocol is the "reply" side of a
// request-reply pair. This is useful for building RPC servers, for
diff --git a/src/protocol/reqrep0/xreq.c b/src/protocol/reqrep0/xreq.c
index a98c713e..271c59a6 100644
--- a/src/protocol/reqrep0/xreq.c
+++ b/src/protocol/reqrep0/xreq.c
@@ -13,7 +13,7 @@
#include <string.h>
#include "core/nng_impl.h"
-#include "protocol/reqrep0/req.h"
+#include "nng/protocol/reqrep0/req.h"
// Request protocol. The REQ protocol is the "request" side of a
// request-reply pair. This is useful for building RPC clients, for example.
diff --git a/src/protocol/survey0/CMakeLists.txt b/src/protocol/survey0/CMakeLists.txt
index b6104a54..260c3e58 100644
--- a/src/protocol/survey0/CMakeLists.txt
+++ b/src/protocol/survey0/CMakeLists.txt
@@ -16,25 +16,23 @@ option (NNG_PROTO_SURVEYOR0 "Enable SURVEYORv0 protocol." ON)
mark_as_advanced(NNG_PROTO_SURVEYOR0)
set(_DEFS)
-set(_HDRS)
set(_SRCS)
if (NNG_PROTO_SURVEYOR0)
list(APPEND _DEFS -DNNG_HAVE_SURVEYOR0)
list(APPEND _SRCS
protocol/survey0/survey.c protocol/survey0/xsurvey.c
- protocol/survey0/survey.h)
- list(APPEND _HDRS protocol/survey0/survey.h)
+ ${PROJECT_SOURCE_DIR}/include/nng/protocol/survey0/survey.h)
+
endif()
if (NNG_PROTO_RESPONDENT0)
list(APPEND _DEFS -DNNG_HAVE_RESPONDENT0)
list(APPEND _SRCS
protocol/survey0/respond.c protocol/survey0/xrespond.c
- protocol/survey0/respond.h)
- list(APPEND _HDRS protocol/survey0/respond.h)
+ ${PROJECT_SOURCE_DIR}/include/nng/protocol/survey0/respond.h)
+
endif()
set(NNG_DEFS ${NNG_DEFS} ${_DEFS} PARENT_SCOPE)
set(NNG_SRCS ${NNG_SRCS} ${_SRCS} PARENT_SCOPE)
-set(NNG_HDRS ${NNG_HDRS} ${_HDRS} PARENT_SCOPE)
diff --git a/src/protocol/survey0/respond.c b/src/protocol/survey0/respond.c
index 80e3f2f8..593b9bae 100644
--- a/src/protocol/survey0/respond.c
+++ b/src/protocol/survey0/respond.c
@@ -12,7 +12,7 @@
#include <string.h>
#include "core/nng_impl.h"
-#include "protocol/survey0/respond.h"
+#include "nng/protocol/survey0/respond.h"
// Respondent protocol. The RESPONDENT protocol is the "replier" side of
// the surveyor pattern. This is useful for building service discovery, or
diff --git a/src/protocol/survey0/survey.c b/src/protocol/survey0/survey.c
index 58fa4aa6..a2eb7379 100644
--- a/src/protocol/survey0/survey.c
+++ b/src/protocol/survey0/survey.c
@@ -12,7 +12,7 @@
#include <string.h>
#include "core/nng_impl.h"
-#include "protocol/survey0/survey.h"
+#include "nng/protocol/survey0/survey.h"
// Surveyor protocol. The SURVEYOR protocol is the "survey" side of the
// survey pattern. This is useful for building service discovery, voting, etc.
diff --git a/src/protocol/survey0/xrespond.c b/src/protocol/survey0/xrespond.c
index 334c5ca6..9c9a1a16 100644
--- a/src/protocol/survey0/xrespond.c
+++ b/src/protocol/survey0/xrespond.c
@@ -12,7 +12,7 @@
#include <string.h>
#include "core/nng_impl.h"
-#include "protocol/survey0/respond.h"
+#include "nng/protocol/survey0/respond.h"
// Respondent protocol. The RESPONDENT protocol is the "replier" side of
// the surveyor pattern. This is useful for building service discovery, or
diff --git a/src/protocol/survey0/xsurvey.c b/src/protocol/survey0/xsurvey.c
index fabcc766..83a7c589 100644
--- a/src/protocol/survey0/xsurvey.c
+++ b/src/protocol/survey0/xsurvey.c
@@ -12,7 +12,7 @@
#include <string.h>
#include "core/nng_impl.h"
-#include "protocol/survey0/survey.h"
+#include "nng/protocol/survey0/survey.h"
// Surveyor protocol. The SURVEYOR protocol is the "survey" side of the
// survey pattern. This is useful for building service discovery, voting, etc.
diff --git a/src/supplemental/http/CMakeLists.txt b/src/supplemental/http/CMakeLists.txt
index 0fe9e7c5..2b8696b6 100644
--- a/src/supplemental/http/CMakeLists.txt
+++ b/src/supplemental/http/CMakeLists.txt
@@ -13,9 +13,9 @@ if (NNG_ENABLE_HTTP)
set(NNG_SUPP_HTTP ON)
endif()
mark_as_advanced(NNG_ENABLE_HTTP)
-
-set(_HDRS supplemental/http/http.h)
-set(_SRCS ${_HDRS} supplemental/http/http_public.c supplemental/http/http_api.h)
+set(_SRCS supplemental/http/http_public.c
+ ${PROJECT_SOURCE_DIR}/include/nng/supplemental/http/http.h
+ supplemental/http/http_api.h)
if (NNG_SUPP_HTTP)
set(_DEFS -DNNG_SUPP_HTTP)
@@ -30,4 +30,3 @@ endif()
set(NNG_DEFS ${NNG_DEFS} ${_DEFS} PARENT_SCOPE)
set(NNG_SRCS ${NNG_SRCS} ${_SRCS} PARENT_SCOPE)
-set(NNG_HDRS ${NNG_HDRS} ${_HDRS} PARENT_SCOPE)
diff --git a/src/supplemental/http/http_api.h b/src/supplemental/http/http_api.h
index fdee70e9..a13348be 100644
--- a/src/supplemental/http/http_api.h
+++ b/src/supplemental/http/http_api.h
@@ -12,9 +12,9 @@
#define NNG_SUPPLEMENTAL_HTTP_HTTP_API_H
#include "core/nng_impl.h"
-#include "supplemental/tls/tls.h"
+#include "nng/supplemental/tls/tls.h"
-#include "supplemental/http/http.h"
+#include "nng/supplemental/http/http.h"
// This represents the "internal" HTTP API. It should not be used
// or exposed to applications directly.
diff --git a/src/supplemental/http/http_client.c b/src/supplemental/http/http_client.c
index c70b7a63..798cbe14 100644
--- a/src/supplemental/http/http_client.c
+++ b/src/supplemental/http/http_client.c
@@ -14,7 +14,7 @@
#include <string.h>
#include "core/nng_impl.h"
-#include "supplemental/tls/tls.h"
+#include "nng/supplemental/tls/tls.h"
#include "supplemental/tls/tls_api.h"
#include "http_api.h"
diff --git a/src/supplemental/http/http_conn.c b/src/supplemental/http/http_conn.c
index d00bd910..4d57281f 100644
--- a/src/supplemental/http/http_conn.c
+++ b/src/supplemental/http/http_conn.c
@@ -13,7 +13,7 @@
#include <string.h>
#include "core/nng_impl.h"
-#include "supplemental/tls/tls.h"
+#include "nng/supplemental/tls/tls.h"
#include "supplemental/tls/tls_api.h"
#include "http_api.h"
diff --git a/src/supplemental/http/http_public.c b/src/supplemental/http/http_public.c
index 50ef03fa..3152c41f 100644
--- a/src/supplemental/http/http_public.c
+++ b/src/supplemental/http/http_public.c
@@ -9,9 +9,9 @@
//
#include "core/nng_impl.h"
-#include "http.h"
+#include "nng/supplemental/http/http.h"
#include "http_api.h"
-#include "supplemental/tls/tls.h"
+#include "nng/supplemental/tls/tls.h"
// Symbols in this file are "public" versions of the HTTP API.
// These are suitable for exposure to applications.
diff --git a/src/supplemental/http/http_server.c b/src/supplemental/http/http_server.c
index b7ca9f7e..a6343d87 100644
--- a/src/supplemental/http/http_server.c
+++ b/src/supplemental/http/http_server.c
@@ -15,7 +15,7 @@
#include <string.h>
#include "core/nng_impl.h"
-#include "supplemental/tls/tls.h"
+#include "nng/supplemental/tls/tls.h"
#include "supplemental/tls/tls_api.h"
#include "http_api.h"
diff --git a/src/supplemental/tls/CMakeLists.txt b/src/supplemental/tls/CMakeLists.txt
index 111ff70f..8fed1df1 100644
--- a/src/supplemental/tls/CMakeLists.txt
+++ b/src/supplemental/tls/CMakeLists.txt
@@ -13,8 +13,7 @@ if (NNG_SUPP_TLS)
set(_DEFS -DNNG_SUPP_TLS)
endif()
-set(_SRCS supplemental/tls/tls.h)
-set(_HDRS supplemental/tls/tls.h)
+set(_SRCS ${PROJECT_SOURCE_DIR}/include/nng/supplemental/tls/tls.h)
# For now we only support the ARM mbedTLS library.
if (NNG_SUPP_TLS_MBEDTLS)
@@ -36,12 +35,10 @@ endif()
list(APPEND NNG_DEFS ${_DEFS})
list(APPEND NNG_SRCS ${_SRCS})
-list(APPEND NNG_HDRS ${_HDRS})
list(APPEND NNG_LIBS ${_LIBS})
list(APPEND NNG_INCS ${_INCS})
set(NNG_DEFS ${NNG_DEFS} PARENT_SCOPE)
set(NNG_SRCS ${NNG_SRCS} PARENT_SCOPE)
-set(NNG_HDRS ${NNG_HDRS} PARENT_SCOPE)
set(NNG_LIBS ${NNG_LIBS} PARENT_SCOPE)
set(NNG_INCS ${NNG_INCS} PARENT_SCOPE)
diff --git a/src/supplemental/tls/mbedtls/tls.c b/src/supplemental/tls/mbedtls/tls.c
index f7431ac6..c01ff2ed 100644
--- a/src/supplemental/tls/mbedtls/tls.c
+++ b/src/supplemental/tls/mbedtls/tls.c
@@ -28,7 +28,7 @@
#include "core/nng_impl.h"
-#include "supplemental/tls/tls.h"
+#include "nng/supplemental/tls/tls.h"
#include "supplemental/tls/tls_api.h"
// Implementation note. This implementation buffers data between the TLS
diff --git a/src/supplemental/tls/none/tls.c b/src/supplemental/tls/none/tls.c
index d7968758..e9d84e19 100644
--- a/src/supplemental/tls/none/tls.c
+++ b/src/supplemental/tls/none/tls.c
@@ -17,7 +17,7 @@
// We provide stub functions only to satisfy linkage.
#include "core/nng_impl.h"
-#include "supplemental/tls/tls.h"
+#include "nng/supplemental/tls/tls.h"
#include "supplemental/tls/tls_api.h"
void
diff --git a/src/supplemental/util/CMakeLists.txt b/src/supplemental/util/CMakeLists.txt
index c61d8a09..64374d69 100644
--- a/src/supplemental/util/CMakeLists.txt
+++ b/src/supplemental/util/CMakeLists.txt
@@ -8,8 +8,9 @@
# found online at https://opensource.org/licenses/MIT.
#
-set(_SRCS supplemental/util/options.c supplemental/util/platform.c)
-set(_HDRS supplemental/util/options.h supplemental/util/platform.h)
+set(_SRCS supplemental/util/options.c
+ ${PROJECT_SOURCE_DIR}/include/nng/supplemental/util/options.h
+ supplemental/util/platform.c
+ ${PROJECT_SOURCE_DIR}/include/nng/supplemental/util/platform.h)
set(NNG_SRCS ${NNG_SRCS} ${_SRCS} PARENT_SCOPE)
-set(NNG_HDRS ${NNG_HDRS} ${_HDRS} PARENT_SCOPE)
diff --git a/src/supplemental/util/options.c b/src/supplemental/util/options.c
index 711635e2..c8dafed8 100644
--- a/src/supplemental/util/options.c
+++ b/src/supplemental/util/options.c
@@ -12,7 +12,7 @@
#include <string.h>
#include "core/nng_impl.h"
-#include "supplemental/util/options.h"
+#include "nng/supplemental/util/options.h"
// Call with optidx set to 1 to start parsing.
int
diff --git a/src/supplemental/util/platform.c b/src/supplemental/util/platform.c
index 691ce867..138e8b0b 100644
--- a/src/supplemental/util/platform.c
+++ b/src/supplemental/util/platform.c
@@ -12,7 +12,7 @@
#include <string.h>
#include "core/nng_impl.h"
-#include "supplemental/util/platform.h"
+#include "nng/supplemental/util/platform.h"
nng_time
nng_clock(void)
diff --git a/src/transport/inproc/CMakeLists.txt b/src/transport/inproc/CMakeLists.txt
index 79264253..bab4cd7e 100644
--- a/src/transport/inproc/CMakeLists.txt
+++ b/src/transport/inproc/CMakeLists.txt
@@ -13,11 +13,9 @@ option (NNG_TRANSPORT_INPROC "Enable inproc transport." ON)
mark_as_advanced(NNG_TRANSPORT_INPROC)
if (NNG_TRANSPORT_INPROC)
- set(_SRCS transport/inproc/inproc.c transport/inproc/inproc.h)
- set(_HDRS transport/inproc/inproc.h)
+ set(_SRCS transport/inproc/inproc.c ${PROJECT_SOURCE_DIR}/include/nng/transport/inproc/inproc.h)
set(_DEFS -DNNG_TRANSPORT_INPROC)
set(NNG_SRCS ${NNG_SRCS} ${_SRCS} PARENT_SCOPE)
- set(NNG_HDRS ${NNG_HDRS} ${_HDRS} PARENT_SCOPE)
set(NNG_DEFS ${NNG_DEFS} ${_DEFS} PARENT_SCOPE)
endif()
diff --git a/src/transport/ipc/CMakeLists.txt b/src/transport/ipc/CMakeLists.txt
index 885b62b6..0fd31984 100644
--- a/src/transport/ipc/CMakeLists.txt
+++ b/src/transport/ipc/CMakeLists.txt
@@ -14,10 +14,8 @@ mark_as_advanced(NNG_TRANSPORT_IPC)
if (NNG_TRANSPORT_IPC)
set(_DEFS -DNNG_TRANSPORT_IPC)
- set(_SRCS transport/ipc/ipc.c transport/ipc/ipc.h)
- set(_HDRS transport/ipc/ipc.h)
+ set(_SRCS transport/ipc/ipc.c ${PROJECT_SOURCE_DIR}/include/nng/transport/ipc/ipc.h)
set(NNG_DEFS ${NNG_DEFS} ${_DEFS} PARENT_SCOPE)
set(NNG_SRCS ${NNG_SRCS} ${_SRCS} PARENT_SCOPE)
- set(NNG_HDRS ${NNG_HDRS} ${_HDRS} PARENT_SCOPE)
endif()
diff --git a/src/transport/ipc/ipc.c b/src/transport/ipc/ipc.c
index 58fff1a7..030d6bfe 100644
--- a/src/transport/ipc/ipc.c
+++ b/src/transport/ipc/ipc.c
@@ -13,7 +13,7 @@
#include <string.h>
#include "core/nng_impl.h"
-#include "ipc.h"
+#include "nng/transport/ipc/ipc.h"
// IPC transport. Platform specific IPC operations must be
// supplied as well. Normally the IPC is UNIX domain sockets or
diff --git a/src/transport/tcp/CMakeLists.txt b/src/transport/tcp/CMakeLists.txt
index 9390c048..c36584b5 100644
--- a/src/transport/tcp/CMakeLists.txt
+++ b/src/transport/tcp/CMakeLists.txt
@@ -14,10 +14,8 @@ mark_as_advanced(NNG_TRANSPORT_TCP)
if (NNG_TRANSPORT_TCP)
set(_DEFS -DNNG_TRANSPORT_TCP)
- set(_SRCS transport/tcp/tcp.c transport/tcp/tcp.h)
- set(_HDRS transport/tcp/tcp.h)
+ set(_SRCS transport/tcp/tcp.c ${PROJECT_SOURCE_DIR}/include/nng/transport/tcp/tcp.h)
set(NNG_SRCS ${NNG_SRCS} ${_SRCS} PARENT_SCOPE)
- set(NNG_HDRS ${NNG_HDRS} ${_HDRS} PARENT_SCOPE)
set(NNG_DEFS ${NNG_DEFS} ${_DEFS} PARENT_SCOPE)
endif()
diff --git a/src/transport/tls/CMakeLists.txt b/src/transport/tls/CMakeLists.txt
index 80bc60af..8668ee4a 100644
--- a/src/transport/tls/CMakeLists.txt
+++ b/src/transport/tls/CMakeLists.txt
@@ -15,10 +15,8 @@ mark_as_advanced(NNG_TRANSPORT_TLS)
if (NNG_TRANSPORT_TLS)
set(_DEFS -DNNG_TRANSPORT_TLS)
- set(_SRCS transport/tls/tls.c transport/tls/tls.h)
- set(_HDRS transport/tls/tls.h)
+ set(_SRCS transport/tls/tls.c ${PROJECT_SOURCE_DIR}/include/nng/transport/tls/tls.h)
set(NNG_DEFS ${NNG_DEFS} ${_DEFS} PARENT_SCOPE)
set(NNG_SRCS ${NNG_SRCS} ${_SRCS} PARENT_SCOPE)
- set(NNG_HDRS ${NNG_HDRS} ${_HDRS} PARENT_SCOPE)
endif()
diff --git a/src/transport/tls/tls.c b/src/transport/tls/tls.c
index a8f196f7..867be9b8 100644
--- a/src/transport/tls/tls.c
+++ b/src/transport/tls/tls.c
@@ -14,9 +14,9 @@
#include "core/nng_impl.h"
-#include "supplemental/tls/tls.h"
+#include "nng/supplemental/tls/tls.h"
#include "supplemental/tls/tls_api.h"
-#include "tls.h"
+#include "nng/transport/tls/tls.h"
// TLS over TCP transport. Platform specific TCP operations must be
// supplied as well, and uses the supplemental TLS v1.2 code. It is not
diff --git a/src/transport/ws/CMakeLists.txt b/src/transport/ws/CMakeLists.txt
index 8104d83c..6e618010 100644
--- a/src/transport/ws/CMakeLists.txt
+++ b/src/transport/ws/CMakeLists.txt
@@ -33,9 +33,7 @@ if (NNG_TRANSPORT_WS OR NNG_TRANSPORT_WSS)
set(NNG_SUPP_BASE64 ON PARENT_SCOPE)
set(NNG_SUPP_SHA1 ON PARENT_SCOPE)
- set(_SRCS transport/ws/websocket.c transport/ws/websocket.h)
- set(_HDRS transport/ws/websocket.h)
+ set(_SRCS transport/ws/websocket.c ${PROJECT_SOURCE_DIR}/include/nng/transport/ws/websocket.h)
set(NNG_DEFS ${NNG_DEFS} ${_DEFS} PARENT_SCOPE)
set(NNG_SRCS ${NNG_SRCS} ${_SRCS} PARENT_SCOPE)
- set(NNG_HDRS ${NNG_HDRS} ${_HDRS} PARENT_SCOPE)
endif()
diff --git a/src/transport/ws/websocket.c b/src/transport/ws/websocket.c
index 73dd8234..12a1ef17 100644
--- a/src/transport/ws/websocket.c
+++ b/src/transport/ws/websocket.c
@@ -15,11 +15,11 @@
#include "core/nng_impl.h"
#include "supplemental/http/http_api.h"
-#include "supplemental/tls/tls.h"
+#include "nng/supplemental/tls/tls.h"
#include "supplemental/tls/tls_api.h"
#include "supplemental/websocket/websocket.h"
-#include "websocket.h"
+#include "nng/transport/ws/websocket.h"
typedef struct ws_dialer ws_dialer;
typedef struct ws_listener ws_listener;
diff --git a/src/transport/zerotier/CMakeLists.txt b/src/transport/zerotier/CMakeLists.txt
index 686a0a8a..5eca54c3 100644
--- a/src/transport/zerotier/CMakeLists.txt
+++ b/src/transport/zerotier/CMakeLists.txt
@@ -35,13 +35,11 @@ if (NNG_TRANSPORT_ZEROTIER)
set(_LIBS zerotiercore::zerotiercore)
set(_DEFS -DNNG_TRANSPORT_ZEROTIER)
- set(_SRCS transport/zerotier/zerotier.c transport/zerotier/zerotier.h)
- set(_HDRS transport/zerotier/zerotier.h)
+ set(_SRCS transport/zerotier/zerotier.c ${PROJECT_SOURCE_DIR}/include/nng/transport/zerotier/zerotier.h)
set(NNG_DEFS ${NNG_DEFS} ${_DEFS} PARENT_SCOPE)
set(NNG_LIBS ${NNG_LIBS} ${_LIBS} PARENT_SCOPE)
set(NNG_PKGS ${NNG_PKGS} ${_PKGS} PARENT_SCOPE)
set(NNG_SRCS ${NNG_SRCS} ${_SRCS} PARENT_SCOPE)
- set(NNG_HDRS ${NNG_HDRS} ${_HDRS} PARENT_SCOPE)
endif()
diff --git a/src/transport/zerotier/zerotier.c b/src/transport/zerotier/zerotier.c
index d98171cc..a767e168 100644
--- a/src/transport/zerotier/zerotier.c
+++ b/src/transport/zerotier/zerotier.c
@@ -14,7 +14,8 @@
#include <string.h>
#include "core/nng_impl.h"
-#include "zerotier.h"
+
+#include "nng/transport/zerotier/zerotier.h"
#include <zerotiercore/ZeroTierOne.h>
diff --git a/tests/aio.c b/tests/aio.c
index 0efc013a..9bb7de19 100644
--- a/tests/aio.c
+++ b/tests/aio.c
@@ -8,16 +8,15 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "convey.h"
-#include "nng.h"
+#include <string.h>
-#include "protocol/pair1/pair.h"
-#include "supplemental/util/platform.h"
+#include <nng/nng.h>
+#include <nng/protocol/pair1/pair.h>
+#include <nng/supplemental/util/platform.h>
+#include "convey.h"
#include "stubs.h"
-#include <string.h>
-
#define APPENDSTR(m, s) nng_msg_append(m, s, strlen(s))
#define CHECKSTR(m, s) \
So(nng_msg_len(m) == strlen(s)); \
diff --git a/tests/base64.c b/tests/base64.c
index 6641928a..1781c5ef 100644
--- a/tests/base64.c
+++ b/tests/base64.c
@@ -9,11 +9,9 @@
//
#include <string.h>
+#include <nng/nng.h>
#include "convey.h"
-
-#include "nng.h"
-
#include "supplemental/base64/base64.h"
typedef struct testcase {
diff --git a/tests/bufsz.c b/tests/bufsz.c
index b7128ed4..da6a14cb 100644
--- a/tests/bufsz.c
+++ b/tests/bufsz.c
@@ -8,21 +8,19 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "compat/nanomsg/nn.h"
-#include "convey.h"
-#include "nng.h"
-#include "trantest.h"
-
-#include "protocol/pubsub0/sub.h"
+#include <string.h>
-#include "protocol/pair1/pair.h"
+#include <nng/compat/nanomsg/nn.h>
-#include "supplemental/util/platform.h"
+#include <nng/nng.h>
+#include <nng/protocol/pubsub0/sub.h>
+#include <nng/protocol/pair1/pair.h>
+#include <nng/supplemental/util/platform.h>
+#include "trantest.h"
+#include "convey.h"
#include "stubs.h"
-#include <string.h>
-
#define SECONDS(x) ((x) *1000)
TestMain("Buffer Options", {
diff --git a/tests/bus.c b/tests/bus.c
index 88137b81..96e7ede3 100644
--- a/tests/bus.c
+++ b/tests/bus.c
@@ -1,6 +1,6 @@
//
-// Copyright 2017 Garrett D'Amore <garrett@damore.org>
-// Copyright 2017 Capitar IT Group BV <info@capitar.com>
+// Copyright 2018 Garrett D'Amore <garrett@damore.org>
+// Copyright 2018 Capitar IT Group BV <info@capitar.com>
//
// This software is supplied under the terms of the MIT License, a
// copy of which should be located in the distribution where this
@@ -8,15 +8,14 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "convey.h"
-#include "nng.h"
+#include <string.h>
-#include "protocol/bus0/bus.h"
+#include <nng/nng.h>
+#include <nng/protocol/bus0/bus.h>
+#include "convey.h"
#include "stubs.h"
-#include <string.h>
-
#define APPENDSTR(m, s) nng_msg_append(m, s, strlen(s))
#define CHECKSTR(m, s) \
So(nng_msg_len(m) == strlen(s)); \
diff --git a/tests/compat_block.c b/tests/compat_block.c
index 1524803e..a0a1fd1a 100644
--- a/tests/compat_block.c
+++ b/tests/compat_block.c
@@ -20,8 +20,8 @@
IN THE SOFTWARE.
*/
-#include <nanomsg/nn.h>
-#include <nanomsg/pair.h>
+#include <nng/compat/nanomsg/nn.h>
+#include <nng/compat/nanomsg/pair.h>
#include "compat_testutil.h"
/* This test checks whether blocking on send/recv works as expected. */
diff --git a/tests/compat_bug777.c b/tests/compat_bug777.c
index be7ed6cd..638c41b2 100644
--- a/tests/compat_bug777.c
+++ b/tests/compat_bug777.c
@@ -21,8 +21,8 @@
IN THE SOFTWARE.
*/
-#include <nanomsg/nn.h>
-#include <nanomsg/pair.h>
+#include <nng/compat/nanomsg/nn.h>
+#include <nng/compat/nanomsg/pair.h>
#include "compat_testutil.h"
int main (NN_UNUSED int argc, NN_UNUSED const char *argv[])
diff --git a/tests/compat_bus.c b/tests/compat_bus.c
index eab41b47..70506047 100644
--- a/tests/compat_bus.c
+++ b/tests/compat_bus.c
@@ -20,8 +20,8 @@
IN THE SOFTWARE.
*/
-#include <nanomsg/nn.h>
-#include <nanomsg/bus.h>
+#include <nng/compat/nanomsg/nn.h>
+#include <nng/compat/nanomsg/bus.h>
#include "compat_testutil.h"
#define SOCKET_ADDRESS_A "inproc://a"
diff --git a/tests/compat_cmsg.c b/tests/compat_cmsg.c
index 774049b2..06d67467 100644
--- a/tests/compat_cmsg.c
+++ b/tests/compat_cmsg.c
@@ -22,9 +22,9 @@
IN THE SOFTWARE.
*/
-#include <nanomsg/nn.h>
-#include <nanomsg/tcp.h>
-#include <nanomsg/reqrep.h>
+#include <nng/compat/nanomsg/nn.h>
+#include <nng/compat/nanomsg/tcp.h>
+#include <nng/compat/nanomsg/reqrep.h>
#include "compat_testutil.h"
diff --git a/tests/compat_device.c b/tests/compat_device.c
index 5c4068d9..3c96e5b9 100644
--- a/tests/compat_device.c
+++ b/tests/compat_device.c
@@ -21,11 +21,11 @@
* IN THE SOFTWARE.
*/
-#include <nanomsg/nn.h>
-#include <nanomsg/bus.h>
-#include <nanomsg/pair.h>
-#include <nanomsg/pipeline.h>
-#include <nanomsg/inproc.h>
+#include <nng/compat/nanomsg/nn.h>
+#include <nng/compat/nanomsg/bus.h>
+#include <nng/compat/nanomsg/pair.h>
+#include <nng/compat/nanomsg/pipeline.h>
+#include <nng/compat/nanomsg/inproc.h>
#include "compat_testutil.h"
#define SOCKET_ADDRESS_A "inproc://a"
diff --git a/tests/compat_iovec.c b/tests/compat_iovec.c
index c579642a..54f078aa 100644
--- a/tests/compat_iovec.c
+++ b/tests/compat_iovec.c
@@ -20,8 +20,8 @@
IN THE SOFTWARE.
*/
-#include <nanomsg/nn.h>
-#include <nanomsg/pair.h>
+#include <nng/compat/nanomsg/nn.h>
+#include <nng/compat/nanomsg/pair.h>
#include "compat_testutil.h"
diff --git a/tests/compat_msg.c b/tests/compat_msg.c
index 50a6004b..c2efb2cc 100644
--- a/tests/compat_msg.c
+++ b/tests/compat_msg.c
@@ -23,8 +23,8 @@
IN THE SOFTWARE.
*/
-#include <nanomsg/nn.h>
-#include <nanomsg/pair.h>
+#include <nng/compat/nanomsg/nn.h>
+#include <nng/compat/nanomsg/pair.h>
#include "compat_testutil.h"
diff --git a/tests/compat_options.c b/tests/compat_options.c
index 307c0e1c..305ae128 100644
--- a/tests/compat_options.c
+++ b/tests/compat_options.c
@@ -8,11 +8,10 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "convey.h"
-
-#include "compat/nanomsg/nn.h"
-#include "compat/nanomsg/reqrep.h"
+#include <nng/compat/nanomsg/nn.h>
+#include <nng/compat/nanomsg/reqrep.h>
+#include "convey.h"
#include "compat_testutil.h"
#include <string.h>
diff --git a/tests/compat_pair.c b/tests/compat_pair.c
index a0bc22f4..000944c1 100644
--- a/tests/compat_pair.c
+++ b/tests/compat_pair.c
@@ -20,8 +20,8 @@
IN THE SOFTWARE.
*/
-#include <nanomsg/nn.h>
-#include <nanomsg/pair.h>
+#include <nng/compat/nanomsg/nn.h>
+#include <nng/compat/nanomsg/pair.h>
#include "compat_testutil.h"
diff --git a/tests/compat_pipeline.c b/tests/compat_pipeline.c
index fda3ae54..679f08f7 100644
--- a/tests/compat_pipeline.c
+++ b/tests/compat_pipeline.c
@@ -21,8 +21,8 @@
IN THE SOFTWARE.
*/
-#include <nanomsg/nn.h>
-#include <nanomsg/pipeline.h>
+#include <nng/compat/nanomsg/nn.h>
+#include <nng/compat/nanomsg/pipeline.h>
#include "compat_testutil.h"
#define SOCKET_ADDRESS "inproc://a"
diff --git a/tests/compat_poll.c b/tests/compat_poll.c
index ce9ec0f6..3431f5f2 100644
--- a/tests/compat_poll.c
+++ b/tests/compat_poll.c
@@ -33,9 +33,9 @@
#include <sys/select.h>
#endif
#include "compat_testutil.h"
-#include <nanomsg/nn.h>
-#include <nanomsg/pair.h>
-#include <nanomsg/inproc.h>
+#include <nng/compat/nanomsg/nn.h>
+#include <nng/compat/nanomsg/pair.h>
+#include <nng/compat/nanomsg/inproc.h>
/* Test of polling via NN_SNDFD/NN_RCVFD mechanism. */
diff --git a/tests/compat_reqrep.c b/tests/compat_reqrep.c
index 893eceac..7bd7bf7b 100644
--- a/tests/compat_reqrep.c
+++ b/tests/compat_reqrep.c
@@ -22,8 +22,8 @@
IN THE SOFTWARE.
*/
-#include <nanomsg/nn.h>
-#include <nanomsg/reqrep.h>
+#include <nng/compat/nanomsg/nn.h>
+#include <nng/compat/nanomsg/reqrep.h>
#include "compat_testutil.h"
diff --git a/tests/compat_reqttl.c b/tests/compat_reqttl.c
index dc525255..939ca567 100644
--- a/tests/compat_reqttl.c
+++ b/tests/compat_reqttl.c
@@ -23,9 +23,9 @@
IN THE SOFTWARE.
*/
-#include <nanomsg/nn.h>
-#include <nanomsg/reqrep.h>
-#include <nanomsg/tcp.h>
+#include <nng/compat/nanomsg/nn.h>
+#include <nng/compat/nanomsg/reqrep.h>
+#include <nng/compat/nanomsg/tcp.h>
#include "compat_testutil.h"
diff --git a/tests/compat_shutdown.c b/tests/compat_shutdown.c
index 452aa2cc..84d4d244 100644
--- a/tests/compat_shutdown.c
+++ b/tests/compat_shutdown.c
@@ -21,9 +21,9 @@
IN THE SOFTWARE.
*/
-#include <nanomsg/nn.h>
-#include <nanomsg/tcp.h>
-#include <nanomsg/reqrep.h>
+#include <nng/compat/nanomsg/nn.h>
+#include <nng/compat/nanomsg/tcp.h>
+#include <nng/compat/nanomsg/reqrep.h>
#include "compat_testutil.h"
int main (int argc, const char *argv[])
diff --git a/tests/compat_survey.c b/tests/compat_survey.c
index 2d1fe0a0..645021eb 100644
--- a/tests/compat_survey.c
+++ b/tests/compat_survey.c
@@ -21,8 +21,8 @@
DEALINGS IN THE SOFTWARE.
*/
-#include <nanomsg/nn.h>
-#include <nanomsg/survey.h>
+#include <nng/compat/nanomsg/nn.h>
+#include <nng/compat/nanomsg/survey.h>
#include "compat_testutil.h"
diff --git a/tests/compat_surveyttl.c b/tests/compat_surveyttl.c
index 6d9f614d..00915da4 100644
--- a/tests/compat_surveyttl.c
+++ b/tests/compat_surveyttl.c
@@ -23,9 +23,9 @@
IN THE SOFTWARE.
*/
-#include <nanomsg/nn.h>
-#include <nanomsg/survey.h>
-#include <nanomsg/tcp.h>
+#include <nng/compat/nanomsg/nn.h>
+#include <nng/compat/nanomsg/survey.h>
+#include <nng/compat/nanomsg/tcp.h>
#include "compat_testutil.h"
diff --git a/tests/compat_tcp.c b/tests/compat_tcp.c
index 95ceb546..0fce4f08 100644
--- a/tests/compat_tcp.c
+++ b/tests/compat_tcp.c
@@ -22,10 +22,10 @@
IN THE SOFTWARE.
*/
-#include <nanomsg/nn.h>
-#include <nanomsg/pair.h>
-#include <nanomsg/pubsub.h>
-#include <nanomsg/tcp.h>
+#include <nng/compat/nanomsg/nn.h>
+#include <nng/compat/nanomsg/pair.h>
+#include <nng/compat/nanomsg/pubsub.h>
+#include <nng/compat/nanomsg/tcp.h>
#include "compat_testutil.h"
diff --git a/tests/compat_testutil.c b/tests/compat_testutil.c
index ef17cb3f..7db03bf0 100644
--- a/tests/compat_testutil.c
+++ b/tests/compat_testutil.c
@@ -32,7 +32,7 @@
#include <stdlib.h>
#include <string.h>
-#include <nanomsg/nn.h>
+#include <nng/compat/nanomsg/nn.h>
#include "compat_testutil.h"
int test_socket_impl(char *file, int line, int family, int protocol);
diff --git a/tests/compat_ws.c b/tests/compat_ws.c
index 5dcfa277..67cd9b94 100644
--- a/tests/compat_ws.c
+++ b/tests/compat_ws.c
@@ -31,9 +31,9 @@
// We have improved the maximum receive size test, and verified that option
// setting for the frame type conforms to NNG constraints.
-#include <nanomsg/nn.h>
-#include <nanomsg/pair.h>
-#include <nanomsg/ws.h>
+#include <nng/compat/nanomsg/nn.h>
+#include <nng/compat/nanomsg/pair.h>
+#include <nng/compat/nanomsg/ws.h>
#include "compat_testutil.h"
diff --git a/tests/cplusplus_pair.cc b/tests/cplusplus_pair.cc
index 02f57eaa..92387ce3 100644
--- a/tests/cplusplus_pair.cc
+++ b/tests/cplusplus_pair.cc
@@ -7,8 +7,8 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "nng.h"
-#include "protocol/pair1/pair.h"
+#include "nng/nng.h"
+#include "nng/protocol/pair1/pair.h"
#include <cstring>
#include <iostream>
diff --git a/tests/device.c b/tests/device.c
index b1f97123..0ff784cc 100644
--- a/tests/device.c
+++ b/tests/device.c
@@ -8,13 +8,14 @@
// found online at https://opensource.org/licenses/MIT.
//
+#include <string.h>
+
+#include <nng/nng.h>
+#include <nng/protocol/pair1/pair.h>
+#include <nng/supplemental/util/platform.h>
+
#include "convey.h"
-#include "nng.h"
-#include "protocol/pair1/pair.h"
#include "stubs.h"
-#include "supplemental/util/platform.h"
-
-#include <string.h>
#define APPENDSTR(m, s) nng_msg_append(m, s, strlen(s))
#define CHECKSTR(m, s) \
diff --git a/tests/errors.c b/tests/errors.c
index 06747c24..0cade6a4 100644
--- a/tests/errors.c
+++ b/tests/errors.c
@@ -1,5 +1,5 @@
//
-// Copyright 2016 Garrett D'Amore <garrett@damore.org>
+// Copyright 2018 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,11 +7,13 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "convey.h"
-#include "nng.h"
#include <errno.h>
#include <string.h>
+#include <nng/nng.h>
+
+#include "convey.h"
+
TestMain("Error messages work", {
Convey("Known errors work", {
So(strcmp(nng_strerror(NNG_ECLOSED), "Object closed") == 0);
diff --git a/tests/httpclient.c b/tests/httpclient.c
index 75ecbae9..46950528 100644
--- a/tests/httpclient.c
+++ b/tests/httpclient.c
@@ -8,19 +8,24 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "convey.h"
-#include "trantest.h"
+// Basic HTTP client tests.
+
#ifndef _WIN32
#include <arpa/inet.h>
#endif
-// Basic HTTP client tests.
+#include <nng/nng.h>
+#include <nng/supplemental/http/http.h>
+#include <nng/supplemental/tls/tls.h>
+
#include "core/nng_impl.h"
-#include "supplemental/http/http.h"
+
#include "supplemental/sha1/sha1.c"
#include "supplemental/sha1/sha1.h"
-#include "supplemental/tls/tls.h"
+
+#include "convey.h"
+#include "trantest.h"
const uint8_t example_sum[20] = { 0x0e, 0x97, 0x3b, 0x59, 0xf4, 0x76, 0x00,
0x7f, 0xd1, 0x0f, 0x87, 0xf3, 0x47, 0xc3, 0x95, 0x60, 0x65, 0x51, 0x6f,
diff --git a/tests/httpserver.c b/tests/httpserver.c
index 1bf88f12..c7530f88 100644
--- a/tests/httpserver.c
+++ b/tests/httpserver.c
@@ -8,8 +8,6 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "convey.h"
-#include "trantest.h"
#ifdef _WIN32
#define strdup _strdup
@@ -17,10 +15,15 @@
#include <arpa/inet.h>
#endif
+#include "trantest.h"
+
// Basic HTTP server tests.
+#include <nng/nng.h>
+#include <nng/supplemental/http/http.h>
+#include <nng/supplemental/tls/tls.h>
+
#include "core/nng_impl.h"
-#include "supplemental/http/http.h"
-#include "supplemental/tls/tls.h"
+#include "convey.h"
const char *doc1 = "<html><body>Someone <b>is</b> home!</body</html>";
const char *doc2 = "This is a text file.";
diff --git a/tests/idhash.c b/tests/idhash.c
index 72f1a44f..60a7133a 100644
--- a/tests/idhash.c
+++ b/tests/idhash.c
@@ -9,10 +9,10 @@
//
#include "core/idhash.c"
-#include "convey.h"
-
#include "core/nng_impl.h"
+#include "convey.h"
+
#define STRESSLOAD 50000
#define NVALUES 1000
diff --git a/tests/inproc.c b/tests/inproc.c
index 6691802a..3a3a2b60 100644
--- a/tests/inproc.c
+++ b/tests/inproc.c
@@ -9,9 +9,10 @@
//
#include "convey.h"
-#include "core/nng_impl.h"
#include "trantest.h"
+#include "core/nng_impl.h"
+
// Inproc tests.
TestMain("Inproc Transport", {
diff --git a/tests/ipc.c b/tests/ipc.c
index 5956b5d3..be37338e 100644
--- a/tests/ipc.c
+++ b/tests/ipc.c
@@ -8,8 +8,6 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "convey.h"
-#include "trantest.h"
#ifdef _WIN32
#else
#include <unistd.h>
@@ -18,7 +16,11 @@
#endif
#endif
-#include "transport/ipc/ipc.h"
+#include <nng/nng.h>
+#include <nng/transport/ipc/ipc.h>
+
+#include "convey.h"
+#include "trantest.h"
// Inproc tests.
static int
diff --git a/tests/ipcperms.c b/tests/ipcperms.c
index 6d083d00..5f4a847c 100644
--- a/tests/ipcperms.c
+++ b/tests/ipcperms.c
@@ -8,17 +8,6 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "convey.h"
-#include "trantest.h"
-
-#include "nng.h"
-
-#include "protocol/reqrep0/rep.h"
-#include "protocol/reqrep0/req.h"
-#include "transport/ipc/ipc.h"
-
-#include "stubs.h"
-
#ifndef _WIN32
#include <errno.h>
#include <string.h>
@@ -28,6 +17,15 @@
#include <unistd.h>
#endif
+#include <nng/nng.h>
+#include <nng/protocol/reqrep0/rep.h>
+#include <nng/protocol/reqrep0/req.h>
+#include <nng/transport/ipc/ipc.h>
+
+#include "convey.h"
+#include "stubs.h"
+#include "trantest.h"
+
#define ADDR "/tmp/ipc_perms_test"
#if defined(__sun)
@@ -40,7 +38,6 @@
#ifdef _WIN32
TestMain("IPC Permissions", {
-
atexit(nng_fini);
Convey("Given a socket and an IPC listener", {
nng_socket s;
diff --git a/tests/ipcwinsec.c b/tests/ipcwinsec.c
index 1c226c7c..d6b28c1b 100644
--- a/tests/ipcwinsec.c
+++ b/tests/ipcwinsec.c
@@ -8,16 +8,14 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "convey.h"
-#include "trantest.h"
-
-#include "nng.h"
-
-#include "protocol/reqrep0/rep.h"
-#include "protocol/reqrep0/req.h"
-#include "transport/ipc/ipc.h"
+#include <nng/nng.h>
+#include <nng/protocol/reqrep0/rep.h>
+#include <nng/protocol/reqrep0/req.h>
+#include <nng/transport/ipc/ipc.h>
+#include "convey.h"
#include "stubs.h"
+#include "trantest.h"
#define ADDR "/tmp/ipc_winsec_test"
diff --git a/tests/message.c b/tests/message.c
index e9f990ae..4c0af912 100644
--- a/tests/message.c
+++ b/tests/message.c
@@ -8,10 +8,12 @@
// found online at https://opensource.org/licenses/MIT.
//
+#include <string.h>
+
+#include <nng/nng.h>
+
#include "convey.h"
-#include "nng.h"
-#include <string.h>
static uint8_t dat123[] = { 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 3 };
TestMain("Message Tests", {
diff --git a/tests/multistress.c b/tests/multistress.c
index d39d2896..a3b32c3b 100644
--- a/tests/multistress.c
+++ b/tests/multistress.c
@@ -8,29 +8,28 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "convey.h"
-#include "nng.h"
-
-#include "protocol/bus0/bus.h"
-#include "protocol/pair0/pair.h"
-#include "protocol/pair1/pair.h"
-#include "protocol/pipeline0/pull.h"
-#include "protocol/pipeline0/push.h"
-#include "protocol/pubsub0/pub.h"
-#include "protocol/pubsub0/sub.h"
-#include "protocol/reqrep0/rep.h"
-#include "protocol/reqrep0/req.h"
-#include "protocol/survey0/respond.h"
-#include "protocol/survey0/survey.h"
-#include "supplemental/util/platform.h"
-#include "transport/inproc/inproc.h"
-#include "transport/ipc/ipc.h"
-#include "transport/tcp/tcp.h"
-
#include <stdio.h>
#include <string.h>
#include <time.h>
+#include <nng/nng.h>
+#include <nng/protocol/bus0/bus.h>
+#include <nng/protocol/pair0/pair.h>
+#include <nng/protocol/pair1/pair.h>
+#include <nng/protocol/pipeline0/pull.h>
+#include <nng/protocol/pipeline0/push.h>
+#include <nng/protocol/pubsub0/pub.h>
+#include <nng/protocol/pubsub0/sub.h>
+#include <nng/protocol/reqrep0/rep.h>
+#include <nng/protocol/reqrep0/req.h>
+#include <nng/protocol/survey0/respond.h>
+#include <nng/protocol/survey0/survey.h>
+#include <nng/supplemental/util/platform.h>
+#include <nng/transport/inproc/inproc.h>
+#include <nng/transport/ipc/ipc.h>
+#include <nng/transport/tcp/tcp.h>
+
+#include "convey.h"
#include "stubs.h"
#ifdef NDEBUG
diff --git a/tests/nonblock.c b/tests/nonblock.c
index 1ad3c2f8..c8cce901 100644
--- a/tests/nonblock.c
+++ b/tests/nonblock.c
@@ -8,14 +8,6 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "nng.h"
-#include "protocol/reqrep0/rep.h"
-#include "protocol/reqrep0/req.h"
-#include "supplemental/util/platform.h"
-
-#include "convey.h"
-#include "stubs.h"
-
#include <stdlib.h>
#include <string.h>
@@ -24,6 +16,14 @@
#include <sys/time.h>
#endif
+#include <nng/nng.h>
+#include <nng/protocol/reqrep0/rep.h>
+#include <nng/protocol/reqrep0/req.h>
+#include <nng/supplemental/util/platform.h>
+
+#include "convey.h"
+#include "stubs.h"
+
const char *addr = "inproc://bug346";
void
@@ -94,11 +94,9 @@ nng_socket reqs[NCLIENTS];
nng_socket rep;
TestMain("Nonblocking Works", {
-
atexit(nng_fini);
Convey("Running for 15 sec", {
-
nng_thread *server;
nng_thread *clients[NCLIENTS];
diff --git a/tests/options.c b/tests/options.c
index 2d81bd83..19134005 100644
--- a/tests/options.c
+++ b/tests/options.c
@@ -10,11 +10,10 @@
#include <string.h>
-#include "convey.h"
-
-#include "nng.h"
+#include <nng/nng.h>
+#include <nng/supplemental/util/options.h>
-#include "supplemental/util/options.h"
+#include "convey.h"
static nng_optspec case1[] = {
// clang-format off
diff --git a/tests/pair1.c b/tests/pair1.c
index c777725c..f55ea08a 100644
--- a/tests/pair1.c
+++ b/tests/pair1.c
@@ -8,14 +8,14 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "convey.h"
-#include "nng.h"
-#include "protocol/pair1/pair.h"
-#include "trantest.h"
+#include <string.h>
-#include "stubs.h"
+#include <nng/nng.h>
+#include <nng/protocol/pair1/pair.h>
-#include <string.h>
+#include "convey.h"
+#include "stubs.h"
+#include "trantest.h"
#define SECOND(x) ((x) *1000)
#define MILLISECOND(x) (x)
@@ -361,7 +361,6 @@ TestMain("PAIRv1 protocol", {
});
Convey("Reserved bits in raw header", {
-
Convey("Nonzero bits fail", {
So(nng_msg_alloc(&msg, 0) == 0);
So(nng_msg_header_append_u32(
diff --git a/tests/pipe.c b/tests/pipe.c
index dfebbd56..d3630289 100644
--- a/tests/pipe.c
+++ b/tests/pipe.c
@@ -8,16 +8,17 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "convey.h"
-#include "nng.h"
-#include "protocol/pipeline0/pull.h"
-#include "protocol/pipeline0/push.h"
-#include "supplemental/util/platform.h"
-
-#include "stubs.h"
#include <stdbool.h>
#include <string.h>
+#include <nng/nng.h>
+#include <nng/protocol/pipeline0/pull.h>
+#include <nng/protocol/pipeline0/push.h>
+#include <nng/supplemental/util/platform.h>
+
+#include "convey.h"
+#include "stubs.h"
+
#define APPENDSTR(m, s) nng_msg_append(m, s, strlen(s))
#define CHECKSTR(m, s) \
So(nng_msg_len(m) == strlen(s)); \
diff --git a/tests/pipeline.c b/tests/pipeline.c
index f7d89367..034cb314 100644
--- a/tests/pipeline.c
+++ b/tests/pipeline.c
@@ -8,14 +8,15 @@
// found online at https://opensource.org/licenses/MIT.
//
+#include <string.h>
+
+#include <nng/nng.h>
+#include <nng/protocol/pipeline0/pull.h>
+#include <nng/protocol/pipeline0/push.h>
+#include <nng/supplemental/util/platform.h>
+
#include "convey.h"
-#include "nng.h"
-#include "protocol/pipeline0/pull.h"
-#include "protocol/pipeline0/push.h"
#include "stubs.h"
-#include "supplemental/util/platform.h"
-
-#include <string.h>
#define APPENDSTR(m, s) nng_msg_append(m, s, strlen(s))
#define CHECKSTR(m, s) \
diff --git a/tests/platform.c b/tests/platform.c
index 51dc41fc..7af18029 100644
--- a/tests/platform.c
+++ b/tests/platform.c
@@ -8,11 +8,10 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "convey.h"
-
-#include "nng.h"
-#include "supplemental/util/platform.h"
+#include <nng/nng.h>
+#include <nng/supplemental/util/platform.h>
+#include "convey.h"
#include "stubs.h"
struct addarg {
diff --git a/tests/pollfd.c b/tests/pollfd.c
index 0baa6b2d..2eca7248 100644
--- a/tests/pollfd.c
+++ b/tests/pollfd.c
@@ -29,16 +29,16 @@
#endif
+#include <nng/nng.h>
+#include <nng/protocol/pair1/pair.h>
+#include <nng/protocol/pipeline0/pull.h>
+#include <nng/protocol/pipeline0/push.h>
+#include <nng/supplemental/util/platform.h>
+
#include "convey.h"
-#include "nng.h"
-#include "protocol/pair1/pair.h"
-#include "protocol/pipeline0/pull.h"
-#include "protocol/pipeline0/push.h"
#include "stubs.h"
-#include "supplemental/util/platform.h"
TestMain("Poll FDs", {
-
Convey("Given a connected pair of sockets", {
nng_socket s1;
nng_socket s2;
diff --git a/tests/pubsub.c b/tests/pubsub.c
index d12a2df3..d61867ce 100644
--- a/tests/pubsub.c
+++ b/tests/pubsub.c
@@ -8,14 +8,15 @@
// found online at https://opensource.org/licenses/MIT.
//
+#include <string.h>
+
+#include <nng/nng.h>
+#include <nng/protocol/pubsub0/pub.h>
+#include <nng/protocol/pubsub0/sub.h>
+#include <nng/supplemental/util/platform.h>
+
#include "convey.h"
-#include "nng.h"
-#include "protocol/pubsub0/pub.h"
-#include "protocol/pubsub0/sub.h"
#include "stubs.h"
-#include "supplemental/util/platform.h"
-
-#include <string.h>
#define APPENDSTR(m, s) nng_msg_append(m, s, strlen(s))
#define CHECKSTR(m, s) \
diff --git a/tests/reconnect.c b/tests/reconnect.c
index d13e6ad9..0cc2878b 100644
--- a/tests/reconnect.c
+++ b/tests/reconnect.c
@@ -8,14 +8,15 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "convey.h"
-#include "nng.h"
-#include "protocol/pipeline0/pull.h"
-#include "protocol/pipeline0/push.h"
-#include "supplemental/util/platform.h"
+#include <string.h>
+
+#include <nng/nng.h>
+#include <nng/protocol/pipeline0/pull.h>
+#include <nng/protocol/pipeline0/push.h>
+#include <nng/supplemental/util/platform.h>
+#include "convey.h"
#include "stubs.h"
-#include <string.h>
#define APPENDSTR(m, s) nng_msg_append(m, s, strlen(s))
#define CHECKSTR(m, s) \
diff --git a/tests/reqctx.c b/tests/reqctx.c
index f8bb7611..e937b995 100644
--- a/tests/reqctx.c
+++ b/tests/reqctx.c
@@ -8,14 +8,15 @@
// found online at https://opensource.org/licenses/MIT.
//
+#include <string.h>
+
+#include <nng/nng.h>
+#include <nng/protocol/reqrep0/rep.h>
+#include <nng/protocol/reqrep0/req.h>
+#include <nng/supplemental/util/platform.h>
+
#include "convey.h"
-#include "nng.h"
-#include "protocol/reqrep0/rep.h"
-#include "protocol/reqrep0/req.h"
#include "stubs.h"
-#include "supplemental/util/platform.h"
-
-#include <string.h>
static struct {
nng_aio *aio;
diff --git a/tests/reqpoll.c b/tests/reqpoll.c
index e1a996dd..672c2f05 100644
--- a/tests/reqpoll.c
+++ b/tests/reqpoll.c
@@ -25,12 +25,13 @@
#include <mswsock.h>
#endif
+#include <nng/nng.h>
+#include <nng/protocol/reqrep0/rep.h>
+#include <nng/protocol/reqrep0/req.h>
+#include <nng/supplemental/util/platform.h>
+
#include "convey.h"
-#include "nng.h"
-#include "protocol/reqrep0/rep.h"
-#include "protocol/reqrep0/req.h"
#include "stubs.h"
-#include "supplemental/util/platform.h"
bool
isready(SOCKET fd)
@@ -52,7 +53,6 @@ isready(SOCKET fd)
}
TestMain("REQ pollable", {
-
atexit(nng_fini);
Convey("Given a REQ/REP pair", {
diff --git a/tests/reqrep.c b/tests/reqrep.c
index b5a32dcf..526891ca 100644
--- a/tests/reqrep.c
+++ b/tests/reqrep.c
@@ -8,14 +8,15 @@
// found online at https://opensource.org/licenses/MIT.
//
+#include <string.h>
+
+#include <nng/nng.h>
+#include <nng/protocol/reqrep0/rep.h>
+#include <nng/protocol/reqrep0/req.h>
+#include <nng/supplemental/util/platform.h>
+
#include "convey.h"
-#include "nng.h"
-#include "protocol/reqrep0/rep.h"
-#include "protocol/reqrep0/req.h"
#include "stubs.h"
-#include "supplemental/util/platform.h"
-
-#include <string.h>
TestMain("REQ/REP pattern", {
int rv;
@@ -43,7 +44,6 @@ TestMain("REQ/REP pattern", {
});
Convey("Resend time option id works", {
-
// Set timeout.
So(nng_setopt_ms(req, NNG_OPT_REQ_RESENDTIME, 10) ==
0);
diff --git a/tests/reqstress.c b/tests/reqstress.c
index 1811063b..f6dfb975 100644
--- a/tests/reqstress.c
+++ b/tests/reqstress.c
@@ -8,21 +8,20 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "convey.h"
-#include "nng.h"
-
-#include "protocol/bus0/bus.h"
-#include "protocol/reqrep0/rep.h"
-#include "protocol/reqrep0/req.h"
-#include "supplemental/util/platform.h"
-#include "transport/inproc/inproc.h"
-#include "transport/ipc/ipc.h"
-#include "transport/tcp/tcp.h"
-
#include <stdio.h>
#include <string.h>
#include <time.h>
+#include <nng/nng.h>
+#include <nng/protocol/bus0/bus.h>
+#include <nng/protocol/reqrep0/rep.h>
+#include <nng/protocol/reqrep0/req.h>
+#include <nng/supplemental/util/platform.h>
+#include <nng/transport/inproc/inproc.h>
+#include <nng/transport/ipc/ipc.h>
+#include <nng/transport/tcp/tcp.h>
+
+#include "convey.h"
#include "stubs.h"
#ifdef NDEBUG
diff --git a/tests/resolv.c b/tests/resolv.c
index 90297a9f..954481b7 100644
--- a/tests/resolv.c
+++ b/tests/resolv.c
@@ -8,12 +8,12 @@
// found online at https://opensource.org/licenses/MIT.
//
+#include <string.h>
+
#include "convey.h"
#include "core/nng_impl.h"
#include "stubs.h"
-#include <string.h>
-
#ifndef _WIN32
#include <arpa/inet.h>
#endif
diff --git a/tests/respondpoll.c b/tests/respondpoll.c
index 5dd34c7f..4e869da8 100644
--- a/tests/respondpoll.c
+++ b/tests/respondpoll.c
@@ -8,15 +8,15 @@
// found online at https://opensource.org/licenses/MIT.
//
+#include <nng/nng.h>
+#include <nng/protocol/survey0/respond.h>
+#include <nng/protocol/survey0/survey.h>
+#include <nng/supplemental/util/platform.h>
+
#include "convey.h"
-#include "nng.h"
-#include "protocol/survey0/respond.h"
-#include "protocol/survey0/survey.h"
#include "stubs.h"
-#include "supplemental/util/platform.h"
TestMain("Respondent pollable", {
-
atexit(nng_fini);
Convey("Given a connected survey pair", {
diff --git a/tests/scalability.c b/tests/scalability.c
index 38137e90..1cbbd961 100644
--- a/tests/scalability.c
+++ b/tests/scalability.c
@@ -8,15 +8,15 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "convey.h"
-#include "nng.h"
+#include <string.h>
-#include "protocol/reqrep0/rep.h"
-#include "protocol/reqrep0/req.h"
-#include "stubs.h"
-#include "supplemental/util/platform.h"
+#include <nng/nng.h>
+#include <nng/protocol/reqrep0/rep.h>
+#include <nng/protocol/reqrep0/req.h>
+#include <nng/supplemental/util/platform.h>
-#include <string.h>
+#include "convey.h"
+#include "stubs.h"
static int nclients = 200;
diff --git a/tests/sha1.c b/tests/sha1.c
index 1aa137d7..6877e89e 100644
--- a/tests/sha1.c
+++ b/tests/sha1.c
@@ -1,6 +1,6 @@
//
-// Copyright 2017 Staysail Systems, Inc. <info@staysail.tech>
-// Copyright 2017 Capitar IT Group BV <info@capitar.com>
+// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2018 Capitar IT Group BV <info@capitar.com>
//
// This software is supplied under the terms of the MIT License, a
// copy of which should be located in the distribution where this
@@ -11,10 +11,9 @@
#include <stdint.h>
#include <string.h>
-#include "convey.h"
-
-#include "nng.h"
+#include <nng/nng.h>
+#include "convey.h"
#include "supplemental/sha1/sha1.h"
// The following test vectors are from RFC 3174.
@@ -38,7 +37,6 @@ char *resultarray[4] = {
};
TestMain("SHA1 Verification", {
-
Convey("SHA1 Works", {
for (int i = 0; i < 4; i++) {
nni_sha1_ctx ctx;
diff --git a/tests/sock.c b/tests/sock.c
index 562a05d7..02cd0d43 100644
--- a/tests/sock.c
+++ b/tests/sock.c
@@ -8,19 +8,16 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "convey.h"
-#include "nng.h"
-#include "trantest.h"
-
-#include "protocol/pubsub0/sub.h"
-
-#include "protocol/pair1/pair.h"
+#include <string.h>
-#include "supplemental/util/platform.h"
+#include <nng/nng.h>
+#include <nng/protocol/pair1/pair.h>
+#include <nng/protocol/pubsub0/sub.h>
+#include <nng/supplemental/util/platform.h>
+#include "convey.h"
#include "stubs.h"
-
-#include <string.h>
+#include "trantest.h"
#define SECONDS(x) ((x) *1000)
diff --git a/tests/stats.c b/tests/stats.c
index b8ca8da8..68a5ab62 100644
--- a/tests/stats.c
+++ b/tests/stats.c
@@ -8,19 +8,16 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "convey.h"
-#include "nng.h"
-#include "trantest.h"
-
-#include "protocol/pubsub0/sub.h"
-
-#include "protocol/pair1/pair.h"
+#include <string.h>
-#include "supplemental/util/platform.h"
+#include <nng/nng.h>
+#include <nng/protocol/pair1/pair.h>
+#include <nng/protocol/pubsub0/sub.h>
+#include <nng/supplemental/util/platform.h>
+#include "convey.h"
#include "stubs.h"
-
-#include <string.h>
+#include "trantest.h"
#define SECONDS(x) ((x) *1000)
diff --git a/tests/survey.c b/tests/survey.c
index 5f3001e7..d1af09ec 100644
--- a/tests/survey.c
+++ b/tests/survey.c
@@ -8,15 +8,15 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "convey.h"
+#include <string.h>
-#include "nng.h"
-#include "protocol/survey0/respond.h"
-#include "protocol/survey0/survey.h"
-#include "stubs.h"
-#include "supplemental/util/platform.h"
+#include <nng/nng.h>
+#include <nng/protocol/survey0/respond.h>
+#include <nng/protocol/survey0/survey.h>
+#include <nng/supplemental/util/platform.h>
-#include <string.h>
+#include "convey.h"
+#include "stubs.h"
#define APPENDSTR(m, s) nng_msg_append(m, s, strlen(s))
#define CHECKSTR(m, s) \
diff --git a/tests/surveyctx.c b/tests/surveyctx.c
index b3843e9d..d2d1c4d7 100644
--- a/tests/surveyctx.c
+++ b/tests/surveyctx.c
@@ -8,14 +8,15 @@
// found online at https://opensource.org/licenses/MIT.
//
+#include <string.h>
+
+#include <nng/nng.h>
+#include <nng/protocol/survey0/respond.h>
+#include <nng/protocol/survey0/survey.h>
+#include <nng/supplemental/util/platform.h>
+
#include "convey.h"
-#include "nng.h"
-#include "protocol/survey0/respond.h"
-#include "protocol/survey0/survey.h"
#include "stubs.h"
-#include "supplemental/util/platform.h"
-
-#include <string.h>
static struct {
nng_aio *aio;
diff --git a/tests/surveypoll.c b/tests/surveypoll.c
index a2264d3e..2d6f02ae 100644
--- a/tests/surveypoll.c
+++ b/tests/surveypoll.c
@@ -8,15 +8,15 @@
// found online at https://opensource.org/licenses/MIT.
//
+#include <nng/nng.h>
+#include <nng/protocol/survey0/respond.h>
+#include <nng/protocol/survey0/survey.h>
+#include <nng/supplemental/util/platform.h>
+
#include "convey.h"
-#include "nng.h"
-#include "protocol/survey0/respond.h"
-#include "protocol/survey0/survey.h"
#include "stubs.h"
-#include "supplemental/util/platform.h"
TestMain("Survey pollable", {
-
atexit(nng_fini);
Convey("Given a connected survey pair", {
diff --git a/tests/synch.c b/tests/synch.c
index cf75e20c..84da5568 100644
--- a/tests/synch.c
+++ b/tests/synch.c
@@ -8,10 +8,10 @@
// found online at https://opensource.org/licenses/MIT.
//
+#include <nng/nng.h>
+#include <nng/supplemental/util/platform.h>
+
#include "convey.h"
-//#include "core/nng_impl.h"
-#include "nng.h"
-#include "supplemental/util/platform.h"
// Notify tests for verifying condvars.
struct notifyarg {
diff --git a/tests/tcp.c b/tests/tcp.c
index 2c49f509..53372fa5 100644
--- a/tests/tcp.c
+++ b/tests/tcp.c
@@ -8,18 +8,19 @@
// found online at https://opensource.org/licenses/MIT.
//
+#ifndef _WIN32
+#include <arpa/inet.h>
+#endif
+
+#include <nng/nng.h>
+#include <nng/protocol/pair1/pair.h>
+
#include "convey.h"
-#include "nng.h"
-#include "protocol/pair1/pair.h"
+#include "stubs.h"
#include "trantest.h"
-#include "stubs.h"
// TCP tests.
-#ifndef _WIN32
-#include <arpa/inet.h>
-#endif
-
static int
check_props_v4(nng_msg *msg)
{
diff --git a/tests/tcp6.c b/tests/tcp6.c
index 86898b46..9b3b0d4b 100644
--- a/tests/tcp6.c
+++ b/tests/tcp6.c
@@ -8,12 +8,14 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "convey.h"
-#include "trantest.h"
+// TCP tests for IPv6.
+
+#include <nng/nng.h>
+#include <nng/protocol/pair1/pair.h>
+#include "convey.h"
#include "core/nng_impl.h"
-// TCP tests for IPv6.
-#include "protocol/pair1/pair.h"
+#include "trantest.h"
#include "stubs.h"
diff --git a/tests/tls.c b/tests/tls.c
index 8915b265..25f7960b 100644
--- a/tests/tls.c
+++ b/tests/tls.c
@@ -8,23 +8,21 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "convey.h"
-
-#include "nng.h"
-
-#include "protocol/pair1/pair.h"
-#include "supplemental/tls/tls.h"
-#include "transport/tls/tls.h"
-
-#include "trantest.h"
-
-#include "stubs.h"
-// TCP tests.
+// TLS tests.
#ifndef _WIN32
#include <arpa/inet.h>
#endif
+#include <nng/nng.h>
+#include <nng/protocol/pair1/pair.h>
+#include <nng/supplemental/tls/tls.h>
+#include <nng/transport/tls/tls.h>
+
+#include "convey.h"
+#include "stubs.h"
+#include "trantest.h"
+
// These keys are for demonstration purposes ONLY. DO NOT USE.
// The certificate is valid for 100 years, because I don't want to
// have to regenerate it ever again. The CN is 127.0.0.1, and self-signed.
diff --git a/tests/transport.c b/tests/transport.c
index c060a26f..850fe1a7 100644
--- a/tests/transport.c
+++ b/tests/transport.c
@@ -1,6 +1,6 @@
//
-// Copyright 2017 Garrett D'Amore <garrett@damore.org>
-// Copyright 2017 Capitar IT Group BV <info@capitar.com>
+// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2018 Capitar IT Group BV <info@capitar.com>
//
// This software is supplied under the terms of the MIT License, a
// copy of which should be located in the distribution where this
@@ -8,11 +8,12 @@
// found online at https://opensource.org/licenses/MIT.
//
+#include <string.h>
+
+#include <nng/nng.h>
+
#include "convey.h"
#include "core/nng_impl.h"
-#include "nng.h"
-
-#include <string.h>
static int ninits;
static int nfinis;
diff --git a/tests/trantest.h b/tests/trantest.h
index 2b181d22..97fd3159 100644
--- a/tests/trantest.h
+++ b/tests/trantest.h
@@ -8,15 +8,17 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "convey.h"
-#include "core/nng_impl.h"
-#include "nng.h"
-#include "protocol/reqrep0/rep.h"
-#include "protocol/reqrep0/req.h"
-#include "supplemental/util/platform.h"
#include <stdlib.h>
#include <string.h>
+#include <nng/nng.h>
+#include <nng/protocol/reqrep0/rep.h>
+#include <nng/protocol/reqrep0/req.h>
+#include <nng/supplemental/util/platform.h>
+
+#include "convey.h"
+#include "core/nng_impl.h"
+
// Transport common tests. By making a common test framework for transports,
// we can avoid rewriting the same tests for each new transport. Include this
// file once in your test code. The test framework uses the REQ/REP protocol
@@ -150,7 +152,7 @@ trantest_init(trantest *tt, const char *addr)
So(nng_req_open(&tt->reqsock) == 0);
So(nng_rep_open(&tt->repsock) == 0);
- nni_url *url;
+ nng_url *url;
So(nng_url_parse(&url, tt->addr) == 0);
#if defined(NNG_STATIC_LIB)
tt->tran = nni_tran_find(url);
diff --git a/tests/udp.c b/tests/udp.c
index 15520791..d5f20c26 100644
--- a/tests/udp.c
+++ b/tests/udp.c
@@ -8,18 +8,17 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "convey.h"
-#include "trantest.h"
+// Basic UDP tests.
#ifndef _WIN32
#include <arpa/inet.h>
#endif
-// Basic UDP tests.
+#include "convey.h"
#include "core/nng_impl.h"
+#include "trantest.h"
TestMain("UDP support", {
-
nni_init();
atexit(nng_fini);
@@ -259,7 +258,6 @@ TestMain("UDP support", {
rv == NNG_EUNREACHABLE);
nng_aio_free(aio1);
});
-
});
Convey("Cannot open using bogus sockaddr", {
diff --git a/tests/url.c b/tests/url.c
index c35feee1..15eb5d78 100644
--- a/tests/url.c
+++ b/tests/url.c
@@ -10,12 +10,11 @@
#include <string.h>
-#include "convey.h"
+#include <nng/nng.h>
-#include "nng.h"
+#include "convey.h"
TestMain("URLs", {
-
nng_url *url;
Convey("http://www.google.com", {
@@ -316,5 +315,4 @@ TestMain("URLs", {
So(strcmp(url->u_path, "/\xc2\xa2_centsign") == 0);
nng_url_free(url);
});
-
})
diff --git a/tests/ws.c b/tests/ws.c
index 753f6be9..0add1a07 100644
--- a/tests/ws.c
+++ b/tests/ws.c
@@ -8,19 +8,18 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "convey.h"
-#include "nng.h"
-#include "protocol/pair1/pair.h"
-#include "transport/ws/websocket.h"
-#include "trantest.h"
-
-#include "stubs.h"
-// TCP tests.
-
#ifndef _WIN32
#include <arpa/inet.h>
#endif
+#include <nng/nng.h>
+#include <nng/protocol/pair1/pair.h>
+#include <nng/transport/ws/websocket.h>
+
+#include "convey.h"
+#include "stubs.h"
+#include "trantest.h"
+
static int
check_props_v4(nng_msg *msg)
{
@@ -83,7 +82,6 @@ check_props_v4(nng_msg *msg)
}
TestMain("WebSocket Transport", {
-
trantest_test_extended("ws://127.0.0.1:%u/test", check_props_v4);
Convey("Empty hostname works", {
diff --git a/tests/wss.c b/tests/wss.c
index fac33398..78601066 100644
--- a/tests/wss.c
+++ b/tests/wss.c
@@ -8,20 +8,19 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "convey.h"
-#include "nng.h"
-#include "protocol/pair1/pair.h"
-#include "supplemental/tls/tls.h"
-#include "transport/ws/websocket.h"
-#include "trantest.h"
-
-#include "stubs.h"
-// TCP tests.
-
#ifndef _WIN32
#include <arpa/inet.h>
#endif
+#include <nng/nng.h>
+#include <nng/protocol/pair1/pair.h>
+#include <nng/supplemental/tls/tls.h>
+#include <nng/transport/ws/websocket.h>
+
+#include "convey.h"
+#include "stubs.h"
+#include "trantest.h"
+
// These keys are for demonstration purposes ONLY. DO NOT USE.
// The certificate is valid for 100 years, because I don't want to
// have to regenerate it ever again. The CN is 127.0.0.1, and self-signed.
@@ -234,7 +233,6 @@ out:
}
TestMain("WebSocket Secure (TLS) Transport", {
-
static trantest tt;
tt.dialer_init = init_dialer_wss;
diff --git a/tests/wssfile.c b/tests/wssfile.c
index 9117c277..3ce26e1a 100644
--- a/tests/wssfile.c
+++ b/tests/wssfile.c
@@ -8,21 +8,19 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "convey.h"
-#include "nng.h"
-#include "protocol/pair1/pair.h"
-#include "supplemental/tls/tls.h"
-#include "transport/ws/websocket.h"
-
-#include "trantest.h"
-
-#include "stubs.h"
-// TCP tests.
-
#ifndef _WIN32
#include <arpa/inet.h>
#endif
+#include <nng/nng.h>
+#include <nng/protocol/pair1/pair.h>
+#include <nng/supplemental/tls/tls.h>
+#include <nng/transport/ws/websocket.h>
+
+#include "convey.h"
+#include "stubs.h"
+#include "trantest.h"
+
// These keys are for demonstration purposes ONLY. DO NOT USE.
// The certificate is valid for 100 years, because I don't want to
// have to regenerate it ever again. The CN is 127.0.0.1, and self-signed.
@@ -267,7 +265,6 @@ init_listener_wss_file(nng_listener l)
}
TestMain("WebSocket Secure (TLS) Transport (file based)", {
-
static trantest tt;
tt.dialer_init = init_dialer_wss_file;
diff --git a/tests/zt.c b/tests/zt.c
index b46741ab..714317b4 100644
--- a/tests/zt.c
+++ b/tests/zt.c
@@ -8,12 +8,12 @@
// found online at https://opensource.org/licenses/MIT.
//
+#include <nng/nng.h>
+#include <nng/protocol/pair0/pair.h>
+#include <nng/transport/zerotier/zerotier.h>
+
#include "convey.h"
-#include "nng.h"
-#include "protocol/pair0/pair.h"
-#include "transport/zerotier/zerotier.h"
#include "trantest.h"
-
#include "stubs.h"
// zerotier tests.
diff --git a/tools/nngcat/nngcat.c b/tools/nngcat/nngcat.c
index e81f59c0..25a5b433 100644
--- a/tools/nngcat/nngcat.c
+++ b/tools/nngcat/nngcat.c
@@ -16,22 +16,22 @@
#include <stdlib.h>
#include <string.h>
-#include "nng.h"
-#include "protocol/bus0/bus.h"
-#include "protocol/pair0/pair.h"
-#include "protocol/pair1/pair.h"
-#include "protocol/pipeline0/pull.h"
-#include "protocol/pipeline0/push.h"
-#include "protocol/pubsub0/pub.h"
-#include "protocol/pubsub0/sub.h"
-#include "protocol/reqrep0/rep.h"
-#include "protocol/reqrep0/req.h"
-#include "protocol/survey0/respond.h"
-#include "protocol/survey0/survey.h"
-#include "supplemental/tls/tls.h"
-#include "supplemental/util/options.h"
-#include "supplemental/util/platform.h"
-#include "transport/zerotier/zerotier.h"
+#include <nng/nng.h>
+#include <nng/protocol/bus0/bus.h>
+#include <nng/protocol/pair0/pair.h>
+#include <nng/protocol/pair1/pair.h>
+#include <nng/protocol/pipeline0/pull.h>
+#include <nng/protocol/pipeline0/push.h>
+#include <nng/protocol/pubsub0/pub.h>
+#include <nng/protocol/pubsub0/sub.h>
+#include <nng/protocol/reqrep0/rep.h>
+#include <nng/protocol/reqrep0/req.h>
+#include <nng/protocol/survey0/respond.h>
+#include <nng/protocol/survey0/survey.h>
+#include <nng/supplemental/tls/tls.h>
+#include <nng/supplemental/util/options.h>
+#include <nng/supplemental/util/platform.h>
+#include <nng/transport/zerotier/zerotier.h>
// Globals. We need this to avoid passing around everything.
int format = 0;