summaryrefslogtreecommitdiffabout
path: root/lib/sitespace.cc
authorMichael Krelin <hacker@klever.net>2005-04-25 16:36:32 (UTC)
committer Michael Krelin <hacker@klever.net>2005-04-25 16:36:32 (UTC)
commit981b219f5297ad2ccc1fc1d0e24e41ec009c35a3 (patch) (side-by-side diff)
tree9fa81d7fe70883ad26d946c902ba06edcebd4516 /lib/sitespace.cc
parent54e344b7e3623e807b893b7febad3adfc6c1648f (diff)
downloadsitecing-981b219f5297ad2ccc1fc1d0e24e41ec009c35a3.zip
sitecing-981b219f5297ad2ccc1fc1d0e24e41ec009c35a3.tar.gz
sitecing-981b219f5297ad2ccc1fc1d0e24e41ec009c35a3.tar.bz2
moved a few utility functions to konforka and bumped konforka version requirement accordingly
Diffstat (limited to 'lib/sitespace.cc') (more/less context) (show whitespace changes)
-rw-r--r--lib/sitespace.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/sitespace.cc b/lib/sitespace.cc
index 0406d11..d5592bf 100644
--- a/lib/sitespace.cc
+++ b/lib/sitespace.cc
@@ -1,52 +1,53 @@
#ifdef USE_PCH
#include "pch.h"
#else
#include <cassert>
+ #include <konforka/util.h>
#include "sitecing/sitespace.h"
#include "sitecing/sitecing_util.h"
#endif
namespace sitecing {
sitespace::sitespace(configuration& c)
: config(c), factory(c) { }
sitespace::~sitespace() {
for(sentenced_t::iterator i = sentenced.begin();i!=sentenced.end();++i) {
assert((*i)->chickens_used.empty());
delete *i;
}
}
so_component sitespace::fetch(const string& c,sitecing_interface* scif) {
execute_sentenced();
- string sobase = normalize_path(c);
+ string sobase = konforka::normalize_path(c);
string sopath = factory.root_so+sobase+".so";
config_options *co_build = config.lookup_config(sobase,config_options::flag_build);
if( (!co_build) || co_build->build )
factory.make(sopath);
components_t::iterator i = components.find(sopath);
if(i!=components.end()) {
if(i->second->is_uptodate())
return so_component(i->second,scif);
if(i->second->chickens_used.empty()) {
delete i->second;
}else{
sentenced.push_back(i->second);
}
components.erase(i);
}
pair<components_t::iterator,bool> ins = components.insert(components_t::value_type(sopath,new component_so(sopath)));
return so_component(ins.first->second,scif);
}
void sitespace::execute_sentenced() {
for(sentenced_t::iterator i = sentenced.begin();i!=sentenced.end();++i) {
if((*i)->chickens_used.empty()) {
delete *i;
sentenced.erase(i);
}
}
}
}