summaryrefslogtreecommitdiffstats
path: root/apps/plugins/lib
diff options
context:
space:
mode:
authorSteve Bavin <pondlife@pondlife.me>2008-05-13 09:57:56 +0000
committerSteve Bavin <pondlife@pondlife.me>2008-05-13 09:57:56 +0000
commit652657781805d9cc10d744a49fb23eb17019fbbf (patch)
tree2d1a6ae597a17531f726b57fd9f8cbaa2a46a07f /apps/plugins/lib
parenta94e40d5153ab698fa8a1b6b57d91fcb6acc905e (diff)
downloadrockbox-652657781805d9cc10d744a49fb23eb17019fbbf.tar.gz
rockbox-652657781805d9cc10d744a49fb23eb17019fbbf.tar.bz2
rockbox-652657781805d9cc10d744a49fb23eb17019fbbf.zip
Plugin parameters should be const.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17492 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/lib')
-rw-r--r--apps/plugins/lib/bmp.c2
-rw-r--r--apps/plugins/lib/bmp.h2
-rw-r--r--apps/plugins/lib/checkbox.c2
-rw-r--r--apps/plugins/lib/checkbox.h2
-rw-r--r--apps/plugins/lib/configfile.c4
-rw-r--r--apps/plugins/lib/configfile.h2
-rw-r--r--apps/plugins/lib/grey.h22
-rw-r--r--apps/plugins/lib/grey_core.c2
-rw-r--r--apps/plugins/lib/helper.c12
-rw-r--r--apps/plugins/lib/helper.h12
-rw-r--r--apps/plugins/lib/highscore.c4
-rw-r--r--apps/plugins/lib/highscore.h2
-rw-r--r--apps/plugins/lib/oldmenuapi.c4
-rw-r--r--apps/plugins/lib/oldmenuapi.h2
-rw-r--r--apps/plugins/lib/overlay.c2
-rw-r--r--apps/plugins/lib/overlay.h2
-rw-r--r--apps/plugins/lib/playback_control.c6
-rw-r--r--apps/plugins/lib/playback_control.h4
-rw-r--r--apps/plugins/lib/playergfx.c4
-rw-r--r--apps/plugins/lib/playergfx.h2
-rw-r--r--apps/plugins/lib/pluginlib_actions.c2
-rw-r--r--apps/plugins/lib/pluginlib_actions.h2
-rw-r--r--apps/plugins/lib/profile_plugin.c4
-rw-r--r--apps/plugins/lib/profile_plugin.h2
-rw-r--r--apps/plugins/lib/xlcd.h4
-rw-r--r--apps/plugins/lib/xlcd_core.c4
26 files changed, 56 insertions, 56 deletions
diff --git a/apps/plugins/lib/bmp.c b/apps/plugins/lib/bmp.c
index 20adc6de86..c46093a8d9 100644
--- a/apps/plugins/lib/bmp.c
+++ b/apps/plugins/lib/bmp.c
@@ -30,7 +30,7 @@
/**
* Save to 24 bit bitmap.
*/
-int save_bmp_file( char* filename, struct bitmap *bm, struct plugin_api* rb )
+int save_bmp_file( char* filename, struct bitmap *bm, const struct plugin_api* rb )
{
/* I'm not really sure about this one :) */
int line_width = bm->width*3+((bm->width*3)%4?4-((bm->width*3)%4):0);
diff --git a/apps/plugins/lib/bmp.h b/apps/plugins/lib/bmp.h
index 10f71865f7..9114df1ee5 100644
--- a/apps/plugins/lib/bmp.h
+++ b/apps/plugins/lib/bmp.h
@@ -26,7 +26,7 @@
/**
* Save bitmap to file
*/
-int save_bmp_file( char* filename, struct bitmap *bm, struct plugin_api* rb );
+int save_bmp_file( char* filename, struct bitmap *bm, const struct plugin_api* rb );
#endif
/**
diff --git a/apps/plugins/lib/checkbox.c b/apps/plugins/lib/checkbox.c
index 5acc52a728..039d5f9cbf 100644
--- a/apps/plugins/lib/checkbox.c
+++ b/apps/plugins/lib/checkbox.c
@@ -25,7 +25,7 @@
/*
* Print a checkbox
*/
-void checkbox(struct plugin_api *api, int x, int y, int width, int height, bool checked)
+void checkbox(const struct plugin_api *api, int x, int y, int width, int height, bool checked)
{
/* draw box */
api->lcd_drawrect(x, y, width, height);
diff --git a/apps/plugins/lib/checkbox.h b/apps/plugins/lib/checkbox.h
index 2a5ffea0aa..72de4952ca 100644
--- a/apps/plugins/lib/checkbox.h
+++ b/apps/plugins/lib/checkbox.h
@@ -24,6 +24,6 @@
/*
* Print a checkbox
*/
-void checkbox(struct plugin_api *api, int x, int y, int width, int height, bool checked);
+void checkbox(const struct plugin_api *api, int x, int y, int width, int height, bool checked);
#endif
diff --git a/apps/plugins/lib/configfile.c b/apps/plugins/lib/configfile.c
index b0d134fae9..516bf616cb 100644
--- a/apps/plugins/lib/configfile.c
+++ b/apps/plugins/lib/configfile.c
@@ -19,9 +19,9 @@
#include "plugin.h"
#include "configfile.h"
-static struct plugin_api *cfg_rb;
+static const struct plugin_api *cfg_rb;
-void configfile_init(struct plugin_api* newrb)
+void configfile_init(const struct plugin_api* newrb)
{
cfg_rb = newrb;
}
diff --git a/apps/plugins/lib/configfile.h b/apps/plugins/lib/configfile.h
index 7aa69f3ecf..fe4b43c485 100644
--- a/apps/plugins/lib/configfile.h
+++ b/apps/plugins/lib/configfile.h
@@ -37,7 +37,7 @@ struct configdata
NULL otherwise */
};
-void configfile_init(struct plugin_api* newrb);
+void configfile_init(const struct plugin_api* newrb);
/* configfile_save - Given configdata entries this function will
create a config file with these entries, destroying any
diff --git a/apps/plugins/lib/grey.h b/apps/plugins/lib/grey.h
index 81912b1995..4a15bd38ea 100644
--- a/apps/plugins/lib/grey.h
+++ b/apps/plugins/lib/grey.h
@@ -50,7 +50,7 @@
#define GREY_ON_COP 0x0004 /* Run ISR on COP (PP targets) */
/* Library initialisation and release */
-bool grey_init(struct plugin_api* newrb, unsigned char *gbuf, long gbuf_size,
+bool grey_init(const struct plugin_api* newrb, unsigned char *gbuf, long gbuf_size,
unsigned features, int width, int height, long *buf_taken);
void grey_release(void);
@@ -168,16 +168,16 @@ struct _grey_info
int by; /* 4-pixel or 8-pixel units */
int bheight; /* 4-pixel or 8-pixel units */
#endif
- unsigned long flags; /* various flags, see #defines */
- struct plugin_api *rb; /* plugin API pointer */
- unsigned char *values; /* start of greyscale pixel values */
- unsigned char *phases; /* start of greyscale pixel phases */
- unsigned char *buffer; /* start of chunky pixel buffer (for buffered mode) */
- unsigned char gvalue[256]; /* calculated brightness -> greyvalue table */
- int fg_brightness; /* current foreground brightness */
- int bg_brightness; /* current background brightness */
- int drawmode; /* current draw mode */
- int curfont; /* current selected font */
+ unsigned long flags; /* various flags, see #defines */
+ const struct plugin_api *rb; /* plugin API pointer */
+ unsigned char *values; /* start of greyscale pixel values */
+ unsigned char *phases; /* start of greyscale pixel phases */
+ unsigned char *buffer; /* start of chunky pixel buffer (for buffered mode) */
+ unsigned char gvalue[256]; /* calculated brightness -> greyvalue table */
+ int fg_brightness; /* current foreground brightness */
+ int bg_brightness; /* current background brightness */
+ int drawmode; /* current draw mode */
+ int curfont; /* current selected font */
};
/* Global variable, defined in the plugin */
diff --git a/apps/plugins/lib/grey_core.c b/apps/plugins/lib/grey_core.c
index e2260cdf11..e7f02dd6cb 100644
--- a/apps/plugins/lib/grey_core.c
+++ b/apps/plugins/lib/grey_core.c
@@ -478,7 +478,7 @@ static void fill_gvalues(void)
The function is authentic regarding memory usage on the simulator, even
if it doesn't use all of the allocated memory. */
-bool grey_init(struct plugin_api* newrb, unsigned char *gbuf, long gbuf_size,
+bool grey_init(const struct plugin_api* newrb, unsigned char *gbuf, long gbuf_size,
unsigned features, int width, int height, long *buf_taken)
{
int bdim, i;
diff --git a/apps/plugins/lib/helper.c b/apps/plugins/lib/helper.c
index 8ac822b407..691a17f15c 100644
--- a/apps/plugins/lib/helper.c
+++ b/apps/plugins/lib/helper.c
@@ -21,7 +21,7 @@
#include "helper.h"
/* Force the backlight on */
-void backlight_force_on(struct plugin_api* rb)
+void backlight_force_on(const struct plugin_api* rb)
{
if(!rb)
return;
@@ -34,7 +34,7 @@ void backlight_force_on(struct plugin_api* rb)
}
/* Reset backlight operation to its settings */
-void backlight_use_settings(struct plugin_api* rb)
+void backlight_use_settings(const struct plugin_api* rb)
{
if (!rb)
return;
@@ -47,7 +47,7 @@ void backlight_use_settings(struct plugin_api* rb)
#ifdef HAVE_REMOTE_LCD
/* Force the backlight on */
-void remote_backlight_force_on(struct plugin_api* rb)
+void remote_backlight_force_on(const struct plugin_api* rb)
{
if (!rb)
return;
@@ -60,7 +60,7 @@ void remote_backlight_force_on(struct plugin_api* rb)
}
/* Reset backlight operation to its settings */
-void remote_backlight_use_settings(struct plugin_api* rb)
+void remote_backlight_use_settings(const struct plugin_api* rb)
{
if (!rb)
return;
@@ -75,7 +75,7 @@ void remote_backlight_use_settings(struct plugin_api* rb)
#ifdef HAVE_BUTTON_LIGHT
/* Force the buttonlight on */
-void buttonlight_force_on(struct plugin_api* rb)
+void buttonlight_force_on(const struct plugin_api* rb)
{
if (!rb)
return;
@@ -84,7 +84,7 @@ void buttonlight_force_on(struct plugin_api* rb)
}
/* Reset buttonlight operation to its settings */
-void buttonlight_use_settings(struct plugin_api* rb)
+void buttonlight_use_settings(const struct plugin_api* rb)
{
if (!rb)
return;
diff --git a/apps/plugins/lib/helper.h b/apps/plugins/lib/helper.h
index 4d1328bd0c..d34e6334f0 100644
--- a/apps/plugins/lib/helper.h
+++ b/apps/plugins/lib/helper.h
@@ -24,14 +24,14 @@
/**
* Backlight on/off operations
*/
-void backlight_force_on(struct plugin_api* rb);
-void backlight_use_settings(struct plugin_api* rb);
+void backlight_force_on(const struct plugin_api* rb);
+void backlight_use_settings(const struct plugin_api* rb);
#ifdef HAVE_REMOTE_LCD
-void remote_backlight_force_on(struct plugin_api* rb);
-void remote_backlight_use_settings(struct plugin_api* rb);
+void remote_backlight_force_on(const struct plugin_api* rb);
+void remote_backlight_use_settings(const struct plugin_api* rb);
#endif
#ifdef HAVE_BUTTON_LIGHT
-void buttonlight_force_on(struct plugin_api* rb);
-void buttonlight_use_settings(struct plugin_api* rb);
+void buttonlight_force_on(const struct plugin_api* rb);
+void buttonlight_use_settings(const struct plugin_api* rb);
#endif
#endif
diff --git a/apps/plugins/lib/highscore.c b/apps/plugins/lib/highscore.c
index df7a71bcdf..94b6a7b947 100644
--- a/apps/plugins/lib/highscore.c
+++ b/apps/plugins/lib/highscore.c
@@ -19,9 +19,9 @@
#include "plugin.h"
#include "highscore.h"
-static struct plugin_api *rb;
+static const struct plugin_api *rb;
-void highscore_init(struct plugin_api* newrb)
+void highscore_init(const struct plugin_api* newrb)
{
rb = newrb;
}
diff --git a/apps/plugins/lib/highscore.h b/apps/plugins/lib/highscore.h
index ba7da241f1..b6501cf568 100644
--- a/apps/plugins/lib/highscore.h
+++ b/apps/plugins/lib/highscore.h
@@ -26,7 +26,7 @@ struct highscore
int level;
};
-void highscore_init(struct plugin_api* newrb);
+void highscore_init(const struct plugin_api* newrb);
int highscore_save(char *filename, struct highscore *scores, int num_scores);
int highscore_load(char *filename, struct highscore *scores, int num_scores);
int highscore_update(int score, int level, struct highscore *scores, int num_scores);
diff --git a/apps/plugins/lib/oldmenuapi.c b/apps/plugins/lib/oldmenuapi.c
index 27e4fdd49e..51fb4f3eb2 100644
--- a/apps/plugins/lib/oldmenuapi.c
+++ b/apps/plugins/lib/oldmenuapi.c
@@ -27,7 +27,7 @@
#include "plugin.h"
#include "oldmenuapi.h"
-struct plugin_api *rb = NULL;
+const struct plugin_api *rb = NULL;
struct menu {
struct menu_item* items;
@@ -65,7 +65,7 @@ static int menu_find_free(void)
return(i);
}
-int menu_init(struct plugin_api *api, const struct menu_item* mitems,
+int menu_init(const struct plugin_api *api, const struct menu_item* mitems,
int count, int (*callback)(int, int),
const char *button1, const char *button2, const char *button3)
{
diff --git a/apps/plugins/lib/oldmenuapi.h b/apps/plugins/lib/oldmenuapi.h
index 34f6226d59..ccfd1400dd 100644
--- a/apps/plugins/lib/oldmenuapi.h
+++ b/apps/plugins/lib/oldmenuapi.h
@@ -31,7 +31,7 @@ struct menu_item {
bool (*function) (void); /* return true if USB was connected */
};
-int menu_init(struct plugin_api *api, const struct menu_item* mitems,
+int menu_init(const struct plugin_api *api, const struct menu_item* mitems,
int count, int (*callback)(int, int),
const char *button1, const char *button2, const char *button3);
void menu_exit(int menu);
diff --git a/apps/plugins/lib/overlay.c b/apps/plugins/lib/overlay.c
index 53cc4a84f0..63fb776f02 100644
--- a/apps/plugins/lib/overlay.c
+++ b/apps/plugins/lib/overlay.c
@@ -44,7 +44,7 @@
The linker script for the overlay should use a base address towards the
end of the audiobuffer, just low enough to make the overlay fit. */
-enum plugin_status run_overlay(struct plugin_api* rb, void* parameter,
+enum plugin_status run_overlay(const struct plugin_api* rb, const void* parameter,
unsigned char *filename, unsigned char *name)
{
int fd, readsize;
diff --git a/apps/plugins/lib/overlay.h b/apps/plugins/lib/overlay.h
index bbf7549274..ba9b1fa308 100644
--- a/apps/plugins/lib/overlay.h
+++ b/apps/plugins/lib/overlay.h
@@ -26,7 +26,7 @@
#include "plugin.h"
/* load and run a plugin linked as an overlay. */
-enum plugin_status run_overlay(struct plugin_api* api, void* parameter,
+enum plugin_status run_overlay(const struct plugin_api* api, const void* parameter,
unsigned char *filename, unsigned char *name);
#endif /* !SIMULATOR */
diff --git a/apps/plugins/lib/playback_control.c b/apps/plugins/lib/playback_control.c
index 7e74728ab4..b0456248a8 100644
--- a/apps/plugins/lib/playback_control.c
+++ b/apps/plugins/lib/playback_control.c
@@ -20,7 +20,7 @@
#include "plugin.h"
#include "playback_control.h"
-struct plugin_api* api = 0;
+const struct plugin_api* api = 0;
struct viewport *parentvp = NULL;
static bool prevtrack(void)
@@ -105,14 +105,14 @@ MAKE_MENU(playback_control_menu, "Playback Control", NULL, Icon_NOICON,
&prevtrack_item, &playpause_item, &stop_item, &nexttrack_item,
&volume_item, &shuffle_item, &repeat_mode_item);
-void playback_control_init(struct plugin_api* newapi,
+void playback_control_init(const struct plugin_api* newapi,
struct viewport parent[NB_SCREENS])
{
api = newapi;
parentvp = parent;
}
-bool playback_control(struct plugin_api* newapi,
+bool playback_control(const struct plugin_api* newapi,
struct viewport parent[NB_SCREENS])
{
api = newapi;
diff --git a/apps/plugins/lib/playback_control.h b/apps/plugins/lib/playback_control.h
index a3a0d7afbc..23b586095e 100644
--- a/apps/plugins/lib/playback_control.h
+++ b/apps/plugins/lib/playback_control.h
@@ -25,11 +25,11 @@
So, make sure you use the same viewport for the rb->do_menu() call
that you use in the playback_control_init() call
*/
-void playback_control_init(struct plugin_api* newapi,
+void playback_control_init(const struct plugin_api* newapi,
struct viewport parent[NB_SCREENS]);
/* Use this if your menu still uses the old menu api */
-bool playback_control(struct plugin_api* api,
+bool playback_control(const struct plugin_api* api,
struct viewport parent[NB_SCREENS]);
#endif /* __PLAYBACK_CONTROL_H__ */
diff --git a/apps/plugins/lib/playergfx.c b/apps/plugins/lib/playergfx.c
index 8853078fa1..4139a6c605 100644
--- a/apps/plugins/lib/playergfx.c
+++ b/apps/plugins/lib/playergfx.c
@@ -26,7 +26,7 @@
/*** globals ***/
-static struct plugin_api *pgfx_rb = NULL; /* global api struct pointer */
+static const struct plugin_api *pgfx_rb = NULL; /* global api struct pointer */
static int char_width;
static int char_height;
static int pixel_height;
@@ -38,7 +38,7 @@ static int drawmode = DRMODE_SOLID;
/*** Special functions ***/
/* library init */
-bool pgfx_init(struct plugin_api* newrb, int cwidth, int cheight)
+bool pgfx_init(const struct plugin_api* newrb, int cwidth, int cheight)
{
int i;
diff --git a/apps/plugins/lib/playergfx.h b/apps/plugins/lib/playergfx.h
index 5f49831609..504599ae39 100644
--- a/apps/plugins/lib/playergfx.h
+++ b/apps/plugins/lib/playergfx.h
@@ -26,7 +26,7 @@
#ifdef HAVE_LCD_CHARCELLS /* Player only :) */
-bool pgfx_init(struct plugin_api* newrb, int cwidth, int cheight);
+bool pgfx_init(const struct plugin_api* newrb, int cwidth, int cheight);
void pgfx_release(void);
void pgfx_display(int cx, int cy);
void pgfx_display_block(int cx, int cy, int x, int y);
diff --git a/apps/plugins/lib/pluginlib_actions.c b/apps/plugins/lib/pluginlib_actions.c
index be78bf1408..a63ffb352a 100644
--- a/apps/plugins/lib/pluginlib_actions.c
+++ b/apps/plugins/lib/pluginlib_actions.c
@@ -464,7 +464,7 @@ static const struct button_mapping* get_context_map(int context)
else return NULL;
}
-int pluginlib_getaction(struct plugin_api *api,int timeout,
+int pluginlib_getaction(const struct plugin_api *api,int timeout,
const struct button_mapping *plugin_contexts[],
int count)
{
diff --git a/apps/plugins/lib/pluginlib_actions.h b/apps/plugins/lib/pluginlib_actions.h
index c11a087904..601cd73a8c 100644
--- a/apps/plugins/lib/pluginlib_actions.h
+++ b/apps/plugins/lib/pluginlib_actions.h
@@ -58,7 +58,7 @@ extern const struct button_mapping generic_left_right_fire[];
extern const struct button_mapping generic_actions[];
extern const struct button_mapping generic_increase_decrease[];
-int pluginlib_getaction(struct plugin_api *api,int timeout,
+int pluginlib_getaction(const struct plugin_api *api,int timeout,
const struct button_mapping *plugin_contexts[],
int count);
diff --git a/apps/plugins/lib/profile_plugin.c b/apps/plugins/lib/profile_plugin.c
index 38c6d81598..6f31288c8f 100644
--- a/apps/plugins/lib/profile_plugin.c
+++ b/apps/plugins/lib/profile_plugin.c
@@ -21,9 +21,9 @@
#include "plugin.h"
-static struct plugin_api *local_rb = NULL; /* global api struct pointer */
+static const struct plugin_api *local_rb = NULL; /* global api struct pointer */
-void profile_init(struct plugin_api* pa)
+void profile_init(const struct plugin_api* pa)
{
local_rb = pa;
}
diff --git a/apps/plugins/lib/profile_plugin.h b/apps/plugins/lib/profile_plugin.h
index 71cff37033..6bc19734d8 100644
--- a/apps/plugins/lib/profile_plugin.h
+++ b/apps/plugins/lib/profile_plugin.h
@@ -24,7 +24,7 @@
#include "plugin.h"
-void profile_init(struct plugin_api* pa);
+void profile_init(const struct plugin_api* pa);
void __cyg_profile_func_enter(void *this_fn, void *call_site)
NO_PROF_ATTR ICODE_ATTR;
diff --git a/apps/plugins/lib/xlcd.h b/apps/plugins/lib/xlcd.h
index 59a048228b..a1e2389f39 100644
--- a/apps/plugins/lib/xlcd.h
+++ b/apps/plugins/lib/xlcd.h
@@ -26,7 +26,7 @@
#ifdef HAVE_LCD_BITMAP
-void xlcd_init(struct plugin_api* newrb);
+void xlcd_init(const struct plugin_api* newrb);
void xlcd_filltriangle(int x1, int y1, int x2, int y2, int x3, int y3);
void xlcd_filltriangle_screen(struct screen* display,
int x1, int y1, int x2, int y2, int x3, int y3);
@@ -49,7 +49,7 @@ void xlcd_scroll_up(int count);
void xlcd_scroll_down(int count);
/* internal stuff */
-extern struct plugin_api *_xlcd_rb; /* global api struct pointer */
+extern const struct plugin_api *_xlcd_rb; /* global api struct pointer */
#endif /* HAVE_LCD_BITMAP */
#endif /* __XLCD_H__ */
diff --git a/apps/plugins/lib/xlcd_core.c b/apps/plugins/lib/xlcd_core.c
index e8cc688591..7f8e566865 100644
--- a/apps/plugins/lib/xlcd_core.c
+++ b/apps/plugins/lib/xlcd_core.c
@@ -27,12 +27,12 @@
/*** globals ***/
-struct plugin_api *_xlcd_rb = NULL; /* global api struct pointer */
+const struct plugin_api *_xlcd_rb = NULL; /* global api struct pointer */
/*** functions ***/
/* library init */
-void xlcd_init(struct plugin_api* newrb)
+void xlcd_init(const struct plugin_api* newrb)
{
_xlcd_rb = newrb;
}