diff options
Diffstat (limited to 'docs/ref/api/util')
| -rw-r--r-- | docs/ref/api/util/nng_clock.md | 7 | ||||
| -rw-r--r-- | docs/ref/api/util/nng_id_map.md | 17 | ||||
| -rw-r--r-- | docs/ref/api/util/nng_msleep.md | 2 | ||||
| -rw-r--r-- | docs/ref/api/util/nng_random.md | 2 | ||||
| -rw-r--r-- | docs/ref/api/util/nng_version.md | 2 |
5 files changed, 16 insertions, 14 deletions
diff --git a/docs/ref/api/util/nng_clock.md b/docs/ref/api/util/nng_clock.md index f4e9f9d5..fcd5af1b 100644 --- a/docs/ref/api/util/nng_clock.md +++ b/docs/ref/api/util/nng_clock.md @@ -16,10 +16,9 @@ nng_time nng_clock(void); ## DESCRIPTION -The `nng_clock` function returns the number of elapsed milliseconds since some -arbitrary time in the past. -The resolution of the clock depends on the underlying timing facilities -of the system. +The {{i:`nng_clock`}}{{hi:clock}} function returns the number of elapsed +milliseconds since some arbitrary time in the past. +The resolution of the clock depends on the underlying timing facilities of the system. This function may be used for timing, but applications should not expect very fine-grained values. diff --git a/docs/ref/api/util/nng_id_map.md b/docs/ref/api/util/nng_id_map.md index 016c60e4..1a516e44 100644 --- a/docs/ref/api/util/nng_id_map.md +++ b/docs/ref/api/util/nng_id_map.md @@ -45,9 +45,12 @@ Given a sufficiently large range, this is unlikely to be a concern.}} > These functions are _not_ thread-safe. > Callers should use a [mutex][mutex] or similar approach when thread-safety is needed. +The {{i:`nng_id_map_free`}} function deallocates one of these tables, and should be called +when it is no longer neeeded. + ### Initialization -An initial table is allocated with `nng_id_map_alloc`, which takes the lowest legal identifier in _lo_, +An initial table is allocated with {{i:`nng_id_map_alloc`}}, which takes the lowest legal identifier in _lo_, and the largest legal identifier in _hi_. The new table is returned in _map_p_, and should be used as the _map_ argument to the rest of these functions. @@ -58,27 +61,27 @@ then both _lo_ and _hi_ must be specified with the exact values desired. themselves be larger than this.}} The _flags_ argument is a bit mask of flags for the table. -If `NNG_MAP_RANDOM` is specified, then the starting point for allocations is randomized, but subsequent allocations will then be monotonically increasing. +If {{i:`NNG_MAP_RANDOM`}} is specified, then the starting point for allocations is randomized, but subsequent allocations will then be monotonically increasing. This is useful to reduce the odds of different instances of an application using the same identifiers at the same time. ### Accessors -The `nng_id_get` function returns the value previously stored with the given identifier. +The {{i:`nng_id_get`}} function returns the value previously stored with the given identifier. If no value is currently associated with the identifer, it returns `NULL`. -The `nng_id_set` function sets the value with the associated identifier. +The {{i:`nng_id_set`}} function sets the value with the associated identifier. This can be used to replace a previously allocated identifier. If the identifier was not previously allocated, then it is allocated as part of the call. This function does not necessarily honor the identifier range limits set for the map when it was allocated. -The `nng_id_alloc` function allocates a new identifier from the range for the map, and associates it with +The {{:`nng_id_alloc`}} function allocates a new identifier from the range for the map, and associates it with the supplied _value_. -The `nng_id_remove` function removes the identifier and its associated value from the table. +The {{:`nng_id_remove`}} function removes the identifier and its associated value from the table. ### Iteration -The `nng_id_visit` function is used to iterate over all items in the table. +The {{i:`nng_id_visit`}} function is used to iterate over all items in the table. The caller starts the iteration by setting the _cursor_ to 0 before calling it. For each call, the associated key and value of the next item will be returned in _id_p_, and _value_p_ and the _cursor_ will be updated. diff --git a/docs/ref/api/util/nng_msleep.md b/docs/ref/api/util/nng_msleep.md index d9e49e49..e055b2f9 100644 --- a/docs/ref/api/util/nng_msleep.md +++ b/docs/ref/api/util/nng_msleep.md @@ -16,7 +16,7 @@ void nng_msleep(nng_duration msec); ## DESCRIPTION -The `nng_msleep` blocks the caller for at least _msec_ milliseconds. +The {{i:`nng_msleep`}}{{hi:sleep}} blocks the caller for at least _msec_ milliseconds. > [!NOTE] > This function may block for longer than requested. diff --git a/docs/ref/api/util/nng_random.md b/docs/ref/api/util/nng_random.md index 160752ab..b8a89d0e 100644 --- a/docs/ref/api/util/nng_random.md +++ b/docs/ref/api/util/nng_random.md @@ -14,7 +14,7 @@ uint32_t nng_random(void); ## DESCRIPTION -The `nng_random` returns a random number. +The {{i:`nng_random`}} returns a {{i:random number}}. The value returned is suitable for use with cryptographic functions such as key generation. The value is obtained using platform-specific cryptographically strong random diff --git a/docs/ref/api/util/nng_version.md b/docs/ref/api/util/nng_version.md index a84ed4cc..04a1dd1b 100644 --- a/docs/ref/api/util/nng_version.md +++ b/docs/ref/api/util/nng_version.md @@ -14,7 +14,7 @@ const char * nng_version(void); ## DESCRIPTION -The `nng_version` function returns a human readable {{i:version number}} +The {{i:`nng_version`}} function returns a human readable {{i:version number}} for _NNG_. Additionally, compile time version information is available |
