QTip
C library for queues
Loading...
Searching...
No Matches
qtip.h File Reference

API for queues. More...

#include <stdbool.h>
#include <stddef.h>
Include dependency graph for qtip.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  qtipContext_t
 Queue context structure. More...
 

Macros

#define QTIP_CPP_SUPPORT_START
 
#define QTIP_CPP_SUPPORT_END
 
#define QTIP_IS_CPP   (0U)
 
#define SIZE_TYPE   size_t
 Type for holding the number of items in queue.
 

Typedefs

typedef size_t qtipSize_t
 Number of items in queue.
 

Enumerations

enum  qtipStatus_t {
  QTIP_STATUS_OK , QTIP_STATUS_FULL , QTIP_STATUS_EMPTY , QTIP_STATUS_NULL_PTR ,
  QTIP_STATUS_INVALID_SIZE , QTIP_STATUS_LOCKED
}
 Queue operation status. More...
 

Functions

qtipStatus_t qtip_init (qtipContext_t *pContext, void *pQueue, qtipSize_t maxItems, size_t itemSize)
 Initialize queue context.
 
qtipStatus_t qtip_put (qtipContext_t *pContext, void *pItem)
 Put an item in a queue.
 
qtipStatus_t qtip_pop (qtipContext_t *pContext, void *pItem)
 Extract the next item from the queue.
 
qtipStatus_t qtip_peek (qtipContext_t *pContext, void *pBuffer, qtipSize_t *pSize)
 Copies every element of the queue into a buffer.
 
qtipStatus_t qtip_purge (qtipContext_t *pContext)
 Removes all the items from the queue.
 
qtipStatus_t qtip_get_front (qtipContext_t *pContext, void *pItem)
 Gets the item at the front of the queue.
 
qtipStatus_t qtip_get_rear (qtipContext_t *pContext, void *pItem)
 Gets the item at the rear of the queue.
 
qtipStatus_t qtip_is_full (qtipContext_t *pContext)
 Checks whether the queue is full.
 
qtipStatus_t qtip_is_empty (qtipContext_t *pContext)
 Checks whether the queue is empty.
 
qtipStatus_t qtip_count_items (qtipContext_t *pContext, qtipSize_t *pResult)
 Gets the number of items in the queue.
 
qtipStatus_t qtip_get_item_index (qtipContext_t *pContext, qtipSize_t index, void *pItem)
 Gets the item from an intex in the queue.
 
qtipStatus_t qtip_remove_item_index (qtipContext_t *pContext, qtipSize_t index)
 Removes the item from an intex in the queue.
 
qtipStatus_t qtip_get_pop_index (qtipContext_t *pContext, qtipSize_t index, void *pItem)
 Pops the item from an intex in the queue.
 
qtipStatus_t qtip_is_locked (qtipContext_t *pContext)
 Checks whether the queue is locked.
 
qtipStatus_t qtip_lock (qtipContext_t *pContext)
 Locks the queue.
 
qtipStatus_t qtip_unlock (qtipContext_t *pContext)
 Unlocks the queue.
 
qtipStatus_t qtip_total_enqueued_items (qtipContext_t *pContext, size_t *pResult)
 Get number of items inserted in the queue.
 
qtipStatus_t qtip_total_processed_items (qtipContext_t *pContext, size_t *pResult)
 Get number of processed items in the queue.
 

Detailed Description

API for queues.

Author
Jose Amador

Definition in file qtip.h.