Ai
112 Star 899 Fork 444

魔罗/CodeBrick

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
queue.h 1.20 KB
一键复制 编辑 原始数据 按行查看 历史
魔罗 提交于 2020-12-04 20:53 +08:00 . 更新描述信息
/******************************************************************************
* @brief 通用队列管理
*
* Copyright (c) 2017~2020, <morro_luo@163.com>
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2017-03-19 Morro Initial version.
******************************************************************************/
#ifndef _QUEUE_H_
#define _QUEUE_H_
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct {
void *base; /*队列容器基地址*/
unsigned short element_size; /*队列元素大小*/
unsigned short size; /*队列容器可容纳元素个数*/
unsigned short front; /*队首*/
unsigned short rear; /*队尾*/
}queue_t;
bool queue_create(queue_t *q, void *container, int size, int element_size);
bool queue_peek (queue_t *q, void **element);
bool queue_put (queue_t *q, void *element);
bool queue_get (queue_t *q, void *element);
bool queue_del (queue_t *q);
void queue_clr (queue_t *q);
int queue_len (queue_t *q);
#ifdef __cplusplus
}
#endif
#endif
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/moluo-tech/CodeBrick.git
git@gitee.com:moluo-tech/CodeBrick.git
moluo-tech
CodeBrick
CodeBrick
master

搜索帮助