From: Julien Desfossez Date: Wed, 28 Aug 2013 18:03:16 +0000 (-0400) Subject: Add support for non unique add string in hashtable X-Git-Tag: v2.4.0-rc1~150 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=efa116c6f19ecdc344a82709e7d919703ec96c45;hp=1ac1098fc560b8b93adb17892c89915c863121fd Add support for non unique add string in hashtable Signed-off-by: Julien Desfossez Signed-off-by: David Goulet --- diff --git a/src/common/hashtable/hashtable.c b/src/common/hashtable/hashtable.c index 8c26ebe15..07210fa81 100644 --- a/src/common/hashtable/hashtable.c +++ b/src/common/hashtable/hashtable.c @@ -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. */ diff --git a/src/common/hashtable/hashtable.h b/src/common/hashtable/hashtable.h index 846c5ec47..4a8a2bd5c 100644 --- a/src/common/hashtable/hashtable.h +++ b/src/common/hashtable/hashtable.h @@ -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,