##// END OF EJS Templates
Étiquette socexplorer-0.6-4 ajoutée à la révision 15a9528f5add
Étiquette socexplorer-0.6-4 ajoutée à la révision 15a9528f5add

File last commit:

r100:11a895cff789 pre-0.7
r105:b1bec15e5c8a 0.6
Show More
unixpluginloader.cpp
38 lines | 884 B | text/x-c | CppLexer
#include "unixpluginloader.h"
#include <stdio.h>
#include <QDebug>
unixPluginLoader::unixPluginLoader(const QString &libPath)
{
qDebug()<<"try to open "+libPath;
dlHandle = dlopen(libPath.toStdString().c_str(),RTLD_LAZY|RTLD_GLOBAL);
if(dlHandle==NULL)
qDebug() << "Failed"<< dlerror();
else
qDebug() << "Success";
this->libPath = libPath;
}
void *unixPluginLoader::resolve(const QString &symbol)
{
if(dlHandle!=NULL)
{
qDebug()<<"try to resolve "+symbol+" in "+libPath;
void* sym = dlsym (dlHandle, symbol.toStdString().c_str());
if(sym==NULL)
qDebug() << "Failed"<< dlerror();
else
qDebug() << "Success";
return sym;
}
return NULL;
}
void unixPluginLoader::close()
{
if(dlHandle!=NULL)
{
dlclose(dlHandle);
qDebug() << dlerror();
}
}