Permalink
Browse files

try to dlopen any file in datasources dir

  • Loading branch information...
artemp committed Sep 8, 2005
1 parent 2a4f257 commit e9fff475be4d357437daf6c465c8d727285da56e
Showing with 14 additions and 24 deletions.
  1. +14 −24 src/datasource_cache.cpp
View
@@ -98,30 +98,20 @@ namespace mapnik
if (!is_directory( *itr ))
{
std::string file_name(str+"/"+itr->leaf());
-
- if (file_name=="." || file_name=="..")
- continue;
- std::string::size_type len=file_name.size();
-
- if (len>3 &&
- file_name[len-1]=='o' &&
- file_name[len-2]=='s')
- {
- lt_dlhandle module=lt_dlopenext(file_name.c_str());
- if (module)
- {
- datasource_name* ds_name = (datasource_name*) lt_dlsym(module, "datasource_name");
- if (ds_name && insert(ds_name(),module))
- {
- std::cout<<"registered datasource : "<<ds_name()<<std::endl;
- registered_=true;
- }
- }
- else
- {
- std::cerr<<lt_dlerror()<<std::endl;
- }
- }
+ lt_dlhandle module=lt_dlopenext(file_name.c_str());
+ if (module)
+ {
+ datasource_name* ds_name = (datasource_name*) lt_dlsym(module, "datasource_name");
+ if (ds_name && insert(ds_name(),module))
+ {
+ std::cout<<"registered datasource : "<<ds_name()<<std::endl;
+ registered_=true;
+ }
+ }
+ else
+ {
+ std::cerr<<lt_dlerror()<<std::endl;
+ }
}
}

0 comments on commit e9fff47

Please sign in to comment.