aboutsummaryrefslogtreecommitdiffstats
path: root/src/tok.h
blob: 5653f85b6713657911589abeb243aa80663b6fe1 (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
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef CONFCONF_TOK_H
#define CONFCONF_TOK_H

#include <stdio.h>

#define TOK_MAX_LEN 128

enum tok_type_e {
	TOK_LBRACE,
	TOK_RBRACE,
	TOK_EQUAL,
	TOK_COMMA,
	TOK_BANG,
	TOK_QMARK,
	TOK_ASTERISK,
	TOK_OP_STRUCT,
	TOK_OP_UNION,
	TOK_OP_ENUM,
	TOK_OP_NAMING_SUFFIX,
	TOK_OP_UTHASH_HEADER,
	TOK_UINT,
	TOK_ID,
	TOK_HEADER,
	TOK_UNKNWN,
	TOK_END,
	TOK_LONG,
};

struct tok_s {
	enum tok_type_e type;
	size_t line;
	size_t col;
	char *val;
};

void tok_reset(FILE *f);

struct tok_s tok_get(void);
void tok_unget(struct tok_s t);

#endif