From a36b1d4083e5cf34df1b217516be28471e7d0dc7 Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Sun, 15 Jan 2006 18:20:18 +0000 Subject: New plugin loader. Solves the crashes introduced with the .bss changes while keeping the small binary size. The model & api version check is now part of the plugin loader. Codecs are not yet adapted, but the old method still works for them. Simulator plugins are not (yet) version-checked. API version numbering restarted, as this is an all-new system. Uses the target ID from configure, so don't change that too often. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8349 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/searchengine/Makefile | 2 +- apps/plugins/searchengine/searchengine.c | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) (limited to 'apps/plugins/searchengine') diff --git a/apps/plugins/searchengine/Makefile b/apps/plugins/searchengine/Makefile index efa7d95..baa0020 100644 --- a/apps/plugins/searchengine/Makefile +++ b/apps/plugins/searchengine/Makefile @@ -10,7 +10,7 @@ INCLUDES = -I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \ -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR) CFLAGS = $(GCCOPTS) -O3 $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) \ - -DMEM=${MEMORYSIZE} -DPLUGIN + -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN ifdef APPEXTRA INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) diff --git a/apps/plugins/searchengine/searchengine.c b/apps/plugins/searchengine/searchengine.c index 8953ba7..b585c25 100644 --- a/apps/plugins/searchengine/searchengine.c +++ b/apps/plugins/searchengine/searchengine.c @@ -21,6 +21,8 @@ #include "token.h" #include "dbinterface.h" +PLUGIN_HEADER + void *audio_bufferbase; void *audio_bufferpointer; unsigned int audio_buffer_free; @@ -58,15 +60,10 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) { unsigned char *result,buf[500]; int parsefd,hits; - /* this macro should be called as the first thing you do in the plugin. - it test that the api version and model the plugin was compiled for - matches the machine it is running on */ - TEST_PLUGIN_API(api); - /* if you are using a global api pointer, don't forget to copy it! otherwise you will get lovely "I04: IllInstr" errors... :-) */ rb = api; - + audio_bufferbase=audio_bufferpointer=0; audio_buffer_free=0; -- cgit v1.1