summaryrefslogtreecommitdiff
path: root/apps/bookmark.c
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2004-08-18 01:09:31 +0000
committerJens Arnold <amiconn@rockbox.org>2004-08-18 01:09:31 +0000
commit8fb336148fb34474c67fbc6e0354daa4512a22fb (patch)
tree5910d0a54bf8424b424939a263abef0f570591f7 /apps/bookmark.c
parent6d0da414bfea35b4370ad820d28d4565521d7b12 (diff)
downloadrockbox-8fb336148fb34474c67fbc6e0354daa4512a22fb.tar.gz
rockbox-8fb336148fb34474c67fbc6e0354daa4512a22fb.zip
Const policed pointer arguments to functions, part 3
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4999 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/bookmark.c')
-rw-r--r--apps/bookmark.c44
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
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