初始化一个给定队列,应用可以在栈上分配队列,而后调用该函数进行初始化
- 参数
-
void test(void) { ACL_FIFO fifo;
acl_fifo_init(&fifo); }
#ifndef ACL_FIFO_INCLUDE_H
#define ACL_FIFO_INCLUDE_H
#ifdef __cplusplus
extern "C" {
#endif
};
};
};
#define acl_fifo_push acl_fifo_push_back
#define acl_fifo_push_info acl_fifo_push_info_back
#define acl_fifo_pop acl_fifo_pop_front
#define ACL_FIFO_ITER_VALUE(iter) ((iter).ptr->data)
#define acl_fifo_iter_value ACL_FIFO_ITER_VALUE
#define ACL_FIFO_FOREACH(iter, fifo_ptr) \
for ((iter).ptr = (fifo_ptr)->head; (iter).ptr; (iter).ptr = (iter).ptr->next)
#define acl_fifo_foreach ACL_FIFO_FOREACH
#define ACL_FIFO_FOREACH_REVERSE(iter, fifo_ptr) \
for ((iter).ptr = (fifo_ptr)->tail; (iter).ptr; (iter).ptr = (iter).ptr->prev)
#define acl_fifo_foreach_reverse ACL_FIFO_FOREACH_REVERSE
#ifdef __cplusplus
}
#endif
#endif