diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2013-08-10 09:35:06 +0200 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2013-08-10 09:35:06 +0200 |
commit | d12c9efdbc0009b626c34c740225b8fc75b75b21 (patch) | |
tree | 932464b0e8bffdd0f43e63964ccaef2d8d15a3bc /doc | |
parent | e407c41c5c784465cc263d228520a68a1c0044ad (diff) | |
download | weechat-d12c9efdbc0009b626c34c740225b8fc75b75b21.zip |
core: change type of hashtable key hash to unsigned long, return item pointer in functions hashtable_set(_with_size)
The key hash has been changed from unsigned int to unsigned long, and now the
callback can return any value (not only between 0 and size-1), the modulo is
computed after the call to the callback by the hashtable functions.
Functions hashtable_set and hashtable_set_with_size were returning 1 if OK,
0 if error. Now they return pointer to hashtable item, or NULL if error.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/en/weechat_plugin_api.en.txt | 22 | ||||
-rw-r--r-- | doc/fr/weechat_plugin_api.fr.txt | 22 | ||||
-rw-r--r-- | doc/it/weechat_plugin_api.it.txt | 26 |
3 files changed, 37 insertions, 33 deletions
diff --git a/doc/en/weechat_plugin_api.en.txt b/doc/en/weechat_plugin_api.en.txt index fbc9c85c3..0f6f5410e 100644 --- a/doc/en/weechat_plugin_api.en.txt +++ b/doc/en/weechat_plugin_api.en.txt @@ -3281,8 +3281,8 @@ Prototype: struct t_hashtable *weechat_hashtable_new (int size, const char *type_keys, const char *type_values, - unsigned int (*callback_hash_key)(struct t_hashtable *hashtable, - const void *key), + unsigned long (*callback_hash_key)(struct t_hashtable *hashtable, + const void *key), int (*callback_keycmp)(struct t_hashtable *hashtable, const void *key1, const void *key2)); @@ -3343,7 +3343,7 @@ This function is not available in scripting API. weechat_hashtable_set_with_size ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -_New in version 0.3.3._ +_New in version 0.3.3, updated in 0.4.2._ Add or update item in a hashtable with size for key and value. @@ -3351,9 +3351,9 @@ Prototype: [source,C] ---------------------------------------- -int weechat_hashtable_set_with_size (struct t_hashtable *hashtable, - const void *key, int key_size, - const void *value, int value_size); +struct t_hashtable_item *weechat_hashtable_set_with_size (struct t_hashtable *hashtable, + const void *key, int key_size, + const void *value, int value_size); ---------------------------------------- Arguments: @@ -3368,7 +3368,7 @@ Arguments: Return value: -* 1 if ok, 0 if error +* pointer to item created/updated, NULL if error C example: @@ -3384,7 +3384,7 @@ This function is not available in scripting API. weechat_hashtable_set ^^^^^^^^^^^^^^^^^^^^^ -_New in version 0.3.3._ +_New in version 0.3.3, updated in 0.4.2._ Add or update item in a hashtable. @@ -3392,8 +3392,8 @@ Prototype: [source,C] ---------------------------------------- -int weechat_hashtable_set (struct t_hashtable *hashtable, - const void *key, const void *value); +struct t_hashtable_item *weechat_hashtable_set (struct t_hashtable *hashtable, + const void *key, const void *value); ---------------------------------------- Arguments: @@ -3404,7 +3404,7 @@ Arguments: Return value: -* 1 if ok, 0 if error +* pointer to item created/updated, NULL if error C example: diff --git a/doc/fr/weechat_plugin_api.fr.txt b/doc/fr/weechat_plugin_api.fr.txt index 188cb5cf0..31598a1dc 100644 --- a/doc/fr/weechat_plugin_api.fr.txt +++ b/doc/fr/weechat_plugin_api.fr.txt @@ -3320,8 +3320,8 @@ Prototype : struct t_hashtable *weechat_hashtable_new (int size, const char *type_keys, const char *type_values, - unsigned int (*callback_hash_key)(struct t_hashtable *hashtable, - const void *key), + unsigned long (*callback_hash_key)(struct t_hashtable *hashtable, + const void *key), int (*callback_keycmp)(struct t_hashtable *hashtable, const void *key1, const void *key2)); @@ -3384,7 +3384,7 @@ Cette fonction n'est pas disponible dans l'API script. weechat_hashtable_set_with_size ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -_Nouveau dans la version 0.3.3._ +_Nouveau dans la version 0.3.3, mis à jour dans la 0.4.2._ Ajoute ou met à jour une entrée dans une hashtable avec une taille pour la clé et la valeur. @@ -3393,9 +3393,9 @@ Prototype : [source,C] ---------------------------------------- -int weechat_hashtable_set_with_size (struct t_hashtable *hashtable, - const void *key, int key_size, - const void *value, int value_size); +struct t_hashtable_item *weechat_hashtable_set_with_size (struct t_hashtable *hashtable, + const void *key, int key_size, + const void *value, int value_size); ---------------------------------------- Paramètres : @@ -3410,7 +3410,7 @@ Paramètres : Valeur de retour : -* 1 si ok, 0 en cas d'erreur +* pointeur vers l'item créé/mis à jour, NULL en cas d'erreur Exemple en C : @@ -3426,7 +3426,7 @@ Cette fonction n'est pas disponible dans l'API script. weechat_hashtable_set ^^^^^^^^^^^^^^^^^^^^^ -_Nouveau dans la version 0.3.3._ +_Nouveau dans la version 0.3.3, mis à jour dans la 0.4.2._ Ajoute ou met à jour une entrée dans la hashtable. @@ -3434,8 +3434,8 @@ Prototype : [source,C] ---------------------------------------- -int weechat_hashtable_set (struct t_hashtable *hashtable, - const void *key, const void *value); +struct t_hashtable_item *weechat_hashtable_set (struct t_hashtable *hashtable, + const void *key, const void *value); ---------------------------------------- Paramètres : @@ -3446,7 +3446,7 @@ Paramètres : Valeur de retour : -* 1 si ok, 0 en cas d'erreur +* pointeur vers l'item créé/mis à jour, NULL en cas d'erreur Exemple en C : diff --git a/doc/it/weechat_plugin_api.it.txt b/doc/it/weechat_plugin_api.it.txt index 3e1955738..77a811ff1 100644 --- a/doc/it/weechat_plugin_api.it.txt +++ b/doc/it/weechat_plugin_api.it.txt @@ -3284,8 +3284,8 @@ Prototipo: struct t_hashtable *weechat_hashtable_new (int size, const char *type_keys, const char *type_values, - unsigned int (*callback_hash_key)(struct t_hashtable *hashtable, - const void *key), + unsigned long (*callback_hash_key)(struct t_hashtable *hashtable, + const void *key), int (*callback_keycmp)(struct t_hashtable *hashtable, const void *key1, const void *key2)); @@ -3348,7 +3348,8 @@ Questa funzione non è disponibile nelle API per lo scripting. weechat_hashtable_set_with_size ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -_Novità nella versione 0.3.3._ +// TRANSLATION MISSING +_Novità nella versione 0.3.3, updated in 0.4.2._ Aggiunge o aggiorna un elemento nella tabella hash con la dimensione per la chiave ed il valore. @@ -3357,9 +3358,9 @@ Prototipo: [source,C] ---------------------------------------- -int weechat_hashtable_set_with_size (struct t_hashtable *hashtable, - const void *key, int key_size, - const void *value, int value_size); +struct t_hashtable_item *weechat_hashtable_set_with_size (struct t_hashtable *hashtable, + const void *key, int key_size, + const void *value, int value_size); ---------------------------------------- Argomenti: @@ -3374,7 +3375,8 @@ Argomenti: Valore restituito: -* 1 se ok, 0 in caso di errore +// TRANSLATION MISSING +* pointer to item created/updated, NULL if error Esempio in C: @@ -3390,7 +3392,8 @@ Questa funzione non è disponibile nelle API per lo scripting. weechat_hashtable_set ^^^^^^^^^^^^^^^^^^^^^ -_Novità nella versione 0.3.3._ +// TRANSLATION MISSING +_Novità nella versione 0.3.3, updated in 0.4.2._ Aggiunge o aggiorna un elemento nella tabella hash. @@ -3398,8 +3401,8 @@ Prototipo: [source,C] ---------------------------------------- -int weechat_hashtable_set (struct t_hashtable *hashtable, - const void *key, const void *value); +struct t_hashtable_item *weechat_hashtable_set (struct t_hashtable *hashtable, + const void *key, const void *value); ---------------------------------------- Argomenti: @@ -3410,7 +3413,8 @@ Argomenti: Valore restituito: -* 1 se ok, 0 in caso di errore +// TRANSLATION MISSING +* pointer to item created/updated, NULL if error Esempio in C: |