]> Pileus Git - grits/blob - src/gis/gpqueue.h
87f6cf97523cacfee1e2e4df945b73eb91d12a2d
[grits] / src / gis / gpqueue.h
1 #if defined(G_DISABLE_SINGLE_INCLUDES) && !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
2 #error "Only <glib.h> can be included directly."
3 #endif
4
5 #ifndef __G_PQUEUE_H__
6 #define __G_PQUEUE_H__
7
8 G_BEGIN_DECLS
9
10 typedef struct _GPQueueNode GPQueueNode;
11
12 /**
13  * GPQueue:
14  * 
15  * An opaque structure representing a priority queue.
16  * 
17  * Since: 2.x
18  **/
19 typedef struct _GPQueue GPQueue;
20
21 /**
22  * GPQueueHandle:
23  * 
24  * An opaque value representing one entry in a #GPQueue.
25  * 
26  * Since: 2.x
27  **/
28 typedef GPQueueNode* GPQueueHandle;
29
30 GPQueue*        g_pqueue_new                    (GCompareDataFunc compare_func,
31                                                  gpointer *compare_userdata);
32
33 void            g_pqueue_free                   (GPQueue* pqueue);
34
35 gboolean        g_pqueue_is_empty               (GPQueue *pqueue);
36
37 void            g_pqueue_foreach                (GPQueue *pqueue,
38                                                  GFunc func,
39                                                  gpointer user_data);
40
41 GPQueueHandle   g_pqueue_push                   (GPQueue *pqueue,
42                                                  gpointer data);
43
44 gpointer        g_pqueue_peek                   (GPQueue *pqueue);
45
46 gpointer        g_pqueue_pop                    (GPQueue *pqueue);
47
48 void            g_pqueue_remove                 (GPQueue* pqueue,
49                                                  GPQueueHandle entry);
50
51 void            g_pqueue_priority_changed       (GPQueue* pqueue,
52                                                  GPQueueHandle entry);
53
54 void            g_pqueue_priority_decreased     (GPQueue* pqueue,
55                                                  GPQueueHandle entry);
56
57 void            g_pqueue_clear                  (GPQueue* pqueue);
58
59 G_END_DECLS
60
61 #endif /* __G_PQUEUE_H__ */