xref: /aosp_15_r20/external/libconfig/docs/test.cfg.txt (revision 2e9d491483b805f09ea864149eadd5680efcc72a)
1#----------------------------
2# Example Configuration File
3#---------------------------
4#
5
6application:
7{
8
9 /* This section defines some settings for our
10  * main application window, such as size and
11  * position.
12  */
13
14  window:
15  {
16    title = "My Application";
17    size = { /* width */ w = 640; /* height */ h = 480; };
18    pos = { x = 350; y = 250; };
19  };
20
21  a = 5;
22  b = 6;
23  ff = 1E6;
24  test-comment = "/* hello\n \"there\"*/";
25
26  test-long-string = "A very long string that spans multiple lines. "
27  /* but wait, there's more... */ "Adjacent strings are automatically"
28  " concatenated.";
29
30  test-escaped-string = "\"This is\n a test.\"";
31
32  group1:
33  {
34    x = 5;  y = 10;
35    my_array = [ 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22 ];
36    flag = TRUE;
37
38    group2: { zzz = "this is a test"; };
39
40    states = [	"CT", // Connecticut
41		"CA", // California
42		"TX", // Texas
43		"NV", // Nevada
44		"FL"  // Florida
45    ];
46  };
47
48  /* this would cause an error */
49  // a = "hi!";
50};
51
52binary = [ 0xAA, 0xBB, 0xCC ];
53
54list = ( ( "abc", 123, true ), 1.234, ( /* an empty list */ ) ,[ 1, 2, 3 ],
55	   { a = (1, 2, true); } );
56
57books = ( "inventory",
58          { title  = "Treasure Island";
59            author = "Robert Louis Stevenson";
60            price  = 29.99;
61            qty    = 5; },
62          { title  = "Snow Crash";
63            author = "Neal Stephenson";
64            price  = 9.99;
65            qty    = 8; },
66          { } );
67
68# miscellaneous stuff
69
70misc:
71{
72  pi = 3.141592653589793238;
73  bitmask = 0xAABBCCDD;
74  bigint = 9223372036854775807L;
75  unicode = "STARGΛ̊TE SG-1"; // UTF-8 string
76};
77
78### eof
79