|
struct | prqueue_t |
| the priority queue handle More...
|
|
typedef unsigned long long | prqueue_pri_t |
| priority data type (used to be double, but ull is 107 times faster)
|
|
typedef prqueue_pri_t(* | prqueue_get_pri_f) (void *a) |
| callback functions to get/set/compare the priority of an element
|
|
typedef void(* | prqueue_set_pri_f) (void *a, prqueue_pri_t pri) |
|
typedef int(* | prqueue_cmp_pri_f) (prqueue_pri_t next, prqueue_pri_t curr) |
|
typedef unsigned int(* | prqueue_get_pos_f) (void *a) |
| callback functions to get/set the position of an element
|
|
typedef void(* | prqueue_set_pos_f) (void *a, unsigned int pos) |
|
typedef void(* | prqueue_print_entry_f) (FILE *out, void *a) |
| debug callback function to print a entry
|
|
typedef struct prqueue_t | prqueue_t |
| the priority queue handle
|
|
prqueue_t * | prqueue_init (unsigned int n, prqueue_cmp_pri_f cmppri, prqueue_get_pri_f getpri, prqueue_set_pri_f setpri, prqueue_get_pos_f getpos, prqueue_set_pos_f setpos) |
| initialize the queue More...
|
|
void | prqueue_free (prqueue_t *q) |
| free all memory used by the queue More...
|
|
unsigned int | prqueue_size (prqueue_t *q) |
| return the size of the queue. More...
|
|
int | prqueue_insert (prqueue_t *q, void *d) |
| insert an item into the queue. More...
|
|
void | prqueue_change_priority (prqueue_t *q, prqueue_pri_t new_pri, void *d) |
| move an existing entry to a different priority More...
|
|
void * | prqueue_pop (prqueue_t *q) |
| pop the highest-ranking item from the queue. More...
|
|
int | prqueue_remove (prqueue_t *q, void *d) |
| remove an item from the queue. More...
|
|
void * | prqueue_peek (prqueue_t *q) |
| access highest-ranking item without removing it. More...
|
|
void | prqueue_print (prqueue_t *q, FILE *out, prqueue_print_entry_f print) |
| print the queue
|
|
void | prqueue_dump (prqueue_t *q, FILE *out, prqueue_print_entry_f print) |
| dump the queue and it's internal structure
|
|
int | prqueue_is_valid (prqueue_t *q) |
| checks that the pq is in the right order, etc
|
|
Priority Queue function declarations.
This priority queue library was originally written by Volkan Yazici volka.nosp@m.n.ya.nosp@m.zici@.nosp@m.gmai.nosp@m.l.com. It was lated adapted for Nagios by Andreas Ericsson ae@op.nosp@m.5.se. Changes compared to the original version are pretty much limited to changing prqueue_pri_t to be an unsigned long long instead of a double, since ULL comparisons are 107 times faster on my 64-bit laptop.