From 2d44950d14c64144c6b02443687ee40b964a2560 Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Sat, 1 Oct 2022 08:44:13 +0100 Subject: [PATCH] native-activity: Migrate ANativeActivity callbacks to Rust A first step towards replacing the android_native_app_glue code with a pure Rust implementation. --- android-activity/generate-bindings.sh | 3 + .../native_app_glue/android_native_app_glue.c | 144 +-- .../native_app_glue/android_native_app_glue.h | 9 + .../src/game_activity/ffi_aarch64.rs | 661 ++++------ android-activity/src/game_activity/ffi_arm.rs | 669 ++++------ .../src/game_activity/ffi_i686.rs | 669 ++++------ .../src/game_activity/ffi_x86_64.rs | 669 ++++------ android-activity/src/native_activity/ffi.rs | 1 + .../src/native_activity/ffi_aarch64.rs | 1135 ++-------------- .../src/native_activity/ffi_arm.rs | 1132 ++-------------- .../src/native_activity/ffi_i686.rs | 1132 ++-------------- .../src/native_activity/ffi_x86_64.rs | 1143 ++--------------- android-activity/src/native_activity/mod.rs | 127 +- 13 files changed, 1442 insertions(+), 6052 deletions(-) diff --git a/android-activity/generate-bindings.sh b/android-activity/generate-bindings.sh index f73cb6b..b9809cd 100644 --- a/android-activity/generate-bindings.sh +++ b/android-activity/generate-bindings.sh @@ -53,6 +53,9 @@ while read ARCH && read TARGET ; do --blocklist-item 'GameActivity_onCreate' \ --blocklist-function 'GameActivity_onCreate_C' \ --newtype-enum '\w+_(result|status)_t' \ + --blocklist-item 'pthread_mutex_t' \ + --blocklist-item 'pthread_cond_t' \ + --blocklist-item 'pthread_\w*' \ -- \ -Inative-activity-csrc \ --sysroot="$SYSROOT" --target=$TARGET diff --git a/android-activity/native-activity-csrc/native-activity/native_app_glue/android_native_app_glue.c b/android-activity/native-activity-csrc/native-activity/native_app_glue/android_native_app_glue.c index 4b212bd..b05f750 100644 --- a/android-activity/native-activity-csrc/native-activity/native_app_glue/android_native_app_glue.c +++ b/android-activity/native-activity-csrc/native-activity/native_app_glue/android_native_app_glue.c @@ -180,10 +180,6 @@ void android_app_post_exec_cmd(struct android_app* android_app, int8_t cmd) { } } -void app_dummy() { - -} - static void android_app_destroy(struct android_app* android_app) { LOGV("android_app_destroy!"); free_saved_state(android_app); @@ -198,21 +194,6 @@ static void android_app_destroy(struct android_app* android_app) { // Can't touch android_app object after this. } -/* -static void process_input(struct android_app* app, __attribute__((unused)) struct android_poll_source* source) { - AInputEvent* event = NULL; - while (AInputQueue_getEvent(app->inputQueue, &event) >= 0) { - LOGV("New input event: type=%d\n", AInputEvent_getType(event)); - if (AInputQueue_preDispatchEvent(app->inputQueue, event)) { - continue; - } - int32_t handled = 0; - if (app->onInputEvent != NULL) handled = app->onInputEvent(app, event); - AInputQueue_finishEvent(app->inputQueue, event, handled); - } -} -*/ - static void process_cmd(struct android_app* app, __attribute__((unused)) struct android_poll_source* source) { int8_t cmd = android_app_read_cmd(app); android_app_pre_exec_cmd(app, cmd); @@ -231,9 +212,6 @@ static void* android_app_entry(void* param) { android_app->cmdPollSource.id = LOOPER_ID_MAIN; android_app->cmdPollSource.app = android_app; android_app->cmdPollSource.process = process_cmd; - //android_app->inputPollSource.id = LOOPER_ID_INPUT; - //android_app->inputPollSource.app = android_app; - //android_app->inputPollSource.process = process_input; ALooper* looper = ALooper_prepare(ALOOPER_PREPARE_ALLOW_NON_CALLBACKS); ALooper_addFd(looper, android_app->msgread, LOOPER_ID_MAIN, ALOOPER_EVENT_INPUT, NULL, @@ -255,7 +233,7 @@ static void* android_app_entry(void* param) { // Native activity interaction (called from main thread) // -------------------------------------------------------------------- -static struct android_app* android_app_create(ANativeActivity* activity, +struct android_app* android_app_create(ANativeActivity* activity, void* savedState, size_t savedStateSize) { struct android_app* android_app = (struct android_app*)malloc(sizeof(struct android_app)); memset(android_app, 0, sizeof(struct android_app)); @@ -293,13 +271,13 @@ static struct android_app* android_app_create(ANativeActivity* activity, return android_app; } -static void android_app_write_cmd(struct android_app* android_app, int8_t cmd) { +void android_app_write_cmd(struct android_app* android_app, int8_t cmd) { if (write(android_app->msgwrite, &cmd, sizeof(cmd)) != sizeof(cmd)) { LOGE("Failure writing android_app cmd: %s\n", strerror(errno)); } } -static void android_app_set_input(struct android_app* android_app, AInputQueue* inputQueue) { +void android_app_set_input(struct android_app* android_app, AInputQueue* inputQueue) { pthread_mutex_lock(&android_app->mutex); android_app->pendingInputQueue = inputQueue; android_app_write_cmd(android_app, APP_CMD_INPUT_CHANGED); @@ -309,7 +287,7 @@ static void android_app_set_input(struct android_app* android_app, AInputQueue* pthread_mutex_unlock(&android_app->mutex); } -static void android_app_set_window(struct android_app* android_app, ANativeWindow* window) { +void android_app_set_window(struct android_app* android_app, ANativeWindow* window) { pthread_mutex_lock(&android_app->mutex); if (android_app->pendingWindow != NULL) { android_app_write_cmd(android_app, APP_CMD_TERM_WINDOW); @@ -324,7 +302,7 @@ static void android_app_set_window(struct android_app* android_app, ANativeWindo pthread_mutex_unlock(&android_app->mutex); } -static void android_app_set_activity_state(struct android_app* android_app, int8_t cmd) { +void android_app_set_activity_state(struct android_app* android_app, int8_t cmd) { pthread_mutex_lock(&android_app->mutex); android_app_write_cmd(android_app, cmd); while (android_app->activityState != cmd) { @@ -333,7 +311,7 @@ static void android_app_set_activity_state(struct android_app* android_app, int8 pthread_mutex_unlock(&android_app->mutex); } -static void android_app_free(struct android_app* android_app) { +void android_app_free(struct android_app* android_app) { pthread_mutex_lock(&android_app->mutex); android_app_write_cmd(android_app, APP_CMD_DESTROY); while (!android_app->destroyed) { @@ -346,112 +324,4 @@ static void android_app_free(struct android_app* android_app) { pthread_cond_destroy(&android_app->cond); pthread_mutex_destroy(&android_app->mutex); free(android_app); -} - -static void onDestroy(ANativeActivity* activity) { - LOGV("Destroy: %p\n", activity); - android_app_free((struct android_app*)activity->instance); -} - -static void onStart(ANativeActivity* activity) { - LOGV("Start: %p\n", activity); - android_app_set_activity_state((struct android_app*)activity->instance, APP_CMD_START); -} - -static void onResume(ANativeActivity* activity) { - LOGV("Resume: %p\n", activity); - android_app_set_activity_state((struct android_app*)activity->instance, APP_CMD_RESUME); -} - -static void* onSaveInstanceState(ANativeActivity* activity, size_t* outLen) { - struct android_app* android_app = (struct android_app*)activity->instance; - void* savedState = NULL; - - LOGV("SaveInstanceState: %p\n", activity); - pthread_mutex_lock(&android_app->mutex); - android_app->stateSaved = 0; - android_app_write_cmd(android_app, APP_CMD_SAVE_STATE); - while (!android_app->stateSaved) { - pthread_cond_wait(&android_app->cond, &android_app->mutex); - } - - if (android_app->savedState != NULL) { - savedState = android_app->savedState; - *outLen = android_app->savedStateSize; - android_app->savedState = NULL; - android_app->savedStateSize = 0; - } - - pthread_mutex_unlock(&android_app->mutex); - - return savedState; -} - -static void onPause(ANativeActivity* activity) { - LOGV("Pause: %p\n", activity); - android_app_set_activity_state((struct android_app*)activity->instance, APP_CMD_PAUSE); -} - -static void onStop(ANativeActivity* activity) { - LOGV("Stop: %p\n", activity); - android_app_set_activity_state((struct android_app*)activity->instance, APP_CMD_STOP); -} - -static void onConfigurationChanged(ANativeActivity* activity) { - struct android_app* android_app = (struct android_app*)activity->instance; - LOGV("ConfigurationChanged: %p\n", activity); - android_app_write_cmd(android_app, APP_CMD_CONFIG_CHANGED); -} - -static void onLowMemory(ANativeActivity* activity) { - struct android_app* android_app = (struct android_app*)activity->instance; - LOGV("LowMemory: %p\n", activity); - android_app_write_cmd(android_app, APP_CMD_LOW_MEMORY); -} - -static void onWindowFocusChanged(ANativeActivity* activity, int focused) { - LOGV("WindowFocusChanged: %p -- %d\n", activity, focused); - android_app_write_cmd((struct android_app*)activity->instance, - focused ? APP_CMD_GAINED_FOCUS : APP_CMD_LOST_FOCUS); -} - -static void onNativeWindowCreated(ANativeActivity* activity, ANativeWindow* window) { - LOGV("NativeWindowCreated: %p -- %p\n", activity, window); - android_app_set_window((struct android_app*)activity->instance, window); -} - -static void onNativeWindowDestroyed(ANativeActivity* activity, ANativeWindow* window) { - LOGV("NativeWindowDestroyed: %p -- %p\n", activity, window); - android_app_set_window((struct android_app*)activity->instance, NULL); -} - -static void onInputQueueCreated(ANativeActivity* activity, AInputQueue* queue) { - LOGV("InputQueueCreated: %p -- %p\n", activity, queue); - android_app_set_input((struct android_app*)activity->instance, queue); -} - -static void onInputQueueDestroyed(ANativeActivity* activity, AInputQueue* queue) { - LOGV("InputQueueDestroyed: %p -- %p\n", activity, queue); - android_app_set_input((struct android_app*)activity->instance, NULL); -} - -JNIEXPORT -void ANativeActivity_onCreate_C(ANativeActivity* activity, void* savedState, - size_t savedStateSize) { - LOGV("Creating: %p\n", activity); - activity->callbacks->onDestroy = onDestroy; - activity->callbacks->onStart = onStart; - activity->callbacks->onResume = onResume; - activity->callbacks->onSaveInstanceState = onSaveInstanceState; - activity->callbacks->onPause = onPause; - activity->callbacks->onStop = onStop; - activity->callbacks->onConfigurationChanged = onConfigurationChanged; - activity->callbacks->onLowMemory = onLowMemory; - activity->callbacks->onWindowFocusChanged = onWindowFocusChanged; - activity->callbacks->onNativeWindowCreated = onNativeWindowCreated; - activity->callbacks->onNativeWindowDestroyed = onNativeWindowDestroyed; - activity->callbacks->onInputQueueCreated = onInputQueueCreated; - activity->callbacks->onInputQueueDestroyed = onInputQueueDestroyed; - - activity->instance = android_app_create(activity, savedState, savedStateSize); -} +} \ No newline at end of file diff --git a/android-activity/native-activity-csrc/native-activity/native_app_glue/android_native_app_glue.h b/android-activity/native-activity-csrc/native-activity/native_app_glue/android_native_app_glue.h index 2a9c6ed..4889769 100644 --- a/android-activity/native-activity-csrc/native-activity/native_app_glue/android_native_app_glue.h +++ b/android-activity/native-activity-csrc/native-activity/native_app_glue/android_native_app_glue.h @@ -334,6 +334,15 @@ void android_app_post_exec_cmd(struct android_app* android_app, int8_t cmd); void android_app_attach_input_queue_looper(struct android_app* android_app); void android_app_detach_input_queue_looper(struct android_app* android_app); + +struct android_app* android_app_create(ANativeActivity* activity, + void* savedState, size_t savedStateSize); +void android_app_write_cmd(struct android_app* android_app, int8_t cmd); +void android_app_set_input(struct android_app* android_app, AInputQueue* inputQueue); +void android_app_set_window(struct android_app* android_app, ANativeWindow* window); +void android_app_set_activity_state(struct android_app* android_app, int8_t cmd); +void android_app_free(struct android_app* android_app); + /** * Dummy function that used to be used to prevent the linker from stripping app * glue code. No longer necessary, since __attribute__((visibility("default"))) diff --git a/android-activity/src/game_activity/ffi_aarch64.rs b/android-activity/src/game_activity/ffi_aarch64.rs index d9ebe3d..2c6600f 100644 --- a/android-activity/src/game_activity/ffi_aarch64.rs +++ b/android-activity/src/game_activity/ffi_aarch64.rs @@ -21,13 +21,10 @@ pub const __ANDROID_API_O_MR1__: u32 = 27; pub const __ANDROID_API_P__: u32 = 28; pub const __ANDROID_API_Q__: u32 = 29; pub const __ANDROID_API_R__: u32 = 30; -pub const __ANDROID_API_S__: u32 = 31; -pub const __ANDROID_API_T__: u32 = 33; -pub const __ANDROID_NDK__: u32 = 1; -pub const __NDK_MAJOR__: u32 = 25; -pub const __NDK_MINOR__: u32 = 0; +pub const __NDK_MAJOR__: u32 = 21; +pub const __NDK_MINOR__: u32 = 1; pub const __NDK_BETA__: u32 = 0; -pub const __NDK_BUILD__: u32 = 8775105; +pub const __NDK_BUILD__: u32 = 6352462; pub const __NDK_CANARY__: u32 = 0; pub const WCHAR_MIN: u8 = 0u8; pub const INT8_MIN: i32 = -128; @@ -60,11 +57,7 @@ pub const WINT_MAX: u32 = 4294967295; pub const WINT_MIN: u32 = 0; pub const __BITS_PER_LONG: u32 = 64; pub const __FD_SETSIZE: u32 = 1024; -pub const __GNUC_VA_LIST: u32 = 1; pub const AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT: u32 = 8; -pub const true_: u32 = 1; -pub const false_: u32 = 0; -pub const __bool_true_false_are_defined: u32 = 1; pub const __PRI_64_prefix: &[u8; 2usize] = b"l\0"; pub const __PRI_PTR_prefix: &[u8; 2usize] = b"l\0"; pub const __PRI_FAST_prefix: &[u8; 2usize] = b"l\0"; @@ -222,6 +215,10 @@ pub const SCNxFAST32: &[u8; 3usize] = b"lx\0"; pub const SCNxFAST64: &[u8; 3usize] = b"lx\0"; pub const SCNxMAX: &[u8; 3usize] = b"jx\0"; pub const SCNxPTR: &[u8; 3usize] = b"lx\0"; +pub const __GNUC_VA_LIST: u32 = 1; +pub const true_: u32 = 1; +pub const false_: u32 = 0; +pub const __bool_true_false_are_defined: u32 = 1; pub const GAME_ACTIVITY_POINTER_INFO_AXIS_COUNT: u32 = 48; pub const GAMEACTIVITY_MAX_NUM_POINTERS_IN_MOTION_EVENT: u32 = 8; pub const GAMEACTIVITY_MAX_NUM_HISTORICAL_IN_MOTION_EVENT: u32 = 8; @@ -474,8 +471,6 @@ pub const __SIGRTMAX: u32 = 64; pub const SA_NOCLDSTOP: u32 = 1; pub const SA_NOCLDWAIT: u32 = 2; pub const SA_SIGINFO: u32 = 4; -pub const SA_UNSUPPORTED: u32 = 1024; -pub const SA_EXPOSE_TAGBITS: u32 = 2048; pub const SA_ONSTACK: u32 = 134217728; pub const SA_RESTART: u32 = 268435456; pub const SA_NODEFER: u32 = 1073741824; @@ -531,9 +526,7 @@ pub const SEGV_PKUERR: u32 = 4; pub const SEGV_ACCADI: u32 = 5; pub const SEGV_ADIDERR: u32 = 6; pub const SEGV_ADIPERR: u32 = 7; -pub const SEGV_MTEAERR: u32 = 8; -pub const SEGV_MTESERR: u32 = 9; -pub const NSIGSEGV: u32 = 9; +pub const NSIGSEGV: u32 = 7; pub const BUS_ADRALN: u32 = 1; pub const BUS_ADRERR: u32 = 2; pub const BUS_OBJERR: u32 = 3; @@ -545,8 +538,7 @@ pub const TRAP_TRACE: u32 = 2; pub const TRAP_BRANCH: u32 = 3; pub const TRAP_HWBKPT: u32 = 4; pub const TRAP_UNK: u32 = 5; -pub const TRAP_PERF: u32 = 6; -pub const NSIGTRAP: u32 = 6; +pub const NSIGTRAP: u32 = 5; pub const CLD_EXITED: u32 = 1; pub const CLD_KILLED: u32 = 2; pub const CLD_DUMPED: u32 = 3; @@ -562,8 +554,7 @@ pub const POLL_PRI: u32 = 5; pub const POLL_HUP: u32 = 6; pub const NSIGPOLL: u32 = 6; pub const SYS_SECCOMP: u32 = 1; -pub const SYS_USER_DISPATCH: u32 = 2; -pub const NSIGSYS: u32 = 2; +pub const NSIGSYS: u32 = 1; pub const EMT_TAGOVF: u32 = 1; pub const NSIGEMT: u32 = 1; pub const SIGEV_SIGNAL: u32 = 0; @@ -627,12 +618,6 @@ pub const CLONE_NEWUSER: u32 = 268435456; pub const CLONE_NEWPID: u32 = 536870912; pub const CLONE_NEWNET: u32 = 1073741824; pub const CLONE_IO: u32 = 2147483648; -pub const CLONE_CLEAR_SIGHAND: u64 = 4294967296; -pub const CLONE_INTO_CGROUP: u64 = 8589934592; -pub const CLONE_NEWTIME: u32 = 128; -pub const CLONE_ARGS_SIZE_VER0: u32 = 64; -pub const CLONE_ARGS_SIZE_VER1: u32 = 80; -pub const CLONE_ARGS_SIZE_VER2: u32 = 88; pub const SCHED_NORMAL: u32 = 0; pub const SCHED_FIFO: u32 = 1; pub const SCHED_RR: u32 = 2; @@ -837,7 +822,6 @@ fn bindgen_test_layout___kernel_fsid_t() { } pub type __kernel_off_t = __kernel_long_t; pub type __kernel_loff_t = ::std::os::raw::c_longlong; -pub type __kernel_old_time_t = __kernel_long_t; pub type __kernel_time_t = __kernel_long_t; pub type __kernel_time64_t = ::std::os::raw::c_longlong; pub type __kernel_clock_t = __kernel_long_t; @@ -1456,158 +1440,6 @@ pub const ALOOPER_EVENT_ERROR: ::std::os::raw::c_uint = 4; pub const ALOOPER_EVENT_HANGUP: ::std::os::raw::c_uint = 8; pub const ALOOPER_EVENT_INVALID: ::std::os::raw::c_uint = 16; pub type _bindgen_ty_5 = ::std::os::raw::c_uint; -pub type va_list = [u64; 4usize]; -pub type __gnuc_va_list = [u64; 4usize]; -#[repr(C)] -pub struct JavaVMAttachArgs { - pub version: jint, - pub name: *const ::std::os::raw::c_char, - pub group: jobject, -} -#[test] -fn bindgen_test_layout_JavaVMAttachArgs() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(JavaVMAttachArgs)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(JavaVMAttachArgs)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).version as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JavaVMAttachArgs), - "::", - stringify!(version) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).name as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(JavaVMAttachArgs), - "::", - stringify!(name) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).group as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(JavaVMAttachArgs), - "::", - stringify!(group) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct JavaVMOption { - pub optionString: *const ::std::os::raw::c_char, - pub extraInfo: *mut ::std::os::raw::c_void, -} -#[test] -fn bindgen_test_layout_JavaVMOption() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(JavaVMOption)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(JavaVMOption)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).optionString as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JavaVMOption), - "::", - stringify!(optionString) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).extraInfo as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(JavaVMOption), - "::", - stringify!(extraInfo) - ) - ); -} -#[repr(C)] -pub struct JavaVMInitArgs { - pub version: jint, - pub nOptions: jint, - pub options: *mut JavaVMOption, - pub ignoreUnrecognized: jboolean, -} -#[test] -fn bindgen_test_layout_JavaVMInitArgs() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(JavaVMInitArgs)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(JavaVMInitArgs)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).version as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JavaVMInitArgs), - "::", - stringify!(version) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).nOptions as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(JavaVMInitArgs), - "::", - stringify!(nOptions) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).options as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(JavaVMInitArgs), - "::", - stringify!(options) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ignoreUnrecognized as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(JavaVMInitArgs), - "::", - stringify!(ignoreUnrecognized) - ) - ); -} pub const AKEY_STATE_UNKNOWN: ::std::os::raw::c_int = -1; pub const AKEY_STATE_UP: ::std::os::raw::c_int = 0; pub const AKEY_STATE_DOWN: ::std::os::raw::c_int = 1; @@ -1639,10 +1471,6 @@ pub struct AInputEvent { } pub const AINPUT_EVENT_TYPE_KEY: ::std::os::raw::c_uint = 1; pub const AINPUT_EVENT_TYPE_MOTION: ::std::os::raw::c_uint = 2; -pub const AINPUT_EVENT_TYPE_FOCUS: ::std::os::raw::c_uint = 3; -pub const AINPUT_EVENT_TYPE_CAPTURE: ::std::os::raw::c_uint = 4; -pub const AINPUT_EVENT_TYPE_DRAG: ::std::os::raw::c_uint = 5; -pub const AINPUT_EVENT_TYPE_TOUCH_MODE: ::std::os::raw::c_uint = 6; pub type _bindgen_ty_8 = ::std::os::raw::c_uint; pub const AKEY_EVENT_ACTION_DOWN: ::std::os::raw::c_uint = 0; pub const AKEY_EVENT_ACTION_UP: ::std::os::raw::c_uint = 1; @@ -1743,13 +1571,7 @@ pub const AMOTION_EVENT_TOOL_TYPE_FINGER: ::std::os::raw::c_uint = 1; pub const AMOTION_EVENT_TOOL_TYPE_STYLUS: ::std::os::raw::c_uint = 2; pub const AMOTION_EVENT_TOOL_TYPE_MOUSE: ::std::os::raw::c_uint = 3; pub const AMOTION_EVENT_TOOL_TYPE_ERASER: ::std::os::raw::c_uint = 4; -pub const AMOTION_EVENT_TOOL_TYPE_PALM: ::std::os::raw::c_uint = 5; pub type _bindgen_ty_16 = ::std::os::raw::c_uint; -pub const AMotionClassification_AMOTION_EVENT_CLASSIFICATION_NONE: AMotionClassification = 0; -pub const AMotionClassification_AMOTION_EVENT_CLASSIFICATION_AMBIGUOUS_GESTURE: - AMotionClassification = 1; -pub const AMotionClassification_AMOTION_EVENT_CLASSIFICATION_DEEP_PRESS: AMotionClassification = 2; -pub type AMotionClassification = u32; pub const AINPUT_SOURCE_CLASS_MASK: ::std::os::raw::c_uint = 255; pub const AINPUT_SOURCE_CLASS_NONE: ::std::os::raw::c_uint = 0; pub const AINPUT_SOURCE_CLASS_BUTTON: ::std::os::raw::c_uint = 1; @@ -1771,8 +1593,6 @@ pub const AINPUT_SOURCE_MOUSE_RELATIVE: ::std::os::raw::c_uint = 131076; pub const AINPUT_SOURCE_TOUCHPAD: ::std::os::raw::c_uint = 1048584; pub const AINPUT_SOURCE_TOUCH_NAVIGATION: ::std::os::raw::c_uint = 2097152; pub const AINPUT_SOURCE_JOYSTICK: ::std::os::raw::c_uint = 16777232; -pub const AINPUT_SOURCE_HDMI: ::std::os::raw::c_uint = 33554433; -pub const AINPUT_SOURCE_SENSOR: ::std::os::raw::c_uint = 67108864; pub const AINPUT_SOURCE_ROTARY_ENCODER: ::std::os::raw::c_uint = 4194304; pub const AINPUT_SOURCE_ANY: ::std::os::raw::c_uint = 4294967040; pub type _bindgen_ty_18 = ::std::os::raw::c_uint; @@ -1799,9 +1619,6 @@ extern "C" { extern "C" { pub fn AInputEvent_getSource(event: *const AInputEvent) -> i32; } -extern "C" { - pub fn AInputEvent_release(event: *const AInputEvent); -} extern "C" { pub fn AKeyEvent_getAction(key_event: *const AInputEvent) -> i32; } @@ -1826,9 +1643,6 @@ extern "C" { extern "C" { pub fn AKeyEvent_getEventTime(key_event: *const AInputEvent) -> i64; } -extern "C" { - pub fn AKeyEvent_fromJava(env: *mut JNIEnv, keyEvent: jobject) -> *const AInputEvent; -} extern "C" { pub fn AMotionEvent_getAction(motion_event: *const AInputEvent) -> i32; } @@ -2025,15 +1839,6 @@ extern "C" { history_index: size_t, ) -> f32; } -extern "C" { - pub fn AMotionEvent_getActionButton(motion_event: *const AInputEvent) -> i32; -} -extern "C" { - pub fn AMotionEvent_getClassification(motion_event: *const AInputEvent) -> i32; -} -extern "C" { - pub fn AMotionEvent_fromJava(env: *mut JNIEnv, motionEvent: jobject) -> *const AInputEvent; -} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct AInputQueue { @@ -2067,9 +1872,6 @@ extern "C" { handled: ::std::os::raw::c_int, ); } -extern "C" { - pub fn AInputQueue_fromJava(env: *mut JNIEnv, inputQueue: jobject) -> *mut AInputQueue; -} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct imaxdiv_t { @@ -2144,52 +1946,11 @@ extern "C" { ) -> uintmax_t; } pub const ADataSpace_ADATASPACE_UNKNOWN: ADataSpace = 0; -pub const ADataSpace_STANDARD_MASK: ADataSpace = 4128768; -pub const ADataSpace_STANDARD_UNSPECIFIED: ADataSpace = 0; -pub const ADataSpace_STANDARD_BT709: ADataSpace = 65536; -pub const ADataSpace_STANDARD_BT601_625: ADataSpace = 131072; -pub const ADataSpace_STANDARD_BT601_625_UNADJUSTED: ADataSpace = 196608; -pub const ADataSpace_STANDARD_BT601_525: ADataSpace = 262144; -pub const ADataSpace_STANDARD_BT601_525_UNADJUSTED: ADataSpace = 327680; -pub const ADataSpace_STANDARD_BT2020: ADataSpace = 393216; -pub const ADataSpace_STANDARD_BT2020_CONSTANT_LUMINANCE: ADataSpace = 458752; -pub const ADataSpace_STANDARD_BT470M: ADataSpace = 524288; -pub const ADataSpace_STANDARD_FILM: ADataSpace = 589824; -pub const ADataSpace_STANDARD_DCI_P3: ADataSpace = 655360; -pub const ADataSpace_STANDARD_ADOBE_RGB: ADataSpace = 720896; -pub const ADataSpace_TRANSFER_MASK: ADataSpace = 130023424; -pub const ADataSpace_TRANSFER_UNSPECIFIED: ADataSpace = 0; -pub const ADataSpace_TRANSFER_LINEAR: ADataSpace = 4194304; -pub const ADataSpace_TRANSFER_SRGB: ADataSpace = 8388608; -pub const ADataSpace_TRANSFER_SMPTE_170M: ADataSpace = 12582912; -pub const ADataSpace_TRANSFER_GAMMA2_2: ADataSpace = 16777216; -pub const ADataSpace_TRANSFER_GAMMA2_6: ADataSpace = 20971520; -pub const ADataSpace_TRANSFER_GAMMA2_8: ADataSpace = 25165824; -pub const ADataSpace_TRANSFER_ST2084: ADataSpace = 29360128; -pub const ADataSpace_TRANSFER_HLG: ADataSpace = 33554432; -pub const ADataSpace_RANGE_MASK: ADataSpace = 939524096; -pub const ADataSpace_RANGE_UNSPECIFIED: ADataSpace = 0; -pub const ADataSpace_RANGE_FULL: ADataSpace = 134217728; -pub const ADataSpace_RANGE_LIMITED: ADataSpace = 268435456; -pub const ADataSpace_RANGE_EXTENDED: ADataSpace = 402653184; pub const ADataSpace_ADATASPACE_SCRGB_LINEAR: ADataSpace = 406913024; pub const ADataSpace_ADATASPACE_SRGB: ADataSpace = 142671872; pub const ADataSpace_ADATASPACE_SCRGB: ADataSpace = 411107328; pub const ADataSpace_ADATASPACE_DISPLAY_P3: ADataSpace = 143261696; pub const ADataSpace_ADATASPACE_BT2020_PQ: ADataSpace = 163971072; -pub const ADataSpace_ADATASPACE_BT2020_ITU_PQ: ADataSpace = 298188800; -pub const ADataSpace_ADATASPACE_ADOBE_RGB: ADataSpace = 151715840; -pub const ADataSpace_ADATASPACE_JFIF: ADataSpace = 146931712; -pub const ADataSpace_ADATASPACE_BT601_625: ADataSpace = 281149440; -pub const ADataSpace_ADATASPACE_BT601_525: ADataSpace = 281280512; -pub const ADataSpace_ADATASPACE_BT2020: ADataSpace = 147193856; -pub const ADataSpace_ADATASPACE_BT709: ADataSpace = 281083904; -pub const ADataSpace_ADATASPACE_DCI_P3: ADataSpace = 155844608; -pub const ADataSpace_ADATASPACE_SRGB_LINEAR: ADataSpace = 138477568; -pub const ADataSpace_ADATASPACE_BT2020_HLG: ADataSpace = 168165376; -pub const ADataSpace_ADATASPACE_BT2020_ITU_HLG: ADataSpace = 302383104; -pub const ADataSpace_DEPTH: ADataSpace = 4096; -pub const ADataSpace_DYNAMIC_DEPTH: ADataSpace = 4098; pub type ADataSpace = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -2270,8 +2031,6 @@ pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_D32_FLOAT_S8_UINT: AHard 52; pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_S8_UINT: AHardwareBuffer_Format = 53; pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_Y8Cb8Cr8_420: AHardwareBuffer_Format = 35; -pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_YCbCr_P010: AHardwareBuffer_Format = 54; -pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_R8_UNORM: AHardwareBuffer_Format = 56; pub type AHardwareBuffer_Format = ::std::os::raw::c_uint; pub const AHardwareBuffer_UsageFlags_AHARDWAREBUFFER_USAGE_CPU_READ_NEVER: AHardwareBuffer_UsageFlags = 0; @@ -2580,6 +2339,15 @@ extern "C" { outVirtualAddress: *mut *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } +extern "C" { + pub fn AHardwareBuffer_lockPlanes( + buffer: *mut AHardwareBuffer, + usage: u64, + fence: i32, + rect: *const ARect, + outPlanes: *mut AHardwareBuffer_Planes, + ) -> ::std::os::raw::c_int; +} extern "C" { pub fn AHardwareBuffer_unlock( buffer: *mut AHardwareBuffer, @@ -2598,15 +2366,6 @@ extern "C" { outBuffer: *mut *mut AHardwareBuffer, ) -> ::std::os::raw::c_int; } -extern "C" { - pub fn AHardwareBuffer_lockPlanes( - buffer: *mut AHardwareBuffer, - usage: u64, - fence: i32, - rect: *const ARect, - outPlanes: *mut AHardwareBuffer_Planes, - ) -> ::std::os::raw::c_int; -} extern "C" { pub fn AHardwareBuffer_isSupported(desc: *const AHardwareBuffer_Desc) -> ::std::os::raw::c_int; } @@ -2621,11 +2380,157 @@ extern "C" { outBytesPerStride: *mut i32, ) -> ::std::os::raw::c_int; } -extern "C" { - pub fn AHardwareBuffer_getId( - buffer: *const AHardwareBuffer, - outId: *mut u64, - ) -> ::std::os::raw::c_int; +pub type va_list = [u64; 4usize]; +pub type __gnuc_va_list = [u64; 4usize]; +#[repr(C)] +pub struct JavaVMAttachArgs { + pub version: jint, + pub name: *const ::std::os::raw::c_char, + pub group: jobject, +} +#[test] +fn bindgen_test_layout_JavaVMAttachArgs() { + assert_eq!( + ::std::mem::size_of::(), + 24usize, + concat!("Size of: ", stringify!(JavaVMAttachArgs)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(JavaVMAttachArgs)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).version as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(JavaVMAttachArgs), + "::", + stringify!(version) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).name as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(JavaVMAttachArgs), + "::", + stringify!(name) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).group as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(JavaVMAttachArgs), + "::", + stringify!(group) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct JavaVMOption { + pub optionString: *const ::std::os::raw::c_char, + pub extraInfo: *mut ::std::os::raw::c_void, +} +#[test] +fn bindgen_test_layout_JavaVMOption() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(JavaVMOption)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(JavaVMOption)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).optionString as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(JavaVMOption), + "::", + stringify!(optionString) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).extraInfo as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(JavaVMOption), + "::", + stringify!(extraInfo) + ) + ); +} +#[repr(C)] +pub struct JavaVMInitArgs { + pub version: jint, + pub nOptions: jint, + pub options: *mut JavaVMOption, + pub ignoreUnrecognized: jboolean, +} +#[test] +fn bindgen_test_layout_JavaVMInitArgs() { + assert_eq!( + ::std::mem::size_of::(), + 24usize, + concat!("Size of: ", stringify!(JavaVMInitArgs)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(JavaVMInitArgs)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).version as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(JavaVMInitArgs), + "::", + stringify!(version) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nOptions as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(JavaVMInitArgs), + "::", + stringify!(nOptions) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).options as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(JavaVMInitArgs), + "::", + stringify!(options) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).ignoreUnrecognized as *const _ as usize + }, + 16usize, + concat!( + "Offset of field: ", + stringify!(JavaVMInitArgs), + "::", + stringify!(ignoreUnrecognized) + ) + ); } pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_CAPTION_BAR: GameCommonInsetsType = 0; pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_DISPLAY_CUTOUT: GameCommonInsetsType = 1; @@ -5214,11 +5119,9 @@ pub struct __sifields__bindgen_ty_5 { #[repr(C)] #[derive(Copy, Clone)] pub union __sifields__bindgen_ty_5__bindgen_ty_1 { - pub _trapno: ::std::os::raw::c_int, pub _addr_lsb: ::std::os::raw::c_short, pub _addr_bnd: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1, pub _addr_pkey: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2, - pub _perf: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3, } #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -5336,57 +5239,6 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2() { ) ); } -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3 { - pub _data: ::std::os::raw::c_ulong, - pub _type: __u32, -} -#[test] -fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3() { - assert_eq!( - ::std::mem::size_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3>(), - 16usize, - concat!( - "Size of: ", - stringify!(__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3) - ) - ); - assert_eq!( - ::std::mem::align_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3>(), - 8usize, - concat!( - "Alignment of ", - stringify!(__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3>()))._data - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3), - "::", - stringify!(_data) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3>()))._type - as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3), - "::", - stringify!(_type) - ) - ); -} #[test] fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1() { assert_eq!( @@ -5405,19 +5257,6 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1() { stringify!(__sifields__bindgen_ty_5__bindgen_ty_1) ) ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1>()))._trapno as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__sifields__bindgen_ty_5__bindgen_ty_1), - "::", - stringify!(_trapno) - ) - ); assert_eq!( unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1>()))._addr_lsb as *const _ @@ -5457,19 +5296,6 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1() { stringify!(_addr_pkey) ) ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1>()))._perf as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__sifields__bindgen_ty_5__bindgen_ty_1), - "::", - stringify!(_perf) - ) - ); } #[test] fn bindgen_test_layout___sifields__bindgen_ty_5() { @@ -6732,40 +6558,40 @@ fn bindgen_test_layout___kernel_itimerspec() { } #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct __kernel_old_timespec { - pub tv_sec: __kernel_old_time_t, - pub tv_nsec: ::std::os::raw::c_long, +pub struct __kernel_old_timeval { + pub tv_sec: __kernel_long_t, + pub tv_usec: __kernel_long_t, } #[test] -fn bindgen_test_layout___kernel_old_timespec() { +fn bindgen_test_layout___kernel_old_timeval() { assert_eq!( - ::std::mem::size_of::<__kernel_old_timespec>(), + ::std::mem::size_of::<__kernel_old_timeval>(), 16usize, - concat!("Size of: ", stringify!(__kernel_old_timespec)) + concat!("Size of: ", stringify!(__kernel_old_timeval)) ); assert_eq!( - ::std::mem::align_of::<__kernel_old_timespec>(), + ::std::mem::align_of::<__kernel_old_timeval>(), 8usize, - concat!("Alignment of ", stringify!(__kernel_old_timespec)) + concat!("Alignment of ", stringify!(__kernel_old_timeval)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_old_timespec>())).tv_sec as *const _ as usize }, + unsafe { &(*(::std::ptr::null::<__kernel_old_timeval>())).tv_sec as *const _ as usize }, 0usize, concat!( "Offset of field: ", - stringify!(__kernel_old_timespec), + stringify!(__kernel_old_timeval), "::", stringify!(tv_sec) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_old_timespec>())).tv_nsec as *const _ as usize }, + unsafe { &(*(::std::ptr::null::<__kernel_old_timeval>())).tv_usec as *const _ as usize }, 8usize, concat!( "Offset of field: ", - stringify!(__kernel_old_timespec), + stringify!(__kernel_old_timeval), "::", - stringify!(tv_nsec) + stringify!(tv_usec) ) ); } @@ -6811,7 +6637,7 @@ fn bindgen_test_layout___kernel_sock_timeval() { #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct timeval { - pub tv_sec: __kernel_old_time_t, + pub tv_sec: __kernel_time_t, pub tv_usec: __kernel_suseconds_t, } #[test] @@ -6849,6 +6675,45 @@ fn bindgen_test_layout_timeval() { } #[repr(C)] #[derive(Debug, Copy, Clone)] +pub struct timezone { + pub tz_minuteswest: ::std::os::raw::c_int, + pub tz_dsttime: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_timezone() { + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(timezone)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(timezone)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tz_minuteswest as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(timezone), + "::", + stringify!(tz_minuteswest) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tz_dsttime as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(timezone), + "::", + stringify!(tz_dsttime) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] pub struct itimerspec { pub it_interval: timespec, pub it_value: timespec, @@ -6925,45 +6790,6 @@ fn bindgen_test_layout_itimerval() { ) ); } -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct timezone { - pub tz_minuteswest: ::std::os::raw::c_int, - pub tz_dsttime: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_timezone() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(timezone)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(timezone)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).tz_minuteswest as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(timezone), - "::", - stringify!(tz_minuteswest) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).tz_dsttime as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(timezone), - "::", - stringify!(tz_dsttime) - ) - ); -} pub type fd_mask = ::std::os::raw::c_ulong; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -7008,7 +6834,7 @@ extern "C" { } extern "C" { pub fn select( - __max_fd_plus_one: ::std::os::raw::c_int, + __fd_count: ::std::os::raw::c_int, __read_fds: *mut fd_set, __write_fds: *mut fd_set, __exception_fds: *mut fd_set, @@ -7017,7 +6843,7 @@ extern "C" { } extern "C" { pub fn pselect( - __max_fd_plus_one: ::std::os::raw::c_int, + __fd_count: ::std::os::raw::c_int, __read_fds: *mut fd_set, __write_fds: *mut fd_set, __exception_fds: *mut fd_set, @@ -7027,7 +6853,7 @@ extern "C" { } extern "C" { pub fn pselect64( - __max_fd_plus_one: ::std::os::raw::c_int, + __fd_count: ::std::os::raw::c_int, __read_fds: *mut fd_set, __write_fds: *mut fd_set, __exception_fds: *mut fd_set, @@ -7387,15 +7213,12 @@ pub struct clone_args { pub stack: __u64, pub stack_size: __u64, pub tls: __u64, - pub set_tid: __u64, - pub set_tid_size: __u64, - pub cgroup: __u64, } #[test] fn bindgen_test_layout_clone_args() { assert_eq!( ::std::mem::size_of::(), - 88usize, + 64usize, concat!("Size of: ", stringify!(clone_args)) ); assert_eq!( @@ -7483,36 +7306,6 @@ fn bindgen_test_layout_clone_args() { stringify!(tls) ) ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).set_tid as *const _ as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(clone_args), - "::", - stringify!(set_tid) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).set_tid_size as *const _ as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(clone_args), - "::", - stringify!(set_tid_size) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).cgroup as *const _ as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(clone_args), - "::", - stringify!(cgroup) - ) - ); } #[repr(C)] #[derive(Debug, Copy, Clone)] diff --git a/android-activity/src/game_activity/ffi_arm.rs b/android-activity/src/game_activity/ffi_arm.rs index 73b02a4..7021eb4 100644 --- a/android-activity/src/game_activity/ffi_arm.rs +++ b/android-activity/src/game_activity/ffi_arm.rs @@ -101,13 +101,10 @@ pub const __ANDROID_API_O_MR1__: u32 = 27; pub const __ANDROID_API_P__: u32 = 28; pub const __ANDROID_API_Q__: u32 = 29; pub const __ANDROID_API_R__: u32 = 30; -pub const __ANDROID_API_S__: u32 = 31; -pub const __ANDROID_API_T__: u32 = 33; -pub const __ANDROID_NDK__: u32 = 1; -pub const __NDK_MAJOR__: u32 = 25; -pub const __NDK_MINOR__: u32 = 0; +pub const __NDK_MAJOR__: u32 = 21; +pub const __NDK_MINOR__: u32 = 1; pub const __NDK_BETA__: u32 = 0; -pub const __NDK_BUILD__: u32 = 8775105; +pub const __NDK_BUILD__: u32 = 6352462; pub const __NDK_CANARY__: u32 = 0; pub const WCHAR_MIN: u8 = 0u8; pub const INT8_MIN: i32 = -128; @@ -146,11 +143,7 @@ pub const PTRDIFF_MAX: u32 = 2147483647; pub const SIZE_MAX: u32 = 4294967295; pub const __BITS_PER_LONG: u32 = 32; pub const __FD_SETSIZE: u32 = 1024; -pub const __GNUC_VA_LIST: u32 = 1; pub const AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT: u32 = 8; -pub const true_: u32 = 1; -pub const false_: u32 = 0; -pub const __bool_true_false_are_defined: u32 = 1; pub const __PRI_64_prefix: &[u8; 3usize] = b"ll\0"; pub const PRId8: &[u8; 2usize] = b"d\0"; pub const PRId16: &[u8; 2usize] = b"d\0"; @@ -273,6 +266,10 @@ pub const SCNxLEAST64: &[u8; 4usize] = b"llx\0"; pub const SCNxFAST8: &[u8; 4usize] = b"hhx\0"; pub const SCNxFAST64: &[u8; 4usize] = b"llx\0"; pub const SCNxMAX: &[u8; 3usize] = b"jx\0"; +pub const __GNUC_VA_LIST: u32 = 1; +pub const true_: u32 = 1; +pub const false_: u32 = 0; +pub const __bool_true_false_are_defined: u32 = 1; pub const GAME_ACTIVITY_POINTER_INFO_AXIS_COUNT: u32 = 48; pub const GAMEACTIVITY_MAX_NUM_POINTERS_IN_MOTION_EVENT: u32 = 8; pub const GAMEACTIVITY_MAX_NUM_HISTORICAL_IN_MOTION_EVENT: u32 = 8; @@ -498,21 +495,19 @@ pub const SIGSYS: u32 = 31; pub const SIGUNUSED: u32 = 31; pub const __SIGRTMIN: u32 = 32; pub const SIGSWI: u32 = 32; -pub const SA_THIRTYTWO: u32 = 33554432; -pub const SA_RESTORER: u32 = 67108864; -pub const MINSIGSTKSZ: u32 = 2048; -pub const SIGSTKSZ: u32 = 8192; pub const SA_NOCLDSTOP: u32 = 1; pub const SA_NOCLDWAIT: u32 = 2; pub const SA_SIGINFO: u32 = 4; -pub const SA_UNSUPPORTED: u32 = 1024; -pub const SA_EXPOSE_TAGBITS: u32 = 2048; +pub const SA_THIRTYTWO: u32 = 33554432; +pub const SA_RESTORER: u32 = 67108864; pub const SA_ONSTACK: u32 = 134217728; pub const SA_RESTART: u32 = 268435456; pub const SA_NODEFER: u32 = 1073741824; pub const SA_RESETHAND: u32 = 2147483648; pub const SA_NOMASK: u32 = 1073741824; pub const SA_ONESHOT: u32 = 2147483648; +pub const MINSIGSTKSZ: u32 = 2048; +pub const SIGSTKSZ: u32 = 8192; pub const SIG_BLOCK: u32 = 0; pub const SIG_UNBLOCK: u32 = 1; pub const SIG_SETMASK: u32 = 2; @@ -562,9 +557,7 @@ pub const SEGV_PKUERR: u32 = 4; pub const SEGV_ACCADI: u32 = 5; pub const SEGV_ADIDERR: u32 = 6; pub const SEGV_ADIPERR: u32 = 7; -pub const SEGV_MTEAERR: u32 = 8; -pub const SEGV_MTESERR: u32 = 9; -pub const NSIGSEGV: u32 = 9; +pub const NSIGSEGV: u32 = 7; pub const BUS_ADRALN: u32 = 1; pub const BUS_ADRERR: u32 = 2; pub const BUS_OBJERR: u32 = 3; @@ -576,8 +569,7 @@ pub const TRAP_TRACE: u32 = 2; pub const TRAP_BRANCH: u32 = 3; pub const TRAP_HWBKPT: u32 = 4; pub const TRAP_UNK: u32 = 5; -pub const TRAP_PERF: u32 = 6; -pub const NSIGTRAP: u32 = 6; +pub const NSIGTRAP: u32 = 5; pub const CLD_EXITED: u32 = 1; pub const CLD_KILLED: u32 = 2; pub const CLD_DUMPED: u32 = 3; @@ -593,8 +585,7 @@ pub const POLL_PRI: u32 = 5; pub const POLL_HUP: u32 = 6; pub const NSIGPOLL: u32 = 6; pub const SYS_SECCOMP: u32 = 1; -pub const SYS_USER_DISPATCH: u32 = 2; -pub const NSIGSYS: u32 = 2; +pub const NSIGSYS: u32 = 1; pub const EMT_TAGOVF: u32 = 1; pub const NSIGEMT: u32 = 1; pub const SIGEV_SIGNAL: u32 = 0; @@ -659,12 +650,6 @@ pub const CLONE_NEWUSER: u32 = 268435456; pub const CLONE_NEWPID: u32 = 536870912; pub const CLONE_NEWNET: u32 = 1073741824; pub const CLONE_IO: u32 = 2147483648; -pub const CLONE_CLEAR_SIGHAND: u64 = 4294967296; -pub const CLONE_INTO_CGROUP: u64 = 8589934592; -pub const CLONE_NEWTIME: u32 = 128; -pub const CLONE_ARGS_SIZE_VER0: u32 = 64; -pub const CLONE_ARGS_SIZE_VER1: u32 = 80; -pub const CLONE_ARGS_SIZE_VER2: u32 = 88; pub const SCHED_NORMAL: u32 = 0; pub const SCHED_FIFO: u32 = 1; pub const SCHED_RR: u32 = 2; @@ -867,7 +852,6 @@ fn bindgen_test_layout___kernel_fsid_t() { } pub type __kernel_off_t = __kernel_long_t; pub type __kernel_loff_t = ::std::os::raw::c_longlong; -pub type __kernel_old_time_t = __kernel_long_t; pub type __kernel_time_t = __kernel_long_t; pub type __kernel_time64_t = ::std::os::raw::c_longlong; pub type __kernel_clock_t = __kernel_long_t; @@ -1475,158 +1459,6 @@ pub const ALOOPER_EVENT_ERROR: ::std::os::raw::c_uint = 4; pub const ALOOPER_EVENT_HANGUP: ::std::os::raw::c_uint = 8; pub const ALOOPER_EVENT_INVALID: ::std::os::raw::c_uint = 16; pub type _bindgen_ty_5 = ::std::os::raw::c_uint; -pub type va_list = u32; -pub type __gnuc_va_list = u32; -#[repr(C)] -pub struct JavaVMAttachArgs { - pub version: jint, - pub name: *const ::std::os::raw::c_char, - pub group: jobject, -} -#[test] -fn bindgen_test_layout_JavaVMAttachArgs() { - assert_eq!( - ::std::mem::size_of::(), - 12usize, - concat!("Size of: ", stringify!(JavaVMAttachArgs)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(JavaVMAttachArgs)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).version as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JavaVMAttachArgs), - "::", - stringify!(version) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).name as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(JavaVMAttachArgs), - "::", - stringify!(name) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).group as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(JavaVMAttachArgs), - "::", - stringify!(group) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct JavaVMOption { - pub optionString: *const ::std::os::raw::c_char, - pub extraInfo: *mut ::std::os::raw::c_void, -} -#[test] -fn bindgen_test_layout_JavaVMOption() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(JavaVMOption)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(JavaVMOption)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).optionString as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JavaVMOption), - "::", - stringify!(optionString) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).extraInfo as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(JavaVMOption), - "::", - stringify!(extraInfo) - ) - ); -} -#[repr(C)] -pub struct JavaVMInitArgs { - pub version: jint, - pub nOptions: jint, - pub options: *mut JavaVMOption, - pub ignoreUnrecognized: jboolean, -} -#[test] -fn bindgen_test_layout_JavaVMInitArgs() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(JavaVMInitArgs)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(JavaVMInitArgs)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).version as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JavaVMInitArgs), - "::", - stringify!(version) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).nOptions as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(JavaVMInitArgs), - "::", - stringify!(nOptions) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).options as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(JavaVMInitArgs), - "::", - stringify!(options) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ignoreUnrecognized as *const _ as usize - }, - 12usize, - concat!( - "Offset of field: ", - stringify!(JavaVMInitArgs), - "::", - stringify!(ignoreUnrecognized) - ) - ); -} pub const AKEY_STATE_UNKNOWN: ::std::os::raw::c_int = -1; pub const AKEY_STATE_UP: ::std::os::raw::c_int = 0; pub const AKEY_STATE_DOWN: ::std::os::raw::c_int = 1; @@ -1658,10 +1490,6 @@ pub struct AInputEvent { } pub const AINPUT_EVENT_TYPE_KEY: ::std::os::raw::c_uint = 1; pub const AINPUT_EVENT_TYPE_MOTION: ::std::os::raw::c_uint = 2; -pub const AINPUT_EVENT_TYPE_FOCUS: ::std::os::raw::c_uint = 3; -pub const AINPUT_EVENT_TYPE_CAPTURE: ::std::os::raw::c_uint = 4; -pub const AINPUT_EVENT_TYPE_DRAG: ::std::os::raw::c_uint = 5; -pub const AINPUT_EVENT_TYPE_TOUCH_MODE: ::std::os::raw::c_uint = 6; pub type _bindgen_ty_8 = ::std::os::raw::c_uint; pub const AKEY_EVENT_ACTION_DOWN: ::std::os::raw::c_uint = 0; pub const AKEY_EVENT_ACTION_UP: ::std::os::raw::c_uint = 1; @@ -1762,13 +1590,7 @@ pub const AMOTION_EVENT_TOOL_TYPE_FINGER: ::std::os::raw::c_uint = 1; pub const AMOTION_EVENT_TOOL_TYPE_STYLUS: ::std::os::raw::c_uint = 2; pub const AMOTION_EVENT_TOOL_TYPE_MOUSE: ::std::os::raw::c_uint = 3; pub const AMOTION_EVENT_TOOL_TYPE_ERASER: ::std::os::raw::c_uint = 4; -pub const AMOTION_EVENT_TOOL_TYPE_PALM: ::std::os::raw::c_uint = 5; pub type _bindgen_ty_16 = ::std::os::raw::c_uint; -pub const AMotionClassification_AMOTION_EVENT_CLASSIFICATION_NONE: AMotionClassification = 0; -pub const AMotionClassification_AMOTION_EVENT_CLASSIFICATION_AMBIGUOUS_GESTURE: - AMotionClassification = 1; -pub const AMotionClassification_AMOTION_EVENT_CLASSIFICATION_DEEP_PRESS: AMotionClassification = 2; -pub type AMotionClassification = u32; pub const AINPUT_SOURCE_CLASS_MASK: ::std::os::raw::c_uint = 255; pub const AINPUT_SOURCE_CLASS_NONE: ::std::os::raw::c_uint = 0; pub const AINPUT_SOURCE_CLASS_BUTTON: ::std::os::raw::c_uint = 1; @@ -1790,8 +1612,6 @@ pub const AINPUT_SOURCE_MOUSE_RELATIVE: ::std::os::raw::c_uint = 131076; pub const AINPUT_SOURCE_TOUCHPAD: ::std::os::raw::c_uint = 1048584; pub const AINPUT_SOURCE_TOUCH_NAVIGATION: ::std::os::raw::c_uint = 2097152; pub const AINPUT_SOURCE_JOYSTICK: ::std::os::raw::c_uint = 16777232; -pub const AINPUT_SOURCE_HDMI: ::std::os::raw::c_uint = 33554433; -pub const AINPUT_SOURCE_SENSOR: ::std::os::raw::c_uint = 67108864; pub const AINPUT_SOURCE_ROTARY_ENCODER: ::std::os::raw::c_uint = 4194304; pub const AINPUT_SOURCE_ANY: ::std::os::raw::c_uint = 4294967040; pub type _bindgen_ty_18 = ::std::os::raw::c_uint; @@ -1818,9 +1638,6 @@ extern "C" { extern "C" { pub fn AInputEvent_getSource(event: *const AInputEvent) -> i32; } -extern "C" { - pub fn AInputEvent_release(event: *const AInputEvent); -} extern "C" { pub fn AKeyEvent_getAction(key_event: *const AInputEvent) -> i32; } @@ -1845,9 +1662,6 @@ extern "C" { extern "C" { pub fn AKeyEvent_getEventTime(key_event: *const AInputEvent) -> i64; } -extern "C" { - pub fn AKeyEvent_fromJava(env: *mut JNIEnv, keyEvent: jobject) -> *const AInputEvent; -} extern "C" { pub fn AMotionEvent_getAction(motion_event: *const AInputEvent) -> i32; } @@ -2044,15 +1858,6 @@ extern "C" { history_index: size_t, ) -> f32; } -extern "C" { - pub fn AMotionEvent_getActionButton(motion_event: *const AInputEvent) -> i32; -} -extern "C" { - pub fn AMotionEvent_getClassification(motion_event: *const AInputEvent) -> i32; -} -extern "C" { - pub fn AMotionEvent_fromJava(env: *mut JNIEnv, motionEvent: jobject) -> *const AInputEvent; -} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct AInputQueue { @@ -2086,9 +1891,6 @@ extern "C" { handled: ::std::os::raw::c_int, ); } -extern "C" { - pub fn AInputQueue_fromJava(env: *mut JNIEnv, inputQueue: jobject) -> *mut AInputQueue; -} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct imaxdiv_t { @@ -2163,52 +1965,11 @@ extern "C" { ) -> uintmax_t; } pub const ADataSpace_ADATASPACE_UNKNOWN: ADataSpace = 0; -pub const ADataSpace_STANDARD_MASK: ADataSpace = 4128768; -pub const ADataSpace_STANDARD_UNSPECIFIED: ADataSpace = 0; -pub const ADataSpace_STANDARD_BT709: ADataSpace = 65536; -pub const ADataSpace_STANDARD_BT601_625: ADataSpace = 131072; -pub const ADataSpace_STANDARD_BT601_625_UNADJUSTED: ADataSpace = 196608; -pub const ADataSpace_STANDARD_BT601_525: ADataSpace = 262144; -pub const ADataSpace_STANDARD_BT601_525_UNADJUSTED: ADataSpace = 327680; -pub const ADataSpace_STANDARD_BT2020: ADataSpace = 393216; -pub const ADataSpace_STANDARD_BT2020_CONSTANT_LUMINANCE: ADataSpace = 458752; -pub const ADataSpace_STANDARD_BT470M: ADataSpace = 524288; -pub const ADataSpace_STANDARD_FILM: ADataSpace = 589824; -pub const ADataSpace_STANDARD_DCI_P3: ADataSpace = 655360; -pub const ADataSpace_STANDARD_ADOBE_RGB: ADataSpace = 720896; -pub const ADataSpace_TRANSFER_MASK: ADataSpace = 130023424; -pub const ADataSpace_TRANSFER_UNSPECIFIED: ADataSpace = 0; -pub const ADataSpace_TRANSFER_LINEAR: ADataSpace = 4194304; -pub const ADataSpace_TRANSFER_SRGB: ADataSpace = 8388608; -pub const ADataSpace_TRANSFER_SMPTE_170M: ADataSpace = 12582912; -pub const ADataSpace_TRANSFER_GAMMA2_2: ADataSpace = 16777216; -pub const ADataSpace_TRANSFER_GAMMA2_6: ADataSpace = 20971520; -pub const ADataSpace_TRANSFER_GAMMA2_8: ADataSpace = 25165824; -pub const ADataSpace_TRANSFER_ST2084: ADataSpace = 29360128; -pub const ADataSpace_TRANSFER_HLG: ADataSpace = 33554432; -pub const ADataSpace_RANGE_MASK: ADataSpace = 939524096; -pub const ADataSpace_RANGE_UNSPECIFIED: ADataSpace = 0; -pub const ADataSpace_RANGE_FULL: ADataSpace = 134217728; -pub const ADataSpace_RANGE_LIMITED: ADataSpace = 268435456; -pub const ADataSpace_RANGE_EXTENDED: ADataSpace = 402653184; pub const ADataSpace_ADATASPACE_SCRGB_LINEAR: ADataSpace = 406913024; pub const ADataSpace_ADATASPACE_SRGB: ADataSpace = 142671872; pub const ADataSpace_ADATASPACE_SCRGB: ADataSpace = 411107328; pub const ADataSpace_ADATASPACE_DISPLAY_P3: ADataSpace = 143261696; pub const ADataSpace_ADATASPACE_BT2020_PQ: ADataSpace = 163971072; -pub const ADataSpace_ADATASPACE_BT2020_ITU_PQ: ADataSpace = 298188800; -pub const ADataSpace_ADATASPACE_ADOBE_RGB: ADataSpace = 151715840; -pub const ADataSpace_ADATASPACE_JFIF: ADataSpace = 146931712; -pub const ADataSpace_ADATASPACE_BT601_625: ADataSpace = 281149440; -pub const ADataSpace_ADATASPACE_BT601_525: ADataSpace = 281280512; -pub const ADataSpace_ADATASPACE_BT2020: ADataSpace = 147193856; -pub const ADataSpace_ADATASPACE_BT709: ADataSpace = 281083904; -pub const ADataSpace_ADATASPACE_DCI_P3: ADataSpace = 155844608; -pub const ADataSpace_ADATASPACE_SRGB_LINEAR: ADataSpace = 138477568; -pub const ADataSpace_ADATASPACE_BT2020_HLG: ADataSpace = 168165376; -pub const ADataSpace_ADATASPACE_BT2020_ITU_HLG: ADataSpace = 302383104; -pub const ADataSpace_DEPTH: ADataSpace = 4096; -pub const ADataSpace_DYNAMIC_DEPTH: ADataSpace = 4098; pub type ADataSpace = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -2289,8 +2050,6 @@ pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_D32_FLOAT_S8_UINT: AHard 52; pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_S8_UINT: AHardwareBuffer_Format = 53; pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_Y8Cb8Cr8_420: AHardwareBuffer_Format = 35; -pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_YCbCr_P010: AHardwareBuffer_Format = 54; -pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_R8_UNORM: AHardwareBuffer_Format = 56; pub type AHardwareBuffer_Format = ::std::os::raw::c_uint; pub const AHardwareBuffer_UsageFlags_AHARDWAREBUFFER_USAGE_CPU_READ_NEVER: AHardwareBuffer_UsageFlags = 0; @@ -2599,6 +2358,15 @@ extern "C" { outVirtualAddress: *mut *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } +extern "C" { + pub fn AHardwareBuffer_lockPlanes( + buffer: *mut AHardwareBuffer, + usage: u64, + fence: i32, + rect: *const ARect, + outPlanes: *mut AHardwareBuffer_Planes, + ) -> ::std::os::raw::c_int; +} extern "C" { pub fn AHardwareBuffer_unlock( buffer: *mut AHardwareBuffer, @@ -2617,15 +2385,6 @@ extern "C" { outBuffer: *mut *mut AHardwareBuffer, ) -> ::std::os::raw::c_int; } -extern "C" { - pub fn AHardwareBuffer_lockPlanes( - buffer: *mut AHardwareBuffer, - usage: u64, - fence: i32, - rect: *const ARect, - outPlanes: *mut AHardwareBuffer_Planes, - ) -> ::std::os::raw::c_int; -} extern "C" { pub fn AHardwareBuffer_isSupported(desc: *const AHardwareBuffer_Desc) -> ::std::os::raw::c_int; } @@ -2640,11 +2399,157 @@ extern "C" { outBytesPerStride: *mut i32, ) -> ::std::os::raw::c_int; } -extern "C" { - pub fn AHardwareBuffer_getId( - buffer: *const AHardwareBuffer, - outId: *mut u64, - ) -> ::std::os::raw::c_int; +pub type va_list = u32; +pub type __gnuc_va_list = u32; +#[repr(C)] +pub struct JavaVMAttachArgs { + pub version: jint, + pub name: *const ::std::os::raw::c_char, + pub group: jobject, +} +#[test] +fn bindgen_test_layout_JavaVMAttachArgs() { + assert_eq!( + ::std::mem::size_of::(), + 12usize, + concat!("Size of: ", stringify!(JavaVMAttachArgs)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(JavaVMAttachArgs)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).version as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(JavaVMAttachArgs), + "::", + stringify!(version) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).name as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(JavaVMAttachArgs), + "::", + stringify!(name) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).group as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(JavaVMAttachArgs), + "::", + stringify!(group) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct JavaVMOption { + pub optionString: *const ::std::os::raw::c_char, + pub extraInfo: *mut ::std::os::raw::c_void, +} +#[test] +fn bindgen_test_layout_JavaVMOption() { + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(JavaVMOption)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(JavaVMOption)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).optionString as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(JavaVMOption), + "::", + stringify!(optionString) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).extraInfo as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(JavaVMOption), + "::", + stringify!(extraInfo) + ) + ); +} +#[repr(C)] +pub struct JavaVMInitArgs { + pub version: jint, + pub nOptions: jint, + pub options: *mut JavaVMOption, + pub ignoreUnrecognized: jboolean, +} +#[test] +fn bindgen_test_layout_JavaVMInitArgs() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(JavaVMInitArgs)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(JavaVMInitArgs)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).version as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(JavaVMInitArgs), + "::", + stringify!(version) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nOptions as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(JavaVMInitArgs), + "::", + stringify!(nOptions) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).options as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(JavaVMInitArgs), + "::", + stringify!(options) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).ignoreUnrecognized as *const _ as usize + }, + 12usize, + concat!( + "Offset of field: ", + stringify!(JavaVMInitArgs), + "::", + stringify!(ignoreUnrecognized) + ) + ); } pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_CAPTION_BAR: GameCommonInsetsType = 0; pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_DISPLAY_CUTOUT: GameCommonInsetsType = 1; @@ -5171,11 +5076,9 @@ pub struct __sifields__bindgen_ty_5 { #[repr(C)] #[derive(Copy, Clone)] pub union __sifields__bindgen_ty_5__bindgen_ty_1 { - pub _trapno: ::std::os::raw::c_int, pub _addr_lsb: ::std::os::raw::c_short, pub _addr_bnd: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1, pub _addr_pkey: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2, - pub _perf: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3, } #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -5293,57 +5196,6 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2() { ) ); } -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3 { - pub _data: ::std::os::raw::c_ulong, - pub _type: __u32, -} -#[test] -fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3() { - assert_eq!( - ::std::mem::size_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3>(), - 8usize, - concat!( - "Size of: ", - stringify!(__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3) - ) - ); - assert_eq!( - ::std::mem::align_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3>(), - 4usize, - concat!( - "Alignment of ", - stringify!(__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3>()))._data - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3), - "::", - stringify!(_data) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3>()))._type - as *const _ as usize - }, - 4usize, - concat!( - "Offset of field: ", - stringify!(__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3), - "::", - stringify!(_type) - ) - ); -} #[test] fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1() { assert_eq!( @@ -5362,19 +5214,6 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1() { stringify!(__sifields__bindgen_ty_5__bindgen_ty_1) ) ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1>()))._trapno as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__sifields__bindgen_ty_5__bindgen_ty_1), - "::", - stringify!(_trapno) - ) - ); assert_eq!( unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1>()))._addr_lsb as *const _ @@ -5414,19 +5253,6 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1() { stringify!(_addr_pkey) ) ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1>()))._perf as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__sifields__bindgen_ty_5__bindgen_ty_1), - "::", - stringify!(_perf) - ) - ); } #[test] fn bindgen_test_layout___sifields__bindgen_ty_5() { @@ -7201,40 +7027,40 @@ fn bindgen_test_layout___kernel_itimerspec() { } #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct __kernel_old_timespec { - pub tv_sec: __kernel_old_time_t, - pub tv_nsec: ::std::os::raw::c_long, +pub struct __kernel_old_timeval { + pub tv_sec: __kernel_long_t, + pub tv_usec: __kernel_long_t, } #[test] -fn bindgen_test_layout___kernel_old_timespec() { +fn bindgen_test_layout___kernel_old_timeval() { assert_eq!( - ::std::mem::size_of::<__kernel_old_timespec>(), + ::std::mem::size_of::<__kernel_old_timeval>(), 8usize, - concat!("Size of: ", stringify!(__kernel_old_timespec)) + concat!("Size of: ", stringify!(__kernel_old_timeval)) ); assert_eq!( - ::std::mem::align_of::<__kernel_old_timespec>(), + ::std::mem::align_of::<__kernel_old_timeval>(), 4usize, - concat!("Alignment of ", stringify!(__kernel_old_timespec)) + concat!("Alignment of ", stringify!(__kernel_old_timeval)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_old_timespec>())).tv_sec as *const _ as usize }, + unsafe { &(*(::std::ptr::null::<__kernel_old_timeval>())).tv_sec as *const _ as usize }, 0usize, concat!( "Offset of field: ", - stringify!(__kernel_old_timespec), + stringify!(__kernel_old_timeval), "::", stringify!(tv_sec) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_old_timespec>())).tv_nsec as *const _ as usize }, + unsafe { &(*(::std::ptr::null::<__kernel_old_timeval>())).tv_usec as *const _ as usize }, 4usize, concat!( "Offset of field: ", - stringify!(__kernel_old_timespec), + stringify!(__kernel_old_timeval), "::", - stringify!(tv_nsec) + stringify!(tv_usec) ) ); } @@ -7280,7 +7106,7 @@ fn bindgen_test_layout___kernel_sock_timeval() { #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct timeval { - pub tv_sec: __kernel_old_time_t, + pub tv_sec: __kernel_time_t, pub tv_usec: __kernel_suseconds_t, } #[test] @@ -7318,6 +7144,45 @@ fn bindgen_test_layout_timeval() { } #[repr(C)] #[derive(Debug, Copy, Clone)] +pub struct timezone { + pub tz_minuteswest: ::std::os::raw::c_int, + pub tz_dsttime: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_timezone() { + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(timezone)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(timezone)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tz_minuteswest as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(timezone), + "::", + stringify!(tz_minuteswest) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tz_dsttime as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(timezone), + "::", + stringify!(tz_dsttime) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] pub struct itimerspec { pub it_interval: timespec, pub it_value: timespec, @@ -7394,45 +7259,6 @@ fn bindgen_test_layout_itimerval() { ) ); } -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct timezone { - pub tz_minuteswest: ::std::os::raw::c_int, - pub tz_dsttime: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_timezone() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(timezone)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(timezone)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).tz_minuteswest as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(timezone), - "::", - stringify!(tz_minuteswest) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).tz_dsttime as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(timezone), - "::", - stringify!(tz_dsttime) - ) - ); -} pub type fd_mask = ::std::os::raw::c_ulong; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -7477,7 +7303,7 @@ extern "C" { } extern "C" { pub fn select( - __max_fd_plus_one: ::std::os::raw::c_int, + __fd_count: ::std::os::raw::c_int, __read_fds: *mut fd_set, __write_fds: *mut fd_set, __exception_fds: *mut fd_set, @@ -7486,7 +7312,7 @@ extern "C" { } extern "C" { pub fn pselect( - __max_fd_plus_one: ::std::os::raw::c_int, + __fd_count: ::std::os::raw::c_int, __read_fds: *mut fd_set, __write_fds: *mut fd_set, __exception_fds: *mut fd_set, @@ -7496,7 +7322,7 @@ extern "C" { } extern "C" { pub fn pselect64( - __max_fd_plus_one: ::std::os::raw::c_int, + __fd_count: ::std::os::raw::c_int, __read_fds: *mut fd_set, __write_fds: *mut fd_set, __exception_fds: *mut fd_set, @@ -7856,15 +7682,12 @@ pub struct clone_args { pub stack: __u64, pub stack_size: __u64, pub tls: __u64, - pub set_tid: __u64, - pub set_tid_size: __u64, - pub cgroup: __u64, } #[test] fn bindgen_test_layout_clone_args() { assert_eq!( ::std::mem::size_of::(), - 88usize, + 64usize, concat!("Size of: ", stringify!(clone_args)) ); assert_eq!( @@ -7952,36 +7775,6 @@ fn bindgen_test_layout_clone_args() { stringify!(tls) ) ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).set_tid as *const _ as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(clone_args), - "::", - stringify!(set_tid) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).set_tid_size as *const _ as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(clone_args), - "::", - stringify!(set_tid_size) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).cgroup as *const _ as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(clone_args), - "::", - stringify!(cgroup) - ) - ); } #[repr(C)] #[derive(Debug, Copy, Clone)] diff --git a/android-activity/src/game_activity/ffi_i686.rs b/android-activity/src/game_activity/ffi_i686.rs index 4fc5a56..31fedac 100644 --- a/android-activity/src/game_activity/ffi_i686.rs +++ b/android-activity/src/game_activity/ffi_i686.rs @@ -21,13 +21,10 @@ pub const __ANDROID_API_O_MR1__: u32 = 27; pub const __ANDROID_API_P__: u32 = 28; pub const __ANDROID_API_Q__: u32 = 29; pub const __ANDROID_API_R__: u32 = 30; -pub const __ANDROID_API_S__: u32 = 31; -pub const __ANDROID_API_T__: u32 = 33; -pub const __ANDROID_NDK__: u32 = 1; -pub const __NDK_MAJOR__: u32 = 25; -pub const __NDK_MINOR__: u32 = 0; +pub const __NDK_MAJOR__: u32 = 21; +pub const __NDK_MINOR__: u32 = 1; pub const __NDK_BETA__: u32 = 0; -pub const __NDK_BUILD__: u32 = 8775105; +pub const __NDK_BUILD__: u32 = 6352462; pub const __NDK_CANARY__: u32 = 0; pub const INT8_MIN: i32 = -128; pub const INT8_MAX: u32 = 127; @@ -65,11 +62,7 @@ pub const PTRDIFF_MAX: u32 = 2147483647; pub const SIZE_MAX: u32 = 4294967295; pub const __BITS_PER_LONG: u32 = 32; pub const __FD_SETSIZE: u32 = 1024; -pub const __GNUC_VA_LIST: u32 = 1; pub const AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT: u32 = 8; -pub const true_: u32 = 1; -pub const false_: u32 = 0; -pub const __bool_true_false_are_defined: u32 = 1; pub const __PRI_64_prefix: &[u8; 3usize] = b"ll\0"; pub const PRId8: &[u8; 2usize] = b"d\0"; pub const PRId16: &[u8; 2usize] = b"d\0"; @@ -192,6 +185,10 @@ pub const SCNxLEAST64: &[u8; 4usize] = b"llx\0"; pub const SCNxFAST8: &[u8; 4usize] = b"hhx\0"; pub const SCNxFAST64: &[u8; 4usize] = b"llx\0"; pub const SCNxMAX: &[u8; 3usize] = b"jx\0"; +pub const __GNUC_VA_LIST: u32 = 1; +pub const true_: u32 = 1; +pub const false_: u32 = 0; +pub const __bool_true_false_are_defined: u32 = 1; pub const GAME_ACTIVITY_POINTER_INFO_AXIS_COUNT: u32 = 48; pub const GAMEACTIVITY_MAX_NUM_POINTERS_IN_MOTION_EVENT: u32 = 8; pub const GAMEACTIVITY_MAX_NUM_HISTORICAL_IN_MOTION_EVENT: u32 = 8; @@ -438,20 +435,18 @@ pub const SIGPWR: u32 = 30; pub const SIGSYS: u32 = 31; pub const SIGUNUSED: u32 = 31; pub const __SIGRTMIN: u32 = 32; -pub const SA_RESTORER: u32 = 67108864; -pub const MINSIGSTKSZ: u32 = 2048; -pub const SIGSTKSZ: u32 = 8192; pub const SA_NOCLDSTOP: u32 = 1; pub const SA_NOCLDWAIT: u32 = 2; pub const SA_SIGINFO: u32 = 4; -pub const SA_UNSUPPORTED: u32 = 1024; -pub const SA_EXPOSE_TAGBITS: u32 = 2048; pub const SA_ONSTACK: u32 = 134217728; pub const SA_RESTART: u32 = 268435456; pub const SA_NODEFER: u32 = 1073741824; pub const SA_RESETHAND: u32 = 2147483648; pub const SA_NOMASK: u32 = 1073741824; pub const SA_ONESHOT: u32 = 2147483648; +pub const SA_RESTORER: u32 = 67108864; +pub const MINSIGSTKSZ: u32 = 2048; +pub const SIGSTKSZ: u32 = 8192; pub const SIG_BLOCK: u32 = 0; pub const SIG_UNBLOCK: u32 = 1; pub const SIG_SETMASK: u32 = 2; @@ -501,9 +496,7 @@ pub const SEGV_PKUERR: u32 = 4; pub const SEGV_ACCADI: u32 = 5; pub const SEGV_ADIDERR: u32 = 6; pub const SEGV_ADIPERR: u32 = 7; -pub const SEGV_MTEAERR: u32 = 8; -pub const SEGV_MTESERR: u32 = 9; -pub const NSIGSEGV: u32 = 9; +pub const NSIGSEGV: u32 = 7; pub const BUS_ADRALN: u32 = 1; pub const BUS_ADRERR: u32 = 2; pub const BUS_OBJERR: u32 = 3; @@ -515,8 +508,7 @@ pub const TRAP_TRACE: u32 = 2; pub const TRAP_BRANCH: u32 = 3; pub const TRAP_HWBKPT: u32 = 4; pub const TRAP_UNK: u32 = 5; -pub const TRAP_PERF: u32 = 6; -pub const NSIGTRAP: u32 = 6; +pub const NSIGTRAP: u32 = 5; pub const CLD_EXITED: u32 = 1; pub const CLD_KILLED: u32 = 2; pub const CLD_DUMPED: u32 = 3; @@ -532,8 +524,7 @@ pub const POLL_PRI: u32 = 5; pub const POLL_HUP: u32 = 6; pub const NSIGPOLL: u32 = 6; pub const SYS_SECCOMP: u32 = 1; -pub const SYS_USER_DISPATCH: u32 = 2; -pub const NSIGSYS: u32 = 2; +pub const NSIGSYS: u32 = 1; pub const EMT_TAGOVF: u32 = 1; pub const NSIGEMT: u32 = 1; pub const SIGEV_SIGNAL: u32 = 0; @@ -579,12 +570,6 @@ pub const CLONE_NEWUSER: u32 = 268435456; pub const CLONE_NEWPID: u32 = 536870912; pub const CLONE_NEWNET: u32 = 1073741824; pub const CLONE_IO: u32 = 2147483648; -pub const CLONE_CLEAR_SIGHAND: u64 = 4294967296; -pub const CLONE_INTO_CGROUP: u64 = 8589934592; -pub const CLONE_NEWTIME: u32 = 128; -pub const CLONE_ARGS_SIZE_VER0: u32 = 64; -pub const CLONE_ARGS_SIZE_VER1: u32 = 80; -pub const CLONE_ARGS_SIZE_VER2: u32 = 88; pub const SCHED_NORMAL: u32 = 0; pub const SCHED_FIFO: u32 = 1; pub const SCHED_RR: u32 = 2; @@ -788,7 +773,6 @@ fn bindgen_test_layout___kernel_fsid_t() { } pub type __kernel_off_t = __kernel_long_t; pub type __kernel_loff_t = ::std::os::raw::c_longlong; -pub type __kernel_old_time_t = __kernel_long_t; pub type __kernel_time_t = __kernel_long_t; pub type __kernel_time64_t = ::std::os::raw::c_longlong; pub type __kernel_clock_t = __kernel_long_t; @@ -1396,158 +1380,6 @@ pub const ALOOPER_EVENT_ERROR: ::std::os::raw::c_uint = 4; pub const ALOOPER_EVENT_HANGUP: ::std::os::raw::c_uint = 8; pub const ALOOPER_EVENT_INVALID: ::std::os::raw::c_uint = 16; pub type _bindgen_ty_5 = ::std::os::raw::c_uint; -pub type va_list = __builtin_va_list; -pub type __gnuc_va_list = __builtin_va_list; -#[repr(C)] -pub struct JavaVMAttachArgs { - pub version: jint, - pub name: *const ::std::os::raw::c_char, - pub group: jobject, -} -#[test] -fn bindgen_test_layout_JavaVMAttachArgs() { - assert_eq!( - ::std::mem::size_of::(), - 12usize, - concat!("Size of: ", stringify!(JavaVMAttachArgs)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(JavaVMAttachArgs)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).version as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JavaVMAttachArgs), - "::", - stringify!(version) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).name as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(JavaVMAttachArgs), - "::", - stringify!(name) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).group as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(JavaVMAttachArgs), - "::", - stringify!(group) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct JavaVMOption { - pub optionString: *const ::std::os::raw::c_char, - pub extraInfo: *mut ::std::os::raw::c_void, -} -#[test] -fn bindgen_test_layout_JavaVMOption() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(JavaVMOption)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(JavaVMOption)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).optionString as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JavaVMOption), - "::", - stringify!(optionString) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).extraInfo as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(JavaVMOption), - "::", - stringify!(extraInfo) - ) - ); -} -#[repr(C)] -pub struct JavaVMInitArgs { - pub version: jint, - pub nOptions: jint, - pub options: *mut JavaVMOption, - pub ignoreUnrecognized: jboolean, -} -#[test] -fn bindgen_test_layout_JavaVMInitArgs() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(JavaVMInitArgs)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(JavaVMInitArgs)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).version as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JavaVMInitArgs), - "::", - stringify!(version) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).nOptions as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(JavaVMInitArgs), - "::", - stringify!(nOptions) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).options as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(JavaVMInitArgs), - "::", - stringify!(options) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ignoreUnrecognized as *const _ as usize - }, - 12usize, - concat!( - "Offset of field: ", - stringify!(JavaVMInitArgs), - "::", - stringify!(ignoreUnrecognized) - ) - ); -} pub const AKEY_STATE_UNKNOWN: ::std::os::raw::c_int = -1; pub const AKEY_STATE_UP: ::std::os::raw::c_int = 0; pub const AKEY_STATE_DOWN: ::std::os::raw::c_int = 1; @@ -1579,10 +1411,6 @@ pub struct AInputEvent { } pub const AINPUT_EVENT_TYPE_KEY: ::std::os::raw::c_uint = 1; pub const AINPUT_EVENT_TYPE_MOTION: ::std::os::raw::c_uint = 2; -pub const AINPUT_EVENT_TYPE_FOCUS: ::std::os::raw::c_uint = 3; -pub const AINPUT_EVENT_TYPE_CAPTURE: ::std::os::raw::c_uint = 4; -pub const AINPUT_EVENT_TYPE_DRAG: ::std::os::raw::c_uint = 5; -pub const AINPUT_EVENT_TYPE_TOUCH_MODE: ::std::os::raw::c_uint = 6; pub type _bindgen_ty_8 = ::std::os::raw::c_uint; pub const AKEY_EVENT_ACTION_DOWN: ::std::os::raw::c_uint = 0; pub const AKEY_EVENT_ACTION_UP: ::std::os::raw::c_uint = 1; @@ -1683,13 +1511,7 @@ pub const AMOTION_EVENT_TOOL_TYPE_FINGER: ::std::os::raw::c_uint = 1; pub const AMOTION_EVENT_TOOL_TYPE_STYLUS: ::std::os::raw::c_uint = 2; pub const AMOTION_EVENT_TOOL_TYPE_MOUSE: ::std::os::raw::c_uint = 3; pub const AMOTION_EVENT_TOOL_TYPE_ERASER: ::std::os::raw::c_uint = 4; -pub const AMOTION_EVENT_TOOL_TYPE_PALM: ::std::os::raw::c_uint = 5; pub type _bindgen_ty_16 = ::std::os::raw::c_uint; -pub const AMotionClassification_AMOTION_EVENT_CLASSIFICATION_NONE: AMotionClassification = 0; -pub const AMotionClassification_AMOTION_EVENT_CLASSIFICATION_AMBIGUOUS_GESTURE: - AMotionClassification = 1; -pub const AMotionClassification_AMOTION_EVENT_CLASSIFICATION_DEEP_PRESS: AMotionClassification = 2; -pub type AMotionClassification = u32; pub const AINPUT_SOURCE_CLASS_MASK: ::std::os::raw::c_uint = 255; pub const AINPUT_SOURCE_CLASS_NONE: ::std::os::raw::c_uint = 0; pub const AINPUT_SOURCE_CLASS_BUTTON: ::std::os::raw::c_uint = 1; @@ -1711,8 +1533,6 @@ pub const AINPUT_SOURCE_MOUSE_RELATIVE: ::std::os::raw::c_uint = 131076; pub const AINPUT_SOURCE_TOUCHPAD: ::std::os::raw::c_uint = 1048584; pub const AINPUT_SOURCE_TOUCH_NAVIGATION: ::std::os::raw::c_uint = 2097152; pub const AINPUT_SOURCE_JOYSTICK: ::std::os::raw::c_uint = 16777232; -pub const AINPUT_SOURCE_HDMI: ::std::os::raw::c_uint = 33554433; -pub const AINPUT_SOURCE_SENSOR: ::std::os::raw::c_uint = 67108864; pub const AINPUT_SOURCE_ROTARY_ENCODER: ::std::os::raw::c_uint = 4194304; pub const AINPUT_SOURCE_ANY: ::std::os::raw::c_uint = 4294967040; pub type _bindgen_ty_18 = ::std::os::raw::c_uint; @@ -1739,9 +1559,6 @@ extern "C" { extern "C" { pub fn AInputEvent_getSource(event: *const AInputEvent) -> i32; } -extern "C" { - pub fn AInputEvent_release(event: *const AInputEvent); -} extern "C" { pub fn AKeyEvent_getAction(key_event: *const AInputEvent) -> i32; } @@ -1766,9 +1583,6 @@ extern "C" { extern "C" { pub fn AKeyEvent_getEventTime(key_event: *const AInputEvent) -> i64; } -extern "C" { - pub fn AKeyEvent_fromJava(env: *mut JNIEnv, keyEvent: jobject) -> *const AInputEvent; -} extern "C" { pub fn AMotionEvent_getAction(motion_event: *const AInputEvent) -> i32; } @@ -1965,15 +1779,6 @@ extern "C" { history_index: size_t, ) -> f32; } -extern "C" { - pub fn AMotionEvent_getActionButton(motion_event: *const AInputEvent) -> i32; -} -extern "C" { - pub fn AMotionEvent_getClassification(motion_event: *const AInputEvent) -> i32; -} -extern "C" { - pub fn AMotionEvent_fromJava(env: *mut JNIEnv, motionEvent: jobject) -> *const AInputEvent; -} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct AInputQueue { @@ -2007,9 +1812,6 @@ extern "C" { handled: ::std::os::raw::c_int, ); } -extern "C" { - pub fn AInputQueue_fromJava(env: *mut JNIEnv, inputQueue: jobject) -> *mut AInputQueue; -} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct imaxdiv_t { @@ -2084,52 +1886,11 @@ extern "C" { ) -> uintmax_t; } pub const ADataSpace_ADATASPACE_UNKNOWN: ADataSpace = 0; -pub const ADataSpace_STANDARD_MASK: ADataSpace = 4128768; -pub const ADataSpace_STANDARD_UNSPECIFIED: ADataSpace = 0; -pub const ADataSpace_STANDARD_BT709: ADataSpace = 65536; -pub const ADataSpace_STANDARD_BT601_625: ADataSpace = 131072; -pub const ADataSpace_STANDARD_BT601_625_UNADJUSTED: ADataSpace = 196608; -pub const ADataSpace_STANDARD_BT601_525: ADataSpace = 262144; -pub const ADataSpace_STANDARD_BT601_525_UNADJUSTED: ADataSpace = 327680; -pub const ADataSpace_STANDARD_BT2020: ADataSpace = 393216; -pub const ADataSpace_STANDARD_BT2020_CONSTANT_LUMINANCE: ADataSpace = 458752; -pub const ADataSpace_STANDARD_BT470M: ADataSpace = 524288; -pub const ADataSpace_STANDARD_FILM: ADataSpace = 589824; -pub const ADataSpace_STANDARD_DCI_P3: ADataSpace = 655360; -pub const ADataSpace_STANDARD_ADOBE_RGB: ADataSpace = 720896; -pub const ADataSpace_TRANSFER_MASK: ADataSpace = 130023424; -pub const ADataSpace_TRANSFER_UNSPECIFIED: ADataSpace = 0; -pub const ADataSpace_TRANSFER_LINEAR: ADataSpace = 4194304; -pub const ADataSpace_TRANSFER_SRGB: ADataSpace = 8388608; -pub const ADataSpace_TRANSFER_SMPTE_170M: ADataSpace = 12582912; -pub const ADataSpace_TRANSFER_GAMMA2_2: ADataSpace = 16777216; -pub const ADataSpace_TRANSFER_GAMMA2_6: ADataSpace = 20971520; -pub const ADataSpace_TRANSFER_GAMMA2_8: ADataSpace = 25165824; -pub const ADataSpace_TRANSFER_ST2084: ADataSpace = 29360128; -pub const ADataSpace_TRANSFER_HLG: ADataSpace = 33554432; -pub const ADataSpace_RANGE_MASK: ADataSpace = 939524096; -pub const ADataSpace_RANGE_UNSPECIFIED: ADataSpace = 0; -pub const ADataSpace_RANGE_FULL: ADataSpace = 134217728; -pub const ADataSpace_RANGE_LIMITED: ADataSpace = 268435456; -pub const ADataSpace_RANGE_EXTENDED: ADataSpace = 402653184; pub const ADataSpace_ADATASPACE_SCRGB_LINEAR: ADataSpace = 406913024; pub const ADataSpace_ADATASPACE_SRGB: ADataSpace = 142671872; pub const ADataSpace_ADATASPACE_SCRGB: ADataSpace = 411107328; pub const ADataSpace_ADATASPACE_DISPLAY_P3: ADataSpace = 143261696; pub const ADataSpace_ADATASPACE_BT2020_PQ: ADataSpace = 163971072; -pub const ADataSpace_ADATASPACE_BT2020_ITU_PQ: ADataSpace = 298188800; -pub const ADataSpace_ADATASPACE_ADOBE_RGB: ADataSpace = 151715840; -pub const ADataSpace_ADATASPACE_JFIF: ADataSpace = 146931712; -pub const ADataSpace_ADATASPACE_BT601_625: ADataSpace = 281149440; -pub const ADataSpace_ADATASPACE_BT601_525: ADataSpace = 281280512; -pub const ADataSpace_ADATASPACE_BT2020: ADataSpace = 147193856; -pub const ADataSpace_ADATASPACE_BT709: ADataSpace = 281083904; -pub const ADataSpace_ADATASPACE_DCI_P3: ADataSpace = 155844608; -pub const ADataSpace_ADATASPACE_SRGB_LINEAR: ADataSpace = 138477568; -pub const ADataSpace_ADATASPACE_BT2020_HLG: ADataSpace = 168165376; -pub const ADataSpace_ADATASPACE_BT2020_ITU_HLG: ADataSpace = 302383104; -pub const ADataSpace_DEPTH: ADataSpace = 4096; -pub const ADataSpace_DYNAMIC_DEPTH: ADataSpace = 4098; pub type ADataSpace = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -2210,8 +1971,6 @@ pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_D32_FLOAT_S8_UINT: AHard 52; pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_S8_UINT: AHardwareBuffer_Format = 53; pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_Y8Cb8Cr8_420: AHardwareBuffer_Format = 35; -pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_YCbCr_P010: AHardwareBuffer_Format = 54; -pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_R8_UNORM: AHardwareBuffer_Format = 56; pub type AHardwareBuffer_Format = ::std::os::raw::c_uint; pub const AHardwareBuffer_UsageFlags_AHARDWAREBUFFER_USAGE_CPU_READ_NEVER: AHardwareBuffer_UsageFlags = 0; @@ -2520,6 +2279,15 @@ extern "C" { outVirtualAddress: *mut *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } +extern "C" { + pub fn AHardwareBuffer_lockPlanes( + buffer: *mut AHardwareBuffer, + usage: u64, + fence: i32, + rect: *const ARect, + outPlanes: *mut AHardwareBuffer_Planes, + ) -> ::std::os::raw::c_int; +} extern "C" { pub fn AHardwareBuffer_unlock( buffer: *mut AHardwareBuffer, @@ -2538,15 +2306,6 @@ extern "C" { outBuffer: *mut *mut AHardwareBuffer, ) -> ::std::os::raw::c_int; } -extern "C" { - pub fn AHardwareBuffer_lockPlanes( - buffer: *mut AHardwareBuffer, - usage: u64, - fence: i32, - rect: *const ARect, - outPlanes: *mut AHardwareBuffer_Planes, - ) -> ::std::os::raw::c_int; -} extern "C" { pub fn AHardwareBuffer_isSupported(desc: *const AHardwareBuffer_Desc) -> ::std::os::raw::c_int; } @@ -2561,11 +2320,157 @@ extern "C" { outBytesPerStride: *mut i32, ) -> ::std::os::raw::c_int; } -extern "C" { - pub fn AHardwareBuffer_getId( - buffer: *const AHardwareBuffer, - outId: *mut u64, - ) -> ::std::os::raw::c_int; +pub type va_list = __builtin_va_list; +pub type __gnuc_va_list = __builtin_va_list; +#[repr(C)] +pub struct JavaVMAttachArgs { + pub version: jint, + pub name: *const ::std::os::raw::c_char, + pub group: jobject, +} +#[test] +fn bindgen_test_layout_JavaVMAttachArgs() { + assert_eq!( + ::std::mem::size_of::(), + 12usize, + concat!("Size of: ", stringify!(JavaVMAttachArgs)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(JavaVMAttachArgs)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).version as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(JavaVMAttachArgs), + "::", + stringify!(version) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).name as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(JavaVMAttachArgs), + "::", + stringify!(name) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).group as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(JavaVMAttachArgs), + "::", + stringify!(group) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct JavaVMOption { + pub optionString: *const ::std::os::raw::c_char, + pub extraInfo: *mut ::std::os::raw::c_void, +} +#[test] +fn bindgen_test_layout_JavaVMOption() { + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(JavaVMOption)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(JavaVMOption)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).optionString as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(JavaVMOption), + "::", + stringify!(optionString) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).extraInfo as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(JavaVMOption), + "::", + stringify!(extraInfo) + ) + ); +} +#[repr(C)] +pub struct JavaVMInitArgs { + pub version: jint, + pub nOptions: jint, + pub options: *mut JavaVMOption, + pub ignoreUnrecognized: jboolean, +} +#[test] +fn bindgen_test_layout_JavaVMInitArgs() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(JavaVMInitArgs)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(JavaVMInitArgs)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).version as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(JavaVMInitArgs), + "::", + stringify!(version) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nOptions as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(JavaVMInitArgs), + "::", + stringify!(nOptions) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).options as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(JavaVMInitArgs), + "::", + stringify!(options) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).ignoreUnrecognized as *const _ as usize + }, + 12usize, + concat!( + "Offset of field: ", + stringify!(JavaVMInitArgs), + "::", + stringify!(ignoreUnrecognized) + ) + ); } pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_CAPTION_BAR: GameCommonInsetsType = 0; pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_DISPLAY_CUTOUT: GameCommonInsetsType = 1; @@ -6205,40 +6110,40 @@ fn bindgen_test_layout___kernel_itimerspec() { } #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct __kernel_old_timespec { - pub tv_sec: __kernel_old_time_t, - pub tv_nsec: ::std::os::raw::c_long, +pub struct __kernel_old_timeval { + pub tv_sec: __kernel_long_t, + pub tv_usec: __kernel_long_t, } #[test] -fn bindgen_test_layout___kernel_old_timespec() { +fn bindgen_test_layout___kernel_old_timeval() { assert_eq!( - ::std::mem::size_of::<__kernel_old_timespec>(), + ::std::mem::size_of::<__kernel_old_timeval>(), 8usize, - concat!("Size of: ", stringify!(__kernel_old_timespec)) + concat!("Size of: ", stringify!(__kernel_old_timeval)) ); assert_eq!( - ::std::mem::align_of::<__kernel_old_timespec>(), + ::std::mem::align_of::<__kernel_old_timeval>(), 4usize, - concat!("Alignment of ", stringify!(__kernel_old_timespec)) + concat!("Alignment of ", stringify!(__kernel_old_timeval)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_old_timespec>())).tv_sec as *const _ as usize }, + unsafe { &(*(::std::ptr::null::<__kernel_old_timeval>())).tv_sec as *const _ as usize }, 0usize, concat!( "Offset of field: ", - stringify!(__kernel_old_timespec), + stringify!(__kernel_old_timeval), "::", stringify!(tv_sec) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_old_timespec>())).tv_nsec as *const _ as usize }, + unsafe { &(*(::std::ptr::null::<__kernel_old_timeval>())).tv_usec as *const _ as usize }, 4usize, concat!( "Offset of field: ", - stringify!(__kernel_old_timespec), + stringify!(__kernel_old_timeval), "::", - stringify!(tv_nsec) + stringify!(tv_usec) ) ); } @@ -6284,7 +6189,7 @@ fn bindgen_test_layout___kernel_sock_timeval() { #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct timespec { - pub tv_sec: __kernel_old_time_t, + pub tv_sec: __kernel_time_t, pub tv_nsec: ::std::os::raw::c_long, } #[test] @@ -6323,7 +6228,7 @@ fn bindgen_test_layout_timespec() { #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct timeval { - pub tv_sec: __kernel_old_time_t, + pub tv_sec: __kernel_time_t, pub tv_usec: __kernel_suseconds_t, } #[test] @@ -6361,6 +6266,45 @@ fn bindgen_test_layout_timeval() { } #[repr(C)] #[derive(Debug, Copy, Clone)] +pub struct timezone { + pub tz_minuteswest: ::std::os::raw::c_int, + pub tz_dsttime: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_timezone() { + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(timezone)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(timezone)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tz_minuteswest as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(timezone), + "::", + stringify!(tz_minuteswest) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tz_dsttime as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(timezone), + "::", + stringify!(tz_dsttime) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] pub struct itimerspec { pub it_interval: timespec, pub it_value: timespec, @@ -6437,45 +6381,6 @@ fn bindgen_test_layout_itimerval() { ) ); } -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct timezone { - pub tz_minuteswest: ::std::os::raw::c_int, - pub tz_dsttime: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_timezone() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(timezone)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(timezone)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).tz_minuteswest as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(timezone), - "::", - stringify!(tz_minuteswest) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).tz_dsttime as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(timezone), - "::", - stringify!(tz_dsttime) - ) - ); -} pub type sigset_t = ::std::os::raw::c_ulong; pub type __signalfn_t = ::std::option::Option; pub type __sighandler_t = __signalfn_t; @@ -6939,11 +6844,9 @@ pub struct __sifields__bindgen_ty_5 { #[repr(C)] #[derive(Copy, Clone)] pub union __sifields__bindgen_ty_5__bindgen_ty_1 { - pub _trapno: ::std::os::raw::c_int, pub _addr_lsb: ::std::os::raw::c_short, pub _addr_bnd: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1, pub _addr_pkey: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2, - pub _perf: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3, } #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -7061,57 +6964,6 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2() { ) ); } -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3 { - pub _data: ::std::os::raw::c_ulong, - pub _type: __u32, -} -#[test] -fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3() { - assert_eq!( - ::std::mem::size_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3>(), - 8usize, - concat!( - "Size of: ", - stringify!(__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3) - ) - ); - assert_eq!( - ::std::mem::align_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3>(), - 4usize, - concat!( - "Alignment of ", - stringify!(__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3>()))._data - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3), - "::", - stringify!(_data) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3>()))._type - as *const _ as usize - }, - 4usize, - concat!( - "Offset of field: ", - stringify!(__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3), - "::", - stringify!(_type) - ) - ); -} #[test] fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1() { assert_eq!( @@ -7130,19 +6982,6 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1() { stringify!(__sifields__bindgen_ty_5__bindgen_ty_1) ) ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1>()))._trapno as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__sifields__bindgen_ty_5__bindgen_ty_1), - "::", - stringify!(_trapno) - ) - ); assert_eq!( unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1>()))._addr_lsb as *const _ @@ -7182,19 +7021,6 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1() { stringify!(_addr_pkey) ) ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1>()))._perf as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__sifields__bindgen_ty_5__bindgen_ty_1), - "::", - stringify!(_perf) - ) - ); } #[test] fn bindgen_test_layout___sifields__bindgen_ty_5() { @@ -9221,7 +9047,7 @@ extern "C" { } extern "C" { pub fn select( - __max_fd_plus_one: ::std::os::raw::c_int, + __fd_count: ::std::os::raw::c_int, __read_fds: *mut fd_set, __write_fds: *mut fd_set, __exception_fds: *mut fd_set, @@ -9230,7 +9056,7 @@ extern "C" { } extern "C" { pub fn pselect( - __max_fd_plus_one: ::std::os::raw::c_int, + __fd_count: ::std::os::raw::c_int, __read_fds: *mut fd_set, __write_fds: *mut fd_set, __exception_fds: *mut fd_set, @@ -9240,7 +9066,7 @@ extern "C" { } extern "C" { pub fn pselect64( - __max_fd_plus_one: ::std::os::raw::c_int, + __fd_count: ::std::os::raw::c_int, __read_fds: *mut fd_set, __write_fds: *mut fd_set, __exception_fds: *mut fd_set, @@ -9601,15 +9427,12 @@ pub struct clone_args { pub stack: __u64, pub stack_size: __u64, pub tls: __u64, - pub set_tid: __u64, - pub set_tid_size: __u64, - pub cgroup: __u64, } #[test] fn bindgen_test_layout_clone_args() { assert_eq!( ::std::mem::size_of::(), - 88usize, + 64usize, concat!("Size of: ", stringify!(clone_args)) ); assert_eq!( @@ -9697,36 +9520,6 @@ fn bindgen_test_layout_clone_args() { stringify!(tls) ) ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).set_tid as *const _ as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(clone_args), - "::", - stringify!(set_tid) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).set_tid_size as *const _ as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(clone_args), - "::", - stringify!(set_tid_size) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).cgroup as *const _ as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(clone_args), - "::", - stringify!(cgroup) - ) - ); } #[repr(C)] #[derive(Debug, Copy, Clone)] diff --git a/android-activity/src/game_activity/ffi_x86_64.rs b/android-activity/src/game_activity/ffi_x86_64.rs index e5a2b88..2bedc9b 100644 --- a/android-activity/src/game_activity/ffi_x86_64.rs +++ b/android-activity/src/game_activity/ffi_x86_64.rs @@ -21,13 +21,10 @@ pub const __ANDROID_API_O_MR1__: u32 = 27; pub const __ANDROID_API_P__: u32 = 28; pub const __ANDROID_API_Q__: u32 = 29; pub const __ANDROID_API_R__: u32 = 30; -pub const __ANDROID_API_S__: u32 = 31; -pub const __ANDROID_API_T__: u32 = 33; -pub const __ANDROID_NDK__: u32 = 1; -pub const __NDK_MAJOR__: u32 = 25; -pub const __NDK_MINOR__: u32 = 0; +pub const __NDK_MAJOR__: u32 = 21; +pub const __NDK_MINOR__: u32 = 1; pub const __NDK_BETA__: u32 = 0; -pub const __NDK_BUILD__: u32 = 8775105; +pub const __NDK_BUILD__: u32 = 6352462; pub const __NDK_CANARY__: u32 = 0; pub const INT8_MIN: i32 = -128; pub const INT8_MAX: u32 = 127; @@ -59,11 +56,7 @@ pub const WINT_MAX: u32 = 4294967295; pub const WINT_MIN: u32 = 0; pub const __BITS_PER_LONG: u32 = 64; pub const __FD_SETSIZE: u32 = 1024; -pub const __GNUC_VA_LIST: u32 = 1; pub const AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT: u32 = 8; -pub const true_: u32 = 1; -pub const false_: u32 = 0; -pub const __bool_true_false_are_defined: u32 = 1; pub const __PRI_64_prefix: &[u8; 2usize] = b"l\0"; pub const __PRI_PTR_prefix: &[u8; 2usize] = b"l\0"; pub const __PRI_FAST_prefix: &[u8; 2usize] = b"l\0"; @@ -221,6 +214,10 @@ pub const SCNxFAST32: &[u8; 3usize] = b"lx\0"; pub const SCNxFAST64: &[u8; 3usize] = b"lx\0"; pub const SCNxMAX: &[u8; 3usize] = b"jx\0"; pub const SCNxPTR: &[u8; 3usize] = b"lx\0"; +pub const __GNUC_VA_LIST: u32 = 1; +pub const true_: u32 = 1; +pub const false_: u32 = 0; +pub const __bool_true_false_are_defined: u32 = 1; pub const GAME_ACTIVITY_POINTER_INFO_AXIS_COUNT: u32 = 48; pub const GAMEACTIVITY_MAX_NUM_POINTERS_IN_MOTION_EVENT: u32 = 8; pub const GAMEACTIVITY_MAX_NUM_HISTORICAL_IN_MOTION_EVENT: u32 = 8; @@ -467,20 +464,18 @@ pub const SIGPWR: u32 = 30; pub const SIGSYS: u32 = 31; pub const SIGUNUSED: u32 = 31; pub const __SIGRTMIN: u32 = 32; -pub const SA_RESTORER: u32 = 67108864; -pub const MINSIGSTKSZ: u32 = 2048; -pub const SIGSTKSZ: u32 = 8192; pub const SA_NOCLDSTOP: u32 = 1; pub const SA_NOCLDWAIT: u32 = 2; pub const SA_SIGINFO: u32 = 4; -pub const SA_UNSUPPORTED: u32 = 1024; -pub const SA_EXPOSE_TAGBITS: u32 = 2048; pub const SA_ONSTACK: u32 = 134217728; pub const SA_RESTART: u32 = 268435456; pub const SA_NODEFER: u32 = 1073741824; pub const SA_RESETHAND: u32 = 2147483648; pub const SA_NOMASK: u32 = 1073741824; pub const SA_ONESHOT: u32 = 2147483648; +pub const SA_RESTORER: u32 = 67108864; +pub const MINSIGSTKSZ: u32 = 2048; +pub const SIGSTKSZ: u32 = 8192; pub const SIG_BLOCK: u32 = 0; pub const SIG_UNBLOCK: u32 = 1; pub const SIG_SETMASK: u32 = 2; @@ -530,9 +525,7 @@ pub const SEGV_PKUERR: u32 = 4; pub const SEGV_ACCADI: u32 = 5; pub const SEGV_ADIDERR: u32 = 6; pub const SEGV_ADIPERR: u32 = 7; -pub const SEGV_MTEAERR: u32 = 8; -pub const SEGV_MTESERR: u32 = 9; -pub const NSIGSEGV: u32 = 9; +pub const NSIGSEGV: u32 = 7; pub const BUS_ADRALN: u32 = 1; pub const BUS_ADRERR: u32 = 2; pub const BUS_OBJERR: u32 = 3; @@ -544,8 +537,7 @@ pub const TRAP_TRACE: u32 = 2; pub const TRAP_BRANCH: u32 = 3; pub const TRAP_HWBKPT: u32 = 4; pub const TRAP_UNK: u32 = 5; -pub const TRAP_PERF: u32 = 6; -pub const NSIGTRAP: u32 = 6; +pub const NSIGTRAP: u32 = 5; pub const CLD_EXITED: u32 = 1; pub const CLD_KILLED: u32 = 2; pub const CLD_DUMPED: u32 = 3; @@ -561,8 +553,7 @@ pub const POLL_PRI: u32 = 5; pub const POLL_HUP: u32 = 6; pub const NSIGPOLL: u32 = 6; pub const SYS_SECCOMP: u32 = 1; -pub const SYS_USER_DISPATCH: u32 = 2; -pub const NSIGSYS: u32 = 2; +pub const NSIGSYS: u32 = 1; pub const EMT_TAGOVF: u32 = 1; pub const NSIGEMT: u32 = 1; pub const SIGEV_SIGNAL: u32 = 0; @@ -607,12 +598,6 @@ pub const CLONE_NEWUSER: u32 = 268435456; pub const CLONE_NEWPID: u32 = 536870912; pub const CLONE_NEWNET: u32 = 1073741824; pub const CLONE_IO: u32 = 2147483648; -pub const CLONE_CLEAR_SIGHAND: u64 = 4294967296; -pub const CLONE_INTO_CGROUP: u64 = 8589934592; -pub const CLONE_NEWTIME: u32 = 128; -pub const CLONE_ARGS_SIZE_VER0: u32 = 64; -pub const CLONE_ARGS_SIZE_VER1: u32 = 80; -pub const CLONE_ARGS_SIZE_VER2: u32 = 88; pub const SCHED_NORMAL: u32 = 0; pub const SCHED_FIFO: u32 = 1; pub const SCHED_RR: u32 = 2; @@ -817,7 +802,6 @@ fn bindgen_test_layout___kernel_fsid_t() { } pub type __kernel_off_t = __kernel_long_t; pub type __kernel_loff_t = ::std::os::raw::c_longlong; -pub type __kernel_old_time_t = __kernel_long_t; pub type __kernel_time_t = __kernel_long_t; pub type __kernel_time64_t = ::std::os::raw::c_longlong; pub type __kernel_clock_t = __kernel_long_t; @@ -1436,158 +1420,6 @@ pub const ALOOPER_EVENT_ERROR: ::std::os::raw::c_uint = 4; pub const ALOOPER_EVENT_HANGUP: ::std::os::raw::c_uint = 8; pub const ALOOPER_EVENT_INVALID: ::std::os::raw::c_uint = 16; pub type _bindgen_ty_5 = ::std::os::raw::c_uint; -pub type va_list = __builtin_va_list; -pub type __gnuc_va_list = __builtin_va_list; -#[repr(C)] -pub struct JavaVMAttachArgs { - pub version: jint, - pub name: *const ::std::os::raw::c_char, - pub group: jobject, -} -#[test] -fn bindgen_test_layout_JavaVMAttachArgs() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(JavaVMAttachArgs)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(JavaVMAttachArgs)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).version as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JavaVMAttachArgs), - "::", - stringify!(version) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).name as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(JavaVMAttachArgs), - "::", - stringify!(name) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).group as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(JavaVMAttachArgs), - "::", - stringify!(group) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct JavaVMOption { - pub optionString: *const ::std::os::raw::c_char, - pub extraInfo: *mut ::std::os::raw::c_void, -} -#[test] -fn bindgen_test_layout_JavaVMOption() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(JavaVMOption)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(JavaVMOption)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).optionString as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JavaVMOption), - "::", - stringify!(optionString) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).extraInfo as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(JavaVMOption), - "::", - stringify!(extraInfo) - ) - ); -} -#[repr(C)] -pub struct JavaVMInitArgs { - pub version: jint, - pub nOptions: jint, - pub options: *mut JavaVMOption, - pub ignoreUnrecognized: jboolean, -} -#[test] -fn bindgen_test_layout_JavaVMInitArgs() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(JavaVMInitArgs)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(JavaVMInitArgs)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).version as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JavaVMInitArgs), - "::", - stringify!(version) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).nOptions as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(JavaVMInitArgs), - "::", - stringify!(nOptions) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).options as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(JavaVMInitArgs), - "::", - stringify!(options) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ignoreUnrecognized as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(JavaVMInitArgs), - "::", - stringify!(ignoreUnrecognized) - ) - ); -} pub const AKEY_STATE_UNKNOWN: ::std::os::raw::c_int = -1; pub const AKEY_STATE_UP: ::std::os::raw::c_int = 0; pub const AKEY_STATE_DOWN: ::std::os::raw::c_int = 1; @@ -1619,10 +1451,6 @@ pub struct AInputEvent { } pub const AINPUT_EVENT_TYPE_KEY: ::std::os::raw::c_uint = 1; pub const AINPUT_EVENT_TYPE_MOTION: ::std::os::raw::c_uint = 2; -pub const AINPUT_EVENT_TYPE_FOCUS: ::std::os::raw::c_uint = 3; -pub const AINPUT_EVENT_TYPE_CAPTURE: ::std::os::raw::c_uint = 4; -pub const AINPUT_EVENT_TYPE_DRAG: ::std::os::raw::c_uint = 5; -pub const AINPUT_EVENT_TYPE_TOUCH_MODE: ::std::os::raw::c_uint = 6; pub type _bindgen_ty_8 = ::std::os::raw::c_uint; pub const AKEY_EVENT_ACTION_DOWN: ::std::os::raw::c_uint = 0; pub const AKEY_EVENT_ACTION_UP: ::std::os::raw::c_uint = 1; @@ -1723,13 +1551,7 @@ pub const AMOTION_EVENT_TOOL_TYPE_FINGER: ::std::os::raw::c_uint = 1; pub const AMOTION_EVENT_TOOL_TYPE_STYLUS: ::std::os::raw::c_uint = 2; pub const AMOTION_EVENT_TOOL_TYPE_MOUSE: ::std::os::raw::c_uint = 3; pub const AMOTION_EVENT_TOOL_TYPE_ERASER: ::std::os::raw::c_uint = 4; -pub const AMOTION_EVENT_TOOL_TYPE_PALM: ::std::os::raw::c_uint = 5; pub type _bindgen_ty_16 = ::std::os::raw::c_uint; -pub const AMotionClassification_AMOTION_EVENT_CLASSIFICATION_NONE: AMotionClassification = 0; -pub const AMotionClassification_AMOTION_EVENT_CLASSIFICATION_AMBIGUOUS_GESTURE: - AMotionClassification = 1; -pub const AMotionClassification_AMOTION_EVENT_CLASSIFICATION_DEEP_PRESS: AMotionClassification = 2; -pub type AMotionClassification = u32; pub const AINPUT_SOURCE_CLASS_MASK: ::std::os::raw::c_uint = 255; pub const AINPUT_SOURCE_CLASS_NONE: ::std::os::raw::c_uint = 0; pub const AINPUT_SOURCE_CLASS_BUTTON: ::std::os::raw::c_uint = 1; @@ -1751,8 +1573,6 @@ pub const AINPUT_SOURCE_MOUSE_RELATIVE: ::std::os::raw::c_uint = 131076; pub const AINPUT_SOURCE_TOUCHPAD: ::std::os::raw::c_uint = 1048584; pub const AINPUT_SOURCE_TOUCH_NAVIGATION: ::std::os::raw::c_uint = 2097152; pub const AINPUT_SOURCE_JOYSTICK: ::std::os::raw::c_uint = 16777232; -pub const AINPUT_SOURCE_HDMI: ::std::os::raw::c_uint = 33554433; -pub const AINPUT_SOURCE_SENSOR: ::std::os::raw::c_uint = 67108864; pub const AINPUT_SOURCE_ROTARY_ENCODER: ::std::os::raw::c_uint = 4194304; pub const AINPUT_SOURCE_ANY: ::std::os::raw::c_uint = 4294967040; pub type _bindgen_ty_18 = ::std::os::raw::c_uint; @@ -1779,9 +1599,6 @@ extern "C" { extern "C" { pub fn AInputEvent_getSource(event: *const AInputEvent) -> i32; } -extern "C" { - pub fn AInputEvent_release(event: *const AInputEvent); -} extern "C" { pub fn AKeyEvent_getAction(key_event: *const AInputEvent) -> i32; } @@ -1806,9 +1623,6 @@ extern "C" { extern "C" { pub fn AKeyEvent_getEventTime(key_event: *const AInputEvent) -> i64; } -extern "C" { - pub fn AKeyEvent_fromJava(env: *mut JNIEnv, keyEvent: jobject) -> *const AInputEvent; -} extern "C" { pub fn AMotionEvent_getAction(motion_event: *const AInputEvent) -> i32; } @@ -2005,15 +1819,6 @@ extern "C" { history_index: size_t, ) -> f32; } -extern "C" { - pub fn AMotionEvent_getActionButton(motion_event: *const AInputEvent) -> i32; -} -extern "C" { - pub fn AMotionEvent_getClassification(motion_event: *const AInputEvent) -> i32; -} -extern "C" { - pub fn AMotionEvent_fromJava(env: *mut JNIEnv, motionEvent: jobject) -> *const AInputEvent; -} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct AInputQueue { @@ -2047,9 +1852,6 @@ extern "C" { handled: ::std::os::raw::c_int, ); } -extern "C" { - pub fn AInputQueue_fromJava(env: *mut JNIEnv, inputQueue: jobject) -> *mut AInputQueue; -} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct imaxdiv_t { @@ -2124,52 +1926,11 @@ extern "C" { ) -> uintmax_t; } pub const ADataSpace_ADATASPACE_UNKNOWN: ADataSpace = 0; -pub const ADataSpace_STANDARD_MASK: ADataSpace = 4128768; -pub const ADataSpace_STANDARD_UNSPECIFIED: ADataSpace = 0; -pub const ADataSpace_STANDARD_BT709: ADataSpace = 65536; -pub const ADataSpace_STANDARD_BT601_625: ADataSpace = 131072; -pub const ADataSpace_STANDARD_BT601_625_UNADJUSTED: ADataSpace = 196608; -pub const ADataSpace_STANDARD_BT601_525: ADataSpace = 262144; -pub const ADataSpace_STANDARD_BT601_525_UNADJUSTED: ADataSpace = 327680; -pub const ADataSpace_STANDARD_BT2020: ADataSpace = 393216; -pub const ADataSpace_STANDARD_BT2020_CONSTANT_LUMINANCE: ADataSpace = 458752; -pub const ADataSpace_STANDARD_BT470M: ADataSpace = 524288; -pub const ADataSpace_STANDARD_FILM: ADataSpace = 589824; -pub const ADataSpace_STANDARD_DCI_P3: ADataSpace = 655360; -pub const ADataSpace_STANDARD_ADOBE_RGB: ADataSpace = 720896; -pub const ADataSpace_TRANSFER_MASK: ADataSpace = 130023424; -pub const ADataSpace_TRANSFER_UNSPECIFIED: ADataSpace = 0; -pub const ADataSpace_TRANSFER_LINEAR: ADataSpace = 4194304; -pub const ADataSpace_TRANSFER_SRGB: ADataSpace = 8388608; -pub const ADataSpace_TRANSFER_SMPTE_170M: ADataSpace = 12582912; -pub const ADataSpace_TRANSFER_GAMMA2_2: ADataSpace = 16777216; -pub const ADataSpace_TRANSFER_GAMMA2_6: ADataSpace = 20971520; -pub const ADataSpace_TRANSFER_GAMMA2_8: ADataSpace = 25165824; -pub const ADataSpace_TRANSFER_ST2084: ADataSpace = 29360128; -pub const ADataSpace_TRANSFER_HLG: ADataSpace = 33554432; -pub const ADataSpace_RANGE_MASK: ADataSpace = 939524096; -pub const ADataSpace_RANGE_UNSPECIFIED: ADataSpace = 0; -pub const ADataSpace_RANGE_FULL: ADataSpace = 134217728; -pub const ADataSpace_RANGE_LIMITED: ADataSpace = 268435456; -pub const ADataSpace_RANGE_EXTENDED: ADataSpace = 402653184; pub const ADataSpace_ADATASPACE_SCRGB_LINEAR: ADataSpace = 406913024; pub const ADataSpace_ADATASPACE_SRGB: ADataSpace = 142671872; pub const ADataSpace_ADATASPACE_SCRGB: ADataSpace = 411107328; pub const ADataSpace_ADATASPACE_DISPLAY_P3: ADataSpace = 143261696; pub const ADataSpace_ADATASPACE_BT2020_PQ: ADataSpace = 163971072; -pub const ADataSpace_ADATASPACE_BT2020_ITU_PQ: ADataSpace = 298188800; -pub const ADataSpace_ADATASPACE_ADOBE_RGB: ADataSpace = 151715840; -pub const ADataSpace_ADATASPACE_JFIF: ADataSpace = 146931712; -pub const ADataSpace_ADATASPACE_BT601_625: ADataSpace = 281149440; -pub const ADataSpace_ADATASPACE_BT601_525: ADataSpace = 281280512; -pub const ADataSpace_ADATASPACE_BT2020: ADataSpace = 147193856; -pub const ADataSpace_ADATASPACE_BT709: ADataSpace = 281083904; -pub const ADataSpace_ADATASPACE_DCI_P3: ADataSpace = 155844608; -pub const ADataSpace_ADATASPACE_SRGB_LINEAR: ADataSpace = 138477568; -pub const ADataSpace_ADATASPACE_BT2020_HLG: ADataSpace = 168165376; -pub const ADataSpace_ADATASPACE_BT2020_ITU_HLG: ADataSpace = 302383104; -pub const ADataSpace_DEPTH: ADataSpace = 4096; -pub const ADataSpace_DYNAMIC_DEPTH: ADataSpace = 4098; pub type ADataSpace = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -2250,8 +2011,6 @@ pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_D32_FLOAT_S8_UINT: AHard 52; pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_S8_UINT: AHardwareBuffer_Format = 53; pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_Y8Cb8Cr8_420: AHardwareBuffer_Format = 35; -pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_YCbCr_P010: AHardwareBuffer_Format = 54; -pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_R8_UNORM: AHardwareBuffer_Format = 56; pub type AHardwareBuffer_Format = ::std::os::raw::c_uint; pub const AHardwareBuffer_UsageFlags_AHARDWAREBUFFER_USAGE_CPU_READ_NEVER: AHardwareBuffer_UsageFlags = 0; @@ -2560,6 +2319,15 @@ extern "C" { outVirtualAddress: *mut *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } +extern "C" { + pub fn AHardwareBuffer_lockPlanes( + buffer: *mut AHardwareBuffer, + usage: u64, + fence: i32, + rect: *const ARect, + outPlanes: *mut AHardwareBuffer_Planes, + ) -> ::std::os::raw::c_int; +} extern "C" { pub fn AHardwareBuffer_unlock( buffer: *mut AHardwareBuffer, @@ -2578,15 +2346,6 @@ extern "C" { outBuffer: *mut *mut AHardwareBuffer, ) -> ::std::os::raw::c_int; } -extern "C" { - pub fn AHardwareBuffer_lockPlanes( - buffer: *mut AHardwareBuffer, - usage: u64, - fence: i32, - rect: *const ARect, - outPlanes: *mut AHardwareBuffer_Planes, - ) -> ::std::os::raw::c_int; -} extern "C" { pub fn AHardwareBuffer_isSupported(desc: *const AHardwareBuffer_Desc) -> ::std::os::raw::c_int; } @@ -2601,11 +2360,157 @@ extern "C" { outBytesPerStride: *mut i32, ) -> ::std::os::raw::c_int; } -extern "C" { - pub fn AHardwareBuffer_getId( - buffer: *const AHardwareBuffer, - outId: *mut u64, - ) -> ::std::os::raw::c_int; +pub type va_list = __builtin_va_list; +pub type __gnuc_va_list = __builtin_va_list; +#[repr(C)] +pub struct JavaVMAttachArgs { + pub version: jint, + pub name: *const ::std::os::raw::c_char, + pub group: jobject, +} +#[test] +fn bindgen_test_layout_JavaVMAttachArgs() { + assert_eq!( + ::std::mem::size_of::(), + 24usize, + concat!("Size of: ", stringify!(JavaVMAttachArgs)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(JavaVMAttachArgs)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).version as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(JavaVMAttachArgs), + "::", + stringify!(version) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).name as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(JavaVMAttachArgs), + "::", + stringify!(name) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).group as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(JavaVMAttachArgs), + "::", + stringify!(group) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct JavaVMOption { + pub optionString: *const ::std::os::raw::c_char, + pub extraInfo: *mut ::std::os::raw::c_void, +} +#[test] +fn bindgen_test_layout_JavaVMOption() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(JavaVMOption)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(JavaVMOption)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).optionString as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(JavaVMOption), + "::", + stringify!(optionString) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).extraInfo as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(JavaVMOption), + "::", + stringify!(extraInfo) + ) + ); +} +#[repr(C)] +pub struct JavaVMInitArgs { + pub version: jint, + pub nOptions: jint, + pub options: *mut JavaVMOption, + pub ignoreUnrecognized: jboolean, +} +#[test] +fn bindgen_test_layout_JavaVMInitArgs() { + assert_eq!( + ::std::mem::size_of::(), + 24usize, + concat!("Size of: ", stringify!(JavaVMInitArgs)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(JavaVMInitArgs)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).version as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(JavaVMInitArgs), + "::", + stringify!(version) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nOptions as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(JavaVMInitArgs), + "::", + stringify!(nOptions) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).options as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(JavaVMInitArgs), + "::", + stringify!(options) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).ignoreUnrecognized as *const _ as usize + }, + 16usize, + concat!( + "Offset of field: ", + stringify!(JavaVMInitArgs), + "::", + stringify!(ignoreUnrecognized) + ) + ); } pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_CAPTION_BAR: GameCommonInsetsType = 0; pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_DISPLAY_CUTOUT: GameCommonInsetsType = 1; @@ -6274,40 +6179,40 @@ fn bindgen_test_layout___kernel_itimerspec() { } #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct __kernel_old_timespec { - pub tv_sec: __kernel_old_time_t, - pub tv_nsec: ::std::os::raw::c_long, +pub struct __kernel_old_timeval { + pub tv_sec: __kernel_long_t, + pub tv_usec: __kernel_long_t, } #[test] -fn bindgen_test_layout___kernel_old_timespec() { +fn bindgen_test_layout___kernel_old_timeval() { assert_eq!( - ::std::mem::size_of::<__kernel_old_timespec>(), + ::std::mem::size_of::<__kernel_old_timeval>(), 16usize, - concat!("Size of: ", stringify!(__kernel_old_timespec)) + concat!("Size of: ", stringify!(__kernel_old_timeval)) ); assert_eq!( - ::std::mem::align_of::<__kernel_old_timespec>(), + ::std::mem::align_of::<__kernel_old_timeval>(), 8usize, - concat!("Alignment of ", stringify!(__kernel_old_timespec)) + concat!("Alignment of ", stringify!(__kernel_old_timeval)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_old_timespec>())).tv_sec as *const _ as usize }, + unsafe { &(*(::std::ptr::null::<__kernel_old_timeval>())).tv_sec as *const _ as usize }, 0usize, concat!( "Offset of field: ", - stringify!(__kernel_old_timespec), + stringify!(__kernel_old_timeval), "::", stringify!(tv_sec) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_old_timespec>())).tv_nsec as *const _ as usize }, + unsafe { &(*(::std::ptr::null::<__kernel_old_timeval>())).tv_usec as *const _ as usize }, 8usize, concat!( "Offset of field: ", - stringify!(__kernel_old_timespec), + stringify!(__kernel_old_timeval), "::", - stringify!(tv_nsec) + stringify!(tv_usec) ) ); } @@ -6353,7 +6258,7 @@ fn bindgen_test_layout___kernel_sock_timeval() { #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct timespec { - pub tv_sec: __kernel_old_time_t, + pub tv_sec: __kernel_time_t, pub tv_nsec: ::std::os::raw::c_long, } #[test] @@ -6392,7 +6297,7 @@ fn bindgen_test_layout_timespec() { #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct timeval { - pub tv_sec: __kernel_old_time_t, + pub tv_sec: __kernel_time_t, pub tv_usec: __kernel_suseconds_t, } #[test] @@ -6430,6 +6335,45 @@ fn bindgen_test_layout_timeval() { } #[repr(C)] #[derive(Debug, Copy, Clone)] +pub struct timezone { + pub tz_minuteswest: ::std::os::raw::c_int, + pub tz_dsttime: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_timezone() { + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(timezone)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(timezone)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tz_minuteswest as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(timezone), + "::", + stringify!(tz_minuteswest) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tz_dsttime as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(timezone), + "::", + stringify!(tz_dsttime) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] pub struct itimerspec { pub it_interval: timespec, pub it_value: timespec, @@ -6506,45 +6450,6 @@ fn bindgen_test_layout_itimerval() { ) ); } -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct timezone { - pub tz_minuteswest: ::std::os::raw::c_int, - pub tz_dsttime: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_timezone() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(timezone)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(timezone)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).tz_minuteswest as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(timezone), - "::", - stringify!(tz_minuteswest) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).tz_dsttime as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(timezone), - "::", - stringify!(tz_dsttime) - ) - ); -} pub type sigset_t = ::std::os::raw::c_ulong; pub type __signalfn_t = ::std::option::Option; pub type __sighandler_t = __signalfn_t; @@ -6954,11 +6859,9 @@ pub struct __sifields__bindgen_ty_5 { #[repr(C)] #[derive(Copy, Clone)] pub union __sifields__bindgen_ty_5__bindgen_ty_1 { - pub _trapno: ::std::os::raw::c_int, pub _addr_lsb: ::std::os::raw::c_short, pub _addr_bnd: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1, pub _addr_pkey: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2, - pub _perf: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3, } #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -7076,57 +6979,6 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2() { ) ); } -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3 { - pub _data: ::std::os::raw::c_ulong, - pub _type: __u32, -} -#[test] -fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3() { - assert_eq!( - ::std::mem::size_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3>(), - 16usize, - concat!( - "Size of: ", - stringify!(__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3) - ) - ); - assert_eq!( - ::std::mem::align_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3>(), - 8usize, - concat!( - "Alignment of ", - stringify!(__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3>()))._data - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3), - "::", - stringify!(_data) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3>()))._type - as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3), - "::", - stringify!(_type) - ) - ); -} #[test] fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1() { assert_eq!( @@ -7145,19 +6997,6 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1() { stringify!(__sifields__bindgen_ty_5__bindgen_ty_1) ) ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1>()))._trapno as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__sifields__bindgen_ty_5__bindgen_ty_1), - "::", - stringify!(_trapno) - ) - ); assert_eq!( unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1>()))._addr_lsb as *const _ @@ -7197,19 +7036,6 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1() { stringify!(_addr_pkey) ) ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1>()))._perf as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__sifields__bindgen_ty_5__bindgen_ty_1), - "::", - stringify!(_perf) - ) - ); } #[test] fn bindgen_test_layout___sifields__bindgen_ty_5() { @@ -9251,7 +9077,7 @@ extern "C" { } extern "C" { pub fn select( - __max_fd_plus_one: ::std::os::raw::c_int, + __fd_count: ::std::os::raw::c_int, __read_fds: *mut fd_set, __write_fds: *mut fd_set, __exception_fds: *mut fd_set, @@ -9260,7 +9086,7 @@ extern "C" { } extern "C" { pub fn pselect( - __max_fd_plus_one: ::std::os::raw::c_int, + __fd_count: ::std::os::raw::c_int, __read_fds: *mut fd_set, __write_fds: *mut fd_set, __exception_fds: *mut fd_set, @@ -9270,7 +9096,7 @@ extern "C" { } extern "C" { pub fn pselect64( - __max_fd_plus_one: ::std::os::raw::c_int, + __fd_count: ::std::os::raw::c_int, __read_fds: *mut fd_set, __write_fds: *mut fd_set, __exception_fds: *mut fd_set, @@ -9630,15 +9456,12 @@ pub struct clone_args { pub stack: __u64, pub stack_size: __u64, pub tls: __u64, - pub set_tid: __u64, - pub set_tid_size: __u64, - pub cgroup: __u64, } #[test] fn bindgen_test_layout_clone_args() { assert_eq!( ::std::mem::size_of::(), - 88usize, + 64usize, concat!("Size of: ", stringify!(clone_args)) ); assert_eq!( @@ -9726,36 +9549,6 @@ fn bindgen_test_layout_clone_args() { stringify!(tls) ) ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).set_tid as *const _ as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(clone_args), - "::", - stringify!(set_tid) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).set_tid_size as *const _ as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(clone_args), - "::", - stringify!(set_tid_size) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).cgroup as *const _ as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(clone_args), - "::", - stringify!(cgroup) - ) - ); } #[repr(C)] #[derive(Debug, Copy, Clone)] diff --git a/android-activity/src/native_activity/ffi.rs b/android-activity/src/native_activity/ffi.rs index be3e68e..fde83f0 100644 --- a/android-activity/src/native_activity/ffi.rs +++ b/android-activity/src/native_activity/ffi.rs @@ -16,6 +16,7 @@ use jni_sys::*; use ndk_sys::AAssetManager; use ndk_sys::ANativeWindow; use ndk_sys::{AConfiguration, AInputQueue, ALooper}; +use libc::{pthread_t, pthread_mutex_t, pthread_cond_t}; #[cfg(all( any(target_os = "android", feature = "test"), diff --git a/android-activity/src/native_activity/ffi_aarch64.rs b/android-activity/src/native_activity/ffi_aarch64.rs index 4784055..3c9ae42 100644 --- a/android-activity/src/native_activity/ffi_aarch64.rs +++ b/android-activity/src/native_activity/ffi_aarch64.rs @@ -21,13 +21,10 @@ pub const __ANDROID_API_O_MR1__: u32 = 27; pub const __ANDROID_API_P__: u32 = 28; pub const __ANDROID_API_Q__: u32 = 29; pub const __ANDROID_API_R__: u32 = 30; -pub const __ANDROID_API_S__: u32 = 31; -pub const __ANDROID_API_T__: u32 = 33; -pub const __ANDROID_NDK__: u32 = 1; -pub const __NDK_MAJOR__: u32 = 25; -pub const __NDK_MINOR__: u32 = 0; +pub const __NDK_MAJOR__: u32 = 21; +pub const __NDK_MINOR__: u32 = 1; pub const __NDK_BETA__: u32 = 0; -pub const __NDK_BUILD__: u32 = 8775105; +pub const __NDK_BUILD__: u32 = 6352462; pub const __NDK_CANARY__: u32 = 0; pub const POLLIN: u32 = 1; pub const POLLPRI: u32 = 2; @@ -309,8 +306,6 @@ pub const __SIGRTMAX: u32 = 64; pub const SA_NOCLDSTOP: u32 = 1; pub const SA_NOCLDWAIT: u32 = 2; pub const SA_SIGINFO: u32 = 4; -pub const SA_UNSUPPORTED: u32 = 1024; -pub const SA_EXPOSE_TAGBITS: u32 = 2048; pub const SA_ONSTACK: u32 = 134217728; pub const SA_RESTART: u32 = 268435456; pub const SA_NODEFER: u32 = 1073741824; @@ -366,9 +361,7 @@ pub const SEGV_PKUERR: u32 = 4; pub const SEGV_ACCADI: u32 = 5; pub const SEGV_ADIDERR: u32 = 6; pub const SEGV_ADIPERR: u32 = 7; -pub const SEGV_MTEAERR: u32 = 8; -pub const SEGV_MTESERR: u32 = 9; -pub const NSIGSEGV: u32 = 9; +pub const NSIGSEGV: u32 = 7; pub const BUS_ADRALN: u32 = 1; pub const BUS_ADRERR: u32 = 2; pub const BUS_OBJERR: u32 = 3; @@ -380,8 +373,7 @@ pub const TRAP_TRACE: u32 = 2; pub const TRAP_BRANCH: u32 = 3; pub const TRAP_HWBKPT: u32 = 4; pub const TRAP_UNK: u32 = 5; -pub const TRAP_PERF: u32 = 6; -pub const NSIGTRAP: u32 = 6; +pub const NSIGTRAP: u32 = 5; pub const CLD_EXITED: u32 = 1; pub const CLD_KILLED: u32 = 2; pub const CLD_DUMPED: u32 = 3; @@ -397,8 +389,7 @@ pub const POLL_PRI: u32 = 5; pub const POLL_HUP: u32 = 6; pub const NSIGPOLL: u32 = 6; pub const SYS_SECCOMP: u32 = 1; -pub const SYS_USER_DISPATCH: u32 = 2; -pub const NSIGSYS: u32 = 2; +pub const NSIGSYS: u32 = 1; pub const EMT_TAGOVF: u32 = 1; pub const NSIGEMT: u32 = 1; pub const SIGEV_SIGNAL: u32 = 0; @@ -462,12 +453,6 @@ pub const CLONE_NEWUSER: u32 = 268435456; pub const CLONE_NEWPID: u32 = 536870912; pub const CLONE_NEWNET: u32 = 1073741824; pub const CLONE_IO: u32 = 2147483648; -pub const CLONE_CLEAR_SIGHAND: u64 = 4294967296; -pub const CLONE_INTO_CGROUP: u64 = 8589934592; -pub const CLONE_NEWTIME: u32 = 128; -pub const CLONE_ARGS_SIZE_VER0: u32 = 64; -pub const CLONE_ARGS_SIZE_VER1: u32 = 80; -pub const CLONE_ARGS_SIZE_VER2: u32 = 88; pub const SCHED_NORMAL: u32 = 0; pub const SCHED_FIFO: u32 = 1; pub const SCHED_RR: u32 = 2; @@ -501,9 +486,6 @@ pub const PTHREAD_SCOPE_SYSTEM: u32 = 0; pub const PTHREAD_SCOPE_PROCESS: u32 = 1; pub const __GNUC_VA_LIST: u32 = 1; pub const AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT: u32 = 8; -pub const true_: u32 = 1; -pub const false_: u32 = 0; -pub const __bool_true_false_are_defined: u32 = 1; pub const __PRI_64_prefix: &[u8; 2usize] = b"l\0"; pub const __PRI_PTR_prefix: &[u8; 2usize] = b"l\0"; pub const __PRI_FAST_prefix: &[u8; 2usize] = b"l\0"; @@ -880,7 +862,6 @@ fn bindgen_test_layout___kernel_fsid_t() { } pub type __kernel_off_t = __kernel_long_t; pub type __kernel_loff_t = ::std::os::raw::c_longlong; -pub type __kernel_old_time_t = __kernel_long_t; pub type __kernel_time_t = __kernel_long_t; pub type __kernel_time64_t = ::std::os::raw::c_longlong; pub type __kernel_clock_t = __kernel_long_t; @@ -898,247 +879,6 @@ pub type __be64 = __u64; pub type __sum16 = __u16; pub type __wsum = __u32; pub type __poll_t = ::std::os::raw::c_uint; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct pthread_attr_t { - pub flags: u32, - pub stack_base: *mut ::std::os::raw::c_void, - pub stack_size: size_t, - pub guard_size: size_t, - pub sched_policy: i32, - pub sched_priority: i32, - pub __reserved: [::std::os::raw::c_char; 16usize], -} -#[test] -fn bindgen_test_layout_pthread_attr_t() { - assert_eq!( - ::std::mem::size_of::(), - 56usize, - concat!("Size of: ", stringify!(pthread_attr_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(pthread_attr_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_attr_t), - "::", - stringify!(flags) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).stack_base as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(pthread_attr_t), - "::", - stringify!(stack_base) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).stack_size as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(pthread_attr_t), - "::", - stringify!(stack_size) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).guard_size as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(pthread_attr_t), - "::", - stringify!(guard_size) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sched_policy as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(pthread_attr_t), - "::", - stringify!(sched_policy) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sched_priority as *const _ as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(pthread_attr_t), - "::", - stringify!(sched_priority) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).__reserved as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(pthread_attr_t), - "::", - stringify!(__reserved) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct pthread_barrier_t { - pub __private: [i64; 4usize], -} -#[test] -fn bindgen_test_layout_pthread_barrier_t() { - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(pthread_barrier_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(pthread_barrier_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).__private as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_barrier_t), - "::", - stringify!(__private) - ) - ); -} -pub type pthread_barrierattr_t = ::std::os::raw::c_int; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct pthread_cond_t { - pub __private: [i32; 12usize], -} -#[test] -fn bindgen_test_layout_pthread_cond_t() { - assert_eq!( - ::std::mem::size_of::(), - 48usize, - concat!("Size of: ", stringify!(pthread_cond_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(pthread_cond_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).__private as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_cond_t), - "::", - stringify!(__private) - ) - ); -} -pub type pthread_condattr_t = ::std::os::raw::c_long; -pub type pthread_key_t = ::std::os::raw::c_int; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct pthread_mutex_t { - pub __private: [i32; 10usize], -} -#[test] -fn bindgen_test_layout_pthread_mutex_t() { - assert_eq!( - ::std::mem::size_of::(), - 40usize, - concat!("Size of: ", stringify!(pthread_mutex_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(pthread_mutex_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).__private as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_mutex_t), - "::", - stringify!(__private) - ) - ); -} -pub type pthread_mutexattr_t = ::std::os::raw::c_long; -pub type pthread_once_t = ::std::os::raw::c_int; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct pthread_rwlock_t { - pub __private: [i32; 14usize], -} -#[test] -fn bindgen_test_layout_pthread_rwlock_t() { - assert_eq!( - ::std::mem::size_of::(), - 56usize, - concat!("Size of: ", stringify!(pthread_rwlock_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(pthread_rwlock_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).__private as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_rwlock_t), - "::", - stringify!(__private) - ) - ); -} -pub type pthread_rwlockattr_t = ::std::os::raw::c_long; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct pthread_spinlock_t { - pub __private: i64, -} -#[test] -fn bindgen_test_layout_pthread_spinlock_t() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(pthread_spinlock_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(pthread_spinlock_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).__private as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_spinlock_t), - "::", - stringify!(__private) - ) - ); -} -pub type pthread_t = ::std::os::raw::c_long; pub type __gid_t = __kernel_gid32_t; pub type gid_t = __gid_t; pub type __uid_t = __kernel_uid32_t; @@ -1964,11 +1704,9 @@ pub struct __sifields__bindgen_ty_5 { #[repr(C)] #[derive(Copy, Clone)] pub union __sifields__bindgen_ty_5__bindgen_ty_1 { - pub _trapno: ::std::os::raw::c_int, pub _addr_lsb: ::std::os::raw::c_short, pub _addr_bnd: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1, pub _addr_pkey: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2, - pub _perf: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3, } #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -2086,57 +1824,6 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2() { ) ); } -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3 { - pub _data: ::std::os::raw::c_ulong, - pub _type: __u32, -} -#[test] -fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3() { - assert_eq!( - ::std::mem::size_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3>(), - 16usize, - concat!( - "Size of: ", - stringify!(__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3) - ) - ); - assert_eq!( - ::std::mem::align_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3>(), - 8usize, - concat!( - "Alignment of ", - stringify!(__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3>()))._data - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3), - "::", - stringify!(_data) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3>()))._type - as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3), - "::", - stringify!(_type) - ) - ); -} #[test] fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1() { assert_eq!( @@ -2155,19 +1842,6 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1() { stringify!(__sifields__bindgen_ty_5__bindgen_ty_1) ) ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1>()))._trapno as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__sifields__bindgen_ty_5__bindgen_ty_1), - "::", - stringify!(_trapno) - ) - ); assert_eq!( unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1>()))._addr_lsb as *const _ @@ -2207,19 +1881,6 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1() { stringify!(_addr_pkey) ) ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1>()))._perf as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__sifields__bindgen_ty_5__bindgen_ty_1), - "::", - stringify!(_perf) - ) - ); } #[test] fn bindgen_test_layout___sifields__bindgen_ty_5() { @@ -3354,26 +3015,6 @@ extern "C" { extern "C" { pub fn psignal(__signal: ::std::os::raw::c_int, __msg: *const ::std::os::raw::c_char); } -extern "C" { - pub fn pthread_kill( - __pthread: pthread_t, - __signal: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_sigmask( - __how: ::std::os::raw::c_int, - __new_set: *const sigset_t, - __old_set: *mut sigset_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_sigmask64( - __how: ::std::os::raw::c_int, - __new_set: *const sigset64_t, - __old_set: *mut sigset64_t, - ) -> ::std::os::raw::c_int; -} extern "C" { pub fn sigqueue( __pid: pid_t, @@ -3482,40 +3123,40 @@ fn bindgen_test_layout___kernel_itimerspec() { } #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct __kernel_old_timespec { - pub tv_sec: __kernel_old_time_t, - pub tv_nsec: ::std::os::raw::c_long, +pub struct __kernel_old_timeval { + pub tv_sec: __kernel_long_t, + pub tv_usec: __kernel_long_t, } #[test] -fn bindgen_test_layout___kernel_old_timespec() { +fn bindgen_test_layout___kernel_old_timeval() { assert_eq!( - ::std::mem::size_of::<__kernel_old_timespec>(), + ::std::mem::size_of::<__kernel_old_timeval>(), 16usize, - concat!("Size of: ", stringify!(__kernel_old_timespec)) + concat!("Size of: ", stringify!(__kernel_old_timeval)) ); assert_eq!( - ::std::mem::align_of::<__kernel_old_timespec>(), + ::std::mem::align_of::<__kernel_old_timeval>(), 8usize, - concat!("Alignment of ", stringify!(__kernel_old_timespec)) + concat!("Alignment of ", stringify!(__kernel_old_timeval)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_old_timespec>())).tv_sec as *const _ as usize }, + unsafe { &(*(::std::ptr::null::<__kernel_old_timeval>())).tv_sec as *const _ as usize }, 0usize, concat!( "Offset of field: ", - stringify!(__kernel_old_timespec), + stringify!(__kernel_old_timeval), "::", stringify!(tv_sec) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_old_timespec>())).tv_nsec as *const _ as usize }, + unsafe { &(*(::std::ptr::null::<__kernel_old_timeval>())).tv_usec as *const _ as usize }, 8usize, concat!( "Offset of field: ", - stringify!(__kernel_old_timespec), + stringify!(__kernel_old_timeval), "::", - stringify!(tv_nsec) + stringify!(tv_usec) ) ); } @@ -3561,7 +3202,7 @@ fn bindgen_test_layout___kernel_sock_timeval() { #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct timeval { - pub tv_sec: __kernel_old_time_t, + pub tv_sec: __kernel_time_t, pub tv_usec: __kernel_suseconds_t, } #[test] @@ -3599,6 +3240,45 @@ fn bindgen_test_layout_timeval() { } #[repr(C)] #[derive(Debug, Copy, Clone)] +pub struct timezone { + pub tz_minuteswest: ::std::os::raw::c_int, + pub tz_dsttime: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_timezone() { + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(timezone)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(timezone)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tz_minuteswest as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(timezone), + "::", + stringify!(tz_minuteswest) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tz_dsttime as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(timezone), + "::", + stringify!(tz_dsttime) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] pub struct itimerspec { pub it_interval: timespec, pub it_value: timespec, @@ -3675,45 +3355,6 @@ fn bindgen_test_layout_itimerval() { ) ); } -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct timezone { - pub tz_minuteswest: ::std::os::raw::c_int, - pub tz_dsttime: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_timezone() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(timezone)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(timezone)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).tz_minuteswest as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(timezone), - "::", - stringify!(tz_minuteswest) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).tz_dsttime as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(timezone), - "::", - stringify!(tz_dsttime) - ) - ); -} pub type fd_mask = ::std::os::raw::c_ulong; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -3758,7 +3399,7 @@ extern "C" { } extern "C" { pub fn select( - __max_fd_plus_one: ::std::os::raw::c_int, + __fd_count: ::std::os::raw::c_int, __read_fds: *mut fd_set, __write_fds: *mut fd_set, __exception_fds: *mut fd_set, @@ -3767,7 +3408,7 @@ extern "C" { } extern "C" { pub fn pselect( - __max_fd_plus_one: ::std::os::raw::c_int, + __fd_count: ::std::os::raw::c_int, __read_fds: *mut fd_set, __write_fds: *mut fd_set, __exception_fds: *mut fd_set, @@ -3777,7 +3418,7 @@ extern "C" { } extern "C" { pub fn pselect64( - __max_fd_plus_one: ::std::os::raw::c_int, + __fd_count: ::std::os::raw::c_int, __read_fds: *mut fd_set, __write_fds: *mut fd_set, __exception_fds: *mut fd_set, @@ -4137,15 +3778,12 @@ pub struct clone_args { pub stack: __u64, pub stack_size: __u64, pub tls: __u64, - pub set_tid: __u64, - pub set_tid_size: __u64, - pub cgroup: __u64, } #[test] fn bindgen_test_layout_clone_args() { assert_eq!( ::std::mem::size_of::(), - 88usize, + 64usize, concat!("Size of: ", stringify!(clone_args)) ); assert_eq!( @@ -4233,36 +3871,6 @@ fn bindgen_test_layout_clone_args() { stringify!(tls) ) ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).set_tid as *const _ as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(clone_args), - "::", - stringify!(set_tid) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).set_tid_size as *const _ as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(clone_args), - "::", - stringify!(set_tid_size) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).cgroup as *const _ as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(clone_args), - "::", - stringify!(cgroup) - ) - ); } #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -4330,506 +3938,6 @@ pub type _bindgen_ty_1 = ::std::os::raw::c_uint; pub const PTHREAD_RWLOCK_PREFER_READER_NP: ::std::os::raw::c_uint = 0; pub const PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP: ::std::os::raw::c_uint = 1; pub type _bindgen_ty_2 = ::std::os::raw::c_uint; -extern "C" { - pub fn pthread_atfork( - __prepare: ::std::option::Option, - __parent: ::std::option::Option, - __child: ::std::option::Option, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_destroy(__attr: *mut pthread_attr_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_getdetachstate( - __attr: *const pthread_attr_t, - __state: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_getguardsize( - __attr: *const pthread_attr_t, - __size: *mut size_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_getinheritsched( - __attr: *const pthread_attr_t, - __flag: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_getschedparam( - __attr: *const pthread_attr_t, - __param: *mut sched_param, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_getschedpolicy( - __attr: *const pthread_attr_t, - __policy: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_getscope( - __attr: *const pthread_attr_t, - __scope: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_getstack( - __attr: *const pthread_attr_t, - __addr: *mut *mut ::std::os::raw::c_void, - __size: *mut size_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_getstacksize( - __attr: *const pthread_attr_t, - __size: *mut size_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_init(__attr: *mut pthread_attr_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_setdetachstate( - __attr: *mut pthread_attr_t, - __state: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_setguardsize( - __attr: *mut pthread_attr_t, - __size: size_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_setinheritsched( - __attr: *mut pthread_attr_t, - __flag: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_setschedparam( - __attr: *mut pthread_attr_t, - __param: *const sched_param, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_setschedpolicy( - __attr: *mut pthread_attr_t, - __policy: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_setscope( - __attr: *mut pthread_attr_t, - __scope: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_setstack( - __attr: *mut pthread_attr_t, - __addr: *mut ::std::os::raw::c_void, - __size: size_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_setstacksize( - __addr: *mut pthread_attr_t, - __size: size_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_condattr_destroy(__attr: *mut pthread_condattr_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_condattr_getclock( - __attr: *const pthread_condattr_t, - __clock: *mut clockid_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_condattr_getpshared( - __attr: *const pthread_condattr_t, - __shared: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_condattr_init(__attr: *mut pthread_condattr_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_condattr_setclock( - __attr: *mut pthread_condattr_t, - __clock: clockid_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_condattr_setpshared( - __attr: *mut pthread_condattr_t, - __shared: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_cond_broadcast(__cond: *mut pthread_cond_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_cond_clockwait( - __cond: *mut pthread_cond_t, - __mutex: *mut pthread_mutex_t, - __clock: clockid_t, - __timeout: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_cond_destroy(__cond: *mut pthread_cond_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_cond_init( - __cond: *mut pthread_cond_t, - __attr: *const pthread_condattr_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_cond_signal(__cond: *mut pthread_cond_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_cond_timedwait( - __cond: *mut pthread_cond_t, - __mutex: *mut pthread_mutex_t, - __timeout: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_cond_timedwait_monotonic_np( - __cond: *mut pthread_cond_t, - __mutex: *mut pthread_mutex_t, - __timeout: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_cond_wait( - __cond: *mut pthread_cond_t, - __mutex: *mut pthread_mutex_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_create( - __pthread_ptr: *mut pthread_t, - __attr: *const pthread_attr_t, - __start_routine: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_void, - >, - arg1: *mut ::std::os::raw::c_void, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_detach(__pthread: pthread_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_exit(__return_value: *mut ::std::os::raw::c_void); -} -extern "C" { - pub fn pthread_equal(__lhs: pthread_t, __rhs: pthread_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_getattr_np( - __pthread: pthread_t, - __attr: *mut pthread_attr_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_getcpuclockid( - __pthread: pthread_t, - __clock: *mut clockid_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_getschedparam( - __pthread: pthread_t, - __policy: *mut ::std::os::raw::c_int, - __param: *mut sched_param, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_getspecific(__key: pthread_key_t) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn pthread_gettid_np(__pthread: pthread_t) -> pid_t; -} -extern "C" { - pub fn pthread_join( - __pthread: pthread_t, - __return_value_ptr: *mut *mut ::std::os::raw::c_void, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_key_create( - __key_ptr: *mut pthread_key_t, - __key_destructor: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void), - >, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_key_delete(__key: pthread_key_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutexattr_destroy(__attr: *mut pthread_mutexattr_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutexattr_getpshared( - __attr: *const pthread_mutexattr_t, - __shared: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutexattr_gettype( - __attr: *const pthread_mutexattr_t, - __type: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutexattr_getprotocol( - __attr: *const pthread_mutexattr_t, - __protocol: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutexattr_init(__attr: *mut pthread_mutexattr_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutexattr_setpshared( - __attr: *mut pthread_mutexattr_t, - __shared: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutexattr_settype( - __attr: *mut pthread_mutexattr_t, - __type: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutexattr_setprotocol( - __attr: *mut pthread_mutexattr_t, - __protocol: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutex_clocklock( - __mutex: *mut pthread_mutex_t, - __clock: clockid_t, - __abstime: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutex_destroy(__mutex: *mut pthread_mutex_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutex_init( - __mutex: *mut pthread_mutex_t, - __attr: *const pthread_mutexattr_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutex_lock(__mutex: *mut pthread_mutex_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutex_timedlock( - __mutex: *mut pthread_mutex_t, - __timeout: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutex_timedlock_monotonic_np( - __mutex: *mut pthread_mutex_t, - __timeout: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutex_trylock(__mutex: *mut pthread_mutex_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutex_unlock(__mutex: *mut pthread_mutex_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_once( - __once: *mut pthread_once_t, - __init_routine: ::std::option::Option, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlockattr_init(__attr: *mut pthread_rwlockattr_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlockattr_destroy(__attr: *mut pthread_rwlockattr_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlockattr_getpshared( - __attr: *const pthread_rwlockattr_t, - __shared: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlockattr_setpshared( - __attr: *mut pthread_rwlockattr_t, - __shared: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlockattr_getkind_np( - __attr: *const pthread_rwlockattr_t, - __kind: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlockattr_setkind_np( - __attr: *mut pthread_rwlockattr_t, - __kind: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_clockrdlock( - __rwlock: *mut pthread_rwlock_t, - __clock: clockid_t, - __timeout: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_clockwrlock( - __rwlock: *mut pthread_rwlock_t, - __clock: clockid_t, - __timeout: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_destroy(__rwlock: *mut pthread_rwlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_init( - __rwlock: *mut pthread_rwlock_t, - __attr: *const pthread_rwlockattr_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_rdlock(__rwlock: *mut pthread_rwlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_timedrdlock( - __rwlock: *mut pthread_rwlock_t, - __timeout: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_timedrdlock_monotonic_np( - __rwlock: *mut pthread_rwlock_t, - __timeout: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_timedwrlock( - __rwlock: *mut pthread_rwlock_t, - __timeout: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_timedwrlock_monotonic_np( - __rwlock: *mut pthread_rwlock_t, - __timeout: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_tryrdlock(__rwlock: *mut pthread_rwlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_trywrlock(__rwlock: *mut pthread_rwlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_unlock(__rwlock: *mut pthread_rwlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_wrlock(__rwlock: *mut pthread_rwlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_barrierattr_init(__attr: *mut pthread_barrierattr_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_barrierattr_destroy(__attr: *mut pthread_barrierattr_t) - -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_barrierattr_getpshared( - __attr: *const pthread_barrierattr_t, - __shared: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_barrierattr_setpshared( - __attr: *mut pthread_barrierattr_t, - __shared: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_barrier_init( - __barrier: *mut pthread_barrier_t, - __attr: *const pthread_barrierattr_t, - __count: ::std::os::raw::c_uint, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_barrier_destroy(__barrier: *mut pthread_barrier_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_barrier_wait(__barrier: *mut pthread_barrier_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_spin_destroy(__spinlock: *mut pthread_spinlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_spin_init( - __spinlock: *mut pthread_spinlock_t, - __shared: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_spin_lock(__spinlock: *mut pthread_spinlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_spin_trylock(__spinlock: *mut pthread_spinlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_spin_unlock(__spinlock: *mut pthread_spinlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_self() -> pthread_t; -} -extern "C" { - pub fn pthread_setname_np( - __pthread: pthread_t, - __name: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_setschedparam( - __pthread: pthread_t, - __policy: ::std::os::raw::c_int, - __param: *const sched_param, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_setschedprio( - __pthread: pthread_t, - __priority: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_setspecific( - __key: pthread_key_t, - __value: *const ::std::os::raw::c_void, - ) -> ::std::os::raw::c_int; -} pub type __pthread_cleanup_func_t = ::std::option::Option; #[repr(C)] @@ -5476,10 +4584,6 @@ pub struct AInputEvent { } pub const AINPUT_EVENT_TYPE_KEY: ::std::os::raw::c_uint = 1; pub const AINPUT_EVENT_TYPE_MOTION: ::std::os::raw::c_uint = 2; -pub const AINPUT_EVENT_TYPE_FOCUS: ::std::os::raw::c_uint = 3; -pub const AINPUT_EVENT_TYPE_CAPTURE: ::std::os::raw::c_uint = 4; -pub const AINPUT_EVENT_TYPE_DRAG: ::std::os::raw::c_uint = 5; -pub const AINPUT_EVENT_TYPE_TOUCH_MODE: ::std::os::raw::c_uint = 6; pub type _bindgen_ty_11 = ::std::os::raw::c_uint; pub const AKEY_EVENT_ACTION_DOWN: ::std::os::raw::c_uint = 0; pub const AKEY_EVENT_ACTION_UP: ::std::os::raw::c_uint = 1; @@ -5580,13 +4684,7 @@ pub const AMOTION_EVENT_TOOL_TYPE_FINGER: ::std::os::raw::c_uint = 1; pub const AMOTION_EVENT_TOOL_TYPE_STYLUS: ::std::os::raw::c_uint = 2; pub const AMOTION_EVENT_TOOL_TYPE_MOUSE: ::std::os::raw::c_uint = 3; pub const AMOTION_EVENT_TOOL_TYPE_ERASER: ::std::os::raw::c_uint = 4; -pub const AMOTION_EVENT_TOOL_TYPE_PALM: ::std::os::raw::c_uint = 5; pub type _bindgen_ty_19 = ::std::os::raw::c_uint; -pub const AMotionClassification_AMOTION_EVENT_CLASSIFICATION_NONE: AMotionClassification = 0; -pub const AMotionClassification_AMOTION_EVENT_CLASSIFICATION_AMBIGUOUS_GESTURE: - AMotionClassification = 1; -pub const AMotionClassification_AMOTION_EVENT_CLASSIFICATION_DEEP_PRESS: AMotionClassification = 2; -pub type AMotionClassification = u32; pub const AINPUT_SOURCE_CLASS_MASK: ::std::os::raw::c_uint = 255; pub const AINPUT_SOURCE_CLASS_NONE: ::std::os::raw::c_uint = 0; pub const AINPUT_SOURCE_CLASS_BUTTON: ::std::os::raw::c_uint = 1; @@ -5608,8 +4706,6 @@ pub const AINPUT_SOURCE_MOUSE_RELATIVE: ::std::os::raw::c_uint = 131076; pub const AINPUT_SOURCE_TOUCHPAD: ::std::os::raw::c_uint = 1048584; pub const AINPUT_SOURCE_TOUCH_NAVIGATION: ::std::os::raw::c_uint = 2097152; pub const AINPUT_SOURCE_JOYSTICK: ::std::os::raw::c_uint = 16777232; -pub const AINPUT_SOURCE_HDMI: ::std::os::raw::c_uint = 33554433; -pub const AINPUT_SOURCE_SENSOR: ::std::os::raw::c_uint = 67108864; pub const AINPUT_SOURCE_ROTARY_ENCODER: ::std::os::raw::c_uint = 4194304; pub const AINPUT_SOURCE_ANY: ::std::os::raw::c_uint = 4294967040; pub type _bindgen_ty_21 = ::std::os::raw::c_uint; @@ -5636,9 +4732,6 @@ extern "C" { extern "C" { pub fn AInputEvent_getSource(event: *const AInputEvent) -> i32; } -extern "C" { - pub fn AInputEvent_release(event: *const AInputEvent); -} extern "C" { pub fn AKeyEvent_getAction(key_event: *const AInputEvent) -> i32; } @@ -5663,9 +4756,6 @@ extern "C" { extern "C" { pub fn AKeyEvent_getEventTime(key_event: *const AInputEvent) -> i64; } -extern "C" { - pub fn AKeyEvent_fromJava(env: *mut JNIEnv, keyEvent: jobject) -> *const AInputEvent; -} extern "C" { pub fn AMotionEvent_getAction(motion_event: *const AInputEvent) -> i32; } @@ -5862,15 +4952,6 @@ extern "C" { history_index: size_t, ) -> f32; } -extern "C" { - pub fn AMotionEvent_getActionButton(motion_event: *const AInputEvent) -> i32; -} -extern "C" { - pub fn AMotionEvent_getClassification(motion_event: *const AInputEvent) -> i32; -} -extern "C" { - pub fn AMotionEvent_fromJava(env: *mut JNIEnv, motionEvent: jobject) -> *const AInputEvent; -} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct imaxdiv_t { @@ -5945,52 +5026,11 @@ extern "C" { ) -> uintmax_t; } pub const ADataSpace_ADATASPACE_UNKNOWN: ADataSpace = 0; -pub const ADataSpace_STANDARD_MASK: ADataSpace = 4128768; -pub const ADataSpace_STANDARD_UNSPECIFIED: ADataSpace = 0; -pub const ADataSpace_STANDARD_BT709: ADataSpace = 65536; -pub const ADataSpace_STANDARD_BT601_625: ADataSpace = 131072; -pub const ADataSpace_STANDARD_BT601_625_UNADJUSTED: ADataSpace = 196608; -pub const ADataSpace_STANDARD_BT601_525: ADataSpace = 262144; -pub const ADataSpace_STANDARD_BT601_525_UNADJUSTED: ADataSpace = 327680; -pub const ADataSpace_STANDARD_BT2020: ADataSpace = 393216; -pub const ADataSpace_STANDARD_BT2020_CONSTANT_LUMINANCE: ADataSpace = 458752; -pub const ADataSpace_STANDARD_BT470M: ADataSpace = 524288; -pub const ADataSpace_STANDARD_FILM: ADataSpace = 589824; -pub const ADataSpace_STANDARD_DCI_P3: ADataSpace = 655360; -pub const ADataSpace_STANDARD_ADOBE_RGB: ADataSpace = 720896; -pub const ADataSpace_TRANSFER_MASK: ADataSpace = 130023424; -pub const ADataSpace_TRANSFER_UNSPECIFIED: ADataSpace = 0; -pub const ADataSpace_TRANSFER_LINEAR: ADataSpace = 4194304; -pub const ADataSpace_TRANSFER_SRGB: ADataSpace = 8388608; -pub const ADataSpace_TRANSFER_SMPTE_170M: ADataSpace = 12582912; -pub const ADataSpace_TRANSFER_GAMMA2_2: ADataSpace = 16777216; -pub const ADataSpace_TRANSFER_GAMMA2_6: ADataSpace = 20971520; -pub const ADataSpace_TRANSFER_GAMMA2_8: ADataSpace = 25165824; -pub const ADataSpace_TRANSFER_ST2084: ADataSpace = 29360128; -pub const ADataSpace_TRANSFER_HLG: ADataSpace = 33554432; -pub const ADataSpace_RANGE_MASK: ADataSpace = 939524096; -pub const ADataSpace_RANGE_UNSPECIFIED: ADataSpace = 0; -pub const ADataSpace_RANGE_FULL: ADataSpace = 134217728; -pub const ADataSpace_RANGE_LIMITED: ADataSpace = 268435456; -pub const ADataSpace_RANGE_EXTENDED: ADataSpace = 402653184; pub const ADataSpace_ADATASPACE_SCRGB_LINEAR: ADataSpace = 406913024; pub const ADataSpace_ADATASPACE_SRGB: ADataSpace = 142671872; pub const ADataSpace_ADATASPACE_SCRGB: ADataSpace = 411107328; pub const ADataSpace_ADATASPACE_DISPLAY_P3: ADataSpace = 143261696; pub const ADataSpace_ADATASPACE_BT2020_PQ: ADataSpace = 163971072; -pub const ADataSpace_ADATASPACE_BT2020_ITU_PQ: ADataSpace = 298188800; -pub const ADataSpace_ADATASPACE_ADOBE_RGB: ADataSpace = 151715840; -pub const ADataSpace_ADATASPACE_JFIF: ADataSpace = 146931712; -pub const ADataSpace_ADATASPACE_BT601_625: ADataSpace = 281149440; -pub const ADataSpace_ADATASPACE_BT601_525: ADataSpace = 281280512; -pub const ADataSpace_ADATASPACE_BT2020: ADataSpace = 147193856; -pub const ADataSpace_ADATASPACE_BT709: ADataSpace = 281083904; -pub const ADataSpace_ADATASPACE_DCI_P3: ADataSpace = 155844608; -pub const ADataSpace_ADATASPACE_SRGB_LINEAR: ADataSpace = 138477568; -pub const ADataSpace_ADATASPACE_BT2020_HLG: ADataSpace = 168165376; -pub const ADataSpace_ADATASPACE_BT2020_ITU_HLG: ADataSpace = 302383104; -pub const ADataSpace_DEPTH: ADataSpace = 4096; -pub const ADataSpace_DYNAMIC_DEPTH: ADataSpace = 4098; pub type ADataSpace = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -6071,8 +5111,6 @@ pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_D32_FLOAT_S8_UINT: AHard 52; pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_S8_UINT: AHardwareBuffer_Format = 53; pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_Y8Cb8Cr8_420: AHardwareBuffer_Format = 35; -pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_YCbCr_P010: AHardwareBuffer_Format = 54; -pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_R8_UNORM: AHardwareBuffer_Format = 56; pub type AHardwareBuffer_Format = ::std::os::raw::c_uint; pub const AHardwareBuffer_UsageFlags_AHARDWAREBUFFER_USAGE_CPU_READ_NEVER: AHardwareBuffer_UsageFlags = 0; @@ -6381,6 +5419,15 @@ extern "C" { outVirtualAddress: *mut *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } +extern "C" { + pub fn AHardwareBuffer_lockPlanes( + buffer: *mut AHardwareBuffer, + usage: u64, + fence: i32, + rect: *const ARect, + outPlanes: *mut AHardwareBuffer_Planes, + ) -> ::std::os::raw::c_int; +} extern "C" { pub fn AHardwareBuffer_unlock( buffer: *mut AHardwareBuffer, @@ -6399,15 +5446,6 @@ extern "C" { outBuffer: *mut *mut AHardwareBuffer, ) -> ::std::os::raw::c_int; } -extern "C" { - pub fn AHardwareBuffer_lockPlanes( - buffer: *mut AHardwareBuffer, - usage: u64, - fence: i32, - rect: *const ARect, - outPlanes: *mut AHardwareBuffer_Planes, - ) -> ::std::os::raw::c_int; -} extern "C" { pub fn AHardwareBuffer_isSupported(desc: *const AHardwareBuffer_Desc) -> ::std::os::raw::c_int; } @@ -6422,12 +5460,6 @@ extern "C" { outBytesPerStride: *mut i32, ) -> ::std::os::raw::c_int; } -extern "C" { - pub fn AHardwareBuffer_getId( - buffer: *const AHardwareBuffer, - outId: *mut u64, - ) -> ::std::os::raw::c_int; -} #[repr(C)] pub struct ANativeActivity { pub callbacks: *mut ANativeActivityCallbacks, @@ -6955,7 +5987,6 @@ fn bindgen_test_layout_android_poll_source() { #[doc = " See the sample named \"native-activity\" that comes with the NDK with a"] #[doc = " full usage example. Also look at the JavaDoc of NativeActivity."] #[repr(C)] -#[derive(Debug, Copy, Clone)] pub struct android_app { pub userData: *mut ::std::os::raw::c_void, pub onAppCmd: ::std::option::Option, @@ -7361,6 +6392,28 @@ extern "C" { extern "C" { pub fn android_app_detach_input_queue_looper(android_app: *mut android_app); } +extern "C" { + pub fn android_app_create( + activity: *mut ANativeActivity, + savedState: *mut ::std::os::raw::c_void, + savedStateSize: size_t, + ) -> *mut android_app; +} +extern "C" { + pub fn android_app_write_cmd(android_app: *mut android_app, cmd: i8); +} +extern "C" { + pub fn android_app_set_input(android_app: *mut android_app, inputQueue: *mut AInputQueue); +} +extern "C" { + pub fn android_app_set_window(android_app: *mut android_app, window: *mut ANativeWindow); +} +extern "C" { + pub fn android_app_set_activity_state(android_app: *mut android_app, cmd: i8); +} +extern "C" { + pub fn android_app_free(android_app: *mut android_app); +} extern "C" { #[doc = " Dummy function that used to be used to prevent the linker from stripping app"] #[doc = " glue code. No longer necessary, since __attribute__((visibility(\"default\")))"] diff --git a/android-activity/src/native_activity/ffi_arm.rs b/android-activity/src/native_activity/ffi_arm.rs index e7a14eb..a80f853 100644 --- a/android-activity/src/native_activity/ffi_arm.rs +++ b/android-activity/src/native_activity/ffi_arm.rs @@ -101,13 +101,10 @@ pub const __ANDROID_API_O_MR1__: u32 = 27; pub const __ANDROID_API_P__: u32 = 28; pub const __ANDROID_API_Q__: u32 = 29; pub const __ANDROID_API_R__: u32 = 30; -pub const __ANDROID_API_S__: u32 = 31; -pub const __ANDROID_API_T__: u32 = 33; -pub const __ANDROID_NDK__: u32 = 1; -pub const __NDK_MAJOR__: u32 = 25; -pub const __NDK_MINOR__: u32 = 0; +pub const __NDK_MAJOR__: u32 = 21; +pub const __NDK_MINOR__: u32 = 1; pub const __NDK_BETA__: u32 = 0; -pub const __NDK_BUILD__: u32 = 8775105; +pub const __NDK_BUILD__: u32 = 6352462; pub const __NDK_CANARY__: u32 = 0; pub const POLLIN: u32 = 1; pub const POLLPRI: u32 = 2; @@ -368,21 +365,19 @@ pub const SIGSYS: u32 = 31; pub const SIGUNUSED: u32 = 31; pub const __SIGRTMIN: u32 = 32; pub const SIGSWI: u32 = 32; -pub const SA_THIRTYTWO: u32 = 33554432; -pub const SA_RESTORER: u32 = 67108864; -pub const MINSIGSTKSZ: u32 = 2048; -pub const SIGSTKSZ: u32 = 8192; pub const SA_NOCLDSTOP: u32 = 1; pub const SA_NOCLDWAIT: u32 = 2; pub const SA_SIGINFO: u32 = 4; -pub const SA_UNSUPPORTED: u32 = 1024; -pub const SA_EXPOSE_TAGBITS: u32 = 2048; +pub const SA_THIRTYTWO: u32 = 33554432; +pub const SA_RESTORER: u32 = 67108864; pub const SA_ONSTACK: u32 = 134217728; pub const SA_RESTART: u32 = 268435456; pub const SA_NODEFER: u32 = 1073741824; pub const SA_RESETHAND: u32 = 2147483648; pub const SA_NOMASK: u32 = 1073741824; pub const SA_ONESHOT: u32 = 2147483648; +pub const MINSIGSTKSZ: u32 = 2048; +pub const SIGSTKSZ: u32 = 8192; pub const SIG_BLOCK: u32 = 0; pub const SIG_UNBLOCK: u32 = 1; pub const SIG_SETMASK: u32 = 2; @@ -432,9 +427,7 @@ pub const SEGV_PKUERR: u32 = 4; pub const SEGV_ACCADI: u32 = 5; pub const SEGV_ADIDERR: u32 = 6; pub const SEGV_ADIPERR: u32 = 7; -pub const SEGV_MTEAERR: u32 = 8; -pub const SEGV_MTESERR: u32 = 9; -pub const NSIGSEGV: u32 = 9; +pub const NSIGSEGV: u32 = 7; pub const BUS_ADRALN: u32 = 1; pub const BUS_ADRERR: u32 = 2; pub const BUS_OBJERR: u32 = 3; @@ -446,8 +439,7 @@ pub const TRAP_TRACE: u32 = 2; pub const TRAP_BRANCH: u32 = 3; pub const TRAP_HWBKPT: u32 = 4; pub const TRAP_UNK: u32 = 5; -pub const TRAP_PERF: u32 = 6; -pub const NSIGTRAP: u32 = 6; +pub const NSIGTRAP: u32 = 5; pub const CLD_EXITED: u32 = 1; pub const CLD_KILLED: u32 = 2; pub const CLD_DUMPED: u32 = 3; @@ -463,8 +455,7 @@ pub const POLL_PRI: u32 = 5; pub const POLL_HUP: u32 = 6; pub const NSIGPOLL: u32 = 6; pub const SYS_SECCOMP: u32 = 1; -pub const SYS_USER_DISPATCH: u32 = 2; -pub const NSIGSYS: u32 = 2; +pub const NSIGSYS: u32 = 1; pub const EMT_TAGOVF: u32 = 1; pub const NSIGEMT: u32 = 1; pub const SIGEV_SIGNAL: u32 = 0; @@ -529,12 +520,6 @@ pub const CLONE_NEWUSER: u32 = 268435456; pub const CLONE_NEWPID: u32 = 536870912; pub const CLONE_NEWNET: u32 = 1073741824; pub const CLONE_IO: u32 = 2147483648; -pub const CLONE_CLEAR_SIGHAND: u64 = 4294967296; -pub const CLONE_INTO_CGROUP: u64 = 8589934592; -pub const CLONE_NEWTIME: u32 = 128; -pub const CLONE_ARGS_SIZE_VER0: u32 = 64; -pub const CLONE_ARGS_SIZE_VER1: u32 = 80; -pub const CLONE_ARGS_SIZE_VER2: u32 = 88; pub const SCHED_NORMAL: u32 = 0; pub const SCHED_FIFO: u32 = 1; pub const SCHED_RR: u32 = 2; @@ -568,9 +553,6 @@ pub const PTHREAD_SCOPE_SYSTEM: u32 = 0; pub const PTHREAD_SCOPE_PROCESS: u32 = 1; pub const __GNUC_VA_LIST: u32 = 1; pub const AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT: u32 = 8; -pub const true_: u32 = 1; -pub const false_: u32 = 0; -pub const __bool_true_false_are_defined: u32 = 1; pub const __PRI_64_prefix: &[u8; 3usize] = b"ll\0"; pub const PRId8: &[u8; 2usize] = b"d\0"; pub const PRId16: &[u8; 2usize] = b"d\0"; @@ -910,7 +892,6 @@ fn bindgen_test_layout___kernel_fsid_t() { } pub type __kernel_off_t = __kernel_long_t; pub type __kernel_loff_t = ::std::os::raw::c_longlong; -pub type __kernel_old_time_t = __kernel_long_t; pub type __kernel_time_t = __kernel_long_t; pub type __kernel_time64_t = ::std::os::raw::c_longlong; pub type __kernel_clock_t = __kernel_long_t; @@ -928,236 +909,6 @@ pub type __be64 = __u64; pub type __sum16 = __u16; pub type __wsum = __u32; pub type __poll_t = ::std::os::raw::c_uint; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct pthread_attr_t { - pub flags: u32, - pub stack_base: *mut ::std::os::raw::c_void, - pub stack_size: size_t, - pub guard_size: size_t, - pub sched_policy: i32, - pub sched_priority: i32, -} -#[test] -fn bindgen_test_layout_pthread_attr_t() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(pthread_attr_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(pthread_attr_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_attr_t), - "::", - stringify!(flags) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).stack_base as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(pthread_attr_t), - "::", - stringify!(stack_base) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).stack_size as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(pthread_attr_t), - "::", - stringify!(stack_size) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).guard_size as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(pthread_attr_t), - "::", - stringify!(guard_size) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sched_policy as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(pthread_attr_t), - "::", - stringify!(sched_policy) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sched_priority as *const _ as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(pthread_attr_t), - "::", - stringify!(sched_priority) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct pthread_barrier_t { - pub __private: [i32; 8usize], -} -#[test] -fn bindgen_test_layout_pthread_barrier_t() { - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(pthread_barrier_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(pthread_barrier_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).__private as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_barrier_t), - "::", - stringify!(__private) - ) - ); -} -pub type pthread_barrierattr_t = ::std::os::raw::c_int; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct pthread_cond_t { - pub __private: [i32; 1usize], -} -#[test] -fn bindgen_test_layout_pthread_cond_t() { - assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(pthread_cond_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(pthread_cond_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).__private as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_cond_t), - "::", - stringify!(__private) - ) - ); -} -pub type pthread_condattr_t = ::std::os::raw::c_long; -pub type pthread_key_t = ::std::os::raw::c_int; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct pthread_mutex_t { - pub __private: [i32; 1usize], -} -#[test] -fn bindgen_test_layout_pthread_mutex_t() { - assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(pthread_mutex_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(pthread_mutex_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).__private as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_mutex_t), - "::", - stringify!(__private) - ) - ); -} -pub type pthread_mutexattr_t = ::std::os::raw::c_long; -pub type pthread_once_t = ::std::os::raw::c_int; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct pthread_rwlock_t { - pub __private: [i32; 10usize], -} -#[test] -fn bindgen_test_layout_pthread_rwlock_t() { - assert_eq!( - ::std::mem::size_of::(), - 40usize, - concat!("Size of: ", stringify!(pthread_rwlock_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(pthread_rwlock_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).__private as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_rwlock_t), - "::", - stringify!(__private) - ) - ); -} -pub type pthread_rwlockattr_t = ::std::os::raw::c_long; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct pthread_spinlock_t { - pub __private: [i32; 2usize], -} -#[test] -fn bindgen_test_layout_pthread_spinlock_t() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(pthread_spinlock_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(pthread_spinlock_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).__private as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_spinlock_t), - "::", - stringify!(__private) - ) - ); -} -pub type pthread_t = ::std::os::raw::c_long; pub type __gid_t = __kernel_gid32_t; pub type gid_t = __gid_t; pub type __uid_t = __kernel_uid32_t; @@ -1921,11 +1672,9 @@ pub struct __sifields__bindgen_ty_5 { #[repr(C)] #[derive(Copy, Clone)] pub union __sifields__bindgen_ty_5__bindgen_ty_1 { - pub _trapno: ::std::os::raw::c_int, pub _addr_lsb: ::std::os::raw::c_short, pub _addr_bnd: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1, pub _addr_pkey: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2, - pub _perf: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3, } #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -2043,57 +1792,6 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2() { ) ); } -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3 { - pub _data: ::std::os::raw::c_ulong, - pub _type: __u32, -} -#[test] -fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3() { - assert_eq!( - ::std::mem::size_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3>(), - 8usize, - concat!( - "Size of: ", - stringify!(__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3) - ) - ); - assert_eq!( - ::std::mem::align_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3>(), - 4usize, - concat!( - "Alignment of ", - stringify!(__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3>()))._data - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3), - "::", - stringify!(_data) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3>()))._type - as *const _ as usize - }, - 4usize, - concat!( - "Offset of field: ", - stringify!(__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3), - "::", - stringify!(_type) - ) - ); -} #[test] fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1() { assert_eq!( @@ -2112,19 +1810,6 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1() { stringify!(__sifields__bindgen_ty_5__bindgen_ty_1) ) ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1>()))._trapno as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__sifields__bindgen_ty_5__bindgen_ty_1), - "::", - stringify!(_trapno) - ) - ); assert_eq!( unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1>()))._addr_lsb as *const _ @@ -2164,19 +1849,6 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1() { stringify!(_addr_pkey) ) ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1>()))._perf as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__sifields__bindgen_ty_5__bindgen_ty_1), - "::", - stringify!(_perf) - ) - ); } #[test] fn bindgen_test_layout___sifields__bindgen_ty_5() { @@ -3823,26 +3495,6 @@ extern "C" { extern "C" { pub fn psignal(__signal: ::std::os::raw::c_int, __msg: *const ::std::os::raw::c_char); } -extern "C" { - pub fn pthread_kill( - __pthread: pthread_t, - __signal: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_sigmask( - __how: ::std::os::raw::c_int, - __new_set: *const sigset_t, - __old_set: *mut sigset_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_sigmask64( - __how: ::std::os::raw::c_int, - __new_set: *const sigset64_t, - __old_set: *mut sigset64_t, - ) -> ::std::os::raw::c_int; -} extern "C" { pub fn sigqueue( __pid: pid_t, @@ -3951,40 +3603,40 @@ fn bindgen_test_layout___kernel_itimerspec() { } #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct __kernel_old_timespec { - pub tv_sec: __kernel_old_time_t, - pub tv_nsec: ::std::os::raw::c_long, +pub struct __kernel_old_timeval { + pub tv_sec: __kernel_long_t, + pub tv_usec: __kernel_long_t, } #[test] -fn bindgen_test_layout___kernel_old_timespec() { +fn bindgen_test_layout___kernel_old_timeval() { assert_eq!( - ::std::mem::size_of::<__kernel_old_timespec>(), + ::std::mem::size_of::<__kernel_old_timeval>(), 8usize, - concat!("Size of: ", stringify!(__kernel_old_timespec)) + concat!("Size of: ", stringify!(__kernel_old_timeval)) ); assert_eq!( - ::std::mem::align_of::<__kernel_old_timespec>(), + ::std::mem::align_of::<__kernel_old_timeval>(), 4usize, - concat!("Alignment of ", stringify!(__kernel_old_timespec)) + concat!("Alignment of ", stringify!(__kernel_old_timeval)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_old_timespec>())).tv_sec as *const _ as usize }, + unsafe { &(*(::std::ptr::null::<__kernel_old_timeval>())).tv_sec as *const _ as usize }, 0usize, concat!( "Offset of field: ", - stringify!(__kernel_old_timespec), + stringify!(__kernel_old_timeval), "::", stringify!(tv_sec) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_old_timespec>())).tv_nsec as *const _ as usize }, + unsafe { &(*(::std::ptr::null::<__kernel_old_timeval>())).tv_usec as *const _ as usize }, 4usize, concat!( "Offset of field: ", - stringify!(__kernel_old_timespec), + stringify!(__kernel_old_timeval), "::", - stringify!(tv_nsec) + stringify!(tv_usec) ) ); } @@ -4030,7 +3682,7 @@ fn bindgen_test_layout___kernel_sock_timeval() { #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct timeval { - pub tv_sec: __kernel_old_time_t, + pub tv_sec: __kernel_time_t, pub tv_usec: __kernel_suseconds_t, } #[test] @@ -4068,6 +3720,45 @@ fn bindgen_test_layout_timeval() { } #[repr(C)] #[derive(Debug, Copy, Clone)] +pub struct timezone { + pub tz_minuteswest: ::std::os::raw::c_int, + pub tz_dsttime: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_timezone() { + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(timezone)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(timezone)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tz_minuteswest as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(timezone), + "::", + stringify!(tz_minuteswest) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tz_dsttime as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(timezone), + "::", + stringify!(tz_dsttime) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] pub struct itimerspec { pub it_interval: timespec, pub it_value: timespec, @@ -4144,45 +3835,6 @@ fn bindgen_test_layout_itimerval() { ) ); } -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct timezone { - pub tz_minuteswest: ::std::os::raw::c_int, - pub tz_dsttime: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_timezone() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(timezone)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(timezone)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).tz_minuteswest as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(timezone), - "::", - stringify!(tz_minuteswest) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).tz_dsttime as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(timezone), - "::", - stringify!(tz_dsttime) - ) - ); -} pub type fd_mask = ::std::os::raw::c_ulong; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -4227,7 +3879,7 @@ extern "C" { } extern "C" { pub fn select( - __max_fd_plus_one: ::std::os::raw::c_int, + __fd_count: ::std::os::raw::c_int, __read_fds: *mut fd_set, __write_fds: *mut fd_set, __exception_fds: *mut fd_set, @@ -4236,7 +3888,7 @@ extern "C" { } extern "C" { pub fn pselect( - __max_fd_plus_one: ::std::os::raw::c_int, + __fd_count: ::std::os::raw::c_int, __read_fds: *mut fd_set, __write_fds: *mut fd_set, __exception_fds: *mut fd_set, @@ -4246,7 +3898,7 @@ extern "C" { } extern "C" { pub fn pselect64( - __max_fd_plus_one: ::std::os::raw::c_int, + __fd_count: ::std::os::raw::c_int, __read_fds: *mut fd_set, __write_fds: *mut fd_set, __exception_fds: *mut fd_set, @@ -4606,15 +4258,12 @@ pub struct clone_args { pub stack: __u64, pub stack_size: __u64, pub tls: __u64, - pub set_tid: __u64, - pub set_tid_size: __u64, - pub cgroup: __u64, } #[test] fn bindgen_test_layout_clone_args() { assert_eq!( ::std::mem::size_of::(), - 88usize, + 64usize, concat!("Size of: ", stringify!(clone_args)) ); assert_eq!( @@ -4702,36 +4351,6 @@ fn bindgen_test_layout_clone_args() { stringify!(tls) ) ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).set_tid as *const _ as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(clone_args), - "::", - stringify!(set_tid) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).set_tid_size as *const _ as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(clone_args), - "::", - stringify!(set_tid_size) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).cgroup as *const _ as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(clone_args), - "::", - stringify!(cgroup) - ) - ); } #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -4799,506 +4418,6 @@ pub type _bindgen_ty_2 = ::std::os::raw::c_uint; pub const PTHREAD_RWLOCK_PREFER_READER_NP: ::std::os::raw::c_uint = 0; pub const PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP: ::std::os::raw::c_uint = 1; pub type _bindgen_ty_3 = ::std::os::raw::c_uint; -extern "C" { - pub fn pthread_atfork( - __prepare: ::std::option::Option, - __parent: ::std::option::Option, - __child: ::std::option::Option, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_destroy(__attr: *mut pthread_attr_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_getdetachstate( - __attr: *const pthread_attr_t, - __state: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_getguardsize( - __attr: *const pthread_attr_t, - __size: *mut size_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_getinheritsched( - __attr: *const pthread_attr_t, - __flag: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_getschedparam( - __attr: *const pthread_attr_t, - __param: *mut sched_param, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_getschedpolicy( - __attr: *const pthread_attr_t, - __policy: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_getscope( - __attr: *const pthread_attr_t, - __scope: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_getstack( - __attr: *const pthread_attr_t, - __addr: *mut *mut ::std::os::raw::c_void, - __size: *mut size_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_getstacksize( - __attr: *const pthread_attr_t, - __size: *mut size_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_init(__attr: *mut pthread_attr_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_setdetachstate( - __attr: *mut pthread_attr_t, - __state: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_setguardsize( - __attr: *mut pthread_attr_t, - __size: size_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_setinheritsched( - __attr: *mut pthread_attr_t, - __flag: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_setschedparam( - __attr: *mut pthread_attr_t, - __param: *const sched_param, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_setschedpolicy( - __attr: *mut pthread_attr_t, - __policy: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_setscope( - __attr: *mut pthread_attr_t, - __scope: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_setstack( - __attr: *mut pthread_attr_t, - __addr: *mut ::std::os::raw::c_void, - __size: size_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_setstacksize( - __addr: *mut pthread_attr_t, - __size: size_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_condattr_destroy(__attr: *mut pthread_condattr_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_condattr_getclock( - __attr: *const pthread_condattr_t, - __clock: *mut clockid_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_condattr_getpshared( - __attr: *const pthread_condattr_t, - __shared: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_condattr_init(__attr: *mut pthread_condattr_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_condattr_setclock( - __attr: *mut pthread_condattr_t, - __clock: clockid_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_condattr_setpshared( - __attr: *mut pthread_condattr_t, - __shared: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_cond_broadcast(__cond: *mut pthread_cond_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_cond_clockwait( - __cond: *mut pthread_cond_t, - __mutex: *mut pthread_mutex_t, - __clock: clockid_t, - __timeout: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_cond_destroy(__cond: *mut pthread_cond_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_cond_init( - __cond: *mut pthread_cond_t, - __attr: *const pthread_condattr_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_cond_signal(__cond: *mut pthread_cond_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_cond_timedwait( - __cond: *mut pthread_cond_t, - __mutex: *mut pthread_mutex_t, - __timeout: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_cond_timedwait_monotonic_np( - __cond: *mut pthread_cond_t, - __mutex: *mut pthread_mutex_t, - __timeout: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_cond_wait( - __cond: *mut pthread_cond_t, - __mutex: *mut pthread_mutex_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_create( - __pthread_ptr: *mut pthread_t, - __attr: *const pthread_attr_t, - __start_routine: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_void, - >, - arg1: *mut ::std::os::raw::c_void, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_detach(__pthread: pthread_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_exit(__return_value: *mut ::std::os::raw::c_void); -} -extern "C" { - pub fn pthread_equal(__lhs: pthread_t, __rhs: pthread_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_getattr_np( - __pthread: pthread_t, - __attr: *mut pthread_attr_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_getcpuclockid( - __pthread: pthread_t, - __clock: *mut clockid_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_getschedparam( - __pthread: pthread_t, - __policy: *mut ::std::os::raw::c_int, - __param: *mut sched_param, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_getspecific(__key: pthread_key_t) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn pthread_gettid_np(__pthread: pthread_t) -> pid_t; -} -extern "C" { - pub fn pthread_join( - __pthread: pthread_t, - __return_value_ptr: *mut *mut ::std::os::raw::c_void, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_key_create( - __key_ptr: *mut pthread_key_t, - __key_destructor: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void), - >, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_key_delete(__key: pthread_key_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutexattr_destroy(__attr: *mut pthread_mutexattr_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutexattr_getpshared( - __attr: *const pthread_mutexattr_t, - __shared: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutexattr_gettype( - __attr: *const pthread_mutexattr_t, - __type: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutexattr_getprotocol( - __attr: *const pthread_mutexattr_t, - __protocol: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutexattr_init(__attr: *mut pthread_mutexattr_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutexattr_setpshared( - __attr: *mut pthread_mutexattr_t, - __shared: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutexattr_settype( - __attr: *mut pthread_mutexattr_t, - __type: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutexattr_setprotocol( - __attr: *mut pthread_mutexattr_t, - __protocol: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutex_clocklock( - __mutex: *mut pthread_mutex_t, - __clock: clockid_t, - __abstime: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutex_destroy(__mutex: *mut pthread_mutex_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutex_init( - __mutex: *mut pthread_mutex_t, - __attr: *const pthread_mutexattr_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutex_lock(__mutex: *mut pthread_mutex_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutex_timedlock( - __mutex: *mut pthread_mutex_t, - __timeout: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutex_timedlock_monotonic_np( - __mutex: *mut pthread_mutex_t, - __timeout: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutex_trylock(__mutex: *mut pthread_mutex_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutex_unlock(__mutex: *mut pthread_mutex_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_once( - __once: *mut pthread_once_t, - __init_routine: ::std::option::Option, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlockattr_init(__attr: *mut pthread_rwlockattr_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlockattr_destroy(__attr: *mut pthread_rwlockattr_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlockattr_getpshared( - __attr: *const pthread_rwlockattr_t, - __shared: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlockattr_setpshared( - __attr: *mut pthread_rwlockattr_t, - __shared: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlockattr_getkind_np( - __attr: *const pthread_rwlockattr_t, - __kind: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlockattr_setkind_np( - __attr: *mut pthread_rwlockattr_t, - __kind: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_clockrdlock( - __rwlock: *mut pthread_rwlock_t, - __clock: clockid_t, - __timeout: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_clockwrlock( - __rwlock: *mut pthread_rwlock_t, - __clock: clockid_t, - __timeout: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_destroy(__rwlock: *mut pthread_rwlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_init( - __rwlock: *mut pthread_rwlock_t, - __attr: *const pthread_rwlockattr_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_rdlock(__rwlock: *mut pthread_rwlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_timedrdlock( - __rwlock: *mut pthread_rwlock_t, - __timeout: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_timedrdlock_monotonic_np( - __rwlock: *mut pthread_rwlock_t, - __timeout: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_timedwrlock( - __rwlock: *mut pthread_rwlock_t, - __timeout: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_timedwrlock_monotonic_np( - __rwlock: *mut pthread_rwlock_t, - __timeout: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_tryrdlock(__rwlock: *mut pthread_rwlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_trywrlock(__rwlock: *mut pthread_rwlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_unlock(__rwlock: *mut pthread_rwlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_wrlock(__rwlock: *mut pthread_rwlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_barrierattr_init(__attr: *mut pthread_barrierattr_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_barrierattr_destroy(__attr: *mut pthread_barrierattr_t) - -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_barrierattr_getpshared( - __attr: *const pthread_barrierattr_t, - __shared: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_barrierattr_setpshared( - __attr: *mut pthread_barrierattr_t, - __shared: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_barrier_init( - __barrier: *mut pthread_barrier_t, - __attr: *const pthread_barrierattr_t, - __count: ::std::os::raw::c_uint, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_barrier_destroy(__barrier: *mut pthread_barrier_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_barrier_wait(__barrier: *mut pthread_barrier_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_spin_destroy(__spinlock: *mut pthread_spinlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_spin_init( - __spinlock: *mut pthread_spinlock_t, - __shared: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_spin_lock(__spinlock: *mut pthread_spinlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_spin_trylock(__spinlock: *mut pthread_spinlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_spin_unlock(__spinlock: *mut pthread_spinlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_self() -> pthread_t; -} -extern "C" { - pub fn pthread_setname_np( - __pthread: pthread_t, - __name: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_setschedparam( - __pthread: pthread_t, - __policy: ::std::os::raw::c_int, - __param: *const sched_param, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_setschedprio( - __pthread: pthread_t, - __priority: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_setspecific( - __key: pthread_key_t, - __value: *const ::std::os::raw::c_void, - ) -> ::std::os::raw::c_int; -} pub type __pthread_cleanup_func_t = ::std::option::Option; #[repr(C)] @@ -5945,10 +5064,6 @@ pub struct AInputEvent { } pub const AINPUT_EVENT_TYPE_KEY: ::std::os::raw::c_uint = 1; pub const AINPUT_EVENT_TYPE_MOTION: ::std::os::raw::c_uint = 2; -pub const AINPUT_EVENT_TYPE_FOCUS: ::std::os::raw::c_uint = 3; -pub const AINPUT_EVENT_TYPE_CAPTURE: ::std::os::raw::c_uint = 4; -pub const AINPUT_EVENT_TYPE_DRAG: ::std::os::raw::c_uint = 5; -pub const AINPUT_EVENT_TYPE_TOUCH_MODE: ::std::os::raw::c_uint = 6; pub type _bindgen_ty_12 = ::std::os::raw::c_uint; pub const AKEY_EVENT_ACTION_DOWN: ::std::os::raw::c_uint = 0; pub const AKEY_EVENT_ACTION_UP: ::std::os::raw::c_uint = 1; @@ -6049,13 +5164,7 @@ pub const AMOTION_EVENT_TOOL_TYPE_FINGER: ::std::os::raw::c_uint = 1; pub const AMOTION_EVENT_TOOL_TYPE_STYLUS: ::std::os::raw::c_uint = 2; pub const AMOTION_EVENT_TOOL_TYPE_MOUSE: ::std::os::raw::c_uint = 3; pub const AMOTION_EVENT_TOOL_TYPE_ERASER: ::std::os::raw::c_uint = 4; -pub const AMOTION_EVENT_TOOL_TYPE_PALM: ::std::os::raw::c_uint = 5; pub type _bindgen_ty_20 = ::std::os::raw::c_uint; -pub const AMotionClassification_AMOTION_EVENT_CLASSIFICATION_NONE: AMotionClassification = 0; -pub const AMotionClassification_AMOTION_EVENT_CLASSIFICATION_AMBIGUOUS_GESTURE: - AMotionClassification = 1; -pub const AMotionClassification_AMOTION_EVENT_CLASSIFICATION_DEEP_PRESS: AMotionClassification = 2; -pub type AMotionClassification = u32; pub const AINPUT_SOURCE_CLASS_MASK: ::std::os::raw::c_uint = 255; pub const AINPUT_SOURCE_CLASS_NONE: ::std::os::raw::c_uint = 0; pub const AINPUT_SOURCE_CLASS_BUTTON: ::std::os::raw::c_uint = 1; @@ -6077,8 +5186,6 @@ pub const AINPUT_SOURCE_MOUSE_RELATIVE: ::std::os::raw::c_uint = 131076; pub const AINPUT_SOURCE_TOUCHPAD: ::std::os::raw::c_uint = 1048584; pub const AINPUT_SOURCE_TOUCH_NAVIGATION: ::std::os::raw::c_uint = 2097152; pub const AINPUT_SOURCE_JOYSTICK: ::std::os::raw::c_uint = 16777232; -pub const AINPUT_SOURCE_HDMI: ::std::os::raw::c_uint = 33554433; -pub const AINPUT_SOURCE_SENSOR: ::std::os::raw::c_uint = 67108864; pub const AINPUT_SOURCE_ROTARY_ENCODER: ::std::os::raw::c_uint = 4194304; pub const AINPUT_SOURCE_ANY: ::std::os::raw::c_uint = 4294967040; pub type _bindgen_ty_22 = ::std::os::raw::c_uint; @@ -6105,9 +5212,6 @@ extern "C" { extern "C" { pub fn AInputEvent_getSource(event: *const AInputEvent) -> i32; } -extern "C" { - pub fn AInputEvent_release(event: *const AInputEvent); -} extern "C" { pub fn AKeyEvent_getAction(key_event: *const AInputEvent) -> i32; } @@ -6132,9 +5236,6 @@ extern "C" { extern "C" { pub fn AKeyEvent_getEventTime(key_event: *const AInputEvent) -> i64; } -extern "C" { - pub fn AKeyEvent_fromJava(env: *mut JNIEnv, keyEvent: jobject) -> *const AInputEvent; -} extern "C" { pub fn AMotionEvent_getAction(motion_event: *const AInputEvent) -> i32; } @@ -6331,15 +5432,6 @@ extern "C" { history_index: size_t, ) -> f32; } -extern "C" { - pub fn AMotionEvent_getActionButton(motion_event: *const AInputEvent) -> i32; -} -extern "C" { - pub fn AMotionEvent_getClassification(motion_event: *const AInputEvent) -> i32; -} -extern "C" { - pub fn AMotionEvent_fromJava(env: *mut JNIEnv, motionEvent: jobject) -> *const AInputEvent; -} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct imaxdiv_t { @@ -6414,52 +5506,11 @@ extern "C" { ) -> uintmax_t; } pub const ADataSpace_ADATASPACE_UNKNOWN: ADataSpace = 0; -pub const ADataSpace_STANDARD_MASK: ADataSpace = 4128768; -pub const ADataSpace_STANDARD_UNSPECIFIED: ADataSpace = 0; -pub const ADataSpace_STANDARD_BT709: ADataSpace = 65536; -pub const ADataSpace_STANDARD_BT601_625: ADataSpace = 131072; -pub const ADataSpace_STANDARD_BT601_625_UNADJUSTED: ADataSpace = 196608; -pub const ADataSpace_STANDARD_BT601_525: ADataSpace = 262144; -pub const ADataSpace_STANDARD_BT601_525_UNADJUSTED: ADataSpace = 327680; -pub const ADataSpace_STANDARD_BT2020: ADataSpace = 393216; -pub const ADataSpace_STANDARD_BT2020_CONSTANT_LUMINANCE: ADataSpace = 458752; -pub const ADataSpace_STANDARD_BT470M: ADataSpace = 524288; -pub const ADataSpace_STANDARD_FILM: ADataSpace = 589824; -pub const ADataSpace_STANDARD_DCI_P3: ADataSpace = 655360; -pub const ADataSpace_STANDARD_ADOBE_RGB: ADataSpace = 720896; -pub const ADataSpace_TRANSFER_MASK: ADataSpace = 130023424; -pub const ADataSpace_TRANSFER_UNSPECIFIED: ADataSpace = 0; -pub const ADataSpace_TRANSFER_LINEAR: ADataSpace = 4194304; -pub const ADataSpace_TRANSFER_SRGB: ADataSpace = 8388608; -pub const ADataSpace_TRANSFER_SMPTE_170M: ADataSpace = 12582912; -pub const ADataSpace_TRANSFER_GAMMA2_2: ADataSpace = 16777216; -pub const ADataSpace_TRANSFER_GAMMA2_6: ADataSpace = 20971520; -pub const ADataSpace_TRANSFER_GAMMA2_8: ADataSpace = 25165824; -pub const ADataSpace_TRANSFER_ST2084: ADataSpace = 29360128; -pub const ADataSpace_TRANSFER_HLG: ADataSpace = 33554432; -pub const ADataSpace_RANGE_MASK: ADataSpace = 939524096; -pub const ADataSpace_RANGE_UNSPECIFIED: ADataSpace = 0; -pub const ADataSpace_RANGE_FULL: ADataSpace = 134217728; -pub const ADataSpace_RANGE_LIMITED: ADataSpace = 268435456; -pub const ADataSpace_RANGE_EXTENDED: ADataSpace = 402653184; pub const ADataSpace_ADATASPACE_SCRGB_LINEAR: ADataSpace = 406913024; pub const ADataSpace_ADATASPACE_SRGB: ADataSpace = 142671872; pub const ADataSpace_ADATASPACE_SCRGB: ADataSpace = 411107328; pub const ADataSpace_ADATASPACE_DISPLAY_P3: ADataSpace = 143261696; pub const ADataSpace_ADATASPACE_BT2020_PQ: ADataSpace = 163971072; -pub const ADataSpace_ADATASPACE_BT2020_ITU_PQ: ADataSpace = 298188800; -pub const ADataSpace_ADATASPACE_ADOBE_RGB: ADataSpace = 151715840; -pub const ADataSpace_ADATASPACE_JFIF: ADataSpace = 146931712; -pub const ADataSpace_ADATASPACE_BT601_625: ADataSpace = 281149440; -pub const ADataSpace_ADATASPACE_BT601_525: ADataSpace = 281280512; -pub const ADataSpace_ADATASPACE_BT2020: ADataSpace = 147193856; -pub const ADataSpace_ADATASPACE_BT709: ADataSpace = 281083904; -pub const ADataSpace_ADATASPACE_DCI_P3: ADataSpace = 155844608; -pub const ADataSpace_ADATASPACE_SRGB_LINEAR: ADataSpace = 138477568; -pub const ADataSpace_ADATASPACE_BT2020_HLG: ADataSpace = 168165376; -pub const ADataSpace_ADATASPACE_BT2020_ITU_HLG: ADataSpace = 302383104; -pub const ADataSpace_DEPTH: ADataSpace = 4096; -pub const ADataSpace_DYNAMIC_DEPTH: ADataSpace = 4098; pub type ADataSpace = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -6540,8 +5591,6 @@ pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_D32_FLOAT_S8_UINT: AHard 52; pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_S8_UINT: AHardwareBuffer_Format = 53; pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_Y8Cb8Cr8_420: AHardwareBuffer_Format = 35; -pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_YCbCr_P010: AHardwareBuffer_Format = 54; -pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_R8_UNORM: AHardwareBuffer_Format = 56; pub type AHardwareBuffer_Format = ::std::os::raw::c_uint; pub const AHardwareBuffer_UsageFlags_AHARDWAREBUFFER_USAGE_CPU_READ_NEVER: AHardwareBuffer_UsageFlags = 0; @@ -6850,6 +5899,15 @@ extern "C" { outVirtualAddress: *mut *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } +extern "C" { + pub fn AHardwareBuffer_lockPlanes( + buffer: *mut AHardwareBuffer, + usage: u64, + fence: i32, + rect: *const ARect, + outPlanes: *mut AHardwareBuffer_Planes, + ) -> ::std::os::raw::c_int; +} extern "C" { pub fn AHardwareBuffer_unlock( buffer: *mut AHardwareBuffer, @@ -6868,15 +5926,6 @@ extern "C" { outBuffer: *mut *mut AHardwareBuffer, ) -> ::std::os::raw::c_int; } -extern "C" { - pub fn AHardwareBuffer_lockPlanes( - buffer: *mut AHardwareBuffer, - usage: u64, - fence: i32, - rect: *const ARect, - outPlanes: *mut AHardwareBuffer_Planes, - ) -> ::std::os::raw::c_int; -} extern "C" { pub fn AHardwareBuffer_isSupported(desc: *const AHardwareBuffer_Desc) -> ::std::os::raw::c_int; } @@ -6891,12 +5940,6 @@ extern "C" { outBytesPerStride: *mut i32, ) -> ::std::os::raw::c_int; } -extern "C" { - pub fn AHardwareBuffer_getId( - buffer: *const AHardwareBuffer, - outId: *mut u64, - ) -> ::std::os::raw::c_int; -} #[repr(C)] pub struct ANativeActivity { pub callbacks: *mut ANativeActivityCallbacks, @@ -7424,7 +6467,6 @@ fn bindgen_test_layout_android_poll_source() { #[doc = " See the sample named \"native-activity\" that comes with the NDK with a"] #[doc = " full usage example. Also look at the JavaDoc of NativeActivity."] #[repr(C)] -#[derive(Debug, Copy, Clone)] pub struct android_app { pub userData: *mut ::std::os::raw::c_void, pub onAppCmd: ::std::option::Option, @@ -7830,6 +6872,28 @@ extern "C" { extern "C" { pub fn android_app_detach_input_queue_looper(android_app: *mut android_app); } +extern "C" { + pub fn android_app_create( + activity: *mut ANativeActivity, + savedState: *mut ::std::os::raw::c_void, + savedStateSize: size_t, + ) -> *mut android_app; +} +extern "C" { + pub fn android_app_write_cmd(android_app: *mut android_app, cmd: i8); +} +extern "C" { + pub fn android_app_set_input(android_app: *mut android_app, inputQueue: *mut AInputQueue); +} +extern "C" { + pub fn android_app_set_window(android_app: *mut android_app, window: *mut ANativeWindow); +} +extern "C" { + pub fn android_app_set_activity_state(android_app: *mut android_app, cmd: i8); +} +extern "C" { + pub fn android_app_free(android_app: *mut android_app); +} extern "C" { #[doc = " Dummy function that used to be used to prevent the linker from stripping app"] #[doc = " glue code. No longer necessary, since __attribute__((visibility(\"default\")))"] diff --git a/android-activity/src/native_activity/ffi_i686.rs b/android-activity/src/native_activity/ffi_i686.rs index c9593f7..febea7d 100644 --- a/android-activity/src/native_activity/ffi_i686.rs +++ b/android-activity/src/native_activity/ffi_i686.rs @@ -21,13 +21,10 @@ pub const __ANDROID_API_O_MR1__: u32 = 27; pub const __ANDROID_API_P__: u32 = 28; pub const __ANDROID_API_Q__: u32 = 29; pub const __ANDROID_API_R__: u32 = 30; -pub const __ANDROID_API_S__: u32 = 31; -pub const __ANDROID_API_T__: u32 = 33; -pub const __ANDROID_NDK__: u32 = 1; -pub const __NDK_MAJOR__: u32 = 25; -pub const __NDK_MINOR__: u32 = 0; +pub const __NDK_MAJOR__: u32 = 21; +pub const __NDK_MINOR__: u32 = 1; pub const __NDK_BETA__: u32 = 0; -pub const __NDK_BUILD__: u32 = 8775105; +pub const __NDK_BUILD__: u32 = 6352462; pub const __NDK_CANARY__: u32 = 0; pub const POLLIN: u32 = 1; pub const POLLPRI: u32 = 2; @@ -308,20 +305,18 @@ pub const SIGPWR: u32 = 30; pub const SIGSYS: u32 = 31; pub const SIGUNUSED: u32 = 31; pub const __SIGRTMIN: u32 = 32; -pub const SA_RESTORER: u32 = 67108864; -pub const MINSIGSTKSZ: u32 = 2048; -pub const SIGSTKSZ: u32 = 8192; pub const SA_NOCLDSTOP: u32 = 1; pub const SA_NOCLDWAIT: u32 = 2; pub const SA_SIGINFO: u32 = 4; -pub const SA_UNSUPPORTED: u32 = 1024; -pub const SA_EXPOSE_TAGBITS: u32 = 2048; pub const SA_ONSTACK: u32 = 134217728; pub const SA_RESTART: u32 = 268435456; pub const SA_NODEFER: u32 = 1073741824; pub const SA_RESETHAND: u32 = 2147483648; pub const SA_NOMASK: u32 = 1073741824; pub const SA_ONESHOT: u32 = 2147483648; +pub const SA_RESTORER: u32 = 67108864; +pub const MINSIGSTKSZ: u32 = 2048; +pub const SIGSTKSZ: u32 = 8192; pub const SIG_BLOCK: u32 = 0; pub const SIG_UNBLOCK: u32 = 1; pub const SIG_SETMASK: u32 = 2; @@ -371,9 +366,7 @@ pub const SEGV_PKUERR: u32 = 4; pub const SEGV_ACCADI: u32 = 5; pub const SEGV_ADIDERR: u32 = 6; pub const SEGV_ADIPERR: u32 = 7; -pub const SEGV_MTEAERR: u32 = 8; -pub const SEGV_MTESERR: u32 = 9; -pub const NSIGSEGV: u32 = 9; +pub const NSIGSEGV: u32 = 7; pub const BUS_ADRALN: u32 = 1; pub const BUS_ADRERR: u32 = 2; pub const BUS_OBJERR: u32 = 3; @@ -385,8 +378,7 @@ pub const TRAP_TRACE: u32 = 2; pub const TRAP_BRANCH: u32 = 3; pub const TRAP_HWBKPT: u32 = 4; pub const TRAP_UNK: u32 = 5; -pub const TRAP_PERF: u32 = 6; -pub const NSIGTRAP: u32 = 6; +pub const NSIGTRAP: u32 = 5; pub const CLD_EXITED: u32 = 1; pub const CLD_KILLED: u32 = 2; pub const CLD_DUMPED: u32 = 3; @@ -402,8 +394,7 @@ pub const POLL_PRI: u32 = 5; pub const POLL_HUP: u32 = 6; pub const NSIGPOLL: u32 = 6; pub const SYS_SECCOMP: u32 = 1; -pub const SYS_USER_DISPATCH: u32 = 2; -pub const NSIGSYS: u32 = 2; +pub const NSIGSYS: u32 = 1; pub const EMT_TAGOVF: u32 = 1; pub const NSIGEMT: u32 = 1; pub const SIGEV_SIGNAL: u32 = 0; @@ -449,12 +440,6 @@ pub const CLONE_NEWUSER: u32 = 268435456; pub const CLONE_NEWPID: u32 = 536870912; pub const CLONE_NEWNET: u32 = 1073741824; pub const CLONE_IO: u32 = 2147483648; -pub const CLONE_CLEAR_SIGHAND: u64 = 4294967296; -pub const CLONE_INTO_CGROUP: u64 = 8589934592; -pub const CLONE_NEWTIME: u32 = 128; -pub const CLONE_ARGS_SIZE_VER0: u32 = 64; -pub const CLONE_ARGS_SIZE_VER1: u32 = 80; -pub const CLONE_ARGS_SIZE_VER2: u32 = 88; pub const SCHED_NORMAL: u32 = 0; pub const SCHED_FIFO: u32 = 1; pub const SCHED_RR: u32 = 2; @@ -488,9 +473,6 @@ pub const PTHREAD_SCOPE_SYSTEM: u32 = 0; pub const PTHREAD_SCOPE_PROCESS: u32 = 1; pub const __GNUC_VA_LIST: u32 = 1; pub const AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT: u32 = 8; -pub const true_: u32 = 1; -pub const false_: u32 = 0; -pub const __bool_true_false_are_defined: u32 = 1; pub const __PRI_64_prefix: &[u8; 3usize] = b"ll\0"; pub const PRId8: &[u8; 2usize] = b"d\0"; pub const PRId16: &[u8; 2usize] = b"d\0"; @@ -831,7 +813,6 @@ fn bindgen_test_layout___kernel_fsid_t() { } pub type __kernel_off_t = __kernel_long_t; pub type __kernel_loff_t = ::std::os::raw::c_longlong; -pub type __kernel_old_time_t = __kernel_long_t; pub type __kernel_time_t = __kernel_long_t; pub type __kernel_time64_t = ::std::os::raw::c_longlong; pub type __kernel_clock_t = __kernel_long_t; @@ -849,236 +830,6 @@ pub type __be64 = __u64; pub type __sum16 = __u16; pub type __wsum = __u32; pub type __poll_t = ::std::os::raw::c_uint; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct pthread_attr_t { - pub flags: u32, - pub stack_base: *mut ::std::os::raw::c_void, - pub stack_size: size_t, - pub guard_size: size_t, - pub sched_policy: i32, - pub sched_priority: i32, -} -#[test] -fn bindgen_test_layout_pthread_attr_t() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(pthread_attr_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(pthread_attr_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_attr_t), - "::", - stringify!(flags) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).stack_base as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(pthread_attr_t), - "::", - stringify!(stack_base) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).stack_size as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(pthread_attr_t), - "::", - stringify!(stack_size) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).guard_size as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(pthread_attr_t), - "::", - stringify!(guard_size) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sched_policy as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(pthread_attr_t), - "::", - stringify!(sched_policy) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sched_priority as *const _ as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(pthread_attr_t), - "::", - stringify!(sched_priority) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct pthread_barrier_t { - pub __private: [i32; 8usize], -} -#[test] -fn bindgen_test_layout_pthread_barrier_t() { - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(pthread_barrier_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(pthread_barrier_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).__private as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_barrier_t), - "::", - stringify!(__private) - ) - ); -} -pub type pthread_barrierattr_t = ::std::os::raw::c_int; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct pthread_cond_t { - pub __private: [i32; 1usize], -} -#[test] -fn bindgen_test_layout_pthread_cond_t() { - assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(pthread_cond_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(pthread_cond_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).__private as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_cond_t), - "::", - stringify!(__private) - ) - ); -} -pub type pthread_condattr_t = ::std::os::raw::c_long; -pub type pthread_key_t = ::std::os::raw::c_int; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct pthread_mutex_t { - pub __private: [i32; 1usize], -} -#[test] -fn bindgen_test_layout_pthread_mutex_t() { - assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(pthread_mutex_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(pthread_mutex_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).__private as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_mutex_t), - "::", - stringify!(__private) - ) - ); -} -pub type pthread_mutexattr_t = ::std::os::raw::c_long; -pub type pthread_once_t = ::std::os::raw::c_int; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct pthread_rwlock_t { - pub __private: [i32; 10usize], -} -#[test] -fn bindgen_test_layout_pthread_rwlock_t() { - assert_eq!( - ::std::mem::size_of::(), - 40usize, - concat!("Size of: ", stringify!(pthread_rwlock_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(pthread_rwlock_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).__private as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_rwlock_t), - "::", - stringify!(__private) - ) - ); -} -pub type pthread_rwlockattr_t = ::std::os::raw::c_long; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct pthread_spinlock_t { - pub __private: [i32; 2usize], -} -#[test] -fn bindgen_test_layout_pthread_spinlock_t() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(pthread_spinlock_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(pthread_spinlock_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).__private as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_spinlock_t), - "::", - stringify!(__private) - ) - ); -} -pub type pthread_t = ::std::os::raw::c_long; pub type __gid_t = __kernel_gid32_t; pub type gid_t = __gid_t; pub type __uid_t = __kernel_uid32_t; @@ -2955,40 +2706,40 @@ fn bindgen_test_layout___kernel_itimerspec() { } #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct __kernel_old_timespec { - pub tv_sec: __kernel_old_time_t, - pub tv_nsec: ::std::os::raw::c_long, +pub struct __kernel_old_timeval { + pub tv_sec: __kernel_long_t, + pub tv_usec: __kernel_long_t, } #[test] -fn bindgen_test_layout___kernel_old_timespec() { +fn bindgen_test_layout___kernel_old_timeval() { assert_eq!( - ::std::mem::size_of::<__kernel_old_timespec>(), + ::std::mem::size_of::<__kernel_old_timeval>(), 8usize, - concat!("Size of: ", stringify!(__kernel_old_timespec)) + concat!("Size of: ", stringify!(__kernel_old_timeval)) ); assert_eq!( - ::std::mem::align_of::<__kernel_old_timespec>(), + ::std::mem::align_of::<__kernel_old_timeval>(), 4usize, - concat!("Alignment of ", stringify!(__kernel_old_timespec)) + concat!("Alignment of ", stringify!(__kernel_old_timeval)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_old_timespec>())).tv_sec as *const _ as usize }, + unsafe { &(*(::std::ptr::null::<__kernel_old_timeval>())).tv_sec as *const _ as usize }, 0usize, concat!( "Offset of field: ", - stringify!(__kernel_old_timespec), + stringify!(__kernel_old_timeval), "::", stringify!(tv_sec) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_old_timespec>())).tv_nsec as *const _ as usize }, + unsafe { &(*(::std::ptr::null::<__kernel_old_timeval>())).tv_usec as *const _ as usize }, 4usize, concat!( "Offset of field: ", - stringify!(__kernel_old_timespec), + stringify!(__kernel_old_timeval), "::", - stringify!(tv_nsec) + stringify!(tv_usec) ) ); } @@ -3034,7 +2785,7 @@ fn bindgen_test_layout___kernel_sock_timeval() { #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct timespec { - pub tv_sec: __kernel_old_time_t, + pub tv_sec: __kernel_time_t, pub tv_nsec: ::std::os::raw::c_long, } #[test] @@ -3073,7 +2824,7 @@ fn bindgen_test_layout_timespec() { #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct timeval { - pub tv_sec: __kernel_old_time_t, + pub tv_sec: __kernel_time_t, pub tv_usec: __kernel_suseconds_t, } #[test] @@ -3111,6 +2862,45 @@ fn bindgen_test_layout_timeval() { } #[repr(C)] #[derive(Debug, Copy, Clone)] +pub struct timezone { + pub tz_minuteswest: ::std::os::raw::c_int, + pub tz_dsttime: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_timezone() { + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(timezone)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(timezone)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tz_minuteswest as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(timezone), + "::", + stringify!(tz_minuteswest) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tz_dsttime as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(timezone), + "::", + stringify!(tz_dsttime) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] pub struct itimerspec { pub it_interval: timespec, pub it_value: timespec, @@ -3187,45 +2977,6 @@ fn bindgen_test_layout_itimerval() { ) ); } -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct timezone { - pub tz_minuteswest: ::std::os::raw::c_int, - pub tz_dsttime: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_timezone() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(timezone)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(timezone)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).tz_minuteswest as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(timezone), - "::", - stringify!(tz_minuteswest) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).tz_dsttime as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(timezone), - "::", - stringify!(tz_dsttime) - ) - ); -} pub type sigset_t = ::std::os::raw::c_ulong; pub type __signalfn_t = ::std::option::Option; pub type __sighandler_t = __signalfn_t; @@ -3689,11 +3440,9 @@ pub struct __sifields__bindgen_ty_5 { #[repr(C)] #[derive(Copy, Clone)] pub union __sifields__bindgen_ty_5__bindgen_ty_1 { - pub _trapno: ::std::os::raw::c_int, pub _addr_lsb: ::std::os::raw::c_short, pub _addr_bnd: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1, pub _addr_pkey: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2, - pub _perf: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3, } #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -3811,57 +3560,6 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2() { ) ); } -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3 { - pub _data: ::std::os::raw::c_ulong, - pub _type: __u32, -} -#[test] -fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3() { - assert_eq!( - ::std::mem::size_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3>(), - 8usize, - concat!( - "Size of: ", - stringify!(__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3) - ) - ); - assert_eq!( - ::std::mem::align_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3>(), - 4usize, - concat!( - "Alignment of ", - stringify!(__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3>()))._data - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3), - "::", - stringify!(_data) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3>()))._type - as *const _ as usize - }, - 4usize, - concat!( - "Offset of field: ", - stringify!(__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3), - "::", - stringify!(_type) - ) - ); -} #[test] fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1() { assert_eq!( @@ -3880,19 +3578,6 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1() { stringify!(__sifields__bindgen_ty_5__bindgen_ty_1) ) ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1>()))._trapno as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__sifields__bindgen_ty_5__bindgen_ty_1), - "::", - stringify!(_trapno) - ) - ); assert_eq!( unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1>()))._addr_lsb as *const _ @@ -3932,19 +3617,6 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1() { stringify!(_addr_pkey) ) ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1>()))._perf as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__sifields__bindgen_ty_5__bindgen_ty_1), - "::", - stringify!(_perf) - ) - ); } #[test] fn bindgen_test_layout___sifields__bindgen_ty_5() { @@ -5879,26 +5551,6 @@ extern "C" { extern "C" { pub fn psignal(__signal: ::std::os::raw::c_int, __msg: *const ::std::os::raw::c_char); } -extern "C" { - pub fn pthread_kill( - __pthread: pthread_t, - __signal: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_sigmask( - __how: ::std::os::raw::c_int, - __new_set: *const sigset_t, - __old_set: *mut sigset_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_sigmask64( - __how: ::std::os::raw::c_int, - __new_set: *const sigset64_t, - __old_set: *mut sigset64_t, - ) -> ::std::os::raw::c_int; -} extern "C" { pub fn sigqueue( __pid: pid_t, @@ -5971,7 +5623,7 @@ extern "C" { } extern "C" { pub fn select( - __max_fd_plus_one: ::std::os::raw::c_int, + __fd_count: ::std::os::raw::c_int, __read_fds: *mut fd_set, __write_fds: *mut fd_set, __exception_fds: *mut fd_set, @@ -5980,7 +5632,7 @@ extern "C" { } extern "C" { pub fn pselect( - __max_fd_plus_one: ::std::os::raw::c_int, + __fd_count: ::std::os::raw::c_int, __read_fds: *mut fd_set, __write_fds: *mut fd_set, __exception_fds: *mut fd_set, @@ -5990,7 +5642,7 @@ extern "C" { } extern "C" { pub fn pselect64( - __max_fd_plus_one: ::std::os::raw::c_int, + __fd_count: ::std::os::raw::c_int, __read_fds: *mut fd_set, __write_fds: *mut fd_set, __exception_fds: *mut fd_set, @@ -6351,15 +6003,12 @@ pub struct clone_args { pub stack: __u64, pub stack_size: __u64, pub tls: __u64, - pub set_tid: __u64, - pub set_tid_size: __u64, - pub cgroup: __u64, } #[test] fn bindgen_test_layout_clone_args() { assert_eq!( ::std::mem::size_of::(), - 88usize, + 64usize, concat!("Size of: ", stringify!(clone_args)) ); assert_eq!( @@ -6447,36 +6096,6 @@ fn bindgen_test_layout_clone_args() { stringify!(tls) ) ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).set_tid as *const _ as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(clone_args), - "::", - stringify!(set_tid) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).set_tid_size as *const _ as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(clone_args), - "::", - stringify!(set_tid_size) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).cgroup as *const _ as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(clone_args), - "::", - stringify!(cgroup) - ) - ); } #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -6544,506 +6163,6 @@ pub type _bindgen_ty_2 = ::std::os::raw::c_uint; pub const PTHREAD_RWLOCK_PREFER_READER_NP: ::std::os::raw::c_uint = 0; pub const PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP: ::std::os::raw::c_uint = 1; pub type _bindgen_ty_3 = ::std::os::raw::c_uint; -extern "C" { - pub fn pthread_atfork( - __prepare: ::std::option::Option, - __parent: ::std::option::Option, - __child: ::std::option::Option, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_destroy(__attr: *mut pthread_attr_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_getdetachstate( - __attr: *const pthread_attr_t, - __state: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_getguardsize( - __attr: *const pthread_attr_t, - __size: *mut size_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_getinheritsched( - __attr: *const pthread_attr_t, - __flag: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_getschedparam( - __attr: *const pthread_attr_t, - __param: *mut sched_param, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_getschedpolicy( - __attr: *const pthread_attr_t, - __policy: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_getscope( - __attr: *const pthread_attr_t, - __scope: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_getstack( - __attr: *const pthread_attr_t, - __addr: *mut *mut ::std::os::raw::c_void, - __size: *mut size_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_getstacksize( - __attr: *const pthread_attr_t, - __size: *mut size_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_init(__attr: *mut pthread_attr_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_setdetachstate( - __attr: *mut pthread_attr_t, - __state: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_setguardsize( - __attr: *mut pthread_attr_t, - __size: size_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_setinheritsched( - __attr: *mut pthread_attr_t, - __flag: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_setschedparam( - __attr: *mut pthread_attr_t, - __param: *const sched_param, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_setschedpolicy( - __attr: *mut pthread_attr_t, - __policy: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_setscope( - __attr: *mut pthread_attr_t, - __scope: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_setstack( - __attr: *mut pthread_attr_t, - __addr: *mut ::std::os::raw::c_void, - __size: size_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_setstacksize( - __addr: *mut pthread_attr_t, - __size: size_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_condattr_destroy(__attr: *mut pthread_condattr_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_condattr_getclock( - __attr: *const pthread_condattr_t, - __clock: *mut clockid_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_condattr_getpshared( - __attr: *const pthread_condattr_t, - __shared: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_condattr_init(__attr: *mut pthread_condattr_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_condattr_setclock( - __attr: *mut pthread_condattr_t, - __clock: clockid_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_condattr_setpshared( - __attr: *mut pthread_condattr_t, - __shared: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_cond_broadcast(__cond: *mut pthread_cond_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_cond_clockwait( - __cond: *mut pthread_cond_t, - __mutex: *mut pthread_mutex_t, - __clock: clockid_t, - __timeout: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_cond_destroy(__cond: *mut pthread_cond_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_cond_init( - __cond: *mut pthread_cond_t, - __attr: *const pthread_condattr_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_cond_signal(__cond: *mut pthread_cond_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_cond_timedwait( - __cond: *mut pthread_cond_t, - __mutex: *mut pthread_mutex_t, - __timeout: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_cond_timedwait_monotonic_np( - __cond: *mut pthread_cond_t, - __mutex: *mut pthread_mutex_t, - __timeout: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_cond_wait( - __cond: *mut pthread_cond_t, - __mutex: *mut pthread_mutex_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_create( - __pthread_ptr: *mut pthread_t, - __attr: *const pthread_attr_t, - __start_routine: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_void, - >, - arg1: *mut ::std::os::raw::c_void, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_detach(__pthread: pthread_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_exit(__return_value: *mut ::std::os::raw::c_void); -} -extern "C" { - pub fn pthread_equal(__lhs: pthread_t, __rhs: pthread_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_getattr_np( - __pthread: pthread_t, - __attr: *mut pthread_attr_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_getcpuclockid( - __pthread: pthread_t, - __clock: *mut clockid_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_getschedparam( - __pthread: pthread_t, - __policy: *mut ::std::os::raw::c_int, - __param: *mut sched_param, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_getspecific(__key: pthread_key_t) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn pthread_gettid_np(__pthread: pthread_t) -> pid_t; -} -extern "C" { - pub fn pthread_join( - __pthread: pthread_t, - __return_value_ptr: *mut *mut ::std::os::raw::c_void, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_key_create( - __key_ptr: *mut pthread_key_t, - __key_destructor: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void), - >, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_key_delete(__key: pthread_key_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutexattr_destroy(__attr: *mut pthread_mutexattr_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutexattr_getpshared( - __attr: *const pthread_mutexattr_t, - __shared: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutexattr_gettype( - __attr: *const pthread_mutexattr_t, - __type: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutexattr_getprotocol( - __attr: *const pthread_mutexattr_t, - __protocol: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutexattr_init(__attr: *mut pthread_mutexattr_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutexattr_setpshared( - __attr: *mut pthread_mutexattr_t, - __shared: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutexattr_settype( - __attr: *mut pthread_mutexattr_t, - __type: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutexattr_setprotocol( - __attr: *mut pthread_mutexattr_t, - __protocol: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutex_clocklock( - __mutex: *mut pthread_mutex_t, - __clock: clockid_t, - __abstime: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutex_destroy(__mutex: *mut pthread_mutex_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutex_init( - __mutex: *mut pthread_mutex_t, - __attr: *const pthread_mutexattr_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutex_lock(__mutex: *mut pthread_mutex_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutex_timedlock( - __mutex: *mut pthread_mutex_t, - __timeout: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutex_timedlock_monotonic_np( - __mutex: *mut pthread_mutex_t, - __timeout: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutex_trylock(__mutex: *mut pthread_mutex_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutex_unlock(__mutex: *mut pthread_mutex_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_once( - __once: *mut pthread_once_t, - __init_routine: ::std::option::Option, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlockattr_init(__attr: *mut pthread_rwlockattr_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlockattr_destroy(__attr: *mut pthread_rwlockattr_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlockattr_getpshared( - __attr: *const pthread_rwlockattr_t, - __shared: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlockattr_setpshared( - __attr: *mut pthread_rwlockattr_t, - __shared: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlockattr_getkind_np( - __attr: *const pthread_rwlockattr_t, - __kind: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlockattr_setkind_np( - __attr: *mut pthread_rwlockattr_t, - __kind: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_clockrdlock( - __rwlock: *mut pthread_rwlock_t, - __clock: clockid_t, - __timeout: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_clockwrlock( - __rwlock: *mut pthread_rwlock_t, - __clock: clockid_t, - __timeout: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_destroy(__rwlock: *mut pthread_rwlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_init( - __rwlock: *mut pthread_rwlock_t, - __attr: *const pthread_rwlockattr_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_rdlock(__rwlock: *mut pthread_rwlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_timedrdlock( - __rwlock: *mut pthread_rwlock_t, - __timeout: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_timedrdlock_monotonic_np( - __rwlock: *mut pthread_rwlock_t, - __timeout: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_timedwrlock( - __rwlock: *mut pthread_rwlock_t, - __timeout: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_timedwrlock_monotonic_np( - __rwlock: *mut pthread_rwlock_t, - __timeout: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_tryrdlock(__rwlock: *mut pthread_rwlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_trywrlock(__rwlock: *mut pthread_rwlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_unlock(__rwlock: *mut pthread_rwlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_wrlock(__rwlock: *mut pthread_rwlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_barrierattr_init(__attr: *mut pthread_barrierattr_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_barrierattr_destroy(__attr: *mut pthread_barrierattr_t) - -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_barrierattr_getpshared( - __attr: *const pthread_barrierattr_t, - __shared: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_barrierattr_setpshared( - __attr: *mut pthread_barrierattr_t, - __shared: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_barrier_init( - __barrier: *mut pthread_barrier_t, - __attr: *const pthread_barrierattr_t, - __count: ::std::os::raw::c_uint, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_barrier_destroy(__barrier: *mut pthread_barrier_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_barrier_wait(__barrier: *mut pthread_barrier_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_spin_destroy(__spinlock: *mut pthread_spinlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_spin_init( - __spinlock: *mut pthread_spinlock_t, - __shared: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_spin_lock(__spinlock: *mut pthread_spinlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_spin_trylock(__spinlock: *mut pthread_spinlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_spin_unlock(__spinlock: *mut pthread_spinlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_self() -> pthread_t; -} -extern "C" { - pub fn pthread_setname_np( - __pthread: pthread_t, - __name: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_setschedparam( - __pthread: pthread_t, - __policy: ::std::os::raw::c_int, - __param: *const sched_param, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_setschedprio( - __pthread: pthread_t, - __priority: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_setspecific( - __key: pthread_key_t, - __value: *const ::std::os::raw::c_void, - ) -> ::std::os::raw::c_int; -} pub type __pthread_cleanup_func_t = ::std::option::Option; #[repr(C)] @@ -7690,10 +6809,6 @@ pub struct AInputEvent { } pub const AINPUT_EVENT_TYPE_KEY: ::std::os::raw::c_uint = 1; pub const AINPUT_EVENT_TYPE_MOTION: ::std::os::raw::c_uint = 2; -pub const AINPUT_EVENT_TYPE_FOCUS: ::std::os::raw::c_uint = 3; -pub const AINPUT_EVENT_TYPE_CAPTURE: ::std::os::raw::c_uint = 4; -pub const AINPUT_EVENT_TYPE_DRAG: ::std::os::raw::c_uint = 5; -pub const AINPUT_EVENT_TYPE_TOUCH_MODE: ::std::os::raw::c_uint = 6; pub type _bindgen_ty_12 = ::std::os::raw::c_uint; pub const AKEY_EVENT_ACTION_DOWN: ::std::os::raw::c_uint = 0; pub const AKEY_EVENT_ACTION_UP: ::std::os::raw::c_uint = 1; @@ -7794,13 +6909,7 @@ pub const AMOTION_EVENT_TOOL_TYPE_FINGER: ::std::os::raw::c_uint = 1; pub const AMOTION_EVENT_TOOL_TYPE_STYLUS: ::std::os::raw::c_uint = 2; pub const AMOTION_EVENT_TOOL_TYPE_MOUSE: ::std::os::raw::c_uint = 3; pub const AMOTION_EVENT_TOOL_TYPE_ERASER: ::std::os::raw::c_uint = 4; -pub const AMOTION_EVENT_TOOL_TYPE_PALM: ::std::os::raw::c_uint = 5; pub type _bindgen_ty_20 = ::std::os::raw::c_uint; -pub const AMotionClassification_AMOTION_EVENT_CLASSIFICATION_NONE: AMotionClassification = 0; -pub const AMotionClassification_AMOTION_EVENT_CLASSIFICATION_AMBIGUOUS_GESTURE: - AMotionClassification = 1; -pub const AMotionClassification_AMOTION_EVENT_CLASSIFICATION_DEEP_PRESS: AMotionClassification = 2; -pub type AMotionClassification = u32; pub const AINPUT_SOURCE_CLASS_MASK: ::std::os::raw::c_uint = 255; pub const AINPUT_SOURCE_CLASS_NONE: ::std::os::raw::c_uint = 0; pub const AINPUT_SOURCE_CLASS_BUTTON: ::std::os::raw::c_uint = 1; @@ -7822,8 +6931,6 @@ pub const AINPUT_SOURCE_MOUSE_RELATIVE: ::std::os::raw::c_uint = 131076; pub const AINPUT_SOURCE_TOUCHPAD: ::std::os::raw::c_uint = 1048584; pub const AINPUT_SOURCE_TOUCH_NAVIGATION: ::std::os::raw::c_uint = 2097152; pub const AINPUT_SOURCE_JOYSTICK: ::std::os::raw::c_uint = 16777232; -pub const AINPUT_SOURCE_HDMI: ::std::os::raw::c_uint = 33554433; -pub const AINPUT_SOURCE_SENSOR: ::std::os::raw::c_uint = 67108864; pub const AINPUT_SOURCE_ROTARY_ENCODER: ::std::os::raw::c_uint = 4194304; pub const AINPUT_SOURCE_ANY: ::std::os::raw::c_uint = 4294967040; pub type _bindgen_ty_22 = ::std::os::raw::c_uint; @@ -7850,9 +6957,6 @@ extern "C" { extern "C" { pub fn AInputEvent_getSource(event: *const AInputEvent) -> i32; } -extern "C" { - pub fn AInputEvent_release(event: *const AInputEvent); -} extern "C" { pub fn AKeyEvent_getAction(key_event: *const AInputEvent) -> i32; } @@ -7877,9 +6981,6 @@ extern "C" { extern "C" { pub fn AKeyEvent_getEventTime(key_event: *const AInputEvent) -> i64; } -extern "C" { - pub fn AKeyEvent_fromJava(env: *mut JNIEnv, keyEvent: jobject) -> *const AInputEvent; -} extern "C" { pub fn AMotionEvent_getAction(motion_event: *const AInputEvent) -> i32; } @@ -8076,15 +7177,6 @@ extern "C" { history_index: size_t, ) -> f32; } -extern "C" { - pub fn AMotionEvent_getActionButton(motion_event: *const AInputEvent) -> i32; -} -extern "C" { - pub fn AMotionEvent_getClassification(motion_event: *const AInputEvent) -> i32; -} -extern "C" { - pub fn AMotionEvent_fromJava(env: *mut JNIEnv, motionEvent: jobject) -> *const AInputEvent; -} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct imaxdiv_t { @@ -8159,52 +7251,11 @@ extern "C" { ) -> uintmax_t; } pub const ADataSpace_ADATASPACE_UNKNOWN: ADataSpace = 0; -pub const ADataSpace_STANDARD_MASK: ADataSpace = 4128768; -pub const ADataSpace_STANDARD_UNSPECIFIED: ADataSpace = 0; -pub const ADataSpace_STANDARD_BT709: ADataSpace = 65536; -pub const ADataSpace_STANDARD_BT601_625: ADataSpace = 131072; -pub const ADataSpace_STANDARD_BT601_625_UNADJUSTED: ADataSpace = 196608; -pub const ADataSpace_STANDARD_BT601_525: ADataSpace = 262144; -pub const ADataSpace_STANDARD_BT601_525_UNADJUSTED: ADataSpace = 327680; -pub const ADataSpace_STANDARD_BT2020: ADataSpace = 393216; -pub const ADataSpace_STANDARD_BT2020_CONSTANT_LUMINANCE: ADataSpace = 458752; -pub const ADataSpace_STANDARD_BT470M: ADataSpace = 524288; -pub const ADataSpace_STANDARD_FILM: ADataSpace = 589824; -pub const ADataSpace_STANDARD_DCI_P3: ADataSpace = 655360; -pub const ADataSpace_STANDARD_ADOBE_RGB: ADataSpace = 720896; -pub const ADataSpace_TRANSFER_MASK: ADataSpace = 130023424; -pub const ADataSpace_TRANSFER_UNSPECIFIED: ADataSpace = 0; -pub const ADataSpace_TRANSFER_LINEAR: ADataSpace = 4194304; -pub const ADataSpace_TRANSFER_SRGB: ADataSpace = 8388608; -pub const ADataSpace_TRANSFER_SMPTE_170M: ADataSpace = 12582912; -pub const ADataSpace_TRANSFER_GAMMA2_2: ADataSpace = 16777216; -pub const ADataSpace_TRANSFER_GAMMA2_6: ADataSpace = 20971520; -pub const ADataSpace_TRANSFER_GAMMA2_8: ADataSpace = 25165824; -pub const ADataSpace_TRANSFER_ST2084: ADataSpace = 29360128; -pub const ADataSpace_TRANSFER_HLG: ADataSpace = 33554432; -pub const ADataSpace_RANGE_MASK: ADataSpace = 939524096; -pub const ADataSpace_RANGE_UNSPECIFIED: ADataSpace = 0; -pub const ADataSpace_RANGE_FULL: ADataSpace = 134217728; -pub const ADataSpace_RANGE_LIMITED: ADataSpace = 268435456; -pub const ADataSpace_RANGE_EXTENDED: ADataSpace = 402653184; pub const ADataSpace_ADATASPACE_SCRGB_LINEAR: ADataSpace = 406913024; pub const ADataSpace_ADATASPACE_SRGB: ADataSpace = 142671872; pub const ADataSpace_ADATASPACE_SCRGB: ADataSpace = 411107328; pub const ADataSpace_ADATASPACE_DISPLAY_P3: ADataSpace = 143261696; pub const ADataSpace_ADATASPACE_BT2020_PQ: ADataSpace = 163971072; -pub const ADataSpace_ADATASPACE_BT2020_ITU_PQ: ADataSpace = 298188800; -pub const ADataSpace_ADATASPACE_ADOBE_RGB: ADataSpace = 151715840; -pub const ADataSpace_ADATASPACE_JFIF: ADataSpace = 146931712; -pub const ADataSpace_ADATASPACE_BT601_625: ADataSpace = 281149440; -pub const ADataSpace_ADATASPACE_BT601_525: ADataSpace = 281280512; -pub const ADataSpace_ADATASPACE_BT2020: ADataSpace = 147193856; -pub const ADataSpace_ADATASPACE_BT709: ADataSpace = 281083904; -pub const ADataSpace_ADATASPACE_DCI_P3: ADataSpace = 155844608; -pub const ADataSpace_ADATASPACE_SRGB_LINEAR: ADataSpace = 138477568; -pub const ADataSpace_ADATASPACE_BT2020_HLG: ADataSpace = 168165376; -pub const ADataSpace_ADATASPACE_BT2020_ITU_HLG: ADataSpace = 302383104; -pub const ADataSpace_DEPTH: ADataSpace = 4096; -pub const ADataSpace_DYNAMIC_DEPTH: ADataSpace = 4098; pub type ADataSpace = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -8285,8 +7336,6 @@ pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_D32_FLOAT_S8_UINT: AHard 52; pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_S8_UINT: AHardwareBuffer_Format = 53; pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_Y8Cb8Cr8_420: AHardwareBuffer_Format = 35; -pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_YCbCr_P010: AHardwareBuffer_Format = 54; -pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_R8_UNORM: AHardwareBuffer_Format = 56; pub type AHardwareBuffer_Format = ::std::os::raw::c_uint; pub const AHardwareBuffer_UsageFlags_AHARDWAREBUFFER_USAGE_CPU_READ_NEVER: AHardwareBuffer_UsageFlags = 0; @@ -8595,6 +7644,15 @@ extern "C" { outVirtualAddress: *mut *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } +extern "C" { + pub fn AHardwareBuffer_lockPlanes( + buffer: *mut AHardwareBuffer, + usage: u64, + fence: i32, + rect: *const ARect, + outPlanes: *mut AHardwareBuffer_Planes, + ) -> ::std::os::raw::c_int; +} extern "C" { pub fn AHardwareBuffer_unlock( buffer: *mut AHardwareBuffer, @@ -8613,15 +7671,6 @@ extern "C" { outBuffer: *mut *mut AHardwareBuffer, ) -> ::std::os::raw::c_int; } -extern "C" { - pub fn AHardwareBuffer_lockPlanes( - buffer: *mut AHardwareBuffer, - usage: u64, - fence: i32, - rect: *const ARect, - outPlanes: *mut AHardwareBuffer_Planes, - ) -> ::std::os::raw::c_int; -} extern "C" { pub fn AHardwareBuffer_isSupported(desc: *const AHardwareBuffer_Desc) -> ::std::os::raw::c_int; } @@ -8636,12 +7685,6 @@ extern "C" { outBytesPerStride: *mut i32, ) -> ::std::os::raw::c_int; } -extern "C" { - pub fn AHardwareBuffer_getId( - buffer: *const AHardwareBuffer, - outId: *mut u64, - ) -> ::std::os::raw::c_int; -} #[repr(C)] pub struct ANativeActivity { pub callbacks: *mut ANativeActivityCallbacks, @@ -9169,7 +8212,6 @@ fn bindgen_test_layout_android_poll_source() { #[doc = " See the sample named \"native-activity\" that comes with the NDK with a"] #[doc = " full usage example. Also look at the JavaDoc of NativeActivity."] #[repr(C)] -#[derive(Debug, Copy, Clone)] pub struct android_app { pub userData: *mut ::std::os::raw::c_void, pub onAppCmd: ::std::option::Option, @@ -9575,6 +8617,28 @@ extern "C" { extern "C" { pub fn android_app_detach_input_queue_looper(android_app: *mut android_app); } +extern "C" { + pub fn android_app_create( + activity: *mut ANativeActivity, + savedState: *mut ::std::os::raw::c_void, + savedStateSize: size_t, + ) -> *mut android_app; +} +extern "C" { + pub fn android_app_write_cmd(android_app: *mut android_app, cmd: i8); +} +extern "C" { + pub fn android_app_set_input(android_app: *mut android_app, inputQueue: *mut AInputQueue); +} +extern "C" { + pub fn android_app_set_window(android_app: *mut android_app, window: *mut ANativeWindow); +} +extern "C" { + pub fn android_app_set_activity_state(android_app: *mut android_app, cmd: i8); +} +extern "C" { + pub fn android_app_free(android_app: *mut android_app); +} extern "C" { #[doc = " Dummy function that used to be used to prevent the linker from stripping app"] #[doc = " glue code. No longer necessary, since __attribute__((visibility(\"default\")))"] diff --git a/android-activity/src/native_activity/ffi_x86_64.rs b/android-activity/src/native_activity/ffi_x86_64.rs index 4919340..8ed9c94 100644 --- a/android-activity/src/native_activity/ffi_x86_64.rs +++ b/android-activity/src/native_activity/ffi_x86_64.rs @@ -21,13 +21,10 @@ pub const __ANDROID_API_O_MR1__: u32 = 27; pub const __ANDROID_API_P__: u32 = 28; pub const __ANDROID_API_Q__: u32 = 29; pub const __ANDROID_API_R__: u32 = 30; -pub const __ANDROID_API_S__: u32 = 31; -pub const __ANDROID_API_T__: u32 = 33; -pub const __ANDROID_NDK__: u32 = 1; -pub const __NDK_MAJOR__: u32 = 25; -pub const __NDK_MINOR__: u32 = 0; +pub const __NDK_MAJOR__: u32 = 21; +pub const __NDK_MINOR__: u32 = 1; pub const __NDK_BETA__: u32 = 0; -pub const __NDK_BUILD__: u32 = 8775105; +pub const __NDK_BUILD__: u32 = 6352462; pub const __NDK_CANARY__: u32 = 0; pub const POLLIN: u32 = 1; pub const POLLPRI: u32 = 2; @@ -302,20 +299,18 @@ pub const SIGPWR: u32 = 30; pub const SIGSYS: u32 = 31; pub const SIGUNUSED: u32 = 31; pub const __SIGRTMIN: u32 = 32; -pub const SA_RESTORER: u32 = 67108864; -pub const MINSIGSTKSZ: u32 = 2048; -pub const SIGSTKSZ: u32 = 8192; pub const SA_NOCLDSTOP: u32 = 1; pub const SA_NOCLDWAIT: u32 = 2; pub const SA_SIGINFO: u32 = 4; -pub const SA_UNSUPPORTED: u32 = 1024; -pub const SA_EXPOSE_TAGBITS: u32 = 2048; pub const SA_ONSTACK: u32 = 134217728; pub const SA_RESTART: u32 = 268435456; pub const SA_NODEFER: u32 = 1073741824; pub const SA_RESETHAND: u32 = 2147483648; pub const SA_NOMASK: u32 = 1073741824; pub const SA_ONESHOT: u32 = 2147483648; +pub const SA_RESTORER: u32 = 67108864; +pub const MINSIGSTKSZ: u32 = 2048; +pub const SIGSTKSZ: u32 = 8192; pub const SIG_BLOCK: u32 = 0; pub const SIG_UNBLOCK: u32 = 1; pub const SIG_SETMASK: u32 = 2; @@ -365,9 +360,7 @@ pub const SEGV_PKUERR: u32 = 4; pub const SEGV_ACCADI: u32 = 5; pub const SEGV_ADIDERR: u32 = 6; pub const SEGV_ADIPERR: u32 = 7; -pub const SEGV_MTEAERR: u32 = 8; -pub const SEGV_MTESERR: u32 = 9; -pub const NSIGSEGV: u32 = 9; +pub const NSIGSEGV: u32 = 7; pub const BUS_ADRALN: u32 = 1; pub const BUS_ADRERR: u32 = 2; pub const BUS_OBJERR: u32 = 3; @@ -379,8 +372,7 @@ pub const TRAP_TRACE: u32 = 2; pub const TRAP_BRANCH: u32 = 3; pub const TRAP_HWBKPT: u32 = 4; pub const TRAP_UNK: u32 = 5; -pub const TRAP_PERF: u32 = 6; -pub const NSIGTRAP: u32 = 6; +pub const NSIGTRAP: u32 = 5; pub const CLD_EXITED: u32 = 1; pub const CLD_KILLED: u32 = 2; pub const CLD_DUMPED: u32 = 3; @@ -396,8 +388,7 @@ pub const POLL_PRI: u32 = 5; pub const POLL_HUP: u32 = 6; pub const NSIGPOLL: u32 = 6; pub const SYS_SECCOMP: u32 = 1; -pub const SYS_USER_DISPATCH: u32 = 2; -pub const NSIGSYS: u32 = 2; +pub const NSIGSYS: u32 = 1; pub const EMT_TAGOVF: u32 = 1; pub const NSIGEMT: u32 = 1; pub const SIGEV_SIGNAL: u32 = 0; @@ -442,12 +433,6 @@ pub const CLONE_NEWUSER: u32 = 268435456; pub const CLONE_NEWPID: u32 = 536870912; pub const CLONE_NEWNET: u32 = 1073741824; pub const CLONE_IO: u32 = 2147483648; -pub const CLONE_CLEAR_SIGHAND: u64 = 4294967296; -pub const CLONE_INTO_CGROUP: u64 = 8589934592; -pub const CLONE_NEWTIME: u32 = 128; -pub const CLONE_ARGS_SIZE_VER0: u32 = 64; -pub const CLONE_ARGS_SIZE_VER1: u32 = 80; -pub const CLONE_ARGS_SIZE_VER2: u32 = 88; pub const SCHED_NORMAL: u32 = 0; pub const SCHED_FIFO: u32 = 1; pub const SCHED_RR: u32 = 2; @@ -481,9 +466,6 @@ pub const PTHREAD_SCOPE_SYSTEM: u32 = 0; pub const PTHREAD_SCOPE_PROCESS: u32 = 1; pub const __GNUC_VA_LIST: u32 = 1; pub const AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT: u32 = 8; -pub const true_: u32 = 1; -pub const false_: u32 = 0; -pub const __bool_true_false_are_defined: u32 = 1; pub const __PRI_64_prefix: &[u8; 2usize] = b"l\0"; pub const __PRI_PTR_prefix: &[u8; 2usize] = b"l\0"; pub const __PRI_FAST_prefix: &[u8; 2usize] = b"l\0"; @@ -860,7 +842,6 @@ fn bindgen_test_layout___kernel_fsid_t() { } pub type __kernel_off_t = __kernel_long_t; pub type __kernel_loff_t = ::std::os::raw::c_longlong; -pub type __kernel_old_time_t = __kernel_long_t; pub type __kernel_time_t = __kernel_long_t; pub type __kernel_time64_t = ::std::os::raw::c_longlong; pub type __kernel_clock_t = __kernel_long_t; @@ -878,247 +859,6 @@ pub type __be64 = __u64; pub type __sum16 = __u16; pub type __wsum = __u32; pub type __poll_t = ::std::os::raw::c_uint; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct pthread_attr_t { - pub flags: u32, - pub stack_base: *mut ::std::os::raw::c_void, - pub stack_size: size_t, - pub guard_size: size_t, - pub sched_policy: i32, - pub sched_priority: i32, - pub __reserved: [::std::os::raw::c_char; 16usize], -} -#[test] -fn bindgen_test_layout_pthread_attr_t() { - assert_eq!( - ::std::mem::size_of::(), - 56usize, - concat!("Size of: ", stringify!(pthread_attr_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(pthread_attr_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_attr_t), - "::", - stringify!(flags) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).stack_base as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(pthread_attr_t), - "::", - stringify!(stack_base) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).stack_size as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(pthread_attr_t), - "::", - stringify!(stack_size) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).guard_size as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(pthread_attr_t), - "::", - stringify!(guard_size) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sched_policy as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(pthread_attr_t), - "::", - stringify!(sched_policy) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sched_priority as *const _ as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(pthread_attr_t), - "::", - stringify!(sched_priority) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).__reserved as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(pthread_attr_t), - "::", - stringify!(__reserved) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct pthread_barrier_t { - pub __private: [i64; 4usize], -} -#[test] -fn bindgen_test_layout_pthread_barrier_t() { - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(pthread_barrier_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(pthread_barrier_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).__private as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_barrier_t), - "::", - stringify!(__private) - ) - ); -} -pub type pthread_barrierattr_t = ::std::os::raw::c_int; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct pthread_cond_t { - pub __private: [i32; 12usize], -} -#[test] -fn bindgen_test_layout_pthread_cond_t() { - assert_eq!( - ::std::mem::size_of::(), - 48usize, - concat!("Size of: ", stringify!(pthread_cond_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(pthread_cond_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).__private as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_cond_t), - "::", - stringify!(__private) - ) - ); -} -pub type pthread_condattr_t = ::std::os::raw::c_long; -pub type pthread_key_t = ::std::os::raw::c_int; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct pthread_mutex_t { - pub __private: [i32; 10usize], -} -#[test] -fn bindgen_test_layout_pthread_mutex_t() { - assert_eq!( - ::std::mem::size_of::(), - 40usize, - concat!("Size of: ", stringify!(pthread_mutex_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(pthread_mutex_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).__private as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_mutex_t), - "::", - stringify!(__private) - ) - ); -} -pub type pthread_mutexattr_t = ::std::os::raw::c_long; -pub type pthread_once_t = ::std::os::raw::c_int; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct pthread_rwlock_t { - pub __private: [i32; 14usize], -} -#[test] -fn bindgen_test_layout_pthread_rwlock_t() { - assert_eq!( - ::std::mem::size_of::(), - 56usize, - concat!("Size of: ", stringify!(pthread_rwlock_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(pthread_rwlock_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).__private as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_rwlock_t), - "::", - stringify!(__private) - ) - ); -} -pub type pthread_rwlockattr_t = ::std::os::raw::c_long; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct pthread_spinlock_t { - pub __private: i64, -} -#[test] -fn bindgen_test_layout_pthread_spinlock_t() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(pthread_spinlock_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(pthread_spinlock_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).__private as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_spinlock_t), - "::", - stringify!(__private) - ) - ); -} -pub type pthread_t = ::std::os::raw::c_long; pub type __gid_t = __kernel_gid32_t; pub type gid_t = __gid_t; pub type __uid_t = __kernel_uid32_t; @@ -3024,40 +2764,40 @@ fn bindgen_test_layout___kernel_itimerspec() { } #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct __kernel_old_timespec { - pub tv_sec: __kernel_old_time_t, - pub tv_nsec: ::std::os::raw::c_long, +pub struct __kernel_old_timeval { + pub tv_sec: __kernel_long_t, + pub tv_usec: __kernel_long_t, } #[test] -fn bindgen_test_layout___kernel_old_timespec() { +fn bindgen_test_layout___kernel_old_timeval() { assert_eq!( - ::std::mem::size_of::<__kernel_old_timespec>(), + ::std::mem::size_of::<__kernel_old_timeval>(), 16usize, - concat!("Size of: ", stringify!(__kernel_old_timespec)) + concat!("Size of: ", stringify!(__kernel_old_timeval)) ); assert_eq!( - ::std::mem::align_of::<__kernel_old_timespec>(), + ::std::mem::align_of::<__kernel_old_timeval>(), 8usize, - concat!("Alignment of ", stringify!(__kernel_old_timespec)) + concat!("Alignment of ", stringify!(__kernel_old_timeval)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_old_timespec>())).tv_sec as *const _ as usize }, + unsafe { &(*(::std::ptr::null::<__kernel_old_timeval>())).tv_sec as *const _ as usize }, 0usize, concat!( "Offset of field: ", - stringify!(__kernel_old_timespec), + stringify!(__kernel_old_timeval), "::", stringify!(tv_sec) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_old_timespec>())).tv_nsec as *const _ as usize }, + unsafe { &(*(::std::ptr::null::<__kernel_old_timeval>())).tv_usec as *const _ as usize }, 8usize, concat!( "Offset of field: ", - stringify!(__kernel_old_timespec), + stringify!(__kernel_old_timeval), "::", - stringify!(tv_nsec) + stringify!(tv_usec) ) ); } @@ -3103,7 +2843,7 @@ fn bindgen_test_layout___kernel_sock_timeval() { #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct timespec { - pub tv_sec: __kernel_old_time_t, + pub tv_sec: __kernel_time_t, pub tv_nsec: ::std::os::raw::c_long, } #[test] @@ -3142,7 +2882,7 @@ fn bindgen_test_layout_timespec() { #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct timeval { - pub tv_sec: __kernel_old_time_t, + pub tv_sec: __kernel_time_t, pub tv_usec: __kernel_suseconds_t, } #[test] @@ -3180,6 +2920,45 @@ fn bindgen_test_layout_timeval() { } #[repr(C)] #[derive(Debug, Copy, Clone)] +pub struct timezone { + pub tz_minuteswest: ::std::os::raw::c_int, + pub tz_dsttime: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_timezone() { + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(timezone)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(timezone)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tz_minuteswest as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(timezone), + "::", + stringify!(tz_minuteswest) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tz_dsttime as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(timezone), + "::", + stringify!(tz_dsttime) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] pub struct itimerspec { pub it_interval: timespec, pub it_value: timespec, @@ -3256,45 +3035,6 @@ fn bindgen_test_layout_itimerval() { ) ); } -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct timezone { - pub tz_minuteswest: ::std::os::raw::c_int, - pub tz_dsttime: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_timezone() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(timezone)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(timezone)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).tz_minuteswest as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(timezone), - "::", - stringify!(tz_minuteswest) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).tz_dsttime as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(timezone), - "::", - stringify!(tz_dsttime) - ) - ); -} pub type sigset_t = ::std::os::raw::c_ulong; pub type __signalfn_t = ::std::option::Option; pub type __sighandler_t = __signalfn_t; @@ -3704,11 +3444,9 @@ pub struct __sifields__bindgen_ty_5 { #[repr(C)] #[derive(Copy, Clone)] pub union __sifields__bindgen_ty_5__bindgen_ty_1 { - pub _trapno: ::std::os::raw::c_int, pub _addr_lsb: ::std::os::raw::c_short, pub _addr_bnd: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1, pub _addr_pkey: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2, - pub _perf: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3, } #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -3826,57 +3564,6 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2() { ) ); } -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3 { - pub _data: ::std::os::raw::c_ulong, - pub _type: __u32, -} -#[test] -fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3() { - assert_eq!( - ::std::mem::size_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3>(), - 16usize, - concat!( - "Size of: ", - stringify!(__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3) - ) - ); - assert_eq!( - ::std::mem::align_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3>(), - 8usize, - concat!( - "Alignment of ", - stringify!(__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3>()))._data - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3), - "::", - stringify!(_data) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3>()))._type - as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3), - "::", - stringify!(_type) - ) - ); -} #[test] fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1() { assert_eq!( @@ -3895,19 +3582,6 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1() { stringify!(__sifields__bindgen_ty_5__bindgen_ty_1) ) ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1>()))._trapno as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__sifields__bindgen_ty_5__bindgen_ty_1), - "::", - stringify!(_trapno) - ) - ); assert_eq!( unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1>()))._addr_lsb as *const _ @@ -3947,19 +3621,6 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1() { stringify!(_addr_pkey) ) ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1>()))._perf as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__sifields__bindgen_ty_5__bindgen_ty_1), - "::", - stringify!(_perf) - ) - ); } #[test] fn bindgen_test_layout___sifields__bindgen_ty_5() { @@ -5909,26 +5570,6 @@ extern "C" { extern "C" { pub fn psignal(__signal: ::std::os::raw::c_int, __msg: *const ::std::os::raw::c_char); } -extern "C" { - pub fn pthread_kill( - __pthread: pthread_t, - __signal: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_sigmask( - __how: ::std::os::raw::c_int, - __new_set: *const sigset_t, - __old_set: *mut sigset_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_sigmask64( - __how: ::std::os::raw::c_int, - __new_set: *const sigset64_t, - __old_set: *mut sigset64_t, - ) -> ::std::os::raw::c_int; -} extern "C" { pub fn sigqueue( __pid: pid_t, @@ -6001,7 +5642,7 @@ extern "C" { } extern "C" { pub fn select( - __max_fd_plus_one: ::std::os::raw::c_int, + __fd_count: ::std::os::raw::c_int, __read_fds: *mut fd_set, __write_fds: *mut fd_set, __exception_fds: *mut fd_set, @@ -6010,7 +5651,7 @@ extern "C" { } extern "C" { pub fn pselect( - __max_fd_plus_one: ::std::os::raw::c_int, + __fd_count: ::std::os::raw::c_int, __read_fds: *mut fd_set, __write_fds: *mut fd_set, __exception_fds: *mut fd_set, @@ -6020,7 +5661,7 @@ extern "C" { } extern "C" { pub fn pselect64( - __max_fd_plus_one: ::std::os::raw::c_int, + __fd_count: ::std::os::raw::c_int, __read_fds: *mut fd_set, __write_fds: *mut fd_set, __exception_fds: *mut fd_set, @@ -6380,15 +6021,12 @@ pub struct clone_args { pub stack: __u64, pub stack_size: __u64, pub tls: __u64, - pub set_tid: __u64, - pub set_tid_size: __u64, - pub cgroup: __u64, } #[test] fn bindgen_test_layout_clone_args() { assert_eq!( ::std::mem::size_of::(), - 88usize, + 64usize, concat!("Size of: ", stringify!(clone_args)) ); assert_eq!( @@ -6476,36 +6114,6 @@ fn bindgen_test_layout_clone_args() { stringify!(tls) ) ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).set_tid as *const _ as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(clone_args), - "::", - stringify!(set_tid) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).set_tid_size as *const _ as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(clone_args), - "::", - stringify!(set_tid_size) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).cgroup as *const _ as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(clone_args), - "::", - stringify!(cgroup) - ) - ); } #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -6573,506 +6181,6 @@ pub type _bindgen_ty_2 = ::std::os::raw::c_uint; pub const PTHREAD_RWLOCK_PREFER_READER_NP: ::std::os::raw::c_uint = 0; pub const PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP: ::std::os::raw::c_uint = 1; pub type _bindgen_ty_3 = ::std::os::raw::c_uint; -extern "C" { - pub fn pthread_atfork( - __prepare: ::std::option::Option, - __parent: ::std::option::Option, - __child: ::std::option::Option, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_destroy(__attr: *mut pthread_attr_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_getdetachstate( - __attr: *const pthread_attr_t, - __state: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_getguardsize( - __attr: *const pthread_attr_t, - __size: *mut size_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_getinheritsched( - __attr: *const pthread_attr_t, - __flag: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_getschedparam( - __attr: *const pthread_attr_t, - __param: *mut sched_param, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_getschedpolicy( - __attr: *const pthread_attr_t, - __policy: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_getscope( - __attr: *const pthread_attr_t, - __scope: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_getstack( - __attr: *const pthread_attr_t, - __addr: *mut *mut ::std::os::raw::c_void, - __size: *mut size_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_getstacksize( - __attr: *const pthread_attr_t, - __size: *mut size_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_init(__attr: *mut pthread_attr_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_setdetachstate( - __attr: *mut pthread_attr_t, - __state: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_setguardsize( - __attr: *mut pthread_attr_t, - __size: size_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_setinheritsched( - __attr: *mut pthread_attr_t, - __flag: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_setschedparam( - __attr: *mut pthread_attr_t, - __param: *const sched_param, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_setschedpolicy( - __attr: *mut pthread_attr_t, - __policy: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_setscope( - __attr: *mut pthread_attr_t, - __scope: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_setstack( - __attr: *mut pthread_attr_t, - __addr: *mut ::std::os::raw::c_void, - __size: size_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_setstacksize( - __addr: *mut pthread_attr_t, - __size: size_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_condattr_destroy(__attr: *mut pthread_condattr_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_condattr_getclock( - __attr: *const pthread_condattr_t, - __clock: *mut clockid_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_condattr_getpshared( - __attr: *const pthread_condattr_t, - __shared: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_condattr_init(__attr: *mut pthread_condattr_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_condattr_setclock( - __attr: *mut pthread_condattr_t, - __clock: clockid_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_condattr_setpshared( - __attr: *mut pthread_condattr_t, - __shared: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_cond_broadcast(__cond: *mut pthread_cond_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_cond_clockwait( - __cond: *mut pthread_cond_t, - __mutex: *mut pthread_mutex_t, - __clock: clockid_t, - __timeout: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_cond_destroy(__cond: *mut pthread_cond_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_cond_init( - __cond: *mut pthread_cond_t, - __attr: *const pthread_condattr_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_cond_signal(__cond: *mut pthread_cond_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_cond_timedwait( - __cond: *mut pthread_cond_t, - __mutex: *mut pthread_mutex_t, - __timeout: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_cond_timedwait_monotonic_np( - __cond: *mut pthread_cond_t, - __mutex: *mut pthread_mutex_t, - __timeout: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_cond_wait( - __cond: *mut pthread_cond_t, - __mutex: *mut pthread_mutex_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_create( - __pthread_ptr: *mut pthread_t, - __attr: *const pthread_attr_t, - __start_routine: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_void, - >, - arg1: *mut ::std::os::raw::c_void, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_detach(__pthread: pthread_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_exit(__return_value: *mut ::std::os::raw::c_void); -} -extern "C" { - pub fn pthread_equal(__lhs: pthread_t, __rhs: pthread_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_getattr_np( - __pthread: pthread_t, - __attr: *mut pthread_attr_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_getcpuclockid( - __pthread: pthread_t, - __clock: *mut clockid_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_getschedparam( - __pthread: pthread_t, - __policy: *mut ::std::os::raw::c_int, - __param: *mut sched_param, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_getspecific(__key: pthread_key_t) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn pthread_gettid_np(__pthread: pthread_t) -> pid_t; -} -extern "C" { - pub fn pthread_join( - __pthread: pthread_t, - __return_value_ptr: *mut *mut ::std::os::raw::c_void, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_key_create( - __key_ptr: *mut pthread_key_t, - __key_destructor: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void), - >, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_key_delete(__key: pthread_key_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutexattr_destroy(__attr: *mut pthread_mutexattr_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutexattr_getpshared( - __attr: *const pthread_mutexattr_t, - __shared: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutexattr_gettype( - __attr: *const pthread_mutexattr_t, - __type: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutexattr_getprotocol( - __attr: *const pthread_mutexattr_t, - __protocol: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutexattr_init(__attr: *mut pthread_mutexattr_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutexattr_setpshared( - __attr: *mut pthread_mutexattr_t, - __shared: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutexattr_settype( - __attr: *mut pthread_mutexattr_t, - __type: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutexattr_setprotocol( - __attr: *mut pthread_mutexattr_t, - __protocol: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutex_clocklock( - __mutex: *mut pthread_mutex_t, - __clock: clockid_t, - __abstime: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutex_destroy(__mutex: *mut pthread_mutex_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutex_init( - __mutex: *mut pthread_mutex_t, - __attr: *const pthread_mutexattr_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutex_lock(__mutex: *mut pthread_mutex_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutex_timedlock( - __mutex: *mut pthread_mutex_t, - __timeout: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutex_timedlock_monotonic_np( - __mutex: *mut pthread_mutex_t, - __timeout: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutex_trylock(__mutex: *mut pthread_mutex_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutex_unlock(__mutex: *mut pthread_mutex_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_once( - __once: *mut pthread_once_t, - __init_routine: ::std::option::Option, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlockattr_init(__attr: *mut pthread_rwlockattr_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlockattr_destroy(__attr: *mut pthread_rwlockattr_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlockattr_getpshared( - __attr: *const pthread_rwlockattr_t, - __shared: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlockattr_setpshared( - __attr: *mut pthread_rwlockattr_t, - __shared: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlockattr_getkind_np( - __attr: *const pthread_rwlockattr_t, - __kind: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlockattr_setkind_np( - __attr: *mut pthread_rwlockattr_t, - __kind: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_clockrdlock( - __rwlock: *mut pthread_rwlock_t, - __clock: clockid_t, - __timeout: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_clockwrlock( - __rwlock: *mut pthread_rwlock_t, - __clock: clockid_t, - __timeout: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_destroy(__rwlock: *mut pthread_rwlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_init( - __rwlock: *mut pthread_rwlock_t, - __attr: *const pthread_rwlockattr_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_rdlock(__rwlock: *mut pthread_rwlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_timedrdlock( - __rwlock: *mut pthread_rwlock_t, - __timeout: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_timedrdlock_monotonic_np( - __rwlock: *mut pthread_rwlock_t, - __timeout: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_timedwrlock( - __rwlock: *mut pthread_rwlock_t, - __timeout: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_timedwrlock_monotonic_np( - __rwlock: *mut pthread_rwlock_t, - __timeout: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_tryrdlock(__rwlock: *mut pthread_rwlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_trywrlock(__rwlock: *mut pthread_rwlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_unlock(__rwlock: *mut pthread_rwlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_wrlock(__rwlock: *mut pthread_rwlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_barrierattr_init(__attr: *mut pthread_barrierattr_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_barrierattr_destroy(__attr: *mut pthread_barrierattr_t) - -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_barrierattr_getpshared( - __attr: *const pthread_barrierattr_t, - __shared: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_barrierattr_setpshared( - __attr: *mut pthread_barrierattr_t, - __shared: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_barrier_init( - __barrier: *mut pthread_barrier_t, - __attr: *const pthread_barrierattr_t, - __count: ::std::os::raw::c_uint, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_barrier_destroy(__barrier: *mut pthread_barrier_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_barrier_wait(__barrier: *mut pthread_barrier_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_spin_destroy(__spinlock: *mut pthread_spinlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_spin_init( - __spinlock: *mut pthread_spinlock_t, - __shared: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_spin_lock(__spinlock: *mut pthread_spinlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_spin_trylock(__spinlock: *mut pthread_spinlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_spin_unlock(__spinlock: *mut pthread_spinlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_self() -> pthread_t; -} -extern "C" { - pub fn pthread_setname_np( - __pthread: pthread_t, - __name: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_setschedparam( - __pthread: pthread_t, - __policy: ::std::os::raw::c_int, - __param: *const sched_param, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_setschedprio( - __pthread: pthread_t, - __priority: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_setspecific( - __key: pthread_key_t, - __value: *const ::std::os::raw::c_void, - ) -> ::std::os::raw::c_int; -} pub type __pthread_cleanup_func_t = ::std::option::Option; #[repr(C)] @@ -7719,10 +6827,6 @@ pub struct AInputEvent { } pub const AINPUT_EVENT_TYPE_KEY: ::std::os::raw::c_uint = 1; pub const AINPUT_EVENT_TYPE_MOTION: ::std::os::raw::c_uint = 2; -pub const AINPUT_EVENT_TYPE_FOCUS: ::std::os::raw::c_uint = 3; -pub const AINPUT_EVENT_TYPE_CAPTURE: ::std::os::raw::c_uint = 4; -pub const AINPUT_EVENT_TYPE_DRAG: ::std::os::raw::c_uint = 5; -pub const AINPUT_EVENT_TYPE_TOUCH_MODE: ::std::os::raw::c_uint = 6; pub type _bindgen_ty_12 = ::std::os::raw::c_uint; pub const AKEY_EVENT_ACTION_DOWN: ::std::os::raw::c_uint = 0; pub const AKEY_EVENT_ACTION_UP: ::std::os::raw::c_uint = 1; @@ -7823,13 +6927,7 @@ pub const AMOTION_EVENT_TOOL_TYPE_FINGER: ::std::os::raw::c_uint = 1; pub const AMOTION_EVENT_TOOL_TYPE_STYLUS: ::std::os::raw::c_uint = 2; pub const AMOTION_EVENT_TOOL_TYPE_MOUSE: ::std::os::raw::c_uint = 3; pub const AMOTION_EVENT_TOOL_TYPE_ERASER: ::std::os::raw::c_uint = 4; -pub const AMOTION_EVENT_TOOL_TYPE_PALM: ::std::os::raw::c_uint = 5; pub type _bindgen_ty_20 = ::std::os::raw::c_uint; -pub const AMotionClassification_AMOTION_EVENT_CLASSIFICATION_NONE: AMotionClassification = 0; -pub const AMotionClassification_AMOTION_EVENT_CLASSIFICATION_AMBIGUOUS_GESTURE: - AMotionClassification = 1; -pub const AMotionClassification_AMOTION_EVENT_CLASSIFICATION_DEEP_PRESS: AMotionClassification = 2; -pub type AMotionClassification = u32; pub const AINPUT_SOURCE_CLASS_MASK: ::std::os::raw::c_uint = 255; pub const AINPUT_SOURCE_CLASS_NONE: ::std::os::raw::c_uint = 0; pub const AINPUT_SOURCE_CLASS_BUTTON: ::std::os::raw::c_uint = 1; @@ -7851,8 +6949,6 @@ pub const AINPUT_SOURCE_MOUSE_RELATIVE: ::std::os::raw::c_uint = 131076; pub const AINPUT_SOURCE_TOUCHPAD: ::std::os::raw::c_uint = 1048584; pub const AINPUT_SOURCE_TOUCH_NAVIGATION: ::std::os::raw::c_uint = 2097152; pub const AINPUT_SOURCE_JOYSTICK: ::std::os::raw::c_uint = 16777232; -pub const AINPUT_SOURCE_HDMI: ::std::os::raw::c_uint = 33554433; -pub const AINPUT_SOURCE_SENSOR: ::std::os::raw::c_uint = 67108864; pub const AINPUT_SOURCE_ROTARY_ENCODER: ::std::os::raw::c_uint = 4194304; pub const AINPUT_SOURCE_ANY: ::std::os::raw::c_uint = 4294967040; pub type _bindgen_ty_22 = ::std::os::raw::c_uint; @@ -7879,9 +6975,6 @@ extern "C" { extern "C" { pub fn AInputEvent_getSource(event: *const AInputEvent) -> i32; } -extern "C" { - pub fn AInputEvent_release(event: *const AInputEvent); -} extern "C" { pub fn AKeyEvent_getAction(key_event: *const AInputEvent) -> i32; } @@ -7906,9 +6999,6 @@ extern "C" { extern "C" { pub fn AKeyEvent_getEventTime(key_event: *const AInputEvent) -> i64; } -extern "C" { - pub fn AKeyEvent_fromJava(env: *mut JNIEnv, keyEvent: jobject) -> *const AInputEvent; -} extern "C" { pub fn AMotionEvent_getAction(motion_event: *const AInputEvent) -> i32; } @@ -8105,15 +7195,6 @@ extern "C" { history_index: size_t, ) -> f32; } -extern "C" { - pub fn AMotionEvent_getActionButton(motion_event: *const AInputEvent) -> i32; -} -extern "C" { - pub fn AMotionEvent_getClassification(motion_event: *const AInputEvent) -> i32; -} -extern "C" { - pub fn AMotionEvent_fromJava(env: *mut JNIEnv, motionEvent: jobject) -> *const AInputEvent; -} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct imaxdiv_t { @@ -8188,52 +7269,11 @@ extern "C" { ) -> uintmax_t; } pub const ADataSpace_ADATASPACE_UNKNOWN: ADataSpace = 0; -pub const ADataSpace_STANDARD_MASK: ADataSpace = 4128768; -pub const ADataSpace_STANDARD_UNSPECIFIED: ADataSpace = 0; -pub const ADataSpace_STANDARD_BT709: ADataSpace = 65536; -pub const ADataSpace_STANDARD_BT601_625: ADataSpace = 131072; -pub const ADataSpace_STANDARD_BT601_625_UNADJUSTED: ADataSpace = 196608; -pub const ADataSpace_STANDARD_BT601_525: ADataSpace = 262144; -pub const ADataSpace_STANDARD_BT601_525_UNADJUSTED: ADataSpace = 327680; -pub const ADataSpace_STANDARD_BT2020: ADataSpace = 393216; -pub const ADataSpace_STANDARD_BT2020_CONSTANT_LUMINANCE: ADataSpace = 458752; -pub const ADataSpace_STANDARD_BT470M: ADataSpace = 524288; -pub const ADataSpace_STANDARD_FILM: ADataSpace = 589824; -pub const ADataSpace_STANDARD_DCI_P3: ADataSpace = 655360; -pub const ADataSpace_STANDARD_ADOBE_RGB: ADataSpace = 720896; -pub const ADataSpace_TRANSFER_MASK: ADataSpace = 130023424; -pub const ADataSpace_TRANSFER_UNSPECIFIED: ADataSpace = 0; -pub const ADataSpace_TRANSFER_LINEAR: ADataSpace = 4194304; -pub const ADataSpace_TRANSFER_SRGB: ADataSpace = 8388608; -pub const ADataSpace_TRANSFER_SMPTE_170M: ADataSpace = 12582912; -pub const ADataSpace_TRANSFER_GAMMA2_2: ADataSpace = 16777216; -pub const ADataSpace_TRANSFER_GAMMA2_6: ADataSpace = 20971520; -pub const ADataSpace_TRANSFER_GAMMA2_8: ADataSpace = 25165824; -pub const ADataSpace_TRANSFER_ST2084: ADataSpace = 29360128; -pub const ADataSpace_TRANSFER_HLG: ADataSpace = 33554432; -pub const ADataSpace_RANGE_MASK: ADataSpace = 939524096; -pub const ADataSpace_RANGE_UNSPECIFIED: ADataSpace = 0; -pub const ADataSpace_RANGE_FULL: ADataSpace = 134217728; -pub const ADataSpace_RANGE_LIMITED: ADataSpace = 268435456; -pub const ADataSpace_RANGE_EXTENDED: ADataSpace = 402653184; pub const ADataSpace_ADATASPACE_SCRGB_LINEAR: ADataSpace = 406913024; pub const ADataSpace_ADATASPACE_SRGB: ADataSpace = 142671872; pub const ADataSpace_ADATASPACE_SCRGB: ADataSpace = 411107328; pub const ADataSpace_ADATASPACE_DISPLAY_P3: ADataSpace = 143261696; pub const ADataSpace_ADATASPACE_BT2020_PQ: ADataSpace = 163971072; -pub const ADataSpace_ADATASPACE_BT2020_ITU_PQ: ADataSpace = 298188800; -pub const ADataSpace_ADATASPACE_ADOBE_RGB: ADataSpace = 151715840; -pub const ADataSpace_ADATASPACE_JFIF: ADataSpace = 146931712; -pub const ADataSpace_ADATASPACE_BT601_625: ADataSpace = 281149440; -pub const ADataSpace_ADATASPACE_BT601_525: ADataSpace = 281280512; -pub const ADataSpace_ADATASPACE_BT2020: ADataSpace = 147193856; -pub const ADataSpace_ADATASPACE_BT709: ADataSpace = 281083904; -pub const ADataSpace_ADATASPACE_DCI_P3: ADataSpace = 155844608; -pub const ADataSpace_ADATASPACE_SRGB_LINEAR: ADataSpace = 138477568; -pub const ADataSpace_ADATASPACE_BT2020_HLG: ADataSpace = 168165376; -pub const ADataSpace_ADATASPACE_BT2020_ITU_HLG: ADataSpace = 302383104; -pub const ADataSpace_DEPTH: ADataSpace = 4096; -pub const ADataSpace_DYNAMIC_DEPTH: ADataSpace = 4098; pub type ADataSpace = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -8314,8 +7354,6 @@ pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_D32_FLOAT_S8_UINT: AHard 52; pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_S8_UINT: AHardwareBuffer_Format = 53; pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_Y8Cb8Cr8_420: AHardwareBuffer_Format = 35; -pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_YCbCr_P010: AHardwareBuffer_Format = 54; -pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_R8_UNORM: AHardwareBuffer_Format = 56; pub type AHardwareBuffer_Format = ::std::os::raw::c_uint; pub const AHardwareBuffer_UsageFlags_AHARDWAREBUFFER_USAGE_CPU_READ_NEVER: AHardwareBuffer_UsageFlags = 0; @@ -8624,6 +7662,15 @@ extern "C" { outVirtualAddress: *mut *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } +extern "C" { + pub fn AHardwareBuffer_lockPlanes( + buffer: *mut AHardwareBuffer, + usage: u64, + fence: i32, + rect: *const ARect, + outPlanes: *mut AHardwareBuffer_Planes, + ) -> ::std::os::raw::c_int; +} extern "C" { pub fn AHardwareBuffer_unlock( buffer: *mut AHardwareBuffer, @@ -8642,15 +7689,6 @@ extern "C" { outBuffer: *mut *mut AHardwareBuffer, ) -> ::std::os::raw::c_int; } -extern "C" { - pub fn AHardwareBuffer_lockPlanes( - buffer: *mut AHardwareBuffer, - usage: u64, - fence: i32, - rect: *const ARect, - outPlanes: *mut AHardwareBuffer_Planes, - ) -> ::std::os::raw::c_int; -} extern "C" { pub fn AHardwareBuffer_isSupported(desc: *const AHardwareBuffer_Desc) -> ::std::os::raw::c_int; } @@ -8665,12 +7703,6 @@ extern "C" { outBytesPerStride: *mut i32, ) -> ::std::os::raw::c_int; } -extern "C" { - pub fn AHardwareBuffer_getId( - buffer: *const AHardwareBuffer, - outId: *mut u64, - ) -> ::std::os::raw::c_int; -} #[repr(C)] pub struct ANativeActivity { pub callbacks: *mut ANativeActivityCallbacks, @@ -9198,7 +8230,6 @@ fn bindgen_test_layout_android_poll_source() { #[doc = " See the sample named \"native-activity\" that comes with the NDK with a"] #[doc = " full usage example. Also look at the JavaDoc of NativeActivity."] #[repr(C)] -#[derive(Debug, Copy, Clone)] pub struct android_app { pub userData: *mut ::std::os::raw::c_void, pub onAppCmd: ::std::option::Option, @@ -9604,6 +8635,28 @@ extern "C" { extern "C" { pub fn android_app_detach_input_queue_looper(android_app: *mut android_app); } +extern "C" { + pub fn android_app_create( + activity: *mut ANativeActivity, + savedState: *mut ::std::os::raw::c_void, + savedStateSize: size_t, + ) -> *mut android_app; +} +extern "C" { + pub fn android_app_write_cmd(android_app: *mut android_app, cmd: i8); +} +extern "C" { + pub fn android_app_set_input(android_app: *mut android_app, inputQueue: *mut AInputQueue); +} +extern "C" { + pub fn android_app_set_window(android_app: *mut android_app, window: *mut ANativeWindow); +} +extern "C" { + pub fn android_app_set_activity_state(android_app: *mut android_app, cmd: i8); +} +extern "C" { + pub fn android_app_free(android_app: *mut android_app); +} extern "C" { #[doc = " Dummy function that used to be used to prevent the linker from stripping app"] #[doc = " glue code. No longer necessary, since __attribute__((visibility(\"default\")))"] diff --git a/android-activity/src/native_activity/mod.rs b/android-activity/src/native_activity/mod.rs index 4456001..28d8bde 100644 --- a/android-activity/src/native_activity/mod.rs +++ b/android-activity/src/native_activity/mod.rs @@ -479,26 +479,127 @@ impl AndroidAppInner { } } -// Rust doesn't give us a clean way to directly export symbols from C/C++ -// so we rename the C/C++ symbols and re-export this entrypoint from -// Rust... -// -// https://github.com/rust-lang/rfcs/issues/2771 -extern "C" { - pub fn ANativeActivity_onCreate_C( - activity: *mut std::os::raw::c_void, - savedState: *mut ::std::os::raw::c_void, - savedStateSize: usize, - ); +unsafe extern "C" fn on_destroy(activity: *mut ffi::ANativeActivity) { + log::debug!("Destroy: {:p}\n", activity); + let android_app: *mut ffi::android_app = (*activity).instance.cast(); + ffi::android_app_free(android_app); +} + +unsafe extern "C" fn on_start(activity: *mut ffi::ANativeActivity) { + log::debug!("Start: {:p}\n", activity); + + let android_app: *mut ffi::android_app = (*activity).instance.cast(); + ffi::android_app_set_activity_state(android_app, ffi::APP_CMD_START as i8); +} + +unsafe extern "C" fn on_resume(activity: *mut ffi::ANativeActivity) { + log::debug!("Resume: {:p}\n", activity); + let android_app: *mut ffi::android_app = (*activity).instance.cast(); + ffi::android_app_set_activity_state(android_app, ffi::APP_CMD_RESUME as i8); +} + +unsafe extern "C" fn on_save_instance_state(activity: *mut ffi::ANativeActivity, out_len: *mut ffi::size_t) -> *mut libc::c_void { + let android_app: *mut ffi::android_app = (*activity).instance.cast(); + let mut saved_state: *mut libc::c_void = ptr::null_mut(); + + log::debug!("SaveInstanceState: {:p}\n", activity); + libc::pthread_mutex_lock(&mut (*android_app).mutex as *mut _); + (*android_app).stateSaved = 0; + ffi::android_app_write_cmd(android_app, ffi::APP_CMD_SAVE_STATE as i8); + while (*android_app).stateSaved == 0 { + libc::pthread_cond_wait(&mut (*android_app).cond as *mut _, &mut (*android_app).mutex as *mut _); + } + + if (*android_app).savedState != ptr::null_mut() { + saved_state = (*android_app).savedState; + *out_len = (*android_app).savedStateSize; + (*android_app).savedState = ptr::null_mut(); + (*android_app).savedStateSize = 0; + } + + libc::pthread_mutex_unlock(&mut (*android_app).mutex as *mut _); + + return saved_state; +} + +unsafe extern "C" fn on_pause(activity: *mut ffi::ANativeActivity) { + log::debug!("Pause: {:p}\n", activity); + let android_app: *mut ffi::android_app = (*activity).instance.cast(); + ffi::android_app_set_activity_state(android_app, ffi::APP_CMD_PAUSE as i8); +} + +unsafe extern "C" fn on_stop(activity: *mut ffi::ANativeActivity) { + log::debug!("Stop: {:p}\n", activity); + let android_app: *mut ffi::android_app = (*activity).instance.cast(); + ffi::android_app_set_activity_state(android_app, ffi::APP_CMD_STOP as i8); +} + +unsafe extern "C" fn on_configuration_changed(activity: *mut ffi::ANativeActivity) { + log::debug!("ConfigurationChanged: {:p}\n", activity); + let android_app: *mut ffi::android_app = (*activity).instance.cast(); + ffi::android_app_write_cmd(android_app, ffi::APP_CMD_CONFIG_CHANGED as i8); +} + +unsafe extern "C" fn on_low_memory(activity: *mut ffi::ANativeActivity) { + log::debug!("LowMemory: {:p}\n", activity); + let android_app: *mut ffi::android_app = (*activity).instance.cast(); + ffi::android_app_write_cmd(android_app, ffi::APP_CMD_LOW_MEMORY as i8); +} + +unsafe extern "C" fn on_window_focus_changed(activity: *mut ffi::ANativeActivity, focused: libc::c_int) { + log::debug!("WindowFocusChanged: {:p} -- {}\n", activity, focused); + let android_app: *mut ffi::android_app = (*activity).instance.cast(); + ffi::android_app_write_cmd(android_app, + if focused != 0 { ffi::APP_CMD_GAINED_FOCUS as i8 } else { ffi::APP_CMD_LOST_FOCUS as i8}); +} + +unsafe extern "C" fn on_native_window_created(activity: *mut ffi::ANativeActivity, window: *mut ndk_sys::ANativeWindow) { + log::debug!("NativeWindowCreated: {:p} -- {:p}\n", activity, window); + let android_app: *mut ffi::android_app = (*activity).instance.cast(); + ffi::android_app_set_window(android_app, window); +} + +unsafe extern "C" fn on_native_window_destroyed(activity: *mut ffi::ANativeActivity, window: *mut ndk_sys::ANativeWindow) { + log::debug!("NativeWindowDestroyed: {:p} -- {:p}\n", activity, window); + let android_app: *mut ffi::android_app = (*activity).instance.cast(); + ffi::android_app_set_window(android_app, ptr::null_mut()); +} + +unsafe extern "C" fn on_input_queue_created(activity: *mut ffi::ANativeActivity, queue: *mut ndk_sys::AInputQueue) { + log::debug!("InputQueueCreated: {:p} -- {:p}\n", activity, queue); + let android_app: *mut ffi::android_app = (*activity).instance.cast(); + ffi::android_app_set_input(android_app, queue); +} + +unsafe extern "C" fn on_input_queue_destroyed(activity: *mut ffi::ANativeActivity, queue: *mut ndk_sys::AInputQueue) { + log::debug!("InputQueueDestroyed: {:p} -- {:p}\n", activity, queue); + let android_app: *mut ffi::android_app = (*activity).instance.cast(); + ffi::android_app_set_input(android_app, ptr::null_mut()); } #[no_mangle] unsafe extern "C" fn ANativeActivity_onCreate( - activity: *mut std::os::raw::c_void, + activity: *mut ffi::ANativeActivity, saved_state: *mut std::os::raw::c_void, saved_state_size: usize, ) { - ANativeActivity_onCreate_C(activity, saved_state, saved_state_size); + log::debug!("Creating: {:p}", activity); + + (*(*activity).callbacks).onDestroy = Some(on_destroy); + (*(*activity).callbacks).onStart = Some(on_start); + (*(*activity).callbacks).onResume = Some(on_resume); + (*(*activity).callbacks).onSaveInstanceState = Some(on_save_instance_state); + (*(*activity).callbacks).onPause = Some(on_pause); + (*(*activity).callbacks).onStop = Some(on_stop); + (*(*activity).callbacks).onConfigurationChanged = Some(on_configuration_changed); + (*(*activity).callbacks).onLowMemory = Some(on_low_memory); + (*(*activity).callbacks).onWindowFocusChanged = Some(on_window_focus_changed); + (*(*activity).callbacks).onNativeWindowCreated = Some(on_native_window_created); + (*(*activity).callbacks).onNativeWindowDestroyed = Some(on_native_window_destroyed); + (*(*activity).callbacks).onInputQueueCreated = Some(on_input_queue_created); + (*(*activity).callbacks).onInputQueueDestroyed = Some(on_input_queue_destroyed); + + (*activity).instance = ffi::android_app_create(activity, saved_state, saved_state_size as u64) as *mut _; } fn android_log(level: Level, tag: &CStr, msg: &CStr) {