All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
heap.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 2 of the License, or
5  * (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software
14  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
15  */
16 #ifndef _FR_HEAP_H
17 #define _FR_HEAP_H
18 /**
19  * $Id: 232bc19fbe4ac66387059f5c803b64f07bc9a31c $
20  *
21  * @file include/heap.h
22  * @brief Structures and prototypes for binary heaps.
23  *
24  * @copyright 2007 Alan DeKok
25  */
26 RCSIDH(heap_h, "$Id: 232bc19fbe4ac66387059f5c803b64f07bc9a31c $")
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 typedef int (*fr_heap_cmp_t)(void const *, void const *);
33 
34 typedef struct fr_heap_t fr_heap_t;
36 void fr_heap_delete(fr_heap_t *hp);
37 
38 int fr_heap_insert(fr_heap_t *hp, void *data);
39 int fr_heap_extract(fr_heap_t *hp, void *data);
40 void *fr_heap_peek(fr_heap_t *hp);
42 
43 #ifdef __cplusplus
44 }
45 #endif
46 #endif /* _FR_HEAP_H*/
#define RCSIDH(h, id)
Definition: build.h:136
int fr_heap_extract(fr_heap_t *hp, void *data)
Definition: heap.c:147
void * fr_heap_peek(fr_heap_t *hp)
Definition: heap.c:207
int(* fr_heap_cmp_t)(void const *, void const *)
Definition: heap.h:32
int fr_heap_insert(fr_heap_t *hp, void *data)
Definition: heap.c:92
Definition: heap.c:16
void fr_heap_delete(fr_heap_t *hp)
Definition: heap.c:36
uint8_t data[]
Definition: eap_pwd.h:625
fr_heap_t * fr_heap_create(fr_heap_cmp_t cmp, size_t offset)
Definition: heap.c:44
size_t offset
Definition: heap.c:19
Definition: pair.c:37
size_t fr_heap_num_elements(fr_heap_t *hp)
Definition: heap.c:217