summaryrefslogtreecommitdiff
path: root/rushs/tinyprintf/evalexpr/src/fifo.h
blob: b330eacc525a1b0e8468fe260aef201b222cdf61 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#ifndef FIFO_H
#define FIFO_H

#include <stddef.h>

#include "evalexpr.h"

struct list
{
    struct token *data;
    struct list *next;
};

struct fifo
{
    struct list *head;
    struct list *tail;
    size_t size;
};

struct fifo *fifo_init(void);
size_t fifo_size(struct fifo *fifo);
void fifo_push(struct fifo *fifo, struct token *elt);
struct token *fifo_head(struct fifo *fifo);
void fifo_pop(struct fifo *fifo);
void fifo_clear(struct fifo *fifo);
void fifo_destroy(struct fifo *fifo);

#endif /* !FIFO_H */