Add function hashtable_add_to_infolist in plugin API reference

v2.8-utf8proc
Sebastien Helleu 2010-07-05 18:13:35 +02:00
parent 94fbbc0a7f
commit 86e503b640
3 changed files with 123 additions and 0 deletions

View File

@ -2770,6 +2770,47 @@ C example:
int items_count = weechat_hashtable_get_integer (hashtable, "items_count");
----------------------------------------
weechat_hashtable_add_to_infolist
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Add hashtable items to an infolist item.
Prototype:
[source,C]
----------------------------------------
int weechat_hashtable_add_to_infolist (struct t_hashtable *hashtable,
struct t_infolist_item *infolist_item,
const char *prefix);
----------------------------------------
Arguments:
* 'hashtable': hashtable pointer
* 'infolist_item': infolist item pointer
* 'prefix': string used as prefix for names in infolist
Return value:
* 1 if ok, 0 if error
C example:
[source,C]
----------------------------------------
weechat_hashtable_add_to_infolist (hashtable, infolist_item, "testhash");
/* if hashtable contains:
"key1" => "value 1"
"key2" => "value 2"
then following variables will be added to infolist item:
"testhash_name_00001" = "key1"
"testhash_value_00001" = "value 1"
"testhash_name_00002" = "key2"
"testhash_value_00002" = "value 2"
*/
----------------------------------------
weechat_hashtable_remove
^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -2799,6 +2799,47 @@ Exemple en C :
int items_count = weechat_hashtable_get_integer (hashtable, "items_count");
----------------------------------------
weechat_hashtable_add_to_infolist
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Ajoute les éléments d'une hashtable dans un objet infolist.
Prototype :
[source,C]
----------------------------------------
int weechat_hashtable_add_to_infolist (struct t_hashtable *hashtable,
struct t_infolist_item *infolist_item,
const char *prefix);
----------------------------------------
Paramètres :
* 'hashtable' : pointeur vers la hashtable
* 'infolist_item' : pointeur vers l'objet de l'infolist
* 'prefix' : chaîne utilisée comme préfixe pour les noms dans l'infolist
Valeur en retour :
* 1 si ok, 0 en cas d'erreur
Exemple en C :
[source,C]
----------------------------------------
weechat_hashtable_add_to_infolist (hashtable, infolist_item, "testhash");
/* si la hashtable contient :
"cle1" => "valeur 1"
"cle2" => "valeur 2"
alors les variables suivantes seront ajoutées dans l'objet de l'infolist :
"testhash_name_00001" = "cle1"
"testhash_value_00001" = "valeur 1"
"testhash_name_00002" = "cle2"
"testhash_value_00002" = "valeur 2"
*/
----------------------------------------
weechat_hashtable_remove
^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -2808,6 +2808,47 @@ C example:
int items_count = weechat_hashtable_get_integer (hashtable, "items_count");
----------------------------------------
weechat_hashtable_add_to_infolist
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Add hashtable items to an infolist item.
Prototype:
[source,C]
----------------------------------------
int weechat_hashtable_add_to_infolist (struct t_hashtable *hashtable,
struct t_infolist_item *infolist_item,
const char *prefix);
----------------------------------------
Arguments:
* 'hashtable': hashtable pointer
* 'infolist_item': infolist item pointer
* 'prefix': string used as prefix for names in infolist
Return value:
* 1 if ok, 0 if error
C example:
[source,C]
----------------------------------------
weechat_hashtable_add_to_infolist (hashtable, infolist_item, "testhash");
/* if hashtable contains:
"key1" => "value 1"
"key2" => "value 2"
then following variables will be added to infolist item:
"testhash_name_00001" = "key1"
"testhash_value_00001" = "value 1"
"testhash_name_00002" = "key2"
"testhash_value_00002" = "value 2"
*/
----------------------------------------
weechat_hashtable_remove
^^^^^^^^^^^^^^^^^^^^^^^^