From 33a9a63787154facfdaddaf719e727947c159800 Mon Sep 17 00:00:00 2001 From: Jari Vetoniemi Date: Thu, 15 Feb 2018 00:59:08 +0200 Subject: Initial commit Stuff in src/linker will get rewritten from scratch eventually, it's all horrible. But for now focus is getting on shit work. --- src/libandroid.c | 464 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 464 insertions(+) create mode 100644 src/libandroid.c (limited to 'src/libandroid.c') diff --git a/src/libandroid.c b/src/libandroid.c new file mode 100644 index 0000000..fb58bd7 --- /dev/null +++ b/src/libandroid.c @@ -0,0 +1,464 @@ +#include +#include +#include + +// System + +#define PROP_NAME_MAX 32 +#define PROP_VALUE_MAX 92 + +int __system_property_get(const char *name, char *value) +{ + return 0; +} + +// AConfiguration + +struct AConfiguration +{ +}; + +struct AAssetManager +{ +}; + +struct AConfiguration* +AConfiguration_new(void) +{ + return calloc(1, sizeof(struct AConfiguration)); +} + +void +AConfiguration_delete(struct AConfiguration *config) +{ + free(config); +} + +void +AConfiguration_fromAssetManager(struct AConfiguration *out, struct AAssetManager *am) +{ +} + +// ALooper + +static struct ALooper +{ +} thread_looper; + +typedef void* ALooper_callbackFunc; + +struct ALooper* +ALooper_forThread(void) +{ + return &thread_looper; +} + +struct ALooper* +ALooper_prepare(int opts) +{ + return &thread_looper; +} + +void +ALooper_wake(struct ALooper *looper) +{ +} + +int +ALooper_pollAll(int timeoutMillis, int *outFd, int *outEvents, void **outData) +{ + return 0; +} + +// ASensor + +struct ASensor { +}; + +const char* +ASensor_getName(struct ASensor const *sensor) +{ + return NULL; +} + +const char* +ASensor_getVendor(struct ASensor const *sensor) +{ + return NULL; +} + +int +ASensor_getType(struct ASensor const *sensor) +{ + return 0; +} + +float +ASensor_getResolution(struct ASensor const *sensor) +{ + return 0; +} + +int +ASensor_getMinDelay(struct ASensor const *sensor) +{ + return 0; +} + +struct ASensorEvent { +}; + +struct ASensorEventQueue { +}; + +int +ASensorEventQueue_enableSensor(struct ASensorEventQueue *queue, struct ASensor const *sensor) +{ + return 0; +} + +int +ASensorEventQueue_disableSensor(struct ASensorEventQueue *queue, struct ASensor const *sensor) +{ + return 0; +} + +int +ASensorEventQueue_setEventRate(struct ASensorEventQueue *queue, struct ASensor const *sensor, int32_t usec) +{ + return 0; +} + +int +ASensorEventQueue_hasEvents(struct ASensorEventQueue *queue) +{ + return 0; +} + +size_t +ASensorEventQueue_getEvents(struct ASensorEventQueue *queue, struct ASensorEvent *events, size_t count) +{ + return 0; +} + +struct ASensorManager { +}; + +struct ASensorList { +}; + +struct ASensorManager* +ASensorManager_getInstance() +{ + return NULL; +} + +struct ASensor const* +ASensorManager_getDefaultSensor(struct ASensorManager *manager, int type) +{ + return NULL; +} + +int +ASensorManager_getSensorList(struct ASensorManager *manager, struct ASensorList *list) +{ + return 0; +} + +struct ASensorEventQueue* +ASensorManager_createEventQueue(struct ASensorManager *manager, struct ALooper *looper, int ident, ALooper_callbackFunc callback, void *data) +{ + return NULL; +} + +int +ASensorManager_destroyEventQueue(struct ASensorManager *manager, struct ASensorEventQueue *queue) +{ + return 0; +} + +// AInput + +struct AInputEvent +{ +}; + +int32_t +AInputEvent_getType(const struct AInputEvent *event) +{ + return 0; +} + +int32_t +AInputEvent_getDeviceId(const struct AInputEvent *event) +{ + return 0; +} + +int32_t +AInputEvent_getSource(const struct AInputEvent *event) +{ + return 0; +} + +int32_t +AMotionEvent_getEdgeFlags(const struct AInputEvent *motion_event) +{ + return 0; +} + +float +AMotionEvent_getTouchMajor(const struct AInputEvent *motion_event, size_t pointer_index) +{ + return 0; +} + +float +AMotionEvent_getTouchMinor(const struct AInputEvent *motion_event, size_t pointer_index) +{ + return 0; +} + +int32_t +AMotionEvent_getPointerId(const struct AInputEvent *motion_event, size_t pointer_index) +{ + return 0; +} + +int64_t +AMotionEvent_getDownTime(const struct AInputEvent *motion_event) +{ + return 0; +} + +size_t +AMotionEvent_getPointerCount(const struct AInputEvent *motion_event) +{ + return 0; +} + +float +AMotionEvent_getXPrecision(const struct AInputEvent *motion_event) +{ + return 0; +} + +float +AMotionEvent_getYPrecision(const struct AInputEvent *motion_event) +{ + return 0; +} + +float +AMotionEvent_getToolMajor(const struct AInputEvent *motion_event, size_t pointer_index) +{ + return 0; +} + +float +AMotionEvent_getToolMinor(const struct AInputEvent *motion_event, size_t pointer_index) +{ + return 0; +} + +float +AMotionEvent_getX(const struct AInputEvent *motion_event, size_t pointer_index) +{ + return 0; +} + +float +AMotionEvent_getY(const struct AInputEvent *motion_event, size_t pointer_index) +{ + return 0; +} + +float +AMotionEvent_getSize(const struct AInputEvent *motion_event, size_t pointer_index) +{ + return 0; +} + +float +AMotionEvent_getPressure(const struct AInputEvent *motion_event, size_t pointer_index) +{ + return 0; +} + +int64_t +AMotionEvent_getEventTime(const struct AInputEvent *motion_event) +{ + return 0; +} + +int32_t +AMotionEvent_getFlags(const struct AInputEvent *motion_event) +{ + return 0; +} + +int32_t +AMotionEvent_getMetaState(const struct AInputEvent *motion_event) +{ + return 0; +} + +int32_t +AMotionEvent_getAction(const struct AInputEvent *motion_event) +{ + return 0; +} + +size_t +AMotionEvent_getHistorySize(const struct AInputEvent *motion_event) +{ + return 0; +} + +int64_t +AMotionEvent_getHistoricalEventTime(const struct AInputEvent *motion_event, size_t history_index) +{ + return 0; +} + +size_t +AMotionEvent_getHistoricalSize(const struct AInputEvent *motion_event, size_t pointer_index, size_t history_index) +{ + return 0; +} + +float +AMotionEvent_getHistoricalPressure(const struct AInputEvent *motion_event, size_t pointer_index, size_t history_index) +{ + return 0; +} + +float +AMotionEvent_getHistoricalX(const struct AInputEvent *motion_event, size_t pointer_index, size_t history_index) +{ + return 0; +} + +float +AMotionEvent_getHistoricalY(const struct AInputEvent *motion_event, size_t pointer_index, size_t history_index) +{ + return 0; +} + +float +AMotionEvent_getOrientation(const struct AInputEvent *motion_event, size_t pointer_index) +{ + return 0; +} + +int32_t +AKeyEvent_getKeyCode(const struct AInputEvent *key_event) +{ + return 0; +} + +int32_t +AKeyEvent_getMetaState(const struct AInputEvent *key_event) +{ + return 0; +} + +int32_t +AKeyEvent_getAction(const struct AInputEvent *key_event) +{ + return 0; +} + +struct AInputQueue +{ +}; + +void +AInputQueue_attachLooper(struct AInputQueue *queue, struct ALooper *looper, int ident, ALooper_callbackFunc callback, void *data) +{ +} + +void +AInputQueue_detachLooper(struct AInputQueue *queue) +{ +} + +int32_t +AInputQueue_getEvent(struct AInputQueue *queue, struct AInputEvent **outEvent) +{ + return 0; +} + +int32_t +AInputQueue_preDispatchEvent(struct AInputQueue *queue, struct AInputEvent *event) +{ + return 0; +} + +void +AInputQueue_finishEvent(struct AInputQueue *queue, struct AInputEvent *event, int handled) +{ +} + +// ANative + +struct ANativeWindow +{ +}; + +struct ANativeWindow_Buffer +{ +}; + +struct ARect +{ +}; + +typedef void JNIEnv; +typedef uint32_t jobject; + +struct ANativeWindow* +ANativeWindow_fromSurface(JNIEnv* env, jobject surface) +{ + return NULL; +} + +void +ANativeWindow_acquire(struct ANativeWindow *window) +{ +} + +void +ANativeWindow_release(struct ANativeWindow *window) +{ +} + +int32_t +ANativeWindow_getWidth(struct ANativeWindow *window) +{ + return 0; +} + +int32_t +ANativeWindow_getHeight(struct ANativeWindow *window) +{ + return 0; +} + +int32_t +ANativeWindow_setBuffersGeometry(struct ANativeWindow *window, int32_t width, int32_t height, int32_t format) +{ + return 0; +} + +int32_t +ANativeWindow_lock(struct ANativeWindow *window, struct ANativeWindow_Buffer *outBuffer, struct ARect *inOutDirtyBounds) +{ + return 0; +} + +int32_t +ANativeWindow_unlockAndPost(struct ANativeWindow *window) +{ + return 0; +} -- cgit v1.2.3