duplex_queue-release/main.h

48 lines
1.2 KiB
C

/* SPDX-License-Identifier: Apache-2.0 */
/**
* @file duplexqueue.h
*
* @brief Header file for Duplex Queue library
*
* @copyright Copyright (C) 2024 Jackrabbit Founders LLC. All rights reserved.
*
* @date Feb 2024
* @author Barrett Edwards <code@jrlabs.io>
*
*/
#ifndef _DUPLEXQUEUE_H
#define _DUPLEXQUEUE_H
/* INCLUDES ==================================================================*/
#include <linux/types.h>
#include <ptrqueue.h>
/* MACROS ====================================================================*/
/* ENUMERATIONS ==============================================================*/
/* STRUCTS ===================================================================*/
/**
* Opaque data structure
*/
struct duplex_queue {
struct ptr_queue *tx;
struct ptr_queue *rx;
__u8 *data;
size_t count;
size_t obj_size;
};
/* GLOBAL VARIABLES ==========================================================*/
/* PROTOTYPES ================================================================*/
int dq_free(struct duplex_queue *pq);
struct duplex_queue *dq_init(size_t count, size_t obj_size);
#endif /* ifndef _DUPLEXQUEUE_H */