16#ifndef INPUT_GP_TASK_H
17#define INPUT_GP_TASK_H
19#include <input/gp_types.h>
22#define GP_TASK_NONE_PRIO 0
24#define GP_TASK_MIN_PRIO 1
25#define GP_TASK_MAX_PRIO 3
A linked list implementation.
void gp_task_queue_dump(gp_task_queue *self)
Dumps task queue structure into stdout.
void gp_task_queue_rem(gp_task_queue *self, gp_task *task)
Removes a new task from the queue.
int gp_task_queue_process(gp_task_queue *self)
Runs a single task in the queue.
static unsigned int gp_task_queue_head_prio(gp_task_queue *self)
Returns minimal priority from all tasks in the queue.
static size_t gp_task_queue_tasks(gp_task_queue *self)
Returns number of tasks in the queue.
void gp_task_queue_ins(gp_task_queue *self, gp_task *task)
Inserts a new task into the queue.
A double linked list header.
A double linked list pointers.
gp_dlist queues[3 - 1+1]
A linked list per priority queue.
unsigned int min_prio
A minimal priority for a non-empty queue.
unsigned int task_cnt
A number of task in the queue.
char * id
Human readable task id.
unsigned int prio
A task priority.
unsigned int queued
Set if task is queued in the queue.
gp_dlist_head head
A pointers to the linked list.
void * priv
A private pointer to be used by the user of the API.
int(* callback)(gp_task *self)
The task callback.