Nagios
4.4.6
Dev docs for Nagios core and neb-module hackers
|
Go to the documentation of this file. 1 #ifndef LIBNAGIOS_SQUEUE_H_INCLUDED
2 #define LIBNAGIOS_SQUEUE_H_INCLUDED
26 typedef struct squeue_event squeue_event;
31 #define SQUEUE_FREE_DATA (1 << 0)
void squeue_destroy(squeue_t *q, int flags)
Destroys a scheduling queue completely.
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...
int squeue_evt_when_is_after(squeue_event *evt, struct timeval *reftime)
Returns true if passed timeval is after the time for the event.
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...
void * squeue_pop(squeue_t *q)
Pops the next scheduled event from the scheduling queue and returns the data for it.
void * squeue_event_data(squeue_event *evt)
Get data of an squeue_event struct.
const struct timeval * squeue_event_runtime(squeue_event *evt)
Get the scheduled runtime of this event.
int squeue_remove(squeue_t *q, squeue_event *evt)
Removes the given event from the scheduling queue.
the priority queue handle
Definition: pqueue.h:55
squeue_t * squeue_create(unsigned int size)
Creates a scheduling queue optimized for handling events within the given timeframe.
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.
Priority Queue function declarations.
void * squeue_peek(squeue_t *q)
Returns the data of the next scheduled event from the scheduling queue without removing it from the q...
squeue_event * squeue_add_tv(squeue_t *q, struct timeval *tv, void *data)
Enqueue an event with microsecond precision.
void squeue_change_priority_tv(squeue_t *q, squeue_event *evt, struct timeval *tv)
Change an event's priority to a new time.