aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2024-10-06 21:27:54 -0700
committerGarrett D'Amore <garrett@damore.org>2024-10-06 21:27:54 -0700
commitdf8dae72ddb569296ff6ce3cb6c35544cbc3b4d0 (patch)
tree975b1cea6877040e59a448d78b1fc4c5f0f9887b /docs
parent415c04a43804cd0e0a4d3f0d49743aedd0ee4cce (diff)
downloadnng-df8dae72ddb569296ff6ce3cb6c35544cbc3b4d0.tar.gz
nng-df8dae72ddb569296ff6ce3cb6c35544cbc3b4d0.tar.bz2
nng-df8dae72ddb569296ff6ce3cb6c35544cbc3b4d0.zip
Indexing improvements to mdbook docs.
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/api/thr/nng_mtx.md10
-rw-r--r--docs/ref/api/util/nng_clock.md7
-rw-r--r--docs/ref/api/util/nng_id_map.md17
-rw-r--r--docs/ref/api/util/nng_msleep.md2
-rw-r--r--docs/ref/api/util/nng_random.md2
-rw-r--r--docs/ref/api/util/nng_version.md2
-rw-r--r--docs/ref/tran/udp.md2
7 files changed, 22 insertions, 20 deletions
diff --git a/docs/ref/api/thr/nng_mtx.md b/docs/ref/api/thr/nng_mtx.md
index ecd00e22..9673ad99 100644
--- a/docs/ref/api/thr/nng_mtx.md
+++ b/docs/ref/api/thr/nng_mtx.md
@@ -19,21 +19,21 @@ void nng_mtx_unlock(nng_mtx *mtx);
## DESCRIPTION
-The {{i:`nng_mutex`}}{{hi:mutex}} structure provides a {{i:mutual-exclusion}} {{i:lock}}, such
+The {{i:`nng_mtx`}}{{hi:mutex}} structure provides a {{i:mutual-exclusion}} {{i:lock}}, such
that only one thread at a time can have the lock (taken using `nng_mtx_lock`).
This is critical for solving certain problems that arise in concurrent programming.
### Initialization and Teardown
-The `nng_mtx` structure is created dynamically, by the application using `nng_mtx_alloc`.
+The `nng_mtx` structure is created dynamically, by the application using {{i:`nng_mtx_alloc`}}.
This function will store a pointer to the allocate mutex at the location signified by _mtxp_.
When the application has no further need of the mutex, it can deallocate the resources
-associated using the `nng_mtx_free` function.
+associated using the {{i:`nng_mtx_free`}} function.
### Locking and Unlocking
-The `nng_mtx` lock can be acquired by a calling thread using the `nng_mtx_lock` function.
+The `nng_mtx` lock can be acquired by a calling thread using the {{i:`nng_mtx_lock`}} function.
The caller will block until the lock is acquired.
If multiple threads are contending for ownership of the lock, the order of
@@ -45,7 +45,7 @@ acquisition is not specified, and applications must not depend on it.
> It is a programming error for the owner of a mutex to attempt to
> reacquire it.
-The lock can be released by the thread that has ownership using the `nng_mtx_unlock` function.
+The lock can be released by the thread that has ownership using the {{i:`nng_mtx_unlock`}} function.
> [!NOTE]
> A mutex can _only_ be unlocked by the thread that locked it.
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
diff --git a/docs/ref/tran/udp.md b/docs/ref/tran/udp.md
index ebf21248..7c389028 100644
--- a/docs/ref/tran/udp.md
+++ b/docs/ref/tran/udp.md
@@ -6,7 +6,7 @@ The {{i:_udp_ transport}} supports communication between peers using {{i:UDP}}.
UDP is a very light-weight connection-less, unreliable, unordered delivery mechanism.
-Both IPv4 and {{i:IPv6}} are supported when the underlying platform also supports it.
+Both {{i:IPv4}} and {{i:IPv6}} are supported when the underlying platform also supports it.
This transport adds an ordering guarantee, so that messages will always be received in
the correct order. Messages that arrive out of order, or are duplicated, will be