aboutsummaryrefslogtreecommitdiff
path: root/examples/hash.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/hash.c')
-rw-r--r--examples/hash.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/examples/hash.c b/examples/hash.c
new file mode 100644
index 0000000..7a06bbe
--- /dev/null
+++ b/examples/hash.c
@@ -0,0 +1,23 @@
+#include <bowl.h>
+
+int main()
+{
+
+ // Root node which contains a list
+ struct bowl *root;
+ bowl_malloc(&root, HASH);
+
+ struct bowl *a;
+ data_malloc(&a, LITERAL, "Destroy capitalism");
+ bowl_insert_key(root, "a", a);
+
+ struct bowl *b;
+ data_malloc(&b, INTEGER, 1312);
+ bowl_insert_key(root, "b", b);
+
+ struct bowl *c;
+ data_malloc(&c, LITERAL, "Alerta, Antifascista!");
+ bowl_insert_key(root, "c", c);
+
+ return bowl_free(root);
+}