From 410eba9514235058c42b922ecbf70e63e0a436e4 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sat, 6 Apr 2024 11:24:20 -0700 Subject: nng_sleep_aio - also addressed some errors --- docs/man/nng_sleep_aio.3.adoc | 53 ---------------------------------------- docs/ref/aio/nng_sleep_aio.adoc | 27 ++++++++++++++++++++ docs/ref/ctx/nng_ctx_getopt.adoc | 43 -------------------------------- docs/ref/ctx/nng_ctx_setopt.adoc | 43 -------------------------------- docs/ref/old/nng_ctx_getopt.adoc | 43 ++++++++++++++++++++++++++++++++ docs/ref/old/nng_ctx_setopt.adoc | 43 ++++++++++++++++++++++++++++++++ 6 files changed, 113 insertions(+), 139 deletions(-) delete mode 100644 docs/man/nng_sleep_aio.3.adoc create mode 100644 docs/ref/aio/nng_sleep_aio.adoc delete mode 100644 docs/ref/ctx/nng_ctx_getopt.adoc delete mode 100644 docs/ref/ctx/nng_ctx_setopt.adoc create mode 100644 docs/ref/old/nng_ctx_getopt.adoc create mode 100644 docs/ref/old/nng_ctx_setopt.adoc (limited to 'docs') diff --git a/docs/man/nng_sleep_aio.3.adoc b/docs/man/nng_sleep_aio.3.adoc deleted file mode 100644 index 2a3cf4f2..00000000 --- a/docs/man/nng_sleep_aio.3.adoc +++ /dev/null @@ -1,53 +0,0 @@ -= nng_sleep_aio(3) -// -// Copyright 2020 Staysail Systems, Inc. -// Copyright 2018 Capitar IT Group BV -// -// This document is supplied under the terms of the MIT License, a -// copy of which should be located in the distribution where this -// file was obtained (LICENSE.txt). A copy of the license may also be -// found online at https://opensource.org/licenses/MIT. -// - -== NAME - -nng_sleep_aio - sleep asynchronously - -== SYNOPSIS - -[source, c] ----- -#include - -void nng_sleep_aio(nng_duration msec, nng_aio *aio); ----- - -== DESCRIPTION - -The `nng_sleep_aio()` function provides an asynchronous delay mechanism, -causing the callback for _aio_ to be executed after _msec_ milliseconds. -If the sleep finishes completely, the result will always be zero. - -NOTE: If a timeout is set on _aio_ using -xref:nng_aio_set_timeout.3.adoc[`nng_aio_set_timeout()`], and it is shorter -than _msec_, -then the sleep will wake up early, with a result code of `NNG_ETIMEDOUT`. - -== RETURN VALUES - -None. - -== ERRORS - -None. - -== SEE ALSO - -[.text-left] -xref:nng_aio_abort.3.adoc[nng_aio_abort(3)], -xref:nng_aio_alloc.3.adoc[nng_aio_alloc(3)], -xref:nng_aio_set_timeout.3.adoc[nng_aio_set_timeout(3)], -xref:nng_strerror.3.adoc[nng_strerror(3)], -xref:nng_aio.5.adoc[nng_aio(5)], -xref:nng_duration.5.adoc[nng_duration(5)], -xref:nng.7.adoc[nng(7)] diff --git a/docs/ref/aio/nng_sleep_aio.adoc b/docs/ref/aio/nng_sleep_aio.adoc new file mode 100644 index 00000000..f2ecd288 --- /dev/null +++ b/docs/ref/aio/nng_sleep_aio.adoc @@ -0,0 +1,27 @@ +## nng_sleep_aio + +Sleep asynchronously. + +### Synopsis + +```c +#include + +void nng_sleep_aio(nng_duration msec, nng_aio *aio); +``` + +### Description + +The `nng_sleep_aio` function provides an asynchronous delay mechanism, causing the callback for _aio_ to be executed after _msec_ milliseconds. +If the sleep finishes completely, the result will always be zero. + +### Errors + +[horizontal] +`NNG_ETIMEDOUT`:: The sleep was interrupted by a timeout.footnote:[This seemingly paradoxical situation happens if the _aio_ has a timeout set with xref:nng_aio_set_timeout.adoc[`nng_aio_set_timeout`] that is shorter than _msec_.] +`NNG_ECANCELED`:: The operation was canceled. + +### See Also + +xref:nng_aio_abort.adoc[nng_aio_abort], +xref:nng_aio_set_timeout.adoc[nng_aio_set_timeout] \ No newline at end of file diff --git a/docs/ref/ctx/nng_ctx_getopt.adoc b/docs/ref/ctx/nng_ctx_getopt.adoc deleted file mode 100644 index cd9dfd53..00000000 --- a/docs/ref/ctx/nng_ctx_getopt.adoc +++ /dev/null @@ -1,43 +0,0 @@ -## nng_ctx_getopt - -Get context option (deprecated). - -### Synopsis - -```c -#include - -int nng_ctx_getopt(nng_ctx ctx, const char *opt, void *val, size_t *valszp); -int nng_ctx_getopt_bool(nng_ctx ctx, const char *opt, bool *bvalp); -int nng_ctx_getopt_int(nng_ctx ctx, const char *opt, int *ivalp); -int nng_ctx_getopt_ms(nng_ctx ctx, const char *opt, nng_duration *durp); -int nng_ctx_getopt_size(nng_ctx ctx, const char *opt, size_t *zp); -int nng_ctx_getopt_string(nng_ctx ctx, const char *opt, char **strp); -int nng_ctx_getopt_uint64(nng_ctx ctx, const char *opt, uint64_t *u64p); -``` - -### Description - -NOTE: These functions are deprecated. -They may not be present if the library was built with ((`NNG_ELIDE_DEPRECATED`)). - -These deprecated functions have one-to-one modern equivalents with the same arguments and semantics, as follows: - -[width=50%,] -|=== -| Legacy Function | Modern Equivalent - -| `nng_ctx_getopt` | `nng_ctx_set` -| `nng_ctx_getopt_bool`| `nng_ctx_get_bool` -| `nng_ctx_getopt_int`| `nng_ctx_get_int` -| `nng_ctx_getopt_ms`| `nng_ctx_get_ms` -| `nng_ctx_getopt_size`| `nng_ctx_get_size` -| `nng_ctx_getopt_string`| `nng_ctx_get_string` -| `nng_ctx_getopt_uint64`| `nng_ctx_get_uint64` -|=== - -Please see the documentation for the modern equivalents for more detail. - -### See Also - -xref:../ctx/nng_ctx_get.adoc[nng_ctx_get] diff --git a/docs/ref/ctx/nng_ctx_setopt.adoc b/docs/ref/ctx/nng_ctx_setopt.adoc deleted file mode 100644 index df6eda4d..00000000 --- a/docs/ref/ctx/nng_ctx_setopt.adoc +++ /dev/null @@ -1,43 +0,0 @@ -## nng_ctx_setopt - -Set context option (deprecated). - -### Synopsis - -```c -#include - -int nng_ctx_setopt(nng_ctx ctx, const char *opt, const void *val, size_t valsz); -int nng_ctx_setopt_bool(nng_ctx ctx, const char *opt, int bval); -int nng_ctx_setopt_int(nng_ctx ctx, const char *opt, int ival); -int nng_ctx_setopt_ms(nng_ctx ctx, const char *opt, nng_duration dur); -int nng_ctx_setopt_size(nng_ctx ctx, const char *opt, size_t z); -int nng_ctx_setopt_string(nng_ctx ctx, const char *opt, const char *str); -int nng_ctx_setopt_uint64(nng_ctx ctx, const char *opt, uint64_t u64); -``` - -### Description - -NOTE: These functions are deprecated. -They may not be present if the library was built with ((`NNG_ELIDE_DEPRECATED`)). - -These deprecated functions have one-to-one modern equivalents with the same arguments and semantics, as follows: - -[width=50%,] -|=== -| Legacy Function | Modern Equivalent - -| `nng_ctx_setopt` | `nng_ctx_set` -| `nng_ctx_setopt_bool`| `nng_ctx_set_bool` -| `nng_ctx_setopt_int`| `nng_ctx_set_int` -| `nng_ctx_setopt_ms`| `nng_ctx_set_ms` -| `nng_ctx_setopt_size`| `nng_ctx_set_size` -| `nng_ctx_setopt_string`| `nng_ctx_set_string` -| `nng_ctx_setopt_uint64`| `nng_ctx_set_uint64` -|=== - -Please see the documentation for the modern equivalents for more detail. - -### See Also - -xref:../ctx/nng_ctx_set.adoc[nng_ctx_set] diff --git a/docs/ref/old/nng_ctx_getopt.adoc b/docs/ref/old/nng_ctx_getopt.adoc new file mode 100644 index 00000000..cd9dfd53 --- /dev/null +++ b/docs/ref/old/nng_ctx_getopt.adoc @@ -0,0 +1,43 @@ +## nng_ctx_getopt + +Get context option (deprecated). + +### Synopsis + +```c +#include + +int nng_ctx_getopt(nng_ctx ctx, const char *opt, void *val, size_t *valszp); +int nng_ctx_getopt_bool(nng_ctx ctx, const char *opt, bool *bvalp); +int nng_ctx_getopt_int(nng_ctx ctx, const char *opt, int *ivalp); +int nng_ctx_getopt_ms(nng_ctx ctx, const char *opt, nng_duration *durp); +int nng_ctx_getopt_size(nng_ctx ctx, const char *opt, size_t *zp); +int nng_ctx_getopt_string(nng_ctx ctx, const char *opt, char **strp); +int nng_ctx_getopt_uint64(nng_ctx ctx, const char *opt, uint64_t *u64p); +``` + +### Description + +NOTE: These functions are deprecated. +They may not be present if the library was built with ((`NNG_ELIDE_DEPRECATED`)). + +These deprecated functions have one-to-one modern equivalents with the same arguments and semantics, as follows: + +[width=50%,] +|=== +| Legacy Function | Modern Equivalent + +| `nng_ctx_getopt` | `nng_ctx_set` +| `nng_ctx_getopt_bool`| `nng_ctx_get_bool` +| `nng_ctx_getopt_int`| `nng_ctx_get_int` +| `nng_ctx_getopt_ms`| `nng_ctx_get_ms` +| `nng_ctx_getopt_size`| `nng_ctx_get_size` +| `nng_ctx_getopt_string`| `nng_ctx_get_string` +| `nng_ctx_getopt_uint64`| `nng_ctx_get_uint64` +|=== + +Please see the documentation for the modern equivalents for more detail. + +### See Also + +xref:../ctx/nng_ctx_get.adoc[nng_ctx_get] diff --git a/docs/ref/old/nng_ctx_setopt.adoc b/docs/ref/old/nng_ctx_setopt.adoc new file mode 100644 index 00000000..df6eda4d --- /dev/null +++ b/docs/ref/old/nng_ctx_setopt.adoc @@ -0,0 +1,43 @@ +## nng_ctx_setopt + +Set context option (deprecated). + +### Synopsis + +```c +#include + +int nng_ctx_setopt(nng_ctx ctx, const char *opt, const void *val, size_t valsz); +int nng_ctx_setopt_bool(nng_ctx ctx, const char *opt, int bval); +int nng_ctx_setopt_int(nng_ctx ctx, const char *opt, int ival); +int nng_ctx_setopt_ms(nng_ctx ctx, const char *opt, nng_duration dur); +int nng_ctx_setopt_size(nng_ctx ctx, const char *opt, size_t z); +int nng_ctx_setopt_string(nng_ctx ctx, const char *opt, const char *str); +int nng_ctx_setopt_uint64(nng_ctx ctx, const char *opt, uint64_t u64); +``` + +### Description + +NOTE: These functions are deprecated. +They may not be present if the library was built with ((`NNG_ELIDE_DEPRECATED`)). + +These deprecated functions have one-to-one modern equivalents with the same arguments and semantics, as follows: + +[width=50%,] +|=== +| Legacy Function | Modern Equivalent + +| `nng_ctx_setopt` | `nng_ctx_set` +| `nng_ctx_setopt_bool`| `nng_ctx_set_bool` +| `nng_ctx_setopt_int`| `nng_ctx_set_int` +| `nng_ctx_setopt_ms`| `nng_ctx_set_ms` +| `nng_ctx_setopt_size`| `nng_ctx_set_size` +| `nng_ctx_setopt_string`| `nng_ctx_set_string` +| `nng_ctx_setopt_uint64`| `nng_ctx_set_uint64` +|=== + +Please see the documentation for the modern equivalents for more detail. + +### See Also + +xref:../ctx/nng_ctx_set.adoc[nng_ctx_set] -- cgit v1.2.3-70-g09d2