summaryrefslogtreecommitdiff
path: root/uisimulator
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2002-05-07 12:25:30 +0000
committerDaniel Stenberg <daniel@haxx.se>2002-05-07 12:25:30 +0000
commite3a12d34ea92cb67cee20b75d7531b58da0a76d6 (patch)
treeab275894e0f19d60a87cbcc2f55a8c0bb202ecfd /uisimulator
parent27dfc7c14ea181d538446138801537a713601ee6 (diff)
downloadrockbox-e3a12d34ea92cb67cee20b75d7531b58da0a76d6.tar.gz
rockbox-e3a12d34ea92cb67cee20b75d7531b58da0a76d6.zip
adjusted to build on my solaris box
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@493 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'uisimulator')
-rw-r--r--uisimulator/x11/dir.h36
-rw-r--r--uisimulator/x11/file.h1
-rw-r--r--uisimulator/x11/io.c24
3 files changed, 29 insertions, 32 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
diff --git a/uisimulator/x11/file.h b/uisimulator/x11/file.h
index af3f66e980..7ea72580ad 100644
--- a/uisimulator/x11/file.h
+++ b/uisimulator/x11/file.h
@@ -18,7 +18,6 @@
18 ****************************************************************************/ 18 ****************************************************************************/
19 19
20#include <sys/types.h> 20#include <sys/types.h>
21#include <dirent.h>
22 21
23#define open(x,y) x11_open(x,y) 22#define open(x,y) x11_open(x,y)
24 23
diff --git a/uisimulator/x11/io.c b/uisimulator/x11/io.c
index 726bfa26a2..53cee8d086 100644
--- a/uisimulator/x11/io.c
+++ b/uisimulator/x11/io.c
@@ -1,8 +1,20 @@
1 1
2#include <sys/stat.h> 2#include <sys/stat.h>
3#include "dir.h" 3#include <dirent.h>
4 4
5#undef DIR 5#define DIRFUNCTIONS_DEFINED /* prevent those prototypes */
6#define dirent x11_dirent
7#include "../../firmware/common/dir.h"
8#undef dirent
9
10#define SIMULATOR_ARCHOS_ROOT "archos"
11
12struct mydir {
13 DIR *dir;
14 char *name;
15};
16
17typedef struct mydir MYDIR;
6 18
7MYDIR *x11_opendir(char *name) 19MYDIR *x11_opendir(char *name)
8{ 20{
@@ -21,13 +33,15 @@ MYDIR *x11_opendir(char *name)
21 return my; 33 return my;
22} 34}
23 35
24struct dirent *x11_readdir(MYDIR *dir) 36struct x11_dirent *x11_readdir(MYDIR *dir)
25{ 37{
26 char buffer[512]; /* sufficiently big */ 38 char buffer[512]; /* sufficiently big */
27 static struct dirent secret; 39 static struct x11_dirent secret;
28 struct stat s; 40 struct stat s;
41 struct dirent *x11 = (readdir)(dir->dir);
29 42
30 struct x11_dirent *x11 = (readdir)(dir->dir); 43 if(!x11)
44 return NULL;
31 45
32 strcpy(secret.d_name, x11->d_name); 46 strcpy(secret.d_name, x11->d_name);
33 47