queue.h

来自「mips架构的bootloader,99左右的版本 但源代码现在没人更新了」· C头文件 代码 · 共 34 行

H
34
字号
#ifndef _QUEUE_#define _QUEUE_/* Qinquiry operations */#define Q_SIZE 1	/* Queue capacity */#define Q_USED 2	/* space used */#define Q_SPACE 3	/* space remaining */#ifdef LANGUAGE_Ctypedef struct Queue {	int inp;	int outp;	int max;	} Queue;typedef unsigned char Msg;#include <malloc.h>Queue *Qcreate();Msg Qget();#define Qfull(x) ((Qinquiry(x,Q_SPACE) == 0)?1:0)#define Qempty(x) (((x)->inp == (x)->outp)?1:0)#else#define Q_INP 0#define Q_OUTP 4#define Q_MAX 8#define Q_SIZ 12#endif#endif /* _QUEUE_ */

⌨️ 快捷键说明

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