summaryrefslogtreecommitdiffstats
path: root/kppp/ruleset.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kppp/ruleset.cpp')
-rw-r--r--kppp/ruleset.cpp48
1 files changed, 24 insertions, 24 deletions
diff --git a/kppp/ruleset.cpp b/kppp/ruleset.cpp
index 21de5625..70c677f9 100644
--- a/kppp/ruleset.cpp
+++ b/kppp/ruleset.cpp
@@ -189,7 +189,7 @@ bool RuleSet::parseEntry(RULE &ret, TQString s, int year) {
ret.type = 1;
ret.date.from = TQDate(year, m, d);
ret.date.until = TQDate(year, m, d);
- return TRUE;
+ return true;
}
if(s.contains(TQRegExp("^[0-9]+\\.[0-9]+$"))) {
@@ -198,7 +198,7 @@ bool RuleSet::parseEntry(RULE &ret, TQString s, int year) {
ret.type = 1;
ret.date.from = TQDate(year, m, d);
ret.date.until = TQDate(year, m, d);
- return TRUE;
+ return true;
}
if(s.right(3) == "day") {
@@ -207,14 +207,14 @@ bool RuleSet::parseEntry(RULE &ret, TQString s, int year) {
ret.type = 2;
ret.weekday.from = d;
ret.weekday.until = d;
- return TRUE;
+ return true;
}
}
if(s.left(6) == "easter") {
TQDate d = get_easter(year);
int off;
- bool ok = TRUE;
+ bool ok = true;
TQString val = s.mid(6, 1000);
if(val.isEmpty())
off = 0;
@@ -226,12 +226,12 @@ bool RuleSet::parseEntry(RULE &ret, TQString s, int year) {
ret.type = 1;
ret.date.from = d;
ret.date.until = d;
- return TRUE;
+ return true;
}
}
ret.type = 0;
- return FALSE;
+ return false;
}
@@ -276,11 +276,11 @@ bool RuleSet::parseEntries(TQString s, int year,
r.weekday.until = rr.weekday.from;
}
} else
- return FALSE;
+ return false;
}
} else
if(!parseEntry(r, token, year))
- return FALSE;
+ return false;
r.costs = costs;
r.len = len;
@@ -290,22 +290,22 @@ bool RuleSet::parseEntries(TQString s, int year,
addRule(r);
}
- return TRUE;
+ return true;
}
bool RuleSet::parseTime(TQTime &t1, TQTime &t2, TQString s) {
if(s.isEmpty()) {
t1 = midnight();
t2 = beforeMidnight();
- return TRUE;
+ return true;
} else {
int t1m, t1h, t2m, t2h;
if(sscanf(s.ascii(), "%d:%d..%d:%d", &t1h, &t1m, &t2h, &t2m) == 4) {
t1.setHMS(t1h, t1m, 0);
t2.setHMS(t2h, t2m, 0);
- return TRUE;
+ return true;
} else
- return FALSE;
+ return false;
}
}
@@ -328,17 +328,17 @@ bool RuleSet::parseLine(const TQString &s) {
double after;
if(!parseRate(flat_init_costs, flat_init_duration, after, token))
- return FALSE;
+ return false;
//printf("COST %f DURATION %f\n",flat_init_costs,flat_init_duration);
if(! (flat_init_costs >= 0.0) )
- return FALSE;
+ return false;
if(! (flat_init_duration >= 0.0))
- return FALSE;
+ return false;
have_flat_init_costs = true;
- return TRUE;
+ return true;
}
@@ -348,7 +348,7 @@ bool RuleSet::parseLine(const TQString &s) {
s.find(")use")-s.find("between(") - 8);
TQTime t1, t2;
if(!parseTime(t1, t2, token))
- return FALSE;
+ return false;
// parse the rate fields
token = s.mid(s.find("use(") + 4,
@@ -357,16 +357,16 @@ bool RuleSet::parseLine(const TQString &s) {
double len;
double after;
if(!parseRate(costs, len, after, token))
- return FALSE;
+ return false;
// parse the days
token = s.mid(s.find("on(") + 3,
s.find(")betw")-s.find("on(") - 3);
if(!parseEntries(token, TQDate::currentDate().year(),
t1, t2, costs, len, after))
- return FALSE;
+ return false;
- return TRUE;
+ return true;
}
// check for the name
@@ -381,7 +381,7 @@ bool RuleSet::parseLine(const TQString &s) {
TQString token = s.mid(9, s.length() - 10);
double after;
if(parseRate(default_costs, default_len, after, token))
- return TRUE;
+ return true;
}
// check for "minimum costs"
@@ -395,7 +395,7 @@ bool RuleSet::parseLine(const TQString &s) {
// check currency settings
if(s.startsWith("currency_symbol=")) {
_currency_symbol = s.mid(16);
- return TRUE;
+ return true;
}
if(s.contains(TQRegExp("currency_digits=.*"))) {
@@ -407,7 +407,7 @@ bool RuleSet::parseLine(const TQString &s) {
// "currency_position" is deprecated so we'll simply ignore it
if(s.contains(TQRegExp("currency_position=.*")))
- return TRUE;
+ return true;
// check per connection fee
if(s.contains(TQRegExp("per_connection="))) {
@@ -417,7 +417,7 @@ bool RuleSet::parseLine(const TQString &s) {
return ok;
}
- return FALSE;
+ return false;
}
void RuleSet::setStartTime(TQDateTime dt){