1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-28 05:46:38 +02:00

core: add type "hashtable" for hdata, new api functions: hdata_hashtable and hashtable_map_string

This commit is contained in:
Sebastien Helleu
2011-12-19 22:39:24 +01:00
parent 7d52f85f55
commit 6f3fd239be
25 changed files with 1786 additions and 1570 deletions
+7 -7
View File
@@ -127,8 +127,8 @@ weechat_python_set_python2_bin ()
void
weechat_python_hashtable_map_cb (void *data,
struct t_hashtable *hashtable,
const void *key,
const void *value)
const char *key,
const char *value)
{
PyObject *dict, *dict_key, *dict_value;
@@ -137,8 +137,8 @@ weechat_python_hashtable_map_cb (void *data,
dict = (PyObject *)data;
dict_key = Py_BuildValue ("s", (const char *)key);
dict_value = Py_BuildValue ("s", (const char *)value);
dict_key = Py_BuildValue ("s", key);
dict_value = Py_BuildValue ("s", value);
PyDict_SetItem (dict, dict_key, dict_value);
@@ -163,9 +163,9 @@ weechat_python_hashtable_to_dict (struct t_hashtable *hashtable)
return Py_None;
}
weechat_hashtable_map (hashtable,
&weechat_python_hashtable_map_cb,
dict);
weechat_hashtable_map_string (hashtable,
&weechat_python_hashtable_map_cb,
dict);
return dict;
}