mirror of
https://github.com/weechat/weechat.git
synced 2026-06-29 06:16:40 +02:00
Add function "hashtable_has_key" in WeeChat and plugin API
This commit is contained in:
@@ -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
|
||||
*/
|
||||
|
||||
@@ -113,6 +113,7 @@ extern int hashtable_set_with_size (struct t_hashtable *hashtable,
|
||||
extern int hashtable_set (struct t_hashtable *hashtable, void *key,
|
||||
void *value);
|
||||
extern void *hashtable_get (struct t_hashtable *hashtable, const void *key);
|
||||
extern int hashtable_has_key (struct t_hashtable *hashtable, const void *key);
|
||||
extern void hashtable_map (struct t_hashtable *hashtable,
|
||||
t_hashtable_map *callback_map,
|
||||
void *callback_map_data);
|
||||
|
||||
Reference in New Issue
Block a user