diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/reference/src/SUMMARY.md | 20 | ||||
| -rw-r--r-- | docs/reference/src/api/util/index.md | 9 | ||||
| -rw-r--r-- | docs/reference/src/refs.md | 26 | ||||
| -rw-r--r-- | docs/reference/src/util/index.md | 11 | ||||
| -rw-r--r-- | docs/reference/src/util/nng_alloc.md (renamed from docs/reference/src/api/util/nng_alloc.md) | 10 | ||||
| -rw-r--r-- | docs/reference/src/util/nng_clock.md (renamed from docs/reference/src/api/util/nng_clock.md) | 14 | ||||
| -rw-r--r-- | docs/reference/src/util/nng_free.md (renamed from docs/reference/src/api/util/nng_free.md) | 6 | ||||
| -rw-r--r-- | docs/reference/src/util/nng_msleep.md (renamed from docs/reference/src/api/util/nng_msleep.md) | 6 | ||||
| -rw-r--r-- | docs/reference/src/util/nng_random.md (renamed from docs/reference/src/api/util/nng_random.md) | 2 | ||||
| -rw-r--r-- | docs/reference/src/util/nng_sleep_aio.md (renamed from docs/reference/src/api/util/nng_sleep_aio.md) | 6 | ||||
| -rw-r--r-- | docs/reference/src/util/nng_strdup.md (renamed from docs/reference/src/api/util/nng_strdup.md) | 14 | ||||
| -rw-r--r-- | docs/reference/src/util/nng_strerror.md (renamed from docs/reference/src/api/util/nng_strerror.md) | 2 | ||||
| -rw-r--r-- | docs/reference/src/util/nng_strfree.md (renamed from docs/reference/src/api/util/nng_strfree.md) | 14 | ||||
| -rw-r--r-- | docs/reference/src/util/nng_version.md (renamed from docs/reference/src/api/util/nng_version.md) | 2 |
14 files changed, 95 insertions, 47 deletions
diff --git a/docs/reference/src/SUMMARY.md b/docs/reference/src/SUMMARY.md index bc24ac01..d6aaf9cb 100644 --- a/docs/reference/src/SUMMARY.md +++ b/docs/reference/src/SUMMARY.md @@ -99,16 +99,16 @@ - [Utility Functions](api/util/index.md) - - [nng_alloc](api/util/nng_alloc.md) - - [nng_clock](api/util/nng_clock.md) - - [nng_free](api/util/nng_free.md) - - [nng_msleep](api/util/nng_msleep.md) - - [nng_random](api/util/nng_random.md) - - [nng_sleep_aio](api/util/nng_sleep_aio.md) - - [nng_strdup](api/util/nng_strdup.md) - - [nng_strerror](api/util/nng_strerror.md) - - [nng_strfree](api/util/nng_strfree.md) - - [nng_version](api/util/nng_version.md) + - [nng_alloc](util/nng_alloc.md) + - [nng_clock](util/nng_clock.md) + - [nng_free](util/nng_free.md) + - [nng_msleep](util/nng_msleep.md) + - [nng_random](util/nng_random.md) + - [nng_sleep_aio](util/nng_sleep_aio.md) + - [nng_strdup](util/nng_strdup.md) + - [nng_strerror](util/nng_strerror.md) + - [nng_strfree](util/nng_strfree.md) + - [nng_version](util/nng_version.md) - [Threads and Synchronization](thr/index.md) diff --git a/docs/reference/src/api/util/index.md b/docs/reference/src/api/util/index.md deleted file mode 100644 index 2ca0bc0b..00000000 --- a/docs/reference/src/api/util/index.md +++ /dev/null @@ -1,9 +0,0 @@ -# General Purpose Functions - -# See Also - -[nng_alloc()](nng_alloc.md), -[nng_clock()](nng_clock.md), -[nng_free()](nng_free.md), -[nng_random()](nng_random.md), -[nng_version()](nng_version.md) diff --git a/docs/reference/src/refs.md b/docs/reference/src/refs.md index 2b4b0b65..e51ffe4e 100644 --- a/docs/reference/src/refs.md +++ b/docs/reference/src/refs.md @@ -64,6 +64,32 @@ [nng_msg_set_pipe]: ../msg/nng_msg_set_pipe.md [nng_msg_trim]: ../msg/nng_msg_trim.md +<!-- Threads --> + +[nng_cv_alloc]: ../thr/nng_cv_alloc.md +[nng_cv_free]: ../thr/nng_cv_free.md +[nng_cv_until]: ../thr/nng_cv_until.md +[nng_cv_wait]: ../thr/nng_cv_wait.md +[nng_cv_wake]: ../thr/nng_cv_wake.md +[nng_cv_wake1]: ../thr/nng_cv_wake1.md +[nng_mtx_alloc]: ../thr/nng_mtx_alloc.md +[nng_mtx_free]: ../thr/nng_mtx_free.md +[nng_mtx_lock]: ../thr/nng_mtx_lock.md +[nng_mtx_unlock]: ../thr/nng_mtx_unlock.md + +<!-- Utility --> + +[nng_alloc]: ../util/nng_alloc.md +[nng_clock]: ../util/nng_clock.md +[nng_free]: ../util/nng_free.md +[nng_msleep]: ../util/nng_msleep.md +[nng_random]: ../util/nng_random.md +[nng_sleep_aio]: ../util/nng_sleep_aio.md +[nng_strdup]: ../util/nng_strdup.md +[nng_strerror]: ../util/nng_strerror.md +[nng_strfree]: ../util/nng_strfree.md +[nng_version]: ../util/nng_version.md + <!-- Options --> [NNG_OPT_MAXTTL]: ../opts/nng_opt_max_ttl.md diff --git a/docs/reference/src/util/index.md b/docs/reference/src/util/index.md new file mode 100644 index 00000000..0d7db007 --- /dev/null +++ b/docs/reference/src/util/index.md @@ -0,0 +1,11 @@ +# General Purpose Functions + +# See Also + +[nng_alloc()][nng_alloc], +[nng_clock()][nng_clock], +[nng_free()][nng_free], +[nng_random()][nng_random], +[nng_version()][nng_version] + +{{#include ../refs.md}} diff --git a/docs/reference/src/api/util/nng_alloc.md b/docs/reference/src/util/nng_alloc.md index ffc46083..6f992798 100644 --- a/docs/reference/src/api/util/nng_alloc.md +++ b/docs/reference/src/util/nng_alloc.md @@ -19,9 +19,9 @@ at least _size_ bytes. The memory will be 64-bit aligned. The returned memory can be used to hold message buffers, in which -case it can be directly passed to [`nng_send()`](../socket/nng_send.md) using +case it can be directly passed to [`nng_send()`][nng_send] using the flag `NNG_FLAG_ALLOC`. Alternatively, it can be freed when no -longer needed using [`nng_free()`](nng_free.md). +longer needed using [`nng_free()`][nng_free]. > [!IMPORTANT] > Do not use the system `free()` function (or the C++ `delete` operator) to release this memory. @@ -40,5 +40,7 @@ is returned. ## SEE ALSO -[nng_free](nng_free.md), -[nng_send](../socket/nng_send.md) +[nng_free][nng_free], +[nng_send][nng_send] + +{{#include ../refs.md}} diff --git a/docs/reference/src/api/util/nng_clock.md b/docs/reference/src/util/nng_clock.md index 1bc4037d..d2b69fb9 100644 --- a/docs/reference/src/api/util/nng_clock.md +++ b/docs/reference/src/util/nng_clock.md @@ -29,8 +29,8 @@ very fine-grained values. > but different programs may have different references. This function is intended to help with setting appropriate -timeouts using [`nng_cv_until()`](../threads/nng_cv_until.md) -or [`nng_aio_set_expire()`](../aio/nng_aio_set_timeout.md). +timeouts using [`nng_cv_until()`][nng_cv_until] +or [`nng_aio_set_expire()`][nng_aio_set_timeout]. ## RETURN VALUES @@ -38,7 +38,9 @@ Milliseconds since reference time. ## SEE ALSO -[nng_sleep_aio](nng_sleep_aio.md), -[nng_cv_until](../threads/nng_cv_until.md), -[nng_msleep](nng_msleep.md), -[nng_duration](nng_duration.md) +[nng_sleep_aio][nng_sleep_aio], +[nng_cv_until][nng_cv_until], +[nng_msleep][nng_msleep], +[nng_duration][duration] + +{{#include ../refs.md}} diff --git a/docs/reference/src/api/util/nng_free.md b/docs/reference/src/util/nng_free.md index c25686b4..e93e91e6 100644 --- a/docs/reference/src/api/util/nng_free.md +++ b/docs/reference/src/util/nng_free.md @@ -15,7 +15,7 @@ void nng_free(void *ptr, size_t size); ## DESCRIPTION The `nng_free()` function deallocates a memory region of size _size_, -that was previously allocated by [`nng_alloc()`](nng_alloc.md) or +that was previously allocated by [`nng_alloc()`][nng_alloc] or [`nng_recv()`](../socket/nng_recv.md) with the `NNG_FLAG_ALLOC` flag. > [!IMPORTANT] @@ -31,5 +31,7 @@ that was previously allocated by [`nng_alloc()`](nng_alloc.md) or ## SEE ALSO -[nng_alloc](nng_alloc.md), +[nng_alloc][nng_alloc], [nng_recv](../socket/nng_recv.md) + +{{#include ../refs.md}} diff --git a/docs/reference/src/api/util/nng_msleep.md b/docs/reference/src/util/nng_msleep.md index 06dd16a6..add422fa 100644 --- a/docs/reference/src/api/util/nng_msleep.md +++ b/docs/reference/src/util/nng_msleep.md @@ -24,5 +24,7 @@ The `nng_msleep()` blocks the caller for at least _msec_ milliseconds. ## SEE ALSO -[nng_sleep_aio](nng_sleep_aio.md), -[nng_clock](nng_clock.md) +[nng_sleep_aio][nng_sleep_aio], +[nng_clock][nng_clock] + +{{#include ../refs.md}} diff --git a/docs/reference/src/api/util/nng_random.md b/docs/reference/src/util/nng_random.md index 7cc73d2a..e4f6f52a 100644 --- a/docs/reference/src/api/util/nng_random.md +++ b/docs/reference/src/util/nng_random.md @@ -24,3 +24,5 @@ number facilities when available. ## RETURN VALUES Returns a random 32-bit value. + +{{#include ../refs.md}} diff --git a/docs/reference/src/api/util/nng_sleep_aio.md b/docs/reference/src/util/nng_sleep_aio.md index 799f512f..7092fa3a 100644 --- a/docs/reference/src/api/util/nng_sleep_aio.md +++ b/docs/reference/src/util/nng_sleep_aio.md @@ -26,6 +26,8 @@ If the sleep finishes completely, the result will always be zero. ## SEE ALSO -[nng_clock](nng_clock.md), -[nng_msleep](nng_msleep.md), +[nng_clock][nng_clock], +[nng_msleep][nng_msleep], [Asynchronous I/O](../aio/index.md) + +{{#include ../refs.md}} diff --git a/docs/reference/src/api/util/nng_strdup.md b/docs/reference/src/util/nng_strdup.md index b8d2fe42..363af304 100644 --- a/docs/reference/src/api/util/nng_strdup.md +++ b/docs/reference/src/util/nng_strdup.md @@ -16,14 +16,14 @@ char *nng_strdup(const char *src); The `nng_strdup()` duplicates the string _src_ and returns it. -This is logically equivalent to using [`nng_alloc()`](nng_alloc.md) +This is logically equivalent to using [`nng_alloc()`][nng_alloc] to allocate a region of memory of `strlen(s) + 1` bytes, and then using `strcpy()` to copy the string into the destination before returning it. The returned string should be deallocated with -[`nng_strfree()`](nng_strfree.md), or may be deallocated using the -[`nng_free()`](nng_free.md) using the length of the returned string plus +[`nng_strfree()`][nng_strfree], or may be deallocated using the +[`nng_free()`][nng_free] using the length of the returned string plus one (for the `NUL` terminating byte). > [!IMPORTANT] @@ -41,6 +41,8 @@ treated the same as `NNG_ENOMEM`. ## SEE ALSO -[nng_alloc.md](nng_alloc.md), -[nng_free.md](nng_free.md), -[nng_strfree.md](nng_strfree.md) +[nng_alloc.md][nng_alloc], +[nng_free.md][nng_free], +[nng_strfree.md][nng_strfree] + +{{#include ../refs.md}} diff --git a/docs/reference/src/api/util/nng_strerror.md b/docs/reference/src/util/nng_strerror.md index 14041fad..4772d705 100644 --- a/docs/reference/src/api/util/nng_strerror.md +++ b/docs/reference/src/util/nng_strerror.md @@ -31,3 +31,5 @@ future locale-specific strings may be presented instead. This function returns the human-readable error message, terminated by a `NUL` byte. + +{{#include ../refs.md}} diff --git a/docs/reference/src/api/util/nng_strfree.md b/docs/reference/src/util/nng_strfree.md index cca7950d..3cebb7f6 100644 --- a/docs/reference/src/api/util/nng_strfree.md +++ b/docs/reference/src/util/nng_strfree.md @@ -15,25 +15,27 @@ void nng_strfree(char *str); ## DESCRIPTION The `nng_strfree()` function deallocates the string _str_. -This is equivalent to using [`nng_free()`](nng_free.md) with +This is equivalent to using [`nng_free()`][nng_free] with the length of _str_ plus one (for the `NUL` terminating byte) as the size. > [!IMPORTANT] > This should only be used with strings that were allocated -> by [`nng_strdup()`](nng_strdup.md) or [`nng_alloc()`](nng_alloc.md). +> by [`nng_strdup()`][nng_strdup] or [`nng_alloc()`](nng_alloc.md). > In all cases, the allocation size of the string must be the same > as `strlen(__str__) + 1`. > [!IMPORTANT] > Consequently, if the a string created with -> [`nng_strdup()`](nng_strfree.md) is modified to be shorter, then +> [`nng_strdup()`][nng_strfree] is modified to be shorter, then > it is incorrect to call this function. > (The [`nng_free()`](nng_Free.md) function can be used instead in that > case, using the length of the original string plus one for the size.) ## SEE ALSO -[nng_alloc](nng_alloc.md), -[nng_free](nng_free.md), -[nng_strdup](nng_strdup.md) +[nng_alloc][nng_alloc], +[nng_free][nng_free], +[nng_strdup][nng_strdup] + +{{#include ../refs.md}} diff --git a/docs/reference/src/api/util/nng_version.md b/docs/reference/src/util/nng_version.md index 53c49ee6..cd6666e3 100644 --- a/docs/reference/src/api/util/nng_version.md +++ b/docs/reference/src/util/nng_version.md @@ -34,3 +34,5 @@ manner depending upon the link options and how the library is built.) ## RETURN VALUES `NUL`-terminated string containing the library version number. + +{{#include ../refs.md}} |
