From 3971d119c129bf5685f9fd14d0f1f785581c3565 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Tue, 7 Oct 2025 20:03:32 -0700 Subject: options: string options are passed by reference This avoids needless allocations, and we offer for pipes (which need this because they might be ephemeral) the get_strdup, get_strcpy, and get_strlen forms. (Those do the copying or allocations while holding the pipe reference.) --- docs/man/nng_dialer_get.3.adoc | 5 +---- docs/man/nng_listener_get.3.adoc | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) (limited to 'docs/man') diff --git a/docs/man/nng_dialer_get.3.adoc b/docs/man/nng_dialer_get.3.adoc index 9b1e6577..575db971 100644 --- a/docs/man/nng_dialer_get.3.adoc +++ b/docs/man/nng_dialer_get.3.adoc @@ -29,7 +29,7 @@ int nng_dialer_get_size(nng_dialer d, const char *opt, size_t *zp); int nng_dialer_get_addr(nng_dialer d, const char *opt, nng_sockaddr *sap); -int nng_dialer_get_string(nng_dialer d, const char *opt, char **strp); +int nng_dialer_get_string(nng_dialer d, const char *opt, const char **strp); int nng_dialer_get_uint64(nng_dialer d, const char *opt, uint64_t *u64p); @@ -77,9 +77,6 @@ into the value referenced by _sap_. `nng_dialer_get_string()`:: This function is used to retrieve a string into _strp_. -This string is created from the source using xref:nng_strdup.3.adoc[`nng_strdup()`] -and consequently must be freed by the caller using -xref:nng_strfree.3.adoc[`nng_strfree()`] when it is no longer needed. `nng_dialer_get_uint64()`:: This function is used to retrieve a 64-bit unsigned value into the value diff --git a/docs/man/nng_listener_get.3.adoc b/docs/man/nng_listener_get.3.adoc index a5df826d..4c4de6b4 100644 --- a/docs/man/nng_listener_get.3.adoc +++ b/docs/man/nng_listener_get.3.adoc @@ -29,7 +29,7 @@ int nng_listener_get_size(nng_listener l, const char *opt, size_t *zp); int nng_listener_get_addr(nng_listener l, const char *opt, nng_sockaddr *sap); -int nng_listener_get_string(nng_listener l, const char *opt, char **strp); +int nng_listener_get_string(nng_listener l, const char *opt, const char **strp); int nng_listener_get_uint64(nng_listener l, const char *opt, uint64_t *u64p); @@ -75,9 +75,6 @@ into the value referenced by _sap_. `nng_listener_get_string()`:: This function is used to retrieve a string into _strp_. -This string is created from the source using xref:nng_strdup.3.adoc[`nng_strdup()`] -and consequently must be freed by the caller using -xref:nng_strfree.3.adoc[`nng_strfree()`] when it is no longer needed. `nng_listener_get_uint64()`:: This function is used to retrieve a 64-bit unsigned value into the value -- cgit v1.2.3-70-g09d2