queue.h

来自「接收端的程序」· C头文件 代码 · 共 44 行

H
44
字号
#ifndef 	_QUEUE_H
#define 	_QUEUE_H
#include	"devicelog.h"

	


typedef struct QNode
{
	
	struct eventinfo data;
	struct QNode *next;
}QNode,*Queueptr;

typedef struct 
{
	Queueptr front;
	Queueptr rear;
	
}LinkQueue;


void InitQueue(LinkQueue *Q);/*initialize the queue*/

void DestroyQueue(LinkQueue *Q);/*destroy the queue*/

void CleanQueue(LinkQueue *Q);/*clean the queue*/

int QueueEmpty(LinkQueue *Q);/*judge the queue is empty*/

int QueueLength(LinkQueue *Q);/*get the length of the queue*/

void GetHear(LinkQueue *Q,struct eventinfo *e);/*get the head data*/

void Enqueue(LinkQueue *Q,struct eventinfo e);/*insert the e into queue*/

void Dequeue(LinkQueue *Q,struct eventinfo *e);/*delete the head data and store it in e*/

void PrintQueue(LinkQueue *Q); /*print the queue*/

#endif   	/*queue.h*/


⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?