From 7b3abdcb09278afa8c0b017825cefebded1781f9 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 30 Apr 2002 13:14:59 +0000 Subject: added for dir emulation git-svn-id: svn://svn.rockbox.org/rockbox/trunk@326 a1c6a512-1295-4272-9138-f99709370657 --- uisimulator/x11/Makefile | 7 +++++-- uisimulator/x11/dir.h | 7 +++++++ uisimulator/x11/io.c | 15 +++++++++++++++ 3 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 uisimulator/x11/dir.h create mode 100644 uisimulator/x11/io.c (limited to 'uisimulator') 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 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 0000000000..560cf103d2 --- /dev/null +++ b/uisimulator/x11/dir.h @@ -0,0 +1,7 @@ +#include +#include + +#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 0000000000..4c1e594047 --- /dev/null +++ b/uisimulator/x11/io.c @@ -0,0 +1,15 @@ + +#include + +#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); +} -- cgit v1.2.3