summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/bookmark.c44
-rw-r--r--apps/bookmark.h4
-rw-r--r--apps/debug_menu.c2
-rw-r--r--apps/filetypes.c18
-rw-r--r--apps/filetypes.h6
-rw-r--r--apps/language.c2
-rw-r--r--apps/language.h2
-rw-r--r--apps/menu.c4
-rw-r--r--apps/menu.h2
-rw-r--r--apps/playlist.c67
-rw-r--r--apps/playlist.h27
-rw-r--r--apps/playlist_viewer.c8
-rw-r--r--apps/plugin.c2
-rw-r--r--apps/plugin.h4
-rw-r--r--apps/screens.c12
-rw-r--r--apps/screens.h10
-rw-r--r--apps/settings.c24
-rw-r--r--apps/settings.h16
-rw-r--r--apps/sound_menu.c2
-rw-r--r--apps/status.c5
-rw-r--r--apps/status.h3
-rw-r--r--apps/talk.c4
-rw-r--r--apps/talk.h6
-rw-r--r--apps/tree.c17
-rw-r--r--apps/tree.h6
-rw-r--r--apps/wps-display.c28
-rw-r--r--apps/wps-display.h3
27 files changed, 170 insertions, 158 deletions
diff --git a/apps/bookmark.c b/apps/bookmark.c
index 8d60de28fe..ed85ff6222 100644
--- a/apps/bookmark.c
+++ b/apps/bookmark.c
@@ -51,19 +51,19 @@
51#define MAX_BOOKMARK_SIZE 350 51#define MAX_BOOKMARK_SIZE 350
52#define RECENT_BOOKMARK_FILE ROCKBOX_DIR "/most-recent.bmark" 52#define RECENT_BOOKMARK_FILE ROCKBOX_DIR "/most-recent.bmark"
53 53
54static bool add_bookmark(char* bookmark_file_name, char* bookmark); 54static bool add_bookmark(const char* bookmark_file_name, const char* bookmark);
55static bool bookmark_load_menu(void); 55static bool bookmark_load_menu(void);
56static bool check_bookmark(char* bookmark); 56static bool check_bookmark(const char* bookmark);
57static char* create_bookmark(void); 57static char* create_bookmark(void);
58static bool delete_bookmark(char* bookmark_file_name, int bookmark_id); 58static bool delete_bookmark(const char* bookmark_file_name, int bookmark_id);
59static void display_bookmark(char* bookmark, 59static void display_bookmark(const char* bookmark,
60 int bookmark_id, 60 int bookmark_id,
61 int bookmark_count); 61 int bookmark_count);
62static void say_bookmark(char* bookmark, 62static void say_bookmark(const char* bookmark,
63 int bookmark_id); 63 int bookmark_id);
64static bool generate_bookmark_file_name(char *in); 64static bool generate_bookmark_file_name(const char *in);
65static char* get_bookmark(char* bookmark_file, int bookmark_count); 65static char* get_bookmark(const char* bookmark_file, int bookmark_count);
66static bool parse_bookmark(char *bookmark, 66static bool parse_bookmark(const char *bookmark,
67 int *resume_index, 67 int *resume_index,
68 int *resume_offset, 68 int *resume_offset,
69 int *resume_seed, 69 int *resume_seed,
@@ -75,10 +75,10 @@ static bool parse_bookmark(char *bookmark,
75 bool *shuffle, 75 bool *shuffle,
76 char* file_name, 76 char* file_name,
77 unsigned int max_file_name_size); 77 unsigned int max_file_name_size);
78static char* select_bookmark(char* bookmark_file_name); 78static char* select_bookmark(const char* bookmark_file_name);
79static bool system_check(void); 79static bool system_check(void);
80static bool write_bookmark(bool create_bookmark_file); 80static bool write_bookmark(bool create_bookmark_file);
81static int get_bookmark_count(char* bookmark_file_name); 81static int get_bookmark_count(const char* bookmark_file_name);
82 82
83static char global_temp_buffer[MAX_PATH+1]; 83static char global_temp_buffer[MAX_PATH+1];
84static char global_bookmark_file_name[MAX_PATH]; 84static char global_bookmark_file_name[MAX_PATH];
@@ -332,7 +332,7 @@ static bool write_bookmark(bool create_bookmark_file)
332/* ----------------------------------------------------------------------- */ 332/* ----------------------------------------------------------------------- */
333/* This function adds a bookmark to a file. */ 333/* This function adds a bookmark to a file. */
334/* ------------------------------------------------------------------------*/ 334/* ------------------------------------------------------------------------*/
335static bool add_bookmark(char* bookmark_file_name, char* bookmark) 335static bool add_bookmark(const char* bookmark_file_name, const char* bookmark)
336{ 336{
337 int temp_bookmark_file = 0; 337 int temp_bookmark_file = 0;
338 int bookmark_file = 0; 338 int bookmark_file = 0;
@@ -447,7 +447,7 @@ static char* create_bookmark()
447 return NULL; 447 return NULL;
448} 448}
449 449
450static bool check_bookmark(char* bookmark) 450static bool check_bookmark(const char* bookmark)
451{ 451{
452 return parse_bookmark(bookmark, 452 return parse_bookmark(bookmark,
453 NULL,NULL,NULL, NULL, 453 NULL,NULL,NULL, NULL,
@@ -459,7 +459,7 @@ static bool check_bookmark(char* bookmark)
459/* This function will determine if an autoload is necessary. This is an */ 459/* This function will determine if an autoload is necessary. This is an */
460/* interface function. */ 460/* interface function. */
461/* ------------------------------------------------------------------------*/ 461/* ------------------------------------------------------------------------*/
462bool bookmark_autoload(char* file) 462bool bookmark_autoload(const char* file)
463{ 463{
464 int key; 464 int key;
465 int fd; 465 int fd;
@@ -537,7 +537,7 @@ bool bookmark_autoload(char* file)
537/* This function loads the bookmark information into the resume memory. */ 537/* This function loads the bookmark information into the resume memory. */
538/* This is an interface function. */ 538/* This is an interface function. */
539/* ------------------------------------------------------------------------*/ 539/* ------------------------------------------------------------------------*/
540bool bookmark_load(char* file, bool autoload) 540bool bookmark_load(const char* file, bool autoload)
541{ 541{
542 int fd; 542 int fd;
543 bool success = true; 543 bool success = true;
@@ -587,7 +587,7 @@ bool bookmark_load(char* file, bool autoload)
587} 587}
588 588
589 589
590static int get_bookmark_count(char* bookmark_file_name) 590static int get_bookmark_count(const char* bookmark_file_name)
591{ 591{
592 int read_count = 0; 592 int read_count = 0;
593 int file = open(bookmark_file_name, O_RDONLY); 593 int file = open(bookmark_file_name, O_RDONLY);
@@ -613,7 +613,7 @@ static int get_bookmark_count(char* bookmark_file_name)
613/* This displays a the bookmarks in a file and allows the user to */ 613/* This displays a the bookmarks in a file and allows the user to */
614/* select one to play. */ 614/* select one to play. */
615/* ------------------------------------------------------------------------*/ 615/* ------------------------------------------------------------------------*/
616static char* select_bookmark(char* bookmark_file_name) 616static char* select_bookmark(const char* bookmark_file_name)
617{ 617{
618 int bookmark_id = 0; 618 int bookmark_id = 0;
619 int bookmark_id_prev = -1; 619 int bookmark_id_prev = -1;
@@ -732,7 +732,7 @@ static char* select_bookmark(char* bookmark_file_name)
732/* This function takes a location in a bookmark file and deletes that */ 732/* This function takes a location in a bookmark file and deletes that */
733/* bookmark. */ 733/* bookmark. */
734/* ------------------------------------------------------------------------*/ 734/* ------------------------------------------------------------------------*/
735static bool delete_bookmark(char* bookmark_file_name, int bookmark_id) 735static bool delete_bookmark(const char* bookmark_file_name, int bookmark_id)
736{ 736{
737 int temp_bookmark_file = 0; 737 int temp_bookmark_file = 0;
738 int bookmark_file = 0; 738 int bookmark_file = 0;
@@ -784,7 +784,7 @@ static bool delete_bookmark(char* bookmark_file_name, int bookmark_id)
784/* ----------------------------------------------------------------------- */ 784/* ----------------------------------------------------------------------- */
785/* This function parses a bookmark and displays it for the user. */ 785/* This function parses a bookmark and displays it for the user. */
786/* ------------------------------------------------------------------------*/ 786/* ------------------------------------------------------------------------*/
787static void display_bookmark(char* bookmark, 787static void display_bookmark(const char* bookmark,
788 int bookmark_id, 788 int bookmark_id,
789 int bookmark_count) 789 int bookmark_count)
790{ 790{
@@ -908,7 +908,7 @@ static void display_bookmark(char* bookmark,
908/* ----------------------------------------------------------------------- */ 908/* ----------------------------------------------------------------------- */
909/* This function parses a bookmark, says the voice UI part of it. */ 909/* This function parses a bookmark, says the voice UI part of it. */
910/* ------------------------------------------------------------------------*/ 910/* ------------------------------------------------------------------------*/
911static void say_bookmark(char* bookmark, 911static void say_bookmark(const char* bookmark,
912 int bookmark_id) 912 int bookmark_id)
913{ 913{
914 int resume_index; 914 int resume_index;
@@ -952,7 +952,7 @@ static void say_bookmark(char* bookmark,
952/* in the file, it will return the last one. */ 952/* in the file, it will return the last one. */
953/* It also returns the index number of the bookmark in the file */ 953/* It also returns the index number of the bookmark in the file */
954/* ------------------------------------------------------------------------*/ 954/* ------------------------------------------------------------------------*/
955static char* get_bookmark(char* bookmark_file, int bookmark_count) 955static char* get_bookmark(const char* bookmark_file, int bookmark_count)
956{ 956{
957 int read_count = -1; 957 int read_count = -1;
958 int result = 0; 958 int result = 0;
@@ -989,7 +989,7 @@ static char* get_bookmark(char* bookmark_file, int bookmark_count)
989/* validates the bookmark. Passing in NULL for an output variable */ 989/* validates the bookmark. Passing in NULL for an output variable */
990/* indicates that value is not requested. */ 990/* indicates that value is not requested. */
991/* ----------------------------------------------------------------------- */ 991/* ----------------------------------------------------------------------- */
992static bool parse_bookmark(char *bookmark, 992static bool parse_bookmark(const char *bookmark,
993 int *resume_index, 993 int *resume_index,
994 int *resume_offset, 994 int *resume_offset,
995 int *resume_seed, 995 int *resume_seed,
@@ -1123,7 +1123,7 @@ static bool parse_bookmark(char *bookmark,
1123/* it would be here that the centralized/decentralized bookmark code */ 1123/* it would be here that the centralized/decentralized bookmark code */
1124/* could be placed. */ 1124/* could be placed. */
1125/* ----------------------------------------------------------------------- */ 1125/* ----------------------------------------------------------------------- */
1126static bool generate_bookmark_file_name(char *in) 1126static bool generate_bookmark_file_name(const char *in)
1127{ 1127{
1128 int len = strlen(in); 1128 int len = strlen(in);
1129 1129
diff --git a/apps/bookmark.h b/apps/bookmark.h
index bff58f67a8..2f8b58af7e 100644
--- a/apps/bookmark.h
+++ b/apps/bookmark.h
@@ -25,8 +25,8 @@ bool bookmark_menu(void);
25bool bookmark_autobookmark(void); 25bool bookmark_autobookmark(void);
26bool bookmark_create_menu(void); 26bool bookmark_create_menu(void);
27bool bookmark_mrb_load(void); 27bool bookmark_mrb_load(void);
28bool bookmark_autoload(char* file); 28bool bookmark_autoload(const char* file);
29bool bookmark_load(char* file, bool autoload); 29bool bookmark_load(const char* file, bool autoload);
30void bookmark_play(char* resume_file, int index, int offset, int seed); 30void bookmark_play(char* resume_file, int index, int offset, int seed);
31 31
32#endif /* __BOOKMARK_H__ */ 32#endif /* __BOOKMARK_H__ */
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index 0f4305640e..9fd2e33749 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -202,7 +202,7 @@ bool dbg_mpeg_thread(void)
202 202
203 203
204/* Tool function to calculate a CRC16 across some buffer */ 204/* Tool function to calculate a CRC16 across some buffer */
205unsigned short crc_16(unsigned char* buf, unsigned len) 205unsigned short crc_16(const unsigned char* buf, unsigned len)
206{ 206{
207 /* CCITT standard polynomial 0x1021 */ 207 /* CCITT standard polynomial 0x1021 */
208 static const unsigned short crc16_lookup[16] = 208 static const unsigned short crc16_lookup[16] =
diff --git a/apps/filetypes.c b/apps/filetypes.c
index d7151ca661..09090c30d4 100644
--- a/apps/filetypes.c
+++ b/apps/filetypes.c
@@ -72,11 +72,11 @@ static char string_buffer[STRING_BUFFER_SIZE];
72 72
73/* prototypes */ 73/* prototypes */
74#ifdef HAVE_LCD_BITMAP 74#ifdef HAVE_LCD_BITMAP
75static char* string2icon(char*); 75static char* string2icon(const char*);
76#endif 76#endif
77static char* get_string(char*); 77static char* get_string(const char*);
78static int find_attr_index(int); 78static int find_attr_index(int);
79static bool read_config(char*); 79static bool read_config(const char*);
80static void rm_whitespaces(char*); 80static void rm_whitespaces(char*);
81static void scan_plugins(void); 81static void scan_plugins(void);
82 82
@@ -160,7 +160,7 @@ int filetype_get_icon(int attr)
160} 160}
161 161
162/* get plugin */ 162/* get plugin */
163char* filetype_get_plugin(struct entry* file) 163char* filetype_get_plugin(const struct entry* file)
164{ 164{
165 int ix; 165 int ix;
166 166
@@ -197,7 +197,7 @@ bool filetype_supported(int attr)
197} 197}
198 198
199/* get the "dynamic" attribute for an extension */ 199/* get the "dynamic" attribute for an extension */
200int filetype_get_attr(char* name) 200int filetype_get_attr(const char* name)
201{ 201{
202 int i; 202 int i;
203 203
@@ -239,7 +239,7 @@ int filetype_load_menu(struct menu_item* menu,int max_items)
239} 239}
240 240
241/* start a plugin with an argument (called from onplay.c) */ 241/* start a plugin with an argument (called from onplay.c) */
242int filetype_load_plugin(char* plugin, char* file) 242int filetype_load_plugin(const char* plugin, char* file)
243{ 243{
244 snprintf(plugin_name,sizeof(plugin_name),"%s/%s.rock", 244 snprintf(plugin_name,sizeof(plugin_name),"%s/%s.rock",
245 VIEWERS_DIR,plugin); 245 VIEWERS_DIR,plugin);
@@ -427,7 +427,7 @@ static void scan_plugins(void)
427} 427}
428 428
429/* read config file (or cahe file) */ 429/* read config file (or cahe file) */
430bool read_config(char* file) 430bool read_config(const char* file)
431{ 431{
432 enum {extension, 432 enum {extension,
433 plugin, 433 plugin,
@@ -584,7 +584,7 @@ bool read_config(char* file)
584 584
585#ifdef HAVE_LCD_BITMAP 585#ifdef HAVE_LCD_BITMAP
586/* convert an ascii hexadecimal icon to a binary icon */ 586/* convert an ascii hexadecimal icon to a binary icon */
587static char* string2icon(char* str) 587static char* string2icon(const char* str)
588{ 588{
589 char tmp[ICON_LENGTH*2]; 589 char tmp[ICON_LENGTH*2];
590 char *cp; 590 char *cp;
@@ -634,7 +634,7 @@ static char* string2icon(char* str)
634#endif 634#endif
635 635
636/* get string from buffer */ 636/* get string from buffer */
637static char* get_string(char* str) 637static char* get_string(const char* str)
638{ 638{
639 unsigned int l=strlen(str)+1; 639 unsigned int l=strlen(str)+1;
640 char* cp; 640 char* cp;
diff --git a/apps/filetypes.h b/apps/filetypes.h
index c5bccf4498..e72dd6ffd3 100644
--- a/apps/filetypes.h
+++ b/apps/filetypes.h
@@ -23,17 +23,17 @@
23#include <tree.h> 23#include <tree.h>
24#include <menu.h> 24#include <menu.h>
25 25
26int filetype_get_attr(char*); 26int filetype_get_attr(const char*);
27#ifdef HAVE_LCD_BITMAP 27#ifdef HAVE_LCD_BITMAP
28const char* filetype_get_icon(int); 28const char* filetype_get_icon(int);
29#else 29#else
30int filetype_get_icon(int); 30int filetype_get_icon(int);
31#endif 31#endif
32char* filetype_get_plugin(struct entry*); 32char* filetype_get_plugin(const struct entry*);
33void filetype_init(void); 33void filetype_init(void);
34bool filetype_supported(int); 34bool filetype_supported(int);
35int filetype_load_menu(struct menu_item*, int); 35int filetype_load_menu(struct menu_item*, int);
36int filetype_load_plugin(char*,char*); 36int filetype_load_plugin(const char*, char*);
37 37
38struct file_type { 38struct file_type {
39#ifdef HAVE_LCD_BITMAP 39#ifdef HAVE_LCD_BITMAP
diff --git a/apps/language.c b/apps/language.c
index 2b050c66ef..2b9b6ff30b 100644
--- a/apps/language.c
+++ b/apps/language.c
@@ -28,7 +28,7 @@ extern int printf(const char *format, ...);
28 28
29static unsigned char language_buffer[MAX_LANGUAGE_SIZE]; 29static unsigned char language_buffer[MAX_LANGUAGE_SIZE];
30 30
31int lang_load(char *filename) 31int lang_load(const char *filename)
32{ 32{
33 int filesize; 33 int filesize;
34 int fd = open(filename, O_RDONLY); 34 int fd = open(filename, O_RDONLY);
diff --git a/apps/language.h b/apps/language.h
index 454d852c7c..0262864431 100644
--- a/apps/language.h
+++ b/apps/language.h
@@ -25,4 +25,4 @@
25#define LANGUAGE_VERSION 0x02 25#define LANGUAGE_VERSION 0x02
26 26
27/* load a given language file */ 27/* load a given language file */
28int lang_load(char *filename); 28int lang_load(const char *filename);
diff --git a/apps/menu.c b/apps/menu.c
index 5e8a51200a..fccc88479b 100644
--- a/apps/menu.c
+++ b/apps/menu.c
@@ -49,7 +49,7 @@ struct menu {
49 int (*callback)(int, int); 49 int (*callback)(int, int);
50#ifdef HAVE_LCD_BITMAP 50#ifdef HAVE_LCD_BITMAP
51 bool use_buttonbar; /* true if a buttonbar is defined */ 51 bool use_buttonbar; /* true if a buttonbar is defined */
52 char *buttonbar[3]; 52 const char *buttonbar[3];
53#endif 53#endif
54}; 54};
55 55
@@ -225,7 +225,7 @@ static void put_cursor(int m, int target)
225} 225}
226 226
227int menu_init(const struct menu_item* mitems, int count, int (*callback)(int, int), 227int menu_init(const struct menu_item* mitems, int count, int (*callback)(int, int),
228 char *button1, char *button2, char *button3) 228 const char *button1, const char *button2, const char *button3)
229{ 229{
230 int i; 230 int i;
231 231
diff --git a/apps/menu.h b/apps/menu.h
index d097f73a0f..12d934fc18 100644
--- a/apps/menu.h
+++ b/apps/menu.h
@@ -28,7 +28,7 @@ struct menu_item {
28}; 28};
29 29
30int menu_init(const struct menu_item* mitems, int count, int (*callback)(int, int), 30int menu_init(const struct menu_item* mitems, int count, int (*callback)(int, int),
31 char *button1, char *button2, char *button3); 31 const char *button1, const char *button2, const char *button3);
32void menu_exit(int menu); 32void menu_exit(int menu);
33 33
34void put_cursorxy(int x, int y, bool on); 34void put_cursorxy(int x, int y, bool on);
diff --git a/apps/playlist.c b/apps/playlist.c
index f702c1ad9d..fa663fe62f 100644
--- a/apps/playlist.c
+++ b/apps/playlist.c
@@ -128,19 +128,19 @@ static struct playlist_info current_playlist;
128static char now_playing[MAX_PATH+1]; 128static char now_playing[MAX_PATH+1];
129 129
130static void empty_playlist(struct playlist_info* playlist, bool resume); 130static void empty_playlist(struct playlist_info* playlist, bool resume);
131static void new_playlist(struct playlist_info* playlist, char *dir, 131static void new_playlist(struct playlist_info* playlist, const char *dir,
132 char *file); 132 const char *file);
133static void create_control(struct playlist_info* playlist); 133static void create_control(struct playlist_info* playlist);
134static int check_control(struct playlist_info* playlist); 134static int check_control(struct playlist_info* playlist);
135static void update_playlist_filename(struct playlist_info* playlist, 135static void update_playlist_filename(struct playlist_info* playlist,
136 char *dir, char *file); 136 const char *dir, const char *file);
137static int add_indices_to_playlist(struct playlist_info* playlist, 137static int add_indices_to_playlist(struct playlist_info* playlist,
138 char* buffer, int buflen); 138 char* buffer, int buflen);
139static int add_track_to_playlist(struct playlist_info* playlist, 139static int add_track_to_playlist(struct playlist_info* playlist,
140 char *filename, int position, bool queue, 140 const char *filename, int position,
141 int seek_pos); 141 bool queue, int seek_pos);
142static int add_directory_to_playlist(struct playlist_info* playlist, 142static int add_directory_to_playlist(struct playlist_info* playlist,
143 char *dirname, int *position, bool queue, 143 const char *dirname, int *position, bool queue,
144 int *count, bool recurse); 144 int *count, bool recurse);
145static int remove_track_from_playlist(struct playlist_info* playlist, 145static int remove_track_from_playlist(struct playlist_info* playlist,
146 int position, bool write); 146 int position, bool write);
@@ -149,18 +149,18 @@ static int randomise_playlist(struct playlist_info* playlist,
149 bool write); 149 bool write);
150static int sort_playlist(struct playlist_info* playlist, bool start_current, 150static int sort_playlist(struct playlist_info* playlist, bool start_current,
151 bool write); 151 bool write);
152static int get_next_index(struct playlist_info* playlist, int steps); 152static int get_next_index(const struct playlist_info* playlist, int steps);
153static void find_and_set_playlist_index(struct playlist_info* playlist, 153static void find_and_set_playlist_index(struct playlist_info* playlist,
154 unsigned int seek); 154 unsigned int seek);
155static int compare(const void* p1, const void* p2); 155static int compare(const void* p1, const void* p2);
156static int get_filename(struct playlist_info* playlist, int seek, 156static int get_filename(struct playlist_info* playlist, int seek,
157 bool control_file, char *buf, int buf_length); 157 bool control_file, char *buf, int buf_length);
158static int format_track_path(char *dest, char *src, int buf_length, int max, 158static int format_track_path(char *dest, char *src, int buf_length, int max,
159 char *dir); 159 const char *dir);
160static void display_playlist_count(int count, char *fmt); 160static void display_playlist_count(int count, const char *fmt);
161static void display_buffer_full(void); 161static void display_buffer_full(void);
162static int flush_pending_control(struct playlist_info* playlist); 162static int flush_pending_control(struct playlist_info* playlist);
163static int rotate_index(struct playlist_info* playlist, int index); 163static int rotate_index(const struct playlist_info* playlist, int index);
164 164
165/* 165/*
166 * remove any files and indices associated with the playlist 166 * remove any files and indices associated with the playlist
@@ -212,8 +212,8 @@ static void empty_playlist(struct playlist_info* playlist, bool resume)
212 * Initialize a new playlist for viewing/editing/playing. dir is the 212 * Initialize a new playlist for viewing/editing/playing. dir is the
213 * directory where the playlist is located and file is the filename. 213 * directory where the playlist is located and file is the filename.
214 */ 214 */
215static void new_playlist(struct playlist_info* playlist, char *dir, 215static void new_playlist(struct playlist_info* playlist, const char *dir,
216 char *file) 216 const char *file)
217{ 217{
218 empty_playlist(playlist, false); 218 empty_playlist(playlist, false);
219 219
@@ -291,7 +291,7 @@ static int check_control(struct playlist_info* playlist)
291 * store directory and name of playlist file 291 * store directory and name of playlist file
292 */ 292 */
293static void update_playlist_filename(struct playlist_info* playlist, 293static void update_playlist_filename(struct playlist_info* playlist,
294 char *dir, char *file) 294 const char *dir, const char *file)
295{ 295{
296 char *sep=""; 296 char *sep="";
297 int dirlen = strlen(dir); 297 int dirlen = strlen(dir);
@@ -400,8 +400,8 @@ static int add_indices_to_playlist(struct playlist_info* playlist,
400 * PLAYLIST_INSERT_LAST - Add track to end of playlist 400 * PLAYLIST_INSERT_LAST - Add track to end of playlist
401 */ 401 */
402static int add_track_to_playlist(struct playlist_info* playlist, 402static int add_track_to_playlist(struct playlist_info* playlist,
403 char *filename, int position, bool queue, 403 const char *filename, int position,
404 int seek_pos) 404 bool queue, int seek_pos)
405{ 405{
406 int insert_position = position; 406 int insert_position = position;
407 unsigned int flags = PLAYLIST_INSERT_TYPE_INSERT; 407 unsigned int flags = PLAYLIST_INSERT_TYPE_INSERT;
@@ -523,7 +523,7 @@ static int add_track_to_playlist(struct playlist_info* playlist,
523 * Insert directory into playlist. May be called recursively. 523 * Insert directory into playlist. May be called recursively.
524 */ 524 */
525static int add_directory_to_playlist(struct playlist_info* playlist, 525static int add_directory_to_playlist(struct playlist_info* playlist,
526 char *dirname, int *position, bool queue, 526 const char *dirname, int *position, bool queue,
527 int *count, bool recurse) 527 int *count, bool recurse)
528{ 528{
529 char buf[MAX_PATH+1]; 529 char buf[MAX_PATH+1];
@@ -791,7 +791,7 @@ static int sort_playlist(struct playlist_info* playlist, bool start_current,
791 * returns the index of the track that is "steps" away from current playing 791 * returns the index of the track that is "steps" away from current playing
792 * track. 792 * track.
793 */ 793 */
794static int get_next_index(struct playlist_info* playlist, int steps) 794static int get_next_index(const struct playlist_info* playlist, int steps)
795{ 795{
796 int current_index = playlist->index; 796 int current_index = playlist->index;
797 int next_index = -1; 797 int next_index = -1;
@@ -972,7 +972,7 @@ static int get_filename(struct playlist_info* playlist, int seek,
972 * Returns absolute path of track 972 * Returns absolute path of track
973 */ 973 */
974static int format_track_path(char *dest, char *src, int buf_length, int max, 974static int format_track_path(char *dest, char *src, int buf_length, int max,
975 char *dir) 975 const char *dir)
976{ 976{
977 int i = 0; 977 int i = 0;
978 int j; 978 int j;
@@ -1037,7 +1037,7 @@ static int format_track_path(char *dest, char *src, int buf_length, int max,
1037 * Display splash message showing progress of playlist/directory insertion or 1037 * Display splash message showing progress of playlist/directory insertion or
1038 * save. 1038 * save.
1039 */ 1039 */
1040static void display_playlist_count(int count, char *fmt) 1040static void display_playlist_count(int count, const char *fmt)
1041{ 1041{
1042 lcd_clear_display(); 1042 lcd_clear_display();
1043 1043
@@ -1120,7 +1120,7 @@ static int flush_pending_control(struct playlist_info* playlist)
1120/* 1120/*
1121 * Rotate indices such that first_index is index 0 1121 * Rotate indices such that first_index is index 0
1122 */ 1122 */
1123static int rotate_index(struct playlist_info* playlist, int index) 1123static int rotate_index(const struct playlist_info* playlist, int index)
1124{ 1124{
1125 index -= playlist->first_index; 1125 index -= playlist->first_index;
1126 if (index < 0) 1126 if (index < 0)
@@ -1153,7 +1153,7 @@ void playlist_init(void)
1153/* 1153/*
1154 * Create new playlist 1154 * Create new playlist
1155 */ 1155 */
1156int playlist_create(char *dir, char *file) 1156int playlist_create(const char *dir, const char *file)
1157{ 1157{
1158 struct playlist_info* playlist = &current_playlist; 1158 struct playlist_info* playlist = &current_playlist;
1159 1159
@@ -1555,7 +1555,7 @@ int playlist_resume(void)
1555/* 1555/*
1556 * Add track to in_ram playlist. Used when playing directories. 1556 * Add track to in_ram playlist. Used when playing directories.
1557 */ 1557 */
1558int playlist_add(char *filename) 1558int playlist_add(const char *filename)
1559{ 1559{
1560 struct playlist_info* playlist = &current_playlist; 1560 struct playlist_info* playlist = &current_playlist;
1561 int len = strlen(filename); 1561 int len = strlen(filename);
@@ -1780,7 +1780,8 @@ int playlist_amount(void)
1780 * playlist indices (required for and only used if !current playlist). The 1780 * playlist indices (required for and only used if !current playlist). The
1781 * temp_buffer (if not NULL) is used as a scratchpad when loading indices. 1781 * temp_buffer (if not NULL) is used as a scratchpad when loading indices.
1782 */ 1782 */
1783int playlist_create_ex(struct playlist_info* playlist, char* dir, char* file, 1783int playlist_create_ex(struct playlist_info* playlist,
1784 const char* dir, const char* file,
1784 void* index_buffer, int index_buffer_size, 1785 void* index_buffer, int index_buffer_size,
1785 void* temp_buffer, int temp_buffer_size) 1786 void* temp_buffer, int temp_buffer_size)
1786{ 1787{
@@ -1897,7 +1898,7 @@ void playlist_close(struct playlist_info* playlist)
1897 * Insert track into playlist at specified position (or one of the special 1898 * Insert track into playlist at specified position (or one of the special
1898 * positions). Returns position where track was inserted or -1 if error. 1899 * positions). Returns position where track was inserted or -1 if error.
1899 */ 1900 */
1900int playlist_insert_track(struct playlist_info* playlist, char *filename, 1901int playlist_insert_track(struct playlist_info* playlist, const char *filename,
1901 int position, bool queue) 1902 int position, bool queue)
1902{ 1903{
1903 int result; 1904 int result;
@@ -1925,8 +1926,9 @@ int playlist_insert_track(struct playlist_info* playlist, char *filename,
1925/* 1926/*
1926 * Insert all tracks from specified directory into playlist. 1927 * Insert all tracks from specified directory into playlist.
1927 */ 1928 */
1928int playlist_insert_directory(struct playlist_info* playlist, char *dirname, 1929int playlist_insert_directory(struct playlist_info* playlist,
1929 int position, bool queue, bool recurse) 1930 const char *dirname, int position, bool queue,
1931 bool recurse)
1930{ 1932{
1931 int count = 0; 1933 int count = 0;
1932 int result; 1934 int result;
@@ -2226,7 +2228,7 @@ int playlist_sort(struct playlist_info* playlist, bool start_current)
2226} 2228}
2227 2229
2228/* returns true if playlist has been modified */ 2230/* returns true if playlist has been modified */
2229bool playlist_modified(struct playlist_info* playlist) 2231bool playlist_modified(const struct playlist_info* playlist)
2230{ 2232{
2231 if (!playlist) 2233 if (!playlist)
2232 playlist = &current_playlist; 2234 playlist = &current_playlist;
@@ -2240,7 +2242,7 @@ bool playlist_modified(struct playlist_info* playlist)
2240} 2242}
2241 2243
2242/* returns index of first track in playlist */ 2244/* returns index of first track in playlist */
2243int playlist_get_first_index(struct playlist_info* playlist) 2245int playlist_get_first_index(const struct playlist_info* playlist)
2244{ 2246{
2245 if (!playlist) 2247 if (!playlist)
2246 playlist = &current_playlist; 2248 playlist = &current_playlist;
@@ -2249,7 +2251,7 @@ int playlist_get_first_index(struct playlist_info* playlist)
2249} 2251}
2250 2252
2251/* returns shuffle seed of playlist */ 2253/* returns shuffle seed of playlist */
2252int playlist_get_seed(struct playlist_info* playlist) 2254int playlist_get_seed(const struct playlist_info* playlist)
2253{ 2255{
2254 if (!playlist) 2256 if (!playlist)
2255 playlist = &current_playlist; 2257 playlist = &current_playlist;
@@ -2258,7 +2260,7 @@ int playlist_get_seed(struct playlist_info* playlist)
2258} 2260}
2259 2261
2260/* returns number of tracks in playlist (includes queued/inserted tracks) */ 2262/* returns number of tracks in playlist (includes queued/inserted tracks) */
2261int playlist_amount_ex(struct playlist_info* playlist) 2263int playlist_amount_ex(const struct playlist_info* playlist)
2262{ 2264{
2263 if (!playlist) 2265 if (!playlist)
2264 playlist = &current_playlist; 2266 playlist = &current_playlist;
@@ -2267,7 +2269,8 @@ int playlist_amount_ex(struct playlist_info* playlist)
2267} 2269}
2268 2270
2269/* returns full path of playlist (minus extension) */ 2271/* returns full path of playlist (minus extension) */
2270char *playlist_name(struct playlist_info* playlist, char *buf, int buf_size) 2272char *playlist_name(const struct playlist_info* playlist, char *buf,
2273 int buf_size)
2271{ 2274{
2272 char *sep; 2275 char *sep;
2273 2276
@@ -2288,7 +2291,7 @@ char *playlist_name(struct playlist_info* playlist, char *buf, int buf_size)
2288} 2291}
2289 2292
2290/* returns the playlist filename */ 2293/* returns the playlist filename */
2291char *playlist_get_name(struct playlist_info* playlist, char *buf, 2294char *playlist_get_name(const struct playlist_info* playlist, char *buf,
2292 int buf_size) 2295 int buf_size)
2293{ 2296{
2294 if (!playlist) 2297 if (!playlist)
diff --git a/apps/playlist.h b/apps/playlist.h
index 482cecd128..8698981d26 100644
--- a/apps/playlist.h
+++ b/apps/playlist.h
@@ -68,9 +68,9 @@ struct playlist_track_info
68 68
69/* Exported functions only for current playlist. */ 69/* Exported functions only for current playlist. */
70void playlist_init(void); 70void playlist_init(void);
71int playlist_create(char *dir, char *file); 71int playlist_create(const char *dir, const char *file);
72int playlist_resume(void); 72int playlist_resume(void);
73int playlist_add(char *filename); 73int playlist_add(const char *filename);
74int playlist_shuffle(int random_seed, int start_index); 74int playlist_shuffle(int random_seed, int start_index);
75int playlist_start(int start_index, int offset); 75int playlist_start(int start_index, int offset);
76bool playlist_check(int steps); 76bool playlist_check(int steps);
@@ -82,15 +82,17 @@ int playlist_amount(void);
82 82
83/* Exported functions for all playlists. Pass NULL for playlist_info 83/* Exported functions for all playlists. Pass NULL for playlist_info
84 structure to work with current playlist. */ 84 structure to work with current playlist. */
85int playlist_create_ex(struct playlist_info* playlist, char* dir, char* file, 85int playlist_create_ex(struct playlist_info* playlist,
86 const char* dir, const char* file,
86 void* index_buffer, int index_buffer_size, 87 void* index_buffer, int index_buffer_size,
87 void* temp_buffer, int temp_buffer_size); 88 void* temp_buffer, int temp_buffer_size);
88int playlist_set_current(struct playlist_info* playlist); 89int playlist_set_current(struct playlist_info* playlist);
89void playlist_close(struct playlist_info* playlist); 90void playlist_close(struct playlist_info* playlist);
90int playlist_insert_track(struct playlist_info* playlist, char *filename, 91int playlist_insert_track(struct playlist_info* playlist, const char *filename,
91 int position, bool queue); 92 int position, bool queue);
92int playlist_insert_directory(struct playlist_info* playlist, char *dirname, 93int playlist_insert_directory(struct playlist_info* playlist,
93 int position, bool queue, bool recurse); 94 const char *dirname, int position, bool queue,
95 bool recurse);
94int playlist_insert_playlist(struct playlist_info* playlist, char *filename, 96int playlist_insert_playlist(struct playlist_info* playlist, char *filename,
95 int position, bool queue); 97 int position, bool queue);
96int playlist_delete(struct playlist_info* playlist, int index); 98int playlist_delete(struct playlist_info* playlist, int index);
@@ -98,12 +100,13 @@ int playlist_move(struct playlist_info* playlist, int index, int new_index);
98int playlist_randomise(struct playlist_info* playlist, unsigned int seed, 100int playlist_randomise(struct playlist_info* playlist, unsigned int seed,
99 bool start_current); 101 bool start_current);
100int playlist_sort(struct playlist_info* playlist, bool start_current); 102int playlist_sort(struct playlist_info* playlist, bool start_current);
101bool playlist_modified(struct playlist_info* playlist); 103bool playlist_modified(const struct playlist_info* playlist);
102int playlist_get_first_index(struct playlist_info* playlist); 104int playlist_get_first_index(const struct playlist_info* playlist);
103int playlist_get_seed(struct playlist_info* playlist); 105int playlist_get_seed(const struct playlist_info* playlist);
104int playlist_amount_ex(struct playlist_info* playlist); 106int playlist_amount_ex(const struct playlist_info* playlist);
105char *playlist_name(struct playlist_info* playlist, char *buf, int buf_size); 107char *playlist_name(const struct playlist_info* playlist, char *buf,
106char *playlist_get_name(struct playlist_info* playlist, char *buf, 108 int buf_size);
109char *playlist_get_name(const struct playlist_info* playlist, char *buf,
107 int buf_size); 110 int buf_size);
108int playlist_get_track_info(struct playlist_info* playlist, int index, 111int playlist_get_track_info(struct playlist_info* playlist, int index,
109 struct playlist_track_info* info); 112 struct playlist_track_info* info);
diff --git a/apps/playlist_viewer.c b/apps/playlist_viewer.c
index e5d95495fa..f093efd172 100644
--- a/apps/playlist_viewer.c
+++ b/apps/playlist_viewer.c
@@ -123,8 +123,8 @@ static bool initialize(char* filename, bool reload);
123static void load_playlist_entries(int start_index); 123static void load_playlist_entries(int start_index);
124static void load_playlist_entries_r(int end_index); 124static void load_playlist_entries_r(int end_index);
125static int load_entry(int index, int pos, char* p, int size); 125static int load_entry(int index, int pos, char* p, int size);
126static void format_name(char* dest, char* src); 126static void format_name(char* dest, const char* src);
127static void format_line(struct playlist_entry* track, char* str, int len); 127static void format_line(const struct playlist_entry* track, char* str, int len);
128static void display_playlist(void); 128static void display_playlist(void);
129static void update_display_line(int line, bool scroll); 129static void update_display_line(int line, bool scroll);
130static void scroll_display(int lines); 130static void scroll_display(int lines);
@@ -392,7 +392,7 @@ static int load_entry(int index, int pos, char* p, int size)
392} 392}
393 393
394/* Format trackname for display purposes */ 394/* Format trackname for display purposes */
395static void format_name(char* dest, char* src) 395static void format_name(char* dest, const char* src)
396{ 396{
397 switch (global_settings.playlist_viewer_track_display) 397 switch (global_settings.playlist_viewer_track_display)
398 { 398 {
@@ -422,7 +422,7 @@ static void format_name(char* dest, char* src)
422} 422}
423 423
424/* Format display line */ 424/* Format display line */
425static void format_line(struct playlist_entry* track, char* str, int len) 425static void format_line(const struct playlist_entry* track, char* str, int len)
426{ 426{
427 char name[MAX_PATH]; 427 char name[MAX_PATH];
428 428
diff --git a/apps/plugin.c b/apps/plugin.c
index f210462815..a7ae34f67e 100644
--- a/apps/plugin.c
+++ b/apps/plugin.c
@@ -261,7 +261,7 @@ static const struct plugin_api rockbox_api = {
261 mpeg_get_last_header, 261 mpeg_get_last_header,
262}; 262};
263 263
264int plugin_load(char* plugin, void* parameter) 264int plugin_load(const char* plugin, void* parameter)
265{ 265{
266 enum plugin_status (*plugin_start)(struct plugin_api* api, void* param); 266 enum plugin_status (*plugin_start)(struct plugin_api* api, void* param);
267 int rc; 267 int rc;
diff --git a/apps/plugin.h b/apps/plugin.h
index 53648ad4c7..e8fb25e555 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -153,7 +153,7 @@ struct plugin_api {
153#endif 153#endif
154 void (*backlight_on)(void); 154 void (*backlight_on)(void);
155 void (*backlight_off)(void); 155 void (*backlight_off)(void);
156 void (*splash)(int ticks, bool center, char *fmt, ...); 156 void (*splash)(int ticks, bool center, const char *fmt, ...);
157 157
158 /* button */ 158 /* button */
159 int (*button_get)(bool block); 159 int (*button_get)(bool block);
@@ -298,7 +298,7 @@ struct plugin_api {
298}; 298};
299 299
300/* defined by the plugin loader (plugin.c) */ 300/* defined by the plugin loader (plugin.c) */
301int plugin_load(char* plugin, void* parameter); 301int plugin_load(const char* plugin, void* parameter);
302void* plugin_get_buffer(int *buffer_size); 302void* plugin_get_buffer(int *buffer_size);
303void* plugin_get_mp3_buffer(int *buffer_size); 303void* plugin_get_mp3_buffer(int *buffer_size);
304int plugin_register_timer(int cycles, int prio, void (*timer_callback)(void)); 304int plugin_register_timer(int cycles, int prio, void (*timer_callback)(void));
diff --git a/apps/screens.c b/apps/screens.c
index a926063efc..3e30e3e021 100644
--- a/apps/screens.c
+++ b/apps/screens.c
@@ -656,10 +656,10 @@ bool quick_screen(int context, int button)
656#define MAXLINES 2 656#define MAXLINES 2
657#endif 657#endif
658 658
659void splash(int ticks, /* how long the splash is displayed */ 659void splash(int ticks, /* how long the splash is displayed */
660 bool center, /* FALSE means left-justified, TRUE means 660 bool center, /* FALSE means left-justified, TRUE means
661 horizontal and vertical center */ 661 horizontal and vertical center */
662 char *fmt, /* what to say *printf style */ 662 const char *fmt, /* what to say *printf style */
663 ...) 663 ...)
664{ 664{
665 char *next; 665 char *next;
@@ -813,7 +813,7 @@ void charging_splash(void)
813#ifdef HAVE_LCD_BITMAP 813#ifdef HAVE_LCD_BITMAP
814 814
815/* little helper function for voice output */ 815/* little helper function for voice output */
816static void say_time(int cursorpos, struct tm *tm) 816static void say_time(int cursorpos, const struct tm *tm)
817{ 817{
818 const int unit[] = { UNIT_HOUR, UNIT_MIN, UNIT_SEC, 0, 0, 0 }; 818 const int unit[] = { UNIT_HOUR, UNIT_MIN, UNIT_SEC, 0, 0, 0 };
819 int value = 0; 819 int value = 0;
@@ -850,7 +850,7 @@ static void say_time(int cursorpos, struct tm *tm)
850#define INDEX_X 0 850#define INDEX_X 0
851#define INDEX_Y 1 851#define INDEX_Y 1
852#define INDEX_WIDTH 2 852#define INDEX_WIDTH 2
853bool set_time_screen(char* string, struct tm *tm) 853bool set_time_screen(const char* string, struct tm *tm)
854{ 854{
855 bool done = false; 855 bool done = false;
856 int button; 856 int button;
diff --git a/apps/screens.h b/apps/screens.h
index b4f293f0ba..a119a9b853 100644
--- a/apps/screens.h
+++ b/apps/screens.h
@@ -31,14 +31,14 @@ int on_screen(void);
31bool quick_screen(const int, const int); 31bool quick_screen(const int, const int);
32#endif 32#endif
33 33
34void splash(int ticks, /* how long */ 34void splash(int ticks, /* how long */
35 bool center, /* FALSE means left-justified, TRUE means 35 bool center, /* FALSE means left-justified, TRUE means
36 horizontal and vertical center */ 36 horizontal and vertical center */
37 char *fmt, /* what to say *printf style */ 37 const char *fmt, /* what to say *printf style */
38 ...); 38 ...);
39 39
40#ifdef HAVE_RTC 40#ifdef HAVE_RTC
41bool set_time_screen(char* string, struct tm *tm); 41bool set_time_screen(const char* string, struct tm *tm);
42#endif 42#endif
43 43
44bool shutdown_screen(void); 44bool shutdown_screen(void);
diff --git a/apps/settings.c b/apps/settings.c
index 47969d1abe..b469ce6d54 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -339,7 +339,7 @@ static const struct bit_entry hd_bits[] =
339 339
340/* helper function to extract n (<=32) bits from an arbitrary position */ 340/* helper function to extract n (<=32) bits from an arbitrary position */
341static unsigned long get_bits( 341static unsigned long get_bits(
342 unsigned long* p, /* the start of the bitfield array */ 342 const unsigned long* p, /* the start of the bitfield array */
343 unsigned int from, /* bit no. to start reading from */ 343 unsigned int from, /* bit no. to start reading from */
344 unsigned int size) /* how many bits to read */ 344 unsigned int size) /* how many bits to read */
345{ 345{
@@ -418,7 +418,7 @@ static void set_bits(
418 * Calculates the checksum for the config block and returns it 418 * Calculates the checksum for the config block and returns it
419 */ 419 */
420 420
421static unsigned short calculate_config_checksum(unsigned char* buf) 421static unsigned short calculate_config_checksum(const unsigned char* buf)
422{ 422{
423 unsigned int i; 423 unsigned int i;
424 unsigned char cksum[2]; 424 unsigned char cksum[2];
@@ -890,8 +890,8 @@ void set_file(char* filename, char* setting, int maxlen)
890static int load_cfg_table( 890static int load_cfg_table(
891 const struct bit_entry* p_table, /* the table which describes the entries */ 891 const struct bit_entry* p_table, /* the table which describes the entries */
892 int count, /* number of entries in the table, including the first */ 892 int count, /* number of entries in the table, including the first */
893 char* name, /* the item to be searched */ 893 const char* name, /* the item to be searched */
894 char* value, /* the value which got loaded for that item */ 894 const char* value, /* the value which got loaded for that item */
895 int hint) /* position to start looking */ 895 int hint) /* position to start looking */
896{ 896{
897 int i = hint; 897 int i = hint;
@@ -963,7 +963,7 @@ static int load_cfg_table(
963} 963}
964 964
965 965
966bool settings_load_config(char* file) 966bool settings_load_config(const char* file)
967{ 967{
968 int fd; 968 int fd;
969 char line[128]; 969 char line[128];
@@ -1238,7 +1238,7 @@ void settings_reset(void) {
1238 1238
1239} 1239}
1240 1240
1241bool set_bool(char* string, bool* variable ) 1241bool set_bool(const char* string, bool* variable )
1242{ 1242{
1243 return set_bool_options(string, variable, 1243 return set_bool_options(string, variable,
1244 STR(LANG_SET_BOOL_YES), 1244 STR(LANG_SET_BOOL_YES),
@@ -1256,9 +1256,9 @@ void bool_funcwrapper(int value)
1256 boolfunction(false); 1256 boolfunction(false);
1257} 1257}
1258 1258
1259bool set_bool_options(char* string, bool* variable, 1259bool set_bool_options(const char* string, bool* variable,
1260 char* yes_str, int yes_voice, 1260 const char* yes_str, int yes_voice,
1261 char* no_str, int no_voice, 1261 const char* no_str, int no_voice,
1262 void (*function)(bool)) 1262 void (*function)(bool))
1263{ 1263{
1264 struct opt_items names[] = { {no_str, no_voice}, {yes_str, yes_voice} }; 1264 struct opt_items names[] = { {no_str, no_voice}, {yes_str, yes_voice} };
@@ -1270,8 +1270,8 @@ bool set_bool_options(char* string, bool* variable,
1270 return result; 1270 return result;
1271} 1271}
1272 1272
1273bool set_int(char* string, 1273bool set_int(const char* string,
1274 char* unit, 1274 const char* unit,
1275 int voice_unit, 1275 int voice_unit,
1276 int* variable, 1276 int* variable,
1277 void (*function)(int), 1277 void (*function)(int),
@@ -1391,7 +1391,7 @@ bool set_int(char* string,
1391 different and bit-incompatible types and can not share the same access 1391 different and bit-incompatible types and can not share the same access
1392 code. */ 1392 code. */
1393 1393
1394bool set_option(char* string, void* variable, enum optiontype type, 1394bool set_option(const char* string, void* variable, enum optiontype type,
1395 const struct opt_items* options, int numoptions, void (*function)(int)) 1395 const struct opt_items* options, int numoptions, void (*function)(int))
1396{ 1396{
1397 bool done = false; 1397 bool done = false;
diff --git a/apps/settings.h b/apps/settings.h
index 78f46eaa4f..331e8dc904 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -264,19 +264,19 @@ void settings_apply(void);
264void settings_apply_pm_range(void); 264void settings_apply_pm_range(void);
265void settings_display(void); 265void settings_display(void);
266 266
267bool settings_load_config(char* file); 267bool settings_load_config(const char* file);
268bool settings_save_config(void); 268bool settings_save_config(void);
269bool set_bool_options(char* string, bool* variable, 269bool set_bool_options(const char* string, bool* variable,
270 char* yes_str, int yes_voice, 270 const char* yes_str, int yes_voice,
271 char* no_str, int no_voice, 271 const char* no_str, int no_voice,
272 void (*function)(bool)); 272 void (*function)(bool));
273 273
274bool set_bool(char* string, bool* variable ); 274bool set_bool(const char* string, bool* variable );
275bool set_option(char* string, void* variable, enum optiontype type, 275bool set_option(const char* string, void* variable, enum optiontype type,
276 const struct opt_items* options, int numoptions, void (*function)(int)); 276 const struct opt_items* options, int numoptions, void (*function)(int));
277bool set_int(char* string, char* unit, int voice_unit, int* variable, 277bool set_int(const char* string, const char* unit, int voice_unit, int* variable,
278 void (*function)(int), int step, int min, int max ); 278 void (*function)(int), int step, int min, int max );
279bool set_time_screen(char* string, struct tm *tm); 279bool set_time_screen(const char* string, struct tm *tm);
280int read_line(int fd, char* buffer, int buffer_size); 280int read_line(int fd, char* buffer, int buffer_size);
281void set_file(char* filename, char* setting, int maxlen); 281void set_file(char* filename, char* setting, int maxlen);
282 282
diff --git a/apps/sound_menu.c b/apps/sound_menu.c
index bbf1c6c473..a037c94084 100644
--- a/apps/sound_menu.c
+++ b/apps/sound_menu.c
@@ -42,7 +42,7 @@ static const char* const fmt[] =
42 "%d.%02d %s " /* 2 decimals */ 42 "%d.%02d %s " /* 2 decimals */
43}; 43};
44 44
45bool set_sound(char* string, 45bool set_sound(const char* string,
46 int* variable, 46 int* variable,
47 int setting) 47 int setting)
48{ 48{
diff --git a/apps/status.c b/apps/status.c
index 8c4a7ef809..f144adebef 100644
--- a/apps/status.c
+++ b/apps/status.c
@@ -268,7 +268,7 @@ void status_draw(bool force_redraw)
268} 268}
269 269
270#ifdef HAVE_LCD_BITMAP 270#ifdef HAVE_LCD_BITMAP
271static void draw_buttonbar_btn(int num, char* caption) 271static void draw_buttonbar_btn(int num, const char* caption)
272{ 272{
273 int xpos, ypos, button_width, text_width; 273 int xpos, ypos, button_width, text_width;
274 int fw, fh; 274 int fw, fh;
@@ -294,7 +294,8 @@ static char stored_caption1[8];
294static char stored_caption2[8]; 294static char stored_caption2[8];
295static char stored_caption3[8]; 295static char stored_caption3[8];
296 296
297void buttonbar_set(char* caption1, char *caption2, char *caption3) 297void buttonbar_set(const char* caption1, const char *caption2,
298 const char *caption3)
298{ 299{
299 buttonbar_unset(); 300 buttonbar_unset();
300 if(caption1) 301 if(caption1)
diff --git a/apps/status.h b/apps/status.h
index c812b9cb75..ab8939cda5 100644
--- a/apps/status.h
+++ b/apps/status.h
@@ -34,7 +34,8 @@ void status_init(void);
34void status_set_ffmode(enum playmode mode); 34void status_set_ffmode(enum playmode mode);
35#ifdef HAVE_LCD_BITMAP 35#ifdef HAVE_LCD_BITMAP
36bool statusbar(bool state); 36bool statusbar(bool state);
37void buttonbar_set(char* caption1, char* caption2, char* caption3); 37void buttonbar_set(const char* caption1, const char* caption2,
38 const char* caption3);
38void buttonbar_unset(void); 39void buttonbar_unset(void);
39bool buttonbar_isset(void); 40bool buttonbar_isset(void);
40void buttonbar_draw(void); 41void buttonbar_draw(void);
diff --git a/apps/talk.c b/apps/talk.c
index 1b3dda39ed..d90d23866e 100644
--- a/apps/talk.c
+++ b/apps/talk.c
@@ -378,7 +378,7 @@ int talk_id(int id, bool enqueue)
378 378
379 379
380/* play a thumbnail from file */ 380/* play a thumbnail from file */
381int talk_file(char* filename, bool enqueue) 381int talk_file(const char* filename, bool enqueue)
382{ 382{
383 int fd; 383 int fd;
384 int size; 384 int size;
@@ -532,7 +532,7 @@ int talk_value(int n, int unit, bool enqueue)
532} 532}
533 533
534/* spell a string */ 534/* spell a string */
535int talk_spell(char* spell, bool enqueue) 535int talk_spell(const char* spell, bool enqueue)
536{ 536{
537 char c; /* currently processed char */ 537 char c; /* currently processed char */
538 538
diff --git a/apps/talk.h b/apps/talk.h
index de93b1678c..c4c8bc7285 100644
--- a/apps/talk.h
+++ b/apps/talk.h
@@ -49,7 +49,7 @@ enum {
49 49
50/* make a "talkable" ID from number + unit 50/* make a "talkable" ID from number + unit
51 unit is upper 4 bits, number the remaining (in regular 2's complement) */ 51 unit is upper 4 bits, number the remaining (in regular 2's complement) */
52#define TALK_ID(n,u) ((u)<<UNIT_SHIFT | ((n) & ~(-1<<UNIT_SHIFT))) 52#define TALK_ID(n,u) ((u)<<UNIT_SHIFT | ((n) & ~(-1<<UNIT_SHIFT)))
53 53
54/* convenience macro to have both virtual pointer and ID as arguments */ 54/* convenience macro to have both virtual pointer and ID as arguments */
55#define STR(id) ID2P(id), id 55#define STR(id) ID2P(id), id
@@ -61,9 +61,9 @@ extern const char* const dir_thumbnail_name;
61void talk_init(void); 61void talk_init(void);
62int talk_buffer_steal(void); /* claim the mp3 buffer e.g. for play/record */ 62int talk_buffer_steal(void); /* claim the mp3 buffer e.g. for play/record */
63int talk_id(int id, bool enqueue); /* play a voice ID from voicefont */ 63int talk_id(int id, bool enqueue); /* play a voice ID from voicefont */
64int talk_file(char* filename, bool enqueue); /* play a thumbnail from file */ 64int talk_file(const char* filename, bool enqueue); /* play a thumbnail from file */
65int talk_number(int n, bool enqueue); /* say a number */ 65int talk_number(int n, bool enqueue); /* say a number */
66int talk_value(int n, int unit, bool enqueue); /* say a numeric value */ 66int talk_value(int n, int unit, bool enqueue); /* say a numeric value */
67int talk_spell(char* spell, bool enqueue); /* spell a string */ 67int talk_spell(const char* spell, bool enqueue); /* spell a string */
68 68
69#endif /* __TALK_H__ */ 69#endif /* __TALK_H__ */
diff --git a/apps/tree.c b/apps/tree.c
index 017e9877f1..c9249caa7d 100644
--- a/apps/tree.c
+++ b/apps/tree.c
@@ -118,7 +118,7 @@ static int boot_cluster;
118static bool boot_changed = false; 118static bool boot_changed = false;
119 119
120static bool start_wps = false; 120static bool start_wps = false;
121static bool dirbrowse(char *root, int *dirfilter); 121static bool dirbrowse(const char *root, const int *dirfilter);
122 122
123void browse_root(void) 123void browse_root(void)
124{ 124{
@@ -293,7 +293,7 @@ static int compare(const void* p1, const void* p2)
293 return 0; /* never reached */ 293 return 0; /* never reached */
294} 294}
295 295
296static void showfileline(int line, int direntry, bool scroll, int *dirfilter) 296static void showfileline(int line, int direntry, bool scroll, const int *dirfilter)
297{ 297{
298 char* name = dircache[direntry].name; 298 char* name = dircache[direntry].name;
299 int xpos = LINE_X; 299 int xpos = LINE_X;
@@ -331,7 +331,7 @@ static void showfileline(int line, int direntry, bool scroll, int *dirfilter)
331} 331}
332 332
333/* load sorted directory into dircache. returns NULL on failure. */ 333/* load sorted directory into dircache. returns NULL on failure. */
334struct entry* load_and_sort_directory(char *dirname, int *dirfilter, 334struct entry* load_and_sort_directory(const char *dirname, const int *dirfilter,
335 int *num_files, bool *buffer_full) 335 int *num_files, bool *buffer_full)
336{ 336{
337 int i; 337 int i;
@@ -453,7 +453,7 @@ static int recalc_screen_height(void)
453} 453}
454#endif 454#endif
455 455
456static int showdir(char *path, int start, int *dirfilter) 456static int showdir(const char *path, int start, const int *dirfilter)
457{ 457{
458 int i; 458 int i;
459 int tree_max_on_screen; 459 int tree_max_on_screen;
@@ -652,7 +652,7 @@ static bool ask_resume(bool ask_once)
652} 652}
653 653
654/* load tracks from specified directory to resume play */ 654/* load tracks from specified directory to resume play */
655void resume_directory(char *dir) 655void resume_directory(const char *dir)
656{ 656{
657 bool buffer_full; 657 bool buffer_full;
658 658
@@ -753,7 +753,8 @@ void set_current_file(char *path)
753} 753}
754 754
755#ifdef BUTTON_ON 755#ifdef BUTTON_ON
756static bool handle_on(int *ds, int *dc, int numentries, int tree_max_on_screen, int *dirfilter) 756static bool handle_on(int *ds, int *dc, int numentries, int tree_max_on_screen,
757 const int *dirfilter)
757{ 758{
758 bool exit = false; 759 bool exit = false;
759 bool used = false; 760 bool used = false;
@@ -878,7 +879,7 @@ static bool handle_on(int *ds, int *dc, int numentries, int tree_max_on_screen,
878} 879}
879#endif 880#endif
880 881
881static bool dirbrowse(char *root, int *dirfilter) 882static bool dirbrowse(const char *root, const int *dirfilter)
882{ 883{
883 int numentries=0; 884 int numentries=0;
884 char buf[MAX_PATH]; 885 char buf[MAX_PATH];
@@ -1643,7 +1644,7 @@ bool create_playlist(void)
1643 return true; 1644 return true;
1644} 1645}
1645 1646
1646bool rockbox_browse(char *root, int dirfilter) 1647bool rockbox_browse(const char *root, int dirfilter)
1647{ 1648{
1648 bool rc; 1649 bool rc;
1649 int dircursor_save = dircursor; 1650 int dircursor_save = dircursor;
diff --git a/apps/tree.h b/apps/tree.h
index 0889b7211e..5a618a8bc3 100644
--- a/apps/tree.h
+++ b/apps/tree.h
@@ -52,12 +52,12 @@ void tree_get_filetypes(const struct filetype**, int*);
52void tree_init(void); 52void tree_init(void);
53void browse_root(void); 53void browse_root(void);
54void set_current_file(char *path); 54void set_current_file(char *path);
55bool rockbox_browse(char *root, int dirfilter); 55bool rockbox_browse(const char *root, int dirfilter);
56bool create_playlist(void); 56bool create_playlist(void);
57void resume_directory(char *dir); 57void resume_directory(const char *dir);
58char *getcwd(char *buf, int size); 58char *getcwd(char *buf, int size);
59void reload_directory(void); 59void reload_directory(void);
60struct entry* load_and_sort_directory(char *dirname, int *dirfilter, 60struct entry* load_and_sort_directory(const char *dirname, const int *dirfilter,
61 int *num_files, bool *buffer_full); 61 int *num_files, bool *buffer_full);
62 62
63#endif 63#endif
diff --git a/apps/wps-display.c b/apps/wps-display.c
index 9f136ffa0c..159f0abda6 100644
--- a/apps/wps-display.c
+++ b/apps/wps-display.c
@@ -68,9 +68,11 @@
68#ifdef HAVE_LCD_CHARCELLS 68#ifdef HAVE_LCD_CHARCELLS
69static unsigned char wps_progress_pat[8]={0,0,0,0,0,0,0,0}; 69static unsigned char wps_progress_pat[8]={0,0,0,0,0,0,0,0};
70static bool full_line_progressbar=0; 70static bool full_line_progressbar=0;
71static bool draw_player_progress(struct mp3entry* id3, int ff_rewwind_count); 71static bool draw_player_progress(const struct mp3entry* id3,
72 int ff_rewwind_count);
72static void draw_player_fullbar(char* buf, int buf_size, 73static void draw_player_fullbar(char* buf, int buf_size,
73 struct mp3entry* id3, int ff_rewwind_count); 74 const struct mp3entry* id3,
75 int ff_rewwind_count);
74static char map_fullbar_char(char ascii_val); 76static char map_fullbar_char(char ascii_val);
75#endif 77#endif
76 78
@@ -86,7 +88,7 @@ bool wps_time_countup = true;
86static bool wps_loaded = false; 88static bool wps_loaded = false;
87 89
88/* Set format string to use for WPS, splitting it into lines */ 90/* Set format string to use for WPS, splitting it into lines */
89static void wps_format(char* fmt) 91static void wps_format(const char* fmt)
90{ 92{
91 char* buf = format_buffer; 93 char* buf = format_buffer;
92 char* start_of_line = format_buffer; 94 char* start_of_line = format_buffer;
@@ -170,7 +172,7 @@ void wps_reset(void)
170 memset(&format_buffer, 0, sizeof format_buffer); 172 memset(&format_buffer, 0, sizeof format_buffer);
171} 173}
172 174
173bool wps_load(char* file, bool display) 175bool wps_load(const char* file, bool display)
174{ 176{
175 int i, s; 177 int i, s;
176 char buffer[FORMAT_BUFFER_SIZE]; 178 char buffer[FORMAT_BUFFER_SIZE];
@@ -256,10 +258,10 @@ static void format_time(char* buf, int buf_size, int time)
256 * 258 *
257 * Returns buf if the desired level was found, NULL otherwise. 259 * Returns buf if the desired level was found, NULL otherwise.
258 */ 260 */
259static char* get_dir(char* buf, int buf_size, char* path, int level) 261static char* get_dir(char* buf, int buf_size, const char* path, int level)
260{ 262{
261 char* sep; 263 const char* sep;
262 char* last_sep; 264 const char* last_sep;
263 int len; 265 int len;
264 266
265 sep = path + strlen(path); 267 sep = path + strlen(path);
@@ -304,7 +306,7 @@ static char* get_dir(char* buf, int buf_size, char* path, int level)
304 */ 306 */
305static char* get_tag(struct mp3entry* cid3, 307static char* get_tag(struct mp3entry* cid3,
306 struct mp3entry* nid3, 308 struct mp3entry* nid3,
307 char* tag, 309 const char* tag,
308 char* buf, 310 char* buf,
309 int buf_size, 311 int buf_size,
310 unsigned char* tag_len, 312 unsigned char* tag_len,
@@ -622,7 +624,7 @@ static char* get_tag(struct mp3entry* cid3,
622 * 624 *
623 * Returns the new position in fmt. 625 * Returns the new position in fmt.
624 */ 626 */
625static char* skip_conditional(char* fmt, bool to_else) 627static const char* skip_conditional(const char* fmt, bool to_else)
626{ 628{
627 int level = 1; 629 int level = 1;
628 630
@@ -693,7 +695,7 @@ static void format_display(char* buf,
693 int buf_size, 695 int buf_size,
694 struct mp3entry* id3, 696 struct mp3entry* id3,
695 struct mp3entry* nid3, /* next song's id3 */ 697 struct mp3entry* nid3, /* next song's id3 */
696 char* fmt, 698 const char* fmt,
697 unsigned char* subline_time_mult, 699 unsigned char* subline_time_mult,
698 unsigned char* flags) 700 unsigned char* flags)
699{ 701{
@@ -1051,7 +1053,8 @@ bool wps_display(struct mp3entry* id3,
1051} 1053}
1052 1054
1053#ifdef HAVE_LCD_CHARCELLS 1055#ifdef HAVE_LCD_CHARCELLS
1054static bool draw_player_progress(struct mp3entry* id3, int ff_rewwind_count) 1056static bool draw_player_progress(const struct mp3entry* id3,
1057 int ff_rewwind_count)
1055{ 1058{
1056 char player_progressbar[7]; 1059 char player_progressbar[7];
1057 char binline[36]; 1060 char binline[36];
@@ -1087,7 +1090,8 @@ static bool draw_player_progress(struct mp3entry* id3, int ff_rewwind_count)
1087} 1090}
1088 1091
1089static void draw_player_fullbar(char* buf, int buf_size, 1092static void draw_player_fullbar(char* buf, int buf_size,
1090 struct mp3entry* id3, int ff_rewwind_count) 1093 const struct mp3entry* id3,
1094 int ff_rewwind_count)
1091{ 1095{
1092 int i,j,lcd_char_pos; 1096 int i,j,lcd_char_pos;
1093 1097
diff --git a/apps/wps-display.h b/apps/wps-display.h
index 7e5df59b5e..7f7976370a 100644
--- a/apps/wps-display.h
+++ b/apps/wps-display.h
@@ -36,8 +36,7 @@
36bool wps_refresh(struct mp3entry* id3, struct mp3entry* nid3, 36bool wps_refresh(struct mp3entry* id3, struct mp3entry* nid3,
37 int ffwd_offset, unsigned char refresh_mode); 37 int ffwd_offset, unsigned char refresh_mode);
38bool wps_display(struct mp3entry* id3, struct mp3entry* nid3); 38bool wps_display(struct mp3entry* id3, struct mp3entry* nid3);
39bool wps_load(char* file, bool display); 39bool wps_load(const char* file, bool display);
40void wps_reset(void); 40void wps_reset(void);
41char* wps_get_genre(struct mp3entry* id3);
42 41
43#endif 42#endif