if (!strcmp(fqn, "process.threads"))
{
if (cpu == -1)
- ParseError("%s - cpu must be an integer in the range"
+ ParseError("%s - cpu(%d) must be an integer in the range"
" of 0 < cpu < max_cpus", fqn, cpu);
else if ((source.empty()) && (thread == -1))
// set methods
//-------------------------------------------------------------------------
-static const Parameter* get_params(string& sfx, const Parameter* p)
+static const Parameter* get_params(const string& sfx, const Parameter* p)
{
size_t pos = sfx.find_first_of('.');
+ std::string new_fqn;
if ( pos == string::npos )
- return p;
-
- sfx.erase(0, pos+1);
- string name = sfx.substr(0, sfx.find_first_of('.'));
+ new_fqn = sfx;
+ else
+ new_fqn = sfx.substr(pos + 1);
+ string name = new_fqn.substr(0, new_fqn.find_first_of('.'));
while ( p->name && name != p->name )
++p;
p->type != Parameter::PT_LIST )
return p;
+ if (new_fqn.find_first_of('.') == std::string::npos)
+ return p;
+
p = (const Parameter*)p->range;
- return get_params(sfx, p);
+ return get_params(new_fqn, p);
}
// FIXIT-M vars may have been defined on command line
Module* m = h->mod;
+ if (strcmp(m->get_name(), s))
+ {
+ std::string fqn = s;
+ const Parameter* const p = get_params(fqn, m->get_parameters());
+
+ if ( !p )
+ {
+ ParseError("can't find %s\n", s);
+ return false;
+ }
+ else if ((idx > 0) && (p->type == Parameter::PT_TABLE))
+ {
+ ParseError("%s is a table. All elements must be name\n", s);
+ return false;
+ }
+ }
+
if ( s_current != key )
{
LogMessage("\t %s\n", key.c_str());
// get special options first
while ( al.get_arg(key, val) )
- set(key, val, sc, false);
+ ::set(key, val, sc, false);
// now get the rest
al.reset();
while ( al.get_arg(key, val) )
- set(key, val, sc, true);
+ ::set(key, val, sc, true);
check_flags(sc);