29 lines
472 B
C
29 lines
472 B
C
#ifndef data_structures
|
|
|
|
#include <stdlib.h>
|
|
|
|
typedef struct {
|
|
size_t size;
|
|
size_t capacity;
|
|
size_t head;
|
|
size_t tail;
|
|
char* arr;
|
|
}list;
|
|
|
|
void initList(list **l);
|
|
void pushs(list *l, char c);
|
|
char pops(list *l);
|
|
void enqueues(list *l, char c);
|
|
char dequeues(list *l);
|
|
void clears(list *l);
|
|
|
|
//returns copy of contents as string
|
|
char* contents(list *l);
|
|
//returns copy of contents as string. But backwards :)
|
|
char* contentb(list *l);
|
|
|
|
void freelist(list *l);
|
|
|
|
#endif
|
|
|