84
// ============================ Class factories======================================== //
85
// This is "allways the same" code, just change the plugin name in the printf and the
87
extern "C" iList* create() {
83
extern "C" interface * create() {
88
84
return new iCompressed;
91
extern "C" void destroy(iList* p) {
87
extern "C" void destroy(interface * p) {
88
delete (iCompressed*)p;
95
extern "C" int getVersion(){ //To save crashes from older versions
91
extern "C" int getVersion() {
96
92
return MANAGER_VERSION;
99
// ============================== REGISTER ============================================ //
100
// Here is where we register the new plugin, what we do is to add a map with the plugin
101
// name and the mime file types it can load, then, the pluginManager will take care of wich
102
// plugin load, depending on its file type. Just add more than one file type adding this
103
// two lines as many times you want.
105
// itself.filetype = "image/bmp"; // Add another extension supported
106
// pluginVector.push_back(itself); // Add filetype that plugin reads
113
factory_list[PLUGIN_NAME] = create;
114
factoryDestroy_list[PLUGIN_NAME] = destroy;
116
plugin_filetype itself = {
122
if(interface::is_program_available("7z"))
123
pluginVector.push_back(itself);
125
if(interface::is_program_available("unrar")) {
126
itself.filetype = GP_COMPRESSED_RAR;
127
pluginVector.push_back(itself);
129
itself.filetype = GP_COMPRESSED_RAR_X;
130
pluginVector.push_back(itself);
133
if(interface::is_program_available("tar")) {
134
itself.filetype = GP_COMPRESSED_TAR;
135
pluginVector.push_back(itself);
137
itself.filetype = GP_COMPRESSED_TAR_7Z;
138
pluginVector.push_back(itself);
140
itself.filetype = GP_COMPRESSED_TAR_BZIP;
141
pluginVector.push_back(itself);
143
itself.filetype = GP_COMPRESSED_TAR_LZIP;
144
pluginVector.push_back(itself);
146
itself.filetype = GP_COMPRESSED_TAR_LZMA;
147
pluginVector.push_back(itself);
149
itself.filetype = GP_COMPRESSED_TAR_LZOP;
150
pluginVector.push_back(itself);
152
itself.filetype = GP_COMPRESSED_TAR_X;
153
pluginVector.push_back(itself);
155
itself.filetype = GP_COMPRESSED_TAR_XZ;
156
pluginVector.push_back(itself);
158
itself.filetype = GP_COMPRESSED_TAR_Z;
159
pluginVector.push_back(itself);
162
if(interface::is_program_available("zipinfo")) {
163
itself.filetype = GP_COMPRESSED_ZIP;
164
pluginVector.push_back(itself);
168
proxy p; // When we open the dll with RTLD_NOW it creates p, and in consequence, it registers the plugin
99
PluginManager::register_plugin("compressed");
101
if(interface::is_program_available("7z")) {
102
PluginManager::register_filetype(GP_COMPRESSED_7Z, 1);
105
if(interface::is_program_available("unrar")) {
106
PluginManager::register_filetype(GP_COMPRESSED_RAR, 1);
107
PluginManager::register_filetype(GP_COMPRESSED_RAR_X, 1);
110
if(interface::is_program_available("tar")) {
111
PluginManager::register_filetype(GP_COMPRESSED_TAR, 1);
112
PluginManager::register_filetype(GP_COMPRESSED_TAR_7Z, 1);
113
PluginManager::register_filetype(GP_COMPRESSED_TAR_BZIP, 1);
114
PluginManager::register_filetype(GP_COMPRESSED_TAR_LZIP, 1);
115
PluginManager::register_filetype(GP_COMPRESSED_TAR_LZMA, 1);
116
PluginManager::register_filetype(GP_COMPRESSED_TAR_LZOP, 1);
117
PluginManager::register_filetype(GP_COMPRESSED_TAR_X, 1);
118
PluginManager::register_filetype(GP_COMPRESSED_TAR_XZ, 1);
119
PluginManager::register_filetype(GP_COMPRESSED_TAR_Z, 1);
122
if(interface::is_program_available("zipinfo")) {
123
PluginManager::register_filetype(GP_COMPRESSED_ZIP, 1);