TacOS
0.2
|
#include <types.h>
Aller au code source de ce fichier.
Structures de données | |
struct | heap_t |
Macros | |
#define | HEAP_MAX_SIZE 256 |
Définitions de type | |
typedef int(* | cmp_func_type )(void *, void *) |
typedef int(* | id_func_type )(int, void *) |
Fonctions | |
void | initHeap (heap_t *h, cmp_func_type cmp, void *heap, size_t elements_size, int max_elements) |
void * | getTop (heap_t *h) |
int | addElement (heap_t *h, void *element) |
int | removetop (heap_t *h) |
int | delElement (heap_t *heap, int id, id_func_type func) |
Copyright (C) 2010, 2011, 2012 - 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.
Description de ce que fait le fichier
#define HEAP_MAX_SIZE 256 |
Taille maximale du tas.
typedef int(* cmp_func_type)(void *, void *) |
Une fonction de comparaison entre 2 elements
int addElement | ( | heap_t * | h, |
void * | element | ||
) |
Ajoute un element au tas.
h | pointeur vers le tas. |
element | pointeur vers l'élément à ajouter au tas. |
void* getTop | ( | heap_t * | h | ) |
Recupere le premier élément du tas.
@param h pointeur vers le tas. @return pointeur vers le premier élément du tas, NULL si aucun.
void initHeap | ( | heap_t * | h, |
cmp_func_type | cmp, | ||
void * | heap, | ||
size_t | elements_size, | ||
int | max_elements | ||
) |
Initialise le tas à vide et regle la fonction de comparaison
int removetop | ( | heap_t * | h | ) |
Retire le sommet.
h | pointeur vers le tas. |