/*
 * =====================================================================================
 *
 *       Filename:  circularQueue.h
 *
 *    Description:  Implement functions of circular queue.
 *
 *        Version:  1.0
 *        Created:  08/25/2016 09:32:32 PM
 *       Compiler:  armcc
 *
 *         Author:  Dongwook Shim (), dw.shim@samsung.com
 *        Company:  Samsung Electronics
 *
 *        Copyright (c) 2016 by Samsung Electronics, All rights reserved. 
 *
 * =====================================================================================
 */

#ifndef __CIRCULAR_QUEUE_H__
#define __CIRCULAR_QUEUE_H__

#include <stdio.h>
#include <stdbool.h>
#include <stdint.h>
#include <string.h>

#define QUEUE_MAX_NUM			256
#define QUEUE_MAX_SIZE			256

/**
 * Function : isQueueEmpty()
 * Description : Check whether queue is empty.
 * Parameters : None.
 * Return : Return true if queue is empty, or return false.
 */
bool isQueueEmpty(void);

/**
 * Function : isQueueFull()
 * Description : Check whether queue is full.
 * Parameters : None.
 * Return : Return true if queue is empty, or return false.
 */
bool isQueueFull(void);

/**
 * Function : getQueueSize()
 * Description : Get length of total letters at queue. 
 * Parameters : None.
 * Return : Total length of letters.
 */
int getQueueSize(void);

/**
 * Function : enqueueData()
 * Description : Enqueue sentence to queue.
 * Parameters : @ data - Pointer to sentence.
 *              @ dataLen - Length of sentence.
 * Return : Return enqueued length, or return zero.
 */
int enqueueData(char *data, uint32_t dataLen);

/**
 * Function : checkPkcs8File()
 * Description : Check whether file is encoded PKCS#8 format.
 * Parameters : @ data - Pointer to input.
 *              @ dataLen - Length of data.
 * Return : Return dequeued length, or return zero.
 */
int dequeueData(char *data, uint32_t dataLen);
#endif	// End of __CIRCULAR_QUEUE_H__
