aboutsummaryrefslogtreecommitdiff
path: root/backends/plugins
diff options
context:
space:
mode:
authorTony Puccinelli2010-08-07 22:30:18 +0000
committerTony Puccinelli2010-08-07 22:30:18 +0000
commit9cf5dedca53b04403977baa95848ddab231d1c17 (patch)
tree8727f8f5b99b49cc12e1d75678a093298b604a92 /backends/plugins
parentde1e941370b7e2fad704e072eccfb79b3db1399b (diff)
downloadscummvm-rg350-9cf5dedca53b04403977baa95848ddab231d1c17.tar.gz
scummvm-rg350-9cf5dedca53b04403977baa95848ddab231d1c17.tar.bz2
scummvm-rg350-9cf5dedca53b04403977baa95848ddab231d1c17.zip
got rid of rest of leftover stuff from GP2X-WIZ elf-loader attempt
svn-id: r51846
Diffstat (limited to 'backends/plugins')
-rw-r--r--backends/plugins/gp2xwiz/gp2xwiz-provider.cpp108
-rw-r--r--backends/plugins/gp2xwiz/gp2xwiz-provider.h43
2 files changed, 0 insertions, 151 deletions
diff --git a/backends/plugins/gp2xwiz/gp2xwiz-provider.cpp b/backends/plugins/gp2xwiz/gp2xwiz-provider.cpp
deleted file mode 100644
index 859ac8fbc8..0000000000
--- a/backends/plugins/gp2xwiz/gp2xwiz-provider.cpp
+++ /dev/null
@@ -1,108 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $URL$
- * $Id$
- *
- */
-
-#if defined(DYNAMIC_MODULES) && defined(GP2XWIZ)
-
-#include "backends/plugins/gp2xwiz/gp2xwiz-provider.h"
-#include "backends/plugins/dynamic-plugin.h"
-#include "common/fs.h"
-
-#include "backends/platform/gp2xwiz/gp2xwiz-loader.h"
-
-
-class GP2XWIZPlugin : public DynamicPlugin {
-protected:
- void *_dlHandle;
- Common::String _filename;
-
- virtual VoidFunc findSymbol(const char *symbol) {
- void *func = dlsym(_dlHandle, symbol);
- if (!func)
- warning("Failed loading symbol '%s' from plugin '%s' (%s)", symbol, _filename.c_str(), dlerror());
-
- // FIXME HACK: This is a HACK to circumvent a clash between the ISO C++
- // standard and POSIX: ISO C++ disallows casting between function pointers
- // and data pointers, but dlsym always returns a void pointer. For details,
- // see e.g. <http://www.trilithium.com/johan/2004/12/problem-with-dlsym/>.
- assert(sizeof(VoidFunc) == sizeof(func));
- VoidFunc tmp;
- memcpy(&tmp, &func, sizeof(VoidFunc));
- return tmp;
- }
-
-public:
- GP2XWIZPlugin(const Common::String &filename)
- : _dlHandle(0), _filename(filename) {}
-
- ~GP2XWIZPlugin() {
- if (_dlHandle) unloadPlugin();
- }
-
- bool loadPlugin() {
- assert(!_dlHandle);
- _dlHandle = dlopen(_filename.c_str(), RTLD_LAZY);
-
- if (!_dlHandle) {
- warning("Failed loading plugin '%s' (%s)", _filename.c_str(), dlerror());
- return false;
- }
-
- bool ret = DynamicPlugin::loadPlugin();
-
- if (ret)
- dlforgetsyms(_dlHandle);
-
- return ret;
- }
-
- void unloadPlugin() {
- DynamicPlugin::unloadPlugin();
- if (_dlHandle) {
- if (dlclose(_dlHandle) != 0)
- warning("Failed unloading plugin '%s' (%s)", _filename.c_str(), dlerror());
- _dlHandle = 0;
- }
- }
-};
-
-
-Plugin* GP2XWIZPluginProvider::createPlugin(const Common::FSNode &node) const {
- return new GP2XWIZPlugin(node.getPath());
-}
-
-bool GP2XWIZPluginProvider::isPluginFilename(const Common::FSNode &node) const {
- // Check the plugin suffix
- Common::String filename = node.getName();
- printf("Testing name %s", filename.c_str());
- if (!filename.hasSuffix(".PLG") && !filename.hasSuffix(".plg") && !filename.hasSuffix(".PLUGIN") && !filename.hasSuffix(".plugin")) {
- printf(" fail.\n");
- return false;
- }
-
- printf(" success!\n");
- return true;
-}
-
-#endif // defined(DYNAMIC_MODULES) && defined(GP2XWIZ)
diff --git a/backends/plugins/gp2xwiz/gp2xwiz-provider.h b/backends/plugins/gp2xwiz/gp2xwiz-provider.h
deleted file mode 100644
index 929a9af1f6..0000000000
--- a/backends/plugins/gp2xwiz/gp2xwiz-provider.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $URL: https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2010-plugins/backends/plugins/ps2/ps2-provider.h $
- * $Id: ps2-provider.h 49435 2010-06-05 01:05:19Z toneman1138 $
- *
- */
-
-#ifndef BACKENDS_PLUGINS_GP2XWIZ_GP2XWIZ_PROVIDER_H
-#define BACKENDS_PLUGINS_GP2XWIZ_GP2XWIZ_PROVIDER_H
-
-#include "base/plugins.h"
-
-#if defined(DYNAMIC_MODULES) && defined(GP2XWIZ)
-
-class GP2XWIZPluginProvider : public FilePluginProvider {
-protected:
- Plugin* createPlugin(const Common::FSNode &node) const;
-
- bool isPluginFilename(const Common::FSNode &node) const;
-
-};
-
-#endif // defined(DYNAMIC_MODULES) && defined(GP2XWIZ)
-
-#endif /* BACKENDS_PLUGINS_GP2XWIZ_GP2XWIZ_PROVIDER_H */