4
//=============================================================================
7
// Creation date : Wed Apr 11 04 2007 00:54:00 GMT+1 by TheXception
9
// This file is part of the KVIrc irc client distribution
10
// Copyright (C) 2007-2008 TheXception
12
// This program is FREE software. You can redistribute it and/or
13
// modify it under the terms of the GNU General Public License
14
// as published by the Free Software Foundation; either version 2
15
// of the License, or (at your opinion) any later version.
17
// This program is distributed in the HOPE that it will be USEFUL,
18
// but WITHOUT ANY WARRANTY; without even the implied warranty of
19
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20
// See the GNU General Public License for more details.
22
// You should have received a copy of the GNU General Public License
23
// along with this program. If not, write to the Free Software Foundation,
24
// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26
//=============================================================================
28
#include "KviModule.h"
29
#include "KviPointerHashTable.h"
32
typedef int (*plugin_function)(int argc, char* argv[], char ** buffer);
33
typedef int (*plugin_unload)();
34
typedef int (*plugin_canunload)();
35
typedef int (*plugin_load)();
36
typedef int (*plugin_free)(char * pBuffer);
41
// You have to create plugin instance by calling Plugin::load()
42
Plugin(QLibrary * pLibrary,const QString& name);
51
static Plugin* load(const QString& szFileName);
52
bool pfree(char * pBuffer);
55
int call(const QString& szFunctionName, int argc, char * argv[], char ** pBuffer);
57
void setName(const QString& szName);
70
KviPointerHashTable<QString,Plugin> * m_pPluginDict;
72
bool pluginCall(KviKvsModuleFunctionCall *c);
76
bool findPlugin(QString& szName);
77
bool isPluginLoaded(const QString& szFileNameOrPathToLoad);
78
bool loadPlugin(const QString& szPluginPath);
79
Plugin * getPlugin(const QString& szPluginPath);