summaryrefslogtreecommitdiff
path: root/src/config/tipidee-config-internal.h
blob: 7ffee8a1985fd499d546901fea0a3ec74a56531a (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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/* ISC license. */

#ifndef TIPIDEE_CONFIG_INTERNAL_H
#define TIPIDEE_CONFIG_INTERNAL_H

#include <stdint.h>
#include <string.h>

#include <skalibs/buffer.h>
#include <skalibs/stralloc.h>
#include <skalibs/cdbmake.h>

#define dienomem() strerr_diefu1sys(111, "stralloc_catb")

typedef struct confnode_s confnode, *confnode_ref ;
struct confnode_s
{
  uint32_t key ;
  uint32_t keylen ;
  uint32_t data ;
  uint32_t datalen ;
  uint32_t filepos ;
  uint32_t line ;
} ;
#define CONFNODE_ZERO { .key = 0, .keylen = 0, .data = 0, .datalen = 0 }

struct global_s
{
  stralloc storage ;
} ;
#define GLOBAL_ZERO { .storage = STRALLOC_ZERO }

extern struct global_s g ;


 /* confnode */

extern void confnode_start (confnode *, char const *, size_t, uint32_t) ;
extern void confnode_add (confnode *, char const *, size_t) ;


 /* conftree */

extern confnode const *conftree_search (char const *) ;
extern void conftree_add (confnode const *) ;
extern void conftree_update (confnode const *) ;
extern int conftree_write (cdbmaker *) ;


 /* lexparse */

extern void conf_lexparse (buffer *, char const *) ;


 /* defaults */

extern void conf_defaults (void) ;

#endif