aboutsummaryrefslogtreecommitdiff
path: root/collections/map/map.adoc
diff options
context:
space:
mode:
Diffstat (limited to 'collections/map/map.adoc')
-rw-r--r--collections/map/map.adoc21
1 files changed, 20 insertions, 1 deletions
diff --git a/collections/map/map.adoc b/collections/map/map.adoc
index fc6b8b7..837a08a 100644
--- a/collections/map/map.adoc
+++ b/collections/map/map.adoc
@@ -1,7 +1,7 @@
Map
===
Tucker Evans
-v0.1, 2020-07-06
+v0.2, 2020-07-06
A basic map implemented in an AVL tree.
@@ -50,3 +50,22 @@ Examples
map *dict = map_new((cmp_func) strcmp);
----
+
+[[map_size]]
++map_size(map *self)+
+~~~~~~~~~~~~~~~~~~~~~
+Returns the number of key, value pairs stored in map +self+.
+
+Examples
+^^^^^^^^
+[source,c]
+----
+#include "map.h"
+#include <string.h>
+
+map *dict = map_new((cmp_func) strcmp);
+
+assert(map_size(dict) == 0);
+map_set(dict, "ONE", NULL);
+assert(map_size(dict) == 1);
+----