Android support,

This commit is contained in:
Vitor Santos Costa
2017-07-25 01:10:44 +01:00
parent c0cf2b0b83
commit 963752fa9c
27 changed files with 851 additions and 722 deletions

View File

@@ -31,6 +31,8 @@
#endif
#endif
#include <encoding.h>
typedef struct {
dev_t st_dev; /* ID of device containing file */
mode_t st_mode; /* Mode of file (see below) */
@@ -47,6 +49,7 @@ typedef struct {
#endif
} vfs_stat;
typedef enum vfs_flags {
VFS_CAN_WRITE = 0x1, /// we can write to files in this space
VFS_CAN_EXEC = 0x2, /// we can execute files in this space
@@ -62,7 +65,7 @@ typedef union {
size_t sz;
void *pt;
uintptr_t scalar;
#if __ANDROID__
#if __ANDROID__0
AAssetManager *mgr;
AAsset *asset;
#endif
@@ -108,6 +111,10 @@ typedef struct vfs {
extern VFS_t *GLOBAL_VFS;
extern void init_android_stream(void);
extern void Yap_InitStdStream(int sno, SMALLUNSGN flags, FILE *file, VFS_t *vfsp);
static inline VFS_t *vfs_owner(const char *fname) {
VFS_t *me = GLOBAL_VFS;
int d;