From 23d9812273d9c74af72ccdc3aa4cfea971f220a4 Mon Sep 17 00:00:00 2001 From: Andrew Mahone Date: Fri, 16 Jan 2009 10:34:40 +0000 Subject: 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 --- apps/plugins/text_editor.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'apps/plugins/text_editor.c') diff --git a/apps/plugins/text_editor.c b/apps/plugins/text_editor.c index abb2787..f03cdcf 100644 --- a/apps/plugins/text_editor.c +++ b/apps/plugins/text_editor.c @@ -28,7 +28,6 @@ #endif #define MAX_LINE_LEN 2048 PLUGIN_HEADER -static const struct plugin_api* rb; static char buffer[MAX_CHARS]; static char eol[3]; @@ -264,7 +263,7 @@ int do_item_menu(int cur_sel, char* copy_buffer) ret = MENU_RET_SAVE; break; case 6: /* playback menu */ - playback_control(rb, NULL); + playback_control(NULL); ret = MENU_RET_UPDATE; break; default: @@ -308,7 +307,7 @@ int hex_to_rgb(const char* hex, int* color) #endif /* HAVE_LCD_COLOR */ /* 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) { int fd; static char temp_line[MAX_LINE_LEN]; @@ -324,8 +323,6 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame bool edit_colors_file = false; #endif - rb = api; - copy_buffer[0]='\0'; prev_show_statusbar = rb->global_settings->statusbar; rb->global_settings->statusbar = false; @@ -481,7 +478,7 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame case 0: break; case 1: - playback_control(rb, NULL); + playback_control(NULL); break; case 2: //save to disk save_changes(1); -- cgit v1.1