summaryrefslogtreecommitdiff
path: root/apps/plugin.h
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2006-10-31 11:17:00 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2006-10-31 11:17:00 +0000
commit29e259a29190a5ec67dbffc85389a1cb71a9fe26 (patch)
treefbb8615c108ee177f378444952b89009f5527519 /apps/plugin.h
parent23f127ddd7ccda46f88597307cd6df3da3a98c0c (diff)
downloadrockbox-29e259a29190a5ec67dbffc85389a1cb71a9fe26.tar.gz
rockbox-29e259a29190a5ec67dbffc85389a1cb71a9fe26.zip
* give tsr plugins the choice to quit or not
* bumps plugin api version git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11405 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugin.h')
-rw-r--r--apps/plugin.h25
1 files changed, 15 insertions, 10 deletions
diff --git a/apps/plugin.h b/apps/plugin.h
index 609f4cc65b..a7ed88985d 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -105,12 +105,12 @@
105#define PLUGIN_MAGIC 0x526F634B /* RocK */ 105#define PLUGIN_MAGIC 0x526F634B /* RocK */
106 106
107/* increase this every time the api struct changes */ 107/* increase this every time the api struct changes */
108#define PLUGIN_API_VERSION 33 108#define PLUGIN_API_VERSION 34
109 109
110/* update this to latest version if a change to the api struct breaks 110/* update this to latest version if a change to the api struct breaks
111 backwards compatibility (and please take the opportunity to sort in any 111 backwards compatibility (and please take the opportunity to sort in any
112 new function which are "waiting" at the end of the function table) */ 112 new function which are "waiting" at the end of the function table) */
113#define PLUGIN_MIN_API_VERSION 30 113#define PLUGIN_MIN_API_VERSION 34
114 114
115/* plugin return codes */ 115/* plugin return codes */
116enum plugin_status { 116enum plugin_status {
@@ -304,6 +304,7 @@ struct plugin_api {
304 void (*ata_sleep)(void); 304 void (*ata_sleep)(void);
305 bool (*ata_disk_is_active)(void); 305 bool (*ata_disk_is_active)(void);
306#endif 306#endif
307 void (*ata_spindown)(int seconds);
307 void (*reload_directory)(void); 308 void (*reload_directory)(void);
308 309
309 /* dir */ 310 /* dir */
@@ -378,6 +379,7 @@ struct plugin_api {
378 void *(*memchr)(const void *s1, int c, size_t n); 379 void *(*memchr)(const void *s1, int c, size_t n);
379 int (*memcmp)(const void *s1, const void *s2, size_t n); 380 int (*memcmp)(const void *s1, const void *s2, size_t n);
380 char *(*strcasestr) (const char* phaystack, const char* pneedle); 381 char *(*strcasestr) (const char* phaystack, const char* pneedle);
382 char* (*strtok_r)(char *ptr, const char *sep, char **end);
381 /* unicode stuff */ 383 /* unicode stuff */
382 const unsigned char* (*utf8decode)(const unsigned char *utf8, unsigned short *ucs); 384 const unsigned char* (*utf8decode)(const unsigned char *utf8, unsigned short *ucs);
383 unsigned char* (*iso_decode)(const unsigned char *iso, unsigned char *utf8, int cp, int count); 385 unsigned char* (*iso_decode)(const unsigned char *iso, unsigned char *utf8, int cp, int count);
@@ -511,7 +513,7 @@ struct plugin_api {
511 int (*set_time)(const struct tm *tm); 513 int (*set_time)(const struct tm *tm);
512 void* (*plugin_get_buffer)(int* buffer_size); 514 void* (*plugin_get_buffer)(int* buffer_size);
513 void* (*plugin_get_audio_buffer)(int* buffer_size); 515 void* (*plugin_get_audio_buffer)(int* buffer_size);
514 void (*plugin_tsr)(void (*exit_callback)(void)); 516 void (*plugin_tsr)(bool (*exit_callback)(bool reenter));
515#if defined(DEBUG) || defined(SIMULATOR) 517#if defined(DEBUG) || defined(SIMULATOR)
516 void (*debugf)(const char *fmt, ...); 518 void (*debugf)(const char *fmt, ...);
517#endif 519#endif
@@ -543,16 +545,15 @@ struct plugin_api {
543 int (*show_logo)(void); 545 int (*show_logo)(void);
544 struct tree_context* (*tree_get_context)(void); 546 struct tree_context* (*tree_get_context)(void);
545 547
546 /* new stuff at the end, sort into place next time
547 the API gets incompatible */
548
549 char* (*strtok_r)(char *ptr, const char *sep, char **end);
550
551#ifdef HAVE_WHEEL_POSITION 548#ifdef HAVE_WHEEL_POSITION
552 int (*wheel_status)(void); 549 int (*wheel_status)(void);
553 void (*wheel_send_events)(bool send); 550 void (*wheel_send_events)(bool send);
554#endif 551#endif
555 void (*ata_spindown)(int seconds); 552
553 /* new stuff at the end, sort into place next time
554 the API gets incompatible */
555
556
556}; 557};
557 558
558/* plugin header */ 559/* plugin header */
@@ -584,7 +585,11 @@ extern unsigned char plugin_end_addr[];
584int plugin_load(const char* plugin, void* parameter); 585int plugin_load(const char* plugin, void* parameter);
585void* plugin_get_buffer(int *buffer_size); 586void* plugin_get_buffer(int *buffer_size);
586void* plugin_get_audio_buffer(int *buffer_size); 587void* plugin_get_audio_buffer(int *buffer_size);
587void plugin_tsr(void (*exit_callback)(void)); 588
589/* plugin_tsr,
590 callback returns true to allow the new plugin to load,
591 reenter means the currently running plugin is being reloaded */
592void plugin_tsr(bool (*exit_callback)(bool reenter));
588 593
589/* defined by the plugin */ 594/* defined by the plugin */
590enum plugin_status plugin_start(struct plugin_api* rockbox, void* parameter) 595enum plugin_status plugin_start(struct plugin_api* rockbox, void* parameter)