|
TacOS
0.2
|

Fonctions | |
| hashmap_t * | hashmap_create (int size, int(*equal)(struct hashmap_key_t *, struct hashmap_key_t *), int(*hash)(struct hashmap_key_t *)) |
| void | hashmap_set (hashmap_t *this, struct hashmap_key_t *key, struct hashmap_value_t *value) |
| struct hashmap_value_t * | hashmap_remove (hashmap_t *this, struct hashmap_key_t *key) |
| struct hashmap_value_t * | hashmap_get (hashmap_t *this, struct hashmap_key_t *key) |
Copyright (C) 2010-2014 TacOS developers.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details at http://www.gnu.org/copyleft/gpl.html
You should have received a copy of the GNU General Public License along with this program; if not, see http://www.gnu.org/licenses.
Hashmap générique. Des tests un peu plus poussés sont à faire.
| hashmap_t* hashmap_create | ( | int | size, |
| int(*)(struct hashmap_key_t *, struct hashmap_key_t *) | equal, | ||
| int(*)(struct hashmap_key_t *) | hash | ||
| ) |
Crée et initialise une nouvelle hashmap.
| size | La taille de la table, correspond à la valeur maximale - 1 que peut retourner la fonction de hash. |
| equal | Fonction qui retourne 1 si 2 clefs sont identiques. |
| hash | Fonction de hash. |


| struct hashmap_value_t* hashmap_get | ( | hashmap_t * | this, |
| struct hashmap_key_t * | key | ||
| ) |
Lit un élément de la hashmap.
| this | Pointeur vers la hashmap à utiliser. |
| key | La clef de l'élément à lire. |

| struct hashmap_value_t* hashmap_remove | ( | hashmap_t * | this, |
| struct hashmap_key_t * | key | ||
| ) |
Supprime un élément de la hashmap. Attention, seule la cellule est freed.
| this | Pointeur vers la hashmap à utiliser. |
| key | La clef de l'élément à supprimer. |


| void hashmap_set | ( | hashmap_t * | this, |
| struct hashmap_key_t * | key, | ||
| struct hashmap_value_t * | value | ||
| ) |
Ajoute ou modifie une valeur dans la hashmap.
| this | Pointeur vers la hashmap à utiliser. |
| key | La clef. |
| value | La valeur. |


1.8.7