summaryrefslogtreecommitdiff
path: root/uisimulator/x11/dir.h
diff options
context:
space:
mode:
Diffstat (limited to 'uisimulator/x11/dir.h')
-rw-r--r--uisimulator/x11/dir.h36
1 files changed, 10 insertions, 26 deletions
diff --git a/uisimulator/x11/dir.h b/uisimulator/x11/dir.h
index a3898076f6..98bf175c11 100644
--- a/uisimulator/x11/dir.h
+++ b/uisimulator/x11/dir.h
@@ -17,39 +17,23 @@
17 * 17 *
18 ****************************************************************************/ 18 ****************************************************************************/
19 19
20#define dirent x11_dirent
21#define readdir(x) x11_readdir(x)
22#define opendir(x) x11_opendir(x)
23#define closedir(x) x11_closedir(x)
24
25/*
26 * The defines above should let us use the readdir() and opendir() in target
27 * code just as they're defined to work in target. They will then call our
28 * x11_* versions of the functions that'll work as wrappers for the actual
29 * host functions.
30 */
31
32#include <sys/types.h> 20#include <sys/types.h>
33#include <dirent.h> 21typedef void DIR;
34
35#undef dirent
36
37 22
38#define DIRFUNCTIONS_DEFINED /* prevent those prototypes */ 23#define DIRFUNCTIONS_DEFINED /* prevent those prototypes */
39 24#define dirent x11_dirent
40#include "../../firmware/common/dir.h" 25#include "../../firmware/common/dir.h"
26#undef dirent
41 27
42#define SIMULATOR_ARCHOS_ROOT "archos" 28typedef void * MYDIR;
43
44struct mydir {
45 DIR *dir;
46 char *name;
47};
48
49typedef struct mydir MYDIR;
50 29
51extern MYDIR *x11_opendir(char *name); 30extern MYDIR *x11_opendir(char *name);
52extern struct dirent* x11_readdir(MYDIR* dir); 31extern struct x11_dirent* x11_readdir(MYDIR* dir);
53extern void x11_closedir(MYDIR *dir); 32extern void x11_closedir(MYDIR *dir);
54 33
55#define DIR MYDIR 34#define DIR MYDIR
35#define dirent x11_dirent
36#define opendir(x) x11_opendir(x)
37#define readdir(x) x11_readdir(x)
38#define closedir(x) x11_closedir(x)
39