Song Zhao | 6859d41 | 2020-06-15 17:16:04 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2020 Amlogic, Inc. All rights reserved. |
| 3 | * |
| 4 | * This source code is subject to the terms and conditions defined in the |
| 5 | * file 'LICENSE' which is part of this source code package. |
| 6 | * |
| 7 | * Description: fifo implementation |
| 8 | * Author: song.zhao@amlogic.com |
| 9 | */ |
| 10 | |
| 11 | #ifndef _AML_QUEUE_H_ |
| 12 | #define _AML_QUEUE_H_ |
| 13 | |
| 14 | #include <stdint.h> |
| 15 | |
| 16 | void* create_q(int max_len); |
| 17 | void destroy_q(void * queue); |
| 18 | int queue_item(void *queue, void * item); |
| 19 | /* cnt 0 for frist one in fifo, cnt 1 for 2nd one in fifo, etc */ |
| 20 | int peek_item(void *queue, void** p_item, uint32_t cnt); |
| 21 | int dqueue_item(void *queue, void** p_item); |
| 22 | int queue_size(void *queue); |
| 23 | |
| 24 | #endif |