summaryrefslogtreecommitdiff
path: root/uisimulator/x11/io.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2002-05-07 11:35:03 +0000
committerDaniel Stenberg <daniel@haxx.se>2002-05-07 11:35:03 +0000
commit159d448739e5237e47ca5936c063c1bce5799fd1 (patch)
tree6e4664bf61676ec5660bbc026c46ac708f5bc1ec /uisimulator/x11/io.c
parent276f62bc6edb53363e98b3bc1a421adb286d6cf8 (diff)
downloadrockbox-159d448739e5237e47ca5936c063c1bce5799fd1.tar.gz
rockbox-159d448739e5237e47ca5936c063c1bce5799fd1.zip
readdir() wrapper for proper dirent struct emulation in target code
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@488 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'uisimulator/x11/io.c')
-rw-r--r--uisimulator/x11/io.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/uisimulator/x11/io.c b/uisimulator/x11/io.c
index 2a94969ce3..0452d65ae8 100644
--- a/uisimulator/x11/io.c
+++ b/uisimulator/x11/io.c
@@ -1,5 +1,5 @@
1 1
2#include <dirent.h> 2#include "dir.h"
3 3
4#define SIMULATOR_ARCHOS_ROOT "archos" 4#define SIMULATOR_ARCHOS_ROOT "archos"
5 5
@@ -14,6 +14,19 @@ DIR *x11_opendir(char *name)
14 return opendir(name); 14 return opendir(name);
15} 15}
16 16
17struct dirent *x11_readdir(DIR *dir)
18{
19 static struct dirent secret;
20
21 struct x11_dirent *x11 = (readdir)(dir);
22
23 strcpy(secret.d_name, x11->d_name);
24 secret.attribute = (x11->d_type == DT_DIR)?ATTR_DIRECTORY:0;
25
26 return &secret;
27}
28
29
17int x11_open(char *name, int opts) 30int x11_open(char *name, int opts)
18{ 31{
19 char buffer[256]; /* sufficiently big */ 32 char buffer[256]; /* sufficiently big */