/*************************************************************************/ /* Copyright (C) 2015 Wizardry and Steamworks - License: GNU GPLv3 */ /*************************************************************************/ /* */ /* stringQueue */ /* */ /* An implementation of a queue of strings. */ /* Implemented functions: */ /* - create */ /* - clear */ /* - is empty */ /* - count */ /* - enqueue */ /* - dequeue */ /* - print */ /* */ /*************************************************************************/ /* The unitQueue structure with front being the index of the front-mode * element and rear being the index of the last element in the queue */ typedef struct { int size; char **store; int front, rear; } stringQueue; extern stringQueue* stringQueueCreate(int length); extern stringQueue* stringQueueclear(stringQueue *q); extern int stringQueueIsEmpty(stringQueue *q); extern int stringQueueCount(stringQueue *q); extern void stringQueueEnqueue(stringQueue *q, char *e); extern char *stringQueueDequeue(stringQueue *q); extern void stringQueuePrint(stringQueue *q);