-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathqueue.h
More file actions
47 lines (32 loc) · 704 Bytes
/
queue.h
File metadata and controls
47 lines (32 loc) · 704 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//
// queue.h
// RegexCompiler
//
// Created by 臻华的Macbook pro on 2018/11/23.
// Copyright © 2018 臻华的Macbook pro. All rights reserved.
//
#ifndef queue_h
#define queue_h
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
typedef struct Queue Queue;
typedef struct QNode QNode;
struct Queue {
QNode *front;
QNode *rear;
};
struct QNode {
const void *data;
QNode *next;
};
Queue *InitQueue(void);
QNode *InitQNode(void);
void EnQueue(Queue *q, const void *ele);
void *DeQueue(Queue *q);
void *GetHead(const Queue *q);
bool EmptyQueue(const Queue *q);
void QueueError(void);
void QueueEmptyError(void);
void FreeQueue(Queue *q);
#endif /* queue_h */