-
Notifications
You must be signed in to change notification settings - Fork 1
/
README
39 lines (29 loc) · 1.18 KB
/
README
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
What?
libucfg is a small configuration library in ANSI C.
Who?
It was written by Torbjörn Lönnemark <[email protected]>.
How?
See example.c for how to use it.
License?
libucfg is released under the ISC License.
Some things that are good to know:
A config file looks something like this:
root: {
child: "child value";
another child: "another child's value";
child node with list: {
"list item1 has some double-quotes:"" and "" such"" ";
"list item2";
}
}
Node names may contain any value except colon (':')
Double-quotes in values are escaped as two doublesquotes ('"' -> '""')
A node in the configuration may have a name (optional), and must have either
a value or a subsection.
Configuration syntax in EBNF:
config-node = [<node-name> , ":"] , <config-node-list> | [<node-name> , ":"] , <node-value> , ";" ;
config-node-list = "{" , { config-node } , "}" ;
node-name = <node-name-character> , { <node-name-character> } ;
node-name-character = ? any visible character except colon ? ;
node-value = '"' , { <node-value-character> } , '"' ;
node-value-character = ? any visible character, with each doublequote character escaped as two doublequotes ? ;