1
0
Fork 0
forked from len0rd/rockbox

Clean up hard-coded paths

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14662 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Nils Wallménius 2007-09-10 09:46:36 +00:00
parent cd5ad2ff69
commit 04b3435afd
11 changed files with 19 additions and 17 deletions

View file

@ -108,7 +108,7 @@ bool logfdump(void)
/* nothing is logged just yet */ /* nothing is logged just yet */
return false; 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) { if(-1 != fd) {
unsigned char buffer[MAX_LOGF_ENTRY +1]; unsigned char buffer[MAX_LOGF_ENTRY +1];
int index = logfindex-1; int index = logfindex-1;

View file

@ -218,7 +218,7 @@ static void load_memo(struct shown *shown)
for (k = 0; k < 7; k++) for (k = 0; k < 7; k++)
wday_has_memo[k] = false; wday_has_memo[k] = false;
memos_in_memory = 0; memos_in_memory = 0;
fp = rb->open("/.rockbox/.memo",O_RDONLY); fp = rb->open(ROCKBOX_DIR "/.memo",O_RDONLY);
if (fp > -1) if (fp > -1)
{ {
int count = rb->filesize(fp); int count = rb->filesize(fp);
@ -315,8 +315,8 @@ static void load_memo(struct shown *shown)
static bool save_memo(int changed, bool new_mod, struct shown *shown) static bool save_memo(int changed, bool new_mod, struct shown *shown)
{ {
int fp,fq; int fp,fq;
fp = rb->open("/.rockbox/.memo",O_RDONLY | O_CREAT); fp = rb->open(ROCKBOX_DIR "/.memo",O_RDONLY | O_CREAT);
fq = rb->creat("/.rockbox/~temp"); fq = rb->creat(ROCKBOX_DIR "/~temp");
if ( (fq != -1) && (fp != -1) ) if ( (fq != -1) && (fp != -1) )
{ {
int i; int i;
@ -345,7 +345,7 @@ static bool save_memo(int changed, bool new_mod, struct shown *shown)
rb->write(fq,temp,1); rb->write(fq,temp,1);
} }
rb->close(fp); rb->close(fp);
fp = rb->creat("/.rockbox/.memo"); fp = rb->creat(ROCKBOX_DIR "/.memo");
rb->lseek(fp, 0, SEEK_SET); rb->lseek(fp, 0, SEEK_SET);
rb->lseek(fq, 0, SEEK_SET); rb->lseek(fq, 0, SEEK_SET);
for (i = 0; i < rb->filesize(fq); i++) for (i = 0; i < rb->filesize(fq); i++)
@ -355,7 +355,7 @@ static bool save_memo(int changed, bool new_mod, struct shown *shown)
} }
rb->close(fp); rb->close(fp);
rb->close(fq); rb->close(fq);
rb->remove("/.rockbox/~temp"); rb->remove(ROCKBOX_DIR "/~temp");
load_memo(shown); load_memo(shown);
return true; return true;
} }

View file

@ -33,7 +33,7 @@ void get_cfg_filename(char* buf, int buf_len, const char* filename)
s = cfg_rb->strrchr(buf, '/'); s = cfg_rb->strrchr(buf, '/');
if (!s) /* should never happen */ 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 else
{ {

View file

@ -131,7 +131,7 @@ int initSynth(struct MIDIfile * mf, char * filename, char * drumConfig)
while(readChar(file)!=' ' && !eof(file)); while(readChar(file)!=' ' && !eof(file));
readTextBlock(file, name); 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); */ /* printf("\nLOADING: <%s> ", fn); */
if(patchUsed[a]==1) if(patchUsed[a]==1)
@ -162,7 +162,7 @@ int initSynth(struct MIDIfile * mf, char * filename, char * drumConfig)
{ {
readTextBlock(file, number); readTextBlock(file, number);
readTextBlock(file, name); 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); idx = rb->atoi(number);
if(idx == 0) if(idx == 0)

View file

@ -107,7 +107,8 @@ int midimain(void * filename)
struct MIDIfile * mf = loadFile(filename); struct MIDIfile * mf = loadFile(filename);
rb->splash(HZ/5, "LOADING PATCHES"); 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; return -1;
} }

View file

@ -237,7 +237,8 @@ int midimain(void * filename)
return -1; 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; return -1;
//#ifndef SIMULATOR //#ifndef SIMULATOR

View file

@ -68,7 +68,7 @@ static bool loadFile( const char * name, unsigned char * buf, int len )
{ {
char filename[MAX_PATH]; 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); int fd = rb->open( filename, O_RDONLY);
@ -419,7 +419,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
SETTINGS_VERSION); SETTINGS_VERSION);
} }
} else { } 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 #ifdef HAVE_ADJUSTABLE_CPU_FREQ

View file

@ -35,7 +35,7 @@ static void do_slot_menu(bool is_load);
static void munge_name(char *buf, size_t bufsiz); static void munge_name(char *buf, size_t bufsiz);
/* directory ROM save slots belong in */ /* directory ROM save slots belong in */
#define STATE_DIR "/.rockbox/rockboy" #define STATE_DIR ROCKBOX_DIR "/rockboy"
int getbutton(char *text) int getbutton(char *text)
{ {

View file

@ -121,6 +121,6 @@ struct options {
bool plugbuf; bool plugbuf;
extern struct options options; extern struct options options;
#define savedir "/.rockbox/rockboy" #define savedir ROCKBOX_DIR "/rockboy"
#endif #endif

View file

@ -370,7 +370,7 @@ int load_all_levels(void)
return 0; 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) void iohiscore(void)
{ {
int fd; int fd;

View file

@ -37,7 +37,7 @@
#define COMPRESS_SAVE 1 #define COMPRESS_SAVE 1
static char quick_snap_file[]="/.rockbox/zxboxq.z80"; static char quick_snap_file[]= ROCKBOX_DIR "/zxboxq.z80";
typedef struct { typedef struct {
int isfile; int isfile;