diff options
| author | Garrett D'Amore <garrett@damore.org> | 2025-01-05 08:39:55 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2025-01-05 08:39:55 -0800 |
| commit | f08a488c30ff102c29f589c138bae29d91dccb2a (patch) | |
| tree | 4e8ffacabb0b90537ac97c806e27f53cb4c3547f /src/core | |
| parent | f77e5a5ec7f8b1373eeda0ea56f47137daf40330 (diff) | |
| download | nng-f08a488c30ff102c29f589c138bae29d91dccb2a.tar.gz nng-f08a488c30ff102c29f589c138bae29d91dccb2a.tar.bz2 nng-f08a488c30ff102c29f589c138bae29d91dccb2a.zip | |
Liberally apply some UWYI (use what you include) to header files
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/dialer.h | 5 | ||||
| -rw-r--r-- | src/core/file.h | 4 | ||||
| -rw-r--r-- | src/core/listener.h | 5 | ||||
| -rw-r--r-- | src/core/lmq.h | 4 | ||||
| -rw-r--r-- | src/core/message.h | 4 | ||||
| -rw-r--r-- | src/core/msgqueue.h | 3 | ||||
| -rw-r--r-- | src/core/options.h | 2 | ||||
| -rw-r--r-- | src/core/pipe.h | 9 | ||||
| -rw-r--r-- | src/core/platform.h | 4 | ||||
| -rw-r--r-- | src/core/pollable.h | 7 | ||||
| -rw-r--r-- | src/core/refcnt.h | 8 | ||||
| -rw-r--r-- | src/core/socket.h | 6 | ||||
| -rw-r--r-- | src/core/sockimpl.h | 16 | ||||
| -rw-r--r-- | src/core/stream.h | 4 | ||||
| -rw-r--r-- | src/core/strs.h | 8 |
15 files changed, 61 insertions, 28 deletions
diff --git a/src/core/dialer.h b/src/core/dialer.h index f3fac7f1..bd987866 100644 --- a/src/core/dialer.h +++ b/src/core/dialer.h @@ -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> // Copyright 2018 Devolutions <info@devolutions.net> // @@ -12,6 +12,9 @@ #ifndef CORE_DIALER_H #define CORE_DIALER_H +#include "defs.h" +#include "stats.h" + extern int nni_dialer_find(nni_dialer **, uint32_t); extern int nni_dialer_hold(nni_dialer *); extern void nni_dialer_rele(nni_dialer *); diff --git a/src/core/file.h b/src/core/file.h index 3baa1ccd..f89b1729 100644 --- a/src/core/file.h +++ b/src/core/file.h @@ -1,5 +1,5 @@ // -// Copyright 2018 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 @@ -11,6 +11,8 @@ #ifndef CORE_FILE_H #define CORE_FILE_H +#include "defs.h" + // File/Store Support // // Some transports require a persistent storage for things like configs, diff --git a/src/core/listener.h b/src/core/listener.h index 5902d4bc..e1f83685 100644 --- a/src/core/listener.h +++ b/src/core/listener.h @@ -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> // Copyright 2018 Devolutions <info@devolutions.net> // @@ -12,6 +12,9 @@ #ifndef CORE_LISTENER_H #define CORE_LISTENER_H +#include "core/defs.h" +#include "core/stats.h" + extern int nni_listener_find(nni_listener **, uint32_t); extern int nni_listener_hold(nni_listener *); extern void nni_listener_rele(nni_listener *); diff --git a/src/core/lmq.h b/src/core/lmq.h index e38a7441..c44ca24c 100644 --- a/src/core/lmq.h +++ b/src/core/lmq.h @@ -1,5 +1,5 @@ // -// Copyright 2021 Staysail Systems, Inc. <info@staysail.tech> +// Copyright 2025 Staysail Systems, Inc. <info@staysail.tech> // // This software is supplied under the terms of the MIT License, a // copy of which should be located in the distribution where this @@ -10,7 +10,7 @@ #ifndef CORE_LMQ_H #define CORE_LMQ_H -#include "nng_impl.h" +#include "core/defs.h" // nni_lmq is a very lightweight message queue. Defining it this way allows // us to share some common code. Locking must be supplied by the caller. diff --git a/src/core/message.h b/src/core/message.h index 9f88cbe8..9940dc9e 100644 --- a/src/core/message.h +++ b/src/core/message.h @@ -1,5 +1,5 @@ // -// Copyright 2021 Staysail Systems, Inc. <info@staysail.tech> +// Copyright 2025 Staysail Systems, Inc. <info@staysail.tech> // Copyright 2017 Capitar IT Group BV <info@capitar.com> // // This software is supplied under the terms of the MIT License, a @@ -11,6 +11,8 @@ #ifndef CORE_MESSAGE_H #define CORE_MESSAGE_H +#include "core/defs.h" + // Internally used message API. Again, this is not part of our public API. // "trim" operations work from the front, and "chop" work from the end. diff --git a/src/core/msgqueue.h b/src/core/msgqueue.h index d264ee3f..f0bf0b71 100644 --- a/src/core/msgqueue.h +++ b/src/core/msgqueue.h @@ -11,7 +11,7 @@ #ifndef CORE_MSGQUEUE_H #define CORE_MSGQUEUE_H -#include "nng_impl.h" +#include "defs.h" #include "pollable.h" // Message queues. Message queues work in some ways like Go channels; @@ -33,7 +33,6 @@ extern int nni_msgq_init(nni_msgq **, unsigned); // messages that may be in the queue. extern void nni_msgq_fini(nni_msgq *); - extern void nni_msgq_aio_put(nni_msgq *, nni_aio *); extern void nni_msgq_aio_get(nni_msgq *, nni_aio *); diff --git a/src/core/options.h b/src/core/options.h index 8aa7fce7..71fa4d36 100644 --- a/src/core/options.h +++ b/src/core/options.h @@ -12,6 +12,8 @@ #ifndef CORE_OPTIONS_H #define CORE_OPTIONS_H +#include "defs.h" + // Integer limits. #define NNI_MAXINT (2147483647) // the -1 trick works around a compiler warning on some compilers (MSVC) diff --git a/src/core/pipe.h b/src/core/pipe.h index 71e07a9f..dcdca418 100644 --- a/src/core/pipe.h +++ b/src/core/pipe.h @@ -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 @@ -15,9 +15,10 @@ // OUTSIDE of the core is STRICTLY VERBOTEN. NO DIRECT ACCESS BY PROTOCOLS OR // TRANSPORTS. -#include "core/defs.h" -#include "core/thread.h" -#include "nng/nng.h" +#include "defs.h" +#include "stats.h" +#include "thread.h" + #include "sp/transport.h" // AIO diff --git a/src/core/platform.h b/src/core/platform.h index aced3675..4ca6a2f4 100644 --- a/src/core/platform.h +++ b/src/core/platform.h @@ -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> // Copyright 2018 Devolutions <info@devolutions.net> // @@ -21,6 +21,8 @@ #include <stddef.h> #include <stdint.h> +#include "defs.h" + // These are the APIs that a platform must implement to support nng. // A word about fork-safety: This library is *NOT* fork safe, in that diff --git a/src/core/pollable.h b/src/core/pollable.h index 2dcce0a1..099ab8b7 100644 --- a/src/core/pollable.h +++ b/src/core/pollable.h @@ -1,5 +1,5 @@ // -// Copyright 2021 Staysail Systems, Inc. <info@staysail.tech> +// Copyright 2025 Staysail Systems, Inc. <info@staysail.tech> // // This software is supplied under the terms of the MIT License, a // copy of which should be located in the distribution where this @@ -10,8 +10,9 @@ #ifndef CORE_POLLABLE_H #define CORE_POLLABLE_H -#include "core/defs.h" -#include "core/list.h" +#include "defs.h" +#include "list.h" +#include "platform.h" typedef struct nni_pollable nni_pollable; diff --git a/src/core/refcnt.h b/src/core/refcnt.h index 9878ba50..29a91ea0 100644 --- a/src/core/refcnt.h +++ b/src/core/refcnt.h @@ -1,4 +1,4 @@ -// Copyright 2024 Staysail Systems, Inc. <info@staysail.tech> +// Copyright 2025 Staysail Systems, Inc. <info@staysail.tech> // // This software is supplied under the terms of the MIT License, a // copy of which should be located in the distribution where this @@ -9,10 +9,8 @@ #ifndef CORE_REFCNT_H #define CORE_REFCNT_H -#include <nng/nng.h> - -#include <core/nng_impl.h> -#include <core/platform.h> +#include "defs.h" +#include "platform.h" typedef struct { nni_atomic_int rc_cnt; diff --git a/src/core/socket.h b/src/core/socket.h index af8fd97d..d84f22c2 100644 --- a/src/core/socket.h +++ b/src/core/socket.h @@ -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 @@ -11,6 +11,10 @@ #ifndef CORE_SOCKET_H #define CORE_SOCKET_H +#include "defs.h" +#include "msgqueue.h" +#include "stats.h" + extern int nni_sock_find(nni_sock **, uint32_t); extern void nni_sock_hold(nni_sock *); extern void nni_sock_rele(nni_sock *); diff --git a/src/core/sockimpl.h b/src/core/sockimpl.h index 92c0bb69..5d41e8d7 100644 --- a/src/core/sockimpl.h +++ b/src/core/sockimpl.h @@ -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 @@ -11,6 +11,20 @@ #ifndef CORE_SOCKIMPL_H #define CORE_SOCKIMPL_H +#include "defs.h" + +#include "aio.h" +#include "dialer.h" +#include "list.h" +#include "listener.h" +#include "protocol.h" +#include "reap.h" +#include "refcnt.h" +#include "stats.h" +#include "url.h" + +#include "sp/transport.h" + // This file contains stuff shared within the core between sockets, endpoints, // and pipes. This must not be exposed to other subsystems -- these internals // are subject to change at any time. diff --git a/src/core/stream.h b/src/core/stream.h index e09dc9e5..ebc13b26 100644 --- a/src/core/stream.h +++ b/src/core/stream.h @@ -1,5 +1,5 @@ // -// Copyright 2024 Staysail Systems, Inc. <info@staysail.tech> +// Copyright 2025 Staysail Systems, Inc. <info@staysail.tech> // // This software is supplied under the terms of the MIT License, a // copy of which should be located in the distribution where this @@ -13,7 +13,7 @@ // This provides an abstraction for byte streams, allowing polymorphic // use of them in rather flexible contexts. -#include "core/nng_impl.h" +#include "defs.h" // Private property operations (these include the types.) extern int nni_stream_get( diff --git a/src/core/strs.h b/src/core/strs.h index 697b4763..8321054c 100644 --- a/src/core/strs.h +++ b/src/core/strs.h @@ -1,5 +1,5 @@ // -// Copyright 2020 Staysail Systems, Inc. <info@staysail.tech> +// Copyright 2025 Staysail Systems, Inc. <info@staysail.tech> // Copyright 2017 Capitar IT Group BV <info@capitar.com> // // This software is supplied under the terms of the MIT License, a @@ -13,11 +13,13 @@ // Safe string functions, in case the platform misses these. -extern char * nni_strdup(const char *); +#include "defs.h" + +extern char *nni_strdup(const char *); extern void nni_strfree(char *); extern size_t nni_strlcpy(char *, const char *, size_t); extern size_t nni_strnlen(const char *, size_t); -extern char * nni_strcasestr(const char *, const char *); +extern char *nni_strcasestr(const char *, const char *); extern int nni_strncasecmp(const char *, const char *, size_t); extern int nni_strcasecmp(const char *, const char *); extern int nni_asprintf(char **, const char *, ...); |
