annotate src/tokenizer.cpp @ 318:e2dc882839f6 stable-6-0-47

better smtp verify logging
author Carl Byington <carl@five-ten-sg.com>
date Thu, 22 Sep 2016 08:43:02 -0700
parents 82886d4dd71f
children f5b394bec28c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
72
e6a2d0be7c5e start coding on new config syntax
carl
parents: 71
diff changeset
1 /*
e6a2d0be7c5e start coding on new config syntax
carl
parents: 71
diff changeset
2
152
c7fc218686f5 gpl3, block mail to recipients that cannot reply
carl
parents: 143
diff changeset
3 Copyright (c) 2007 Carl Byington - 510 Software Group, released under
c7fc218686f5 gpl3, block mail to recipients that cannot reply
carl
parents: 143
diff changeset
4 the GPL version 3 or any later version at your choice available at
c7fc218686f5 gpl3, block mail to recipients that cannot reply
carl
parents: 143
diff changeset
5 http://www.gnu.org/licenses/gpl-3.0.txt
72
e6a2d0be7c5e start coding on new config syntax
carl
parents: 71
diff changeset
6
e6a2d0be7c5e start coding on new config syntax
carl
parents: 71
diff changeset
7 */
e6a2d0be7c5e start coding on new config syntax
carl
parents: 71
diff changeset
8
98
91c27c00048f tokenizer errors now go thru syslog to be visible during config file reloads in normal operation
carl
parents: 75
diff changeset
9 #include "includes.h"
71
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
10
214
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
11 const int maxlen = 1000; // used for snprintf buffers
71
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
12
98
91c27c00048f tokenizer errors now go thru syslog to be visible during config file reloads in normal operation
carl
parents: 75
diff changeset
13 enum state {s_init,
214
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
14 s_token,
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
15 s_string,
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
16 s_ignore, // whitespace
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
17 s_eol, // ignore to eol
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
18 end_state,
98
91c27c00048f tokenizer errors now go thru syslog to be visible during config file reloads in normal operation
carl
parents: 75
diff changeset
19
214
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
20 s_term, // token terminator
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
21 s_single,
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
22 s_string1, // first " of string
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
23 s_string2, // last " of string
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
24 s_slash // possible start of ignore to eol
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
25 };
71
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
26
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
27 typedef state PARSE[end_state];
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
28
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
29 static PARSE parse_table[256] = {
214
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
30 // s_init s_token s_string s_ignore s_eol
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
31 { s_single, s_term, s_string, s_single, s_eol, }, // 0x00
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
32 { s_single, s_term, s_string, s_single, s_eol, }, // 0x01
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
33 { s_single, s_term, s_string, s_single, s_eol, }, // 0x02
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
34 { s_single, s_term, s_string, s_single, s_eol, }, // 0x03
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
35 { s_single, s_term, s_string, s_single, s_eol, }, // 0x04
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
36 { s_single, s_term, s_string, s_single, s_eol, }, // 0x05
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
37 { s_single, s_term, s_string, s_single, s_eol, }, // 0x06
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
38 { s_single, s_term, s_string, s_single, s_eol, }, // 0x07
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
39 { s_single, s_term, s_string, s_single, s_eol, }, // 0x08
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
40 { s_ignore, s_term, s_string, s_ignore, s_eol, }, // 0x09 <tab>
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
41 { s_ignore, s_term, s_string2, s_ignore, s_ignore, }, // 0x0a <lf>
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
42 { s_single, s_term, s_string, s_single, s_eol, }, // 0x0b
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
43 { s_single, s_term, s_string, s_single, s_eol, }, // 0x0c
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
44 { s_ignore, s_term, s_string2, s_ignore, s_eol, }, // 0x0d <cr>
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
45 { s_single, s_term, s_string, s_single, s_eol, }, // 0x0e
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
46 { s_single, s_term, s_string, s_single, s_eol, }, // 0x0f
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
47 { s_single, s_term, s_string, s_single, s_eol, }, // 0x10
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
48 { s_single, s_term, s_string, s_single, s_eol, }, // 0x11 xon char
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
49 { s_single, s_term, s_string, s_single, s_eol, }, // 0x12
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
50 { s_single, s_term, s_string, s_single, s_eol, }, // 0x13 xoff char
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
51 { s_single, s_term, s_string, s_single, s_eol, }, // 0x14
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
52 { s_single, s_term, s_string, s_single, s_eol, }, // 0x15
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
53 { s_single, s_term, s_string, s_single, s_eol, }, // 0x16
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
54 { s_single, s_term, s_string, s_single, s_eol, }, // 0x17
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
55 { s_single, s_term, s_string, s_single, s_eol, }, // 0x18
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
56 { s_single, s_term, s_string, s_single, s_eol, }, // 0x19
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
57 { s_single, s_term, s_string, s_single, s_eol, }, // 0x1a
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
58 { s_single, s_term, s_string, s_single, s_eol, }, // 0x1b
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
59 { s_single, s_term, s_string, s_single, s_eol, }, // 0x1c
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
60 { s_single, s_term, s_string, s_single, s_eol, }, // 0x1d
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
61 { s_single, s_term, s_string, s_single, s_eol, }, // 0x1e
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
62 { s_single, s_term, s_string, s_single, s_eol, }, // 0x1f
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
63 { s_ignore, s_term, s_string, s_ignore, s_eol, }, // 0x20 space
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
64 { s_single, s_term, s_string, s_single, s_eol, }, // 0x21 !
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
65 { s_string1, s_term, s_string2, s_string1, s_eol, }, // 0x22 "
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
66 { s_eol, s_term, s_string, s_eol, s_eol, }, // 0x23 #
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
67 { s_single, s_term, s_string, s_single, s_eol, }, // 0x24 $
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
68 { s_single, s_term, s_string, s_single, s_eol, }, // 0x25 %
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
69 { s_single, s_term, s_string, s_single, s_eol, }, // 0x26 &
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
70 { s_single, s_term, s_string, s_single, s_eol, }, // 0x27 '
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
71 { s_single, s_term, s_string, s_single, s_eol, }, // 0x28 (
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
72 { s_single, s_term, s_string, s_single, s_eol, }, // 0x29 )
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
73 { s_single, s_term, s_string, s_single, s_eol, }, // 0x2A *
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
74 { s_single, s_token, s_string, s_single, s_eol, }, // 0x2B +
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
75 { s_single, s_term, s_string, s_single, s_eol, }, // 0x2C ,
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
76 { s_single, s_token, s_string, s_single, s_eol, }, // 0x2D -
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
77 { s_single, s_token, s_string, s_single, s_eol, }, // 0x2E .
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
78 { s_slash, s_token, s_string, s_slash, s_eol, }, // 0x2F /
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
79 { s_token, s_token, s_string, s_token, s_eol, }, // 0x30 0
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
80 { s_token, s_token, s_string, s_token, s_eol, }, // 0x31 1
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
81 { s_token, s_token, s_string, s_token, s_eol, }, // 0x32 2
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
82 { s_token, s_token, s_string, s_token, s_eol, }, // 0x33 3
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
83 { s_token, s_token, s_string, s_token, s_eol, }, // 0x34 4
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
84 { s_token, s_token, s_string, s_token, s_eol, }, // 0x35 5
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
85 { s_token, s_token, s_string, s_token, s_eol, }, // 0x36 6
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
86 { s_token, s_token, s_string, s_token, s_eol, }, // 0x37 7
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
87 { s_token, s_token, s_string, s_token, s_eol, }, // 0x38 8
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
88 { s_token, s_token, s_string, s_token, s_eol, }, // 0x39 9
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
89 { s_single, s_term, s_string, s_single, s_eol, }, // 0x3A :
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
90 { s_single, s_term, s_string, s_single, s_eol, }, // 0x3B ;
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
91 { s_single, s_term, s_string, s_single, s_eol, }, // 0x3C <
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
92 { s_single, s_token, s_string, s_single, s_eol, }, // 0x3D =
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
93 { s_single, s_term, s_string, s_single, s_eol, }, // 0x3E >
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
94 { s_single, s_term, s_string, s_single, s_eol, }, // 0x3F ?
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
95 { s_single, s_token, s_string, s_single, s_eol, }, // 0x40 @
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
96 { s_token, s_token, s_string, s_token, s_eol, }, // 0x41 A
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
97 { s_token, s_token, s_string, s_token, s_eol, }, // 0x42 B
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
98 { s_token, s_token, s_string, s_token, s_eol, }, // 0x43 C
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
99 { s_token, s_token, s_string, s_token, s_eol, }, // 0x44 D
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
100 { s_token, s_token, s_string, s_token, s_eol, }, // 0x45 E
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
101 { s_token, s_token, s_string, s_token, s_eol, }, // 0x46 F
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
102 { s_token, s_token, s_string, s_token, s_eol, }, // 0x47 G
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
103 { s_token, s_token, s_string, s_token, s_eol, }, // 0x48 H
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
104 { s_token, s_token, s_string, s_token, s_eol, }, // 0x49 I
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
105 { s_token, s_token, s_string, s_token, s_eol, }, // 0x4A J
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
106 { s_token, s_token, s_string, s_token, s_eol, }, // 0x4B K
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
107 { s_token, s_token, s_string, s_token, s_eol, }, // 0x4C L
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
108 { s_token, s_token, s_string, s_token, s_eol, }, // 0x4D M
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
109 { s_token, s_token, s_string, s_token, s_eol, }, // 0x4E N
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
110 { s_token, s_token, s_string, s_token, s_eol, }, // 0x4F O
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
111 { s_token, s_token, s_string, s_token, s_eol, }, // 0x50 P
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
112 { s_token, s_token, s_string, s_token, s_eol, }, // 0x51 Q
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
113 { s_token, s_token, s_string, s_token, s_eol, }, // 0x52 R
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
114 { s_token, s_token, s_string, s_token, s_eol, }, // 0x53 S
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
115 { s_token, s_token, s_string, s_token, s_eol, }, // 0x54 T
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
116 { s_token, s_token, s_string, s_token, s_eol, }, // 0x55 U
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
117 { s_token, s_token, s_string, s_token, s_eol, }, // 0x56 V
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
118 { s_token, s_token, s_string, s_token, s_eol, }, // 0x57 W
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
119 { s_token, s_token, s_string, s_token, s_eol, }, // 0x58 X
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
120 { s_token, s_token, s_string, s_token, s_eol, }, // 0x59 Y
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
121 { s_token, s_token, s_string, s_token, s_eol, }, // 0x5A Z
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
122 { s_single, s_term, s_string, s_single, s_eol, }, // 0x5B [
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
123 { s_single, s_term, s_string, s_single, s_eol, }, // 0x5C backslash
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
124 { s_single, s_term, s_string, s_single, s_eol, }, // 0x5D ]
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
125 { s_single, s_term, s_string, s_single, s_eol, }, // 0x5E ^
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
126 { s_single, s_token, s_string, s_single, s_eol, }, // 0x5F _
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
127 { s_single, s_term, s_string, s_single, s_eol, }, // 0x60 `
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
128 { s_token, s_token, s_string, s_token, s_eol, }, // 0x61 a
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
129 { s_token, s_token, s_string, s_token, s_eol, }, // 0x62 b
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
130 { s_token, s_token, s_string, s_token, s_eol, }, // 0x63 c
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
131 { s_token, s_token, s_string, s_token, s_eol, }, // 0x64 d
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
132 { s_token, s_token, s_string, s_token, s_eol, }, // 0x65 e
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
133 { s_token, s_token, s_string, s_token, s_eol, }, // 0x66 f
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
134 { s_token, s_token, s_string, s_token, s_eol, }, // 0x67 g
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
135 { s_token, s_token, s_string, s_token, s_eol, }, // 0x68 h
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
136 { s_token, s_token, s_string, s_token, s_eol, }, // 0x69 i
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
137 { s_token, s_token, s_string, s_token, s_eol, }, // 0x6A j
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
138 { s_token, s_token, s_string, s_token, s_eol, }, // 0x6B k
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
139 { s_token, s_token, s_string, s_token, s_eol, }, // 0x6C l
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
140 { s_token, s_token, s_string, s_token, s_eol, }, // 0x6D m
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
141 { s_token, s_token, s_string, s_token, s_eol, }, // 0x6E n
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
142 { s_token, s_token, s_string, s_token, s_eol, }, // 0x6F o
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
143 { s_token, s_token, s_string, s_token, s_eol, }, // 0x70 p
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
144 { s_token, s_token, s_string, s_token, s_eol, }, // 0x71 q
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
145 { s_token, s_token, s_string, s_token, s_eol, }, // 0x72 r
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
146 { s_token, s_token, s_string, s_token, s_eol, }, // 0x73 s
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
147 { s_token, s_token, s_string, s_token, s_eol, }, // 0x74 t
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
148 { s_token, s_token, s_string, s_token, s_eol, }, // 0x75 u
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
149 { s_token, s_token, s_string, s_token, s_eol, }, // 0x76 v
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
150 { s_token, s_token, s_string, s_token, s_eol, }, // 0x77 w
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
151 { s_token, s_token, s_string, s_token, s_eol, }, // 0x78 x
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
152 { s_token, s_token, s_string, s_token, s_eol, }, // 0x79 y
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
153 { s_token, s_token, s_string, s_token, s_eol, }, // 0x7A z
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
154 { s_single, s_term, s_string, s_single, s_eol, }, // 0x7B {
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
155 { s_single, s_term, s_string, s_single, s_eol, }, // 0x7C |
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
156 { s_single, s_term, s_string, s_single, s_eol, }, // 0x7D }
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
157 { s_single, s_term, s_string, s_single, s_eol, }, // 0x7E ~
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
158 { s_single, s_term, s_string, s_single, s_eol, }, // 0x7f
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
159 { s_single, s_term, s_string, s_single, s_eol, }, // 0x80
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
160 { s_single, s_term, s_string, s_single, s_eol, }, // 0x81
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
161 { s_single, s_term, s_string, s_single, s_eol, }, // 0x82
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
162 { s_single, s_term, s_string, s_single, s_eol, }, // 0x83
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
163 { s_single, s_term, s_string, s_single, s_eol, }, // 0x84
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
164 { s_single, s_term, s_string, s_single, s_eol, }, // 0x85
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
165 { s_single, s_term, s_string, s_single, s_eol, }, // 0x86
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
166 { s_single, s_term, s_string, s_single, s_eol, }, // 0x87
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
167 { s_single, s_term, s_string, s_single, s_eol, }, // 0x88
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
168 { s_single, s_term, s_string, s_single, s_eol, }, // 0x89
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
169 { s_single, s_term, s_string, s_single, s_eol, }, // 0x8a
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
170 { s_single, s_term, s_string, s_single, s_eol, }, // 0x8b
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
171 { s_single, s_term, s_string, s_single, s_eol, }, // 0x8c
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
172 { s_single, s_term, s_string, s_single, s_eol, }, // 0x8d
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
173 { s_single, s_term, s_string, s_single, s_eol, }, // 0x8e
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
174 { s_single, s_term, s_string, s_single, s_eol, }, // 0x8f
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
175 { s_single, s_term, s_string, s_single, s_eol, }, // 0x90
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
176 { s_single, s_term, s_string, s_single, s_eol, }, // 0x91
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
177 { s_single, s_term, s_string, s_single, s_eol, }, // 0x92
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
178 { s_single, s_term, s_string, s_single, s_eol, }, // 0x93
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
179 { s_single, s_term, s_string, s_single, s_eol, }, // 0x94
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
180 { s_single, s_term, s_string, s_single, s_eol, }, // 0x95
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
181 { s_single, s_term, s_string, s_single, s_eol, }, // 0x96
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
182 { s_single, s_term, s_string, s_single, s_eol, }, // 0x97
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
183 { s_single, s_term, s_string, s_single, s_eol, }, // 0x98
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
184 { s_single, s_term, s_string, s_single, s_eol, }, // 0x99
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
185 { s_single, s_term, s_string, s_single, s_eol, }, // 0x9a
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
186 { s_single, s_term, s_string, s_single, s_eol, }, // 0x9b
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
187 { s_single, s_term, s_string, s_single, s_eol, }, // 0x9c
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
188 { s_single, s_term, s_string, s_single, s_eol, }, // 0x9d
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
189 { s_single, s_term, s_string, s_single, s_eol, }, // 0x9e
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
190 { s_single, s_term, s_string, s_single, s_eol, }, // 0x9f
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
191 { s_single, s_term, s_string, s_single, s_eol, }, // 0xa0
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
192 { s_single, s_term, s_string, s_single, s_eol, }, // 0xa1
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
193 { s_single, s_term, s_string, s_single, s_eol, }, // 0xa2
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
194 { s_single, s_term, s_string, s_single, s_eol, }, // 0xa3
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
195 { s_single, s_term, s_string, s_single, s_eol, }, // 0xa4
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
196 { s_single, s_term, s_string, s_single, s_eol, }, // 0xa5
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
197 { s_single, s_term, s_string, s_single, s_eol, }, // 0xa6
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
198 { s_single, s_term, s_string, s_single, s_eol, }, // 0xa7
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
199 { s_single, s_term, s_string, s_single, s_eol, }, // 0xa8
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
200 { s_single, s_term, s_string, s_single, s_eol, }, // 0xa9
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
201 { s_single, s_term, s_string, s_single, s_eol, }, // 0xaa
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
202 { s_single, s_term, s_string, s_single, s_eol, }, // 0xab
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
203 { s_single, s_term, s_string, s_single, s_eol, }, // 0xac
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
204 { s_single, s_term, s_string, s_single, s_eol, }, // 0xad
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
205 { s_single, s_term, s_string, s_single, s_eol, }, // 0xae
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
206 { s_single, s_term, s_string, s_single, s_eol, }, // 0xaf
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
207 { s_single, s_term, s_string, s_single, s_eol, }, // 0xb0
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
208 { s_single, s_term, s_string, s_single, s_eol, }, // 0xb1
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
209 { s_single, s_term, s_string, s_single, s_eol, }, // 0xb2
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
210 { s_single, s_term, s_string, s_single, s_eol, }, // 0xb3
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
211 { s_single, s_term, s_string, s_single, s_eol, }, // 0xb4
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
212 { s_single, s_term, s_string, s_single, s_eol, }, // 0xb5
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
213 { s_single, s_term, s_string, s_single, s_eol, }, // 0xb6
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
214 { s_single, s_term, s_string, s_single, s_eol, }, // 0xb7
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
215 { s_single, s_term, s_string, s_single, s_eol, }, // 0xb8
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
216 { s_single, s_term, s_string, s_single, s_eol, }, // 0xb9
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
217 { s_single, s_term, s_string, s_single, s_eol, }, // 0xba
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
218 { s_single, s_term, s_string, s_single, s_eol, }, // 0xbb
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
219 { s_single, s_term, s_string, s_single, s_eol, }, // 0xbc
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
220 { s_single, s_term, s_string, s_single, s_eol, }, // 0xbd
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
221 { s_single, s_term, s_string, s_single, s_eol, }, // 0xbe
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
222 { s_single, s_term, s_string, s_single, s_eol, }, // 0xbf
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
223 { s_single, s_term, s_string, s_single, s_eol, }, // 0xc0
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
224 { s_single, s_term, s_string, s_single, s_eol, }, // 0xc1
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
225 { s_single, s_term, s_string, s_single, s_eol, }, // 0xc2
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
226 { s_single, s_term, s_string, s_single, s_eol, }, // 0xc3
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
227 { s_single, s_term, s_string, s_single, s_eol, }, // 0xc4
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
228 { s_single, s_term, s_string, s_single, s_eol, }, // 0xc5
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
229 { s_single, s_term, s_string, s_single, s_eol, }, // 0xc6
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
230 { s_single, s_term, s_string, s_single, s_eol, }, // 0xc7
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
231 { s_single, s_term, s_string, s_single, s_eol, }, // 0xc8
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
232 { s_single, s_term, s_string, s_single, s_eol, }, // 0xc9
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
233 { s_single, s_term, s_string, s_single, s_eol, }, // 0xca
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
234 { s_single, s_term, s_string, s_single, s_eol, }, // 0xcb
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
235 { s_single, s_term, s_string, s_single, s_eol, }, // 0xcc
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
236 { s_single, s_term, s_string, s_single, s_eol, }, // 0xcd
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
237 { s_single, s_term, s_string, s_single, s_eol, }, // 0xce
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
238 { s_single, s_term, s_string, s_single, s_eol, }, // 0xcf
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
239 { s_single, s_term, s_string, s_single, s_eol, }, // 0xd0
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
240 { s_single, s_term, s_string, s_single, s_eol, }, // 0xd1
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
241 { s_single, s_term, s_string, s_single, s_eol, }, // 0xd2
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
242 { s_single, s_term, s_string, s_single, s_eol, }, // 0xd3
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
243 { s_single, s_term, s_string, s_single, s_eol, }, // 0xd4
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
244 { s_single, s_term, s_string, s_single, s_eol, }, // 0xd5
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
245 { s_single, s_term, s_string, s_single, s_eol, }, // 0xd6
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
246 { s_single, s_term, s_string, s_single, s_eol, }, // 0xd7
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
247 { s_single, s_term, s_string, s_single, s_eol, }, // 0xd8
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
248 { s_single, s_term, s_string, s_single, s_eol, }, // 0xd9
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
249 { s_single, s_term, s_string, s_single, s_eol, }, // 0xda
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
250 { s_single, s_term, s_string, s_single, s_eol, }, // 0xdb
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
251 { s_single, s_term, s_string, s_single, s_eol, }, // 0xdc
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
252 { s_single, s_term, s_string, s_single, s_eol, }, // 0xdd
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
253 { s_single, s_term, s_string, s_single, s_eol, }, // 0xde
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
254 { s_single, s_term, s_string, s_single, s_eol, }, // 0xdf
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
255 { s_single, s_term, s_string, s_single, s_eol, }, // 0xe0
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
256 { s_single, s_term, s_string, s_single, s_eol, }, // 0xe1
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
257 { s_single, s_term, s_string, s_single, s_eol, }, // 0xe2
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
258 { s_single, s_term, s_string, s_single, s_eol, }, // 0xe3
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
259 { s_single, s_term, s_string, s_single, s_eol, }, // 0xe4
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
260 { s_single, s_term, s_string, s_single, s_eol, }, // 0xe5
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
261 { s_single, s_term, s_string, s_single, s_eol, }, // 0xe6
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
262 { s_single, s_term, s_string, s_single, s_eol, }, // 0xe7
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
263 { s_single, s_term, s_string, s_single, s_eol, }, // 0xe8
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
264 { s_single, s_term, s_string, s_single, s_eol, }, // 0xe9
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
265 { s_single, s_term, s_string, s_single, s_eol, }, // 0xea
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
266 { s_single, s_term, s_string, s_single, s_eol, }, // 0xeb
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
267 { s_single, s_term, s_string, s_single, s_eol, }, // 0xec
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
268 { s_single, s_term, s_string, s_single, s_eol, }, // 0xed
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
269 { s_single, s_term, s_string, s_single, s_eol, }, // 0xee
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
270 { s_single, s_term, s_string, s_single, s_eol, }, // 0xef
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
271 { s_single, s_term, s_string, s_single, s_eol, }, // 0xf0
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
272 { s_single, s_term, s_string, s_single, s_eol, }, // 0xf1
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
273 { s_single, s_term, s_string, s_single, s_eol, }, // 0xf2
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
274 { s_single, s_term, s_string, s_single, s_eol, }, // 0xf3
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
275 { s_single, s_term, s_string, s_single, s_eol, }, // 0xf4
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
276 { s_single, s_term, s_string, s_single, s_eol, }, // 0xf5
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
277 { s_single, s_term, s_string, s_single, s_eol, }, // 0xf6
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
278 { s_single, s_term, s_string, s_single, s_eol, }, // 0xf7
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
279 { s_single, s_term, s_string, s_single, s_eol, }, // 0xf8
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
280 { s_single, s_term, s_string, s_single, s_eol, }, // 0xf9
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
281 { s_single, s_term, s_string, s_single, s_eol, }, // 0xfa
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
282 { s_single, s_term, s_string, s_single, s_eol, }, // 0xfb
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
283 { s_single, s_term, s_string, s_single, s_eol, }, // 0xfc
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
284 { s_single, s_term, s_string, s_single, s_eol, }, // 0xfd
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
285 { s_single, s_term, s_string, s_single, s_eol, }, // 0xfe
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
286 { s_single, s_term, s_string, s_single, s_eol, }, // 0xff
71
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
287 };
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
288
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
289
214
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
290 TOKEN::TOKEN(const char *fn, string_set *includes) {
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
291 pushed = false;
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
292 include_files = includes;
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
293 include(fn);
71
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
294 }
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
295
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
296
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
297 TOKEN::~TOKEN() {
214
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
298 while (!streams.empty()) pop();
71
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
299 }
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
300
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
301
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
302 void TOKEN::pop() {
214
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
303 ifstream *is = streams.front();
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
304 const char *fn = filenames.front();
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
305 streams.pop_front();
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
306 filenamess.erase(fn);
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
307 if (filenames.size() > 1) filenames.pop_front();
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
308 if (linenumbers.size() > 1) linenumbers.pop_front();
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
309 is->close();
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
310 delete is;
71
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
311 }
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
312
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
313
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
314 void TOKEN::push_char(u_char c) {
214
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
315 pushed = true;
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
316 pushed_char = c;
71
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
317 }
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
318
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
319
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
320 bool TOKEN::next_char(u_char &uc) {
214
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
321 if (pushed) {
98
91c27c00048f tokenizer errors now go thru syslog to be visible during config file reloads in normal operation
carl
parents: 75
diff changeset
322 uc = (u_char)tolower((char)pushed_char);
214
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
323 pushed = false;
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
324 return true;
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
325 }
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
326 while (!streams.empty() && streams.front()->eof()) {
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
327 pop();
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
328 }
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
329 if (streams.empty()) return false;
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
330 ifstream *is = streams.front();
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
331 uc = (u_char)is->get();
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
332 if (is->eof()) return next_char(uc);
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
333 if (uc == (u_char)'\n') {
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
334 int &line = linenumbers.front();
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
335 line++;
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
336 }
98
91c27c00048f tokenizer errors now go thru syslog to be visible during config file reloads in normal operation
carl
parents: 75
diff changeset
337 uc = (u_char)tolower((char)uc);
214
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
338 return true;
71
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
339 }
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
340
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
341
214
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
342 bool TOKEN::include(const char *fn) {
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
343 string_set::iterator i = filenamess.find(fn);
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
344 if (i != filenamess.end()) {
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
345 token_error("redundant or recursive include file detected");
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
346 return false;
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
347 }
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
348 ifstream *is = new ifstream;
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
349 is->open(fn);
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
350 if (is->fail()) {
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
351 char buf[maxlen];
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
352 snprintf(buf, sizeof(buf), "include file %s not found", fn);
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
353 token_error(buf);
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
354 return false;
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
355 }
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
356 string_set &inc = *include_files;
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
357 inc.insert(fn);
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
358 streams.push_front(is);
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
359 filenames.push_front(fn);
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
360 filenamess.insert(fn);
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
361 linenumbers.push_front(1);
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
362 return true;
71
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
363 }
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
364
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
365
214
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
366 const char *TOKEN::next() {
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
367 if (!pending_tokens.empty()) {
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
368 const char *t = pending_tokens.front();
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
369 pending_tokens.pop_front();
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
370 return t;
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
371 }
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
372 if (streams.empty()) return NULL;
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
373 const int PENDING_LIMIT = 1000;
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
374 u_char buffer[PENDING_LIMIT];
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
375 int count = 0;
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
376 state st = s_init;
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
377 while (true) {
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
378 if (count == (PENDING_LIMIT-1)) {
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
379 token_error("token too long");
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
380 break;
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
381 }
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
382 if (st >= end_state) {
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
383 token_error("finite state machine error");
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
384 break;
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
385 }
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
386 u_char c;
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
387 if (!next_char(c)) break;
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
388 st = parse_table[c][st];
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
389 switch (st) {
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
390 case s_string:
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
391 case s_token: {
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
392 buffer[count++] = c;
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
393 } break;
71
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
394
214
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
395 case s_term: {
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
396 push_char(c);
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
397 st = s_init;
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
398 } break;
71
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
399
214
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
400 case s_string1: {
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
401 st = s_string;
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
402 } break;
71
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
403
214
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
404 case s_string2: {
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
405 st = s_init;
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
406 } break;
71
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
407
214
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
408 case s_single: {
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
409 buffer[count++] = c;
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
410 st = s_init;
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
411 } break;
71
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
412
214
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
413 case s_ignore:
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
414 case s_eol: {
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
415 } break;
71
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
416
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
417
214
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
418 case s_slash: {
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
419 buffer[count++] = c;
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
420 if (next_char(c)) {
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
421 if (c == (u_char)'/') {
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
422 // start of ignore to eol on //
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
423 count--;
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
424 st = s_eol;
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
425 }
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
426 else {
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
427 // not a // token, just return this single /
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
428 push_char(c);
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
429 st = s_init;
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
430 }
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
431 }
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
432 else {
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
433 // cannot get another char
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
434 st = s_init;
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
435 }
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
436 } break;
71
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
437
214
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
438 default: {
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
439 token_error();
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
440 token_error("unknown state %d %s", st, " ");
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
441 } break;
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
442 }
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
443 if (st == s_init) break;
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
444 }
71
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
445
214
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
446 buffer[count] = '\0';
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
447 if (count == 0) return NULL;
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
448 const char *t = register_string((char*)buffer);
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
449 if (t == token_include) {
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
450 const char *f = next(); // should be file name
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
451 const char *s = next(); // should be semicolon
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
452 if (s == token_semi) {
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
453 include(f);
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
454 return next();
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
455 }
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
456 else {
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
457 push(s);
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
458 push(f);
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
459 return t;
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
460 }
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
461 }
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
462 return t;
71
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
463 }
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
464
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
465
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
466 int TOKEN::nextint() {
214
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
467 const char *t = next();
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
468 char *e;
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
469 long i = strtol(t, &e, 10);
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
470 if (*e != '\0') {
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
471 token_error("integer", t);
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
472 return 0;
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
473 }
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
474 return (int)i;
71
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
475 }
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
476
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
477
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
478 void TOKEN::skipeol() {
214
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
479 while (true) {
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
480 u_char c;
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
481 if (!next_char(c)) break;
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
482 if (c == (u_char)'\n') break;
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
483 }
71
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
484 }
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
485
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
486
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
487 void TOKEN::token_error(const char *err) {
214
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
488 token_error();
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
489 char buf[maxlen];
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
490 snprintf(buf, sizeof(buf), "%s \n", err);
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
491 my_syslog(buf);
71
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
492 }
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
493
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
494
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
495 void TOKEN::token_error(const char *fmt, int d, const char *s) {
214
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
496 char buf[maxlen];
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
497 snprintf(buf, sizeof(buf), fmt, d, s);
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
498 my_syslog(buf);
71
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
499 }
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
500
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
501
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
502 void TOKEN::token_error(const char *fmt, const char *t, const char *h) {
214
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
503 if (!h) h = "null";
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
504 char buf[maxlen];
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
505 snprintf(buf, sizeof(buf), fmt, t, h);
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
506 my_syslog(buf);
71
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
507 }
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
508
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
509
75
1142e46be550 start coding on new config syntax
carl
parents: 74
diff changeset
510 void TOKEN::token_error(const char *want, const char *have) {
214
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
511 token_error();
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
512 token_error("expecting %s, found %s", want, have);
71
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
513 }
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
514
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
515
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
516 void TOKEN::token_error() {
214
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
517 token_error("syntax error at line %d in file %s -- ", cur_line(), cur_fn());
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
518 line_list::iterator j = linenumbers.begin();
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
519 string_list::const_iterator i = filenames.begin();
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
520 for (; i!=filenames.end(); i++,j++) {
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
521 if (i != filenames.begin()) {
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
522 const char *fn = (*i);
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
523 int li = (*j);
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
524 token_error(" included from line %d in file %s -- ", li, fn);
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
525 }
82886d4dd71f Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 213
diff changeset
526 }
71
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
527 }
dd21c8e13074 start coding on new config syntax
carl
parents:
diff changeset
528