diff options
| author | Søren Holm <sgh@sgh.dk> | 2025-04-27 18:06:18 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-27 09:06:18 -0700 |
| commit | eb813829f9ffec760e1ed6c2c710c9f6aed55c2f (patch) | |
| tree | d34581a37c71d8e31040ac04eb64fbbb5ea20a36 /include | |
| parent | 8c8563c45afc3e6d6339ea3e7c087bd773f84052 (diff) | |
| download | nng-eb813829f9ffec760e1ed6c2c710c9f6aed55c2f.tar.gz nng-eb813829f9ffec760e1ed6c2c710c9f6aed55c2f.tar.bz2 nng-eb813829f9ffec760e1ed6c2c710c9f6aed55c2f.zip | |
Make pointers to data that is not modified const. (#2117)
This allow to pass constrant string i particular and constant data in general
to nng functions.
Co-authored-by: Garrett D'Amore <garrett@damore.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/nng/nng.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/nng/nng.h b/include/nng/nng.h index b3c5ae14..6f041fcb 100644 --- a/include/nng/nng.h +++ b/include/nng/nng.h @@ -442,7 +442,7 @@ NNG_DECL const char *nng_strerror(nng_err); // received the data. The return value will be zero to indicate that the // socket has accepted the entire data for send, or an errno to indicate // failure. The flags may include NNG_FLAG_NONBLOCK. -NNG_DECL int nng_send(nng_socket, void *, size_t, int); +NNG_DECL int nng_send(nng_socket, const void *, size_t, int); // nng_recv receives message data into the socket, up to the supplied size. // The actual size of the message data will be written to the value pointed @@ -1292,7 +1292,7 @@ typedef struct { // only the first call can contain a non-NULL params. If already // initialized with non-NULL params, will return NNG_EALREADY. // Applications should *not* call a matching nng_fini() in that case. -NNG_DECL nng_err nng_init(nng_init_params *parms); +NNG_DECL nng_err nng_init(const nng_init_params *parms); // nng_fini is used to terminate the library, freeing certain global resources. // Each call to nng_fini is paired to a call to nng_init. The last such |
