diff options
| author | Garrett D'Amore <garrett@damore.org> | 2025-10-09 19:24:37 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2025-10-10 06:51:58 -0700 |
| commit | ea65f9503c80c33fb236703a7e81747bcb94666b (patch) | |
| tree | be20fb0854295dd28d28c44f5d471506d5f79ecc /src/sp/protocol/pubsub0 | |
| parent | f41cd6a9edf4b9a680194b3fb4378f39d1ed1f34 (diff) | |
| download | nng-ea65f9503c80c33fb236703a7e81747bcb94666b.tar.gz nng-ea65f9503c80c33fb236703a7e81747bcb94666b.tar.bz2 nng-ea65f9503c80c33fb236703a7e81747bcb94666b.zip | |
header file refactoring for IWYU (protocols)
This changes the header files mostly in the protocols to include
directly rather than through the commmon nng_impl.h header. This
should lead to faster compiles, and by properly making all includes
relative should reduce friction with language servers and other tooling.
Diffstat (limited to 'src/sp/protocol/pubsub0')
| -rw-r--r-- | src/sp/protocol/pubsub0/pub.c | 11 | ||||
| -rw-r--r-- | src/sp/protocol/pubsub0/pub_test.c | 3 | ||||
| -rw-r--r-- | src/sp/protocol/pubsub0/sub.c | 10 | ||||
| -rw-r--r-- | src/sp/protocol/pubsub0/sub_test.c | 3 | ||||
| -rw-r--r-- | src/sp/protocol/pubsub0/xsub.c | 10 | ||||
| -rw-r--r-- | src/sp/protocol/pubsub0/xsub_test.c | 3 |
6 files changed, 27 insertions, 13 deletions
diff --git a/src/sp/protocol/pubsub0/pub.c b/src/sp/protocol/pubsub0/pub.c index c753b8af..bc0e5d66 100644 --- a/src/sp/protocol/pubsub0/pub.c +++ b/src/sp/protocol/pubsub0/pub.c @@ -8,9 +8,14 @@ // found online at https://opensource.org/licenses/MIT. // -#include <string.h> - -#include "../../../core/nng_impl.h" +#include "../../../core/aio.h" +#include "../../../core/defs.h" +#include "../../../core/lmq.h" +#include "../../../core/message.h" +#include "../../../core/pipe.h" +#include "../../../core/pollable.h" +#include "../../../core/protocol.h" +#include "../../../core/socket.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/sp/protocol/pubsub0/pub_test.c b/src/sp/protocol/pubsub0/pub_test.c index 3018ced9..1cef9d1c 100644 --- a/src/sp/protocol/pubsub0/pub_test.c +++ b/src/sp/protocol/pubsub0/pub_test.c @@ -7,8 +7,7 @@ // found online at https://opensource.org/licenses/MIT. // -#include "nng/nng.h" -#include <nuts.h> +#include "../../../testing/nuts.h" static void test_pub_identity(void) diff --git a/src/sp/protocol/pubsub0/sub.c b/src/sp/protocol/pubsub0/sub.c index c426d46c..487d82c8 100644 --- a/src/sp/protocol/pubsub0/sub.c +++ b/src/sp/protocol/pubsub0/sub.c @@ -9,10 +9,16 @@ // found online at https://opensource.org/licenses/MIT. // -#include <stdbool.h> #include <string.h> -#include "core/nng_impl.h" +#include "../../../core/aio.h" +#include "../../../core/defs.h" +#include "../../../core/lmq.h" +#include "../../../core/message.h" +#include "../../../core/pipe.h" +#include "../../../core/pollable.h" +#include "../../../core/protocol.h" +#include "../../../core/socket.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/sp/protocol/pubsub0/sub_test.c b/src/sp/protocol/pubsub0/sub_test.c index 7f4e4480..810003c1 100644 --- a/src/sp/protocol/pubsub0/sub_test.c +++ b/src/sp/protocol/pubsub0/sub_test.c @@ -7,8 +7,7 @@ // found online at https://opensource.org/licenses/MIT. // -#include "nng/nng.h" -#include <nuts.h> +#include "../../../testing/nuts.h" static void test_sub_identity(void) diff --git a/src/sp/protocol/pubsub0/xsub.c b/src/sp/protocol/pubsub0/xsub.c index cb2a5362..7fdcf341 100644 --- a/src/sp/protocol/pubsub0/xsub.c +++ b/src/sp/protocol/pubsub0/xsub.c @@ -1,5 +1,5 @@ // -// Copyright 2024 Staysail Systems, Inc. <info@staysail.tech> +// Copyright 2025 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 @@ -10,7 +10,13 @@ #include <stdlib.h> -#include "core/nng_impl.h" +#include "../../../core/aio.h" +#include "../../../core/defs.h" +#include "../../../core/message.h" +#include "../../../core/msgqueue.h" +#include "../../../core/pipe.h" +#include "../../../core/protocol.h" +#include "../../../core/socket.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/sp/protocol/pubsub0/xsub_test.c b/src/sp/protocol/pubsub0/xsub_test.c index 859ab532..2f42a363 100644 --- a/src/sp/protocol/pubsub0/xsub_test.c +++ b/src/sp/protocol/pubsub0/xsub_test.c @@ -7,8 +7,7 @@ // found online at https://opensource.org/licenses/MIT. // -#include <nng/nng.h> -#include <nuts.h> +#include "../../../testing/nuts.h" static void test_xsub_identity(void) |
