Added a proper config file tokenizer that supports escaping sequences

and comments.

This allows for:

'"foo bar"' can be represented as 'foo\ bar'.

And allows for comments using the hash symbol (#), but not inside
escapes or quotes. "#this is not a comment", \#this\ is\ not\ a comment.

All configuration file parsers should be rewritten using this functionality.
This commit is contained in:
Jan Vidar Krey
2010-07-09 13:04:20 +02:00
parent 849a791f79
commit 4b22ccb73c
4 changed files with 270 additions and 0 deletions

View File

@@ -163,6 +163,7 @@ libadc_common_SOURCES := \
src/adc/sid.c
libutils_SOURCES := \
src/util/config_token.c \
src/util/ipcalc.c \
src/util/list.c \
src/util/log.c \
@@ -192,6 +193,7 @@ autotest_SOURCES := \
autotest/test_sid.tcc \
autotest/test_tiger.tcc \
autotest/test_timer.tcc \
autotest/test_tokenizer.tcc \
autotest/test_usermanager.tcc
autotest_OBJECTS = autotest.o