diff options
author | Roger Dingledine <arma@torproject.org> | 2005-11-01 03:47:55 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2005-11-01 03:47:55 +0000 |
commit | a2a4f4ae61ad7626559156479f15ed8398979c2a (patch) | |
tree | 17333d16e7c60dec9de67b7f727f122b9cdf91e2 /src/common | |
parent | 0fcc1a912144f50c9be8933126bccd7072980660 (diff) | |
download | tor-a2a4f4ae61ad7626559156479f15ed8398979c2a.tar.gz tor-a2a4f4ae61ad7626559156479f15ed8398979c2a.zip |
cleanups and a smidgen more docs
svn:r5335
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/container.c | 14 | ||||
-rw-r--r-- | src/common/container.h | 2 |
2 files changed, 9 insertions, 7 deletions
diff --git a/src/common/container.c b/src/common/container.c index 1da4b5597d..0807a47c80 100644 --- a/src/common/container.c +++ b/src/common/container.c @@ -480,7 +480,7 @@ SPLAY_PROTOTYPE(digestmap_tree, digestmap_entry_t, node, SPLAY_GENERATE(digestmap_tree, digestmap_entry_t, node, compare_digestmap_entries); -/** Define function reate a new empty map from strings to void*'s. +/** Constructor to create a new empty map from strings to void*'s. */ strmap_t * strmap_new(void) @@ -491,7 +491,7 @@ strmap_new(void) return result; } -/** Define function reate a new empty map from digests to void*'s. +/** Constructor to create a new empty map from digests to void*'s. */ digestmap_t * digestmap_new(void) @@ -532,6 +532,7 @@ strmap_set(strmap_t *map, const char *key, void *val) } } +/** Like strmap_set() above but for digestmaps. */ void * digestmap_set(digestmap_t *map, const char *key, void *val) { @@ -575,6 +576,7 @@ strmap_get(strmap_t *map, const char *key) } } +/** Like strmap_get() above but for digestmaps. */ void * digestmap_get(digestmap_t *map, const char *key) { @@ -618,6 +620,7 @@ strmap_remove(strmap_t *map, const char *key) } } +/** Like strmap_remove() above but for digestmaps. */ void * digestmap_remove(digestmap_t *map, const char *key) { @@ -651,6 +654,7 @@ strmap_set_lc(strmap_t *map, const char *key, void *val) tor_free(lc_key); return v; } + /** Same as strmap_get, but first converts <b>key</b> to lowercase. */ void * strmap_get_lc(strmap_t *map, const char *key) @@ -662,6 +666,7 @@ strmap_get_lc(strmap_t *map, const char *key) tor_free(lc_key); return v; } + /** Same as strmap_remove, but first converts <b>key</b> to lowercase */ void * strmap_remove_lc(strmap_t *map, const char *key) @@ -836,7 +841,6 @@ strmap_iter_done(strmap_iter_t *iter) { return iter == NULL; } - int digestmap_iter_done(digestmap_iter_t *iter) { @@ -861,7 +865,6 @@ strmap_free(strmap_t *map, void (*free_val)(void*)) tor_assert(SPLAY_EMPTY(&map->head)); tor_free(map); } - void digestmap_free(digestmap_t *map, void (*free_val)(void*)) { @@ -877,8 +880,7 @@ digestmap_free(digestmap_t *map, void (*free_val)(void*)) tor_free(map); } -/* Return true iff <b>map</b> has no entries. - */ +/** Return true iff <b>map</b> has no entries. */ int strmap_isempty(strmap_t *map) { diff --git a/src/common/container.h b/src/common/container.h index 50b20e4a42..5746ed8f6c 100644 --- a/src/common/container.h +++ b/src/common/container.h @@ -125,7 +125,7 @@ char *smartlist_join_strings2(smartlist_t *sl, const char *join, void prefix##iter_get(prefix##iter_t *iter, keytype *keyp, void **valp); \ int prefix##iter_done(prefix##iter_t *iter); -/* Map from const char * to void*. Implemented with a splay tree. */ +/* Map from const char * to void *. Implemented with a splay tree. */ DECLARE_MAP_FNS(strmap_t, const char *, strmap_); DECLARE_MAP_FNS(digestmap_t, const char *, digestmap_); |