Revert... stupid svn doesn't complain when passing -m twice :(
[Rockbox.git] / apps / plugin.c
blob7c3fab1079bc877ba4d7e5b13256024a43035721
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2002 Björn Stenberg
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
19 #include "plugin.h"
20 #include <ctype.h>
21 #include <string.h>
22 #include <sprintf.h>
23 #include <atoi.h>
24 #include "debug.h"
25 #include "i2c.h"
26 #include "lang.h"
27 #include "led.h"
28 #include "keyboard.h"
29 #include "buffer.h"
30 #include "backlight.h"
31 #include "sound_menu.h"
32 #include "mp3data.h"
33 #include "powermgmt.h"
34 #include "splash.h"
35 #include "logf.h"
36 #include "option_select.h"
37 #include "talk.h"
39 #if CONFIG_CHARGING
40 #include "power.h"
41 #endif
43 #ifdef HAVE_LCD_BITMAP
44 #include "scrollbar.h"
45 #include "peakmeter.h"
46 #include "bmp.h"
47 #include "bidi.h"
48 #endif
50 #ifdef SIMULATOR
51 static unsigned char pluginbuf[PLUGIN_BUFFER_SIZE];
52 void *sim_plugin_load(char *plugin, void **pd);
53 void sim_plugin_close(void *pd);
54 void sim_lcd_ex_init(int shades, unsigned long (*getpixel)(int, int));
55 void sim_lcd_ex_update_rect(int x, int y, int width, int height);
56 #else
57 #define sim_plugin_close(x)
58 extern unsigned char pluginbuf[];
59 #include "bitswap.h"
60 #endif
62 /* for actual plugins only, not for codecs */
63 static bool plugin_loaded = false;
64 static int plugin_size = 0;
65 static bool (*pfn_tsr_exit)(bool reenter) = NULL; /* TSR exit callback */
66 static char current_plugin[MAX_PATH];
68 char *plugin_get_current_filename(void);
70 extern struct thread_entry threads[MAXTHREADS];
72 static const struct plugin_api rockbox_api = {
74 /* lcd */
75 lcd_set_contrast,
76 lcd_update,
77 lcd_clear_display,
78 lcd_setmargins,
79 lcd_getstringsize,
80 lcd_putsxy,
81 lcd_puts,
82 lcd_puts_scroll,
83 lcd_stop_scroll,
84 #ifdef HAVE_LCD_CHARCELLS
85 lcd_define_pattern,
86 lcd_get_locked_pattern,
87 lcd_unlock_pattern,
88 lcd_putc,
89 lcd_put_cursor,
90 lcd_remove_cursor,
91 lcd_icon,
92 lcd_double_height,
93 #else
94 &lcd_framebuffer[0][0],
95 lcd_update_rect,
96 lcd_set_drawmode,
97 lcd_get_drawmode,
98 lcd_setfont,
99 lcd_drawpixel,
100 lcd_drawline,
101 lcd_hline,
102 lcd_vline,
103 lcd_drawrect,
104 lcd_fillrect,
105 lcd_mono_bitmap_part,
106 lcd_mono_bitmap,
107 #if LCD_DEPTH > 1
108 lcd_set_foreground,
109 lcd_get_foreground,
110 lcd_set_background,
111 lcd_get_background,
112 lcd_bitmap_part,
113 lcd_bitmap,
114 lcd_get_backdrop,
115 lcd_set_backdrop,
116 #endif
117 #if LCD_DEPTH == 16
118 lcd_bitmap_transparent_part,
119 lcd_bitmap_transparent,
120 lcd_blit_yuv,
121 #if defined(TOSHIBA_GIGABEAT_F) || defined(SANSA_E200) || defined(SANSA_C200) \
122 || defined (IRIVER_H10)
123 lcd_yuv_set_options,
124 #endif
125 #elif (LCD_DEPTH < 4) && !defined(SIMULATOR)
126 lcd_blit_mono,
127 lcd_blit_grey_phase,
128 #endif /* LCD_DEPTH */
129 lcd_puts_style,
130 lcd_puts_scroll_style,
131 bidi_l2v,
132 font_get_bits,
133 font_load,
134 font_get,
135 font_getstringsize,
136 font_get_width,
137 screen_clear_area,
138 gui_scrollbar_draw,
139 #endif
141 backlight_on,
142 backlight_off,
143 backlight_set_timeout,
144 #if CONFIG_CHARGING
145 backlight_set_timeout_plugged,
146 #endif
147 gui_syncsplash,
149 #ifdef HAVE_REMOTE_LCD
150 /* remote lcd */
151 lcd_remote_set_contrast,
152 lcd_remote_clear_display,
153 lcd_remote_setmargins,
154 lcd_remote_puts,
155 lcd_remote_puts_scroll,
156 lcd_remote_stop_scroll,
157 lcd_remote_set_drawmode,
158 lcd_remote_get_drawmode,
159 lcd_remote_setfont,
160 lcd_remote_getstringsize,
161 lcd_remote_drawpixel,
162 lcd_remote_drawline,
163 lcd_remote_hline,
164 lcd_remote_vline,
165 lcd_remote_drawrect,
166 lcd_remote_fillrect,
167 lcd_remote_mono_bitmap_part,
168 lcd_remote_mono_bitmap,
169 lcd_remote_putsxy,
170 lcd_remote_puts_style,
171 lcd_remote_puts_scroll_style,
172 &lcd_remote_framebuffer[0][0],
173 lcd_remote_update,
174 lcd_remote_update_rect,
176 remote_backlight_on,
177 remote_backlight_off,
178 remote_backlight_set_timeout,
179 #if CONFIG_CHARGING
180 remote_backlight_set_timeout_plugged,
181 #endif
182 #endif /* HAVE_REMOTE_LCD */
183 #if NB_SCREENS == 2
184 {&screens[SCREEN_MAIN], &screens[SCREEN_REMOTE]},
185 #else
186 {&screens[SCREEN_MAIN]},
187 #endif
188 #if defined(HAVE_REMOTE_LCD) && (LCD_REMOTE_DEPTH > 1)
189 lcd_remote_set_foreground,
190 lcd_remote_get_foreground,
191 lcd_remote_set_background,
192 lcd_remote_get_background,
193 lcd_remote_bitmap_part,
194 lcd_remote_bitmap,
195 #endif
196 viewport_set_defaults,
198 /* list */
199 gui_synclist_init,
200 gui_synclist_set_nb_items,
201 gui_synclist_set_icon_callback,
202 gui_synclist_get_nb_items,
203 gui_synclist_get_sel_pos,
204 gui_synclist_draw,
205 gui_synclist_select_item,
206 gui_synclist_add_item,
207 gui_synclist_del_item,
208 gui_synclist_limit_scroll,
209 gui_synclist_do_button,
210 gui_synclist_set_title,
212 /* button */
213 button_get,
214 button_get_w_tmo,
215 button_status,
216 button_clear_queue,
217 button_queue_count,
218 #ifdef HAS_BUTTON_HOLD
219 button_hold,
220 #endif
222 /* file */
223 (open_func)PREFIX(open),
224 PREFIX(close),
225 (read_func)PREFIX(read),
226 PREFIX(lseek),
227 (creat_func)PREFIX(creat),
228 (write_func)PREFIX(write),
229 PREFIX(remove),
230 PREFIX(rename),
231 PREFIX(ftruncate),
232 PREFIX(filesize),
233 fdprintf,
234 read_line,
235 settings_parseline,
236 #ifndef SIMULATOR
237 ata_sleep,
238 ata_disk_is_active,
239 #endif
240 ata_spin,
241 ata_spindown,
242 reload_directory,
243 create_numbered_filename,
244 file_exists,
246 /* dir */
247 opendir,
248 closedir,
249 readdir,
250 mkdir,
251 rmdir,
252 dir_exists,
254 /* kernel/ system */
255 PREFIX(sleep),
256 yield,
257 &current_tick,
258 default_event_handler,
259 default_event_handler_ex,
260 threads,
261 create_thread,
262 thread_exit,
263 thread_wait,
264 #if (CONFIG_CODEC == SWCODEC)
265 mutex_init,
266 mutex_lock,
267 mutex_unlock,
268 align_buffer,
269 #endif
271 reset_poweroff_timer,
272 #ifndef SIMULATOR
273 system_memory_guard,
274 &cpu_frequency,
276 #ifdef HAVE_ADJUSTABLE_CPU_FREQ
277 #ifdef CPU_BOOST_LOGGING
278 cpu_boost_,
279 #else
280 cpu_boost,
281 #endif
282 #endif /* HAVE_ADJUSTABLE_CPU_FREQ */
283 #endif /* !SIMULATOR */
284 #ifdef HAVE_SCHEDULER_BOOSTCTRL
285 trigger_cpu_boost,
286 cancel_cpu_boost,
287 #endif
288 #ifdef CACHE_FUNCTIONS_AS_CALL
289 flush_icache,
290 invalidate_icache,
291 #endif
292 timer_register,
293 timer_unregister,
294 timer_set_period,
296 queue_init,
297 queue_delete,
298 queue_post,
299 queue_wait_w_tmo,
300 #if CONFIG_CODEC == SWCODEC
301 queue_enable_queue_send,
302 queue_empty,
303 queue_wait,
304 queue_send,
305 queue_reply,
306 #endif
307 usb_acknowledge,
308 #ifdef RB_PROFILE
309 profile_thread,
310 profstop,
311 profile_func_enter,
312 profile_func_exit,
313 #endif
315 #ifdef SIMULATOR
316 /* special simulator hooks */
317 #if defined(HAVE_LCD_BITMAP) && LCD_DEPTH < 8
318 sim_lcd_ex_init,
319 sim_lcd_ex_update_rect,
320 #endif
321 #endif
323 /* strings and memory */
324 snprintf,
325 vsnprintf,
326 strcpy,
327 strncpy,
328 strlen,
329 strrchr,
330 strcmp,
331 strncmp,
332 strcasecmp,
333 strncasecmp,
334 memset,
335 memcpy,
336 memmove,
337 _ctype_,
338 atoi,
339 strchr,
340 strcat,
341 memchr,
342 memcmp,
343 strcasestr,
344 strtok_r,
345 /* unicode stuff */
346 utf8decode,
347 iso_decode,
348 utf16LEdecode,
349 utf16BEdecode,
350 utf8encode,
351 utf8length,
352 utf8seek,
354 /* sound */
355 sound_set,
356 sound_default,
357 sound_min,
358 sound_max,
359 sound_unit,
360 sound_val2phys,
361 #ifndef SIMULATOR
362 mp3_play_data,
363 mp3_play_pause,
364 mp3_play_stop,
365 mp3_is_playing,
366 #if CONFIG_CODEC != SWCODEC
367 bitswap,
368 #endif
369 #endif
370 #if CONFIG_CODEC == SWCODEC
371 &audio_master_sampr_list[0],
372 &hw_freq_sampr[0],
373 pcm_apply_settings,
374 pcm_play_data,
375 pcm_play_stop,
376 pcm_set_frequency,
377 pcm_is_playing,
378 pcm_is_paused,
379 pcm_play_pause,
380 pcm_get_bytes_waiting,
381 pcm_calculate_peaks,
382 pcm_play_lock,
383 pcm_play_unlock,
384 #ifdef HAVE_RECORDING
385 &rec_freq_sampr[0],
386 pcm_init_recording,
387 pcm_close_recording,
388 pcm_record_data,
389 pcm_record_more,
390 pcm_stop_recording,
391 pcm_calculate_rec_peaks,
392 audio_set_recording_gain,
393 #endif /* HAVE_RECORDING */
394 #if INPUT_SRC_CAPS != 0
395 audio_set_output_source,
396 audio_set_input_source,
397 #endif
398 dsp_set_crossfeed,
399 dsp_set_eq,
400 dsp_dither_enable,
401 dsp_configure,
402 dsp_process,
403 #endif /* CONFIG_CODEC == SWCODEC */
405 /* playback control */
406 playlist_amount,
407 playlist_resume,
408 playlist_start,
409 PREFIX(audio_play),
410 audio_stop,
411 audio_pause,
412 audio_resume,
413 audio_next,
414 audio_prev,
415 audio_ff_rewind,
416 audio_next_track,
417 audio_status,
418 audio_has_changed_track,
419 audio_current_track,
420 audio_flush_and_reload_tracks,
421 audio_get_file_pos,
422 #if !defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC)
423 mpeg_get_last_header,
424 #endif
425 #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) || \
426 (CONFIG_CODEC == SWCODEC)
427 sound_set_pitch,
428 #endif
430 #if !defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC)
431 /* MAS communication */
432 mas_readmem,
433 mas_writemem,
434 mas_readreg,
435 mas_writereg,
436 #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
437 mas_codec_writereg,
438 mas_codec_readreg,
439 i2c_begin,
440 i2c_end,
441 i2c_write,
442 #endif
443 #endif /* !SIMULATOR && CONFIG_CODEC != SWCODEC */
445 /* menu */
446 do_menu,
447 /* statusbars */
448 &statusbars,
449 gui_syncstatusbar_draw,
450 /* options */
451 find_setting,
452 option_screen,
453 set_option,
454 set_bool_options,
455 set_int,
456 set_bool,
457 #ifdef HAVE_LCD_COLOR
458 set_color,
459 #endif
461 /* action handling */
462 get_custom_action,
463 get_action,
464 action_userabort,
466 /* power */
467 battery_level,
468 battery_level_safe,
469 battery_time,
470 #ifndef SIMULATOR
471 battery_voltage,
472 #endif
473 #if CONFIG_CHARGING
474 charger_inserted,
475 # if CONFIG_CHARGING == CHARGING_MONITOR
476 charging_state,
477 # endif
478 #endif
479 #ifdef HAVE_USB_POWER
480 usb_powered,
481 #endif
483 /* misc */
484 srand,
485 rand,
486 (qsort_func)qsort,
487 kbd_input,
488 get_time,
489 set_time,
490 #if CONFIG_RTC
491 mktime,
492 #endif
493 plugin_get_buffer,
494 plugin_get_audio_buffer,
495 plugin_tsr,
496 plugin_get_current_filename,
497 #ifdef PLUGIN_USE_IRAM
498 plugin_iram_init,
499 #endif
500 #if defined(DEBUG) || defined(SIMULATOR)
501 debugf,
502 #endif
503 #ifdef ROCKBOX_HAS_LOGF
504 _logf,
505 #endif
506 &global_settings,
507 &global_status,
508 talk_disable,
509 #if CONFIG_CODEC == SWCODEC
510 codec_load_file,
511 get_codec_filename,
512 get_metadata,
513 #endif
514 mp3info,
515 count_mp3_frames,
516 create_xing_header,
517 find_next_frame,
518 #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
519 peak_meter_scale_value,
520 peak_meter_set_use_dbfs,
521 peak_meter_get_use_dbfs,
522 #endif
523 #ifdef HAVE_LCD_BITMAP
524 read_bmp_file,
525 screen_dump_set_hook,
526 #endif
527 show_logo,
528 tree_get_context,
529 set_current_file,
530 set_dirfilter,
532 #ifdef HAVE_WHEEL_POSITION
533 wheel_status,
534 wheel_send_events,
535 #endif
537 #ifdef IRIVER_H100_SERIES
538 /* Routines for the iriver_flash -plugin. */
539 detect_original_firmware,
540 detect_flashed_ramimage,
541 detect_flashed_romimage,
542 #endif
543 led,
544 #if (CONFIG_CODEC == SWCODEC)
545 bufopen,
546 bufalloc,
547 bufclose,
548 bufseek,
549 bufadvance,
550 bufread,
551 bufgetdata,
552 bufgettail,
553 bufcuttail,
555 buf_get_offset,
556 buf_handle_offset,
557 buf_request_buffer_handle,
558 buf_set_base_handle,
559 buf_used,
560 #endif
562 #ifdef HAVE_TAGCACHE
563 tagcache_search,
564 tagcache_search_set_uniqbuf,
565 tagcache_search_add_filter,
566 tagcache_get_next,
567 tagcache_retrieve,
568 tagcache_search_finish,
569 #endif
571 #ifdef HAVE_ALBUMART
572 find_albumart,
573 search_albumart_files,
574 #endif
576 /* new stuff at the end, sort into place next time
577 the API gets incompatible */
579 is_backlight_on,
582 int plugin_load(const char* plugin, void* parameter)
584 int rc;
585 struct plugin_header *hdr;
586 #ifdef SIMULATOR
587 void *pd;
588 #else
589 int fd;
590 ssize_t readsize;
591 #endif
592 int xm, ym;
593 #ifdef HAVE_REMOTE_LCD
594 int rxm, rym;
595 #endif
597 #if LCD_DEPTH > 1
598 fb_data* old_backdrop;
599 #endif
601 if (pfn_tsr_exit != NULL) /* if we have a resident old plugin: */
603 if (pfn_tsr_exit(!strcmp(current_plugin, plugin)) == false )
605 /* not allowing another plugin to load */
606 return PLUGIN_OK;
608 pfn_tsr_exit = NULL;
609 plugin_loaded = false;
612 gui_syncsplash(0, ID2P(LANG_WAIT));
613 strcpy(current_plugin, plugin);
615 #ifdef SIMULATOR
616 hdr = sim_plugin_load((char *)plugin, &pd);
617 if (pd == NULL) {
618 gui_syncsplash(HZ*2, str(LANG_PLUGIN_CANT_OPEN), plugin);
619 return -1;
621 if (hdr == NULL
622 || hdr->magic != PLUGIN_MAGIC
623 || hdr->target_id != TARGET_ID) {
624 sim_plugin_close(pd);
625 gui_syncsplash(HZ*2, str(LANG_PLUGIN_WRONG_MODEL));
626 return -1;
628 if (hdr->api_version > PLUGIN_API_VERSION
629 || hdr->api_version < PLUGIN_MIN_API_VERSION) {
630 sim_plugin_close(pd);
631 gui_syncsplash(HZ*2, str(LANG_PLUGIN_WRONG_VERSION));
632 return -1;
634 #else
635 fd = open(plugin, O_RDONLY);
636 if (fd < 0) {
637 gui_syncsplash(HZ*2, str(LANG_PLUGIN_CANT_OPEN), plugin);
638 return fd;
641 readsize = read(fd, pluginbuf, PLUGIN_BUFFER_SIZE);
642 close(fd);
644 if (readsize < 0) {
645 gui_syncsplash(HZ*2, str(LANG_READ_FAILED), plugin);
646 return -1;
648 hdr = (struct plugin_header *)pluginbuf;
650 if ((unsigned)readsize <= sizeof(struct plugin_header)
651 || hdr->magic != PLUGIN_MAGIC
652 || hdr->target_id != TARGET_ID
653 || hdr->load_addr != pluginbuf
654 || hdr->end_addr > pluginbuf + PLUGIN_BUFFER_SIZE) {
655 gui_syncsplash(HZ*2, str(LANG_PLUGIN_WRONG_MODEL));
656 return -1;
658 if (hdr->api_version > PLUGIN_API_VERSION
659 || hdr->api_version < PLUGIN_MIN_API_VERSION) {
660 gui_syncsplash(HZ*2, str(LANG_PLUGIN_WRONG_VERSION));
661 return -1;
663 plugin_size = hdr->end_addr - pluginbuf;
665 /* zero out bss area only, above guards end of pluginbuf */
666 if (plugin_size > readsize)
667 memset(pluginbuf + readsize, 0, plugin_size - readsize);
668 #endif
670 plugin_loaded = true;
672 xm = lcd_getxmargin();
673 ym = lcd_getymargin();
674 lcd_setmargins(0,0);
676 #if defined HAVE_LCD_BITMAP && LCD_DEPTH > 1
677 old_backdrop = lcd_get_backdrop();
678 #endif
679 lcd_clear_display();
680 lcd_update();
682 #ifdef HAVE_REMOTE_LCD
683 rxm = lcd_remote_getxmargin();
684 rym = lcd_remote_getymargin();
685 lcd_remote_setmargins(0, 0);
686 lcd_remote_clear_display();
687 lcd_remote_update();
688 #endif
690 invalidate_icache();
692 rc = hdr->entry_point((struct plugin_api*) &rockbox_api, parameter);
693 /* explicitly casting the pointer here to avoid touching every plugin. */
695 button_clear_queue();
697 #ifdef HAVE_LCD_BITMAP
698 #if LCD_DEPTH > 1
699 lcd_set_backdrop(old_backdrop);
700 #ifdef HAVE_LCD_COLOR
701 lcd_set_drawinfo(DRMODE_SOLID, global_settings.fg_color,
702 global_settings.bg_color);
703 #else
704 lcd_set_drawinfo(DRMODE_SOLID, LCD_DEFAULT_FG, LCD_DEFAULT_BG);
705 #endif
706 #else /* LCD_DEPTH == 1 */
707 lcd_set_drawmode(DRMODE_SOLID);
708 #endif /* LCD_DEPTH */
709 #endif /* HAVE_LCD_BITMAP */
711 /* restore margins */
712 lcd_setmargins(xm,ym);
713 lcd_clear_display();
714 lcd_update();
716 #ifdef HAVE_REMOTE_LCD
717 #if LCD_REMOTE_DEPTH > 1
718 lcd_remote_set_drawinfo(DRMODE_SOLID, LCD_REMOTE_DEFAULT_FG,
719 LCD_REMOTE_DEFAULT_BG);
720 #else
721 lcd_remote_set_drawmode(DRMODE_SOLID);
722 #endif
723 lcd_remote_setmargins(rxm, rym);
724 lcd_remote_clear_display();
727 lcd_remote_update();
730 #endif
732 if (pfn_tsr_exit == NULL)
733 plugin_loaded = false;
735 sim_plugin_close(pd);
737 switch (rc) {
738 case PLUGIN_OK:
739 break;
741 case PLUGIN_USB_CONNECTED:
742 return PLUGIN_USB_CONNECTED;
744 default:
745 gui_syncsplash(HZ*2, str(LANG_PLUGIN_ERROR));
746 break;
748 return PLUGIN_OK;
751 /* Returns a pointer to the portion of the plugin buffer that is not already
752 being used. If no plugin is loaded, returns the entire plugin buffer */
753 void* plugin_get_buffer(size_t *buffer_size)
755 int buffer_pos;
757 if (plugin_loaded)
759 if (plugin_size >= PLUGIN_BUFFER_SIZE)
760 return NULL;
762 *buffer_size = PLUGIN_BUFFER_SIZE-plugin_size;
763 buffer_pos = plugin_size;
765 else
767 *buffer_size = PLUGIN_BUFFER_SIZE;
768 buffer_pos = 0;
771 return &pluginbuf[buffer_pos];
774 /* Returns a pointer to the mp3 buffer.
775 Playback gets stopped, to avoid conflicts.
776 Talk buffer is stolen as well.
778 void* plugin_get_audio_buffer(size_t *buffer_size)
780 #if CONFIG_CODEC == SWCODEC
781 return audio_get_buffer(true, buffer_size);
782 #else
783 audio_stop();
784 talk_buffer_steal(); /* we use the mp3 buffer, need to tell */
785 *buffer_size = audiobufend - audiobuf;
786 return audiobuf;
787 #endif
790 #ifdef PLUGIN_USE_IRAM
791 /* Initializes plugin IRAM */
792 void plugin_iram_init(char *iramstart, char *iramcopy, size_t iram_size,
793 char *iedata, size_t iedata_size)
795 /* We need to stop audio playback in order to use codec IRAM */
796 audio_hard_stop();
797 memcpy(iramstart, iramcopy, iram_size);
798 memset(iedata, 0, iedata_size);
799 memset(iramcopy, 0, iram_size);
800 #if NUM_CORES > 1
801 /* writeback cleared iedata and iramcopy areas */
802 flush_icache();
803 #endif
805 #endif /* PLUGIN_USE_IRAM */
807 /* The plugin wants to stay resident after leaving its main function, e.g.
808 runs from timer or own thread. The callback is registered to later
809 instruct it to free its resources before a new plugin gets loaded. */
810 void plugin_tsr(bool (*exit_callback)(bool))
812 pfn_tsr_exit = exit_callback; /* remember the callback for later */
815 char *plugin_get_current_filename(void)
817 return current_plugin;