From 0c458c043a2e95cfed15d143ff0053b44b6a425c Mon Sep 17 00:00:00 2001 From: Linus Nielsen Feltzing Date: Tue, 13 Jul 2004 14:01:41 +0000 Subject: The plugin API now supports ctype macros like tolower() and friends git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4872 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugin.c | 9 ++++++--- apps/plugin.h | 12 +++++++----- apps/plugins/viewer.c | 9 --------- firmware/include/ctype.h | 4 ++++ 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/apps/plugin.c b/apps/plugin.c index e9c538fd78..983e4991b9 100644 --- a/apps/plugin.c +++ b/apps/plugin.c @@ -21,6 +21,7 @@ #include #include #include +#include #include "debug.h" #include "button.h" #include "lcd.h" @@ -147,6 +148,9 @@ static struct plugin_api rockbox_api = { strlen, memset, memcpy, +#ifndef SIMULATOR + _ctype_, +#endif /* sound */ #ifndef SIMULATOR @@ -209,6 +213,7 @@ static struct plugin_api rockbox_api = { mpeg_next_track, playlist_amount, mpeg_status, + mpeg_has_changed_track, #ifdef HAVE_LCD_BITMAP font_get, #endif @@ -230,6 +235,7 @@ static struct plugin_api rockbox_api = { #endif battery_level, set_time, + reset_poweroff_timer, backlight_on, backlight_off, @@ -237,9 +243,6 @@ static struct plugin_api rockbox_api = { #ifdef HAVE_LCD_CHARCELLS lcd_icon, #endif - - reset_poweroff_timer, - mpeg_has_changed_track, }; int plugin_load(char* plugin, void* parameter) diff --git a/apps/plugin.h b/apps/plugin.h index 5b3193c42b..d9b32055d6 100644 --- a/apps/plugin.h +++ b/apps/plugin.h @@ -60,12 +60,12 @@ #endif /* increase this every time the api struct changes */ -#define PLUGIN_API_VERSION 18 +#define PLUGIN_API_VERSION 19 /* update this to latest version if a change to the api struct breaks backwards compatibility (and please take the opportunity to sort in any new function which are "waiting" at the end of the function table) */ -#define PLUGIN_MIN_API_VERSION 18 +#define PLUGIN_MIN_API_VERSION 19 /* plugin return codes */ enum plugin_status { @@ -176,6 +176,9 @@ struct plugin_api { size_t (*strlen)(const char *str); void* (*memset)(void *dst, int c, size_t length); void* (*memcpy)(void *out, const void *in, size_t n); +#ifndef SIMULATOR + char *_ctype_; +#endif /* sound */ #ifndef SIMULATOR @@ -240,6 +243,7 @@ struct plugin_api { struct mp3entry* (*mpeg_next_track)(void); int (*playlist_amount)(void); int (*mpeg_status)(void); + bool (*mpeg_has_changed_track)(void); #ifdef HAVE_LCD_BITMAP struct font* (*font_get)(int font); @@ -267,6 +271,7 @@ struct plugin_api { #endif int (*battery_level)(void); int (*set_time)(struct tm *tm); + void (*reset_poweroff_timer)(void); void (*backlight_on)(void); void (*backlight_off)(void); @@ -274,9 +279,6 @@ struct plugin_api { #ifdef HAVE_LCD_CHARCELLS void (*lcd_icon)(int icon, bool enable); #endif - - void (*reset_poweroff_timer)(void); - bool (*mpeg_has_changed_track)(void); }; /* defined by the plugin loader (plugin.c) */ diff --git a/apps/plugins/viewer.c b/apps/plugins/viewer.c index d8d6b516bd..a593da28e7 100644 --- a/apps/plugins/viewer.c +++ b/apps/plugins/viewer.c @@ -18,17 +18,8 @@ * ****************************************************************************/ #include "plugin.h" - -#ifdef HAVE_LCD_BITMAP -#include "recorder/widgets.h" -#endif - #include -#ifndef SIMULATOR -#include -#endif - #if PLUGIN_API_VERSION < 3 #error Scrollbar function requires PLUGIN_API_VERSION 3 at least #endif diff --git a/firmware/include/ctype.h b/firmware/include/ctype.h index b6d8a43492..c72a256e4b 100644 --- a/firmware/include/ctype.h +++ b/firmware/include/ctype.h @@ -36,7 +36,11 @@ int _EXFUN(_toupper, (int __c)); #define _X 0100 #define _B 0200 +#ifdef PLUGIN +#define _ctype_ (rb->_ctype_) +#else extern char _ctype_[]; +#endif #ifndef __cplusplus #define isalpha(c) ((_ctype_+1)[(unsigned)(c)]&(_U|_L)) -- cgit v1.2.3