1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-04 00:33:13 +02:00

Add function "hashtable_has_key" in WeeChat and plugin API

This commit is contained in:
Sebastien Helleu
2010-10-11 13:56:57 +02:00
parent b9d6c5c5a0
commit f32e18c717
7 changed files with 130 additions and 1 deletions
+10
View File
@@ -374,6 +374,16 @@ hashtable_get (struct t_hashtable *hashtable, const void *key)
return (ptr_item) ? ptr_item->value : NULL;
}
/*
* hashtable_has_key: return 1 if key is in hashtable, otherwise 0
*/
int
hashtable_has_key (struct t_hashtable *hashtable, const void *key)
{
return (hashtable_get_item (hashtable, key, NULL) != NULL) ? 1 : 0;
}
/*
* hashtable_map: call a function on all hashtable entries
*/