From 507dcc03f21510232cc1e540256e0d66d3239921 Mon Sep 17 00:00:00 2001 From: Jari Vetoniemi Date: Mon, 30 Jul 2018 15:53:49 +0300 Subject: android: Implement more asset stuff --- src/libandroid.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 50 insertions(+), 2 deletions(-) diff --git a/src/libandroid.c b/src/libandroid.c index eff3b3a..cfcc09f 100644 --- a/src/libandroid.c +++ b/src/libandroid.c @@ -10,6 +10,9 @@ #include "jvm/jni.h" +// https://android.googlesource.com/platform/bionic/+/master/docs/32-bit-abi.md +typedef uint32_t bionic_off_t; + // System #define PROP_NAME_MAX 32 @@ -21,16 +24,61 @@ __system_property_get(const char *name, char *value) return 0; } -// AConfiguration +// AAsset -struct AConfiguration { +struct AAsset { char nop; }; +void +AAsset_close(struct AAsset *asset) +{ + free(asset); +} + +bionic_off_t +AAsset_getLength(struct AAsset *asset) +{ + return 0; +} + +bionic_off_t +AAsset_seek(struct AAsset *asset, bionic_off_t offset, int whence) +{ + return 0; +} + + +int +AAsset_read(struct AAsset *asset, void *buf, size_t count) +{ + return 0; +} + +// AAssetManager + struct AAssetManager { char nop; }; +struct AAssetManager* +AAssetManager_fromJava(JNIEnv *env, jobject assetManager) +{ + return calloc(1, sizeof(struct AAssetManager)); +} + +struct AAsset* +AAssetManager_open(struct AAssetManager *amgr, const char *filename, int mode) +{ + return calloc(1, sizeof(struct AAsset)); +} + +// AConfiguration + +struct AConfiguration { + char nop; +}; + struct AConfiguration* AConfiguration_new(void) { -- cgit v1.2.3