From 70de4ec4c9183080846a4e0e2591fcd4850832d3 Mon Sep 17 00:00:00 2001 From: Linus Nielsen Feltzing Date: Tue, 27 Jul 2004 19:16:58 +0000 Subject: Sorted the plugin functions git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4963 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugin.c | 52 +++++++++++++++++++++----------------------- apps/plugin.h | 70 +++++++++++++++++++++++++++++------------------------------ 2 files changed, 59 insertions(+), 63 deletions(-) (limited to 'apps') diff --git a/apps/plugin.c b/apps/plugin.c index e5a496c567..dc7351de5a 100644 --- a/apps/plugin.c +++ b/apps/plugin.c @@ -124,6 +124,7 @@ static const struct plugin_api rockbox_api = { #endif backlight_on, backlight_off, + splash, /* button */ button_get, @@ -145,6 +146,9 @@ static const struct plugin_api rockbox_api = { fprintf, read_line, settings_parseline, +#ifndef SIMULATOR + ata_sleep, +#endif /* dir */ PREFIX(opendir), @@ -159,6 +163,7 @@ static const struct plugin_api rockbox_api = { default_event_handler, create_thread, remove_thread, + reset_poweroff_timer, /* strings and memory */ snprintf, @@ -173,6 +178,7 @@ static const struct plugin_api rockbox_api = { #ifndef SIMULATOR _ctype_, #endif + atoi, /* sound */ mpeg_sound_set, @@ -182,9 +188,6 @@ static const struct plugin_api rockbox_api = { mp3_play_stop, mp3_is_playing, bitswap, -#ifdef HAVE_MAS3587F - mas_codec_readreg, -#endif #endif /* playback control */ @@ -199,16 +202,27 @@ static const struct plugin_api rockbox_api = { playlist_amount, mpeg_status, mpeg_has_changed_track, + mpeg_current_track, + + /* MAS communication */ +#ifndef SIMULATOR + mas_readmem, + mas_writemem, + mas_readreg, + mas_writereg, +#ifdef HAVE_MAS3587F + mas_codec_writereg, + mas_codec_readreg, +#endif +#endif /* misc */ srand, rand, - splash, (qsort_func)qsort, kbd_input, - mpeg_current_track, - atoi, get_time, + set_time, plugin_get_buffer, plugin_get_mp3_buffer, #ifndef SIMULATOR @@ -216,34 +230,18 @@ static const struct plugin_api rockbox_api = { plugin_unregister_timer, #endif plugin_tsr, - - /* new stuff at the end, sort into place next time the API gets incompatible */ - - - &global_settings, - backlight_set_timeout, -#ifndef SIMULATOR - ata_sleep, -#endif #if defined(DEBUG) || defined(SIMULATOR) debugf, #endif + &global_settings, + backlight_set_timeout, mp3info, count_mp3_frames, create_xing_header, - -#ifndef SIMULATOR - mas_readmem, - mas_writemem, - mas_readreg, - mas_writereg, -#ifdef HAVE_MAS3587F - mas_codec_writereg, -#endif -#endif battery_level, - set_time, - reset_poweroff_timer, + + /* new stuff at the end, sort into place next time + the API gets incompatible */ }; diff --git a/apps/plugin.h b/apps/plugin.h index 51607a53e6..dc8a273c99 100644 --- a/apps/plugin.h +++ b/apps/plugin.h @@ -152,6 +152,7 @@ struct plugin_api { #endif void (*backlight_on)(void); void (*backlight_off)(void); + void (*splash)(int ticks, bool center, char *fmt, ...); /* button */ int (*button_get)(bool block); @@ -173,6 +174,9 @@ struct plugin_api { int (*fprintf)(int fd, const char *fmt, ...); int (*read_line)(int fd, char* buffer, int buffer_size); bool (*settings_parseline)(char* line, char** name, char** value); +#ifndef SIMULATOR + int (*ata_sleep)(void); +#endif /* dir */ DIR* (*opendir)(const char* name); @@ -187,6 +191,7 @@ struct plugin_api { int (*default_event_handler)(int event); int (*create_thread)(void* function, void* stack, int stack_size, char *name); void (*remove_thread)(int threadnum); + void (*reset_poweroff_timer)(void); /* strings and memory */ int (*snprintf)(char *buf, size_t size, const char *fmt, ...); @@ -201,6 +206,7 @@ struct plugin_api { #ifndef SIMULATOR const char *_ctype_; #endif + int (*atoi)(const char *str); /* sound */ void (*mpeg_sound_set)(int setting, int value); @@ -210,9 +216,6 @@ struct plugin_api { void (*mp3_play_stop)(void); bool (*mp3_is_playing)(void); void (*bitswap)(unsigned char *data, int length); -#ifdef HAVE_MAS3587F - int (*mas_codec_readreg)(int reg); -#endif #endif /* playback control */ @@ -227,17 +230,28 @@ struct plugin_api { int (*playlist_amount)(void); int (*mpeg_status)(void); bool (*mpeg_has_changed_track)(void); + struct mp3entry* (*mpeg_current_track)(void); + + /* MAS communication */ +#ifndef SIMULATOR + int (*mas_readmem)(int bank, int addr, unsigned long* dest, int len); + int (*mas_writemem)(int bank, int addr, unsigned long* src, int len); + int (*mas_readreg)(int reg); + int (*mas_writereg)(int reg, unsigned int val); +#ifdef HAVE_MAS3587F + int (*mas_codec_writereg)(int reg, unsigned int val); + int (*mas_codec_readreg)(int reg); +#endif +#endif /* misc */ void (*srand)(unsigned int seed); int (*rand)(void); - void (*splash)(int ticks, bool center, char *fmt, ...); void (*qsort)(void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *)); int (*kbd_input)(char* buffer, int buflen); - struct mp3entry* (*mpeg_current_track)(void); - int (*atoi)(const char *str); struct tm* (*get_time)(void); + int (*set_time)(struct tm *tm); void* (*plugin_get_buffer)(int* buffer_size); void* (*plugin_get_mp3_buffer)(int* buffer_size); #ifndef SIMULATOR @@ -245,39 +259,23 @@ struct plugin_api { void (*plugin_unregister_timer)(void); #endif void (*plugin_tsr)(void (*exit_callback)(void)); - - /* new stuff, sort in next time the API gets broken! */ - - struct user_settings* global_settings; - void (*backlight_set_timeout)(int index); -#ifndef SIMULATOR - int (*ata_sleep)(void); -#endif - - #if defined(DEBUG) || defined(SIMULATOR) - void (*debugf)(char *fmt, ...); -#endif - bool (*mp3info)(struct mp3entry *entry, char *filename, bool v1first); - int (*count_mp3_frames)(int fd, int startpos, int filesize, - void (*progressfunc)(int)); - int (*create_xing_header)(int fd, int startpos, int filesize, - unsigned char *buf, int num_frames, - unsigned long header_template, - void (*progressfunc)(int), bool generate_toc); - -#ifndef SIMULATOR - int (*mas_readmem)(int bank, int addr, unsigned long* dest, int len); - int (*mas_writemem)(int bank, int addr, unsigned long* src, int len); - int (*mas_readreg)(int reg); - int (*mas_writereg)(int reg, unsigned int val); -#ifdef HAVE_MAS3587F - int (*mas_codec_writereg)(int reg, unsigned int val); -#endif + void (*debugf)(char *fmt, ...); #endif + struct user_settings* global_settings; + void (*backlight_set_timeout)(int index); + bool (*mp3info)(struct mp3entry *entry, char *filename, bool v1first); + int (*count_mp3_frames)(int fd, int startpos, int filesize, + void (*progressfunc)(int)); + int (*create_xing_header)(int fd, int startpos, int filesize, + unsigned char *buf, int num_frames, + unsigned long header_template, + void (*progressfunc)(int), bool generate_toc); int (*battery_level)(void); - int (*set_time)(struct tm *tm); - void (*reset_poweroff_timer)(void); + + /* new stuff at the end, sort into place next time + the API gets incompatible */ + }; -- cgit v1.2.3