summaryrefslogtreecommitdiff
path: root/main/config.c
diff options
context:
space:
mode:
authorTerry Wilson <twilson@digium.com>2012-06-01 16:33:25 +0000
committerTerry Wilson <twilson@digium.com>2012-06-01 16:33:25 +0000
commitd54717c39e62f4cc8b290ac4836c4d4469d87c24 (patch)
tree5a765e82be880f3b8c2407133fbcc15c4b4349d0 /main/config.c
parent463f9d729aed1a5ed538aa3deed1a3fed9462111 (diff)
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
Diffstat (limited to 'main/config.c')
-rw-r--r--main/config.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/main/config.c b/main/config.c
index 7f7f35558..9d9eefc25 100644
--- a/main/config.c
+++ b/main/config.c
@@ -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;
}