summaryrefslogtreecommitdiffstats
path: root/apps/plugins/clock
diff options
context:
space:
mode:
authorAndrew Mahone <andrew.mahone@gmail.com>2009-01-16 10:34:40 +0000
committerAndrew Mahone <andrew.mahone@gmail.com>2009-01-16 10:34:40 +0000
commit23d9812273d9c74af72ccdc3aa4cfea971f220a4 (patch)
tree8e60c3a2a41879f8b2a52516fa416b3ab906e239 /apps/plugins/clock
parent35677cbc54bbe400ebbff59b489dda7ca7f04916 (diff)
downloadrockbox-23d9812273d9c74af72ccdc3aa4cfea971f220a4.tar.gz
rockbox-23d9812273d9c74af72ccdc3aa4cfea971f220a4.zip
loader-initialized global plugin API:
struct plugin_api *rb is declared in PLUGIN_HEADER, and pointed to by __header.api the loader uses this pointer to initialize rb before calling entry_point entry_point is no longer passed a pointer to the plugin API all plugins, and pluginlib functions, are modified to refer to the global rb pluginlib functions which only served to copy the API pointer are removed git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19776 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/clock')
-rw-r--r--apps/plugins/clock/clock.c8
-rw-r--r--apps/plugins/clock/clock.h1
2 files changed, 2 insertions, 7 deletions
diff --git a/apps/plugins/clock/clock.c b/apps/plugins/clock/clock.c
index 9279a182ee..f0001780bf 100644
--- a/apps/plugins/clock/clock.c
+++ b/apps/plugins/clock/clock.c
@@ -56,8 +56,6 @@ const struct button_mapping* plugin_contexts[]={
#define ACTION_SKIN_PREV PLA_DEC
#define ACTION_SKIN_PREV_REPEAT PLA_DEC_REPEAT
-extern const struct plugin_api* rb;
-
/**************************
* Cleanup on plugin return
*************************/
@@ -111,7 +109,7 @@ void format_date(char* buffer, struct time* time, enum date_format format){
/**********************************************************************
* Plugin starts here
**********************************************************************/
-enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter){
+enum plugin_status plugin_start(const void* parameter){
int button;
int last_second = -1;
bool redraw=true;
@@ -120,7 +118,6 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame
struct counter counter;
bool exit_clock = false;
(void)parameter;
- rb = api;
#if LCD_DEPTH > 1
rb->lcd_set_backdrop(NULL);
@@ -129,7 +126,6 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame
load_settings();
/* init xlcd functions */
- xlcd_init(rb);
counter_init(&counter);
clock_draw_set_colors();
@@ -142,7 +138,7 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame
/*************************
* Scan for button presses
************************/
- button = pluginlib_getaction(rb, HZ/10, plugin_contexts, PLA_ARRAY_COUNT);
+ button = pluginlib_getaction(HZ/10, plugin_contexts, PLA_ARRAY_COUNT);
redraw=true;/* we'll set it to false afterwards if there was no action */
switch (button){
case ACTION_COUNTER_TOGGLE: /* start/stop counter */
diff --git a/apps/plugins/clock/clock.h b/apps/plugins/clock/clock.h
index 2bcbe7207e..e447ccce5d 100644
--- a/apps/plugins/clock/clock.h
+++ b/apps/plugins/clock/clock.h
@@ -22,7 +22,6 @@
#ifndef _CLOCK_
#define _CLOCK_
#include "clock_settings.h"
-extern const struct plugin_api* rb;
struct time{
int year, day, month;