SphinxBase  5prealpha
priority_queue.h
1 #ifndef __PRIORITY_QUEUE_H__
2 #define __PRIORITY_QUEUE_H__
3 
4 #include <stdlib.h>
5 #include <sphinxbase/sphinxbase_export.h>
6 
7 #ifdef __cplusplus
8 extern "C" {
9 #endif
10 #if 0
11 /* Fool Emacs. */
12 }
13 #endif
14 
24 typedef struct priority_queue_s priority_queue_t;
25 
26 SPHINXBASE_EXPORT
27 priority_queue_t* priority_queue_create(size_t len, int (*compare)(const void *a, const void *b));
28 
29 SPHINXBASE_EXPORT
30 void* priority_queue_poll(priority_queue_t *queue);
31 
32 SPHINXBASE_EXPORT
33 void priority_queue_add(priority_queue_t *queue, void *element);
34 
35 SPHINXBASE_EXPORT
36 size_t priority_queue_size(priority_queue_t *queue);
37 
38 SPHINXBASE_EXPORT
39 void priority_queue_free(priority_queue_t *queue, void (*free_ptr)(void *a));
40 
41 #ifdef __cplusplus
42 }
43 #endif
44 
45 #endif /* __PRIORITY_QUEUE_H__ */