+void Component::Loader::modular()
+{
+ if(comp.type!=PROGRAM)
+ throw Msp::Exception("Only programs can be modular");
+ comp.modular=true;
+}
+
+void Component::Loader::host(const string &n)
+{
+ const ComponentList &comps=comp.pkg.get_components();
+ for(ComponentList::const_iterator i=comps.begin(); i!=comps.end(); ++i)
+ if(i->get_name()==n)
+ {
+ if(i->get_type()!=PROGRAM || !i->get_modular())
+ throw Msp::Exception("Module host must be a modular program");
+ comp.module_host=&*i;
+ return;
+ }
+
+ throw Msp::Exception("Unknown component");
+}
+