mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-01 11:32:25 +00:00
Add function ast_false, like ast_true
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2289 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
14
config.c
14
config.c
@@ -128,6 +128,20 @@ int ast_true(char *s)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int ast_false(char *s)
|
||||||
|
{
|
||||||
|
if (!s)
|
||||||
|
return 0;
|
||||||
|
/* Determine if this is a false value */
|
||||||
|
if (!strcasecmp(s, "no") ||
|
||||||
|
!strcasecmp(s, "false") ||
|
||||||
|
!strcasecmp(s, "n") ||
|
||||||
|
!strcasecmp(s, "f") ||
|
||||||
|
!strcasecmp(s, "0"))
|
||||||
|
return -1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
struct ast_variable *ast_variable_browse(struct ast_config *config, char *category)
|
struct ast_variable *ast_variable_browse(struct ast_config *config, char *category)
|
||||||
{
|
{
|
||||||
struct ast_category *cat;
|
struct ast_category *cat;
|
||||||
|
|||||||
@@ -87,6 +87,14 @@ char *ast_variable_retrieve(struct ast_config *config, char *category, char *val
|
|||||||
*/
|
*/
|
||||||
int ast_true(char *val);
|
int ast_true(char *val);
|
||||||
|
|
||||||
|
//! Make sure something is false
|
||||||
|
/*!
|
||||||
|
* Determine falseness of a boolean value.
|
||||||
|
* This function checks to see whether a string passed to it is an indication of a negatirve value. It checks to see if the string is "no", "false", "n", "f", and "0".
|
||||||
|
* Returns 0 if the value of s is a NULL pointer, 0 on "truth", and -1 on falsehood.
|
||||||
|
*/
|
||||||
|
int ast_false(char *val);
|
||||||
|
|
||||||
//! Check for category duplicates
|
//! Check for category duplicates
|
||||||
/*!
|
/*!
|
||||||
* \param config which config to use
|
* \param config which config to use
|
||||||
|
|||||||
Reference in New Issue
Block a user