diff options
author | Dmitri Pal <dpal@redhat.com> | 2010-06-19 11:28:04 -0400 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2010-09-22 14:57:53 -0400 |
commit | bcfbcf2e8d578580f308b5bdded49b166650f131 (patch) | |
tree | a1348fb14bf6a45bff16d668c1e083042252d569 /Makefile.am | |
parent | 49ea94d1755e9003cbc2cba99c218cdd0a391813 (diff) | |
download | ding-libs-bcfbcf2e8d578580f308b5bdded49b166650f131.tar.gz ding-libs-bcfbcf2e8d578580f308b5bdded49b166650f131.tar.xz ding-libs-bcfbcf2e8d578580f308b5bdded49b166650f131.zip |
New INI parser
The parser is added to the existing module.
The old parsing functuion will be removed when we
switch to the new interface.
Parser logic:
* There is one high level function that wraps the
parser interface. It is at the bottom of the module.
ini_parse_config();
* Internally it creates a perser object
and then runs parser on it.
* At the end parser object is destroyed.
* This object stores the state of the parser.
* The parser has an action queue
* There are several actions that parser can perform
- read line
- inspect read line
- record an error
- process last comment in the file (POST)
* Each action handler determines what to do next
depending upon what has happened.
* Read handler reads lines and enqueues inspection action
in case of success or error action in case of failure.
* Inspection action parses last read line and
treats it either is a:
* Comment
* Section
* New key + value
* Continuation of the value
In case of error the error action is enqueued.
* Error can be fatal or non fatal. It depend on the error_level
flag passed in. If the error is non fatal the read action is
enqueued otherwise parser stops.
* The POST action is a special action to handle comment at
the bottom of the file. The comment is stored with the
value it preceeds so in case there is a comment at
the bottom of the file a special value needs to be created
to hold just the comment.
Diffstat (limited to 'Makefile.am')
-rw-r--r-- | Makefile.am | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/Makefile.am b/Makefile.am index 47f5329..da36c20 100644 --- a/Makefile.am +++ b/Makefile.am @@ -231,6 +231,10 @@ libini_config_la_SOURCES = \ ini/ini_comment.h \ ini/ini_valueobj.c \ ini/ini_valueobj.h \ + ini/ini_serialize.c \ + ini/ini_configobj.c \ + ini/ini_configobj.h \ + ini/ini_config_priv.h \ trace/trace.h libini_config_la_LIBADD = \ libcollection.la \ @@ -238,7 +242,7 @@ libini_config_la_LIBADD = \ libref_array.la \ libbasicobjects.la libini_config_la_LDFLAGS = \ - -version-info 2:0:0 + -version-info 3:0:0 dist_noinst_DATA += \ ini/ini.conf \ @@ -250,12 +254,14 @@ dist_noinst_DATA += \ check_PROGRAMS += \ ini_config_ut \ ini_comment_ut \ - ini_valueobj_ut + ini_valueobj_ut \ + ini_parse_ut TESTS += \ ini_config_ut \ ini_comment_ut \ - ini_valueobj_ut + ini_valueobj_ut \ + ini_parse_ut ini_config_ut_SOURCES = ini/ini_config_ut.c ini_config_ut_LDADD = \ @@ -268,12 +274,19 @@ ini_comment_ut_LDADD = libini_config.la ini_valueobj_ut_SOURCES = ini/ini_valueobj_ut.c ini_valueobj_ut_LDADD = libini_config.la +ini_parse_ut_SOURCES = ini/ini_parse_ut.c +ini_parse_ut_LDADD = libini_config.la + ini_config-docs: if HAVE_DOXYGEN cd ini; \ $(DOXYGEN) ini_config.cfg.doxy endif +clean-local-ini_config: + rm -f ./*.out + rm -f test.ini + ############################################################################## # Additional rules ############################################################################## @@ -322,5 +335,5 @@ tests: all $(check_PROGRAMS) docs: path_utils-docs collection-docs ref_array-docs ini_config-docs basicobjects-docs -clean-local: +clean-local: clean-local-ini_config rm -Rf doc |