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/survey0/respond.c | 10 ++++++++-- src/sp/protocol/survey0/respond_test.c | 3 +-- src/sp/protocol/survey0/survey.c | 13 ++++++++++--- src/sp/protocol/survey0/survey_test.c | 3 +-- src/sp/protocol/survey0/xrespond.c | 11 ++++++++--- src/sp/protocol/survey0/xrespond_test.c | 3 +-- src/sp/protocol/survey0/xsurvey.c | 10 +++++++++- src/sp/protocol/survey0/xsurvey_test.c | 3 +-- 8 files changed, 39 insertions(+), 17 deletions(-) (limited to 'src/sp/protocol/survey0') diff --git a/src/sp/protocol/survey0/respond.c b/src/sp/protocol/survey0/respond.c index f50ccb6b..85c96843 100644 --- a/src/sp/protocol/survey0/respond.c +++ b/src/sp/protocol/survey0/respond.c @@ -8,10 +8,16 @@ // found online at https://opensource.org/licenses/MIT. // -#include #include -#include "core/nng_impl.h" +#include "../../../core/aio.h" +#include "../../../core/defs.h" +#include "../../../core/idhash.h" +#include "../../../core/list.h" +#include "../../../core/message.h" +#include "../../../core/pipe.h" +#include "../../../core/pollable.h" +#include "../../../core/protocol.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/sp/protocol/survey0/respond_test.c b/src/sp/protocol/survey0/respond_test.c index 5b4bcff9..2a2b44bd 100644 --- a/src/sp/protocol/survey0/respond_test.c +++ b/src/sp/protocol/survey0/respond_test.c @@ -7,8 +7,7 @@ // found online at https://opensource.org/licenses/MIT. // -#include "nng/nng.h" -#include +#include "../../../testing/nuts.h" #define RESPONDENT0_SELF 0x63 #define RESPONDENT0_PEER 0x62 diff --git a/src/sp/protocol/survey0/survey.c b/src/sp/protocol/survey0/survey.c index 716375a9..1c678d1e 100644 --- a/src/sp/protocol/survey0/survey.c +++ b/src/sp/protocol/survey0/survey.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/idhash.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" // 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/sp/protocol/survey0/survey_test.c b/src/sp/protocol/survey0/survey_test.c index ac6767ba..fd7133d3 100644 --- a/src/sp/protocol/survey0/survey_test.c +++ b/src/sp/protocol/survey0/survey_test.c @@ -8,8 +8,7 @@ // found online at https://opensource.org/licenses/MIT. // -#include "nng/nng.h" -#include +#include "../../../testing/nuts.h" #define SURVEYOR0_SELF 0x62 #define SURVEYOR0_PEER 0x63 diff --git a/src/sp/protocol/survey0/xrespond.c b/src/sp/protocol/survey0/xrespond.c index 0e04b516..e9fa209c 100644 --- a/src/sp/protocol/survey0/xrespond.c +++ b/src/sp/protocol/survey0/xrespond.c @@ -8,9 +8,14 @@ // 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" // 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/sp/protocol/survey0/xrespond_test.c b/src/sp/protocol/survey0/xrespond_test.c index bda924c3..1a3f110c 100644 --- a/src/sp/protocol/survey0/xrespond_test.c +++ b/src/sp/protocol/survey0/xrespond_test.c @@ -7,8 +7,7 @@ // found online at https://opensource.org/licenses/MIT. // -#include "nng/nng.h" -#include +#include "../../../testing/nuts.h" #define RESPONDENT0_SELF 0x63 #define RESPONDENT0_PEER 0x62 diff --git a/src/sp/protocol/survey0/xsurvey.c b/src/sp/protocol/survey0/xsurvey.c index 3c78c392..c01c20c3 100644 --- a/src/sp/protocol/survey0/xsurvey.c +++ b/src/sp/protocol/survey0/xsurvey.c @@ -8,7 +8,15 @@ // found online at https://opensource.org/licenses/MIT. // -#include "core/nng_impl.h" +#include "../../../core/aio.h" +#include "../../../core/defs.h" +#include "../../../core/list.h" +#include "../../../core/message.h" +#include "../../../core/msgqueue.h" +#include "../../../core/pipe.h" +#include "../../../core/platform.h" +#include "../../../core/protocol.h" +#include "../../../core/socket.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/sp/protocol/survey0/xsurvey_test.c b/src/sp/protocol/survey0/xsurvey_test.c index 1b9c52fd..3a94e8ed 100644 --- a/src/sp/protocol/survey0/xsurvey_test.c +++ b/src/sp/protocol/survey0/xsurvey_test.c @@ -7,8 +7,7 @@ // found online at https://opensource.org/licenses/MIT. // -#include "nng/nng.h" -#include +#include "../../../testing/nuts.h" #define SURVEYOR0_SELF 0x62 #define SURVEYOR0_PEER 0x63 -- cgit v1.2.3-70-g09d2