summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 53f791c)
raw | patch | inline | side by side (parent: 53f791c)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Fri, 2 Oct 2009 16:01:38 +0000 (18:01 +0200) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Fri, 2 Oct 2009 16:01:38 +0000 (18:01 +0200) |
22 files changed:
src/apache.c | patch | blob | history | |
src/ascent.c | patch | blob | history | |
src/collectd.c | patch | blob | history | |
src/csv.c | patch | blob | history | |
src/disk.c | patch | blob | history | |
src/hddtemp.c | patch | blob | history | |
src/interface.c | patch | blob | history | |
src/ipmi.c | patch | blob | history | |
src/irq.c | patch | blob | history | |
src/libvirt.c | patch | blob | history | |
src/logfile.c | patch | blob | history | |
src/netlink.c | patch | blob | history | |
src/network.c | patch | blob | history | |
src/nginx.c | patch | blob | history | |
src/ntpd.c | patch | blob | history | |
src/onewire.c | patch | blob | history | |
src/protocols.c | patch | blob | history | |
src/rrdcached.c | patch | blob | history | |
src/sensors.c | patch | blob | history | |
src/tcpconns.c | patch | blob | history | |
src/thermal.c | patch | blob | history | |
src/vmem.c | patch | blob | history |
diff --git a/src/apache.c b/src/apache.c
index a333bf2b50a7db6a6ab39d1e2eaa962ca1902f17..df1b560f092e89bbc8dd9cb65309fb55b20216f5 100644 (file)
--- a/src/apache.c
+++ b/src/apache.c
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
{
diff --git a/src/ascent.c b/src/ascent.c
index 1e7eca1480fee669b888cd279a3f903f7e1ddeb9..6782fce199db3f5c9ffbbe984d81080e7e1a7cb3 100644 (file)
--- a/src/ascent.c
+++ b/src/ascent.c
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);
diff --git a/src/collectd.c b/src/collectd.c
index 576abef48c7110575d3a7452008c4a28970db3c4..bc69a3b7fc47d2279f63b0d148b210f525bcf825 100644 (file)
--- a/src/collectd.c
+++ b/src/collectd.c
}
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));
diff --git a/src/csv.c b/src/csv.c
index 78037a940ca3981a150a3fa84055c490b83c955b..0b34687dac172b863379a89803d1a86936c9c71d 100644 (file)
--- a/src/csv.c
+++ b/src/csv.c
}
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
{
diff --git a/src/disk.c b/src/disk.c
index 489770c7f9da86b9f8c0cb50d918871933c05603..5df1c9827b465d136e185fa9b15925d142912c10 100644 (file)
--- a/src/disk.c
+++ b/src/disk.c
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);
}
diff --git a/src/hddtemp.c b/src/hddtemp.c
index 2405d8c3e9d540152aaab25cab0c703c8bb22c5c..4e083753202718c588f72b0b1a2c58dc3ef1f37c 100644 (file)
--- a/src/hddtemp.c
+++ b/src/hddtemp.c
}
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;
diff --git a/src/interface.c b/src/interface.c
index fad37dbefdaf6208133e2454da22ac3ef2e263db..fead88859c08fd5e429a973a1bd79d9ed7898c12 100644 (file)
--- a/src/interface.c
+++ b/src/interface.c
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);
}
diff --git a/src/ipmi.c b/src/ipmi.c
index 441ad8fbc543ee4651ad0f458a9cb45b4d499c8e..95b3dbf5625fcd4c09aef04d2a880c5ca85d2ae8 100644 (file)
--- a/src/ipmi.c
+++ b/src/ipmi.c
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
diff --git a/src/irq.c b/src/irq.c
index 1aef344f596219aa3287ffabedb118c1685a9e59..401cc6f9cb3f13e84e1a5e2fd961238565c6632c 100644 (file)
--- a/src/irq.c
+++ b/src/irq.c
}
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;
diff --git a/src/libvirt.c b/src/libvirt.c
index 6f9e5f126d497b44ef2c42e2cd437cae3f5a1b49..bcbf0e6ad51a5527df6b9a74a6a7322bd916881c 100644 (file)
--- a/src/libvirt.c
+++ b/src/libvirt.c
}
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);
diff --git a/src/logfile.c b/src/logfile.c
index 03af7a3fe4369f2b614517613ac3c7108f52b7e1..7b96ac57fcb21130a42a74e5342303503c2a88aa 100644 (file)
--- a/src/logfile.c
+++ b/src/logfile.c
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;
diff --git a/src/netlink.c b/src/netlink.c
index b15768e719d5c7ea847848ea63db4142e703c45c..49c4e990fb47d8ea5c15e5c8ae2b8f132c959d1f 100644 (file)
--- a/src/netlink.c
+++ b/src/netlink.c
}
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;
diff --git a/src/network.c b/src/network.c
index 109289e3a76d62924be53dce9902cd2e21c2273f..f4b87579dfda0c28b91ddb9a121b40103b478bf1 100644 (file)
--- a/src/network.c
+++ b/src/network.c
{
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
{
diff --git a/src/nginx.c b/src/nginx.c
index 53137a71d206dd5ec9218d9697a963a6085c8db3..697684277a153911fdc43474cdc74bdab5b62d1e 100644 (file)
--- a/src/nginx.c
+++ b/src/nginx.c
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);
}
diff --git a/src/ntpd.c b/src/ntpd.c
index 9d716adc0e0e181f3c965107c32e06670dfa97f4..ecc87c78977dbbdde88e920aa5f6156a1060fc0d 100644 (file)
--- a/src/ntpd.c
+++ b/src/ntpd.c
}
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;
diff --git a/src/onewire.c b/src/onewire.c
index 261457a1bb90cad631a236c8fc7014818b4f9c01..cae0d63d4c22f529aab642a3e3f6dd37e8195fb4 100644 (file)
--- a/src/onewire.c
+++ b/src/onewire.c
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)
diff --git a/src/protocols.c b/src/protocols.c
index 75e9a1c4782035bbeffcbfc232a9fcb5d3936512..73fe15431a96e8d39f52b429aac7998f2b291f85 100644 (file)
--- a/src/protocols.c
+++ b/src/protocols.c
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);
}
diff --git a/src/rrdcached.c b/src/rrdcached.c
index 728ada459d821f2c7cd4d009e14cdd882e01f59d..bca10be3e37eb5c662cfdb7a2556b7847636e8ab 100644 (file)
--- a/src/rrdcached.c
+++ b/src/rrdcached.c
}
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;
diff --git a/src/sensors.c b/src/sensors.c
index fa461a2f6bffd7db8b3dca5dcca02a23e542dc53..8391346b4dc611b060633e8e6b1c828d20d7b67a 100644 (file)
--- a/src/sensors.c
+++ b/src/sensors.c
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
diff --git a/src/tcpconns.c b/src/tcpconns.c
index f164b53b4858406a27e8cd49040a88cc02f61e20..d68cd0968ca70a126dfd37d839f41ebe0be2fe77 100644 (file)
--- a/src/tcpconns.c
+++ b/src/tcpconns.c
{
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;
diff --git a/src/thermal.c b/src/thermal.c
index fe54aee443790617b30c22915414bcd4c5123b5c..2b708052d707461afa3f9976f3bd9132affa79a6 100644 (file)
--- a/src/thermal.c
+++ b/src/thermal.c
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
diff --git a/src/vmem.c b/src/vmem.c
index 6775d20ddf0b3b4788fb4132d8359334af1d045b..d32f1db8cf42e9b2e155db93f0bf32df89f51e39 100644 (file)
--- a/src/vmem.c
+++ b/src/vmem.c
{
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;