diff options
Diffstat (limited to 'apps/bookmark.c')
-rw-r--r-- | apps/bookmark.c | 44 |
1 files changed, 22 insertions, 22 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 | ||
54 | static bool add_bookmark(char* bookmark_file_name, char* bookmark); | 54 | static bool add_bookmark(const char* bookmark_file_name, const char* bookmark); |
55 | static bool bookmark_load_menu(void); | 55 | static bool bookmark_load_menu(void); |
56 | static bool check_bookmark(char* bookmark); | 56 | static bool check_bookmark(const char* bookmark); |
57 | static char* create_bookmark(void); | 57 | static char* create_bookmark(void); |
58 | static bool delete_bookmark(char* bookmark_file_name, int bookmark_id); | 58 | static bool delete_bookmark(const char* bookmark_file_name, int bookmark_id); |
59 | static void display_bookmark(char* bookmark, | 59 | static void display_bookmark(const char* bookmark, |
60 | int bookmark_id, | 60 | int bookmark_id, |
61 | int bookmark_count); | 61 | int bookmark_count); |
62 | static void say_bookmark(char* bookmark, | 62 | static void say_bookmark(const char* bookmark, |
63 | int bookmark_id); | 63 | int bookmark_id); |
64 | static bool generate_bookmark_file_name(char *in); | 64 | static bool generate_bookmark_file_name(const char *in); |
65 | static char* get_bookmark(char* bookmark_file, int bookmark_count); | 65 | static char* get_bookmark(const char* bookmark_file, int bookmark_count); |
66 | static bool parse_bookmark(char *bookmark, | 66 | static 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); |
78 | static char* select_bookmark(char* bookmark_file_name); | 78 | static char* select_bookmark(const char* bookmark_file_name); |
79 | static bool system_check(void); | 79 | static bool system_check(void); |
80 | static bool write_bookmark(bool create_bookmark_file); | 80 | static bool write_bookmark(bool create_bookmark_file); |
81 | static int get_bookmark_count(char* bookmark_file_name); | 81 | static int get_bookmark_count(const char* bookmark_file_name); |
82 | 82 | ||
83 | static char global_temp_buffer[MAX_PATH+1]; | 83 | static char global_temp_buffer[MAX_PATH+1]; |
84 | static char global_bookmark_file_name[MAX_PATH]; | 84 | static 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 | /* ------------------------------------------------------------------------*/ |
335 | static bool add_bookmark(char* bookmark_file_name, char* bookmark) | 335 | static 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 | ||
450 | static bool check_bookmark(char* bookmark) | 450 | static 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 | /* ------------------------------------------------------------------------*/ |
462 | bool bookmark_autoload(char* file) | 462 | bool 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 | /* ------------------------------------------------------------------------*/ |
540 | bool bookmark_load(char* file, bool autoload) | 540 | bool 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 | ||
590 | static int get_bookmark_count(char* bookmark_file_name) | 590 | static 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 | /* ------------------------------------------------------------------------*/ |
616 | static char* select_bookmark(char* bookmark_file_name) | 616 | static 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 | /* ------------------------------------------------------------------------*/ |
735 | static bool delete_bookmark(char* bookmark_file_name, int bookmark_id) | 735 | static 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 | /* ------------------------------------------------------------------------*/ |
787 | static void display_bookmark(char* bookmark, | 787 | static 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 | /* ------------------------------------------------------------------------*/ |
911 | static void say_bookmark(char* bookmark, | 911 | static 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 | /* ------------------------------------------------------------------------*/ |
955 | static char* get_bookmark(char* bookmark_file, int bookmark_count) | 955 | static 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 | /* ----------------------------------------------------------------------- */ |
992 | static bool parse_bookmark(char *bookmark, | 992 | static 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 | /* ----------------------------------------------------------------------- */ |
1126 | static bool generate_bookmark_file_name(char *in) | 1126 | static bool generate_bookmark_file_name(const char *in) |
1127 | { | 1127 | { |
1128 | int len = strlen(in); | 1128 | int len = strlen(in); |
1129 | 1129 | ||