81 lines
1.8 KiB
C
81 lines
1.8 KiB
C
|
|
#ifndef __CELOXICA_BUFFER_QUEUE_H__
|
|
#define __CELOXICA_BUFFER_QUEUE_H__
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#include "celoxica_buffer_pool.h"
|
|
|
|
typedef struct _CeloxicaBufferQueueHandle CeloxicaBufferQueueHandle_t;
|
|
|
|
/**
|
|
* \brief Open Celoxica buffer queue
|
|
*
|
|
* @param H Pointer to are handle.
|
|
*
|
|
* @return zero on successful completion.
|
|
*/
|
|
int CeloxicaBufferQueueOpen(CeloxicaBufferQueueHandle_t **H);
|
|
|
|
/**
|
|
* \brief Close Celoxica buffer queue
|
|
*
|
|
* @param H Valid buffer queue handle.
|
|
*/
|
|
void CeloxicaBufferQueueClose(CeloxicaBufferQueueHandle_t *H);
|
|
|
|
/**
|
|
* \brief Add buffer to queue
|
|
*
|
|
* @param H Valid buffer queue handle.
|
|
* @param New The Buffer to add to the queue.
|
|
*
|
|
* @return zero on successful completion.
|
|
*/
|
|
int CeloxicaBufferQueueAdd(CeloxicaBufferQueueHandle_t *H, CeloxicaBuffer_t *New);
|
|
|
|
/**
|
|
* \brief Get next buffer from queue.
|
|
*
|
|
* Gets the next Item from the queue.
|
|
*
|
|
* @param H Valid buffer queue handle.
|
|
* @param New A pointer to store the next item in the queue.
|
|
*
|
|
* @return zero on successful completion.
|
|
*/
|
|
int CeloxicaBufferQueueGetNext(CeloxicaBufferQueueHandle_t *H, CeloxicaBuffer_t **Next);
|
|
|
|
/**
|
|
* \brief Peek at next buffer in queue.
|
|
*
|
|
* Get the next item from the queue without removing it.
|
|
*
|
|
* @param H Valid buffer queue handle.
|
|
* @param New A pointer to store the next item in the queue.
|
|
*
|
|
* @return zero on successful completion.
|
|
*/
|
|
int CeloxicaBufferQueuePeek(CeloxicaBufferQueueHandle_t *H, CeloxicaBuffer_t **Next);
|
|
|
|
/**
|
|
* \brief Get queue size.
|
|
*
|
|
* Get the number of buffers in the queue.
|
|
*
|
|
* @param H Valid buffer queue handle.
|
|
*
|
|
* @return -1 on error else the size of the queue.
|
|
*/
|
|
int CeloxicaBufferQueueSize(CeloxicaBufferQueueHandle_t *H);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* __CELOXICA_BUFFER_QUEUE_H__ */
|
|
|
|
|