2015-02-26 09:02:31 -06:00
|
|
|
/***************** queue functions ***************/
|
|
|
|
|
2015-03-23 16:03:14 -05:00
|
|
|
#ifndef LQUEUE_H
|
|
|
|
#define LQUEUE_H
|
2015-02-26 09:02:31 -06:00
|
|
|
|
|
|
|
|
|
|
|
#include "dllist.h"
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
typedef struct _LQUEUE
|
|
|
|
{
|
|
|
|
DLLIST list; /* implementing queue using a linked-list */
|
|
|
|
}LQUEUE;
|
|
|
|
|
|
|
|
|
|
|
|
LQUEUE* LQ_Create(void); /* create and initialize a LQUEUE */
|
|
|
|
|
|
|
|
|
|
|
|
void LQ_Init(LQUEUE*); /* initialize a LQUEUE */
|
|
|
|
|
|
|
|
|
|
|
|
void LQ_EnQ(void* pData,LQUEUE* pQueue); /* insert data into queue */
|
|
|
|
|
|
|
|
|
|
|
|
void* LQ_DeQ(LQUEUE* pQueue); /* extract data from queue */
|
|
|
|
|
|
|
|
|
|
|
|
void* LQ_Peek(LQUEUE* pQueue); /* get data off queue without extracting */
|
|
|
|
|
|
|
|
|
|
|
|
int LQ_GetCount(LQUEUE* pQueue); /* returns number of items in the queue */
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|