summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorDmitri Pal <dpal@redhat.com>2010-06-19 11:28:04 -0400
committerStephen Gallagher <sgallagh@redhat.com>2010-09-22 14:57:53 -0400
commitbcfbcf2e8d578580f308b5bdded49b166650f131 (patch)
treea1348fb14bf6a45bff16d668c1e083042252d569 /configure.ac
parent49ea94d1755e9003cbc2cba99c218cdd0a391813 (diff)
downloadding-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 'configure.ac')
-rw-r--r--configure.ac6
1 files changed, 6 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 906a183..10c4062 100644
--- a/configure.ac
+++ b/configure.ac
@@ -47,6 +47,12 @@ AC_CHECK_FUNC([strcasestr],
[Define if strcasestr exists]),
AC_MSG_ERROR("Platform must support strcasestr"))
+AC_CHECK_FUNC([getline],
+ AC_DEFINE([HAVE_GETLINE],
+ [1],
+ [Define if getline() exists]),
+ AC_MSG_ERROR("Platform must support getline()"))
+
AC_DEFINE([COL_MAX_DATA], [65535], [Max length of the data block allowed in the collection value.])
AC_DEFINE([MAX_KEY], [1024], [Max length of the key in the INI file.])