CoolPotOS/include/queue.h

21 lines
349 B
C
Raw Normal View History

2024-04-09 23:46:56 +08:00
#ifndef CPOS_QUEUE_H
#define CPOS_QUEUE_H
typedef struct queue_node {
char data;
struct queue_node *next;
}QNode;
typedef struct queue {
QNode *phead; //队头
QNode *ptail; //队尾
int size;
}Queue;
Queue *create_queue();
void free_queue(Queue *queue);
char queue_pop(Queue *pq);
void queue_push(Queue *pq, char x);
#endif