forked from len0rd/rockbox
adjusted to build on my solaris box
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@493 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
27dfc7c14e
commit
e3a12d34ea
3 changed files with 29 additions and 32 deletions
|
@ -17,39 +17,23 @@
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
#define dirent x11_dirent
|
||||
#define readdir(x) x11_readdir(x)
|
||||
#define opendir(x) x11_opendir(x)
|
||||
#define closedir(x) x11_closedir(x)
|
||||
|
||||
/*
|
||||
* The defines above should let us use the readdir() and opendir() in target
|
||||
* code just as they're defined to work in target. They will then call our
|
||||
* x11_* versions of the functions that'll work as wrappers for the actual
|
||||
* host functions.
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <dirent.h>
|
||||
|
||||
#undef dirent
|
||||
|
||||
typedef void DIR;
|
||||
|
||||
#define DIRFUNCTIONS_DEFINED /* prevent those prototypes */
|
||||
|
||||
#define dirent x11_dirent
|
||||
#include "../../firmware/common/dir.h"
|
||||
#undef dirent
|
||||
|
||||
#define SIMULATOR_ARCHOS_ROOT "archos"
|
||||
|
||||
struct mydir {
|
||||
DIR *dir;
|
||||
char *name;
|
||||
};
|
||||
|
||||
typedef struct mydir MYDIR;
|
||||
typedef void * MYDIR;
|
||||
|
||||
extern MYDIR *x11_opendir(char *name);
|
||||
extern struct dirent* x11_readdir(MYDIR* dir);
|
||||
extern struct x11_dirent* x11_readdir(MYDIR* dir);
|
||||
extern void x11_closedir(MYDIR *dir);
|
||||
|
||||
#define DIR MYDIR
|
||||
#define dirent x11_dirent
|
||||
#define opendir(x) x11_opendir(x)
|
||||
#define readdir(x) x11_readdir(x)
|
||||
#define closedir(x) x11_closedir(x)
|
||||
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
****************************************************************************/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <dirent.h>
|
||||
|
||||
#define open(x,y) x11_open(x,y)
|
||||
|
||||
|
|
|
@ -1,8 +1,20 @@
|
|||
|
||||
#include <sys/stat.h>
|
||||
#include "dir.h"
|
||||
#include <dirent.h>
|
||||
|
||||
#undef DIR
|
||||
#define DIRFUNCTIONS_DEFINED /* prevent those prototypes */
|
||||
#define dirent x11_dirent
|
||||
#include "../../firmware/common/dir.h"
|
||||
#undef dirent
|
||||
|
||||
#define SIMULATOR_ARCHOS_ROOT "archos"
|
||||
|
||||
struct mydir {
|
||||
DIR *dir;
|
||||
char *name;
|
||||
};
|
||||
|
||||
typedef struct mydir MYDIR;
|
||||
|
||||
MYDIR *x11_opendir(char *name)
|
||||
{
|
||||
|
@ -21,13 +33,15 @@ MYDIR *x11_opendir(char *name)
|
|||
return my;
|
||||
}
|
||||
|
||||
struct dirent *x11_readdir(MYDIR *dir)
|
||||
struct x11_dirent *x11_readdir(MYDIR *dir)
|
||||
{
|
||||
char buffer[512]; /* sufficiently big */
|
||||
static struct dirent secret;
|
||||
static struct x11_dirent secret;
|
||||
struct stat s;
|
||||
struct dirent *x11 = (readdir)(dir->dir);
|
||||
|
||||
struct x11_dirent *x11 = (readdir)(dir->dir);
|
||||
if(!x11)
|
||||
return NULL;
|
||||
|
||||
strcpy(secret.d_name, x11->d_name);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue