else /* if (ci->values[0].type != OCONFIG_TYPE_STRING) */
{
char *string = ci->values[0].value.string;
- if ((strcasecmp ("true", string) == 0)
- || (strcasecmp ("yes", string) == 0)
- || (strcasecmp ("on", string) == 0))
+ if (IS_TRUE (string))
*ret_boolean = 1;
- else if ((strcasecmp ("false", string) == 0)
- || (strcasecmp ("no", string) == 0)
- || (strcasecmp ("off", string) == 0))
+ else if (IS_FALSE (string))
*ret_boolean = 0;
else
{
curl_easy_setopt (curl, CURLOPT_URL, url);
curl_easy_setopt (curl, CURLOPT_FOLLOWLOCATION, 1);
- if ((verify_peer == NULL) || (strcmp (verify_peer, "true") == 0))
+ if ((verify_peer == NULL) || IS_TRUE (verify_peer))
curl_easy_setopt (curl, CURLOPT_SSL_VERIFYPEER, 1);
else
curl_easy_setopt (curl, CURLOPT_SSL_VERIFYPEER, 0);
- if ((verify_host == NULL) || (strcmp (verify_host, "true") == 0))
+ if ((verify_host == NULL) || IS_TRUE (verify_host))
curl_easy_setopt (curl, CURLOPT_SSL_VERIFYHOST, 2);
else
curl_easy_setopt (curl, CURLOPT_SSL_VERIFYHOST, 0);
}
str = global_option_get ("FQDNLookup");
- if ((strcasecmp ("false", str) == 0)
- || (strcasecmp ("no", str) == 0)
- || (strcasecmp ("off", str) == 0))
+ if (IS_FALSE (str))
return (0);
memset (&ai_hints, '\0', sizeof (ai_hints));
}
else if (strcasecmp ("StoreRates", key) == 0)
{
- if ((strcasecmp ("True", value) == 0)
- || (strcasecmp ("Yes", value) == 0)
- || (strcasecmp ("On", value) == 0))
- {
+ if (IS_TRUE (value))
store_rates = 1;
- }
else
- {
store_rates = 0;
- }
}
else
{
else if (strcasecmp ("IgnoreSelected", key) == 0)
{
int invert = 1;
- if ((strcasecmp ("True", value) == 0)
- || (strcasecmp ("Yes", value) == 0)
- || (strcasecmp ("On", value) == 0))
+ if (IS_TRUE (value))
invert = 0;
ignorelist_set_invert (ignorelist, invert);
}
}
else if (strcasecmp (key, "TranslateDevicename") == 0)
{
- if ((strcasecmp ("true", value) == 0)
- || (strcasecmp ("yes", value) == 0)
- || (strcasecmp ("on", value) == 0))
+ if (IS_TRUE (value))
translate_devicename = 1;
else
translate_devicename = 0;
else if (strcasecmp (key, "IgnoreSelected") == 0)
{
int invert = 1;
- if ((strcasecmp (value, "True") == 0)
- || (strcasecmp (value, "Yes") == 0)
- || (strcasecmp (value, "On") == 0))
+ if (IS_TRUE (value))
invert = 0;
ignorelist_set_invert (ignorelist, invert);
}
else if (strcasecmp ("IgnoreSelected", key) == 0)
{
int invert = 1;
- if ((strcasecmp ("True", value) == 0)
- || (strcasecmp ("Yes", value) == 0)
- || (strcasecmp ("On", value) == 0))
+ if (IS_TRUE (value))
invert = 0;
ignorelist_set_invert (ignorelist, invert);
}
else if (strcasecmp ("NotifySensorAdd", key) == 0)
{
- if ((strcasecmp ("True", value) == 0)
- || (strcasecmp ("Yes", value) == 0)
- || (strcasecmp ("On", value) == 0))
+ if (IS_TRUE (value))
c_ipmi_nofiy_add = 1;
}
else if (strcasecmp ("NotifySensorRemove", key) == 0)
{
- if ((strcasecmp ("True", value) == 0)
- || (strcasecmp ("Yes", value) == 0)
- || (strcasecmp ("On", value) == 0))
+ if (IS_TRUE (value))
c_ipmi_nofiy_remove = 1;
}
else if (strcasecmp ("NotifySensorNotPresent", key) == 0)
{
- if ((strcasecmp ("True", value) == 0)
- || (strcasecmp ("Yes", value) == 0)
- || (strcasecmp ("On", value) == 0))
+ if (IS_TRUE (value))
c_ipmi_nofiy_notpresent = 1;
}
else
}
else if (strcasecmp (key, "IgnoreSelected") == 0)
{
- if ((strcasecmp (value, "True") == 0)
- || (strcasecmp (value, "Yes") == 0)
- || (strcasecmp (value, "On") == 0))
+ if (IS_TRUE (value))
irq_list_action = 1;
else
irq_list_action = 0;
}
if (strcasecmp (key, "IgnoreSelected") == 0) {
- if (strcasecmp (value, "True") == 0 ||
- strcasecmp (value, "Yes") == 0 ||
- strcasecmp (value, "On") == 0)
+ if (IS_TRUE (value))
{
ignorelist_set_invert (il_domains, 0);
ignorelist_set_invert (il_block_devices, 0);
log_file = strdup (value);
}
else if (0 == strcasecmp (key, "Timestamp")) {
- if ((strcasecmp (value, "false") == 0)
- || (strcasecmp (value, "no") == 0)
- || (strcasecmp (value, "off") == 0))
+ if (IS_FALSE (value))
print_timestamp = 0;
else
print_timestamp = 1;
}
else
{
- if ((strcasecmp (fields[0], "yes") == 0)
- || (strcasecmp (fields[0], "true") == 0)
- || (strcasecmp (fields[0], "on") == 0))
+ if (IS_TRUE (fields[0]))
ir_ignorelist_invert = 0;
else
ir_ignorelist_invert = 1;
{
char *str = ci->values[0].value.string;
- if ((strcasecmp ("true", str) == 0)
- || (strcasecmp ("yes", str) == 0)
- || (strcasecmp ("on", str) == 0))
+ if (IS_TRUE (str))
*retval = 1;
- else if ((strcasecmp ("false", str) == 0)
- || (strcasecmp ("no", str) == 0)
- || (strcasecmp ("off", str) == 0))
+ else if (IS_FALSE (str))
*retval = 0;
else
{
curl_easy_setopt (curl, CURLOPT_FOLLOWLOCATION, 1);
- if ((verify_peer == NULL) || (strcmp (verify_peer, "true") == 0))
+ if ((verify_peer == NULL) || IS_TRUE (verify_peer))
{
curl_easy_setopt (curl, CURLOPT_SSL_VERIFYPEER, 1);
}
curl_easy_setopt (curl, CURLOPT_SSL_VERIFYPEER, 0);
}
- if ((verify_host == NULL) || (strcmp (verify_host, "true") == 0))
+ if ((verify_host == NULL) || IS_TRUE (verify_host))
{
curl_easy_setopt (curl, CURLOPT_SSL_VERIFYHOST, 2);
}
}
else if (strcasecmp (key, "ReverseLookups") == 0)
{
- if ((strcasecmp (value, "True") == 0)
- || (strcasecmp (value, "Yes") == 0)
- || (strcasecmp (value, "On") == 0))
+ if (IS_TRUE (value))
do_reverse_lookups = 1;
else
do_reverse_lookups = 0;
else if (strcasecmp (key, "IgnoreSelected") == 0)
{
ignorelist_set_invert (sensor_list, 1);
- if ((strcasecmp (value, "True") == 0)
- || (strcasecmp (value, "Yes") == 0)
- || (strcasecmp (value, "On") == 0))
+ if (IS_TRUE (value))
ignorelist_set_invert (sensor_list, 0);
}
else if (strcasecmp (key, "Device") == 0)
else if (strcasecmp (key, "IgnoreSelected") == 0)
{
int invert = 1;
- if ((strcasecmp (value, "True") == 0)
- || (strcasecmp (value, "Yes") == 0)
- || (strcasecmp (value, "On") == 0))
+ if (IS_TRUE (value))
invert = 0;
ignorelist_set_invert (values_list, invert);
}
}
else if (strcasecmp ("CreateFiles", key) == 0)
{
- if ((strcasecmp ("false", value) == 0)
- || (strcasecmp ("no", value) == 0)
- || (strcasecmp ("off", value) == 0))
+ if (IS_FALSE (value))
config_create_files = 0;
else
config_create_files = 1;
}
else if (strcasecmp ("CollectStatistics", key) == 0)
{
- if ((strcasecmp ("false", value) == 0)
- || (strcasecmp ("no", value) == 0)
- || (strcasecmp ("off", value) == 0))
+ if (IS_FALSE (value))
config_collect_stats = 0;
else
config_collect_stats = 1;
else if (strcasecmp (key, "IgnoreSelected") == 0)
{
ignorelist_set_invert (sensor_list, 1);
- if ((strcasecmp (value, "True") == 0)
- || (strcasecmp (value, "Yes") == 0)
- || (strcasecmp (value, "On") == 0))
+ if (IS_TRUE (value))
ignorelist_set_invert (sensor_list, 0);
}
else
{
if (strcasecmp (key, "ListeningPorts") == 0)
{
- if ((strcasecmp (value, "Yes") == 0)
- || (strcasecmp (value, "True") == 0)
- || (strcasecmp (value, "On") == 0))
+ if (IS_TRUE (value))
port_collect_listening = 1;
else
port_collect_listening = 0;
else if (strcasecmp (key, "IgnoreSelected") == 0)
{
ignorelist_set_invert (device_list, 1);
- if ((strcasecmp (value, "True") == 0)
- || (strcasecmp (value, "Yes") == 0)
- || (strcasecmp (value, "On") == 0))
+ if (IS_TRUE (value))
ignorelist_set_invert (device_list, 0);
}
else if (strcasecmp (key, "ForceUseProcfs") == 0)
{
force_procfs = 0;
- if ((strcasecmp (value, "True") == 0)
- || (strcasecmp (value, "Yes") == 0)
- || (strcasecmp (value, "On") == 0))
+ if (IS_TRUE (value))
force_procfs = 1;
}
else
{
if (strcasecmp ("Verbose", key) == 0)
{
- if ((strcasecmp ("true", value) == 0)
- || (strcasecmp ("yes", value) == 0)
- || (strcasecmp ("on", value) == 0))
+ if (IS_TRUE (value))
verbose_output = 1;
else
verbose_output = 0;