mirror of
https://gitee.com/moluo-tech/CodeBrick.git
synced 2025-01-30 04:42:53 +08:00
42 lines
1.2 KiB
C
42 lines
1.2 KiB
C
/******************************************************************************
|
||
* @brief ͨ<>ö<EFBFBD><C3B6>й<EFBFBD><D0B9><EFBFBD>
|
||
*
|
||
* Copyright (c) 2017~2020, <master_roger@sina.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; /*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ*/
|
||
unsigned short element_size; /*<2A><><EFBFBD><EFBFBD>Ԫ<EFBFBD>ش<EFBFBD>С*/
|
||
unsigned short size; /*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ԫ<EFBFBD>ظ<EFBFBD><D8B8><EFBFBD>*/
|
||
unsigned short front; /*<2A><><EFBFBD><EFBFBD>*/
|
||
unsigned short rear; /*<2A><>β*/
|
||
}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
|