|
|
@@ -41,9 +41,9 @@ bool ConfigTable::IsComment(const ConfigString& S)
|
|
|
{
|
|
|
if (!S.empty()) {
|
|
|
for (ConfigString::iterator i=configcmt.begin();
|
|
|
- i!=configcmt.end(); ++i)
|
|
|
+ i!=configcmt.end(); ++i)
|
|
|
if (S[0] == (*i))
|
|
|
- return true;
|
|
|
+ return true;
|
|
|
}
|
|
|
return false;
|
|
|
}
|
|
|
@@ -74,35 +74,35 @@ void ConfigTable::ParseConfigFile(istream& is, const ConfigString& Filename)
|
|
|
while (!is.eof()) {
|
|
|
std::getline(is, line);
|
|
|
if (microconfig_cat->is_spam())
|
|
|
- microconfig_cat->spam() << "read from " << Filename << ": '" << line
|
|
|
- << "'" << endl;
|
|
|
+ microconfig_cat->spam() << "read from " << Filename << ": '" << line
|
|
|
+ << "'" << endl;
|
|
|
CropString(line);
|
|
|
if (microconfig_cat->is_spam())
|
|
|
- microconfig_cat->spam() << "cropped line to: '" << line << "'"
|
|
|
- << endl;
|
|
|
+ microconfig_cat->spam() << "cropped line to: '" << line << "'"
|
|
|
+ << endl;
|
|
|
if (!IsComment(line)) {
|
|
|
- ConfigString protosym(PopNextWord(line));
|
|
|
- if (microconfig_cat->is_spam())
|
|
|
- microconfig_cat->spam() << "protosym is '" << protosym
|
|
|
- << "' with value of '" << line << "'"
|
|
|
- << endl;
|
|
|
- size_t i(protosym.find("."));
|
|
|
- if (i == ConfigString::npos) {
|
|
|
- if (microconfig_cat->is_spam())
|
|
|
- microconfig_cat->spam() << "this is an unqualified symbol"
|
|
|
- << endl;
|
|
|
- unqualified[protosym].push_back(SymEnt(SymEnt::ConfigFile, line, Filename));
|
|
|
- } else {
|
|
|
- ConfigString scope(protosym.substr(0, i));
|
|
|
- ConfigString sym(protosym.substr(i+1, ConfigString::npos));
|
|
|
- if (microconfig_cat->is_spam())
|
|
|
- microconfig_cat->spam() << "this is a qualified symbol."
|
|
|
- << " scope '" << scope
|
|
|
- << "', symbol '" << sym << "'" << endl;
|
|
|
- (qualified[scope])[sym].push_back(SymEnt(SymEnt::ConfigFile, line, Filename));
|
|
|
- }
|
|
|
+ ConfigString protosym(PopNextWord(line));
|
|
|
+ if (microconfig_cat->is_spam())
|
|
|
+ microconfig_cat->spam() << "protosym is '" << protosym
|
|
|
+ << "' with value of '" << line << "'"
|
|
|
+ << endl;
|
|
|
+ size_t i(protosym.find("."));
|
|
|
+ if (i == ConfigString::npos) {
|
|
|
+ if (microconfig_cat->is_spam())
|
|
|
+ microconfig_cat->spam() << "this is an unqualified symbol"
|
|
|
+ << endl;
|
|
|
+ unqualified[protosym].push_back(SymEnt(SymEnt::ConfigFile, line, Filename));
|
|
|
+ } else {
|
|
|
+ ConfigString scope(protosym.substr(0, i));
|
|
|
+ ConfigString sym(protosym.substr(i+1, ConfigString::npos));
|
|
|
+ if (microconfig_cat->is_spam())
|
|
|
+ microconfig_cat->spam() << "this is a qualified symbol."
|
|
|
+ << " scope '" << scope
|
|
|
+ << "', symbol '" << sym << "'" << endl;
|
|
|
+ (qualified[scope])[sym].push_back(SymEnt(SymEnt::ConfigFile, line, Filename));
|
|
|
+ }
|
|
|
} else if (microconfig_cat->is_spam())
|
|
|
- microconfig_cat->spam() << "line is detected as a comment" << endl;
|
|
|
+ microconfig_cat->spam() << "line is detected as a comment" << endl;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -130,7 +130,7 @@ void ConfigTable::ReadConfigFile(void) {
|
|
|
int i = configpath.find_first_of(" ");
|
|
|
ConfigString stmp = configpath.substr(0, i);
|
|
|
if (ExecutionEnvironment::has_environment_variable(stmp)) {
|
|
|
- S += " ";
|
|
|
+ S += " ";
|
|
|
S += ExecutionEnvironment::get_environment_variable(stmp);
|
|
|
}
|
|
|
configpath.erase(0, i);
|
|
|
@@ -143,7 +143,7 @@ void ConfigTable::ReadConfigFile(void) {
|
|
|
}
|
|
|
if (microconfig_cat->is_spam())
|
|
|
microconfig_cat->spam() << "evaluated value of configpath '"
|
|
|
- << configpath << "'" << endl;
|
|
|
+ << configpath << "'" << endl;
|
|
|
|
|
|
DSearchPath config_search(configpath);
|
|
|
DSearchPath::Results config_files;
|
|
|
@@ -151,24 +151,24 @@ void ConfigTable::ReadConfigFile(void) {
|
|
|
if (!configsuffix.empty()) {
|
|
|
if (microconfig_cat->is_spam())
|
|
|
microconfig_cat->spam() << "agregate config name is: "
|
|
|
- << (configname + configsuffix) << endl;
|
|
|
+ << (configname + configsuffix) << endl;
|
|
|
config_search.find_all_files(configname + configsuffix, config_files);
|
|
|
if (microconfig_cat->is_spam())
|
|
|
microconfig_cat->spam() << "found " << config_files.get_num_files()
|
|
|
- << " files" << endl;
|
|
|
+ << " files" << endl;
|
|
|
} else {
|
|
|
if (microconfig_cat->is_spam())
|
|
|
microconfig_cat->spam() << "searching for '" << configname << "'"
|
|
|
- << endl;
|
|
|
+ << endl;
|
|
|
config_search.find_all_files(configname, config_files);
|
|
|
if (microconfig_cat->is_spam())
|
|
|
microconfig_cat->spam() << "found " << config_files.get_num_files()
|
|
|
- << " files" << endl;
|
|
|
+ << " files" << endl;
|
|
|
}
|
|
|
|
|
|
if (microconfig_cat->is_spam())
|
|
|
microconfig_cat->spam() << "configpath parsed and searched"
|
|
|
- << endl;
|
|
|
+ << endl;
|
|
|
|
|
|
int num_config_files = config_files.get_num_files();
|
|
|
for (int i = num_config_files - 1; i >= 0; i--) {
|
|
|
@@ -176,19 +176,19 @@ void ConfigTable::ReadConfigFile(void) {
|
|
|
|
|
|
if (microconfig_cat->is_spam())
|
|
|
microconfig_cat->spam() << "examining file '" << config_file << "'"
|
|
|
- << endl;
|
|
|
+ << endl;
|
|
|
if (config_file.is_executable()) {
|
|
|
ConfigString line = config_file.to_os_specific() + " "
|
|
|
- + ExecutionEnvironment::get_binary_name();
|
|
|
+ + ExecutionEnvironment::get_binary_name();
|
|
|
if (microconfig_cat->is_spam())
|
|
|
- microconfig_cat->spam() << "file is executable, running '"
|
|
|
- << line << "'" << endl;
|
|
|
+ microconfig_cat->spam() << "file is executable, running '"
|
|
|
+ << line << "'" << endl;
|
|
|
IPipeStream ifs(line);
|
|
|
ParseConfigFile(ifs, config_file);
|
|
|
} else {
|
|
|
if (microconfig_cat->is_spam())
|
|
|
- microconfig_cat->spam()
|
|
|
- << "file is not executable, reading normally" << endl;
|
|
|
+ microconfig_cat->spam()
|
|
|
+ << "file is not executable, reading normally" << endl;
|
|
|
|
|
|
#ifdef PENV_PS2
|
|
|
ConfigString line = PS2_FILE_PREFIX + convert_pathname(config_file);
|
|
|
@@ -202,8 +202,8 @@ void ConfigTable::ReadConfigFile(void) {
|
|
|
|
|
|
while (sceRead(fd, line_buffer, 2048) > 0)
|
|
|
{
|
|
|
- file_buffer += line_buffer;
|
|
|
- memset(line_buffer, 0, 2048);
|
|
|
+ file_buffer += line_buffer;
|
|
|
+ memset(line_buffer, 0, 2048);
|
|
|
}
|
|
|
|
|
|
sceClose(fd);
|
|
|
@@ -221,43 +221,43 @@ void ConfigTable::ParseCommandEnv(ConfigString& S, const ConfigString& sym)
|
|
|
{
|
|
|
if (microconfig_cat->is_spam())
|
|
|
microconfig_cat->spam() << "value of '" << sym << "' is '" << S << "'"
|
|
|
- << endl;
|
|
|
+ << endl;
|
|
|
while (!S.empty()) {
|
|
|
ConfigString protosym(PopNextWord(S));
|
|
|
bool ok = false;
|
|
|
bool state = false;
|
|
|
if (protosym[0] == '-')
|
|
|
- ok = true;
|
|
|
+ ok = true;
|
|
|
else if (protosym[0] == '+') {
|
|
|
- ok = true;
|
|
|
- state = true;
|
|
|
+ ok = true;
|
|
|
+ state = true;
|
|
|
}
|
|
|
if (ok) {
|
|
|
- protosym.erase(0, 1);
|
|
|
- CropString(protosym);
|
|
|
- size_t i(protosym.find("."));
|
|
|
- if (i == ConfigString::npos) {
|
|
|
- unqualified[protosym].push_back(SymEnt(SymEnt::CommandEnv,
|
|
|
- NextWord(S), sym, state));
|
|
|
- if (microconfig_cat->is_spam())
|
|
|
- microconfig_cat->spam() << "unqualified symbol '" << protosym
|
|
|
- << "' with value '" << NextWord(S)
|
|
|
- << "'" << endl;
|
|
|
- } else {
|
|
|
- ConfigString scope(protosym.substr(0, i));
|
|
|
- ConfigString sym(protosym.substr(i+1, ConfigString::npos));
|
|
|
- (qualified[scope])[sym].push_back(SymEnt(SymEnt::CommandEnv,
|
|
|
- NextWord(S), sym, state));
|
|
|
- if (microconfig_cat->is_spam())
|
|
|
- microconfig_cat->spam() << "qualified symbol '" << sym
|
|
|
- << "' in scope '" << scope
|
|
|
- << "' and value '" << NextWord(S)
|
|
|
- << "'" << endl;
|
|
|
- }
|
|
|
+ protosym.erase(0, 1);
|
|
|
+ CropString(protosym);
|
|
|
+ size_t i(protosym.find("."));
|
|
|
+ if (i == ConfigString::npos) {
|
|
|
+ unqualified[protosym].push_back(SymEnt(SymEnt::CommandEnv,
|
|
|
+ NextWord(S), sym, state));
|
|
|
+ if (microconfig_cat->is_spam())
|
|
|
+ microconfig_cat->spam() << "unqualified symbol '" << protosym
|
|
|
+ << "' with value '" << NextWord(S)
|
|
|
+ << "'" << endl;
|
|
|
+ } else {
|
|
|
+ ConfigString scope(protosym.substr(0, i));
|
|
|
+ ConfigString sym(protosym.substr(i+1, ConfigString::npos));
|
|
|
+ (qualified[scope])[sym].push_back(SymEnt(SymEnt::CommandEnv,
|
|
|
+ NextWord(S), sym, state));
|
|
|
+ if (microconfig_cat->is_spam())
|
|
|
+ microconfig_cat->spam() << "qualified symbol '" << sym
|
|
|
+ << "' in scope '" << scope
|
|
|
+ << "' and value '" << NextWord(S)
|
|
|
+ << "'" << endl;
|
|
|
+ }
|
|
|
} else if (microconfig_cat->is_spam())
|
|
|
- microconfig_cat->spam() << "'" << protosym
|
|
|
- << "' was not recognized as an option"
|
|
|
- << endl;
|
|
|
+ microconfig_cat->spam() << "'" << protosym
|
|
|
+ << "' was not recognized as an option"
|
|
|
+ << endl;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -283,31 +283,31 @@ void ConfigTable::ParseArgs(void)
|
|
|
size_t i(line.find("."));
|
|
|
ConfigString aparam;
|
|
|
if (n + 1 < num_args) {
|
|
|
- aparam = ExecutionEnvironment::get_arg(n + 1);
|
|
|
+ aparam = ExecutionEnvironment::get_arg(n + 1);
|
|
|
}
|
|
|
|
|
|
if (i == ConfigString::npos) {
|
|
|
- unqualified[line].push_back(SymEnt(SymEnt::Commandline,
|
|
|
- aparam, "", state));
|
|
|
- if (microconfig_cat->is_spam())
|
|
|
- microconfig_cat->spam() << "unqualified symbol '" << line
|
|
|
- << "' with value '" << aparam
|
|
|
- << "'" << endl;
|
|
|
+ unqualified[line].push_back(SymEnt(SymEnt::Commandline,
|
|
|
+ aparam, "", state));
|
|
|
+ if (microconfig_cat->is_spam())
|
|
|
+ microconfig_cat->spam() << "unqualified symbol '" << line
|
|
|
+ << "' with value '" << aparam
|
|
|
+ << "'" << endl;
|
|
|
} else {
|
|
|
- ConfigString scope(line.substr(0, i));
|
|
|
- ConfigString sym(line.substr(i+1, ConfigString::npos));
|
|
|
- (qualified[scope])[sym].push_back(SymEnt(SymEnt::Commandline,
|
|
|
- aparam, "", state));
|
|
|
- if (microconfig_cat->is_spam())
|
|
|
- microconfig_cat->spam() << "qualified symbol '" << sym
|
|
|
- << "' with scope '" << scope
|
|
|
- << "' and value '" << aparam
|
|
|
- << "'" << endl;
|
|
|
+ ConfigString scope(line.substr(0, i));
|
|
|
+ ConfigString sym(line.substr(i+1, ConfigString::npos));
|
|
|
+ (qualified[scope])[sym].push_back(SymEnt(SymEnt::Commandline,
|
|
|
+ aparam, "", state));
|
|
|
+ if (microconfig_cat->is_spam())
|
|
|
+ microconfig_cat->spam() << "qualified symbol '" << sym
|
|
|
+ << "' with scope '" << scope
|
|
|
+ << "' and value '" << aparam
|
|
|
+ << "'" << endl;
|
|
|
}
|
|
|
} else if (microconfig_cat->is_spam()) {
|
|
|
microconfig_cat->spam() << "argument #" << n << " ('" << line
|
|
|
- << "') is not recognized as an option"
|
|
|
- << endl;
|
|
|
+ << "') is not recognized as an option"
|
|
|
+ << endl;
|
|
|
}
|
|
|
++n;
|
|
|
}
|
|
|
@@ -349,149 +349,149 @@ void ConfigTable::MicroConfig(void)
|
|
|
if (!cc.empty()) {
|
|
|
ConfigString configconfig(cc);
|
|
|
if (configconfig.length() > 1) {
|
|
|
- ConfigString assign = "=";
|
|
|
- ConfigString sep = configconfig.substr(0, 1);
|
|
|
- if (microconfig_cat->is_spam())
|
|
|
- microconfig_cat->spam() << "separator character is: '" << sep
|
|
|
- << "'" << endl;
|
|
|
- typedef std::vector<ConfigString> strvec;
|
|
|
- typedef Serialize::Deserializer<strvec, Serialize::StdExt<ConfigString> > deser;
|
|
|
- configconfig.erase(0, 1);
|
|
|
- deser ds(configconfig, sep);
|
|
|
- strvec sv = ds;
|
|
|
- if (microconfig_cat->is_spam())
|
|
|
- microconfig_cat->spam()
|
|
|
- << "extracted vector of microconfig options" << endl;
|
|
|
- for (strvec::iterator i=sv.begin(); i!=sv.end(); ++i) {
|
|
|
- if (microconfig_cat->is_spam())
|
|
|
- microconfig_cat->spam() << "parsing microconfig option '"
|
|
|
- << *i << "'" << endl;
|
|
|
- if ((*i).length() == 1) {
|
|
|
- // new assignment character
|
|
|
- assign += *i;
|
|
|
- continue;
|
|
|
- }
|
|
|
- size_t j = (*i).find_first_of(assign);
|
|
|
- if (j != ConfigString::npos) {
|
|
|
- ConfigString tok = (*i).substr(0, j);
|
|
|
- ConfigString rest = (*i).substr(j+1, ConfigString::npos);
|
|
|
- if (microconfig_cat->is_spam())
|
|
|
- microconfig_cat->spam() << "split microconfig option into '"
|
|
|
- << tok << "' and '" << rest << "'"
|
|
|
- << endl;
|
|
|
- if (tok == "pathsep") {
|
|
|
- pathsep = rest;
|
|
|
- psep = true;
|
|
|
- if (microconfig_cat->is_spam())
|
|
|
- microconfig_cat->spam()
|
|
|
- << "got a microconfig pathsep directive, "
|
|
|
- << "setting the path separator to '" << pathsep << "'"
|
|
|
- << endl;
|
|
|
- } else if (tok == "filesep") {
|
|
|
- filesep = rest;
|
|
|
- fsep = true;
|
|
|
- if (microconfig_cat->is_spam())
|
|
|
- microconfig_cat->spam()
|
|
|
- << "got a microconfig filesep directive, "
|
|
|
- << "setting the file separator to '" << filesep << "'"
|
|
|
- << endl;
|
|
|
- } else if (tok == "configname") {
|
|
|
- configname = rest;
|
|
|
- cname = true;
|
|
|
- if (microconfig_cat->is_spam())
|
|
|
- microconfig_cat->spam()
|
|
|
- << "got a microconfig configname directive, "
|
|
|
- << "setting the configfile name to '" << configname
|
|
|
- << "'" << endl;
|
|
|
- } else if (tok == "configsuffix") {
|
|
|
- configsuffix = rest;
|
|
|
- csuff = true;
|
|
|
- if (microconfig_cat->is_spam())
|
|
|
- microconfig_cat->spam()
|
|
|
- << "got a microconfig configsuffix directive, "
|
|
|
- << "setting the config file suffix to '"
|
|
|
- << configsuffix << "'"
|
|
|
- << endl;
|
|
|
- } else if (tok == "configpath") {
|
|
|
- if (cpath) {
|
|
|
- configpath += " " + rest;
|
|
|
- if (microconfig_cat->is_spam())
|
|
|
- microconfig_cat->spam()
|
|
|
- << "got a microconfig configpath directive, "
|
|
|
- << "adding '" << rest << "' to the configpath"
|
|
|
- << endl;
|
|
|
- } else {
|
|
|
- configpath = rest;
|
|
|
- if (microconfig_cat->is_spam())
|
|
|
- microconfig_cat->spam()
|
|
|
- << "got a microconfig configpath directive, "
|
|
|
- << "setting the configpath to '" << configpath << "'"
|
|
|
- << endl;
|
|
|
- }
|
|
|
- cpath = true;
|
|
|
- } else if (tok == "configcmt") {
|
|
|
- configcmt = rest;
|
|
|
- ccmt = true;
|
|
|
- if (microconfig_cat->is_spam())
|
|
|
- microconfig_cat->spam()
|
|
|
- << "got a microconfig configcmt directive, "
|
|
|
- << "setting the config comment to '" << configcmt
|
|
|
- << "'" << endl;
|
|
|
- } else if (tok == "argsuffix") {
|
|
|
- argsuffix = rest;
|
|
|
- asuff = true;
|
|
|
- if (microconfig_cat->is_spam())
|
|
|
- microconfig_cat->spam()
|
|
|
- << "got a microconfig argsuffix directive, "
|
|
|
- << "setting the argument environment suffix to '"
|
|
|
- << argsuffix << "'" << endl;
|
|
|
- } else if (tok == "commandstub") {
|
|
|
- commandstub = rest;
|
|
|
- cstub = true;
|
|
|
- if (microconfig_cat->is_spam())
|
|
|
- microconfig_cat->spam()
|
|
|
- << "got a microconfig commandstub directive, "
|
|
|
- << "setting the command environment stub "
|
|
|
- << "to '" << commandstub << "'" << endl;
|
|
|
- } else if (tok == "configdbg") {
|
|
|
- configdbg = TrueOrFalse(rest);
|
|
|
- cdbg = true;
|
|
|
- if (configdbg) {
|
|
|
- microconfig_cat->set_severity(NS_spam);
|
|
|
- dconfig_cat->set_severity(NS_spam);
|
|
|
- } else {
|
|
|
- microconfig_cat->set_severity(NS_info);
|
|
|
- dconfig_cat->set_severity(NS_info);
|
|
|
- }
|
|
|
- if (microconfig_cat->is_spam())
|
|
|
- microconfig_cat->spam()
|
|
|
- << "got a microconfig configdbg directive, "
|
|
|
- << "setting the config spam state to " << configdbg
|
|
|
- << endl;
|
|
|
- } else if (tok == "readargs") {
|
|
|
- readargs = TrueOrFalse(rest);
|
|
|
- rdarg = true;
|
|
|
- if (microconfig_cat->is_spam())
|
|
|
- microconfig_cat->spam()
|
|
|
- << "got a microconfig readargs directive, "
|
|
|
- << (readargs?"will":"will not")
|
|
|
- << " read from the commandline." << endl;
|
|
|
- } else if (tok == "readenv") {
|
|
|
- readenvs = TrueOrFalse(rest);
|
|
|
- rdenv = true;
|
|
|
- if (microconfig_cat->is_spam())
|
|
|
- microconfig_cat->spam()
|
|
|
- << "got a microconfig readenv directive, "
|
|
|
- << (readargs?"will":"will not")
|
|
|
- << " read the environment." << endl;
|
|
|
- }
|
|
|
- } else if (microconfig_cat->is_spam())
|
|
|
- microconfig_cat->spam()
|
|
|
- << "no '=' in microconfig option, ignoring it" << endl;
|
|
|
- }
|
|
|
+ ConfigString assign = "=";
|
|
|
+ ConfigString sep = configconfig.substr(0, 1);
|
|
|
+ if (microconfig_cat->is_spam())
|
|
|
+ microconfig_cat->spam() << "separator character is: '" << sep
|
|
|
+ << "'" << endl;
|
|
|
+ typedef std::vector<ConfigString> strvec;
|
|
|
+ typedef Serialize::Deserializer<strvec, Serialize::StdExt<ConfigString> > deser;
|
|
|
+ configconfig.erase(0, 1);
|
|
|
+ deser ds(configconfig, sep);
|
|
|
+ strvec sv = ds;
|
|
|
+ if (microconfig_cat->is_spam())
|
|
|
+ microconfig_cat->spam()
|
|
|
+ << "extracted vector of microconfig options" << endl;
|
|
|
+ for (strvec::iterator i=sv.begin(); i!=sv.end(); ++i) {
|
|
|
+ if (microconfig_cat->is_spam())
|
|
|
+ microconfig_cat->spam() << "parsing microconfig option '"
|
|
|
+ << *i << "'" << endl;
|
|
|
+ if ((*i).length() == 1) {
|
|
|
+ // new assignment character
|
|
|
+ assign += *i;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ size_t j = (*i).find_first_of(assign);
|
|
|
+ if (j != ConfigString::npos) {
|
|
|
+ ConfigString tok = (*i).substr(0, j);
|
|
|
+ ConfigString rest = (*i).substr(j+1, ConfigString::npos);
|
|
|
+ if (microconfig_cat->is_spam())
|
|
|
+ microconfig_cat->spam() << "split microconfig option into '"
|
|
|
+ << tok << "' and '" << rest << "'"
|
|
|
+ << endl;
|
|
|
+ if (tok == "pathsep") {
|
|
|
+ pathsep = rest;
|
|
|
+ psep = true;
|
|
|
+ if (microconfig_cat->is_spam())
|
|
|
+ microconfig_cat->spam()
|
|
|
+ << "got a microconfig pathsep directive, "
|
|
|
+ << "setting the path separator to '" << pathsep << "'"
|
|
|
+ << endl;
|
|
|
+ } else if (tok == "filesep") {
|
|
|
+ filesep = rest;
|
|
|
+ fsep = true;
|
|
|
+ if (microconfig_cat->is_spam())
|
|
|
+ microconfig_cat->spam()
|
|
|
+ << "got a microconfig filesep directive, "
|
|
|
+ << "setting the file separator to '" << filesep << "'"
|
|
|
+ << endl;
|
|
|
+ } else if (tok == "configname") {
|
|
|
+ configname = rest;
|
|
|
+ cname = true;
|
|
|
+ if (microconfig_cat->is_spam())
|
|
|
+ microconfig_cat->spam()
|
|
|
+ << "got a microconfig configname directive, "
|
|
|
+ << "setting the configfile name to '" << configname
|
|
|
+ << "'" << endl;
|
|
|
+ } else if (tok == "configsuffix") {
|
|
|
+ configsuffix = rest;
|
|
|
+ csuff = true;
|
|
|
+ if (microconfig_cat->is_spam())
|
|
|
+ microconfig_cat->spam()
|
|
|
+ << "got a microconfig configsuffix directive, "
|
|
|
+ << "setting the config file suffix to '"
|
|
|
+ << configsuffix << "'"
|
|
|
+ << endl;
|
|
|
+ } else if (tok == "configpath") {
|
|
|
+ if (cpath) {
|
|
|
+ configpath += " " + rest;
|
|
|
+ if (microconfig_cat->is_spam())
|
|
|
+ microconfig_cat->spam()
|
|
|
+ << "got a microconfig configpath directive, "
|
|
|
+ << "adding '" << rest << "' to the configpath"
|
|
|
+ << endl;
|
|
|
+ } else {
|
|
|
+ configpath = rest;
|
|
|
+ if (microconfig_cat->is_spam())
|
|
|
+ microconfig_cat->spam()
|
|
|
+ << "got a microconfig configpath directive, "
|
|
|
+ << "setting the configpath to '" << configpath << "'"
|
|
|
+ << endl;
|
|
|
+ }
|
|
|
+ cpath = true;
|
|
|
+ } else if (tok == "configcmt") {
|
|
|
+ configcmt = rest;
|
|
|
+ ccmt = true;
|
|
|
+ if (microconfig_cat->is_spam())
|
|
|
+ microconfig_cat->spam()
|
|
|
+ << "got a microconfig configcmt directive, "
|
|
|
+ << "setting the config comment to '" << configcmt
|
|
|
+ << "'" << endl;
|
|
|
+ } else if (tok == "argsuffix") {
|
|
|
+ argsuffix = rest;
|
|
|
+ asuff = true;
|
|
|
+ if (microconfig_cat->is_spam())
|
|
|
+ microconfig_cat->spam()
|
|
|
+ << "got a microconfig argsuffix directive, "
|
|
|
+ << "setting the argument environment suffix to '"
|
|
|
+ << argsuffix << "'" << endl;
|
|
|
+ } else if (tok == "commandstub") {
|
|
|
+ commandstub = rest;
|
|
|
+ cstub = true;
|
|
|
+ if (microconfig_cat->is_spam())
|
|
|
+ microconfig_cat->spam()
|
|
|
+ << "got a microconfig commandstub directive, "
|
|
|
+ << "setting the command environment stub "
|
|
|
+ << "to '" << commandstub << "'" << endl;
|
|
|
+ } else if (tok == "configdbg") {
|
|
|
+ configdbg = TrueOrFalse(rest);
|
|
|
+ cdbg = true;
|
|
|
+ if (configdbg) {
|
|
|
+ microconfig_cat->set_severity(NS_spam);
|
|
|
+ dconfig_cat->set_severity(NS_spam);
|
|
|
+ } else {
|
|
|
+ microconfig_cat->set_severity(NS_info);
|
|
|
+ dconfig_cat->set_severity(NS_info);
|
|
|
+ }
|
|
|
+ if (microconfig_cat->is_spam())
|
|
|
+ microconfig_cat->spam()
|
|
|
+ << "got a microconfig configdbg directive, "
|
|
|
+ << "setting the config spam state to " << configdbg
|
|
|
+ << endl;
|
|
|
+ } else if (tok == "readargs") {
|
|
|
+ readargs = TrueOrFalse(rest);
|
|
|
+ rdarg = true;
|
|
|
+ if (microconfig_cat->is_spam())
|
|
|
+ microconfig_cat->spam()
|
|
|
+ << "got a microconfig readargs directive, "
|
|
|
+ << (readargs?"will":"will not")
|
|
|
+ << " read from the commandline." << endl;
|
|
|
+ } else if (tok == "readenv") {
|
|
|
+ readenvs = TrueOrFalse(rest);
|
|
|
+ rdenv = true;
|
|
|
+ if (microconfig_cat->is_spam())
|
|
|
+ microconfig_cat->spam()
|
|
|
+ << "got a microconfig readenv directive, "
|
|
|
+ << (readargs?"will":"will not")
|
|
|
+ << " read the environment." << endl;
|
|
|
+ }
|
|
|
+ } else if (microconfig_cat->is_spam())
|
|
|
+ microconfig_cat->spam()
|
|
|
+ << "no '=' in microconfig option, ignoring it" << endl;
|
|
|
+ }
|
|
|
} else if (microconfig_cat->is_spam())
|
|
|
- microconfig_cat->spam()
|
|
|
- << "CONFIG_CONFIG contains only a single character" << endl;
|
|
|
+ microconfig_cat->spam()
|
|
|
+ << "CONFIG_CONFIG contains only a single character" << endl;
|
|
|
} else if (microconfig_cat->is_spam())
|
|
|
microconfig_cat->spam() << "CONFIG_CONFIG is empty" << endl;
|
|
|
if (!cdbg)
|
|
|
@@ -499,72 +499,72 @@ void ConfigTable::MicroConfig(void)
|
|
|
if (!psep) {
|
|
|
PathSepDefault();
|
|
|
if (microconfig_cat->is_spam())
|
|
|
- microconfig_cat->spam() << "no microconfig for pathsep, "
|
|
|
- << "setting to default '" << pathsep << "'"
|
|
|
- << endl;
|
|
|
+ microconfig_cat->spam() << "no microconfig for pathsep, "
|
|
|
+ << "setting to default '" << pathsep << "'"
|
|
|
+ << endl;
|
|
|
}
|
|
|
if (!fsep) {
|
|
|
FileSepDefault();
|
|
|
if (microconfig_cat->is_spam())
|
|
|
- microconfig_cat->spam() << "no microconfig for filesep, "
|
|
|
- << "setting to default '" << filesep << "'"
|
|
|
- << endl;
|
|
|
+ microconfig_cat->spam() << "no microconfig for filesep, "
|
|
|
+ << "setting to default '" << filesep << "'"
|
|
|
+ << endl;
|
|
|
}
|
|
|
if (!cname) {
|
|
|
ConfigNameDefault();
|
|
|
if (microconfig_cat->is_spam())
|
|
|
- microconfig_cat->spam() << "no microconfig for configname, "
|
|
|
- << "setting to default '" << configname
|
|
|
- << "'" << endl;
|
|
|
+ microconfig_cat->spam() << "no microconfig for configname, "
|
|
|
+ << "setting to default '" << configname
|
|
|
+ << "'" << endl;
|
|
|
}
|
|
|
if (!csuff) {
|
|
|
ConfigSuffixDefault();
|
|
|
if (microconfig_cat->is_spam())
|
|
|
- microconfig_cat->spam() << "no microconfig for configsuffix, "
|
|
|
- << "setting to default '" << configsuffix
|
|
|
- << "'" << endl;
|
|
|
+ microconfig_cat->spam() << "no microconfig for configsuffix, "
|
|
|
+ << "setting to default '" << configsuffix
|
|
|
+ << "'" << endl;
|
|
|
}
|
|
|
if (!cpath) {
|
|
|
ConfigPathDefault();
|
|
|
if (microconfig_cat->is_spam())
|
|
|
- microconfig_cat->spam() << "no microconfig for configpath, "
|
|
|
- << "setting to default '" << configpath
|
|
|
- << "'" << endl;
|
|
|
+ microconfig_cat->spam() << "no microconfig for configpath, "
|
|
|
+ << "setting to default '" << configpath
|
|
|
+ << "'" << endl;
|
|
|
}
|
|
|
if (!ccmt) {
|
|
|
ConfigCmtDefault();
|
|
|
if (microconfig_cat->is_spam())
|
|
|
- microconfig_cat->spam() << "no microconfig for configcmt, "
|
|
|
- << "setting to default '" << configcmt
|
|
|
- << "'" << endl;
|
|
|
+ microconfig_cat->spam() << "no microconfig for configcmt, "
|
|
|
+ << "setting to default '" << configcmt
|
|
|
+ << "'" << endl;
|
|
|
}
|
|
|
if (!asuff) {
|
|
|
ArgSuffixDefault();
|
|
|
if (microconfig_cat->is_spam())
|
|
|
- microconfig_cat->spam() << "no microconfig for argsuffix, "
|
|
|
- << "setting to default '" << argsuffix
|
|
|
- << "'" << endl;
|
|
|
+ microconfig_cat->spam() << "no microconfig for argsuffix, "
|
|
|
+ << "setting to default '" << argsuffix
|
|
|
+ << "'" << endl;
|
|
|
}
|
|
|
if (!cstub) {
|
|
|
CommandStubDefault();
|
|
|
if (microconfig_cat->is_spam())
|
|
|
- microconfig_cat->spam() << "no microconfig for commandstub, "
|
|
|
- << "setting to default '" << commandstub
|
|
|
- << "'" << endl;
|
|
|
+ microconfig_cat->spam() << "no microconfig for commandstub, "
|
|
|
+ << "setting to default '" << commandstub
|
|
|
+ << "'" << endl;
|
|
|
}
|
|
|
if (!rdarg) {
|
|
|
ReadArgsDefault();
|
|
|
if (microconfig_cat->is_spam())
|
|
|
- microconfig_cat->spam() << "no microconfig for readargs, "
|
|
|
- << "setting to default: "
|
|
|
- << (readargs?"true":"false") << endl;
|
|
|
+ microconfig_cat->spam() << "no microconfig for readargs, "
|
|
|
+ << "setting to default: "
|
|
|
+ << (readargs?"true":"false") << endl;
|
|
|
}
|
|
|
if (!rdenv) {
|
|
|
ReadEnvsDefault();
|
|
|
if (microconfig_cat->is_spam())
|
|
|
- microconfig_cat->spam() << "no microconfig for readenv, "
|
|
|
- << "setting to default: "
|
|
|
- << (readargs?"true":"false") << endl;
|
|
|
+ microconfig_cat->spam() << "no microconfig for readenv, "
|
|
|
+ << "setting to default: "
|
|
|
+ << (readargs?"true":"false") << endl;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -576,7 +576,7 @@ void ConfigTable::GetData(void) {
|
|
|
ConfigString comarg = commandstub + argsuffix;
|
|
|
if (microconfig_cat->is_spam())
|
|
|
microconfig_cat->spam() << "comarg is '" << comarg << "'"
|
|
|
- << endl;
|
|
|
+ << endl;
|
|
|
if (ExecutionEnvironment::has_environment_variable(comarg)) {
|
|
|
ConfigString env = ExecutionEnvironment::get_environment_variable(comarg);
|
|
|
ParseCommandEnv(env, comarg);
|
|
|
@@ -585,7 +585,7 @@ void ConfigTable::GetData(void) {
|
|
|
UpCase(line);
|
|
|
if (microconfig_cat->is_spam())
|
|
|
microconfig_cat->spam() << "binarg is '" << line << "'"
|
|
|
- << endl;
|
|
|
+ << endl;
|
|
|
if (ExecutionEnvironment::has_environment_variable(line)) {
|
|
|
ConfigString env = ExecutionEnvironment::get_environment_variable(line);
|
|
|
ParseCommandEnv(env, line);
|
|
|
@@ -632,13 +632,13 @@ bool ConfigTable::TrueOrFalse(const ConfigString& in, bool def) {
|
|
|
}
|
|
|
|
|
|
bool ConfigTable::Defined(const ConfigString& sym,
|
|
|
- const ConfigString qual) {
|
|
|
+ const ConfigString qual) {
|
|
|
#ifdef DISABLE_CONFIG
|
|
|
return false;
|
|
|
#else
|
|
|
if (qual.empty()) {
|
|
|
return (unqualified.count(sym) != 0 ||
|
|
|
- ExecutionEnvironment::has_environment_variable(sym));
|
|
|
+ ExecutionEnvironment::has_environment_variable(sym));
|
|
|
|
|
|
} else {
|
|
|
TableMap::const_iterator ti;
|
|
|
@@ -646,7 +646,7 @@ bool ConfigTable::Defined(const ConfigString& sym,
|
|
|
if (ti != qualified.end()) {
|
|
|
const SymbolTable &table = (*ti).second;
|
|
|
if (table.count(sym) != 0) {
|
|
|
- return true;
|
|
|
+ return true;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -656,7 +656,7 @@ bool ConfigTable::Defined(const ConfigString& sym,
|
|
|
}
|
|
|
|
|
|
ConfigTable::SymEnt ConfigTable::Get(const ConfigString& sym,
|
|
|
- const ConfigString qual) {
|
|
|
+ const ConfigString qual) {
|
|
|
#ifndef DISABLE_CONFIG
|
|
|
const ConfigTable::Symbol &symbol = GetSym(sym, qual);
|
|
|
if (!symbol.empty()) {
|
|
|
@@ -680,7 +680,7 @@ ConfigTable::SymEnt ConfigTable::Get(const ConfigString& sym,
|
|
|
}
|
|
|
|
|
|
const ConfigTable::Symbol& ConfigTable::GetSym(const ConfigString& sym,
|
|
|
- const ConfigString qual) {
|
|
|
+ const ConfigString qual) {
|
|
|
static ConfigTable::Symbol empty_symbol;
|
|
|
|
|
|
#ifndef DISABLE_CONFIG
|
|
|
@@ -700,7 +700,7 @@ const ConfigTable::Symbol& ConfigTable::GetSym(const ConfigString& sym,
|
|
|
SymbolTable::const_iterator si;
|
|
|
si = table.find(sym);
|
|
|
if (si != table.end()) {
|
|
|
- return (*si).second;
|
|
|
+ return (*si).second;
|
|
|
}
|
|
|
}
|
|
|
}
|