📄 queue.h.svn-base
字号:
/* ****ROBOCON 2009 | BUPT TEAM*******
* ------------------------------------------------------------------------
* FileName : queue.h
* Version : 1.1
* Brief : Queue Data Structure, Header file
* Code by : Leaf
* Date : Dec 08, 2008
* Note : Use Circle Array
*
*
* ------------------------------------------------------------------------
*/
#ifndef QUEUE_H_INCLUDED
#define QUEUE_H_INCLUDED
#include "includes.h"
#ifndef Q_DATA_TYPE
#define Q_DATA_TYPE UINT8
#endif
#ifndef Q_SIZE_TYPE
#define Q_SIZE_TYPE UINT8
#endif
typedef struct
{
Q_DATA_TYPE *buf;
Q_SIZE_TYPE capacity;
Q_SIZE_TYPE front;
Q_SIZE_TYPE back;
Q_SIZE_TYPE size;
}Queue;
extern void qInit(Queue *q, Q_DATA_TYPE *buf, Q_SIZE_TYPE bufsize);
extern inline BOOL qFull(const Queue *q);
extern inline BOOL qEmpty(const Queue *q);
extern inline Q_SIZE_TYPE qSize(const Queue *q);
extern void qPush(Queue *q, Q_DATA_TYPE d);
extern Q_DATA_TYPE qPop(Queue *q);
extern Q_DATA_TYPE qFront(const Queue *q);
extern Q_SIZE_TYPE qFlush(Queue *q, Q_DATA_TYPE *buf);
extern void qReset(Queue *q);
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -