Add support for non unique add string in hashtable
authorJulien Desfossez <jdesfossez@efficios.com>
Wed, 28 Aug 2013 18:03:16 +0000 (14:03 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Wed, 25 Sep 2013 14:34:24 +0000 (10:34 -0400)
Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
src/common/hashtable/hashtable.c
src/common/hashtable/hashtable.h

index 8c26ebe15b63d3a71f2efd40398e2781e5ddbb59..07210fa8161e63e41a6ea12c061812b27c94d1c8 100644 (file)
@@ -220,6 +220,20 @@ void lttng_ht_add_unique_str(struct lttng_ht *ht,
        assert(node_ptr == &node->node);
 }
 
+/*
+ * Add string node to hashtable.
+ */
+void lttng_ht_add_str(struct lttng_ht *ht,
+               struct lttng_ht_node_str *node)
+{
+       assert(ht);
+       assert(ht->ht);
+       assert(node);
+
+       cds_lfht_add(ht->ht, ht->hash_fct(node->key, lttng_ht_seed),
+                       &node->node);
+}
+
 /*
  * Add unsigned long node to hashtable.
  */
index 846c5ec47277596fdb231e766feb6f177c9e2f62..4a8a2bd5c53a184b40ebe5484213816934a80300 100644 (file)
@@ -91,6 +91,8 @@ extern struct lttng_ht_node_ulong *lttng_ht_add_replace_ulong(
                struct lttng_ht *ht, struct lttng_ht_node_ulong *node);
 extern struct lttng_ht_node_u64 *lttng_ht_add_replace_u64(
                struct lttng_ht *ht, struct lttng_ht_node_u64 *node);
+extern void lttng_ht_add_str(struct lttng_ht *ht,
+               struct lttng_ht_node_str *node);
 extern void lttng_ht_add_ulong(struct lttng_ht *ht,
                struct lttng_ht_node_ulong *node);
 extern void lttng_ht_add_u64(struct lttng_ht *ht,
This page took 0.027408 seconds and 5 git commands to generate.