diff options
author | Daniel Stenberg <daniel@haxx.se> | 2003-01-17 16:50:36 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2003-01-17 16:50:36 +0000 |
commit | 8c5e3f833b8d0f92c46679077acd755ed6075e05 (patch) | |
tree | fd0111fbff73d788f2a552eec2e37529dc2c5fb3 /uisimulator | |
parent | 37b0c075cf8007b6bece5e8eaaf9bfa4756273f1 (diff) | |
download | rockbox-8c5e3f833b8d0f92c46679077acd755ed6075e05.tar.gz rockbox-8c5e3f833b8d0f92c46679077acd755ed6075e05.zip |
added stub functions for the rename
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3126 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'uisimulator')
-rw-r--r-- | uisimulator/win32/Makefile | 2 | ||||
-rw-r--r-- | uisimulator/win32/file.h | 28 | ||||
-rw-r--r-- | uisimulator/win32/io.c | 38 |
3 files changed, 67 insertions, 1 deletions
diff --git a/uisimulator/win32/Makefile b/uisimulator/win32/Makefile index 6e377a9ac6..6daf8d70e1 100644 --- a/uisimulator/win32/Makefile +++ b/uisimulator/win32/Makefile | |||
@@ -86,7 +86,7 @@ endif | |||
86 | 86 | ||
87 | SRCS = button.c dir-win32.c lcd-win32.c panic-win32.c thread-win32.c \ | 87 | SRCS = button.c dir-win32.c lcd-win32.c panic-win32.c thread-win32.c \ |
88 | debug-win32.c kernel.c string-win32.c uisw32.c stubs.c \ | 88 | debug-win32.c kernel.c string-win32.c uisw32.c stubs.c \ |
89 | $(APPS) $(MENUS) $(FIRMSRCS) strtok.c sim_icons.c | 89 | $(APPS) $(MENUS) $(FIRMSRCS) strtok.c sim_icons.c io.c |
90 | 90 | ||
91 | OBJS := $(OBJDIR)/lang.o $(SRCS:%.c=$(OBJDIR)/%.o) $(OBJDIR)/uisw32-res.o | 91 | OBJS := $(OBJDIR)/lang.o $(SRCS:%.c=$(OBJDIR)/%.o) $(OBJDIR)/uisw32-res.o |
92 | 92 | ||
diff --git a/uisimulator/win32/file.h b/uisimulator/win32/file.h new file mode 100644 index 0000000000..eb1ab82fa9 --- /dev/null +++ b/uisimulator/win32/file.h | |||
@@ -0,0 +1,28 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2002 by Daniel Stenberg <daniel@haxx.se> | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | |||
20 | #include <stdio.h> | ||
21 | #include <string.h> | ||
22 | |||
23 | int win32_rename(char *oldpath, char *newpath); | ||
24 | |||
25 | #define rename(x,y) win32_rename(x,y) | ||
26 | |||
27 | #include "../../firmware/common/file.h" | ||
28 | |||
diff --git a/uisimulator/win32/io.c b/uisimulator/win32/io.c new file mode 100644 index 0000000000..974fdadbbd --- /dev/null +++ b/uisimulator/win32/io.c | |||
@@ -0,0 +1,38 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2002 Daniel Stenberg | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | |||
20 | #include "file.h" | ||
21 | #include "debug.h" | ||
22 | |||
23 | #define SIMULATOR_ARCHOS_ROOT "archos" | ||
24 | |||
25 | int win32_rename(char *oldpath, char* newpath) | ||
26 | { | ||
27 | char buffer1[256]; | ||
28 | char buffer2[256]; | ||
29 | |||
30 | if(oldpath[0] == '/') { | ||
31 | sprintf(buffer1, "%s%s", SIMULATOR_ARCHOS_ROOT, oldpath); | ||
32 | sprintf(buffer2, "%s%s", SIMULATOR_ARCHOS_ROOT, newpath); | ||
33 | |||
34 | debugf("We rename the real file '%s' to '%s'\n", buffer1, buffer2); | ||
35 | return rename(buffer1, buffer2); | ||
36 | } | ||
37 | return -1; | ||
38 | } | ||