added for dir emulation

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@326 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Daniel Stenberg 2002-04-30 13:14:59 +00:00
parent ad9bdf6e38
commit 7b3abdcb09
3 changed files with 27 additions and 2 deletions

View file

@ -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 $@

7
uisimulator/x11/dir.h Normal file
View file

@ -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"

15
uisimulator/x11/io.c Normal file
View file

@ -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);
}