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/reqrep0 | |
| 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/reqrep0')
| -rw-r--r-- | src/sp/protocol/reqrep0/rep.c | 9 | ||||
| -rw-r--r-- | src/sp/protocol/reqrep0/rep_test.c | 3 | ||||
| -rw-r--r-- | src/sp/protocol/reqrep0/req.c | 12 | ||||
| -rw-r--r-- | src/sp/protocol/reqrep0/req_test.c | 3 | ||||
| -rw-r--r-- | src/sp/protocol/reqrep0/reqstress_test.c | 4 | ||||
| -rw-r--r-- | src/sp/protocol/reqrep0/xrep.c | 12 | ||||
| -rw-r--r-- | src/sp/protocol/reqrep0/xrep_test.c | 3 | ||||
| -rw-r--r-- | src/sp/protocol/reqrep0/xreq.c | 10 | ||||
| -rw-r--r-- | src/sp/protocol/reqrep0/xreq_test.c | 3 |
9 files changed, 39 insertions, 20 deletions
diff --git a/src/sp/protocol/reqrep0/rep.c b/src/sp/protocol/reqrep0/rep.c index 6df65df3..ea3e9558 100644 --- a/src/sp/protocol/reqrep0/rep.c +++ b/src/sp/protocol/reqrep0/rep.c @@ -10,7 +10,14 @@ #include <string.h> -#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" // 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/sp/protocol/reqrep0/rep_test.c b/src/sp/protocol/reqrep0/rep_test.c index 7c788d96..a8370880 100644 --- a/src/sp/protocol/reqrep0/rep_test.c +++ b/src/sp/protocol/reqrep0/rep_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" #define REP0_SELF 0x31 #define REP0_PEER 0x30 diff --git a/src/sp/protocol/reqrep0/req.c b/src/sp/protocol/reqrep0/req.c index 85c2dfa4..451253bd 100644 --- a/src/sp/protocol/reqrep0/req.c +++ b/src/sp/protocol/reqrep0/req.c @@ -7,9 +7,17 @@ // file was obtained (LICENSE.txt). A copy of the license may also be // found online at https://opensource.org/licenses/MIT. // -#include <stdio.h> -#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/platform.h" +#include "../../../core/pollable.h" +#include "../../../core/protocol.h" +#include "../../../core/socket.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/sp/protocol/reqrep0/req_test.c b/src/sp/protocol/reqrep0/req_test.c index 1da63ffc..d77f06d0 100644 --- a/src/sp/protocol/reqrep0/req_test.c +++ b/src/sp/protocol/reqrep0/req_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 REQ0_SELF 0x30 #define REQ0_PEER 0x31 diff --git a/src/sp/protocol/reqrep0/reqstress_test.c b/src/sp/protocol/reqrep0/reqstress_test.c index 2b2e1980..db0da0d6 100644 --- a/src/sp/protocol/reqrep0/reqstress_test.c +++ b/src/sp/protocol/reqrep0/reqstress_test.c @@ -12,9 +12,7 @@ #include <string.h> #include <time.h> -#include "nng/nng.h" - -#include "nuts.h" +#include "../../../testing/nuts.h" #ifdef NDEBUG #define dprintf(...) diff --git a/src/sp/protocol/reqrep0/xrep.c b/src/sp/protocol/reqrep0/xrep.c index fe6c9fde..e0b5fece 100644 --- a/src/sp/protocol/reqrep0/xrep.c +++ b/src/sp/protocol/reqrep0/xrep.c @@ -8,9 +8,15 @@ // 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/idhash.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" #define REP0_SELF 0x31 #define REP0_PEER 0x30 diff --git a/src/sp/protocol/reqrep0/xrep_test.c b/src/sp/protocol/reqrep0/xrep_test.c index d4e4ce26..ef9b9246 100644 --- a/src/sp/protocol/reqrep0/xrep_test.c +++ b/src/sp/protocol/reqrep0/xrep_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" #define REP0_SELF 0x31 #define REP0_PEER 0x30 diff --git a/src/sp/protocol/reqrep0/xreq.c b/src/sp/protocol/reqrep0/xreq.c index f80391dd..8939d8f4 100644 --- a/src/sp/protocol/reqrep0/xreq.c +++ b/src/sp/protocol/reqrep0/xreq.c @@ -8,9 +8,13 @@ // found online at https://opensource.org/licenses/MIT. // -#include <stdio.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" #define REQ0_SELF 0x30 #define REQ0_PEER 0x31 diff --git a/src/sp/protocol/reqrep0/xreq_test.c b/src/sp/protocol/reqrep0/xreq_test.c index 7969ff0f..ef06c711 100644 --- a/src/sp/protocol/reqrep0/xreq_test.c +++ b/src/sp/protocol/reqrep0/xreq_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" #define REQ0_SELF 0x30 #define REQ0_PEER 0x31 |
