00001 /*************************************************************************** 00002 pluginloader.h - description 00003 ------------------- 00004 begin : Fri Jan 4 2002 00005 copyright : (C) 2002 by Christian Tusche 00006 email : christian.tusche@stud.uni-goettingen.de 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 00018 #ifndef PLUGINLOADER_H 00019 #define PLUGINLOADER_H 00020 00021 #include "String.h" 00022 #include <vector.h> 00023 00024 00029 class PluginLoader { 00030 public: 00031 PluginLoader(); 00032 virtual ~PluginLoader(); 00033 00037 virtual int AddDir( const char *dir ); 00038 00043 virtual int AddModul( const char *libname ); 00044 00047 virtual void CloseModuls( void ); 00048 00049 protected: 00052 struct modul_data { 00053 String Name; // Dateiname 00054 void *dl_handle; // Handle für libdl 00055 00056 // dynamisch geladene Funktionen 00057 const char *(*InitModul)(void); // Modul initialisieren - liefert String mit Modultyp 00058 void *(*ModulInfo)(void); // Info-Struktur des Moduls abfragen 00059 void (*DeleteModul)(void); // Modul beenden 00060 00061 String Typ; // Modultyp 00062 }; 00063 00066 vector<modul_data *> module; 00067 00072 virtual int RegisterModul( modul_data *data ) { return 0; } 00073 }; 00074 00075 #endif