moved strcaseeq() macro from constants.h to utils.h
This commit is contained in:
@@ -214,17 +214,17 @@ static bool get_bool(private_settings_t *this, char *key, bool def, ...)
|
||||
va_end(args);
|
||||
if (value)
|
||||
{
|
||||
if (strcasecmp(value, "true") == 0 ||
|
||||
strcasecmp(value, "enabled") == 0 ||
|
||||
strcasecmp(value, "yes") == 0 ||
|
||||
strcasecmp(value, "1") == 0)
|
||||
if (strcaseeq(value, "true") ||
|
||||
strcaseeq(value, "enabled") ||
|
||||
strcaseeq(value, "yes") ||
|
||||
strcaseeq(value, "1"))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
else if (strcasecmp(value, "false") == 0 ||
|
||||
strcasecmp(value, "disabled") == 0 ||
|
||||
strcasecmp(value, "no") == 0 ||
|
||||
strcasecmp(value, "0") == 0)
|
||||
else if (strcaseeq(value, "false") ||
|
||||
strcaseeq(value, "disabled") ||
|
||||
strcaseeq(value, "no") ||
|
||||
strcaseeq(value, "0"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -50,6 +50,11 @@
|
||||
*/
|
||||
#define strneq(x,y,len) (strncmp(x, y, len) == 0)
|
||||
|
||||
/**
|
||||
* Macro compares two strings for equality ignoring case
|
||||
*/
|
||||
#define strcaseeq(x,y) (strcasecmp(x, y) == 0)
|
||||
|
||||
/**
|
||||
* Macro compares two binary blobs for equality
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user