summaryrefslogtreecommitdiff
path: root/uisimulator
diff options
context:
space:
mode:
Diffstat (limited to 'uisimulator')
-rw-r--r--uisimulator/win32/Makefile2
-rw-r--r--uisimulator/win32/file.h28
-rw-r--r--uisimulator/win32/io.c38
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
87SRCS = button.c dir-win32.c lcd-win32.c panic-win32.c thread-win32.c \ 87SRCS = 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
91OBJS := $(OBJDIR)/lang.o $(SRCS:%.c=$(OBJDIR)/%.o) $(OBJDIR)/uisw32-res.o 91OBJS := $(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
23int 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
25int 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}