git.stg.codes
/
stg.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix prefix incremental operator to postfix
[stg.git]
/
projects
/
stargazer
/
settings.cpp
diff --git
a/projects/stargazer/settings.cpp
b/projects/stargazer/settings.cpp
index 84de336bbb4277dba85697242c0584667c77a408..8af7f7aa80ba9e58125b4c7e9417cc5a2bd629bc 100644
(file)
--- a/
projects/stargazer/settings.cpp
+++ b/
projects/stargazer/settings.cpp
@@
-41,7
+41,7
@@
using namespace std;
//-----------------------------------------------------------------------------
SETTINGS::SETTINGS()
: confDir("/etc/stargazer"),
//-----------------------------------------------------------------------------
SETTINGS::SETTINGS()
: confDir("/etc/stargazer"),
- scriptDir("/etc/stargazer"),
+ script
s
Dir("/etc/stargazer"),
pidFile("/var/run/stargazer.pid"),
monitoring(false),
detailStatWritePeriod(dsPeriod_1_6),
pidFile("/var/run/stargazer.pid"),
monitoring(false),
detailStatWritePeriod(dsPeriod_1_6),
@@
-63,7
+63,7
@@
SETTINGS::SETTINGS()
//-----------------------------------------------------------------------------
SETTINGS::SETTINGS(const std::string & cd)
: confDir(cd),
//-----------------------------------------------------------------------------
SETTINGS::SETTINGS(const std::string & cd)
: confDir(cd),
- scriptDir(cd),
+ script
s
Dir(cd),
monitoring(false),
detailStatWritePeriod(dsPeriod_1_6),
statWritePeriod(10),
monitoring(false),
detailStatWritePeriod(dsPeriod_1_6),
statWritePeriod(10),
@@
-84,7
+84,7
@@
SETTINGS::SETTINGS(const std::string & cd)
//-----------------------------------------------------------------------------
SETTINGS::SETTINGS(const SETTINGS & rval)
: confDir(rval.confDir),
//-----------------------------------------------------------------------------
SETTINGS::SETTINGS(const SETTINGS & rval)
: confDir(rval.confDir),
- script
Dir(rval.script
Dir),
+ script
sDir(rval.scripts
Dir),
pidFile(rval.pidFile),
monitoring(rval.monitoring),
detailStatWritePeriod(dsPeriod_1_6),
pidFile(rval.pidFile),
monitoring(rval.monitoring),
detailStatWritePeriod(dsPeriod_1_6),
@@
-244,8
+244,6
@@
conf.setErrorCallback(SETTINGS::ErrorCallback, this);
conf.setRequiredOptionNames(requiredOptions);
string confFile = confDir + "/stargazer.conf";
conf.setRequiredOptionNames(requiredOptions);
string confFile = confDir + "/stargazer.conf";
-//printfd(__FILE__, "Conffile: %s\n", confFile.c_str());
-
if(conf.setContent(confFile.c_str()) != 0)
{
strError = "Cannot read file " + confFile;
if(conf.setContent(confFile.c_str()) != 0)
{
strError = "Cannot read file " + confFile;
@@
-258,32
+256,27
@@
while (node)
{
if (strcasecmp(node->getName(), "ScriptDir") == 0)
{
{
if (strcasecmp(node->getName(), "ScriptDir") == 0)
{
- scriptDir = node->getValue(0);
- //printfd(__FILE__, "LogFile: %s\n", logFile.c_str());
+ scriptsDir = node->getValue(0);
}
if (strcasecmp(node->getName(), "LogFile") == 0)
{
logFile = node->getValue(0);
}
if (strcasecmp(node->getName(), "LogFile") == 0)
{
logFile = node->getValue(0);
- //printfd(__FILE__, "LogFile: %s\n", logFile.c_str());
}
if (strcasecmp(node->getName(), "PIDFile") == 0)
{
pidFile = node->getValue(0);
}
if (strcasecmp(node->getName(), "PIDFile") == 0)
{
pidFile = node->getValue(0);
- //printfd(__FILE__, "PIDFile: %s\n", pidFile.c_str());
}
if (strcasecmp(node->getName(), "ModulesPath") == 0)
{
modulesPath = node->getValue(0);
}
if (strcasecmp(node->getName(), "ModulesPath") == 0)
{
modulesPath = node->getValue(0);
- //printfd(__FILE__, "ModulesPath: %s\n", logFile.c_str());
}
if (strcasecmp(node->getName(), "Rules") == 0)
{
rules = node->getValue(0);
}
if (strcasecmp(node->getName(), "Rules") == 0)
{
rules = node->getValue(0);
- //printfd(__FILE__, "Rules: %s\n", rules.c_str());
}
if (strcasecmp(node->getName(), "DetailStatWritePeriod") == 0)
}
if (strcasecmp(node->getName(), "DetailStatWritePeriod") == 0)
@@
-293,7
+286,6
@@
while (node)
strError = "Incorrect DetailStatWritePeriod value: \'" + string(node->getValue(0)) + "\'";
return -1;
}
strError = "Incorrect DetailStatWritePeriod value: \'" + string(node->getValue(0)) + "\'";
return -1;
}
- //printfd(__FILE__, "DetailStatWritePeriod: %d\n", detailStatWritePeriod);
}
if (strcasecmp(node->getName(), "StatWritePeriod") == 0)
}
if (strcasecmp(node->getName(), "StatWritePeriod") == 0)
@@
-303,7
+295,6
@@
while (node)
strError = "Incorrect StatWritePeriod value: \'" + string(node->getValue(0)) + "\'";
return -1;
}
strError = "Incorrect StatWritePeriod value: \'" + string(node->getValue(0)) + "\'";
return -1;
}
- //printfd(__FILE__, "StatWritePeriod: %d\n", statWritePeriod);
}
if (strcasecmp(node->getName(), "ExecMsgKey") == 0)
}
if (strcasecmp(node->getName(), "ExecMsgKey") == 0)
@@
-317,12
+308,11
@@
while (node)
if (strcasecmp(node->getName(), "ExecutersNum") == 0)
{
if (strcasecmp(node->getName(), "ExecutersNum") == 0)
{
- if (ParseUnsignedInRange(node->getValue(0), 1, 1024,
static_cast<unsigned *>(&executersNum)
) != 0)
+ if (ParseUnsignedInRange(node->getValue(0), 1, 1024,
&executersNum
) != 0)
{
strError = "Incorrect ExecutersNum value: \'" + string(node->getValue(0)) + "\'";
return -1;
}
{
strError = "Incorrect ExecutersNum value: \'" + string(node->getValue(0)) + "\'";
return -1;
}
- //printfd(__FILE__, "DayResetTraff: %d\n", dayResetTraff);
}
if (strcasecmp(node->getName(), "DayFee") == 0)
}
if (strcasecmp(node->getName(), "DayFee") == 0)
@@
-332,7
+322,6
@@
while (node)
strError = "Incorrect DayFee value: \'" + string(node->getValue(0)) + "\'";
return -1;
}
strError = "Incorrect DayFee value: \'" + string(node->getValue(0)) + "\'";
return -1;
}
- //printfd(__FILE__, "DayFee: %d\n", dayFee);
}
if (strcasecmp(node->getName(), "FullFee") == 0)
}
if (strcasecmp(node->getName(), "FullFee") == 0)
@@
-342,7
+331,6
@@
while (node)
strError = "Incorrect FullFee value: \'" + string(node->getValue(0)) + "\'";
return -1;
}
strError = "Incorrect FullFee value: \'" + string(node->getValue(0)) + "\'";
return -1;
}
- //printfd(__FILE__, "DayFee: %d\n", dayFee);
}
if (strcasecmp(node->getName(), "DayResetTraff") == 0)
}
if (strcasecmp(node->getName(), "DayResetTraff") == 0)
@@
-352,7
+340,6
@@
while (node)
strError = "Incorrect DayResetTraff value: \'" + string(node->getValue(0)) + "\'";
return -1;
}
strError = "Incorrect DayResetTraff value: \'" + string(node->getValue(0)) + "\'";
return -1;
}
- //printfd(__FILE__, "DayResetTraff: %d\n", dayResetTraff);
}
if (strcasecmp(node->getName(), "SpreadFee") == 0)
}
if (strcasecmp(node->getName(), "SpreadFee") == 0)
@@
-362,7
+349,6
@@
while (node)
strError = "Incorrect SpreadFee value: \'" + string(node->getValue(0)) + "\'";
return -1;
}
strError = "Incorrect SpreadFee value: \'" + string(node->getValue(0)) + "\'";
return -1;
}
- //printfd(__FILE__, "SpreadFee: %d\n", spreadFee);
}
if (strcasecmp(node->getName(), "FreeMbAllowInet") == 0)
}
if (strcasecmp(node->getName(), "FreeMbAllowInet") == 0)
@@
-372,7
+358,6
@@
while (node)
strError = "Incorrect FreeMbAllowInet value: \'" + string(node->getValue(0)) + "\'";
return -1;
}
strError = "Incorrect FreeMbAllowInet value: \'" + string(node->getValue(0)) + "\'";
return -1;
}
- //printfd(__FILE__, "FreeMbAllowInet: %d\n", freeMbAllowInet);
}
if (strcasecmp(node->getName(), "DayFeeIsLastDay") == 0)
}
if (strcasecmp(node->getName(), "DayFeeIsLastDay") == 0)
@@
-382,7
+367,6
@@
while (node)
strError = "Incorrect DayFeeIsLastDay value: \'" + string(node->getValue(0)) + "\'";
return -1;
}
strError = "Incorrect DayFeeIsLastDay value: \'" + string(node->getValue(0)) + "\'";
return -1;
}
- //printfd(__FILE__, "DayFeeIsLastDay: %d\n", dayFeeIsLastDay);
}
if (strcasecmp(node->getName(), "WriteFreeMbTraffCost") == 0)
}
if (strcasecmp(node->getName(), "WriteFreeMbTraffCost") == 0)
@@
-392,7
+376,6
@@
while (node)
strError = "Incorrect WriteFreeMbTraffCost value: \'" + string(node->getValue(0)) + "\'";
return -1;
}
strError = "Incorrect WriteFreeMbTraffCost value: \'" + string(node->getValue(0)) + "\'";
return -1;
}
- //printfd(__FILE__, "WriteFreeMbTraffCost: %d\n", writeFreeMbTraffCost);
}
if (strcasecmp(node->getName(), "ShowFeeInCash") == 0)
}
if (strcasecmp(node->getName(), "ShowFeeInCash") == 0)
@@
-402,7
+385,6
@@
while (node)
strError = "Incorrect ShowFeeInCash value: \'" + string(node->getValue(0)) + "\'";
return -1;
}
strError = "Incorrect ShowFeeInCash value: \'" + string(node->getValue(0)) + "\'";
return -1;
}
- //printfd(__FILE__, "ShowFeeInCash: %d\n", showFeeInCash);
}
if (strcasecmp(node->getName(), "MonitorDir") == 0)
}
if (strcasecmp(node->getName(), "MonitorDir") == 0)
@@
-424,12
+406,10
@@
while (node)
strError = "Incorrect MessageTimeout value: \'" + string(node->getValue(0)) + "\'";
return -1;
}
strError = "Incorrect MessageTimeout value: \'" + string(node->getValue(0)) + "\'";
return -1;
}
- //printfd(__FILE__, "MessageTimeout: %d\n", messageTimeout);
}
if (strcasecmp(node->getName(), "DirNames") == 0)
{
}
if (strcasecmp(node->getName(), "DirNames") == 0)
{
- // íÙ ×ÎÕÔÒÉ ÓÅËÃÉÉ DirNames
const DOTCONFDocumentNode * child = node->getChildNode();
if (child)
{
const DOTCONFDocumentNode * child = node->getChildNode();
if (child)
{
@@
-449,19
+429,14
@@
while (node)
if (strcasecmp(node->getName(), "StoreModule") == 0)
{
if (strcasecmp(node->getName(), "StoreModule") == 0)
{
- // íÙ ×ÎÕÔÒÉ ÓÅËÃÉÉ StoreModule
- //printfd(__FILE__, "StoreModule\n");
-
if (node->getValue(1))
{
if (node->getValue(1))
{
- // StoreModule ÄÏÌÖÅÎ ÉÍÅÔØ 1 ÁÔÒÉÂÕÔ
strError = "Unexpected \'" + string(node->getValue(1)) + "\'.";
return -1;
}
if (storeModulesCount)
{
strError = "Unexpected \'" + string(node->getValue(1)) + "\'.";
return -1;
}
if (storeModulesCount)
{
- // äÏÌÖÅÎ ÂÙÔØ ÔÏÌØËÏ ÏÄÉÎ ÍÏÄÕÌØ StoreModule!
strError = "Should be only one StoreModule.";
return -1;
}
strError = "Should be only one StoreModule.";
return -1;
}
@@
-471,20
+446,16
@@
while (node)
ParseModuleSettings(node, &storeModuleSettings.moduleParams);
}
ParseModuleSettings(node, &storeModuleSettings.moduleParams);
}
- // þÉÔÁÅÍ ÎÁÓÔÒÏÊËÉ ×ÓÅÈ ÏÓÔÁ×ÛÉÈÓÑ ÍÏÄÕÌÅÊ.
if (strcasecmp(node->getName(), "Modules") == 0)
{
if (strcasecmp(node->getName(), "Modules") == 0)
{
- // íÙ ×ÎÕÔÒÉ ÓÅËÃÉÉ Modules
if (node->getValue(0))
{
if (node->getValue(0))
{
- // Modules ÎÅ ÄÏÌÖÅÎ ÉÍÅÔØ ÁÔÒÉÂÕÏ×
strError = "Unexpected \'" + string(node->getValue(0)) + "\'.";
return -1;
}
const DOTCONFDocumentNode * child = node->getChildNode();
while (child)
{
strError = "Unexpected \'" + string(node->getValue(0)) + "\'.";
return -1;
}
const DOTCONFDocumentNode * child = node->getChildNode();
while (child)
{
- // íÙ ×ÎÕÔÒÉ ÓÅËÃÉÉ
if (strcasecmp(child->getName(), "Module") != 0)
{
child = child->getNextNode();
if (strcasecmp(child->getName(), "Module") != 0)
{
child = child->getNextNode();