From edd3b6bc34f211bd3d58642d0c69ce1b5bb9dc3b Mon Sep 17 00:00:00 2001
From: gdamore
The function available for nng_id_map are not thread-safe.
-Callers should use a mutex or similar approach when thread-safety is needed.
#define NNG_MAP_RANDOM 1
@@ -285,7 +285,7 @@ This is useful to reduce the odds of different instances of an application using
the same identifiers at the same time.
If both lo and hi are zero, then the values 0 and 0xffffffff are substituted
in their place, giving a full range of 32-bit identifiers.
-This function can return NNG_ENOMEM if it is unable to allocate resources, otherwise
+
This function can return NNG_ENOMEM if it is unable to allocate resources, otherwise
it returns zero on success.
Destroy Map
void nng_id_map_free(nng_id_map *map);
@@ -315,7 +315,7 @@ index id.
The value must not be NULL.
If the table has to grow to accommodate this value, it may fail if insufficient
-memory is available, returning NNG_ENOMEM. Otherwise it returns zero.
+memory is available, returning NNG_ENOMEM. Otherwise it returns zero.
Lookup a Value
void *nng_id_get(nng_id_map *map, uint64_t id);
@@ -331,16 +331,16 @@ largest possible identifier is allocated. After wrapping, only identifiers that
in use will be considered.
No effort is made to order the availability of identifiers based on
when they were freed.2
-As with nng_id_set, this may need to allocate memory and can thus
-fail with NNG_ENOMEM.
+As with nng_id_set, this may need to allocate memory and can thus
+fail with NNG_ENOMEM.
Additionally, if there are no more free identifiers within the range specified
-when map was created, then it will return NNG_ENOSPC.
+when map was created, then it will return NNG_ENOSPC.
Otherwise it returns zero, indicating success.
Remove an ID
int nng_id_remove(nng_id_map *map, uint64_t id);
The nng_id_remove removes the entry at index id from map.
-If no such entry exist, it will return NNG_ENOENT. Otherwise it returns zero.
+If no such entry exist, it will return NNG_ENOENT. Otherwise it returns zero.
Iterating IDs
bool nng_id_visit(nng_id_map *map, uint64_t *id_p, void **value_p, uint32_t *cursor);
--
cgit v1.2.3-70-g09d2