1#ifndef LIBNAGIOS_SQUEUE_H_INCLUDED
2#define LIBNAGIOS_SQUEUE_H_INCLUDED
26typedef struct squeue_event squeue_event;
31#define SQUEUE_FREE_DATA (1 << 0)
Priority Queue function declarations.
void * squeue_event_data(squeue_event *evt)
Get data of an squeue_event struct.
int squeue_remove(squeue_t *q, squeue_event *evt)
Removes the given event from the scheduling queue.
void * squeue_peek(squeue_t *q)
Returns the data of the next scheduled event from the scheduling queue without removing it from the q...
void squeue_change_priority_tv(squeue_t *q, squeue_event *evt, struct timeval *tv)
Change an event's priority to a new time.
squeue_event * squeue_add_msec(squeue_t *q, time_t when, time_t msec, void *data)
Adds an event to the scheduling queue with millisecond precision See notes on squeue_add_tv() for det...
int squeue_evt_when_is_after(squeue_event *evt, struct timeval *reftime)
Returns true if passed timeval is after the time for the event.
void squeue_destroy(squeue_t *q, int flags)
Destroys a scheduling queue completely.
squeue_t * squeue_create(unsigned int size)
Creates a scheduling queue optimized for handling events within the given timeframe.
squeue_event * squeue_add_tv(squeue_t *q, struct timeval *tv, void *data)
Enqueue an event with microsecond precision.
squeue_event * squeue_add_usec(squeue_t *q, time_t when, time_t usec, void *data)
Adds an event to the scheduling queue with millisecond precision See notes on squeue_add_tv() for det...
unsigned int squeue_size(squeue_t *q)
Returns the number of events in the scheduling queue.
squeue_event * squeue_add(squeue_t *q, time_t when, void *data)
Adds an event to the scheduling queue.
void * squeue_pop(squeue_t *q)
Pops the next scheduled event from the scheduling queue and returns the data for it.
const struct timeval * squeue_event_runtime(squeue_event *evt)
Get the scheduled runtime of this event.
the priority queue handle
Definition prqueue.h:56