summaryrefslogtreecommitdiff
path: root/apps/plugin.c
diff options
context:
space:
mode:
authorNils Wallménius <nils@rockbox.org>2008-08-15 08:27:39 +0000
committerNils Wallménius <nils@rockbox.org>2008-08-15 08:27:39 +0000
commit01729e7a1841d8aae7be37707dbc7146348c9a64 (patch)
tree5490fd9eccdcaef39bbbb91e8a44d1caad9b2ef7 /apps/plugin.c
parent9464fdde2d780206e1eddba8cafbfbd4bbff83e4 (diff)
downloadrockbox-01729e7a1841d8aae7be37707dbc7146348c9a64.zip
rockbox-01729e7a1841d8aae7be37707dbc7146348c9a64.tar.gz
rockbox-01729e7a1841d8aae7be37707dbc7146348c9a64.tar.bz2
rockbox-01729e7a1841d8aae7be37707dbc7146348c9a64.tar.xz
FS#9281 Rename of splash functions.
* Remove gui_splash() * Rename gui_syncsplash() to splashf() and remove its voice capabilities. * Rename the internal splash() to splash_internal() and introduce an externally visible splash() that handles simple splashing without printf functionality e.g. splash(HZ, ID2P(LANG_FOO)); or splash(HZ, "foo"); if a LANG_* id is passed it will be voiced. * Adjust all places that called gui_syncsplash() to use the correct variant from above. * Export both new functions to plugins and adjust places calling rb->splash() to use the correct variant so that we now have naming consistency between the core and plugins. * Fix one latent bug that would cause my sim to crash with the above changes and correct P2STR and P2ID macros, thanks to pondlife. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18282 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugin.c')
-rw-r--r--apps/plugin.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/apps/plugin.c b/apps/plugin.c
index 6ebb6fa..7f54601 100644
--- a/apps/plugin.c
+++ b/apps/plugin.c
@@ -157,7 +157,8 @@ static const struct plugin_api rockbox_api = {
backlight_set_timeout_plugged,
#endif
is_backlight_on,
- gui_syncsplash,
+ splash,
+ splashf,
#ifdef HAVE_REMOTE_LCD
/* remote lcd */
@@ -639,32 +640,32 @@ int plugin_load(const char* plugin, const void* parameter)
plugin_loaded = false;
}
- gui_syncsplash(0, ID2P(LANG_WAIT));
+ splash(0, ID2P(LANG_WAIT));
strcpy(current_plugin, plugin);
#ifdef SIMULATOR
hdr = sim_plugin_load((char *)plugin, &pd);
if (pd == NULL) {
- gui_syncsplash(HZ*2, str(LANG_PLUGIN_CANT_OPEN), plugin);
+ splashf(HZ*2, str(LANG_PLUGIN_CANT_OPEN), plugin);
return -1;
}
if (hdr == NULL
|| hdr->magic != PLUGIN_MAGIC
|| hdr->target_id != TARGET_ID) {
sim_plugin_close(pd);
- gui_syncsplash(HZ*2, str(LANG_PLUGIN_WRONG_MODEL));
+ splash(HZ*2, str(LANG_PLUGIN_WRONG_MODEL));
return -1;
}
if (hdr->api_version > PLUGIN_API_VERSION
|| hdr->api_version < PLUGIN_MIN_API_VERSION) {
sim_plugin_close(pd);
- gui_syncsplash(HZ*2, str(LANG_PLUGIN_WRONG_VERSION));
+ splash(HZ*2, str(LANG_PLUGIN_WRONG_VERSION));
return -1;
}
#else
fd = open(plugin, O_RDONLY);
if (fd < 0) {
- gui_syncsplash(HZ*2, str(LANG_PLUGIN_CANT_OPEN), plugin);
+ splashf(HZ*2, str(LANG_PLUGIN_CANT_OPEN), plugin);
return fd;
}
#if NUM_CORES > 1
@@ -678,7 +679,7 @@ int plugin_load(const char* plugin, const void* parameter)
close(fd);
if (readsize < 0) {
- gui_syncsplash(HZ*2, str(LANG_READ_FAILED), plugin);
+ splashf(HZ*2, str(LANG_READ_FAILED), plugin);
return -1;
}
hdr = (struct plugin_header *)pluginbuf;
@@ -688,12 +689,12 @@ int plugin_load(const char* plugin, const void* parameter)
|| hdr->target_id != TARGET_ID
|| hdr->load_addr != pluginbuf
|| hdr->end_addr > pluginbuf + PLUGIN_BUFFER_SIZE) {
- gui_syncsplash(HZ*2, str(LANG_PLUGIN_WRONG_MODEL));
+ splash(HZ*2, str(LANG_PLUGIN_WRONG_MODEL));
return -1;
}
if (hdr->api_version > PLUGIN_API_VERSION
|| hdr->api_version < PLUGIN_MIN_API_VERSION) {
- gui_syncsplash(HZ*2, str(LANG_PLUGIN_WRONG_VERSION));
+ splash(HZ*2, str(LANG_PLUGIN_WRONG_VERSION));
return -1;
}
plugin_size = hdr->end_addr - pluginbuf;
@@ -768,7 +769,7 @@ int plugin_load(const char* plugin, const void* parameter)
return PLUGIN_USB_CONNECTED;
default:
- gui_syncsplash(HZ*2, str(LANG_PLUGIN_ERROR));
+ splash(HZ*2, str(LANG_PLUGIN_ERROR));
break;
}
return PLUGIN_OK;