1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Linus Nielsen Feltzing 2004-07-13 14:01:41 +00:00
parent ae9b319ec5
commit 0c458c043a
4 changed files with 17 additions and 17 deletions

View file

@ -21,6 +21,7 @@
#include <stdio.h> #include <stdio.h>
#include <atoi.h> #include <atoi.h>
#include <timefuncs.h> #include <timefuncs.h>
#include <ctype.h>
#include "debug.h" #include "debug.h"
#include "button.h" #include "button.h"
#include "lcd.h" #include "lcd.h"
@ -147,6 +148,9 @@ static struct plugin_api rockbox_api = {
strlen, strlen,
memset, memset,
memcpy, memcpy,
#ifndef SIMULATOR
_ctype_,
#endif
/* sound */ /* sound */
#ifndef SIMULATOR #ifndef SIMULATOR
@ -209,6 +213,7 @@ static struct plugin_api rockbox_api = {
mpeg_next_track, mpeg_next_track,
playlist_amount, playlist_amount,
mpeg_status, mpeg_status,
mpeg_has_changed_track,
#ifdef HAVE_LCD_BITMAP #ifdef HAVE_LCD_BITMAP
font_get, font_get,
#endif #endif
@ -230,6 +235,7 @@ static struct plugin_api rockbox_api = {
#endif #endif
battery_level, battery_level,
set_time, set_time,
reset_poweroff_timer,
backlight_on, backlight_on,
backlight_off, backlight_off,
@ -237,9 +243,6 @@ static struct plugin_api rockbox_api = {
#ifdef HAVE_LCD_CHARCELLS #ifdef HAVE_LCD_CHARCELLS
lcd_icon, lcd_icon,
#endif #endif
reset_poweroff_timer,
mpeg_has_changed_track,
}; };
int plugin_load(char* plugin, void* parameter) int plugin_load(char* plugin, void* parameter)

View file

@ -60,12 +60,12 @@
#endif #endif
/* increase this every time the api struct changes */ /* 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 /* update this to latest version if a change to the api struct breaks
backwards compatibility (and please take the opportunity to sort in any backwards compatibility (and please take the opportunity to sort in any
new function which are "waiting" at the end of the function table) */ 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 */ /* plugin return codes */
enum plugin_status { enum plugin_status {
@ -176,6 +176,9 @@ struct plugin_api {
size_t (*strlen)(const char *str); size_t (*strlen)(const char *str);
void* (*memset)(void *dst, int c, size_t length); void* (*memset)(void *dst, int c, size_t length);
void* (*memcpy)(void *out, const void *in, size_t n); void* (*memcpy)(void *out, const void *in, size_t n);
#ifndef SIMULATOR
char *_ctype_;
#endif
/* sound */ /* sound */
#ifndef SIMULATOR #ifndef SIMULATOR
@ -240,6 +243,7 @@ struct plugin_api {
struct mp3entry* (*mpeg_next_track)(void); struct mp3entry* (*mpeg_next_track)(void);
int (*playlist_amount)(void); int (*playlist_amount)(void);
int (*mpeg_status)(void); int (*mpeg_status)(void);
bool (*mpeg_has_changed_track)(void);
#ifdef HAVE_LCD_BITMAP #ifdef HAVE_LCD_BITMAP
struct font* (*font_get)(int font); struct font* (*font_get)(int font);
@ -267,6 +271,7 @@ struct plugin_api {
#endif #endif
int (*battery_level)(void); int (*battery_level)(void);
int (*set_time)(struct tm *tm); int (*set_time)(struct tm *tm);
void (*reset_poweroff_timer)(void);
void (*backlight_on)(void); void (*backlight_on)(void);
void (*backlight_off)(void); void (*backlight_off)(void);
@ -274,9 +279,6 @@ struct plugin_api {
#ifdef HAVE_LCD_CHARCELLS #ifdef HAVE_LCD_CHARCELLS
void (*lcd_icon)(int icon, bool enable); void (*lcd_icon)(int icon, bool enable);
#endif #endif
void (*reset_poweroff_timer)(void);
bool (*mpeg_has_changed_track)(void);
}; };
/* defined by the plugin loader (plugin.c) */ /* defined by the plugin loader (plugin.c) */

View file

@ -18,17 +18,8 @@
* *
****************************************************************************/ ****************************************************************************/
#include "plugin.h" #include "plugin.h"
#ifdef HAVE_LCD_BITMAP
#include "recorder/widgets.h"
#endif
#include <ctype.h> #include <ctype.h>
#ifndef SIMULATOR
#include <ctype.c>
#endif
#if PLUGIN_API_VERSION < 3 #if PLUGIN_API_VERSION < 3
#error Scrollbar function requires PLUGIN_API_VERSION 3 at least #error Scrollbar function requires PLUGIN_API_VERSION 3 at least
#endif #endif

View file

@ -36,7 +36,11 @@ int _EXFUN(_toupper, (int __c));
#define _X 0100 #define _X 0100
#define _B 0200 #define _B 0200
#ifdef PLUGIN
#define _ctype_ (rb->_ctype_)
#else
extern char _ctype_[]; extern char _ctype_[];
#endif
#ifndef __cplusplus #ifndef __cplusplus
#define isalpha(c) ((_ctype_+1)[(unsigned)(c)]&(_U|_L)) #define isalpha(c) ((_ctype_+1)[(unsigned)(c)]&(_U|_L))