Add new config-parsing framework

This framework adds a way to register the various options in a config
file with Asterisk and to handle loading and reloading of that config
in a consistent and atomic manner.

Review: https://reviewboard.asterisk.org/r/1873/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368181 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Terry Wilson
2012-06-01 16:33:25 +00:00
parent 463f9d729a
commit d54717c39e
17 changed files with 2430 additions and 199 deletions

View File

@@ -2658,6 +2658,13 @@ int ast_parse_arg(const char *arg, enum ast_parse_flags flags,
goto int32_done;
}
error = (x < low) || (x > high);
if (flags & PARSE_RANGE_DEFAULTS) {
if (x < low) {
def = low;
} else if (x > high) {
def = high;
}
}
if (flags & PARSE_OUT_RANGE) {
error = !error;
}
@@ -2704,6 +2711,13 @@ int32_done:
goto uint32_done;
}
error = (x < low) || (x > high);
if (flags & PARSE_RANGE_DEFAULTS) {
if (x < low) {
def = low;
} else if (x > high) {
def = high;
}
}
if (flags & PARSE_OUT_RANGE) {
error = !error;
}