-Changed most of the header guard strings to be a little more verbose
[newos.git] / include / kernel / queue.h
blobeb29363432c11481e77ed0476f6a062c572aa43a
1 /*
2 ** Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
3 ** Distributed under the terms of the NewOS License.
4 */
5 #ifndef _KERNEL_QUEUE_H
6 #define _KERNEL_QUEUE_H
8 #include <kernel/kernel.h>
10 typedef struct queue {
11 void *head;
12 void *tail;
13 int count;
14 } queue;
16 int queue_init(queue *q);
17 int queue_remove_item(queue *q, void *e);
18 int queue_enqueue(queue *q, void *e);
19 void *queue_dequeue(queue *q);
20 void *queue_peek(queue *q);
22 typedef struct fixed_queue {
23 void **table;
24 int head;
25 int tail;
26 int count;
27 int size;
28 } fixed_queue;
30 int fixed_queue_init(fixed_queue *q, int size);
31 void fixed_queue_destroy(fixed_queue *q);
32 int fixed_queue_enqueue(fixed_queue *q, void *e);
33 void *fixed_queue_dequeue(fixed_queue *q);
34 void *fixed_queue_peek(fixed_queue *q);
36 #endif