2016-08-15 18:16:30 +08:00
|
|
|
/*
|
2017-11-22 17:29:57 +08:00
|
|
|
* Copyright (c) 2016-2017 Nordic Semiconductor ASA
|
2016-08-15 18:16:30 +08:00
|
|
|
* Copyright (c) 2016 Vinayak Kariappa Chettimada
|
|
|
|
*
|
2017-01-19 09:01:01 +08:00
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
2016-08-15 18:16:30 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _MEMQ_H_
|
|
|
|
#define _MEMQ_H_
|
|
|
|
|
2017-11-22 17:29:57 +08:00
|
|
|
struct _memq_link {
|
|
|
|
struct _memq_link *next;
|
|
|
|
void *mem;
|
|
|
|
};
|
2016-08-15 18:16:30 +08:00
|
|
|
|
2017-11-22 17:29:57 +08:00
|
|
|
typedef struct _memq_link memq_link_t;
|
|
|
|
|
|
|
|
memq_link_t *memq_init(memq_link_t *link, memq_link_t **head,
|
|
|
|
memq_link_t **tail);
|
|
|
|
memq_link_t *memq_enqueue(memq_link_t *link, void *mem, memq_link_t **tail);
|
|
|
|
memq_link_t *memq_peek(memq_link_t *head, memq_link_t *tail, void **mem);
|
|
|
|
memq_link_t *memq_dequeue(memq_link_t *tail, memq_link_t **head, void **mem);
|
|
|
|
|
|
|
|
#endif /* _MEMQ_H_ */
|