Skip to content

Commit 8adaa39

Browse files
committed
update clang queue
1 parent f8da685 commit 8adaa39

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

c/queue/queue.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#include <stdlib.h>
2+
#include <string.h>
3+
#include <assert.h>
4+
#include <stdbool.h>
5+
#include "queue.h"
6+
7+
#define DEFAULT_QUEUE_SIZE 4
8+
9+
Queue *queueCreate() {
10+
Queue *q = malloc(sizeof(Queue));
11+
assert(q);
12+
q->theSize = 0;
13+
q->capacity = 0;
14+
q->dataStore
15+
16+
}
17+
18+

c/queue/queue.h

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#ifndef __QUEUE_H__
2+
#define __QUEUE_H__
3+
4+
typedef struct Queue {
5+
int theSize;
6+
int capacity;
7+
void **dataStore;
8+
9+
void (*enqueue)();
10+
void *(*dequeue)();
11+
int (*size)();
12+
bool (*isEmpty)();
13+
void *(font)();
14+
void *(end)();
15+
void (clear)();
16+
} Queue;
17+
18+
/* Prototypes */
19+
Queue *queueCreate();
20+
void queueEnqueue(Queue *, void *);
21+
void *queueDequeue(Queue *);
22+
int queueSize(Queue *);
23+
bool queueIsEmpty(Queue *);
24+
void *queueFont(Queue *);
25+
void *queueEnd(Queue *);
26+
void queueClear(Queue *);
27+
28+
#endif __QUEUE_H__

0 commit comments

Comments
 (0)