summaryrefslogtreecommitdiffstats
path: root/uisimulator
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2006-01-16 23:20:58 +0000
committerJens Arnold <amiconn@rockbox.org>2006-01-16 23:20:58 +0000
commita79027743ab00911a839a76420e7e26a741ceee3 (patch)
tree7c60fd12ef0405dfff7ff7af46379ef40d6d0f74 /uisimulator
parent137501b9ac11032f57c63b4f90ec9379bf134b08 (diff)
downloadrockbox-a79027743ab00911a839a76420e7e26a741ceee3.tar.gz
rockbox-a79027743ab00911a839a76420e7e26a741ceee3.tar.bz2
rockbox-a79027743ab00911a839a76420e7e26a741ceee3.zip
Model & version check for simulator plugins.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8356 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'uisimulator')
-rw-r--r--uisimulator/common/io.c25
-rwxr-xr-xuisimulator/win32/plugin.def3
2 files changed, 11 insertions, 17 deletions
diff --git a/uisimulator/common/io.c b/uisimulator/common/io.c
index a5353af5e5..1871b29395 100644
--- a/uisimulator/common/io.c
+++ b/uisimulator/common/io.c
@@ -303,7 +303,7 @@ int sim_fsync(int fd)
#include <dlfcn.h>
#endif
-void *sim_codec_load_ram(char* codecptr, int size,
+void *sim_codec_load_ram(char* codecptr, int size,
void* ptr2, int bufwrap, int *pd_fd)
{
void *pd;
@@ -372,22 +372,21 @@ void *sim_codec_load_ram(char* codecptr, int size,
void sim_codec_close(int pd)
{
- dlclose((void *)pd);
+ dlclose((void *)pd);
}
void *sim_plugin_load(char *plugin, int *fd)
{
- void* pd;
+ void *pd, *hdr;
char path[256];
- int (*plugin_start)(void * api, void* param);
#ifdef WIN32
char buf[256];
#endif
snprintf(path, sizeof path, "archos%s", plugin);
-
- *fd = -1;
+ *fd = 0;
+
pd = dlopen(path, RTLD_NOW);
if (!pd) {
DEBUGF("failed to load %s\n", plugin);
@@ -402,16 +401,12 @@ void *sim_plugin_load(char *plugin, int *fd)
return NULL;
}
- plugin_start = dlsym(pd, "plugin_start");
- if (!plugin_start) {
- plugin_start = dlsym(pd, "_plugin_start");
- if (!plugin_start) {
- dlclose(pd);
- return NULL;
- }
- }
+ hdr = dlsym(pd, "__header");
+ if (!hdr)
+ hdr = dlsym(pd, "___header");
+
*fd = (int)pd; /* success */
- return plugin_start;
+ return hdr; /* maybe NULL if symbol not present */
}
void sim_plugin_close(int pd)
diff --git a/uisimulator/win32/plugin.def b/uisimulator/win32/plugin.def
index 403b2d1ff4..e37ce20d8f 100755
--- a/uisimulator/win32/plugin.def
+++ b/uisimulator/win32/plugin.def
@@ -1,3 +1,2 @@
EXPORTS
- plugin_start
-
+ __header