mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-19 00:00:09 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user