2010-09-22 15:10:42 +02:00
|
|
|
/**
|
|
|
|
* @ingroup kernel
|
|
|
|
* @{
|
|
|
|
* @file
|
2013-03-08 11:30:23 +01:00
|
|
|
* @author Freie Universität Berlin, Computer Systems & Telematics
|
2010-09-22 15:10:42 +02:00
|
|
|
* @author Kaspar Schleiser <kaspar@schleiser.de>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __QUEUE_H
|
|
|
|
#define __QUEUE_H
|
|
|
|
|
2013-05-24 02:20:54 +02:00
|
|
|
#include <stdlib.h>
|
2013-06-14 19:41:48 +02:00
|
|
|
#include <stdint.h>
|
2010-09-22 15:10:42 +02:00
|
|
|
|
|
|
|
typedef struct queue_node_t {
|
|
|
|
struct queue_node_t *next;
|
|
|
|
unsigned int data;
|
2013-05-24 02:20:54 +02:00
|
|
|
uint32_t priority;
|
2010-09-22 15:10:42 +02:00
|
|
|
} queue_node_t;
|
|
|
|
|
2013-06-20 18:18:29 +02:00
|
|
|
queue_node_t *queue_remove_head(queue_node_t *root);
|
|
|
|
void queue_add_tail(queue_node_t *root, queue_node_t *new_obj);
|
|
|
|
void queue_add_head(queue_node_t *root, queue_node_t *new_obj);
|
|
|
|
queue_node_t *queue_remove_head(queue_node_t *root);
|
|
|
|
void queue_priority_add(queue_node_t *root, queue_node_t *new_obj);
|
|
|
|
void queue_priority_add_generic(queue_node_t *root, queue_node_t *new_obj, int(*cmp)(queue_node_t *, queue_node_t *)) ;
|
|
|
|
void queue_remove(queue_node_t *root, queue_node_t *node);
|
2010-09-22 15:10:42 +02:00
|
|
|
|
2013-06-30 01:53:53 +02:00
|
|
|
void queue_print(queue_node_t *node);
|
|
|
|
void queue_print_node(queue_node_t *node);
|
|
|
|
|
2010-09-22 15:10:42 +02:00
|
|
|
/** @} */
|
|
|
|
#endif // __QUEUE_H
|