libdatatypes
0.3.2
Abstract datatypes for C.
Loading...
Searching...
No Matches
queue.h
Go to the documentation of this file.
1
/***************************************************************************
2
begin........: June 2012
3
copyright....: Sebastian Fedrau
4
email........: sebastian.fedrau@gmail.com
5
***************************************************************************/
6
7
/***************************************************************************
8
This program is free software; you can redistribute it and/or modify
9
it under the terms of the GNU General Public License v3 as published by
10
the Free Software Foundation.
11
12
This program is distributed in the hope that it will be useful,
13
but WITHOUT ANY WARRANTY; without even the implied warranty of
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
General Public License v3 for more details.
16
***************************************************************************/
22
#ifndef QUEUE_H
23
#define QUEUE_H
24
25
#include "
stack.h
"
26
31
typedef
SList
Queue
;
32
37
typedef
SList
QueueItem
;
38
47
#define queue_new(compare, free, pool) stack_new(compare, free, pool)
48
57
#define queue_init(queue, compare, free, pool) stack_init(queue, compare, free, pool)
58
64
#define queue_destroy(queue) stack_destroy(queue)
65
71
#define queue_free(queue) stack_free(queue)
72
79
#define queue_push(queue, data) slist_append(queue, data)
80
88
#define queue_pop(queue, data) stack_pop(queue, data)
89
97
#define queue_head(queue, data) stack_head(queue, data)
98
104
#define queue_clear(queue) stack_clear(queue)
105
112
#define queue_count(queue) stack_count(queue)
113
114
#endif
115
116
Queue
SList Queue
Generic queue.
Definition
queue.h:31
QueueItem
SList QueueItem
Holds queue item data & pointer to next element.
Definition
queue.h:37
SList
Singly-linked list.
Definition
slist.h:49
stack.h
Generic stack.
queue.h
Generated on Sat Oct 7 2023 10:49:13 for libdatatypes by
1.9.8