diff options
| author | Garrett D'Amore <garrett@damore.org> | 2025-10-07 20:03:32 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2025-10-07 20:03:32 -0700 |
| commit | 3971d119c129bf5685f9fd14d0f1f785581c3565 (patch) | |
| tree | 12b08c053d07fab5af699229ef52e311b8182d56 /docs/man | |
| parent | 07191755f3a38cbac48d15523095136f69d8f772 (diff) | |
| download | nng-3971d119c129bf5685f9fd14d0f1f785581c3565.tar.gz nng-3971d119c129bf5685f9fd14d0f1f785581c3565.tar.bz2 nng-3971d119c129bf5685f9fd14d0f1f785581c3565.zip | |
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.)
Diffstat (limited to 'docs/man')
| -rw-r--r-- | docs/man/nng_dialer_get.3.adoc | 5 | ||||
| -rw-r--r-- | docs/man/nng_listener_get.3.adoc | 5 |
2 files changed, 2 insertions, 8 deletions
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 |
