From d6bb25e1e0a25cb5aa781ac4f90b513fd5624f50 Mon Sep 17 00:00:00 2001 From: Gregor Burger Date: Tue, 20 Nov 2018 11:48:03 +0100 Subject: move all public headers to include/nng/ folder This change makes embedding nng + nggpp (or other projects depending on nng) in cmake easier. The header files are moved to a separate include directory. This also makes installation of the headers easier, and allows clearer identification of private vs public heade files. Some additional cleanups were performed by @gedamore, but the main credit for this change belongs with @gregorburger. --- src/protocol/pipeline0/CMakeLists.txt | 10 ++++------ src/protocol/pipeline0/pull.c | 2 +- src/protocol/pipeline0/pull.h | 33 --------------------------------- src/protocol/pipeline0/push.c | 2 +- src/protocol/pipeline0/push.h | 33 --------------------------------- 5 files changed, 6 insertions(+), 74 deletions(-) delete mode 100644 src/protocol/pipeline0/pull.h delete mode 100644 src/protocol/pipeline0/push.h (limited to 'src/protocol/pipeline0') 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 #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/pull.h b/src/protocol/pipeline0/pull.h deleted file mode 100644 index 1c5d63e3..00000000 --- a/src/protocol/pipeline0/pull.h +++ /dev/null @@ -1,33 +0,0 @@ -// -// Copyright 2018 Staysail Systems, Inc. -// Copyright 2018 Capitar IT Group BV -// -// 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_PROTOCOL_PIPELINE0_PULL_H -#define NNG_PROTOCOL_PIPELINE0_PULL_H - -#ifdef __cplusplus -extern "C" { -#endif - -NNG_DECL int nng_pull0_open(nng_socket *); -NNG_DECL int nng_pull0_open_raw(nng_socket *); - -#ifndef nng_pull_open -#define nng_pull_open nng_pull0_open -#endif - -#ifndef nng_pull_open_raw -#define nng_pull_open_raw nng_pull0_open_raw -#endif - -#ifdef __cplusplus -} -#endif - -#endif // NNG_PROTOCOL_PIPELINE0_PULL_H 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 #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/pipeline0/push.h b/src/protocol/pipeline0/push.h deleted file mode 100644 index a1384e0a..00000000 --- a/src/protocol/pipeline0/push.h +++ /dev/null @@ -1,33 +0,0 @@ -// -// Copyright 2018 Staysail Systems, Inc. -// Copyright 2018 Capitar IT Group BV -// -// 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_PROTOCOL_PIPELINE0_PUSH_H -#define NNG_PROTOCOL_PIPELINE0_PUSH_H - -#ifdef __cplusplus -extern "C" { -#endif - -NNG_DECL int nng_push0_open(nng_socket *); -NNG_DECL int nng_push0_open_raw(nng_socket *); - -#ifndef nng_push_open -#define nng_push_open nng_push0_open -#endif - -#ifndef nng_push_open_raw -#define nng_push_open_raw nng_push0_open_raw -#endif - -#ifdef __cplusplus -} -#endif - -#endif // NNG_PROTOCOL_PIPELINE0_PUSH_H -- cgit v1.2.3-70-g09d2