diff options
author | Daniel Stenberg <daniel@haxx.se> | 2002-04-30 13:14:59 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2002-04-30 13:14:59 +0000 |
commit | 7b3abdcb09278afa8c0b017825cefebded1781f9 (patch) | |
tree | cbce8fdbac181f3deb7f41c10d5dc5acf82450ae /uisimulator/x11 | |
parent | ad9bdf6e3805515b0726de2c94db24ffe6aa108e (diff) | |
download | rockbox-7b3abdcb09278afa8c0b017825cefebded1781f9.tar.gz rockbox-7b3abdcb09278afa8c0b017825cefebded1781f9.zip |
added for dir emulation
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@326 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'uisimulator/x11')
-rw-r--r-- | uisimulator/x11/Makefile | 7 | ||||
-rw-r--r-- | uisimulator/x11/dir.h | 7 | ||||
-rw-r--r-- | uisimulator/x11/io.c | 15 |
3 files changed, 27 insertions, 2 deletions
diff --git a/uisimulator/x11/Makefile b/uisimulator/x11/Makefile index fd53196784..9d73305c57 100644 --- a/uisimulator/x11/Makefile +++ b/uisimulator/x11/Makefile | |||
@@ -29,7 +29,7 @@ DEBUG = -g | |||
29 | DEFINES = -DHAVE_CONFIG_H -DGETTIMEOFDAY_TWO_ARGS -DSIMULATOR -DHAVE_LCD_BITMAP -DHAVE_RECORDER_KEYPAD | 29 | DEFINES = -DHAVE_CONFIG_H -DGETTIMEOFDAY_TWO_ARGS -DSIMULATOR -DHAVE_LCD_BITMAP -DHAVE_RECORDER_KEYPAD |
30 | LDFLAGS = -lX11 -lm -lXt -lXmu -lnsl | 30 | LDFLAGS = -lX11 -lm -lXt -lXmu -lnsl |
31 | 31 | ||
32 | INCLUDES = -I$(DRIVERS) -I$(FIRMWAREDIR) | 32 | INCLUDES = -I. -I$(DRIVERS) -I$(FIRMWAREDIR) |
33 | 33 | ||
34 | UNAME := $(shell uname) | 34 | UNAME := $(shell uname) |
35 | ifeq ($(UNAME),Linux) | 35 | ifeq ($(UNAME),Linux) |
@@ -44,7 +44,7 @@ CFLAGS = $(DEBUG) $(DEFINES) $(INCLUDES) | |||
44 | #SRCS = $(wildcard *.c) | 44 | #SRCS = $(wildcard *.c) |
45 | 45 | ||
46 | SRCS = screenhack.c uibasic.c resources.c visual.c lcd.c lcd-x11.c \ | 46 | SRCS = screenhack.c uibasic.c resources.c visual.c lcd.c lcd-x11.c \ |
47 | button-x11.c chartables.c tetris.c app.c | 47 | button-x11.c chartables.c tetris.c app.c tree.c io.c |
48 | 48 | ||
49 | OBJS := $(SRCS:c=o) | 49 | OBJS := $(SRCS:c=o) |
50 | 50 | ||
@@ -63,6 +63,9 @@ tetris.o: $(APPDIR)/tetris.c | |||
63 | app.o: $(APPDIR)/app.c | 63 | app.o: $(APPDIR)/app.c |
64 | $(CC) $(CFLAGS) -c $< -o $@ | 64 | $(CC) $(CFLAGS) -c $< -o $@ |
65 | 65 | ||
66 | tree.o: $(APPDIR)/tree.c | ||
67 | $(CC) $(CFLAGS) -c $< -o $@ | ||
68 | |||
66 | lcd.o: $(DRIVERS)/lcd.c | 69 | lcd.o: $(DRIVERS)/lcd.c |
67 | $(CC) $(CFLAGS) -c $< -o $@ | 70 | $(CC) $(CFLAGS) -c $< -o $@ |
68 | 71 | ||
diff --git a/uisimulator/x11/dir.h b/uisimulator/x11/dir.h new file mode 100644 index 0000000000..560cf103d2 --- /dev/null +++ b/uisimulator/x11/dir.h | |||
@@ -0,0 +1,7 @@ | |||
1 | #include <sys/types.h> | ||
2 | #include <dirent.h> | ||
3 | |||
4 | #define opendir(x) x11_opendir(x) | ||
5 | |||
6 | #define DIRENT_DEFINED /* prevent it from getting defined again */ | ||
7 | #include "../../firmware/common/dir.h" | ||
diff --git a/uisimulator/x11/io.c b/uisimulator/x11/io.c new file mode 100644 index 0000000000..4c1e594047 --- /dev/null +++ b/uisimulator/x11/io.c | |||
@@ -0,0 +1,15 @@ | |||
1 | |||
2 | #include <dirent.h> | ||
3 | |||
4 | #define SIMULATOR_ARCHOS_ROOT "archos" | ||
5 | |||
6 | DIR *x11_opendir(char *name) | ||
7 | { | ||
8 | char buffer[256]; /* sufficiently big */ | ||
9 | |||
10 | if(name[0] == '/') { | ||
11 | sprintf(buffer, "%s/%s", SIMULATOR_ARCHOS_ROOT, name); | ||
12 | return opendir(buffer); | ||
13 | } | ||
14 | return opendir(name); | ||
15 | } | ||