Compare commits
No commits in common. "2e360733166434de3154ddaf9e1850d6af9d8b64" and "ea76226760e60eb86fc7251caceee43c049303d5" have entirely different histories.
2e36073316
...
ea76226760
|
@ -110,8 +110,4 @@ config.h
|
||||||
config.h.in
|
config.h.in
|
||||||
stamp-h1
|
stamp-h1
|
||||||
|
|
||||||
build/
|
build/
|
||||||
|
|
||||||
# Tests:
|
|
||||||
*.log
|
|
||||||
*_test*
|
|
|
@ -1,54 +0,0 @@
|
||||||
// =========================================
|
|
||||||
// | SilverMUD Server - queues.h |
|
|
||||||
// | Copyright (C) 2023, Barra Ó Catháin |
|
|
||||||
// | See end of file for copyright notice. |
|
|
||||||
// =========================================
|
|
||||||
#ifndef QUEUES_H
|
|
||||||
#define QUEUES_H
|
|
||||||
#include "data-type.h"
|
|
||||||
#include <stdbool.h>
|
|
||||||
|
|
||||||
struct Queue
|
|
||||||
{
|
|
||||||
size_t itemCount;
|
|
||||||
enum DataType type;
|
|
||||||
struct ListNode * front;
|
|
||||||
struct ListNode * back;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct QueueNode
|
|
||||||
{
|
|
||||||
struct ListNode * next;
|
|
||||||
void * data;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// Functions:
|
|
||||||
// ==========
|
|
||||||
|
|
||||||
struct Queue * createQueue(enum DataType type);
|
|
||||||
int destroyQueue(struct Queue * queue);
|
|
||||||
int destroyQueueAndContents(void (*deallocationFunction)(void *), struct Queue * queue);
|
|
||||||
|
|
||||||
void * peekFromQueue(struct Queue * queue);
|
|
||||||
size_t popFromQueue(struct Queue * queue);
|
|
||||||
size_t pushToQueue(enum DataType type, void * data, struct Queue * queue);
|
|
||||||
size_t popFromQueueAndDestroy(void (*deallocationFunction)(void *), struct Queue * queue);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
// ==============================================
|
|
||||||
// | End of queues.h, copyright notice follows. |
|
|
||||||
// ==============================================
|
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
|
||||||
// it under the terms of the GNU Affero General Public License as published by
|
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
|
||||||
// (at your option) any later version.
|
|
||||||
|
|
||||||
// This program is distributed in the hope that it will be useful,
|
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
// GNU Affero General Public License for more details.
|
|
||||||
|
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
Loading…
Reference in New Issue