cleanup: fix up the type of string buffers
[secnet] / conffile_internal.h
CommitLineData
2fe58dfd
SE
1#ifndef conffile_internal_h
2#define conffile_internal_h
3
4#include <stdio.h>
5#include "secnet.h"
6
7extern FILE *yyin;
8
fe5e9cc4 9typedef cstring_t atom_t;
2fe58dfd
SE
10
11/* Parse tree for configuration file */
12
13#define YYSTYPE struct p_node *
14
15#define T_STRING 1
16#define T_NUMBER 2
17#define T_KEY 3
18#define T_ASSIGNMENT 10
19#define T_LISTITEM 11
20#define T_EXEC 12
21#define T_PATHELEM 13
22#define T_ABSPATH 14
23#define T_RELPATH 15
24#define T_DICT 16
25#define T_ALIST 17
26#define T_ERROR 20
27
28struct p_node {
29 uint32_t type;
30 struct cloc loc;
31 union {
32 atom_t key;
33 string_t string;
34 uint32_t number;
35 } data;
36 struct p_node *l;
37 struct p_node *r;
38};
39
40extern int yylex(void);
fe5e9cc4 41extern cstring_t config_file;
2fe58dfd 42extern uint32_t config_lineno;
fe5e9cc4 43extern int yynerrs;
2fe58dfd
SE
44
45/* Keys in dictionaries are 'atoms', which are constructed from strings
46 using this call. Atoms may be compared using '=='. */
fe5e9cc4 47extern atom_t intern(cstring_t string);
2fe58dfd
SE
48
49extern struct p_node *parse_conffile(FILE *conffile);
50
51#endif /* conffile_internal_h */