mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-28 06:13:31 +01:00
Add functions to return number of elts in associative containers
svn:r5448
This commit is contained in:
parent
0118a236a4
commit
05482a0899
@ -859,3 +859,15 @@ digestmap_isempty(digestmap_t *map)
|
|||||||
return HT_EMPTY(&map->head);
|
return HT_EMPTY(&map->head);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
strmap_size(strmap_t *map)
|
||||||
|
{
|
||||||
|
return HT_SIZE(&map->head);
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
digestmap_size(digestmap_t *map)
|
||||||
|
{
|
||||||
|
return HT_SIZE(&map->head);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -117,6 +117,7 @@ char *smartlist_join_strings2(smartlist_t *sl, const char *join,
|
|||||||
void* prefix##remove(maptype *map, keytype key); \
|
void* prefix##remove(maptype *map, keytype key); \
|
||||||
void prefix##free(maptype *map, void (*free_val)(void*)); \
|
void prefix##free(maptype *map, void (*free_val)(void*)); \
|
||||||
int prefix##isempty(maptype *map); \
|
int prefix##isempty(maptype *map); \
|
||||||
|
int prefix##size(maptype *map); \
|
||||||
prefix##iter_t *prefix##iter_init(maptype *map); \
|
prefix##iter_t *prefix##iter_init(maptype *map); \
|
||||||
prefix##iter_t *prefix##iter_next(maptype *map, prefix##iter_t *iter); \
|
prefix##iter_t *prefix##iter_next(maptype *map, prefix##iter_t *iter); \
|
||||||
prefix##iter_t *prefix##iter_next_rmv(maptype *map, prefix##iter_t *iter); \
|
prefix##iter_t *prefix##iter_next_rmv(maptype *map, prefix##iter_t *iter); \
|
||||||
|
Loading…
Reference in New Issue
Block a user