summaryrefslogtreecommitdiff
path: root/src/common/utils.cpp
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2013-09-08 19:43:28 -0700
committerBen Longbons <b.r.longbons@gmail.com>2013-09-09 19:29:31 -0700
commita5861a4c81bb616b7fba2028cf9ee31f890357c5 (patch)
tree0a7aedad97d70b6194eb57a7de39857d015685a3 /src/common/utils.cpp
parent367e76ba89bde0e3fb6c4ae0e64cd3927e0db2f2 (diff)
downloadtmwa-a5861a4c81bb616b7fba2028cf9ee31f890357c5.tar.gz
tmwa-a5861a4c81bb616b7fba2028cf9ee31f890357c5.tar.bz2
tmwa-a5861a4c81bb616b7fba2028cf9ee31f890357c5.tar.xz
tmwa-a5861a4c81bb616b7fba2028cf9ee31f890357c5.zip
Use IP4 classes and rename conf variables
Diffstat (limited to 'src/common/utils.cpp')
-rw-r--r--src/common/utils.cpp20
1 files changed, 2 insertions, 18 deletions
diff --git a/src/common/utils.cpp b/src/common/utils.cpp
index c9c22b9..9ab470b 100644
--- a/src/common/utils.cpp
+++ b/src/common/utils.cpp
@@ -44,11 +44,11 @@ bool e_mail_check(XString email)
//-------------------------------------------------
int config_switch (ZString str)
{
- if (str == "on" || str == "yes"
+ if (str == "true" || str == "on" || str == "yes"
|| str == "oui" || str == "ja"
|| str == "si")
return 1;
- if (str == "off" || str == "no"
+ if (str == "false" || str == "off" || str == "no"
|| str == "non" || str == "nein")
return 0;
@@ -59,22 +59,6 @@ int config_switch (ZString str)
abort();
}
-IP_String ip2str(struct in_addr ip)
-{
- const uint8_t *p = reinterpret_cast<const uint8_t *>(&ip);
-
- IP_String out;
- SNPRINTF(out, 16, "%d.%d.%d.%d", p[0], p[1], p[2], p[3]);
- return out;
-}
-VString<16> ip2str_extradot(struct in_addr ip)
-{
- const uint8_t *p = reinterpret_cast<const uint8_t *>(&ip);
- VString<16> out;
- SNPRINTF(out, 17, "%d.%d.%d.%d.", p[0], p[1], p[2], p[3]);
- return out;
-}
-
bool split_key_value(const FString& line, SString *w1, TString *w2)
{
FString::iterator begin = line.begin(), end = line.end();