diff options
| author | Andrew Mahone <andrew.mahone@gmail.com> | 2009-01-16 10:34:40 +0000 |
|---|---|---|
| committer | Andrew Mahone <andrew.mahone@gmail.com> | 2009-01-16 10:34:40 +0000 |
| commit | 23d9812273d9c74af72ccdc3aa4cfea971f220a4 (patch) | |
| tree | 8e60c3a2a41879f8b2a52516fa416b3ab906e239 /apps/plugins/test_disk.c | |
| parent | 35677cbc54bbe400ebbff59b489dda7ca7f04916 (diff) | |
| download | rockbox-23d9812273d9c74af72ccdc3aa4cfea971f220a4.zip rockbox-23d9812273d9c74af72ccdc3aa4cfea971f220a4.tar.gz rockbox-23d9812273d9c74af72ccdc3aa4cfea971f220a4.tar.bz2 rockbox-23d9812273d9c74af72ccdc3aa4cfea971f220a4.tar.xz | |
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/test_disk.c')
| -rw-r--r-- | apps/plugins/test_disk.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/apps/plugins/test_disk.c b/apps/plugins/test_disk.c index 085435e..2fa841b 100644 --- a/apps/plugins/test_disk.c +++ b/apps/plugins/test_disk.c @@ -36,7 +36,6 @@ PLUGIN_HEADER #endif #define TEST_TIME 10 /* in seconds */ -static const struct plugin_api* rb; static unsigned char* audiobuf; static ssize_t audiobuflen; @@ -405,7 +404,7 @@ static bool test_speed(void) /* this is the plugin entry point */ -enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter) +enum plugin_status plugin_start(const void* parameter) { static const struct menu_item items[] = { { "Disk speed", test_speed }, @@ -416,7 +415,6 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame DIR *dir; (void)parameter; - rb = api; if ((dir = rb->opendir(testbasedir)) == NULL) { @@ -440,15 +438,15 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame rb->srand(*rb->current_tick); /* Turn off backlight timeout */ - backlight_force_on(rb); /* backlight control in lib/helper.c */ + backlight_force_on(); /* backlight control in lib/helper.c */ - m = menu_init(rb, items, sizeof(items) / sizeof(*items), NULL, + m = menu_init(items, sizeof(items) / sizeof(*items), NULL, NULL, NULL, NULL); menu_run(m); menu_exit(m); /* Turn on backlight timeout (revert to settings) */ - backlight_use_settings(rb); /* backlight control in lib/helper.c */ + backlight_use_settings(); /* backlight control in lib/helper.c */ rb->rmdir(testbasedir); |