]>
Commit | Line | Data |
---|---|---|
a0e4f61f TC |
1 | #ifndef XSQUEUE_H\r |
2 | #define XSQUEUE_H\r | |
3 | \r | |
4 | typedef unsigned pq_id_t;\r | |
5 | typedef double pq_priority_t;\r | |
6 | \r | |
7 | /* an entry in the queue */\r | |
8 | typedef struct {\r | |
9 | pq_priority_t priority;\r | |
10 | pq_id_t id;\r | |
11 | SV *payload;\r | |
12 | } pq_entry;\r | |
13 | \r | |
14 | typedef struct poe_queue_tag poe_queue;\r | |
15 | \r | |
16 | extern poe_queue *pq_create(void);\r | |
17 | extern void\r | |
18 | pq_delete(poe_queue *pq);\r | |
19 | extern int\r | |
20 | pq_enqueue(poe_queue *pq, pq_priority_t priority, SV *payload);\r | |
21 | extern int\r | |
22 | pq_get_item_count(poe_queue *pq);\r | |
23 | extern int\r | |
24 | pq_dequeue_next(poe_queue *pq, pq_priority_t *priority, pq_id_t *id, SV **payload);\r | |
25 | extern int\r | |
26 | pq_get_next_priority(poe_queue *pq, pq_priority_t *priority);\r | |
27 | extern int\r | |
28 | pq_remove_item(poe_queue *pq, pq_id_t id, SV *filter, pq_entry *removed);\r | |
29 | extern int\r | |
30 | pq_remove_items(poe_queue *pq, SV *filter, int max_count, pq_entry **entries);\r | |
31 | extern int\r | |
32 | pq_set_priority(poe_queue *pq, pq_id_t id, SV *filter, pq_priority_t new_priority);\r | |
33 | extern int\r | |
34 | pq_adjust_priority(poe_queue *pq, pq_id_t id, SV *filter, double delta, pq_priority_t *priority);\r | |
35 | extern int\r | |
36 | pq_peek_items(poe_queue *pq, SV *filter, int max_count, pq_entry **items);\r | |
37 | extern void pq_dump(poe_queue *pq);\r | |
d5e34ea9 | 38 | extern void pq_verify(poe_queue *pq);\r |
a0e4f61f | 39 | \r |
70aaf253 TC |
40 | extern void\r |
41 | pq__set_errno_queue(int value);\r | |
42 | \r | |
a0e4f61f | 43 | #endif\r |