summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2002-04-30 13:14:59 +0000
committerDaniel Stenberg <daniel@haxx.se>2002-04-30 13:14:59 +0000
commit7b3abdcb09278afa8c0b017825cefebded1781f9 (patch)
treecbce8fdbac181f3deb7f41c10d5dc5acf82450ae
parentad9bdf6e3805515b0726de2c94db24ffe6aa108e (diff)
downloadrockbox-7b3abdcb09278afa8c0b017825cefebded1781f9.zip
rockbox-7b3abdcb09278afa8c0b017825cefebded1781f9.tar.gz
rockbox-7b3abdcb09278afa8c0b017825cefebded1781f9.tar.bz2
rockbox-7b3abdcb09278afa8c0b017825cefebded1781f9.tar.xz
added for dir emulation
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@326 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--uisimulator/x11/Makefile7
-rw-r--r--uisimulator/x11/dir.h7
-rw-r--r--uisimulator/x11/io.c15
3 files changed, 27 insertions, 2 deletions
diff --git a/uisimulator/x11/Makefile b/uisimulator/x11/Makefile
index fd53196..9d73305 100644
--- a/uisimulator/x11/Makefile
+++ b/uisimulator/x11/Makefile
@@ -29,7 +29,7 @@ DEBUG = -g
DEFINES = -DHAVE_CONFIG_H -DGETTIMEOFDAY_TWO_ARGS -DSIMULATOR -DHAVE_LCD_BITMAP -DHAVE_RECORDER_KEYPAD
LDFLAGS = -lX11 -lm -lXt -lXmu -lnsl
-INCLUDES = -I$(DRIVERS) -I$(FIRMWAREDIR)
+INCLUDES = -I. -I$(DRIVERS) -I$(FIRMWAREDIR)
UNAME := $(shell uname)
ifeq ($(UNAME),Linux)
@@ -44,7 +44,7 @@ CFLAGS = $(DEBUG) $(DEFINES) $(INCLUDES)
#SRCS = $(wildcard *.c)
SRCS = screenhack.c uibasic.c resources.c visual.c lcd.c lcd-x11.c \
- button-x11.c chartables.c tetris.c app.c
+ button-x11.c chartables.c tetris.c app.c tree.c io.c
OBJS := $(SRCS:c=o)
@@ -63,6 +63,9 @@ tetris.o: $(APPDIR)/tetris.c
app.o: $(APPDIR)/app.c
$(CC) $(CFLAGS) -c $< -o $@
+tree.o: $(APPDIR)/tree.c
+ $(CC) $(CFLAGS) -c $< -o $@
+
lcd.o: $(DRIVERS)/lcd.c
$(CC) $(CFLAGS) -c $< -o $@
diff --git a/uisimulator/x11/dir.h b/uisimulator/x11/dir.h
new file mode 100644
index 0000000..560cf10
--- /dev/null
+++ b/uisimulator/x11/dir.h
@@ -0,0 +1,7 @@
+#include <sys/types.h>
+#include <dirent.h>
+
+#define opendir(x) x11_opendir(x)
+
+#define DIRENT_DEFINED /* prevent it from getting defined again */
+#include "../../firmware/common/dir.h"
diff --git a/uisimulator/x11/io.c b/uisimulator/x11/io.c
new file mode 100644
index 0000000..4c1e594
--- /dev/null
+++ b/uisimulator/x11/io.c
@@ -0,0 +1,15 @@
+
+#include <dirent.h>
+
+#define SIMULATOR_ARCHOS_ROOT "archos"
+
+DIR *x11_opendir(char *name)
+{
+ char buffer[256]; /* sufficiently big */
+
+ if(name[0] == '/') {
+ sprintf(buffer, "%s/%s", SIMULATOR_ARCHOS_ROOT, name);
+ return opendir(buffer);
+ }
+ return opendir(name);
+}