From ea65f9503c80c33fb236703a7e81747bcb94666b Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Thu, 9 Oct 2025 19:24:37 -0700 Subject: 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. --- src/sp/protocol/pair1/pair.c | 13 ++++++++++--- src/sp/protocol/pair1/pair1_poly.c | 12 +++++++++--- src/sp/protocol/pair1/pair1_poly_test.c | 4 ++-- src/sp/protocol/pair1/pair1_test.c | 3 +-- 4 files changed, 22 insertions(+), 10 deletions(-) (limited to 'src/sp/protocol/pair1') diff --git a/src/sp/protocol/pair1/pair.c b/src/sp/protocol/pair1/pair.c index 486b2a37..bddde6f8 100644 --- a/src/sp/protocol/pair1/pair.c +++ b/src/sp/protocol/pair1/pair.c @@ -8,9 +8,16 @@ // found online at https://opensource.org/licenses/MIT. // -#include - -#include "../../../core/nng_impl.h" +#include "../../../core/aio.h" +#include "../../../core/defs.h" +#include "../../../core/list.h" +#include "../../../core/lmq.h" +#include "../../../core/message.h" +#include "../../../core/pipe.h" +#include "../../../core/platform.h" +#include "../../../core/pollable.h" +#include "../../../core/protocol.h" +#include "../../../core/socket.h" // Pair protocol. The PAIRv1 protocol is a simple 1:1 messaging pattern. diff --git a/src/sp/protocol/pair1/pair1_poly.c b/src/sp/protocol/pair1/pair1_poly.c index af3ede3b..9c34cd00 100644 --- a/src/sp/protocol/pair1/pair1_poly.c +++ b/src/sp/protocol/pair1/pair1_poly.c @@ -8,9 +8,15 @@ // found online at https://opensource.org/licenses/MIT. // -#include - -#include "core/nng_impl.h" +#include "../../../core/aio.h" +#include "../../../core/defs.h" +#include "../../../core/idhash.h" +#include "../../../core/message.h" +#include "../../../core/msgqueue.h" +#include "../../../core/pipe.h" +#include "../../../core/protocol.h" +#include "../../../core/socket.h" +#include "../../../core/stats.h" #define PAIR1_SELF_NAME "pair1" #define PAIR1_PEER_NAME "pair1" diff --git a/src/sp/protocol/pair1/pair1_poly_test.c b/src/sp/protocol/pair1/pair1_poly_test.c index 40e84d30..516baf81 100644 --- a/src/sp/protocol/pair1/pair1_poly_test.c +++ b/src/sp/protocol/pair1/pair1_poly_test.c @@ -1,5 +1,5 @@ // -// Copyright 2024 Staysail Systems, Inc. +// Copyright 2025 Staysail Systems, Inc. // Copyright 2017 Capitar IT Group BV // // This software is supplied under the terms of the MIT License, a @@ -8,7 +8,7 @@ // found online at https://opensource.org/licenses/MIT. // -#include +#include "../../../testing/nuts.h" #define SECOND 1000 diff --git a/src/sp/protocol/pair1/pair1_test.c b/src/sp/protocol/pair1/pair1_test.c index 8baf139b..c0b2acd9 100644 --- a/src/sp/protocol/pair1/pair1_test.c +++ b/src/sp/protocol/pair1/pair1_test.c @@ -8,8 +8,7 @@ // found online at https://opensource.org/licenses/MIT. // -#include "nng/nng.h" -#include "nuts.h" +#include "../../../testing/nuts.h" #define SECOND 1000 -- cgit v1.2.3-70-g09d2