Clean up hard-coded paths

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14662 a1c6a512-1295-4272-9138-f99709370657
diff --git a/apps/logfdisp.c b/apps/logfdisp.c
index 734a6ae..6463ae6 100644
--- a/apps/logfdisp.c
+++ b/apps/logfdisp.c
@@ -108,7 +108,7 @@
         /* nothing is logged just yet */
         return false;
     
-    fd = open("/.rockbox/logf.txt", O_CREAT|O_WRONLY|O_TRUNC);
+    fd = open(ROCKBOX_DIR "/logf.txt", O_CREAT|O_WRONLY|O_TRUNC);
     if(-1 != fd) {
         unsigned char buffer[MAX_LOGF_ENTRY +1];
         int index = logfindex-1;
diff --git a/apps/plugins/calendar.c b/apps/plugins/calendar.c
index 8c0b6af..8ed6122 100644
--- a/apps/plugins/calendar.c
+++ b/apps/plugins/calendar.c
@@ -218,7 +218,7 @@
     for (k = 0; k < 7; k++)
         wday_has_memo[k] = false;
     memos_in_memory = 0;
-    fp = rb->open("/.rockbox/.memo",O_RDONLY);
+    fp = rb->open(ROCKBOX_DIR "/.memo",O_RDONLY);
     if (fp > -1)
     {
         int count = rb->filesize(fp);
@@ -315,8 +315,8 @@
 static bool save_memo(int changed, bool new_mod, struct shown *shown)
 {
     int fp,fq;
-    fp = rb->open("/.rockbox/.memo",O_RDONLY | O_CREAT);
-    fq = rb->creat("/.rockbox/~temp");
+    fp = rb->open(ROCKBOX_DIR "/.memo",O_RDONLY | O_CREAT);
+    fq = rb->creat(ROCKBOX_DIR "/~temp");
     if ( (fq != -1) && (fp != -1) )
     {
         int i;
@@ -345,7 +345,7 @@
             rb->write(fq,temp,1);
         }
         rb->close(fp);
-        fp = rb->creat("/.rockbox/.memo");
+        fp = rb->creat(ROCKBOX_DIR "/.memo");
         rb->lseek(fp, 0, SEEK_SET);
         rb->lseek(fq, 0, SEEK_SET);
         for (i = 0; i < rb->filesize(fq); i++)
@@ -355,7 +355,7 @@
         }
         rb->close(fp);
         rb->close(fq);
-        rb->remove("/.rockbox/~temp");
+        rb->remove(ROCKBOX_DIR "/~temp");
         load_memo(shown);
         return true;
     }
diff --git a/apps/plugins/lib/configfile.c b/apps/plugins/lib/configfile.c
index 54c067c..0fbba81 100644
--- a/apps/plugins/lib/configfile.c
+++ b/apps/plugins/lib/configfile.c
@@ -33,7 +33,7 @@
     s = cfg_rb->strrchr(buf, '/');
     if (!s) /* should never happen */
     {
-        cfg_rb->snprintf(buf, buf_len, "/.rockbox/rocks/%s", filename);
+        cfg_rb->snprintf(buf, buf_len, PLUGIN_DIR "/%s", filename);
     }
     else
     {
diff --git a/apps/plugins/midi/synth.c b/apps/plugins/midi/synth.c
index 6ec229b..00a01e4 100644
--- a/apps/plugins/midi/synth.c
+++ b/apps/plugins/midi/synth.c
@@ -131,7 +131,7 @@
         while(readChar(file)!=' ' && !eof(file));
         readTextBlock(file, name);
 
-        rb->snprintf(fn, 40, "/.rockbox/patchset/%s.pat", name);
+        rb->snprintf(fn, 40, ROCKBOX_DIR "/patchset/%s.pat", name);
 /*        printf("\nLOADING: <%s> ", fn); */
 
         if(patchUsed[a]==1)
@@ -162,7 +162,7 @@
     {
         readTextBlock(file, number);
         readTextBlock(file, name);
-        rb->snprintf(fn, 40, "/.rockbox/patchset/%s.pat", name);
+        rb->snprintf(fn, 40, ROCKBOX_DIR "/patchset/%s.pat", name);
 
         idx = rb->atoi(number);
         if(idx == 0)
diff --git a/apps/plugins/midi2wav.c b/apps/plugins/midi2wav.c
index 368c8b9..ad41451 100644
--- a/apps/plugins/midi2wav.c
+++ b/apps/plugins/midi2wav.c
@@ -107,7 +107,8 @@
     struct MIDIfile * mf = loadFile(filename);
 
     rb->splash(HZ/5, "LOADING PATCHES");
-    if (initSynth(mf, "/.rockbox/patchset/patchset.cfg", "/.rockbox/patchset/drums.cfg") == -1)
+    if (initSynth(mf, ROCKBOX_DIR "/patchset/patchset.cfg",
+        ROCKBOX_DIR "/patchset/drums.cfg") == -1)
     {
         return -1;
     }
diff --git a/apps/plugins/midiplay.c b/apps/plugins/midiplay.c
index c19ca04..59594a9 100644
--- a/apps/plugins/midiplay.c
+++ b/apps/plugins/midiplay.c
@@ -237,7 +237,8 @@
         return -1;
     }
 
-    if (initSynth(mf, "/.rockbox/patchset/patchset.cfg", "/.rockbox/patchset/drums.cfg") == -1)
+    if (initSynth(mf, ROCKBOX_DIR "/patchset/patchset.cfg",
+        ROCKBOX_DIR "/patchset/drums.cfg") == -1)
         return -1;
 
 //#ifndef SIMULATOR
diff --git a/apps/plugins/pacbox/pacbox.c b/apps/plugins/pacbox/pacbox.c
index 712c3af..fad2735 100644
--- a/apps/plugins/pacbox/pacbox.c
+++ b/apps/plugins/pacbox/pacbox.c
@@ -68,7 +68,7 @@
 {
     char filename[MAX_PATH];
 
-    rb->snprintf(filename,sizeof(filename),"/.rockbox/pacman/%s",name);
+    rb->snprintf(filename,sizeof(filename), ROCKBOX_DIR "/pacman/%s",name);
 
     int fd = rb->open( filename, O_RDONLY);
 
@@ -419,7 +419,7 @@
                             SETTINGS_VERSION);
         }
     } else {
-        rb->splash(HZ*2, "No ROMs in /.rockbox/pacman/");
+        rb->splash(HZ*2, "No ROMs in %s/pacman/", ROCKBOX_DIR);
     }
 
 #ifdef HAVE_ADJUSTABLE_CPU_FREQ
