summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJari Vetoniemi <mailroxas@gmail.com>2018-07-30 15:53:49 +0300
committerJari Vetoniemi <mailroxas@gmail.com>2018-07-30 15:53:49 +0300
commit507dcc03f21510232cc1e540256e0d66d3239921 (patch)
treed16d2eb5fbdefa8a436617f90973ec65cfaf2037
parent1b0c42ed185c30b6fa439554c40cb6be5e991839 (diff)
android: Implement more asset stuff
-rw-r--r--src/libandroid.c52
1 files 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)
{