diff --git a/apps/plugins/rockboy/menu.c b/apps/plugins/rockboy/menu.c
index 0c9e46b..e896e26 100644
--- a/apps/plugins/rockboy/menu.c
+++ b/apps/plugins/rockboy/menu.c
@@ -35,7 +35,7 @@
 static void munge_name(char *buf, size_t bufsiz);
 
 /* directory ROM save slots belong in */
-#define STATE_DIR "/.rockbox/rockboy"
+#define STATE_DIR ROCKBOX_DIR "/rockboy"
 
 int getbutton(char *text)
 {
diff --git a/apps/plugins/rockboy/rockmacros.h b/apps/plugins/rockboy/rockmacros.h
index 83b5998..01beb43 100644
--- a/apps/plugins/rockboy/rockmacros.h
+++ b/apps/plugins/rockboy/rockmacros.h
@@ -121,6 +121,6 @@
 bool plugbuf;
 
 extern struct options options;
-#define savedir "/.rockbox/rockboy"
+#define savedir ROCKBOX_DIR "/rockboy"
 
 #endif
diff --git a/apps/plugins/snake2.c b/apps/plugins/snake2.c
index dbefef6..385af15 100644
--- a/apps/plugins/snake2.c
+++ b/apps/plugins/snake2.c
@@ -370,7 +370,7 @@
     return 0;
 }
 
-/*Hi-Score reading and writing to file "/.rockbox/snake2.levels" function */
+/*Hi-Score reading and writing to file "/.rockbox/rocks/games/snake2.levels" function */
 void iohiscore(void)
 {
     int fd;
diff --git a/apps/plugins/zxbox/snapshot.c b/apps/plugins/zxbox/snapshot.c
index d693d1f..0010550 100644
--- a/apps/plugins/zxbox/snapshot.c
+++ b/apps/plugins/zxbox/snapshot.c
@@ -37,7 +37,7 @@
 
 #define COMPRESS_SAVE 1
 
-static char quick_snap_file[]="/.rockbox/zxboxq.z80";
+static char quick_snap_file[]= ROCKBOX_DIR "/zxboxq.z80";
 
 typedef struct {
   int isfile;