From 049e6602199e27a81bddf28c209a3e028efee907 Mon Sep 17 00:00:00 2001 From: kukie Date: Tue, 23 May 2023 15:43:03 +0300 Subject: [PATCH 01/93] fix: pointer_index always returns 0 --- android-activity/src/game_activity/input.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android-activity/src/game_activity/input.rs b/android-activity/src/game_activity/input.rs index ac951be..0f29a42 100644 --- a/android-activity/src/game_activity/input.rs +++ b/android-activity/src/game_activity/input.rs @@ -332,7 +332,7 @@ impl<'a> MotionEvent<'a> { /// or [`PointerDown`](MotionAction::PointerDown). #[inline] pub fn pointer_index(&self) -> usize { - let action = self.action as u32 & ndk_sys::AMOTION_EVENT_ACTION_MASK; + let action = self.action as u32; let index = (action & ndk_sys::AMOTION_EVENT_ACTION_POINTER_INDEX_MASK) >> ndk_sys::AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT; index as usize From 3843a7cfaa04c3981c1e655db6bfa6e603924ebd Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Thu, 27 Apr 2023 22:00:43 +0100 Subject: [PATCH 02/93] Call Activity.finish() when android_main returns Calling Activity.finish() is what ensures the Activity will get gracefully destroyed, including calling the Activity's onDestroy method. Fixes: #67 --- android-activity/CHANGELOG.md | 2 + android-activity/src/game_activity/mod.rs | 73 ++++++++++++-------- android-activity/src/native_activity/glue.rs | 37 +++++++--- android-activity/src/util.rs | 40 +++++------ 4 files changed, 95 insertions(+), 57 deletions(-) diff --git a/android-activity/CHANGELOG.md b/android-activity/CHANGELOG.md index 6ddb0e1..6124643 100644 --- a/android-activity/CHANGELOG.md +++ b/android-activity/CHANGELOG.md @@ -3,6 +3,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Changed +- The `Activity.finish()` method is now called when `android_main` returns so the `Activity` will be destroyed ([#67](https://github.com/rust-mobile/android-activity/issues/67)) ## [0.4.1] - 2022-02-16 ### Added diff --git a/android-activity/src/game_activity/mod.rs b/android-activity/src/game_activity/mod.rs index 82bc3e3..d43dc6e 100644 --- a/android-activity/src/game_activity/mod.rs +++ b/android-activity/src/game_activity/mod.rs @@ -6,6 +6,7 @@ use std::io::{BufRead, BufReader}; use std::marker::PhantomData; use std::ops::Deref; use std::os::unix::prelude::*; +use std::panic::catch_unwind; use std::ptr::NonNull; use std::sync::{Arc, RwLock}; use std::time::Duration; @@ -23,7 +24,7 @@ use ndk::asset::AssetManager; use ndk::configuration::Configuration; use ndk::native_window::NativeWindow; -use crate::util::{abort_on_panic, android_log}; +use crate::util::{abort_on_panic, android_log, log_panic}; use crate::{ util, AndroidApp, ConfigurationRef, InputStatus, MainEvent, PollEvent, Rect, WindowManagerFlags, }; @@ -603,7 +604,8 @@ extern "Rust" { // `app_main` function. This is run on a dedicated thread spawned // by android_native_app_glue. #[no_mangle] -pub unsafe extern "C" fn _rust_glue_entry(app: *mut ffi::android_app) { +#[allow(unused_unsafe)] // Otherwise rust 1.64 moans about using unsafe{} in unsafe functions +pub unsafe extern "C" fn _rust_glue_entry(native_app: *mut ffi::android_app) { abort_on_panic(|| { // Maybe make this stdout/stderr redirection an optional / opt-in feature?... let mut logpipe: [RawFd; 2] = Default::default(); @@ -627,34 +629,51 @@ pub unsafe extern "C" fn _rust_glue_entry(app: *mut ffi::android_app) { } }); - let jvm: *mut JavaVM = (*(*app).activity).vm; - let activity: jobject = (*(*app).activity).javaGameActivity; - ndk_context::initialize_android_context(jvm.cast(), activity.cast()); + let jvm = unsafe { + let jvm = (*(*native_app).activity).vm; + let activity: jobject = (*(*native_app).activity).javaGameActivity; + ndk_context::initialize_android_context(jvm.cast(), activity.cast()); + + // Since this is a newly spawned thread then the JVM hasn't been attached + // to the thread yet. Attach before calling the applications main function + // so they can safely make JNI calls + let mut jenv_out: *mut core::ffi::c_void = std::ptr::null_mut(); + if let Some(attach_current_thread) = (*(*jvm)).AttachCurrentThread { + attach_current_thread(jvm, &mut jenv_out, std::ptr::null_mut()); + } - let app = AndroidApp::from_ptr(NonNull::new(app).unwrap()); + jvm + }; - // Since this is a newly spawned thread then the JVM hasn't been attached - // to the thread yet. Attach before calling the applications main function - // so they can safely make JNI calls - let mut jenv_out: *mut core::ffi::c_void = std::ptr::null_mut(); - if let Some(attach_current_thread) = (*(*jvm)).AttachCurrentThread { - attach_current_thread(jvm, &mut jenv_out, std::ptr::null_mut()); - } + unsafe { + let app = AndroidApp::from_ptr(NonNull::new(native_app).unwrap()); + + // We want to specifically catch any panic from the application's android_main + // so we can finish + destroy the Activity gracefully via the JVM + catch_unwind(|| { + // XXX: If we were in control of the Java Activity subclass then + // we could potentially run the android_main function via a Java native method + // springboard (e.g. call an Activity subclass method that calls a jni native + // method that then just calls android_main()) that would make sure there was + // a Java frame at the base of our call stack which would then be recognised + // when calling FindClass to lookup a suitable classLoader, instead of + // defaulting to the system loader. Without this then it's difficult for native + // code to look up non-standard Java classes. + android_main(app); + }) + .unwrap_or_else(|panic| log_panic(panic)); + + // Let JVM know that our Activity can be destroyed before detaching from the JVM + // + // "Note that this method can be called from any thread; it will send a message + // to the main thread of the process where the Java finish call will take place" + ffi::GameActivity_finish((*native_app).activity); - // XXX: If we were in control of the Java Activity subclass then - // we could potentially run the android_main function via a Java native method - // springboard (e.g. call an Activity subclass method that calls a jni native - // method that then just calls android_main()) that would make sure there was - // a Java frame at the base of our call stack which would then be recognised - // when calling FindClass to lookup a suitable classLoader, instead of - // defaulting to the system loader. Without this then it's difficult for native - // code to look up non-standard Java classes. - android_main(app); - - if let Some(detach_current_thread) = (*(*jvm)).DetachCurrentThread { - detach_current_thread(jvm); - } + if let Some(detach_current_thread) = (*(*jvm)).DetachCurrentThread { + detach_current_thread(jvm); + } - ndk_context::release_android_context(); + ndk_context::release_android_context(); + } }) } diff --git a/android-activity/src/native_activity/glue.rs b/android-activity/src/native_activity/glue.rs index 6af66af..64df108 100644 --- a/android-activity/src/native_activity/glue.rs +++ b/android-activity/src/native_activity/glue.rs @@ -8,6 +8,7 @@ use std::{ io::{BufRead, BufReader}, ops::Deref, os::unix::prelude::{FromRawFd, RawFd}, + panic::catch_unwind, ptr::{self, NonNull}, sync::{Arc, Condvar, Mutex, Weak}, }; @@ -15,7 +16,11 @@ use std::{ use log::Level; use ndk::{configuration::Configuration, input_queue::InputQueue, native_window::NativeWindow}; -use crate::{util::abort_on_panic, util::android_log, ConfigurationRef}; +use crate::{ + util::android_log, + util::{abort_on_panic, log_panic}, + ConfigurationRef, +}; use super::{AndroidApp, Rect}; @@ -803,6 +808,7 @@ unsafe extern "C" fn on_content_rect_changed( /// This is the native entrypoint for our cdylib library that `ANativeActivity` will look for via `dlsym` #[no_mangle] +#[allow(unused_unsafe)] // Otherwise rust 1.64 moans about using unsafe{} in unsafe functions extern "C" fn ANativeActivity_onCreate( activity: *mut ndk_sys::ANativeActivity, saved_state: *const libc::c_void, @@ -874,15 +880,26 @@ extern "C" fn ANativeActivity_onCreate( rust_glue.notify_main_thread_running(); unsafe { - // XXX: If we were in control of the Java Activity subclass then - // we could potentially run the android_main function via a Java native method - // springboard (e.g. call an Activity subclass method that calls a jni native - // method that then just calls android_main()) that would make sure there was - // a Java frame at the base of our call stack which would then be recognised - // when calling FindClass to lookup a suitable classLoader, instead of - // defaulting to the system loader. Without this then it's difficult for native - // code to look up non-standard Java classes. - android_main(app); + // We want to specifically catch any panic from the application's android_main + // so we can finish + destroy the Activity gracefully via the JVM + catch_unwind(|| { + // XXX: If we were in control of the Java Activity subclass then + // we could potentially run the android_main function via a Java native method + // springboard (e.g. call an Activity subclass method that calls a jni native + // method that then just calls android_main()) that would make sure there was + // a Java frame at the base of our call stack which would then be recognised + // when calling FindClass to lookup a suitable classLoader, instead of + // defaulting to the system loader. Without this then it's difficult for native + // code to look up non-standard Java classes. + android_main(app); + }) + .unwrap_or_else(|panic| log_panic(panic)); + + // Let JVM know that our Activity can be destroyed before detaching from the JVM + // + // "Note that this method can be called from any thread; it will send a message + // to the main thread of the process where the Java finish call will take place" + ndk_sys::ANativeActivity_finish(activity); if let Some(detach_current_thread) = (*(*jvm)).DetachCurrentThread { detach_current_thread(jvm); diff --git a/android-activity/src/util.rs b/android-activity/src/util.rs index c115328..6e04758 100644 --- a/android-activity/src/util.rs +++ b/android-activity/src/util.rs @@ -31,6 +31,25 @@ pub(crate) fn android_log(level: Level, tag: &CStr, msg: &CStr) { } } +pub(crate) fn log_panic(panic: Box) { + let rust_panic = unsafe { CStr::from_bytes_with_nul_unchecked(b"RustPanic\0") }; + + if let Some(panic) = panic.downcast_ref::() { + if let Ok(msg) = CString::new(panic.clone()) { + android_log(Level::Error, rust_panic, &msg); + } + } else if let Ok(panic) = panic.downcast::<&str>() { + if let Ok(msg) = CString::new(*panic) { + android_log(Level::Error, rust_panic, &msg); + } + } else { + let unknown_panic = unsafe { CStr::from_bytes_with_nul_unchecked(b"UnknownPanic\0") }; + android_log(Level::Error, unknown_panic, unsafe { + CStr::from_bytes_with_nul_unchecked(b"\0") + }); + } +} + /// Run a closure and abort the program if it panics. /// /// This is generally used to ensure Rust callbacks won't unwind past the JNI boundary, which leads @@ -45,26 +64,7 @@ pub(crate) fn abort_on_panic(f: impl FnOnce() -> R) -> R { // // Just in case our attempt to log a panic could itself cause a panic we use a // second catch_unwind here. - let _ = std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| { - // Try logging the panic, but abort if that fails. - let rust_panic = unsafe { CStr::from_bytes_with_nul_unchecked(b"RustPanic\0") }; - - if let Some(panic) = panic.downcast_ref::() { - if let Ok(msg) = CString::new(panic.clone()) { - android_log(Level::Error, rust_panic, &msg); - } - } else if let Ok(panic) = panic.downcast::<&str>() { - if let Ok(msg) = CString::new(*panic) { - android_log(Level::Error, rust_panic, &msg); - } - } else { - let unknown_panic = - unsafe { CStr::from_bytes_with_nul_unchecked(b"UnknownPanic\0") }; - android_log(Level::Error, unknown_panic, unsafe { - CStr::from_bytes_with_nul_unchecked(b"\0") - }); - } - })); + let _ = std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| log_panic(panic))); std::process::abort(); }) } From 4a4efd871a62a1519ea628c599a116a321b0babc Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Fri, 16 Jun 2023 17:35:53 +0200 Subject: [PATCH 03/93] README: Add badges to CI, crates.io, docs.rs and show the MSRV I was trying to quickly get to the documentation of this crate and had the GitHub page open... but there was no link on the front-page: let's fix that. --- README.md | 39 +++++++++++++++++++++-------------- android-activity/src/input.rs | 2 +- 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index b2d0dc0..7c49732 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,11 @@ -# Overview +# `android-activity` + +[![ci](https://github.com/rust-mobile/android-activity/actions/workflows/ci.yml/badge.svg)](https://github.com/rust-mobile/android-activity/actions/workflows/ci.yml) +[![crates.io](https://img.shields.io/crates/v/android-activity.svg)](https://crates.io/crates/android-activity) +[![Docs](https://docs.rs/android-activity/badge.svg)](https://docs.rs/android-activity) +[![MSRV](https://img.shields.io/badge/rustc-1.64.0+-ab6000.svg)](https://blog.rust-lang.org/2022/09/22/Rust-1.64.0.html) + +## Overview `android-activity` provides a "glue" layer for building native Rust applications on Android, supporting multiple [`Activity`] base classes. @@ -22,10 +29,11 @@ applications. [ndk-glue]: https://crates.io/crates/ndk-glue [agdk]: https://developer.android.com/games/agdk -# Example +## Example Cargo.toml -``` + +```toml [dependencies] log = "0.4" android_logger = "0.11" @@ -38,6 +46,7 @@ crate_type = ["cdylib"] _Note: that you will need to either specify the **"native-activity"** feature or **"game-activity"** feature to identify which `Activity` base class your application is based on_ lib.rs + ```rust use android_activity::{AndroidApp, InputStatus, MainEvent, PollEvent}; @@ -69,14 +78,14 @@ fn android_main(app: AndroidApp) { } ``` -``` +```sh rustup target add aarch64-linux-android cargo install cargo-apk cargo apk run adb logcat example:V *:S ``` -# Full Examples +## Full Examples See [this collection of examples](https://github.com/rust-mobile/rust-android-examples) (based on both `GameActivity` and `NativeActivity`). @@ -84,7 +93,7 @@ Each example is a standalone project that may also be a convenient templates for For the examples based on middleware frameworks (Winit and or Egui) they also aim to demonstrate how it's possible to write portable code that will run on Android and other systems. -# Should I use NativeActivity or GameActivity? +## Should I use NativeActivity or GameActivity? To learn more about the `NativeActivity` class that's shipped with Android see [here](https://developer.android.com/ndk/guides/concepts#naa). @@ -96,22 +105,23 @@ It's expected that the `GameActivity` backend will gain more sophisticated input Even if you start out using `NativeActivity` for the convenience, it's likely that most moderately complex applications will eventually need to define their own `Activity` subclass (either subclassing `NativeActivity` or `GameActivity`) which will require compiling at least a small amount of Java or Kotlin code. This is generally due to Android's design which directs numerous events via the `Activity` class which can only be processed by overloading some associated Activity method. -# Switching from ndk-glue to android-activity +## Switching from ndk-glue to android-activity + +### Winit-based applications -## Winit-based applications Firstly; if you have a [Winit](https://crates.io/crates/winit) based application and also have an explicit dependency on `ndk-glue` your application will need to remove its dependency on `ndk-glue` for the 0.28 release of Winit which will be based on android-activity (Since glue crates, due to their nature, can't be compatible with alternative glue crates). Winit-based applications can follow the [Android README](https://github.com/rust-windowing/winit#android) guidance for advice on how to switch over. Most Winit-based applications should aim to remove any explicit dependency on a specific glue crate (so not depend directly on `ndk-glue` or `android-activity` and instead rely on Winit to pull in the right glue crate). The main practical change will then be to add a `#[no_mangle]fn android_main(app: AndroidApp)` entry point. See the [Android README](https://github.com/rust-windowing/winit#android) for more details and also see the [Winit-based examples here](https://github.com/rust-mobile/rust-android-examples). -## Middleware crates (i.e. not applications) +### Middleware crates (i.e. not applications) If you have a crate that would be considered a middleware library (for example using JNI to support access to Bluetooth, or Android's Camera APIs) then the crate should almost certainly remove any dependence on a specific glue crate because this imposes a strict compatibility constraint that means the crate can only be used by applications that use that exact same glue crate version. Middleware libraries can instead look at using the [ndk-context](https://crates.io/crates/ndk-context) crate as a means for being able to use JNI without making any assumptions about the applications overall architecture. This way a middleware crate can work with alternative glue crates (including `ndk-glue` and `android-activity`) as well as work with embedded use cases (i.e. non-native applications that may just embed a dynamic library written in Rust to implement certain native functions). -## Other, non-Winit-based applications +### Other, non-Winit-based applications The steps to switch a simple standalone application over from `ndk-glue` to `android-activity` (still based on `NativeActivity`) should be: @@ -120,7 +130,7 @@ The steps to switch a simple standalone application over from `ndk-glue` to `and 3. Optionally add a dependency on `android_logger = "0.11.0"` 4. Update the `main` entry point to look like this: -``` +```rust use android_activity::AndroidApp; #[no_mangle] @@ -133,8 +143,7 @@ See this minimal [NativeActivity Mainloop](https://github.com/rust-mobile/androi There is is no `#[ndk_glue::main]` replacement considering that `android_main()` entry point needs to be passed an `AndroidApp` argument which isn't compatible with a traditional `main()` function. Having an Android specific entry point also gives a place to initialize Android logging and handle other Android specific details (such as building an event loop based on the `app` argument) - -## Design Summary / Motivation behind android-activity +### Design Summary / Motivation behind android-activity Prior to working on android-activity, the existing glue crates available for building standalone Rust applications on Android were found to have a number of technical limitations that this crate aimed to solve: @@ -142,12 +151,10 @@ Prior to working on android-activity, the existing glue crates available for bui 2. **Encapsulate IPC + synchronization between the native thread and the JVM thread**: For example with `ndk-glue` the application itself needs to avoid race conditions between the native and Java thread by following a locking convention) and it wasn't clear how this would extend to support other requests (like state saving) that also require synchronization. 3. **Avoid static global state**: Keeping in mind the possibility of supporting applications with multiple native activities there was interest in having an API that didn't rely on global statics to track top-level state. Instead of having global getters for state then `android-activity` passes an explicit `app: AndroidApp` argument to the entry point that encapsulates the state connected with a single `Activity`. - [`GameTextInput`]: https://developer.android.com/games/agdk/add-support-for-text-input [`AppCompatActivity`]: https://developer.android.com/reference/androidx/appcompat/app/AppCompatActivity - -# MSRV +## MSRV We aim to (at least) support stable releases of Rust from the last three months. Rust has a 6 week release cycle which means we will support the last three stable releases. For example, when Rust 1.69 is released we would limit our `rust_version` to 1.67. diff --git a/android-activity/src/input.rs b/android-activity/src/input.rs index 3653260..f28d1a9 100644 --- a/android-activity/src/input.rs +++ b/android-activity/src/input.rs @@ -63,7 +63,7 @@ pub enum Class { impl From for Class { fn from(source: u32) -> Self { - let class = SourceFlags::from_bits_truncate(source as u32); + let class = SourceFlags::from_bits_truncate(source); match class { SourceFlags::BUTTON => Class::Button, SourceFlags::POINTER => Class::Pointer, From ca0d2eb3aa6e91116b00b5a8dd9be3fb92cfade0 Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Sat, 24 Jun 2023 00:43:14 +0200 Subject: [PATCH 04/93] cargo: Fix `rust_version` -> `rust-version` property typo Cargo complains: warning: android-activity/Cargo.toml: unused manifest key: package.rust_version Solve this by replacing the underscore with a hyphen. --- android-activity/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android-activity/Cargo.toml b/android-activity/Cargo.toml index 764c8e6..db3f4ff 100644 --- a/android-activity/Cargo.toml +++ b/android-activity/Cargo.toml @@ -9,7 +9,7 @@ repository = "https://github.com/rust-mobile/android-activity" documentation = "https://docs.rs/android-activity" description = "Glue for building Rust applications on Android with NativeActivity or GameActivity" license = "MIT OR Apache-2.0" -rust_version = "1.64" +rust-version = "1.64" [features] # Note: we don't enable any backend by default since features From cd814206385639e433ed1d43ec0f67e28d434139 Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Sun, 25 Jun 2023 23:45:32 +0100 Subject: [PATCH 05/93] Update agdk-mainloop --- examples/agdk-mainloop/Cargo.toml | 2 ++ examples/agdk-mainloop/app/build.gradle | 2 ++ .../app/src/main/AndroidManifest.xml | 3 +- examples/agdk-mainloop/build.gradle | 4 +-- examples/agdk-mainloop/gradle.properties | 4 ++- .../gradle/wrapper/gradle-wrapper.properties | 2 +- examples/agdk-mainloop/src/lib.rs | 31 ++++++++++++++++--- 7 files changed, 38 insertions(+), 10 deletions(-) diff --git a/examples/agdk-mainloop/Cargo.toml b/examples/agdk-mainloop/Cargo.toml index 47d30a3..6971468 100644 --- a/examples/agdk-mainloop/Cargo.toml +++ b/examples/agdk-mainloop/Cargo.toml @@ -9,6 +9,8 @@ edition = "2021" log = "0.4" android_logger = "0.11.0" android-activity = { path="../../android-activity", features = ["game-activity"] } +ndk-sys = "0.4" +ndk = "0.7" [lib] name="main" diff --git a/examples/agdk-mainloop/app/build.gradle b/examples/agdk-mainloop/app/build.gradle index 77c1a85..cce660e 100644 --- a/examples/agdk-mainloop/app/build.gradle +++ b/examples/agdk-mainloop/app/build.gradle @@ -3,6 +3,7 @@ plugins { } android { + ndkVersion "25.2.9519653" compileSdk 31 defaultConfig { @@ -32,6 +33,7 @@ android { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } + namespace 'co.realfit.agdkmainloop' } dependencies { diff --git a/examples/agdk-mainloop/app/src/main/AndroidManifest.xml b/examples/agdk-mainloop/app/src/main/AndroidManifest.xml index 7b99a0b..b9d7563 100644 --- a/examples/agdk-mainloop/app/src/main/AndroidManifest.xml +++ b/examples/agdk-mainloop/app/src/main/AndroidManifest.xml @@ -1,6 +1,5 @@ - + = Default::default(); + let mut native_window: Option = None; while !quit { app.poll_events( @@ -37,11 +37,11 @@ fn android_main(app: AndroidApp) { } } MainEvent::InitWindow { .. } => { - render_state = Some(()); + native_window = app.native_window(); redraw_pending = true; } MainEvent::TerminateWindow { .. } => { - render_state = None; + native_window = None; } MainEvent::WindowResized { .. } => { redraw_pending = true; @@ -65,7 +65,7 @@ fn android_main(app: AndroidApp) { } if redraw_pending { - if let Some(_rs) = render_state { + if let Some(native_window) = &native_window { redraw_pending = false; // Handle input @@ -75,9 +75,32 @@ fn android_main(app: AndroidApp) { }); info!("Render..."); + dummy_render(native_window); } } }, ); } } + +/// Post a NOP frame to the window +/// +/// Since this is a bare minimum test app we don't depend +/// on any GPU graphics APIs but we do need to at least +/// convince Android that we're drawing something and are +/// responsive, otherwise it will stop delivering input +/// events to us. +fn dummy_render(native_window: &ndk::native_window::NativeWindow) { + unsafe { + let mut buf: ndk_sys::ANativeWindow_Buffer = std::mem::zeroed(); + let mut rect: ndk_sys::ARect = std::mem::zeroed(); + ndk_sys::ANativeWindow_lock( + native_window.ptr().as_ptr() as _, + &mut buf as _, + &mut rect as _, + ); + // Note: we don't try and touch the buffer since that + // also requires us to handle various buffer formats + ndk_sys::ANativeWindow_unlockAndPost(native_window.ptr().as_ptr() as _); + } +} From 230035526b5127b93c2d120c5b7f5aa8418852b3 Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Sun, 25 Jun 2023 23:45:42 +0100 Subject: [PATCH 06/93] Update na-mainloop --- examples/na-mainloop/Cargo.toml | 2 ++ examples/na-mainloop/app/build.gradle | 2 ++ .../app/src/main/AndroidManifest.xml | 3 +- examples/na-mainloop/build.gradle | 4 +-- examples/na-mainloop/gradle.properties | 4 ++- .../gradle/wrapper/gradle-wrapper.properties | 2 +- examples/na-mainloop/src/lib.rs | 31 ++++++++++++++++--- 7 files changed, 38 insertions(+), 10 deletions(-) diff --git a/examples/na-mainloop/Cargo.toml b/examples/na-mainloop/Cargo.toml index 6280913..93da1d9 100644 --- a/examples/na-mainloop/Cargo.toml +++ b/examples/na-mainloop/Cargo.toml @@ -9,6 +9,8 @@ edition = "2021" log = "0.4" android_logger = "0.11.0" android-activity = { path="../../android-activity", features = [ "native-activity" ] } +ndk-sys = "0.4" +ndk = "0.7" [lib] #name="na_mainloop" diff --git a/examples/na-mainloop/app/build.gradle b/examples/na-mainloop/app/build.gradle index c17a5d3..dd102cc 100644 --- a/examples/na-mainloop/app/build.gradle +++ b/examples/na-mainloop/app/build.gradle @@ -3,6 +3,7 @@ plugins { } android { + ndkVersion "25.2.9519653" compileSdk 31 defaultConfig { @@ -32,6 +33,7 @@ android { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } + namespace 'co.realfit.namainloop' } dependencies { diff --git a/examples/na-mainloop/app/src/main/AndroidManifest.xml b/examples/na-mainloop/app/src/main/AndroidManifest.xml index 56fe639..d104641 100644 --- a/examples/na-mainloop/app/src/main/AndroidManifest.xml +++ b/examples/na-mainloop/app/src/main/AndroidManifest.xml @@ -1,6 +1,5 @@ - + = Default::default(); + let mut native_window: Option = None; while !quit { app.poll_events( @@ -37,11 +37,11 @@ fn android_main(app: AndroidApp) { } } MainEvent::InitWindow { .. } => { - render_state = Some(()); + native_window = app.native_window(); redraw_pending = true; } MainEvent::TerminateWindow { .. } => { - render_state = None; + native_window = None; } MainEvent::WindowResized { .. } => { redraw_pending = true; @@ -65,7 +65,7 @@ fn android_main(app: AndroidApp) { } if redraw_pending { - if let Some(_rs) = render_state { + if let Some(native_window) = &native_window { redraw_pending = false; // Handle input @@ -75,9 +75,32 @@ fn android_main(app: AndroidApp) { }); info!("Render..."); + dummy_render(native_window); } } }, ); } } + +/// Post a NOP frame to the window +/// +/// Since this is a bare minimum test app we don't depend +/// on any GPU graphics APIs but we do need to at least +/// convince Android that we're drawing something and are +/// responsive, otherwise it will stop delivering input +/// events to us. +fn dummy_render(native_window: &ndk::native_window::NativeWindow) { + unsafe { + let mut buf: ndk_sys::ANativeWindow_Buffer = std::mem::zeroed(); + let mut rect: ndk_sys::ARect = std::mem::zeroed(); + ndk_sys::ANativeWindow_lock( + native_window.ptr().as_ptr() as _, + &mut buf as _, + &mut rect as _, + ); + // Note: we don't try and touch the buffer since that + // also requires us to handle various buffer formats + ndk_sys::ANativeWindow_unlockAndPost(native_window.ptr().as_ptr() as _); + } +} From 9a713c823d0ff8fc70cee722ffed909f65543ad6 Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Sun, 25 Jun 2023 23:46:32 +0100 Subject: [PATCH 07/93] Release 0.4.2 --- android-activity/CHANGELOG.md | 6 ++++++ android-activity/Cargo.toml | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/android-activity/CHANGELOG.md b/android-activity/CHANGELOG.md index 6124643..ca4be1f 100644 --- a/android-activity/CHANGELOG.md +++ b/android-activity/CHANGELOG.md @@ -3,8 +3,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] + + +## [0.4.2] - 2022-02-16 ### Changed - The `Activity.finish()` method is now called when `android_main` returns so the `Activity` will be destroyed ([#67](https://github.com/rust-mobile/android-activity/issues/67)) +- The `native-activity` backend now propagates `NativeWindow` redraw/resize and `ContentRectChanged` callbacks to main loop ([#70](https://github.com/rust-mobile/android-activity/pull/70)) +- The `game-activity` implementation of `pointer_index()` was fixed to not always return `0` ([#80](https://github.com/rust-mobile/android-activity/pull/84)) +- Added `panic` guards around application's `android_main()` and native code that could potentially unwind across a Java FFI boundary ([#68](https://github.com/rust-mobile/android-activity/pull/68)) ## [0.4.1] - 2022-02-16 ### Added diff --git a/android-activity/Cargo.toml b/android-activity/Cargo.toml index db3f4ff..ed6a1b0 100644 --- a/android-activity/Cargo.toml +++ b/android-activity/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "android-activity" -version = "0.4.1" +version = "0.4.2" edition = "2021" keywords = ["android", "ndk"] readme = "../README.md" From a9e91f4308ce711d1b1900dbc172240f4fbd16ac Mon Sep 17 00:00:00 2001 From: "Stephen M. Coakley" Date: Mon, 17 Jul 2023 21:39:47 -0500 Subject: [PATCH 08/93] Fix deadlock on activity onDestroy Fix a deadlock that occurs when an activity is destroyed without process termination, such as when an activity is destroyed and recreated due to a configuration change. The deadlock occurs because `notify_destroyed` blocks until `destroyed` is set to `true`. This only occurs when `WaitableNativeActivityState` is dropped, but the `WaitableNativeActivityState` instance is the very thing being used to await for destruction, resulting in a deadlock. Instead of waiting for the `WaitableNativeActivityState` to be dropped we now wait until the native `android_main` thread has stopped. So we can tell the difference between the thread not running because it hasn't started or because it has finished (in case `android_main` returns immediately) this replaces the `running` boolean with a tri-state enum. Co-authored-by: Robert Bragg --- android-activity/src/native_activity/glue.rs | 39 ++++++++++++++++---- 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/android-activity/src/native_activity/glue.rs b/android-activity/src/native_activity/glue.rs index 64df108..6682857 100644 --- a/android-activity/src/native_activity/glue.rs +++ b/android-activity/src/native_activity/glue.rs @@ -199,6 +199,18 @@ impl NativeActivityGlue { } } +/// The status of the native thread that's created to run +/// `android_main` +#[derive(Copy, Clone, Debug, PartialEq, Eq)] +pub enum NativeThreadState { + /// The `android_main` thread hasn't been created yet + Init, + /// The `android_main` thread has been spawned and started running + Running, + /// The `android_main` thread has finished + Stopped, +} + #[derive(Debug)] pub struct NativeActivityState { pub msg_read: libc::c_int, @@ -210,8 +222,11 @@ pub struct NativeActivityState { pub content_rect: ndk_sys::ARect, pub activity_state: State, pub destroy_requested: bool, - pub running: bool, + pub thread_state: NativeThreadState, pub app_has_saved_state: bool, + + /// Set as soon as the Java main thread notifies us of an + /// `onDestroyed` callback. pub destroyed: bool, pub redraw_needed: bool, pub pending_input_queue: *mut ndk_sys::AInputQueue, @@ -303,8 +318,6 @@ impl Drop for WaitableNativeActivityState { unsafe { let mut guard = self.mutex.lock().unwrap(); guard.detach_input_queue_from_looper(); - guard.destroyed = true; - self.cond.notify_one(); } } } @@ -356,7 +369,7 @@ impl WaitableNativeActivityState { content_rect: Rect::empty().into(), activity_state: State::Init, destroy_requested: false, - running: false, + thread_state: NativeThreadState::Init, app_has_saved_state: false, destroyed: false, redraw_needed: false, @@ -369,10 +382,11 @@ impl WaitableNativeActivityState { pub fn notify_destroyed(&self) { let mut guard = self.mutex.lock().unwrap(); + guard.destroyed = true; unsafe { guard.write_cmd(AppCmd::Destroy); - while !guard.destroyed { + while guard.thread_state != NativeThreadState::Stopped { guard = self.cond.wait(guard).unwrap(); } @@ -541,7 +555,13 @@ impl WaitableNativeActivityState { pub fn notify_main_thread_running(&self) { let mut guard = self.mutex.lock().unwrap(); - guard.running = true; + guard.thread_state = NativeThreadState::Running; + self.cond.notify_one(); + } + + pub fn notify_main_thread_stopped_running(&self) { + let mut guard = self.mutex.lock().unwrap(); + guard.thread_state = NativeThreadState::Stopped; self.cond.notify_one(); } @@ -907,11 +927,16 @@ extern "C" fn ANativeActivity_onCreate( ndk_context::release_android_context(); } + + rust_glue.notify_main_thread_stopped_running(); }); // Wait for thread to start. let mut guard = jvm_glue.mutex.lock().unwrap(); - while !guard.running { + + // Don't specifically wait for `Running` just in case `android_main` returns + // immediately and the state is set to `Stopped` + while guard.thread_state == NativeThreadState::Init { guard = jvm_glue.cond.wait(guard).unwrap(); } }) From ab2606a73d85b00ec86ff2eafae28c1516aea86b Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Sat, 22 Jul 2023 18:09:18 +0100 Subject: [PATCH 09/93] build.rs: emit rerun-if-changed lines for compiled C/C++ code --- android-activity/build.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/android-activity/build.rs b/android-activity/build.rs index 6b08f62..110859b 100644 --- a/android-activity/build.rs +++ b/android-activity/build.rs @@ -1,6 +1,12 @@ #![allow(dead_code)] fn build_glue_for_game_activity() { + for f in [ + "GameActivity.h", + "GameActivity.cpp", + ] { + println!("cargo:rerun-if-changed=game-activity-csrc/game-activity/{f}"); + } cc::Build::new() .cpp(true) .include("game-activity-csrc") @@ -8,12 +14,20 @@ fn build_glue_for_game_activity() { .extra_warnings(false) .cpp_link_stdlib("c++_static") .compile("libgame_activity.a"); + + for f in ["gamecommon.h", "gametextinput.h", "gametextinput.cpp"] { + println!("cargo:rerun-if-changed=game-activity-csrc/game-text-input/{f}"); + } cc::Build::new() .cpp(true) .include("game-activity-csrc") .file("game-activity-csrc/game-text-input/gametextinput.cpp") .cpp_link_stdlib("c++_static") .compile("libgame_text_input.a"); + + for f in ["android_native_app_glue.h", "android_native_app_glue.c"] { + println!("cargo:rerun-if-changed=game-activity-csrc/native_app_glue/{f}"); + } cc::Build::new() .include("game-activity-csrc") .include("game-activity-csrc/game-activity/native_app_glue") From c10a2fb67accd0a4983ede6e021c13518b5ed00c Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Fri, 28 Jul 2023 22:18:24 +0100 Subject: [PATCH 10/93] GameActivity PATH: fix deadlocks in java callbacks after app destroyed This ensures that any java Activity callbacks take into account the possibility that the `android_app` may have already been marked destroyed if `android_main` has returned - and so they mustn't block and wait for a thread that is no longer running. --- android-activity/build.rs | 5 +- .../native_app_glue/android_native_app_glue.c | 63 +++++++++++++++++-- 2 files changed, 59 insertions(+), 9 deletions(-) diff --git a/android-activity/build.rs b/android-activity/build.rs index 110859b..305b6ba 100644 --- a/android-activity/build.rs +++ b/android-activity/build.rs @@ -1,10 +1,7 @@ #![allow(dead_code)] fn build_glue_for_game_activity() { - for f in [ - "GameActivity.h", - "GameActivity.cpp", - ] { + for f in ["GameActivity.h", "GameActivity.cpp"] { println!("cargo:rerun-if-changed=game-activity-csrc/game-activity/{f}"); } cc::Build::new() diff --git a/android-activity/game-activity-csrc/game-activity/native_app_glue/android_native_app_glue.c b/android-activity/game-activity-csrc/game-activity/native_app_glue/android_native_app_glue.c index 5fd3eb8..0a52bd0 100644 --- a/android-activity/game-activity-csrc/game-activity/native_app_glue/android_native_app_glue.c +++ b/android-activity/game-activity-csrc/game-activity/native_app_glue/android_native_app_glue.c @@ -308,6 +308,15 @@ static void android_app_set_window(struct android_app* android_app, ANativeWindow* window) { LOGV("android_app_set_window called"); pthread_mutex_lock(&android_app->mutex); + + // NB: we have to consider that the native thread could have already + // (gracefully) exit (setting android_app->destroyed) and so we need + // to be careful to avoid a deadlock waiting for a thread that's + // already exit. + if (android_app->destroyed) { + pthread_mutex_unlock(&android_app->mutex); + return; + } if (android_app->pendingWindow != NULL) { android_app_write_cmd(android_app, APP_CMD_TERM_WINDOW); } @@ -324,15 +333,30 @@ static void android_app_set_window(struct android_app* android_app, static 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) { - pthread_cond_wait(&android_app->cond, &android_app->mutex); + + // NB: we have to consider that the native thread could have already + // (gracefully) exit (setting android_app->destroyed) and so we need + // to be careful to avoid a deadlock waiting for a thread that's + // already exit. + if (!android_app->destroyed) { + android_app_write_cmd(android_app, cmd); + while (android_app->activityState != cmd) { + pthread_cond_wait(&android_app->cond, &android_app->mutex); + } } pthread_mutex_unlock(&android_app->mutex); } static void android_app_free(struct android_app* android_app) { pthread_mutex_lock(&android_app->mutex); + + // It's possible that onDestroy is called after we have already 'destroyed' + // the app (via `android_app_destroy` due to `android_main` returning. + // + // In this case `->destroyed` will already be set (so we won't deadlock in + // the loop below) but we still need to close the messaging fds and finish + // freeing the android_app + android_app_write_cmd(android_app, APP_CMD_DESTROY); while (!android_app->destroyed) { pthread_cond_wait(&android_app->cond, &android_app->mutex); @@ -372,6 +396,16 @@ static void onSaveInstanceState(GameActivity* activity, struct android_app* android_app = ToApp(activity); pthread_mutex_lock(&android_app->mutex); + + // NB: we have to consider that the native thread could have already + // (gracefully) exit (setting android_app->destroyed) and so we need + // to be careful to avoid a deadlock waiting for a thread that's + // already exit. + if (android_app->destroyed) { + pthread_mutex_unlock(&android_app->mutex); + return; + } + android_app->stateSaved = 0; android_app_write_cmd(android_app, APP_CMD_SAVE_STATE); while (!android_app->stateSaved) { @@ -481,6 +515,15 @@ static bool onTouchEvent(GameActivity* activity, struct android_app* android_app = ToApp(activity); pthread_mutex_lock(&android_app->mutex); + // NB: we have to consider that the native thread could have already + // (gracefully) exit (setting android_app->destroyed) and so we need + // to be careful to avoid a deadlock waiting for a thread that's + // already exit. + if (android_app->destroyed) { + pthread_mutex_unlock(&android_app->mutex); + return false; + } + if (android_app->motionEventFilter != NULL && !android_app->motionEventFilter(event)) { pthread_mutex_unlock(&android_app->mutex); @@ -563,6 +606,15 @@ static bool onKey(GameActivity* activity, const GameActivityKeyEvent* event) { struct android_app* android_app = ToApp(activity); pthread_mutex_lock(&android_app->mutex); + // NB: we have to consider that the native thread could have already + // (gracefully) exit (setting android_app->destroyed) and so we need + // to be careful to avoid a deadlock waiting for a thread that's + // already exit. + if (android_app->destroyed) { + pthread_mutex_unlock(&android_app->mutex); + return false; + } + if (android_app->keyEventFilter != NULL && !android_app->keyEventFilter(event)) { pthread_mutex_unlock(&android_app->mutex); @@ -599,8 +651,9 @@ static void onTextInputEvent(GameActivity* activity, const GameTextInputState* state) { struct android_app* android_app = ToApp(activity); pthread_mutex_lock(&android_app->mutex); - - android_app->textInputState = 1; + if (!android_app->destroyed) { + android_app->textInputState = 1; + } pthread_mutex_unlock(&android_app->mutex); } From bb97af154f656aa2405d6ab6d345f733a08c97cb Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Fri, 28 Jul 2023 22:18:54 +0100 Subject: [PATCH 11/93] Release 0.4.3 --- android-activity/CHANGELOG.md | 9 ++++++++- android-activity/Cargo.toml | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/android-activity/CHANGELOG.md b/android-activity/CHANGELOG.md index ca4be1f..4453871 100644 --- a/android-activity/CHANGELOG.md +++ b/android-activity/CHANGELOG.md @@ -1,11 +1,18 @@ + + # Changelog The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +## [0.4.3] - 2022-07-30 +### Fixed +- Fixed a deadlock in the `native-activity` backend while waiting for the native thread after getting an `onDestroy` callback from Java ([#94](https://github.com/rust-mobile/android-activity/pull/94)) + +- Fixed numerous deadlocks in the `game-activity` backend with how it would wait for the native thread in various Java callbacks, after the app has returned from `android_main` ([#98](https://github.com/rust-mobile/android-activity/pull/98)) -## [0.4.2] - 2022-02-16 +## [0.4.2] - 2022-06-17 ### Changed - The `Activity.finish()` method is now called when `android_main` returns so the `Activity` will be destroyed ([#67](https://github.com/rust-mobile/android-activity/issues/67)) - The `native-activity` backend now propagates `NativeWindow` redraw/resize and `ContentRectChanged` callbacks to main loop ([#70](https://github.com/rust-mobile/android-activity/pull/70)) diff --git a/android-activity/Cargo.toml b/android-activity/Cargo.toml index ed6a1b0..d60bca4 100644 --- a/android-activity/Cargo.toml +++ b/android-activity/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "android-activity" -version = "0.4.2" +version = "0.4.3" edition = "2021" keywords = ["android", "ndk"] readme = "../README.md" From c471fdf903262c1cafa560065ce4af2531cf1aae Mon Sep 17 00:00:00 2001 From: Alexis <120563837+alexisart@users.noreply.github.com> Date: Sun, 25 Jun 2023 22:28:45 -0400 Subject: [PATCH 12/93] Import unmodified GameActivity 2.0.2 Source See: https://developer.android.com/jetpack/androidx/releases/games#games-activity_version_20_2 --- .../common/gamesdk_common.h | 41 + .../game-activity/GameActivity.cpp | 795 ++++++------------ .../game-activity/GameActivity.h | 266 +----- .../game-activity/GameActivityEvents.cpp | 413 +++++++++ .../game-activity/GameActivityEvents.h | 336 ++++++++ .../game-activity/GameActivityLog.h | 109 +++ .../native_app_glue/android_native_app_glue.c | 216 ++--- .../native_app_glue/android_native_app_glue.h | 87 +- .../game-text-input/gamecommon.h | 0 .../game-text-input/gametextinput.cpp | 13 + .../game-text-input/gametextinput.h | 15 + 11 files changed, 1338 insertions(+), 953 deletions(-) create mode 100644 android-activity/game-activity-csrc/common/gamesdk_common.h create mode 100644 android-activity/game-activity-csrc/game-activity/GameActivityEvents.cpp create mode 100644 android-activity/game-activity-csrc/game-activity/GameActivityEvents.h create mode 100644 android-activity/game-activity-csrc/game-activity/GameActivityLog.h mode change 100644 => 100755 android-activity/game-activity-csrc/game-text-input/gamecommon.h mode change 100644 => 100755 android-activity/game-activity-csrc/game-text-input/gametextinput.cpp mode change 100644 => 100755 android-activity/game-activity-csrc/game-text-input/gametextinput.h diff --git a/android-activity/game-activity-csrc/common/gamesdk_common.h b/android-activity/game-activity-csrc/common/gamesdk_common.h new file mode 100644 index 0000000..d29ac01 --- /dev/null +++ b/android-activity/game-activity-csrc/common/gamesdk_common.h @@ -0,0 +1,41 @@ +/* + * Copyright 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * This is the main interface to the Android Performance Tuner library, also + * known as Tuning Fork. + * + * It is part of the Android Games SDK and produces best results when integrated + * with the Swappy Frame Pacing Library. + * + * See the documentation at + * https://developer.android.com/games/sdk/performance-tuner/custom-engine for + * more information on using this library in a native Android game. + * + */ + +#pragma once + +// There are separate versions for each GameSDK component that use this format: +#define ANDROID_GAMESDK_PACKED_VERSION(MAJOR, MINOR, BUGFIX) \ + ((MAJOR << 16) | (MINOR << 8) | (BUGFIX)) +// Accessors +#define ANDROID_GAMESDK_MAJOR_VERSION(PACKED) ((PACKED) >> 16) +#define ANDROID_GAMESDK_MINOR_VERSION(PACKED) (((PACKED) >> 8) & 0xff) +#define ANDROID_GAMESDK_BUGFIX_VERSION(PACKED) ((PACKED) & 0xff) + +#define AGDK_STRING_VERSION(MAJOR, MINOR, BUGFIX, GIT) \ +#MAJOR "." #MINOR "." #BUGFIX "." #GIT diff --git a/android-activity/game-activity-csrc/game-activity/GameActivity.cpp b/android-activity/game-activity-csrc/game-activity/GameActivity.cpp index a139696..3721b6d 100644 --- a/android-activity/game-activity-csrc/game-activity/GameActivity.cpp +++ b/android-activity/game-activity-csrc/game-activity/GameActivity.cpp @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#define LOG_TAG "GameActivity" #include "GameActivity.h" @@ -39,53 +38,9 @@ #include #include -// TODO(b/187147166): these functions were extracted from the Game SDK -// (gamesdk/src/common/system_utils.h). system_utils.h/cpp should be used -// instead. -namespace { - -#if __ANDROID_API__ >= 26 -std::string getSystemPropViaCallback(const char *key, - const char *default_value = "") { - const prop_info *prop = __system_property_find(key); - if (prop == nullptr) { - return default_value; - } - std::string return_value; - auto thunk = [](void *cookie, const char * /*name*/, const char *value, - uint32_t /*serial*/) { - if (value != nullptr) { - std::string *r = static_cast(cookie); - *r = value; - } - }; - __system_property_read_callback(prop, thunk, &return_value); - return return_value; -} -#else -std::string getSystemPropViaGet(const char *key, - const char *default_value = "") { - char buffer[PROP_VALUE_MAX + 1] = ""; // +1 for terminator - int bufferLen = __system_property_get(key, buffer); - if (bufferLen > 0) - return buffer; - else - return ""; -} -#endif - -std::string GetSystemProp(const char *key, const char *default_value = "") { -#if __ANDROID_API__ >= 26 - return getSystemPropViaCallback(key, default_value); -#else - return getSystemPropViaGet(key, default_value); -#endif -} +#include "GameActivityLog.h" -int GetSystemPropAsInt(const char *key, int default_value = 0) { - std::string prop = GetSystemProp(key); - return prop == "" ? default_value : strtoll(prop.c_str(), nullptr, 10); -} +namespace { struct OwnedGameTextInputState { OwnedGameTextInputState &operator=(const GameTextInputState &rhs) { @@ -100,93 +55,6 @@ struct OwnedGameTextInputState { } // anonymous namespace -#define ALOGE(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__); -#define ALOGW(...) __android_log_print(ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__); -#define ALOGD(...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__); -#ifdef NDEBUG -#define ALOGV(...) -#else -#define ALOGV(...) \ - __android_log_print(ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__); -#endif - -/* Returns 2nd arg. Used to substitute default value if caller's vararg list - * is empty. - */ -#define __android_second(first, second, ...) second - -/* If passed multiple args, returns ',' followed by all but 1st arg, otherwise - * returns nothing. - */ -#define __android_rest(first, ...) , ##__VA_ARGS__ - -#define android_printAssert(cond, tag, fmt...) \ - __android_log_assert(cond, tag, \ - __android_second(0, ##fmt, NULL) __android_rest(fmt)) - -#define CONDITION(cond) (__builtin_expect((cond) != 0, 0)) - -#ifndef LOG_ALWAYS_FATAL_IF -#define LOG_ALWAYS_FATAL_IF(cond, ...) \ - ((CONDITION(cond)) \ - ? ((void)android_printAssert(#cond, LOG_TAG, ##__VA_ARGS__)) \ - : (void)0) -#endif - -#ifndef LOG_ALWAYS_FATAL -#define LOG_ALWAYS_FATAL(...) \ - (((void)android_printAssert(NULL, LOG_TAG, ##__VA_ARGS__))) -#endif - -/* - * Simplified macro to send a warning system log message using current LOG_TAG. - */ -#ifndef SLOGW -#define SLOGW(...) \ - ((void)__android_log_print(ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__)) -#endif - -#ifndef SLOGW_IF -#define SLOGW_IF(cond, ...) \ - ((__predict_false(cond)) \ - ? ((void)__android_log_print(ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__)) \ - : (void)0) -#endif - -/* - * Versions of LOG_ALWAYS_FATAL_IF and LOG_ALWAYS_FATAL that - * are stripped out of release builds. - */ -#if LOG_NDEBUG - -#ifndef LOG_FATAL_IF -#define LOG_FATAL_IF(cond, ...) ((void)0) -#endif -#ifndef LOG_FATAL -#define LOG_FATAL(...) ((void)0) -#endif - -#else - -#ifndef LOG_FATAL_IF -#define LOG_FATAL_IF(cond, ...) LOG_ALWAYS_FATAL_IF(cond, ##__VA_ARGS__) -#endif -#ifndef LOG_FATAL -#define LOG_FATAL(...) LOG_ALWAYS_FATAL(__VA_ARGS__) -#endif - -#endif - -/* - * Assertion that generates a log message when the assertion fails. - * Stripped out of release builds. Uses the current LOG_TAG. - */ -#ifndef ALOG_ASSERT -#define ALOG_ASSERT(cond, ...) LOG_FATAL_IF(!(cond), ##__VA_ARGS__) -#endif - -#define LOG_TRACE(...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__) - #ifndef NELEM #define NELEM(x) ((int)(sizeof(x) / sizeof((x)[0]))) #endif @@ -212,6 +80,30 @@ static struct { jfieldID bottom; } gInsetsClassInfo; +/* + * JNI fields of the Configuration Java class. + */ +static struct ConfigurationClassInfo { + jfieldID colorMode; + jfieldID densityDpi; + jfieldID fontScale; + jfieldID fontWeightAdjustment; + jfieldID hardKeyboardHidden; + jfieldID keyboard; + jfieldID keyboardHidden; + jfieldID mcc; + jfieldID mnc; + jfieldID navigation; + jfieldID navigationHidden; + jfieldID orientation; + jfieldID screenHeightDp; + jfieldID screenLayout; + jfieldID screenWidthDp; + jfieldID smallestScreenWidthDp; + jfieldID touchscreen; + jfieldID uiMode; +} gConfigurationClassInfo; + /* * JNI methods of the WindowInsetsCompat.Type Java class. */ @@ -228,6 +120,7 @@ struct ActivityWork { int32_t cmd; int64_t arg1; int64_t arg2; + int64_t arg3; }; /* @@ -240,19 +133,46 @@ enum { CMD_SET_WINDOW_FLAGS, CMD_SHOW_SOFT_INPUT, CMD_HIDE_SOFT_INPUT, - CMD_SET_SOFT_INPUT_STATE + CMD_SET_SOFT_INPUT_STATE, + CMD_SET_IME_EDITOR_INFO }; +/* + * Last known Configuration values. They may be accessed from the different + * thread, this is why they are made atomic. + */ +static struct Configuration { + std::atomic_int colorMode; + std::atomic_int densityDpi; + std::atomic fontScale; + std::atomic_int fontWeightAdjustment; + std::atomic_int hardKeyboardHidden; + std::atomic_int keyboard; + std::atomic_int keyboardHidden; + std::atomic_int mcc; + std::atomic_int mnc; + std::atomic_int navigation; + std::atomic_int navigationHidden; + std::atomic_int orientation; + std::atomic_int screenHeightDp; + std::atomic_int screenLayout; + std::atomic_int screenWidthDp; + std::atomic_int smallestScreenWidthDp; + std::atomic_int touchscreen; + std::atomic_int uiMode; +} gConfiguration; + /* * Write a command to be executed by the GameActivity on the application main * thread. */ -static void write_work(int fd, int32_t cmd, int64_t arg1 = 0, - int64_t arg2 = 0) { +static void write_work(int fd, int32_t cmd, int64_t arg1 = 0, int64_t arg2 = 0, + int64_t arg3 = 0) { ActivityWork work; work.cmd = cmd; work.arg1 = arg1; work.arg2 = arg2; + work.arg3 = arg3; LOG_TRACE("write_work: cmd=%d", cmd); restart: @@ -291,12 +211,10 @@ static bool read_work(int fd, ActivityWork *outWork) { * Native state for interacting with the GameActivity class. */ struct NativeCode : public GameActivity { - NativeCode(void *_dlhandle, GameActivity_createFunc *_createFunc) { + NativeCode() { memset((GameActivity *)this, 0, sizeof(GameActivity)); memset(&callbacks, 0, sizeof(callbacks)); memset(&insetsState, 0, sizeof(insetsState)); - dlhandle = _dlhandle; - createActivityFunc = _createFunc; nativeWindow = NULL; mainWorkRead = mainWorkWrite = -1; gameTextInput = NULL; @@ -324,12 +242,6 @@ struct NativeCode : public GameActivity { setSurface(NULL); if (mainWorkRead >= 0) close(mainWorkRead); if (mainWorkWrite >= 0) close(mainWorkWrite); - if (dlhandle != NULL) { - // for now don't unload... we probably should clean this - // up and only keep one open dlhandle per proc, since there - // is really no benefit to unloading the code. - // dlclose(dlhandle); - } } void setSurface(jobject _surface) { @@ -345,9 +257,6 @@ struct NativeCode : public GameActivity { GameActivityCallbacks callbacks; - void *dlhandle; - GameActivity_createFunc *createActivityFunc; - std::string internalDataPathObj; std::string externalDataPathObj; std::string obbPathObj; @@ -374,6 +283,8 @@ struct NativeCode : public GameActivity { ARect insetsState[GAMECOMMON_INSETS_TYPE_COUNT]; }; +static void readConfigurationValues(NativeCode *code, jobject javaConfig); + extern "C" void GameActivity_finish(GameActivity *activity) { NativeCode *code = static_cast(activity); write_work(code->mainWorkWrite, CMD_FINISH, 0); @@ -476,6 +387,13 @@ static int mainWorkCallback(int fd, int events, void *data) { case CMD_HIDE_SOFT_INPUT: { GameTextInput_hideIme(code->gameTextInput, work.arg1); } break; + case CMD_SET_IME_EDITOR_INFO: { + code->env->CallVoidMethod( + code->javaGameActivity, + gGameActivityClassInfo.setImeEditorInfoFields, work.arg1, + work.arg2, work.arg3); + checkAndClearException(code->env, "setImeEditorInfo"); + } break; default: ALOGW("Unknown work command: %d", work.cmd); break; @@ -485,40 +403,16 @@ static int mainWorkCallback(int fd, int events, void *data) { } // ------------------------------------------------------------------------ - static thread_local std::string g_error_msg; -static jlong loadNativeCode_native(JNIEnv *env, jobject javaGameActivity, - jstring path, jstring funcName, - jstring internalDataDir, jstring obbDir, - jstring externalDataDir, jobject jAssetMgr, - jbyteArray savedState) { - LOG_TRACE("loadNativeCode_native"); - const char *pathStr = env->GetStringUTFChars(path, NULL); +static jlong initializeNativeCode_native( + JNIEnv *env, jobject javaGameActivity, jstring internalDataDir, + jstring obbDir, jstring externalDataDir, jobject jAssetMgr, + jbyteArray savedState, jobject javaConfig) { + LOG_TRACE("initializeNativeCode_native"); NativeCode *code = NULL; - void *handle = dlopen(pathStr, RTLD_LAZY); - - env->ReleaseStringUTFChars(path, pathStr); - - if (handle == nullptr) { - g_error_msg = dlerror(); - ALOGE("GameActivity dlopen(\"%s\") failed: %s", pathStr, - g_error_msg.c_str()); - return 0; - } - - const char *funcStr = env->GetStringUTFChars(funcName, NULL); - code = new NativeCode(handle, - (GameActivity_createFunc *)dlsym(handle, funcStr)); - env->ReleaseStringUTFChars(funcName, funcStr); - - if (code->createActivityFunc == nullptr) { - g_error_msg = dlerror(); - ALOGW("GameActivity_onCreate not found: %s", g_error_msg.c_str()); - delete code; - return 0; - } + code = new NativeCode(); code->looper = ALooper_forThread(); if (code->looper == nullptr) { @@ -588,7 +482,10 @@ static jlong loadNativeCode_native(JNIEnv *env, jobject javaGameActivity, rawSavedState = env->GetByteArrayElements(savedState, NULL); rawSavedSize = env->GetArrayLength(savedState); } - code->createActivityFunc(code, rawSavedState, rawSavedSize); + + readConfigurationValues(code, javaConfig); + + GameActivity_onCreate(code, rawSavedState, rawSavedSize); code->gameTextInput = GameTextInput_init(env, 0); GameTextInput_setEventCallback(code->gameTextInput, @@ -609,9 +506,9 @@ static jstring getDlError_native(JNIEnv *env, jobject javaGameActivity) { return result; } -static void unloadNativeCode_native(JNIEnv *env, jobject javaGameActivity, +static void terminateNativeCode_native(JNIEnv *env, jobject javaGameActivity, jlong handle) { - LOG_TRACE("unloadNativeCode_native"); + LOG_TRACE("terminateNativeCode_native"); if (handle != 0) { NativeCode *code = (NativeCode *)handle; delete code; @@ -695,11 +592,57 @@ static void onStop_native(JNIEnv *env, jobject javaGameActivity, jlong handle) { } } +static void readConfigurationValues(NativeCode *code, jobject javaConfig) { + if (gConfigurationClassInfo.colorMode != NULL) { + gConfiguration.colorMode = code->env->GetIntField( + javaConfig, gConfigurationClassInfo.colorMode); + } + + gConfiguration.densityDpi = + code->env->GetIntField(javaConfig, gConfigurationClassInfo.densityDpi); + gConfiguration.fontScale = + code->env->GetFloatField(javaConfig, gConfigurationClassInfo.fontScale); + + if (gConfigurationClassInfo.fontWeightAdjustment != NULL) { + gConfiguration.fontWeightAdjustment = code->env->GetIntField( + javaConfig, gConfigurationClassInfo.fontWeightAdjustment); + } + + gConfiguration.hardKeyboardHidden = code->env->GetIntField( + javaConfig, gConfigurationClassInfo.hardKeyboardHidden); + gConfiguration.mcc = + code->env->GetIntField(javaConfig, gConfigurationClassInfo.mcc); + gConfiguration.mnc = + code->env->GetIntField(javaConfig, gConfigurationClassInfo.mnc); + gConfiguration.navigation = + code->env->GetIntField(javaConfig, gConfigurationClassInfo.navigation); + gConfiguration.navigationHidden = code->env->GetIntField( + javaConfig, gConfigurationClassInfo.navigationHidden); + gConfiguration.orientation = + code->env->GetIntField(javaConfig, gConfigurationClassInfo.orientation); + gConfiguration.screenHeightDp = code->env->GetIntField( + javaConfig, gConfigurationClassInfo.screenHeightDp); + gConfiguration.screenLayout = code->env->GetIntField( + javaConfig, gConfigurationClassInfo.screenLayout); + gConfiguration.screenWidthDp = code->env->GetIntField( + javaConfig, gConfigurationClassInfo.screenWidthDp); + gConfiguration.smallestScreenWidthDp = code->env->GetIntField( + javaConfig, gConfigurationClassInfo.smallestScreenWidthDp); + gConfiguration.touchscreen = + code->env->GetIntField(javaConfig, gConfigurationClassInfo.touchscreen); + gConfiguration.uiMode = + code->env->GetIntField(javaConfig, gConfigurationClassInfo.uiMode); + + checkAndClearException(code->env, "Configuration.get"); +} + static void onConfigurationChanged_native(JNIEnv *env, jobject javaGameActivity, - jlong handle) { + jlong handle, jobject javaNewConfig) { LOG_TRACE("onConfigurationChanged_native"); if (handle != 0) { NativeCode *code = (NativeCode *)handle; + readConfigurationValues(code, javaNewConfig); + if (code->callbacks.onConfigurationChanged != NULL) { code->callbacks.onConfigurationChanged(code); } @@ -776,8 +719,12 @@ static void onSurfaceChanged_native(JNIEnv *env, jobject javaGameActivity, // Maybe it was resized? int32_t newWidth = ANativeWindow_getWidth(code->nativeWindow); int32_t newHeight = ANativeWindow_getHeight(code->nativeWindow); + if (newWidth != code->lastWindowWidth || newHeight != code->lastWindowHeight) { + code->lastWindowWidth = newWidth; + code->lastWindowHeight = newHeight; + if (code->callbacks.onNativeWindowResized != NULL) { code->callbacks.onNativeWindowResized( code, code->nativeWindow, newWidth, newHeight); @@ -817,347 +764,84 @@ static void onSurfaceDestroyed_native(JNIEnv *env, jobject javaGameActivity, } } -static bool enabledAxes[GAME_ACTIVITY_POINTER_INFO_AXIS_COUNT] = { - /* AMOTION_EVENT_AXIS_X */ true, - /* AMOTION_EVENT_AXIS_Y */ true, - // Disable all other axes by default (they can be enabled using - // `GameActivityPointerAxes_enableAxis`). - false}; - -extern "C" void GameActivityPointerAxes_enableAxis(int32_t axis) { - if (axis < 0 || axis >= GAME_ACTIVITY_POINTER_INFO_AXIS_COUNT) { - return; - } +extern "C" void GameActivity_setImeEditorInfo(GameActivity *activity, + int inputType, int actionId, + int imeOptions) { + NativeCode *code = static_cast(activity); + write_work(code->mainWorkWrite, CMD_SET_IME_EDITOR_INFO, inputType, + actionId, imeOptions); +} - enabledAxes[axis] = true; +extern "C" int GameActivity_getColorMode(GameActivity *) { + return gConfiguration.colorMode; } -extern "C" void GameActivityPointerAxes_disableAxis(int32_t axis) { - if (axis < 0 || axis >= GAME_ACTIVITY_POINTER_INFO_AXIS_COUNT) { - return; - } +extern "C" int GameActivity_getDensityDpi(GameActivity *) { + return gConfiguration.densityDpi; +} - enabledAxes[axis] = false; +extern "C" float GameActivity_getFontScale(GameActivity *) { + return gConfiguration.fontScale; } -static bool enabledHistoricalAxes[GAME_ACTIVITY_POINTER_INFO_AXIS_COUNT] = { - // Disable all axes by default (they can be enabled using - // `GameActivityPointerAxes_enableHistoricalAxis`). - false}; +extern "C" int GameActivity_getFontWeightAdjustment(GameActivity *) { + return gConfiguration.fontWeightAdjustment; +} -extern "C" void GameActivityHistoricalPointerAxes_enableAxis(int32_t axis) { - if (axis < 0 || axis >= GAME_ACTIVITY_POINTER_INFO_AXIS_COUNT) { - return; - } +extern "C" int GameActivity_getHardKeyboardHidden(GameActivity *) { + return gConfiguration.hardKeyboardHidden; +} - enabledHistoricalAxes[axis] = true; +extern "C" int GameActivity_getKeyboard(GameActivity *) { + return gConfiguration.keyboard; } -extern "C" void GameActivityHistoricalPointerAxes_disableAxis(int32_t axis) { - if (axis < 0 || axis >= GAME_ACTIVITY_POINTER_INFO_AXIS_COUNT) { - return; - } +extern "C" int GameActivity_getKeyboardHidden(GameActivity *) { + return gConfiguration.keyboardHidden; +} - enabledHistoricalAxes[axis] = false; +extern "C" int GameActivity_getMcc(GameActivity *) { + return gConfiguration.mcc; } -extern "C" void GameActivity_setImeEditorInfo(GameActivity *activity, - int inputType, int actionId, - int imeOptions) { - JNIEnv *env; - if (activity->vm->AttachCurrentThread(&env, NULL) == JNI_OK) { - env->CallVoidMethod(activity->javaGameActivity, - gGameActivityClassInfo.setImeEditorInfoFields, - inputType, actionId, imeOptions); - } +extern "C" int GameActivity_getMnc(GameActivity *) { + return gConfiguration.mnc; } -static struct { - jmethodID getDeviceId; - jmethodID getSource; - jmethodID getAction; - - jmethodID getEventTime; - jmethodID getDownTime; - - jmethodID getFlags; - jmethodID getMetaState; - - jmethodID getActionButton; - jmethodID getButtonState; - jmethodID getClassification; - jmethodID getEdgeFlags; - - jmethodID getPointerCount; - jmethodID getPointerId; - jmethodID getToolType; - jmethodID getRawX; - jmethodID getRawY; - jmethodID getXPrecision; - jmethodID getYPrecision; - jmethodID getAxisValue; - - jmethodID getHistorySize; - jmethodID getHistoricalEventTime; - jmethodID getHistoricalAxisValue; -} gMotionEventClassInfo; - -extern "C" int GameActivityMotionEvent_fromJava( - JNIEnv *env, jobject motionEvent, GameActivityMotionEvent *out_event, - GameActivityHistoricalPointerAxes *out_historical) { - static bool gMotionEventClassInfoInitialized = false; - if (!gMotionEventClassInfoInitialized) { - int sdkVersion = GetSystemPropAsInt("ro.build.version.sdk"); - gMotionEventClassInfo = {0}; - jclass motionEventClass = env->FindClass("android/view/MotionEvent"); - gMotionEventClassInfo.getDeviceId = - env->GetMethodID(motionEventClass, "getDeviceId", "()I"); - gMotionEventClassInfo.getSource = - env->GetMethodID(motionEventClass, "getSource", "()I"); - gMotionEventClassInfo.getAction = - env->GetMethodID(motionEventClass, "getAction", "()I"); - gMotionEventClassInfo.getEventTime = - env->GetMethodID(motionEventClass, "getEventTime", "()J"); - gMotionEventClassInfo.getDownTime = - env->GetMethodID(motionEventClass, "getDownTime", "()J"); - gMotionEventClassInfo.getFlags = - env->GetMethodID(motionEventClass, "getFlags", "()I"); - gMotionEventClassInfo.getMetaState = - env->GetMethodID(motionEventClass, "getMetaState", "()I"); - if (sdkVersion >= 23) { - gMotionEventClassInfo.getActionButton = - env->GetMethodID(motionEventClass, "getActionButton", "()I"); - } - if (sdkVersion >= 14) { - gMotionEventClassInfo.getButtonState = - env->GetMethodID(motionEventClass, "getButtonState", "()I"); - } - if (sdkVersion >= 29) { - gMotionEventClassInfo.getClassification = - env->GetMethodID(motionEventClass, "getClassification", "()I"); - } - gMotionEventClassInfo.getEdgeFlags = - env->GetMethodID(motionEventClass, "getEdgeFlags", "()I"); - gMotionEventClassInfo.getPointerCount = - env->GetMethodID(motionEventClass, "getPointerCount", "()I"); - gMotionEventClassInfo.getPointerId = - env->GetMethodID(motionEventClass, "getPointerId", "(I)I"); - gMotionEventClassInfo.getToolType = - env->GetMethodID(motionEventClass, "getToolType", "(I)I"); - if (sdkVersion >= 29) { - gMotionEventClassInfo.getRawX = - env->GetMethodID(motionEventClass, "getRawX", "(I)F"); - gMotionEventClassInfo.getRawY = - env->GetMethodID(motionEventClass, "getRawY", "(I)F"); - } - gMotionEventClassInfo.getXPrecision = - env->GetMethodID(motionEventClass, "getXPrecision", "()F"); - gMotionEventClassInfo.getYPrecision = - env->GetMethodID(motionEventClass, "getYPrecision", "()F"); - gMotionEventClassInfo.getAxisValue = - env->GetMethodID(motionEventClass, "getAxisValue", "(II)F"); - - gMotionEventClassInfo.getHistorySize = - env->GetMethodID(motionEventClass, "getHistorySize", "()I"); - gMotionEventClassInfo.getHistoricalEventTime = - env->GetMethodID(motionEventClass, "getHistoricalEventTime", "(I)J"); - gMotionEventClassInfo.getHistoricalAxisValue = - env->GetMethodID(motionEventClass, "getHistoricalAxisValue", "(III)F"); - - gMotionEventClassInfoInitialized = true; - } +extern "C" int GameActivity_getNavigation(GameActivity *) { + return gConfiguration.navigation; +} - int historySize = - env->CallIntMethod(motionEvent, gMotionEventClassInfo.getHistorySize); - historySize = - std::min(historySize, GAMEACTIVITY_MAX_NUM_HISTORICAL_IN_MOTION_EVENT); +extern "C" int GameActivity_getNavigationHidden(GameActivity *) { + return gConfiguration.navigationHidden; +} - int localEnabledHistoricalAxis[GAME_ACTIVITY_POINTER_INFO_AXIS_COUNT]; - int enabledHistoricalAxisCount = 0; +extern "C" int GameActivity_getOrientation(GameActivity *) { + return gConfiguration.orientation; +} - for (int axisIndex = 0; - axisIndex < GAME_ACTIVITY_POINTER_INFO_AXIS_COUNT; - ++axisIndex) { - if (enabledHistoricalAxes[axisIndex]) { - localEnabledHistoricalAxis[enabledHistoricalAxisCount++] = axisIndex; - } - } - out_event->historicalCount = enabledHistoricalAxisCount == 0 ? 0 : historySize; - out_event->historicalStart = 0; // Free for caller to use - - // The historical event times aren't unique per-pointer but for simplicity - // we output a per-pointer event time, copied from here... - int64_t historicalEventTimes[GAMEACTIVITY_MAX_NUM_HISTORICAL_IN_MOTION_EVENT]; - for (int histIndex = 0; histIndex < historySize; ++histIndex) { - historicalEventTimes[histIndex] = - env->CallLongMethod(motionEvent, - gMotionEventClassInfo.getHistoricalEventTime, histIndex) * - 1000000; - } +extern "C" int GameActivity_getScreenHeightDp(GameActivity *) { + return gConfiguration.screenHeightDp; +} - int pointerCount = - env->CallIntMethod(motionEvent, gMotionEventClassInfo.getPointerCount); - pointerCount = - std::min(pointerCount, GAMEACTIVITY_MAX_NUM_POINTERS_IN_MOTION_EVENT); - out_event->pointerCount = pointerCount; - for (int i = 0; i < pointerCount; ++i) { - out_event->pointers[i] = { - /*id=*/env->CallIntMethod(motionEvent, - gMotionEventClassInfo.getPointerId, i), - /*toolType=*/env->CallIntMethod(motionEvent, - gMotionEventClassInfo.getToolType, i), - /*axisValues=*/{0}, - /*rawX=*/gMotionEventClassInfo.getRawX - ? env->CallFloatMethod(motionEvent, - gMotionEventClassInfo.getRawX, i) - : 0, - /*rawY=*/gMotionEventClassInfo.getRawY - ? env->CallFloatMethod(motionEvent, - gMotionEventClassInfo.getRawY, i) - : 0, - }; - - for (int axisIndex = 0; - axisIndex < GAME_ACTIVITY_POINTER_INFO_AXIS_COUNT; ++axisIndex) { - if (enabledAxes[axisIndex]) { - out_event->pointers[i].axisValues[axisIndex] = - env->CallFloatMethod(motionEvent, - gMotionEventClassInfo.getAxisValue, - axisIndex, i); - } - } +extern "C" int GameActivity_getScreenLayout(GameActivity *) { + return gConfiguration.screenLayout; +} - if (enabledHistoricalAxisCount > 0) { - for (int histIndex = 0; histIndex < historySize; ++histIndex) { - int pointerHistIndex = historySize * i; - out_historical[pointerHistIndex].eventTime = historicalEventTimes[histIndex]; - for (int c = 0; c < enabledHistoricalAxisCount; ++c) { - int axisIndex = localEnabledHistoricalAxis[c]; - out_historical[pointerHistIndex].axisValues[axisIndex] = - env->CallFloatMethod(motionEvent, - gMotionEventClassInfo.getHistoricalAxisValue, - axisIndex, i, histIndex); - } - } - } - } +extern "C" int GameActivity_getScreenWidthDp(GameActivity *) { + return gConfiguration.screenWidthDp; +} - out_event->deviceId = - env->CallIntMethod(motionEvent, gMotionEventClassInfo.getDeviceId); - out_event->source = - env->CallIntMethod(motionEvent, gMotionEventClassInfo.getSource); - out_event->action = - env->CallIntMethod(motionEvent, gMotionEventClassInfo.getAction); - out_event->eventTime = - env->CallLongMethod(motionEvent, gMotionEventClassInfo.getEventTime) * - 1000000; - out_event->downTime = - env->CallLongMethod(motionEvent, gMotionEventClassInfo.getDownTime) * - 1000000; - out_event->flags = - env->CallIntMethod(motionEvent, gMotionEventClassInfo.getFlags); - out_event->metaState = - env->CallIntMethod(motionEvent, gMotionEventClassInfo.getMetaState); - out_event->actionButton = - gMotionEventClassInfo.getActionButton - ? env->CallIntMethod(motionEvent, - gMotionEventClassInfo.getActionButton) - : 0; - out_event->buttonState = - gMotionEventClassInfo.getButtonState - ? env->CallIntMethod(motionEvent, - gMotionEventClassInfo.getButtonState) - : 0; - out_event->classification = - gMotionEventClassInfo.getClassification - ? env->CallIntMethod(motionEvent, - gMotionEventClassInfo.getClassification) - : 0; - out_event->edgeFlags = - env->CallIntMethod(motionEvent, gMotionEventClassInfo.getEdgeFlags); - out_event->precisionX = - env->CallFloatMethod(motionEvent, gMotionEventClassInfo.getXPrecision); - out_event->precisionY = - env->CallFloatMethod(motionEvent, gMotionEventClassInfo.getYPrecision); - - return out_event->pointerCount * out_event->historicalCount; +extern "C" int GameActivity_getSmallestScreenWidthDp(GameActivity *) { + return gConfiguration.smallestScreenWidthDp; } -static struct { - jmethodID getDeviceId; - jmethodID getSource; - jmethodID getAction; - - jmethodID getEventTime; - jmethodID getDownTime; - - jmethodID getFlags; - jmethodID getMetaState; - - jmethodID getModifiers; - jmethodID getRepeatCount; - jmethodID getKeyCode; - jmethodID getScanCode; -} gKeyEventClassInfo; - -extern "C" void GameActivityKeyEvent_fromJava(JNIEnv *env, jobject keyEvent, - GameActivityKeyEvent *out_event) { - static bool gKeyEventClassInfoInitialized = false; - if (!gKeyEventClassInfoInitialized) { - int sdkVersion = GetSystemPropAsInt("ro.build.version.sdk"); - gKeyEventClassInfo = {0}; - jclass keyEventClass = env->FindClass("android/view/KeyEvent"); - gKeyEventClassInfo.getDeviceId = - env->GetMethodID(keyEventClass, "getDeviceId", "()I"); - gKeyEventClassInfo.getSource = - env->GetMethodID(keyEventClass, "getSource", "()I"); - gKeyEventClassInfo.getAction = - env->GetMethodID(keyEventClass, "getAction", "()I"); - gKeyEventClassInfo.getEventTime = - env->GetMethodID(keyEventClass, "getEventTime", "()J"); - gKeyEventClassInfo.getDownTime = - env->GetMethodID(keyEventClass, "getDownTime", "()J"); - gKeyEventClassInfo.getFlags = - env->GetMethodID(keyEventClass, "getFlags", "()I"); - gKeyEventClassInfo.getMetaState = - env->GetMethodID(keyEventClass, "getMetaState", "()I"); - if (sdkVersion >= 13) { - gKeyEventClassInfo.getModifiers = - env->GetMethodID(keyEventClass, "getModifiers", "()I"); - } - gKeyEventClassInfo.getRepeatCount = - env->GetMethodID(keyEventClass, "getRepeatCount", "()I"); - gKeyEventClassInfo.getKeyCode = - env->GetMethodID(keyEventClass, "getKeyCode", "()I"); - gKeyEventClassInfo.getScanCode = - env->GetMethodID(keyEventClass, "getScanCode", "()I"); - - gKeyEventClassInfoInitialized = true; - } +extern "C" int GameActivity_getTouchscreen(GameActivity *) { + return gConfiguration.touchscreen; +} - *out_event = { - /*deviceId=*/env->CallIntMethod(keyEvent, - gKeyEventClassInfo.getDeviceId), - /*source=*/env->CallIntMethod(keyEvent, gKeyEventClassInfo.getSource), - /*action=*/env->CallIntMethod(keyEvent, gKeyEventClassInfo.getAction), - // TODO: introduce a millisecondsToNanoseconds helper: - /*eventTime=*/ - env->CallLongMethod(keyEvent, gKeyEventClassInfo.getEventTime) * - 1000000, - /*downTime=*/ - env->CallLongMethod(keyEvent, gKeyEventClassInfo.getDownTime) * 1000000, - /*flags=*/env->CallIntMethod(keyEvent, gKeyEventClassInfo.getFlags), - /*metaState=*/ - env->CallIntMethod(keyEvent, gKeyEventClassInfo.getMetaState), - /*modifiers=*/gKeyEventClassInfo.getModifiers - ? env->CallIntMethod(keyEvent, gKeyEventClassInfo.getModifiers) - : 0, - /*repeatCount=*/ - env->CallIntMethod(keyEvent, gKeyEventClassInfo.getRepeatCount), - /*keyCode=*/ - env->CallIntMethod(keyEvent, gKeyEventClassInfo.getKeyCode), - /*scanCode=*/ - env->CallIntMethod(keyEvent, gKeyEventClassInfo.getScanCode)}; +extern "C" int GameActivity_getUIMode(GameActivity *) { + return gConfiguration.uiMode; } static bool onTouchEvent_native(JNIEnv *env, jobject javaGameActivity, @@ -1167,11 +851,9 @@ static bool onTouchEvent_native(JNIEnv *env, jobject javaGameActivity, if (code->callbacks.onTouchEvent == nullptr) return false; static GameActivityMotionEvent c_event; - // Note the actual data is written contiguously as numPointers x historySize - // entries. - static GameActivityHistoricalPointerAxes historical[GAMEACTIVITY_MAX_NUM_POINTERS_IN_MOTION_EVENT * GAMEACTIVITY_MAX_NUM_HISTORICAL_IN_MOTION_EVENT]; - int historicalLen = GameActivityMotionEvent_fromJava(env, motionEvent, &c_event, historical); - return code->callbacks.onTouchEvent(code, &c_event, historical, historicalLen); + GameActivityMotionEvent_fromJava(env, motionEvent, &c_event); + return code->callbacks.onTouchEvent(code, &c_event); + } static bool onKeyUp_native(JNIEnv *env, jobject javaGameActivity, jlong handle, @@ -1247,19 +929,37 @@ static void setInputConnection_native(JNIEnv *env, jobject activity, GameTextInput_setInputConnection(code->gameTextInput, inputConnection); } +static void onContentRectChangedNative_native(JNIEnv *env, jobject activity, + jlong handle, jint x, jint y, + jint w, jint h) { + if (handle != 0) { + NativeCode *code = (NativeCode *)handle; + + if (code->callbacks.onContentRectChanged != nullptr) { + ARect rect; + rect.left = x; + rect.top = y; + rect.right = x+w; + rect.bottom = y+h; + code->callbacks.onContentRectChanged(code, &rect); + } + } +} + static const JNINativeMethod g_methods[] = { - {"loadNativeCode", - "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/" - "String;Ljava/lang/String;Landroid/content/res/AssetManager;[B)J", - (void *)loadNativeCode_native}, + {"initializeNativeCode", + "(Ljava/lang/String;Ljava/lang/String;" + "Ljava/lang/String;Landroid/content/res/AssetManager;" + "[BLandroid/content/res/Configuration;)J", + (void *)initializeNativeCode_native}, {"getDlError", "()Ljava/lang/String;", (void *)getDlError_native}, - {"unloadNativeCode", "(J)V", (void *)unloadNativeCode_native}, + {"terminateNativeCode", "(J)V", (void *)terminateNativeCode_native}, {"onStartNative", "(J)V", (void *)onStart_native}, {"onResumeNative", "(J)V", (void *)onResume_native}, {"onSaveInstanceStateNative", "(J)[B", (void *)onSaveInstanceState_native}, {"onPauseNative", "(J)V", (void *)onPause_native}, {"onStopNative", "(J)V", (void *)onStop_native}, - {"onConfigurationChangedNative", "(J)V", + {"onConfigurationChangedNative", "(JLandroid/content/res/Configuration;)V", (void *)onConfigurationChanged_native}, {"onTrimMemoryNative", "(JI)V", (void *)onTrimMemory_native}, {"onWindowFocusChangedNative", "(JZ)V", @@ -1284,13 +984,16 @@ static const JNINativeMethod g_methods[] = { {"setInputConnectionNative", "(JLcom/google/androidgamesdk/gametextinput/InputConnection;)V", (void *)setInputConnection_native}, + {"onContentRectChangedNative", "(JIIII)V", + (void *)onContentRectChangedNative_native}, }; static const char *const kGameActivityPathName = "com/google/androidgamesdk/GameActivity"; static const char *const kInsetsPathName = "androidx/core/graphics/Insets"; - +static const char *const kConfigurationPathName = + "android/content/res/Configuration"; static const char *const kWindowInsetsCompatTypePathName = "androidx/core/view/WindowInsetsCompat$Type"; @@ -1348,12 +1051,59 @@ extern "C" int GameActivity_register(JNIEnv *env) { "getWaterfallInsets", "()Landroidx/core/graphics/Insets;"); GET_METHOD_ID(gGameActivityClassInfo.setImeEditorInfoFields, activity_class, "setImeEditorInfoFields", "(III)V"); + jclass insets_class; FIND_CLASS(insets_class, kInsetsPathName); GET_FIELD_ID(gInsetsClassInfo.left, insets_class, "left", "I"); GET_FIELD_ID(gInsetsClassInfo.right, insets_class, "right", "I"); GET_FIELD_ID(gInsetsClassInfo.top, insets_class, "top", "I"); GET_FIELD_ID(gInsetsClassInfo.bottom, insets_class, "bottom", "I"); + + jclass configuration_class; + FIND_CLASS(configuration_class, kConfigurationPathName); + + if (android_get_device_api_level() >= 26) { + GET_FIELD_ID(gConfigurationClassInfo.colorMode, configuration_class, + "colorMode", "I"); + } + + GET_FIELD_ID(gConfigurationClassInfo.densityDpi, configuration_class, + "densityDpi", "I"); + GET_FIELD_ID(gConfigurationClassInfo.fontScale, configuration_class, + "fontScale", "F"); + + if (android_get_device_api_level() >= 31) { + GET_FIELD_ID(gConfigurationClassInfo.fontWeightAdjustment, + configuration_class, "fontWeightAdjustment", "I"); + } + + GET_FIELD_ID(gConfigurationClassInfo.hardKeyboardHidden, + configuration_class, "hardKeyboardHidden", "I"); + GET_FIELD_ID(gConfigurationClassInfo.keyboard, configuration_class, + "keyboard", "I"); + GET_FIELD_ID(gConfigurationClassInfo.keyboardHidden, configuration_class, + "keyboardHidden", "I"); + GET_FIELD_ID(gConfigurationClassInfo.mcc, configuration_class, "mcc", "I"); + GET_FIELD_ID(gConfigurationClassInfo.mnc, configuration_class, "mnc", "I"); + GET_FIELD_ID(gConfigurationClassInfo.navigation, configuration_class, + "navigation", "I"); + GET_FIELD_ID(gConfigurationClassInfo.navigationHidden, configuration_class, + "navigationHidden", "I"); + GET_FIELD_ID(gConfigurationClassInfo.orientation, configuration_class, + "orientation", "I"); + GET_FIELD_ID(gConfigurationClassInfo.screenHeightDp, configuration_class, + "screenHeightDp", "I"); + GET_FIELD_ID(gConfigurationClassInfo.screenLayout, configuration_class, + "screenLayout", "I"); + GET_FIELD_ID(gConfigurationClassInfo.screenWidthDp, configuration_class, + "screenWidthDp", "I"); + GET_FIELD_ID(gConfigurationClassInfo.smallestScreenWidthDp, + configuration_class, "smallestScreenWidthDp", "I"); + GET_FIELD_ID(gConfigurationClassInfo.touchscreen, configuration_class, + "touchscreen", "I"); + GET_FIELD_ID(gConfigurationClassInfo.uiMode, configuration_class, "uiMode", + "I"); + jclass windowInsetsCompatType_class; FIND_CLASS(windowInsetsCompatType_class, kWindowInsetsCompatTypePathName); gWindowInsetsCompatTypeClassInfo.clazz = @@ -1380,19 +1130,14 @@ extern "C" int GameActivity_register(JNIEnv *env) { NELEM(g_methods)); } -// XXX: This symbol is renamed with a _C suffix and then re-exported from -// Rust because Rust/Cargo don't give us a way to directly export symbols -// from C/C++ code: https://github.com/rust-lang/rfcs/issues/2771 -// -// Register this method so that GameActiviy_register does not need to be called -// manually. -extern "C" jlong Java_com_google_androidgamesdk_GameActivity_loadNativeCode_C( - JNIEnv *env, jobject javaGameActivity, jstring path, jstring funcName, - jstring internalDataDir, jstring obbDir, jstring externalDataDir, - jobject jAssetMgr, jbyteArray savedState) { +extern "C" JNIEXPORT jlong JNICALL +Java_com_google_androidgamesdk_GameActivity_initializeNativeCode( + JNIEnv *env, jobject javaGameActivity, jstring internalDataDir, + jstring obbDir, jstring externalDataDir, jobject jAssetMgr, + jbyteArray savedState, jobject javaConfig) { GameActivity_register(env); - jlong nativeCode = loadNativeCode_native( - env, javaGameActivity, path, funcName, internalDataDir, obbDir, - externalDataDir, jAssetMgr, savedState); + jlong nativeCode = initializeNativeCode_native( + env, javaGameActivity, internalDataDir, obbDir, externalDataDir, + jAssetMgr, savedState, javaConfig); return nativeCode; } diff --git a/android-activity/game-activity-csrc/game-activity/GameActivity.h b/android-activity/game-activity-csrc/game-activity/GameActivity.h index c5abfc0..702f754 100644 --- a/android-activity/game-activity-csrc/game-activity/GameActivity.h +++ b/android-activity/game-activity-csrc/game-activity/GameActivity.h @@ -36,12 +36,22 @@ #include #include +#include "common/gamesdk_common.h" +#include "game-activity/GameActivityEvents.h" #include "game-text-input/gametextinput.h" #ifdef __cplusplus extern "C" { #endif +#define GAMEACTIVITY_MAJOR_VERSION 2 +#define GAMEACTIVITY_MINOR_VERSION 0 +#define GAMEACTIVITY_BUGFIX_VERSION 2 +#define GAMEACTIVITY_PACKED_VERSION \ + ANDROID_GAMESDK_PACKED_VERSION(GAMEACTIVITY_MAJOR_VERSION, \ + GAMEACTIVITY_MINOR_VERSION, \ + GAMEACTIVITY_BUGFIX_VERSION) + /** * {@link GameActivityCallbacks} */ @@ -115,199 +125,6 @@ typedef struct GameActivity { const char* obbPath; } GameActivity; -/** - * The maximum number of axes supported in an Android MotionEvent. - * See https://developer.android.com/ndk/reference/group/input. - */ -#define GAME_ACTIVITY_POINTER_INFO_AXIS_COUNT 48 - -/** - * \brief Describe information about a pointer, found in a - * GameActivityMotionEvent. - * - * You can read values directly from this structure, or use helper functions - * (`GameActivityPointerAxes_getX`, `GameActivityPointerAxes_getY` and - * `GameActivityPointerAxes_getAxisValue`). - * - * The X axis and Y axis are enabled by default but any other axis that you want - * to read **must** be enabled first, using - * `GameActivityPointerAxes_enableAxis`. - * - * \see GameActivityMotionEvent - */ -typedef struct GameActivityPointerAxes { - int32_t id; - int32_t toolType; - float axisValues[GAME_ACTIVITY_POINTER_INFO_AXIS_COUNT]; - float rawX; - float rawY; -} GameActivityPointerAxes; - -typedef struct GameActivityHistoricalPointerAxes { - int64_t eventTime; - float axisValues[GAME_ACTIVITY_POINTER_INFO_AXIS_COUNT]; -} GameActivityHistoricalPointerAxes; - -/** \brief Get the current X coordinate of the pointer. */ -inline float GameActivityPointerAxes_getX( - const GameActivityPointerAxes* pointerInfo) { - return pointerInfo->axisValues[AMOTION_EVENT_AXIS_X]; -} - -/** \brief Get the current Y coordinate of the pointer. */ -inline float GameActivityPointerAxes_getY( - const GameActivityPointerAxes* pointerInfo) { - return pointerInfo->axisValues[AMOTION_EVENT_AXIS_Y]; -} - -/** - * \brief Enable the specified axis, so that its value is reported in the - * GameActivityPointerAxes structures stored in a motion event. - * - * You must enable any axis that you want to read, apart from - * `AMOTION_EVENT_AXIS_X` and `AMOTION_EVENT_AXIS_Y` that are enabled by - * default. - * - * If the axis index is out of range, nothing is done. - */ -void GameActivityPointerAxes_enableAxis(int32_t axis); - -/** - * \brief Disable the specified axis. Its value won't be reported in the - * GameActivityPointerAxes structures stored in a motion event anymore. - * - * Apart from X and Y, any axis that you want to read **must** be enabled first, - * using `GameActivityPointerAxes_enableAxis`. - * - * If the axis index is out of range, nothing is done. - */ -void GameActivityPointerAxes_disableAxis(int32_t axis); - -/** - * \brief Enable the specified axis, so that its value is reported in the - * GameActivityHistoricalPointerAxes structures associated with a motion event. - * - * You must enable any axis that you want to read (no axes are enabled by - * default). - * - * If the axis index is out of range, nothing is done. - */ -void GameActivityHistoricalPointerAxes_enableAxis(int32_t axis); - -/** - * \brief Disable the specified axis. Its value won't be reported in the - * GameActivityHistoricalPointerAxes structures associated with motion events - * anymore. - * - * If the axis index is out of range, nothing is done. - */ -void GameActivityHistoricalPointerAxes_disableAxis(int32_t axis); - -/** - * \brief Get the value of the requested axis. - * - * Apart from X and Y, any axis that you want to read **must** be enabled first, - * using `GameActivityPointerAxes_enableAxis`. - * - * Find the valid enums for the axis (`AMOTION_EVENT_AXIS_X`, - * `AMOTION_EVENT_AXIS_Y`, `AMOTION_EVENT_AXIS_PRESSURE`...) - * in https://developer.android.com/ndk/reference/group/input. - * - * @param pointerInfo The structure containing information about the pointer, - * obtained from GameActivityMotionEvent. - * @param axis The axis to get the value from - * @return The value of the axis, or 0 if the axis is invalid or was not - * enabled. - */ -inline float GameActivityPointerAxes_getAxisValue( - GameActivityPointerAxes* pointerInfo, int32_t axis) { - if (axis < 0 || axis >= GAME_ACTIVITY_POINTER_INFO_AXIS_COUNT) { - return 0; - } - - return pointerInfo->axisValues[axis]; -} - -/** - * The maximum number of pointers returned inside a motion event. - */ -#if (defined GAMEACTIVITY_MAX_NUM_POINTERS_IN_MOTION_EVENT_OVERRIDE) -#define GAMEACTIVITY_MAX_NUM_POINTERS_IN_MOTION_EVENT \ - GAMEACTIVITY_MAX_NUM_POINTERS_IN_MOTION_EVENT_OVERRIDE -#else -#define GAMEACTIVITY_MAX_NUM_POINTERS_IN_MOTION_EVENT 8 -#endif - -/** - * The maximum number of historic samples associated with a single motion event. - */ -#if (defined GAMEACTIVITY_MAX_NUM_HISTORICAL_IN_MOTION_EVENT_OVERRIDE) -#define GAMEACTIVITY_MAX_NUM_HISTORICAL_IN_MOTION_EVENT \ - GAMEACTIVITY_MAX_NUM_HISTORICAL_IN_MOTION_EVENT_OVERRIDE -#else -#define GAMEACTIVITY_MAX_NUM_HISTORICAL_IN_MOTION_EVENT 8 -#endif - -/** - * \brief Describe a motion event that happened on the GameActivity SurfaceView. - * - * This is 1:1 mapping to the information contained in a Java `MotionEvent` - * (see https://developer.android.com/reference/android/view/MotionEvent). - */ -typedef struct GameActivityMotionEvent { - int32_t deviceId; - int32_t source; - int32_t action; - - int64_t eventTime; - int64_t downTime; - - int32_t flags; - int32_t metaState; - - int32_t actionButton; - int32_t buttonState; - int32_t classification; - int32_t edgeFlags; - - uint32_t pointerCount; - GameActivityPointerAxes - pointers[GAMEACTIVITY_MAX_NUM_POINTERS_IN_MOTION_EVENT]; - - float precisionX; - float precisionY; - - int16_t historicalStart; - - // Note the actual buffer of historical data has a length of - // pointerCount * historicalCount, since the historical axis - // data is per-pointer. - int16_t historicalCount; -} GameActivityMotionEvent; - -/** - * \brief Describe a key event that happened on the GameActivity SurfaceView. - * - * This is 1:1 mapping to the information contained in a Java `KeyEvent` - * (see https://developer.android.com/reference/android/view/KeyEvent). - */ -typedef struct GameActivityKeyEvent { - int32_t deviceId; - int32_t source; - int32_t action; - - int64_t eventTime; - int64_t downTime; - - int32_t flags; - int32_t metaState; - - int32_t modifiers; - int32_t repeatCount; - int32_t keyCode; - int32_t scanCode; -} GameActivityKeyEvent; - /** * A function the user should call from their callback with the data, its length * and the library- supplied context. @@ -424,9 +241,7 @@ typedef struct GameActivityCallbacks { * only valid during the callback. */ bool (*onTouchEvent)(GameActivity* activity, - const GameActivityMotionEvent* event, - const GameActivityHistoricalPointerAxes* historical, - int historicalLen); + const GameActivityMotionEvent* event); /** * Callback called for every key down event on the GameActivity SurfaceView. @@ -456,36 +271,13 @@ typedef struct GameActivityCallbacks { * Call GameActivity_getWindowInsets to retrieve the insets themselves. */ void (*onWindowInsetsChanged)(GameActivity* activity); -} GameActivityCallbacks; -/** - * \brief Convert a Java `MotionEvent` to a `GameActivityMotionEvent`. - * - * This is done automatically by the GameActivity: see `onTouchEvent` to set - * a callback to consume the received events. - * This function can be used if you re-implement events handling in your own - * activity. On return, the out_event->historicalStart will be zero, and should - * be updated to index into whatever buffer out_historical is copied. - * On return the length of out_historical is - * (out_event->pointerCount x out_event->historicalCount) and is in a - * pointer-major order (i.e. all axis for a pointer are contiguous) - * Ownership of out_event is maintained by the caller. - */ -int GameActivityMotionEvent_fromJava(JNIEnv* env, jobject motionEvent, - GameActivityMotionEvent* out_event, - GameActivityHistoricalPointerAxes *out_historical); - -/** - * \brief Convert a Java `KeyEvent` to a `GameActivityKeyEvent`. - * - * This is done automatically by the GameActivity: see `onKeyUp` and `onKeyDown` - * to set a callback to consume the received events. - * This function can be used if you re-implement events handling in your own - * activity. - * Ownership of out_event is maintained by the caller. - */ -void GameActivityKeyEvent_fromJava(JNIEnv* env, jobject motionEvent, - GameActivityKeyEvent* out_event); + /** + * Callback called when the rectangle in the window where the content + * should be placed has changed. + */ + void (*onContentRectChanged)(GameActivity *activity, const ARect *rect); +} GameActivityCallbacks; /** * This is the function that must be in the native code to instantiate the @@ -811,6 +603,30 @@ void GameActivity_getWindowInsets(GameActivity* activity, void GameActivity_setImeEditorInfo(GameActivity* activity, int inputType, int actionId, int imeOptions); +/** + * These are getters for Configuration class members. They may be called from + * any thread. + */ +int GameActivity_getOrientation(GameActivity* activity); +int GameActivity_getColorMode(GameActivity* activity); +int GameActivity_getDensityDpi(GameActivity* activity); +float GameActivity_getFontScale(GameActivity* activity); +int GameActivity_getFontWeightAdjustment(GameActivity* activity); +int GameActivity_getHardKeyboardHidden(GameActivity* activity); +int GameActivity_getKeyboard(GameActivity* activity); +int GameActivity_getKeyboardHidden(GameActivity* activity); +int GameActivity_getMcc(GameActivity* activity); +int GameActivity_getMnc(GameActivity* activity); +int GameActivity_getNavigation(GameActivity* activity); +int GameActivity_getNavigationHidden(GameActivity* activity); +int GameActivity_getOrientation(GameActivity* activity); +int GameActivity_getScreenHeightDp(GameActivity* activity); +int GameActivity_getScreenLayout(GameActivity* activity); +int GameActivity_getScreenWidthDp(GameActivity* activity); +int GameActivity_getSmallestScreenWidthDp(GameActivity* activity); +int GameActivity_getTouchscreen(GameActivity* activity); +int GameActivity_getUIMode(GameActivity* activity); + #ifdef __cplusplus } #endif diff --git a/android-activity/game-activity-csrc/game-activity/GameActivityEvents.cpp b/android-activity/game-activity-csrc/game-activity/GameActivityEvents.cpp new file mode 100644 index 0000000..4142601 --- /dev/null +++ b/android-activity/game-activity-csrc/game-activity/GameActivityEvents.cpp @@ -0,0 +1,413 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "GameActivityEvents.h" + +#include + +#include + +#include "GameActivityLog.h" + +// TODO(b/187147166): these functions were extracted from the Game SDK +// (gamesdk/src/common/system_utils.h). system_utils.h/cpp should be used +// instead. +namespace { + +std::string getSystemPropViaGet(const char *key, + const char *default_value = "") { + char buffer[PROP_VALUE_MAX + 1] = ""; // +1 for terminator + int bufferLen = __system_property_get(key, buffer); + if (bufferLen > 0) + return buffer; + else + return ""; +} + +std::string GetSystemProp(const char *key, const char *default_value = "") { + return getSystemPropViaGet(key, default_value); +} + +int GetSystemPropAsInt(const char *key, int default_value = 0) { + std::string prop = GetSystemProp(key); + return prop == "" ? default_value : strtoll(prop.c_str(), nullptr, 10); +} + +} // anonymous namespace + +#ifndef NELEM +#define NELEM(x) ((int)(sizeof(x) / sizeof((x)[0]))) +#endif + +static bool enabledAxes[GAME_ACTIVITY_POINTER_INFO_AXIS_COUNT] = { + /* AMOTION_EVENT_AXIS_X */ true, + /* AMOTION_EVENT_AXIS_Y */ true, + // Disable all other axes by default (they can be enabled using + // `GameActivityPointerAxes_enableAxis`). + false}; + +extern "C" void GameActivityPointerAxes_enableAxis(int32_t axis) { + if (axis < 0 || axis >= GAME_ACTIVITY_POINTER_INFO_AXIS_COUNT) { + return; + } + + enabledAxes[axis] = true; +} + +float GameActivityPointerAxes_getAxisValue( + const GameActivityPointerAxes *pointerInfo, int32_t axis) { + if (axis < 0 || axis >= GAME_ACTIVITY_POINTER_INFO_AXIS_COUNT) { + return 0; + } + + if (!enabledAxes[axis]) { + ALOGW("Axis %d must be enabled before it can be accessed.", axis); + return 0; + } + + return pointerInfo->axisValues[axis]; +} + +extern "C" void GameActivityPointerAxes_disableAxis(int32_t axis) { + if (axis < 0 || axis >= GAME_ACTIVITY_POINTER_INFO_AXIS_COUNT) { + return; + } + + enabledAxes[axis] = false; +} + +float GameActivityMotionEvent_getHistoricalAxisValue( + const GameActivityMotionEvent *event, int axis, int pointerIndex, + int historyPos) { + if (axis < 0 || axis >= GAME_ACTIVITY_POINTER_INFO_AXIS_COUNT) { + ALOGE("Invalid axis %d", axis); + return -1; + } + if (pointerIndex < 0 || pointerIndex >= event->pointerCount) { + ALOGE("Invalid pointer index %d", pointerIndex); + return -1; + } + if (historyPos < 0 || historyPos >= event->historySize) { + ALOGE("Invalid history index %d", historyPos); + return -1; + } + if (!enabledAxes[axis]) { + ALOGW("Axis %d must be enabled before it can be accessed.", axis); + return 0; + } + + int pointerOffset = pointerIndex * GAME_ACTIVITY_POINTER_INFO_AXIS_COUNT; + int historyValuesOffset = historyPos * event->pointerCount * + GAME_ACTIVITY_POINTER_INFO_AXIS_COUNT; + return event + ->historicalAxisValues[historyValuesOffset + pointerOffset + axis]; +} + +static struct { + jmethodID getDeviceId; + jmethodID getSource; + jmethodID getAction; + + jmethodID getEventTime; + jmethodID getDownTime; + + jmethodID getFlags; + jmethodID getMetaState; + + jmethodID getActionButton; + jmethodID getButtonState; + jmethodID getClassification; + jmethodID getEdgeFlags; + + jmethodID getHistorySize; + jmethodID getHistoricalEventTime; + + jmethodID getPointerCount; + jmethodID getPointerId; + + jmethodID getToolType; + + jmethodID getRawX; + jmethodID getRawY; + jmethodID getXPrecision; + jmethodID getYPrecision; + jmethodID getAxisValue; + + jmethodID getHistoricalAxisValue; +} gMotionEventClassInfo; + +extern "C" void GameActivityMotionEvent_destroy( + GameActivityMotionEvent *c_event) { + delete c_event->historicalAxisValues; + delete c_event->historicalEventTimesMillis; + delete c_event->historicalEventTimesNanos; +} + +extern "C" void GameActivityMotionEvent_fromJava( + JNIEnv *env, jobject motionEvent, GameActivityMotionEvent *out_event) { + static bool gMotionEventClassInfoInitialized = false; + if (!gMotionEventClassInfoInitialized) { + int sdkVersion = GetSystemPropAsInt("ro.build.version.sdk"); + gMotionEventClassInfo = {0}; + jclass motionEventClass = env->FindClass("android/view/MotionEvent"); + gMotionEventClassInfo.getDeviceId = + env->GetMethodID(motionEventClass, "getDeviceId", "()I"); + gMotionEventClassInfo.getSource = + env->GetMethodID(motionEventClass, "getSource", "()I"); + gMotionEventClassInfo.getAction = + env->GetMethodID(motionEventClass, "getAction", "()I"); + gMotionEventClassInfo.getEventTime = + env->GetMethodID(motionEventClass, "getEventTime", "()J"); + gMotionEventClassInfo.getDownTime = + env->GetMethodID(motionEventClass, "getDownTime", "()J"); + gMotionEventClassInfo.getFlags = + env->GetMethodID(motionEventClass, "getFlags", "()I"); + gMotionEventClassInfo.getMetaState = + env->GetMethodID(motionEventClass, "getMetaState", "()I"); + if (sdkVersion >= 23) { + gMotionEventClassInfo.getActionButton = + env->GetMethodID(motionEventClass, "getActionButton", "()I"); + } + if (sdkVersion >= 14) { + gMotionEventClassInfo.getButtonState = + env->GetMethodID(motionEventClass, "getButtonState", "()I"); + } + if (sdkVersion >= 29) { + gMotionEventClassInfo.getClassification = + env->GetMethodID(motionEventClass, "getClassification", "()I"); + } + gMotionEventClassInfo.getEdgeFlags = + env->GetMethodID(motionEventClass, "getEdgeFlags", "()I"); + + gMotionEventClassInfo.getHistorySize = + env->GetMethodID(motionEventClass, "getHistorySize", "()I"); + gMotionEventClassInfo.getHistoricalEventTime = env->GetMethodID( + motionEventClass, "getHistoricalEventTime", "(I)J"); + + gMotionEventClassInfo.getPointerCount = + env->GetMethodID(motionEventClass, "getPointerCount", "()I"); + gMotionEventClassInfo.getPointerId = + env->GetMethodID(motionEventClass, "getPointerId", "(I)I"); + gMotionEventClassInfo.getToolType = + env->GetMethodID(motionEventClass, "getToolType", "(I)I"); + if (sdkVersion >= 29) { + gMotionEventClassInfo.getRawX = + env->GetMethodID(motionEventClass, "getRawX", "(I)F"); + gMotionEventClassInfo.getRawY = + env->GetMethodID(motionEventClass, "getRawY", "(I)F"); + } + gMotionEventClassInfo.getXPrecision = + env->GetMethodID(motionEventClass, "getXPrecision", "()F"); + gMotionEventClassInfo.getYPrecision = + env->GetMethodID(motionEventClass, "getYPrecision", "()F"); + gMotionEventClassInfo.getAxisValue = + env->GetMethodID(motionEventClass, "getAxisValue", "(II)F"); + + gMotionEventClassInfo.getHistoricalAxisValue = env->GetMethodID( + motionEventClass, "getHistoricalAxisValue", "(III)F"); + gMotionEventClassInfoInitialized = true; + } + + int pointerCount = + env->CallIntMethod(motionEvent, gMotionEventClassInfo.getPointerCount); + pointerCount = + std::min(pointerCount, GAMEACTIVITY_MAX_NUM_POINTERS_IN_MOTION_EVENT); + out_event->pointerCount = pointerCount; + for (int i = 0; i < pointerCount; ++i) { + out_event->pointers[i] = { + /*id=*/env->CallIntMethod(motionEvent, + gMotionEventClassInfo.getPointerId, i), + /*toolType=*/ + env->CallIntMethod(motionEvent, gMotionEventClassInfo.getToolType, + i), + /*axisValues=*/{0}, + /*rawX=*/gMotionEventClassInfo.getRawX + ? env->CallFloatMethod(motionEvent, + gMotionEventClassInfo.getRawX, i) + : 0, + /*rawY=*/gMotionEventClassInfo.getRawY + ? env->CallFloatMethod(motionEvent, + gMotionEventClassInfo.getRawY, i) + : 0, + }; + + for (int axisIndex = 0; + axisIndex < GAME_ACTIVITY_POINTER_INFO_AXIS_COUNT; ++axisIndex) { + if (enabledAxes[axisIndex]) { + out_event->pointers[i].axisValues[axisIndex] = + env->CallFloatMethod(motionEvent, + gMotionEventClassInfo.getAxisValue, + axisIndex, i); + } + } + } + + int historySize = + env->CallIntMethod(motionEvent, gMotionEventClassInfo.getHistorySize); + out_event->historySize = historySize; + out_event->historicalAxisValues = + new float[historySize * pointerCount * + GAME_ACTIVITY_POINTER_INFO_AXIS_COUNT]; + out_event->historicalEventTimesMillis = new int64_t[historySize]; + out_event->historicalEventTimesNanos = new int64_t[historySize]; + + for (int historyIndex = 0; historyIndex < historySize; historyIndex++) { + out_event->historicalEventTimesMillis[historyIndex] = + env->CallLongMethod(motionEvent, + gMotionEventClassInfo.getHistoricalEventTime, + historyIndex); + out_event->historicalEventTimesNanos[historyIndex] = + out_event->historicalEventTimesMillis[historyIndex] * 1000000; + for (int i = 0; i < pointerCount; ++i) { + int pointerOffset = i * GAME_ACTIVITY_POINTER_INFO_AXIS_COUNT; + int historyAxisOffset = historyIndex * pointerCount * + GAME_ACTIVITY_POINTER_INFO_AXIS_COUNT; + float *axisValues = + &out_event + ->historicalAxisValues[historyAxisOffset + pointerOffset]; + for (int axisIndex = 0; + axisIndex < GAME_ACTIVITY_POINTER_INFO_AXIS_COUNT; + ++axisIndex) { + if (enabledAxes[axisIndex]) { + axisValues[axisIndex] = env->CallFloatMethod( + motionEvent, + gMotionEventClassInfo.getHistoricalAxisValue, axisIndex, + i, historyIndex); + } + } + } + } + + out_event->deviceId = + env->CallIntMethod(motionEvent, gMotionEventClassInfo.getDeviceId); + out_event->source = + env->CallIntMethod(motionEvent, gMotionEventClassInfo.getSource); + out_event->action = + env->CallIntMethod(motionEvent, gMotionEventClassInfo.getAction); + out_event->eventTime = + env->CallLongMethod(motionEvent, gMotionEventClassInfo.getEventTime) * + 1000000; + out_event->downTime = + env->CallLongMethod(motionEvent, gMotionEventClassInfo.getDownTime) * + 1000000; + out_event->flags = + env->CallIntMethod(motionEvent, gMotionEventClassInfo.getFlags); + out_event->metaState = + env->CallIntMethod(motionEvent, gMotionEventClassInfo.getMetaState); + out_event->actionButton = + gMotionEventClassInfo.getActionButton + ? env->CallIntMethod(motionEvent, + gMotionEventClassInfo.getActionButton) + : 0; + out_event->buttonState = + gMotionEventClassInfo.getButtonState + ? env->CallIntMethod(motionEvent, + gMotionEventClassInfo.getButtonState) + : 0; + out_event->classification = + gMotionEventClassInfo.getClassification + ? env->CallIntMethod(motionEvent, + gMotionEventClassInfo.getClassification) + : 0; + out_event->edgeFlags = + env->CallIntMethod(motionEvent, gMotionEventClassInfo.getEdgeFlags); + out_event->precisionX = + env->CallFloatMethod(motionEvent, gMotionEventClassInfo.getXPrecision); + out_event->precisionY = + env->CallFloatMethod(motionEvent, gMotionEventClassInfo.getYPrecision); +} + +static struct { + jmethodID getDeviceId; + jmethodID getSource; + jmethodID getAction; + + jmethodID getEventTime; + jmethodID getDownTime; + + jmethodID getFlags; + jmethodID getMetaState; + + jmethodID getModifiers; + jmethodID getRepeatCount; + jmethodID getKeyCode; + jmethodID getScanCode; + jmethodID getUnicodeChar; +} gKeyEventClassInfo; + +extern "C" void GameActivityKeyEvent_fromJava(JNIEnv *env, jobject keyEvent, + GameActivityKeyEvent *out_event) { + static bool gKeyEventClassInfoInitialized = false; + if (!gKeyEventClassInfoInitialized) { + int sdkVersion = GetSystemPropAsInt("ro.build.version.sdk"); + gKeyEventClassInfo = {0}; + jclass keyEventClass = env->FindClass("android/view/KeyEvent"); + gKeyEventClassInfo.getDeviceId = + env->GetMethodID(keyEventClass, "getDeviceId", "()I"); + gKeyEventClassInfo.getSource = + env->GetMethodID(keyEventClass, "getSource", "()I"); + gKeyEventClassInfo.getAction = + env->GetMethodID(keyEventClass, "getAction", "()I"); + gKeyEventClassInfo.getEventTime = + env->GetMethodID(keyEventClass, "getEventTime", "()J"); + gKeyEventClassInfo.getDownTime = + env->GetMethodID(keyEventClass, "getDownTime", "()J"); + gKeyEventClassInfo.getFlags = + env->GetMethodID(keyEventClass, "getFlags", "()I"); + gKeyEventClassInfo.getMetaState = + env->GetMethodID(keyEventClass, "getMetaState", "()I"); + if (sdkVersion >= 13) { + gKeyEventClassInfo.getModifiers = + env->GetMethodID(keyEventClass, "getModifiers", "()I"); + } + gKeyEventClassInfo.getRepeatCount = + env->GetMethodID(keyEventClass, "getRepeatCount", "()I"); + gKeyEventClassInfo.getKeyCode = + env->GetMethodID(keyEventClass, "getKeyCode", "()I"); + gKeyEventClassInfo.getScanCode = + env->GetMethodID(keyEventClass, "getScanCode", "()I"); + gKeyEventClassInfo.getUnicodeChar = + env->GetMethodID(keyEventClass, "getUnicodeChar", "()I"); + + gKeyEventClassInfoInitialized = true; + } + + *out_event = { + /*deviceId=*/env->CallIntMethod(keyEvent, + gKeyEventClassInfo.getDeviceId), + /*source=*/env->CallIntMethod(keyEvent, gKeyEventClassInfo.getSource), + /*action=*/env->CallIntMethod(keyEvent, gKeyEventClassInfo.getAction), + // TODO: introduce a millisecondsToNanoseconds helper: + /*eventTime=*/ + env->CallLongMethod(keyEvent, gKeyEventClassInfo.getEventTime) * + 1000000, + /*downTime=*/ + env->CallLongMethod(keyEvent, gKeyEventClassInfo.getDownTime) * 1000000, + /*flags=*/env->CallIntMethod(keyEvent, gKeyEventClassInfo.getFlags), + /*metaState=*/ + env->CallIntMethod(keyEvent, gKeyEventClassInfo.getMetaState), + /*modifiers=*/gKeyEventClassInfo.getModifiers + ? env->CallIntMethod(keyEvent, gKeyEventClassInfo.getModifiers) + : 0, + /*repeatCount=*/ + env->CallIntMethod(keyEvent, gKeyEventClassInfo.getRepeatCount), + /*keyCode=*/ + env->CallIntMethod(keyEvent, gKeyEventClassInfo.getKeyCode), + /*scanCode=*/ + env->CallIntMethod(keyEvent, gKeyEventClassInfo.getScanCode), + /*unicodeChar=*/ + env->CallIntMethod(keyEvent, gKeyEventClassInfo.getUnicodeChar)}; +} diff --git a/android-activity/game-activity-csrc/game-activity/GameActivityEvents.h b/android-activity/game-activity-csrc/game-activity/GameActivityEvents.h new file mode 100644 index 0000000..183c72f --- /dev/null +++ b/android-activity/game-activity-csrc/game-activity/GameActivityEvents.h @@ -0,0 +1,336 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup GameActivity Game Activity Events + * The interface to use Game Activity Events. + * @{ + */ + +/** + * @file GameActivityEvents.h + */ +#ifndef ANDROID_GAME_SDK_GAME_ACTIVITY_EVENTS_H +#define ANDROID_GAME_SDK_GAME_ACTIVITY_EVENTS_H + +#include +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * The maximum number of axes supported in an Android MotionEvent. + * See https://developer.android.com/ndk/reference/group/input. + */ +#define GAME_ACTIVITY_POINTER_INFO_AXIS_COUNT 48 + +/** + * \brief Describe information about a pointer, found in a + * GameActivityMotionEvent. + * + * You can read values directly from this structure, or use helper functions + * (`GameActivityPointerAxes_getX`, `GameActivityPointerAxes_getY` and + * `GameActivityPointerAxes_getAxisValue`). + * + * The X axis and Y axis are enabled by default but any other axis that you want + * to read **must** be enabled first, using + * `GameActivityPointerAxes_enableAxis`. + * + * \see GameActivityMotionEvent + */ +typedef struct GameActivityPointerAxes { + int32_t id; + int32_t toolType; + float axisValues[GAME_ACTIVITY_POINTER_INFO_AXIS_COUNT]; + float rawX; + float rawY; +} GameActivityPointerAxes; + +/** \brief Get the toolType of the pointer. */ +inline int32_t GameActivityPointerAxes_getToolType( + const GameActivityPointerAxes* pointerInfo) { + return pointerInfo->toolType; +} + +/** \brief Get the current X coordinate of the pointer. */ +inline float GameActivityPointerAxes_getX( + const GameActivityPointerAxes* pointerInfo) { + return pointerInfo->axisValues[AMOTION_EVENT_AXIS_X]; +} + +/** \brief Get the current Y coordinate of the pointer. */ +inline float GameActivityPointerAxes_getY( + const GameActivityPointerAxes* pointerInfo) { + return pointerInfo->axisValues[AMOTION_EVENT_AXIS_Y]; +} + +/** + * \brief Enable the specified axis, so that its value is reported in the + * GameActivityPointerAxes structures stored in a motion event. + * + * You must enable any axis that you want to read, apart from + * `AMOTION_EVENT_AXIS_X` and `AMOTION_EVENT_AXIS_Y` that are enabled by + * default. + * + * If the axis index is out of range, nothing is done. + */ +void GameActivityPointerAxes_enableAxis(int32_t axis); + +/** + * \brief Disable the specified axis. Its value won't be reported in the + * GameActivityPointerAxes structures stored in a motion event anymore. + * + * Apart from X and Y, any axis that you want to read **must** be enabled first, + * using `GameActivityPointerAxes_enableAxis`. + * + * If the axis index is out of range, nothing is done. + */ +void GameActivityPointerAxes_disableAxis(int32_t axis); + +/** + * \brief Get the value of the requested axis. + * + * Apart from X and Y, any axis that you want to read **must** be enabled first, + * using `GameActivityPointerAxes_enableAxis`. + * + * Find the valid enums for the axis (`AMOTION_EVENT_AXIS_X`, + * `AMOTION_EVENT_AXIS_Y`, `AMOTION_EVENT_AXIS_PRESSURE`...) + * in https://developer.android.com/ndk/reference/group/input. + * + * @param pointerInfo The structure containing information about the pointer, + * obtained from GameActivityMotionEvent. + * @param axis The axis to get the value from + * @return The value of the axis, or 0 if the axis is invalid or was not + * enabled. + */ +float GameActivityPointerAxes_getAxisValue( + const GameActivityPointerAxes* pointerInfo, int32_t axis); + +inline float GameActivityPointerAxes_getPressure( + const GameActivityPointerAxes* pointerInfo) { + return GameActivityPointerAxes_getAxisValue(pointerInfo, + AMOTION_EVENT_AXIS_PRESSURE); +} + +inline float GameActivityPointerAxes_getSize( + const GameActivityPointerAxes* pointerInfo) { + return GameActivityPointerAxes_getAxisValue(pointerInfo, + AMOTION_EVENT_AXIS_SIZE); +} + +inline float GameActivityPointerAxes_getTouchMajor( + const GameActivityPointerAxes* pointerInfo) { + return GameActivityPointerAxes_getAxisValue(pointerInfo, + AMOTION_EVENT_AXIS_TOUCH_MAJOR); +} + +inline float GameActivityPointerAxes_getTouchMinor( + const GameActivityPointerAxes* pointerInfo) { + return GameActivityPointerAxes_getAxisValue(pointerInfo, + AMOTION_EVENT_AXIS_TOUCH_MINOR); +} + +inline float GameActivityPointerAxes_getToolMajor( + const GameActivityPointerAxes* pointerInfo) { + return GameActivityPointerAxes_getAxisValue(pointerInfo, + AMOTION_EVENT_AXIS_TOOL_MAJOR); +} + +inline float GameActivityPointerAxes_getToolMinor( + const GameActivityPointerAxes* pointerInfo) { + return GameActivityPointerAxes_getAxisValue(pointerInfo, + AMOTION_EVENT_AXIS_TOOL_MINOR); +} + +inline float GameActivityPointerAxes_getOrientation( + const GameActivityPointerAxes* pointerInfo) { + return GameActivityPointerAxes_getAxisValue(pointerInfo, + AMOTION_EVENT_AXIS_ORIENTATION); +} + +/** + * The maximum number of pointers returned inside a motion event. + */ +#if (defined GAMEACTIVITY_MAX_NUM_POINTERS_IN_MOTION_EVENT_OVERRIDE) +#define GAMEACTIVITY_MAX_NUM_POINTERS_IN_MOTION_EVENT \ + GAMEACTIVITY_MAX_NUM_POINTERS_IN_MOTION_EVENT_OVERRIDE +#else +#define GAMEACTIVITY_MAX_NUM_POINTERS_IN_MOTION_EVENT 8 +#endif + +/** + * \brief Describe a motion event that happened on the GameActivity SurfaceView. + * + * This is 1:1 mapping to the information contained in a Java `MotionEvent` + * (see https://developer.android.com/reference/android/view/MotionEvent). + */ +typedef struct GameActivityMotionEvent { + int32_t deviceId; + int32_t source; + int32_t action; + + int64_t eventTime; + int64_t downTime; + + int32_t flags; + int32_t metaState; + + int32_t actionButton; + int32_t buttonState; + int32_t classification; + int32_t edgeFlags; + + uint32_t pointerCount; + GameActivityPointerAxes + pointers[GAMEACTIVITY_MAX_NUM_POINTERS_IN_MOTION_EVENT]; + + int historySize; + int64_t* historicalEventTimesMillis; + int64_t* historicalEventTimesNanos; + float* historicalAxisValues; + + float precisionX; + float precisionY; +} GameActivityMotionEvent; + +float GameActivityMotionEvent_getHistoricalAxisValue( + const GameActivityMotionEvent* event, int axis, int pointerIndex, + int historyPos); + +inline int GameActivityMotionEvent_getHistorySize( + const GameActivityMotionEvent* event) { + return event->historySize; +} + +inline float GameActivityMotionEvent_getHistoricalX( + const GameActivityMotionEvent* event, int pointerIndex, int historyPos) { + return GameActivityMotionEvent_getHistoricalAxisValue( + event, AMOTION_EVENT_AXIS_X, pointerIndex, historyPos); +} + +inline float GameActivityMotionEvent_getHistoricalY( + const GameActivityMotionEvent* event, int pointerIndex, int historyPos) { + return GameActivityMotionEvent_getHistoricalAxisValue( + event, AMOTION_EVENT_AXIS_Y, pointerIndex, historyPos); +} + +inline float GameActivityMotionEvent_getHistoricalPressure( + const GameActivityMotionEvent* event, int pointerIndex, int historyPos) { + return GameActivityMotionEvent_getHistoricalAxisValue( + event, AMOTION_EVENT_AXIS_PRESSURE, pointerIndex, historyPos); +} + +inline float GameActivityMotionEvent_getHistoricalSize( + const GameActivityMotionEvent* event, int pointerIndex, int historyPos) { + return GameActivityMotionEvent_getHistoricalAxisValue( + event, AMOTION_EVENT_AXIS_SIZE, pointerIndex, historyPos); +} + +inline float GameActivityMotionEvent_getHistoricalTouchMajor( + const GameActivityMotionEvent* event, int pointerIndex, int historyPos) { + return GameActivityMotionEvent_getHistoricalAxisValue( + event, AMOTION_EVENT_AXIS_TOUCH_MAJOR, pointerIndex, historyPos); +} + +inline float GameActivityMotionEvent_getHistoricalTouchMinor( + const GameActivityMotionEvent* event, int pointerIndex, int historyPos) { + return GameActivityMotionEvent_getHistoricalAxisValue( + event, AMOTION_EVENT_AXIS_TOUCH_MINOR, pointerIndex, historyPos); +} + +inline float GameActivityMotionEvent_getHistoricalToolMajor( + const GameActivityMotionEvent* event, int pointerIndex, int historyPos) { + return GameActivityMotionEvent_getHistoricalAxisValue( + event, AMOTION_EVENT_AXIS_TOOL_MAJOR, pointerIndex, historyPos); +} + +inline float GameActivityMotionEvent_getHistoricalToolMinor( + const GameActivityMotionEvent* event, int pointerIndex, int historyPos) { + return GameActivityMotionEvent_getHistoricalAxisValue( + event, AMOTION_EVENT_AXIS_TOOL_MINOR, pointerIndex, historyPos); +} + +inline float GameActivityMotionEvent_getHistoricalOrientation( + const GameActivityMotionEvent* event, int pointerIndex, int historyPos) { + return GameActivityMotionEvent_getHistoricalAxisValue( + event, AMOTION_EVENT_AXIS_ORIENTATION, pointerIndex, historyPos); +} + +/** \brief Handle the freeing of the GameActivityMotionEvent struct. */ +void GameActivityMotionEvent_destroy(GameActivityMotionEvent* c_event); + +/** + * \brief Convert a Java `MotionEvent` to a `GameActivityMotionEvent`. + * + * This is done automatically by the GameActivity: see `onTouchEvent` to set + * a callback to consume the received events. + * This function can be used if you re-implement events handling in your own + * activity. + * Ownership of out_event is maintained by the caller. + */ +void GameActivityMotionEvent_fromJava(JNIEnv* env, jobject motionEvent, + GameActivityMotionEvent* out_event); + +/** + * \brief Describe a key event that happened on the GameActivity SurfaceView. + * + * This is 1:1 mapping to the information contained in a Java `KeyEvent` + * (see https://developer.android.com/reference/android/view/KeyEvent). + * The only exception is the event times, which are reported as + * nanoseconds in this struct. + */ +typedef struct GameActivityKeyEvent { + int32_t deviceId; + int32_t source; + int32_t action; + + int64_t eventTime; + int64_t downTime; + + int32_t flags; + int32_t metaState; + + int32_t modifiers; + int32_t repeatCount; + int32_t keyCode; + int32_t scanCode; + int32_t unicodeChar; +} GameActivityKeyEvent; + +/** + * \brief Convert a Java `KeyEvent` to a `GameActivityKeyEvent`. + * + * This is done automatically by the GameActivity: see `onKeyUp` and `onKeyDown` + * to set a callback to consume the received events. + * This function can be used if you re-implement events handling in your own + * activity. + * Ownership of out_event is maintained by the caller. + */ +void GameActivityKeyEvent_fromJava(JNIEnv* env, jobject motionEvent, + GameActivityKeyEvent* out_event); + +#ifdef __cplusplus +} +#endif + +/** @} */ + +#endif // ANDROID_GAME_SDK_GAME_ACTIVITY_EVENTS_H diff --git a/android-activity/game-activity-csrc/game-activity/GameActivityLog.h b/android-activity/game-activity-csrc/game-activity/GameActivityLog.h new file mode 100644 index 0000000..ba9a9e9 --- /dev/null +++ b/android-activity/game-activity-csrc/game-activity/GameActivityLog.h @@ -0,0 +1,109 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef ANDROID_GAME_SDK_GAME_ACTIVITY_LOG_H_ +#define ANDROID_GAME_SDK_GAME_ACTIVITY_LOG_H_ + +#define LOG_TAG "GameActivity" +#include + +#define ALOGE(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__); +#define ALOGW(...) __android_log_print(ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__); +#define ALOGD(...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__); +#ifdef NDEBUG +#define ALOGV(...) +#else +#define ALOGV(...) \ + __android_log_print(ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__); +#endif + +/* Returns 2nd arg. Used to substitute default value if caller's vararg list + * is empty. + */ +#define __android_second(first, second, ...) second + +/* If passed multiple args, returns ',' followed by all but 1st arg, otherwise + * returns nothing. + */ +#define __android_rest(first, ...) , ##__VA_ARGS__ + +#define android_printAssert(cond, tag, fmt...) \ + __android_log_assert(cond, tag, \ + __android_second(0, ##fmt, NULL) __android_rest(fmt)) + +#define CONDITION(cond) (__builtin_expect((cond) != 0, 0)) + +#ifndef LOG_ALWAYS_FATAL_IF +#define LOG_ALWAYS_FATAL_IF(cond, ...) \ + ((CONDITION(cond)) \ + ? ((void)android_printAssert(#cond, LOG_TAG, ##__VA_ARGS__)) \ + : (void)0) +#endif + +#ifndef LOG_ALWAYS_FATAL +#define LOG_ALWAYS_FATAL(...) \ + (((void)android_printAssert(NULL, LOG_TAG, ##__VA_ARGS__))) +#endif + +/* + * Simplified macro to send a warning system log message using current LOG_TAG. + */ +#ifndef SLOGW +#define SLOGW(...) \ + ((void)__android_log_print(ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__)) +#endif + +#ifndef SLOGW_IF +#define SLOGW_IF(cond, ...) \ + ((__predict_false(cond)) \ + ? ((void)__android_log_print(ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__)) \ + : (void)0) +#endif + +/* + * Versions of LOG_ALWAYS_FATAL_IF and LOG_ALWAYS_FATAL that + * are stripped out of release builds. + */ +#if LOG_NDEBUG + +#ifndef LOG_FATAL_IF +#define LOG_FATAL_IF(cond, ...) ((void)0) +#endif +#ifndef LOG_FATAL +#define LOG_FATAL(...) ((void)0) +#endif + +#else + +#ifndef LOG_FATAL_IF +#define LOG_FATAL_IF(cond, ...) LOG_ALWAYS_FATAL_IF(cond, ##__VA_ARGS__) +#endif +#ifndef LOG_FATAL +#define LOG_FATAL(...) LOG_ALWAYS_FATAL(__VA_ARGS__) +#endif + +#endif + +/* + * Assertion that generates a log message when the assertion fails. + * Stripped out of release builds. Uses the current LOG_TAG. + */ +#ifndef ALOG_ASSERT +#define ALOG_ASSERT(cond, ...) LOG_FATAL_IF(!(cond), ##__VA_ARGS__) +#endif + +#define LOG_TRACE(...) + +#endif // ANDROID_GAME_SDK_GAME_ACTIVITY_LOG_H_ diff --git a/android-activity/game-activity-csrc/game-activity/native_app_glue/android_native_app_glue.c b/android-activity/game-activity-csrc/game-activity/native_app_glue/android_native_app_glue.c index 0a52bd0..223c762 100644 --- a/android-activity/game-activity-csrc/game-activity/native_app_glue/android_native_app_glue.c +++ b/android-activity/game-activity-csrc/game-activity/native_app_glue/android_native_app_glue.c @@ -17,6 +17,7 @@ #include "android_native_app_glue.h" #include +#include #include #include #include @@ -24,6 +25,9 @@ #include #include +#define NATIVE_APP_GLUE_MOTION_EVENTS_DEFAULT_BUF_SIZE 16 +#define NATIVE_APP_GLUE_KEY_EVENTS_DEFAULT_BUF_SIZE 4 + #define LOGI(...) \ ((void)__android_log_print(ANDROID_LOG_INFO, "threaded_app", __VA_ARGS__)) #define LOGE(...) \ @@ -189,6 +193,7 @@ static void process_cmd(struct android_app* app, // This is run on a separate thread (i.e: not the main thread). static void* android_app_entry(void* param) { struct android_app* android_app = (struct android_app*)param; + int input_buf_idx = 0; LOGV("android_app_entry called"); android_app->config = AConfiguration_new(); @@ -201,6 +206,19 @@ static void* android_app_entry(void* param) { print_cur_config(android_app); + /* initialize event buffers */ + for (input_buf_idx = 0; input_buf_idx < NATIVE_APP_GLUE_MAX_INPUT_BUFFERS; input_buf_idx++) { + struct android_input_buffer *buf = &android_app->inputBuffers[input_buf_idx]; + + buf->motionEventsBufferSize = NATIVE_APP_GLUE_MOTION_EVENTS_DEFAULT_BUF_SIZE; + buf->motionEvents = (GameActivityMotionEvent *) malloc(sizeof(GameActivityMotionEvent) * + buf->motionEventsBufferSize); + + buf->keyEventsBufferSize = NATIVE_APP_GLUE_KEY_EVENTS_DEFAULT_BUF_SIZE; + buf->keyEvents = (GameActivityKeyEvent *) malloc(sizeof(GameActivityKeyEvent) * + buf->keyEventsBufferSize); + } + android_app->cmdPollSource.id = LOOPER_ID_MAIN; android_app->cmdPollSource.app = android_app; android_app->cmdPollSource.process = process_cmd; @@ -215,7 +233,7 @@ static void* android_app_entry(void* param) { pthread_cond_broadcast(&android_app->cond); pthread_mutex_unlock(&android_app->mutex); - _rust_glue_entry(android_app); + android_main(android_app); android_app_destroy(android_app); return NULL; @@ -308,15 +326,6 @@ static void android_app_set_window(struct android_app* android_app, ANativeWindow* window) { LOGV("android_app_set_window called"); pthread_mutex_lock(&android_app->mutex); - - // NB: we have to consider that the native thread could have already - // (gracefully) exit (setting android_app->destroyed) and so we need - // to be careful to avoid a deadlock waiting for a thread that's - // already exit. - if (android_app->destroyed) { - pthread_mutex_unlock(&android_app->mutex); - return; - } if (android_app->pendingWindow != NULL) { android_app_write_cmd(android_app, APP_CMD_TERM_WINDOW); } @@ -333,36 +342,31 @@ static void android_app_set_window(struct android_app* android_app, static void android_app_set_activity_state(struct android_app* android_app, int8_t cmd) { pthread_mutex_lock(&android_app->mutex); - - // NB: we have to consider that the native thread could have already - // (gracefully) exit (setting android_app->destroyed) and so we need - // to be careful to avoid a deadlock waiting for a thread that's - // already exit. - if (!android_app->destroyed) { - android_app_write_cmd(android_app, cmd); - while (android_app->activityState != cmd) { - pthread_cond_wait(&android_app->cond, &android_app->mutex); - } + android_app_write_cmd(android_app, cmd); + while (android_app->activityState != cmd) { + pthread_cond_wait(&android_app->cond, &android_app->mutex); } pthread_mutex_unlock(&android_app->mutex); } static void android_app_free(struct android_app* android_app) { - pthread_mutex_lock(&android_app->mutex); - - // It's possible that onDestroy is called after we have already 'destroyed' - // the app (via `android_app_destroy` due to `android_main` returning. - // - // In this case `->destroyed` will already be set (so we won't deadlock in - // the loop below) but we still need to close the messaging fds and finish - // freeing the android_app + int input_buf_idx = 0; + pthread_mutex_lock(&android_app->mutex); android_app_write_cmd(android_app, APP_CMD_DESTROY); while (!android_app->destroyed) { pthread_cond_wait(&android_app->cond, &android_app->mutex); } pthread_mutex_unlock(&android_app->mutex); + for (input_buf_idx = 0; input_buf_idx < NATIVE_APP_GLUE_MAX_INPUT_BUFFERS; input_buf_idx++) { + struct android_input_buffer *buf = &android_app->inputBuffers[input_buf_idx]; + + android_app_clear_motion_events(buf); + free(buf->motionEvents); + free(buf->keyEvents); + } + close(android_app->msgread); close(android_app->msgwrite); pthread_cond_destroy(&android_app->cond); @@ -395,17 +399,8 @@ static void onSaveInstanceState(GameActivity* activity, LOGV("SaveInstanceState: %p", activity); struct android_app* android_app = ToApp(activity); + void* savedState = NULL; pthread_mutex_lock(&android_app->mutex); - - // NB: we have to consider that the native thread could have already - // (gracefully) exit (setting android_app->destroyed) and so we need - // to be careful to avoid a deadlock waiting for a thread that's - // already exit. - if (android_app->destroyed) { - pthread_mutex_unlock(&android_app->mutex); - return; - } - android_app->stateSaved = 0; android_app_write_cmd(android_app, APP_CMD_SAVE_STATE); while (!android_app->stateSaved) { @@ -483,47 +478,11 @@ void android_app_set_motion_event_filter(struct android_app* app, pthread_mutex_unlock(&app->mutex); } -bool android_app_input_available_wake_up(struct android_app* app) { - pthread_mutex_lock(&app->mutex); - // TODO: use atomic ops for this - bool available = app->inputAvailableWakeUp; - app->inputAvailableWakeUp = false; - pthread_mutex_unlock(&app->mutex); - return available; -} - -// NB: should be called with the android_app->mutex held already -static void notifyInput(struct android_app* android_app) { - // Don't spam the mainloop with wake ups if we've already sent one - if (android_app->inputSwapPending) { - return; - } - - if (android_app->looper != NULL) { - LOGV("Input Notify: %p", android_app); - // for the app thread to know why it received the wake() up - android_app->inputAvailableWakeUp = true; - android_app->inputSwapPending = true; - ALooper_wake(android_app->looper); - } -} - static bool onTouchEvent(GameActivity* activity, - const GameActivityMotionEvent* event, - const GameActivityHistoricalPointerAxes* historical, - int historicalLen) { + const GameActivityMotionEvent* event) { struct android_app* android_app = ToApp(activity); pthread_mutex_lock(&android_app->mutex); - // NB: we have to consider that the native thread could have already - // (gracefully) exit (setting android_app->destroyed) and so we need - // to be careful to avoid a deadlock waiting for a thread that's - // already exit. - if (android_app->destroyed) { - pthread_mutex_unlock(&android_app->mutex); - return false; - } - if (android_app->motionEventFilter != NULL && !android_app->motionEventFilter(event)) { pthread_mutex_unlock(&android_app->mutex); @@ -534,35 +493,21 @@ static bool onTouchEvent(GameActivity* activity, &android_app->inputBuffers[android_app->currentInputBuffer]; // Add to the list of active motion events - if (inputBuffer->motionEventsCount < - NATIVE_APP_GLUE_MAX_NUM_MOTION_EVENTS) { - int new_ix = inputBuffer->motionEventsCount; - memcpy(&inputBuffer->motionEvents[new_ix], event, - sizeof(GameActivityMotionEvent)); - ++inputBuffer->motionEventsCount; - - if (inputBuffer->historicalSamplesCount + historicalLen <= - NATIVE_APP_GLUE_MAX_HISTORICAL_POINTER_SAMPLES) { - - int start_ix = inputBuffer->historicalSamplesCount; - memcpy(&inputBuffer->historicalAxisSamples[start_ix], historical, - sizeof(historical[0]) * historicalLen); - inputBuffer->historicalSamplesCount += event->historicalCount; - - inputBuffer->motionEvents[new_ix].historicalStart = start_ix; - inputBuffer->motionEvents[new_ix].historicalCount = historicalLen; - } else { - inputBuffer->motionEvents[new_ix].historicalCount = 0; + if (inputBuffer->motionEventsCount >= inputBuffer->motionEventsBufferSize) { + inputBuffer->motionEventsBufferSize *= 2; + inputBuffer->motionEvents = (GameActivityMotionEvent *) realloc(inputBuffer->motionEvents, + sizeof(GameActivityMotionEvent) * inputBuffer->motionEventsBufferSize); + + if (inputBuffer->motionEvents == NULL) { + LOGE("onTouchEvent: out of memory"); + abort(); } - - notifyInput(android_app); - } else { - LOGW_ONCE("Motion event will be dropped because the number of unconsumed motion" - " events exceeded NATIVE_APP_GLUE_MAX_NUM_MOTION_EVENTS (%d). Consider setting" - " NATIVE_APP_GLUE_MAX_NUM_MOTION_EVENTS_OVERRIDE to a larger value", - NATIVE_APP_GLUE_MAX_NUM_MOTION_EVENTS); } + int new_ix = inputBuffer->motionEventsCount; + memcpy(&inputBuffer->motionEvents[new_ix], event, sizeof(GameActivityMotionEvent)); + ++inputBuffer->motionEventsCount; + pthread_mutex_unlock(&android_app->mutex); return true; } @@ -583,16 +528,21 @@ struct android_input_buffer* android_app_swap_input_buffers( NATIVE_APP_GLUE_MAX_INPUT_BUFFERS; } - android_app->inputSwapPending = false; - android_app->inputAvailableWakeUp = false; - pthread_mutex_unlock(&android_app->mutex); return inputBuffer; } void android_app_clear_motion_events(struct android_input_buffer* inputBuffer) { - inputBuffer->motionEventsCount = 0; + // We do not need to lock here if the inputBuffer has already been swapped + // as is handled by the game loop thread + while (inputBuffer->motionEventsCount > 0) { + GameActivityMotionEvent_destroy( + &inputBuffer->motionEvents[inputBuffer->motionEventsCount - 1]); + + inputBuffer->motionEventsCount--; + } + assert(inputBuffer->motionEventsCount == 0); } void android_app_set_key_event_filter(struct android_app* app, @@ -606,15 +556,6 @@ static bool onKey(GameActivity* activity, const GameActivityKeyEvent* event) { struct android_app* android_app = ToApp(activity); pthread_mutex_lock(&android_app->mutex); - // NB: we have to consider that the native thread could have already - // (gracefully) exit (setting android_app->destroyed) and so we need - // to be careful to avoid a deadlock waiting for a thread that's - // already exit. - if (android_app->destroyed) { - pthread_mutex_unlock(&android_app->mutex); - return false; - } - if (android_app->keyEventFilter != NULL && !android_app->keyEventFilter(event)) { pthread_mutex_unlock(&android_app->mutex); @@ -625,20 +566,21 @@ static bool onKey(GameActivity* activity, const GameActivityKeyEvent* event) { &android_app->inputBuffers[android_app->currentInputBuffer]; // Add to the list of active key down events - if (inputBuffer->keyEventsCount < NATIVE_APP_GLUE_MAX_NUM_KEY_EVENTS) { - int new_ix = inputBuffer->keyEventsCount; - memcpy(&inputBuffer->keyEvents[new_ix], event, - sizeof(GameActivityKeyEvent)); - ++inputBuffer->keyEventsCount; - - notifyInput(android_app); - } else { - LOGW_ONCE("Key event will be dropped because the number of unconsumed key events exceeded" - " NATIVE_APP_GLUE_MAX_NUM_KEY_EVENTS (%d). Consider setting" - " NATIVE_APP_GLUE_MAX_NUM_KEY_EVENTS_OVERRIDE to a larger value", - NATIVE_APP_GLUE_MAX_NUM_KEY_EVENTS); + if (inputBuffer->keyEventsCount >= inputBuffer->keyEventsBufferSize) { + inputBuffer->keyEventsBufferSize = inputBuffer->keyEventsBufferSize * 2; + inputBuffer->keyEvents = (GameActivityKeyEvent *) realloc(inputBuffer->keyEvents, + sizeof(GameActivityKeyEvent) * inputBuffer->keyEventsBufferSize); + + if (inputBuffer->keyEvents == NULL) { + LOGE("onKey: out of memory"); + abort(); + } } + int new_ix = inputBuffer->keyEventsCount; + memcpy(&inputBuffer->keyEvents[new_ix], event, sizeof(GameActivityKeyEvent)); + ++inputBuffer->keyEventsCount; + pthread_mutex_unlock(&android_app->mutex); return true; } @@ -651,9 +593,8 @@ static void onTextInputEvent(GameActivity* activity, const GameTextInputState* state) { struct android_app* android_app = ToApp(activity); pthread_mutex_lock(&android_app->mutex); - if (!android_app->destroyed) { - android_app->textInputState = 1; - } + + android_app->textInputState = 1; pthread_mutex_unlock(&android_app->mutex); } @@ -662,8 +603,22 @@ static void onWindowInsetsChanged(GameActivity* activity) { android_app_write_cmd(ToApp(activity), APP_CMD_WINDOW_INSETS_CHANGED); } +static void onContentRectChanged(GameActivity* activity, const ARect *rect) { + LOGV("ContentRectChanged: %p -- (%d %d) (%d %d)", activity, rect->left, rect->top, + rect->right, rect->bottom); + + struct android_app* android_app = ToApp(activity); + + pthread_mutex_lock(&android_app->mutex); + android_app->contentRect = *rect; + + android_app_write_cmd(android_app, APP_CMD_CONTENT_RECT_CHANGED); + pthread_mutex_unlock(&android_app->mutex); +} + + JNIEXPORT -void GameActivity_onCreate_C(GameActivity* activity, void* savedState, +void GameActivity_onCreate(GameActivity* activity, void* savedState, size_t savedStateSize) { LOGV("Creating: %p", activity); activity->callbacks->onDestroy = onDestroy; @@ -685,6 +640,7 @@ void GameActivity_onCreate_C(GameActivity* activity, void* savedState, onNativeWindowRedrawNeeded; activity->callbacks->onNativeWindowResized = onNativeWindowResized; activity->callbacks->onWindowInsetsChanged = onWindowInsetsChanged; + activity->callbacks->onContentRectChanged = onContentRectChanged; LOGV("Callbacks set: %p", activity->callbacks); activity->instance = diff --git a/android-activity/game-activity-csrc/game-activity/native_app_glue/android_native_app_glue.h b/android-activity/game-activity-csrc/game-activity/native_app_glue/android_native_app_glue.h index 96968e3..e63026f 100644 --- a/android-activity/game-activity-csrc/game-activity/native_app_glue/android_native_app_glue.h +++ b/android-activity/game-activity-csrc/game-activity/native_app_glue/android_native_app_glue.h @@ -30,27 +30,6 @@ #include "game-activity/GameActivity.h" -#if (defined NATIVE_APP_GLUE_MAX_NUM_MOTION_EVENTS_OVERRIDE) -#define NATIVE_APP_GLUE_MAX_NUM_MOTION_EVENTS \ - NATIVE_APP_GLUE_MAX_NUM_MOTION_EVENTS_OVERRIDE -#else -#define NATIVE_APP_GLUE_MAX_NUM_MOTION_EVENTS 16 -#endif - -#if (defined NATIVE_APP_GLUE_MAX_HISTORICAL_POINTER_SAMPLES_OVERRIDE) -#define NATIVE_APP_GLUE_MAX_HISTORICAL_POINTER_SAMPLES \ - NATIVE_APP_GLUE_MAX_HISTORICAL_POINTER_SAMPLES_OVERRIDE -#else -#define NATIVE_APP_GLUE_MAX_HISTORICAL_POINTER_SAMPLES 64 -#endif - -#if (defined NATIVE_APP_GLUE_MAX_NUM_KEY_EVENTS_OVERRIDE) -#define NATIVE_APP_GLUE_MAX_NUM_KEY_EVENTS \ - NATIVE_APP_GLUE_MAX_NUM_KEY_EVENTS_OVERRIDE -#else -#define NATIVE_APP_GLUE_MAX_NUM_KEY_EVENTS 4 -#endif - #ifdef __cplusplus extern "C" { #endif @@ -126,10 +105,10 @@ struct android_poll_source { struct android_input_buffer { /** - * Pointer to a read-only array of pointers to GameActivityMotionEvent. + * Pointer to a read-only array of GameActivityMotionEvent. * Only the first motionEventsCount events are valid. */ - GameActivityMotionEvent motionEvents[NATIVE_APP_GLUE_MAX_NUM_MOTION_EVENTS]; + GameActivityMotionEvent *motionEvents; /** * The number of valid motion events in `motionEvents`. @@ -137,36 +116,25 @@ struct android_input_buffer { uint64_t motionEventsCount; /** - * Pointer to a read-only array of pointers to GameActivityHistoricalPointerAxes. - * - * Only the first historicalSamplesCount samples are valid. - * Refer to event->historicalStart, event->pointerCount and event->historicalCount - * to access the specific samples that relate to an event. - * - * Each slice of samples for one event has a length of - * (event->pointerCount and event->historicalCount) and is in pointer-major - * order so the historic samples for each pointer are contiguous. - * E.g. you would access historic sample index 3 for pointer 2 of an event with: - * - * historicalAxisSamples[event->historicalStart + (event->historicalCount * 2) + 3]; - */ - GameActivityHistoricalPointerAxes historicalAxisSamples[NATIVE_APP_GLUE_MAX_HISTORICAL_POINTER_SAMPLES]; - - /** - * The number of valid historical samples in `historicalAxisSamples`. + * The size of the `motionEvents` buffer. */ - uint64_t historicalSamplesCount; + uint64_t motionEventsBufferSize; /** - * Pointer to a read-only array of pointers to GameActivityKeyEvent. + * Pointer to a read-only array of GameActivityKeyEvent. * Only the first keyEventsCount events are valid. */ - GameActivityKeyEvent keyEvents[NATIVE_APP_GLUE_MAX_NUM_KEY_EVENTS]; + GameActivityKeyEvent *keyEvents; /** * The number of valid "Key" events in `keyEvents`. */ uint64_t keyEventsCount; + + /** + * The size of the `keyEvents` buffer. + */ + uint64_t keyEventsBufferSize; }; /** @@ -295,26 +263,6 @@ struct android_app { android_key_event_filter keyEventFilter; android_motion_event_filter motionEventFilter; - // When new input is received we set both of these flags and use the looper to - // wake up the application mainloop. - // - // To avoid spamming the mainloop with wake ups from lots of input though we - // don't sent a wake up if the inputSwapPending flag is already set. (i.e. - // we already expect input to be processed in a finite amount of time due to - // our previous wake up) - // - // When a wake up is received then we will check this flag (clearing it - // at the same time). If it was set then an InputAvailable event is sent to - // the application - which should lead to all input being processed within - // a finite amount of time. - // - // The next time android_app_swap_input_buffers is called, both flags will be - // cleared. - // - // NB: both of these should only be read with the app mutex held - bool inputAvailableWakeUp; - bool inputSwapPending; - /** @endcond */ }; @@ -500,10 +448,10 @@ void android_app_clear_motion_events(struct android_input_buffer* inputBuffer); void android_app_clear_key_events(struct android_input_buffer* inputBuffer); /** - * This is a springboard into the Rust glue layer that wraps calling the - * main entry for the app itself. + * This is the function that application code must implement, representing + * the main entry to the app. */ -extern void _rust_glue_entry(struct android_app* app); +extern void android_main(struct android_app* app); /** * Set the filter to use when processing key events. @@ -527,13 +475,6 @@ void android_app_set_key_event_filter(struct android_app* app, void android_app_set_motion_event_filter(struct android_app* app, android_motion_event_filter filter); -/** - * Determines if a looper wake up was due to new input becoming available - */ -bool android_app_input_available_wake_up(struct android_app* app); - -void GameActivity_onCreate_C(GameActivity* activity, void* savedState, - size_t savedStateSize); #ifdef __cplusplus } #endif diff --git a/android-activity/game-activity-csrc/game-text-input/gamecommon.h b/android-activity/game-activity-csrc/game-text-input/gamecommon.h old mode 100644 new mode 100755 diff --git a/android-activity/game-activity-csrc/game-text-input/gametextinput.cpp b/android-activity/game-activity-csrc/game-text-input/gametextinput.cpp old mode 100644 new mode 100755 index 6a39943..b8244fb --- a/android-activity/game-activity-csrc/game-text-input/gametextinput.cpp +++ b/android-activity/game-activity-csrc/game-text-input/gametextinput.cpp @@ -48,6 +48,7 @@ struct GameTextInput { void processEvent(jobject textInputEvent); void showIme(uint32_t flags); void hideIme(uint32_t flags); + void restartInput(); void setEventCallback(GameTextInputEventCallback callback, void *context); jobject stateToJava(const GameTextInputState &state) const; void stateFromJava(jobject textInputEvent, @@ -73,6 +74,7 @@ struct GameTextInput { jobject inputConnection_ = nullptr; jmethodID inputConnectionSetStateMethod_; jmethodID setSoftKeyboardActiveMethod_; + jmethodID restartInputMethod_; void (*eventCallback_)(void *context, const struct GameTextInputState *state) = nullptr; void *eventCallbackContext_ = nullptr; @@ -164,6 +166,10 @@ void GameTextInput_hideIme(struct GameTextInput *input, uint32_t flags) { input->hideIme(flags); } +void GameTextInput_restartInput(struct GameTextInput *input) { + input->restartInput(); +} + void GameTextInput_setEventCallback(struct GameTextInput *input, GameTextInputEventCallback callback, void *context) { @@ -199,6 +205,8 @@ GameTextInput::GameTextInput(JNIEnv *env, uint32_t max_string_size) "(Lcom/google/androidgamesdk/gametextinput/State;)V"); setSoftKeyboardActiveMethod_ = env_->GetMethodID( inputConnectionClass_, "setSoftKeyboardActive", "(ZI)V"); + restartInputMethod_ = + env_->GetMethodID(inputConnectionClass_, "restartInput", "()V"); stateClassInfo_.text = env_->GetFieldID(stateJavaClass_, "text", "Ljava/lang/String;"); @@ -307,6 +315,11 @@ void GameTextInput::hideIme(uint32_t flags) { flags); } +void GameTextInput::restartInput() { + if (inputConnection_ == nullptr) return; + env_->CallVoidMethod(inputConnection_, restartInputMethod_, false); +} + jobject GameTextInput::stateToJava(const GameTextInputState &state) const { static jmethodID constructor = nullptr; if (constructor == nullptr) { diff --git a/android-activity/game-activity-csrc/game-text-input/gametextinput.h b/android-activity/game-activity-csrc/game-text-input/gametextinput.h old mode 100644 new mode 100755 index a85265e..8c33da5 --- a/android-activity/game-activity-csrc/game-text-input/gametextinput.h +++ b/android-activity/game-activity-csrc/game-text-input/gametextinput.h @@ -26,12 +26,21 @@ #include #include +#include "common/gamesdk_common.h" #include "gamecommon.h" #ifdef __cplusplus extern "C" { #endif +#define GAMETEXTINPUT_MAJOR_VERSION 2 +#define GAMETEXTINPUT_MINOR_VERSION 0 +#define GAMETEXTINPUT_BUGFIX_VERSION 0 +#define GAMETEXTINPUT_PACKED_VERSION \ + ANDROID_GAMESDK_PACKED_VERSION(GAMETEXTINPUT_MAJOR_VERSION, \ + GAMETEXTINPUT_MINOR_VERSION, \ + GAMETEXTINPUT_BUGFIX_VERSION) + /** * This struct holds a span within a region of text from start (inclusive) to * end (exclusive). An empty span or cursor position is specified with @@ -173,6 +182,12 @@ enum HideImeFlags { */ void GameTextInput_hideIme(GameTextInput *input, uint32_t flags); +/** + * Restarts the input method. Calls InputMethodManager.restartInput(). + * @param input A valid GameTextInput library handle. + */ +void GameTextInput_restartInput(GameTextInput *input); + /** * Call a callback with the current GameTextInput state, which may have been * modified by changes in the IME and calls to GameTextInput_setState. We use a From d6345abb2a087d1eecd12614538c21b7d47b835b Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Sat, 22 Jul 2023 18:12:01 +0100 Subject: [PATCH 13/93] GameActivity PATCH: rename C symbols that need export Give C symbols that need to be exported a `_C` suffix so that they can be linked into a Rust symbol with the correct name (Since we can't directly export from C/C++ with Rust+Cargo) See: https://github.com/rust-lang/rfcs/issues/2771 --- .../game-activity-csrc/game-activity/GameActivity.cpp | 8 ++++++-- .../game-activity-csrc/game-activity/GameActivity.h | 2 +- .../native_app_glue/android_native_app_glue.c | 7 +++++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/android-activity/game-activity-csrc/game-activity/GameActivity.cpp b/android-activity/game-activity-csrc/game-activity/GameActivity.cpp index 3721b6d..4dbc9e8 100644 --- a/android-activity/game-activity-csrc/game-activity/GameActivity.cpp +++ b/android-activity/game-activity-csrc/game-activity/GameActivity.cpp @@ -485,7 +485,7 @@ static jlong initializeNativeCode_native( readConfigurationValues(code, javaConfig); - GameActivity_onCreate(code, rawSavedState, rawSavedSize); + GameActivity_onCreate_C(code, rawSavedState, rawSavedSize); code->gameTextInput = GameTextInput_init(env, 0); GameTextInput_setEventCallback(code->gameTextInput, @@ -1130,8 +1130,12 @@ extern "C" int GameActivity_register(JNIEnv *env) { NELEM(g_methods)); } +// XXX: This symbol is renamed with a _C suffix and then re-exported from +// Rust because Rust/Cargo don't give us a way to directly export symbols +// from C/C++ code: https://github.com/rust-lang/rfcs/issues/2771 +// extern "C" JNIEXPORT jlong JNICALL -Java_com_google_androidgamesdk_GameActivity_initializeNativeCode( +Java_com_google_androidgamesdk_GameActivity_initializeNativeCode_C( JNIEnv *env, jobject javaGameActivity, jstring internalDataDir, jstring obbDir, jstring externalDataDir, jobject jAssetMgr, jbyteArray savedState, jobject javaConfig) { diff --git a/android-activity/game-activity-csrc/game-activity/GameActivity.h b/android-activity/game-activity-csrc/game-activity/GameActivity.h index 702f754..b945069 100644 --- a/android-activity/game-activity-csrc/game-activity/GameActivity.h +++ b/android-activity/game-activity-csrc/game-activity/GameActivity.h @@ -296,7 +296,7 @@ typedef void GameActivity_createFunc(GameActivity* activity, void* savedState, * "android.app.func_name" string meta-data in your manifest to use a different * function. */ -extern GameActivity_createFunc GameActivity_onCreate; +extern GameActivity_createFunc GameActivity_onCreate_C; /** * Finish the given activity. Its finish() method will be called, causing it diff --git a/android-activity/game-activity-csrc/game-activity/native_app_glue/android_native_app_glue.c b/android-activity/game-activity-csrc/game-activity/native_app_glue/android_native_app_glue.c index 223c762..09a4b22 100644 --- a/android-activity/game-activity-csrc/game-activity/native_app_glue/android_native_app_glue.c +++ b/android-activity/game-activity-csrc/game-activity/native_app_glue/android_native_app_glue.c @@ -616,9 +616,12 @@ static void onContentRectChanged(GameActivity* activity, const ARect *rect) { pthread_mutex_unlock(&android_app->mutex); } - +// XXX: This symbol is renamed with a _C suffix and then re-exported from +// Rust because Rust/Cargo don't give us a way to directly export symbols +// from C/C++ code: https://github.com/rust-lang/rfcs/issues/2771 +// JNIEXPORT -void GameActivity_onCreate(GameActivity* activity, void* savedState, +void GameActivity_onCreate_C(GameActivity* activity, void* savedState, size_t savedStateSize) { LOGV("Creating: %p", activity); activity->callbacks->onDestroy = onDestroy; From 202ab4c1e988c3d4cbe46aaece70862a6979fc38 Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Sat, 22 Jul 2023 18:15:58 +0100 Subject: [PATCH 14/93] GameActivity PATCH: Rename android_main _rust_glue_entry The real `android_main` is going to be written in Rust and android-activity needs to handle its own initialization before calling the application's `android_main` and so the C/C++ code calls an intermediate `_rust_glue_entry` function. --- .../game-activity/native_app_glue/android_native_app_glue.c | 2 +- .../game-activity/native_app_glue/android_native_app_glue.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/android-activity/game-activity-csrc/game-activity/native_app_glue/android_native_app_glue.c b/android-activity/game-activity-csrc/game-activity/native_app_glue/android_native_app_glue.c index 09a4b22..56e3a44 100644 --- a/android-activity/game-activity-csrc/game-activity/native_app_glue/android_native_app_glue.c +++ b/android-activity/game-activity-csrc/game-activity/native_app_glue/android_native_app_glue.c @@ -233,7 +233,7 @@ static void* android_app_entry(void* param) { pthread_cond_broadcast(&android_app->cond); pthread_mutex_unlock(&android_app->mutex); - android_main(android_app); + _rust_glue_entry(android_app); android_app_destroy(android_app); return NULL; diff --git a/android-activity/game-activity-csrc/game-activity/native_app_glue/android_native_app_glue.h b/android-activity/game-activity-csrc/game-activity/native_app_glue/android_native_app_glue.h index e63026f..f504ac4 100644 --- a/android-activity/game-activity-csrc/game-activity/native_app_glue/android_native_app_glue.h +++ b/android-activity/game-activity-csrc/game-activity/native_app_glue/android_native_app_glue.h @@ -448,10 +448,10 @@ void android_app_clear_motion_events(struct android_input_buffer* inputBuffer); void android_app_clear_key_events(struct android_input_buffer* inputBuffer); /** - * This is the function that application code must implement, representing - * the main entry to the app. + * This is a springboard into the Rust glue layer that wraps calling the + * main entry for the app itself. */ -extern void android_main(struct android_app* app); +extern void _rust_glue_entry(struct android_app* app); /** * Set the filter to use when processing key events. From 3e3fb84c0350c485a6423f7eb0ce0142e99d7a7d Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Wed, 25 May 2022 23:57:45 +0100 Subject: [PATCH 15/93] GameActivity PATCH: remove unused variable --- .../game-activity/native_app_glue/android_native_app_glue.c | 1 - 1 file changed, 1 deletion(-) diff --git a/android-activity/game-activity-csrc/game-activity/native_app_glue/android_native_app_glue.c b/android-activity/game-activity-csrc/game-activity/native_app_glue/android_native_app_glue.c index 56e3a44..01ee70c 100644 --- a/android-activity/game-activity-csrc/game-activity/native_app_glue/android_native_app_glue.c +++ b/android-activity/game-activity-csrc/game-activity/native_app_glue/android_native_app_glue.c @@ -399,7 +399,6 @@ static void onSaveInstanceState(GameActivity* activity, LOGV("SaveInstanceState: %p", activity); struct android_app* android_app = ToApp(activity); - void* savedState = NULL; pthread_mutex_lock(&android_app->mutex); android_app->stateSaved = 0; android_app_write_cmd(android_app, APP_CMD_SAVE_STATE); From d2d18154d9cf6773d543619f1d3021104e77413a Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Sat, 13 Aug 2022 05:42:37 +0100 Subject: [PATCH 16/93] GameActivity PATCH: Support InputAvailable events This makes a small change to the C glue code for GameActivity to send looper wake ups when new input is received (only sending a single wake up, until the application next handles input). This makes it possible to recognise that new input is available and send an `InputAvailable` event to the application - consistent with how NativeActivity can deliver `InputAvailable` events. This addresses a significant feature disparity between GameActivity and NativeActivity that meant GameActivity was not practically usable for GUI applications that wouldn't want to render continuously like a game. --- .../native_app_glue/android_native_app_glue.c | 28 +++++++++++++++++++ .../native_app_glue/android_native_app_glue.h | 25 +++++++++++++++++ 2 files changed, 53 insertions(+) diff --git a/android-activity/game-activity-csrc/game-activity/native_app_glue/android_native_app_glue.c b/android-activity/game-activity-csrc/game-activity/native_app_glue/android_native_app_glue.c index 01ee70c..8500ff6 100644 --- a/android-activity/game-activity-csrc/game-activity/native_app_glue/android_native_app_glue.c +++ b/android-activity/game-activity-csrc/game-activity/native_app_glue/android_native_app_glue.c @@ -477,6 +477,29 @@ void android_app_set_motion_event_filter(struct android_app* app, pthread_mutex_unlock(&app->mutex); } +bool android_app_input_available_wake_up(struct android_app* app) { + pthread_mutex_lock(&app->mutex); + bool available = app->inputAvailableWakeUp; + app->inputAvailableWakeUp = false; + pthread_mutex_unlock(&app->mutex); + return available; +} + +// NB: should be called with the android_app->mutex held already +static void notifyInput(struct android_app* android_app) { + // Don't spam the mainloop with wake ups if we've already sent one + if (android_app->inputSwapPending) { + return; + } + + if (android_app->looper != NULL) { + // for the app thread to know why it received the wake() up + android_app->inputAvailableWakeUp = true; + android_app->inputSwapPending = true; + ALooper_wake(android_app->looper); + } +} + static bool onTouchEvent(GameActivity* activity, const GameActivityMotionEvent* event) { struct android_app* android_app = ToApp(activity); @@ -506,6 +529,7 @@ static bool onTouchEvent(GameActivity* activity, int new_ix = inputBuffer->motionEventsCount; memcpy(&inputBuffer->motionEvents[new_ix], event, sizeof(GameActivityMotionEvent)); ++inputBuffer->motionEventsCount; + notifyInput(android_app); pthread_mutex_unlock(&android_app->mutex); return true; @@ -527,6 +551,9 @@ struct android_input_buffer* android_app_swap_input_buffers( NATIVE_APP_GLUE_MAX_INPUT_BUFFERS; } + android_app->inputSwapPending = false; + android_app->inputAvailableWakeUp = false; + pthread_mutex_unlock(&android_app->mutex); return inputBuffer; @@ -579,6 +606,7 @@ static bool onKey(GameActivity* activity, const GameActivityKeyEvent* event) { int new_ix = inputBuffer->keyEventsCount; memcpy(&inputBuffer->keyEvents[new_ix], event, sizeof(GameActivityKeyEvent)); ++inputBuffer->keyEventsCount; + notifyInput(android_app); pthread_mutex_unlock(&android_app->mutex); return true; diff --git a/android-activity/game-activity-csrc/game-activity/native_app_glue/android_native_app_glue.h b/android-activity/game-activity-csrc/game-activity/native_app_glue/android_native_app_glue.h index f504ac4..6fa5721 100644 --- a/android-activity/game-activity-csrc/game-activity/native_app_glue/android_native_app_glue.h +++ b/android-activity/game-activity-csrc/game-activity/native_app_glue/android_native_app_glue.h @@ -263,6 +263,26 @@ struct android_app { android_key_event_filter keyEventFilter; android_motion_event_filter motionEventFilter; + // When new input is received we set both of these flags and use the looper to + // wake up the application mainloop. + // + // To avoid spamming the mainloop with wake ups from lots of input though we + // don't sent a wake up if the inputSwapPending flag is already set. (i.e. + // we already expect input to be processed in a finite amount of time due to + // our previous wake up) + // + // When a wake up is received then we will check this flag (clearing it + // at the same time). If it was set then an InputAvailable event is sent to + // the application - which should lead to all input being processed within + // a finite amount of time. + // + // The next time android_app_swap_input_buffers is called, both flags will be + // cleared. + // + // NB: both of these should only be read with the app mutex held + bool inputAvailableWakeUp; + bool inputSwapPending; + /** @endcond */ }; @@ -475,6 +495,11 @@ void android_app_set_key_event_filter(struct android_app* app, void android_app_set_motion_event_filter(struct android_app* app, android_motion_event_filter filter); +/** + * Determines if a looper wake up was due to new input becoming available + */ +bool android_app_input_available_wake_up(struct android_app* app); + #ifdef __cplusplus } #endif From 2a2f27637f79026d61b6bfa75335de57ab4e9e66 Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Fri, 28 Jul 2023 22:18:24 +0100 Subject: [PATCH 17/93] GameActivity PATCH: fix deadlocks in java callbacks after app destroyed This ensures that any java Activity callbacks take into account the possibility that the `android_app` may have already been marked destroyed if `android_main` has returned - and so they mustn't block and wait for a thread that is no longer running. --- .../native_app_glue/android_native_app_glue.c | 63 +++++++++++++++++-- 1 file changed, 58 insertions(+), 5 deletions(-) diff --git a/android-activity/game-activity-csrc/game-activity/native_app_glue/android_native_app_glue.c b/android-activity/game-activity-csrc/game-activity/native_app_glue/android_native_app_glue.c index 8500ff6..b78a44f 100644 --- a/android-activity/game-activity-csrc/game-activity/native_app_glue/android_native_app_glue.c +++ b/android-activity/game-activity-csrc/game-activity/native_app_glue/android_native_app_glue.c @@ -326,6 +326,15 @@ static void android_app_set_window(struct android_app* android_app, ANativeWindow* window) { LOGV("android_app_set_window called"); pthread_mutex_lock(&android_app->mutex); + + // NB: we have to consider that the native thread could have already + // (gracefully) exit (setting android_app->destroyed) and so we need + // to be careful to avoid a deadlock waiting for a thread that's + // already exit. + if (android_app->destroyed) { + pthread_mutex_unlock(&android_app->mutex); + return; + } if (android_app->pendingWindow != NULL) { android_app_write_cmd(android_app, APP_CMD_TERM_WINDOW); } @@ -342,9 +351,16 @@ static void android_app_set_window(struct android_app* android_app, static 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) { - pthread_cond_wait(&android_app->cond, &android_app->mutex); + + // NB: we have to consider that the native thread could have already + // (gracefully) exit (setting android_app->destroyed) and so we need + // to be careful to avoid a deadlock waiting for a thread that's + // already exit. + if (!android_app->destroyed) { + android_app_write_cmd(android_app, cmd); + while (android_app->activityState != cmd) { + pthread_cond_wait(&android_app->cond, &android_app->mutex); + } } pthread_mutex_unlock(&android_app->mutex); } @@ -353,6 +369,14 @@ static void android_app_free(struct android_app* android_app) { int input_buf_idx = 0; pthread_mutex_lock(&android_app->mutex); + + // It's possible that onDestroy is called after we have already 'destroyed' + // the app (via `android_app_destroy` due to `android_main` returning. + // + // In this case `->destroyed` will already be set (so we won't deadlock in + // the loop below) but we still need to close the messaging fds and finish + // freeing the android_app + android_app_write_cmd(android_app, APP_CMD_DESTROY); while (!android_app->destroyed) { pthread_cond_wait(&android_app->cond, &android_app->mutex); @@ -400,6 +424,16 @@ static void onSaveInstanceState(GameActivity* activity, struct android_app* android_app = ToApp(activity); pthread_mutex_lock(&android_app->mutex); + + // NB: we have to consider that the native thread could have already + // (gracefully) exit (setting android_app->destroyed) and so we need + // to be careful to avoid a deadlock waiting for a thread that's + // already exit. + if (android_app->destroyed) { + pthread_mutex_unlock(&android_app->mutex); + return; + } + android_app->stateSaved = 0; android_app_write_cmd(android_app, APP_CMD_SAVE_STATE); while (!android_app->stateSaved) { @@ -505,6 +539,15 @@ static bool onTouchEvent(GameActivity* activity, struct android_app* android_app = ToApp(activity); pthread_mutex_lock(&android_app->mutex); + // NB: we have to consider that the native thread could have already + // (gracefully) exit (setting android_app->destroyed) and so we need + // to be careful to avoid a deadlock waiting for a thread that's + // already exit. + if (android_app->destroyed) { + pthread_mutex_unlock(&android_app->mutex); + return false; + } + if (android_app->motionEventFilter != NULL && !android_app->motionEventFilter(event)) { pthread_mutex_unlock(&android_app->mutex); @@ -582,6 +625,15 @@ static bool onKey(GameActivity* activity, const GameActivityKeyEvent* event) { struct android_app* android_app = ToApp(activity); pthread_mutex_lock(&android_app->mutex); + // NB: we have to consider that the native thread could have already + // (gracefully) exit (setting android_app->destroyed) and so we need + // to be careful to avoid a deadlock waiting for a thread that's + // already exit. + if (android_app->destroyed) { + pthread_mutex_unlock(&android_app->mutex); + return false; + } + if (android_app->keyEventFilter != NULL && !android_app->keyEventFilter(event)) { pthread_mutex_unlock(&android_app->mutex); @@ -620,8 +672,9 @@ static void onTextInputEvent(GameActivity* activity, const GameTextInputState* state) { struct android_app* android_app = ToApp(activity); pthread_mutex_lock(&android_app->mutex); - - android_app->textInputState = 1; + if (!android_app->destroyed) { + android_app->textInputState = 1; + } pthread_mutex_unlock(&android_app->mutex); } From cc3983ca2106876d22374ea229b61f4bacfa1232 Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Sat, 22 Jul 2023 18:36:07 +0100 Subject: [PATCH 18/93] generate-bindings: add comment about installing bindgen-cli --- android-activity/generate-bindings.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/android-activity/generate-bindings.sh b/android-activity/generate-bindings.sh index 530eeae..51c5602 100644 --- a/android-activity/generate-bindings.sh +++ b/android-activity/generate-bindings.sh @@ -1,5 +1,7 @@ #!/bin/sh +# First install bindgen-cli via `cargo install bindgen-cli` + if test -z "${ANDROID_NDK_ROOT}"; then export ANDROID_NDK_ROOT=${ANDROID_NDK_HOME} fi From b09526a4a9a3909969c326bddab3d4127e86394d Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Sat, 22 Jul 2023 18:38:38 +0100 Subject: [PATCH 19/93] game-activity: update ffi bindings for 2.0.2 via ./generate-bindings.sh --- android-activity/src/game_activity/ffi.rs | 2 +- .../src/game_activity/ffi_aarch64.rs | 4800 +++++++-------- android-activity/src/game_activity/ffi_arm.rs | 4742 +++++++-------- .../src/game_activity/ffi_i686.rs | 5123 ++++++++-------- .../src/game_activity/ffi_x86_64.rs | 5274 ++++++++--------- 5 files changed, 9593 insertions(+), 10348 deletions(-) diff --git a/android-activity/src/game_activity/ffi.rs b/android-activity/src/game_activity/ffi.rs index 3196865..e3c561d 100644 --- a/android-activity/src/game_activity/ffi.rs +++ b/android-activity/src/game_activity/ffi.rs @@ -13,7 +13,7 @@ #![allow(dead_code)] use jni_sys::*; -use libc::{pthread_cond_t, pthread_mutex_t, pthread_t, size_t}; +use libc::{pthread_cond_t, pthread_mutex_t, pthread_t}; use ndk_sys::{AAssetManager, AConfiguration, ALooper, ALooper_callbackFunc, ANativeWindow, ARect}; #[cfg(all( diff --git a/android-activity/src/game_activity/ffi_aarch64.rs b/android-activity/src/game_activity/ffi_aarch64.rs index 20a66d0..0d5c320 100644 --- a/android-activity/src/game_activity/ffi_aarch64.rs +++ b/android-activity/src/game_activity/ffi_aarch64.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.59.2 */ +/* automatically generated by rust-bindgen 0.66.1 */ pub const __BIONIC__: u32 = 1; pub const __WORDSIZE: u32 = 64; @@ -21,10 +21,14 @@ 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 __NDK_MAJOR__: u32 = 21; -pub const __NDK_MINOR__: u32 = 1; +pub const __ANDROID_API_S__: u32 = 31; +pub const __ANDROID_API_T__: u32 = 33; +pub const __ANDROID_API_U__: u32 = 34; +pub const __ANDROID_NDK__: u32 = 1; +pub const __NDK_MAJOR__: u32 = 25; +pub const __NDK_MINOR__: u32 = 2; pub const __NDK_BETA__: u32 = 0; -pub const __NDK_BUILD__: u32 = 6352462; +pub const __NDK_BUILD__: u32 = 9519653; pub const __NDK_CANARY__: u32 = 0; pub const WCHAR_MIN: u8 = 0u8; pub const INT8_MIN: i32 = -128; @@ -57,171 +61,176 @@ 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 AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT: u32 = 8; -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"; -pub const PRId8: &[u8; 2usize] = b"d\0"; -pub const PRId16: &[u8; 2usize] = b"d\0"; -pub const PRId32: &[u8; 2usize] = b"d\0"; -pub const PRId64: &[u8; 3usize] = b"ld\0"; -pub const PRIdLEAST8: &[u8; 2usize] = b"d\0"; -pub const PRIdLEAST16: &[u8; 2usize] = b"d\0"; -pub const PRIdLEAST32: &[u8; 2usize] = b"d\0"; -pub const PRIdLEAST64: &[u8; 3usize] = b"ld\0"; -pub const PRIdFAST8: &[u8; 2usize] = b"d\0"; -pub const PRIdFAST16: &[u8; 3usize] = b"ld\0"; -pub const PRIdFAST32: &[u8; 3usize] = b"ld\0"; -pub const PRIdFAST64: &[u8; 3usize] = b"ld\0"; -pub const PRIdMAX: &[u8; 3usize] = b"jd\0"; -pub const PRIdPTR: &[u8; 3usize] = b"ld\0"; -pub const PRIi8: &[u8; 2usize] = b"i\0"; -pub const PRIi16: &[u8; 2usize] = b"i\0"; -pub const PRIi32: &[u8; 2usize] = b"i\0"; -pub const PRIi64: &[u8; 3usize] = b"li\0"; -pub const PRIiLEAST8: &[u8; 2usize] = b"i\0"; -pub const PRIiLEAST16: &[u8; 2usize] = b"i\0"; -pub const PRIiLEAST32: &[u8; 2usize] = b"i\0"; -pub const PRIiLEAST64: &[u8; 3usize] = b"li\0"; -pub const PRIiFAST8: &[u8; 2usize] = b"i\0"; -pub const PRIiFAST16: &[u8; 3usize] = b"li\0"; -pub const PRIiFAST32: &[u8; 3usize] = b"li\0"; -pub const PRIiFAST64: &[u8; 3usize] = b"li\0"; -pub const PRIiMAX: &[u8; 3usize] = b"ji\0"; -pub const PRIiPTR: &[u8; 3usize] = b"li\0"; -pub const PRIo8: &[u8; 2usize] = b"o\0"; -pub const PRIo16: &[u8; 2usize] = b"o\0"; -pub const PRIo32: &[u8; 2usize] = b"o\0"; -pub const PRIo64: &[u8; 3usize] = b"lo\0"; -pub const PRIoLEAST8: &[u8; 2usize] = b"o\0"; -pub const PRIoLEAST16: &[u8; 2usize] = b"o\0"; -pub const PRIoLEAST32: &[u8; 2usize] = b"o\0"; -pub const PRIoLEAST64: &[u8; 3usize] = b"lo\0"; -pub const PRIoFAST8: &[u8; 2usize] = b"o\0"; -pub const PRIoFAST16: &[u8; 3usize] = b"lo\0"; -pub const PRIoFAST32: &[u8; 3usize] = b"lo\0"; -pub const PRIoFAST64: &[u8; 3usize] = b"lo\0"; -pub const PRIoMAX: &[u8; 3usize] = b"jo\0"; -pub const PRIoPTR: &[u8; 3usize] = b"lo\0"; -pub const PRIu8: &[u8; 2usize] = b"u\0"; -pub const PRIu16: &[u8; 2usize] = b"u\0"; -pub const PRIu32: &[u8; 2usize] = b"u\0"; -pub const PRIu64: &[u8; 3usize] = b"lu\0"; -pub const PRIuLEAST8: &[u8; 2usize] = b"u\0"; -pub const PRIuLEAST16: &[u8; 2usize] = b"u\0"; -pub const PRIuLEAST32: &[u8; 2usize] = b"u\0"; -pub const PRIuLEAST64: &[u8; 3usize] = b"lu\0"; -pub const PRIuFAST8: &[u8; 2usize] = b"u\0"; -pub const PRIuFAST16: &[u8; 3usize] = b"lu\0"; -pub const PRIuFAST32: &[u8; 3usize] = b"lu\0"; -pub const PRIuFAST64: &[u8; 3usize] = b"lu\0"; -pub const PRIuMAX: &[u8; 3usize] = b"ju\0"; -pub const PRIuPTR: &[u8; 3usize] = b"lu\0"; -pub const PRIx8: &[u8; 2usize] = b"x\0"; -pub const PRIx16: &[u8; 2usize] = b"x\0"; -pub const PRIx32: &[u8; 2usize] = b"x\0"; -pub const PRIx64: &[u8; 3usize] = b"lx\0"; -pub const PRIxLEAST8: &[u8; 2usize] = b"x\0"; -pub const PRIxLEAST16: &[u8; 2usize] = b"x\0"; -pub const PRIxLEAST32: &[u8; 2usize] = b"x\0"; -pub const PRIxLEAST64: &[u8; 3usize] = b"lx\0"; -pub const PRIxFAST8: &[u8; 2usize] = b"x\0"; -pub const PRIxFAST16: &[u8; 3usize] = b"lx\0"; -pub const PRIxFAST32: &[u8; 3usize] = b"lx\0"; -pub const PRIxFAST64: &[u8; 3usize] = b"lx\0"; -pub const PRIxMAX: &[u8; 3usize] = b"jx\0"; -pub const PRIxPTR: &[u8; 3usize] = b"lx\0"; -pub const PRIX8: &[u8; 2usize] = b"X\0"; -pub const PRIX16: &[u8; 2usize] = b"X\0"; -pub const PRIX32: &[u8; 2usize] = b"X\0"; -pub const PRIX64: &[u8; 3usize] = b"lX\0"; -pub const PRIXLEAST8: &[u8; 2usize] = b"X\0"; -pub const PRIXLEAST16: &[u8; 2usize] = b"X\0"; -pub const PRIXLEAST32: &[u8; 2usize] = b"X\0"; -pub const PRIXLEAST64: &[u8; 3usize] = b"lX\0"; -pub const PRIXFAST8: &[u8; 2usize] = b"X\0"; -pub const PRIXFAST16: &[u8; 3usize] = b"lX\0"; -pub const PRIXFAST32: &[u8; 3usize] = b"lX\0"; -pub const PRIXFAST64: &[u8; 3usize] = b"lX\0"; -pub const PRIXMAX: &[u8; 3usize] = b"jX\0"; -pub const PRIXPTR: &[u8; 3usize] = b"lX\0"; -pub const SCNd8: &[u8; 4usize] = b"hhd\0"; -pub const SCNd16: &[u8; 3usize] = b"hd\0"; -pub const SCNd32: &[u8; 2usize] = b"d\0"; -pub const SCNd64: &[u8; 3usize] = b"ld\0"; -pub const SCNdLEAST8: &[u8; 4usize] = b"hhd\0"; -pub const SCNdLEAST16: &[u8; 3usize] = b"hd\0"; -pub const SCNdLEAST32: &[u8; 2usize] = b"d\0"; -pub const SCNdLEAST64: &[u8; 3usize] = b"ld\0"; -pub const SCNdFAST8: &[u8; 4usize] = b"hhd\0"; -pub const SCNdFAST16: &[u8; 3usize] = b"ld\0"; -pub const SCNdFAST32: &[u8; 3usize] = b"ld\0"; -pub const SCNdFAST64: &[u8; 3usize] = b"ld\0"; -pub const SCNdMAX: &[u8; 3usize] = b"jd\0"; -pub const SCNdPTR: &[u8; 3usize] = b"ld\0"; -pub const SCNi8: &[u8; 4usize] = b"hhi\0"; -pub const SCNi16: &[u8; 3usize] = b"hi\0"; -pub const SCNi32: &[u8; 2usize] = b"i\0"; -pub const SCNi64: &[u8; 3usize] = b"li\0"; -pub const SCNiLEAST8: &[u8; 4usize] = b"hhi\0"; -pub const SCNiLEAST16: &[u8; 3usize] = b"hi\0"; -pub const SCNiLEAST32: &[u8; 2usize] = b"i\0"; -pub const SCNiLEAST64: &[u8; 3usize] = b"li\0"; -pub const SCNiFAST8: &[u8; 4usize] = b"hhi\0"; -pub const SCNiFAST16: &[u8; 3usize] = b"li\0"; -pub const SCNiFAST32: &[u8; 3usize] = b"li\0"; -pub const SCNiFAST64: &[u8; 3usize] = b"li\0"; -pub const SCNiMAX: &[u8; 3usize] = b"ji\0"; -pub const SCNiPTR: &[u8; 3usize] = b"li\0"; -pub const SCNo8: &[u8; 4usize] = b"hho\0"; -pub const SCNo16: &[u8; 3usize] = b"ho\0"; -pub const SCNo32: &[u8; 2usize] = b"o\0"; -pub const SCNo64: &[u8; 3usize] = b"lo\0"; -pub const SCNoLEAST8: &[u8; 4usize] = b"hho\0"; -pub const SCNoLEAST16: &[u8; 3usize] = b"ho\0"; -pub const SCNoLEAST32: &[u8; 2usize] = b"o\0"; -pub const SCNoLEAST64: &[u8; 3usize] = b"lo\0"; -pub const SCNoFAST8: &[u8; 4usize] = b"hho\0"; -pub const SCNoFAST16: &[u8; 3usize] = b"lo\0"; -pub const SCNoFAST32: &[u8; 3usize] = b"lo\0"; -pub const SCNoFAST64: &[u8; 3usize] = b"lo\0"; -pub const SCNoMAX: &[u8; 3usize] = b"jo\0"; -pub const SCNoPTR: &[u8; 3usize] = b"lo\0"; -pub const SCNu8: &[u8; 4usize] = b"hhu\0"; -pub const SCNu16: &[u8; 3usize] = b"hu\0"; -pub const SCNu32: &[u8; 2usize] = b"u\0"; -pub const SCNu64: &[u8; 3usize] = b"lu\0"; -pub const SCNuLEAST8: &[u8; 4usize] = b"hhu\0"; -pub const SCNuLEAST16: &[u8; 3usize] = b"hu\0"; -pub const SCNuLEAST32: &[u8; 2usize] = b"u\0"; -pub const SCNuLEAST64: &[u8; 3usize] = b"lu\0"; -pub const SCNuFAST8: &[u8; 4usize] = b"hhu\0"; -pub const SCNuFAST16: &[u8; 3usize] = b"lu\0"; -pub const SCNuFAST32: &[u8; 3usize] = b"lu\0"; -pub const SCNuFAST64: &[u8; 3usize] = b"lu\0"; -pub const SCNuMAX: &[u8; 3usize] = b"ju\0"; -pub const SCNuPTR: &[u8; 3usize] = b"lu\0"; -pub const SCNx8: &[u8; 4usize] = b"hhx\0"; -pub const SCNx16: &[u8; 3usize] = b"hx\0"; -pub const SCNx32: &[u8; 2usize] = b"x\0"; -pub const SCNx64: &[u8; 3usize] = b"lx\0"; -pub const SCNxLEAST8: &[u8; 4usize] = b"hhx\0"; -pub const SCNxLEAST16: &[u8; 3usize] = b"hx\0"; -pub const SCNxLEAST32: &[u8; 2usize] = b"x\0"; -pub const SCNxLEAST64: &[u8; 3usize] = b"lx\0"; -pub const SCNxFAST8: &[u8; 4usize] = b"hhx\0"; -pub const SCNxFAST16: &[u8; 3usize] = b"lx\0"; -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 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; 2] = b"l\0"; +pub const __PRI_PTR_prefix: &[u8; 2] = b"l\0"; +pub const __PRI_FAST_prefix: &[u8; 2] = b"l\0"; +pub const PRId8: &[u8; 2] = b"d\0"; +pub const PRId16: &[u8; 2] = b"d\0"; +pub const PRId32: &[u8; 2] = b"d\0"; +pub const PRId64: &[u8; 3] = b"ld\0"; +pub const PRIdLEAST8: &[u8; 2] = b"d\0"; +pub const PRIdLEAST16: &[u8; 2] = b"d\0"; +pub const PRIdLEAST32: &[u8; 2] = b"d\0"; +pub const PRIdLEAST64: &[u8; 3] = b"ld\0"; +pub const PRIdFAST8: &[u8; 2] = b"d\0"; +pub const PRIdFAST16: &[u8; 3] = b"ld\0"; +pub const PRIdFAST32: &[u8; 3] = b"ld\0"; +pub const PRIdFAST64: &[u8; 3] = b"ld\0"; +pub const PRIdMAX: &[u8; 3] = b"jd\0"; +pub const PRIdPTR: &[u8; 3] = b"ld\0"; +pub const PRIi8: &[u8; 2] = b"i\0"; +pub const PRIi16: &[u8; 2] = b"i\0"; +pub const PRIi32: &[u8; 2] = b"i\0"; +pub const PRIi64: &[u8; 3] = b"li\0"; +pub const PRIiLEAST8: &[u8; 2] = b"i\0"; +pub const PRIiLEAST16: &[u8; 2] = b"i\0"; +pub const PRIiLEAST32: &[u8; 2] = b"i\0"; +pub const PRIiLEAST64: &[u8; 3] = b"li\0"; +pub const PRIiFAST8: &[u8; 2] = b"i\0"; +pub const PRIiFAST16: &[u8; 3] = b"li\0"; +pub const PRIiFAST32: &[u8; 3] = b"li\0"; +pub const PRIiFAST64: &[u8; 3] = b"li\0"; +pub const PRIiMAX: &[u8; 3] = b"ji\0"; +pub const PRIiPTR: &[u8; 3] = b"li\0"; +pub const PRIo8: &[u8; 2] = b"o\0"; +pub const PRIo16: &[u8; 2] = b"o\0"; +pub const PRIo32: &[u8; 2] = b"o\0"; +pub const PRIo64: &[u8; 3] = b"lo\0"; +pub const PRIoLEAST8: &[u8; 2] = b"o\0"; +pub const PRIoLEAST16: &[u8; 2] = b"o\0"; +pub const PRIoLEAST32: &[u8; 2] = b"o\0"; +pub const PRIoLEAST64: &[u8; 3] = b"lo\0"; +pub const PRIoFAST8: &[u8; 2] = b"o\0"; +pub const PRIoFAST16: &[u8; 3] = b"lo\0"; +pub const PRIoFAST32: &[u8; 3] = b"lo\0"; +pub const PRIoFAST64: &[u8; 3] = b"lo\0"; +pub const PRIoMAX: &[u8; 3] = b"jo\0"; +pub const PRIoPTR: &[u8; 3] = b"lo\0"; +pub const PRIu8: &[u8; 2] = b"u\0"; +pub const PRIu16: &[u8; 2] = b"u\0"; +pub const PRIu32: &[u8; 2] = b"u\0"; +pub const PRIu64: &[u8; 3] = b"lu\0"; +pub const PRIuLEAST8: &[u8; 2] = b"u\0"; +pub const PRIuLEAST16: &[u8; 2] = b"u\0"; +pub const PRIuLEAST32: &[u8; 2] = b"u\0"; +pub const PRIuLEAST64: &[u8; 3] = b"lu\0"; +pub const PRIuFAST8: &[u8; 2] = b"u\0"; +pub const PRIuFAST16: &[u8; 3] = b"lu\0"; +pub const PRIuFAST32: &[u8; 3] = b"lu\0"; +pub const PRIuFAST64: &[u8; 3] = b"lu\0"; +pub const PRIuMAX: &[u8; 3] = b"ju\0"; +pub const PRIuPTR: &[u8; 3] = b"lu\0"; +pub const PRIx8: &[u8; 2] = b"x\0"; +pub const PRIx16: &[u8; 2] = b"x\0"; +pub const PRIx32: &[u8; 2] = b"x\0"; +pub const PRIx64: &[u8; 3] = b"lx\0"; +pub const PRIxLEAST8: &[u8; 2] = b"x\0"; +pub const PRIxLEAST16: &[u8; 2] = b"x\0"; +pub const PRIxLEAST32: &[u8; 2] = b"x\0"; +pub const PRIxLEAST64: &[u8; 3] = b"lx\0"; +pub const PRIxFAST8: &[u8; 2] = b"x\0"; +pub const PRIxFAST16: &[u8; 3] = b"lx\0"; +pub const PRIxFAST32: &[u8; 3] = b"lx\0"; +pub const PRIxFAST64: &[u8; 3] = b"lx\0"; +pub const PRIxMAX: &[u8; 3] = b"jx\0"; +pub const PRIxPTR: &[u8; 3] = b"lx\0"; +pub const PRIX8: &[u8; 2] = b"X\0"; +pub const PRIX16: &[u8; 2] = b"X\0"; +pub const PRIX32: &[u8; 2] = b"X\0"; +pub const PRIX64: &[u8; 3] = b"lX\0"; +pub const PRIXLEAST8: &[u8; 2] = b"X\0"; +pub const PRIXLEAST16: &[u8; 2] = b"X\0"; +pub const PRIXLEAST32: &[u8; 2] = b"X\0"; +pub const PRIXLEAST64: &[u8; 3] = b"lX\0"; +pub const PRIXFAST8: &[u8; 2] = b"X\0"; +pub const PRIXFAST16: &[u8; 3] = b"lX\0"; +pub const PRIXFAST32: &[u8; 3] = b"lX\0"; +pub const PRIXFAST64: &[u8; 3] = b"lX\0"; +pub const PRIXMAX: &[u8; 3] = b"jX\0"; +pub const PRIXPTR: &[u8; 3] = b"lX\0"; +pub const SCNd8: &[u8; 4] = b"hhd\0"; +pub const SCNd16: &[u8; 3] = b"hd\0"; +pub const SCNd32: &[u8; 2] = b"d\0"; +pub const SCNd64: &[u8; 3] = b"ld\0"; +pub const SCNdLEAST8: &[u8; 4] = b"hhd\0"; +pub const SCNdLEAST16: &[u8; 3] = b"hd\0"; +pub const SCNdLEAST32: &[u8; 2] = b"d\0"; +pub const SCNdLEAST64: &[u8; 3] = b"ld\0"; +pub const SCNdFAST8: &[u8; 4] = b"hhd\0"; +pub const SCNdFAST16: &[u8; 3] = b"ld\0"; +pub const SCNdFAST32: &[u8; 3] = b"ld\0"; +pub const SCNdFAST64: &[u8; 3] = b"ld\0"; +pub const SCNdMAX: &[u8; 3] = b"jd\0"; +pub const SCNdPTR: &[u8; 3] = b"ld\0"; +pub const SCNi8: &[u8; 4] = b"hhi\0"; +pub const SCNi16: &[u8; 3] = b"hi\0"; +pub const SCNi32: &[u8; 2] = b"i\0"; +pub const SCNi64: &[u8; 3] = b"li\0"; +pub const SCNiLEAST8: &[u8; 4] = b"hhi\0"; +pub const SCNiLEAST16: &[u8; 3] = b"hi\0"; +pub const SCNiLEAST32: &[u8; 2] = b"i\0"; +pub const SCNiLEAST64: &[u8; 3] = b"li\0"; +pub const SCNiFAST8: &[u8; 4] = b"hhi\0"; +pub const SCNiFAST16: &[u8; 3] = b"li\0"; +pub const SCNiFAST32: &[u8; 3] = b"li\0"; +pub const SCNiFAST64: &[u8; 3] = b"li\0"; +pub const SCNiMAX: &[u8; 3] = b"ji\0"; +pub const SCNiPTR: &[u8; 3] = b"li\0"; +pub const SCNo8: &[u8; 4] = b"hho\0"; +pub const SCNo16: &[u8; 3] = b"ho\0"; +pub const SCNo32: &[u8; 2] = b"o\0"; +pub const SCNo64: &[u8; 3] = b"lo\0"; +pub const SCNoLEAST8: &[u8; 4] = b"hho\0"; +pub const SCNoLEAST16: &[u8; 3] = b"ho\0"; +pub const SCNoLEAST32: &[u8; 2] = b"o\0"; +pub const SCNoLEAST64: &[u8; 3] = b"lo\0"; +pub const SCNoFAST8: &[u8; 4] = b"hho\0"; +pub const SCNoFAST16: &[u8; 3] = b"lo\0"; +pub const SCNoFAST32: &[u8; 3] = b"lo\0"; +pub const SCNoFAST64: &[u8; 3] = b"lo\0"; +pub const SCNoMAX: &[u8; 3] = b"jo\0"; +pub const SCNoPTR: &[u8; 3] = b"lo\0"; +pub const SCNu8: &[u8; 4] = b"hhu\0"; +pub const SCNu16: &[u8; 3] = b"hu\0"; +pub const SCNu32: &[u8; 2] = b"u\0"; +pub const SCNu64: &[u8; 3] = b"lu\0"; +pub const SCNuLEAST8: &[u8; 4] = b"hhu\0"; +pub const SCNuLEAST16: &[u8; 3] = b"hu\0"; +pub const SCNuLEAST32: &[u8; 2] = b"u\0"; +pub const SCNuLEAST64: &[u8; 3] = b"lu\0"; +pub const SCNuFAST8: &[u8; 4] = b"hhu\0"; +pub const SCNuFAST16: &[u8; 3] = b"lu\0"; +pub const SCNuFAST32: &[u8; 3] = b"lu\0"; +pub const SCNuFAST64: &[u8; 3] = b"lu\0"; +pub const SCNuMAX: &[u8; 3] = b"ju\0"; +pub const SCNuPTR: &[u8; 3] = b"lu\0"; +pub const SCNx8: &[u8; 4] = b"hhx\0"; +pub const SCNx16: &[u8; 3] = b"hx\0"; +pub const SCNx32: &[u8; 2] = b"x\0"; +pub const SCNx64: &[u8; 3] = b"lx\0"; +pub const SCNxLEAST8: &[u8; 4] = b"hhx\0"; +pub const SCNxLEAST16: &[u8; 3] = b"hx\0"; +pub const SCNxLEAST32: &[u8; 2] = b"x\0"; +pub const SCNxLEAST64: &[u8; 3] = b"lx\0"; +pub const SCNxFAST8: &[u8; 4] = b"hhx\0"; +pub const SCNxFAST16: &[u8; 3] = b"lx\0"; +pub const SCNxFAST32: &[u8; 3] = b"lx\0"; +pub const SCNxFAST64: &[u8; 3] = b"lx\0"; +pub const SCNxMAX: &[u8; 3] = b"jx\0"; +pub const SCNxPTR: &[u8; 3] = b"lx\0"; 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; +pub const GAMETEXTINPUT_MAJOR_VERSION: u32 = 2; +pub const GAMETEXTINPUT_MINOR_VERSION: u32 = 0; +pub const GAMETEXTINPUT_BUGFIX_VERSION: u32 = 0; +pub const GAMEACTIVITY_MAJOR_VERSION: u32 = 2; +pub const GAMEACTIVITY_MINOR_VERSION: u32 = 0; +pub const GAMEACTIVITY_BUGFIX_VERSION: u32 = 2; pub const POLLIN: u32 = 1; pub const POLLPRI: u32 = 2; pub const POLLOUT: u32 = 4; @@ -471,6 +480,8 @@ 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; @@ -526,7 +537,9 @@ 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 NSIGSEGV: u32 = 7; +pub const SEGV_MTEAERR: u32 = 8; +pub const SEGV_MTESERR: u32 = 9; +pub const NSIGSEGV: u32 = 9; pub const BUS_ADRALN: u32 = 1; pub const BUS_ADRERR: u32 = 2; pub const BUS_OBJERR: u32 = 3; @@ -538,7 +551,8 @@ 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 NSIGTRAP: u32 = 5; +pub const TRAP_PERF: u32 = 6; +pub const NSIGTRAP: u32 = 6; pub const CLD_EXITED: u32 = 1; pub const CLD_KILLED: u32 = 2; pub const CLD_DUMPED: u32 = 3; @@ -554,7 +568,8 @@ 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 NSIGSYS: u32 = 1; +pub const SYS_USER_DISPATCH: u32 = 2; +pub const NSIGSYS: u32 = 2; pub const EMT_TAGOVF: u32 = 1; pub const NSIGEMT: u32 = 1; pub const SIGEV_SIGNAL: u32 = 0; @@ -618,6 +633,12 @@ 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; @@ -649,9 +670,6 @@ pub const PTHREAD_PROCESS_PRIVATE: u32 = 0; pub const PTHREAD_PROCESS_SHARED: u32 = 1; pub const PTHREAD_SCOPE_SYSTEM: u32 = 0; pub const PTHREAD_SCOPE_PROCESS: u32 = 1; -pub const NATIVE_APP_GLUE_MAX_NUM_MOTION_EVENTS: u32 = 16; -pub const NATIVE_APP_GLUE_MAX_HISTORICAL_POINTER_SAMPLES: u32 = 64; -pub const NATIVE_APP_GLUE_MAX_NUM_KEY_EVENTS: u32 = 4; pub const NATIVE_APP_GLUE_MAX_INPUT_BUFFERS: u32 = 2; extern "C" { pub fn android_get_application_target_sdk_version() -> ::std::os::raw::c_int; @@ -670,6 +688,8 @@ pub struct max_align_t { } #[test] fn bindgen_test_layout_max_align_t() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 32usize, @@ -681,9 +701,7 @@ fn bindgen_test_layout_max_align_t() { concat!("Alignment of ", stringify!(max_align_t)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).__clang_max_align_nonce1 as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).__clang_max_align_nonce1) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -693,9 +711,7 @@ fn bindgen_test_layout_max_align_t() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).__clang_max_align_nonce2 as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).__clang_max_align_nonce2) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -748,6 +764,8 @@ pub struct __kernel_fd_set { } #[test] fn bindgen_test_layout___kernel_fd_set() { + const UNINIT: ::std::mem::MaybeUninit<__kernel_fd_set> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__kernel_fd_set>(), 128usize, @@ -759,7 +777,7 @@ fn bindgen_test_layout___kernel_fd_set() { concat!("Alignment of ", stringify!(__kernel_fd_set)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_fd_set>())).fds_bits as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).fds_bits) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -798,6 +816,8 @@ pub struct __kernel_fsid_t { } #[test] fn bindgen_test_layout___kernel_fsid_t() { + const UNINIT: ::std::mem::MaybeUninit<__kernel_fsid_t> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__kernel_fsid_t>(), 8usize, @@ -809,7 +829,7 @@ fn bindgen_test_layout___kernel_fsid_t() { concat!("Alignment of ", stringify!(__kernel_fsid_t)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_fsid_t>())).val as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).val) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -821,6 +841,7 @@ 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; @@ -879,7 +900,6 @@ pub type off64_t = loff_t; pub type __socklen_t = u32; pub type socklen_t = __socklen_t; pub type __va_list = [u64; 4usize]; -pub type ssize_t = __kernel_ssize_t; pub type uint_t = ::std::os::raw::c_uint; pub type uint = ::std::os::raw::c_uint; pub type u_char = ::std::os::raw::c_uchar; @@ -890,483 +910,651 @@ pub type u_int32_t = u32; pub type u_int16_t = u16; pub type u_int8_t = u8; pub type u_int64_t = u64; -pub const AASSET_MODE_UNKNOWN: ::std::os::raw::c_uint = 0; -pub const AASSET_MODE_RANDOM: ::std::os::raw::c_uint = 1; -pub const AASSET_MODE_STREAMING: ::std::os::raw::c_uint = 2; -pub const AASSET_MODE_BUFFER: ::std::os::raw::c_uint = 3; +pub const AASSET_MODE_UNKNOWN: _bindgen_ty_1 = 0; +pub const AASSET_MODE_RANDOM: _bindgen_ty_1 = 1; +pub const AASSET_MODE_STREAMING: _bindgen_ty_1 = 2; +pub const AASSET_MODE_BUFFER: _bindgen_ty_1 = 3; pub type _bindgen_ty_1 = ::std::os::raw::c_uint; -pub const AKEYCODE_UNKNOWN: ::std::os::raw::c_uint = 0; -pub const AKEYCODE_SOFT_LEFT: ::std::os::raw::c_uint = 1; -pub const AKEYCODE_SOFT_RIGHT: ::std::os::raw::c_uint = 2; -pub const AKEYCODE_HOME: ::std::os::raw::c_uint = 3; -pub const AKEYCODE_BACK: ::std::os::raw::c_uint = 4; -pub const AKEYCODE_CALL: ::std::os::raw::c_uint = 5; -pub const AKEYCODE_ENDCALL: ::std::os::raw::c_uint = 6; -pub const AKEYCODE_0: ::std::os::raw::c_uint = 7; -pub const AKEYCODE_1: ::std::os::raw::c_uint = 8; -pub const AKEYCODE_2: ::std::os::raw::c_uint = 9; -pub const AKEYCODE_3: ::std::os::raw::c_uint = 10; -pub const AKEYCODE_4: ::std::os::raw::c_uint = 11; -pub const AKEYCODE_5: ::std::os::raw::c_uint = 12; -pub const AKEYCODE_6: ::std::os::raw::c_uint = 13; -pub const AKEYCODE_7: ::std::os::raw::c_uint = 14; -pub const AKEYCODE_8: ::std::os::raw::c_uint = 15; -pub const AKEYCODE_9: ::std::os::raw::c_uint = 16; -pub const AKEYCODE_STAR: ::std::os::raw::c_uint = 17; -pub const AKEYCODE_POUND: ::std::os::raw::c_uint = 18; -pub const AKEYCODE_DPAD_UP: ::std::os::raw::c_uint = 19; -pub const AKEYCODE_DPAD_DOWN: ::std::os::raw::c_uint = 20; -pub const AKEYCODE_DPAD_LEFT: ::std::os::raw::c_uint = 21; -pub const AKEYCODE_DPAD_RIGHT: ::std::os::raw::c_uint = 22; -pub const AKEYCODE_DPAD_CENTER: ::std::os::raw::c_uint = 23; -pub const AKEYCODE_VOLUME_UP: ::std::os::raw::c_uint = 24; -pub const AKEYCODE_VOLUME_DOWN: ::std::os::raw::c_uint = 25; -pub const AKEYCODE_POWER: ::std::os::raw::c_uint = 26; -pub const AKEYCODE_CAMERA: ::std::os::raw::c_uint = 27; -pub const AKEYCODE_CLEAR: ::std::os::raw::c_uint = 28; -pub const AKEYCODE_A: ::std::os::raw::c_uint = 29; -pub const AKEYCODE_B: ::std::os::raw::c_uint = 30; -pub const AKEYCODE_C: ::std::os::raw::c_uint = 31; -pub const AKEYCODE_D: ::std::os::raw::c_uint = 32; -pub const AKEYCODE_E: ::std::os::raw::c_uint = 33; -pub const AKEYCODE_F: ::std::os::raw::c_uint = 34; -pub const AKEYCODE_G: ::std::os::raw::c_uint = 35; -pub const AKEYCODE_H: ::std::os::raw::c_uint = 36; -pub const AKEYCODE_I: ::std::os::raw::c_uint = 37; -pub const AKEYCODE_J: ::std::os::raw::c_uint = 38; -pub const AKEYCODE_K: ::std::os::raw::c_uint = 39; -pub const AKEYCODE_L: ::std::os::raw::c_uint = 40; -pub const AKEYCODE_M: ::std::os::raw::c_uint = 41; -pub const AKEYCODE_N: ::std::os::raw::c_uint = 42; -pub const AKEYCODE_O: ::std::os::raw::c_uint = 43; -pub const AKEYCODE_P: ::std::os::raw::c_uint = 44; -pub const AKEYCODE_Q: ::std::os::raw::c_uint = 45; -pub const AKEYCODE_R: ::std::os::raw::c_uint = 46; -pub const AKEYCODE_S: ::std::os::raw::c_uint = 47; -pub const AKEYCODE_T: ::std::os::raw::c_uint = 48; -pub const AKEYCODE_U: ::std::os::raw::c_uint = 49; -pub const AKEYCODE_V: ::std::os::raw::c_uint = 50; -pub const AKEYCODE_W: ::std::os::raw::c_uint = 51; -pub const AKEYCODE_X: ::std::os::raw::c_uint = 52; -pub const AKEYCODE_Y: ::std::os::raw::c_uint = 53; -pub const AKEYCODE_Z: ::std::os::raw::c_uint = 54; -pub const AKEYCODE_COMMA: ::std::os::raw::c_uint = 55; -pub const AKEYCODE_PERIOD: ::std::os::raw::c_uint = 56; -pub const AKEYCODE_ALT_LEFT: ::std::os::raw::c_uint = 57; -pub const AKEYCODE_ALT_RIGHT: ::std::os::raw::c_uint = 58; -pub const AKEYCODE_SHIFT_LEFT: ::std::os::raw::c_uint = 59; -pub const AKEYCODE_SHIFT_RIGHT: ::std::os::raw::c_uint = 60; -pub const AKEYCODE_TAB: ::std::os::raw::c_uint = 61; -pub const AKEYCODE_SPACE: ::std::os::raw::c_uint = 62; -pub const AKEYCODE_SYM: ::std::os::raw::c_uint = 63; -pub const AKEYCODE_EXPLORER: ::std::os::raw::c_uint = 64; -pub const AKEYCODE_ENVELOPE: ::std::os::raw::c_uint = 65; -pub const AKEYCODE_ENTER: ::std::os::raw::c_uint = 66; -pub const AKEYCODE_DEL: ::std::os::raw::c_uint = 67; -pub const AKEYCODE_GRAVE: ::std::os::raw::c_uint = 68; -pub const AKEYCODE_MINUS: ::std::os::raw::c_uint = 69; -pub const AKEYCODE_EQUALS: ::std::os::raw::c_uint = 70; -pub const AKEYCODE_LEFT_BRACKET: ::std::os::raw::c_uint = 71; -pub const AKEYCODE_RIGHT_BRACKET: ::std::os::raw::c_uint = 72; -pub const AKEYCODE_BACKSLASH: ::std::os::raw::c_uint = 73; -pub const AKEYCODE_SEMICOLON: ::std::os::raw::c_uint = 74; -pub const AKEYCODE_APOSTROPHE: ::std::os::raw::c_uint = 75; -pub const AKEYCODE_SLASH: ::std::os::raw::c_uint = 76; -pub const AKEYCODE_AT: ::std::os::raw::c_uint = 77; -pub const AKEYCODE_NUM: ::std::os::raw::c_uint = 78; -pub const AKEYCODE_HEADSETHOOK: ::std::os::raw::c_uint = 79; -pub const AKEYCODE_FOCUS: ::std::os::raw::c_uint = 80; -pub const AKEYCODE_PLUS: ::std::os::raw::c_uint = 81; -pub const AKEYCODE_MENU: ::std::os::raw::c_uint = 82; -pub const AKEYCODE_NOTIFICATION: ::std::os::raw::c_uint = 83; -pub const AKEYCODE_SEARCH: ::std::os::raw::c_uint = 84; -pub const AKEYCODE_MEDIA_PLAY_PAUSE: ::std::os::raw::c_uint = 85; -pub const AKEYCODE_MEDIA_STOP: ::std::os::raw::c_uint = 86; -pub const AKEYCODE_MEDIA_NEXT: ::std::os::raw::c_uint = 87; -pub const AKEYCODE_MEDIA_PREVIOUS: ::std::os::raw::c_uint = 88; -pub const AKEYCODE_MEDIA_REWIND: ::std::os::raw::c_uint = 89; -pub const AKEYCODE_MEDIA_FAST_FORWARD: ::std::os::raw::c_uint = 90; -pub const AKEYCODE_MUTE: ::std::os::raw::c_uint = 91; -pub const AKEYCODE_PAGE_UP: ::std::os::raw::c_uint = 92; -pub const AKEYCODE_PAGE_DOWN: ::std::os::raw::c_uint = 93; -pub const AKEYCODE_PICTSYMBOLS: ::std::os::raw::c_uint = 94; -pub const AKEYCODE_SWITCH_CHARSET: ::std::os::raw::c_uint = 95; -pub const AKEYCODE_BUTTON_A: ::std::os::raw::c_uint = 96; -pub const AKEYCODE_BUTTON_B: ::std::os::raw::c_uint = 97; -pub const AKEYCODE_BUTTON_C: ::std::os::raw::c_uint = 98; -pub const AKEYCODE_BUTTON_X: ::std::os::raw::c_uint = 99; -pub const AKEYCODE_BUTTON_Y: ::std::os::raw::c_uint = 100; -pub const AKEYCODE_BUTTON_Z: ::std::os::raw::c_uint = 101; -pub const AKEYCODE_BUTTON_L1: ::std::os::raw::c_uint = 102; -pub const AKEYCODE_BUTTON_R1: ::std::os::raw::c_uint = 103; -pub const AKEYCODE_BUTTON_L2: ::std::os::raw::c_uint = 104; -pub const AKEYCODE_BUTTON_R2: ::std::os::raw::c_uint = 105; -pub const AKEYCODE_BUTTON_THUMBL: ::std::os::raw::c_uint = 106; -pub const AKEYCODE_BUTTON_THUMBR: ::std::os::raw::c_uint = 107; -pub const AKEYCODE_BUTTON_START: ::std::os::raw::c_uint = 108; -pub const AKEYCODE_BUTTON_SELECT: ::std::os::raw::c_uint = 109; -pub const AKEYCODE_BUTTON_MODE: ::std::os::raw::c_uint = 110; -pub const AKEYCODE_ESCAPE: ::std::os::raw::c_uint = 111; -pub const AKEYCODE_FORWARD_DEL: ::std::os::raw::c_uint = 112; -pub const AKEYCODE_CTRL_LEFT: ::std::os::raw::c_uint = 113; -pub const AKEYCODE_CTRL_RIGHT: ::std::os::raw::c_uint = 114; -pub const AKEYCODE_CAPS_LOCK: ::std::os::raw::c_uint = 115; -pub const AKEYCODE_SCROLL_LOCK: ::std::os::raw::c_uint = 116; -pub const AKEYCODE_META_LEFT: ::std::os::raw::c_uint = 117; -pub const AKEYCODE_META_RIGHT: ::std::os::raw::c_uint = 118; -pub const AKEYCODE_FUNCTION: ::std::os::raw::c_uint = 119; -pub const AKEYCODE_SYSRQ: ::std::os::raw::c_uint = 120; -pub const AKEYCODE_BREAK: ::std::os::raw::c_uint = 121; -pub const AKEYCODE_MOVE_HOME: ::std::os::raw::c_uint = 122; -pub const AKEYCODE_MOVE_END: ::std::os::raw::c_uint = 123; -pub const AKEYCODE_INSERT: ::std::os::raw::c_uint = 124; -pub const AKEYCODE_FORWARD: ::std::os::raw::c_uint = 125; -pub const AKEYCODE_MEDIA_PLAY: ::std::os::raw::c_uint = 126; -pub const AKEYCODE_MEDIA_PAUSE: ::std::os::raw::c_uint = 127; -pub const AKEYCODE_MEDIA_CLOSE: ::std::os::raw::c_uint = 128; -pub const AKEYCODE_MEDIA_EJECT: ::std::os::raw::c_uint = 129; -pub const AKEYCODE_MEDIA_RECORD: ::std::os::raw::c_uint = 130; -pub const AKEYCODE_F1: ::std::os::raw::c_uint = 131; -pub const AKEYCODE_F2: ::std::os::raw::c_uint = 132; -pub const AKEYCODE_F3: ::std::os::raw::c_uint = 133; -pub const AKEYCODE_F4: ::std::os::raw::c_uint = 134; -pub const AKEYCODE_F5: ::std::os::raw::c_uint = 135; -pub const AKEYCODE_F6: ::std::os::raw::c_uint = 136; -pub const AKEYCODE_F7: ::std::os::raw::c_uint = 137; -pub const AKEYCODE_F8: ::std::os::raw::c_uint = 138; -pub const AKEYCODE_F9: ::std::os::raw::c_uint = 139; -pub const AKEYCODE_F10: ::std::os::raw::c_uint = 140; -pub const AKEYCODE_F11: ::std::os::raw::c_uint = 141; -pub const AKEYCODE_F12: ::std::os::raw::c_uint = 142; -pub const AKEYCODE_NUM_LOCK: ::std::os::raw::c_uint = 143; -pub const AKEYCODE_NUMPAD_0: ::std::os::raw::c_uint = 144; -pub const AKEYCODE_NUMPAD_1: ::std::os::raw::c_uint = 145; -pub const AKEYCODE_NUMPAD_2: ::std::os::raw::c_uint = 146; -pub const AKEYCODE_NUMPAD_3: ::std::os::raw::c_uint = 147; -pub const AKEYCODE_NUMPAD_4: ::std::os::raw::c_uint = 148; -pub const AKEYCODE_NUMPAD_5: ::std::os::raw::c_uint = 149; -pub const AKEYCODE_NUMPAD_6: ::std::os::raw::c_uint = 150; -pub const AKEYCODE_NUMPAD_7: ::std::os::raw::c_uint = 151; -pub const AKEYCODE_NUMPAD_8: ::std::os::raw::c_uint = 152; -pub const AKEYCODE_NUMPAD_9: ::std::os::raw::c_uint = 153; -pub const AKEYCODE_NUMPAD_DIVIDE: ::std::os::raw::c_uint = 154; -pub const AKEYCODE_NUMPAD_MULTIPLY: ::std::os::raw::c_uint = 155; -pub const AKEYCODE_NUMPAD_SUBTRACT: ::std::os::raw::c_uint = 156; -pub const AKEYCODE_NUMPAD_ADD: ::std::os::raw::c_uint = 157; -pub const AKEYCODE_NUMPAD_DOT: ::std::os::raw::c_uint = 158; -pub const AKEYCODE_NUMPAD_COMMA: ::std::os::raw::c_uint = 159; -pub const AKEYCODE_NUMPAD_ENTER: ::std::os::raw::c_uint = 160; -pub const AKEYCODE_NUMPAD_EQUALS: ::std::os::raw::c_uint = 161; -pub const AKEYCODE_NUMPAD_LEFT_PAREN: ::std::os::raw::c_uint = 162; -pub const AKEYCODE_NUMPAD_RIGHT_PAREN: ::std::os::raw::c_uint = 163; -pub const AKEYCODE_VOLUME_MUTE: ::std::os::raw::c_uint = 164; -pub const AKEYCODE_INFO: ::std::os::raw::c_uint = 165; -pub const AKEYCODE_CHANNEL_UP: ::std::os::raw::c_uint = 166; -pub const AKEYCODE_CHANNEL_DOWN: ::std::os::raw::c_uint = 167; -pub const AKEYCODE_ZOOM_IN: ::std::os::raw::c_uint = 168; -pub const AKEYCODE_ZOOM_OUT: ::std::os::raw::c_uint = 169; -pub const AKEYCODE_TV: ::std::os::raw::c_uint = 170; -pub const AKEYCODE_WINDOW: ::std::os::raw::c_uint = 171; -pub const AKEYCODE_GUIDE: ::std::os::raw::c_uint = 172; -pub const AKEYCODE_DVR: ::std::os::raw::c_uint = 173; -pub const AKEYCODE_BOOKMARK: ::std::os::raw::c_uint = 174; -pub const AKEYCODE_CAPTIONS: ::std::os::raw::c_uint = 175; -pub const AKEYCODE_SETTINGS: ::std::os::raw::c_uint = 176; -pub const AKEYCODE_TV_POWER: ::std::os::raw::c_uint = 177; -pub const AKEYCODE_TV_INPUT: ::std::os::raw::c_uint = 178; -pub const AKEYCODE_STB_POWER: ::std::os::raw::c_uint = 179; -pub const AKEYCODE_STB_INPUT: ::std::os::raw::c_uint = 180; -pub const AKEYCODE_AVR_POWER: ::std::os::raw::c_uint = 181; -pub const AKEYCODE_AVR_INPUT: ::std::os::raw::c_uint = 182; -pub const AKEYCODE_PROG_RED: ::std::os::raw::c_uint = 183; -pub const AKEYCODE_PROG_GREEN: ::std::os::raw::c_uint = 184; -pub const AKEYCODE_PROG_YELLOW: ::std::os::raw::c_uint = 185; -pub const AKEYCODE_PROG_BLUE: ::std::os::raw::c_uint = 186; -pub const AKEYCODE_APP_SWITCH: ::std::os::raw::c_uint = 187; -pub const AKEYCODE_BUTTON_1: ::std::os::raw::c_uint = 188; -pub const AKEYCODE_BUTTON_2: ::std::os::raw::c_uint = 189; -pub const AKEYCODE_BUTTON_3: ::std::os::raw::c_uint = 190; -pub const AKEYCODE_BUTTON_4: ::std::os::raw::c_uint = 191; -pub const AKEYCODE_BUTTON_5: ::std::os::raw::c_uint = 192; -pub const AKEYCODE_BUTTON_6: ::std::os::raw::c_uint = 193; -pub const AKEYCODE_BUTTON_7: ::std::os::raw::c_uint = 194; -pub const AKEYCODE_BUTTON_8: ::std::os::raw::c_uint = 195; -pub const AKEYCODE_BUTTON_9: ::std::os::raw::c_uint = 196; -pub const AKEYCODE_BUTTON_10: ::std::os::raw::c_uint = 197; -pub const AKEYCODE_BUTTON_11: ::std::os::raw::c_uint = 198; -pub const AKEYCODE_BUTTON_12: ::std::os::raw::c_uint = 199; -pub const AKEYCODE_BUTTON_13: ::std::os::raw::c_uint = 200; -pub const AKEYCODE_BUTTON_14: ::std::os::raw::c_uint = 201; -pub const AKEYCODE_BUTTON_15: ::std::os::raw::c_uint = 202; -pub const AKEYCODE_BUTTON_16: ::std::os::raw::c_uint = 203; -pub const AKEYCODE_LANGUAGE_SWITCH: ::std::os::raw::c_uint = 204; -pub const AKEYCODE_MANNER_MODE: ::std::os::raw::c_uint = 205; -pub const AKEYCODE_3D_MODE: ::std::os::raw::c_uint = 206; -pub const AKEYCODE_CONTACTS: ::std::os::raw::c_uint = 207; -pub const AKEYCODE_CALENDAR: ::std::os::raw::c_uint = 208; -pub const AKEYCODE_MUSIC: ::std::os::raw::c_uint = 209; -pub const AKEYCODE_CALCULATOR: ::std::os::raw::c_uint = 210; -pub const AKEYCODE_ZENKAKU_HANKAKU: ::std::os::raw::c_uint = 211; -pub const AKEYCODE_EISU: ::std::os::raw::c_uint = 212; -pub const AKEYCODE_MUHENKAN: ::std::os::raw::c_uint = 213; -pub const AKEYCODE_HENKAN: ::std::os::raw::c_uint = 214; -pub const AKEYCODE_KATAKANA_HIRAGANA: ::std::os::raw::c_uint = 215; -pub const AKEYCODE_YEN: ::std::os::raw::c_uint = 216; -pub const AKEYCODE_RO: ::std::os::raw::c_uint = 217; -pub const AKEYCODE_KANA: ::std::os::raw::c_uint = 218; -pub const AKEYCODE_ASSIST: ::std::os::raw::c_uint = 219; -pub const AKEYCODE_BRIGHTNESS_DOWN: ::std::os::raw::c_uint = 220; -pub const AKEYCODE_BRIGHTNESS_UP: ::std::os::raw::c_uint = 221; -pub const AKEYCODE_MEDIA_AUDIO_TRACK: ::std::os::raw::c_uint = 222; -pub const AKEYCODE_SLEEP: ::std::os::raw::c_uint = 223; -pub const AKEYCODE_WAKEUP: ::std::os::raw::c_uint = 224; -pub const AKEYCODE_PAIRING: ::std::os::raw::c_uint = 225; -pub const AKEYCODE_MEDIA_TOP_MENU: ::std::os::raw::c_uint = 226; -pub const AKEYCODE_11: ::std::os::raw::c_uint = 227; -pub const AKEYCODE_12: ::std::os::raw::c_uint = 228; -pub const AKEYCODE_LAST_CHANNEL: ::std::os::raw::c_uint = 229; -pub const AKEYCODE_TV_DATA_SERVICE: ::std::os::raw::c_uint = 230; -pub const AKEYCODE_VOICE_ASSIST: ::std::os::raw::c_uint = 231; -pub const AKEYCODE_TV_RADIO_SERVICE: ::std::os::raw::c_uint = 232; -pub const AKEYCODE_TV_TELETEXT: ::std::os::raw::c_uint = 233; -pub const AKEYCODE_TV_NUMBER_ENTRY: ::std::os::raw::c_uint = 234; -pub const AKEYCODE_TV_TERRESTRIAL_ANALOG: ::std::os::raw::c_uint = 235; -pub const AKEYCODE_TV_TERRESTRIAL_DIGITAL: ::std::os::raw::c_uint = 236; -pub const AKEYCODE_TV_SATELLITE: ::std::os::raw::c_uint = 237; -pub const AKEYCODE_TV_SATELLITE_BS: ::std::os::raw::c_uint = 238; -pub const AKEYCODE_TV_SATELLITE_CS: ::std::os::raw::c_uint = 239; -pub const AKEYCODE_TV_SATELLITE_SERVICE: ::std::os::raw::c_uint = 240; -pub const AKEYCODE_TV_NETWORK: ::std::os::raw::c_uint = 241; -pub const AKEYCODE_TV_ANTENNA_CABLE: ::std::os::raw::c_uint = 242; -pub const AKEYCODE_TV_INPUT_HDMI_1: ::std::os::raw::c_uint = 243; -pub const AKEYCODE_TV_INPUT_HDMI_2: ::std::os::raw::c_uint = 244; -pub const AKEYCODE_TV_INPUT_HDMI_3: ::std::os::raw::c_uint = 245; -pub const AKEYCODE_TV_INPUT_HDMI_4: ::std::os::raw::c_uint = 246; -pub const AKEYCODE_TV_INPUT_COMPOSITE_1: ::std::os::raw::c_uint = 247; -pub const AKEYCODE_TV_INPUT_COMPOSITE_2: ::std::os::raw::c_uint = 248; -pub const AKEYCODE_TV_INPUT_COMPONENT_1: ::std::os::raw::c_uint = 249; -pub const AKEYCODE_TV_INPUT_COMPONENT_2: ::std::os::raw::c_uint = 250; -pub const AKEYCODE_TV_INPUT_VGA_1: ::std::os::raw::c_uint = 251; -pub const AKEYCODE_TV_AUDIO_DESCRIPTION: ::std::os::raw::c_uint = 252; -pub const AKEYCODE_TV_AUDIO_DESCRIPTION_MIX_UP: ::std::os::raw::c_uint = 253; -pub const AKEYCODE_TV_AUDIO_DESCRIPTION_MIX_DOWN: ::std::os::raw::c_uint = 254; -pub const AKEYCODE_TV_ZOOM_MODE: ::std::os::raw::c_uint = 255; -pub const AKEYCODE_TV_CONTENTS_MENU: ::std::os::raw::c_uint = 256; -pub const AKEYCODE_TV_MEDIA_CONTEXT_MENU: ::std::os::raw::c_uint = 257; -pub const AKEYCODE_TV_TIMER_PROGRAMMING: ::std::os::raw::c_uint = 258; -pub const AKEYCODE_HELP: ::std::os::raw::c_uint = 259; -pub const AKEYCODE_NAVIGATE_PREVIOUS: ::std::os::raw::c_uint = 260; -pub const AKEYCODE_NAVIGATE_NEXT: ::std::os::raw::c_uint = 261; -pub const AKEYCODE_NAVIGATE_IN: ::std::os::raw::c_uint = 262; -pub const AKEYCODE_NAVIGATE_OUT: ::std::os::raw::c_uint = 263; -pub const AKEYCODE_STEM_PRIMARY: ::std::os::raw::c_uint = 264; -pub const AKEYCODE_STEM_1: ::std::os::raw::c_uint = 265; -pub const AKEYCODE_STEM_2: ::std::os::raw::c_uint = 266; -pub const AKEYCODE_STEM_3: ::std::os::raw::c_uint = 267; -pub const AKEYCODE_DPAD_UP_LEFT: ::std::os::raw::c_uint = 268; -pub const AKEYCODE_DPAD_DOWN_LEFT: ::std::os::raw::c_uint = 269; -pub const AKEYCODE_DPAD_UP_RIGHT: ::std::os::raw::c_uint = 270; -pub const AKEYCODE_DPAD_DOWN_RIGHT: ::std::os::raw::c_uint = 271; -pub const AKEYCODE_MEDIA_SKIP_FORWARD: ::std::os::raw::c_uint = 272; -pub const AKEYCODE_MEDIA_SKIP_BACKWARD: ::std::os::raw::c_uint = 273; -pub const AKEYCODE_MEDIA_STEP_FORWARD: ::std::os::raw::c_uint = 274; -pub const AKEYCODE_MEDIA_STEP_BACKWARD: ::std::os::raw::c_uint = 275; -pub const AKEYCODE_SOFT_SLEEP: ::std::os::raw::c_uint = 276; -pub const AKEYCODE_CUT: ::std::os::raw::c_uint = 277; -pub const AKEYCODE_COPY: ::std::os::raw::c_uint = 278; -pub const AKEYCODE_PASTE: ::std::os::raw::c_uint = 279; -pub const AKEYCODE_SYSTEM_NAVIGATION_UP: ::std::os::raw::c_uint = 280; -pub const AKEYCODE_SYSTEM_NAVIGATION_DOWN: ::std::os::raw::c_uint = 281; -pub const AKEYCODE_SYSTEM_NAVIGATION_LEFT: ::std::os::raw::c_uint = 282; -pub const AKEYCODE_SYSTEM_NAVIGATION_RIGHT: ::std::os::raw::c_uint = 283; -pub const AKEYCODE_ALL_APPS: ::std::os::raw::c_uint = 284; -pub const AKEYCODE_REFRESH: ::std::os::raw::c_uint = 285; -pub const AKEYCODE_THUMBS_UP: ::std::os::raw::c_uint = 286; -pub const AKEYCODE_THUMBS_DOWN: ::std::os::raw::c_uint = 287; -pub const AKEYCODE_PROFILE_SWITCH: ::std::os::raw::c_uint = 288; +pub const AKEYCODE_UNKNOWN: _bindgen_ty_2 = 0; +pub const AKEYCODE_SOFT_LEFT: _bindgen_ty_2 = 1; +pub const AKEYCODE_SOFT_RIGHT: _bindgen_ty_2 = 2; +pub const AKEYCODE_HOME: _bindgen_ty_2 = 3; +pub const AKEYCODE_BACK: _bindgen_ty_2 = 4; +pub const AKEYCODE_CALL: _bindgen_ty_2 = 5; +pub const AKEYCODE_ENDCALL: _bindgen_ty_2 = 6; +pub const AKEYCODE_0: _bindgen_ty_2 = 7; +pub const AKEYCODE_1: _bindgen_ty_2 = 8; +pub const AKEYCODE_2: _bindgen_ty_2 = 9; +pub const AKEYCODE_3: _bindgen_ty_2 = 10; +pub const AKEYCODE_4: _bindgen_ty_2 = 11; +pub const AKEYCODE_5: _bindgen_ty_2 = 12; +pub const AKEYCODE_6: _bindgen_ty_2 = 13; +pub const AKEYCODE_7: _bindgen_ty_2 = 14; +pub const AKEYCODE_8: _bindgen_ty_2 = 15; +pub const AKEYCODE_9: _bindgen_ty_2 = 16; +pub const AKEYCODE_STAR: _bindgen_ty_2 = 17; +pub const AKEYCODE_POUND: _bindgen_ty_2 = 18; +pub const AKEYCODE_DPAD_UP: _bindgen_ty_2 = 19; +pub const AKEYCODE_DPAD_DOWN: _bindgen_ty_2 = 20; +pub const AKEYCODE_DPAD_LEFT: _bindgen_ty_2 = 21; +pub const AKEYCODE_DPAD_RIGHT: _bindgen_ty_2 = 22; +pub const AKEYCODE_DPAD_CENTER: _bindgen_ty_2 = 23; +pub const AKEYCODE_VOLUME_UP: _bindgen_ty_2 = 24; +pub const AKEYCODE_VOLUME_DOWN: _bindgen_ty_2 = 25; +pub const AKEYCODE_POWER: _bindgen_ty_2 = 26; +pub const AKEYCODE_CAMERA: _bindgen_ty_2 = 27; +pub const AKEYCODE_CLEAR: _bindgen_ty_2 = 28; +pub const AKEYCODE_A: _bindgen_ty_2 = 29; +pub const AKEYCODE_B: _bindgen_ty_2 = 30; +pub const AKEYCODE_C: _bindgen_ty_2 = 31; +pub const AKEYCODE_D: _bindgen_ty_2 = 32; +pub const AKEYCODE_E: _bindgen_ty_2 = 33; +pub const AKEYCODE_F: _bindgen_ty_2 = 34; +pub const AKEYCODE_G: _bindgen_ty_2 = 35; +pub const AKEYCODE_H: _bindgen_ty_2 = 36; +pub const AKEYCODE_I: _bindgen_ty_2 = 37; +pub const AKEYCODE_J: _bindgen_ty_2 = 38; +pub const AKEYCODE_K: _bindgen_ty_2 = 39; +pub const AKEYCODE_L: _bindgen_ty_2 = 40; +pub const AKEYCODE_M: _bindgen_ty_2 = 41; +pub const AKEYCODE_N: _bindgen_ty_2 = 42; +pub const AKEYCODE_O: _bindgen_ty_2 = 43; +pub const AKEYCODE_P: _bindgen_ty_2 = 44; +pub const AKEYCODE_Q: _bindgen_ty_2 = 45; +pub const AKEYCODE_R: _bindgen_ty_2 = 46; +pub const AKEYCODE_S: _bindgen_ty_2 = 47; +pub const AKEYCODE_T: _bindgen_ty_2 = 48; +pub const AKEYCODE_U: _bindgen_ty_2 = 49; +pub const AKEYCODE_V: _bindgen_ty_2 = 50; +pub const AKEYCODE_W: _bindgen_ty_2 = 51; +pub const AKEYCODE_X: _bindgen_ty_2 = 52; +pub const AKEYCODE_Y: _bindgen_ty_2 = 53; +pub const AKEYCODE_Z: _bindgen_ty_2 = 54; +pub const AKEYCODE_COMMA: _bindgen_ty_2 = 55; +pub const AKEYCODE_PERIOD: _bindgen_ty_2 = 56; +pub const AKEYCODE_ALT_LEFT: _bindgen_ty_2 = 57; +pub const AKEYCODE_ALT_RIGHT: _bindgen_ty_2 = 58; +pub const AKEYCODE_SHIFT_LEFT: _bindgen_ty_2 = 59; +pub const AKEYCODE_SHIFT_RIGHT: _bindgen_ty_2 = 60; +pub const AKEYCODE_TAB: _bindgen_ty_2 = 61; +pub const AKEYCODE_SPACE: _bindgen_ty_2 = 62; +pub const AKEYCODE_SYM: _bindgen_ty_2 = 63; +pub const AKEYCODE_EXPLORER: _bindgen_ty_2 = 64; +pub const AKEYCODE_ENVELOPE: _bindgen_ty_2 = 65; +pub const AKEYCODE_ENTER: _bindgen_ty_2 = 66; +pub const AKEYCODE_DEL: _bindgen_ty_2 = 67; +pub const AKEYCODE_GRAVE: _bindgen_ty_2 = 68; +pub const AKEYCODE_MINUS: _bindgen_ty_2 = 69; +pub const AKEYCODE_EQUALS: _bindgen_ty_2 = 70; +pub const AKEYCODE_LEFT_BRACKET: _bindgen_ty_2 = 71; +pub const AKEYCODE_RIGHT_BRACKET: _bindgen_ty_2 = 72; +pub const AKEYCODE_BACKSLASH: _bindgen_ty_2 = 73; +pub const AKEYCODE_SEMICOLON: _bindgen_ty_2 = 74; +pub const AKEYCODE_APOSTROPHE: _bindgen_ty_2 = 75; +pub const AKEYCODE_SLASH: _bindgen_ty_2 = 76; +pub const AKEYCODE_AT: _bindgen_ty_2 = 77; +pub const AKEYCODE_NUM: _bindgen_ty_2 = 78; +pub const AKEYCODE_HEADSETHOOK: _bindgen_ty_2 = 79; +pub const AKEYCODE_FOCUS: _bindgen_ty_2 = 80; +pub const AKEYCODE_PLUS: _bindgen_ty_2 = 81; +pub const AKEYCODE_MENU: _bindgen_ty_2 = 82; +pub const AKEYCODE_NOTIFICATION: _bindgen_ty_2 = 83; +pub const AKEYCODE_SEARCH: _bindgen_ty_2 = 84; +pub const AKEYCODE_MEDIA_PLAY_PAUSE: _bindgen_ty_2 = 85; +pub const AKEYCODE_MEDIA_STOP: _bindgen_ty_2 = 86; +pub const AKEYCODE_MEDIA_NEXT: _bindgen_ty_2 = 87; +pub const AKEYCODE_MEDIA_PREVIOUS: _bindgen_ty_2 = 88; +pub const AKEYCODE_MEDIA_REWIND: _bindgen_ty_2 = 89; +pub const AKEYCODE_MEDIA_FAST_FORWARD: _bindgen_ty_2 = 90; +pub const AKEYCODE_MUTE: _bindgen_ty_2 = 91; +pub const AKEYCODE_PAGE_UP: _bindgen_ty_2 = 92; +pub const AKEYCODE_PAGE_DOWN: _bindgen_ty_2 = 93; +pub const AKEYCODE_PICTSYMBOLS: _bindgen_ty_2 = 94; +pub const AKEYCODE_SWITCH_CHARSET: _bindgen_ty_2 = 95; +pub const AKEYCODE_BUTTON_A: _bindgen_ty_2 = 96; +pub const AKEYCODE_BUTTON_B: _bindgen_ty_2 = 97; +pub const AKEYCODE_BUTTON_C: _bindgen_ty_2 = 98; +pub const AKEYCODE_BUTTON_X: _bindgen_ty_2 = 99; +pub const AKEYCODE_BUTTON_Y: _bindgen_ty_2 = 100; +pub const AKEYCODE_BUTTON_Z: _bindgen_ty_2 = 101; +pub const AKEYCODE_BUTTON_L1: _bindgen_ty_2 = 102; +pub const AKEYCODE_BUTTON_R1: _bindgen_ty_2 = 103; +pub const AKEYCODE_BUTTON_L2: _bindgen_ty_2 = 104; +pub const AKEYCODE_BUTTON_R2: _bindgen_ty_2 = 105; +pub const AKEYCODE_BUTTON_THUMBL: _bindgen_ty_2 = 106; +pub const AKEYCODE_BUTTON_THUMBR: _bindgen_ty_2 = 107; +pub const AKEYCODE_BUTTON_START: _bindgen_ty_2 = 108; +pub const AKEYCODE_BUTTON_SELECT: _bindgen_ty_2 = 109; +pub const AKEYCODE_BUTTON_MODE: _bindgen_ty_2 = 110; +pub const AKEYCODE_ESCAPE: _bindgen_ty_2 = 111; +pub const AKEYCODE_FORWARD_DEL: _bindgen_ty_2 = 112; +pub const AKEYCODE_CTRL_LEFT: _bindgen_ty_2 = 113; +pub const AKEYCODE_CTRL_RIGHT: _bindgen_ty_2 = 114; +pub const AKEYCODE_CAPS_LOCK: _bindgen_ty_2 = 115; +pub const AKEYCODE_SCROLL_LOCK: _bindgen_ty_2 = 116; +pub const AKEYCODE_META_LEFT: _bindgen_ty_2 = 117; +pub const AKEYCODE_META_RIGHT: _bindgen_ty_2 = 118; +pub const AKEYCODE_FUNCTION: _bindgen_ty_2 = 119; +pub const AKEYCODE_SYSRQ: _bindgen_ty_2 = 120; +pub const AKEYCODE_BREAK: _bindgen_ty_2 = 121; +pub const AKEYCODE_MOVE_HOME: _bindgen_ty_2 = 122; +pub const AKEYCODE_MOVE_END: _bindgen_ty_2 = 123; +pub const AKEYCODE_INSERT: _bindgen_ty_2 = 124; +pub const AKEYCODE_FORWARD: _bindgen_ty_2 = 125; +pub const AKEYCODE_MEDIA_PLAY: _bindgen_ty_2 = 126; +pub const AKEYCODE_MEDIA_PAUSE: _bindgen_ty_2 = 127; +pub const AKEYCODE_MEDIA_CLOSE: _bindgen_ty_2 = 128; +pub const AKEYCODE_MEDIA_EJECT: _bindgen_ty_2 = 129; +pub const AKEYCODE_MEDIA_RECORD: _bindgen_ty_2 = 130; +pub const AKEYCODE_F1: _bindgen_ty_2 = 131; +pub const AKEYCODE_F2: _bindgen_ty_2 = 132; +pub const AKEYCODE_F3: _bindgen_ty_2 = 133; +pub const AKEYCODE_F4: _bindgen_ty_2 = 134; +pub const AKEYCODE_F5: _bindgen_ty_2 = 135; +pub const AKEYCODE_F6: _bindgen_ty_2 = 136; +pub const AKEYCODE_F7: _bindgen_ty_2 = 137; +pub const AKEYCODE_F8: _bindgen_ty_2 = 138; +pub const AKEYCODE_F9: _bindgen_ty_2 = 139; +pub const AKEYCODE_F10: _bindgen_ty_2 = 140; +pub const AKEYCODE_F11: _bindgen_ty_2 = 141; +pub const AKEYCODE_F12: _bindgen_ty_2 = 142; +pub const AKEYCODE_NUM_LOCK: _bindgen_ty_2 = 143; +pub const AKEYCODE_NUMPAD_0: _bindgen_ty_2 = 144; +pub const AKEYCODE_NUMPAD_1: _bindgen_ty_2 = 145; +pub const AKEYCODE_NUMPAD_2: _bindgen_ty_2 = 146; +pub const AKEYCODE_NUMPAD_3: _bindgen_ty_2 = 147; +pub const AKEYCODE_NUMPAD_4: _bindgen_ty_2 = 148; +pub const AKEYCODE_NUMPAD_5: _bindgen_ty_2 = 149; +pub const AKEYCODE_NUMPAD_6: _bindgen_ty_2 = 150; +pub const AKEYCODE_NUMPAD_7: _bindgen_ty_2 = 151; +pub const AKEYCODE_NUMPAD_8: _bindgen_ty_2 = 152; +pub const AKEYCODE_NUMPAD_9: _bindgen_ty_2 = 153; +pub const AKEYCODE_NUMPAD_DIVIDE: _bindgen_ty_2 = 154; +pub const AKEYCODE_NUMPAD_MULTIPLY: _bindgen_ty_2 = 155; +pub const AKEYCODE_NUMPAD_SUBTRACT: _bindgen_ty_2 = 156; +pub const AKEYCODE_NUMPAD_ADD: _bindgen_ty_2 = 157; +pub const AKEYCODE_NUMPAD_DOT: _bindgen_ty_2 = 158; +pub const AKEYCODE_NUMPAD_COMMA: _bindgen_ty_2 = 159; +pub const AKEYCODE_NUMPAD_ENTER: _bindgen_ty_2 = 160; +pub const AKEYCODE_NUMPAD_EQUALS: _bindgen_ty_2 = 161; +pub const AKEYCODE_NUMPAD_LEFT_PAREN: _bindgen_ty_2 = 162; +pub const AKEYCODE_NUMPAD_RIGHT_PAREN: _bindgen_ty_2 = 163; +pub const AKEYCODE_VOLUME_MUTE: _bindgen_ty_2 = 164; +pub const AKEYCODE_INFO: _bindgen_ty_2 = 165; +pub const AKEYCODE_CHANNEL_UP: _bindgen_ty_2 = 166; +pub const AKEYCODE_CHANNEL_DOWN: _bindgen_ty_2 = 167; +pub const AKEYCODE_ZOOM_IN: _bindgen_ty_2 = 168; +pub const AKEYCODE_ZOOM_OUT: _bindgen_ty_2 = 169; +pub const AKEYCODE_TV: _bindgen_ty_2 = 170; +pub const AKEYCODE_WINDOW: _bindgen_ty_2 = 171; +pub const AKEYCODE_GUIDE: _bindgen_ty_2 = 172; +pub const AKEYCODE_DVR: _bindgen_ty_2 = 173; +pub const AKEYCODE_BOOKMARK: _bindgen_ty_2 = 174; +pub const AKEYCODE_CAPTIONS: _bindgen_ty_2 = 175; +pub const AKEYCODE_SETTINGS: _bindgen_ty_2 = 176; +pub const AKEYCODE_TV_POWER: _bindgen_ty_2 = 177; +pub const AKEYCODE_TV_INPUT: _bindgen_ty_2 = 178; +pub const AKEYCODE_STB_POWER: _bindgen_ty_2 = 179; +pub const AKEYCODE_STB_INPUT: _bindgen_ty_2 = 180; +pub const AKEYCODE_AVR_POWER: _bindgen_ty_2 = 181; +pub const AKEYCODE_AVR_INPUT: _bindgen_ty_2 = 182; +pub const AKEYCODE_PROG_RED: _bindgen_ty_2 = 183; +pub const AKEYCODE_PROG_GREEN: _bindgen_ty_2 = 184; +pub const AKEYCODE_PROG_YELLOW: _bindgen_ty_2 = 185; +pub const AKEYCODE_PROG_BLUE: _bindgen_ty_2 = 186; +pub const AKEYCODE_APP_SWITCH: _bindgen_ty_2 = 187; +pub const AKEYCODE_BUTTON_1: _bindgen_ty_2 = 188; +pub const AKEYCODE_BUTTON_2: _bindgen_ty_2 = 189; +pub const AKEYCODE_BUTTON_3: _bindgen_ty_2 = 190; +pub const AKEYCODE_BUTTON_4: _bindgen_ty_2 = 191; +pub const AKEYCODE_BUTTON_5: _bindgen_ty_2 = 192; +pub const AKEYCODE_BUTTON_6: _bindgen_ty_2 = 193; +pub const AKEYCODE_BUTTON_7: _bindgen_ty_2 = 194; +pub const AKEYCODE_BUTTON_8: _bindgen_ty_2 = 195; +pub const AKEYCODE_BUTTON_9: _bindgen_ty_2 = 196; +pub const AKEYCODE_BUTTON_10: _bindgen_ty_2 = 197; +pub const AKEYCODE_BUTTON_11: _bindgen_ty_2 = 198; +pub const AKEYCODE_BUTTON_12: _bindgen_ty_2 = 199; +pub const AKEYCODE_BUTTON_13: _bindgen_ty_2 = 200; +pub const AKEYCODE_BUTTON_14: _bindgen_ty_2 = 201; +pub const AKEYCODE_BUTTON_15: _bindgen_ty_2 = 202; +pub const AKEYCODE_BUTTON_16: _bindgen_ty_2 = 203; +pub const AKEYCODE_LANGUAGE_SWITCH: _bindgen_ty_2 = 204; +pub const AKEYCODE_MANNER_MODE: _bindgen_ty_2 = 205; +pub const AKEYCODE_3D_MODE: _bindgen_ty_2 = 206; +pub const AKEYCODE_CONTACTS: _bindgen_ty_2 = 207; +pub const AKEYCODE_CALENDAR: _bindgen_ty_2 = 208; +pub const AKEYCODE_MUSIC: _bindgen_ty_2 = 209; +pub const AKEYCODE_CALCULATOR: _bindgen_ty_2 = 210; +pub const AKEYCODE_ZENKAKU_HANKAKU: _bindgen_ty_2 = 211; +pub const AKEYCODE_EISU: _bindgen_ty_2 = 212; +pub const AKEYCODE_MUHENKAN: _bindgen_ty_2 = 213; +pub const AKEYCODE_HENKAN: _bindgen_ty_2 = 214; +pub const AKEYCODE_KATAKANA_HIRAGANA: _bindgen_ty_2 = 215; +pub const AKEYCODE_YEN: _bindgen_ty_2 = 216; +pub const AKEYCODE_RO: _bindgen_ty_2 = 217; +pub const AKEYCODE_KANA: _bindgen_ty_2 = 218; +pub const AKEYCODE_ASSIST: _bindgen_ty_2 = 219; +pub const AKEYCODE_BRIGHTNESS_DOWN: _bindgen_ty_2 = 220; +pub const AKEYCODE_BRIGHTNESS_UP: _bindgen_ty_2 = 221; +pub const AKEYCODE_MEDIA_AUDIO_TRACK: _bindgen_ty_2 = 222; +pub const AKEYCODE_SLEEP: _bindgen_ty_2 = 223; +pub const AKEYCODE_WAKEUP: _bindgen_ty_2 = 224; +pub const AKEYCODE_PAIRING: _bindgen_ty_2 = 225; +pub const AKEYCODE_MEDIA_TOP_MENU: _bindgen_ty_2 = 226; +pub const AKEYCODE_11: _bindgen_ty_2 = 227; +pub const AKEYCODE_12: _bindgen_ty_2 = 228; +pub const AKEYCODE_LAST_CHANNEL: _bindgen_ty_2 = 229; +pub const AKEYCODE_TV_DATA_SERVICE: _bindgen_ty_2 = 230; +pub const AKEYCODE_VOICE_ASSIST: _bindgen_ty_2 = 231; +pub const AKEYCODE_TV_RADIO_SERVICE: _bindgen_ty_2 = 232; +pub const AKEYCODE_TV_TELETEXT: _bindgen_ty_2 = 233; +pub const AKEYCODE_TV_NUMBER_ENTRY: _bindgen_ty_2 = 234; +pub const AKEYCODE_TV_TERRESTRIAL_ANALOG: _bindgen_ty_2 = 235; +pub const AKEYCODE_TV_TERRESTRIAL_DIGITAL: _bindgen_ty_2 = 236; +pub const AKEYCODE_TV_SATELLITE: _bindgen_ty_2 = 237; +pub const AKEYCODE_TV_SATELLITE_BS: _bindgen_ty_2 = 238; +pub const AKEYCODE_TV_SATELLITE_CS: _bindgen_ty_2 = 239; +pub const AKEYCODE_TV_SATELLITE_SERVICE: _bindgen_ty_2 = 240; +pub const AKEYCODE_TV_NETWORK: _bindgen_ty_2 = 241; +pub const AKEYCODE_TV_ANTENNA_CABLE: _bindgen_ty_2 = 242; +pub const AKEYCODE_TV_INPUT_HDMI_1: _bindgen_ty_2 = 243; +pub const AKEYCODE_TV_INPUT_HDMI_2: _bindgen_ty_2 = 244; +pub const AKEYCODE_TV_INPUT_HDMI_3: _bindgen_ty_2 = 245; +pub const AKEYCODE_TV_INPUT_HDMI_4: _bindgen_ty_2 = 246; +pub const AKEYCODE_TV_INPUT_COMPOSITE_1: _bindgen_ty_2 = 247; +pub const AKEYCODE_TV_INPUT_COMPOSITE_2: _bindgen_ty_2 = 248; +pub const AKEYCODE_TV_INPUT_COMPONENT_1: _bindgen_ty_2 = 249; +pub const AKEYCODE_TV_INPUT_COMPONENT_2: _bindgen_ty_2 = 250; +pub const AKEYCODE_TV_INPUT_VGA_1: _bindgen_ty_2 = 251; +pub const AKEYCODE_TV_AUDIO_DESCRIPTION: _bindgen_ty_2 = 252; +pub const AKEYCODE_TV_AUDIO_DESCRIPTION_MIX_UP: _bindgen_ty_2 = 253; +pub const AKEYCODE_TV_AUDIO_DESCRIPTION_MIX_DOWN: _bindgen_ty_2 = 254; +pub const AKEYCODE_TV_ZOOM_MODE: _bindgen_ty_2 = 255; +pub const AKEYCODE_TV_CONTENTS_MENU: _bindgen_ty_2 = 256; +pub const AKEYCODE_TV_MEDIA_CONTEXT_MENU: _bindgen_ty_2 = 257; +pub const AKEYCODE_TV_TIMER_PROGRAMMING: _bindgen_ty_2 = 258; +pub const AKEYCODE_HELP: _bindgen_ty_2 = 259; +pub const AKEYCODE_NAVIGATE_PREVIOUS: _bindgen_ty_2 = 260; +pub const AKEYCODE_NAVIGATE_NEXT: _bindgen_ty_2 = 261; +pub const AKEYCODE_NAVIGATE_IN: _bindgen_ty_2 = 262; +pub const AKEYCODE_NAVIGATE_OUT: _bindgen_ty_2 = 263; +pub const AKEYCODE_STEM_PRIMARY: _bindgen_ty_2 = 264; +pub const AKEYCODE_STEM_1: _bindgen_ty_2 = 265; +pub const AKEYCODE_STEM_2: _bindgen_ty_2 = 266; +pub const AKEYCODE_STEM_3: _bindgen_ty_2 = 267; +pub const AKEYCODE_DPAD_UP_LEFT: _bindgen_ty_2 = 268; +pub const AKEYCODE_DPAD_DOWN_LEFT: _bindgen_ty_2 = 269; +pub const AKEYCODE_DPAD_UP_RIGHT: _bindgen_ty_2 = 270; +pub const AKEYCODE_DPAD_DOWN_RIGHT: _bindgen_ty_2 = 271; +pub const AKEYCODE_MEDIA_SKIP_FORWARD: _bindgen_ty_2 = 272; +pub const AKEYCODE_MEDIA_SKIP_BACKWARD: _bindgen_ty_2 = 273; +pub const AKEYCODE_MEDIA_STEP_FORWARD: _bindgen_ty_2 = 274; +pub const AKEYCODE_MEDIA_STEP_BACKWARD: _bindgen_ty_2 = 275; +pub const AKEYCODE_SOFT_SLEEP: _bindgen_ty_2 = 276; +pub const AKEYCODE_CUT: _bindgen_ty_2 = 277; +pub const AKEYCODE_COPY: _bindgen_ty_2 = 278; +pub const AKEYCODE_PASTE: _bindgen_ty_2 = 279; +pub const AKEYCODE_SYSTEM_NAVIGATION_UP: _bindgen_ty_2 = 280; +pub const AKEYCODE_SYSTEM_NAVIGATION_DOWN: _bindgen_ty_2 = 281; +pub const AKEYCODE_SYSTEM_NAVIGATION_LEFT: _bindgen_ty_2 = 282; +pub const AKEYCODE_SYSTEM_NAVIGATION_RIGHT: _bindgen_ty_2 = 283; +pub const AKEYCODE_ALL_APPS: _bindgen_ty_2 = 284; +pub const AKEYCODE_REFRESH: _bindgen_ty_2 = 285; +pub const AKEYCODE_THUMBS_UP: _bindgen_ty_2 = 286; +pub const AKEYCODE_THUMBS_DOWN: _bindgen_ty_2 = 287; +pub const AKEYCODE_PROFILE_SWITCH: _bindgen_ty_2 = 288; pub type _bindgen_ty_2 = ::std::os::raw::c_uint; -pub const ALOOPER_PREPARE_ALLOW_NON_CALLBACKS: ::std::os::raw::c_uint = 1; +pub const ALOOPER_PREPARE_ALLOW_NON_CALLBACKS: _bindgen_ty_3 = 1; pub type _bindgen_ty_3 = ::std::os::raw::c_uint; -pub const ALOOPER_POLL_WAKE: ::std::os::raw::c_int = -1; -pub const ALOOPER_POLL_CALLBACK: ::std::os::raw::c_int = -2; -pub const ALOOPER_POLL_TIMEOUT: ::std::os::raw::c_int = -3; -pub const ALOOPER_POLL_ERROR: ::std::os::raw::c_int = -4; +pub const ALOOPER_POLL_WAKE: _bindgen_ty_4 = -1; +pub const ALOOPER_POLL_CALLBACK: _bindgen_ty_4 = -2; +pub const ALOOPER_POLL_TIMEOUT: _bindgen_ty_4 = -3; +pub const ALOOPER_POLL_ERROR: _bindgen_ty_4 = -4; pub type _bindgen_ty_4 = ::std::os::raw::c_int; -pub const ALOOPER_EVENT_INPUT: ::std::os::raw::c_uint = 1; -pub const ALOOPER_EVENT_OUTPUT: ::std::os::raw::c_uint = 2; -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 const ALOOPER_EVENT_INPUT: _bindgen_ty_5 = 1; +pub const ALOOPER_EVENT_OUTPUT: _bindgen_ty_5 = 2; +pub const ALOOPER_EVENT_ERROR: _bindgen_ty_5 = 4; +pub const ALOOPER_EVENT_HANGUP: _bindgen_ty_5 = 8; +pub const ALOOPER_EVENT_INVALID: _bindgen_ty_5 = 16; pub type _bindgen_ty_5 = ::std::os::raw::c_uint; -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; -pub const AKEY_STATE_VIRTUAL: ::std::os::raw::c_int = 2; +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() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + 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::addr_of!((*ptr).version) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(JavaVMAttachArgs), + "::", + stringify!(version) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(JavaVMAttachArgs), + "::", + stringify!(name) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).group) as usize - ptr 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() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + 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::addr_of!((*ptr).optionString) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(JavaVMOption), + "::", + stringify!(optionString) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).extraInfo) as usize - ptr 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() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + 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::addr_of!((*ptr).version) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(JavaVMInitArgs), + "::", + stringify!(version) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).nOptions) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(JavaVMInitArgs), + "::", + stringify!(nOptions) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).options) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(JavaVMInitArgs), + "::", + stringify!(options) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ignoreUnrecognized) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(JavaVMInitArgs), + "::", + stringify!(ignoreUnrecognized) + ) + ); +} +pub const AKEY_STATE_UNKNOWN: _bindgen_ty_6 = -1; +pub const AKEY_STATE_UP: _bindgen_ty_6 = 0; +pub const AKEY_STATE_DOWN: _bindgen_ty_6 = 1; +pub const AKEY_STATE_VIRTUAL: _bindgen_ty_6 = 2; pub type _bindgen_ty_6 = ::std::os::raw::c_int; -pub const AMETA_NONE: ::std::os::raw::c_uint = 0; -pub const AMETA_ALT_ON: ::std::os::raw::c_uint = 2; -pub const AMETA_ALT_LEFT_ON: ::std::os::raw::c_uint = 16; -pub const AMETA_ALT_RIGHT_ON: ::std::os::raw::c_uint = 32; -pub const AMETA_SHIFT_ON: ::std::os::raw::c_uint = 1; -pub const AMETA_SHIFT_LEFT_ON: ::std::os::raw::c_uint = 64; -pub const AMETA_SHIFT_RIGHT_ON: ::std::os::raw::c_uint = 128; -pub const AMETA_SYM_ON: ::std::os::raw::c_uint = 4; -pub const AMETA_FUNCTION_ON: ::std::os::raw::c_uint = 8; -pub const AMETA_CTRL_ON: ::std::os::raw::c_uint = 4096; -pub const AMETA_CTRL_LEFT_ON: ::std::os::raw::c_uint = 8192; -pub const AMETA_CTRL_RIGHT_ON: ::std::os::raw::c_uint = 16384; -pub const AMETA_META_ON: ::std::os::raw::c_uint = 65536; -pub const AMETA_META_LEFT_ON: ::std::os::raw::c_uint = 131072; -pub const AMETA_META_RIGHT_ON: ::std::os::raw::c_uint = 262144; -pub const AMETA_CAPS_LOCK_ON: ::std::os::raw::c_uint = 1048576; -pub const AMETA_NUM_LOCK_ON: ::std::os::raw::c_uint = 2097152; -pub const AMETA_SCROLL_LOCK_ON: ::std::os::raw::c_uint = 4194304; +pub const AMETA_NONE: _bindgen_ty_7 = 0; +pub const AMETA_ALT_ON: _bindgen_ty_7 = 2; +pub const AMETA_ALT_LEFT_ON: _bindgen_ty_7 = 16; +pub const AMETA_ALT_RIGHT_ON: _bindgen_ty_7 = 32; +pub const AMETA_SHIFT_ON: _bindgen_ty_7 = 1; +pub const AMETA_SHIFT_LEFT_ON: _bindgen_ty_7 = 64; +pub const AMETA_SHIFT_RIGHT_ON: _bindgen_ty_7 = 128; +pub const AMETA_SYM_ON: _bindgen_ty_7 = 4; +pub const AMETA_FUNCTION_ON: _bindgen_ty_7 = 8; +pub const AMETA_CTRL_ON: _bindgen_ty_7 = 4096; +pub const AMETA_CTRL_LEFT_ON: _bindgen_ty_7 = 8192; +pub const AMETA_CTRL_RIGHT_ON: _bindgen_ty_7 = 16384; +pub const AMETA_META_ON: _bindgen_ty_7 = 65536; +pub const AMETA_META_LEFT_ON: _bindgen_ty_7 = 131072; +pub const AMETA_META_RIGHT_ON: _bindgen_ty_7 = 262144; +pub const AMETA_CAPS_LOCK_ON: _bindgen_ty_7 = 1048576; +pub const AMETA_NUM_LOCK_ON: _bindgen_ty_7 = 2097152; +pub const AMETA_SCROLL_LOCK_ON: _bindgen_ty_7 = 4194304; pub type _bindgen_ty_7 = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct AInputEvent { _unused: [u8; 0], } -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_KEY: _bindgen_ty_8 = 1; +pub const AINPUT_EVENT_TYPE_MOTION: _bindgen_ty_8 = 2; +pub const AINPUT_EVENT_TYPE_FOCUS: _bindgen_ty_8 = 3; +pub const AINPUT_EVENT_TYPE_CAPTURE: _bindgen_ty_8 = 4; +pub const AINPUT_EVENT_TYPE_DRAG: _bindgen_ty_8 = 5; +pub const AINPUT_EVENT_TYPE_TOUCH_MODE: _bindgen_ty_8 = 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; -pub const AKEY_EVENT_ACTION_MULTIPLE: ::std::os::raw::c_uint = 2; +pub const AKEY_EVENT_ACTION_DOWN: _bindgen_ty_9 = 0; +pub const AKEY_EVENT_ACTION_UP: _bindgen_ty_9 = 1; +pub const AKEY_EVENT_ACTION_MULTIPLE: _bindgen_ty_9 = 2; pub type _bindgen_ty_9 = ::std::os::raw::c_uint; -pub const AKEY_EVENT_FLAG_WOKE_HERE: ::std::os::raw::c_uint = 1; -pub const AKEY_EVENT_FLAG_SOFT_KEYBOARD: ::std::os::raw::c_uint = 2; -pub const AKEY_EVENT_FLAG_KEEP_TOUCH_MODE: ::std::os::raw::c_uint = 4; -pub const AKEY_EVENT_FLAG_FROM_SYSTEM: ::std::os::raw::c_uint = 8; -pub const AKEY_EVENT_FLAG_EDITOR_ACTION: ::std::os::raw::c_uint = 16; -pub const AKEY_EVENT_FLAG_CANCELED: ::std::os::raw::c_uint = 32; -pub const AKEY_EVENT_FLAG_VIRTUAL_HARD_KEY: ::std::os::raw::c_uint = 64; -pub const AKEY_EVENT_FLAG_LONG_PRESS: ::std::os::raw::c_uint = 128; -pub const AKEY_EVENT_FLAG_CANCELED_LONG_PRESS: ::std::os::raw::c_uint = 256; -pub const AKEY_EVENT_FLAG_TRACKING: ::std::os::raw::c_uint = 512; -pub const AKEY_EVENT_FLAG_FALLBACK: ::std::os::raw::c_uint = 1024; +pub const AKEY_EVENT_FLAG_WOKE_HERE: _bindgen_ty_10 = 1; +pub const AKEY_EVENT_FLAG_SOFT_KEYBOARD: _bindgen_ty_10 = 2; +pub const AKEY_EVENT_FLAG_KEEP_TOUCH_MODE: _bindgen_ty_10 = 4; +pub const AKEY_EVENT_FLAG_FROM_SYSTEM: _bindgen_ty_10 = 8; +pub const AKEY_EVENT_FLAG_EDITOR_ACTION: _bindgen_ty_10 = 16; +pub const AKEY_EVENT_FLAG_CANCELED: _bindgen_ty_10 = 32; +pub const AKEY_EVENT_FLAG_VIRTUAL_HARD_KEY: _bindgen_ty_10 = 64; +pub const AKEY_EVENT_FLAG_LONG_PRESS: _bindgen_ty_10 = 128; +pub const AKEY_EVENT_FLAG_CANCELED_LONG_PRESS: _bindgen_ty_10 = 256; +pub const AKEY_EVENT_FLAG_TRACKING: _bindgen_ty_10 = 512; +pub const AKEY_EVENT_FLAG_FALLBACK: _bindgen_ty_10 = 1024; pub type _bindgen_ty_10 = ::std::os::raw::c_uint; -pub const AMOTION_EVENT_ACTION_MASK: ::std::os::raw::c_uint = 255; -pub const AMOTION_EVENT_ACTION_POINTER_INDEX_MASK: ::std::os::raw::c_uint = 65280; -pub const AMOTION_EVENT_ACTION_DOWN: ::std::os::raw::c_uint = 0; -pub const AMOTION_EVENT_ACTION_UP: ::std::os::raw::c_uint = 1; -pub const AMOTION_EVENT_ACTION_MOVE: ::std::os::raw::c_uint = 2; -pub const AMOTION_EVENT_ACTION_CANCEL: ::std::os::raw::c_uint = 3; -pub const AMOTION_EVENT_ACTION_OUTSIDE: ::std::os::raw::c_uint = 4; -pub const AMOTION_EVENT_ACTION_POINTER_DOWN: ::std::os::raw::c_uint = 5; -pub const AMOTION_EVENT_ACTION_POINTER_UP: ::std::os::raw::c_uint = 6; -pub const AMOTION_EVENT_ACTION_HOVER_MOVE: ::std::os::raw::c_uint = 7; -pub const AMOTION_EVENT_ACTION_SCROLL: ::std::os::raw::c_uint = 8; -pub const AMOTION_EVENT_ACTION_HOVER_ENTER: ::std::os::raw::c_uint = 9; -pub const AMOTION_EVENT_ACTION_HOVER_EXIT: ::std::os::raw::c_uint = 10; -pub const AMOTION_EVENT_ACTION_BUTTON_PRESS: ::std::os::raw::c_uint = 11; -pub const AMOTION_EVENT_ACTION_BUTTON_RELEASE: ::std::os::raw::c_uint = 12; +pub const AMOTION_EVENT_ACTION_MASK: _bindgen_ty_11 = 255; +pub const AMOTION_EVENT_ACTION_POINTER_INDEX_MASK: _bindgen_ty_11 = 65280; +pub const AMOTION_EVENT_ACTION_DOWN: _bindgen_ty_11 = 0; +pub const AMOTION_EVENT_ACTION_UP: _bindgen_ty_11 = 1; +pub const AMOTION_EVENT_ACTION_MOVE: _bindgen_ty_11 = 2; +pub const AMOTION_EVENT_ACTION_CANCEL: _bindgen_ty_11 = 3; +pub const AMOTION_EVENT_ACTION_OUTSIDE: _bindgen_ty_11 = 4; +pub const AMOTION_EVENT_ACTION_POINTER_DOWN: _bindgen_ty_11 = 5; +pub const AMOTION_EVENT_ACTION_POINTER_UP: _bindgen_ty_11 = 6; +pub const AMOTION_EVENT_ACTION_HOVER_MOVE: _bindgen_ty_11 = 7; +pub const AMOTION_EVENT_ACTION_SCROLL: _bindgen_ty_11 = 8; +pub const AMOTION_EVENT_ACTION_HOVER_ENTER: _bindgen_ty_11 = 9; +pub const AMOTION_EVENT_ACTION_HOVER_EXIT: _bindgen_ty_11 = 10; +pub const AMOTION_EVENT_ACTION_BUTTON_PRESS: _bindgen_ty_11 = 11; +pub const AMOTION_EVENT_ACTION_BUTTON_RELEASE: _bindgen_ty_11 = 12; pub type _bindgen_ty_11 = ::std::os::raw::c_uint; -pub const AMOTION_EVENT_FLAG_WINDOW_IS_OBSCURED: ::std::os::raw::c_uint = 1; +pub const AMOTION_EVENT_FLAG_WINDOW_IS_OBSCURED: _bindgen_ty_12 = 1; pub type _bindgen_ty_12 = ::std::os::raw::c_uint; -pub const AMOTION_EVENT_EDGE_FLAG_NONE: ::std::os::raw::c_uint = 0; -pub const AMOTION_EVENT_EDGE_FLAG_TOP: ::std::os::raw::c_uint = 1; -pub const AMOTION_EVENT_EDGE_FLAG_BOTTOM: ::std::os::raw::c_uint = 2; -pub const AMOTION_EVENT_EDGE_FLAG_LEFT: ::std::os::raw::c_uint = 4; -pub const AMOTION_EVENT_EDGE_FLAG_RIGHT: ::std::os::raw::c_uint = 8; +pub const AMOTION_EVENT_EDGE_FLAG_NONE: _bindgen_ty_13 = 0; +pub const AMOTION_EVENT_EDGE_FLAG_TOP: _bindgen_ty_13 = 1; +pub const AMOTION_EVENT_EDGE_FLAG_BOTTOM: _bindgen_ty_13 = 2; +pub const AMOTION_EVENT_EDGE_FLAG_LEFT: _bindgen_ty_13 = 4; +pub const AMOTION_EVENT_EDGE_FLAG_RIGHT: _bindgen_ty_13 = 8; pub type _bindgen_ty_13 = ::std::os::raw::c_uint; -pub const AMOTION_EVENT_AXIS_X: ::std::os::raw::c_uint = 0; -pub const AMOTION_EVENT_AXIS_Y: ::std::os::raw::c_uint = 1; -pub const AMOTION_EVENT_AXIS_PRESSURE: ::std::os::raw::c_uint = 2; -pub const AMOTION_EVENT_AXIS_SIZE: ::std::os::raw::c_uint = 3; -pub const AMOTION_EVENT_AXIS_TOUCH_MAJOR: ::std::os::raw::c_uint = 4; -pub const AMOTION_EVENT_AXIS_TOUCH_MINOR: ::std::os::raw::c_uint = 5; -pub const AMOTION_EVENT_AXIS_TOOL_MAJOR: ::std::os::raw::c_uint = 6; -pub const AMOTION_EVENT_AXIS_TOOL_MINOR: ::std::os::raw::c_uint = 7; -pub const AMOTION_EVENT_AXIS_ORIENTATION: ::std::os::raw::c_uint = 8; -pub const AMOTION_EVENT_AXIS_VSCROLL: ::std::os::raw::c_uint = 9; -pub const AMOTION_EVENT_AXIS_HSCROLL: ::std::os::raw::c_uint = 10; -pub const AMOTION_EVENT_AXIS_Z: ::std::os::raw::c_uint = 11; -pub const AMOTION_EVENT_AXIS_RX: ::std::os::raw::c_uint = 12; -pub const AMOTION_EVENT_AXIS_RY: ::std::os::raw::c_uint = 13; -pub const AMOTION_EVENT_AXIS_RZ: ::std::os::raw::c_uint = 14; -pub const AMOTION_EVENT_AXIS_HAT_X: ::std::os::raw::c_uint = 15; -pub const AMOTION_EVENT_AXIS_HAT_Y: ::std::os::raw::c_uint = 16; -pub const AMOTION_EVENT_AXIS_LTRIGGER: ::std::os::raw::c_uint = 17; -pub const AMOTION_EVENT_AXIS_RTRIGGER: ::std::os::raw::c_uint = 18; -pub const AMOTION_EVENT_AXIS_THROTTLE: ::std::os::raw::c_uint = 19; -pub const AMOTION_EVENT_AXIS_RUDDER: ::std::os::raw::c_uint = 20; -pub const AMOTION_EVENT_AXIS_WHEEL: ::std::os::raw::c_uint = 21; -pub const AMOTION_EVENT_AXIS_GAS: ::std::os::raw::c_uint = 22; -pub const AMOTION_EVENT_AXIS_BRAKE: ::std::os::raw::c_uint = 23; -pub const AMOTION_EVENT_AXIS_DISTANCE: ::std::os::raw::c_uint = 24; -pub const AMOTION_EVENT_AXIS_TILT: ::std::os::raw::c_uint = 25; -pub const AMOTION_EVENT_AXIS_SCROLL: ::std::os::raw::c_uint = 26; -pub const AMOTION_EVENT_AXIS_RELATIVE_X: ::std::os::raw::c_uint = 27; -pub const AMOTION_EVENT_AXIS_RELATIVE_Y: ::std::os::raw::c_uint = 28; -pub const AMOTION_EVENT_AXIS_GENERIC_1: ::std::os::raw::c_uint = 32; -pub const AMOTION_EVENT_AXIS_GENERIC_2: ::std::os::raw::c_uint = 33; -pub const AMOTION_EVENT_AXIS_GENERIC_3: ::std::os::raw::c_uint = 34; -pub const AMOTION_EVENT_AXIS_GENERIC_4: ::std::os::raw::c_uint = 35; -pub const AMOTION_EVENT_AXIS_GENERIC_5: ::std::os::raw::c_uint = 36; -pub const AMOTION_EVENT_AXIS_GENERIC_6: ::std::os::raw::c_uint = 37; -pub const AMOTION_EVENT_AXIS_GENERIC_7: ::std::os::raw::c_uint = 38; -pub const AMOTION_EVENT_AXIS_GENERIC_8: ::std::os::raw::c_uint = 39; -pub const AMOTION_EVENT_AXIS_GENERIC_9: ::std::os::raw::c_uint = 40; -pub const AMOTION_EVENT_AXIS_GENERIC_10: ::std::os::raw::c_uint = 41; -pub const AMOTION_EVENT_AXIS_GENERIC_11: ::std::os::raw::c_uint = 42; -pub const AMOTION_EVENT_AXIS_GENERIC_12: ::std::os::raw::c_uint = 43; -pub const AMOTION_EVENT_AXIS_GENERIC_13: ::std::os::raw::c_uint = 44; -pub const AMOTION_EVENT_AXIS_GENERIC_14: ::std::os::raw::c_uint = 45; -pub const AMOTION_EVENT_AXIS_GENERIC_15: ::std::os::raw::c_uint = 46; -pub const AMOTION_EVENT_AXIS_GENERIC_16: ::std::os::raw::c_uint = 47; +pub const AMOTION_EVENT_AXIS_X: _bindgen_ty_14 = 0; +pub const AMOTION_EVENT_AXIS_Y: _bindgen_ty_14 = 1; +pub const AMOTION_EVENT_AXIS_PRESSURE: _bindgen_ty_14 = 2; +pub const AMOTION_EVENT_AXIS_SIZE: _bindgen_ty_14 = 3; +pub const AMOTION_EVENT_AXIS_TOUCH_MAJOR: _bindgen_ty_14 = 4; +pub const AMOTION_EVENT_AXIS_TOUCH_MINOR: _bindgen_ty_14 = 5; +pub const AMOTION_EVENT_AXIS_TOOL_MAJOR: _bindgen_ty_14 = 6; +pub const AMOTION_EVENT_AXIS_TOOL_MINOR: _bindgen_ty_14 = 7; +pub const AMOTION_EVENT_AXIS_ORIENTATION: _bindgen_ty_14 = 8; +pub const AMOTION_EVENT_AXIS_VSCROLL: _bindgen_ty_14 = 9; +pub const AMOTION_EVENT_AXIS_HSCROLL: _bindgen_ty_14 = 10; +pub const AMOTION_EVENT_AXIS_Z: _bindgen_ty_14 = 11; +pub const AMOTION_EVENT_AXIS_RX: _bindgen_ty_14 = 12; +pub const AMOTION_EVENT_AXIS_RY: _bindgen_ty_14 = 13; +pub const AMOTION_EVENT_AXIS_RZ: _bindgen_ty_14 = 14; +pub const AMOTION_EVENT_AXIS_HAT_X: _bindgen_ty_14 = 15; +pub const AMOTION_EVENT_AXIS_HAT_Y: _bindgen_ty_14 = 16; +pub const AMOTION_EVENT_AXIS_LTRIGGER: _bindgen_ty_14 = 17; +pub const AMOTION_EVENT_AXIS_RTRIGGER: _bindgen_ty_14 = 18; +pub const AMOTION_EVENT_AXIS_THROTTLE: _bindgen_ty_14 = 19; +pub const AMOTION_EVENT_AXIS_RUDDER: _bindgen_ty_14 = 20; +pub const AMOTION_EVENT_AXIS_WHEEL: _bindgen_ty_14 = 21; +pub const AMOTION_EVENT_AXIS_GAS: _bindgen_ty_14 = 22; +pub const AMOTION_EVENT_AXIS_BRAKE: _bindgen_ty_14 = 23; +pub const AMOTION_EVENT_AXIS_DISTANCE: _bindgen_ty_14 = 24; +pub const AMOTION_EVENT_AXIS_TILT: _bindgen_ty_14 = 25; +pub const AMOTION_EVENT_AXIS_SCROLL: _bindgen_ty_14 = 26; +pub const AMOTION_EVENT_AXIS_RELATIVE_X: _bindgen_ty_14 = 27; +pub const AMOTION_EVENT_AXIS_RELATIVE_Y: _bindgen_ty_14 = 28; +pub const AMOTION_EVENT_AXIS_GENERIC_1: _bindgen_ty_14 = 32; +pub const AMOTION_EVENT_AXIS_GENERIC_2: _bindgen_ty_14 = 33; +pub const AMOTION_EVENT_AXIS_GENERIC_3: _bindgen_ty_14 = 34; +pub const AMOTION_EVENT_AXIS_GENERIC_4: _bindgen_ty_14 = 35; +pub const AMOTION_EVENT_AXIS_GENERIC_5: _bindgen_ty_14 = 36; +pub const AMOTION_EVENT_AXIS_GENERIC_6: _bindgen_ty_14 = 37; +pub const AMOTION_EVENT_AXIS_GENERIC_7: _bindgen_ty_14 = 38; +pub const AMOTION_EVENT_AXIS_GENERIC_8: _bindgen_ty_14 = 39; +pub const AMOTION_EVENT_AXIS_GENERIC_9: _bindgen_ty_14 = 40; +pub const AMOTION_EVENT_AXIS_GENERIC_10: _bindgen_ty_14 = 41; +pub const AMOTION_EVENT_AXIS_GENERIC_11: _bindgen_ty_14 = 42; +pub const AMOTION_EVENT_AXIS_GENERIC_12: _bindgen_ty_14 = 43; +pub const AMOTION_EVENT_AXIS_GENERIC_13: _bindgen_ty_14 = 44; +pub const AMOTION_EVENT_AXIS_GENERIC_14: _bindgen_ty_14 = 45; +pub const AMOTION_EVENT_AXIS_GENERIC_15: _bindgen_ty_14 = 46; +pub const AMOTION_EVENT_AXIS_GENERIC_16: _bindgen_ty_14 = 47; pub type _bindgen_ty_14 = ::std::os::raw::c_uint; -pub const AMOTION_EVENT_BUTTON_PRIMARY: ::std::os::raw::c_uint = 1; -pub const AMOTION_EVENT_BUTTON_SECONDARY: ::std::os::raw::c_uint = 2; -pub const AMOTION_EVENT_BUTTON_TERTIARY: ::std::os::raw::c_uint = 4; -pub const AMOTION_EVENT_BUTTON_BACK: ::std::os::raw::c_uint = 8; -pub const AMOTION_EVENT_BUTTON_FORWARD: ::std::os::raw::c_uint = 16; -pub const AMOTION_EVENT_BUTTON_STYLUS_PRIMARY: ::std::os::raw::c_uint = 32; -pub const AMOTION_EVENT_BUTTON_STYLUS_SECONDARY: ::std::os::raw::c_uint = 64; +pub const AMOTION_EVENT_BUTTON_PRIMARY: _bindgen_ty_15 = 1; +pub const AMOTION_EVENT_BUTTON_SECONDARY: _bindgen_ty_15 = 2; +pub const AMOTION_EVENT_BUTTON_TERTIARY: _bindgen_ty_15 = 4; +pub const AMOTION_EVENT_BUTTON_BACK: _bindgen_ty_15 = 8; +pub const AMOTION_EVENT_BUTTON_FORWARD: _bindgen_ty_15 = 16; +pub const AMOTION_EVENT_BUTTON_STYLUS_PRIMARY: _bindgen_ty_15 = 32; +pub const AMOTION_EVENT_BUTTON_STYLUS_SECONDARY: _bindgen_ty_15 = 64; pub type _bindgen_ty_15 = ::std::os::raw::c_uint; -pub const AMOTION_EVENT_TOOL_TYPE_UNKNOWN: ::std::os::raw::c_uint = 0; -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_UNKNOWN: _bindgen_ty_16 = 0; +pub const AMOTION_EVENT_TOOL_TYPE_FINGER: _bindgen_ty_16 = 1; +pub const AMOTION_EVENT_TOOL_TYPE_STYLUS: _bindgen_ty_16 = 2; +pub const AMOTION_EVENT_TOOL_TYPE_MOUSE: _bindgen_ty_16 = 3; +pub const AMOTION_EVENT_TOOL_TYPE_ERASER: _bindgen_ty_16 = 4; +pub const AMOTION_EVENT_TOOL_TYPE_PALM: _bindgen_ty_16 = 5; pub type _bindgen_ty_16 = ::std::os::raw::c_uint; -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; -pub const AINPUT_SOURCE_CLASS_POINTER: ::std::os::raw::c_uint = 2; -pub const AINPUT_SOURCE_CLASS_NAVIGATION: ::std::os::raw::c_uint = 4; -pub const AINPUT_SOURCE_CLASS_POSITION: ::std::os::raw::c_uint = 8; -pub const AINPUT_SOURCE_CLASS_JOYSTICK: ::std::os::raw::c_uint = 16; +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: _bindgen_ty_17 = 255; +pub const AINPUT_SOURCE_CLASS_NONE: _bindgen_ty_17 = 0; +pub const AINPUT_SOURCE_CLASS_BUTTON: _bindgen_ty_17 = 1; +pub const AINPUT_SOURCE_CLASS_POINTER: _bindgen_ty_17 = 2; +pub const AINPUT_SOURCE_CLASS_NAVIGATION: _bindgen_ty_17 = 4; +pub const AINPUT_SOURCE_CLASS_POSITION: _bindgen_ty_17 = 8; +pub const AINPUT_SOURCE_CLASS_JOYSTICK: _bindgen_ty_17 = 16; pub type _bindgen_ty_17 = ::std::os::raw::c_uint; -pub const AINPUT_SOURCE_UNKNOWN: ::std::os::raw::c_uint = 0; -pub const AINPUT_SOURCE_KEYBOARD: ::std::os::raw::c_uint = 257; -pub const AINPUT_SOURCE_DPAD: ::std::os::raw::c_uint = 513; -pub const AINPUT_SOURCE_GAMEPAD: ::std::os::raw::c_uint = 1025; -pub const AINPUT_SOURCE_TOUCHSCREEN: ::std::os::raw::c_uint = 4098; -pub const AINPUT_SOURCE_MOUSE: ::std::os::raw::c_uint = 8194; -pub const AINPUT_SOURCE_STYLUS: ::std::os::raw::c_uint = 16386; -pub const AINPUT_SOURCE_BLUETOOTH_STYLUS: ::std::os::raw::c_uint = 49154; -pub const AINPUT_SOURCE_TRACKBALL: ::std::os::raw::c_uint = 65540; -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_ROTARY_ENCODER: ::std::os::raw::c_uint = 4194304; -pub const AINPUT_SOURCE_ANY: ::std::os::raw::c_uint = 4294967040; +pub const AINPUT_SOURCE_UNKNOWN: _bindgen_ty_18 = 0; +pub const AINPUT_SOURCE_KEYBOARD: _bindgen_ty_18 = 257; +pub const AINPUT_SOURCE_DPAD: _bindgen_ty_18 = 513; +pub const AINPUT_SOURCE_GAMEPAD: _bindgen_ty_18 = 1025; +pub const AINPUT_SOURCE_TOUCHSCREEN: _bindgen_ty_18 = 4098; +pub const AINPUT_SOURCE_MOUSE: _bindgen_ty_18 = 8194; +pub const AINPUT_SOURCE_STYLUS: _bindgen_ty_18 = 16386; +pub const AINPUT_SOURCE_BLUETOOTH_STYLUS: _bindgen_ty_18 = 49154; +pub const AINPUT_SOURCE_TRACKBALL: _bindgen_ty_18 = 65540; +pub const AINPUT_SOURCE_MOUSE_RELATIVE: _bindgen_ty_18 = 131076; +pub const AINPUT_SOURCE_TOUCHPAD: _bindgen_ty_18 = 1048584; +pub const AINPUT_SOURCE_TOUCH_NAVIGATION: _bindgen_ty_18 = 2097152; +pub const AINPUT_SOURCE_JOYSTICK: _bindgen_ty_18 = 16777232; +pub const AINPUT_SOURCE_HDMI: _bindgen_ty_18 = 33554433; +pub const AINPUT_SOURCE_SENSOR: _bindgen_ty_18 = 67108864; +pub const AINPUT_SOURCE_ROTARY_ENCODER: _bindgen_ty_18 = 4194304; +pub const AINPUT_SOURCE_ANY: _bindgen_ty_18 = 4294967040; pub type _bindgen_ty_18 = ::std::os::raw::c_uint; -pub const AINPUT_KEYBOARD_TYPE_NONE: ::std::os::raw::c_uint = 0; -pub const AINPUT_KEYBOARD_TYPE_NON_ALPHABETIC: ::std::os::raw::c_uint = 1; -pub const AINPUT_KEYBOARD_TYPE_ALPHABETIC: ::std::os::raw::c_uint = 2; +pub const AINPUT_KEYBOARD_TYPE_NONE: _bindgen_ty_19 = 0; +pub const AINPUT_KEYBOARD_TYPE_NON_ALPHABETIC: _bindgen_ty_19 = 1; +pub const AINPUT_KEYBOARD_TYPE_ALPHABETIC: _bindgen_ty_19 = 2; pub type _bindgen_ty_19 = ::std::os::raw::c_uint; -pub const AINPUT_MOTION_RANGE_X: ::std::os::raw::c_uint = 0; -pub const AINPUT_MOTION_RANGE_Y: ::std::os::raw::c_uint = 1; -pub const AINPUT_MOTION_RANGE_PRESSURE: ::std::os::raw::c_uint = 2; -pub const AINPUT_MOTION_RANGE_SIZE: ::std::os::raw::c_uint = 3; -pub const AINPUT_MOTION_RANGE_TOUCH_MAJOR: ::std::os::raw::c_uint = 4; -pub const AINPUT_MOTION_RANGE_TOUCH_MINOR: ::std::os::raw::c_uint = 5; -pub const AINPUT_MOTION_RANGE_TOOL_MAJOR: ::std::os::raw::c_uint = 6; -pub const AINPUT_MOTION_RANGE_TOOL_MINOR: ::std::os::raw::c_uint = 7; -pub const AINPUT_MOTION_RANGE_ORIENTATION: ::std::os::raw::c_uint = 8; +pub const AINPUT_MOTION_RANGE_X: _bindgen_ty_20 = 0; +pub const AINPUT_MOTION_RANGE_Y: _bindgen_ty_20 = 1; +pub const AINPUT_MOTION_RANGE_PRESSURE: _bindgen_ty_20 = 2; +pub const AINPUT_MOTION_RANGE_SIZE: _bindgen_ty_20 = 3; +pub const AINPUT_MOTION_RANGE_TOUCH_MAJOR: _bindgen_ty_20 = 4; +pub const AINPUT_MOTION_RANGE_TOUCH_MINOR: _bindgen_ty_20 = 5; +pub const AINPUT_MOTION_RANGE_TOOL_MAJOR: _bindgen_ty_20 = 6; +pub const AINPUT_MOTION_RANGE_TOOL_MINOR: _bindgen_ty_20 = 7; +pub const AINPUT_MOTION_RANGE_ORIENTATION: _bindgen_ty_20 = 8; pub type _bindgen_ty_20 = ::std::os::raw::c_uint; extern "C" { pub fn AInputEvent_getType(event: *const AInputEvent) -> i32; @@ -1377,6 +1565,9 @@ 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; } @@ -1401,6 +1592,9 @@ 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; } @@ -1435,168 +1629,169 @@ extern "C" { pub fn AMotionEvent_getYPrecision(motion_event: *const AInputEvent) -> f32; } extern "C" { - pub fn AMotionEvent_getPointerCount(motion_event: *const AInputEvent) -> size_t; + pub fn AMotionEvent_getPointerCount(motion_event: *const AInputEvent) -> usize; } extern "C" { - pub fn AMotionEvent_getPointerId( - motion_event: *const AInputEvent, - pointer_index: size_t, - ) -> i32; + pub fn AMotionEvent_getPointerId(motion_event: *const AInputEvent, pointer_index: usize) + -> i32; } extern "C" { - pub fn AMotionEvent_getToolType(motion_event: *const AInputEvent, pointer_index: size_t) - -> i32; + pub fn AMotionEvent_getToolType(motion_event: *const AInputEvent, pointer_index: usize) -> i32; } extern "C" { - pub fn AMotionEvent_getRawX(motion_event: *const AInputEvent, pointer_index: size_t) -> f32; + pub fn AMotionEvent_getRawX(motion_event: *const AInputEvent, pointer_index: usize) -> f32; } extern "C" { - pub fn AMotionEvent_getRawY(motion_event: *const AInputEvent, pointer_index: size_t) -> f32; + pub fn AMotionEvent_getRawY(motion_event: *const AInputEvent, pointer_index: usize) -> f32; } extern "C" { - pub fn AMotionEvent_getX(motion_event: *const AInputEvent, pointer_index: size_t) -> f32; + pub fn AMotionEvent_getX(motion_event: *const AInputEvent, pointer_index: usize) -> f32; } extern "C" { - pub fn AMotionEvent_getY(motion_event: *const AInputEvent, pointer_index: size_t) -> f32; + pub fn AMotionEvent_getY(motion_event: *const AInputEvent, pointer_index: usize) -> f32; } extern "C" { - pub fn AMotionEvent_getPressure(motion_event: *const AInputEvent, pointer_index: size_t) - -> f32; + pub fn AMotionEvent_getPressure(motion_event: *const AInputEvent, pointer_index: usize) -> f32; } extern "C" { - pub fn AMotionEvent_getSize(motion_event: *const AInputEvent, pointer_index: size_t) -> f32; + pub fn AMotionEvent_getSize(motion_event: *const AInputEvent, pointer_index: usize) -> f32; } extern "C" { pub fn AMotionEvent_getTouchMajor( motion_event: *const AInputEvent, - pointer_index: size_t, + pointer_index: usize, ) -> f32; } extern "C" { pub fn AMotionEvent_getTouchMinor( motion_event: *const AInputEvent, - pointer_index: size_t, + pointer_index: usize, ) -> f32; } extern "C" { - pub fn AMotionEvent_getToolMajor( - motion_event: *const AInputEvent, - pointer_index: size_t, - ) -> f32; + pub fn AMotionEvent_getToolMajor(motion_event: *const AInputEvent, pointer_index: usize) + -> f32; } extern "C" { - pub fn AMotionEvent_getToolMinor( - motion_event: *const AInputEvent, - pointer_index: size_t, - ) -> f32; + pub fn AMotionEvent_getToolMinor(motion_event: *const AInputEvent, pointer_index: usize) + -> f32; } extern "C" { pub fn AMotionEvent_getOrientation( motion_event: *const AInputEvent, - pointer_index: size_t, + pointer_index: usize, ) -> f32; } extern "C" { pub fn AMotionEvent_getAxisValue( motion_event: *const AInputEvent, axis: i32, - pointer_index: size_t, + pointer_index: usize, ) -> f32; } extern "C" { - pub fn AMotionEvent_getHistorySize(motion_event: *const AInputEvent) -> size_t; + pub fn AMotionEvent_getHistorySize(motion_event: *const AInputEvent) -> usize; } extern "C" { pub fn AMotionEvent_getHistoricalEventTime( motion_event: *const AInputEvent, - history_index: size_t, + history_index: usize, ) -> i64; } extern "C" { pub fn AMotionEvent_getHistoricalRawX( motion_event: *const AInputEvent, - pointer_index: size_t, - history_index: size_t, + pointer_index: usize, + history_index: usize, ) -> f32; } extern "C" { pub fn AMotionEvent_getHistoricalRawY( motion_event: *const AInputEvent, - pointer_index: size_t, - history_index: size_t, + pointer_index: usize, + history_index: usize, ) -> f32; } extern "C" { pub fn AMotionEvent_getHistoricalX( motion_event: *const AInputEvent, - pointer_index: size_t, - history_index: size_t, + pointer_index: usize, + history_index: usize, ) -> f32; } extern "C" { pub fn AMotionEvent_getHistoricalY( motion_event: *const AInputEvent, - pointer_index: size_t, - history_index: size_t, + pointer_index: usize, + history_index: usize, ) -> f32; } extern "C" { pub fn AMotionEvent_getHistoricalPressure( motion_event: *const AInputEvent, - pointer_index: size_t, - history_index: size_t, + pointer_index: usize, + history_index: usize, ) -> f32; } extern "C" { pub fn AMotionEvent_getHistoricalSize( motion_event: *const AInputEvent, - pointer_index: size_t, - history_index: size_t, + pointer_index: usize, + history_index: usize, ) -> f32; } extern "C" { pub fn AMotionEvent_getHistoricalTouchMajor( motion_event: *const AInputEvent, - pointer_index: size_t, - history_index: size_t, + pointer_index: usize, + history_index: usize, ) -> f32; } extern "C" { pub fn AMotionEvent_getHistoricalTouchMinor( motion_event: *const AInputEvent, - pointer_index: size_t, - history_index: size_t, + pointer_index: usize, + history_index: usize, ) -> f32; } extern "C" { pub fn AMotionEvent_getHistoricalToolMajor( motion_event: *const AInputEvent, - pointer_index: size_t, - history_index: size_t, + pointer_index: usize, + history_index: usize, ) -> f32; } extern "C" { pub fn AMotionEvent_getHistoricalToolMinor( motion_event: *const AInputEvent, - pointer_index: size_t, - history_index: size_t, + pointer_index: usize, + history_index: usize, ) -> f32; } extern "C" { pub fn AMotionEvent_getHistoricalOrientation( motion_event: *const AInputEvent, - pointer_index: size_t, - history_index: size_t, + pointer_index: usize, + history_index: usize, ) -> f32; } extern "C" { pub fn AMotionEvent_getHistoricalAxisValue( motion_event: *const AInputEvent, axis: i32, - pointer_index: size_t, - history_index: size_t, + pointer_index: usize, + history_index: usize, ) -> 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 { @@ -1630,6 +1825,9 @@ 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 { @@ -1638,6 +1836,8 @@ pub struct imaxdiv_t { } #[test] fn bindgen_test_layout_imaxdiv_t() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 16usize, @@ -1649,7 +1849,7 @@ fn bindgen_test_layout_imaxdiv_t() { concat!("Alignment of ", stringify!(imaxdiv_t)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).quot as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).quot) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1659,7 +1859,7 @@ fn bindgen_test_layout_imaxdiv_t() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).rem as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).rem) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -1704,11 +1904,52 @@ 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; pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_R8G8B8A8_UNORM: AHardwareBuffer_Format = 1; pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_R8G8B8X8_UNORM: AHardwareBuffer_Format = 2; @@ -1728,6 +1969,8 @@ 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; @@ -1820,6 +2063,8 @@ pub struct AHardwareBuffer_Desc { } #[test] fn bindgen_test_layout_AHardwareBuffer_Desc() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 40usize, @@ -1831,7 +2076,7 @@ fn bindgen_test_layout_AHardwareBuffer_Desc() { concat!("Alignment of ", stringify!(AHardwareBuffer_Desc)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).width as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).width) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1841,7 +2086,7 @@ fn bindgen_test_layout_AHardwareBuffer_Desc() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).height as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).height) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -1851,7 +2096,7 @@ fn bindgen_test_layout_AHardwareBuffer_Desc() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).layers as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).layers) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -1861,7 +2106,7 @@ fn bindgen_test_layout_AHardwareBuffer_Desc() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).format as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).format) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", @@ -1871,7 +2116,7 @@ fn bindgen_test_layout_AHardwareBuffer_Desc() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).usage as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).usage) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -1881,7 +2126,7 @@ fn bindgen_test_layout_AHardwareBuffer_Desc() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).stride as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).stride) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -1891,7 +2136,7 @@ fn bindgen_test_layout_AHardwareBuffer_Desc() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).rfu0 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).rfu0) as usize - ptr as usize }, 28usize, concat!( "Offset of field: ", @@ -1901,7 +2146,7 @@ fn bindgen_test_layout_AHardwareBuffer_Desc() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).rfu1 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).rfu1) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -1920,6 +2165,9 @@ pub struct AHardwareBuffer_Plane { } #[test] fn bindgen_test_layout_AHardwareBuffer_Plane() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 16usize, @@ -1931,7 +2179,7 @@ fn bindgen_test_layout_AHardwareBuffer_Plane() { concat!("Alignment of ", stringify!(AHardwareBuffer_Plane)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).data as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).data) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1941,9 +2189,7 @@ fn bindgen_test_layout_AHardwareBuffer_Plane() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pixelStride as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).pixelStride) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -1953,7 +2199,7 @@ fn bindgen_test_layout_AHardwareBuffer_Plane() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).rowStride as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).rowStride) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", @@ -1971,6 +2217,9 @@ pub struct AHardwareBuffer_Planes { } #[test] fn bindgen_test_layout_AHardwareBuffer_Planes() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 72usize, @@ -1982,9 +2231,7 @@ fn bindgen_test_layout_AHardwareBuffer_Planes() { concat!("Alignment of ", stringify!(AHardwareBuffer_Planes)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).planeCount as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).planeCount) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1994,7 +2241,7 @@ fn bindgen_test_layout_AHardwareBuffer_Planes() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).planes as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).planes) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -2036,15 +2283,6 @@ 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, @@ -2063,6 +2301,15 @@ 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; } @@ -2077,1183 +2324,892 @@ extern "C" { outBytesPerStride: *mut i32, ) -> ::std::os::raw::c_int; } -pub type va_list = [u64; 4usize]; -pub type __gnuc_va_list = [u64; 4usize]; +extern "C" { + pub fn AHardwareBuffer_getId( + buffer: *const AHardwareBuffer, + outId: *mut u64, + ) -> ::std::os::raw::c_int; +} +#[doc = " \\brief Describe information about a pointer, found in a\n GameActivityMotionEvent.\n\n You can read values directly from this structure, or use helper functions\n (`GameActivityPointerAxes_getX`, `GameActivityPointerAxes_getY` and\n `GameActivityPointerAxes_getAxisValue`).\n\n The X axis and Y axis are enabled by default but any other axis that you want\n to read **must** be enabled first, using\n `GameActivityPointerAxes_enableAxis`.\n\n \\see GameActivityMotionEvent"] #[repr(C)] -pub struct JavaVMAttachArgs { - pub version: jint, - pub name: *const ::std::os::raw::c_char, - pub group: jobject, +#[derive(Debug, Copy, Clone)] +pub struct GameActivityPointerAxes { + pub id: i32, + pub toolType: i32, + pub axisValues: [f32; 48usize], + pub rawX: f32, + pub rawY: f32, } #[test] -fn bindgen_test_layout_JavaVMAttachArgs() { +fn bindgen_test_layout_GameActivityPointerAxes() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(JavaVMAttachArgs)) + ::std::mem::size_of::(), + 208usize, + concat!("Size of: ", stringify!(GameActivityPointerAxes)) ); assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(JavaVMAttachArgs)) + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(GameActivityPointerAxes)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).version as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(JavaVMAttachArgs), + stringify!(GameActivityPointerAxes), "::", - stringify!(version) + stringify!(id) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).name as *const _ as usize }, - 8usize, + unsafe { ::std::ptr::addr_of!((*ptr).toolType) as usize - ptr as usize }, + 4usize, concat!( "Offset of field: ", - stringify!(JavaVMAttachArgs), + stringify!(GameActivityPointerAxes), "::", - stringify!(name) + stringify!(toolType) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).group as *const _ as usize }, - 16usize, + unsafe { ::std::ptr::addr_of!((*ptr).axisValues) as usize - ptr as usize }, + 8usize, concat!( "Offset of field: ", - stringify!(JavaVMAttachArgs), + stringify!(GameActivityPointerAxes), "::", - stringify!(group) + stringify!(axisValues) ) ); -} -#[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, + unsafe { ::std::ptr::addr_of!((*ptr).rawX) as usize - ptr as usize }, + 200usize, concat!( "Offset of field: ", - stringify!(JavaVMOption), + stringify!(GameActivityPointerAxes), "::", - stringify!(optionString) + stringify!(rawX) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).extraInfo as *const _ as usize }, - 8usize, + unsafe { ::std::ptr::addr_of!((*ptr).rawY) as usize - ptr as usize }, + 204usize, concat!( "Offset of field: ", - stringify!(JavaVMOption), + stringify!(GameActivityPointerAxes), "::", - stringify!(extraInfo) + stringify!(rawY) ) ); } +extern "C" { + #[doc = " \\brief Enable the specified axis, so that its value is reported in the\n GameActivityPointerAxes structures stored in a motion event.\n\n You must enable any axis that you want to read, apart from\n `AMOTION_EVENT_AXIS_X` and `AMOTION_EVENT_AXIS_Y` that are enabled by\n default.\n\n If the axis index is out of range, nothing is done."] + pub fn GameActivityPointerAxes_enableAxis(axis: i32); +} +extern "C" { + #[doc = " \\brief Disable the specified axis. Its value won't be reported in the\n GameActivityPointerAxes structures stored in a motion event anymore.\n\n Apart from X and Y, any axis that you want to read **must** be enabled first,\n using `GameActivityPointerAxes_enableAxis`.\n\n If the axis index is out of range, nothing is done."] + pub fn GameActivityPointerAxes_disableAxis(axis: i32); +} +extern "C" { + #[doc = " \\brief Get the value of the requested axis.\n\n Apart from X and Y, any axis that you want to read **must** be enabled first,\n using `GameActivityPointerAxes_enableAxis`.\n\n Find the valid enums for the axis (`AMOTION_EVENT_AXIS_X`,\n `AMOTION_EVENT_AXIS_Y`, `AMOTION_EVENT_AXIS_PRESSURE`...)\n in https://developer.android.com/ndk/reference/group/input.\n\n @param pointerInfo The structure containing information about the pointer,\n obtained from GameActivityMotionEvent.\n @param axis The axis to get the value from\n @return The value of the axis, or 0 if the axis is invalid or was not\n enabled."] + pub fn GameActivityPointerAxes_getAxisValue( + pointerInfo: *const GameActivityPointerAxes, + axis: i32, + ) -> f32; +} +#[doc = " \\brief Describe a motion event that happened on the GameActivity SurfaceView.\n\n This is 1:1 mapping to the information contained in a Java `MotionEvent`\n (see https://developer.android.com/reference/android/view/MotionEvent)."] #[repr(C)] -pub struct JavaVMInitArgs { - pub version: jint, - pub nOptions: jint, - pub options: *mut JavaVMOption, - pub ignoreUnrecognized: jboolean, +#[derive(Debug, Copy, Clone)] +pub struct GameActivityMotionEvent { + pub deviceId: i32, + pub source: i32, + pub action: i32, + pub eventTime: i64, + pub downTime: i64, + pub flags: i32, + pub metaState: i32, + pub actionButton: i32, + pub buttonState: i32, + pub classification: i32, + pub edgeFlags: i32, + pub pointerCount: u32, + pub pointers: [GameActivityPointerAxes; 8usize], + pub historySize: ::std::os::raw::c_int, + pub historicalEventTimesMillis: *mut i64, + pub historicalEventTimesNanos: *mut i64, + pub historicalAxisValues: *mut f32, + pub precisionX: f32, + pub precisionY: f32, } #[test] -fn bindgen_test_layout_JavaVMInitArgs() { +fn bindgen_test_layout_GameActivityMotionEvent() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(JavaVMInitArgs)) + ::std::mem::size_of::(), + 1760usize, + concat!("Size of: ", stringify!(GameActivityMotionEvent)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(JavaVMInitArgs)) + concat!("Alignment of ", stringify!(GameActivityMotionEvent)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).version as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).deviceId) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(JavaVMInitArgs), + stringify!(GameActivityMotionEvent), "::", - stringify!(version) + stringify!(deviceId) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).nOptions as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).source) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", - stringify!(JavaVMInitArgs), + stringify!(GameActivityMotionEvent), "::", - stringify!(nOptions) + stringify!(source) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).options as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).action) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(JavaVMInitArgs), + stringify!(GameActivityMotionEvent), "::", - stringify!(options) + stringify!(action) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ignoreUnrecognized as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).eventTime) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", - stringify!(JavaVMInitArgs), + stringify!(GameActivityMotionEvent), "::", - stringify!(ignoreUnrecognized) + stringify!(eventTime) ) ); -} -pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_CAPTION_BAR: GameCommonInsetsType = 0; -pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_DISPLAY_CUTOUT: GameCommonInsetsType = 1; -pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_IME: GameCommonInsetsType = 2; -pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_MANDATORY_SYSTEM_GESTURES: - GameCommonInsetsType = 3; -pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_NAVIGATION_BARS: GameCommonInsetsType = 4; -pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_STATUS_BARS: GameCommonInsetsType = 5; -pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_SYSTEM_BARS: GameCommonInsetsType = 6; -pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_SYSTEM_GESTURES: GameCommonInsetsType = 7; -pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_TAPABLE_ELEMENT: GameCommonInsetsType = 8; -pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_WATERFALL: GameCommonInsetsType = 9; -pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_COUNT: GameCommonInsetsType = 10; -#[doc = " The type of a component for which to retrieve insets. See"] -#[doc = " https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type"] -pub type GameCommonInsetsType = ::std::os::raw::c_uint; -#[doc = " This struct holds a span within a region of text from start (inclusive) to"] -#[doc = " end (exclusive). An empty span or cursor position is specified with"] -#[doc = " start==end. An undefined span is specified with start = end = SPAN_UNDEFINED."] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct GameTextInputSpan { - #[doc = " The start of the region (inclusive)."] - pub start: i32, - #[doc = " The end of the region (exclusive)."] - pub end: i32, -} -#[test] -fn bindgen_test_layout_GameTextInputSpan() { assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(GameTextInputSpan)) + unsafe { ::std::ptr::addr_of!((*ptr).downTime) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(GameActivityMotionEvent), + "::", + stringify!(downTime) + ) ); assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(GameTextInputSpan)) + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(GameActivityMotionEvent), + "::", + stringify!(flags) + ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).start as *const _ as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).metaState) as usize - ptr as usize }, + 36usize, concat!( "Offset of field: ", - stringify!(GameTextInputSpan), + stringify!(GameActivityMotionEvent), "::", - stringify!(start) + stringify!(metaState) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).end as *const _ as usize }, - 4usize, + unsafe { ::std::ptr::addr_of!((*ptr).actionButton) as usize - ptr as usize }, + 40usize, concat!( "Offset of field: ", - stringify!(GameTextInputSpan), + stringify!(GameActivityMotionEvent), "::", - stringify!(end) + stringify!(actionButton) ) ); -} -pub const GameTextInputSpanFlag_SPAN_UNDEFINED: GameTextInputSpanFlag = -1; -#[doc = " Values with special meaning in a GameTextInputSpan."] -pub type GameTextInputSpanFlag = ::std::os::raw::c_int; -#[doc = " This struct holds the state of an editable section of text."] -#[doc = " The text can have a selection and a composing region defined on it."] -#[doc = " A composing region is used by IMEs that allow input using multiple steps to"] -#[doc = " compose a glyph or word. Use functions GameTextInput_getState and"] -#[doc = " GameTextInput_setState to read and modify the state that an IME is editing."] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct GameTextInputState { - #[doc = " Text owned by the state, as a modified UTF-8 string. Null-terminated."] - #[doc = " https://en.wikipedia.org/wiki/UTF-8#Modified_UTF-8"] - pub text_UTF8: *const ::std::os::raw::c_char, - #[doc = " Length in bytes of text_UTF8, *not* including the null at end."] - pub text_length: i32, - #[doc = " A selection defined on the text."] - pub selection: GameTextInputSpan, - #[doc = " A composing region defined on the text."] - pub composingRegion: GameTextInputSpan, -} -#[test] -fn bindgen_test_layout_GameTextInputState() { assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(GameTextInputState)) + unsafe { ::std::ptr::addr_of!((*ptr).buttonState) as usize - ptr as usize }, + 44usize, + concat!( + "Offset of field: ", + stringify!(GameActivityMotionEvent), + "::", + stringify!(buttonState) + ) ); assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(GameTextInputState)) + unsafe { ::std::ptr::addr_of!((*ptr).classification) as usize - ptr as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(GameActivityMotionEvent), + "::", + stringify!(classification) + ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).text_UTF8 as *const _ as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).edgeFlags) as usize - ptr as usize }, + 52usize, concat!( "Offset of field: ", - stringify!(GameTextInputState), + stringify!(GameActivityMotionEvent), "::", - stringify!(text_UTF8) + stringify!(edgeFlags) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).text_length as *const _ as usize }, - 8usize, + unsafe { ::std::ptr::addr_of!((*ptr).pointerCount) as usize - ptr as usize }, + 56usize, concat!( "Offset of field: ", - stringify!(GameTextInputState), + stringify!(GameActivityMotionEvent), "::", - stringify!(text_length) + stringify!(pointerCount) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).selection as *const _ as usize }, - 12usize, + unsafe { ::std::ptr::addr_of!((*ptr).pointers) as usize - ptr as usize }, + 60usize, concat!( "Offset of field: ", - stringify!(GameTextInputState), + stringify!(GameActivityMotionEvent), "::", - stringify!(selection) + stringify!(pointers) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).composingRegion as *const _ as usize - }, - 20usize, + unsafe { ::std::ptr::addr_of!((*ptr).historySize) as usize - ptr as usize }, + 1724usize, concat!( "Offset of field: ", - stringify!(GameTextInputState), + stringify!(GameActivityMotionEvent), "::", - stringify!(composingRegion) + stringify!(historySize) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).historicalEventTimesMillis) as usize - ptr as usize }, + 1728usize, + concat!( + "Offset of field: ", + stringify!(GameActivityMotionEvent), + "::", + stringify!(historicalEventTimesMillis) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).historicalEventTimesNanos) as usize - ptr as usize }, + 1736usize, + concat!( + "Offset of field: ", + stringify!(GameActivityMotionEvent), + "::", + stringify!(historicalEventTimesNanos) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).historicalAxisValues) as usize - ptr as usize }, + 1744usize, + concat!( + "Offset of field: ", + stringify!(GameActivityMotionEvent), + "::", + stringify!(historicalAxisValues) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).precisionX) as usize - ptr as usize }, + 1752usize, + concat!( + "Offset of field: ", + stringify!(GameActivityMotionEvent), + "::", + stringify!(precisionX) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).precisionY) as usize - ptr as usize }, + 1756usize, + concat!( + "Offset of field: ", + stringify!(GameActivityMotionEvent), + "::", + stringify!(precisionY) ) ); -} -#[doc = " A callback called by GameTextInput_getState."] -#[doc = " @param context User-defined context."] -#[doc = " @param state State, owned by the library, that will be valid for the duration"] -#[doc = " of the callback."] -pub type GameTextInputGetStateCallback = ::std::option::Option< - unsafe extern "C" fn(context: *mut ::std::os::raw::c_void, state: *const GameTextInputState), ->; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct GameTextInput { - _unused: [u8; 0], } extern "C" { - #[doc = " Initialize the GameTextInput library."] - #[doc = " If called twice without GameTextInput_destroy being called, the same pointer"] - #[doc = " will be returned and a warning will be issued."] - #[doc = " @param env A JNI env valid on the calling thread."] - #[doc = " @param max_string_size The maximum length of a string that can be edited. If"] - #[doc = " zero, the maximum defaults to 65536 bytes. A buffer of this size is allocated"] - #[doc = " at initialization."] - #[doc = " @return A handle to the library."] - pub fn GameTextInput_init(env: *mut JNIEnv, max_string_size: u32) -> *mut GameTextInput; + pub fn GameActivityMotionEvent_getHistoricalAxisValue( + event: *const GameActivityMotionEvent, + axis: ::std::os::raw::c_int, + pointerIndex: ::std::os::raw::c_int, + historyPos: ::std::os::raw::c_int, + ) -> f32; } extern "C" { - #[doc = " When using GameTextInput, you need to create a gametextinput.InputConnection"] - #[doc = " on the Java side and pass it using this function to the library, unless using"] - #[doc = " GameActivity in which case this will be done for you. See the GameActivity"] - #[doc = " source code or GameTextInput samples for examples of usage."] - #[doc = " @param input A valid GameTextInput library handle."] - #[doc = " @param inputConnection A gametextinput.InputConnection object."] - pub fn GameTextInput_setInputConnection(input: *mut GameTextInput, inputConnection: jobject); + #[doc = " \\brief Handle the freeing of the GameActivityMotionEvent struct."] + pub fn GameActivityMotionEvent_destroy(c_event: *mut GameActivityMotionEvent); } extern "C" { - #[doc = " Unless using GameActivity, it is required to call this function from your"] - #[doc = " Java gametextinput.Listener.stateChanged method to convert eventState and"] - #[doc = " trigger any event callbacks. When using GameActivity, this does not need to"] - #[doc = " be called as event processing is handled by the Activity."] - #[doc = " @param input A valid GameTextInput library handle."] - #[doc = " @param eventState A Java gametextinput.State object."] - pub fn GameTextInput_processEvent(input: *mut GameTextInput, eventState: jobject); + #[doc = " \\brief Convert a Java `MotionEvent` to a `GameActivityMotionEvent`.\n\n This is done automatically by the GameActivity: see `onTouchEvent` to set\n a callback to consume the received events.\n This function can be used if you re-implement events handling in your own\n activity.\n Ownership of out_event is maintained by the caller."] + pub fn GameActivityMotionEvent_fromJava( + env: *mut JNIEnv, + motionEvent: jobject, + out_event: *mut GameActivityMotionEvent, + ); } -extern "C" { - #[doc = " Free any resources owned by the GameTextInput library."] - #[doc = " Any subsequent calls to the library will fail until GameTextInput_init is"] - #[doc = " called again."] - #[doc = " @param input A valid GameTextInput library handle."] - pub fn GameTextInput_destroy(input: *mut GameTextInput); -} -pub const ShowImeFlags_SHOW_IME_UNDEFINED: ShowImeFlags = 0; -pub const ShowImeFlags_SHOW_IMPLICIT: ShowImeFlags = 1; -pub const ShowImeFlags_SHOW_FORCED: ShowImeFlags = 2; -#[doc = " Flags to be passed to GameTextInput_showIme."] -pub type ShowImeFlags = ::std::os::raw::c_uint; -extern "C" { - #[doc = " Show the IME. Calls InputMethodManager.showSoftInput()."] - #[doc = " @param input A valid GameTextInput library handle."] - #[doc = " @param flags Defined in ShowImeFlags above. For more information see:"] - #[doc = " https://developer.android.com/reference/android/view/inputmethod/InputMethodManager"] - pub fn GameTextInput_showIme(input: *mut GameTextInput, flags: u32); -} -pub const HideImeFlags_HIDE_IME_UNDEFINED: HideImeFlags = 0; -pub const HideImeFlags_HIDE_IMPLICIT_ONLY: HideImeFlags = 1; -pub const HideImeFlags_HIDE_NOT_ALWAYS: HideImeFlags = 2; -#[doc = " Flags to be passed to GameTextInput_hideIme."] -pub type HideImeFlags = ::std::os::raw::c_uint; -extern "C" { - #[doc = " Show the IME. Calls InputMethodManager.hideSoftInputFromWindow()."] - #[doc = " @param input A valid GameTextInput library handle."] - #[doc = " @param flags Defined in HideImeFlags above. For more information see:"] - #[doc = " https://developer.android.com/reference/android/view/inputmethod/InputMethodManager"] - pub fn GameTextInput_hideIme(input: *mut GameTextInput, flags: u32); -} -extern "C" { - #[doc = " Call a callback with the current GameTextInput state, which may have been"] - #[doc = " modified by changes in the IME and calls to GameTextInput_setState. We use a"] - #[doc = " callback rather than returning the state in order to simplify ownership of"] - #[doc = " text_UTF8 strings. These strings are only valid during the calling of the"] - #[doc = " callback."] - #[doc = " @param input A valid GameTextInput library handle."] - #[doc = " @param callback A function that will be called with valid state."] - #[doc = " @param context Context used by the callback."] - pub fn GameTextInput_getState( - input: *mut GameTextInput, - callback: GameTextInputGetStateCallback, - context: *mut ::std::os::raw::c_void, - ); -} -extern "C" { - #[doc = " Set the current GameTextInput state. This state is reflected to any active"] - #[doc = " IME."] - #[doc = " @param input A valid GameTextInput library handle."] - #[doc = " @param state The state to set. Ownership is maintained by the caller and must"] - #[doc = " remain valid for the duration of the call."] - pub fn GameTextInput_setState(input: *mut GameTextInput, state: *const GameTextInputState); -} -#[doc = " Type of the callback needed by GameTextInput_setEventCallback that will be"] -#[doc = " called every time the IME state changes."] -#[doc = " @param context User-defined context set in GameTextInput_setEventCallback."] -#[doc = " @param current_state Current IME state, owned by the library and valid during"] -#[doc = " the callback."] -pub type GameTextInputEventCallback = ::std::option::Option< - unsafe extern "C" fn( - context: *mut ::std::os::raw::c_void, - current_state: *const GameTextInputState, - ), ->; -extern "C" { - #[doc = " Optionally set a callback to be called whenever the IME state changes."] - #[doc = " Not necessary if you are using GameActivity, which handles these callbacks"] - #[doc = " for you."] - #[doc = " @param input A valid GameTextInput library handle."] - #[doc = " @param callback Called by the library when the IME state changes."] - #[doc = " @param context Context passed as first argument to the callback."] - pub fn GameTextInput_setEventCallback( - input: *mut GameTextInput, - callback: GameTextInputEventCallback, - context: *mut ::std::os::raw::c_void, - ); -} -#[doc = " Type of the callback needed by GameTextInput_setImeInsetsCallback that will"] -#[doc = " be called every time the IME window insets change."] -#[doc = " @param context User-defined context set in"] -#[doc = " GameTextInput_setImeWIndowInsetsCallback."] -#[doc = " @param current_insets Current IME insets, owned by the library and valid"] -#[doc = " during the callback."] -pub type GameTextInputImeInsetsCallback = ::std::option::Option< - unsafe extern "C" fn(context: *mut ::std::os::raw::c_void, current_insets: *const ARect), ->; -extern "C" { - #[doc = " Optionally set a callback to be called whenever the IME insets change."] - #[doc = " Not necessary if you are using GameActivity, which handles these callbacks"] - #[doc = " for you."] - #[doc = " @param input A valid GameTextInput library handle."] - #[doc = " @param callback Called by the library when the IME insets change."] - #[doc = " @param context Context passed as first argument to the callback."] - pub fn GameTextInput_setImeInsetsCallback( - input: *mut GameTextInput, - callback: GameTextInputImeInsetsCallback, - context: *mut ::std::os::raw::c_void, - ); -} -extern "C" { - #[doc = " Get the current window insets for the IME."] - #[doc = " @param input A valid GameTextInput library handle."] - #[doc = " @param insets Filled with the current insets by this function."] - pub fn GameTextInput_getImeInsets(input: *const GameTextInput, insets: *mut ARect); -} -extern "C" { - #[doc = " Unless using GameActivity, it is required to call this function from your"] - #[doc = " Java gametextinput.Listener.onImeInsetsChanged method to"] - #[doc = " trigger any event callbacks. When using GameActivity, this does not need to"] - #[doc = " be called as insets processing is handled by the Activity."] - #[doc = " @param input A valid GameTextInput library handle."] - #[doc = " @param eventState A Java gametextinput.State object."] - pub fn GameTextInput_processImeInsets(input: *mut GameTextInput, insets: *const ARect); -} -extern "C" { - #[doc = " Convert a GameTextInputState struct to a Java gametextinput.State object."] - #[doc = " Don't forget to delete the returned Java local ref when you're done."] - #[doc = " @param input A valid GameTextInput library handle."] - #[doc = " @param state Input state to convert."] - #[doc = " @return A Java object of class gametextinput.State. The caller is required to"] - #[doc = " delete this local reference."] - pub fn GameTextInputState_toJava( - input: *const GameTextInput, - state: *const GameTextInputState, - ) -> jobject; -} -extern "C" { - #[doc = " Convert from a Java gametextinput.State object into a C GameTextInputState"] - #[doc = " struct."] - #[doc = " @param input A valid GameTextInput library handle."] - #[doc = " @param state A Java gametextinput.State object."] - #[doc = " @param callback A function called with the C struct, valid for the duration"] - #[doc = " of the call."] - #[doc = " @param context Context passed to the callback."] - pub fn GameTextInputState_fromJava( - input: *const GameTextInput, - state: jobject, - callback: GameTextInputGetStateCallback, - context: *mut ::std::os::raw::c_void, - ); -} -#[doc = " This structure defines the native side of an android.app.GameActivity."] -#[doc = " It is created by the framework, and handed to the application's native"] -#[doc = " code as it is being launched."] -#[repr(C)] -pub struct GameActivity { - #[doc = " Pointer to the callback function table of the native application."] - #[doc = " You can set the functions here to your own callbacks. The callbacks"] - #[doc = " pointer itself here should not be changed; it is allocated and managed"] - #[doc = " for you by the framework."] - pub callbacks: *mut GameActivityCallbacks, - #[doc = " The global handle on the process's Java VM."] - pub vm: *mut JavaVM, - #[doc = " JNI context for the main thread of the app. Note that this field"] - #[doc = " can ONLY be used from the main thread of the process; that is, the"] - #[doc = " thread that calls into the GameActivityCallbacks."] - pub env: *mut JNIEnv, - #[doc = " The GameActivity object handle."] - pub javaGameActivity: jobject, - #[doc = " Path to this application's internal data directory."] - pub internalDataPath: *const ::std::os::raw::c_char, - #[doc = " Path to this application's external (removable/mountable) data directory."] - pub externalDataPath: *const ::std::os::raw::c_char, - #[doc = " The platform's SDK version code."] - pub sdkVersion: i32, - #[doc = " This is the native instance of the application. It is not used by"] - #[doc = " the framework, but can be set by the application to its own instance"] - #[doc = " state."] - pub instance: *mut ::std::os::raw::c_void, - #[doc = " Pointer to the Asset Manager instance for the application. The"] - #[doc = " application uses this to access binary assets bundled inside its own .apk"] - #[doc = " file."] - pub assetManager: *mut AAssetManager, - #[doc = " Available starting with Honeycomb: path to the directory containing"] - #[doc = " the application's OBB files (if any). If the app doesn't have any"] - #[doc = " OBB files, this directory may not exist."] - pub obbPath: *const ::std::os::raw::c_char, +#[doc = " \\brief Describe a key event that happened on the GameActivity SurfaceView.\n\n This is 1:1 mapping to the information contained in a Java `KeyEvent`\n (see https://developer.android.com/reference/android/view/KeyEvent).\n The only exception is the event times, which are reported as\n nanoseconds in this struct."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GameActivityKeyEvent { + pub deviceId: i32, + pub source: i32, + pub action: i32, + pub eventTime: i64, + pub downTime: i64, + pub flags: i32, + pub metaState: i32, + pub modifiers: i32, + pub repeatCount: i32, + pub keyCode: i32, + pub scanCode: i32, + pub unicodeChar: i32, } #[test] -fn bindgen_test_layout_GameActivity() { +fn bindgen_test_layout_GameActivityKeyEvent() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 80usize, - concat!("Size of: ", stringify!(GameActivity)) + ::std::mem::size_of::(), + 64usize, + concat!("Size of: ", stringify!(GameActivityKeyEvent)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(GameActivity)) + concat!("Alignment of ", stringify!(GameActivityKeyEvent)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).callbacks as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).deviceId) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(GameActivity), + stringify!(GameActivityKeyEvent), "::", - stringify!(callbacks) + stringify!(deviceId) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).source) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(GameActivityKeyEvent), + "::", + stringify!(source) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).vm as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).action) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(GameActivity), + stringify!(GameActivityKeyEvent), "::", - stringify!(vm) + stringify!(action) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).env as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).eventTime) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", - stringify!(GameActivity), + stringify!(GameActivityKeyEvent), "::", - stringify!(env) + stringify!(eventTime) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).javaGameActivity as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).downTime) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", - stringify!(GameActivity), + stringify!(GameActivityKeyEvent), "::", - stringify!(javaGameActivity) + stringify!(downTime) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).internalDataPath as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", - stringify!(GameActivity), + stringify!(GameActivityKeyEvent), "::", - stringify!(internalDataPath) + stringify!(flags) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).metaState) as usize - ptr as usize }, + 36usize, + concat!( + "Offset of field: ", + stringify!(GameActivityKeyEvent), + "::", + stringify!(metaState) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).externalDataPath as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).modifiers) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", - stringify!(GameActivity), + stringify!(GameActivityKeyEvent), "::", - stringify!(externalDataPath) + stringify!(modifiers) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sdkVersion as *const _ as usize }, - 48usize, + unsafe { ::std::ptr::addr_of!((*ptr).repeatCount) as usize - ptr as usize }, + 44usize, concat!( "Offset of field: ", - stringify!(GameActivity), + stringify!(GameActivityKeyEvent), "::", - stringify!(sdkVersion) + stringify!(repeatCount) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).instance as *const _ as usize }, - 56usize, + unsafe { ::std::ptr::addr_of!((*ptr).keyCode) as usize - ptr as usize }, + 48usize, concat!( "Offset of field: ", - stringify!(GameActivity), + stringify!(GameActivityKeyEvent), "::", - stringify!(instance) + stringify!(keyCode) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).assetManager as *const _ as usize }, - 64usize, + unsafe { ::std::ptr::addr_of!((*ptr).scanCode) as usize - ptr as usize }, + 52usize, concat!( "Offset of field: ", - stringify!(GameActivity), + stringify!(GameActivityKeyEvent), "::", - stringify!(assetManager) + stringify!(scanCode) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).obbPath as *const _ as usize }, - 72usize, + unsafe { ::std::ptr::addr_of!((*ptr).unicodeChar) as usize - ptr as usize }, + 56usize, concat!( "Offset of field: ", - stringify!(GameActivity), + stringify!(GameActivityKeyEvent), "::", - stringify!(obbPath) + stringify!(unicodeChar) ) ); } -#[doc = " \\brief Describe information about a pointer, found in a"] -#[doc = " GameActivityMotionEvent."] -#[doc = ""] -#[doc = " You can read values directly from this structure, or use helper functions"] -#[doc = " (`GameActivityPointerAxes_getX`, `GameActivityPointerAxes_getY` and"] -#[doc = " `GameActivityPointerAxes_getAxisValue`)."] -#[doc = ""] -#[doc = " The X axis and Y axis are enabled by default but any other axis that you want"] -#[doc = " to read **must** be enabled first, using"] -#[doc = " `GameActivityPointerAxes_enableAxis`."] -#[doc = ""] -#[doc = " \\see GameActivityMotionEvent"] +extern "C" { + #[doc = " \\brief Convert a Java `KeyEvent` to a `GameActivityKeyEvent`.\n\n This is done automatically by the GameActivity: see `onKeyUp` and `onKeyDown`\n to set a callback to consume the received events.\n This function can be used if you re-implement events handling in your own\n activity.\n Ownership of out_event is maintained by the caller."] + pub fn GameActivityKeyEvent_fromJava( + env: *mut JNIEnv, + motionEvent: jobject, + out_event: *mut GameActivityKeyEvent, + ); +} +pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_CAPTION_BAR: GameCommonInsetsType = 0; +pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_DISPLAY_CUTOUT: GameCommonInsetsType = 1; +pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_IME: GameCommonInsetsType = 2; +pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_MANDATORY_SYSTEM_GESTURES: + GameCommonInsetsType = 3; +pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_NAVIGATION_BARS: GameCommonInsetsType = 4; +pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_STATUS_BARS: GameCommonInsetsType = 5; +pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_SYSTEM_BARS: GameCommonInsetsType = 6; +pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_SYSTEM_GESTURES: GameCommonInsetsType = 7; +pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_TAPABLE_ELEMENT: GameCommonInsetsType = 8; +pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_WATERFALL: GameCommonInsetsType = 9; +pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_COUNT: GameCommonInsetsType = 10; +#[doc = " The type of a component for which to retrieve insets. See\n https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type"] +pub type GameCommonInsetsType = ::std::os::raw::c_uint; +#[doc = " This struct holds a span within a region of text from start (inclusive) to\n end (exclusive). An empty span or cursor position is specified with\n start==end. An undefined span is specified with start = end = SPAN_UNDEFINED."] #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct GameActivityPointerAxes { - pub id: i32, - pub toolType: i32, - pub axisValues: [f32; 48usize], - pub rawX: f32, - pub rawY: f32, +pub struct GameTextInputSpan { + #[doc = " The start of the region (inclusive)."] + pub start: i32, + #[doc = " The end of the region (exclusive)."] + pub end: i32, } #[test] -fn bindgen_test_layout_GameActivityPointerAxes() { +fn bindgen_test_layout_GameTextInputSpan() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 208usize, - concat!("Size of: ", stringify!(GameActivityPointerAxes)) + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(GameTextInputSpan)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(GameActivityPointerAxes)) + concat!("Alignment of ", stringify!(GameTextInputSpan)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).id as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).start) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(GameActivityPointerAxes), + stringify!(GameTextInputSpan), "::", - stringify!(id) + stringify!(start) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).toolType as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).end) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", - stringify!(GameActivityPointerAxes), + stringify!(GameTextInputSpan), "::", - stringify!(toolType) + stringify!(end) ) ); +} +pub const GameTextInputSpanFlag_SPAN_UNDEFINED: GameTextInputSpanFlag = -1; +#[doc = " Values with special meaning in a GameTextInputSpan."] +pub type GameTextInputSpanFlag = ::std::os::raw::c_int; +#[doc = " This struct holds the state of an editable section of text.\n The text can have a selection and a composing region defined on it.\n A composing region is used by IMEs that allow input using multiple steps to\n compose a glyph or word. Use functions GameTextInput_getState and\n GameTextInput_setState to read and modify the state that an IME is editing."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GameTextInputState { + #[doc = " Text owned by the state, as a modified UTF-8 string. Null-terminated.\n https://en.wikipedia.org/wiki/UTF-8#Modified_UTF-8"] + pub text_UTF8: *const ::std::os::raw::c_char, + #[doc = " Length in bytes of text_UTF8, *not* including the null at end."] + pub text_length: i32, + #[doc = " A selection defined on the text."] + pub selection: GameTextInputSpan, + #[doc = " A composing region defined on the text."] + pub composingRegion: GameTextInputSpan, +} +#[test] +fn bindgen_test_layout_GameTextInputState() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(GameTextInputState)) + ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).axisValues as *const _ as usize - }, + ::std::mem::align_of::(), 8usize, + concat!("Alignment of ", stringify!(GameTextInputState)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).text_UTF8) as usize - ptr as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(GameActivityPointerAxes), + stringify!(GameTextInputState), "::", - stringify!(axisValues) + stringify!(text_UTF8) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).rawX as *const _ as usize }, - 200usize, + unsafe { ::std::ptr::addr_of!((*ptr).text_length) as usize - ptr as usize }, + 8usize, concat!( "Offset of field: ", - stringify!(GameActivityPointerAxes), + stringify!(GameTextInputState), "::", - stringify!(rawX) + stringify!(text_length) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).rawY as *const _ as usize }, - 204usize, + unsafe { ::std::ptr::addr_of!((*ptr).selection) as usize - ptr as usize }, + 12usize, concat!( "Offset of field: ", - stringify!(GameActivityPointerAxes), + stringify!(GameTextInputState), "::", - stringify!(rawY) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct GameActivityHistoricalPointerAxes { - pub eventTime: i64, - pub axisValues: [f32; 48usize], -} -#[test] -fn bindgen_test_layout_GameActivityHistoricalPointerAxes() { - assert_eq!( - ::std::mem::size_of::(), - 200usize, - concat!("Size of: ", stringify!(GameActivityHistoricalPointerAxes)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(GameActivityHistoricalPointerAxes) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).eventTime as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(GameActivityHistoricalPointerAxes), - "::", - stringify!(eventTime) + stringify!(selection) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).axisValues as *const _ - as usize - }, - 8usize, + unsafe { ::std::ptr::addr_of!((*ptr).composingRegion) as usize - ptr as usize }, + 20usize, concat!( "Offset of field: ", - stringify!(GameActivityHistoricalPointerAxes), + stringify!(GameTextInputState), "::", - stringify!(axisValues) + stringify!(composingRegion) ) ); } +#[doc = " A callback called by GameTextInput_getState.\n @param context User-defined context.\n @param state State, owned by the library, that will be valid for the duration\n of the callback."] +pub type GameTextInputGetStateCallback = ::std::option::Option< + unsafe extern "C" fn(context: *mut ::std::os::raw::c_void, state: *const GameTextInputState), +>; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GameTextInput { + _unused: [u8; 0], +} extern "C" { - #[doc = " \\brief Enable the specified axis, so that its value is reported in the"] - #[doc = " GameActivityPointerAxes structures stored in a motion event."] - #[doc = ""] - #[doc = " You must enable any axis that you want to read, apart from"] - #[doc = " `AMOTION_EVENT_AXIS_X` and `AMOTION_EVENT_AXIS_Y` that are enabled by"] - #[doc = " default."] - #[doc = ""] - #[doc = " If the axis index is out of range, nothing is done."] - pub fn GameActivityPointerAxes_enableAxis(axis: i32); + #[doc = " Initialize the GameTextInput library.\n If called twice without GameTextInput_destroy being called, the same pointer\n will be returned and a warning will be issued.\n @param env A JNI env valid on the calling thread.\n @param max_string_size The maximum length of a string that can be edited. If\n zero, the maximum defaults to 65536 bytes. A buffer of this size is allocated\n at initialization.\n @return A handle to the library."] + pub fn GameTextInput_init(env: *mut JNIEnv, max_string_size: u32) -> *mut GameTextInput; } extern "C" { - #[doc = " \\brief Disable the specified axis. Its value won't be reported in the"] - #[doc = " GameActivityPointerAxes structures stored in a motion event anymore."] - #[doc = ""] - #[doc = " Apart from X and Y, any axis that you want to read **must** be enabled first,"] - #[doc = " using `GameActivityPointerAxes_enableAxis`."] - #[doc = ""] - #[doc = " If the axis index is out of range, nothing is done."] - pub fn GameActivityPointerAxes_disableAxis(axis: i32); + #[doc = " When using GameTextInput, you need to create a gametextinput.InputConnection\n on the Java side and pass it using this function to the library, unless using\n GameActivity in which case this will be done for you. See the GameActivity\n source code or GameTextInput samples for examples of usage.\n @param input A valid GameTextInput library handle.\n @param inputConnection A gametextinput.InputConnection object."] + pub fn GameTextInput_setInputConnection(input: *mut GameTextInput, inputConnection: jobject); } extern "C" { - #[doc = " \\brief Enable the specified axis, so that its value is reported in the"] - #[doc = " GameActivityHistoricalPointerAxes structures associated with a motion event."] - #[doc = ""] - #[doc = " You must enable any axis that you want to read (no axes are enabled by"] - #[doc = " default)."] - #[doc = ""] - #[doc = " If the axis index is out of range, nothing is done."] - pub fn GameActivityHistoricalPointerAxes_enableAxis(axis: i32); + #[doc = " Unless using GameActivity, it is required to call this function from your\n Java gametextinput.Listener.stateChanged method to convert eventState and\n trigger any event callbacks. When using GameActivity, this does not need to\n be called as event processing is handled by the Activity.\n @param input A valid GameTextInput library handle.\n @param eventState A Java gametextinput.State object."] + pub fn GameTextInput_processEvent(input: *mut GameTextInput, eventState: jobject); } extern "C" { - #[doc = " \\brief Disable the specified axis. Its value won't be reported in the"] - #[doc = " GameActivityHistoricalPointerAxes structures associated with motion events"] - #[doc = " anymore."] - #[doc = ""] - #[doc = " If the axis index is out of range, nothing is done."] - pub fn GameActivityHistoricalPointerAxes_disableAxis(axis: i32); + #[doc = " Free any resources owned by the GameTextInput library.\n Any subsequent calls to the library will fail until GameTextInput_init is\n called again.\n @param input A valid GameTextInput library handle."] + pub fn GameTextInput_destroy(input: *mut GameTextInput); } -#[doc = " \\brief Describe a motion event that happened on the GameActivity SurfaceView."] -#[doc = ""] -#[doc = " This is 1:1 mapping to the information contained in a Java `MotionEvent`"] -#[doc = " (see https://developer.android.com/reference/android/view/MotionEvent)."] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct GameActivityMotionEvent { - pub deviceId: i32, - pub source: i32, - pub action: i32, - pub eventTime: i64, - pub downTime: i64, - pub flags: i32, - pub metaState: i32, - pub actionButton: i32, - pub buttonState: i32, - pub classification: i32, - pub edgeFlags: i32, - pub pointerCount: u32, - pub pointers: [GameActivityPointerAxes; 8usize], - pub precisionX: f32, - pub precisionY: f32, - pub historicalStart: i16, - pub historicalCount: i16, +pub const ShowImeFlags_SHOW_IME_UNDEFINED: ShowImeFlags = 0; +pub const ShowImeFlags_SHOW_IMPLICIT: ShowImeFlags = 1; +pub const ShowImeFlags_SHOW_FORCED: ShowImeFlags = 2; +#[doc = " Flags to be passed to GameTextInput_showIme."] +pub type ShowImeFlags = ::std::os::raw::c_uint; +extern "C" { + #[doc = " Show the IME. Calls InputMethodManager.showSoftInput().\n @param input A valid GameTextInput library handle.\n @param flags Defined in ShowImeFlags above. For more information see:\n https://developer.android.com/reference/android/view/inputmethod/InputMethodManager"] + pub fn GameTextInput_showIme(input: *mut GameTextInput, flags: u32); } -#[test] -fn bindgen_test_layout_GameActivityMotionEvent() { - assert_eq!( - ::std::mem::size_of::(), - 1736usize, - concat!("Size of: ", stringify!(GameActivityMotionEvent)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(GameActivityMotionEvent)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).deviceId as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(GameActivityMotionEvent), - "::", - stringify!(deviceId) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).source as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(GameActivityMotionEvent), - "::", - stringify!(source) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).action as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(GameActivityMotionEvent), - "::", - stringify!(action) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).eventTime as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(GameActivityMotionEvent), - "::", - stringify!(eventTime) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).downTime as *const _ as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(GameActivityMotionEvent), - "::", - stringify!(downTime) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(GameActivityMotionEvent), - "::", - stringify!(flags) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).metaState as *const _ as usize - }, - 36usize, - concat!( - "Offset of field: ", - stringify!(GameActivityMotionEvent), - "::", - stringify!(metaState) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).actionButton as *const _ as usize - }, - 40usize, - concat!( - "Offset of field: ", - stringify!(GameActivityMotionEvent), - "::", - stringify!(actionButton) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).buttonState as *const _ as usize - }, - 44usize, - concat!( - "Offset of field: ", - stringify!(GameActivityMotionEvent), - "::", - stringify!(buttonState) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).classification as *const _ as usize - }, - 48usize, - concat!( - "Offset of field: ", - stringify!(GameActivityMotionEvent), - "::", - stringify!(classification) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).edgeFlags as *const _ as usize - }, - 52usize, - concat!( - "Offset of field: ", - stringify!(GameActivityMotionEvent), - "::", - stringify!(edgeFlags) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pointerCount as *const _ as usize - }, - 56usize, - concat!( - "Offset of field: ", - stringify!(GameActivityMotionEvent), - "::", - stringify!(pointerCount) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pointers as *const _ as usize - }, - 60usize, - concat!( - "Offset of field: ", - stringify!(GameActivityMotionEvent), - "::", - stringify!(pointers) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).precisionX as *const _ as usize - }, - 1724usize, - concat!( - "Offset of field: ", - stringify!(GameActivityMotionEvent), - "::", - stringify!(precisionX) - ) +pub const HideImeFlags_HIDE_IME_UNDEFINED: HideImeFlags = 0; +pub const HideImeFlags_HIDE_IMPLICIT_ONLY: HideImeFlags = 1; +pub const HideImeFlags_HIDE_NOT_ALWAYS: HideImeFlags = 2; +#[doc = " Flags to be passed to GameTextInput_hideIme."] +pub type HideImeFlags = ::std::os::raw::c_uint; +extern "C" { + #[doc = " Show the IME. Calls InputMethodManager.hideSoftInputFromWindow().\n @param input A valid GameTextInput library handle.\n @param flags Defined in HideImeFlags above. For more information see:\n https://developer.android.com/reference/android/view/inputmethod/InputMethodManager"] + pub fn GameTextInput_hideIme(input: *mut GameTextInput, flags: u32); +} +extern "C" { + #[doc = " Restarts the input method. Calls InputMethodManager.restartInput().\n @param input A valid GameTextInput library handle."] + pub fn GameTextInput_restartInput(input: *mut GameTextInput); +} +extern "C" { + #[doc = " Call a callback with the current GameTextInput state, which may have been\n modified by changes in the IME and calls to GameTextInput_setState. We use a\n callback rather than returning the state in order to simplify ownership of\n text_UTF8 strings. These strings are only valid during the calling of the\n callback.\n @param input A valid GameTextInput library handle.\n @param callback A function that will be called with valid state.\n @param context Context used by the callback."] + pub fn GameTextInput_getState( + input: *mut GameTextInput, + callback: GameTextInputGetStateCallback, + context: *mut ::std::os::raw::c_void, ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).precisionY as *const _ as usize - }, - 1728usize, - concat!( - "Offset of field: ", - stringify!(GameActivityMotionEvent), - "::", - stringify!(precisionY) - ) +} +extern "C" { + #[doc = " Set the current GameTextInput state. This state is reflected to any active\n IME.\n @param input A valid GameTextInput library handle.\n @param state The state to set. Ownership is maintained by the caller and must\n remain valid for the duration of the call."] + pub fn GameTextInput_setState(input: *mut GameTextInput, state: *const GameTextInputState); +} +#[doc = " Type of the callback needed by GameTextInput_setEventCallback that will be\n called every time the IME state changes.\n @param context User-defined context set in GameTextInput_setEventCallback.\n @param current_state Current IME state, owned by the library and valid during\n the callback."] +pub type GameTextInputEventCallback = ::std::option::Option< + unsafe extern "C" fn( + context: *mut ::std::os::raw::c_void, + current_state: *const GameTextInputState, + ), +>; +extern "C" { + #[doc = " Optionally set a callback to be called whenever the IME state changes.\n Not necessary if you are using GameActivity, which handles these callbacks\n for you.\n @param input A valid GameTextInput library handle.\n @param callback Called by the library when the IME state changes.\n @param context Context passed as first argument to the callback."] + pub fn GameTextInput_setEventCallback( + input: *mut GameTextInput, + callback: GameTextInputEventCallback, + context: *mut ::std::os::raw::c_void, ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).historicalStart as *const _ as usize - }, - 1732usize, - concat!( - "Offset of field: ", - stringify!(GameActivityMotionEvent), - "::", - stringify!(historicalStart) - ) +} +#[doc = " Type of the callback needed by GameTextInput_setImeInsetsCallback that will\n be called every time the IME window insets change.\n @param context User-defined context set in\n GameTextInput_setImeWIndowInsetsCallback.\n @param current_insets Current IME insets, owned by the library and valid\n during the callback."] +pub type GameTextInputImeInsetsCallback = ::std::option::Option< + unsafe extern "C" fn(context: *mut ::std::os::raw::c_void, current_insets: *const ARect), +>; +extern "C" { + #[doc = " Optionally set a callback to be called whenever the IME insets change.\n Not necessary if you are using GameActivity, which handles these callbacks\n for you.\n @param input A valid GameTextInput library handle.\n @param callback Called by the library when the IME insets change.\n @param context Context passed as first argument to the callback."] + pub fn GameTextInput_setImeInsetsCallback( + input: *mut GameTextInput, + callback: GameTextInputImeInsetsCallback, + context: *mut ::std::os::raw::c_void, ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).historicalCount as *const _ as usize - }, - 1734usize, - concat!( - "Offset of field: ", - stringify!(GameActivityMotionEvent), - "::", - stringify!(historicalCount) - ) +} +extern "C" { + #[doc = " Get the current window insets for the IME.\n @param input A valid GameTextInput library handle.\n @param insets Filled with the current insets by this function."] + pub fn GameTextInput_getImeInsets(input: *const GameTextInput, insets: *mut ARect); +} +extern "C" { + #[doc = " Unless using GameActivity, it is required to call this function from your\n Java gametextinput.Listener.onImeInsetsChanged method to\n trigger any event callbacks. When using GameActivity, this does not need to\n be called as insets processing is handled by the Activity.\n @param input A valid GameTextInput library handle.\n @param eventState A Java gametextinput.State object."] + pub fn GameTextInput_processImeInsets(input: *mut GameTextInput, insets: *const ARect); +} +extern "C" { + #[doc = " Convert a GameTextInputState struct to a Java gametextinput.State object.\n Don't forget to delete the returned Java local ref when you're done.\n @param input A valid GameTextInput library handle.\n @param state Input state to convert.\n @return A Java object of class gametextinput.State. The caller is required to\n delete this local reference."] + pub fn GameTextInputState_toJava( + input: *const GameTextInput, + state: *const GameTextInputState, + ) -> jobject; +} +extern "C" { + #[doc = " Convert from a Java gametextinput.State object into a C GameTextInputState\n struct.\n @param input A valid GameTextInput library handle.\n @param state A Java gametextinput.State object.\n @param callback A function called with the C struct, valid for the duration\n of the call.\n @param context Context passed to the callback."] + pub fn GameTextInputState_fromJava( + input: *const GameTextInput, + state: jobject, + callback: GameTextInputGetStateCallback, + context: *mut ::std::os::raw::c_void, ); } -#[doc = " \\brief Describe a key event that happened on the GameActivity SurfaceView."] -#[doc = ""] -#[doc = " This is 1:1 mapping to the information contained in a Java `KeyEvent`"] -#[doc = " (see https://developer.android.com/reference/android/view/KeyEvent)."] +#[doc = " This structure defines the native side of an android.app.GameActivity.\n It is created by the framework, and handed to the application's native\n code as it is being launched."] #[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct GameActivityKeyEvent { - pub deviceId: i32, - pub source: i32, - pub action: i32, - pub eventTime: i64, - pub downTime: i64, - pub flags: i32, - pub metaState: i32, - pub modifiers: i32, - pub repeatCount: i32, - pub keyCode: i32, - pub scanCode: i32, +pub struct GameActivity { + #[doc = " Pointer to the callback function table of the native application.\n You can set the functions here to your own callbacks. The callbacks\n pointer itself here should not be changed; it is allocated and managed\n for you by the framework."] + pub callbacks: *mut GameActivityCallbacks, + #[doc = " The global handle on the process's Java VM."] + pub vm: *mut JavaVM, + #[doc = " JNI context for the main thread of the app. Note that this field\n can ONLY be used from the main thread of the process; that is, the\n thread that calls into the GameActivityCallbacks."] + pub env: *mut JNIEnv, + #[doc = " The GameActivity object handle."] + pub javaGameActivity: jobject, + #[doc = " Path to this application's internal data directory."] + pub internalDataPath: *const ::std::os::raw::c_char, + #[doc = " Path to this application's external (removable/mountable) data directory."] + pub externalDataPath: *const ::std::os::raw::c_char, + #[doc = " The platform's SDK version code."] + pub sdkVersion: i32, + #[doc = " This is the native instance of the application. It is not used by\n the framework, but can be set by the application to its own instance\n state."] + pub instance: *mut ::std::os::raw::c_void, + #[doc = " Pointer to the Asset Manager instance for the application. The\n application uses this to access binary assets bundled inside its own .apk\n file."] + pub assetManager: *mut AAssetManager, + #[doc = " Available starting with Honeycomb: path to the directory containing\n the application's OBB files (if any). If the app doesn't have any\n OBB files, this directory may not exist."] + pub obbPath: *const ::std::os::raw::c_char, } #[test] -fn bindgen_test_layout_GameActivityKeyEvent() { +fn bindgen_test_layout_GameActivity() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 56usize, - concat!("Size of: ", stringify!(GameActivityKeyEvent)) + ::std::mem::size_of::(), + 80usize, + concat!("Size of: ", stringify!(GameActivity)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(GameActivityKeyEvent)) + concat!("Alignment of ", stringify!(GameActivity)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).deviceId as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).callbacks) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(GameActivityKeyEvent), - "::", - stringify!(deviceId) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).source as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(GameActivityKeyEvent), + stringify!(GameActivity), "::", - stringify!(source) + stringify!(callbacks) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).action as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).vm) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(GameActivityKeyEvent), + stringify!(GameActivity), "::", - stringify!(action) + stringify!(vm) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).eventTime as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).env) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", - stringify!(GameActivityKeyEvent), + stringify!(GameActivity), "::", - stringify!(eventTime) + stringify!(env) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).downTime as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).javaGameActivity) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", - stringify!(GameActivityKeyEvent), + stringify!(GameActivity), "::", - stringify!(downTime) + stringify!(javaGameActivity) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).internalDataPath) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", - stringify!(GameActivityKeyEvent), + stringify!(GameActivity), "::", - stringify!(flags) + stringify!(internalDataPath) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).metaState as *const _ as usize }, - 36usize, + unsafe { ::std::ptr::addr_of!((*ptr).externalDataPath) as usize - ptr as usize }, + 40usize, concat!( "Offset of field: ", - stringify!(GameActivityKeyEvent), + stringify!(GameActivity), "::", - stringify!(metaState) + stringify!(externalDataPath) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).modifiers as *const _ as usize }, - 40usize, + unsafe { ::std::ptr::addr_of!((*ptr).sdkVersion) as usize - ptr as usize }, + 48usize, concat!( "Offset of field: ", - stringify!(GameActivityKeyEvent), + stringify!(GameActivity), "::", - stringify!(modifiers) + stringify!(sdkVersion) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).repeatCount as *const _ as usize - }, - 44usize, + unsafe { ::std::ptr::addr_of!((*ptr).instance) as usize - ptr as usize }, + 56usize, concat!( "Offset of field: ", - stringify!(GameActivityKeyEvent), + stringify!(GameActivity), "::", - stringify!(repeatCount) + stringify!(instance) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).keyCode as *const _ as usize }, - 48usize, + unsafe { ::std::ptr::addr_of!((*ptr).assetManager) as usize - ptr as usize }, + 64usize, concat!( "Offset of field: ", - stringify!(GameActivityKeyEvent), + stringify!(GameActivity), "::", - stringify!(keyCode) + stringify!(assetManager) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).scanCode as *const _ as usize }, - 52usize, + unsafe { ::std::ptr::addr_of!((*ptr).obbPath) as usize - ptr as usize }, + 72usize, concat!( "Offset of field: ", - stringify!(GameActivityKeyEvent), + stringify!(GameActivity), "::", - stringify!(scanCode) + stringify!(obbPath) ) ); } -#[doc = " A function the user should call from their callback with the data, its length"] -#[doc = " and the library- supplied context."] +#[doc = " A function the user should call from their callback with the data, its length\n and the library- supplied context."] pub type SaveInstanceStateRecallback = ::std::option::Option< unsafe extern "C" fn( bytes: *const ::std::os::raw::c_char, @@ -3265,18 +3221,11 @@ pub type SaveInstanceStateRecallback = ::std::option::Option< #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct GameActivityCallbacks { - #[doc = " GameActivity has started. See Java documentation for Activity.onStart()"] - #[doc = " for more information."] + #[doc = " GameActivity has started. See Java documentation for Activity.onStart()\n for more information."] pub onStart: ::std::option::Option, - #[doc = " GameActivity has resumed. See Java documentation for Activity.onResume()"] - #[doc = " for more information."] + #[doc = " GameActivity has resumed. See Java documentation for Activity.onResume()\n for more information."] pub onResume: ::std::option::Option, - #[doc = " The framework is asking GameActivity to save its current instance state."] - #[doc = " See the Java documentation for Activity.onSaveInstanceState() for more"] - #[doc = " information. The user should call the recallback with their data, its"] - #[doc = " length and the provided context; they retain ownership of the data. Note"] - #[doc = " that the saved state will be persisted, so it can not contain any active"] - #[doc = " entities (pointers to memory, file descriptors, etc)."] + #[doc = " The framework is asking GameActivity to save its current instance state.\n See the Java documentation for Activity.onSaveInstanceState() for more\n information. The user should call the recallback with their data, its\n length and the provided context; they retain ownership of the data. Note\n that the saved state will be persisted, so it can not contain any active\n entities (pointers to memory, file descriptors, etc)."] pub onSaveInstanceState: ::std::option::Option< unsafe extern "C" fn( activity: *mut GameActivity, @@ -3284,27 +3233,20 @@ pub struct GameActivityCallbacks { context: *mut ::std::os::raw::c_void, ), >, - #[doc = " GameActivity has paused. See Java documentation for Activity.onPause()"] - #[doc = " for more information."] + #[doc = " GameActivity has paused. See Java documentation for Activity.onPause()\n for more information."] pub onPause: ::std::option::Option, - #[doc = " GameActivity has stopped. See Java documentation for Activity.onStop()"] - #[doc = " for more information."] + #[doc = " GameActivity has stopped. See Java documentation for Activity.onStop()\n for more information."] pub onStop: ::std::option::Option, - #[doc = " GameActivity is being destroyed. See Java documentation for"] - #[doc = " Activity.onDestroy() for more information."] + #[doc = " GameActivity is being destroyed. See Java documentation for\n Activity.onDestroy() for more information."] pub onDestroy: ::std::option::Option, - #[doc = " Focus has changed in this GameActivity's window. This is often used,"] - #[doc = " for example, to pause a game when it loses input focus."] + #[doc = " Focus has changed in this GameActivity's window. This is often used,\n for example, to pause a game when it loses input focus."] pub onWindowFocusChanged: ::std::option::Option, - #[doc = " The drawing window for this native activity has been created. You"] - #[doc = " can use the given native window object to start drawing."] + #[doc = " The drawing window for this native activity has been created. You\n can use the given native window object to start drawing."] pub onNativeWindowCreated: ::std::option::Option< unsafe extern "C" fn(activity: *mut GameActivity, window: *mut ANativeWindow), >, - #[doc = " The drawing window for this native activity has been resized. You should"] - #[doc = " retrieve the new size from the window and ensure that your rendering in"] - #[doc = " it now matches."] + #[doc = " The drawing window for this native activity has been resized. You should\n retrieve the new size from the window and ensure that your rendering in\n it now matches."] pub onNativeWindowResized: ::std::option::Option< unsafe extern "C" fn( activity: *mut GameActivity, @@ -3313,77 +3255,62 @@ pub struct GameActivityCallbacks { newHeight: i32, ), >, - #[doc = " The drawing window for this native activity needs to be redrawn. To"] - #[doc = " avoid transient artifacts during screen changes (such resizing after"] - #[doc = " rotation), applications should not return from this function until they"] - #[doc = " have finished drawing their window in its current state."] + #[doc = " The drawing window for this native activity needs to be redrawn. To\n avoid transient artifacts during screen changes (such resizing after\n rotation), applications should not return from this function until they\n have finished drawing their window in its current state."] pub onNativeWindowRedrawNeeded: ::std::option::Option< unsafe extern "C" fn(activity: *mut GameActivity, window: *mut ANativeWindow), >, - #[doc = " The drawing window for this native activity is going to be destroyed."] - #[doc = " You MUST ensure that you do not touch the window object after returning"] - #[doc = " from this function: in the common case of drawing to the window from"] - #[doc = " another thread, that means the implementation of this callback must"] - #[doc = " properly synchronize with the other thread to stop its drawing before"] - #[doc = " returning from here."] + #[doc = " The drawing window for this native activity is going to be destroyed.\n You MUST ensure that you do not touch the window object after returning\n from this function: in the common case of drawing to the window from\n another thread, that means the implementation of this callback must\n properly synchronize with the other thread to stop its drawing before\n returning from here."] pub onNativeWindowDestroyed: ::std::option::Option< unsafe extern "C" fn(activity: *mut GameActivity, window: *mut ANativeWindow), >, - #[doc = " The current device AConfiguration has changed. The new configuration can"] - #[doc = " be retrieved from assetManager."] + #[doc = " The current device AConfiguration has changed. The new configuration can\n be retrieved from assetManager."] pub onConfigurationChanged: ::std::option::Option, - #[doc = " The system is running low on memory. Use this callback to release"] - #[doc = " resources you do not need, to help the system avoid killing more"] - #[doc = " important processes."] + #[doc = " The system is running low on memory. Use this callback to release\n resources you do not need, to help the system avoid killing more\n important processes."] pub onTrimMemory: ::std::option::Option< unsafe extern "C" fn(activity: *mut GameActivity, level: ::std::os::raw::c_int), >, - #[doc = " Callback called for every MotionEvent done on the GameActivity"] - #[doc = " SurfaceView. Ownership of `event` is maintained by the library and it is"] - #[doc = " only valid during the callback."] + #[doc = " Callback called for every MotionEvent done on the GameActivity\n SurfaceView. Ownership of `event` is maintained by the library and it is\n only valid during the callback."] pub onTouchEvent: ::std::option::Option< unsafe extern "C" fn( activity: *mut GameActivity, event: *const GameActivityMotionEvent, - historical: *const GameActivityHistoricalPointerAxes, - historicalLen: ::std::os::raw::c_int, ) -> bool, >, - #[doc = " Callback called for every key down event on the GameActivity SurfaceView."] - #[doc = " Ownership of `event` is maintained by the library and it is only valid"] - #[doc = " during the callback."] + #[doc = " Callback called for every key down event on the GameActivity SurfaceView.\n Ownership of `event` is maintained by the library and it is only valid\n during the callback."] pub onKeyDown: ::std::option::Option< unsafe extern "C" fn( activity: *mut GameActivity, event: *const GameActivityKeyEvent, ) -> bool, >, - #[doc = " Callback called for every key up event on the GameActivity SurfaceView."] - #[doc = " Ownership of `event` is maintained by the library and it is only valid"] - #[doc = " during the callback."] + #[doc = " Callback called for every key up event on the GameActivity SurfaceView.\n Ownership of `event` is maintained by the library and it is only valid\n during the callback."] pub onKeyUp: ::std::option::Option< unsafe extern "C" fn( activity: *mut GameActivity, event: *const GameActivityKeyEvent, ) -> bool, >, - #[doc = " Callback called for every soft-keyboard text input event."] - #[doc = " Ownership of `state` is maintained by the library and it is only valid"] - #[doc = " during the callback."] + #[doc = " Callback called for every soft-keyboard text input event.\n Ownership of `state` is maintained by the library and it is only valid\n during the callback."] pub onTextInputEvent: ::std::option::Option< unsafe extern "C" fn(activity: *mut GameActivity, state: *const GameTextInputState), >, - #[doc = " Callback called when WindowInsets of the main app window have changed."] - #[doc = " Call GameActivity_getWindowInsets to retrieve the insets themselves."] + #[doc = " Callback called when WindowInsets of the main app window have changed.\n Call GameActivity_getWindowInsets to retrieve the insets themselves."] pub onWindowInsetsChanged: ::std::option::Option, + #[doc = " Callback called when the rectangle in the window where the content\n should be placed has changed."] + pub onContentRectChanged: ::std::option::Option< + unsafe extern "C" fn(activity: *mut GameActivity, rect: *const ARect), + >, } #[test] fn bindgen_test_layout_GameActivityCallbacks() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 144usize, + 152usize, concat!("Size of: ", stringify!(GameActivityCallbacks)) ); assert_eq!( @@ -3392,7 +3319,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { concat!("Alignment of ", stringify!(GameActivityCallbacks)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).onStart as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).onStart) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -3402,7 +3329,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).onResume as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).onResume) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -3412,10 +3339,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onSaveInstanceState as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).onSaveInstanceState) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -3425,7 +3349,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).onPause as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).onPause) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -3435,7 +3359,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).onStop as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).onStop) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -3445,7 +3369,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).onDestroy as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).onDestroy) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", @@ -3455,10 +3379,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onWindowFocusChanged as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).onWindowFocusChanged) as usize - ptr as usize }, 48usize, concat!( "Offset of field: ", @@ -3468,10 +3389,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onNativeWindowCreated as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).onNativeWindowCreated) as usize - ptr as usize }, 56usize, concat!( "Offset of field: ", @@ -3481,10 +3399,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onNativeWindowResized as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).onNativeWindowResized) as usize - ptr as usize }, 64usize, concat!( "Offset of field: ", @@ -3494,10 +3409,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onNativeWindowRedrawNeeded as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).onNativeWindowRedrawNeeded) as usize - ptr as usize }, 72usize, concat!( "Offset of field: ", @@ -3507,10 +3419,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onNativeWindowDestroyed as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).onNativeWindowDestroyed) as usize - ptr as usize }, 80usize, concat!( "Offset of field: ", @@ -3520,10 +3429,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onConfigurationChanged as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).onConfigurationChanged) as usize - ptr as usize }, 88usize, concat!( "Offset of field: ", @@ -3533,9 +3439,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onTrimMemory as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).onTrimMemory) as usize - ptr as usize }, 96usize, concat!( "Offset of field: ", @@ -3545,9 +3449,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onTouchEvent as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).onTouchEvent) as usize - ptr as usize }, 104usize, concat!( "Offset of field: ", @@ -3557,7 +3459,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).onKeyDown as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).onKeyDown) as usize - ptr as usize }, 112usize, concat!( "Offset of field: ", @@ -3567,7 +3469,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).onKeyUp as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).onKeyUp) as usize - ptr as usize }, 120usize, concat!( "Offset of field: ", @@ -3577,9 +3479,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onTextInputEvent as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).onTextInputEvent) as usize - ptr as usize }, 128usize, concat!( "Offset of field: ", @@ -3589,10 +3489,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onWindowInsetsChanged as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).onWindowInsetsChanged) as usize - ptr as usize }, 136usize, concat!( "Offset of field: ", @@ -3601,269 +3498,124 @@ fn bindgen_test_layout_GameActivityCallbacks() { stringify!(onWindowInsetsChanged) ) ); -} -extern "C" { - #[doc = " \\brief Convert a Java `MotionEvent` to a `GameActivityMotionEvent`."] - #[doc = ""] - #[doc = " This is done automatically by the GameActivity: see `onTouchEvent` to set"] - #[doc = " a callback to consume the received events."] - #[doc = " This function can be used if you re-implement events handling in your own"] - #[doc = " activity. On return, the out_event->historicalStart will be zero, and should"] - #[doc = " be updated to index into whatever buffer out_historical is copied."] - #[doc = " On return the length of out_historical is"] - #[doc = " (out_event->pointerCount x out_event->historicalCount) and is in a"] - #[doc = " pointer-major order (i.e. all axis for a pointer are contiguous)"] - #[doc = " Ownership of out_event is maintained by the caller."] - pub fn GameActivityMotionEvent_fromJava( - env: *mut JNIEnv, - motionEvent: jobject, - out_event: *mut GameActivityMotionEvent, - out_historical: *mut GameActivityHistoricalPointerAxes, - ) -> ::std::os::raw::c_int; -} -extern "C" { - #[doc = " \\brief Convert a Java `KeyEvent` to a `GameActivityKeyEvent`."] - #[doc = ""] - #[doc = " This is done automatically by the GameActivity: see `onKeyUp` and `onKeyDown`"] - #[doc = " to set a callback to consume the received events."] - #[doc = " This function can be used if you re-implement events handling in your own"] - #[doc = " activity."] - #[doc = " Ownership of out_event is maintained by the caller."] - pub fn GameActivityKeyEvent_fromJava( - env: *mut JNIEnv, - motionEvent: jobject, - out_event: *mut GameActivityKeyEvent, + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).onContentRectChanged) as usize - ptr as usize }, + 144usize, + concat!( + "Offset of field: ", + stringify!(GameActivityCallbacks), + "::", + stringify!(onContentRectChanged) + ) ); } -#[doc = " This is the function that must be in the native code to instantiate the"] -#[doc = " application's native activity. It is called with the activity instance (see"] -#[doc = " above); if the code is being instantiated from a previously saved instance,"] -#[doc = " the savedState will be non-NULL and point to the saved data. You must make"] -#[doc = " any copy of this data you need -- it will be released after you return from"] -#[doc = " this function."] +#[doc = " This is the function that must be in the native code to instantiate the\n application's native activity. It is called with the activity instance (see\n above); if the code is being instantiated from a previously saved instance,\n the savedState will be non-NULL and point to the saved data. You must make\n any copy of this data you need -- it will be released after you return from\n this function."] pub type GameActivity_createFunc = ::std::option::Option< unsafe extern "C" fn( activity: *mut GameActivity, savedState: *mut ::std::os::raw::c_void, - savedStateSize: size_t, + savedStateSize: usize, ), >; extern "C" { - #[doc = " Finish the given activity. Its finish() method will be called, causing it"] - #[doc = " to be stopped and destroyed. Note that this method can be called from"] - #[doc = " *any* thread; it will send a message to the main thread of the process"] - #[doc = " where the Java finish call will take place."] + #[doc = " Finish the given activity. Its finish() method will be called, causing it\n to be stopped and destroyed. Note that this method can be called from\n *any* thread; it will send a message to the main thread of the process\n where the Java finish call will take place."] pub fn GameActivity_finish(activity: *mut GameActivity); } -#[doc = " As long as this window is visible to the user, allow the lock"] -#[doc = " screen to activate while the screen is on. This can be used"] -#[doc = " independently, or in combination with {@link"] -#[doc = " GAMEACTIVITY_FLAG_KEEP_SCREEN_ON} and/or {@link"] -#[doc = " GAMEACTIVITY_FLAG_SHOW_WHEN_LOCKED}"] +#[doc = " As long as this window is visible to the user, allow the lock\n screen to activate while the screen is on. This can be used\n independently, or in combination with {@link\n GAMEACTIVITY_FLAG_KEEP_SCREEN_ON} and/or {@link\n GAMEACTIVITY_FLAG_SHOW_WHEN_LOCKED}"] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_ALLOW_LOCK_WHILE_SCREEN_ON: GameActivitySetWindowFlags = 1; #[doc = " Everything behind this window will be dimmed."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_DIM_BEHIND: GameActivitySetWindowFlags = 2; -#[doc = " Blur everything behind this window."] -#[doc = " @deprecated Blurring is no longer supported."] +#[doc = " Blur everything behind this window.\n @deprecated Blurring is no longer supported."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_BLUR_BEHIND: GameActivitySetWindowFlags = 4; -#[doc = " This window won't ever get key input focus, so the"] -#[doc = " user can not send key or other button events to it. Those will"] -#[doc = " instead go to whatever focusable window is behind it. This flag"] -#[doc = " will also enable {@link GAMEACTIVITY_FLAG_NOT_TOUCH_MODAL} whether or not"] -#[doc = " that is explicitly set."] -#[doc = ""] -#[doc = " Setting this flag also implies that the window will not need to"] -#[doc = " interact with"] -#[doc = " a soft input method, so it will be Z-ordered and positioned"] -#[doc = " independently of any active input method (typically this means it"] -#[doc = " gets Z-ordered on top of the input method, so it can use the full"] -#[doc = " screen for its content and cover the input method if needed. You"] -#[doc = " can use {@link GAMEACTIVITY_FLAG_ALT_FOCUSABLE_IM} to modify this"] -#[doc = " behavior."] +#[doc = " This window won't ever get key input focus, so the\n user can not send key or other button events to it. Those will\n instead go to whatever focusable window is behind it. This flag\n will also enable {@link GAMEACTIVITY_FLAG_NOT_TOUCH_MODAL} whether or not\n that is explicitly set.\n\n Setting this flag also implies that the window will not need to\n interact with\n a soft input method, so it will be Z-ordered and positioned\n independently of any active input method (typically this means it\n gets Z-ordered on top of the input method, so it can use the full\n screen for its content and cover the input method if needed. You\n can use {@link GAMEACTIVITY_FLAG_ALT_FOCUSABLE_IM} to modify this\n behavior."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_NOT_FOCUSABLE: GameActivitySetWindowFlags = 8; #[doc = " This window can never receive touch events."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_NOT_TOUCHABLE: GameActivitySetWindowFlags = 16; -#[doc = " Even when this window is focusable (its"] -#[doc = " {@link GAMEACTIVITY_FLAG_NOT_FOCUSABLE} is not set), allow any pointer"] -#[doc = " events outside of the window to be sent to the windows behind it."] -#[doc = " Otherwise it will consume all pointer events itself, regardless of"] -#[doc = " whether they are inside of the window."] +#[doc = " Even when this window is focusable (its\n {@link GAMEACTIVITY_FLAG_NOT_FOCUSABLE} is not set), allow any pointer\n events outside of the window to be sent to the windows behind it.\n Otherwise it will consume all pointer events itself, regardless of\n whether they are inside of the window."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_NOT_TOUCH_MODAL: GameActivitySetWindowFlags = 32; -#[doc = " When set, if the device is asleep when the touch"] -#[doc = " screen is pressed, you will receive this first touch event. Usually"] -#[doc = " the first touch event is consumed by the system since the user can"] -#[doc = " not see what they are pressing on."] -#[doc = ""] -#[doc = " @deprecated This flag has no effect."] +#[doc = " When set, if the device is asleep when the touch\n screen is pressed, you will receive this first touch event. Usually\n the first touch event is consumed by the system since the user can\n not see what they are pressing on.\n\n @deprecated This flag has no effect."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_TOUCHABLE_WHEN_WAKING: GameActivitySetWindowFlags = 64; -#[doc = " As long as this window is visible to the user, keep"] -#[doc = " the device's screen turned on and bright."] +#[doc = " As long as this window is visible to the user, keep\n the device's screen turned on and bright."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_KEEP_SCREEN_ON: GameActivitySetWindowFlags = 128; -#[doc = " Place the window within the entire screen, ignoring"] -#[doc = " decorations around the border (such as the status bar). The"] -#[doc = " window must correctly position its contents to take the screen"] -#[doc = " decoration into account."] +#[doc = " Place the window within the entire screen, ignoring\n decorations around the border (such as the status bar). The\n window must correctly position its contents to take the screen\n decoration into account."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_LAYOUT_IN_SCREEN: GameActivitySetWindowFlags = 256; #[doc = " Allows the window to extend outside of the screen."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_LAYOUT_NO_LIMITS: GameActivitySetWindowFlags = 512; -#[doc = " Hide all screen decorations (such as the status"] -#[doc = " bar) while this window is displayed. This allows the window to"] -#[doc = " use the entire display space for itself -- the status bar will"] -#[doc = " be hidden when an app window with this flag set is on the top"] -#[doc = " layer. A fullscreen window will ignore a value of {@link"] -#[doc = " GAMEACTIVITY_SOFT_INPUT_ADJUST_RESIZE}; the window will stay"] -#[doc = " fullscreen and will not resize."] +#[doc = " Hide all screen decorations (such as the status\n bar) while this window is displayed. This allows the window to\n use the entire display space for itself -- the status bar will\n be hidden when an app window with this flag set is on the top\n layer. A fullscreen window will ignore a value of {@link\n GAMEACTIVITY_SOFT_INPUT_ADJUST_RESIZE}; the window will stay\n fullscreen and will not resize."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_FULLSCREEN: GameActivitySetWindowFlags = 1024; -#[doc = " Override {@link GAMEACTIVITY_FLAG_FULLSCREEN} and force the"] -#[doc = " screen decorations (such as the status bar) to be shown."] +#[doc = " Override {@link GAMEACTIVITY_FLAG_FULLSCREEN} and force the\n screen decorations (such as the status bar) to be shown."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_FORCE_NOT_FULLSCREEN: GameActivitySetWindowFlags = 2048; -#[doc = " Turn on dithering when compositing this window to"] -#[doc = " the screen."] -#[doc = " @deprecated This flag is no longer used."] +#[doc = " Turn on dithering when compositing this window to\n the screen.\n @deprecated This flag is no longer used."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_DITHER: GameActivitySetWindowFlags = 4096; -#[doc = " Treat the content of the window as secure, preventing"] -#[doc = " it from appearing in screenshots or from being viewed on non-secure"] -#[doc = " displays."] +#[doc = " Treat the content of the window as secure, preventing\n it from appearing in screenshots or from being viewed on non-secure\n displays."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_SECURE: GameActivitySetWindowFlags = 8192; -#[doc = " A special mode where the layout parameters are used"] -#[doc = " to perform scaling of the surface when it is composited to the"] -#[doc = " screen."] +#[doc = " A special mode where the layout parameters are used\n to perform scaling of the surface when it is composited to the\n screen."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_SCALED: GameActivitySetWindowFlags = 16384; -#[doc = " Intended for windows that will often be used when the user is"] -#[doc = " holding the screen against their face, it will aggressively"] -#[doc = " filter the event stream to prevent unintended presses in this"] -#[doc = " situation that may not be desired for a particular window, when"] -#[doc = " such an event stream is detected, the application will receive"] -#[doc = " a {@link AMOTION_EVENT_ACTION_CANCEL} to indicate this so"] -#[doc = " applications can handle this accordingly by taking no action on"] -#[doc = " the event until the finger is released."] +#[doc = " Intended for windows that will often be used when the user is\n holding the screen against their face, it will aggressively\n filter the event stream to prevent unintended presses in this\n situation that may not be desired for a particular window, when\n such an event stream is detected, the application will receive\n a {@link AMOTION_EVENT_ACTION_CANCEL} to indicate this so\n applications can handle this accordingly by taking no action on\n the event until the finger is released."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_IGNORE_CHEEK_PRESSES: GameActivitySetWindowFlags = 32768; -#[doc = " A special option only for use in combination with"] -#[doc = " {@link GAMEACTIVITY_FLAG_LAYOUT_IN_SCREEN}. When requesting layout in"] -#[doc = " the screen your window may appear on top of or behind screen decorations"] -#[doc = " such as the status bar. By also including this flag, the window"] -#[doc = " manager will report the inset rectangle needed to ensure your"] -#[doc = " content is not covered by screen decorations."] +#[doc = " A special option only for use in combination with\n {@link GAMEACTIVITY_FLAG_LAYOUT_IN_SCREEN}. When requesting layout in\n the screen your window may appear on top of or behind screen decorations\n such as the status bar. By also including this flag, the window\n manager will report the inset rectangle needed to ensure your\n content is not covered by screen decorations."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_LAYOUT_INSET_DECOR: GameActivitySetWindowFlags = 65536; -#[doc = " Invert the state of {@link GAMEACTIVITY_FLAG_NOT_FOCUSABLE} with"] -#[doc = " respect to how this window interacts with the current method."] -#[doc = " That is, if FLAG_NOT_FOCUSABLE is set and this flag is set,"] -#[doc = " then the window will behave as if it needs to interact with the"] -#[doc = " input method and thus be placed behind/away from it; if {@link"] -#[doc = " GAMEACTIVITY_FLAG_NOT_FOCUSABLE} is not set and this flag is set,"] -#[doc = " then the window will behave as if it doesn't need to interact"] -#[doc = " with the input method and can be placed to use more space and"] -#[doc = " cover the input method."] +#[doc = " Invert the state of {@link GAMEACTIVITY_FLAG_NOT_FOCUSABLE} with\n respect to how this window interacts with the current method.\n That is, if FLAG_NOT_FOCUSABLE is set and this flag is set,\n then the window will behave as if it needs to interact with the\n input method and thus be placed behind/away from it; if {@link\n GAMEACTIVITY_FLAG_NOT_FOCUSABLE} is not set and this flag is set,\n then the window will behave as if it doesn't need to interact\n with the input method and can be placed to use more space and\n cover the input method."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_ALT_FOCUSABLE_IM: GameActivitySetWindowFlags = 131072; -#[doc = " If you have set {@link GAMEACTIVITY_FLAG_NOT_TOUCH_MODAL}, you"] -#[doc = " can set this flag to receive a single special MotionEvent with"] -#[doc = " the action"] -#[doc = " {@link AMOTION_EVENT_ACTION_OUTSIDE} for"] -#[doc = " touches that occur outside of your window. Note that you will not"] -#[doc = " receive the full down/move/up gesture, only the location of the"] -#[doc = " first down as an {@link AMOTION_EVENT_ACTION_OUTSIDE}."] +#[doc = " If you have set {@link GAMEACTIVITY_FLAG_NOT_TOUCH_MODAL}, you\n can set this flag to receive a single special MotionEvent with\n the action\n {@link AMOTION_EVENT_ACTION_OUTSIDE} for\n touches that occur outside of your window. Note that you will not\n receive the full down/move/up gesture, only the location of the\n first down as an {@link AMOTION_EVENT_ACTION_OUTSIDE}."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_WATCH_OUTSIDE_TOUCH: GameActivitySetWindowFlags = 262144; -#[doc = " Special flag to let windows be shown when the screen"] -#[doc = " is locked. This will let application windows take precedence over"] -#[doc = " key guard or any other lock screens. Can be used with"] -#[doc = " {@link GAMEACTIVITY_FLAG_KEEP_SCREEN_ON} to turn screen on and display"] -#[doc = " windows directly before showing the key guard window. Can be used with"] -#[doc = " {@link GAMEACTIVITY_FLAG_DISMISS_KEYGUARD} to automatically fully"] -#[doc = " dismisss non-secure keyguards. This flag only applies to the top-most"] -#[doc = " full-screen window."] +#[doc = " Special flag to let windows be shown when the screen\n is locked. This will let application windows take precedence over\n key guard or any other lock screens. Can be used with\n {@link GAMEACTIVITY_FLAG_KEEP_SCREEN_ON} to turn screen on and display\n windows directly before showing the key guard window. Can be used with\n {@link GAMEACTIVITY_FLAG_DISMISS_KEYGUARD} to automatically fully\n dismisss non-secure keyguards. This flag only applies to the top-most\n full-screen window."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_SHOW_WHEN_LOCKED: GameActivitySetWindowFlags = 524288; -#[doc = " Ask that the system wallpaper be shown behind"] -#[doc = " your window. The window surface must be translucent to be able"] -#[doc = " to actually see the wallpaper behind it; this flag just ensures"] -#[doc = " that the wallpaper surface will be there if this window actually"] -#[doc = " has translucent regions."] +#[doc = " Ask that the system wallpaper be shown behind\n your window. The window surface must be translucent to be able\n to actually see the wallpaper behind it; this flag just ensures\n that the wallpaper surface will be there if this window actually\n has translucent regions."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_SHOW_WALLPAPER: GameActivitySetWindowFlags = 1048576; -#[doc = " When set as a window is being added or made"] -#[doc = " visible, once the window has been shown then the system will"] -#[doc = " poke the power manager's user activity (as if the user had woken"] -#[doc = " up the device) to turn the screen on."] +#[doc = " When set as a window is being added or made\n visible, once the window has been shown then the system will\n poke the power manager's user activity (as if the user had woken\n up the device) to turn the screen on."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_TURN_SCREEN_ON: GameActivitySetWindowFlags = 2097152; -#[doc = " When set the window will cause the keyguard to"] -#[doc = " be dismissed, only if it is not a secure lock keyguard. Because such"] -#[doc = " a keyguard is not needed for security, it will never re-appear if"] -#[doc = " the user navigates to another window (in contrast to"] -#[doc = " {@link GAMEACTIVITY_FLAG_SHOW_WHEN_LOCKED}, which will only temporarily"] -#[doc = " hide both secure and non-secure keyguards but ensure they reappear"] -#[doc = " when the user moves to another UI that doesn't hide them)."] -#[doc = " If the keyguard is currently active and is secure (requires an"] -#[doc = " unlock pattern) than the user will still need to confirm it before"] -#[doc = " seeing this window, unless {@link GAMEACTIVITY_FLAG_SHOW_WHEN_LOCKED} has"] -#[doc = " also been set."] +#[doc = " When set the window will cause the keyguard to\n be dismissed, only if it is not a secure lock keyguard. Because such\n a keyguard is not needed for security, it will never re-appear if\n the user navigates to another window (in contrast to\n {@link GAMEACTIVITY_FLAG_SHOW_WHEN_LOCKED}, which will only temporarily\n hide both secure and non-secure keyguards but ensure they reappear\n when the user moves to another UI that doesn't hide them).\n If the keyguard is currently active and is secure (requires an\n unlock pattern) than the user will still need to confirm it before\n seeing this window, unless {@link GAMEACTIVITY_FLAG_SHOW_WHEN_LOCKED} has\n also been set."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_DISMISS_KEYGUARD: GameActivitySetWindowFlags = 4194304; -#[doc = " Flags for GameActivity_setWindowFlags,"] -#[doc = " as per the Java API at android.view.WindowManager.LayoutParams."] +#[doc = " Flags for GameActivity_setWindowFlags,\n as per the Java API at android.view.WindowManager.LayoutParams."] pub type GameActivitySetWindowFlags = ::std::os::raw::c_uint; extern "C" { - #[doc = " Change the window flags of the given activity. Calls getWindow().setFlags()"] - #[doc = " of the given activity."] - #[doc = " Note that some flags must be set before the window decoration is created,"] - #[doc = " see"] - #[doc = " https://developer.android.com/reference/android/view/Window#setFlags(int,%20int)."] - #[doc = " Note also that this method can be called from"] - #[doc = " *any* thread; it will send a message to the main thread of the process"] - #[doc = " where the Java finish call will take place."] + #[doc = " Change the window flags of the given activity. Calls getWindow().setFlags()\n of the given activity.\n Note that some flags must be set before the window decoration is created,\n see\n https://developer.android.com/reference/android/view/Window#setFlags(int,%20int).\n Note also that this method can be called from\n *any* thread; it will send a message to the main thread of the process\n where the Java finish call will take place."] pub fn GameActivity_setWindowFlags( activity: *mut GameActivity, addFlags: u32, removeFlags: u32, ); } -#[doc = " Implicit request to show the input window, not as the result"] -#[doc = " of a direct request by the user."] +#[doc = " Implicit request to show the input window, not as the result\n of a direct request by the user."] pub const GameActivityShowSoftInputFlags_GAMEACTIVITY_SHOW_SOFT_INPUT_IMPLICIT: GameActivityShowSoftInputFlags = 1; -#[doc = " The user has forced the input method open (such as by"] -#[doc = " long-pressing menu) so it should not be closed until they"] -#[doc = " explicitly do so."] +#[doc = " The user has forced the input method open (such as by\n long-pressing menu) so it should not be closed until they\n explicitly do so."] pub const GameActivityShowSoftInputFlags_GAMEACTIVITY_SHOW_SOFT_INPUT_FORCED: GameActivityShowSoftInputFlags = 2; -#[doc = " Flags for GameActivity_showSoftInput; see the Java InputMethodManager"] -#[doc = " API for documentation."] +#[doc = " Flags for GameActivity_showSoftInput; see the Java InputMethodManager\n API for documentation."] pub type GameActivityShowSoftInputFlags = ::std::os::raw::c_uint; extern "C" { - #[doc = " Show the IME while in the given activity. Calls"] - #[doc = " InputMethodManager.showSoftInput() for the given activity. Note that this"] - #[doc = " method can be called from *any* thread; it will send a message to the main"] - #[doc = " thread of the process where the Java call will take place."] + #[doc = " Show the IME while in the given activity. Calls\n InputMethodManager.showSoftInput() for the given activity. Note that this\n method can be called from *any* thread; it will send a message to the main\n thread of the process where the Java call will take place."] pub fn GameActivity_showSoftInput(activity: *mut GameActivity, flags: u32); } extern "C" { - #[doc = " Set the text entry state (see documentation of the GameTextInputState struct"] - #[doc = " in the Game Text Input library reference)."] - #[doc = ""] - #[doc = " Ownership of the state is maintained by the caller."] + #[doc = " Set the text entry state (see documentation of the GameTextInputState struct\n in the Game Text Input library reference).\n\n Ownership of the state is maintained by the caller."] pub fn GameActivity_setTextInputState( activity: *mut GameActivity, state: *const GameTextInputState, ); } extern "C" { - #[doc = " Get the last-received text entry state (see documentation of the"] - #[doc = " GameTextInputState struct in the Game Text Input library reference)."] - #[doc = ""] + #[doc = " Get the last-received text entry state (see documentation of the\n GameTextInputState struct in the Game Text Input library reference).\n"] pub fn GameActivity_getTextInputState( activity: *mut GameActivity, callback: GameTextInputGetStateCallback, @@ -3874,29 +3626,20 @@ extern "C" { #[doc = " Get a pointer to the GameTextInput library instance."] pub fn GameActivity_getTextInput(activity: *const GameActivity) -> *mut GameTextInput; } -#[doc = " The soft input window should only be hidden if it was not"] -#[doc = " explicitly shown by the user."] +#[doc = " The soft input window should only be hidden if it was not\n explicitly shown by the user."] pub const GameActivityHideSoftInputFlags_GAMEACTIVITY_HIDE_SOFT_INPUT_IMPLICIT_ONLY: GameActivityHideSoftInputFlags = 1; -#[doc = " The soft input window should normally be hidden, unless it was"] -#[doc = " originally shown with {@link GAMEACTIVITY_SHOW_SOFT_INPUT_FORCED}."] +#[doc = " The soft input window should normally be hidden, unless it was\n originally shown with {@link GAMEACTIVITY_SHOW_SOFT_INPUT_FORCED}."] pub const GameActivityHideSoftInputFlags_GAMEACTIVITY_HIDE_SOFT_INPUT_NOT_ALWAYS: GameActivityHideSoftInputFlags = 2; -#[doc = " Flags for GameActivity_hideSoftInput; see the Java InputMethodManager"] -#[doc = " API for documentation."] +#[doc = " Flags for GameActivity_hideSoftInput; see the Java InputMethodManager\n API for documentation."] pub type GameActivityHideSoftInputFlags = ::std::os::raw::c_uint; extern "C" { - #[doc = " Hide the IME while in the given activity. Calls"] - #[doc = " InputMethodManager.hideSoftInput() for the given activity. Note that this"] - #[doc = " method can be called from *any* thread; it will send a message to the main"] - #[doc = " thread of the process where the Java finish call will take place."] + #[doc = " Hide the IME while in the given activity. Calls\n InputMethodManager.hideSoftInput() for the given activity. Note that this\n method can be called from *any* thread; it will send a message to the main\n thread of the process where the Java finish call will take place."] pub fn GameActivity_hideSoftInput(activity: *mut GameActivity, flags: u32); } extern "C" { - #[doc = " Get the current window insets of the particular component. See"] - #[doc = " https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type"] - #[doc = " for more details."] - #[doc = " You can use these insets to influence what you show on the screen."] + #[doc = " Get the current window insets of the particular component. See\n https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type\n for more details.\n You can use these insets to influence what you show on the screen."] pub fn GameActivity_getWindowInsets( activity: *mut GameActivity, type_: GameCommonInsetsType, @@ -3904,14 +3647,7 @@ extern "C" { ); } extern "C" { - #[doc = " Set options on how the IME behaves when it is requested for text input."] - #[doc = " See"] - #[doc = " https://developer.android.com/reference/android/view/inputmethod/EditorInfo"] - #[doc = " for the meaning of inputType, actionId and imeOptions."] - #[doc = ""] - #[doc = " Note that this function will attach the current thread to the JVM if it is"] - #[doc = " not already attached, so the caller must detach the thread from the JVM"] - #[doc = " before the thread is destroyed using DetachCurrentThread."] + #[doc = " Set options on how the IME behaves when it is requested for text input.\n See\n https://developer.android.com/reference/android/view/inputmethod/EditorInfo\n for the meaning of inputType, actionId and imeOptions.\n\n Note that this function will attach the current thread to the JVM if it is\n not already attached, so the caller must detach the thread from the JVM\n before the thread is destroyed using DetachCurrentThread."] pub fn GameActivity_setImeEditorInfo( activity: *mut GameActivity, inputType: ::std::os::raw::c_int, @@ -3919,92 +3655,152 @@ extern "C" { imeOptions: ::std::os::raw::c_int, ); } -pub const ACONFIGURATION_ORIENTATION_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_ORIENTATION_PORT: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_ORIENTATION_LAND: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_ORIENTATION_SQUARE: ::std::os::raw::c_uint = 3; -pub const ACONFIGURATION_TOUCHSCREEN_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_TOUCHSCREEN_NOTOUCH: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_TOUCHSCREEN_STYLUS: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_TOUCHSCREEN_FINGER: ::std::os::raw::c_uint = 3; -pub const ACONFIGURATION_DENSITY_DEFAULT: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_DENSITY_LOW: ::std::os::raw::c_uint = 120; -pub const ACONFIGURATION_DENSITY_MEDIUM: ::std::os::raw::c_uint = 160; -pub const ACONFIGURATION_DENSITY_TV: ::std::os::raw::c_uint = 213; -pub const ACONFIGURATION_DENSITY_HIGH: ::std::os::raw::c_uint = 240; -pub const ACONFIGURATION_DENSITY_XHIGH: ::std::os::raw::c_uint = 320; -pub const ACONFIGURATION_DENSITY_XXHIGH: ::std::os::raw::c_uint = 480; -pub const ACONFIGURATION_DENSITY_XXXHIGH: ::std::os::raw::c_uint = 640; -pub const ACONFIGURATION_DENSITY_ANY: ::std::os::raw::c_uint = 65534; -pub const ACONFIGURATION_DENSITY_NONE: ::std::os::raw::c_uint = 65535; -pub const ACONFIGURATION_KEYBOARD_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_KEYBOARD_NOKEYS: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_KEYBOARD_QWERTY: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_KEYBOARD_12KEY: ::std::os::raw::c_uint = 3; -pub const ACONFIGURATION_NAVIGATION_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_NAVIGATION_NONAV: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_NAVIGATION_DPAD: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_NAVIGATION_TRACKBALL: ::std::os::raw::c_uint = 3; -pub const ACONFIGURATION_NAVIGATION_WHEEL: ::std::os::raw::c_uint = 4; -pub const ACONFIGURATION_KEYSHIDDEN_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_KEYSHIDDEN_NO: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_KEYSHIDDEN_YES: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_KEYSHIDDEN_SOFT: ::std::os::raw::c_uint = 3; -pub const ACONFIGURATION_NAVHIDDEN_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_NAVHIDDEN_NO: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_NAVHIDDEN_YES: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_SCREENSIZE_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_SCREENSIZE_SMALL: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_SCREENSIZE_NORMAL: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_SCREENSIZE_LARGE: ::std::os::raw::c_uint = 3; -pub const ACONFIGURATION_SCREENSIZE_XLARGE: ::std::os::raw::c_uint = 4; -pub const ACONFIGURATION_SCREENLONG_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_SCREENLONG_NO: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_SCREENLONG_YES: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_SCREENROUND_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_SCREENROUND_NO: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_SCREENROUND_YES: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_WIDE_COLOR_GAMUT_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_WIDE_COLOR_GAMUT_NO: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_WIDE_COLOR_GAMUT_YES: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_HDR_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_HDR_NO: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_HDR_YES: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_UI_MODE_TYPE_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_UI_MODE_TYPE_NORMAL: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_UI_MODE_TYPE_DESK: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_UI_MODE_TYPE_CAR: ::std::os::raw::c_uint = 3; -pub const ACONFIGURATION_UI_MODE_TYPE_TELEVISION: ::std::os::raw::c_uint = 4; -pub const ACONFIGURATION_UI_MODE_TYPE_APPLIANCE: ::std::os::raw::c_uint = 5; -pub const ACONFIGURATION_UI_MODE_TYPE_WATCH: ::std::os::raw::c_uint = 6; -pub const ACONFIGURATION_UI_MODE_TYPE_VR_HEADSET: ::std::os::raw::c_uint = 7; -pub const ACONFIGURATION_UI_MODE_NIGHT_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_UI_MODE_NIGHT_NO: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_UI_MODE_NIGHT_YES: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_SCREEN_WIDTH_DP_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_SCREEN_HEIGHT_DP_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_SMALLEST_SCREEN_WIDTH_DP_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_LAYOUTDIR_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_LAYOUTDIR_LTR: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_LAYOUTDIR_RTL: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_MCC: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_MNC: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_LOCALE: ::std::os::raw::c_uint = 4; -pub const ACONFIGURATION_TOUCHSCREEN: ::std::os::raw::c_uint = 8; -pub const ACONFIGURATION_KEYBOARD: ::std::os::raw::c_uint = 16; -pub const ACONFIGURATION_KEYBOARD_HIDDEN: ::std::os::raw::c_uint = 32; -pub const ACONFIGURATION_NAVIGATION: ::std::os::raw::c_uint = 64; -pub const ACONFIGURATION_ORIENTATION: ::std::os::raw::c_uint = 128; -pub const ACONFIGURATION_DENSITY: ::std::os::raw::c_uint = 256; -pub const ACONFIGURATION_SCREEN_SIZE: ::std::os::raw::c_uint = 512; -pub const ACONFIGURATION_VERSION: ::std::os::raw::c_uint = 1024; -pub const ACONFIGURATION_SCREEN_LAYOUT: ::std::os::raw::c_uint = 2048; -pub const ACONFIGURATION_UI_MODE: ::std::os::raw::c_uint = 4096; -pub const ACONFIGURATION_SMALLEST_SCREEN_SIZE: ::std::os::raw::c_uint = 8192; -pub const ACONFIGURATION_LAYOUTDIR: ::std::os::raw::c_uint = 16384; -pub const ACONFIGURATION_SCREEN_ROUND: ::std::os::raw::c_uint = 32768; -pub const ACONFIGURATION_COLOR_MODE: ::std::os::raw::c_uint = 65536; -pub const ACONFIGURATION_MNC_ZERO: ::std::os::raw::c_uint = 65535; +extern "C" { + #[doc = " These are getters for Configuration class members. They may be called from\n any thread."] + pub fn GameActivity_getOrientation(activity: *mut GameActivity) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getColorMode(activity: *mut GameActivity) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getDensityDpi(activity: *mut GameActivity) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getFontScale(activity: *mut GameActivity) -> f32; +} +extern "C" { + pub fn GameActivity_getFontWeightAdjustment( + activity: *mut GameActivity, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getHardKeyboardHidden(activity: *mut GameActivity) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getKeyboard(activity: *mut GameActivity) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getKeyboardHidden(activity: *mut GameActivity) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getMcc(activity: *mut GameActivity) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getMnc(activity: *mut GameActivity) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getNavigation(activity: *mut GameActivity) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getNavigationHidden(activity: *mut GameActivity) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getScreenHeightDp(activity: *mut GameActivity) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getScreenLayout(activity: *mut GameActivity) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getScreenWidthDp(activity: *mut GameActivity) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getSmallestScreenWidthDp( + activity: *mut GameActivity, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getTouchscreen(activity: *mut GameActivity) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getUIMode(activity: *mut GameActivity) -> ::std::os::raw::c_int; +} +pub const ACONFIGURATION_ORIENTATION_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_ORIENTATION_PORT: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_ORIENTATION_LAND: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_ORIENTATION_SQUARE: _bindgen_ty_21 = 3; +pub const ACONFIGURATION_TOUCHSCREEN_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_TOUCHSCREEN_NOTOUCH: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_TOUCHSCREEN_STYLUS: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_TOUCHSCREEN_FINGER: _bindgen_ty_21 = 3; +pub const ACONFIGURATION_DENSITY_DEFAULT: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_DENSITY_LOW: _bindgen_ty_21 = 120; +pub const ACONFIGURATION_DENSITY_MEDIUM: _bindgen_ty_21 = 160; +pub const ACONFIGURATION_DENSITY_TV: _bindgen_ty_21 = 213; +pub const ACONFIGURATION_DENSITY_HIGH: _bindgen_ty_21 = 240; +pub const ACONFIGURATION_DENSITY_XHIGH: _bindgen_ty_21 = 320; +pub const ACONFIGURATION_DENSITY_XXHIGH: _bindgen_ty_21 = 480; +pub const ACONFIGURATION_DENSITY_XXXHIGH: _bindgen_ty_21 = 640; +pub const ACONFIGURATION_DENSITY_ANY: _bindgen_ty_21 = 65534; +pub const ACONFIGURATION_DENSITY_NONE: _bindgen_ty_21 = 65535; +pub const ACONFIGURATION_KEYBOARD_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_KEYBOARD_NOKEYS: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_KEYBOARD_QWERTY: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_KEYBOARD_12KEY: _bindgen_ty_21 = 3; +pub const ACONFIGURATION_NAVIGATION_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_NAVIGATION_NONAV: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_NAVIGATION_DPAD: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_NAVIGATION_TRACKBALL: _bindgen_ty_21 = 3; +pub const ACONFIGURATION_NAVIGATION_WHEEL: _bindgen_ty_21 = 4; +pub const ACONFIGURATION_KEYSHIDDEN_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_KEYSHIDDEN_NO: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_KEYSHIDDEN_YES: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_KEYSHIDDEN_SOFT: _bindgen_ty_21 = 3; +pub const ACONFIGURATION_NAVHIDDEN_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_NAVHIDDEN_NO: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_NAVHIDDEN_YES: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_SCREENSIZE_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_SCREENSIZE_SMALL: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_SCREENSIZE_NORMAL: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_SCREENSIZE_LARGE: _bindgen_ty_21 = 3; +pub const ACONFIGURATION_SCREENSIZE_XLARGE: _bindgen_ty_21 = 4; +pub const ACONFIGURATION_SCREENLONG_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_SCREENLONG_NO: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_SCREENLONG_YES: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_SCREENROUND_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_SCREENROUND_NO: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_SCREENROUND_YES: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_WIDE_COLOR_GAMUT_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_WIDE_COLOR_GAMUT_NO: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_WIDE_COLOR_GAMUT_YES: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_HDR_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_HDR_NO: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_HDR_YES: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_UI_MODE_TYPE_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_UI_MODE_TYPE_NORMAL: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_UI_MODE_TYPE_DESK: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_UI_MODE_TYPE_CAR: _bindgen_ty_21 = 3; +pub const ACONFIGURATION_UI_MODE_TYPE_TELEVISION: _bindgen_ty_21 = 4; +pub const ACONFIGURATION_UI_MODE_TYPE_APPLIANCE: _bindgen_ty_21 = 5; +pub const ACONFIGURATION_UI_MODE_TYPE_WATCH: _bindgen_ty_21 = 6; +pub const ACONFIGURATION_UI_MODE_TYPE_VR_HEADSET: _bindgen_ty_21 = 7; +pub const ACONFIGURATION_UI_MODE_NIGHT_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_UI_MODE_NIGHT_NO: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_UI_MODE_NIGHT_YES: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_SCREEN_WIDTH_DP_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_SCREEN_HEIGHT_DP_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_SMALLEST_SCREEN_WIDTH_DP_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_LAYOUTDIR_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_LAYOUTDIR_LTR: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_LAYOUTDIR_RTL: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_MCC: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_MNC: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_LOCALE: _bindgen_ty_21 = 4; +pub const ACONFIGURATION_TOUCHSCREEN: _bindgen_ty_21 = 8; +pub const ACONFIGURATION_KEYBOARD: _bindgen_ty_21 = 16; +pub const ACONFIGURATION_KEYBOARD_HIDDEN: _bindgen_ty_21 = 32; +pub const ACONFIGURATION_NAVIGATION: _bindgen_ty_21 = 64; +pub const ACONFIGURATION_ORIENTATION: _bindgen_ty_21 = 128; +pub const ACONFIGURATION_DENSITY: _bindgen_ty_21 = 256; +pub const ACONFIGURATION_SCREEN_SIZE: _bindgen_ty_21 = 512; +pub const ACONFIGURATION_VERSION: _bindgen_ty_21 = 1024; +pub const ACONFIGURATION_SCREEN_LAYOUT: _bindgen_ty_21 = 2048; +pub const ACONFIGURATION_UI_MODE: _bindgen_ty_21 = 4096; +pub const ACONFIGURATION_SMALLEST_SCREEN_SIZE: _bindgen_ty_21 = 8192; +pub const ACONFIGURATION_LAYOUTDIR: _bindgen_ty_21 = 16384; +pub const ACONFIGURATION_SCREEN_ROUND: _bindgen_ty_21 = 32768; +pub const ACONFIGURATION_COLOR_MODE: _bindgen_ty_21 = 65536; +pub const ACONFIGURATION_MNC_ZERO: _bindgen_ty_21 = 65535; pub type _bindgen_ty_21 = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -4015,6 +3811,8 @@ pub struct pollfd { } #[test] fn bindgen_test_layout_pollfd() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 8usize, @@ -4026,7 +3824,7 @@ fn bindgen_test_layout_pollfd() { concat!("Alignment of ", stringify!(pollfd)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).fd as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).fd) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4036,7 +3834,7 @@ fn bindgen_test_layout_pollfd() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).events as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).events) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -4046,7 +3844,7 @@ fn bindgen_test_layout_pollfd() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).revents as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).revents) as usize - ptr as usize }, 6usize, concat!( "Offset of field: ", @@ -4070,6 +3868,8 @@ pub struct sigcontext { } #[test] fn bindgen_test_layout_sigcontext() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 4384usize, @@ -4081,7 +3881,7 @@ fn bindgen_test_layout_sigcontext() { concat!("Alignment of ", stringify!(sigcontext)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).fault_address as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).fault_address) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4091,7 +3891,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).regs as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).regs) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -4101,7 +3901,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sp as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sp) as usize - ptr as usize }, 256usize, concat!( "Offset of field: ", @@ -4111,7 +3911,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pc as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pc) as usize - ptr as usize }, 264usize, concat!( "Offset of field: ", @@ -4121,7 +3921,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pstate as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pstate) as usize - ptr as usize }, 272usize, concat!( "Offset of field: ", @@ -4131,7 +3931,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).__reserved as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).__reserved) as usize - ptr as usize }, 288usize, concat!( "Offset of field: ", @@ -4149,6 +3949,8 @@ pub struct _aarch64_ctx { } #[test] fn bindgen_test_layout__aarch64_ctx() { + const UNINIT: ::std::mem::MaybeUninit<_aarch64_ctx> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_aarch64_ctx>(), 8usize, @@ -4160,7 +3962,7 @@ fn bindgen_test_layout__aarch64_ctx() { concat!("Alignment of ", stringify!(_aarch64_ctx)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_aarch64_ctx>())).magic as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).magic) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4170,7 +3972,7 @@ fn bindgen_test_layout__aarch64_ctx() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_aarch64_ctx>())).size as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -4191,6 +3993,8 @@ pub struct fpsimd_context { } #[test] fn bindgen_test_layout_fpsimd_context() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 528usize, @@ -4202,7 +4006,7 @@ fn bindgen_test_layout_fpsimd_context() { concat!("Alignment of ", stringify!(fpsimd_context)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).head as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4212,7 +4016,7 @@ fn bindgen_test_layout_fpsimd_context() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).fpsr as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).fpsr) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -4222,7 +4026,7 @@ fn bindgen_test_layout_fpsimd_context() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).fpcr as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).fpcr) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", @@ -4232,7 +4036,7 @@ fn bindgen_test_layout_fpsimd_context() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).vregs as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).vregs) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -4250,6 +4054,8 @@ pub struct esr_context { } #[test] fn bindgen_test_layout_esr_context() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 16usize, @@ -4261,7 +4067,7 @@ fn bindgen_test_layout_esr_context() { concat!("Alignment of ", stringify!(esr_context)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).head as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4271,7 +4077,7 @@ fn bindgen_test_layout_esr_context() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).esr as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).esr) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -4291,6 +4097,8 @@ pub struct extra_context { } #[test] fn bindgen_test_layout_extra_context() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 32usize, @@ -4302,7 +4110,7 @@ fn bindgen_test_layout_extra_context() { concat!("Alignment of ", stringify!(extra_context)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).head as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4312,7 +4120,7 @@ fn bindgen_test_layout_extra_context() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).datap as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).datap) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -4322,7 +4130,7 @@ fn bindgen_test_layout_extra_context() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).size as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -4332,7 +4140,7 @@ fn bindgen_test_layout_extra_context() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).__reserved as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).__reserved) as usize - ptr as usize }, 20usize, concat!( "Offset of field: ", @@ -4351,6 +4159,8 @@ pub struct sve_context { } #[test] fn bindgen_test_layout_sve_context() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 16usize, @@ -4362,7 +4172,7 @@ fn bindgen_test_layout_sve_context() { concat!("Alignment of ", stringify!(sve_context)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).head as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4372,7 +4182,7 @@ fn bindgen_test_layout_sve_context() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).vl as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).vl) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -4382,7 +4192,7 @@ fn bindgen_test_layout_sve_context() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).__reserved as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).__reserved) as usize - ptr as usize }, 10usize, concat!( "Offset of field: ", @@ -4399,6 +4209,8 @@ pub struct sigset_t { } #[test] fn bindgen_test_layout_sigset_t() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 8usize, @@ -4410,7 +4222,7 @@ fn bindgen_test_layout_sigset_t() { concat!("Alignment of ", stringify!(sigset_t)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sig as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sig) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4435,6 +4247,8 @@ pub struct __kernel_sigaction { } #[test] fn bindgen_test_layout___kernel_sigaction() { + const UNINIT: ::std::mem::MaybeUninit<__kernel_sigaction> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__kernel_sigaction>(), 32usize, @@ -4446,7 +4260,7 @@ fn bindgen_test_layout___kernel_sigaction() { concat!("Alignment of ", stringify!(__kernel_sigaction)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_sigaction>())).sa_handler as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sa_handler) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4456,7 +4270,7 @@ fn bindgen_test_layout___kernel_sigaction() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_sigaction>())).sa_flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sa_flags) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -4466,7 +4280,7 @@ fn bindgen_test_layout___kernel_sigaction() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_sigaction>())).sa_restorer as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sa_restorer) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -4476,7 +4290,7 @@ fn bindgen_test_layout___kernel_sigaction() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_sigaction>())).sa_mask as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sa_mask) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -4487,13 +4301,16 @@ fn bindgen_test_layout___kernel_sigaction() { ); } #[repr(C)] +#[derive(Debug, Copy, Clone)] pub struct sigaltstack { pub ss_sp: *mut ::std::os::raw::c_void, pub ss_flags: ::std::os::raw::c_int, - pub ss_size: size_t, + pub ss_size: __kernel_size_t, } #[test] fn bindgen_test_layout_sigaltstack() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 24usize, @@ -4505,7 +4322,7 @@ fn bindgen_test_layout_sigaltstack() { concat!("Alignment of ", stringify!(sigaltstack)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ss_sp as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ss_sp) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4515,7 +4332,7 @@ fn bindgen_test_layout_sigaltstack() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ss_flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ss_flags) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -4525,7 +4342,7 @@ fn bindgen_test_layout_sigaltstack() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ss_size as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ss_size) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -4544,6 +4361,8 @@ pub union sigval { } #[test] fn bindgen_test_layout_sigval() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 8usize, @@ -4555,7 +4374,7 @@ fn bindgen_test_layout_sigval() { concat!("Alignment of ", stringify!(sigval)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sival_int as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sival_int) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4565,7 +4384,7 @@ fn bindgen_test_layout_sigval() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sival_ptr as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sival_ptr) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4595,6 +4414,9 @@ pub struct __sifields__bindgen_ty_1 { } #[test] fn bindgen_test_layout___sifields__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_1> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__sifields__bindgen_ty_1>(), 8usize, @@ -4606,7 +4428,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_1() { concat!("Alignment of ", stringify!(__sifields__bindgen_ty_1)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_1>()))._pid as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._pid) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4616,7 +4438,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_1() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_1>()))._uid as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._uid) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -4636,6 +4458,9 @@ pub struct __sifields__bindgen_ty_2 { } #[test] fn bindgen_test_layout___sifields__bindgen_ty_2() { + const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_2> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__sifields__bindgen_ty_2>(), 24usize, @@ -4647,7 +4472,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_2() { concat!("Alignment of ", stringify!(__sifields__bindgen_ty_2)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_2>()))._tid as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._tid) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4657,9 +4482,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_2() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_2>()))._overrun as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._overrun) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -4669,9 +4492,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_2() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_2>()))._sigval as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._sigval) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -4681,9 +4502,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_2() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_2>()))._sys_private as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._sys_private) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -4702,6 +4521,9 @@ pub struct __sifields__bindgen_ty_3 { } #[test] fn bindgen_test_layout___sifields__bindgen_ty_3() { + const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_3> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__sifields__bindgen_ty_3>(), 16usize, @@ -4713,7 +4535,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_3() { concat!("Alignment of ", stringify!(__sifields__bindgen_ty_3)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_3>()))._pid as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._pid) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4723,7 +4545,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_3() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_3>()))._uid as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._uid) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -4733,9 +4555,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_3() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_3>()))._sigval as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._sigval) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -4756,6 +4576,9 @@ pub struct __sifields__bindgen_ty_4 { } #[test] fn bindgen_test_layout___sifields__bindgen_ty_4() { + const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_4> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__sifields__bindgen_ty_4>(), 32usize, @@ -4767,7 +4590,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_4() { concat!("Alignment of ", stringify!(__sifields__bindgen_ty_4)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_4>()))._pid as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._pid) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4777,7 +4600,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_4() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_4>()))._uid as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._uid) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -4787,9 +4610,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_4() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_4>()))._status as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._status) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -4799,7 +4620,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_4() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_4>()))._utime as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._utime) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -4809,7 +4630,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_4() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_4>()))._stime as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._stime) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -4828,9 +4649,11 @@ 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)] @@ -4841,6 +4664,9 @@ pub struct __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1 { } #[test] fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1>(), 24usize, @@ -4858,10 +4684,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1>())) - ._dummy_bnd as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._dummy_bnd) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4871,10 +4694,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1>()))._lower - as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._lower) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -4884,10 +4704,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1>()))._upper - as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._upper) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -4905,6 +4722,9 @@ pub struct __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2 { } #[test] fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2() { + const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2>(), 12usize, @@ -4922,10 +4742,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2>())) - ._dummy_pkey as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._dummy_pkey) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4935,10 +4752,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2>()))._pkey - as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._pkey) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -4948,8 +4762,59 @@ 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() { + const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + 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::addr_of!((*ptr)._data) as usize - ptr 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::addr_of!((*ptr)._type) as usize - ptr 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() { + const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_5__bindgen_ty_1> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__sifields__bindgen_ty_5__bindgen_ty_1>(), 24usize, @@ -4967,10 +4832,17 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1>()))._addr_lsb as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._trapno) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__sifields__bindgen_ty_5__bindgen_ty_1), + "::", + stringify!(_trapno) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._addr_lsb) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4980,10 +4852,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1>()))._addr_bnd as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._addr_bnd) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4993,10 +4862,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1>()))._addr_pkey - as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._addr_pkey) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5005,9 +4871,22 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1() { stringify!(_addr_pkey) ) ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._perf) as usize - ptr 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() { + const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_5> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__sifields__bindgen_ty_5>(), 32usize, @@ -5019,7 +4898,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_5() { concat!("Alignment of ", stringify!(__sifields__bindgen_ty_5)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_5>()))._addr as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._addr) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5037,6 +4916,9 @@ pub struct __sifields__bindgen_ty_6 { } #[test] fn bindgen_test_layout___sifields__bindgen_ty_6() { + const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_6> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__sifields__bindgen_ty_6>(), 16usize, @@ -5048,7 +4930,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_6() { concat!("Alignment of ", stringify!(__sifields__bindgen_ty_6)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_6>()))._band as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._band) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5058,7 +4940,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_6() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_6>()))._fd as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._fd) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -5077,6 +4959,9 @@ pub struct __sifields__bindgen_ty_7 { } #[test] fn bindgen_test_layout___sifields__bindgen_ty_7() { + const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_7> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__sifields__bindgen_ty_7>(), 16usize, @@ -5088,9 +4973,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_7() { concat!("Alignment of ", stringify!(__sifields__bindgen_ty_7)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_7>()))._call_addr as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._call_addr) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5100,9 +4983,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_7() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_7>()))._syscall as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._syscall) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -5112,7 +4993,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_7() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_7>()))._arch as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._arch) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", @@ -5124,6 +5005,8 @@ fn bindgen_test_layout___sifields__bindgen_ty_7() { } #[test] fn bindgen_test_layout___sifields() { + const UNINIT: ::std::mem::MaybeUninit<__sifields> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__sifields>(), 32usize, @@ -5135,7 +5018,7 @@ fn bindgen_test_layout___sifields() { concat!("Alignment of ", stringify!(__sifields)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields>()))._kill as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._kill) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5145,7 +5028,7 @@ fn bindgen_test_layout___sifields() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields>()))._timer as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._timer) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5155,7 +5038,7 @@ fn bindgen_test_layout___sifields() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields>()))._rt as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._rt) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5165,7 +5048,7 @@ fn bindgen_test_layout___sifields() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields>()))._sigchld as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._sigchld) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5175,7 +5058,7 @@ fn bindgen_test_layout___sifields() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields>()))._sigfault as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._sigfault) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5185,7 +5068,7 @@ fn bindgen_test_layout___sifields() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields>()))._sigpoll as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._sigpoll) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5195,7 +5078,7 @@ fn bindgen_test_layout___sifields() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields>()))._sigsys as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._sigsys) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5226,6 +5109,9 @@ pub struct siginfo__bindgen_ty_1__bindgen_ty_1 { } #[test] fn bindgen_test_layout_siginfo__bindgen_ty_1__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 48usize, @@ -5240,10 +5126,7 @@ fn bindgen_test_layout_siginfo__bindgen_ty_1__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).si_signo as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).si_signo) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5253,10 +5136,7 @@ fn bindgen_test_layout_siginfo__bindgen_ty_1__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).si_errno as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).si_errno) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -5266,10 +5146,7 @@ fn bindgen_test_layout_siginfo__bindgen_ty_1__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).si_code as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).si_code) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -5279,10 +5156,7 @@ fn bindgen_test_layout_siginfo__bindgen_ty_1__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::()))._sifields as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._sifields) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -5294,6 +5168,9 @@ fn bindgen_test_layout_siginfo__bindgen_ty_1__bindgen_ty_1() { } #[test] fn bindgen_test_layout_siginfo__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 128usize, @@ -5305,7 +5182,7 @@ fn bindgen_test_layout_siginfo__bindgen_ty_1() { concat!("Alignment of ", stringify!(siginfo__bindgen_ty_1)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::()))._si_pad as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._si_pad) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5352,6 +5229,9 @@ pub struct sigevent__bindgen_ty_1__bindgen_ty_1 { } #[test] fn bindgen_test_layout_sigevent__bindgen_ty_1__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 16usize, @@ -5369,10 +5249,7 @@ fn bindgen_test_layout_sigevent__bindgen_ty_1__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::()))._function as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._function) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5382,10 +5259,7 @@ fn bindgen_test_layout_sigevent__bindgen_ty_1__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::()))._attribute as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._attribute) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -5397,6 +5271,9 @@ fn bindgen_test_layout_sigevent__bindgen_ty_1__bindgen_ty_1() { } #[test] fn bindgen_test_layout_sigevent__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 48usize, @@ -5408,7 +5285,7 @@ fn bindgen_test_layout_sigevent__bindgen_ty_1() { concat!("Alignment of ", stringify!(sigevent__bindgen_ty_1)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::()))._pad as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._pad) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5418,7 +5295,7 @@ fn bindgen_test_layout_sigevent__bindgen_ty_1() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::()))._tid as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._tid) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5428,9 +5305,7 @@ fn bindgen_test_layout_sigevent__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::()))._sigev_thread as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._sigev_thread) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5442,6 +5317,8 @@ fn bindgen_test_layout_sigevent__bindgen_ty_1() { } #[test] fn bindgen_test_layout_sigevent() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 64usize, @@ -5453,7 +5330,7 @@ fn bindgen_test_layout_sigevent() { concat!("Alignment of ", stringify!(sigevent)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sigev_value as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sigev_value) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5463,7 +5340,7 @@ fn bindgen_test_layout_sigevent() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sigev_signo as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sigev_signo) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -5473,7 +5350,7 @@ fn bindgen_test_layout_sigevent() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sigev_notify as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sigev_notify) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", @@ -5483,7 +5360,7 @@ fn bindgen_test_layout_sigevent() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::()))._sigev_un as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._sigev_un) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -5520,6 +5397,9 @@ pub union sigaction__bindgen_ty_1 { } #[test] fn bindgen_test_layout_sigaction__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 8usize, @@ -5531,9 +5411,7 @@ fn bindgen_test_layout_sigaction__bindgen_ty_1() { concat!("Alignment of ", stringify!(sigaction__bindgen_ty_1)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).sa_handler as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).sa_handler) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5543,9 +5421,7 @@ fn bindgen_test_layout_sigaction__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).sa_sigaction as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).sa_sigaction) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5557,6 +5433,8 @@ fn bindgen_test_layout_sigaction__bindgen_ty_1() { } #[test] fn bindgen_test_layout_sigaction() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 32usize, @@ -5568,7 +5446,7 @@ fn bindgen_test_layout_sigaction() { concat!("Alignment of ", stringify!(sigaction)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sa_flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sa_flags) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5578,7 +5456,7 @@ fn bindgen_test_layout_sigaction() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sa_mask as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sa_mask) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -5588,7 +5466,7 @@ fn bindgen_test_layout_sigaction() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sa_restorer as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sa_restorer) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -5620,6 +5498,9 @@ pub union sigaction64__bindgen_ty_1 { } #[test] fn bindgen_test_layout_sigaction64__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 8usize, @@ -5631,9 +5512,7 @@ fn bindgen_test_layout_sigaction64__bindgen_ty_1() { concat!("Alignment of ", stringify!(sigaction64__bindgen_ty_1)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).sa_handler as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).sa_handler) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5643,9 +5522,7 @@ fn bindgen_test_layout_sigaction64__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).sa_sigaction as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).sa_sigaction) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5657,6 +5534,8 @@ fn bindgen_test_layout_sigaction64__bindgen_ty_1() { } #[test] fn bindgen_test_layout_sigaction64() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 32usize, @@ -5668,7 +5547,7 @@ fn bindgen_test_layout_sigaction64() { concat!("Alignment of ", stringify!(sigaction64)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sa_flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sa_flags) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5678,7 +5557,7 @@ fn bindgen_test_layout_sigaction64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sa_mask as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sa_mask) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -5688,7 +5567,7 @@ fn bindgen_test_layout_sigaction64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sa_restorer as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sa_restorer) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -5706,6 +5585,8 @@ pub struct timespec { } #[test] fn bindgen_test_layout_timespec() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 16usize, @@ -5717,7 +5598,7 @@ fn bindgen_test_layout_timespec() { concat!("Alignment of ", stringify!(timespec)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tv_sec as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5727,7 +5608,7 @@ fn bindgen_test_layout_timespec() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tv_nsec as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tv_nsec) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -5747,6 +5628,8 @@ pub struct user_regs_struct { } #[test] fn bindgen_test_layout_user_regs_struct() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 272usize, @@ -5758,7 +5641,7 @@ fn bindgen_test_layout_user_regs_struct() { concat!("Alignment of ", stringify!(user_regs_struct)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).regs as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).regs) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5768,7 +5651,7 @@ fn bindgen_test_layout_user_regs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sp as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sp) as usize - ptr as usize }, 248usize, concat!( "Offset of field: ", @@ -5778,7 +5661,7 @@ fn bindgen_test_layout_user_regs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pc as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pc) as usize - ptr as usize }, 256usize, concat!( "Offset of field: ", @@ -5788,7 +5671,7 @@ fn bindgen_test_layout_user_regs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pstate as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pstate) as usize - ptr as usize }, 264usize, concat!( "Offset of field: ", @@ -5808,6 +5691,8 @@ pub struct user_fpsimd_struct { } #[test] fn bindgen_test_layout_user_fpsimd_struct() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 528usize, @@ -5819,7 +5704,7 @@ fn bindgen_test_layout_user_fpsimd_struct() { concat!("Alignment of ", stringify!(user_fpsimd_struct)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).vregs as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).vregs) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5829,7 +5714,7 @@ fn bindgen_test_layout_user_fpsimd_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).fpsr as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).fpsr) as usize - ptr as usize }, 512usize, concat!( "Offset of field: ", @@ -5839,7 +5724,7 @@ fn bindgen_test_layout_user_fpsimd_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).fpcr as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).fpcr) as usize - ptr as usize }, 516usize, concat!( "Offset of field: ", @@ -5855,6 +5740,7 @@ pub type fpregset_t = user_fpsimd_struct; pub type mcontext_t = sigcontext; #[repr(C)] #[repr(align(16))] +#[derive(Copy, Clone)] pub struct ucontext { pub uc_flags: ::std::os::raw::c_ulong, pub uc_link: *mut ucontext, @@ -5872,6 +5758,9 @@ pub union ucontext__bindgen_ty_1 { } #[test] fn bindgen_test_layout_ucontext__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 8usize, @@ -5883,9 +5772,7 @@ fn bindgen_test_layout_ucontext__bindgen_ty_1() { concat!("Alignment of ", stringify!(ucontext__bindgen_ty_1)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).uc_sigmask as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).uc_sigmask) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5895,9 +5782,7 @@ fn bindgen_test_layout_ucontext__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).uc_sigmask64 as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).uc_sigmask64) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5909,6 +5794,8 @@ fn bindgen_test_layout_ucontext__bindgen_ty_1() { } #[test] fn bindgen_test_layout_ucontext() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 4560usize, @@ -5920,7 +5807,7 @@ fn bindgen_test_layout_ucontext() { concat!("Alignment of ", stringify!(ucontext)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).uc_flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).uc_flags) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5930,7 +5817,7 @@ fn bindgen_test_layout_ucontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).uc_link as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).uc_link) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -5940,7 +5827,7 @@ fn bindgen_test_layout_ucontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).uc_stack as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).uc_stack) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -5950,7 +5837,7 @@ fn bindgen_test_layout_ucontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).__padding as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).__padding) as usize - ptr as usize }, 48usize, concat!( "Offset of field: ", @@ -5960,7 +5847,7 @@ fn bindgen_test_layout_ucontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).uc_mcontext as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).uc_mcontext) as usize - ptr as usize }, 176usize, concat!( "Offset of field: ", @@ -6174,6 +6061,8 @@ pub struct __kernel_timespec { } #[test] fn bindgen_test_layout___kernel_timespec() { + const UNINIT: ::std::mem::MaybeUninit<__kernel_timespec> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__kernel_timespec>(), 16usize, @@ -6185,7 +6074,7 @@ fn bindgen_test_layout___kernel_timespec() { concat!("Alignment of ", stringify!(__kernel_timespec)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_timespec>())).tv_sec as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6195,7 +6084,7 @@ fn bindgen_test_layout___kernel_timespec() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_timespec>())).tv_nsec as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tv_nsec) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -6213,6 +6102,8 @@ pub struct __kernel_itimerspec { } #[test] fn bindgen_test_layout___kernel_itimerspec() { + const UNINIT: ::std::mem::MaybeUninit<__kernel_itimerspec> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__kernel_itimerspec>(), 32usize, @@ -6224,7 +6115,7 @@ fn bindgen_test_layout___kernel_itimerspec() { concat!("Alignment of ", stringify!(__kernel_itimerspec)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_itimerspec>())).it_interval as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).it_interval) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6234,7 +6125,7 @@ fn bindgen_test_layout___kernel_itimerspec() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_itimerspec>())).it_value as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).it_value) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -6246,40 +6137,43 @@ fn bindgen_test_layout___kernel_itimerspec() { } #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct __kernel_old_timeval { - pub tv_sec: __kernel_long_t, - pub tv_usec: __kernel_long_t, +pub struct __kernel_old_timespec { + pub tv_sec: __kernel_old_time_t, + pub tv_nsec: ::std::os::raw::c_long, } #[test] -fn bindgen_test_layout___kernel_old_timeval() { +fn bindgen_test_layout___kernel_old_timespec() { + const UNINIT: ::std::mem::MaybeUninit<__kernel_old_timespec> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::<__kernel_old_timeval>(), + ::std::mem::size_of::<__kernel_old_timespec>(), 16usize, - concat!("Size of: ", stringify!(__kernel_old_timeval)) + concat!("Size of: ", stringify!(__kernel_old_timespec)) ); assert_eq!( - ::std::mem::align_of::<__kernel_old_timeval>(), + ::std::mem::align_of::<__kernel_old_timespec>(), 8usize, - concat!("Alignment of ", stringify!(__kernel_old_timeval)) + concat!("Alignment of ", stringify!(__kernel_old_timespec)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_old_timeval>())).tv_sec as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(__kernel_old_timeval), + stringify!(__kernel_old_timespec), "::", stringify!(tv_sec) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_old_timeval>())).tv_usec as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tv_nsec) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(__kernel_old_timeval), + stringify!(__kernel_old_timespec), "::", - stringify!(tv_usec) + stringify!(tv_nsec) ) ); } @@ -6291,6 +6185,9 @@ pub struct __kernel_sock_timeval { } #[test] fn bindgen_test_layout___kernel_sock_timeval() { + const UNINIT: ::std::mem::MaybeUninit<__kernel_sock_timeval> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__kernel_sock_timeval>(), 16usize, @@ -6302,7 +6199,7 @@ fn bindgen_test_layout___kernel_sock_timeval() { concat!("Alignment of ", stringify!(__kernel_sock_timeval)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_sock_timeval>())).tv_sec as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6312,7 +6209,7 @@ fn bindgen_test_layout___kernel_sock_timeval() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_sock_timeval>())).tv_usec as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tv_usec) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -6325,11 +6222,13 @@ fn bindgen_test_layout___kernel_sock_timeval() { #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct timeval { - pub tv_sec: __kernel_time_t, + pub tv_sec: __kernel_old_time_t, pub tv_usec: __kernel_suseconds_t, } #[test] fn bindgen_test_layout_timeval() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 16usize, @@ -6341,7 +6240,7 @@ fn bindgen_test_layout_timeval() { concat!("Alignment of ", stringify!(timeval)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tv_sec as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6351,7 +6250,7 @@ fn bindgen_test_layout_timeval() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tv_usec as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tv_usec) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -6363,51 +6262,14 @@ 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, } #[test] fn bindgen_test_layout_itimerspec() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 32usize, @@ -6419,7 +6281,7 @@ fn bindgen_test_layout_itimerspec() { concat!("Alignment of ", stringify!(itimerspec)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).it_interval as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).it_interval) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6429,7 +6291,7 @@ fn bindgen_test_layout_itimerspec() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).it_value as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).it_value) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -6447,6 +6309,8 @@ pub struct itimerval { } #[test] fn bindgen_test_layout_itimerval() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 32usize, @@ -6458,7 +6322,7 @@ fn bindgen_test_layout_itimerval() { concat!("Alignment of ", stringify!(itimerval)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).it_interval as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).it_interval) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6468,7 +6332,7 @@ fn bindgen_test_layout_itimerval() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).it_value as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).it_value) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -6478,6 +6342,47 @@ 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() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + 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::addr_of!((*ptr).tz_minuteswest) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(timezone), + "::", + stringify!(tz_minuteswest) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tz_dsttime) as usize - ptr 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)] @@ -6486,6 +6391,8 @@ pub struct fd_set { } #[test] fn bindgen_test_layout_fd_set() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 128usize, @@ -6497,7 +6404,7 @@ fn bindgen_test_layout_fd_set() { concat!("Alignment of ", stringify!(fd_set)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).fds_bits as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).fds_bits) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6508,21 +6415,21 @@ fn bindgen_test_layout_fd_set() { ); } extern "C" { - pub fn __FD_CLR_chk(arg1: ::std::os::raw::c_int, arg2: *mut fd_set, arg3: size_t); + pub fn __FD_CLR_chk(arg1: ::std::os::raw::c_int, arg2: *mut fd_set, arg3: usize); } extern "C" { - pub fn __FD_SET_chk(arg1: ::std::os::raw::c_int, arg2: *mut fd_set, arg3: size_t); + pub fn __FD_SET_chk(arg1: ::std::os::raw::c_int, arg2: *mut fd_set, arg3: usize); } extern "C" { pub fn __FD_ISSET_chk( arg1: ::std::os::raw::c_int, arg2: *const fd_set, - arg3: size_t, + arg3: usize, ) -> ::std::os::raw::c_int; } extern "C" { pub fn select( - __fd_count: ::std::os::raw::c_int, + __max_fd_plus_one: ::std::os::raw::c_int, __read_fds: *mut fd_set, __write_fds: *mut fd_set, __exception_fds: *mut fd_set, @@ -6531,7 +6438,7 @@ extern "C" { } extern "C" { pub fn pselect( - __fd_count: ::std::os::raw::c_int, + __max_fd_plus_one: ::std::os::raw::c_int, __read_fds: *mut fd_set, __write_fds: *mut fd_set, __exception_fds: *mut fd_set, @@ -6541,7 +6448,7 @@ extern "C" { } extern "C" { pub fn pselect64( - __fd_count: ::std::os::raw::c_int, + __max_fd_plus_one: ::std::os::raw::c_int, __read_fds: *mut fd_set, __write_fds: *mut fd_set, __exception_fds: *mut fd_set, @@ -6606,6 +6513,8 @@ pub struct tm { } #[test] fn bindgen_test_layout_tm() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 56usize, @@ -6617,7 +6526,7 @@ fn bindgen_test_layout_tm() { concat!("Alignment of ", stringify!(tm)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tm_sec as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tm_sec) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6627,7 +6536,7 @@ fn bindgen_test_layout_tm() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tm_min as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tm_min) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -6637,7 +6546,7 @@ fn bindgen_test_layout_tm() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tm_hour as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tm_hour) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -6647,7 +6556,7 @@ fn bindgen_test_layout_tm() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tm_mday as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tm_mday) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", @@ -6657,7 +6566,7 @@ fn bindgen_test_layout_tm() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tm_mon as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tm_mon) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -6667,7 +6576,7 @@ fn bindgen_test_layout_tm() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tm_year as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tm_year) as usize - ptr as usize }, 20usize, concat!( "Offset of field: ", @@ -6677,7 +6586,7 @@ fn bindgen_test_layout_tm() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tm_wday as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tm_wday) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -6687,7 +6596,7 @@ fn bindgen_test_layout_tm() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tm_yday as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tm_yday) as usize - ptr as usize }, 28usize, concat!( "Offset of field: ", @@ -6697,7 +6606,7 @@ fn bindgen_test_layout_tm() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tm_isdst as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tm_isdst) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -6707,7 +6616,7 @@ fn bindgen_test_layout_tm() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tm_gmtoff as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tm_gmtoff) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", @@ -6717,7 +6626,7 @@ fn bindgen_test_layout_tm() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tm_zone as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tm_zone) as usize - ptr as usize }, 48usize, concat!( "Offset of field: ", @@ -6781,19 +6690,19 @@ extern "C" { extern "C" { pub fn strftime( __buf: *mut ::std::os::raw::c_char, - __n: size_t, + __n: usize, __fmt: *const ::std::os::raw::c_char, __tm: *const tm, - ) -> size_t; + ) -> usize; } extern "C" { pub fn strftime_l( __buf: *mut ::std::os::raw::c_char, - __n: size_t, + __n: usize, __fmt: *const ::std::os::raw::c_char, __tm: *const tm, __l: locale_t, - ) -> size_t; + ) -> usize; } extern "C" { pub fn ctime(__t: *const time_t) -> *mut ::std::os::raw::c_char; @@ -6901,12 +6810,17 @@ 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() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 64usize, + 88usize, concat!("Size of: ", stringify!(clone_args)) ); assert_eq!( @@ -6915,7 +6829,7 @@ fn bindgen_test_layout_clone_args() { concat!("Alignment of ", stringify!(clone_args)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6925,7 +6839,7 @@ fn bindgen_test_layout_clone_args() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pidfd as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pidfd) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -6935,7 +6849,7 @@ fn bindgen_test_layout_clone_args() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).child_tid as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).child_tid) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -6945,7 +6859,7 @@ fn bindgen_test_layout_clone_args() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).parent_tid as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).parent_tid) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -6955,7 +6869,7 @@ fn bindgen_test_layout_clone_args() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).exit_signal as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).exit_signal) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -6965,7 +6879,7 @@ fn bindgen_test_layout_clone_args() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).stack as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).stack) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", @@ -6975,7 +6889,7 @@ fn bindgen_test_layout_clone_args() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).stack_size as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).stack_size) as usize - ptr as usize }, 48usize, concat!( "Offset of field: ", @@ -6985,7 +6899,7 @@ fn bindgen_test_layout_clone_args() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tls as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tls) as usize - ptr as usize }, 56usize, concat!( "Offset of field: ", @@ -6994,6 +6908,36 @@ fn bindgen_test_layout_clone_args() { stringify!(tls) ) ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).set_tid) as usize - ptr as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(clone_args), + "::", + stringify!(set_tid) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).set_tid_size) as usize - ptr as usize }, + 72usize, + concat!( + "Offset of field: ", + stringify!(clone_args), + "::", + stringify!(set_tid_size) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).cgroup) as usize - ptr as usize }, + 80usize, + concat!( + "Offset of field: ", + stringify!(clone_args), + "::", + stringify!(cgroup) + ) + ); } #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -7002,6 +6946,8 @@ pub struct sched_param { } #[test] fn bindgen_test_layout_sched_param() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 4usize, @@ -7013,7 +6959,7 @@ fn bindgen_test_layout_sched_param() { concat!("Alignment of ", stringify!(sched_param)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sched_priority as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sched_priority) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -7051,15 +6997,15 @@ extern "C" { extern "C" { pub fn sched_rr_get_interval(__pid: pid_t, __quantum: *mut timespec) -> ::std::os::raw::c_int; } -pub const PTHREAD_MUTEX_NORMAL: ::std::os::raw::c_uint = 0; -pub const PTHREAD_MUTEX_RECURSIVE: ::std::os::raw::c_uint = 1; -pub const PTHREAD_MUTEX_ERRORCHECK: ::std::os::raw::c_uint = 2; -pub const PTHREAD_MUTEX_ERRORCHECK_NP: ::std::os::raw::c_uint = 2; -pub const PTHREAD_MUTEX_RECURSIVE_NP: ::std::os::raw::c_uint = 1; -pub const PTHREAD_MUTEX_DEFAULT: ::std::os::raw::c_uint = 0; +pub const PTHREAD_MUTEX_NORMAL: _bindgen_ty_22 = 0; +pub const PTHREAD_MUTEX_RECURSIVE: _bindgen_ty_22 = 1; +pub const PTHREAD_MUTEX_ERRORCHECK: _bindgen_ty_22 = 2; +pub const PTHREAD_MUTEX_ERRORCHECK_NP: _bindgen_ty_22 = 2; +pub const PTHREAD_MUTEX_RECURSIVE_NP: _bindgen_ty_22 = 1; +pub const PTHREAD_MUTEX_DEFAULT: _bindgen_ty_22 = 0; pub type _bindgen_ty_22 = ::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 const PTHREAD_RWLOCK_PREFER_READER_NP: _bindgen_ty_23 = 0; +pub const PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP: _bindgen_ty_23 = 1; pub type _bindgen_ty_23 = ::std::os::raw::c_uint; pub type __pthread_cleanup_func_t = ::std::option::Option; @@ -7072,6 +7018,8 @@ pub struct __pthread_cleanup_t { } #[test] fn bindgen_test_layout___pthread_cleanup_t() { + const UNINIT: ::std::mem::MaybeUninit<__pthread_cleanup_t> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__pthread_cleanup_t>(), 24usize, @@ -7083,9 +7031,7 @@ fn bindgen_test_layout___pthread_cleanup_t() { concat!("Alignment of ", stringify!(__pthread_cleanup_t)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_cleanup_t>())).__cleanup_prev as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).__cleanup_prev) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -7095,9 +7041,7 @@ fn bindgen_test_layout___pthread_cleanup_t() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_cleanup_t>())).__cleanup_routine as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).__cleanup_routine) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -7107,9 +7051,7 @@ fn bindgen_test_layout___pthread_cleanup_t() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_cleanup_t>())).__cleanup_arg as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).__cleanup_arg) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -7129,24 +7071,23 @@ extern "C" { extern "C" { pub fn __pthread_cleanup_pop(arg1: *mut __pthread_cleanup_t, arg2: ::std::os::raw::c_int); } -#[doc = " Data associated with an ALooper fd that will be returned as the \"outData\""] -#[doc = " when that source has data ready."] +#[doc = " Data associated with an ALooper fd that will be returned as the \"outData\"\n when that source has data ready."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct android_poll_source { - #[doc = " The identifier of this source. May be LOOPER_ID_MAIN or"] - #[doc = " LOOPER_ID_INPUT."] + #[doc = " The identifier of this source. May be LOOPER_ID_MAIN or\n LOOPER_ID_INPUT."] pub id: i32, #[doc = " The android_app this ident is associated with."] pub app: *mut android_app, - #[doc = " Function to call to perform the standard processing of data from"] - #[doc = " this source."] + #[doc = " Function to call to perform the standard processing of data from\n this source."] pub process: ::std::option::Option< unsafe extern "C" fn(app: *mut android_app, source: *mut android_poll_source), >, } #[test] fn bindgen_test_layout_android_poll_source() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 24usize, @@ -7158,7 +7099,7 @@ fn bindgen_test_layout_android_poll_source() { concat!("Alignment of ", stringify!(android_poll_source)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).id as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -7168,7 +7109,7 @@ fn bindgen_test_layout_android_poll_source() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).app as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).app) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -7178,7 +7119,7 @@ fn bindgen_test_layout_android_poll_source() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).process as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).process) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -7191,37 +7132,26 @@ fn bindgen_test_layout_android_poll_source() { #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct android_input_buffer { - #[doc = " Pointer to a read-only array of pointers to GameActivityMotionEvent."] - #[doc = " Only the first motionEventsCount events are valid."] - pub motionEvents: [GameActivityMotionEvent; 16usize], + #[doc = " Pointer to a read-only array of GameActivityMotionEvent.\n Only the first motionEventsCount events are valid."] + pub motionEvents: *mut GameActivityMotionEvent, #[doc = " The number of valid motion events in `motionEvents`."] pub motionEventsCount: u64, - #[doc = " Pointer to a read-only array of pointers to GameActivityHistoricalPointerAxes."] - #[doc = ""] - #[doc = " Only the first historicalSamplesCount samples are valid."] - #[doc = " Refer to event->historicalStart, event->pointerCount and event->historicalCount"] - #[doc = " to access the specific samples that relate to an event."] - #[doc = ""] - #[doc = " Each slice of samples for one event has a length of"] - #[doc = " (event->pointerCount and event->historicalCount) and is in pointer-major"] - #[doc = " order so the historic samples for each pointer are contiguous."] - #[doc = " E.g. you would access historic sample index 3 for pointer 2 of an event with:"] - #[doc = ""] - #[doc = " historicalAxisSamples[event->historicalStart + (event->historicalCount * 2) + 3];"] - pub historicalAxisSamples: [GameActivityHistoricalPointerAxes; 64usize], - #[doc = " The number of valid historical samples in `historicalAxisSamples`."] - pub historicalSamplesCount: u64, - #[doc = " Pointer to a read-only array of pointers to GameActivityKeyEvent."] - #[doc = " Only the first keyEventsCount events are valid."] - pub keyEvents: [GameActivityKeyEvent; 4usize], + #[doc = " The size of the `motionEvents` buffer."] + pub motionEventsBufferSize: u64, + #[doc = " Pointer to a read-only array of GameActivityKeyEvent.\n Only the first keyEventsCount events are valid."] + pub keyEvents: *mut GameActivityKeyEvent, #[doc = " The number of valid \"Key\" events in `keyEvents`."] pub keyEventsCount: u64, + #[doc = " The size of the `keyEvents` buffer."] + pub keyEventsBufferSize: u64, } #[test] fn bindgen_test_layout_android_input_buffer() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 40824usize, + 48usize, concat!("Size of: ", stringify!(android_input_buffer)) ); assert_eq!( @@ -7230,9 +7160,7 @@ fn bindgen_test_layout_android_input_buffer() { concat!("Alignment of ", stringify!(android_input_buffer)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).motionEvents as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).motionEvents) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -7242,10 +7170,8 @@ fn bindgen_test_layout_android_input_buffer() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).motionEventsCount as *const _ as usize - }, - 27776usize, + unsafe { ::std::ptr::addr_of!((*ptr).motionEventsCount) as usize - ptr as usize }, + 8usize, concat!( "Offset of field: ", stringify!(android_input_buffer), @@ -7254,153 +7180,81 @@ fn bindgen_test_layout_android_input_buffer() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).historicalAxisSamples as *const _ - as usize - }, - 27784usize, + unsafe { ::std::ptr::addr_of!((*ptr).motionEventsBufferSize) as usize - ptr as usize }, + 16usize, concat!( "Offset of field: ", stringify!(android_input_buffer), "::", - stringify!(historicalAxisSamples) + stringify!(motionEventsBufferSize) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).historicalSamplesCount as *const _ - as usize - }, - 40584usize, + unsafe { ::std::ptr::addr_of!((*ptr).keyEvents) as usize - ptr as usize }, + 24usize, concat!( "Offset of field: ", stringify!(android_input_buffer), "::", - stringify!(historicalSamplesCount) + stringify!(keyEvents) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).keyEvents as *const _ as usize }, - 40592usize, + unsafe { ::std::ptr::addr_of!((*ptr).keyEventsCount) as usize - ptr as usize }, + 32usize, concat!( "Offset of field: ", stringify!(android_input_buffer), "::", - stringify!(keyEvents) + stringify!(keyEventsCount) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).keyEventsCount as *const _ as usize - }, - 40816usize, + unsafe { ::std::ptr::addr_of!((*ptr).keyEventsBufferSize) as usize - ptr as usize }, + 40usize, concat!( "Offset of field: ", stringify!(android_input_buffer), "::", - stringify!(keyEventsCount) + stringify!(keyEventsBufferSize) ) ); } -#[doc = " Function pointer declaration for the filtering of key events."] -#[doc = " A function with this signature should be passed to"] -#[doc = " android_app_set_key_event_filter and return false for any events that should"] -#[doc = " not be handled by android_native_app_glue. These events will be handled by"] -#[doc = " the system instead."] +#[doc = " Function pointer declaration for the filtering of key events.\n A function with this signature should be passed to\n android_app_set_key_event_filter and return false for any events that should\n not be handled by android_native_app_glue. These events will be handled by\n the system instead."] pub type android_key_event_filter = ::std::option::Option bool>; -#[doc = " Function pointer definition for the filtering of motion events."] -#[doc = " A function with this signature should be passed to"] -#[doc = " android_app_set_motion_event_filter and return false for any events that"] -#[doc = " should not be handled by android_native_app_glue. These events will be"] -#[doc = " handled by the system instead."] +#[doc = " Function pointer definition for the filtering of motion events.\n A function with this signature should be passed to\n android_app_set_motion_event_filter and return false for any events that\n should not be handled by android_native_app_glue. These events will be\n handled by the system instead."] pub type android_motion_event_filter = ::std::option::Option bool>; -#[doc = " The GameActivity interface provided by "] -#[doc = " is based on a set of application-provided callbacks that will be called"] -#[doc = " by the Activity's main thread when certain events occur."] -#[doc = ""] -#[doc = " This means that each one of this callbacks _should_ _not_ block, or they"] -#[doc = " risk having the system force-close the application. This programming"] -#[doc = " model is direct, lightweight, but constraining."] -#[doc = ""] -#[doc = " The 'android_native_app_glue' static library is used to provide a different"] -#[doc = " execution model where the application can implement its own main event"] -#[doc = " loop in a different thread instead. Here's how it works:"] -#[doc = ""] -#[doc = " 1/ The application must provide a function named \"android_main()\" that"] -#[doc = " will be called when the activity is created, in a new thread that is"] -#[doc = " distinct from the activity's main thread."] -#[doc = ""] -#[doc = " 2/ android_main() receives a pointer to a valid \"android_app\" structure"] -#[doc = " that contains references to other important objects, e.g. the"] -#[doc = " GameActivity obejct instance the application is running in."] -#[doc = ""] -#[doc = " 3/ the \"android_app\" object holds an ALooper instance that already"] -#[doc = " listens to activity lifecycle events (e.g. \"pause\", \"resume\")."] -#[doc = " See APP_CMD_XXX declarations below."] -#[doc = ""] -#[doc = " This corresponds to an ALooper identifier returned by"] -#[doc = " ALooper_pollOnce with value LOOPER_ID_MAIN."] -#[doc = ""] -#[doc = " Your application can use the same ALooper to listen to additional"] -#[doc = " file-descriptors. They can either be callback based, or with return"] -#[doc = " identifiers starting with LOOPER_ID_USER."] -#[doc = ""] -#[doc = " 4/ Whenever you receive a LOOPER_ID_MAIN event,"] -#[doc = " the returned data will point to an android_poll_source structure. You"] -#[doc = " can call the process() function on it, and fill in android_app->onAppCmd"] -#[doc = " to be called for your own processing of the event."] -#[doc = ""] -#[doc = " Alternatively, you can call the low-level functions to read and process"] -#[doc = " the data directly... look at the process_cmd() and process_input()"] -#[doc = " implementations in the glue to see how to do this."] -#[doc = ""] -#[doc = " See the sample named \"native-activity\" that comes with the NDK with a"] -#[doc = " full usage example. Also look at the documentation of GameActivity."] +#[doc = " The GameActivity interface provided by \n is based on a set of application-provided callbacks that will be called\n by the Activity's main thread when certain events occur.\n\n This means that each one of this callbacks _should_ _not_ block, or they\n risk having the system force-close the application. This programming\n model is direct, lightweight, but constraining.\n\n The 'android_native_app_glue' static library is used to provide a different\n execution model where the application can implement its own main event\n loop in a different thread instead. Here's how it works:\n\n 1/ The application must provide a function named \"android_main()\" that\n will be called when the activity is created, in a new thread that is\n distinct from the activity's main thread.\n\n 2/ android_main() receives a pointer to a valid \"android_app\" structure\n that contains references to other important objects, e.g. the\n GameActivity obejct instance the application is running in.\n\n 3/ the \"android_app\" object holds an ALooper instance that already\n listens to activity lifecycle events (e.g. \"pause\", \"resume\").\n See APP_CMD_XXX declarations below.\n\n This corresponds to an ALooper identifier returned by\n ALooper_pollOnce with value LOOPER_ID_MAIN.\n\n Your application can use the same ALooper to listen to additional\n file-descriptors. They can either be callback based, or with return\n identifiers starting with LOOPER_ID_USER.\n\n 4/ Whenever you receive a LOOPER_ID_MAIN event,\n the returned data will point to an android_poll_source structure. You\n can call the process() function on it, and fill in android_app->onAppCmd\n to be called for your own processing of the event.\n\n Alternatively, you can call the low-level functions to read and process\n the data directly... look at the process_cmd() and process_input()\n implementations in the glue to see how to do this.\n\n See the sample named \"native-activity\" that comes with the NDK with a\n full usage example. Also look at the documentation of GameActivity."] #[repr(C)] pub struct android_app { #[doc = " An optional pointer to application-defined state."] pub userData: *mut ::std::os::raw::c_void, - #[doc = " A required callback for processing main app commands (`APP_CMD_*`)."] - #[doc = " This is called each frame if there are app commands that need processing."] + #[doc = " A required callback for processing main app commands (`APP_CMD_*`).\n This is called each frame if there are app commands that need processing."] pub onAppCmd: ::std::option::Option, #[doc = " The GameActivity object instance that this app is running in."] pub activity: *mut GameActivity, #[doc = " The current configuration the app is running in."] pub config: *mut AConfiguration, - #[doc = " The last activity saved state, as provided at creation time."] - #[doc = " It is NULL if there was no state. You can use this as you need; the"] - #[doc = " memory will remain around until you call android_app_exec_cmd() for"] - #[doc = " APP_CMD_RESUME, at which point it will be freed and savedState set to"] - #[doc = " NULL. These variables should only be changed when processing a"] - #[doc = " APP_CMD_SAVE_STATE, at which point they will be initialized to NULL and"] - #[doc = " you can malloc your state and place the information here. In that case"] - #[doc = " the memory will be freed for you later."] + #[doc = " The last activity saved state, as provided at creation time.\n It is NULL if there was no state. You can use this as you need; the\n memory will remain around until you call android_app_exec_cmd() for\n APP_CMD_RESUME, at which point it will be freed and savedState set to\n NULL. These variables should only be changed when processing a\n APP_CMD_SAVE_STATE, at which point they will be initialized to NULL and\n you can malloc your state and place the information here. In that case\n the memory will be freed for you later."] pub savedState: *mut ::std::os::raw::c_void, #[doc = " The size of the activity saved state. It is 0 if `savedState` is NULL."] - pub savedStateSize: size_t, + pub savedStateSize: usize, #[doc = " The ALooper associated with the app's thread."] pub looper: *mut ALooper, #[doc = " When non-NULL, this is the window surface that the app can draw in."] pub window: *mut ANativeWindow, - #[doc = " Current content rectangle of the window; this is the area where the"] - #[doc = " window's content should be placed to be seen by the user."] + #[doc = " Current content rectangle of the window; this is the area where the\n window's content should be placed to be seen by the user."] pub contentRect: ARect, - #[doc = " Current state of the app's activity. May be either APP_CMD_START,"] - #[doc = " APP_CMD_RESUME, APP_CMD_PAUSE, or APP_CMD_STOP."] + #[doc = " Current state of the app's activity. May be either APP_CMD_START,\n APP_CMD_RESUME, APP_CMD_PAUSE, or APP_CMD_STOP."] pub activityState: ::std::os::raw::c_int, - #[doc = " This is non-zero when the application's GameActivity is being"] - #[doc = " destroyed and waiting for the app thread to complete."] + #[doc = " This is non-zero when the application's GameActivity is being\n destroyed and waiting for the app thread to complete."] pub destroyRequested: ::std::os::raw::c_int, - #[doc = " This is used for buffering input from GameActivity. Once ready, the"] - #[doc = " application thread switches the buffers and processes what was"] - #[doc = " accumulated."] + #[doc = " This is used for buffering input from GameActivity. Once ready, the\n application thread switches the buffers and processes what was\n accumulated."] pub inputBuffers: [android_input_buffer; 2usize], pub currentInputBuffer: ::std::os::raw::c_int, - #[doc = " 0 if no text input event is outstanding, 1 if it is."] - #[doc = " Use `GameActivity_getTextInputState` to get information"] - #[doc = " about the text entered by the user."] + #[doc = " 0 if no text input event is outstanding, 1 if it is.\n Use `GameActivity_getTextInputState` to get information\n about the text entered by the user."] pub textInputState: ::std::os::raw::c_int, #[doc = " @cond INTERNAL"] pub mutex: pthread_mutex_t, @@ -7422,9 +7276,11 @@ pub struct android_app { } #[test] fn bindgen_test_layout_android_app() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 81936usize, + 384usize, concat!("Size of: ", stringify!(android_app)) ); assert_eq!( @@ -7433,7 +7289,7 @@ fn bindgen_test_layout_android_app() { concat!("Alignment of ", stringify!(android_app)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).userData as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).userData) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -7443,7 +7299,7 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).onAppCmd as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).onAppCmd) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -7453,7 +7309,7 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).activity as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).activity) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -7463,7 +7319,7 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).config as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).config) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -7473,7 +7329,7 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).savedState as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).savedState) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -7483,7 +7339,7 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).savedStateSize as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).savedStateSize) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", @@ -7493,7 +7349,7 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).looper as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).looper) as usize - ptr as usize }, 48usize, concat!( "Offset of field: ", @@ -7503,7 +7359,7 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).window as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).window) as usize - ptr as usize }, 56usize, concat!( "Offset of field: ", @@ -7513,7 +7369,7 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).contentRect as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).contentRect) as usize - ptr as usize }, 64usize, concat!( "Offset of field: ", @@ -7523,7 +7379,7 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).activityState as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).activityState) as usize - ptr as usize }, 80usize, concat!( "Offset of field: ", @@ -7533,7 +7389,7 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).destroyRequested as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).destroyRequested) as usize - ptr as usize }, 84usize, concat!( "Offset of field: ", @@ -7543,7 +7399,7 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).inputBuffers as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).inputBuffers) as usize - ptr as usize }, 88usize, concat!( "Offset of field: ", @@ -7553,8 +7409,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).currentInputBuffer as *const _ as usize }, - 81736usize, + unsafe { ::std::ptr::addr_of!((*ptr).currentInputBuffer) as usize - ptr as usize }, + 184usize, concat!( "Offset of field: ", stringify!(android_app), @@ -7563,8 +7419,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).textInputState as *const _ as usize }, - 81740usize, + unsafe { ::std::ptr::addr_of!((*ptr).textInputState) as usize - ptr as usize }, + 188usize, concat!( "Offset of field: ", stringify!(android_app), @@ -7573,8 +7429,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).mutex as *const _ as usize }, - 81744usize, + unsafe { ::std::ptr::addr_of!((*ptr).mutex) as usize - ptr as usize }, + 192usize, concat!( "Offset of field: ", stringify!(android_app), @@ -7583,8 +7439,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).cond as *const _ as usize }, - 81784usize, + unsafe { ::std::ptr::addr_of!((*ptr).cond) as usize - ptr as usize }, + 232usize, concat!( "Offset of field: ", stringify!(android_app), @@ -7593,8 +7449,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).msgread as *const _ as usize }, - 81832usize, + unsafe { ::std::ptr::addr_of!((*ptr).msgread) as usize - ptr as usize }, + 280usize, concat!( "Offset of field: ", stringify!(android_app), @@ -7603,8 +7459,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).msgwrite as *const _ as usize }, - 81836usize, + unsafe { ::std::ptr::addr_of!((*ptr).msgwrite) as usize - ptr as usize }, + 284usize, concat!( "Offset of field: ", stringify!(android_app), @@ -7613,8 +7469,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).thread as *const _ as usize }, - 81840usize, + unsafe { ::std::ptr::addr_of!((*ptr).thread) as usize - ptr as usize }, + 288usize, concat!( "Offset of field: ", stringify!(android_app), @@ -7623,8 +7479,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).cmdPollSource as *const _ as usize }, - 81848usize, + unsafe { ::std::ptr::addr_of!((*ptr).cmdPollSource) as usize - ptr as usize }, + 296usize, concat!( "Offset of field: ", stringify!(android_app), @@ -7633,8 +7489,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).running as *const _ as usize }, - 81872usize, + unsafe { ::std::ptr::addr_of!((*ptr).running) as usize - ptr as usize }, + 320usize, concat!( "Offset of field: ", stringify!(android_app), @@ -7643,8 +7499,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).stateSaved as *const _ as usize }, - 81876usize, + unsafe { ::std::ptr::addr_of!((*ptr).stateSaved) as usize - ptr as usize }, + 324usize, concat!( "Offset of field: ", stringify!(android_app), @@ -7653,8 +7509,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).destroyed as *const _ as usize }, - 81880usize, + unsafe { ::std::ptr::addr_of!((*ptr).destroyed) as usize - ptr as usize }, + 328usize, concat!( "Offset of field: ", stringify!(android_app), @@ -7663,8 +7519,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).redrawNeeded as *const _ as usize }, - 81884usize, + unsafe { ::std::ptr::addr_of!((*ptr).redrawNeeded) as usize - ptr as usize }, + 332usize, concat!( "Offset of field: ", stringify!(android_app), @@ -7673,8 +7529,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pendingWindow as *const _ as usize }, - 81888usize, + unsafe { ::std::ptr::addr_of!((*ptr).pendingWindow) as usize - ptr as usize }, + 336usize, concat!( "Offset of field: ", stringify!(android_app), @@ -7683,8 +7539,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pendingContentRect as *const _ as usize }, - 81896usize, + unsafe { ::std::ptr::addr_of!((*ptr).pendingContentRect) as usize - ptr as usize }, + 344usize, concat!( "Offset of field: ", stringify!(android_app), @@ -7693,8 +7549,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).keyEventFilter as *const _ as usize }, - 81912usize, + unsafe { ::std::ptr::addr_of!((*ptr).keyEventFilter) as usize - ptr as usize }, + 360usize, concat!( "Offset of field: ", stringify!(android_app), @@ -7703,8 +7559,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).motionEventFilter as *const _ as usize }, - 81920usize, + unsafe { ::std::ptr::addr_of!((*ptr).motionEventFilter) as usize - ptr as usize }, + 368usize, concat!( "Offset of field: ", stringify!(android_app), @@ -7713,10 +7569,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).inputAvailableWakeUp as *const _ as usize - }, - 81928usize, + unsafe { ::std::ptr::addr_of!((*ptr).inputAvailableWakeUp) as usize - ptr as usize }, + 376usize, concat!( "Offset of field: ", stringify!(android_app), @@ -7725,8 +7579,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).inputSwapPending as *const _ as usize }, - 81929usize, + unsafe { ::std::ptr::addr_of!((*ptr).inputSwapPending) as usize - ptr as usize }, + 377usize, concat!( "Offset of field: ", stringify!(android_app), @@ -7735,139 +7589,89 @@ fn bindgen_test_layout_android_app() { ) ); } -#[doc = " Looper data ID of commands coming from the app's main thread, which"] -#[doc = " is returned as an identifier from ALooper_pollOnce(). The data for this"] -#[doc = " identifier is a pointer to an android_poll_source structure."] -#[doc = " These can be retrieved and processed with android_app_read_cmd()"] -#[doc = " and android_app_exec_cmd()."] +#[doc = " Looper data ID of commands coming from the app's main thread, which\n is returned as an identifier from ALooper_pollOnce(). The data for this\n identifier is a pointer to an android_poll_source structure.\n These can be retrieved and processed with android_app_read_cmd()\n and android_app_exec_cmd()."] pub const NativeAppGlueLooperId_LOOPER_ID_MAIN: NativeAppGlueLooperId = 1; -#[doc = " Unused. Reserved for future use when usage of AInputQueue will be"] -#[doc = " supported."] +#[doc = " Unused. Reserved for future use when usage of AInputQueue will be\n supported."] pub const NativeAppGlueLooperId_LOOPER_ID_INPUT: NativeAppGlueLooperId = 2; #[doc = " Start of user-defined ALooper identifiers."] pub const NativeAppGlueLooperId_LOOPER_ID_USER: NativeAppGlueLooperId = 3; -#[doc = " Looper ID of commands coming from the app's main thread, an AInputQueue or"] -#[doc = " user-defined sources."] +#[doc = " Looper ID of commands coming from the app's main thread, an AInputQueue or\n user-defined sources."] pub type NativeAppGlueLooperId = ::std::os::raw::c_uint; -#[doc = " Unused. Reserved for future use when usage of AInputQueue will be"] -#[doc = " supported."] +#[doc = " Unused. Reserved for future use when usage of AInputQueue will be\n supported."] pub const NativeAppGlueAppCmd_UNUSED_APP_CMD_INPUT_CHANGED: NativeAppGlueAppCmd = 0; -#[doc = " Command from main thread: a new ANativeWindow is ready for use. Upon"] -#[doc = " receiving this command, android_app->window will contain the new window"] -#[doc = " surface."] +#[doc = " Command from main thread: a new ANativeWindow is ready for use. Upon\n receiving this command, android_app->window will contain the new window\n surface."] pub const NativeAppGlueAppCmd_APP_CMD_INIT_WINDOW: NativeAppGlueAppCmd = 1; -#[doc = " Command from main thread: the existing ANativeWindow needs to be"] -#[doc = " terminated. Upon receiving this command, android_app->window still"] -#[doc = " contains the existing window; after calling android_app_exec_cmd"] -#[doc = " it will be set to NULL."] +#[doc = " Command from main thread: the existing ANativeWindow needs to be\n terminated. Upon receiving this command, android_app->window still\n contains the existing window; after calling android_app_exec_cmd\n it will be set to NULL."] pub const NativeAppGlueAppCmd_APP_CMD_TERM_WINDOW: NativeAppGlueAppCmd = 2; -#[doc = " Command from main thread: the current ANativeWindow has been resized."] -#[doc = " Please redraw with its new size."] +#[doc = " Command from main thread: the current ANativeWindow has been resized.\n Please redraw with its new size."] pub const NativeAppGlueAppCmd_APP_CMD_WINDOW_RESIZED: NativeAppGlueAppCmd = 3; -#[doc = " Command from main thread: the system needs that the current ANativeWindow"] -#[doc = " be redrawn. You should redraw the window before handing this to"] -#[doc = " android_app_exec_cmd() in order to avoid transient drawing glitches."] +#[doc = " Command from main thread: the system needs that the current ANativeWindow\n be redrawn. You should redraw the window before handing this to\n android_app_exec_cmd() in order to avoid transient drawing glitches."] pub const NativeAppGlueAppCmd_APP_CMD_WINDOW_REDRAW_NEEDED: NativeAppGlueAppCmd = 4; -#[doc = " Command from main thread: the content area of the window has changed,"] -#[doc = " such as from the soft input window being shown or hidden. You can"] -#[doc = " find the new content rect in android_app::contentRect."] +#[doc = " Command from main thread: the content area of the window has changed,\n such as from the soft input window being shown or hidden. You can\n find the new content rect in android_app::contentRect."] pub const NativeAppGlueAppCmd_APP_CMD_CONTENT_RECT_CHANGED: NativeAppGlueAppCmd = 5; -#[doc = " Command from main thread: the app's activity window has gained"] -#[doc = " input focus."] +#[doc = " Command from main thread: the app's activity window has gained\n input focus."] pub const NativeAppGlueAppCmd_APP_CMD_GAINED_FOCUS: NativeAppGlueAppCmd = 6; -#[doc = " Command from main thread: the app's activity window has lost"] -#[doc = " input focus."] +#[doc = " Command from main thread: the app's activity window has lost\n input focus."] pub const NativeAppGlueAppCmd_APP_CMD_LOST_FOCUS: NativeAppGlueAppCmd = 7; #[doc = " Command from main thread: the current device configuration has changed."] pub const NativeAppGlueAppCmd_APP_CMD_CONFIG_CHANGED: NativeAppGlueAppCmd = 8; -#[doc = " Command from main thread: the system is running low on memory."] -#[doc = " Try to reduce your memory use."] +#[doc = " Command from main thread: the system is running low on memory.\n Try to reduce your memory use."] pub const NativeAppGlueAppCmd_APP_CMD_LOW_MEMORY: NativeAppGlueAppCmd = 9; #[doc = " Command from main thread: the app's activity has been started."] pub const NativeAppGlueAppCmd_APP_CMD_START: NativeAppGlueAppCmd = 10; #[doc = " Command from main thread: the app's activity has been resumed."] pub const NativeAppGlueAppCmd_APP_CMD_RESUME: NativeAppGlueAppCmd = 11; -#[doc = " Command from main thread: the app should generate a new saved state"] -#[doc = " for itself, to restore from later if needed. If you have saved state,"] -#[doc = " allocate it with malloc and place it in android_app.savedState with"] -#[doc = " the size in android_app.savedStateSize. The will be freed for you"] -#[doc = " later."] +#[doc = " Command from main thread: the app should generate a new saved state\n for itself, to restore from later if needed. If you have saved state,\n allocate it with malloc and place it in android_app.savedState with\n the size in android_app.savedStateSize. The will be freed for you\n later."] pub const NativeAppGlueAppCmd_APP_CMD_SAVE_STATE: NativeAppGlueAppCmd = 12; #[doc = " Command from main thread: the app's activity has been paused."] pub const NativeAppGlueAppCmd_APP_CMD_PAUSE: NativeAppGlueAppCmd = 13; #[doc = " Command from main thread: the app's activity has been stopped."] pub const NativeAppGlueAppCmd_APP_CMD_STOP: NativeAppGlueAppCmd = 14; -#[doc = " Command from main thread: the app's activity is being destroyed,"] -#[doc = " and waiting for the app thread to clean up and exit before proceeding."] +#[doc = " Command from main thread: the app's activity is being destroyed,\n and waiting for the app thread to clean up and exit before proceeding."] pub const NativeAppGlueAppCmd_APP_CMD_DESTROY: NativeAppGlueAppCmd = 15; #[doc = " Command from main thread: the app's insets have changed."] pub const NativeAppGlueAppCmd_APP_CMD_WINDOW_INSETS_CHANGED: NativeAppGlueAppCmd = 16; #[doc = " Commands passed from the application's main Java thread to the game's thread."] pub type NativeAppGlueAppCmd = ::std::os::raw::c_uint; extern "C" { - #[doc = " Call when ALooper_pollAll() returns LOOPER_ID_MAIN, reading the next"] - #[doc = " app command message."] + #[doc = " Call when ALooper_pollAll() returns LOOPER_ID_MAIN, reading the next\n app command message."] pub fn android_app_read_cmd(android_app: *mut android_app) -> i8; } extern "C" { - #[doc = " Call with the command returned by android_app_read_cmd() to do the"] - #[doc = " initial pre-processing of the given command. You can perform your own"] - #[doc = " actions for the command after calling this function."] + #[doc = " Call with the command returned by android_app_read_cmd() to do the\n initial pre-processing of the given command. You can perform your own\n actions for the command after calling this function."] pub fn android_app_pre_exec_cmd(android_app: *mut android_app, cmd: i8); } extern "C" { - #[doc = " Call with the command returned by android_app_read_cmd() to do the"] - #[doc = " final post-processing of the given command. You must have done your own"] - #[doc = " actions for the command before calling this function."] + #[doc = " Call with the command returned by android_app_read_cmd() to do the\n final post-processing of the given command. You must have done your own\n actions for the command before calling this function."] pub fn android_app_post_exec_cmd(android_app: *mut android_app, cmd: i8); } extern "C" { - #[doc = " Call this before processing input events to get the events buffer."] - #[doc = " The function returns NULL if there are no events to process."] + #[doc = " Call this before processing input events to get the events buffer.\n The function returns NULL if there are no events to process."] pub fn android_app_swap_input_buffers( android_app: *mut android_app, ) -> *mut android_input_buffer; } extern "C" { - #[doc = " Clear the array of motion events that were waiting to be handled, and release"] - #[doc = " each of them."] - #[doc = ""] - #[doc = " This method should be called after you have processed the motion events in"] - #[doc = " your game loop. You should handle events at each iteration of your game loop."] + #[doc = " Clear the array of motion events that were waiting to be handled, and release\n each of them.\n\n This method should be called after you have processed the motion events in\n your game loop. You should handle events at each iteration of your game loop."] pub fn android_app_clear_motion_events(inputBuffer: *mut android_input_buffer); } extern "C" { - #[doc = " Clear the array of key events that were waiting to be handled, and release"] - #[doc = " each of them."] - #[doc = ""] - #[doc = " This method should be called after you have processed the key up events in"] - #[doc = " your game loop. You should handle events at each iteration of your game loop."] + #[doc = " Clear the array of key events that were waiting to be handled, and release\n each of them.\n\n This method should be called after you have processed the key up events in\n your game loop. You should handle events at each iteration of your game loop."] pub fn android_app_clear_key_events(inputBuffer: *mut android_input_buffer); } extern "C" { - #[doc = " This is a springboard into the Rust glue layer that wraps calling the"] - #[doc = " main entry for the app itself."] + #[doc = " This is a springboard into the Rust glue layer that wraps calling the\n main entry for the app itself."] pub fn _rust_glue_entry(app: *mut android_app); } extern "C" { - #[doc = " Set the filter to use when processing key events."] - #[doc = " Any events for which the filter returns false will be ignored by"] - #[doc = " android_native_app_glue. If filter is set to NULL, no filtering is done."] - #[doc = ""] - #[doc = " The default key filter will filter out volume and camera button presses."] + #[doc = " Set the filter to use when processing key events.\n Any events for which the filter returns false will be ignored by\n android_native_app_glue. If filter is set to NULL, no filtering is done.\n\n The default key filter will filter out volume and camera button presses."] pub fn android_app_set_key_event_filter( app: *mut android_app, filter: android_key_event_filter, ); } extern "C" { - #[doc = " Set the filter to use when processing touch and motion events."] - #[doc = " Any events for which the filter returns false will be ignored by"] - #[doc = " android_native_app_glue. If filter is set to NULL, no filtering is done."] - #[doc = ""] - #[doc = " Note that the default motion event filter will only allow touchscreen events"] - #[doc = " through, in order to mimic NativeActivity's behaviour, so for controller"] - #[doc = " events to be passed to the app, set the filter to NULL."] + #[doc = " Set the filter to use when processing touch and motion events.\n Any events for which the filter returns false will be ignored by\n android_native_app_glue. If filter is set to NULL, no filtering is done.\n\n Note that the default motion event filter will only allow touchscreen events\n through, in order to mimic NativeActivity's behaviour, so for controller\n events to be passed to the app, set the filter to NULL."] pub fn android_app_set_motion_event_filter( app: *mut android_app, filter: android_motion_event_filter, diff --git a/android-activity/src/game_activity/ffi_arm.rs b/android-activity/src/game_activity/ffi_arm.rs index 7504db8..f33e4bc 100644 --- a/android-activity/src/game_activity/ffi_arm.rs +++ b/android-activity/src/game_activity/ffi_arm.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.59.2 */ +/* automatically generated by rust-bindgen 0.66.1 */ #[repr(C)] #[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] @@ -101,10 +101,14 @@ 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 __NDK_MAJOR__: u32 = 21; -pub const __NDK_MINOR__: u32 = 1; +pub const __ANDROID_API_S__: u32 = 31; +pub const __ANDROID_API_T__: u32 = 33; +pub const __ANDROID_API_U__: u32 = 34; +pub const __ANDROID_NDK__: u32 = 1; +pub const __NDK_MAJOR__: u32 = 25; +pub const __NDK_MINOR__: u32 = 2; pub const __NDK_BETA__: u32 = 0; -pub const __NDK_BUILD__: u32 = 6352462; +pub const __NDK_BUILD__: u32 = 9519653; pub const __NDK_CANARY__: u32 = 0; pub const WCHAR_MIN: u8 = 0u8; pub const INT8_MIN: i32 = -128; @@ -143,136 +147,141 @@ 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 AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT: u32 = 8; -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"; -pub const PRId32: &[u8; 2usize] = b"d\0"; -pub const PRId64: &[u8; 4usize] = b"lld\0"; -pub const PRIdLEAST8: &[u8; 2usize] = b"d\0"; -pub const PRIdLEAST16: &[u8; 2usize] = b"d\0"; -pub const PRIdLEAST32: &[u8; 2usize] = b"d\0"; -pub const PRIdLEAST64: &[u8; 4usize] = b"lld\0"; -pub const PRIdFAST8: &[u8; 2usize] = b"d\0"; -pub const PRIdFAST64: &[u8; 4usize] = b"lld\0"; -pub const PRIdMAX: &[u8; 3usize] = b"jd\0"; -pub const PRIi8: &[u8; 2usize] = b"i\0"; -pub const PRIi16: &[u8; 2usize] = b"i\0"; -pub const PRIi32: &[u8; 2usize] = b"i\0"; -pub const PRIi64: &[u8; 4usize] = b"lli\0"; -pub const PRIiLEAST8: &[u8; 2usize] = b"i\0"; -pub const PRIiLEAST16: &[u8; 2usize] = b"i\0"; -pub const PRIiLEAST32: &[u8; 2usize] = b"i\0"; -pub const PRIiLEAST64: &[u8; 4usize] = b"lli\0"; -pub const PRIiFAST8: &[u8; 2usize] = b"i\0"; -pub const PRIiFAST64: &[u8; 4usize] = b"lli\0"; -pub const PRIiMAX: &[u8; 3usize] = b"ji\0"; -pub const PRIo8: &[u8; 2usize] = b"o\0"; -pub const PRIo16: &[u8; 2usize] = b"o\0"; -pub const PRIo32: &[u8; 2usize] = b"o\0"; -pub const PRIo64: &[u8; 4usize] = b"llo\0"; -pub const PRIoLEAST8: &[u8; 2usize] = b"o\0"; -pub const PRIoLEAST16: &[u8; 2usize] = b"o\0"; -pub const PRIoLEAST32: &[u8; 2usize] = b"o\0"; -pub const PRIoLEAST64: &[u8; 4usize] = b"llo\0"; -pub const PRIoFAST8: &[u8; 2usize] = b"o\0"; -pub const PRIoFAST64: &[u8; 4usize] = b"llo\0"; -pub const PRIoMAX: &[u8; 3usize] = b"jo\0"; -pub const PRIu8: &[u8; 2usize] = b"u\0"; -pub const PRIu16: &[u8; 2usize] = b"u\0"; -pub const PRIu32: &[u8; 2usize] = b"u\0"; -pub const PRIu64: &[u8; 4usize] = b"llu\0"; -pub const PRIuLEAST8: &[u8; 2usize] = b"u\0"; -pub const PRIuLEAST16: &[u8; 2usize] = b"u\0"; -pub const PRIuLEAST32: &[u8; 2usize] = b"u\0"; -pub const PRIuLEAST64: &[u8; 4usize] = b"llu\0"; -pub const PRIuFAST8: &[u8; 2usize] = b"u\0"; -pub const PRIuFAST64: &[u8; 4usize] = b"llu\0"; -pub const PRIuMAX: &[u8; 3usize] = b"ju\0"; -pub const PRIx8: &[u8; 2usize] = b"x\0"; -pub const PRIx16: &[u8; 2usize] = b"x\0"; -pub const PRIx32: &[u8; 2usize] = b"x\0"; -pub const PRIx64: &[u8; 4usize] = b"llx\0"; -pub const PRIxLEAST8: &[u8; 2usize] = b"x\0"; -pub const PRIxLEAST16: &[u8; 2usize] = b"x\0"; -pub const PRIxLEAST32: &[u8; 2usize] = b"x\0"; -pub const PRIxLEAST64: &[u8; 4usize] = b"llx\0"; -pub const PRIxFAST8: &[u8; 2usize] = b"x\0"; -pub const PRIxFAST64: &[u8; 4usize] = b"llx\0"; -pub const PRIxMAX: &[u8; 3usize] = b"jx\0"; -pub const PRIX8: &[u8; 2usize] = b"X\0"; -pub const PRIX16: &[u8; 2usize] = b"X\0"; -pub const PRIX32: &[u8; 2usize] = b"X\0"; -pub const PRIX64: &[u8; 4usize] = b"llX\0"; -pub const PRIXLEAST8: &[u8; 2usize] = b"X\0"; -pub const PRIXLEAST16: &[u8; 2usize] = b"X\0"; -pub const PRIXLEAST32: &[u8; 2usize] = b"X\0"; -pub const PRIXLEAST64: &[u8; 4usize] = b"llX\0"; -pub const PRIXFAST8: &[u8; 2usize] = b"X\0"; -pub const PRIXFAST64: &[u8; 4usize] = b"llX\0"; -pub const PRIXMAX: &[u8; 3usize] = b"jX\0"; -pub const SCNd8: &[u8; 4usize] = b"hhd\0"; -pub const SCNd16: &[u8; 3usize] = b"hd\0"; -pub const SCNd32: &[u8; 2usize] = b"d\0"; -pub const SCNd64: &[u8; 4usize] = b"lld\0"; -pub const SCNdLEAST8: &[u8; 4usize] = b"hhd\0"; -pub const SCNdLEAST16: &[u8; 3usize] = b"hd\0"; -pub const SCNdLEAST32: &[u8; 2usize] = b"d\0"; -pub const SCNdLEAST64: &[u8; 4usize] = b"lld\0"; -pub const SCNdFAST8: &[u8; 4usize] = b"hhd\0"; -pub const SCNdFAST64: &[u8; 4usize] = b"lld\0"; -pub const SCNdMAX: &[u8; 3usize] = b"jd\0"; -pub const SCNi8: &[u8; 4usize] = b"hhi\0"; -pub const SCNi16: &[u8; 3usize] = b"hi\0"; -pub const SCNi32: &[u8; 2usize] = b"i\0"; -pub const SCNi64: &[u8; 4usize] = b"lli\0"; -pub const SCNiLEAST8: &[u8; 4usize] = b"hhi\0"; -pub const SCNiLEAST16: &[u8; 3usize] = b"hi\0"; -pub const SCNiLEAST32: &[u8; 2usize] = b"i\0"; -pub const SCNiLEAST64: &[u8; 4usize] = b"lli\0"; -pub const SCNiFAST8: &[u8; 4usize] = b"hhi\0"; -pub const SCNiFAST64: &[u8; 4usize] = b"lli\0"; -pub const SCNiMAX: &[u8; 3usize] = b"ji\0"; -pub const SCNo8: &[u8; 4usize] = b"hho\0"; -pub const SCNo16: &[u8; 3usize] = b"ho\0"; -pub const SCNo32: &[u8; 2usize] = b"o\0"; -pub const SCNo64: &[u8; 4usize] = b"llo\0"; -pub const SCNoLEAST8: &[u8; 4usize] = b"hho\0"; -pub const SCNoLEAST16: &[u8; 3usize] = b"ho\0"; -pub const SCNoLEAST32: &[u8; 2usize] = b"o\0"; -pub const SCNoLEAST64: &[u8; 4usize] = b"llo\0"; -pub const SCNoFAST8: &[u8; 4usize] = b"hho\0"; -pub const SCNoFAST64: &[u8; 4usize] = b"llo\0"; -pub const SCNoMAX: &[u8; 3usize] = b"jo\0"; -pub const SCNu8: &[u8; 4usize] = b"hhu\0"; -pub const SCNu16: &[u8; 3usize] = b"hu\0"; -pub const SCNu32: &[u8; 2usize] = b"u\0"; -pub const SCNu64: &[u8; 4usize] = b"llu\0"; -pub const SCNuLEAST8: &[u8; 4usize] = b"hhu\0"; -pub const SCNuLEAST16: &[u8; 3usize] = b"hu\0"; -pub const SCNuLEAST32: &[u8; 2usize] = b"u\0"; -pub const SCNuLEAST64: &[u8; 4usize] = b"llu\0"; -pub const SCNuFAST8: &[u8; 4usize] = b"hhu\0"; -pub const SCNuFAST64: &[u8; 4usize] = b"llu\0"; -pub const SCNuMAX: &[u8; 3usize] = b"ju\0"; -pub const SCNx8: &[u8; 4usize] = b"hhx\0"; -pub const SCNx16: &[u8; 3usize] = b"hx\0"; -pub const SCNx32: &[u8; 2usize] = b"x\0"; -pub const SCNx64: &[u8; 4usize] = b"llx\0"; -pub const SCNxLEAST8: &[u8; 4usize] = b"hhx\0"; -pub const SCNxLEAST16: &[u8; 3usize] = b"hx\0"; -pub const SCNxLEAST32: &[u8; 2usize] = b"x\0"; -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 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; 3] = b"ll\0"; +pub const PRId8: &[u8; 2] = b"d\0"; +pub const PRId16: &[u8; 2] = b"d\0"; +pub const PRId32: &[u8; 2] = b"d\0"; +pub const PRId64: &[u8; 4] = b"lld\0"; +pub const PRIdLEAST8: &[u8; 2] = b"d\0"; +pub const PRIdLEAST16: &[u8; 2] = b"d\0"; +pub const PRIdLEAST32: &[u8; 2] = b"d\0"; +pub const PRIdLEAST64: &[u8; 4] = b"lld\0"; +pub const PRIdFAST8: &[u8; 2] = b"d\0"; +pub const PRIdFAST64: &[u8; 4] = b"lld\0"; +pub const PRIdMAX: &[u8; 3] = b"jd\0"; +pub const PRIi8: &[u8; 2] = b"i\0"; +pub const PRIi16: &[u8; 2] = b"i\0"; +pub const PRIi32: &[u8; 2] = b"i\0"; +pub const PRIi64: &[u8; 4] = b"lli\0"; +pub const PRIiLEAST8: &[u8; 2] = b"i\0"; +pub const PRIiLEAST16: &[u8; 2] = b"i\0"; +pub const PRIiLEAST32: &[u8; 2] = b"i\0"; +pub const PRIiLEAST64: &[u8; 4] = b"lli\0"; +pub const PRIiFAST8: &[u8; 2] = b"i\0"; +pub const PRIiFAST64: &[u8; 4] = b"lli\0"; +pub const PRIiMAX: &[u8; 3] = b"ji\0"; +pub const PRIo8: &[u8; 2] = b"o\0"; +pub const PRIo16: &[u8; 2] = b"o\0"; +pub const PRIo32: &[u8; 2] = b"o\0"; +pub const PRIo64: &[u8; 4] = b"llo\0"; +pub const PRIoLEAST8: &[u8; 2] = b"o\0"; +pub const PRIoLEAST16: &[u8; 2] = b"o\0"; +pub const PRIoLEAST32: &[u8; 2] = b"o\0"; +pub const PRIoLEAST64: &[u8; 4] = b"llo\0"; +pub const PRIoFAST8: &[u8; 2] = b"o\0"; +pub const PRIoFAST64: &[u8; 4] = b"llo\0"; +pub const PRIoMAX: &[u8; 3] = b"jo\0"; +pub const PRIu8: &[u8; 2] = b"u\0"; +pub const PRIu16: &[u8; 2] = b"u\0"; +pub const PRIu32: &[u8; 2] = b"u\0"; +pub const PRIu64: &[u8; 4] = b"llu\0"; +pub const PRIuLEAST8: &[u8; 2] = b"u\0"; +pub const PRIuLEAST16: &[u8; 2] = b"u\0"; +pub const PRIuLEAST32: &[u8; 2] = b"u\0"; +pub const PRIuLEAST64: &[u8; 4] = b"llu\0"; +pub const PRIuFAST8: &[u8; 2] = b"u\0"; +pub const PRIuFAST64: &[u8; 4] = b"llu\0"; +pub const PRIuMAX: &[u8; 3] = b"ju\0"; +pub const PRIx8: &[u8; 2] = b"x\0"; +pub const PRIx16: &[u8; 2] = b"x\0"; +pub const PRIx32: &[u8; 2] = b"x\0"; +pub const PRIx64: &[u8; 4] = b"llx\0"; +pub const PRIxLEAST8: &[u8; 2] = b"x\0"; +pub const PRIxLEAST16: &[u8; 2] = b"x\0"; +pub const PRIxLEAST32: &[u8; 2] = b"x\0"; +pub const PRIxLEAST64: &[u8; 4] = b"llx\0"; +pub const PRIxFAST8: &[u8; 2] = b"x\0"; +pub const PRIxFAST64: &[u8; 4] = b"llx\0"; +pub const PRIxMAX: &[u8; 3] = b"jx\0"; +pub const PRIX8: &[u8; 2] = b"X\0"; +pub const PRIX16: &[u8; 2] = b"X\0"; +pub const PRIX32: &[u8; 2] = b"X\0"; +pub const PRIX64: &[u8; 4] = b"llX\0"; +pub const PRIXLEAST8: &[u8; 2] = b"X\0"; +pub const PRIXLEAST16: &[u8; 2] = b"X\0"; +pub const PRIXLEAST32: &[u8; 2] = b"X\0"; +pub const PRIXLEAST64: &[u8; 4] = b"llX\0"; +pub const PRIXFAST8: &[u8; 2] = b"X\0"; +pub const PRIXFAST64: &[u8; 4] = b"llX\0"; +pub const PRIXMAX: &[u8; 3] = b"jX\0"; +pub const SCNd8: &[u8; 4] = b"hhd\0"; +pub const SCNd16: &[u8; 3] = b"hd\0"; +pub const SCNd32: &[u8; 2] = b"d\0"; +pub const SCNd64: &[u8; 4] = b"lld\0"; +pub const SCNdLEAST8: &[u8; 4] = b"hhd\0"; +pub const SCNdLEAST16: &[u8; 3] = b"hd\0"; +pub const SCNdLEAST32: &[u8; 2] = b"d\0"; +pub const SCNdLEAST64: &[u8; 4] = b"lld\0"; +pub const SCNdFAST8: &[u8; 4] = b"hhd\0"; +pub const SCNdFAST64: &[u8; 4] = b"lld\0"; +pub const SCNdMAX: &[u8; 3] = b"jd\0"; +pub const SCNi8: &[u8; 4] = b"hhi\0"; +pub const SCNi16: &[u8; 3] = b"hi\0"; +pub const SCNi32: &[u8; 2] = b"i\0"; +pub const SCNi64: &[u8; 4] = b"lli\0"; +pub const SCNiLEAST8: &[u8; 4] = b"hhi\0"; +pub const SCNiLEAST16: &[u8; 3] = b"hi\0"; +pub const SCNiLEAST32: &[u8; 2] = b"i\0"; +pub const SCNiLEAST64: &[u8; 4] = b"lli\0"; +pub const SCNiFAST8: &[u8; 4] = b"hhi\0"; +pub const SCNiFAST64: &[u8; 4] = b"lli\0"; +pub const SCNiMAX: &[u8; 3] = b"ji\0"; +pub const SCNo8: &[u8; 4] = b"hho\0"; +pub const SCNo16: &[u8; 3] = b"ho\0"; +pub const SCNo32: &[u8; 2] = b"o\0"; +pub const SCNo64: &[u8; 4] = b"llo\0"; +pub const SCNoLEAST8: &[u8; 4] = b"hho\0"; +pub const SCNoLEAST16: &[u8; 3] = b"ho\0"; +pub const SCNoLEAST32: &[u8; 2] = b"o\0"; +pub const SCNoLEAST64: &[u8; 4] = b"llo\0"; +pub const SCNoFAST8: &[u8; 4] = b"hho\0"; +pub const SCNoFAST64: &[u8; 4] = b"llo\0"; +pub const SCNoMAX: &[u8; 3] = b"jo\0"; +pub const SCNu8: &[u8; 4] = b"hhu\0"; +pub const SCNu16: &[u8; 3] = b"hu\0"; +pub const SCNu32: &[u8; 2] = b"u\0"; +pub const SCNu64: &[u8; 4] = b"llu\0"; +pub const SCNuLEAST8: &[u8; 4] = b"hhu\0"; +pub const SCNuLEAST16: &[u8; 3] = b"hu\0"; +pub const SCNuLEAST32: &[u8; 2] = b"u\0"; +pub const SCNuLEAST64: &[u8; 4] = b"llu\0"; +pub const SCNuFAST8: &[u8; 4] = b"hhu\0"; +pub const SCNuFAST64: &[u8; 4] = b"llu\0"; +pub const SCNuMAX: &[u8; 3] = b"ju\0"; +pub const SCNx8: &[u8; 4] = b"hhx\0"; +pub const SCNx16: &[u8; 3] = b"hx\0"; +pub const SCNx32: &[u8; 2] = b"x\0"; +pub const SCNx64: &[u8; 4] = b"llx\0"; +pub const SCNxLEAST8: &[u8; 4] = b"hhx\0"; +pub const SCNxLEAST16: &[u8; 3] = b"hx\0"; +pub const SCNxLEAST32: &[u8; 2] = b"x\0"; +pub const SCNxLEAST64: &[u8; 4] = b"llx\0"; +pub const SCNxFAST8: &[u8; 4] = b"hhx\0"; +pub const SCNxFAST64: &[u8; 4] = b"llx\0"; +pub const SCNxMAX: &[u8; 3] = b"jx\0"; 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; +pub const GAMETEXTINPUT_MAJOR_VERSION: u32 = 2; +pub const GAMETEXTINPUT_MINOR_VERSION: u32 = 0; +pub const GAMETEXTINPUT_BUGFIX_VERSION: u32 = 0; +pub const GAMEACTIVITY_MAJOR_VERSION: u32 = 2; +pub const GAMEACTIVITY_MINOR_VERSION: u32 = 0; +pub const GAMEACTIVITY_BUGFIX_VERSION: u32 = 2; pub const POLLIN: u32 = 1; pub const POLLPRI: u32 = 2; pub const POLLOUT: u32 = 4; @@ -495,19 +504,21 @@ 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_THIRTYTWO: u32 = 33554432; -pub const SA_RESTORER: u32 = 67108864; +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 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; @@ -557,7 +568,9 @@ 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 NSIGSEGV: u32 = 7; +pub const SEGV_MTEAERR: u32 = 8; +pub const SEGV_MTESERR: u32 = 9; +pub const NSIGSEGV: u32 = 9; pub const BUS_ADRALN: u32 = 1; pub const BUS_ADRERR: u32 = 2; pub const BUS_OBJERR: u32 = 3; @@ -569,7 +582,8 @@ 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 NSIGTRAP: u32 = 5; +pub const TRAP_PERF: u32 = 6; +pub const NSIGTRAP: u32 = 6; pub const CLD_EXITED: u32 = 1; pub const CLD_KILLED: u32 = 2; pub const CLD_DUMPED: u32 = 3; @@ -585,7 +599,8 @@ 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 NSIGSYS: u32 = 1; +pub const SYS_USER_DISPATCH: u32 = 2; +pub const NSIGSYS: u32 = 2; pub const EMT_TAGOVF: u32 = 1; pub const NSIGEMT: u32 = 1; pub const SIGEV_SIGNAL: u32 = 0; @@ -650,6 +665,12 @@ 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; @@ -681,9 +702,6 @@ pub const PTHREAD_PROCESS_PRIVATE: u32 = 0; pub const PTHREAD_PROCESS_SHARED: u32 = 1; pub const PTHREAD_SCOPE_SYSTEM: u32 = 0; pub const PTHREAD_SCOPE_PROCESS: u32 = 1; -pub const NATIVE_APP_GLUE_MAX_NUM_MOTION_EVENTS: u32 = 16; -pub const NATIVE_APP_GLUE_MAX_HISTORICAL_POINTER_SAMPLES: u32 = 64; -pub const NATIVE_APP_GLUE_MAX_NUM_KEY_EVENTS: u32 = 4; pub const NATIVE_APP_GLUE_MAX_INPUT_BUFFERS: u32 = 2; extern "C" { pub fn android_get_application_target_sdk_version() -> ::std::os::raw::c_int; @@ -700,6 +718,8 @@ pub struct max_align_t { } #[test] fn bindgen_test_layout_max_align_t() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 16usize, @@ -711,9 +731,7 @@ fn bindgen_test_layout_max_align_t() { concat!("Alignment of ", stringify!(max_align_t)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).__clang_max_align_nonce1 as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).__clang_max_align_nonce1) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -723,9 +741,7 @@ fn bindgen_test_layout_max_align_t() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).__clang_max_align_nonce2 as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).__clang_max_align_nonce2) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -778,6 +794,8 @@ pub struct __kernel_fd_set { } #[test] fn bindgen_test_layout___kernel_fd_set() { + const UNINIT: ::std::mem::MaybeUninit<__kernel_fd_set> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__kernel_fd_set>(), 128usize, @@ -789,7 +807,7 @@ fn bindgen_test_layout___kernel_fd_set() { concat!("Alignment of ", stringify!(__kernel_fd_set)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_fd_set>())).fds_bits as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).fds_bits) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -828,6 +846,8 @@ pub struct __kernel_fsid_t { } #[test] fn bindgen_test_layout___kernel_fsid_t() { + const UNINIT: ::std::mem::MaybeUninit<__kernel_fsid_t> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__kernel_fsid_t>(), 8usize, @@ -839,7 +859,7 @@ fn bindgen_test_layout___kernel_fsid_t() { concat!("Alignment of ", stringify!(__kernel_fsid_t)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_fsid_t>())).val as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).val) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -851,6 +871,7 @@ 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; @@ -909,7 +930,6 @@ pub type off64_t = loff_t; pub type __socklen_t = i32; pub type socklen_t = __socklen_t; pub type __va_list = u32; -pub type ssize_t = __kernel_ssize_t; pub type uint_t = ::std::os::raw::c_uint; pub type uint = ::std::os::raw::c_uint; pub type u_char = ::std::os::raw::c_uchar; @@ -920,483 +940,651 @@ pub type u_int32_t = u32; pub type u_int16_t = u16; pub type u_int8_t = u8; pub type u_int64_t = u64; -pub const AASSET_MODE_UNKNOWN: ::std::os::raw::c_uint = 0; -pub const AASSET_MODE_RANDOM: ::std::os::raw::c_uint = 1; -pub const AASSET_MODE_STREAMING: ::std::os::raw::c_uint = 2; -pub const AASSET_MODE_BUFFER: ::std::os::raw::c_uint = 3; +pub const AASSET_MODE_UNKNOWN: _bindgen_ty_1 = 0; +pub const AASSET_MODE_RANDOM: _bindgen_ty_1 = 1; +pub const AASSET_MODE_STREAMING: _bindgen_ty_1 = 2; +pub const AASSET_MODE_BUFFER: _bindgen_ty_1 = 3; pub type _bindgen_ty_1 = ::std::os::raw::c_uint; -pub const AKEYCODE_UNKNOWN: ::std::os::raw::c_uint = 0; -pub const AKEYCODE_SOFT_LEFT: ::std::os::raw::c_uint = 1; -pub const AKEYCODE_SOFT_RIGHT: ::std::os::raw::c_uint = 2; -pub const AKEYCODE_HOME: ::std::os::raw::c_uint = 3; -pub const AKEYCODE_BACK: ::std::os::raw::c_uint = 4; -pub const AKEYCODE_CALL: ::std::os::raw::c_uint = 5; -pub const AKEYCODE_ENDCALL: ::std::os::raw::c_uint = 6; -pub const AKEYCODE_0: ::std::os::raw::c_uint = 7; -pub const AKEYCODE_1: ::std::os::raw::c_uint = 8; -pub const AKEYCODE_2: ::std::os::raw::c_uint = 9; -pub const AKEYCODE_3: ::std::os::raw::c_uint = 10; -pub const AKEYCODE_4: ::std::os::raw::c_uint = 11; -pub const AKEYCODE_5: ::std::os::raw::c_uint = 12; -pub const AKEYCODE_6: ::std::os::raw::c_uint = 13; -pub const AKEYCODE_7: ::std::os::raw::c_uint = 14; -pub const AKEYCODE_8: ::std::os::raw::c_uint = 15; -pub const AKEYCODE_9: ::std::os::raw::c_uint = 16; -pub const AKEYCODE_STAR: ::std::os::raw::c_uint = 17; -pub const AKEYCODE_POUND: ::std::os::raw::c_uint = 18; -pub const AKEYCODE_DPAD_UP: ::std::os::raw::c_uint = 19; -pub const AKEYCODE_DPAD_DOWN: ::std::os::raw::c_uint = 20; -pub const AKEYCODE_DPAD_LEFT: ::std::os::raw::c_uint = 21; -pub const AKEYCODE_DPAD_RIGHT: ::std::os::raw::c_uint = 22; -pub const AKEYCODE_DPAD_CENTER: ::std::os::raw::c_uint = 23; -pub const AKEYCODE_VOLUME_UP: ::std::os::raw::c_uint = 24; -pub const AKEYCODE_VOLUME_DOWN: ::std::os::raw::c_uint = 25; -pub const AKEYCODE_POWER: ::std::os::raw::c_uint = 26; -pub const AKEYCODE_CAMERA: ::std::os::raw::c_uint = 27; -pub const AKEYCODE_CLEAR: ::std::os::raw::c_uint = 28; -pub const AKEYCODE_A: ::std::os::raw::c_uint = 29; -pub const AKEYCODE_B: ::std::os::raw::c_uint = 30; -pub const AKEYCODE_C: ::std::os::raw::c_uint = 31; -pub const AKEYCODE_D: ::std::os::raw::c_uint = 32; -pub const AKEYCODE_E: ::std::os::raw::c_uint = 33; -pub const AKEYCODE_F: ::std::os::raw::c_uint = 34; -pub const AKEYCODE_G: ::std::os::raw::c_uint = 35; -pub const AKEYCODE_H: ::std::os::raw::c_uint = 36; -pub const AKEYCODE_I: ::std::os::raw::c_uint = 37; -pub const AKEYCODE_J: ::std::os::raw::c_uint = 38; -pub const AKEYCODE_K: ::std::os::raw::c_uint = 39; -pub const AKEYCODE_L: ::std::os::raw::c_uint = 40; -pub const AKEYCODE_M: ::std::os::raw::c_uint = 41; -pub const AKEYCODE_N: ::std::os::raw::c_uint = 42; -pub const AKEYCODE_O: ::std::os::raw::c_uint = 43; -pub const AKEYCODE_P: ::std::os::raw::c_uint = 44; -pub const AKEYCODE_Q: ::std::os::raw::c_uint = 45; -pub const AKEYCODE_R: ::std::os::raw::c_uint = 46; -pub const AKEYCODE_S: ::std::os::raw::c_uint = 47; -pub const AKEYCODE_T: ::std::os::raw::c_uint = 48; -pub const AKEYCODE_U: ::std::os::raw::c_uint = 49; -pub const AKEYCODE_V: ::std::os::raw::c_uint = 50; -pub const AKEYCODE_W: ::std::os::raw::c_uint = 51; -pub const AKEYCODE_X: ::std::os::raw::c_uint = 52; -pub const AKEYCODE_Y: ::std::os::raw::c_uint = 53; -pub const AKEYCODE_Z: ::std::os::raw::c_uint = 54; -pub const AKEYCODE_COMMA: ::std::os::raw::c_uint = 55; -pub const AKEYCODE_PERIOD: ::std::os::raw::c_uint = 56; -pub const AKEYCODE_ALT_LEFT: ::std::os::raw::c_uint = 57; -pub const AKEYCODE_ALT_RIGHT: ::std::os::raw::c_uint = 58; -pub const AKEYCODE_SHIFT_LEFT: ::std::os::raw::c_uint = 59; -pub const AKEYCODE_SHIFT_RIGHT: ::std::os::raw::c_uint = 60; -pub const AKEYCODE_TAB: ::std::os::raw::c_uint = 61; -pub const AKEYCODE_SPACE: ::std::os::raw::c_uint = 62; -pub const AKEYCODE_SYM: ::std::os::raw::c_uint = 63; -pub const AKEYCODE_EXPLORER: ::std::os::raw::c_uint = 64; -pub const AKEYCODE_ENVELOPE: ::std::os::raw::c_uint = 65; -pub const AKEYCODE_ENTER: ::std::os::raw::c_uint = 66; -pub const AKEYCODE_DEL: ::std::os::raw::c_uint = 67; -pub const AKEYCODE_GRAVE: ::std::os::raw::c_uint = 68; -pub const AKEYCODE_MINUS: ::std::os::raw::c_uint = 69; -pub const AKEYCODE_EQUALS: ::std::os::raw::c_uint = 70; -pub const AKEYCODE_LEFT_BRACKET: ::std::os::raw::c_uint = 71; -pub const AKEYCODE_RIGHT_BRACKET: ::std::os::raw::c_uint = 72; -pub const AKEYCODE_BACKSLASH: ::std::os::raw::c_uint = 73; -pub const AKEYCODE_SEMICOLON: ::std::os::raw::c_uint = 74; -pub const AKEYCODE_APOSTROPHE: ::std::os::raw::c_uint = 75; -pub const AKEYCODE_SLASH: ::std::os::raw::c_uint = 76; -pub const AKEYCODE_AT: ::std::os::raw::c_uint = 77; -pub const AKEYCODE_NUM: ::std::os::raw::c_uint = 78; -pub const AKEYCODE_HEADSETHOOK: ::std::os::raw::c_uint = 79; -pub const AKEYCODE_FOCUS: ::std::os::raw::c_uint = 80; -pub const AKEYCODE_PLUS: ::std::os::raw::c_uint = 81; -pub const AKEYCODE_MENU: ::std::os::raw::c_uint = 82; -pub const AKEYCODE_NOTIFICATION: ::std::os::raw::c_uint = 83; -pub const AKEYCODE_SEARCH: ::std::os::raw::c_uint = 84; -pub const AKEYCODE_MEDIA_PLAY_PAUSE: ::std::os::raw::c_uint = 85; -pub const AKEYCODE_MEDIA_STOP: ::std::os::raw::c_uint = 86; -pub const AKEYCODE_MEDIA_NEXT: ::std::os::raw::c_uint = 87; -pub const AKEYCODE_MEDIA_PREVIOUS: ::std::os::raw::c_uint = 88; -pub const AKEYCODE_MEDIA_REWIND: ::std::os::raw::c_uint = 89; -pub const AKEYCODE_MEDIA_FAST_FORWARD: ::std::os::raw::c_uint = 90; -pub const AKEYCODE_MUTE: ::std::os::raw::c_uint = 91; -pub const AKEYCODE_PAGE_UP: ::std::os::raw::c_uint = 92; -pub const AKEYCODE_PAGE_DOWN: ::std::os::raw::c_uint = 93; -pub const AKEYCODE_PICTSYMBOLS: ::std::os::raw::c_uint = 94; -pub const AKEYCODE_SWITCH_CHARSET: ::std::os::raw::c_uint = 95; -pub const AKEYCODE_BUTTON_A: ::std::os::raw::c_uint = 96; -pub const AKEYCODE_BUTTON_B: ::std::os::raw::c_uint = 97; -pub const AKEYCODE_BUTTON_C: ::std::os::raw::c_uint = 98; -pub const AKEYCODE_BUTTON_X: ::std::os::raw::c_uint = 99; -pub const AKEYCODE_BUTTON_Y: ::std::os::raw::c_uint = 100; -pub const AKEYCODE_BUTTON_Z: ::std::os::raw::c_uint = 101; -pub const AKEYCODE_BUTTON_L1: ::std::os::raw::c_uint = 102; -pub const AKEYCODE_BUTTON_R1: ::std::os::raw::c_uint = 103; -pub const AKEYCODE_BUTTON_L2: ::std::os::raw::c_uint = 104; -pub const AKEYCODE_BUTTON_R2: ::std::os::raw::c_uint = 105; -pub const AKEYCODE_BUTTON_THUMBL: ::std::os::raw::c_uint = 106; -pub const AKEYCODE_BUTTON_THUMBR: ::std::os::raw::c_uint = 107; -pub const AKEYCODE_BUTTON_START: ::std::os::raw::c_uint = 108; -pub const AKEYCODE_BUTTON_SELECT: ::std::os::raw::c_uint = 109; -pub const AKEYCODE_BUTTON_MODE: ::std::os::raw::c_uint = 110; -pub const AKEYCODE_ESCAPE: ::std::os::raw::c_uint = 111; -pub const AKEYCODE_FORWARD_DEL: ::std::os::raw::c_uint = 112; -pub const AKEYCODE_CTRL_LEFT: ::std::os::raw::c_uint = 113; -pub const AKEYCODE_CTRL_RIGHT: ::std::os::raw::c_uint = 114; -pub const AKEYCODE_CAPS_LOCK: ::std::os::raw::c_uint = 115; -pub const AKEYCODE_SCROLL_LOCK: ::std::os::raw::c_uint = 116; -pub const AKEYCODE_META_LEFT: ::std::os::raw::c_uint = 117; -pub const AKEYCODE_META_RIGHT: ::std::os::raw::c_uint = 118; -pub const AKEYCODE_FUNCTION: ::std::os::raw::c_uint = 119; -pub const AKEYCODE_SYSRQ: ::std::os::raw::c_uint = 120; -pub const AKEYCODE_BREAK: ::std::os::raw::c_uint = 121; -pub const AKEYCODE_MOVE_HOME: ::std::os::raw::c_uint = 122; -pub const AKEYCODE_MOVE_END: ::std::os::raw::c_uint = 123; -pub const AKEYCODE_INSERT: ::std::os::raw::c_uint = 124; -pub const AKEYCODE_FORWARD: ::std::os::raw::c_uint = 125; -pub const AKEYCODE_MEDIA_PLAY: ::std::os::raw::c_uint = 126; -pub const AKEYCODE_MEDIA_PAUSE: ::std::os::raw::c_uint = 127; -pub const AKEYCODE_MEDIA_CLOSE: ::std::os::raw::c_uint = 128; -pub const AKEYCODE_MEDIA_EJECT: ::std::os::raw::c_uint = 129; -pub const AKEYCODE_MEDIA_RECORD: ::std::os::raw::c_uint = 130; -pub const AKEYCODE_F1: ::std::os::raw::c_uint = 131; -pub const AKEYCODE_F2: ::std::os::raw::c_uint = 132; -pub const AKEYCODE_F3: ::std::os::raw::c_uint = 133; -pub const AKEYCODE_F4: ::std::os::raw::c_uint = 134; -pub const AKEYCODE_F5: ::std::os::raw::c_uint = 135; -pub const AKEYCODE_F6: ::std::os::raw::c_uint = 136; -pub const AKEYCODE_F7: ::std::os::raw::c_uint = 137; -pub const AKEYCODE_F8: ::std::os::raw::c_uint = 138; -pub const AKEYCODE_F9: ::std::os::raw::c_uint = 139; -pub const AKEYCODE_F10: ::std::os::raw::c_uint = 140; -pub const AKEYCODE_F11: ::std::os::raw::c_uint = 141; -pub const AKEYCODE_F12: ::std::os::raw::c_uint = 142; -pub const AKEYCODE_NUM_LOCK: ::std::os::raw::c_uint = 143; -pub const AKEYCODE_NUMPAD_0: ::std::os::raw::c_uint = 144; -pub const AKEYCODE_NUMPAD_1: ::std::os::raw::c_uint = 145; -pub const AKEYCODE_NUMPAD_2: ::std::os::raw::c_uint = 146; -pub const AKEYCODE_NUMPAD_3: ::std::os::raw::c_uint = 147; -pub const AKEYCODE_NUMPAD_4: ::std::os::raw::c_uint = 148; -pub const AKEYCODE_NUMPAD_5: ::std::os::raw::c_uint = 149; -pub const AKEYCODE_NUMPAD_6: ::std::os::raw::c_uint = 150; -pub const AKEYCODE_NUMPAD_7: ::std::os::raw::c_uint = 151; -pub const AKEYCODE_NUMPAD_8: ::std::os::raw::c_uint = 152; -pub const AKEYCODE_NUMPAD_9: ::std::os::raw::c_uint = 153; -pub const AKEYCODE_NUMPAD_DIVIDE: ::std::os::raw::c_uint = 154; -pub const AKEYCODE_NUMPAD_MULTIPLY: ::std::os::raw::c_uint = 155; -pub const AKEYCODE_NUMPAD_SUBTRACT: ::std::os::raw::c_uint = 156; -pub const AKEYCODE_NUMPAD_ADD: ::std::os::raw::c_uint = 157; -pub const AKEYCODE_NUMPAD_DOT: ::std::os::raw::c_uint = 158; -pub const AKEYCODE_NUMPAD_COMMA: ::std::os::raw::c_uint = 159; -pub const AKEYCODE_NUMPAD_ENTER: ::std::os::raw::c_uint = 160; -pub const AKEYCODE_NUMPAD_EQUALS: ::std::os::raw::c_uint = 161; -pub const AKEYCODE_NUMPAD_LEFT_PAREN: ::std::os::raw::c_uint = 162; -pub const AKEYCODE_NUMPAD_RIGHT_PAREN: ::std::os::raw::c_uint = 163; -pub const AKEYCODE_VOLUME_MUTE: ::std::os::raw::c_uint = 164; -pub const AKEYCODE_INFO: ::std::os::raw::c_uint = 165; -pub const AKEYCODE_CHANNEL_UP: ::std::os::raw::c_uint = 166; -pub const AKEYCODE_CHANNEL_DOWN: ::std::os::raw::c_uint = 167; -pub const AKEYCODE_ZOOM_IN: ::std::os::raw::c_uint = 168; -pub const AKEYCODE_ZOOM_OUT: ::std::os::raw::c_uint = 169; -pub const AKEYCODE_TV: ::std::os::raw::c_uint = 170; -pub const AKEYCODE_WINDOW: ::std::os::raw::c_uint = 171; -pub const AKEYCODE_GUIDE: ::std::os::raw::c_uint = 172; -pub const AKEYCODE_DVR: ::std::os::raw::c_uint = 173; -pub const AKEYCODE_BOOKMARK: ::std::os::raw::c_uint = 174; -pub const AKEYCODE_CAPTIONS: ::std::os::raw::c_uint = 175; -pub const AKEYCODE_SETTINGS: ::std::os::raw::c_uint = 176; -pub const AKEYCODE_TV_POWER: ::std::os::raw::c_uint = 177; -pub const AKEYCODE_TV_INPUT: ::std::os::raw::c_uint = 178; -pub const AKEYCODE_STB_POWER: ::std::os::raw::c_uint = 179; -pub const AKEYCODE_STB_INPUT: ::std::os::raw::c_uint = 180; -pub const AKEYCODE_AVR_POWER: ::std::os::raw::c_uint = 181; -pub const AKEYCODE_AVR_INPUT: ::std::os::raw::c_uint = 182; -pub const AKEYCODE_PROG_RED: ::std::os::raw::c_uint = 183; -pub const AKEYCODE_PROG_GREEN: ::std::os::raw::c_uint = 184; -pub const AKEYCODE_PROG_YELLOW: ::std::os::raw::c_uint = 185; -pub const AKEYCODE_PROG_BLUE: ::std::os::raw::c_uint = 186; -pub const AKEYCODE_APP_SWITCH: ::std::os::raw::c_uint = 187; -pub const AKEYCODE_BUTTON_1: ::std::os::raw::c_uint = 188; -pub const AKEYCODE_BUTTON_2: ::std::os::raw::c_uint = 189; -pub const AKEYCODE_BUTTON_3: ::std::os::raw::c_uint = 190; -pub const AKEYCODE_BUTTON_4: ::std::os::raw::c_uint = 191; -pub const AKEYCODE_BUTTON_5: ::std::os::raw::c_uint = 192; -pub const AKEYCODE_BUTTON_6: ::std::os::raw::c_uint = 193; -pub const AKEYCODE_BUTTON_7: ::std::os::raw::c_uint = 194; -pub const AKEYCODE_BUTTON_8: ::std::os::raw::c_uint = 195; -pub const AKEYCODE_BUTTON_9: ::std::os::raw::c_uint = 196; -pub const AKEYCODE_BUTTON_10: ::std::os::raw::c_uint = 197; -pub const AKEYCODE_BUTTON_11: ::std::os::raw::c_uint = 198; -pub const AKEYCODE_BUTTON_12: ::std::os::raw::c_uint = 199; -pub const AKEYCODE_BUTTON_13: ::std::os::raw::c_uint = 200; -pub const AKEYCODE_BUTTON_14: ::std::os::raw::c_uint = 201; -pub const AKEYCODE_BUTTON_15: ::std::os::raw::c_uint = 202; -pub const AKEYCODE_BUTTON_16: ::std::os::raw::c_uint = 203; -pub const AKEYCODE_LANGUAGE_SWITCH: ::std::os::raw::c_uint = 204; -pub const AKEYCODE_MANNER_MODE: ::std::os::raw::c_uint = 205; -pub const AKEYCODE_3D_MODE: ::std::os::raw::c_uint = 206; -pub const AKEYCODE_CONTACTS: ::std::os::raw::c_uint = 207; -pub const AKEYCODE_CALENDAR: ::std::os::raw::c_uint = 208; -pub const AKEYCODE_MUSIC: ::std::os::raw::c_uint = 209; -pub const AKEYCODE_CALCULATOR: ::std::os::raw::c_uint = 210; -pub const AKEYCODE_ZENKAKU_HANKAKU: ::std::os::raw::c_uint = 211; -pub const AKEYCODE_EISU: ::std::os::raw::c_uint = 212; -pub const AKEYCODE_MUHENKAN: ::std::os::raw::c_uint = 213; -pub const AKEYCODE_HENKAN: ::std::os::raw::c_uint = 214; -pub const AKEYCODE_KATAKANA_HIRAGANA: ::std::os::raw::c_uint = 215; -pub const AKEYCODE_YEN: ::std::os::raw::c_uint = 216; -pub const AKEYCODE_RO: ::std::os::raw::c_uint = 217; -pub const AKEYCODE_KANA: ::std::os::raw::c_uint = 218; -pub const AKEYCODE_ASSIST: ::std::os::raw::c_uint = 219; -pub const AKEYCODE_BRIGHTNESS_DOWN: ::std::os::raw::c_uint = 220; -pub const AKEYCODE_BRIGHTNESS_UP: ::std::os::raw::c_uint = 221; -pub const AKEYCODE_MEDIA_AUDIO_TRACK: ::std::os::raw::c_uint = 222; -pub const AKEYCODE_SLEEP: ::std::os::raw::c_uint = 223; -pub const AKEYCODE_WAKEUP: ::std::os::raw::c_uint = 224; -pub const AKEYCODE_PAIRING: ::std::os::raw::c_uint = 225; -pub const AKEYCODE_MEDIA_TOP_MENU: ::std::os::raw::c_uint = 226; -pub const AKEYCODE_11: ::std::os::raw::c_uint = 227; -pub const AKEYCODE_12: ::std::os::raw::c_uint = 228; -pub const AKEYCODE_LAST_CHANNEL: ::std::os::raw::c_uint = 229; -pub const AKEYCODE_TV_DATA_SERVICE: ::std::os::raw::c_uint = 230; -pub const AKEYCODE_VOICE_ASSIST: ::std::os::raw::c_uint = 231; -pub const AKEYCODE_TV_RADIO_SERVICE: ::std::os::raw::c_uint = 232; -pub const AKEYCODE_TV_TELETEXT: ::std::os::raw::c_uint = 233; -pub const AKEYCODE_TV_NUMBER_ENTRY: ::std::os::raw::c_uint = 234; -pub const AKEYCODE_TV_TERRESTRIAL_ANALOG: ::std::os::raw::c_uint = 235; -pub const AKEYCODE_TV_TERRESTRIAL_DIGITAL: ::std::os::raw::c_uint = 236; -pub const AKEYCODE_TV_SATELLITE: ::std::os::raw::c_uint = 237; -pub const AKEYCODE_TV_SATELLITE_BS: ::std::os::raw::c_uint = 238; -pub const AKEYCODE_TV_SATELLITE_CS: ::std::os::raw::c_uint = 239; -pub const AKEYCODE_TV_SATELLITE_SERVICE: ::std::os::raw::c_uint = 240; -pub const AKEYCODE_TV_NETWORK: ::std::os::raw::c_uint = 241; -pub const AKEYCODE_TV_ANTENNA_CABLE: ::std::os::raw::c_uint = 242; -pub const AKEYCODE_TV_INPUT_HDMI_1: ::std::os::raw::c_uint = 243; -pub const AKEYCODE_TV_INPUT_HDMI_2: ::std::os::raw::c_uint = 244; -pub const AKEYCODE_TV_INPUT_HDMI_3: ::std::os::raw::c_uint = 245; -pub const AKEYCODE_TV_INPUT_HDMI_4: ::std::os::raw::c_uint = 246; -pub const AKEYCODE_TV_INPUT_COMPOSITE_1: ::std::os::raw::c_uint = 247; -pub const AKEYCODE_TV_INPUT_COMPOSITE_2: ::std::os::raw::c_uint = 248; -pub const AKEYCODE_TV_INPUT_COMPONENT_1: ::std::os::raw::c_uint = 249; -pub const AKEYCODE_TV_INPUT_COMPONENT_2: ::std::os::raw::c_uint = 250; -pub const AKEYCODE_TV_INPUT_VGA_1: ::std::os::raw::c_uint = 251; -pub const AKEYCODE_TV_AUDIO_DESCRIPTION: ::std::os::raw::c_uint = 252; -pub const AKEYCODE_TV_AUDIO_DESCRIPTION_MIX_UP: ::std::os::raw::c_uint = 253; -pub const AKEYCODE_TV_AUDIO_DESCRIPTION_MIX_DOWN: ::std::os::raw::c_uint = 254; -pub const AKEYCODE_TV_ZOOM_MODE: ::std::os::raw::c_uint = 255; -pub const AKEYCODE_TV_CONTENTS_MENU: ::std::os::raw::c_uint = 256; -pub const AKEYCODE_TV_MEDIA_CONTEXT_MENU: ::std::os::raw::c_uint = 257; -pub const AKEYCODE_TV_TIMER_PROGRAMMING: ::std::os::raw::c_uint = 258; -pub const AKEYCODE_HELP: ::std::os::raw::c_uint = 259; -pub const AKEYCODE_NAVIGATE_PREVIOUS: ::std::os::raw::c_uint = 260; -pub const AKEYCODE_NAVIGATE_NEXT: ::std::os::raw::c_uint = 261; -pub const AKEYCODE_NAVIGATE_IN: ::std::os::raw::c_uint = 262; -pub const AKEYCODE_NAVIGATE_OUT: ::std::os::raw::c_uint = 263; -pub const AKEYCODE_STEM_PRIMARY: ::std::os::raw::c_uint = 264; -pub const AKEYCODE_STEM_1: ::std::os::raw::c_uint = 265; -pub const AKEYCODE_STEM_2: ::std::os::raw::c_uint = 266; -pub const AKEYCODE_STEM_3: ::std::os::raw::c_uint = 267; -pub const AKEYCODE_DPAD_UP_LEFT: ::std::os::raw::c_uint = 268; -pub const AKEYCODE_DPAD_DOWN_LEFT: ::std::os::raw::c_uint = 269; -pub const AKEYCODE_DPAD_UP_RIGHT: ::std::os::raw::c_uint = 270; -pub const AKEYCODE_DPAD_DOWN_RIGHT: ::std::os::raw::c_uint = 271; -pub const AKEYCODE_MEDIA_SKIP_FORWARD: ::std::os::raw::c_uint = 272; -pub const AKEYCODE_MEDIA_SKIP_BACKWARD: ::std::os::raw::c_uint = 273; -pub const AKEYCODE_MEDIA_STEP_FORWARD: ::std::os::raw::c_uint = 274; -pub const AKEYCODE_MEDIA_STEP_BACKWARD: ::std::os::raw::c_uint = 275; -pub const AKEYCODE_SOFT_SLEEP: ::std::os::raw::c_uint = 276; -pub const AKEYCODE_CUT: ::std::os::raw::c_uint = 277; -pub const AKEYCODE_COPY: ::std::os::raw::c_uint = 278; -pub const AKEYCODE_PASTE: ::std::os::raw::c_uint = 279; -pub const AKEYCODE_SYSTEM_NAVIGATION_UP: ::std::os::raw::c_uint = 280; -pub const AKEYCODE_SYSTEM_NAVIGATION_DOWN: ::std::os::raw::c_uint = 281; -pub const AKEYCODE_SYSTEM_NAVIGATION_LEFT: ::std::os::raw::c_uint = 282; -pub const AKEYCODE_SYSTEM_NAVIGATION_RIGHT: ::std::os::raw::c_uint = 283; -pub const AKEYCODE_ALL_APPS: ::std::os::raw::c_uint = 284; -pub const AKEYCODE_REFRESH: ::std::os::raw::c_uint = 285; -pub const AKEYCODE_THUMBS_UP: ::std::os::raw::c_uint = 286; -pub const AKEYCODE_THUMBS_DOWN: ::std::os::raw::c_uint = 287; -pub const AKEYCODE_PROFILE_SWITCH: ::std::os::raw::c_uint = 288; +pub const AKEYCODE_UNKNOWN: _bindgen_ty_2 = 0; +pub const AKEYCODE_SOFT_LEFT: _bindgen_ty_2 = 1; +pub const AKEYCODE_SOFT_RIGHT: _bindgen_ty_2 = 2; +pub const AKEYCODE_HOME: _bindgen_ty_2 = 3; +pub const AKEYCODE_BACK: _bindgen_ty_2 = 4; +pub const AKEYCODE_CALL: _bindgen_ty_2 = 5; +pub const AKEYCODE_ENDCALL: _bindgen_ty_2 = 6; +pub const AKEYCODE_0: _bindgen_ty_2 = 7; +pub const AKEYCODE_1: _bindgen_ty_2 = 8; +pub const AKEYCODE_2: _bindgen_ty_2 = 9; +pub const AKEYCODE_3: _bindgen_ty_2 = 10; +pub const AKEYCODE_4: _bindgen_ty_2 = 11; +pub const AKEYCODE_5: _bindgen_ty_2 = 12; +pub const AKEYCODE_6: _bindgen_ty_2 = 13; +pub const AKEYCODE_7: _bindgen_ty_2 = 14; +pub const AKEYCODE_8: _bindgen_ty_2 = 15; +pub const AKEYCODE_9: _bindgen_ty_2 = 16; +pub const AKEYCODE_STAR: _bindgen_ty_2 = 17; +pub const AKEYCODE_POUND: _bindgen_ty_2 = 18; +pub const AKEYCODE_DPAD_UP: _bindgen_ty_2 = 19; +pub const AKEYCODE_DPAD_DOWN: _bindgen_ty_2 = 20; +pub const AKEYCODE_DPAD_LEFT: _bindgen_ty_2 = 21; +pub const AKEYCODE_DPAD_RIGHT: _bindgen_ty_2 = 22; +pub const AKEYCODE_DPAD_CENTER: _bindgen_ty_2 = 23; +pub const AKEYCODE_VOLUME_UP: _bindgen_ty_2 = 24; +pub const AKEYCODE_VOLUME_DOWN: _bindgen_ty_2 = 25; +pub const AKEYCODE_POWER: _bindgen_ty_2 = 26; +pub const AKEYCODE_CAMERA: _bindgen_ty_2 = 27; +pub const AKEYCODE_CLEAR: _bindgen_ty_2 = 28; +pub const AKEYCODE_A: _bindgen_ty_2 = 29; +pub const AKEYCODE_B: _bindgen_ty_2 = 30; +pub const AKEYCODE_C: _bindgen_ty_2 = 31; +pub const AKEYCODE_D: _bindgen_ty_2 = 32; +pub const AKEYCODE_E: _bindgen_ty_2 = 33; +pub const AKEYCODE_F: _bindgen_ty_2 = 34; +pub const AKEYCODE_G: _bindgen_ty_2 = 35; +pub const AKEYCODE_H: _bindgen_ty_2 = 36; +pub const AKEYCODE_I: _bindgen_ty_2 = 37; +pub const AKEYCODE_J: _bindgen_ty_2 = 38; +pub const AKEYCODE_K: _bindgen_ty_2 = 39; +pub const AKEYCODE_L: _bindgen_ty_2 = 40; +pub const AKEYCODE_M: _bindgen_ty_2 = 41; +pub const AKEYCODE_N: _bindgen_ty_2 = 42; +pub const AKEYCODE_O: _bindgen_ty_2 = 43; +pub const AKEYCODE_P: _bindgen_ty_2 = 44; +pub const AKEYCODE_Q: _bindgen_ty_2 = 45; +pub const AKEYCODE_R: _bindgen_ty_2 = 46; +pub const AKEYCODE_S: _bindgen_ty_2 = 47; +pub const AKEYCODE_T: _bindgen_ty_2 = 48; +pub const AKEYCODE_U: _bindgen_ty_2 = 49; +pub const AKEYCODE_V: _bindgen_ty_2 = 50; +pub const AKEYCODE_W: _bindgen_ty_2 = 51; +pub const AKEYCODE_X: _bindgen_ty_2 = 52; +pub const AKEYCODE_Y: _bindgen_ty_2 = 53; +pub const AKEYCODE_Z: _bindgen_ty_2 = 54; +pub const AKEYCODE_COMMA: _bindgen_ty_2 = 55; +pub const AKEYCODE_PERIOD: _bindgen_ty_2 = 56; +pub const AKEYCODE_ALT_LEFT: _bindgen_ty_2 = 57; +pub const AKEYCODE_ALT_RIGHT: _bindgen_ty_2 = 58; +pub const AKEYCODE_SHIFT_LEFT: _bindgen_ty_2 = 59; +pub const AKEYCODE_SHIFT_RIGHT: _bindgen_ty_2 = 60; +pub const AKEYCODE_TAB: _bindgen_ty_2 = 61; +pub const AKEYCODE_SPACE: _bindgen_ty_2 = 62; +pub const AKEYCODE_SYM: _bindgen_ty_2 = 63; +pub const AKEYCODE_EXPLORER: _bindgen_ty_2 = 64; +pub const AKEYCODE_ENVELOPE: _bindgen_ty_2 = 65; +pub const AKEYCODE_ENTER: _bindgen_ty_2 = 66; +pub const AKEYCODE_DEL: _bindgen_ty_2 = 67; +pub const AKEYCODE_GRAVE: _bindgen_ty_2 = 68; +pub const AKEYCODE_MINUS: _bindgen_ty_2 = 69; +pub const AKEYCODE_EQUALS: _bindgen_ty_2 = 70; +pub const AKEYCODE_LEFT_BRACKET: _bindgen_ty_2 = 71; +pub const AKEYCODE_RIGHT_BRACKET: _bindgen_ty_2 = 72; +pub const AKEYCODE_BACKSLASH: _bindgen_ty_2 = 73; +pub const AKEYCODE_SEMICOLON: _bindgen_ty_2 = 74; +pub const AKEYCODE_APOSTROPHE: _bindgen_ty_2 = 75; +pub const AKEYCODE_SLASH: _bindgen_ty_2 = 76; +pub const AKEYCODE_AT: _bindgen_ty_2 = 77; +pub const AKEYCODE_NUM: _bindgen_ty_2 = 78; +pub const AKEYCODE_HEADSETHOOK: _bindgen_ty_2 = 79; +pub const AKEYCODE_FOCUS: _bindgen_ty_2 = 80; +pub const AKEYCODE_PLUS: _bindgen_ty_2 = 81; +pub const AKEYCODE_MENU: _bindgen_ty_2 = 82; +pub const AKEYCODE_NOTIFICATION: _bindgen_ty_2 = 83; +pub const AKEYCODE_SEARCH: _bindgen_ty_2 = 84; +pub const AKEYCODE_MEDIA_PLAY_PAUSE: _bindgen_ty_2 = 85; +pub const AKEYCODE_MEDIA_STOP: _bindgen_ty_2 = 86; +pub const AKEYCODE_MEDIA_NEXT: _bindgen_ty_2 = 87; +pub const AKEYCODE_MEDIA_PREVIOUS: _bindgen_ty_2 = 88; +pub const AKEYCODE_MEDIA_REWIND: _bindgen_ty_2 = 89; +pub const AKEYCODE_MEDIA_FAST_FORWARD: _bindgen_ty_2 = 90; +pub const AKEYCODE_MUTE: _bindgen_ty_2 = 91; +pub const AKEYCODE_PAGE_UP: _bindgen_ty_2 = 92; +pub const AKEYCODE_PAGE_DOWN: _bindgen_ty_2 = 93; +pub const AKEYCODE_PICTSYMBOLS: _bindgen_ty_2 = 94; +pub const AKEYCODE_SWITCH_CHARSET: _bindgen_ty_2 = 95; +pub const AKEYCODE_BUTTON_A: _bindgen_ty_2 = 96; +pub const AKEYCODE_BUTTON_B: _bindgen_ty_2 = 97; +pub const AKEYCODE_BUTTON_C: _bindgen_ty_2 = 98; +pub const AKEYCODE_BUTTON_X: _bindgen_ty_2 = 99; +pub const AKEYCODE_BUTTON_Y: _bindgen_ty_2 = 100; +pub const AKEYCODE_BUTTON_Z: _bindgen_ty_2 = 101; +pub const AKEYCODE_BUTTON_L1: _bindgen_ty_2 = 102; +pub const AKEYCODE_BUTTON_R1: _bindgen_ty_2 = 103; +pub const AKEYCODE_BUTTON_L2: _bindgen_ty_2 = 104; +pub const AKEYCODE_BUTTON_R2: _bindgen_ty_2 = 105; +pub const AKEYCODE_BUTTON_THUMBL: _bindgen_ty_2 = 106; +pub const AKEYCODE_BUTTON_THUMBR: _bindgen_ty_2 = 107; +pub const AKEYCODE_BUTTON_START: _bindgen_ty_2 = 108; +pub const AKEYCODE_BUTTON_SELECT: _bindgen_ty_2 = 109; +pub const AKEYCODE_BUTTON_MODE: _bindgen_ty_2 = 110; +pub const AKEYCODE_ESCAPE: _bindgen_ty_2 = 111; +pub const AKEYCODE_FORWARD_DEL: _bindgen_ty_2 = 112; +pub const AKEYCODE_CTRL_LEFT: _bindgen_ty_2 = 113; +pub const AKEYCODE_CTRL_RIGHT: _bindgen_ty_2 = 114; +pub const AKEYCODE_CAPS_LOCK: _bindgen_ty_2 = 115; +pub const AKEYCODE_SCROLL_LOCK: _bindgen_ty_2 = 116; +pub const AKEYCODE_META_LEFT: _bindgen_ty_2 = 117; +pub const AKEYCODE_META_RIGHT: _bindgen_ty_2 = 118; +pub const AKEYCODE_FUNCTION: _bindgen_ty_2 = 119; +pub const AKEYCODE_SYSRQ: _bindgen_ty_2 = 120; +pub const AKEYCODE_BREAK: _bindgen_ty_2 = 121; +pub const AKEYCODE_MOVE_HOME: _bindgen_ty_2 = 122; +pub const AKEYCODE_MOVE_END: _bindgen_ty_2 = 123; +pub const AKEYCODE_INSERT: _bindgen_ty_2 = 124; +pub const AKEYCODE_FORWARD: _bindgen_ty_2 = 125; +pub const AKEYCODE_MEDIA_PLAY: _bindgen_ty_2 = 126; +pub const AKEYCODE_MEDIA_PAUSE: _bindgen_ty_2 = 127; +pub const AKEYCODE_MEDIA_CLOSE: _bindgen_ty_2 = 128; +pub const AKEYCODE_MEDIA_EJECT: _bindgen_ty_2 = 129; +pub const AKEYCODE_MEDIA_RECORD: _bindgen_ty_2 = 130; +pub const AKEYCODE_F1: _bindgen_ty_2 = 131; +pub const AKEYCODE_F2: _bindgen_ty_2 = 132; +pub const AKEYCODE_F3: _bindgen_ty_2 = 133; +pub const AKEYCODE_F4: _bindgen_ty_2 = 134; +pub const AKEYCODE_F5: _bindgen_ty_2 = 135; +pub const AKEYCODE_F6: _bindgen_ty_2 = 136; +pub const AKEYCODE_F7: _bindgen_ty_2 = 137; +pub const AKEYCODE_F8: _bindgen_ty_2 = 138; +pub const AKEYCODE_F9: _bindgen_ty_2 = 139; +pub const AKEYCODE_F10: _bindgen_ty_2 = 140; +pub const AKEYCODE_F11: _bindgen_ty_2 = 141; +pub const AKEYCODE_F12: _bindgen_ty_2 = 142; +pub const AKEYCODE_NUM_LOCK: _bindgen_ty_2 = 143; +pub const AKEYCODE_NUMPAD_0: _bindgen_ty_2 = 144; +pub const AKEYCODE_NUMPAD_1: _bindgen_ty_2 = 145; +pub const AKEYCODE_NUMPAD_2: _bindgen_ty_2 = 146; +pub const AKEYCODE_NUMPAD_3: _bindgen_ty_2 = 147; +pub const AKEYCODE_NUMPAD_4: _bindgen_ty_2 = 148; +pub const AKEYCODE_NUMPAD_5: _bindgen_ty_2 = 149; +pub const AKEYCODE_NUMPAD_6: _bindgen_ty_2 = 150; +pub const AKEYCODE_NUMPAD_7: _bindgen_ty_2 = 151; +pub const AKEYCODE_NUMPAD_8: _bindgen_ty_2 = 152; +pub const AKEYCODE_NUMPAD_9: _bindgen_ty_2 = 153; +pub const AKEYCODE_NUMPAD_DIVIDE: _bindgen_ty_2 = 154; +pub const AKEYCODE_NUMPAD_MULTIPLY: _bindgen_ty_2 = 155; +pub const AKEYCODE_NUMPAD_SUBTRACT: _bindgen_ty_2 = 156; +pub const AKEYCODE_NUMPAD_ADD: _bindgen_ty_2 = 157; +pub const AKEYCODE_NUMPAD_DOT: _bindgen_ty_2 = 158; +pub const AKEYCODE_NUMPAD_COMMA: _bindgen_ty_2 = 159; +pub const AKEYCODE_NUMPAD_ENTER: _bindgen_ty_2 = 160; +pub const AKEYCODE_NUMPAD_EQUALS: _bindgen_ty_2 = 161; +pub const AKEYCODE_NUMPAD_LEFT_PAREN: _bindgen_ty_2 = 162; +pub const AKEYCODE_NUMPAD_RIGHT_PAREN: _bindgen_ty_2 = 163; +pub const AKEYCODE_VOLUME_MUTE: _bindgen_ty_2 = 164; +pub const AKEYCODE_INFO: _bindgen_ty_2 = 165; +pub const AKEYCODE_CHANNEL_UP: _bindgen_ty_2 = 166; +pub const AKEYCODE_CHANNEL_DOWN: _bindgen_ty_2 = 167; +pub const AKEYCODE_ZOOM_IN: _bindgen_ty_2 = 168; +pub const AKEYCODE_ZOOM_OUT: _bindgen_ty_2 = 169; +pub const AKEYCODE_TV: _bindgen_ty_2 = 170; +pub const AKEYCODE_WINDOW: _bindgen_ty_2 = 171; +pub const AKEYCODE_GUIDE: _bindgen_ty_2 = 172; +pub const AKEYCODE_DVR: _bindgen_ty_2 = 173; +pub const AKEYCODE_BOOKMARK: _bindgen_ty_2 = 174; +pub const AKEYCODE_CAPTIONS: _bindgen_ty_2 = 175; +pub const AKEYCODE_SETTINGS: _bindgen_ty_2 = 176; +pub const AKEYCODE_TV_POWER: _bindgen_ty_2 = 177; +pub const AKEYCODE_TV_INPUT: _bindgen_ty_2 = 178; +pub const AKEYCODE_STB_POWER: _bindgen_ty_2 = 179; +pub const AKEYCODE_STB_INPUT: _bindgen_ty_2 = 180; +pub const AKEYCODE_AVR_POWER: _bindgen_ty_2 = 181; +pub const AKEYCODE_AVR_INPUT: _bindgen_ty_2 = 182; +pub const AKEYCODE_PROG_RED: _bindgen_ty_2 = 183; +pub const AKEYCODE_PROG_GREEN: _bindgen_ty_2 = 184; +pub const AKEYCODE_PROG_YELLOW: _bindgen_ty_2 = 185; +pub const AKEYCODE_PROG_BLUE: _bindgen_ty_2 = 186; +pub const AKEYCODE_APP_SWITCH: _bindgen_ty_2 = 187; +pub const AKEYCODE_BUTTON_1: _bindgen_ty_2 = 188; +pub const AKEYCODE_BUTTON_2: _bindgen_ty_2 = 189; +pub const AKEYCODE_BUTTON_3: _bindgen_ty_2 = 190; +pub const AKEYCODE_BUTTON_4: _bindgen_ty_2 = 191; +pub const AKEYCODE_BUTTON_5: _bindgen_ty_2 = 192; +pub const AKEYCODE_BUTTON_6: _bindgen_ty_2 = 193; +pub const AKEYCODE_BUTTON_7: _bindgen_ty_2 = 194; +pub const AKEYCODE_BUTTON_8: _bindgen_ty_2 = 195; +pub const AKEYCODE_BUTTON_9: _bindgen_ty_2 = 196; +pub const AKEYCODE_BUTTON_10: _bindgen_ty_2 = 197; +pub const AKEYCODE_BUTTON_11: _bindgen_ty_2 = 198; +pub const AKEYCODE_BUTTON_12: _bindgen_ty_2 = 199; +pub const AKEYCODE_BUTTON_13: _bindgen_ty_2 = 200; +pub const AKEYCODE_BUTTON_14: _bindgen_ty_2 = 201; +pub const AKEYCODE_BUTTON_15: _bindgen_ty_2 = 202; +pub const AKEYCODE_BUTTON_16: _bindgen_ty_2 = 203; +pub const AKEYCODE_LANGUAGE_SWITCH: _bindgen_ty_2 = 204; +pub const AKEYCODE_MANNER_MODE: _bindgen_ty_2 = 205; +pub const AKEYCODE_3D_MODE: _bindgen_ty_2 = 206; +pub const AKEYCODE_CONTACTS: _bindgen_ty_2 = 207; +pub const AKEYCODE_CALENDAR: _bindgen_ty_2 = 208; +pub const AKEYCODE_MUSIC: _bindgen_ty_2 = 209; +pub const AKEYCODE_CALCULATOR: _bindgen_ty_2 = 210; +pub const AKEYCODE_ZENKAKU_HANKAKU: _bindgen_ty_2 = 211; +pub const AKEYCODE_EISU: _bindgen_ty_2 = 212; +pub const AKEYCODE_MUHENKAN: _bindgen_ty_2 = 213; +pub const AKEYCODE_HENKAN: _bindgen_ty_2 = 214; +pub const AKEYCODE_KATAKANA_HIRAGANA: _bindgen_ty_2 = 215; +pub const AKEYCODE_YEN: _bindgen_ty_2 = 216; +pub const AKEYCODE_RO: _bindgen_ty_2 = 217; +pub const AKEYCODE_KANA: _bindgen_ty_2 = 218; +pub const AKEYCODE_ASSIST: _bindgen_ty_2 = 219; +pub const AKEYCODE_BRIGHTNESS_DOWN: _bindgen_ty_2 = 220; +pub const AKEYCODE_BRIGHTNESS_UP: _bindgen_ty_2 = 221; +pub const AKEYCODE_MEDIA_AUDIO_TRACK: _bindgen_ty_2 = 222; +pub const AKEYCODE_SLEEP: _bindgen_ty_2 = 223; +pub const AKEYCODE_WAKEUP: _bindgen_ty_2 = 224; +pub const AKEYCODE_PAIRING: _bindgen_ty_2 = 225; +pub const AKEYCODE_MEDIA_TOP_MENU: _bindgen_ty_2 = 226; +pub const AKEYCODE_11: _bindgen_ty_2 = 227; +pub const AKEYCODE_12: _bindgen_ty_2 = 228; +pub const AKEYCODE_LAST_CHANNEL: _bindgen_ty_2 = 229; +pub const AKEYCODE_TV_DATA_SERVICE: _bindgen_ty_2 = 230; +pub const AKEYCODE_VOICE_ASSIST: _bindgen_ty_2 = 231; +pub const AKEYCODE_TV_RADIO_SERVICE: _bindgen_ty_2 = 232; +pub const AKEYCODE_TV_TELETEXT: _bindgen_ty_2 = 233; +pub const AKEYCODE_TV_NUMBER_ENTRY: _bindgen_ty_2 = 234; +pub const AKEYCODE_TV_TERRESTRIAL_ANALOG: _bindgen_ty_2 = 235; +pub const AKEYCODE_TV_TERRESTRIAL_DIGITAL: _bindgen_ty_2 = 236; +pub const AKEYCODE_TV_SATELLITE: _bindgen_ty_2 = 237; +pub const AKEYCODE_TV_SATELLITE_BS: _bindgen_ty_2 = 238; +pub const AKEYCODE_TV_SATELLITE_CS: _bindgen_ty_2 = 239; +pub const AKEYCODE_TV_SATELLITE_SERVICE: _bindgen_ty_2 = 240; +pub const AKEYCODE_TV_NETWORK: _bindgen_ty_2 = 241; +pub const AKEYCODE_TV_ANTENNA_CABLE: _bindgen_ty_2 = 242; +pub const AKEYCODE_TV_INPUT_HDMI_1: _bindgen_ty_2 = 243; +pub const AKEYCODE_TV_INPUT_HDMI_2: _bindgen_ty_2 = 244; +pub const AKEYCODE_TV_INPUT_HDMI_3: _bindgen_ty_2 = 245; +pub const AKEYCODE_TV_INPUT_HDMI_4: _bindgen_ty_2 = 246; +pub const AKEYCODE_TV_INPUT_COMPOSITE_1: _bindgen_ty_2 = 247; +pub const AKEYCODE_TV_INPUT_COMPOSITE_2: _bindgen_ty_2 = 248; +pub const AKEYCODE_TV_INPUT_COMPONENT_1: _bindgen_ty_2 = 249; +pub const AKEYCODE_TV_INPUT_COMPONENT_2: _bindgen_ty_2 = 250; +pub const AKEYCODE_TV_INPUT_VGA_1: _bindgen_ty_2 = 251; +pub const AKEYCODE_TV_AUDIO_DESCRIPTION: _bindgen_ty_2 = 252; +pub const AKEYCODE_TV_AUDIO_DESCRIPTION_MIX_UP: _bindgen_ty_2 = 253; +pub const AKEYCODE_TV_AUDIO_DESCRIPTION_MIX_DOWN: _bindgen_ty_2 = 254; +pub const AKEYCODE_TV_ZOOM_MODE: _bindgen_ty_2 = 255; +pub const AKEYCODE_TV_CONTENTS_MENU: _bindgen_ty_2 = 256; +pub const AKEYCODE_TV_MEDIA_CONTEXT_MENU: _bindgen_ty_2 = 257; +pub const AKEYCODE_TV_TIMER_PROGRAMMING: _bindgen_ty_2 = 258; +pub const AKEYCODE_HELP: _bindgen_ty_2 = 259; +pub const AKEYCODE_NAVIGATE_PREVIOUS: _bindgen_ty_2 = 260; +pub const AKEYCODE_NAVIGATE_NEXT: _bindgen_ty_2 = 261; +pub const AKEYCODE_NAVIGATE_IN: _bindgen_ty_2 = 262; +pub const AKEYCODE_NAVIGATE_OUT: _bindgen_ty_2 = 263; +pub const AKEYCODE_STEM_PRIMARY: _bindgen_ty_2 = 264; +pub const AKEYCODE_STEM_1: _bindgen_ty_2 = 265; +pub const AKEYCODE_STEM_2: _bindgen_ty_2 = 266; +pub const AKEYCODE_STEM_3: _bindgen_ty_2 = 267; +pub const AKEYCODE_DPAD_UP_LEFT: _bindgen_ty_2 = 268; +pub const AKEYCODE_DPAD_DOWN_LEFT: _bindgen_ty_2 = 269; +pub const AKEYCODE_DPAD_UP_RIGHT: _bindgen_ty_2 = 270; +pub const AKEYCODE_DPAD_DOWN_RIGHT: _bindgen_ty_2 = 271; +pub const AKEYCODE_MEDIA_SKIP_FORWARD: _bindgen_ty_2 = 272; +pub const AKEYCODE_MEDIA_SKIP_BACKWARD: _bindgen_ty_2 = 273; +pub const AKEYCODE_MEDIA_STEP_FORWARD: _bindgen_ty_2 = 274; +pub const AKEYCODE_MEDIA_STEP_BACKWARD: _bindgen_ty_2 = 275; +pub const AKEYCODE_SOFT_SLEEP: _bindgen_ty_2 = 276; +pub const AKEYCODE_CUT: _bindgen_ty_2 = 277; +pub const AKEYCODE_COPY: _bindgen_ty_2 = 278; +pub const AKEYCODE_PASTE: _bindgen_ty_2 = 279; +pub const AKEYCODE_SYSTEM_NAVIGATION_UP: _bindgen_ty_2 = 280; +pub const AKEYCODE_SYSTEM_NAVIGATION_DOWN: _bindgen_ty_2 = 281; +pub const AKEYCODE_SYSTEM_NAVIGATION_LEFT: _bindgen_ty_2 = 282; +pub const AKEYCODE_SYSTEM_NAVIGATION_RIGHT: _bindgen_ty_2 = 283; +pub const AKEYCODE_ALL_APPS: _bindgen_ty_2 = 284; +pub const AKEYCODE_REFRESH: _bindgen_ty_2 = 285; +pub const AKEYCODE_THUMBS_UP: _bindgen_ty_2 = 286; +pub const AKEYCODE_THUMBS_DOWN: _bindgen_ty_2 = 287; +pub const AKEYCODE_PROFILE_SWITCH: _bindgen_ty_2 = 288; pub type _bindgen_ty_2 = ::std::os::raw::c_uint; -pub const ALOOPER_PREPARE_ALLOW_NON_CALLBACKS: ::std::os::raw::c_uint = 1; +pub const ALOOPER_PREPARE_ALLOW_NON_CALLBACKS: _bindgen_ty_3 = 1; pub type _bindgen_ty_3 = ::std::os::raw::c_uint; -pub const ALOOPER_POLL_WAKE: ::std::os::raw::c_int = -1; -pub const ALOOPER_POLL_CALLBACK: ::std::os::raw::c_int = -2; -pub const ALOOPER_POLL_TIMEOUT: ::std::os::raw::c_int = -3; -pub const ALOOPER_POLL_ERROR: ::std::os::raw::c_int = -4; +pub const ALOOPER_POLL_WAKE: _bindgen_ty_4 = -1; +pub const ALOOPER_POLL_CALLBACK: _bindgen_ty_4 = -2; +pub const ALOOPER_POLL_TIMEOUT: _bindgen_ty_4 = -3; +pub const ALOOPER_POLL_ERROR: _bindgen_ty_4 = -4; pub type _bindgen_ty_4 = ::std::os::raw::c_int; -pub const ALOOPER_EVENT_INPUT: ::std::os::raw::c_uint = 1; -pub const ALOOPER_EVENT_OUTPUT: ::std::os::raw::c_uint = 2; -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 const ALOOPER_EVENT_INPUT: _bindgen_ty_5 = 1; +pub const ALOOPER_EVENT_OUTPUT: _bindgen_ty_5 = 2; +pub const ALOOPER_EVENT_ERROR: _bindgen_ty_5 = 4; +pub const ALOOPER_EVENT_HANGUP: _bindgen_ty_5 = 8; +pub const ALOOPER_EVENT_INVALID: _bindgen_ty_5 = 16; pub type _bindgen_ty_5 = ::std::os::raw::c_uint; -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; -pub const AKEY_STATE_VIRTUAL: ::std::os::raw::c_int = 2; +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() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + 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::addr_of!((*ptr).version) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(JavaVMAttachArgs), + "::", + stringify!(version) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(JavaVMAttachArgs), + "::", + stringify!(name) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).group) as usize - ptr 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() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + 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::addr_of!((*ptr).optionString) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(JavaVMOption), + "::", + stringify!(optionString) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).extraInfo) as usize - ptr 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() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + 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::addr_of!((*ptr).version) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(JavaVMInitArgs), + "::", + stringify!(version) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).nOptions) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(JavaVMInitArgs), + "::", + stringify!(nOptions) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).options) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(JavaVMInitArgs), + "::", + stringify!(options) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ignoreUnrecognized) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(JavaVMInitArgs), + "::", + stringify!(ignoreUnrecognized) + ) + ); +} +pub const AKEY_STATE_UNKNOWN: _bindgen_ty_6 = -1; +pub const AKEY_STATE_UP: _bindgen_ty_6 = 0; +pub const AKEY_STATE_DOWN: _bindgen_ty_6 = 1; +pub const AKEY_STATE_VIRTUAL: _bindgen_ty_6 = 2; pub type _bindgen_ty_6 = ::std::os::raw::c_int; -pub const AMETA_NONE: ::std::os::raw::c_uint = 0; -pub const AMETA_ALT_ON: ::std::os::raw::c_uint = 2; -pub const AMETA_ALT_LEFT_ON: ::std::os::raw::c_uint = 16; -pub const AMETA_ALT_RIGHT_ON: ::std::os::raw::c_uint = 32; -pub const AMETA_SHIFT_ON: ::std::os::raw::c_uint = 1; -pub const AMETA_SHIFT_LEFT_ON: ::std::os::raw::c_uint = 64; -pub const AMETA_SHIFT_RIGHT_ON: ::std::os::raw::c_uint = 128; -pub const AMETA_SYM_ON: ::std::os::raw::c_uint = 4; -pub const AMETA_FUNCTION_ON: ::std::os::raw::c_uint = 8; -pub const AMETA_CTRL_ON: ::std::os::raw::c_uint = 4096; -pub const AMETA_CTRL_LEFT_ON: ::std::os::raw::c_uint = 8192; -pub const AMETA_CTRL_RIGHT_ON: ::std::os::raw::c_uint = 16384; -pub const AMETA_META_ON: ::std::os::raw::c_uint = 65536; -pub const AMETA_META_LEFT_ON: ::std::os::raw::c_uint = 131072; -pub const AMETA_META_RIGHT_ON: ::std::os::raw::c_uint = 262144; -pub const AMETA_CAPS_LOCK_ON: ::std::os::raw::c_uint = 1048576; -pub const AMETA_NUM_LOCK_ON: ::std::os::raw::c_uint = 2097152; -pub const AMETA_SCROLL_LOCK_ON: ::std::os::raw::c_uint = 4194304; +pub const AMETA_NONE: _bindgen_ty_7 = 0; +pub const AMETA_ALT_ON: _bindgen_ty_7 = 2; +pub const AMETA_ALT_LEFT_ON: _bindgen_ty_7 = 16; +pub const AMETA_ALT_RIGHT_ON: _bindgen_ty_7 = 32; +pub const AMETA_SHIFT_ON: _bindgen_ty_7 = 1; +pub const AMETA_SHIFT_LEFT_ON: _bindgen_ty_7 = 64; +pub const AMETA_SHIFT_RIGHT_ON: _bindgen_ty_7 = 128; +pub const AMETA_SYM_ON: _bindgen_ty_7 = 4; +pub const AMETA_FUNCTION_ON: _bindgen_ty_7 = 8; +pub const AMETA_CTRL_ON: _bindgen_ty_7 = 4096; +pub const AMETA_CTRL_LEFT_ON: _bindgen_ty_7 = 8192; +pub const AMETA_CTRL_RIGHT_ON: _bindgen_ty_7 = 16384; +pub const AMETA_META_ON: _bindgen_ty_7 = 65536; +pub const AMETA_META_LEFT_ON: _bindgen_ty_7 = 131072; +pub const AMETA_META_RIGHT_ON: _bindgen_ty_7 = 262144; +pub const AMETA_CAPS_LOCK_ON: _bindgen_ty_7 = 1048576; +pub const AMETA_NUM_LOCK_ON: _bindgen_ty_7 = 2097152; +pub const AMETA_SCROLL_LOCK_ON: _bindgen_ty_7 = 4194304; pub type _bindgen_ty_7 = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct AInputEvent { _unused: [u8; 0], } -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_KEY: _bindgen_ty_8 = 1; +pub const AINPUT_EVENT_TYPE_MOTION: _bindgen_ty_8 = 2; +pub const AINPUT_EVENT_TYPE_FOCUS: _bindgen_ty_8 = 3; +pub const AINPUT_EVENT_TYPE_CAPTURE: _bindgen_ty_8 = 4; +pub const AINPUT_EVENT_TYPE_DRAG: _bindgen_ty_8 = 5; +pub const AINPUT_EVENT_TYPE_TOUCH_MODE: _bindgen_ty_8 = 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; -pub const AKEY_EVENT_ACTION_MULTIPLE: ::std::os::raw::c_uint = 2; +pub const AKEY_EVENT_ACTION_DOWN: _bindgen_ty_9 = 0; +pub const AKEY_EVENT_ACTION_UP: _bindgen_ty_9 = 1; +pub const AKEY_EVENT_ACTION_MULTIPLE: _bindgen_ty_9 = 2; pub type _bindgen_ty_9 = ::std::os::raw::c_uint; -pub const AKEY_EVENT_FLAG_WOKE_HERE: ::std::os::raw::c_uint = 1; -pub const AKEY_EVENT_FLAG_SOFT_KEYBOARD: ::std::os::raw::c_uint = 2; -pub const AKEY_EVENT_FLAG_KEEP_TOUCH_MODE: ::std::os::raw::c_uint = 4; -pub const AKEY_EVENT_FLAG_FROM_SYSTEM: ::std::os::raw::c_uint = 8; -pub const AKEY_EVENT_FLAG_EDITOR_ACTION: ::std::os::raw::c_uint = 16; -pub const AKEY_EVENT_FLAG_CANCELED: ::std::os::raw::c_uint = 32; -pub const AKEY_EVENT_FLAG_VIRTUAL_HARD_KEY: ::std::os::raw::c_uint = 64; -pub const AKEY_EVENT_FLAG_LONG_PRESS: ::std::os::raw::c_uint = 128; -pub const AKEY_EVENT_FLAG_CANCELED_LONG_PRESS: ::std::os::raw::c_uint = 256; -pub const AKEY_EVENT_FLAG_TRACKING: ::std::os::raw::c_uint = 512; -pub const AKEY_EVENT_FLAG_FALLBACK: ::std::os::raw::c_uint = 1024; +pub const AKEY_EVENT_FLAG_WOKE_HERE: _bindgen_ty_10 = 1; +pub const AKEY_EVENT_FLAG_SOFT_KEYBOARD: _bindgen_ty_10 = 2; +pub const AKEY_EVENT_FLAG_KEEP_TOUCH_MODE: _bindgen_ty_10 = 4; +pub const AKEY_EVENT_FLAG_FROM_SYSTEM: _bindgen_ty_10 = 8; +pub const AKEY_EVENT_FLAG_EDITOR_ACTION: _bindgen_ty_10 = 16; +pub const AKEY_EVENT_FLAG_CANCELED: _bindgen_ty_10 = 32; +pub const AKEY_EVENT_FLAG_VIRTUAL_HARD_KEY: _bindgen_ty_10 = 64; +pub const AKEY_EVENT_FLAG_LONG_PRESS: _bindgen_ty_10 = 128; +pub const AKEY_EVENT_FLAG_CANCELED_LONG_PRESS: _bindgen_ty_10 = 256; +pub const AKEY_EVENT_FLAG_TRACKING: _bindgen_ty_10 = 512; +pub const AKEY_EVENT_FLAG_FALLBACK: _bindgen_ty_10 = 1024; pub type _bindgen_ty_10 = ::std::os::raw::c_uint; -pub const AMOTION_EVENT_ACTION_MASK: ::std::os::raw::c_uint = 255; -pub const AMOTION_EVENT_ACTION_POINTER_INDEX_MASK: ::std::os::raw::c_uint = 65280; -pub const AMOTION_EVENT_ACTION_DOWN: ::std::os::raw::c_uint = 0; -pub const AMOTION_EVENT_ACTION_UP: ::std::os::raw::c_uint = 1; -pub const AMOTION_EVENT_ACTION_MOVE: ::std::os::raw::c_uint = 2; -pub const AMOTION_EVENT_ACTION_CANCEL: ::std::os::raw::c_uint = 3; -pub const AMOTION_EVENT_ACTION_OUTSIDE: ::std::os::raw::c_uint = 4; -pub const AMOTION_EVENT_ACTION_POINTER_DOWN: ::std::os::raw::c_uint = 5; -pub const AMOTION_EVENT_ACTION_POINTER_UP: ::std::os::raw::c_uint = 6; -pub const AMOTION_EVENT_ACTION_HOVER_MOVE: ::std::os::raw::c_uint = 7; -pub const AMOTION_EVENT_ACTION_SCROLL: ::std::os::raw::c_uint = 8; -pub const AMOTION_EVENT_ACTION_HOVER_ENTER: ::std::os::raw::c_uint = 9; -pub const AMOTION_EVENT_ACTION_HOVER_EXIT: ::std::os::raw::c_uint = 10; -pub const AMOTION_EVENT_ACTION_BUTTON_PRESS: ::std::os::raw::c_uint = 11; -pub const AMOTION_EVENT_ACTION_BUTTON_RELEASE: ::std::os::raw::c_uint = 12; +pub const AMOTION_EVENT_ACTION_MASK: _bindgen_ty_11 = 255; +pub const AMOTION_EVENT_ACTION_POINTER_INDEX_MASK: _bindgen_ty_11 = 65280; +pub const AMOTION_EVENT_ACTION_DOWN: _bindgen_ty_11 = 0; +pub const AMOTION_EVENT_ACTION_UP: _bindgen_ty_11 = 1; +pub const AMOTION_EVENT_ACTION_MOVE: _bindgen_ty_11 = 2; +pub const AMOTION_EVENT_ACTION_CANCEL: _bindgen_ty_11 = 3; +pub const AMOTION_EVENT_ACTION_OUTSIDE: _bindgen_ty_11 = 4; +pub const AMOTION_EVENT_ACTION_POINTER_DOWN: _bindgen_ty_11 = 5; +pub const AMOTION_EVENT_ACTION_POINTER_UP: _bindgen_ty_11 = 6; +pub const AMOTION_EVENT_ACTION_HOVER_MOVE: _bindgen_ty_11 = 7; +pub const AMOTION_EVENT_ACTION_SCROLL: _bindgen_ty_11 = 8; +pub const AMOTION_EVENT_ACTION_HOVER_ENTER: _bindgen_ty_11 = 9; +pub const AMOTION_EVENT_ACTION_HOVER_EXIT: _bindgen_ty_11 = 10; +pub const AMOTION_EVENT_ACTION_BUTTON_PRESS: _bindgen_ty_11 = 11; +pub const AMOTION_EVENT_ACTION_BUTTON_RELEASE: _bindgen_ty_11 = 12; pub type _bindgen_ty_11 = ::std::os::raw::c_uint; -pub const AMOTION_EVENT_FLAG_WINDOW_IS_OBSCURED: ::std::os::raw::c_uint = 1; +pub const AMOTION_EVENT_FLAG_WINDOW_IS_OBSCURED: _bindgen_ty_12 = 1; pub type _bindgen_ty_12 = ::std::os::raw::c_uint; -pub const AMOTION_EVENT_EDGE_FLAG_NONE: ::std::os::raw::c_uint = 0; -pub const AMOTION_EVENT_EDGE_FLAG_TOP: ::std::os::raw::c_uint = 1; -pub const AMOTION_EVENT_EDGE_FLAG_BOTTOM: ::std::os::raw::c_uint = 2; -pub const AMOTION_EVENT_EDGE_FLAG_LEFT: ::std::os::raw::c_uint = 4; -pub const AMOTION_EVENT_EDGE_FLAG_RIGHT: ::std::os::raw::c_uint = 8; +pub const AMOTION_EVENT_EDGE_FLAG_NONE: _bindgen_ty_13 = 0; +pub const AMOTION_EVENT_EDGE_FLAG_TOP: _bindgen_ty_13 = 1; +pub const AMOTION_EVENT_EDGE_FLAG_BOTTOM: _bindgen_ty_13 = 2; +pub const AMOTION_EVENT_EDGE_FLAG_LEFT: _bindgen_ty_13 = 4; +pub const AMOTION_EVENT_EDGE_FLAG_RIGHT: _bindgen_ty_13 = 8; pub type _bindgen_ty_13 = ::std::os::raw::c_uint; -pub const AMOTION_EVENT_AXIS_X: ::std::os::raw::c_uint = 0; -pub const AMOTION_EVENT_AXIS_Y: ::std::os::raw::c_uint = 1; -pub const AMOTION_EVENT_AXIS_PRESSURE: ::std::os::raw::c_uint = 2; -pub const AMOTION_EVENT_AXIS_SIZE: ::std::os::raw::c_uint = 3; -pub const AMOTION_EVENT_AXIS_TOUCH_MAJOR: ::std::os::raw::c_uint = 4; -pub const AMOTION_EVENT_AXIS_TOUCH_MINOR: ::std::os::raw::c_uint = 5; -pub const AMOTION_EVENT_AXIS_TOOL_MAJOR: ::std::os::raw::c_uint = 6; -pub const AMOTION_EVENT_AXIS_TOOL_MINOR: ::std::os::raw::c_uint = 7; -pub const AMOTION_EVENT_AXIS_ORIENTATION: ::std::os::raw::c_uint = 8; -pub const AMOTION_EVENT_AXIS_VSCROLL: ::std::os::raw::c_uint = 9; -pub const AMOTION_EVENT_AXIS_HSCROLL: ::std::os::raw::c_uint = 10; -pub const AMOTION_EVENT_AXIS_Z: ::std::os::raw::c_uint = 11; -pub const AMOTION_EVENT_AXIS_RX: ::std::os::raw::c_uint = 12; -pub const AMOTION_EVENT_AXIS_RY: ::std::os::raw::c_uint = 13; -pub const AMOTION_EVENT_AXIS_RZ: ::std::os::raw::c_uint = 14; -pub const AMOTION_EVENT_AXIS_HAT_X: ::std::os::raw::c_uint = 15; -pub const AMOTION_EVENT_AXIS_HAT_Y: ::std::os::raw::c_uint = 16; -pub const AMOTION_EVENT_AXIS_LTRIGGER: ::std::os::raw::c_uint = 17; -pub const AMOTION_EVENT_AXIS_RTRIGGER: ::std::os::raw::c_uint = 18; -pub const AMOTION_EVENT_AXIS_THROTTLE: ::std::os::raw::c_uint = 19; -pub const AMOTION_EVENT_AXIS_RUDDER: ::std::os::raw::c_uint = 20; -pub const AMOTION_EVENT_AXIS_WHEEL: ::std::os::raw::c_uint = 21; -pub const AMOTION_EVENT_AXIS_GAS: ::std::os::raw::c_uint = 22; -pub const AMOTION_EVENT_AXIS_BRAKE: ::std::os::raw::c_uint = 23; -pub const AMOTION_EVENT_AXIS_DISTANCE: ::std::os::raw::c_uint = 24; -pub const AMOTION_EVENT_AXIS_TILT: ::std::os::raw::c_uint = 25; -pub const AMOTION_EVENT_AXIS_SCROLL: ::std::os::raw::c_uint = 26; -pub const AMOTION_EVENT_AXIS_RELATIVE_X: ::std::os::raw::c_uint = 27; -pub const AMOTION_EVENT_AXIS_RELATIVE_Y: ::std::os::raw::c_uint = 28; -pub const AMOTION_EVENT_AXIS_GENERIC_1: ::std::os::raw::c_uint = 32; -pub const AMOTION_EVENT_AXIS_GENERIC_2: ::std::os::raw::c_uint = 33; -pub const AMOTION_EVENT_AXIS_GENERIC_3: ::std::os::raw::c_uint = 34; -pub const AMOTION_EVENT_AXIS_GENERIC_4: ::std::os::raw::c_uint = 35; -pub const AMOTION_EVENT_AXIS_GENERIC_5: ::std::os::raw::c_uint = 36; -pub const AMOTION_EVENT_AXIS_GENERIC_6: ::std::os::raw::c_uint = 37; -pub const AMOTION_EVENT_AXIS_GENERIC_7: ::std::os::raw::c_uint = 38; -pub const AMOTION_EVENT_AXIS_GENERIC_8: ::std::os::raw::c_uint = 39; -pub const AMOTION_EVENT_AXIS_GENERIC_9: ::std::os::raw::c_uint = 40; -pub const AMOTION_EVENT_AXIS_GENERIC_10: ::std::os::raw::c_uint = 41; -pub const AMOTION_EVENT_AXIS_GENERIC_11: ::std::os::raw::c_uint = 42; -pub const AMOTION_EVENT_AXIS_GENERIC_12: ::std::os::raw::c_uint = 43; -pub const AMOTION_EVENT_AXIS_GENERIC_13: ::std::os::raw::c_uint = 44; -pub const AMOTION_EVENT_AXIS_GENERIC_14: ::std::os::raw::c_uint = 45; -pub const AMOTION_EVENT_AXIS_GENERIC_15: ::std::os::raw::c_uint = 46; -pub const AMOTION_EVENT_AXIS_GENERIC_16: ::std::os::raw::c_uint = 47; +pub const AMOTION_EVENT_AXIS_X: _bindgen_ty_14 = 0; +pub const AMOTION_EVENT_AXIS_Y: _bindgen_ty_14 = 1; +pub const AMOTION_EVENT_AXIS_PRESSURE: _bindgen_ty_14 = 2; +pub const AMOTION_EVENT_AXIS_SIZE: _bindgen_ty_14 = 3; +pub const AMOTION_EVENT_AXIS_TOUCH_MAJOR: _bindgen_ty_14 = 4; +pub const AMOTION_EVENT_AXIS_TOUCH_MINOR: _bindgen_ty_14 = 5; +pub const AMOTION_EVENT_AXIS_TOOL_MAJOR: _bindgen_ty_14 = 6; +pub const AMOTION_EVENT_AXIS_TOOL_MINOR: _bindgen_ty_14 = 7; +pub const AMOTION_EVENT_AXIS_ORIENTATION: _bindgen_ty_14 = 8; +pub const AMOTION_EVENT_AXIS_VSCROLL: _bindgen_ty_14 = 9; +pub const AMOTION_EVENT_AXIS_HSCROLL: _bindgen_ty_14 = 10; +pub const AMOTION_EVENT_AXIS_Z: _bindgen_ty_14 = 11; +pub const AMOTION_EVENT_AXIS_RX: _bindgen_ty_14 = 12; +pub const AMOTION_EVENT_AXIS_RY: _bindgen_ty_14 = 13; +pub const AMOTION_EVENT_AXIS_RZ: _bindgen_ty_14 = 14; +pub const AMOTION_EVENT_AXIS_HAT_X: _bindgen_ty_14 = 15; +pub const AMOTION_EVENT_AXIS_HAT_Y: _bindgen_ty_14 = 16; +pub const AMOTION_EVENT_AXIS_LTRIGGER: _bindgen_ty_14 = 17; +pub const AMOTION_EVENT_AXIS_RTRIGGER: _bindgen_ty_14 = 18; +pub const AMOTION_EVENT_AXIS_THROTTLE: _bindgen_ty_14 = 19; +pub const AMOTION_EVENT_AXIS_RUDDER: _bindgen_ty_14 = 20; +pub const AMOTION_EVENT_AXIS_WHEEL: _bindgen_ty_14 = 21; +pub const AMOTION_EVENT_AXIS_GAS: _bindgen_ty_14 = 22; +pub const AMOTION_EVENT_AXIS_BRAKE: _bindgen_ty_14 = 23; +pub const AMOTION_EVENT_AXIS_DISTANCE: _bindgen_ty_14 = 24; +pub const AMOTION_EVENT_AXIS_TILT: _bindgen_ty_14 = 25; +pub const AMOTION_EVENT_AXIS_SCROLL: _bindgen_ty_14 = 26; +pub const AMOTION_EVENT_AXIS_RELATIVE_X: _bindgen_ty_14 = 27; +pub const AMOTION_EVENT_AXIS_RELATIVE_Y: _bindgen_ty_14 = 28; +pub const AMOTION_EVENT_AXIS_GENERIC_1: _bindgen_ty_14 = 32; +pub const AMOTION_EVENT_AXIS_GENERIC_2: _bindgen_ty_14 = 33; +pub const AMOTION_EVENT_AXIS_GENERIC_3: _bindgen_ty_14 = 34; +pub const AMOTION_EVENT_AXIS_GENERIC_4: _bindgen_ty_14 = 35; +pub const AMOTION_EVENT_AXIS_GENERIC_5: _bindgen_ty_14 = 36; +pub const AMOTION_EVENT_AXIS_GENERIC_6: _bindgen_ty_14 = 37; +pub const AMOTION_EVENT_AXIS_GENERIC_7: _bindgen_ty_14 = 38; +pub const AMOTION_EVENT_AXIS_GENERIC_8: _bindgen_ty_14 = 39; +pub const AMOTION_EVENT_AXIS_GENERIC_9: _bindgen_ty_14 = 40; +pub const AMOTION_EVENT_AXIS_GENERIC_10: _bindgen_ty_14 = 41; +pub const AMOTION_EVENT_AXIS_GENERIC_11: _bindgen_ty_14 = 42; +pub const AMOTION_EVENT_AXIS_GENERIC_12: _bindgen_ty_14 = 43; +pub const AMOTION_EVENT_AXIS_GENERIC_13: _bindgen_ty_14 = 44; +pub const AMOTION_EVENT_AXIS_GENERIC_14: _bindgen_ty_14 = 45; +pub const AMOTION_EVENT_AXIS_GENERIC_15: _bindgen_ty_14 = 46; +pub const AMOTION_EVENT_AXIS_GENERIC_16: _bindgen_ty_14 = 47; pub type _bindgen_ty_14 = ::std::os::raw::c_uint; -pub const AMOTION_EVENT_BUTTON_PRIMARY: ::std::os::raw::c_uint = 1; -pub const AMOTION_EVENT_BUTTON_SECONDARY: ::std::os::raw::c_uint = 2; -pub const AMOTION_EVENT_BUTTON_TERTIARY: ::std::os::raw::c_uint = 4; -pub const AMOTION_EVENT_BUTTON_BACK: ::std::os::raw::c_uint = 8; -pub const AMOTION_EVENT_BUTTON_FORWARD: ::std::os::raw::c_uint = 16; -pub const AMOTION_EVENT_BUTTON_STYLUS_PRIMARY: ::std::os::raw::c_uint = 32; -pub const AMOTION_EVENT_BUTTON_STYLUS_SECONDARY: ::std::os::raw::c_uint = 64; +pub const AMOTION_EVENT_BUTTON_PRIMARY: _bindgen_ty_15 = 1; +pub const AMOTION_EVENT_BUTTON_SECONDARY: _bindgen_ty_15 = 2; +pub const AMOTION_EVENT_BUTTON_TERTIARY: _bindgen_ty_15 = 4; +pub const AMOTION_EVENT_BUTTON_BACK: _bindgen_ty_15 = 8; +pub const AMOTION_EVENT_BUTTON_FORWARD: _bindgen_ty_15 = 16; +pub const AMOTION_EVENT_BUTTON_STYLUS_PRIMARY: _bindgen_ty_15 = 32; +pub const AMOTION_EVENT_BUTTON_STYLUS_SECONDARY: _bindgen_ty_15 = 64; pub type _bindgen_ty_15 = ::std::os::raw::c_uint; -pub const AMOTION_EVENT_TOOL_TYPE_UNKNOWN: ::std::os::raw::c_uint = 0; -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_UNKNOWN: _bindgen_ty_16 = 0; +pub const AMOTION_EVENT_TOOL_TYPE_FINGER: _bindgen_ty_16 = 1; +pub const AMOTION_EVENT_TOOL_TYPE_STYLUS: _bindgen_ty_16 = 2; +pub const AMOTION_EVENT_TOOL_TYPE_MOUSE: _bindgen_ty_16 = 3; +pub const AMOTION_EVENT_TOOL_TYPE_ERASER: _bindgen_ty_16 = 4; +pub const AMOTION_EVENT_TOOL_TYPE_PALM: _bindgen_ty_16 = 5; pub type _bindgen_ty_16 = ::std::os::raw::c_uint; -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; -pub const AINPUT_SOURCE_CLASS_POINTER: ::std::os::raw::c_uint = 2; -pub const AINPUT_SOURCE_CLASS_NAVIGATION: ::std::os::raw::c_uint = 4; -pub const AINPUT_SOURCE_CLASS_POSITION: ::std::os::raw::c_uint = 8; -pub const AINPUT_SOURCE_CLASS_JOYSTICK: ::std::os::raw::c_uint = 16; +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: _bindgen_ty_17 = 255; +pub const AINPUT_SOURCE_CLASS_NONE: _bindgen_ty_17 = 0; +pub const AINPUT_SOURCE_CLASS_BUTTON: _bindgen_ty_17 = 1; +pub const AINPUT_SOURCE_CLASS_POINTER: _bindgen_ty_17 = 2; +pub const AINPUT_SOURCE_CLASS_NAVIGATION: _bindgen_ty_17 = 4; +pub const AINPUT_SOURCE_CLASS_POSITION: _bindgen_ty_17 = 8; +pub const AINPUT_SOURCE_CLASS_JOYSTICK: _bindgen_ty_17 = 16; pub type _bindgen_ty_17 = ::std::os::raw::c_uint; -pub const AINPUT_SOURCE_UNKNOWN: ::std::os::raw::c_uint = 0; -pub const AINPUT_SOURCE_KEYBOARD: ::std::os::raw::c_uint = 257; -pub const AINPUT_SOURCE_DPAD: ::std::os::raw::c_uint = 513; -pub const AINPUT_SOURCE_GAMEPAD: ::std::os::raw::c_uint = 1025; -pub const AINPUT_SOURCE_TOUCHSCREEN: ::std::os::raw::c_uint = 4098; -pub const AINPUT_SOURCE_MOUSE: ::std::os::raw::c_uint = 8194; -pub const AINPUT_SOURCE_STYLUS: ::std::os::raw::c_uint = 16386; -pub const AINPUT_SOURCE_BLUETOOTH_STYLUS: ::std::os::raw::c_uint = 49154; -pub const AINPUT_SOURCE_TRACKBALL: ::std::os::raw::c_uint = 65540; -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_ROTARY_ENCODER: ::std::os::raw::c_uint = 4194304; -pub const AINPUT_SOURCE_ANY: ::std::os::raw::c_uint = 4294967040; +pub const AINPUT_SOURCE_UNKNOWN: _bindgen_ty_18 = 0; +pub const AINPUT_SOURCE_KEYBOARD: _bindgen_ty_18 = 257; +pub const AINPUT_SOURCE_DPAD: _bindgen_ty_18 = 513; +pub const AINPUT_SOURCE_GAMEPAD: _bindgen_ty_18 = 1025; +pub const AINPUT_SOURCE_TOUCHSCREEN: _bindgen_ty_18 = 4098; +pub const AINPUT_SOURCE_MOUSE: _bindgen_ty_18 = 8194; +pub const AINPUT_SOURCE_STYLUS: _bindgen_ty_18 = 16386; +pub const AINPUT_SOURCE_BLUETOOTH_STYLUS: _bindgen_ty_18 = 49154; +pub const AINPUT_SOURCE_TRACKBALL: _bindgen_ty_18 = 65540; +pub const AINPUT_SOURCE_MOUSE_RELATIVE: _bindgen_ty_18 = 131076; +pub const AINPUT_SOURCE_TOUCHPAD: _bindgen_ty_18 = 1048584; +pub const AINPUT_SOURCE_TOUCH_NAVIGATION: _bindgen_ty_18 = 2097152; +pub const AINPUT_SOURCE_JOYSTICK: _bindgen_ty_18 = 16777232; +pub const AINPUT_SOURCE_HDMI: _bindgen_ty_18 = 33554433; +pub const AINPUT_SOURCE_SENSOR: _bindgen_ty_18 = 67108864; +pub const AINPUT_SOURCE_ROTARY_ENCODER: _bindgen_ty_18 = 4194304; +pub const AINPUT_SOURCE_ANY: _bindgen_ty_18 = 4294967040; pub type _bindgen_ty_18 = ::std::os::raw::c_uint; -pub const AINPUT_KEYBOARD_TYPE_NONE: ::std::os::raw::c_uint = 0; -pub const AINPUT_KEYBOARD_TYPE_NON_ALPHABETIC: ::std::os::raw::c_uint = 1; -pub const AINPUT_KEYBOARD_TYPE_ALPHABETIC: ::std::os::raw::c_uint = 2; +pub const AINPUT_KEYBOARD_TYPE_NONE: _bindgen_ty_19 = 0; +pub const AINPUT_KEYBOARD_TYPE_NON_ALPHABETIC: _bindgen_ty_19 = 1; +pub const AINPUT_KEYBOARD_TYPE_ALPHABETIC: _bindgen_ty_19 = 2; pub type _bindgen_ty_19 = ::std::os::raw::c_uint; -pub const AINPUT_MOTION_RANGE_X: ::std::os::raw::c_uint = 0; -pub const AINPUT_MOTION_RANGE_Y: ::std::os::raw::c_uint = 1; -pub const AINPUT_MOTION_RANGE_PRESSURE: ::std::os::raw::c_uint = 2; -pub const AINPUT_MOTION_RANGE_SIZE: ::std::os::raw::c_uint = 3; -pub const AINPUT_MOTION_RANGE_TOUCH_MAJOR: ::std::os::raw::c_uint = 4; -pub const AINPUT_MOTION_RANGE_TOUCH_MINOR: ::std::os::raw::c_uint = 5; -pub const AINPUT_MOTION_RANGE_TOOL_MAJOR: ::std::os::raw::c_uint = 6; -pub const AINPUT_MOTION_RANGE_TOOL_MINOR: ::std::os::raw::c_uint = 7; -pub const AINPUT_MOTION_RANGE_ORIENTATION: ::std::os::raw::c_uint = 8; +pub const AINPUT_MOTION_RANGE_X: _bindgen_ty_20 = 0; +pub const AINPUT_MOTION_RANGE_Y: _bindgen_ty_20 = 1; +pub const AINPUT_MOTION_RANGE_PRESSURE: _bindgen_ty_20 = 2; +pub const AINPUT_MOTION_RANGE_SIZE: _bindgen_ty_20 = 3; +pub const AINPUT_MOTION_RANGE_TOUCH_MAJOR: _bindgen_ty_20 = 4; +pub const AINPUT_MOTION_RANGE_TOUCH_MINOR: _bindgen_ty_20 = 5; +pub const AINPUT_MOTION_RANGE_TOOL_MAJOR: _bindgen_ty_20 = 6; +pub const AINPUT_MOTION_RANGE_TOOL_MINOR: _bindgen_ty_20 = 7; +pub const AINPUT_MOTION_RANGE_ORIENTATION: _bindgen_ty_20 = 8; pub type _bindgen_ty_20 = ::std::os::raw::c_uint; extern "C" { pub fn AInputEvent_getType(event: *const AInputEvent) -> i32; @@ -1407,6 +1595,9 @@ 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; } @@ -1431,6 +1622,9 @@ 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; } @@ -1465,168 +1659,169 @@ extern "C" { pub fn AMotionEvent_getYPrecision(motion_event: *const AInputEvent) -> f32; } extern "C" { - pub fn AMotionEvent_getPointerCount(motion_event: *const AInputEvent) -> size_t; + pub fn AMotionEvent_getPointerCount(motion_event: *const AInputEvent) -> usize; } extern "C" { - pub fn AMotionEvent_getPointerId( - motion_event: *const AInputEvent, - pointer_index: size_t, - ) -> i32; + pub fn AMotionEvent_getPointerId(motion_event: *const AInputEvent, pointer_index: usize) + -> i32; } extern "C" { - pub fn AMotionEvent_getToolType(motion_event: *const AInputEvent, pointer_index: size_t) - -> i32; + pub fn AMotionEvent_getToolType(motion_event: *const AInputEvent, pointer_index: usize) -> i32; } extern "C" { - pub fn AMotionEvent_getRawX(motion_event: *const AInputEvent, pointer_index: size_t) -> f32; + pub fn AMotionEvent_getRawX(motion_event: *const AInputEvent, pointer_index: usize) -> f32; } extern "C" { - pub fn AMotionEvent_getRawY(motion_event: *const AInputEvent, pointer_index: size_t) -> f32; + pub fn AMotionEvent_getRawY(motion_event: *const AInputEvent, pointer_index: usize) -> f32; } extern "C" { - pub fn AMotionEvent_getX(motion_event: *const AInputEvent, pointer_index: size_t) -> f32; + pub fn AMotionEvent_getX(motion_event: *const AInputEvent, pointer_index: usize) -> f32; } extern "C" { - pub fn AMotionEvent_getY(motion_event: *const AInputEvent, pointer_index: size_t) -> f32; + pub fn AMotionEvent_getY(motion_event: *const AInputEvent, pointer_index: usize) -> f32; } extern "C" { - pub fn AMotionEvent_getPressure(motion_event: *const AInputEvent, pointer_index: size_t) - -> f32; + pub fn AMotionEvent_getPressure(motion_event: *const AInputEvent, pointer_index: usize) -> f32; } extern "C" { - pub fn AMotionEvent_getSize(motion_event: *const AInputEvent, pointer_index: size_t) -> f32; + pub fn AMotionEvent_getSize(motion_event: *const AInputEvent, pointer_index: usize) -> f32; } extern "C" { pub fn AMotionEvent_getTouchMajor( motion_event: *const AInputEvent, - pointer_index: size_t, + pointer_index: usize, ) -> f32; } extern "C" { pub fn AMotionEvent_getTouchMinor( motion_event: *const AInputEvent, - pointer_index: size_t, + pointer_index: usize, ) -> f32; } extern "C" { - pub fn AMotionEvent_getToolMajor( - motion_event: *const AInputEvent, - pointer_index: size_t, - ) -> f32; + pub fn AMotionEvent_getToolMajor(motion_event: *const AInputEvent, pointer_index: usize) + -> f32; } extern "C" { - pub fn AMotionEvent_getToolMinor( - motion_event: *const AInputEvent, - pointer_index: size_t, - ) -> f32; + pub fn AMotionEvent_getToolMinor(motion_event: *const AInputEvent, pointer_index: usize) + -> f32; } extern "C" { pub fn AMotionEvent_getOrientation( motion_event: *const AInputEvent, - pointer_index: size_t, + pointer_index: usize, ) -> f32; } extern "C" { pub fn AMotionEvent_getAxisValue( motion_event: *const AInputEvent, axis: i32, - pointer_index: size_t, + pointer_index: usize, ) -> f32; } extern "C" { - pub fn AMotionEvent_getHistorySize(motion_event: *const AInputEvent) -> size_t; + pub fn AMotionEvent_getHistorySize(motion_event: *const AInputEvent) -> usize; } extern "C" { pub fn AMotionEvent_getHistoricalEventTime( motion_event: *const AInputEvent, - history_index: size_t, + history_index: usize, ) -> i64; } extern "C" { pub fn AMotionEvent_getHistoricalRawX( motion_event: *const AInputEvent, - pointer_index: size_t, - history_index: size_t, + pointer_index: usize, + history_index: usize, ) -> f32; } extern "C" { pub fn AMotionEvent_getHistoricalRawY( motion_event: *const AInputEvent, - pointer_index: size_t, - history_index: size_t, + pointer_index: usize, + history_index: usize, ) -> f32; } extern "C" { pub fn AMotionEvent_getHistoricalX( motion_event: *const AInputEvent, - pointer_index: size_t, - history_index: size_t, + pointer_index: usize, + history_index: usize, ) -> f32; } extern "C" { pub fn AMotionEvent_getHistoricalY( motion_event: *const AInputEvent, - pointer_index: size_t, - history_index: size_t, + pointer_index: usize, + history_index: usize, ) -> f32; } extern "C" { pub fn AMotionEvent_getHistoricalPressure( motion_event: *const AInputEvent, - pointer_index: size_t, - history_index: size_t, + pointer_index: usize, + history_index: usize, ) -> f32; } extern "C" { pub fn AMotionEvent_getHistoricalSize( motion_event: *const AInputEvent, - pointer_index: size_t, - history_index: size_t, + pointer_index: usize, + history_index: usize, ) -> f32; } extern "C" { pub fn AMotionEvent_getHistoricalTouchMajor( motion_event: *const AInputEvent, - pointer_index: size_t, - history_index: size_t, + pointer_index: usize, + history_index: usize, ) -> f32; } extern "C" { pub fn AMotionEvent_getHistoricalTouchMinor( motion_event: *const AInputEvent, - pointer_index: size_t, - history_index: size_t, + pointer_index: usize, + history_index: usize, ) -> f32; } extern "C" { pub fn AMotionEvent_getHistoricalToolMajor( motion_event: *const AInputEvent, - pointer_index: size_t, - history_index: size_t, + pointer_index: usize, + history_index: usize, ) -> f32; } extern "C" { pub fn AMotionEvent_getHistoricalToolMinor( motion_event: *const AInputEvent, - pointer_index: size_t, - history_index: size_t, + pointer_index: usize, + history_index: usize, ) -> f32; } extern "C" { pub fn AMotionEvent_getHistoricalOrientation( motion_event: *const AInputEvent, - pointer_index: size_t, - history_index: size_t, + pointer_index: usize, + history_index: usize, ) -> f32; } extern "C" { pub fn AMotionEvent_getHistoricalAxisValue( motion_event: *const AInputEvent, axis: i32, - pointer_index: size_t, - history_index: size_t, + pointer_index: usize, + history_index: usize, ) -> 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 { @@ -1660,6 +1855,9 @@ 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 { @@ -1668,6 +1866,8 @@ pub struct imaxdiv_t { } #[test] fn bindgen_test_layout_imaxdiv_t() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 16usize, @@ -1679,7 +1879,7 @@ fn bindgen_test_layout_imaxdiv_t() { concat!("Alignment of ", stringify!(imaxdiv_t)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).quot as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).quot) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1689,7 +1889,7 @@ fn bindgen_test_layout_imaxdiv_t() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).rem as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).rem) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -1734,11 +1934,52 @@ 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; pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_R8G8B8A8_UNORM: AHardwareBuffer_Format = 1; pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_R8G8B8X8_UNORM: AHardwareBuffer_Format = 2; @@ -1758,6 +1999,8 @@ 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; @@ -1850,6 +2093,8 @@ pub struct AHardwareBuffer_Desc { } #[test] fn bindgen_test_layout_AHardwareBuffer_Desc() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 40usize, @@ -1861,7 +2106,7 @@ fn bindgen_test_layout_AHardwareBuffer_Desc() { concat!("Alignment of ", stringify!(AHardwareBuffer_Desc)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).width as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).width) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1871,7 +2116,7 @@ fn bindgen_test_layout_AHardwareBuffer_Desc() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).height as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).height) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -1881,7 +2126,7 @@ fn bindgen_test_layout_AHardwareBuffer_Desc() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).layers as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).layers) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -1891,7 +2136,7 @@ fn bindgen_test_layout_AHardwareBuffer_Desc() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).format as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).format) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", @@ -1901,7 +2146,7 @@ fn bindgen_test_layout_AHardwareBuffer_Desc() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).usage as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).usage) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -1911,7 +2156,7 @@ fn bindgen_test_layout_AHardwareBuffer_Desc() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).stride as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).stride) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -1921,7 +2166,7 @@ fn bindgen_test_layout_AHardwareBuffer_Desc() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).rfu0 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).rfu0) as usize - ptr as usize }, 28usize, concat!( "Offset of field: ", @@ -1931,7 +2176,7 @@ fn bindgen_test_layout_AHardwareBuffer_Desc() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).rfu1 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).rfu1) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -1950,6 +2195,9 @@ pub struct AHardwareBuffer_Plane { } #[test] fn bindgen_test_layout_AHardwareBuffer_Plane() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 12usize, @@ -1961,7 +2209,7 @@ fn bindgen_test_layout_AHardwareBuffer_Plane() { concat!("Alignment of ", stringify!(AHardwareBuffer_Plane)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).data as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).data) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1971,9 +2219,7 @@ fn bindgen_test_layout_AHardwareBuffer_Plane() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pixelStride as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).pixelStride) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -1983,7 +2229,7 @@ fn bindgen_test_layout_AHardwareBuffer_Plane() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).rowStride as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).rowStride) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -2001,6 +2247,9 @@ pub struct AHardwareBuffer_Planes { } #[test] fn bindgen_test_layout_AHardwareBuffer_Planes() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 52usize, @@ -2012,9 +2261,7 @@ fn bindgen_test_layout_AHardwareBuffer_Planes() { concat!("Alignment of ", stringify!(AHardwareBuffer_Planes)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).planeCount as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).planeCount) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -2024,7 +2271,7 @@ fn bindgen_test_layout_AHardwareBuffer_Planes() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).planes as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).planes) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -2066,15 +2313,6 @@ 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, @@ -2093,6 +2331,15 @@ 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; } @@ -2107,808 +2354,357 @@ extern "C" { outBytesPerStride: *mut i32, ) -> ::std::os::raw::c_int; } -pub type va_list = u32; -pub type __gnuc_va_list = u32; +extern "C" { + pub fn AHardwareBuffer_getId( + buffer: *const AHardwareBuffer, + outId: *mut u64, + ) -> ::std::os::raw::c_int; +} +#[doc = " \\brief Describe information about a pointer, found in a\n GameActivityMotionEvent.\n\n You can read values directly from this structure, or use helper functions\n (`GameActivityPointerAxes_getX`, `GameActivityPointerAxes_getY` and\n `GameActivityPointerAxes_getAxisValue`).\n\n The X axis and Y axis are enabled by default but any other axis that you want\n to read **must** be enabled first, using\n `GameActivityPointerAxes_enableAxis`.\n\n \\see GameActivityMotionEvent"] #[repr(C)] -pub struct JavaVMAttachArgs { - pub version: jint, - pub name: *const ::std::os::raw::c_char, - pub group: jobject, +#[derive(Debug, Copy, Clone)] +pub struct GameActivityPointerAxes { + pub id: i32, + pub toolType: i32, + pub axisValues: [f32; 48usize], + pub rawX: f32, + pub rawY: f32, } #[test] -fn bindgen_test_layout_JavaVMAttachArgs() { +fn bindgen_test_layout_GameActivityPointerAxes() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 12usize, - concat!("Size of: ", stringify!(JavaVMAttachArgs)) + ::std::mem::size_of::(), + 208usize, + concat!("Size of: ", stringify!(GameActivityPointerAxes)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(JavaVMAttachArgs)) + concat!("Alignment of ", stringify!(GameActivityPointerAxes)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).version as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(JavaVMAttachArgs), + stringify!(GameActivityPointerAxes), "::", - stringify!(version) + stringify!(id) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).name as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).toolType) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", - stringify!(JavaVMAttachArgs), + stringify!(GameActivityPointerAxes), "::", - stringify!(name) + stringify!(toolType) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).group as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).axisValues) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(JavaVMAttachArgs), + stringify!(GameActivityPointerAxes), "::", - stringify!(group) + stringify!(axisValues) ) ); -} -#[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)) + unsafe { ::std::ptr::addr_of!((*ptr).rawX) as usize - ptr as usize }, + 200usize, + concat!( + "Offset of field: ", + stringify!(GameActivityPointerAxes), + "::", + stringify!(rawX) + ) ); 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, + unsafe { ::std::ptr::addr_of!((*ptr).rawY) as usize - ptr as usize }, + 204usize, concat!( "Offset of field: ", - stringify!(JavaVMOption), + stringify!(GameActivityPointerAxes), "::", - stringify!(extraInfo) + stringify!(rawY) ) ); } -#[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) - ) - ); +extern "C" { + #[doc = " \\brief Enable the specified axis, so that its value is reported in the\n GameActivityPointerAxes structures stored in a motion event.\n\n You must enable any axis that you want to read, apart from\n `AMOTION_EVENT_AXIS_X` and `AMOTION_EVENT_AXIS_Y` that are enabled by\n default.\n\n If the axis index is out of range, nothing is done."] + pub fn GameActivityPointerAxes_enableAxis(axis: i32); } -pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_CAPTION_BAR: GameCommonInsetsType = 0; -pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_DISPLAY_CUTOUT: GameCommonInsetsType = 1; -pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_IME: GameCommonInsetsType = 2; -pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_MANDATORY_SYSTEM_GESTURES: - GameCommonInsetsType = 3; -pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_NAVIGATION_BARS: GameCommonInsetsType = 4; -pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_STATUS_BARS: GameCommonInsetsType = 5; -pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_SYSTEM_BARS: GameCommonInsetsType = 6; -pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_SYSTEM_GESTURES: GameCommonInsetsType = 7; -pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_TAPABLE_ELEMENT: GameCommonInsetsType = 8; -pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_WATERFALL: GameCommonInsetsType = 9; -pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_COUNT: GameCommonInsetsType = 10; -#[doc = " The type of a component for which to retrieve insets. See"] -#[doc = " https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type"] -pub type GameCommonInsetsType = ::std::os::raw::c_uint; -#[doc = " This struct holds a span within a region of text from start (inclusive) to"] -#[doc = " end (exclusive). An empty span or cursor position is specified with"] -#[doc = " start==end. An undefined span is specified with start = end = SPAN_UNDEFINED."] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct GameTextInputSpan { - #[doc = " The start of the region (inclusive)."] - pub start: i32, - #[doc = " The end of the region (exclusive)."] - pub end: i32, +extern "C" { + #[doc = " \\brief Disable the specified axis. Its value won't be reported in the\n GameActivityPointerAxes structures stored in a motion event anymore.\n\n Apart from X and Y, any axis that you want to read **must** be enabled first,\n using `GameActivityPointerAxes_enableAxis`.\n\n If the axis index is out of range, nothing is done."] + pub fn GameActivityPointerAxes_disableAxis(axis: i32); } -#[test] -fn bindgen_test_layout_GameTextInputSpan() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(GameTextInputSpan)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(GameTextInputSpan)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).start as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(GameTextInputSpan), - "::", - stringify!(start) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).end as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(GameTextInputSpan), - "::", - stringify!(end) - ) - ); +extern "C" { + #[doc = " \\brief Get the value of the requested axis.\n\n Apart from X and Y, any axis that you want to read **must** be enabled first,\n using `GameActivityPointerAxes_enableAxis`.\n\n Find the valid enums for the axis (`AMOTION_EVENT_AXIS_X`,\n `AMOTION_EVENT_AXIS_Y`, `AMOTION_EVENT_AXIS_PRESSURE`...)\n in https://developer.android.com/ndk/reference/group/input.\n\n @param pointerInfo The structure containing information about the pointer,\n obtained from GameActivityMotionEvent.\n @param axis The axis to get the value from\n @return The value of the axis, or 0 if the axis is invalid or was not\n enabled."] + pub fn GameActivityPointerAxes_getAxisValue( + pointerInfo: *const GameActivityPointerAxes, + axis: i32, + ) -> f32; } -pub const GameTextInputSpanFlag_SPAN_UNDEFINED: GameTextInputSpanFlag = -1; -#[doc = " Values with special meaning in a GameTextInputSpan."] -pub type GameTextInputSpanFlag = ::std::os::raw::c_int; -#[doc = " This struct holds the state of an editable section of text."] -#[doc = " The text can have a selection and a composing region defined on it."] -#[doc = " A composing region is used by IMEs that allow input using multiple steps to"] -#[doc = " compose a glyph or word. Use functions GameTextInput_getState and"] -#[doc = " GameTextInput_setState to read and modify the state that an IME is editing."] +#[doc = " \\brief Describe a motion event that happened on the GameActivity SurfaceView.\n\n This is 1:1 mapping to the information contained in a Java `MotionEvent`\n (see https://developer.android.com/reference/android/view/MotionEvent)."] #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct GameTextInputState { - #[doc = " Text owned by the state, as a modified UTF-8 string. Null-terminated."] - #[doc = " https://en.wikipedia.org/wiki/UTF-8#Modified_UTF-8"] - pub text_UTF8: *const ::std::os::raw::c_char, - #[doc = " Length in bytes of text_UTF8, *not* including the null at end."] - pub text_length: i32, - #[doc = " A selection defined on the text."] - pub selection: GameTextInputSpan, - #[doc = " A composing region defined on the text."] - pub composingRegion: GameTextInputSpan, +pub struct GameActivityMotionEvent { + pub deviceId: i32, + pub source: i32, + pub action: i32, + pub eventTime: i64, + pub downTime: i64, + pub flags: i32, + pub metaState: i32, + pub actionButton: i32, + pub buttonState: i32, + pub classification: i32, + pub edgeFlags: i32, + pub pointerCount: u32, + pub pointers: [GameActivityPointerAxes; 8usize], + pub historySize: ::std::os::raw::c_int, + pub historicalEventTimesMillis: *mut i64, + pub historicalEventTimesNanos: *mut i64, + pub historicalAxisValues: *mut f32, + pub precisionX: f32, + pub precisionY: f32, } #[test] -fn bindgen_test_layout_GameTextInputState() { +fn bindgen_test_layout_GameActivityMotionEvent() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(GameTextInputState)) + ::std::mem::size_of::(), + 1752usize, + concat!("Size of: ", stringify!(GameActivityMotionEvent)) ); assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(GameTextInputState)) + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(GameActivityMotionEvent)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).text_UTF8 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).deviceId) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(GameTextInputState), + stringify!(GameActivityMotionEvent), "::", - stringify!(text_UTF8) + stringify!(deviceId) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).text_length as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).source) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", - stringify!(GameTextInputState), + stringify!(GameActivityMotionEvent), "::", - stringify!(text_length) + stringify!(source) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).selection as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).action) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(GameTextInputState), + stringify!(GameActivityMotionEvent), "::", - stringify!(selection) + stringify!(action) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).composingRegion as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).eventTime) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", - stringify!(GameTextInputState), - "::", - stringify!(composingRegion) - ) - ); -} -#[doc = " A callback called by GameTextInput_getState."] -#[doc = " @param context User-defined context."] -#[doc = " @param state State, owned by the library, that will be valid for the duration"] -#[doc = " of the callback."] -pub type GameTextInputGetStateCallback = ::std::option::Option< - unsafe extern "C" fn(context: *mut ::std::os::raw::c_void, state: *const GameTextInputState), ->; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct GameTextInput { - _unused: [u8; 0], -} -extern "C" { - #[doc = " Initialize the GameTextInput library."] - #[doc = " If called twice without GameTextInput_destroy being called, the same pointer"] - #[doc = " will be returned and a warning will be issued."] - #[doc = " @param env A JNI env valid on the calling thread."] - #[doc = " @param max_string_size The maximum length of a string that can be edited. If"] - #[doc = " zero, the maximum defaults to 65536 bytes. A buffer of this size is allocated"] - #[doc = " at initialization."] - #[doc = " @return A handle to the library."] - pub fn GameTextInput_init(env: *mut JNIEnv, max_string_size: u32) -> *mut GameTextInput; -} -extern "C" { - #[doc = " When using GameTextInput, you need to create a gametextinput.InputConnection"] - #[doc = " on the Java side and pass it using this function to the library, unless using"] - #[doc = " GameActivity in which case this will be done for you. See the GameActivity"] - #[doc = " source code or GameTextInput samples for examples of usage."] - #[doc = " @param input A valid GameTextInput library handle."] - #[doc = " @param inputConnection A gametextinput.InputConnection object."] - pub fn GameTextInput_setInputConnection(input: *mut GameTextInput, inputConnection: jobject); -} -extern "C" { - #[doc = " Unless using GameActivity, it is required to call this function from your"] - #[doc = " Java gametextinput.Listener.stateChanged method to convert eventState and"] - #[doc = " trigger any event callbacks. When using GameActivity, this does not need to"] - #[doc = " be called as event processing is handled by the Activity."] - #[doc = " @param input A valid GameTextInput library handle."] - #[doc = " @param eventState A Java gametextinput.State object."] - pub fn GameTextInput_processEvent(input: *mut GameTextInput, eventState: jobject); -} -extern "C" { - #[doc = " Free any resources owned by the GameTextInput library."] - #[doc = " Any subsequent calls to the library will fail until GameTextInput_init is"] - #[doc = " called again."] - #[doc = " @param input A valid GameTextInput library handle."] - pub fn GameTextInput_destroy(input: *mut GameTextInput); -} -pub const ShowImeFlags_SHOW_IME_UNDEFINED: ShowImeFlags = 0; -pub const ShowImeFlags_SHOW_IMPLICIT: ShowImeFlags = 1; -pub const ShowImeFlags_SHOW_FORCED: ShowImeFlags = 2; -#[doc = " Flags to be passed to GameTextInput_showIme."] -pub type ShowImeFlags = ::std::os::raw::c_uint; -extern "C" { - #[doc = " Show the IME. Calls InputMethodManager.showSoftInput()."] - #[doc = " @param input A valid GameTextInput library handle."] - #[doc = " @param flags Defined in ShowImeFlags above. For more information see:"] - #[doc = " https://developer.android.com/reference/android/view/inputmethod/InputMethodManager"] - pub fn GameTextInput_showIme(input: *mut GameTextInput, flags: u32); -} -pub const HideImeFlags_HIDE_IME_UNDEFINED: HideImeFlags = 0; -pub const HideImeFlags_HIDE_IMPLICIT_ONLY: HideImeFlags = 1; -pub const HideImeFlags_HIDE_NOT_ALWAYS: HideImeFlags = 2; -#[doc = " Flags to be passed to GameTextInput_hideIme."] -pub type HideImeFlags = ::std::os::raw::c_uint; -extern "C" { - #[doc = " Show the IME. Calls InputMethodManager.hideSoftInputFromWindow()."] - #[doc = " @param input A valid GameTextInput library handle."] - #[doc = " @param flags Defined in HideImeFlags above. For more information see:"] - #[doc = " https://developer.android.com/reference/android/view/inputmethod/InputMethodManager"] - pub fn GameTextInput_hideIme(input: *mut GameTextInput, flags: u32); -} -extern "C" { - #[doc = " Call a callback with the current GameTextInput state, which may have been"] - #[doc = " modified by changes in the IME and calls to GameTextInput_setState. We use a"] - #[doc = " callback rather than returning the state in order to simplify ownership of"] - #[doc = " text_UTF8 strings. These strings are only valid during the calling of the"] - #[doc = " callback."] - #[doc = " @param input A valid GameTextInput library handle."] - #[doc = " @param callback A function that will be called with valid state."] - #[doc = " @param context Context used by the callback."] - pub fn GameTextInput_getState( - input: *mut GameTextInput, - callback: GameTextInputGetStateCallback, - context: *mut ::std::os::raw::c_void, - ); -} -extern "C" { - #[doc = " Set the current GameTextInput state. This state is reflected to any active"] - #[doc = " IME."] - #[doc = " @param input A valid GameTextInput library handle."] - #[doc = " @param state The state to set. Ownership is maintained by the caller and must"] - #[doc = " remain valid for the duration of the call."] - pub fn GameTextInput_setState(input: *mut GameTextInput, state: *const GameTextInputState); -} -#[doc = " Type of the callback needed by GameTextInput_setEventCallback that will be"] -#[doc = " called every time the IME state changes."] -#[doc = " @param context User-defined context set in GameTextInput_setEventCallback."] -#[doc = " @param current_state Current IME state, owned by the library and valid during"] -#[doc = " the callback."] -pub type GameTextInputEventCallback = ::std::option::Option< - unsafe extern "C" fn( - context: *mut ::std::os::raw::c_void, - current_state: *const GameTextInputState, - ), ->; -extern "C" { - #[doc = " Optionally set a callback to be called whenever the IME state changes."] - #[doc = " Not necessary if you are using GameActivity, which handles these callbacks"] - #[doc = " for you."] - #[doc = " @param input A valid GameTextInput library handle."] - #[doc = " @param callback Called by the library when the IME state changes."] - #[doc = " @param context Context passed as first argument to the callback."] - pub fn GameTextInput_setEventCallback( - input: *mut GameTextInput, - callback: GameTextInputEventCallback, - context: *mut ::std::os::raw::c_void, - ); -} -#[doc = " Type of the callback needed by GameTextInput_setImeInsetsCallback that will"] -#[doc = " be called every time the IME window insets change."] -#[doc = " @param context User-defined context set in"] -#[doc = " GameTextInput_setImeWIndowInsetsCallback."] -#[doc = " @param current_insets Current IME insets, owned by the library and valid"] -#[doc = " during the callback."] -pub type GameTextInputImeInsetsCallback = ::std::option::Option< - unsafe extern "C" fn(context: *mut ::std::os::raw::c_void, current_insets: *const ARect), ->; -extern "C" { - #[doc = " Optionally set a callback to be called whenever the IME insets change."] - #[doc = " Not necessary if you are using GameActivity, which handles these callbacks"] - #[doc = " for you."] - #[doc = " @param input A valid GameTextInput library handle."] - #[doc = " @param callback Called by the library when the IME insets change."] - #[doc = " @param context Context passed as first argument to the callback."] - pub fn GameTextInput_setImeInsetsCallback( - input: *mut GameTextInput, - callback: GameTextInputImeInsetsCallback, - context: *mut ::std::os::raw::c_void, - ); -} -extern "C" { - #[doc = " Get the current window insets for the IME."] - #[doc = " @param input A valid GameTextInput library handle."] - #[doc = " @param insets Filled with the current insets by this function."] - pub fn GameTextInput_getImeInsets(input: *const GameTextInput, insets: *mut ARect); -} -extern "C" { - #[doc = " Unless using GameActivity, it is required to call this function from your"] - #[doc = " Java gametextinput.Listener.onImeInsetsChanged method to"] - #[doc = " trigger any event callbacks. When using GameActivity, this does not need to"] - #[doc = " be called as insets processing is handled by the Activity."] - #[doc = " @param input A valid GameTextInput library handle."] - #[doc = " @param eventState A Java gametextinput.State object."] - pub fn GameTextInput_processImeInsets(input: *mut GameTextInput, insets: *const ARect); -} -extern "C" { - #[doc = " Convert a GameTextInputState struct to a Java gametextinput.State object."] - #[doc = " Don't forget to delete the returned Java local ref when you're done."] - #[doc = " @param input A valid GameTextInput library handle."] - #[doc = " @param state Input state to convert."] - #[doc = " @return A Java object of class gametextinput.State. The caller is required to"] - #[doc = " delete this local reference."] - pub fn GameTextInputState_toJava( - input: *const GameTextInput, - state: *const GameTextInputState, - ) -> jobject; -} -extern "C" { - #[doc = " Convert from a Java gametextinput.State object into a C GameTextInputState"] - #[doc = " struct."] - #[doc = " @param input A valid GameTextInput library handle."] - #[doc = " @param state A Java gametextinput.State object."] - #[doc = " @param callback A function called with the C struct, valid for the duration"] - #[doc = " of the call."] - #[doc = " @param context Context passed to the callback."] - pub fn GameTextInputState_fromJava( - input: *const GameTextInput, - state: jobject, - callback: GameTextInputGetStateCallback, - context: *mut ::std::os::raw::c_void, - ); -} -#[doc = " This structure defines the native side of an android.app.GameActivity."] -#[doc = " It is created by the framework, and handed to the application's native"] -#[doc = " code as it is being launched."] -#[repr(C)] -pub struct GameActivity { - #[doc = " Pointer to the callback function table of the native application."] - #[doc = " You can set the functions here to your own callbacks. The callbacks"] - #[doc = " pointer itself here should not be changed; it is allocated and managed"] - #[doc = " for you by the framework."] - pub callbacks: *mut GameActivityCallbacks, - #[doc = " The global handle on the process's Java VM."] - pub vm: *mut JavaVM, - #[doc = " JNI context for the main thread of the app. Note that this field"] - #[doc = " can ONLY be used from the main thread of the process; that is, the"] - #[doc = " thread that calls into the GameActivityCallbacks."] - pub env: *mut JNIEnv, - #[doc = " The GameActivity object handle."] - pub javaGameActivity: jobject, - #[doc = " Path to this application's internal data directory."] - pub internalDataPath: *const ::std::os::raw::c_char, - #[doc = " Path to this application's external (removable/mountable) data directory."] - pub externalDataPath: *const ::std::os::raw::c_char, - #[doc = " The platform's SDK version code."] - pub sdkVersion: i32, - #[doc = " This is the native instance of the application. It is not used by"] - #[doc = " the framework, but can be set by the application to its own instance"] - #[doc = " state."] - pub instance: *mut ::std::os::raw::c_void, - #[doc = " Pointer to the Asset Manager instance for the application. The"] - #[doc = " application uses this to access binary assets bundled inside its own .apk"] - #[doc = " file."] - pub assetManager: *mut AAssetManager, - #[doc = " Available starting with Honeycomb: path to the directory containing"] - #[doc = " the application's OBB files (if any). If the app doesn't have any"] - #[doc = " OBB files, this directory may not exist."] - pub obbPath: *const ::std::os::raw::c_char, -} -#[test] -fn bindgen_test_layout_GameActivity() { - assert_eq!( - ::std::mem::size_of::(), - 40usize, - concat!("Size of: ", stringify!(GameActivity)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(GameActivity)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).callbacks as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(GameActivity), - "::", - stringify!(callbacks) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).vm as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(GameActivity), - "::", - stringify!(vm) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).env as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(GameActivity), + stringify!(GameActivityMotionEvent), "::", - stringify!(env) + stringify!(eventTime) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).javaGameActivity as *const _ as usize }, - 12usize, + unsafe { ::std::ptr::addr_of!((*ptr).downTime) as usize - ptr as usize }, + 24usize, concat!( "Offset of field: ", - stringify!(GameActivity), + stringify!(GameActivityMotionEvent), "::", - stringify!(javaGameActivity) + stringify!(downTime) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).internalDataPath as *const _ as usize }, - 16usize, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + 32usize, concat!( "Offset of field: ", - stringify!(GameActivity), + stringify!(GameActivityMotionEvent), "::", - stringify!(internalDataPath) + stringify!(flags) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).externalDataPath as *const _ as usize }, - 20usize, + unsafe { ::std::ptr::addr_of!((*ptr).metaState) as usize - ptr as usize }, + 36usize, concat!( "Offset of field: ", - stringify!(GameActivity), + stringify!(GameActivityMotionEvent), "::", - stringify!(externalDataPath) + stringify!(metaState) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sdkVersion as *const _ as usize }, - 24usize, + unsafe { ::std::ptr::addr_of!((*ptr).actionButton) as usize - ptr as usize }, + 40usize, concat!( "Offset of field: ", - stringify!(GameActivity), + stringify!(GameActivityMotionEvent), "::", - stringify!(sdkVersion) + stringify!(actionButton) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).instance as *const _ as usize }, - 28usize, + unsafe { ::std::ptr::addr_of!((*ptr).buttonState) as usize - ptr as usize }, + 44usize, concat!( "Offset of field: ", - stringify!(GameActivity), + stringify!(GameActivityMotionEvent), "::", - stringify!(instance) + stringify!(buttonState) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).assetManager as *const _ as usize }, - 32usize, + unsafe { ::std::ptr::addr_of!((*ptr).classification) as usize - ptr as usize }, + 48usize, concat!( "Offset of field: ", - stringify!(GameActivity), + stringify!(GameActivityMotionEvent), "::", - stringify!(assetManager) + stringify!(classification) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).obbPath as *const _ as usize }, - 36usize, + unsafe { ::std::ptr::addr_of!((*ptr).edgeFlags) as usize - ptr as usize }, + 52usize, concat!( "Offset of field: ", - stringify!(GameActivity), + stringify!(GameActivityMotionEvent), "::", - stringify!(obbPath) + stringify!(edgeFlags) ) ); -} -#[doc = " \\brief Describe information about a pointer, found in a"] -#[doc = " GameActivityMotionEvent."] -#[doc = ""] -#[doc = " You can read values directly from this structure, or use helper functions"] -#[doc = " (`GameActivityPointerAxes_getX`, `GameActivityPointerAxes_getY` and"] -#[doc = " `GameActivityPointerAxes_getAxisValue`)."] -#[doc = ""] -#[doc = " The X axis and Y axis are enabled by default but any other axis that you want"] -#[doc = " to read **must** be enabled first, using"] -#[doc = " `GameActivityPointerAxes_enableAxis`."] -#[doc = ""] -#[doc = " \\see GameActivityMotionEvent"] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct GameActivityPointerAxes { - pub id: i32, - pub toolType: i32, - pub axisValues: [f32; 48usize], - pub rawX: f32, - pub rawY: f32, -} -#[test] -fn bindgen_test_layout_GameActivityPointerAxes() { - assert_eq!( - ::std::mem::size_of::(), - 208usize, - concat!("Size of: ", stringify!(GameActivityPointerAxes)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(GameActivityPointerAxes)) - ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).id as *const _ as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).pointerCount) as usize - ptr as usize }, + 56usize, concat!( "Offset of field: ", - stringify!(GameActivityPointerAxes), + stringify!(GameActivityMotionEvent), "::", - stringify!(id) + stringify!(pointerCount) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).toolType as *const _ as usize - }, - 4usize, + unsafe { ::std::ptr::addr_of!((*ptr).pointers) as usize - ptr as usize }, + 60usize, concat!( "Offset of field: ", - stringify!(GameActivityPointerAxes), + stringify!(GameActivityMotionEvent), "::", - stringify!(toolType) + stringify!(pointers) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).axisValues as *const _ as usize - }, - 8usize, + unsafe { ::std::ptr::addr_of!((*ptr).historySize) as usize - ptr as usize }, + 1724usize, concat!( "Offset of field: ", - stringify!(GameActivityPointerAxes), + stringify!(GameActivityMotionEvent), "::", - stringify!(axisValues) + stringify!(historySize) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).rawX as *const _ as usize }, - 200usize, + unsafe { ::std::ptr::addr_of!((*ptr).historicalEventTimesMillis) as usize - ptr as usize }, + 1728usize, concat!( "Offset of field: ", - stringify!(GameActivityPointerAxes), + stringify!(GameActivityMotionEvent), "::", - stringify!(rawX) + stringify!(historicalEventTimesMillis) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).rawY as *const _ as usize }, - 204usize, + unsafe { ::std::ptr::addr_of!((*ptr).historicalEventTimesNanos) as usize - ptr as usize }, + 1732usize, concat!( "Offset of field: ", - stringify!(GameActivityPointerAxes), + stringify!(GameActivityMotionEvent), "::", - stringify!(rawY) + stringify!(historicalEventTimesNanos) ) ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct GameActivityHistoricalPointerAxes { - pub eventTime: i64, - pub axisValues: [f32; 48usize], -} -#[test] -fn bindgen_test_layout_GameActivityHistoricalPointerAxes() { - assert_eq!( - ::std::mem::size_of::(), - 200usize, - concat!("Size of: ", stringify!(GameActivityHistoricalPointerAxes)) - ); assert_eq!( - ::std::mem::align_of::(), - 8usize, + unsafe { ::std::ptr::addr_of!((*ptr).historicalAxisValues) as usize - ptr as usize }, + 1736usize, concat!( - "Alignment of ", - stringify!(GameActivityHistoricalPointerAxes) + "Offset of field: ", + stringify!(GameActivityMotionEvent), + "::", + stringify!(historicalAxisValues) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).eventTime as *const _ - as usize - }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).precisionX) as usize - ptr as usize }, + 1740usize, concat!( "Offset of field: ", - stringify!(GameActivityHistoricalPointerAxes), + stringify!(GameActivityMotionEvent), "::", - stringify!(eventTime) + stringify!(precisionX) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).axisValues as *const _ - as usize - }, - 8usize, + unsafe { ::std::ptr::addr_of!((*ptr).precisionY) as usize - ptr as usize }, + 1744usize, concat!( "Offset of field: ", - stringify!(GameActivityHistoricalPointerAxes), + stringify!(GameActivityMotionEvent), "::", - stringify!(axisValues) + stringify!(precisionY) ) ); } extern "C" { - #[doc = " \\brief Enable the specified axis, so that its value is reported in the"] - #[doc = " GameActivityPointerAxes structures stored in a motion event."] - #[doc = ""] - #[doc = " You must enable any axis that you want to read, apart from"] - #[doc = " `AMOTION_EVENT_AXIS_X` and `AMOTION_EVENT_AXIS_Y` that are enabled by"] - #[doc = " default."] - #[doc = ""] - #[doc = " If the axis index is out of range, nothing is done."] - pub fn GameActivityPointerAxes_enableAxis(axis: i32); -} -extern "C" { - #[doc = " \\brief Disable the specified axis. Its value won't be reported in the"] - #[doc = " GameActivityPointerAxes structures stored in a motion event anymore."] - #[doc = ""] - #[doc = " Apart from X and Y, any axis that you want to read **must** be enabled first,"] - #[doc = " using `GameActivityPointerAxes_enableAxis`."] - #[doc = ""] - #[doc = " If the axis index is out of range, nothing is done."] - pub fn GameActivityPointerAxes_disableAxis(axis: i32); + pub fn GameActivityMotionEvent_getHistoricalAxisValue( + event: *const GameActivityMotionEvent, + axis: ::std::os::raw::c_int, + pointerIndex: ::std::os::raw::c_int, + historyPos: ::std::os::raw::c_int, + ) -> f32; } extern "C" { - #[doc = " \\brief Enable the specified axis, so that its value is reported in the"] - #[doc = " GameActivityHistoricalPointerAxes structures associated with a motion event."] - #[doc = ""] - #[doc = " You must enable any axis that you want to read (no axes are enabled by"] - #[doc = " default)."] - #[doc = ""] - #[doc = " If the axis index is out of range, nothing is done."] - pub fn GameActivityHistoricalPointerAxes_enableAxis(axis: i32); + #[doc = " \\brief Handle the freeing of the GameActivityMotionEvent struct."] + pub fn GameActivityMotionEvent_destroy(c_event: *mut GameActivityMotionEvent); } extern "C" { - #[doc = " \\brief Disable the specified axis. Its value won't be reported in the"] - #[doc = " GameActivityHistoricalPointerAxes structures associated with motion events"] - #[doc = " anymore."] - #[doc = ""] - #[doc = " If the axis index is out of range, nothing is done."] - pub fn GameActivityHistoricalPointerAxes_disableAxis(axis: i32); + #[doc = " \\brief Convert a Java `MotionEvent` to a `GameActivityMotionEvent`.\n\n This is done automatically by the GameActivity: see `onTouchEvent` to set\n a callback to consume the received events.\n This function can be used if you re-implement events handling in your own\n activity.\n Ownership of out_event is maintained by the caller."] + pub fn GameActivityMotionEvent_fromJava( + env: *mut JNIEnv, + motionEvent: jobject, + out_event: *mut GameActivityMotionEvent, + ); } -#[doc = " \\brief Describe a motion event that happened on the GameActivity SurfaceView."] -#[doc = ""] -#[doc = " This is 1:1 mapping to the information contained in a Java `MotionEvent`"] -#[doc = " (see https://developer.android.com/reference/android/view/MotionEvent)."] +#[doc = " \\brief Describe a key event that happened on the GameActivity SurfaceView.\n\n This is 1:1 mapping to the information contained in a Java `KeyEvent`\n (see https://developer.android.com/reference/android/view/KeyEvent).\n The only exception is the event times, which are reported as\n nanoseconds in this struct."] #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct GameActivityMotionEvent { +pub struct GameActivityKeyEvent { pub deviceId: i32, pub source: i32, pub action: i32, @@ -2916,374 +2712,534 @@ pub struct GameActivityMotionEvent { pub downTime: i64, pub flags: i32, pub metaState: i32, - pub actionButton: i32, - pub buttonState: i32, - pub classification: i32, - pub edgeFlags: i32, - pub pointerCount: u32, - pub pointers: [GameActivityPointerAxes; 8usize], - pub precisionX: f32, - pub precisionY: f32, - pub historicalStart: i16, - pub historicalCount: i16, + pub modifiers: i32, + pub repeatCount: i32, + pub keyCode: i32, + pub scanCode: i32, + pub unicodeChar: i32, } #[test] -fn bindgen_test_layout_GameActivityMotionEvent() { +fn bindgen_test_layout_GameActivityKeyEvent() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 1736usize, - concat!("Size of: ", stringify!(GameActivityMotionEvent)) + ::std::mem::size_of::(), + 64usize, + concat!("Size of: ", stringify!(GameActivityKeyEvent)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(GameActivityMotionEvent)) + concat!("Alignment of ", stringify!(GameActivityKeyEvent)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).deviceId as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).deviceId) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(GameActivityMotionEvent), + stringify!(GameActivityKeyEvent), "::", stringify!(deviceId) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).source as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).source) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", - stringify!(GameActivityMotionEvent), + stringify!(GameActivityKeyEvent), "::", stringify!(source) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).action as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).action) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(GameActivityMotionEvent), + stringify!(GameActivityKeyEvent), "::", stringify!(action) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).eventTime as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).eventTime) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", - stringify!(GameActivityMotionEvent), + stringify!(GameActivityKeyEvent), "::", stringify!(eventTime) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).downTime as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).downTime) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", - stringify!(GameActivityMotionEvent), + stringify!(GameActivityKeyEvent), "::", stringify!(downTime) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", - stringify!(GameActivityMotionEvent), + stringify!(GameActivityKeyEvent), "::", stringify!(flags) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).metaState as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).metaState) as usize - ptr as usize }, 36usize, concat!( "Offset of field: ", - stringify!(GameActivityMotionEvent), + stringify!(GameActivityKeyEvent), "::", stringify!(metaState) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).actionButton as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).modifiers) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", - stringify!(GameActivityMotionEvent), + stringify!(GameActivityKeyEvent), "::", - stringify!(actionButton) + stringify!(modifiers) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).buttonState as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).repeatCount) as usize - ptr as usize }, 44usize, concat!( "Offset of field: ", - stringify!(GameActivityMotionEvent), + stringify!(GameActivityKeyEvent), "::", - stringify!(buttonState) + stringify!(repeatCount) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).classification as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).keyCode) as usize - ptr as usize }, 48usize, concat!( "Offset of field: ", - stringify!(GameActivityMotionEvent), + stringify!(GameActivityKeyEvent), "::", - stringify!(classification) + stringify!(keyCode) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).edgeFlags as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).scanCode) as usize - ptr as usize }, 52usize, concat!( "Offset of field: ", - stringify!(GameActivityMotionEvent), + stringify!(GameActivityKeyEvent), "::", - stringify!(edgeFlags) + stringify!(scanCode) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pointerCount as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).unicodeChar) as usize - ptr as usize }, 56usize, concat!( "Offset of field: ", - stringify!(GameActivityMotionEvent), + stringify!(GameActivityKeyEvent), "::", - stringify!(pointerCount) + stringify!(unicodeChar) + ) + ); +} +extern "C" { + #[doc = " \\brief Convert a Java `KeyEvent` to a `GameActivityKeyEvent`.\n\n This is done automatically by the GameActivity: see `onKeyUp` and `onKeyDown`\n to set a callback to consume the received events.\n This function can be used if you re-implement events handling in your own\n activity.\n Ownership of out_event is maintained by the caller."] + pub fn GameActivityKeyEvent_fromJava( + env: *mut JNIEnv, + motionEvent: jobject, + out_event: *mut GameActivityKeyEvent, + ); +} +pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_CAPTION_BAR: GameCommonInsetsType = 0; +pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_DISPLAY_CUTOUT: GameCommonInsetsType = 1; +pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_IME: GameCommonInsetsType = 2; +pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_MANDATORY_SYSTEM_GESTURES: + GameCommonInsetsType = 3; +pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_NAVIGATION_BARS: GameCommonInsetsType = 4; +pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_STATUS_BARS: GameCommonInsetsType = 5; +pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_SYSTEM_BARS: GameCommonInsetsType = 6; +pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_SYSTEM_GESTURES: GameCommonInsetsType = 7; +pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_TAPABLE_ELEMENT: GameCommonInsetsType = 8; +pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_WATERFALL: GameCommonInsetsType = 9; +pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_COUNT: GameCommonInsetsType = 10; +#[doc = " The type of a component for which to retrieve insets. See\n https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type"] +pub type GameCommonInsetsType = ::std::os::raw::c_uint; +#[doc = " This struct holds a span within a region of text from start (inclusive) to\n end (exclusive). An empty span or cursor position is specified with\n start==end. An undefined span is specified with start = end = SPAN_UNDEFINED."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GameTextInputSpan { + #[doc = " The start of the region (inclusive)."] + pub start: i32, + #[doc = " The end of the region (exclusive)."] + pub end: i32, +} +#[test] +fn bindgen_test_layout_GameTextInputSpan() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(GameTextInputSpan)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(GameTextInputSpan)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).start) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(GameTextInputSpan), + "::", + stringify!(start) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pointers as *const _ as usize - }, - 60usize, + unsafe { ::std::ptr::addr_of!((*ptr).end) as usize - ptr as usize }, + 4usize, concat!( "Offset of field: ", - stringify!(GameActivityMotionEvent), + stringify!(GameTextInputSpan), "::", - stringify!(pointers) + stringify!(end) ) ); +} +pub const GameTextInputSpanFlag_SPAN_UNDEFINED: GameTextInputSpanFlag = -1; +#[doc = " Values with special meaning in a GameTextInputSpan."] +pub type GameTextInputSpanFlag = ::std::os::raw::c_int; +#[doc = " This struct holds the state of an editable section of text.\n The text can have a selection and a composing region defined on it.\n A composing region is used by IMEs that allow input using multiple steps to\n compose a glyph or word. Use functions GameTextInput_getState and\n GameTextInput_setState to read and modify the state that an IME is editing."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GameTextInputState { + #[doc = " Text owned by the state, as a modified UTF-8 string. Null-terminated.\n https://en.wikipedia.org/wiki/UTF-8#Modified_UTF-8"] + pub text_UTF8: *const ::std::os::raw::c_char, + #[doc = " Length in bytes of text_UTF8, *not* including the null at end."] + pub text_length: i32, + #[doc = " A selection defined on the text."] + pub selection: GameTextInputSpan, + #[doc = " A composing region defined on the text."] + pub composingRegion: GameTextInputSpan, +} +#[test] +fn bindgen_test_layout_GameTextInputState() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 24usize, + concat!("Size of: ", stringify!(GameTextInputState)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(GameTextInputState)) + ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).precisionX as *const _ as usize - }, - 1724usize, + unsafe { ::std::ptr::addr_of!((*ptr).text_UTF8) as usize - ptr as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(GameActivityMotionEvent), + stringify!(GameTextInputState), "::", - stringify!(precisionX) + stringify!(text_UTF8) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).precisionY as *const _ as usize - }, - 1728usize, + unsafe { ::std::ptr::addr_of!((*ptr).text_length) as usize - ptr as usize }, + 4usize, concat!( "Offset of field: ", - stringify!(GameActivityMotionEvent), + stringify!(GameTextInputState), "::", - stringify!(precisionY) + stringify!(text_length) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).historicalStart as *const _ as usize - }, - 1732usize, + unsafe { ::std::ptr::addr_of!((*ptr).selection) as usize - ptr as usize }, + 8usize, concat!( "Offset of field: ", - stringify!(GameActivityMotionEvent), + stringify!(GameTextInputState), "::", - stringify!(historicalStart) + stringify!(selection) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).historicalCount as *const _ as usize - }, - 1734usize, + unsafe { ::std::ptr::addr_of!((*ptr).composingRegion) as usize - ptr as usize }, + 16usize, concat!( "Offset of field: ", - stringify!(GameActivityMotionEvent), + stringify!(GameTextInputState), "::", - stringify!(historicalCount) + stringify!(composingRegion) ) ); } -#[doc = " \\brief Describe a key event that happened on the GameActivity SurfaceView."] -#[doc = ""] -#[doc = " This is 1:1 mapping to the information contained in a Java `KeyEvent`"] -#[doc = " (see https://developer.android.com/reference/android/view/KeyEvent)."] +#[doc = " A callback called by GameTextInput_getState.\n @param context User-defined context.\n @param state State, owned by the library, that will be valid for the duration\n of the callback."] +pub type GameTextInputGetStateCallback = ::std::option::Option< + unsafe extern "C" fn(context: *mut ::std::os::raw::c_void, state: *const GameTextInputState), +>; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct GameActivityKeyEvent { - pub deviceId: i32, - pub source: i32, - pub action: i32, - pub eventTime: i64, - pub downTime: i64, - pub flags: i32, - pub metaState: i32, - pub modifiers: i32, - pub repeatCount: i32, - pub keyCode: i32, - pub scanCode: i32, +pub struct GameTextInput { + _unused: [u8; 0], +} +extern "C" { + #[doc = " Initialize the GameTextInput library.\n If called twice without GameTextInput_destroy being called, the same pointer\n will be returned and a warning will be issued.\n @param env A JNI env valid on the calling thread.\n @param max_string_size The maximum length of a string that can be edited. If\n zero, the maximum defaults to 65536 bytes. A buffer of this size is allocated\n at initialization.\n @return A handle to the library."] + pub fn GameTextInput_init(env: *mut JNIEnv, max_string_size: u32) -> *mut GameTextInput; +} +extern "C" { + #[doc = " When using GameTextInput, you need to create a gametextinput.InputConnection\n on the Java side and pass it using this function to the library, unless using\n GameActivity in which case this will be done for you. See the GameActivity\n source code or GameTextInput samples for examples of usage.\n @param input A valid GameTextInput library handle.\n @param inputConnection A gametextinput.InputConnection object."] + pub fn GameTextInput_setInputConnection(input: *mut GameTextInput, inputConnection: jobject); +} +extern "C" { + #[doc = " Unless using GameActivity, it is required to call this function from your\n Java gametextinput.Listener.stateChanged method to convert eventState and\n trigger any event callbacks. When using GameActivity, this does not need to\n be called as event processing is handled by the Activity.\n @param input A valid GameTextInput library handle.\n @param eventState A Java gametextinput.State object."] + pub fn GameTextInput_processEvent(input: *mut GameTextInput, eventState: jobject); +} +extern "C" { + #[doc = " Free any resources owned by the GameTextInput library.\n Any subsequent calls to the library will fail until GameTextInput_init is\n called again.\n @param input A valid GameTextInput library handle."] + pub fn GameTextInput_destroy(input: *mut GameTextInput); +} +pub const ShowImeFlags_SHOW_IME_UNDEFINED: ShowImeFlags = 0; +pub const ShowImeFlags_SHOW_IMPLICIT: ShowImeFlags = 1; +pub const ShowImeFlags_SHOW_FORCED: ShowImeFlags = 2; +#[doc = " Flags to be passed to GameTextInput_showIme."] +pub type ShowImeFlags = ::std::os::raw::c_uint; +extern "C" { + #[doc = " Show the IME. Calls InputMethodManager.showSoftInput().\n @param input A valid GameTextInput library handle.\n @param flags Defined in ShowImeFlags above. For more information see:\n https://developer.android.com/reference/android/view/inputmethod/InputMethodManager"] + pub fn GameTextInput_showIme(input: *mut GameTextInput, flags: u32); +} +pub const HideImeFlags_HIDE_IME_UNDEFINED: HideImeFlags = 0; +pub const HideImeFlags_HIDE_IMPLICIT_ONLY: HideImeFlags = 1; +pub const HideImeFlags_HIDE_NOT_ALWAYS: HideImeFlags = 2; +#[doc = " Flags to be passed to GameTextInput_hideIme."] +pub type HideImeFlags = ::std::os::raw::c_uint; +extern "C" { + #[doc = " Show the IME. Calls InputMethodManager.hideSoftInputFromWindow().\n @param input A valid GameTextInput library handle.\n @param flags Defined in HideImeFlags above. For more information see:\n https://developer.android.com/reference/android/view/inputmethod/InputMethodManager"] + pub fn GameTextInput_hideIme(input: *mut GameTextInput, flags: u32); +} +extern "C" { + #[doc = " Restarts the input method. Calls InputMethodManager.restartInput().\n @param input A valid GameTextInput library handle."] + pub fn GameTextInput_restartInput(input: *mut GameTextInput); +} +extern "C" { + #[doc = " Call a callback with the current GameTextInput state, which may have been\n modified by changes in the IME and calls to GameTextInput_setState. We use a\n callback rather than returning the state in order to simplify ownership of\n text_UTF8 strings. These strings are only valid during the calling of the\n callback.\n @param input A valid GameTextInput library handle.\n @param callback A function that will be called with valid state.\n @param context Context used by the callback."] + pub fn GameTextInput_getState( + input: *mut GameTextInput, + callback: GameTextInputGetStateCallback, + context: *mut ::std::os::raw::c_void, + ); +} +extern "C" { + #[doc = " Set the current GameTextInput state. This state is reflected to any active\n IME.\n @param input A valid GameTextInput library handle.\n @param state The state to set. Ownership is maintained by the caller and must\n remain valid for the duration of the call."] + pub fn GameTextInput_setState(input: *mut GameTextInput, state: *const GameTextInputState); +} +#[doc = " Type of the callback needed by GameTextInput_setEventCallback that will be\n called every time the IME state changes.\n @param context User-defined context set in GameTextInput_setEventCallback.\n @param current_state Current IME state, owned by the library and valid during\n the callback."] +pub type GameTextInputEventCallback = ::std::option::Option< + unsafe extern "C" fn( + context: *mut ::std::os::raw::c_void, + current_state: *const GameTextInputState, + ), +>; +extern "C" { + #[doc = " Optionally set a callback to be called whenever the IME state changes.\n Not necessary if you are using GameActivity, which handles these callbacks\n for you.\n @param input A valid GameTextInput library handle.\n @param callback Called by the library when the IME state changes.\n @param context Context passed as first argument to the callback."] + pub fn GameTextInput_setEventCallback( + input: *mut GameTextInput, + callback: GameTextInputEventCallback, + context: *mut ::std::os::raw::c_void, + ); +} +#[doc = " Type of the callback needed by GameTextInput_setImeInsetsCallback that will\n be called every time the IME window insets change.\n @param context User-defined context set in\n GameTextInput_setImeWIndowInsetsCallback.\n @param current_insets Current IME insets, owned by the library and valid\n during the callback."] +pub type GameTextInputImeInsetsCallback = ::std::option::Option< + unsafe extern "C" fn(context: *mut ::std::os::raw::c_void, current_insets: *const ARect), +>; +extern "C" { + #[doc = " Optionally set a callback to be called whenever the IME insets change.\n Not necessary if you are using GameActivity, which handles these callbacks\n for you.\n @param input A valid GameTextInput library handle.\n @param callback Called by the library when the IME insets change.\n @param context Context passed as first argument to the callback."] + pub fn GameTextInput_setImeInsetsCallback( + input: *mut GameTextInput, + callback: GameTextInputImeInsetsCallback, + context: *mut ::std::os::raw::c_void, + ); +} +extern "C" { + #[doc = " Get the current window insets for the IME.\n @param input A valid GameTextInput library handle.\n @param insets Filled with the current insets by this function."] + pub fn GameTextInput_getImeInsets(input: *const GameTextInput, insets: *mut ARect); +} +extern "C" { + #[doc = " Unless using GameActivity, it is required to call this function from your\n Java gametextinput.Listener.onImeInsetsChanged method to\n trigger any event callbacks. When using GameActivity, this does not need to\n be called as insets processing is handled by the Activity.\n @param input A valid GameTextInput library handle.\n @param eventState A Java gametextinput.State object."] + pub fn GameTextInput_processImeInsets(input: *mut GameTextInput, insets: *const ARect); +} +extern "C" { + #[doc = " Convert a GameTextInputState struct to a Java gametextinput.State object.\n Don't forget to delete the returned Java local ref when you're done.\n @param input A valid GameTextInput library handle.\n @param state Input state to convert.\n @return A Java object of class gametextinput.State. The caller is required to\n delete this local reference."] + pub fn GameTextInputState_toJava( + input: *const GameTextInput, + state: *const GameTextInputState, + ) -> jobject; +} +extern "C" { + #[doc = " Convert from a Java gametextinput.State object into a C GameTextInputState\n struct.\n @param input A valid GameTextInput library handle.\n @param state A Java gametextinput.State object.\n @param callback A function called with the C struct, valid for the duration\n of the call.\n @param context Context passed to the callback."] + pub fn GameTextInputState_fromJava( + input: *const GameTextInput, + state: jobject, + callback: GameTextInputGetStateCallback, + context: *mut ::std::os::raw::c_void, + ); +} +#[doc = " This structure defines the native side of an android.app.GameActivity.\n It is created by the framework, and handed to the application's native\n code as it is being launched."] +#[repr(C)] +pub struct GameActivity { + #[doc = " Pointer to the callback function table of the native application.\n You can set the functions here to your own callbacks. The callbacks\n pointer itself here should not be changed; it is allocated and managed\n for you by the framework."] + pub callbacks: *mut GameActivityCallbacks, + #[doc = " The global handle on the process's Java VM."] + pub vm: *mut JavaVM, + #[doc = " JNI context for the main thread of the app. Note that this field\n can ONLY be used from the main thread of the process; that is, the\n thread that calls into the GameActivityCallbacks."] + pub env: *mut JNIEnv, + #[doc = " The GameActivity object handle."] + pub javaGameActivity: jobject, + #[doc = " Path to this application's internal data directory."] + pub internalDataPath: *const ::std::os::raw::c_char, + #[doc = " Path to this application's external (removable/mountable) data directory."] + pub externalDataPath: *const ::std::os::raw::c_char, + #[doc = " The platform's SDK version code."] + pub sdkVersion: i32, + #[doc = " This is the native instance of the application. It is not used by\n the framework, but can be set by the application to its own instance\n state."] + pub instance: *mut ::std::os::raw::c_void, + #[doc = " Pointer to the Asset Manager instance for the application. The\n application uses this to access binary assets bundled inside its own .apk\n file."] + pub assetManager: *mut AAssetManager, + #[doc = " Available starting with Honeycomb: path to the directory containing\n the application's OBB files (if any). If the app doesn't have any\n OBB files, this directory may not exist."] + pub obbPath: *const ::std::os::raw::c_char, } #[test] -fn bindgen_test_layout_GameActivityKeyEvent() { +fn bindgen_test_layout_GameActivity() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 56usize, - concat!("Size of: ", stringify!(GameActivityKeyEvent)) + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(GameActivity)) ); assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(GameActivityKeyEvent)) + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(GameActivity)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).deviceId as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).callbacks) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(GameActivityKeyEvent), + stringify!(GameActivity), "::", - stringify!(deviceId) + stringify!(callbacks) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).source as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).vm) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", - stringify!(GameActivityKeyEvent), + stringify!(GameActivity), "::", - stringify!(source) + stringify!(vm) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).action as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).env) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(GameActivityKeyEvent), - "::", - stringify!(action) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).eventTime as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(GameActivityKeyEvent), + stringify!(GameActivity), "::", - stringify!(eventTime) + stringify!(env) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).downTime as *const _ as usize }, - 24usize, + unsafe { ::std::ptr::addr_of!((*ptr).javaGameActivity) as usize - ptr as usize }, + 12usize, concat!( "Offset of field: ", - stringify!(GameActivityKeyEvent), + stringify!(GameActivity), "::", - stringify!(downTime) + stringify!(javaGameActivity) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, - 32usize, + unsafe { ::std::ptr::addr_of!((*ptr).internalDataPath) as usize - ptr as usize }, + 16usize, concat!( "Offset of field: ", - stringify!(GameActivityKeyEvent), + stringify!(GameActivity), "::", - stringify!(flags) + stringify!(internalDataPath) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).metaState as *const _ as usize }, - 36usize, + unsafe { ::std::ptr::addr_of!((*ptr).externalDataPath) as usize - ptr as usize }, + 20usize, concat!( "Offset of field: ", - stringify!(GameActivityKeyEvent), + stringify!(GameActivity), "::", - stringify!(metaState) + stringify!(externalDataPath) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).modifiers as *const _ as usize }, - 40usize, + unsafe { ::std::ptr::addr_of!((*ptr).sdkVersion) as usize - ptr as usize }, + 24usize, concat!( "Offset of field: ", - stringify!(GameActivityKeyEvent), + stringify!(GameActivity), "::", - stringify!(modifiers) + stringify!(sdkVersion) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).repeatCount as *const _ as usize - }, - 44usize, + unsafe { ::std::ptr::addr_of!((*ptr).instance) as usize - ptr as usize }, + 28usize, concat!( "Offset of field: ", - stringify!(GameActivityKeyEvent), + stringify!(GameActivity), "::", - stringify!(repeatCount) + stringify!(instance) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).keyCode as *const _ as usize }, - 48usize, + unsafe { ::std::ptr::addr_of!((*ptr).assetManager) as usize - ptr as usize }, + 32usize, concat!( "Offset of field: ", - stringify!(GameActivityKeyEvent), + stringify!(GameActivity), "::", - stringify!(keyCode) + stringify!(assetManager) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).scanCode as *const _ as usize }, - 52usize, + unsafe { ::std::ptr::addr_of!((*ptr).obbPath) as usize - ptr as usize }, + 36usize, concat!( "Offset of field: ", - stringify!(GameActivityKeyEvent), + stringify!(GameActivity), "::", - stringify!(scanCode) + stringify!(obbPath) ) ); } -#[doc = " A function the user should call from their callback with the data, its length"] -#[doc = " and the library- supplied context."] +#[doc = " A function the user should call from their callback with the data, its length\n and the library- supplied context."] pub type SaveInstanceStateRecallback = ::std::option::Option< unsafe extern "C" fn( bytes: *const ::std::os::raw::c_char, @@ -3295,18 +3251,11 @@ pub type SaveInstanceStateRecallback = ::std::option::Option< #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct GameActivityCallbacks { - #[doc = " GameActivity has started. See Java documentation for Activity.onStart()"] - #[doc = " for more information."] + #[doc = " GameActivity has started. See Java documentation for Activity.onStart()\n for more information."] pub onStart: ::std::option::Option, - #[doc = " GameActivity has resumed. See Java documentation for Activity.onResume()"] - #[doc = " for more information."] + #[doc = " GameActivity has resumed. See Java documentation for Activity.onResume()\n for more information."] pub onResume: ::std::option::Option, - #[doc = " The framework is asking GameActivity to save its current instance state."] - #[doc = " See the Java documentation for Activity.onSaveInstanceState() for more"] - #[doc = " information. The user should call the recallback with their data, its"] - #[doc = " length and the provided context; they retain ownership of the data. Note"] - #[doc = " that the saved state will be persisted, so it can not contain any active"] - #[doc = " entities (pointers to memory, file descriptors, etc)."] + #[doc = " The framework is asking GameActivity to save its current instance state.\n See the Java documentation for Activity.onSaveInstanceState() for more\n information. The user should call the recallback with their data, its\n length and the provided context; they retain ownership of the data. Note\n that the saved state will be persisted, so it can not contain any active\n entities (pointers to memory, file descriptors, etc)."] pub onSaveInstanceState: ::std::option::Option< unsafe extern "C" fn( activity: *mut GameActivity, @@ -3314,27 +3263,20 @@ pub struct GameActivityCallbacks { context: *mut ::std::os::raw::c_void, ), >, - #[doc = " GameActivity has paused. See Java documentation for Activity.onPause()"] - #[doc = " for more information."] + #[doc = " GameActivity has paused. See Java documentation for Activity.onPause()\n for more information."] pub onPause: ::std::option::Option, - #[doc = " GameActivity has stopped. See Java documentation for Activity.onStop()"] - #[doc = " for more information."] + #[doc = " GameActivity has stopped. See Java documentation for Activity.onStop()\n for more information."] pub onStop: ::std::option::Option, - #[doc = " GameActivity is being destroyed. See Java documentation for"] - #[doc = " Activity.onDestroy() for more information."] + #[doc = " GameActivity is being destroyed. See Java documentation for\n Activity.onDestroy() for more information."] pub onDestroy: ::std::option::Option, - #[doc = " Focus has changed in this GameActivity's window. This is often used,"] - #[doc = " for example, to pause a game when it loses input focus."] + #[doc = " Focus has changed in this GameActivity's window. This is often used,\n for example, to pause a game when it loses input focus."] pub onWindowFocusChanged: ::std::option::Option, - #[doc = " The drawing window for this native activity has been created. You"] - #[doc = " can use the given native window object to start drawing."] + #[doc = " The drawing window for this native activity has been created. You\n can use the given native window object to start drawing."] pub onNativeWindowCreated: ::std::option::Option< unsafe extern "C" fn(activity: *mut GameActivity, window: *mut ANativeWindow), >, - #[doc = " The drawing window for this native activity has been resized. You should"] - #[doc = " retrieve the new size from the window and ensure that your rendering in"] - #[doc = " it now matches."] + #[doc = " The drawing window for this native activity has been resized. You should\n retrieve the new size from the window and ensure that your rendering in\n it now matches."] pub onNativeWindowResized: ::std::option::Option< unsafe extern "C" fn( activity: *mut GameActivity, @@ -3343,77 +3285,62 @@ pub struct GameActivityCallbacks { newHeight: i32, ), >, - #[doc = " The drawing window for this native activity needs to be redrawn. To"] - #[doc = " avoid transient artifacts during screen changes (such resizing after"] - #[doc = " rotation), applications should not return from this function until they"] - #[doc = " have finished drawing their window in its current state."] + #[doc = " The drawing window for this native activity needs to be redrawn. To\n avoid transient artifacts during screen changes (such resizing after\n rotation), applications should not return from this function until they\n have finished drawing their window in its current state."] pub onNativeWindowRedrawNeeded: ::std::option::Option< unsafe extern "C" fn(activity: *mut GameActivity, window: *mut ANativeWindow), >, - #[doc = " The drawing window for this native activity is going to be destroyed."] - #[doc = " You MUST ensure that you do not touch the window object after returning"] - #[doc = " from this function: in the common case of drawing to the window from"] - #[doc = " another thread, that means the implementation of this callback must"] - #[doc = " properly synchronize with the other thread to stop its drawing before"] - #[doc = " returning from here."] + #[doc = " The drawing window for this native activity is going to be destroyed.\n You MUST ensure that you do not touch the window object after returning\n from this function: in the common case of drawing to the window from\n another thread, that means the implementation of this callback must\n properly synchronize with the other thread to stop its drawing before\n returning from here."] pub onNativeWindowDestroyed: ::std::option::Option< unsafe extern "C" fn(activity: *mut GameActivity, window: *mut ANativeWindow), >, - #[doc = " The current device AConfiguration has changed. The new configuration can"] - #[doc = " be retrieved from assetManager."] + #[doc = " The current device AConfiguration has changed. The new configuration can\n be retrieved from assetManager."] pub onConfigurationChanged: ::std::option::Option, - #[doc = " The system is running low on memory. Use this callback to release"] - #[doc = " resources you do not need, to help the system avoid killing more"] - #[doc = " important processes."] + #[doc = " The system is running low on memory. Use this callback to release\n resources you do not need, to help the system avoid killing more\n important processes."] pub onTrimMemory: ::std::option::Option< unsafe extern "C" fn(activity: *mut GameActivity, level: ::std::os::raw::c_int), >, - #[doc = " Callback called for every MotionEvent done on the GameActivity"] - #[doc = " SurfaceView. Ownership of `event` is maintained by the library and it is"] - #[doc = " only valid during the callback."] + #[doc = " Callback called for every MotionEvent done on the GameActivity\n SurfaceView. Ownership of `event` is maintained by the library and it is\n only valid during the callback."] pub onTouchEvent: ::std::option::Option< unsafe extern "C" fn( activity: *mut GameActivity, event: *const GameActivityMotionEvent, - historical: *const GameActivityHistoricalPointerAxes, - historicalLen: ::std::os::raw::c_int, ) -> bool, >, - #[doc = " Callback called for every key down event on the GameActivity SurfaceView."] - #[doc = " Ownership of `event` is maintained by the library and it is only valid"] - #[doc = " during the callback."] + #[doc = " Callback called for every key down event on the GameActivity SurfaceView.\n Ownership of `event` is maintained by the library and it is only valid\n during the callback."] pub onKeyDown: ::std::option::Option< unsafe extern "C" fn( activity: *mut GameActivity, event: *const GameActivityKeyEvent, ) -> bool, >, - #[doc = " Callback called for every key up event on the GameActivity SurfaceView."] - #[doc = " Ownership of `event` is maintained by the library and it is only valid"] - #[doc = " during the callback."] + #[doc = " Callback called for every key up event on the GameActivity SurfaceView.\n Ownership of `event` is maintained by the library and it is only valid\n during the callback."] pub onKeyUp: ::std::option::Option< unsafe extern "C" fn( activity: *mut GameActivity, event: *const GameActivityKeyEvent, ) -> bool, >, - #[doc = " Callback called for every soft-keyboard text input event."] - #[doc = " Ownership of `state` is maintained by the library and it is only valid"] - #[doc = " during the callback."] + #[doc = " Callback called for every soft-keyboard text input event.\n Ownership of `state` is maintained by the library and it is only valid\n during the callback."] pub onTextInputEvent: ::std::option::Option< unsafe extern "C" fn(activity: *mut GameActivity, state: *const GameTextInputState), >, - #[doc = " Callback called when WindowInsets of the main app window have changed."] - #[doc = " Call GameActivity_getWindowInsets to retrieve the insets themselves."] + #[doc = " Callback called when WindowInsets of the main app window have changed.\n Call GameActivity_getWindowInsets to retrieve the insets themselves."] pub onWindowInsetsChanged: ::std::option::Option, + #[doc = " Callback called when the rectangle in the window where the content\n should be placed has changed."] + pub onContentRectChanged: ::std::option::Option< + unsafe extern "C" fn(activity: *mut GameActivity, rect: *const ARect), + >, } #[test] fn bindgen_test_layout_GameActivityCallbacks() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 72usize, + 76usize, concat!("Size of: ", stringify!(GameActivityCallbacks)) ); assert_eq!( @@ -3422,7 +3349,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { concat!("Alignment of ", stringify!(GameActivityCallbacks)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).onStart as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).onStart) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -3432,7 +3359,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).onResume as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).onResume) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -3442,10 +3369,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onSaveInstanceState as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).onSaveInstanceState) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -3455,7 +3379,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).onPause as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).onPause) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", @@ -3465,7 +3389,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).onStop as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).onStop) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -3475,7 +3399,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).onDestroy as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).onDestroy) as usize - ptr as usize }, 20usize, concat!( "Offset of field: ", @@ -3485,10 +3409,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onWindowFocusChanged as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).onWindowFocusChanged) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -3498,10 +3419,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onNativeWindowCreated as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).onNativeWindowCreated) as usize - ptr as usize }, 28usize, concat!( "Offset of field: ", @@ -3511,10 +3429,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onNativeWindowResized as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).onNativeWindowResized) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -3524,10 +3439,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onNativeWindowRedrawNeeded as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).onNativeWindowRedrawNeeded) as usize - ptr as usize }, 36usize, concat!( "Offset of field: ", @@ -3537,10 +3449,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onNativeWindowDestroyed as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).onNativeWindowDestroyed) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", @@ -3550,10 +3459,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onConfigurationChanged as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).onConfigurationChanged) as usize - ptr as usize }, 44usize, concat!( "Offset of field: ", @@ -3563,9 +3469,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onTrimMemory as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).onTrimMemory) as usize - ptr as usize }, 48usize, concat!( "Offset of field: ", @@ -3575,9 +3479,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onTouchEvent as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).onTouchEvent) as usize - ptr as usize }, 52usize, concat!( "Offset of field: ", @@ -3587,7 +3489,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).onKeyDown as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).onKeyDown) as usize - ptr as usize }, 56usize, concat!( "Offset of field: ", @@ -3597,7 +3499,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).onKeyUp as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).onKeyUp) as usize - ptr as usize }, 60usize, concat!( "Offset of field: ", @@ -3607,9 +3509,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onTextInputEvent as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).onTextInputEvent) as usize - ptr as usize }, 64usize, concat!( "Offset of field: ", @@ -3619,281 +3519,133 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onWindowInsetsChanged as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).onWindowInsetsChanged) as usize - ptr as usize }, 68usize, concat!( "Offset of field: ", stringify!(GameActivityCallbacks), - "::", - stringify!(onWindowInsetsChanged) - ) - ); -} -extern "C" { - #[doc = " \\brief Convert a Java `MotionEvent` to a `GameActivityMotionEvent`."] - #[doc = ""] - #[doc = " This is done automatically by the GameActivity: see `onTouchEvent` to set"] - #[doc = " a callback to consume the received events."] - #[doc = " This function can be used if you re-implement events handling in your own"] - #[doc = " activity. On return, the out_event->historicalStart will be zero, and should"] - #[doc = " be updated to index into whatever buffer out_historical is copied."] - #[doc = " On return the length of out_historical is"] - #[doc = " (out_event->pointerCount x out_event->historicalCount) and is in a"] - #[doc = " pointer-major order (i.e. all axis for a pointer are contiguous)"] - #[doc = " Ownership of out_event is maintained by the caller."] - pub fn GameActivityMotionEvent_fromJava( - env: *mut JNIEnv, - motionEvent: jobject, - out_event: *mut GameActivityMotionEvent, - out_historical: *mut GameActivityHistoricalPointerAxes, - ) -> ::std::os::raw::c_int; -} -extern "C" { - #[doc = " \\brief Convert a Java `KeyEvent` to a `GameActivityKeyEvent`."] - #[doc = ""] - #[doc = " This is done automatically by the GameActivity: see `onKeyUp` and `onKeyDown`"] - #[doc = " to set a callback to consume the received events."] - #[doc = " This function can be used if you re-implement events handling in your own"] - #[doc = " activity."] - #[doc = " Ownership of out_event is maintained by the caller."] - pub fn GameActivityKeyEvent_fromJava( - env: *mut JNIEnv, - motionEvent: jobject, - out_event: *mut GameActivityKeyEvent, + "::", + stringify!(onWindowInsetsChanged) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).onContentRectChanged) as usize - ptr as usize }, + 72usize, + concat!( + "Offset of field: ", + stringify!(GameActivityCallbacks), + "::", + stringify!(onContentRectChanged) + ) ); } -#[doc = " This is the function that must be in the native code to instantiate the"] -#[doc = " application's native activity. It is called with the activity instance (see"] -#[doc = " above); if the code is being instantiated from a previously saved instance,"] -#[doc = " the savedState will be non-NULL and point to the saved data. You must make"] -#[doc = " any copy of this data you need -- it will be released after you return from"] -#[doc = " this function."] +#[doc = " This is the function that must be in the native code to instantiate the\n application's native activity. It is called with the activity instance (see\n above); if the code is being instantiated from a previously saved instance,\n the savedState will be non-NULL and point to the saved data. You must make\n any copy of this data you need -- it will be released after you return from\n this function."] pub type GameActivity_createFunc = ::std::option::Option< unsafe extern "C" fn( activity: *mut GameActivity, savedState: *mut ::std::os::raw::c_void, - savedStateSize: size_t, + savedStateSize: usize, ), >; extern "C" { - #[doc = " Finish the given activity. Its finish() method will be called, causing it"] - #[doc = " to be stopped and destroyed. Note that this method can be called from"] - #[doc = " *any* thread; it will send a message to the main thread of the process"] - #[doc = " where the Java finish call will take place."] + #[doc = " Finish the given activity. Its finish() method will be called, causing it\n to be stopped and destroyed. Note that this method can be called from\n *any* thread; it will send a message to the main thread of the process\n where the Java finish call will take place."] pub fn GameActivity_finish(activity: *mut GameActivity); } -#[doc = " As long as this window is visible to the user, allow the lock"] -#[doc = " screen to activate while the screen is on. This can be used"] -#[doc = " independently, or in combination with {@link"] -#[doc = " GAMEACTIVITY_FLAG_KEEP_SCREEN_ON} and/or {@link"] -#[doc = " GAMEACTIVITY_FLAG_SHOW_WHEN_LOCKED}"] +#[doc = " As long as this window is visible to the user, allow the lock\n screen to activate while the screen is on. This can be used\n independently, or in combination with {@link\n GAMEACTIVITY_FLAG_KEEP_SCREEN_ON} and/or {@link\n GAMEACTIVITY_FLAG_SHOW_WHEN_LOCKED}"] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_ALLOW_LOCK_WHILE_SCREEN_ON: GameActivitySetWindowFlags = 1; #[doc = " Everything behind this window will be dimmed."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_DIM_BEHIND: GameActivitySetWindowFlags = 2; -#[doc = " Blur everything behind this window."] -#[doc = " @deprecated Blurring is no longer supported."] +#[doc = " Blur everything behind this window.\n @deprecated Blurring is no longer supported."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_BLUR_BEHIND: GameActivitySetWindowFlags = 4; -#[doc = " This window won't ever get key input focus, so the"] -#[doc = " user can not send key or other button events to it. Those will"] -#[doc = " instead go to whatever focusable window is behind it. This flag"] -#[doc = " will also enable {@link GAMEACTIVITY_FLAG_NOT_TOUCH_MODAL} whether or not"] -#[doc = " that is explicitly set."] -#[doc = ""] -#[doc = " Setting this flag also implies that the window will not need to"] -#[doc = " interact with"] -#[doc = " a soft input method, so it will be Z-ordered and positioned"] -#[doc = " independently of any active input method (typically this means it"] -#[doc = " gets Z-ordered on top of the input method, so it can use the full"] -#[doc = " screen for its content and cover the input method if needed. You"] -#[doc = " can use {@link GAMEACTIVITY_FLAG_ALT_FOCUSABLE_IM} to modify this"] -#[doc = " behavior."] +#[doc = " This window won't ever get key input focus, so the\n user can not send key or other button events to it. Those will\n instead go to whatever focusable window is behind it. This flag\n will also enable {@link GAMEACTIVITY_FLAG_NOT_TOUCH_MODAL} whether or not\n that is explicitly set.\n\n Setting this flag also implies that the window will not need to\n interact with\n a soft input method, so it will be Z-ordered and positioned\n independently of any active input method (typically this means it\n gets Z-ordered on top of the input method, so it can use the full\n screen for its content and cover the input method if needed. You\n can use {@link GAMEACTIVITY_FLAG_ALT_FOCUSABLE_IM} to modify this\n behavior."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_NOT_FOCUSABLE: GameActivitySetWindowFlags = 8; #[doc = " This window can never receive touch events."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_NOT_TOUCHABLE: GameActivitySetWindowFlags = 16; -#[doc = " Even when this window is focusable (its"] -#[doc = " {@link GAMEACTIVITY_FLAG_NOT_FOCUSABLE} is not set), allow any pointer"] -#[doc = " events outside of the window to be sent to the windows behind it."] -#[doc = " Otherwise it will consume all pointer events itself, regardless of"] -#[doc = " whether they are inside of the window."] +#[doc = " Even when this window is focusable (its\n {@link GAMEACTIVITY_FLAG_NOT_FOCUSABLE} is not set), allow any pointer\n events outside of the window to be sent to the windows behind it.\n Otherwise it will consume all pointer events itself, regardless of\n whether they are inside of the window."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_NOT_TOUCH_MODAL: GameActivitySetWindowFlags = 32; -#[doc = " When set, if the device is asleep when the touch"] -#[doc = " screen is pressed, you will receive this first touch event. Usually"] -#[doc = " the first touch event is consumed by the system since the user can"] -#[doc = " not see what they are pressing on."] -#[doc = ""] -#[doc = " @deprecated This flag has no effect."] +#[doc = " When set, if the device is asleep when the touch\n screen is pressed, you will receive this first touch event. Usually\n the first touch event is consumed by the system since the user can\n not see what they are pressing on.\n\n @deprecated This flag has no effect."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_TOUCHABLE_WHEN_WAKING: GameActivitySetWindowFlags = 64; -#[doc = " As long as this window is visible to the user, keep"] -#[doc = " the device's screen turned on and bright."] +#[doc = " As long as this window is visible to the user, keep\n the device's screen turned on and bright."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_KEEP_SCREEN_ON: GameActivitySetWindowFlags = 128; -#[doc = " Place the window within the entire screen, ignoring"] -#[doc = " decorations around the border (such as the status bar). The"] -#[doc = " window must correctly position its contents to take the screen"] -#[doc = " decoration into account."] +#[doc = " Place the window within the entire screen, ignoring\n decorations around the border (such as the status bar). The\n window must correctly position its contents to take the screen\n decoration into account."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_LAYOUT_IN_SCREEN: GameActivitySetWindowFlags = 256; #[doc = " Allows the window to extend outside of the screen."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_LAYOUT_NO_LIMITS: GameActivitySetWindowFlags = 512; -#[doc = " Hide all screen decorations (such as the status"] -#[doc = " bar) while this window is displayed. This allows the window to"] -#[doc = " use the entire display space for itself -- the status bar will"] -#[doc = " be hidden when an app window with this flag set is on the top"] -#[doc = " layer. A fullscreen window will ignore a value of {@link"] -#[doc = " GAMEACTIVITY_SOFT_INPUT_ADJUST_RESIZE}; the window will stay"] -#[doc = " fullscreen and will not resize."] +#[doc = " Hide all screen decorations (such as the status\n bar) while this window is displayed. This allows the window to\n use the entire display space for itself -- the status bar will\n be hidden when an app window with this flag set is on the top\n layer. A fullscreen window will ignore a value of {@link\n GAMEACTIVITY_SOFT_INPUT_ADJUST_RESIZE}; the window will stay\n fullscreen and will not resize."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_FULLSCREEN: GameActivitySetWindowFlags = 1024; -#[doc = " Override {@link GAMEACTIVITY_FLAG_FULLSCREEN} and force the"] -#[doc = " screen decorations (such as the status bar) to be shown."] +#[doc = " Override {@link GAMEACTIVITY_FLAG_FULLSCREEN} and force the\n screen decorations (such as the status bar) to be shown."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_FORCE_NOT_FULLSCREEN: GameActivitySetWindowFlags = 2048; -#[doc = " Turn on dithering when compositing this window to"] -#[doc = " the screen."] -#[doc = " @deprecated This flag is no longer used."] +#[doc = " Turn on dithering when compositing this window to\n the screen.\n @deprecated This flag is no longer used."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_DITHER: GameActivitySetWindowFlags = 4096; -#[doc = " Treat the content of the window as secure, preventing"] -#[doc = " it from appearing in screenshots or from being viewed on non-secure"] -#[doc = " displays."] +#[doc = " Treat the content of the window as secure, preventing\n it from appearing in screenshots or from being viewed on non-secure\n displays."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_SECURE: GameActivitySetWindowFlags = 8192; -#[doc = " A special mode where the layout parameters are used"] -#[doc = " to perform scaling of the surface when it is composited to the"] -#[doc = " screen."] +#[doc = " A special mode where the layout parameters are used\n to perform scaling of the surface when it is composited to the\n screen."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_SCALED: GameActivitySetWindowFlags = 16384; -#[doc = " Intended for windows that will often be used when the user is"] -#[doc = " holding the screen against their face, it will aggressively"] -#[doc = " filter the event stream to prevent unintended presses in this"] -#[doc = " situation that may not be desired for a particular window, when"] -#[doc = " such an event stream is detected, the application will receive"] -#[doc = " a {@link AMOTION_EVENT_ACTION_CANCEL} to indicate this so"] -#[doc = " applications can handle this accordingly by taking no action on"] -#[doc = " the event until the finger is released."] +#[doc = " Intended for windows that will often be used when the user is\n holding the screen against their face, it will aggressively\n filter the event stream to prevent unintended presses in this\n situation that may not be desired for a particular window, when\n such an event stream is detected, the application will receive\n a {@link AMOTION_EVENT_ACTION_CANCEL} to indicate this so\n applications can handle this accordingly by taking no action on\n the event until the finger is released."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_IGNORE_CHEEK_PRESSES: GameActivitySetWindowFlags = 32768; -#[doc = " A special option only for use in combination with"] -#[doc = " {@link GAMEACTIVITY_FLAG_LAYOUT_IN_SCREEN}. When requesting layout in"] -#[doc = " the screen your window may appear on top of or behind screen decorations"] -#[doc = " such as the status bar. By also including this flag, the window"] -#[doc = " manager will report the inset rectangle needed to ensure your"] -#[doc = " content is not covered by screen decorations."] +#[doc = " A special option only for use in combination with\n {@link GAMEACTIVITY_FLAG_LAYOUT_IN_SCREEN}. When requesting layout in\n the screen your window may appear on top of or behind screen decorations\n such as the status bar. By also including this flag, the window\n manager will report the inset rectangle needed to ensure your\n content is not covered by screen decorations."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_LAYOUT_INSET_DECOR: GameActivitySetWindowFlags = 65536; -#[doc = " Invert the state of {@link GAMEACTIVITY_FLAG_NOT_FOCUSABLE} with"] -#[doc = " respect to how this window interacts with the current method."] -#[doc = " That is, if FLAG_NOT_FOCUSABLE is set and this flag is set,"] -#[doc = " then the window will behave as if it needs to interact with the"] -#[doc = " input method and thus be placed behind/away from it; if {@link"] -#[doc = " GAMEACTIVITY_FLAG_NOT_FOCUSABLE} is not set and this flag is set,"] -#[doc = " then the window will behave as if it doesn't need to interact"] -#[doc = " with the input method and can be placed to use more space and"] -#[doc = " cover the input method."] +#[doc = " Invert the state of {@link GAMEACTIVITY_FLAG_NOT_FOCUSABLE} with\n respect to how this window interacts with the current method.\n That is, if FLAG_NOT_FOCUSABLE is set and this flag is set,\n then the window will behave as if it needs to interact with the\n input method and thus be placed behind/away from it; if {@link\n GAMEACTIVITY_FLAG_NOT_FOCUSABLE} is not set and this flag is set,\n then the window will behave as if it doesn't need to interact\n with the input method and can be placed to use more space and\n cover the input method."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_ALT_FOCUSABLE_IM: GameActivitySetWindowFlags = 131072; -#[doc = " If you have set {@link GAMEACTIVITY_FLAG_NOT_TOUCH_MODAL}, you"] -#[doc = " can set this flag to receive a single special MotionEvent with"] -#[doc = " the action"] -#[doc = " {@link AMOTION_EVENT_ACTION_OUTSIDE} for"] -#[doc = " touches that occur outside of your window. Note that you will not"] -#[doc = " receive the full down/move/up gesture, only the location of the"] -#[doc = " first down as an {@link AMOTION_EVENT_ACTION_OUTSIDE}."] +#[doc = " If you have set {@link GAMEACTIVITY_FLAG_NOT_TOUCH_MODAL}, you\n can set this flag to receive a single special MotionEvent with\n the action\n {@link AMOTION_EVENT_ACTION_OUTSIDE} for\n touches that occur outside of your window. Note that you will not\n receive the full down/move/up gesture, only the location of the\n first down as an {@link AMOTION_EVENT_ACTION_OUTSIDE}."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_WATCH_OUTSIDE_TOUCH: GameActivitySetWindowFlags = 262144; -#[doc = " Special flag to let windows be shown when the screen"] -#[doc = " is locked. This will let application windows take precedence over"] -#[doc = " key guard or any other lock screens. Can be used with"] -#[doc = " {@link GAMEACTIVITY_FLAG_KEEP_SCREEN_ON} to turn screen on and display"] -#[doc = " windows directly before showing the key guard window. Can be used with"] -#[doc = " {@link GAMEACTIVITY_FLAG_DISMISS_KEYGUARD} to automatically fully"] -#[doc = " dismisss non-secure keyguards. This flag only applies to the top-most"] -#[doc = " full-screen window."] +#[doc = " Special flag to let windows be shown when the screen\n is locked. This will let application windows take precedence over\n key guard or any other lock screens. Can be used with\n {@link GAMEACTIVITY_FLAG_KEEP_SCREEN_ON} to turn screen on and display\n windows directly before showing the key guard window. Can be used with\n {@link GAMEACTIVITY_FLAG_DISMISS_KEYGUARD} to automatically fully\n dismisss non-secure keyguards. This flag only applies to the top-most\n full-screen window."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_SHOW_WHEN_LOCKED: GameActivitySetWindowFlags = 524288; -#[doc = " Ask that the system wallpaper be shown behind"] -#[doc = " your window. The window surface must be translucent to be able"] -#[doc = " to actually see the wallpaper behind it; this flag just ensures"] -#[doc = " that the wallpaper surface will be there if this window actually"] -#[doc = " has translucent regions."] +#[doc = " Ask that the system wallpaper be shown behind\n your window. The window surface must be translucent to be able\n to actually see the wallpaper behind it; this flag just ensures\n that the wallpaper surface will be there if this window actually\n has translucent regions."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_SHOW_WALLPAPER: GameActivitySetWindowFlags = 1048576; -#[doc = " When set as a window is being added or made"] -#[doc = " visible, once the window has been shown then the system will"] -#[doc = " poke the power manager's user activity (as if the user had woken"] -#[doc = " up the device) to turn the screen on."] +#[doc = " When set as a window is being added or made\n visible, once the window has been shown then the system will\n poke the power manager's user activity (as if the user had woken\n up the device) to turn the screen on."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_TURN_SCREEN_ON: GameActivitySetWindowFlags = 2097152; -#[doc = " When set the window will cause the keyguard to"] -#[doc = " be dismissed, only if it is not a secure lock keyguard. Because such"] -#[doc = " a keyguard is not needed for security, it will never re-appear if"] -#[doc = " the user navigates to another window (in contrast to"] -#[doc = " {@link GAMEACTIVITY_FLAG_SHOW_WHEN_LOCKED}, which will only temporarily"] -#[doc = " hide both secure and non-secure keyguards but ensure they reappear"] -#[doc = " when the user moves to another UI that doesn't hide them)."] -#[doc = " If the keyguard is currently active and is secure (requires an"] -#[doc = " unlock pattern) than the user will still need to confirm it before"] -#[doc = " seeing this window, unless {@link GAMEACTIVITY_FLAG_SHOW_WHEN_LOCKED} has"] -#[doc = " also been set."] +#[doc = " When set the window will cause the keyguard to\n be dismissed, only if it is not a secure lock keyguard. Because such\n a keyguard is not needed for security, it will never re-appear if\n the user navigates to another window (in contrast to\n {@link GAMEACTIVITY_FLAG_SHOW_WHEN_LOCKED}, which will only temporarily\n hide both secure and non-secure keyguards but ensure they reappear\n when the user moves to another UI that doesn't hide them).\n If the keyguard is currently active and is secure (requires an\n unlock pattern) than the user will still need to confirm it before\n seeing this window, unless {@link GAMEACTIVITY_FLAG_SHOW_WHEN_LOCKED} has\n also been set."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_DISMISS_KEYGUARD: GameActivitySetWindowFlags = 4194304; -#[doc = " Flags for GameActivity_setWindowFlags,"] -#[doc = " as per the Java API at android.view.WindowManager.LayoutParams."] +#[doc = " Flags for GameActivity_setWindowFlags,\n as per the Java API at android.view.WindowManager.LayoutParams."] pub type GameActivitySetWindowFlags = ::std::os::raw::c_uint; extern "C" { - #[doc = " Change the window flags of the given activity. Calls getWindow().setFlags()"] - #[doc = " of the given activity."] - #[doc = " Note that some flags must be set before the window decoration is created,"] - #[doc = " see"] - #[doc = " https://developer.android.com/reference/android/view/Window#setFlags(int,%20int)."] - #[doc = " Note also that this method can be called from"] - #[doc = " *any* thread; it will send a message to the main thread of the process"] - #[doc = " where the Java finish call will take place."] + #[doc = " Change the window flags of the given activity. Calls getWindow().setFlags()\n of the given activity.\n Note that some flags must be set before the window decoration is created,\n see\n https://developer.android.com/reference/android/view/Window#setFlags(int,%20int).\n Note also that this method can be called from\n *any* thread; it will send a message to the main thread of the process\n where the Java finish call will take place."] pub fn GameActivity_setWindowFlags( activity: *mut GameActivity, addFlags: u32, removeFlags: u32, ); } -#[doc = " Implicit request to show the input window, not as the result"] -#[doc = " of a direct request by the user."] +#[doc = " Implicit request to show the input window, not as the result\n of a direct request by the user."] pub const GameActivityShowSoftInputFlags_GAMEACTIVITY_SHOW_SOFT_INPUT_IMPLICIT: GameActivityShowSoftInputFlags = 1; -#[doc = " The user has forced the input method open (such as by"] -#[doc = " long-pressing menu) so it should not be closed until they"] -#[doc = " explicitly do so."] +#[doc = " The user has forced the input method open (such as by\n long-pressing menu) so it should not be closed until they\n explicitly do so."] pub const GameActivityShowSoftInputFlags_GAMEACTIVITY_SHOW_SOFT_INPUT_FORCED: GameActivityShowSoftInputFlags = 2; -#[doc = " Flags for GameActivity_showSoftInput; see the Java InputMethodManager"] -#[doc = " API for documentation."] +#[doc = " Flags for GameActivity_showSoftInput; see the Java InputMethodManager\n API for documentation."] pub type GameActivityShowSoftInputFlags = ::std::os::raw::c_uint; extern "C" { - #[doc = " Show the IME while in the given activity. Calls"] - #[doc = " InputMethodManager.showSoftInput() for the given activity. Note that this"] - #[doc = " method can be called from *any* thread; it will send a message to the main"] - #[doc = " thread of the process where the Java call will take place."] + #[doc = " Show the IME while in the given activity. Calls\n InputMethodManager.showSoftInput() for the given activity. Note that this\n method can be called from *any* thread; it will send a message to the main\n thread of the process where the Java call will take place."] pub fn GameActivity_showSoftInput(activity: *mut GameActivity, flags: u32); } extern "C" { - #[doc = " Set the text entry state (see documentation of the GameTextInputState struct"] - #[doc = " in the Game Text Input library reference)."] - #[doc = ""] - #[doc = " Ownership of the state is maintained by the caller."] + #[doc = " Set the text entry state (see documentation of the GameTextInputState struct\n in the Game Text Input library reference).\n\n Ownership of the state is maintained by the caller."] pub fn GameActivity_setTextInputState( activity: *mut GameActivity, state: *const GameTextInputState, ); } extern "C" { - #[doc = " Get the last-received text entry state (see documentation of the"] - #[doc = " GameTextInputState struct in the Game Text Input library reference)."] - #[doc = ""] + #[doc = " Get the last-received text entry state (see documentation of the\n GameTextInputState struct in the Game Text Input library reference).\n"] pub fn GameActivity_getTextInputState( activity: *mut GameActivity, callback: GameTextInputGetStateCallback, @@ -3904,29 +3656,20 @@ extern "C" { #[doc = " Get a pointer to the GameTextInput library instance."] pub fn GameActivity_getTextInput(activity: *const GameActivity) -> *mut GameTextInput; } -#[doc = " The soft input window should only be hidden if it was not"] -#[doc = " explicitly shown by the user."] +#[doc = " The soft input window should only be hidden if it was not\n explicitly shown by the user."] pub const GameActivityHideSoftInputFlags_GAMEACTIVITY_HIDE_SOFT_INPUT_IMPLICIT_ONLY: GameActivityHideSoftInputFlags = 1; -#[doc = " The soft input window should normally be hidden, unless it was"] -#[doc = " originally shown with {@link GAMEACTIVITY_SHOW_SOFT_INPUT_FORCED}."] +#[doc = " The soft input window should normally be hidden, unless it was\n originally shown with {@link GAMEACTIVITY_SHOW_SOFT_INPUT_FORCED}."] pub const GameActivityHideSoftInputFlags_GAMEACTIVITY_HIDE_SOFT_INPUT_NOT_ALWAYS: GameActivityHideSoftInputFlags = 2; -#[doc = " Flags for GameActivity_hideSoftInput; see the Java InputMethodManager"] -#[doc = " API for documentation."] +#[doc = " Flags for GameActivity_hideSoftInput; see the Java InputMethodManager\n API for documentation."] pub type GameActivityHideSoftInputFlags = ::std::os::raw::c_uint; extern "C" { - #[doc = " Hide the IME while in the given activity. Calls"] - #[doc = " InputMethodManager.hideSoftInput() for the given activity. Note that this"] - #[doc = " method can be called from *any* thread; it will send a message to the main"] - #[doc = " thread of the process where the Java finish call will take place."] + #[doc = " Hide the IME while in the given activity. Calls\n InputMethodManager.hideSoftInput() for the given activity. Note that this\n method can be called from *any* thread; it will send a message to the main\n thread of the process where the Java finish call will take place."] pub fn GameActivity_hideSoftInput(activity: *mut GameActivity, flags: u32); } extern "C" { - #[doc = " Get the current window insets of the particular component. See"] - #[doc = " https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type"] - #[doc = " for more details."] - #[doc = " You can use these insets to influence what you show on the screen."] + #[doc = " Get the current window insets of the particular component. See\n https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type\n for more details.\n You can use these insets to influence what you show on the screen."] pub fn GameActivity_getWindowInsets( activity: *mut GameActivity, type_: GameCommonInsetsType, @@ -3934,14 +3677,7 @@ extern "C" { ); } extern "C" { - #[doc = " Set options on how the IME behaves when it is requested for text input."] - #[doc = " See"] - #[doc = " https://developer.android.com/reference/android/view/inputmethod/EditorInfo"] - #[doc = " for the meaning of inputType, actionId and imeOptions."] - #[doc = ""] - #[doc = " Note that this function will attach the current thread to the JVM if it is"] - #[doc = " not already attached, so the caller must detach the thread from the JVM"] - #[doc = " before the thread is destroyed using DetachCurrentThread."] + #[doc = " Set options on how the IME behaves when it is requested for text input.\n See\n https://developer.android.com/reference/android/view/inputmethod/EditorInfo\n for the meaning of inputType, actionId and imeOptions.\n\n Note that this function will attach the current thread to the JVM if it is\n not already attached, so the caller must detach the thread from the JVM\n before the thread is destroyed using DetachCurrentThread."] pub fn GameActivity_setImeEditorInfo( activity: *mut GameActivity, inputType: ::std::os::raw::c_int, @@ -3949,92 +3685,152 @@ extern "C" { imeOptions: ::std::os::raw::c_int, ); } -pub const ACONFIGURATION_ORIENTATION_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_ORIENTATION_PORT: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_ORIENTATION_LAND: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_ORIENTATION_SQUARE: ::std::os::raw::c_uint = 3; -pub const ACONFIGURATION_TOUCHSCREEN_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_TOUCHSCREEN_NOTOUCH: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_TOUCHSCREEN_STYLUS: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_TOUCHSCREEN_FINGER: ::std::os::raw::c_uint = 3; -pub const ACONFIGURATION_DENSITY_DEFAULT: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_DENSITY_LOW: ::std::os::raw::c_uint = 120; -pub const ACONFIGURATION_DENSITY_MEDIUM: ::std::os::raw::c_uint = 160; -pub const ACONFIGURATION_DENSITY_TV: ::std::os::raw::c_uint = 213; -pub const ACONFIGURATION_DENSITY_HIGH: ::std::os::raw::c_uint = 240; -pub const ACONFIGURATION_DENSITY_XHIGH: ::std::os::raw::c_uint = 320; -pub const ACONFIGURATION_DENSITY_XXHIGH: ::std::os::raw::c_uint = 480; -pub const ACONFIGURATION_DENSITY_XXXHIGH: ::std::os::raw::c_uint = 640; -pub const ACONFIGURATION_DENSITY_ANY: ::std::os::raw::c_uint = 65534; -pub const ACONFIGURATION_DENSITY_NONE: ::std::os::raw::c_uint = 65535; -pub const ACONFIGURATION_KEYBOARD_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_KEYBOARD_NOKEYS: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_KEYBOARD_QWERTY: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_KEYBOARD_12KEY: ::std::os::raw::c_uint = 3; -pub const ACONFIGURATION_NAVIGATION_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_NAVIGATION_NONAV: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_NAVIGATION_DPAD: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_NAVIGATION_TRACKBALL: ::std::os::raw::c_uint = 3; -pub const ACONFIGURATION_NAVIGATION_WHEEL: ::std::os::raw::c_uint = 4; -pub const ACONFIGURATION_KEYSHIDDEN_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_KEYSHIDDEN_NO: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_KEYSHIDDEN_YES: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_KEYSHIDDEN_SOFT: ::std::os::raw::c_uint = 3; -pub const ACONFIGURATION_NAVHIDDEN_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_NAVHIDDEN_NO: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_NAVHIDDEN_YES: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_SCREENSIZE_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_SCREENSIZE_SMALL: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_SCREENSIZE_NORMAL: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_SCREENSIZE_LARGE: ::std::os::raw::c_uint = 3; -pub const ACONFIGURATION_SCREENSIZE_XLARGE: ::std::os::raw::c_uint = 4; -pub const ACONFIGURATION_SCREENLONG_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_SCREENLONG_NO: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_SCREENLONG_YES: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_SCREENROUND_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_SCREENROUND_NO: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_SCREENROUND_YES: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_WIDE_COLOR_GAMUT_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_WIDE_COLOR_GAMUT_NO: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_WIDE_COLOR_GAMUT_YES: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_HDR_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_HDR_NO: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_HDR_YES: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_UI_MODE_TYPE_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_UI_MODE_TYPE_NORMAL: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_UI_MODE_TYPE_DESK: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_UI_MODE_TYPE_CAR: ::std::os::raw::c_uint = 3; -pub const ACONFIGURATION_UI_MODE_TYPE_TELEVISION: ::std::os::raw::c_uint = 4; -pub const ACONFIGURATION_UI_MODE_TYPE_APPLIANCE: ::std::os::raw::c_uint = 5; -pub const ACONFIGURATION_UI_MODE_TYPE_WATCH: ::std::os::raw::c_uint = 6; -pub const ACONFIGURATION_UI_MODE_TYPE_VR_HEADSET: ::std::os::raw::c_uint = 7; -pub const ACONFIGURATION_UI_MODE_NIGHT_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_UI_MODE_NIGHT_NO: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_UI_MODE_NIGHT_YES: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_SCREEN_WIDTH_DP_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_SCREEN_HEIGHT_DP_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_SMALLEST_SCREEN_WIDTH_DP_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_LAYOUTDIR_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_LAYOUTDIR_LTR: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_LAYOUTDIR_RTL: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_MCC: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_MNC: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_LOCALE: ::std::os::raw::c_uint = 4; -pub const ACONFIGURATION_TOUCHSCREEN: ::std::os::raw::c_uint = 8; -pub const ACONFIGURATION_KEYBOARD: ::std::os::raw::c_uint = 16; -pub const ACONFIGURATION_KEYBOARD_HIDDEN: ::std::os::raw::c_uint = 32; -pub const ACONFIGURATION_NAVIGATION: ::std::os::raw::c_uint = 64; -pub const ACONFIGURATION_ORIENTATION: ::std::os::raw::c_uint = 128; -pub const ACONFIGURATION_DENSITY: ::std::os::raw::c_uint = 256; -pub const ACONFIGURATION_SCREEN_SIZE: ::std::os::raw::c_uint = 512; -pub const ACONFIGURATION_VERSION: ::std::os::raw::c_uint = 1024; -pub const ACONFIGURATION_SCREEN_LAYOUT: ::std::os::raw::c_uint = 2048; -pub const ACONFIGURATION_UI_MODE: ::std::os::raw::c_uint = 4096; -pub const ACONFIGURATION_SMALLEST_SCREEN_SIZE: ::std::os::raw::c_uint = 8192; -pub const ACONFIGURATION_LAYOUTDIR: ::std::os::raw::c_uint = 16384; -pub const ACONFIGURATION_SCREEN_ROUND: ::std::os::raw::c_uint = 32768; -pub const ACONFIGURATION_COLOR_MODE: ::std::os::raw::c_uint = 65536; -pub const ACONFIGURATION_MNC_ZERO: ::std::os::raw::c_uint = 65535; +extern "C" { + #[doc = " These are getters for Configuration class members. They may be called from\n any thread."] + pub fn GameActivity_getOrientation(activity: *mut GameActivity) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getColorMode(activity: *mut GameActivity) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getDensityDpi(activity: *mut GameActivity) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getFontScale(activity: *mut GameActivity) -> f32; +} +extern "C" { + pub fn GameActivity_getFontWeightAdjustment( + activity: *mut GameActivity, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getHardKeyboardHidden(activity: *mut GameActivity) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getKeyboard(activity: *mut GameActivity) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getKeyboardHidden(activity: *mut GameActivity) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getMcc(activity: *mut GameActivity) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getMnc(activity: *mut GameActivity) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getNavigation(activity: *mut GameActivity) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getNavigationHidden(activity: *mut GameActivity) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getScreenHeightDp(activity: *mut GameActivity) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getScreenLayout(activity: *mut GameActivity) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getScreenWidthDp(activity: *mut GameActivity) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getSmallestScreenWidthDp( + activity: *mut GameActivity, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getTouchscreen(activity: *mut GameActivity) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getUIMode(activity: *mut GameActivity) -> ::std::os::raw::c_int; +} +pub const ACONFIGURATION_ORIENTATION_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_ORIENTATION_PORT: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_ORIENTATION_LAND: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_ORIENTATION_SQUARE: _bindgen_ty_21 = 3; +pub const ACONFIGURATION_TOUCHSCREEN_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_TOUCHSCREEN_NOTOUCH: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_TOUCHSCREEN_STYLUS: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_TOUCHSCREEN_FINGER: _bindgen_ty_21 = 3; +pub const ACONFIGURATION_DENSITY_DEFAULT: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_DENSITY_LOW: _bindgen_ty_21 = 120; +pub const ACONFIGURATION_DENSITY_MEDIUM: _bindgen_ty_21 = 160; +pub const ACONFIGURATION_DENSITY_TV: _bindgen_ty_21 = 213; +pub const ACONFIGURATION_DENSITY_HIGH: _bindgen_ty_21 = 240; +pub const ACONFIGURATION_DENSITY_XHIGH: _bindgen_ty_21 = 320; +pub const ACONFIGURATION_DENSITY_XXHIGH: _bindgen_ty_21 = 480; +pub const ACONFIGURATION_DENSITY_XXXHIGH: _bindgen_ty_21 = 640; +pub const ACONFIGURATION_DENSITY_ANY: _bindgen_ty_21 = 65534; +pub const ACONFIGURATION_DENSITY_NONE: _bindgen_ty_21 = 65535; +pub const ACONFIGURATION_KEYBOARD_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_KEYBOARD_NOKEYS: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_KEYBOARD_QWERTY: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_KEYBOARD_12KEY: _bindgen_ty_21 = 3; +pub const ACONFIGURATION_NAVIGATION_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_NAVIGATION_NONAV: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_NAVIGATION_DPAD: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_NAVIGATION_TRACKBALL: _bindgen_ty_21 = 3; +pub const ACONFIGURATION_NAVIGATION_WHEEL: _bindgen_ty_21 = 4; +pub const ACONFIGURATION_KEYSHIDDEN_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_KEYSHIDDEN_NO: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_KEYSHIDDEN_YES: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_KEYSHIDDEN_SOFT: _bindgen_ty_21 = 3; +pub const ACONFIGURATION_NAVHIDDEN_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_NAVHIDDEN_NO: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_NAVHIDDEN_YES: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_SCREENSIZE_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_SCREENSIZE_SMALL: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_SCREENSIZE_NORMAL: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_SCREENSIZE_LARGE: _bindgen_ty_21 = 3; +pub const ACONFIGURATION_SCREENSIZE_XLARGE: _bindgen_ty_21 = 4; +pub const ACONFIGURATION_SCREENLONG_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_SCREENLONG_NO: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_SCREENLONG_YES: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_SCREENROUND_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_SCREENROUND_NO: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_SCREENROUND_YES: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_WIDE_COLOR_GAMUT_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_WIDE_COLOR_GAMUT_NO: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_WIDE_COLOR_GAMUT_YES: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_HDR_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_HDR_NO: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_HDR_YES: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_UI_MODE_TYPE_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_UI_MODE_TYPE_NORMAL: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_UI_MODE_TYPE_DESK: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_UI_MODE_TYPE_CAR: _bindgen_ty_21 = 3; +pub const ACONFIGURATION_UI_MODE_TYPE_TELEVISION: _bindgen_ty_21 = 4; +pub const ACONFIGURATION_UI_MODE_TYPE_APPLIANCE: _bindgen_ty_21 = 5; +pub const ACONFIGURATION_UI_MODE_TYPE_WATCH: _bindgen_ty_21 = 6; +pub const ACONFIGURATION_UI_MODE_TYPE_VR_HEADSET: _bindgen_ty_21 = 7; +pub const ACONFIGURATION_UI_MODE_NIGHT_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_UI_MODE_NIGHT_NO: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_UI_MODE_NIGHT_YES: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_SCREEN_WIDTH_DP_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_SCREEN_HEIGHT_DP_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_SMALLEST_SCREEN_WIDTH_DP_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_LAYOUTDIR_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_LAYOUTDIR_LTR: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_LAYOUTDIR_RTL: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_MCC: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_MNC: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_LOCALE: _bindgen_ty_21 = 4; +pub const ACONFIGURATION_TOUCHSCREEN: _bindgen_ty_21 = 8; +pub const ACONFIGURATION_KEYBOARD: _bindgen_ty_21 = 16; +pub const ACONFIGURATION_KEYBOARD_HIDDEN: _bindgen_ty_21 = 32; +pub const ACONFIGURATION_NAVIGATION: _bindgen_ty_21 = 64; +pub const ACONFIGURATION_ORIENTATION: _bindgen_ty_21 = 128; +pub const ACONFIGURATION_DENSITY: _bindgen_ty_21 = 256; +pub const ACONFIGURATION_SCREEN_SIZE: _bindgen_ty_21 = 512; +pub const ACONFIGURATION_VERSION: _bindgen_ty_21 = 1024; +pub const ACONFIGURATION_SCREEN_LAYOUT: _bindgen_ty_21 = 2048; +pub const ACONFIGURATION_UI_MODE: _bindgen_ty_21 = 4096; +pub const ACONFIGURATION_SMALLEST_SCREEN_SIZE: _bindgen_ty_21 = 8192; +pub const ACONFIGURATION_LAYOUTDIR: _bindgen_ty_21 = 16384; +pub const ACONFIGURATION_SCREEN_ROUND: _bindgen_ty_21 = 32768; +pub const ACONFIGURATION_COLOR_MODE: _bindgen_ty_21 = 65536; +pub const ACONFIGURATION_MNC_ZERO: _bindgen_ty_21 = 65535; pub type _bindgen_ty_21 = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -4045,6 +3841,8 @@ pub struct pollfd { } #[test] fn bindgen_test_layout_pollfd() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 8usize, @@ -4056,7 +3854,7 @@ fn bindgen_test_layout_pollfd() { concat!("Alignment of ", stringify!(pollfd)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).fd as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).fd) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4066,7 +3864,7 @@ fn bindgen_test_layout_pollfd() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).events as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).events) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -4076,7 +3874,7 @@ fn bindgen_test_layout_pollfd() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).revents as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).revents) as usize - ptr as usize }, 6usize, concat!( "Offset of field: ", @@ -4113,6 +3911,8 @@ pub struct sigcontext { } #[test] fn bindgen_test_layout_sigcontext() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 84usize, @@ -4124,7 +3924,7 @@ fn bindgen_test_layout_sigcontext() { concat!("Alignment of ", stringify!(sigcontext)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).trap_no as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).trap_no) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4134,7 +3934,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).error_code as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).error_code) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -4144,7 +3944,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).oldmask as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).oldmask) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -4154,7 +3954,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).arm_r0 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).arm_r0) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", @@ -4164,7 +3964,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).arm_r1 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).arm_r1) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -4174,7 +3974,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).arm_r2 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).arm_r2) as usize - ptr as usize }, 20usize, concat!( "Offset of field: ", @@ -4184,7 +3984,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).arm_r3 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).arm_r3) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -4194,7 +3994,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).arm_r4 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).arm_r4) as usize - ptr as usize }, 28usize, concat!( "Offset of field: ", @@ -4204,7 +4004,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).arm_r5 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).arm_r5) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -4214,7 +4014,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).arm_r6 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).arm_r6) as usize - ptr as usize }, 36usize, concat!( "Offset of field: ", @@ -4224,7 +4024,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).arm_r7 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).arm_r7) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", @@ -4234,7 +4034,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).arm_r8 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).arm_r8) as usize - ptr as usize }, 44usize, concat!( "Offset of field: ", @@ -4244,7 +4044,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).arm_r9 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).arm_r9) as usize - ptr as usize }, 48usize, concat!( "Offset of field: ", @@ -4254,7 +4054,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).arm_r10 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).arm_r10) as usize - ptr as usize }, 52usize, concat!( "Offset of field: ", @@ -4264,7 +4064,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).arm_fp as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).arm_fp) as usize - ptr as usize }, 56usize, concat!( "Offset of field: ", @@ -4274,7 +4074,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).arm_ip as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).arm_ip) as usize - ptr as usize }, 60usize, concat!( "Offset of field: ", @@ -4284,7 +4084,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).arm_sp as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).arm_sp) as usize - ptr as usize }, 64usize, concat!( "Offset of field: ", @@ -4294,7 +4094,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).arm_lr as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).arm_lr) as usize - ptr as usize }, 68usize, concat!( "Offset of field: ", @@ -4304,7 +4104,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).arm_pc as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).arm_pc) as usize - ptr as usize }, 72usize, concat!( "Offset of field: ", @@ -4314,7 +4114,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).arm_cpsr as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).arm_cpsr) as usize - ptr as usize }, 76usize, concat!( "Offset of field: ", @@ -4324,7 +4124,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).fault_address as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).fault_address) as usize - ptr as usize }, 80usize, concat!( "Offset of field: ", @@ -4361,6 +4161,9 @@ pub union __kernel_sigaction__bindgen_ty_1 { } #[test] fn bindgen_test_layout___kernel_sigaction__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit<__kernel_sigaction__bindgen_ty_1> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__kernel_sigaction__bindgen_ty_1>(), 4usize, @@ -4375,10 +4178,7 @@ fn bindgen_test_layout___kernel_sigaction__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__kernel_sigaction__bindgen_ty_1>()))._sa_handler as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._sa_handler) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4388,10 +4188,7 @@ fn bindgen_test_layout___kernel_sigaction__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__kernel_sigaction__bindgen_ty_1>()))._sa_sigaction as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._sa_sigaction) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4403,6 +4200,8 @@ fn bindgen_test_layout___kernel_sigaction__bindgen_ty_1() { } #[test] fn bindgen_test_layout___kernel_sigaction() { + const UNINIT: ::std::mem::MaybeUninit<__kernel_sigaction> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__kernel_sigaction>(), 16usize, @@ -4414,7 +4213,7 @@ fn bindgen_test_layout___kernel_sigaction() { concat!("Alignment of ", stringify!(__kernel_sigaction)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_sigaction>()))._u as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._u) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4424,7 +4223,7 @@ fn bindgen_test_layout___kernel_sigaction() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_sigaction>())).sa_mask as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sa_mask) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -4434,7 +4233,7 @@ fn bindgen_test_layout___kernel_sigaction() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_sigaction>())).sa_flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sa_flags) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -4444,7 +4243,7 @@ fn bindgen_test_layout___kernel_sigaction() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_sigaction>())).sa_restorer as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sa_restorer) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", @@ -4455,13 +4254,16 @@ fn bindgen_test_layout___kernel_sigaction() { ); } #[repr(C)] +#[derive(Debug, Copy, Clone)] pub struct sigaltstack { pub ss_sp: *mut ::std::os::raw::c_void, pub ss_flags: ::std::os::raw::c_int, - pub ss_size: size_t, + pub ss_size: __kernel_size_t, } #[test] fn bindgen_test_layout_sigaltstack() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 12usize, @@ -4473,7 +4275,7 @@ fn bindgen_test_layout_sigaltstack() { concat!("Alignment of ", stringify!(sigaltstack)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ss_sp as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ss_sp) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4483,7 +4285,7 @@ fn bindgen_test_layout_sigaltstack() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ss_flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ss_flags) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -4493,7 +4295,7 @@ fn bindgen_test_layout_sigaltstack() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ss_size as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ss_size) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -4512,6 +4314,8 @@ pub union sigval { } #[test] fn bindgen_test_layout_sigval() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 4usize, @@ -4523,7 +4327,7 @@ fn bindgen_test_layout_sigval() { concat!("Alignment of ", stringify!(sigval)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sival_int as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sival_int) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4533,7 +4337,7 @@ fn bindgen_test_layout_sigval() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sival_ptr as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sival_ptr) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4563,6 +4367,9 @@ pub struct __sifields__bindgen_ty_1 { } #[test] fn bindgen_test_layout___sifields__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_1> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__sifields__bindgen_ty_1>(), 8usize, @@ -4574,7 +4381,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_1() { concat!("Alignment of ", stringify!(__sifields__bindgen_ty_1)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_1>()))._pid as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._pid) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4584,7 +4391,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_1() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_1>()))._uid as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._uid) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -4604,6 +4411,9 @@ pub struct __sifields__bindgen_ty_2 { } #[test] fn bindgen_test_layout___sifields__bindgen_ty_2() { + const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_2> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__sifields__bindgen_ty_2>(), 16usize, @@ -4615,7 +4425,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_2() { concat!("Alignment of ", stringify!(__sifields__bindgen_ty_2)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_2>()))._tid as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._tid) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4625,9 +4435,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_2() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_2>()))._overrun as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._overrun) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -4637,9 +4445,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_2() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_2>()))._sigval as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._sigval) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -4649,9 +4455,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_2() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_2>()))._sys_private as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._sys_private) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", @@ -4670,6 +4474,9 @@ pub struct __sifields__bindgen_ty_3 { } #[test] fn bindgen_test_layout___sifields__bindgen_ty_3() { + const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_3> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__sifields__bindgen_ty_3>(), 12usize, @@ -4681,7 +4488,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_3() { concat!("Alignment of ", stringify!(__sifields__bindgen_ty_3)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_3>()))._pid as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._pid) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4691,7 +4498,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_3() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_3>()))._uid as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._uid) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -4701,9 +4508,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_3() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_3>()))._sigval as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._sigval) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -4724,6 +4529,9 @@ pub struct __sifields__bindgen_ty_4 { } #[test] fn bindgen_test_layout___sifields__bindgen_ty_4() { + const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_4> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__sifields__bindgen_ty_4>(), 20usize, @@ -4735,7 +4543,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_4() { concat!("Alignment of ", stringify!(__sifields__bindgen_ty_4)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_4>()))._pid as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._pid) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4745,7 +4553,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_4() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_4>()))._uid as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._uid) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -4755,9 +4563,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_4() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_4>()))._status as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._status) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -4767,7 +4573,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_4() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_4>()))._utime as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._utime) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", @@ -4777,7 +4583,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_4() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_4>()))._stime as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._stime) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -4796,9 +4602,11 @@ 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)] @@ -4809,6 +4617,9 @@ pub struct __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1 { } #[test] fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1>(), 12usize, @@ -4826,10 +4637,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1>())) - ._dummy_bnd as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._dummy_bnd) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4839,10 +4647,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1>()))._lower - as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._lower) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -4852,10 +4657,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1>()))._upper - as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._upper) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -4873,6 +4675,9 @@ pub struct __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2 { } #[test] fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2() { + const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2>(), 8usize, @@ -4890,10 +4695,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2>())) - ._dummy_pkey as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._dummy_pkey) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4903,10 +4705,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2>()))._pkey - as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._pkey) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -4916,8 +4715,59 @@ 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() { + const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + 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::addr_of!((*ptr)._data) as usize - ptr 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::addr_of!((*ptr)._type) as usize - ptr 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() { + const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_5__bindgen_ty_1> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__sifields__bindgen_ty_5__bindgen_ty_1>(), 12usize, @@ -4935,10 +4785,17 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1>()))._addr_lsb as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._trapno) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__sifields__bindgen_ty_5__bindgen_ty_1), + "::", + stringify!(_trapno) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._addr_lsb) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4948,10 +4805,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1>()))._addr_bnd as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._addr_bnd) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4961,10 +4815,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1>()))._addr_pkey - as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._addr_pkey) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4973,9 +4824,22 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1() { stringify!(_addr_pkey) ) ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._perf) as usize - ptr 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() { + const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_5> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__sifields__bindgen_ty_5>(), 16usize, @@ -4987,7 +4851,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_5() { concat!("Alignment of ", stringify!(__sifields__bindgen_ty_5)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_5>()))._addr as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._addr) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5005,6 +4869,9 @@ pub struct __sifields__bindgen_ty_6 { } #[test] fn bindgen_test_layout___sifields__bindgen_ty_6() { + const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_6> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__sifields__bindgen_ty_6>(), 8usize, @@ -5016,7 +4883,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_6() { concat!("Alignment of ", stringify!(__sifields__bindgen_ty_6)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_6>()))._band as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._band) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5026,7 +4893,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_6() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_6>()))._fd as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._fd) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -5045,6 +4912,9 @@ pub struct __sifields__bindgen_ty_7 { } #[test] fn bindgen_test_layout___sifields__bindgen_ty_7() { + const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_7> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__sifields__bindgen_ty_7>(), 12usize, @@ -5056,9 +4926,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_7() { concat!("Alignment of ", stringify!(__sifields__bindgen_ty_7)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_7>()))._call_addr as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._call_addr) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5068,9 +4936,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_7() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_7>()))._syscall as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._syscall) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -5080,7 +4946,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_7() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_7>()))._arch as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._arch) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -5092,6 +4958,8 @@ fn bindgen_test_layout___sifields__bindgen_ty_7() { } #[test] fn bindgen_test_layout___sifields() { + const UNINIT: ::std::mem::MaybeUninit<__sifields> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__sifields>(), 20usize, @@ -5103,7 +4971,7 @@ fn bindgen_test_layout___sifields() { concat!("Alignment of ", stringify!(__sifields)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields>()))._kill as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._kill) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5113,7 +4981,7 @@ fn bindgen_test_layout___sifields() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields>()))._timer as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._timer) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5123,7 +4991,7 @@ fn bindgen_test_layout___sifields() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields>()))._rt as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._rt) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5133,7 +5001,7 @@ fn bindgen_test_layout___sifields() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields>()))._sigchld as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._sigchld) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5143,7 +5011,7 @@ fn bindgen_test_layout___sifields() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields>()))._sigfault as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._sigfault) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5153,7 +5021,7 @@ fn bindgen_test_layout___sifields() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields>()))._sigpoll as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._sigpoll) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5163,7 +5031,7 @@ fn bindgen_test_layout___sifields() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields>()))._sigsys as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._sigsys) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5194,6 +5062,9 @@ pub struct siginfo__bindgen_ty_1__bindgen_ty_1 { } #[test] fn bindgen_test_layout_siginfo__bindgen_ty_1__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 32usize, @@ -5208,10 +5079,7 @@ fn bindgen_test_layout_siginfo__bindgen_ty_1__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).si_signo as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).si_signo) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5221,10 +5089,7 @@ fn bindgen_test_layout_siginfo__bindgen_ty_1__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).si_errno as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).si_errno) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -5234,10 +5099,7 @@ fn bindgen_test_layout_siginfo__bindgen_ty_1__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).si_code as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).si_code) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -5247,10 +5109,7 @@ fn bindgen_test_layout_siginfo__bindgen_ty_1__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::()))._sifields as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._sifields) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", @@ -5262,6 +5121,9 @@ fn bindgen_test_layout_siginfo__bindgen_ty_1__bindgen_ty_1() { } #[test] fn bindgen_test_layout_siginfo__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 128usize, @@ -5273,7 +5135,7 @@ fn bindgen_test_layout_siginfo__bindgen_ty_1() { concat!("Alignment of ", stringify!(siginfo__bindgen_ty_1)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::()))._si_pad as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._si_pad) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5320,6 +5182,9 @@ pub struct sigevent__bindgen_ty_1__bindgen_ty_1 { } #[test] fn bindgen_test_layout_sigevent__bindgen_ty_1__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 8usize, @@ -5337,10 +5202,7 @@ fn bindgen_test_layout_sigevent__bindgen_ty_1__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::()))._function as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._function) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5350,10 +5212,7 @@ fn bindgen_test_layout_sigevent__bindgen_ty_1__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::()))._attribute as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._attribute) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -5365,6 +5224,9 @@ fn bindgen_test_layout_sigevent__bindgen_ty_1__bindgen_ty_1() { } #[test] fn bindgen_test_layout_sigevent__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 52usize, @@ -5376,7 +5238,7 @@ fn bindgen_test_layout_sigevent__bindgen_ty_1() { concat!("Alignment of ", stringify!(sigevent__bindgen_ty_1)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::()))._pad as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._pad) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5386,7 +5248,7 @@ fn bindgen_test_layout_sigevent__bindgen_ty_1() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::()))._tid as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._tid) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5396,9 +5258,7 @@ fn bindgen_test_layout_sigevent__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::()))._sigev_thread as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._sigev_thread) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5410,6 +5270,8 @@ fn bindgen_test_layout_sigevent__bindgen_ty_1() { } #[test] fn bindgen_test_layout_sigevent() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 64usize, @@ -5421,7 +5283,7 @@ fn bindgen_test_layout_sigevent() { concat!("Alignment of ", stringify!(sigevent)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sigev_value as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sigev_value) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5431,7 +5293,7 @@ fn bindgen_test_layout_sigevent() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sigev_signo as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sigev_signo) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -5441,7 +5303,7 @@ fn bindgen_test_layout_sigevent() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sigev_notify as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sigev_notify) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -5451,7 +5313,7 @@ fn bindgen_test_layout_sigevent() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::()))._sigev_un as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._sigev_un) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", @@ -5472,6 +5334,8 @@ pub struct sigset64_t { } #[test] fn bindgen_test_layout_sigset64_t() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 8usize, @@ -5483,7 +5347,7 @@ fn bindgen_test_layout_sigset64_t() { concat!("Alignment of ", stringify!(sigset64_t)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).__bits as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).__bits) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5515,6 +5379,9 @@ pub union sigaction__bindgen_ty_1 { } #[test] fn bindgen_test_layout_sigaction__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 4usize, @@ -5526,9 +5393,7 @@ fn bindgen_test_layout_sigaction__bindgen_ty_1() { concat!("Alignment of ", stringify!(sigaction__bindgen_ty_1)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).sa_handler as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).sa_handler) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5538,9 +5403,7 @@ fn bindgen_test_layout_sigaction__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).sa_sigaction as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).sa_sigaction) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5552,6 +5415,8 @@ fn bindgen_test_layout_sigaction__bindgen_ty_1() { } #[test] fn bindgen_test_layout_sigaction() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 16usize, @@ -5563,7 +5428,7 @@ fn bindgen_test_layout_sigaction() { concat!("Alignment of ", stringify!(sigaction)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sa_mask as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sa_mask) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -5573,7 +5438,7 @@ fn bindgen_test_layout_sigaction() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sa_flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sa_flags) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -5583,7 +5448,7 @@ fn bindgen_test_layout_sigaction() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sa_restorer as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sa_restorer) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", @@ -5615,6 +5480,9 @@ pub union sigaction64__bindgen_ty_1 { } #[test] fn bindgen_test_layout_sigaction64__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 4usize, @@ -5626,9 +5494,7 @@ fn bindgen_test_layout_sigaction64__bindgen_ty_1() { concat!("Alignment of ", stringify!(sigaction64__bindgen_ty_1)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).sa_handler as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).sa_handler) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5638,9 +5504,7 @@ fn bindgen_test_layout_sigaction64__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).sa_sigaction as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).sa_sigaction) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5652,6 +5516,8 @@ fn bindgen_test_layout_sigaction64__bindgen_ty_1() { } #[test] fn bindgen_test_layout_sigaction64() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 20usize, @@ -5663,7 +5529,7 @@ fn bindgen_test_layout_sigaction64() { concat!("Alignment of ", stringify!(sigaction64)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sa_flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sa_flags) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -5673,7 +5539,7 @@ fn bindgen_test_layout_sigaction64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sa_restorer as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sa_restorer) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -5683,7 +5549,7 @@ fn bindgen_test_layout_sigaction64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sa_mask as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sa_mask) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", @@ -5701,6 +5567,8 @@ pub struct timespec { } #[test] fn bindgen_test_layout_timespec() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 8usize, @@ -5712,7 +5580,7 @@ fn bindgen_test_layout_timespec() { concat!("Alignment of ", stringify!(timespec)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tv_sec as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5722,7 +5590,7 @@ fn bindgen_test_layout_timespec() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tv_nsec as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tv_nsec) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -5883,6 +5751,8 @@ impl user_fpregs_fp_reg { } #[test] fn bindgen_test_layout_user_fpregs() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 116usize, @@ -5894,7 +5764,7 @@ fn bindgen_test_layout_user_fpregs() { concat!("Alignment of ", stringify!(user_fpregs)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).fpregs as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).fpregs) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5904,7 +5774,7 @@ fn bindgen_test_layout_user_fpregs() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ftype as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ftype) as usize - ptr as usize }, 104usize, concat!( "Offset of field: ", @@ -5914,7 +5784,7 @@ fn bindgen_test_layout_user_fpregs() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).init_flag as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).init_flag) as usize - ptr as usize }, 112usize, concat!( "Offset of field: ", @@ -5971,6 +5841,8 @@ pub struct user_regs { } #[test] fn bindgen_test_layout_user_regs() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 72usize, @@ -5982,7 +5854,7 @@ fn bindgen_test_layout_user_regs() { concat!("Alignment of ", stringify!(user_regs)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).uregs as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).uregs) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6000,6 +5872,8 @@ pub struct user_vfp { } #[test] fn bindgen_test_layout_user_vfp() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 264usize, @@ -6011,7 +5885,7 @@ fn bindgen_test_layout_user_vfp() { concat!("Alignment of ", stringify!(user_vfp)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).fpregs as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).fpregs) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6021,7 +5895,7 @@ fn bindgen_test_layout_user_vfp() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).fpscr as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).fpscr) as usize - ptr as usize }, 256usize, concat!( "Offset of field: ", @@ -6040,6 +5914,8 @@ pub struct user_vfp_exc { } #[test] fn bindgen_test_layout_user_vfp_exc() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 12usize, @@ -6051,7 +5927,7 @@ fn bindgen_test_layout_user_vfp_exc() { concat!("Alignment of ", stringify!(user_vfp_exc)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).fpexc as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).fpexc) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6061,7 +5937,7 @@ fn bindgen_test_layout_user_vfp_exc() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).fpinst as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).fpinst) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -6071,7 +5947,7 @@ fn bindgen_test_layout_user_vfp_exc() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).fpinst2 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).fpinst2) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -6102,6 +5978,8 @@ pub struct user { } #[test] fn bindgen_test_layout_user() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 296usize, @@ -6113,7 +5991,7 @@ fn bindgen_test_layout_user() { concat!("Alignment of ", stringify!(user)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).regs as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).regs) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6123,7 +6001,7 @@ fn bindgen_test_layout_user() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).u_fpvalid as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).u_fpvalid) as usize - ptr as usize }, 72usize, concat!( "Offset of field: ", @@ -6133,7 +6011,7 @@ fn bindgen_test_layout_user() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).u_tsize as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).u_tsize) as usize - ptr as usize }, 76usize, concat!( "Offset of field: ", @@ -6143,7 +6021,7 @@ fn bindgen_test_layout_user() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).u_dsize as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).u_dsize) as usize - ptr as usize }, 80usize, concat!( "Offset of field: ", @@ -6153,7 +6031,7 @@ fn bindgen_test_layout_user() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).u_ssize as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).u_ssize) as usize - ptr as usize }, 84usize, concat!( "Offset of field: ", @@ -6163,7 +6041,7 @@ fn bindgen_test_layout_user() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).start_code as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).start_code) as usize - ptr as usize }, 88usize, concat!( "Offset of field: ", @@ -6173,7 +6051,7 @@ fn bindgen_test_layout_user() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).start_stack as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).start_stack) as usize - ptr as usize }, 92usize, concat!( "Offset of field: ", @@ -6183,7 +6061,7 @@ fn bindgen_test_layout_user() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).signal as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).signal) as usize - ptr as usize }, 96usize, concat!( "Offset of field: ", @@ -6193,7 +6071,7 @@ fn bindgen_test_layout_user() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).reserved) as usize - ptr as usize }, 100usize, concat!( "Offset of field: ", @@ -6203,7 +6081,7 @@ fn bindgen_test_layout_user() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).u_ar0 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).u_ar0) as usize - ptr as usize }, 104usize, concat!( "Offset of field: ", @@ -6213,7 +6091,7 @@ fn bindgen_test_layout_user() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).magic as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).magic) as usize - ptr as usize }, 108usize, concat!( "Offset of field: ", @@ -6223,7 +6101,7 @@ fn bindgen_test_layout_user() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).u_comm as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).u_comm) as usize - ptr as usize }, 112usize, concat!( "Offset of field: ", @@ -6233,7 +6111,7 @@ fn bindgen_test_layout_user() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).u_debugreg as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).u_debugreg) as usize - ptr as usize }, 144usize, concat!( "Offset of field: ", @@ -6243,7 +6121,7 @@ fn bindgen_test_layout_user() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).u_fp as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).u_fp) as usize - ptr as usize }, 176usize, concat!( "Offset of field: ", @@ -6253,7 +6131,7 @@ fn bindgen_test_layout_user() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).u_fp0 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).u_fp0) as usize - ptr as usize }, 292usize, concat!( "Offset of field: ", @@ -6263,22 +6141,22 @@ fn bindgen_test_layout_user() { ) ); } -pub const REG_R0: ::std::os::raw::c_uint = 0; -pub const REG_R1: ::std::os::raw::c_uint = 1; -pub const REG_R2: ::std::os::raw::c_uint = 2; -pub const REG_R3: ::std::os::raw::c_uint = 3; -pub const REG_R4: ::std::os::raw::c_uint = 4; -pub const REG_R5: ::std::os::raw::c_uint = 5; -pub const REG_R6: ::std::os::raw::c_uint = 6; -pub const REG_R7: ::std::os::raw::c_uint = 7; -pub const REG_R8: ::std::os::raw::c_uint = 8; -pub const REG_R9: ::std::os::raw::c_uint = 9; -pub const REG_R10: ::std::os::raw::c_uint = 10; -pub const REG_R11: ::std::os::raw::c_uint = 11; -pub const REG_R12: ::std::os::raw::c_uint = 12; -pub const REG_R13: ::std::os::raw::c_uint = 13; -pub const REG_R14: ::std::os::raw::c_uint = 14; -pub const REG_R15: ::std::os::raw::c_uint = 15; +pub const REG_R0: _bindgen_ty_22 = 0; +pub const REG_R1: _bindgen_ty_22 = 1; +pub const REG_R2: _bindgen_ty_22 = 2; +pub const REG_R3: _bindgen_ty_22 = 3; +pub const REG_R4: _bindgen_ty_22 = 4; +pub const REG_R5: _bindgen_ty_22 = 5; +pub const REG_R6: _bindgen_ty_22 = 6; +pub const REG_R7: _bindgen_ty_22 = 7; +pub const REG_R8: _bindgen_ty_22 = 8; +pub const REG_R9: _bindgen_ty_22 = 9; +pub const REG_R10: _bindgen_ty_22 = 10; +pub const REG_R11: _bindgen_ty_22 = 11; +pub const REG_R12: _bindgen_ty_22 = 12; +pub const REG_R13: _bindgen_ty_22 = 13; +pub const REG_R14: _bindgen_ty_22 = 14; +pub const REG_R15: _bindgen_ty_22 = 15; pub type _bindgen_ty_22 = ::std::os::raw::c_uint; pub type greg_t = ::std::os::raw::c_int; pub type gregset_t = [greg_t; 18usize]; @@ -6286,6 +6164,7 @@ pub type fpregset_t = user_fpregs; pub type mcontext_t = sigcontext; #[repr(C)] #[repr(align(8))] +#[derive(Copy, Clone)] pub struct ucontext { pub uc_flags: ::std::os::raw::c_ulong, pub uc_link: *mut ucontext, @@ -6309,6 +6188,9 @@ pub struct ucontext__bindgen_ty_1__bindgen_ty_1 { } #[test] fn bindgen_test_layout_ucontext__bindgen_ty_1__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 8usize, @@ -6326,10 +6208,7 @@ fn bindgen_test_layout_ucontext__bindgen_ty_1__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).uc_sigmask as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).uc_sigmask) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6339,10 +6218,7 @@ fn bindgen_test_layout_ucontext__bindgen_ty_1__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).__padding_rt_sigset - as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).__padding_rt_sigset) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -6354,6 +6230,9 @@ fn bindgen_test_layout_ucontext__bindgen_ty_1__bindgen_ty_1() { } #[test] fn bindgen_test_layout_ucontext__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 8usize, @@ -6365,9 +6244,7 @@ fn bindgen_test_layout_ucontext__bindgen_ty_1() { concat!("Alignment of ", stringify!(ucontext__bindgen_ty_1)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).uc_sigmask64 as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).uc_sigmask64) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6379,6 +6256,8 @@ fn bindgen_test_layout_ucontext__bindgen_ty_1() { } #[test] fn bindgen_test_layout_ucontext() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 744usize, @@ -6390,7 +6269,7 @@ fn bindgen_test_layout_ucontext() { concat!("Alignment of ", stringify!(ucontext)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).uc_flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).uc_flags) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6400,7 +6279,7 @@ fn bindgen_test_layout_ucontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).uc_link as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).uc_link) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -6410,7 +6289,7 @@ fn bindgen_test_layout_ucontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).uc_stack as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).uc_stack) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -6420,7 +6299,7 @@ fn bindgen_test_layout_ucontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).uc_mcontext as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).uc_mcontext) as usize - ptr as usize }, 20usize, concat!( "Offset of field: ", @@ -6430,7 +6309,7 @@ fn bindgen_test_layout_ucontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).__padding as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).__padding) as usize - ptr as usize }, 112usize, concat!( "Offset of field: ", @@ -6440,7 +6319,7 @@ fn bindgen_test_layout_ucontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).uc_regspace as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).uc_regspace) as usize - ptr as usize }, 232usize, concat!( "Offset of field: ", @@ -6654,6 +6533,8 @@ pub struct __kernel_timespec { } #[test] fn bindgen_test_layout___kernel_timespec() { + const UNINIT: ::std::mem::MaybeUninit<__kernel_timespec> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__kernel_timespec>(), 16usize, @@ -6665,7 +6546,7 @@ fn bindgen_test_layout___kernel_timespec() { concat!("Alignment of ", stringify!(__kernel_timespec)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_timespec>())).tv_sec as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6675,7 +6556,7 @@ fn bindgen_test_layout___kernel_timespec() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_timespec>())).tv_nsec as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tv_nsec) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -6693,6 +6574,8 @@ pub struct __kernel_itimerspec { } #[test] fn bindgen_test_layout___kernel_itimerspec() { + const UNINIT: ::std::mem::MaybeUninit<__kernel_itimerspec> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__kernel_itimerspec>(), 32usize, @@ -6704,7 +6587,7 @@ fn bindgen_test_layout___kernel_itimerspec() { concat!("Alignment of ", stringify!(__kernel_itimerspec)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_itimerspec>())).it_interval as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).it_interval) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6714,7 +6597,7 @@ fn bindgen_test_layout___kernel_itimerspec() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_itimerspec>())).it_value as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).it_value) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -6726,40 +6609,43 @@ fn bindgen_test_layout___kernel_itimerspec() { } #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct __kernel_old_timeval { - pub tv_sec: __kernel_long_t, - pub tv_usec: __kernel_long_t, +pub struct __kernel_old_timespec { + pub tv_sec: __kernel_old_time_t, + pub tv_nsec: ::std::os::raw::c_long, } #[test] -fn bindgen_test_layout___kernel_old_timeval() { +fn bindgen_test_layout___kernel_old_timespec() { + const UNINIT: ::std::mem::MaybeUninit<__kernel_old_timespec> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::<__kernel_old_timeval>(), + ::std::mem::size_of::<__kernel_old_timespec>(), 8usize, - concat!("Size of: ", stringify!(__kernel_old_timeval)) + concat!("Size of: ", stringify!(__kernel_old_timespec)) ); assert_eq!( - ::std::mem::align_of::<__kernel_old_timeval>(), + ::std::mem::align_of::<__kernel_old_timespec>(), 4usize, - concat!("Alignment of ", stringify!(__kernel_old_timeval)) + concat!("Alignment of ", stringify!(__kernel_old_timespec)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_old_timeval>())).tv_sec as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(__kernel_old_timeval), + stringify!(__kernel_old_timespec), "::", stringify!(tv_sec) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_old_timeval>())).tv_usec as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tv_nsec) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", - stringify!(__kernel_old_timeval), + stringify!(__kernel_old_timespec), "::", - stringify!(tv_usec) + stringify!(tv_nsec) ) ); } @@ -6771,6 +6657,9 @@ pub struct __kernel_sock_timeval { } #[test] fn bindgen_test_layout___kernel_sock_timeval() { + const UNINIT: ::std::mem::MaybeUninit<__kernel_sock_timeval> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__kernel_sock_timeval>(), 16usize, @@ -6782,7 +6671,7 @@ fn bindgen_test_layout___kernel_sock_timeval() { concat!("Alignment of ", stringify!(__kernel_sock_timeval)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_sock_timeval>())).tv_sec as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6792,7 +6681,7 @@ fn bindgen_test_layout___kernel_sock_timeval() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_sock_timeval>())).tv_usec as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tv_usec) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -6805,11 +6694,13 @@ fn bindgen_test_layout___kernel_sock_timeval() { #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct timeval { - pub tv_sec: __kernel_time_t, + pub tv_sec: __kernel_old_time_t, pub tv_usec: __kernel_suseconds_t, } #[test] fn bindgen_test_layout_timeval() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 8usize, @@ -6821,7 +6712,7 @@ fn bindgen_test_layout_timeval() { concat!("Alignment of ", stringify!(timeval)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tv_sec as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6831,7 +6722,7 @@ fn bindgen_test_layout_timeval() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tv_usec as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tv_usec) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -6843,51 +6734,14 @@ 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, } #[test] fn bindgen_test_layout_itimerspec() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 16usize, @@ -6899,7 +6753,7 @@ fn bindgen_test_layout_itimerspec() { concat!("Alignment of ", stringify!(itimerspec)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).it_interval as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).it_interval) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6909,7 +6763,7 @@ fn bindgen_test_layout_itimerspec() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).it_value as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).it_value) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -6927,6 +6781,8 @@ pub struct itimerval { } #[test] fn bindgen_test_layout_itimerval() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 16usize, @@ -6938,7 +6794,7 @@ fn bindgen_test_layout_itimerval() { concat!("Alignment of ", stringify!(itimerval)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).it_interval as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).it_interval) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6948,7 +6804,7 @@ fn bindgen_test_layout_itimerval() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).it_value as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).it_value) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -6958,6 +6814,47 @@ 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() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + 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::addr_of!((*ptr).tz_minuteswest) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(timezone), + "::", + stringify!(tz_minuteswest) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tz_dsttime) as usize - ptr 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)] @@ -6966,6 +6863,8 @@ pub struct fd_set { } #[test] fn bindgen_test_layout_fd_set() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 128usize, @@ -6977,7 +6876,7 @@ fn bindgen_test_layout_fd_set() { concat!("Alignment of ", stringify!(fd_set)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).fds_bits as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).fds_bits) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6988,21 +6887,21 @@ fn bindgen_test_layout_fd_set() { ); } extern "C" { - pub fn __FD_CLR_chk(arg1: ::std::os::raw::c_int, arg2: *mut fd_set, arg3: size_t); + pub fn __FD_CLR_chk(arg1: ::std::os::raw::c_int, arg2: *mut fd_set, arg3: usize); } extern "C" { - pub fn __FD_SET_chk(arg1: ::std::os::raw::c_int, arg2: *mut fd_set, arg3: size_t); + pub fn __FD_SET_chk(arg1: ::std::os::raw::c_int, arg2: *mut fd_set, arg3: usize); } extern "C" { pub fn __FD_ISSET_chk( arg1: ::std::os::raw::c_int, arg2: *const fd_set, - arg3: size_t, + arg3: usize, ) -> ::std::os::raw::c_int; } extern "C" { pub fn select( - __fd_count: ::std::os::raw::c_int, + __max_fd_plus_one: ::std::os::raw::c_int, __read_fds: *mut fd_set, __write_fds: *mut fd_set, __exception_fds: *mut fd_set, @@ -7011,7 +6910,7 @@ extern "C" { } extern "C" { pub fn pselect( - __fd_count: ::std::os::raw::c_int, + __max_fd_plus_one: ::std::os::raw::c_int, __read_fds: *mut fd_set, __write_fds: *mut fd_set, __exception_fds: *mut fd_set, @@ -7021,7 +6920,7 @@ extern "C" { } extern "C" { pub fn pselect64( - __fd_count: ::std::os::raw::c_int, + __max_fd_plus_one: ::std::os::raw::c_int, __read_fds: *mut fd_set, __write_fds: *mut fd_set, __exception_fds: *mut fd_set, @@ -7086,6 +6985,8 @@ pub struct tm { } #[test] fn bindgen_test_layout_tm() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 44usize, @@ -7097,7 +6998,7 @@ fn bindgen_test_layout_tm() { concat!("Alignment of ", stringify!(tm)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tm_sec as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tm_sec) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -7107,7 +7008,7 @@ fn bindgen_test_layout_tm() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tm_min as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tm_min) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -7117,7 +7018,7 @@ fn bindgen_test_layout_tm() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tm_hour as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tm_hour) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -7127,7 +7028,7 @@ fn bindgen_test_layout_tm() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tm_mday as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tm_mday) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", @@ -7137,7 +7038,7 @@ fn bindgen_test_layout_tm() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tm_mon as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tm_mon) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -7147,7 +7048,7 @@ fn bindgen_test_layout_tm() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tm_year as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tm_year) as usize - ptr as usize }, 20usize, concat!( "Offset of field: ", @@ -7157,7 +7058,7 @@ fn bindgen_test_layout_tm() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tm_wday as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tm_wday) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -7167,7 +7068,7 @@ fn bindgen_test_layout_tm() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tm_yday as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tm_yday) as usize - ptr as usize }, 28usize, concat!( "Offset of field: ", @@ -7177,7 +7078,7 @@ fn bindgen_test_layout_tm() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tm_isdst as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tm_isdst) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -7187,7 +7088,7 @@ fn bindgen_test_layout_tm() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tm_gmtoff as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tm_gmtoff) as usize - ptr as usize }, 36usize, concat!( "Offset of field: ", @@ -7197,7 +7098,7 @@ fn bindgen_test_layout_tm() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tm_zone as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tm_zone) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", @@ -7261,19 +7162,19 @@ extern "C" { extern "C" { pub fn strftime( __buf: *mut ::std::os::raw::c_char, - __n: size_t, + __n: usize, __fmt: *const ::std::os::raw::c_char, __tm: *const tm, - ) -> size_t; + ) -> usize; } extern "C" { pub fn strftime_l( __buf: *mut ::std::os::raw::c_char, - __n: size_t, + __n: usize, __fmt: *const ::std::os::raw::c_char, __tm: *const tm, __l: locale_t, - ) -> size_t; + ) -> usize; } extern "C" { pub fn ctime(__t: *const time_t) -> *mut ::std::os::raw::c_char; @@ -7381,12 +7282,17 @@ 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() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 64usize, + 88usize, concat!("Size of: ", stringify!(clone_args)) ); assert_eq!( @@ -7395,7 +7301,7 @@ fn bindgen_test_layout_clone_args() { concat!("Alignment of ", stringify!(clone_args)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -7405,7 +7311,7 @@ fn bindgen_test_layout_clone_args() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pidfd as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pidfd) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -7415,7 +7321,7 @@ fn bindgen_test_layout_clone_args() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).child_tid as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).child_tid) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -7425,7 +7331,7 @@ fn bindgen_test_layout_clone_args() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).parent_tid as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).parent_tid) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -7435,7 +7341,7 @@ fn bindgen_test_layout_clone_args() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).exit_signal as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).exit_signal) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -7445,7 +7351,7 @@ fn bindgen_test_layout_clone_args() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).stack as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).stack) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", @@ -7455,7 +7361,7 @@ fn bindgen_test_layout_clone_args() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).stack_size as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).stack_size) as usize - ptr as usize }, 48usize, concat!( "Offset of field: ", @@ -7465,7 +7371,7 @@ fn bindgen_test_layout_clone_args() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tls as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tls) as usize - ptr as usize }, 56usize, concat!( "Offset of field: ", @@ -7474,6 +7380,36 @@ fn bindgen_test_layout_clone_args() { stringify!(tls) ) ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).set_tid) as usize - ptr as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(clone_args), + "::", + stringify!(set_tid) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).set_tid_size) as usize - ptr as usize }, + 72usize, + concat!( + "Offset of field: ", + stringify!(clone_args), + "::", + stringify!(set_tid_size) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).cgroup) as usize - ptr as usize }, + 80usize, + concat!( + "Offset of field: ", + stringify!(clone_args), + "::", + stringify!(cgroup) + ) + ); } #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -7482,6 +7418,8 @@ pub struct sched_param { } #[test] fn bindgen_test_layout_sched_param() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 4usize, @@ -7493,7 +7431,7 @@ fn bindgen_test_layout_sched_param() { concat!("Alignment of ", stringify!(sched_param)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sched_priority as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sched_priority) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -7531,15 +7469,15 @@ extern "C" { extern "C" { pub fn sched_rr_get_interval(__pid: pid_t, __quantum: *mut timespec) -> ::std::os::raw::c_int; } -pub const PTHREAD_MUTEX_NORMAL: ::std::os::raw::c_uint = 0; -pub const PTHREAD_MUTEX_RECURSIVE: ::std::os::raw::c_uint = 1; -pub const PTHREAD_MUTEX_ERRORCHECK: ::std::os::raw::c_uint = 2; -pub const PTHREAD_MUTEX_ERRORCHECK_NP: ::std::os::raw::c_uint = 2; -pub const PTHREAD_MUTEX_RECURSIVE_NP: ::std::os::raw::c_uint = 1; -pub const PTHREAD_MUTEX_DEFAULT: ::std::os::raw::c_uint = 0; +pub const PTHREAD_MUTEX_NORMAL: _bindgen_ty_23 = 0; +pub const PTHREAD_MUTEX_RECURSIVE: _bindgen_ty_23 = 1; +pub const PTHREAD_MUTEX_ERRORCHECK: _bindgen_ty_23 = 2; +pub const PTHREAD_MUTEX_ERRORCHECK_NP: _bindgen_ty_23 = 2; +pub const PTHREAD_MUTEX_RECURSIVE_NP: _bindgen_ty_23 = 1; +pub const PTHREAD_MUTEX_DEFAULT: _bindgen_ty_23 = 0; pub type _bindgen_ty_23 = ::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 const PTHREAD_RWLOCK_PREFER_READER_NP: _bindgen_ty_24 = 0; +pub const PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP: _bindgen_ty_24 = 1; pub type _bindgen_ty_24 = ::std::os::raw::c_uint; pub type __pthread_cleanup_func_t = ::std::option::Option; @@ -7552,6 +7490,8 @@ pub struct __pthread_cleanup_t { } #[test] fn bindgen_test_layout___pthread_cleanup_t() { + const UNINIT: ::std::mem::MaybeUninit<__pthread_cleanup_t> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__pthread_cleanup_t>(), 12usize, @@ -7563,9 +7503,7 @@ fn bindgen_test_layout___pthread_cleanup_t() { concat!("Alignment of ", stringify!(__pthread_cleanup_t)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_cleanup_t>())).__cleanup_prev as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).__cleanup_prev) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -7575,9 +7513,7 @@ fn bindgen_test_layout___pthread_cleanup_t() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_cleanup_t>())).__cleanup_routine as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).__cleanup_routine) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -7587,9 +7523,7 @@ fn bindgen_test_layout___pthread_cleanup_t() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_cleanup_t>())).__cleanup_arg as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).__cleanup_arg) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -7609,24 +7543,23 @@ extern "C" { extern "C" { pub fn __pthread_cleanup_pop(arg1: *mut __pthread_cleanup_t, arg2: ::std::os::raw::c_int); } -#[doc = " Data associated with an ALooper fd that will be returned as the \"outData\""] -#[doc = " when that source has data ready."] +#[doc = " Data associated with an ALooper fd that will be returned as the \"outData\"\n when that source has data ready."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct android_poll_source { - #[doc = " The identifier of this source. May be LOOPER_ID_MAIN or"] - #[doc = " LOOPER_ID_INPUT."] + #[doc = " The identifier of this source. May be LOOPER_ID_MAIN or\n LOOPER_ID_INPUT."] pub id: i32, #[doc = " The android_app this ident is associated with."] pub app: *mut android_app, - #[doc = " Function to call to perform the standard processing of data from"] - #[doc = " this source."] + #[doc = " Function to call to perform the standard processing of data from\n this source."] pub process: ::std::option::Option< unsafe extern "C" fn(app: *mut android_app, source: *mut android_poll_source), >, } #[test] fn bindgen_test_layout_android_poll_source() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 12usize, @@ -7638,7 +7571,7 @@ fn bindgen_test_layout_android_poll_source() { concat!("Alignment of ", stringify!(android_poll_source)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).id as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -7648,7 +7581,7 @@ fn bindgen_test_layout_android_poll_source() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).app as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).app) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -7658,7 +7591,7 @@ fn bindgen_test_layout_android_poll_source() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).process as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).process) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -7671,37 +7604,26 @@ fn bindgen_test_layout_android_poll_source() { #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct android_input_buffer { - #[doc = " Pointer to a read-only array of pointers to GameActivityMotionEvent."] - #[doc = " Only the first motionEventsCount events are valid."] - pub motionEvents: [GameActivityMotionEvent; 16usize], + #[doc = " Pointer to a read-only array of GameActivityMotionEvent.\n Only the first motionEventsCount events are valid."] + pub motionEvents: *mut GameActivityMotionEvent, #[doc = " The number of valid motion events in `motionEvents`."] pub motionEventsCount: u64, - #[doc = " Pointer to a read-only array of pointers to GameActivityHistoricalPointerAxes."] - #[doc = ""] - #[doc = " Only the first historicalSamplesCount samples are valid."] - #[doc = " Refer to event->historicalStart, event->pointerCount and event->historicalCount"] - #[doc = " to access the specific samples that relate to an event."] - #[doc = ""] - #[doc = " Each slice of samples for one event has a length of"] - #[doc = " (event->pointerCount and event->historicalCount) and is in pointer-major"] - #[doc = " order so the historic samples for each pointer are contiguous."] - #[doc = " E.g. you would access historic sample index 3 for pointer 2 of an event with:"] - #[doc = ""] - #[doc = " historicalAxisSamples[event->historicalStart + (event->historicalCount * 2) + 3];"] - pub historicalAxisSamples: [GameActivityHistoricalPointerAxes; 64usize], - #[doc = " The number of valid historical samples in `historicalAxisSamples`."] - pub historicalSamplesCount: u64, - #[doc = " Pointer to a read-only array of pointers to GameActivityKeyEvent."] - #[doc = " Only the first keyEventsCount events are valid."] - pub keyEvents: [GameActivityKeyEvent; 4usize], + #[doc = " The size of the `motionEvents` buffer."] + pub motionEventsBufferSize: u64, + #[doc = " Pointer to a read-only array of GameActivityKeyEvent.\n Only the first keyEventsCount events are valid."] + pub keyEvents: *mut GameActivityKeyEvent, #[doc = " The number of valid \"Key\" events in `keyEvents`."] pub keyEventsCount: u64, + #[doc = " The size of the `keyEvents` buffer."] + pub keyEventsBufferSize: u64, } #[test] fn bindgen_test_layout_android_input_buffer() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 40824usize, + 48usize, concat!("Size of: ", stringify!(android_input_buffer)) ); assert_eq!( @@ -7710,9 +7632,7 @@ fn bindgen_test_layout_android_input_buffer() { concat!("Alignment of ", stringify!(android_input_buffer)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).motionEvents as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).motionEvents) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -7722,10 +7642,8 @@ fn bindgen_test_layout_android_input_buffer() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).motionEventsCount as *const _ as usize - }, - 27776usize, + unsafe { ::std::ptr::addr_of!((*ptr).motionEventsCount) as usize - ptr as usize }, + 8usize, concat!( "Offset of field: ", stringify!(android_input_buffer), @@ -7734,153 +7652,81 @@ fn bindgen_test_layout_android_input_buffer() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).historicalAxisSamples as *const _ - as usize - }, - 27784usize, + unsafe { ::std::ptr::addr_of!((*ptr).motionEventsBufferSize) as usize - ptr as usize }, + 16usize, concat!( "Offset of field: ", stringify!(android_input_buffer), "::", - stringify!(historicalAxisSamples) + stringify!(motionEventsBufferSize) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).historicalSamplesCount as *const _ - as usize - }, - 40584usize, + unsafe { ::std::ptr::addr_of!((*ptr).keyEvents) as usize - ptr as usize }, + 24usize, concat!( "Offset of field: ", stringify!(android_input_buffer), "::", - stringify!(historicalSamplesCount) + stringify!(keyEvents) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).keyEvents as *const _ as usize }, - 40592usize, + unsafe { ::std::ptr::addr_of!((*ptr).keyEventsCount) as usize - ptr as usize }, + 32usize, concat!( "Offset of field: ", stringify!(android_input_buffer), "::", - stringify!(keyEvents) + stringify!(keyEventsCount) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).keyEventsCount as *const _ as usize - }, - 40816usize, + unsafe { ::std::ptr::addr_of!((*ptr).keyEventsBufferSize) as usize - ptr as usize }, + 40usize, concat!( "Offset of field: ", stringify!(android_input_buffer), "::", - stringify!(keyEventsCount) + stringify!(keyEventsBufferSize) ) ); } -#[doc = " Function pointer declaration for the filtering of key events."] -#[doc = " A function with this signature should be passed to"] -#[doc = " android_app_set_key_event_filter and return false for any events that should"] -#[doc = " not be handled by android_native_app_glue. These events will be handled by"] -#[doc = " the system instead."] +#[doc = " Function pointer declaration for the filtering of key events.\n A function with this signature should be passed to\n android_app_set_key_event_filter and return false for any events that should\n not be handled by android_native_app_glue. These events will be handled by\n the system instead."] pub type android_key_event_filter = ::std::option::Option bool>; -#[doc = " Function pointer definition for the filtering of motion events."] -#[doc = " A function with this signature should be passed to"] -#[doc = " android_app_set_motion_event_filter and return false for any events that"] -#[doc = " should not be handled by android_native_app_glue. These events will be"] -#[doc = " handled by the system instead."] +#[doc = " Function pointer definition for the filtering of motion events.\n A function with this signature should be passed to\n android_app_set_motion_event_filter and return false for any events that\n should not be handled by android_native_app_glue. These events will be\n handled by the system instead."] pub type android_motion_event_filter = ::std::option::Option bool>; -#[doc = " The GameActivity interface provided by "] -#[doc = " is based on a set of application-provided callbacks that will be called"] -#[doc = " by the Activity's main thread when certain events occur."] -#[doc = ""] -#[doc = " This means that each one of this callbacks _should_ _not_ block, or they"] -#[doc = " risk having the system force-close the application. This programming"] -#[doc = " model is direct, lightweight, but constraining."] -#[doc = ""] -#[doc = " The 'android_native_app_glue' static library is used to provide a different"] -#[doc = " execution model where the application can implement its own main event"] -#[doc = " loop in a different thread instead. Here's how it works:"] -#[doc = ""] -#[doc = " 1/ The application must provide a function named \"android_main()\" that"] -#[doc = " will be called when the activity is created, in a new thread that is"] -#[doc = " distinct from the activity's main thread."] -#[doc = ""] -#[doc = " 2/ android_main() receives a pointer to a valid \"android_app\" structure"] -#[doc = " that contains references to other important objects, e.g. the"] -#[doc = " GameActivity obejct instance the application is running in."] -#[doc = ""] -#[doc = " 3/ the \"android_app\" object holds an ALooper instance that already"] -#[doc = " listens to activity lifecycle events (e.g. \"pause\", \"resume\")."] -#[doc = " See APP_CMD_XXX declarations below."] -#[doc = ""] -#[doc = " This corresponds to an ALooper identifier returned by"] -#[doc = " ALooper_pollOnce with value LOOPER_ID_MAIN."] -#[doc = ""] -#[doc = " Your application can use the same ALooper to listen to additional"] -#[doc = " file-descriptors. They can either be callback based, or with return"] -#[doc = " identifiers starting with LOOPER_ID_USER."] -#[doc = ""] -#[doc = " 4/ Whenever you receive a LOOPER_ID_MAIN event,"] -#[doc = " the returned data will point to an android_poll_source structure. You"] -#[doc = " can call the process() function on it, and fill in android_app->onAppCmd"] -#[doc = " to be called for your own processing of the event."] -#[doc = ""] -#[doc = " Alternatively, you can call the low-level functions to read and process"] -#[doc = " the data directly... look at the process_cmd() and process_input()"] -#[doc = " implementations in the glue to see how to do this."] -#[doc = ""] -#[doc = " See the sample named \"native-activity\" that comes with the NDK with a"] -#[doc = " full usage example. Also look at the documentation of GameActivity."] +#[doc = " The GameActivity interface provided by \n is based on a set of application-provided callbacks that will be called\n by the Activity's main thread when certain events occur.\n\n This means that each one of this callbacks _should_ _not_ block, or they\n risk having the system force-close the application. This programming\n model is direct, lightweight, but constraining.\n\n The 'android_native_app_glue' static library is used to provide a different\n execution model where the application can implement its own main event\n loop in a different thread instead. Here's how it works:\n\n 1/ The application must provide a function named \"android_main()\" that\n will be called when the activity is created, in a new thread that is\n distinct from the activity's main thread.\n\n 2/ android_main() receives a pointer to a valid \"android_app\" structure\n that contains references to other important objects, e.g. the\n GameActivity obejct instance the application is running in.\n\n 3/ the \"android_app\" object holds an ALooper instance that already\n listens to activity lifecycle events (e.g. \"pause\", \"resume\").\n See APP_CMD_XXX declarations below.\n\n This corresponds to an ALooper identifier returned by\n ALooper_pollOnce with value LOOPER_ID_MAIN.\n\n Your application can use the same ALooper to listen to additional\n file-descriptors. They can either be callback based, or with return\n identifiers starting with LOOPER_ID_USER.\n\n 4/ Whenever you receive a LOOPER_ID_MAIN event,\n the returned data will point to an android_poll_source structure. You\n can call the process() function on it, and fill in android_app->onAppCmd\n to be called for your own processing of the event.\n\n Alternatively, you can call the low-level functions to read and process\n the data directly... look at the process_cmd() and process_input()\n implementations in the glue to see how to do this.\n\n See the sample named \"native-activity\" that comes with the NDK with a\n full usage example. Also look at the documentation of GameActivity."] #[repr(C)] pub struct android_app { #[doc = " An optional pointer to application-defined state."] pub userData: *mut ::std::os::raw::c_void, - #[doc = " A required callback for processing main app commands (`APP_CMD_*`)."] - #[doc = " This is called each frame if there are app commands that need processing."] + #[doc = " A required callback for processing main app commands (`APP_CMD_*`).\n This is called each frame if there are app commands that need processing."] pub onAppCmd: ::std::option::Option, #[doc = " The GameActivity object instance that this app is running in."] pub activity: *mut GameActivity, #[doc = " The current configuration the app is running in."] pub config: *mut AConfiguration, - #[doc = " The last activity saved state, as provided at creation time."] - #[doc = " It is NULL if there was no state. You can use this as you need; the"] - #[doc = " memory will remain around until you call android_app_exec_cmd() for"] - #[doc = " APP_CMD_RESUME, at which point it will be freed and savedState set to"] - #[doc = " NULL. These variables should only be changed when processing a"] - #[doc = " APP_CMD_SAVE_STATE, at which point they will be initialized to NULL and"] - #[doc = " you can malloc your state and place the information here. In that case"] - #[doc = " the memory will be freed for you later."] + #[doc = " The last activity saved state, as provided at creation time.\n It is NULL if there was no state. You can use this as you need; the\n memory will remain around until you call android_app_exec_cmd() for\n APP_CMD_RESUME, at which point it will be freed and savedState set to\n NULL. These variables should only be changed when processing a\n APP_CMD_SAVE_STATE, at which point they will be initialized to NULL and\n you can malloc your state and place the information here. In that case\n the memory will be freed for you later."] pub savedState: *mut ::std::os::raw::c_void, #[doc = " The size of the activity saved state. It is 0 if `savedState` is NULL."] - pub savedStateSize: size_t, + pub savedStateSize: usize, #[doc = " The ALooper associated with the app's thread."] pub looper: *mut ALooper, #[doc = " When non-NULL, this is the window surface that the app can draw in."] pub window: *mut ANativeWindow, - #[doc = " Current content rectangle of the window; this is the area where the"] - #[doc = " window's content should be placed to be seen by the user."] + #[doc = " Current content rectangle of the window; this is the area where the\n window's content should be placed to be seen by the user."] pub contentRect: ARect, - #[doc = " Current state of the app's activity. May be either APP_CMD_START,"] - #[doc = " APP_CMD_RESUME, APP_CMD_PAUSE, or APP_CMD_STOP."] + #[doc = " Current state of the app's activity. May be either APP_CMD_START,\n APP_CMD_RESUME, APP_CMD_PAUSE, or APP_CMD_STOP."] pub activityState: ::std::os::raw::c_int, - #[doc = " This is non-zero when the application's GameActivity is being"] - #[doc = " destroyed and waiting for the app thread to complete."] + #[doc = " This is non-zero when the application's GameActivity is being\n destroyed and waiting for the app thread to complete."] pub destroyRequested: ::std::os::raw::c_int, - #[doc = " This is used for buffering input from GameActivity. Once ready, the"] - #[doc = " application thread switches the buffers and processes what was"] - #[doc = " accumulated."] + #[doc = " This is used for buffering input from GameActivity. Once ready, the\n application thread switches the buffers and processes what was\n accumulated."] pub inputBuffers: [android_input_buffer; 2usize], pub currentInputBuffer: ::std::os::raw::c_int, - #[doc = " 0 if no text input event is outstanding, 1 if it is."] - #[doc = " Use `GameActivity_getTextInputState` to get information"] - #[doc = " about the text entered by the user."] + #[doc = " 0 if no text input event is outstanding, 1 if it is.\n Use `GameActivity_getTextInputState` to get information\n about the text entered by the user."] pub textInputState: ::std::os::raw::c_int, #[doc = " @cond INTERNAL"] pub mutex: pthread_mutex_t, @@ -7902,9 +7748,11 @@ pub struct android_app { } #[test] fn bindgen_test_layout_android_app() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 81792usize, + 240usize, concat!("Size of: ", stringify!(android_app)) ); assert_eq!( @@ -7913,7 +7761,7 @@ fn bindgen_test_layout_android_app() { concat!("Alignment of ", stringify!(android_app)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).userData as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).userData) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -7923,7 +7771,7 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).onAppCmd as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).onAppCmd) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -7933,7 +7781,7 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).activity as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).activity) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -7943,7 +7791,7 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).config as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).config) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", @@ -7953,7 +7801,7 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).savedState as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).savedState) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -7963,7 +7811,7 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).savedStateSize as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).savedStateSize) as usize - ptr as usize }, 20usize, concat!( "Offset of field: ", @@ -7973,7 +7821,7 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).looper as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).looper) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -7983,7 +7831,7 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).window as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).window) as usize - ptr as usize }, 28usize, concat!( "Offset of field: ", @@ -7993,7 +7841,7 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).contentRect as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).contentRect) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -8003,7 +7851,7 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).activityState as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).activityState) as usize - ptr as usize }, 48usize, concat!( "Offset of field: ", @@ -8013,7 +7861,7 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).destroyRequested as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).destroyRequested) as usize - ptr as usize }, 52usize, concat!( "Offset of field: ", @@ -8023,7 +7871,7 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).inputBuffers as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).inputBuffers) as usize - ptr as usize }, 56usize, concat!( "Offset of field: ", @@ -8033,8 +7881,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).currentInputBuffer as *const _ as usize }, - 81704usize, + unsafe { ::std::ptr::addr_of!((*ptr).currentInputBuffer) as usize - ptr as usize }, + 152usize, concat!( "Offset of field: ", stringify!(android_app), @@ -8043,8 +7891,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).textInputState as *const _ as usize }, - 81708usize, + unsafe { ::std::ptr::addr_of!((*ptr).textInputState) as usize - ptr as usize }, + 156usize, concat!( "Offset of field: ", stringify!(android_app), @@ -8053,8 +7901,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).mutex as *const _ as usize }, - 81712usize, + unsafe { ::std::ptr::addr_of!((*ptr).mutex) as usize - ptr as usize }, + 160usize, concat!( "Offset of field: ", stringify!(android_app), @@ -8063,8 +7911,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).cond as *const _ as usize }, - 81716usize, + unsafe { ::std::ptr::addr_of!((*ptr).cond) as usize - ptr as usize }, + 164usize, concat!( "Offset of field: ", stringify!(android_app), @@ -8073,8 +7921,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).msgread as *const _ as usize }, - 81720usize, + unsafe { ::std::ptr::addr_of!((*ptr).msgread) as usize - ptr as usize }, + 168usize, concat!( "Offset of field: ", stringify!(android_app), @@ -8083,8 +7931,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).msgwrite as *const _ as usize }, - 81724usize, + unsafe { ::std::ptr::addr_of!((*ptr).msgwrite) as usize - ptr as usize }, + 172usize, concat!( "Offset of field: ", stringify!(android_app), @@ -8093,8 +7941,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).thread as *const _ as usize }, - 81728usize, + unsafe { ::std::ptr::addr_of!((*ptr).thread) as usize - ptr as usize }, + 176usize, concat!( "Offset of field: ", stringify!(android_app), @@ -8103,8 +7951,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).cmdPollSource as *const _ as usize }, - 81732usize, + unsafe { ::std::ptr::addr_of!((*ptr).cmdPollSource) as usize - ptr as usize }, + 180usize, concat!( "Offset of field: ", stringify!(android_app), @@ -8113,8 +7961,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).running as *const _ as usize }, - 81744usize, + unsafe { ::std::ptr::addr_of!((*ptr).running) as usize - ptr as usize }, + 192usize, concat!( "Offset of field: ", stringify!(android_app), @@ -8123,8 +7971,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).stateSaved as *const _ as usize }, - 81748usize, + unsafe { ::std::ptr::addr_of!((*ptr).stateSaved) as usize - ptr as usize }, + 196usize, concat!( "Offset of field: ", stringify!(android_app), @@ -8133,8 +7981,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).destroyed as *const _ as usize }, - 81752usize, + unsafe { ::std::ptr::addr_of!((*ptr).destroyed) as usize - ptr as usize }, + 200usize, concat!( "Offset of field: ", stringify!(android_app), @@ -8143,8 +7991,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).redrawNeeded as *const _ as usize }, - 81756usize, + unsafe { ::std::ptr::addr_of!((*ptr).redrawNeeded) as usize - ptr as usize }, + 204usize, concat!( "Offset of field: ", stringify!(android_app), @@ -8153,8 +8001,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pendingWindow as *const _ as usize }, - 81760usize, + unsafe { ::std::ptr::addr_of!((*ptr).pendingWindow) as usize - ptr as usize }, + 208usize, concat!( "Offset of field: ", stringify!(android_app), @@ -8163,8 +8011,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pendingContentRect as *const _ as usize }, - 81764usize, + unsafe { ::std::ptr::addr_of!((*ptr).pendingContentRect) as usize - ptr as usize }, + 212usize, concat!( "Offset of field: ", stringify!(android_app), @@ -8173,8 +8021,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).keyEventFilter as *const _ as usize }, - 81780usize, + unsafe { ::std::ptr::addr_of!((*ptr).keyEventFilter) as usize - ptr as usize }, + 228usize, concat!( "Offset of field: ", stringify!(android_app), @@ -8183,8 +8031,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).motionEventFilter as *const _ as usize }, - 81784usize, + unsafe { ::std::ptr::addr_of!((*ptr).motionEventFilter) as usize - ptr as usize }, + 232usize, concat!( "Offset of field: ", stringify!(android_app), @@ -8193,10 +8041,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).inputAvailableWakeUp as *const _ as usize - }, - 81788usize, + unsafe { ::std::ptr::addr_of!((*ptr).inputAvailableWakeUp) as usize - ptr as usize }, + 236usize, concat!( "Offset of field: ", stringify!(android_app), @@ -8205,8 +8051,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).inputSwapPending as *const _ as usize }, - 81789usize, + unsafe { ::std::ptr::addr_of!((*ptr).inputSwapPending) as usize - ptr as usize }, + 237usize, concat!( "Offset of field: ", stringify!(android_app), @@ -8215,139 +8061,89 @@ fn bindgen_test_layout_android_app() { ) ); } -#[doc = " Looper data ID of commands coming from the app's main thread, which"] -#[doc = " is returned as an identifier from ALooper_pollOnce(). The data for this"] -#[doc = " identifier is a pointer to an android_poll_source structure."] -#[doc = " These can be retrieved and processed with android_app_read_cmd()"] -#[doc = " and android_app_exec_cmd()."] +#[doc = " Looper data ID of commands coming from the app's main thread, which\n is returned as an identifier from ALooper_pollOnce(). The data for this\n identifier is a pointer to an android_poll_source structure.\n These can be retrieved and processed with android_app_read_cmd()\n and android_app_exec_cmd()."] pub const NativeAppGlueLooperId_LOOPER_ID_MAIN: NativeAppGlueLooperId = 1; -#[doc = " Unused. Reserved for future use when usage of AInputQueue will be"] -#[doc = " supported."] +#[doc = " Unused. Reserved for future use when usage of AInputQueue will be\n supported."] pub const NativeAppGlueLooperId_LOOPER_ID_INPUT: NativeAppGlueLooperId = 2; #[doc = " Start of user-defined ALooper identifiers."] pub const NativeAppGlueLooperId_LOOPER_ID_USER: NativeAppGlueLooperId = 3; -#[doc = " Looper ID of commands coming from the app's main thread, an AInputQueue or"] -#[doc = " user-defined sources."] +#[doc = " Looper ID of commands coming from the app's main thread, an AInputQueue or\n user-defined sources."] pub type NativeAppGlueLooperId = ::std::os::raw::c_uint; -#[doc = " Unused. Reserved for future use when usage of AInputQueue will be"] -#[doc = " supported."] +#[doc = " Unused. Reserved for future use when usage of AInputQueue will be\n supported."] pub const NativeAppGlueAppCmd_UNUSED_APP_CMD_INPUT_CHANGED: NativeAppGlueAppCmd = 0; -#[doc = " Command from main thread: a new ANativeWindow is ready for use. Upon"] -#[doc = " receiving this command, android_app->window will contain the new window"] -#[doc = " surface."] +#[doc = " Command from main thread: a new ANativeWindow is ready for use. Upon\n receiving this command, android_app->window will contain the new window\n surface."] pub const NativeAppGlueAppCmd_APP_CMD_INIT_WINDOW: NativeAppGlueAppCmd = 1; -#[doc = " Command from main thread: the existing ANativeWindow needs to be"] -#[doc = " terminated. Upon receiving this command, android_app->window still"] -#[doc = " contains the existing window; after calling android_app_exec_cmd"] -#[doc = " it will be set to NULL."] +#[doc = " Command from main thread: the existing ANativeWindow needs to be\n terminated. Upon receiving this command, android_app->window still\n contains the existing window; after calling android_app_exec_cmd\n it will be set to NULL."] pub const NativeAppGlueAppCmd_APP_CMD_TERM_WINDOW: NativeAppGlueAppCmd = 2; -#[doc = " Command from main thread: the current ANativeWindow has been resized."] -#[doc = " Please redraw with its new size."] +#[doc = " Command from main thread: the current ANativeWindow has been resized.\n Please redraw with its new size."] pub const NativeAppGlueAppCmd_APP_CMD_WINDOW_RESIZED: NativeAppGlueAppCmd = 3; -#[doc = " Command from main thread: the system needs that the current ANativeWindow"] -#[doc = " be redrawn. You should redraw the window before handing this to"] -#[doc = " android_app_exec_cmd() in order to avoid transient drawing glitches."] +#[doc = " Command from main thread: the system needs that the current ANativeWindow\n be redrawn. You should redraw the window before handing this to\n android_app_exec_cmd() in order to avoid transient drawing glitches."] pub const NativeAppGlueAppCmd_APP_CMD_WINDOW_REDRAW_NEEDED: NativeAppGlueAppCmd = 4; -#[doc = " Command from main thread: the content area of the window has changed,"] -#[doc = " such as from the soft input window being shown or hidden. You can"] -#[doc = " find the new content rect in android_app::contentRect."] +#[doc = " Command from main thread: the content area of the window has changed,\n such as from the soft input window being shown or hidden. You can\n find the new content rect in android_app::contentRect."] pub const NativeAppGlueAppCmd_APP_CMD_CONTENT_RECT_CHANGED: NativeAppGlueAppCmd = 5; -#[doc = " Command from main thread: the app's activity window has gained"] -#[doc = " input focus."] +#[doc = " Command from main thread: the app's activity window has gained\n input focus."] pub const NativeAppGlueAppCmd_APP_CMD_GAINED_FOCUS: NativeAppGlueAppCmd = 6; -#[doc = " Command from main thread: the app's activity window has lost"] -#[doc = " input focus."] +#[doc = " Command from main thread: the app's activity window has lost\n input focus."] pub const NativeAppGlueAppCmd_APP_CMD_LOST_FOCUS: NativeAppGlueAppCmd = 7; #[doc = " Command from main thread: the current device configuration has changed."] pub const NativeAppGlueAppCmd_APP_CMD_CONFIG_CHANGED: NativeAppGlueAppCmd = 8; -#[doc = " Command from main thread: the system is running low on memory."] -#[doc = " Try to reduce your memory use."] +#[doc = " Command from main thread: the system is running low on memory.\n Try to reduce your memory use."] pub const NativeAppGlueAppCmd_APP_CMD_LOW_MEMORY: NativeAppGlueAppCmd = 9; #[doc = " Command from main thread: the app's activity has been started."] pub const NativeAppGlueAppCmd_APP_CMD_START: NativeAppGlueAppCmd = 10; #[doc = " Command from main thread: the app's activity has been resumed."] pub const NativeAppGlueAppCmd_APP_CMD_RESUME: NativeAppGlueAppCmd = 11; -#[doc = " Command from main thread: the app should generate a new saved state"] -#[doc = " for itself, to restore from later if needed. If you have saved state,"] -#[doc = " allocate it with malloc and place it in android_app.savedState with"] -#[doc = " the size in android_app.savedStateSize. The will be freed for you"] -#[doc = " later."] +#[doc = " Command from main thread: the app should generate a new saved state\n for itself, to restore from later if needed. If you have saved state,\n allocate it with malloc and place it in android_app.savedState with\n the size in android_app.savedStateSize. The will be freed for you\n later."] pub const NativeAppGlueAppCmd_APP_CMD_SAVE_STATE: NativeAppGlueAppCmd = 12; #[doc = " Command from main thread: the app's activity has been paused."] pub const NativeAppGlueAppCmd_APP_CMD_PAUSE: NativeAppGlueAppCmd = 13; #[doc = " Command from main thread: the app's activity has been stopped."] pub const NativeAppGlueAppCmd_APP_CMD_STOP: NativeAppGlueAppCmd = 14; -#[doc = " Command from main thread: the app's activity is being destroyed,"] -#[doc = " and waiting for the app thread to clean up and exit before proceeding."] +#[doc = " Command from main thread: the app's activity is being destroyed,\n and waiting for the app thread to clean up and exit before proceeding."] pub const NativeAppGlueAppCmd_APP_CMD_DESTROY: NativeAppGlueAppCmd = 15; #[doc = " Command from main thread: the app's insets have changed."] pub const NativeAppGlueAppCmd_APP_CMD_WINDOW_INSETS_CHANGED: NativeAppGlueAppCmd = 16; #[doc = " Commands passed from the application's main Java thread to the game's thread."] pub type NativeAppGlueAppCmd = ::std::os::raw::c_uint; extern "C" { - #[doc = " Call when ALooper_pollAll() returns LOOPER_ID_MAIN, reading the next"] - #[doc = " app command message."] + #[doc = " Call when ALooper_pollAll() returns LOOPER_ID_MAIN, reading the next\n app command message."] pub fn android_app_read_cmd(android_app: *mut android_app) -> i8; } extern "C" { - #[doc = " Call with the command returned by android_app_read_cmd() to do the"] - #[doc = " initial pre-processing of the given command. You can perform your own"] - #[doc = " actions for the command after calling this function."] + #[doc = " Call with the command returned by android_app_read_cmd() to do the\n initial pre-processing of the given command. You can perform your own\n actions for the command after calling this function."] pub fn android_app_pre_exec_cmd(android_app: *mut android_app, cmd: i8); } extern "C" { - #[doc = " Call with the command returned by android_app_read_cmd() to do the"] - #[doc = " final post-processing of the given command. You must have done your own"] - #[doc = " actions for the command before calling this function."] + #[doc = " Call with the command returned by android_app_read_cmd() to do the\n final post-processing of the given command. You must have done your own\n actions for the command before calling this function."] pub fn android_app_post_exec_cmd(android_app: *mut android_app, cmd: i8); } extern "C" { - #[doc = " Call this before processing input events to get the events buffer."] - #[doc = " The function returns NULL if there are no events to process."] + #[doc = " Call this before processing input events to get the events buffer.\n The function returns NULL if there are no events to process."] pub fn android_app_swap_input_buffers( android_app: *mut android_app, ) -> *mut android_input_buffer; } extern "C" { - #[doc = " Clear the array of motion events that were waiting to be handled, and release"] - #[doc = " each of them."] - #[doc = ""] - #[doc = " This method should be called after you have processed the motion events in"] - #[doc = " your game loop. You should handle events at each iteration of your game loop."] + #[doc = " Clear the array of motion events that were waiting to be handled, and release\n each of them.\n\n This method should be called after you have processed the motion events in\n your game loop. You should handle events at each iteration of your game loop."] pub fn android_app_clear_motion_events(inputBuffer: *mut android_input_buffer); } extern "C" { - #[doc = " Clear the array of key events that were waiting to be handled, and release"] - #[doc = " each of them."] - #[doc = ""] - #[doc = " This method should be called after you have processed the key up events in"] - #[doc = " your game loop. You should handle events at each iteration of your game loop."] + #[doc = " Clear the array of key events that were waiting to be handled, and release\n each of them.\n\n This method should be called after you have processed the key up events in\n your game loop. You should handle events at each iteration of your game loop."] pub fn android_app_clear_key_events(inputBuffer: *mut android_input_buffer); } extern "C" { - #[doc = " This is a springboard into the Rust glue layer that wraps calling the"] - #[doc = " main entry for the app itself."] + #[doc = " This is a springboard into the Rust glue layer that wraps calling the\n main entry for the app itself."] pub fn _rust_glue_entry(app: *mut android_app); } extern "C" { - #[doc = " Set the filter to use when processing key events."] - #[doc = " Any events for which the filter returns false will be ignored by"] - #[doc = " android_native_app_glue. If filter is set to NULL, no filtering is done."] - #[doc = ""] - #[doc = " The default key filter will filter out volume and camera button presses."] + #[doc = " Set the filter to use when processing key events.\n Any events for which the filter returns false will be ignored by\n android_native_app_glue. If filter is set to NULL, no filtering is done.\n\n The default key filter will filter out volume and camera button presses."] pub fn android_app_set_key_event_filter( app: *mut android_app, filter: android_key_event_filter, ); } extern "C" { - #[doc = " Set the filter to use when processing touch and motion events."] - #[doc = " Any events for which the filter returns false will be ignored by"] - #[doc = " android_native_app_glue. If filter is set to NULL, no filtering is done."] - #[doc = ""] - #[doc = " Note that the default motion event filter will only allow touchscreen events"] - #[doc = " through, in order to mimic NativeActivity's behaviour, so for controller"] - #[doc = " events to be passed to the app, set the filter to NULL."] + #[doc = " Set the filter to use when processing touch and motion events.\n Any events for which the filter returns false will be ignored by\n android_native_app_glue. If filter is set to NULL, no filtering is done.\n\n Note that the default motion event filter will only allow touchscreen events\n through, in order to mimic NativeActivity's behaviour, so for controller\n events to be passed to the app, set the filter to NULL."] pub fn android_app_set_motion_event_filter( app: *mut android_app, filter: android_motion_event_filter, diff --git a/android-activity/src/game_activity/ffi_i686.rs b/android-activity/src/game_activity/ffi_i686.rs index 65c9cc9..ed9075f 100644 --- a/android-activity/src/game_activity/ffi_i686.rs +++ b/android-activity/src/game_activity/ffi_i686.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.59.2 */ +/* automatically generated by rust-bindgen 0.66.1 */ pub const __BIONIC__: u32 = 1; pub const __WORDSIZE: u32 = 32; @@ -21,10 +21,14 @@ 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 __NDK_MAJOR__: u32 = 21; -pub const __NDK_MINOR__: u32 = 1; +pub const __ANDROID_API_S__: u32 = 31; +pub const __ANDROID_API_T__: u32 = 33; +pub const __ANDROID_API_U__: u32 = 34; +pub const __ANDROID_NDK__: u32 = 1; +pub const __NDK_MAJOR__: u32 = 25; +pub const __NDK_MINOR__: u32 = 2; pub const __NDK_BETA__: u32 = 0; -pub const __NDK_BUILD__: u32 = 6352462; +pub const __NDK_BUILD__: u32 = 9519653; pub const __NDK_CANARY__: u32 = 0; pub const INT8_MIN: i32 = -128; pub const INT8_MAX: u32 = 127; @@ -62,136 +66,141 @@ 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 AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT: u32 = 8; -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"; -pub const PRId32: &[u8; 2usize] = b"d\0"; -pub const PRId64: &[u8; 4usize] = b"lld\0"; -pub const PRIdLEAST8: &[u8; 2usize] = b"d\0"; -pub const PRIdLEAST16: &[u8; 2usize] = b"d\0"; -pub const PRIdLEAST32: &[u8; 2usize] = b"d\0"; -pub const PRIdLEAST64: &[u8; 4usize] = b"lld\0"; -pub const PRIdFAST8: &[u8; 2usize] = b"d\0"; -pub const PRIdFAST64: &[u8; 4usize] = b"lld\0"; -pub const PRIdMAX: &[u8; 3usize] = b"jd\0"; -pub const PRIi8: &[u8; 2usize] = b"i\0"; -pub const PRIi16: &[u8; 2usize] = b"i\0"; -pub const PRIi32: &[u8; 2usize] = b"i\0"; -pub const PRIi64: &[u8; 4usize] = b"lli\0"; -pub const PRIiLEAST8: &[u8; 2usize] = b"i\0"; -pub const PRIiLEAST16: &[u8; 2usize] = b"i\0"; -pub const PRIiLEAST32: &[u8; 2usize] = b"i\0"; -pub const PRIiLEAST64: &[u8; 4usize] = b"lli\0"; -pub const PRIiFAST8: &[u8; 2usize] = b"i\0"; -pub const PRIiFAST64: &[u8; 4usize] = b"lli\0"; -pub const PRIiMAX: &[u8; 3usize] = b"ji\0"; -pub const PRIo8: &[u8; 2usize] = b"o\0"; -pub const PRIo16: &[u8; 2usize] = b"o\0"; -pub const PRIo32: &[u8; 2usize] = b"o\0"; -pub const PRIo64: &[u8; 4usize] = b"llo\0"; -pub const PRIoLEAST8: &[u8; 2usize] = b"o\0"; -pub const PRIoLEAST16: &[u8; 2usize] = b"o\0"; -pub const PRIoLEAST32: &[u8; 2usize] = b"o\0"; -pub const PRIoLEAST64: &[u8; 4usize] = b"llo\0"; -pub const PRIoFAST8: &[u8; 2usize] = b"o\0"; -pub const PRIoFAST64: &[u8; 4usize] = b"llo\0"; -pub const PRIoMAX: &[u8; 3usize] = b"jo\0"; -pub const PRIu8: &[u8; 2usize] = b"u\0"; -pub const PRIu16: &[u8; 2usize] = b"u\0"; -pub const PRIu32: &[u8; 2usize] = b"u\0"; -pub const PRIu64: &[u8; 4usize] = b"llu\0"; -pub const PRIuLEAST8: &[u8; 2usize] = b"u\0"; -pub const PRIuLEAST16: &[u8; 2usize] = b"u\0"; -pub const PRIuLEAST32: &[u8; 2usize] = b"u\0"; -pub const PRIuLEAST64: &[u8; 4usize] = b"llu\0"; -pub const PRIuFAST8: &[u8; 2usize] = b"u\0"; -pub const PRIuFAST64: &[u8; 4usize] = b"llu\0"; -pub const PRIuMAX: &[u8; 3usize] = b"ju\0"; -pub const PRIx8: &[u8; 2usize] = b"x\0"; -pub const PRIx16: &[u8; 2usize] = b"x\0"; -pub const PRIx32: &[u8; 2usize] = b"x\0"; -pub const PRIx64: &[u8; 4usize] = b"llx\0"; -pub const PRIxLEAST8: &[u8; 2usize] = b"x\0"; -pub const PRIxLEAST16: &[u8; 2usize] = b"x\0"; -pub const PRIxLEAST32: &[u8; 2usize] = b"x\0"; -pub const PRIxLEAST64: &[u8; 4usize] = b"llx\0"; -pub const PRIxFAST8: &[u8; 2usize] = b"x\0"; -pub const PRIxFAST64: &[u8; 4usize] = b"llx\0"; -pub const PRIxMAX: &[u8; 3usize] = b"jx\0"; -pub const PRIX8: &[u8; 2usize] = b"X\0"; -pub const PRIX16: &[u8; 2usize] = b"X\0"; -pub const PRIX32: &[u8; 2usize] = b"X\0"; -pub const PRIX64: &[u8; 4usize] = b"llX\0"; -pub const PRIXLEAST8: &[u8; 2usize] = b"X\0"; -pub const PRIXLEAST16: &[u8; 2usize] = b"X\0"; -pub const PRIXLEAST32: &[u8; 2usize] = b"X\0"; -pub const PRIXLEAST64: &[u8; 4usize] = b"llX\0"; -pub const PRIXFAST8: &[u8; 2usize] = b"X\0"; -pub const PRIXFAST64: &[u8; 4usize] = b"llX\0"; -pub const PRIXMAX: &[u8; 3usize] = b"jX\0"; -pub const SCNd8: &[u8; 4usize] = b"hhd\0"; -pub const SCNd16: &[u8; 3usize] = b"hd\0"; -pub const SCNd32: &[u8; 2usize] = b"d\0"; -pub const SCNd64: &[u8; 4usize] = b"lld\0"; -pub const SCNdLEAST8: &[u8; 4usize] = b"hhd\0"; -pub const SCNdLEAST16: &[u8; 3usize] = b"hd\0"; -pub const SCNdLEAST32: &[u8; 2usize] = b"d\0"; -pub const SCNdLEAST64: &[u8; 4usize] = b"lld\0"; -pub const SCNdFAST8: &[u8; 4usize] = b"hhd\0"; -pub const SCNdFAST64: &[u8; 4usize] = b"lld\0"; -pub const SCNdMAX: &[u8; 3usize] = b"jd\0"; -pub const SCNi8: &[u8; 4usize] = b"hhi\0"; -pub const SCNi16: &[u8; 3usize] = b"hi\0"; -pub const SCNi32: &[u8; 2usize] = b"i\0"; -pub const SCNi64: &[u8; 4usize] = b"lli\0"; -pub const SCNiLEAST8: &[u8; 4usize] = b"hhi\0"; -pub const SCNiLEAST16: &[u8; 3usize] = b"hi\0"; -pub const SCNiLEAST32: &[u8; 2usize] = b"i\0"; -pub const SCNiLEAST64: &[u8; 4usize] = b"lli\0"; -pub const SCNiFAST8: &[u8; 4usize] = b"hhi\0"; -pub const SCNiFAST64: &[u8; 4usize] = b"lli\0"; -pub const SCNiMAX: &[u8; 3usize] = b"ji\0"; -pub const SCNo8: &[u8; 4usize] = b"hho\0"; -pub const SCNo16: &[u8; 3usize] = b"ho\0"; -pub const SCNo32: &[u8; 2usize] = b"o\0"; -pub const SCNo64: &[u8; 4usize] = b"llo\0"; -pub const SCNoLEAST8: &[u8; 4usize] = b"hho\0"; -pub const SCNoLEAST16: &[u8; 3usize] = b"ho\0"; -pub const SCNoLEAST32: &[u8; 2usize] = b"o\0"; -pub const SCNoLEAST64: &[u8; 4usize] = b"llo\0"; -pub const SCNoFAST8: &[u8; 4usize] = b"hho\0"; -pub const SCNoFAST64: &[u8; 4usize] = b"llo\0"; -pub const SCNoMAX: &[u8; 3usize] = b"jo\0"; -pub const SCNu8: &[u8; 4usize] = b"hhu\0"; -pub const SCNu16: &[u8; 3usize] = b"hu\0"; -pub const SCNu32: &[u8; 2usize] = b"u\0"; -pub const SCNu64: &[u8; 4usize] = b"llu\0"; -pub const SCNuLEAST8: &[u8; 4usize] = b"hhu\0"; -pub const SCNuLEAST16: &[u8; 3usize] = b"hu\0"; -pub const SCNuLEAST32: &[u8; 2usize] = b"u\0"; -pub const SCNuLEAST64: &[u8; 4usize] = b"llu\0"; -pub const SCNuFAST8: &[u8; 4usize] = b"hhu\0"; -pub const SCNuFAST64: &[u8; 4usize] = b"llu\0"; -pub const SCNuMAX: &[u8; 3usize] = b"ju\0"; -pub const SCNx8: &[u8; 4usize] = b"hhx\0"; -pub const SCNx16: &[u8; 3usize] = b"hx\0"; -pub const SCNx32: &[u8; 2usize] = b"x\0"; -pub const SCNx64: &[u8; 4usize] = b"llx\0"; -pub const SCNxLEAST8: &[u8; 4usize] = b"hhx\0"; -pub const SCNxLEAST16: &[u8; 3usize] = b"hx\0"; -pub const SCNxLEAST32: &[u8; 2usize] = b"x\0"; -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 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; 3] = b"ll\0"; +pub const PRId8: &[u8; 2] = b"d\0"; +pub const PRId16: &[u8; 2] = b"d\0"; +pub const PRId32: &[u8; 2] = b"d\0"; +pub const PRId64: &[u8; 4] = b"lld\0"; +pub const PRIdLEAST8: &[u8; 2] = b"d\0"; +pub const PRIdLEAST16: &[u8; 2] = b"d\0"; +pub const PRIdLEAST32: &[u8; 2] = b"d\0"; +pub const PRIdLEAST64: &[u8; 4] = b"lld\0"; +pub const PRIdFAST8: &[u8; 2] = b"d\0"; +pub const PRIdFAST64: &[u8; 4] = b"lld\0"; +pub const PRIdMAX: &[u8; 3] = b"jd\0"; +pub const PRIi8: &[u8; 2] = b"i\0"; +pub const PRIi16: &[u8; 2] = b"i\0"; +pub const PRIi32: &[u8; 2] = b"i\0"; +pub const PRIi64: &[u8; 4] = b"lli\0"; +pub const PRIiLEAST8: &[u8; 2] = b"i\0"; +pub const PRIiLEAST16: &[u8; 2] = b"i\0"; +pub const PRIiLEAST32: &[u8; 2] = b"i\0"; +pub const PRIiLEAST64: &[u8; 4] = b"lli\0"; +pub const PRIiFAST8: &[u8; 2] = b"i\0"; +pub const PRIiFAST64: &[u8; 4] = b"lli\0"; +pub const PRIiMAX: &[u8; 3] = b"ji\0"; +pub const PRIo8: &[u8; 2] = b"o\0"; +pub const PRIo16: &[u8; 2] = b"o\0"; +pub const PRIo32: &[u8; 2] = b"o\0"; +pub const PRIo64: &[u8; 4] = b"llo\0"; +pub const PRIoLEAST8: &[u8; 2] = b"o\0"; +pub const PRIoLEAST16: &[u8; 2] = b"o\0"; +pub const PRIoLEAST32: &[u8; 2] = b"o\0"; +pub const PRIoLEAST64: &[u8; 4] = b"llo\0"; +pub const PRIoFAST8: &[u8; 2] = b"o\0"; +pub const PRIoFAST64: &[u8; 4] = b"llo\0"; +pub const PRIoMAX: &[u8; 3] = b"jo\0"; +pub const PRIu8: &[u8; 2] = b"u\0"; +pub const PRIu16: &[u8; 2] = b"u\0"; +pub const PRIu32: &[u8; 2] = b"u\0"; +pub const PRIu64: &[u8; 4] = b"llu\0"; +pub const PRIuLEAST8: &[u8; 2] = b"u\0"; +pub const PRIuLEAST16: &[u8; 2] = b"u\0"; +pub const PRIuLEAST32: &[u8; 2] = b"u\0"; +pub const PRIuLEAST64: &[u8; 4] = b"llu\0"; +pub const PRIuFAST8: &[u8; 2] = b"u\0"; +pub const PRIuFAST64: &[u8; 4] = b"llu\0"; +pub const PRIuMAX: &[u8; 3] = b"ju\0"; +pub const PRIx8: &[u8; 2] = b"x\0"; +pub const PRIx16: &[u8; 2] = b"x\0"; +pub const PRIx32: &[u8; 2] = b"x\0"; +pub const PRIx64: &[u8; 4] = b"llx\0"; +pub const PRIxLEAST8: &[u8; 2] = b"x\0"; +pub const PRIxLEAST16: &[u8; 2] = b"x\0"; +pub const PRIxLEAST32: &[u8; 2] = b"x\0"; +pub const PRIxLEAST64: &[u8; 4] = b"llx\0"; +pub const PRIxFAST8: &[u8; 2] = b"x\0"; +pub const PRIxFAST64: &[u8; 4] = b"llx\0"; +pub const PRIxMAX: &[u8; 3] = b"jx\0"; +pub const PRIX8: &[u8; 2] = b"X\0"; +pub const PRIX16: &[u8; 2] = b"X\0"; +pub const PRIX32: &[u8; 2] = b"X\0"; +pub const PRIX64: &[u8; 4] = b"llX\0"; +pub const PRIXLEAST8: &[u8; 2] = b"X\0"; +pub const PRIXLEAST16: &[u8; 2] = b"X\0"; +pub const PRIXLEAST32: &[u8; 2] = b"X\0"; +pub const PRIXLEAST64: &[u8; 4] = b"llX\0"; +pub const PRIXFAST8: &[u8; 2] = b"X\0"; +pub const PRIXFAST64: &[u8; 4] = b"llX\0"; +pub const PRIXMAX: &[u8; 3] = b"jX\0"; +pub const SCNd8: &[u8; 4] = b"hhd\0"; +pub const SCNd16: &[u8; 3] = b"hd\0"; +pub const SCNd32: &[u8; 2] = b"d\0"; +pub const SCNd64: &[u8; 4] = b"lld\0"; +pub const SCNdLEAST8: &[u8; 4] = b"hhd\0"; +pub const SCNdLEAST16: &[u8; 3] = b"hd\0"; +pub const SCNdLEAST32: &[u8; 2] = b"d\0"; +pub const SCNdLEAST64: &[u8; 4] = b"lld\0"; +pub const SCNdFAST8: &[u8; 4] = b"hhd\0"; +pub const SCNdFAST64: &[u8; 4] = b"lld\0"; +pub const SCNdMAX: &[u8; 3] = b"jd\0"; +pub const SCNi8: &[u8; 4] = b"hhi\0"; +pub const SCNi16: &[u8; 3] = b"hi\0"; +pub const SCNi32: &[u8; 2] = b"i\0"; +pub const SCNi64: &[u8; 4] = b"lli\0"; +pub const SCNiLEAST8: &[u8; 4] = b"hhi\0"; +pub const SCNiLEAST16: &[u8; 3] = b"hi\0"; +pub const SCNiLEAST32: &[u8; 2] = b"i\0"; +pub const SCNiLEAST64: &[u8; 4] = b"lli\0"; +pub const SCNiFAST8: &[u8; 4] = b"hhi\0"; +pub const SCNiFAST64: &[u8; 4] = b"lli\0"; +pub const SCNiMAX: &[u8; 3] = b"ji\0"; +pub const SCNo8: &[u8; 4] = b"hho\0"; +pub const SCNo16: &[u8; 3] = b"ho\0"; +pub const SCNo32: &[u8; 2] = b"o\0"; +pub const SCNo64: &[u8; 4] = b"llo\0"; +pub const SCNoLEAST8: &[u8; 4] = b"hho\0"; +pub const SCNoLEAST16: &[u8; 3] = b"ho\0"; +pub const SCNoLEAST32: &[u8; 2] = b"o\0"; +pub const SCNoLEAST64: &[u8; 4] = b"llo\0"; +pub const SCNoFAST8: &[u8; 4] = b"hho\0"; +pub const SCNoFAST64: &[u8; 4] = b"llo\0"; +pub const SCNoMAX: &[u8; 3] = b"jo\0"; +pub const SCNu8: &[u8; 4] = b"hhu\0"; +pub const SCNu16: &[u8; 3] = b"hu\0"; +pub const SCNu32: &[u8; 2] = b"u\0"; +pub const SCNu64: &[u8; 4] = b"llu\0"; +pub const SCNuLEAST8: &[u8; 4] = b"hhu\0"; +pub const SCNuLEAST16: &[u8; 3] = b"hu\0"; +pub const SCNuLEAST32: &[u8; 2] = b"u\0"; +pub const SCNuLEAST64: &[u8; 4] = b"llu\0"; +pub const SCNuFAST8: &[u8; 4] = b"hhu\0"; +pub const SCNuFAST64: &[u8; 4] = b"llu\0"; +pub const SCNuMAX: &[u8; 3] = b"ju\0"; +pub const SCNx8: &[u8; 4] = b"hhx\0"; +pub const SCNx16: &[u8; 3] = b"hx\0"; +pub const SCNx32: &[u8; 2] = b"x\0"; +pub const SCNx64: &[u8; 4] = b"llx\0"; +pub const SCNxLEAST8: &[u8; 4] = b"hhx\0"; +pub const SCNxLEAST16: &[u8; 3] = b"hx\0"; +pub const SCNxLEAST32: &[u8; 2] = b"x\0"; +pub const SCNxLEAST64: &[u8; 4] = b"llx\0"; +pub const SCNxFAST8: &[u8; 4] = b"hhx\0"; +pub const SCNxFAST64: &[u8; 4] = b"llx\0"; +pub const SCNxMAX: &[u8; 3] = b"jx\0"; 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; +pub const GAMETEXTINPUT_MAJOR_VERSION: u32 = 2; +pub const GAMETEXTINPUT_MINOR_VERSION: u32 = 0; +pub const GAMETEXTINPUT_BUGFIX_VERSION: u32 = 0; +pub const GAMEACTIVITY_MAJOR_VERSION: u32 = 2; +pub const GAMEACTIVITY_MINOR_VERSION: u32 = 0; +pub const GAMEACTIVITY_BUGFIX_VERSION: u32 = 2; pub const POLLIN: u32 = 1; pub const POLLPRI: u32 = 2; pub const POLLOUT: u32 = 4; @@ -435,18 +444,20 @@ 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; @@ -496,7 +507,9 @@ 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 NSIGSEGV: u32 = 7; +pub const SEGV_MTEAERR: u32 = 8; +pub const SEGV_MTESERR: u32 = 9; +pub const NSIGSEGV: u32 = 9; pub const BUS_ADRALN: u32 = 1; pub const BUS_ADRERR: u32 = 2; pub const BUS_OBJERR: u32 = 3; @@ -508,7 +521,8 @@ 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 NSIGTRAP: u32 = 5; +pub const TRAP_PERF: u32 = 6; +pub const NSIGTRAP: u32 = 6; pub const CLD_EXITED: u32 = 1; pub const CLD_KILLED: u32 = 2; pub const CLD_DUMPED: u32 = 3; @@ -524,7 +538,8 @@ 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 NSIGSYS: u32 = 1; +pub const SYS_USER_DISPATCH: u32 = 2; +pub const NSIGSYS: u32 = 2; pub const EMT_TAGOVF: u32 = 1; pub const NSIGEMT: u32 = 1; pub const SIGEV_SIGNAL: u32 = 0; @@ -570,6 +585,12 @@ 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; @@ -601,9 +622,6 @@ pub const PTHREAD_PROCESS_PRIVATE: u32 = 0; pub const PTHREAD_PROCESS_SHARED: u32 = 1; pub const PTHREAD_SCOPE_SYSTEM: u32 = 0; pub const PTHREAD_SCOPE_PROCESS: u32 = 1; -pub const NATIVE_APP_GLUE_MAX_NUM_MOTION_EVENTS: u32 = 16; -pub const NATIVE_APP_GLUE_MAX_HISTORICAL_POINTER_SAMPLES: u32 = 64; -pub const NATIVE_APP_GLUE_MAX_NUM_KEY_EVENTS: u32 = 4; pub const NATIVE_APP_GLUE_MAX_INPUT_BUFFERS: u32 = 2; extern "C" { pub fn android_get_application_target_sdk_version() -> ::std::os::raw::c_int; @@ -621,6 +639,8 @@ pub struct max_align_t { } #[test] fn bindgen_test_layout_max_align_t() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 16usize, @@ -632,9 +652,7 @@ fn bindgen_test_layout_max_align_t() { concat!("Alignment of ", stringify!(max_align_t)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).__clang_max_align_nonce1 as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).__clang_max_align_nonce1) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -644,9 +662,7 @@ fn bindgen_test_layout_max_align_t() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).__clang_max_align_nonce2 as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).__clang_max_align_nonce2) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -699,6 +715,8 @@ pub struct __kernel_fd_set { } #[test] fn bindgen_test_layout___kernel_fd_set() { + const UNINIT: ::std::mem::MaybeUninit<__kernel_fd_set> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__kernel_fd_set>(), 128usize, @@ -710,7 +728,7 @@ fn bindgen_test_layout___kernel_fd_set() { concat!("Alignment of ", stringify!(__kernel_fd_set)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_fd_set>())).fds_bits as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).fds_bits) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -749,6 +767,8 @@ pub struct __kernel_fsid_t { } #[test] fn bindgen_test_layout___kernel_fsid_t() { + const UNINIT: ::std::mem::MaybeUninit<__kernel_fsid_t> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__kernel_fsid_t>(), 8usize, @@ -760,7 +780,7 @@ fn bindgen_test_layout___kernel_fsid_t() { concat!("Alignment of ", stringify!(__kernel_fsid_t)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_fsid_t>())).val as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).val) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -772,6 +792,7 @@ 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; @@ -830,7 +851,6 @@ pub type off64_t = loff_t; pub type __socklen_t = i32; pub type socklen_t = __socklen_t; pub type __va_list = __builtin_va_list; -pub type ssize_t = __kernel_ssize_t; pub type uint_t = ::std::os::raw::c_uint; pub type uint = ::std::os::raw::c_uint; pub type u_char = ::std::os::raw::c_uchar; @@ -841,483 +861,651 @@ pub type u_int32_t = u32; pub type u_int16_t = u16; pub type u_int8_t = u8; pub type u_int64_t = u64; -pub const AASSET_MODE_UNKNOWN: ::std::os::raw::c_uint = 0; -pub const AASSET_MODE_RANDOM: ::std::os::raw::c_uint = 1; -pub const AASSET_MODE_STREAMING: ::std::os::raw::c_uint = 2; -pub const AASSET_MODE_BUFFER: ::std::os::raw::c_uint = 3; +pub const AASSET_MODE_UNKNOWN: _bindgen_ty_1 = 0; +pub const AASSET_MODE_RANDOM: _bindgen_ty_1 = 1; +pub const AASSET_MODE_STREAMING: _bindgen_ty_1 = 2; +pub const AASSET_MODE_BUFFER: _bindgen_ty_1 = 3; pub type _bindgen_ty_1 = ::std::os::raw::c_uint; -pub const AKEYCODE_UNKNOWN: ::std::os::raw::c_uint = 0; -pub const AKEYCODE_SOFT_LEFT: ::std::os::raw::c_uint = 1; -pub const AKEYCODE_SOFT_RIGHT: ::std::os::raw::c_uint = 2; -pub const AKEYCODE_HOME: ::std::os::raw::c_uint = 3; -pub const AKEYCODE_BACK: ::std::os::raw::c_uint = 4; -pub const AKEYCODE_CALL: ::std::os::raw::c_uint = 5; -pub const AKEYCODE_ENDCALL: ::std::os::raw::c_uint = 6; -pub const AKEYCODE_0: ::std::os::raw::c_uint = 7; -pub const AKEYCODE_1: ::std::os::raw::c_uint = 8; -pub const AKEYCODE_2: ::std::os::raw::c_uint = 9; -pub const AKEYCODE_3: ::std::os::raw::c_uint = 10; -pub const AKEYCODE_4: ::std::os::raw::c_uint = 11; -pub const AKEYCODE_5: ::std::os::raw::c_uint = 12; -pub const AKEYCODE_6: ::std::os::raw::c_uint = 13; -pub const AKEYCODE_7: ::std::os::raw::c_uint = 14; -pub const AKEYCODE_8: ::std::os::raw::c_uint = 15; -pub const AKEYCODE_9: ::std::os::raw::c_uint = 16; -pub const AKEYCODE_STAR: ::std::os::raw::c_uint = 17; -pub const AKEYCODE_POUND: ::std::os::raw::c_uint = 18; -pub const AKEYCODE_DPAD_UP: ::std::os::raw::c_uint = 19; -pub const AKEYCODE_DPAD_DOWN: ::std::os::raw::c_uint = 20; -pub const AKEYCODE_DPAD_LEFT: ::std::os::raw::c_uint = 21; -pub const AKEYCODE_DPAD_RIGHT: ::std::os::raw::c_uint = 22; -pub const AKEYCODE_DPAD_CENTER: ::std::os::raw::c_uint = 23; -pub const AKEYCODE_VOLUME_UP: ::std::os::raw::c_uint = 24; -pub const AKEYCODE_VOLUME_DOWN: ::std::os::raw::c_uint = 25; -pub const AKEYCODE_POWER: ::std::os::raw::c_uint = 26; -pub const AKEYCODE_CAMERA: ::std::os::raw::c_uint = 27; -pub const AKEYCODE_CLEAR: ::std::os::raw::c_uint = 28; -pub const AKEYCODE_A: ::std::os::raw::c_uint = 29; -pub const AKEYCODE_B: ::std::os::raw::c_uint = 30; -pub const AKEYCODE_C: ::std::os::raw::c_uint = 31; -pub const AKEYCODE_D: ::std::os::raw::c_uint = 32; -pub const AKEYCODE_E: ::std::os::raw::c_uint = 33; -pub const AKEYCODE_F: ::std::os::raw::c_uint = 34; -pub const AKEYCODE_G: ::std::os::raw::c_uint = 35; -pub const AKEYCODE_H: ::std::os::raw::c_uint = 36; -pub const AKEYCODE_I: ::std::os::raw::c_uint = 37; -pub const AKEYCODE_J: ::std::os::raw::c_uint = 38; -pub const AKEYCODE_K: ::std::os::raw::c_uint = 39; -pub const AKEYCODE_L: ::std::os::raw::c_uint = 40; -pub const AKEYCODE_M: ::std::os::raw::c_uint = 41; -pub const AKEYCODE_N: ::std::os::raw::c_uint = 42; -pub const AKEYCODE_O: ::std::os::raw::c_uint = 43; -pub const AKEYCODE_P: ::std::os::raw::c_uint = 44; -pub const AKEYCODE_Q: ::std::os::raw::c_uint = 45; -pub const AKEYCODE_R: ::std::os::raw::c_uint = 46; -pub const AKEYCODE_S: ::std::os::raw::c_uint = 47; -pub const AKEYCODE_T: ::std::os::raw::c_uint = 48; -pub const AKEYCODE_U: ::std::os::raw::c_uint = 49; -pub const AKEYCODE_V: ::std::os::raw::c_uint = 50; -pub const AKEYCODE_W: ::std::os::raw::c_uint = 51; -pub const AKEYCODE_X: ::std::os::raw::c_uint = 52; -pub const AKEYCODE_Y: ::std::os::raw::c_uint = 53; -pub const AKEYCODE_Z: ::std::os::raw::c_uint = 54; -pub const AKEYCODE_COMMA: ::std::os::raw::c_uint = 55; -pub const AKEYCODE_PERIOD: ::std::os::raw::c_uint = 56; -pub const AKEYCODE_ALT_LEFT: ::std::os::raw::c_uint = 57; -pub const AKEYCODE_ALT_RIGHT: ::std::os::raw::c_uint = 58; -pub const AKEYCODE_SHIFT_LEFT: ::std::os::raw::c_uint = 59; -pub const AKEYCODE_SHIFT_RIGHT: ::std::os::raw::c_uint = 60; -pub const AKEYCODE_TAB: ::std::os::raw::c_uint = 61; -pub const AKEYCODE_SPACE: ::std::os::raw::c_uint = 62; -pub const AKEYCODE_SYM: ::std::os::raw::c_uint = 63; -pub const AKEYCODE_EXPLORER: ::std::os::raw::c_uint = 64; -pub const AKEYCODE_ENVELOPE: ::std::os::raw::c_uint = 65; -pub const AKEYCODE_ENTER: ::std::os::raw::c_uint = 66; -pub const AKEYCODE_DEL: ::std::os::raw::c_uint = 67; -pub const AKEYCODE_GRAVE: ::std::os::raw::c_uint = 68; -pub const AKEYCODE_MINUS: ::std::os::raw::c_uint = 69; -pub const AKEYCODE_EQUALS: ::std::os::raw::c_uint = 70; -pub const AKEYCODE_LEFT_BRACKET: ::std::os::raw::c_uint = 71; -pub const AKEYCODE_RIGHT_BRACKET: ::std::os::raw::c_uint = 72; -pub const AKEYCODE_BACKSLASH: ::std::os::raw::c_uint = 73; -pub const AKEYCODE_SEMICOLON: ::std::os::raw::c_uint = 74; -pub const AKEYCODE_APOSTROPHE: ::std::os::raw::c_uint = 75; -pub const AKEYCODE_SLASH: ::std::os::raw::c_uint = 76; -pub const AKEYCODE_AT: ::std::os::raw::c_uint = 77; -pub const AKEYCODE_NUM: ::std::os::raw::c_uint = 78; -pub const AKEYCODE_HEADSETHOOK: ::std::os::raw::c_uint = 79; -pub const AKEYCODE_FOCUS: ::std::os::raw::c_uint = 80; -pub const AKEYCODE_PLUS: ::std::os::raw::c_uint = 81; -pub const AKEYCODE_MENU: ::std::os::raw::c_uint = 82; -pub const AKEYCODE_NOTIFICATION: ::std::os::raw::c_uint = 83; -pub const AKEYCODE_SEARCH: ::std::os::raw::c_uint = 84; -pub const AKEYCODE_MEDIA_PLAY_PAUSE: ::std::os::raw::c_uint = 85; -pub const AKEYCODE_MEDIA_STOP: ::std::os::raw::c_uint = 86; -pub const AKEYCODE_MEDIA_NEXT: ::std::os::raw::c_uint = 87; -pub const AKEYCODE_MEDIA_PREVIOUS: ::std::os::raw::c_uint = 88; -pub const AKEYCODE_MEDIA_REWIND: ::std::os::raw::c_uint = 89; -pub const AKEYCODE_MEDIA_FAST_FORWARD: ::std::os::raw::c_uint = 90; -pub const AKEYCODE_MUTE: ::std::os::raw::c_uint = 91; -pub const AKEYCODE_PAGE_UP: ::std::os::raw::c_uint = 92; -pub const AKEYCODE_PAGE_DOWN: ::std::os::raw::c_uint = 93; -pub const AKEYCODE_PICTSYMBOLS: ::std::os::raw::c_uint = 94; -pub const AKEYCODE_SWITCH_CHARSET: ::std::os::raw::c_uint = 95; -pub const AKEYCODE_BUTTON_A: ::std::os::raw::c_uint = 96; -pub const AKEYCODE_BUTTON_B: ::std::os::raw::c_uint = 97; -pub const AKEYCODE_BUTTON_C: ::std::os::raw::c_uint = 98; -pub const AKEYCODE_BUTTON_X: ::std::os::raw::c_uint = 99; -pub const AKEYCODE_BUTTON_Y: ::std::os::raw::c_uint = 100; -pub const AKEYCODE_BUTTON_Z: ::std::os::raw::c_uint = 101; -pub const AKEYCODE_BUTTON_L1: ::std::os::raw::c_uint = 102; -pub const AKEYCODE_BUTTON_R1: ::std::os::raw::c_uint = 103; -pub const AKEYCODE_BUTTON_L2: ::std::os::raw::c_uint = 104; -pub const AKEYCODE_BUTTON_R2: ::std::os::raw::c_uint = 105; -pub const AKEYCODE_BUTTON_THUMBL: ::std::os::raw::c_uint = 106; -pub const AKEYCODE_BUTTON_THUMBR: ::std::os::raw::c_uint = 107; -pub const AKEYCODE_BUTTON_START: ::std::os::raw::c_uint = 108; -pub const AKEYCODE_BUTTON_SELECT: ::std::os::raw::c_uint = 109; -pub const AKEYCODE_BUTTON_MODE: ::std::os::raw::c_uint = 110; -pub const AKEYCODE_ESCAPE: ::std::os::raw::c_uint = 111; -pub const AKEYCODE_FORWARD_DEL: ::std::os::raw::c_uint = 112; -pub const AKEYCODE_CTRL_LEFT: ::std::os::raw::c_uint = 113; -pub const AKEYCODE_CTRL_RIGHT: ::std::os::raw::c_uint = 114; -pub const AKEYCODE_CAPS_LOCK: ::std::os::raw::c_uint = 115; -pub const AKEYCODE_SCROLL_LOCK: ::std::os::raw::c_uint = 116; -pub const AKEYCODE_META_LEFT: ::std::os::raw::c_uint = 117; -pub const AKEYCODE_META_RIGHT: ::std::os::raw::c_uint = 118; -pub const AKEYCODE_FUNCTION: ::std::os::raw::c_uint = 119; -pub const AKEYCODE_SYSRQ: ::std::os::raw::c_uint = 120; -pub const AKEYCODE_BREAK: ::std::os::raw::c_uint = 121; -pub const AKEYCODE_MOVE_HOME: ::std::os::raw::c_uint = 122; -pub const AKEYCODE_MOVE_END: ::std::os::raw::c_uint = 123; -pub const AKEYCODE_INSERT: ::std::os::raw::c_uint = 124; -pub const AKEYCODE_FORWARD: ::std::os::raw::c_uint = 125; -pub const AKEYCODE_MEDIA_PLAY: ::std::os::raw::c_uint = 126; -pub const AKEYCODE_MEDIA_PAUSE: ::std::os::raw::c_uint = 127; -pub const AKEYCODE_MEDIA_CLOSE: ::std::os::raw::c_uint = 128; -pub const AKEYCODE_MEDIA_EJECT: ::std::os::raw::c_uint = 129; -pub const AKEYCODE_MEDIA_RECORD: ::std::os::raw::c_uint = 130; -pub const AKEYCODE_F1: ::std::os::raw::c_uint = 131; -pub const AKEYCODE_F2: ::std::os::raw::c_uint = 132; -pub const AKEYCODE_F3: ::std::os::raw::c_uint = 133; -pub const AKEYCODE_F4: ::std::os::raw::c_uint = 134; -pub const AKEYCODE_F5: ::std::os::raw::c_uint = 135; -pub const AKEYCODE_F6: ::std::os::raw::c_uint = 136; -pub const AKEYCODE_F7: ::std::os::raw::c_uint = 137; -pub const AKEYCODE_F8: ::std::os::raw::c_uint = 138; -pub const AKEYCODE_F9: ::std::os::raw::c_uint = 139; -pub const AKEYCODE_F10: ::std::os::raw::c_uint = 140; -pub const AKEYCODE_F11: ::std::os::raw::c_uint = 141; -pub const AKEYCODE_F12: ::std::os::raw::c_uint = 142; -pub const AKEYCODE_NUM_LOCK: ::std::os::raw::c_uint = 143; -pub const AKEYCODE_NUMPAD_0: ::std::os::raw::c_uint = 144; -pub const AKEYCODE_NUMPAD_1: ::std::os::raw::c_uint = 145; -pub const AKEYCODE_NUMPAD_2: ::std::os::raw::c_uint = 146; -pub const AKEYCODE_NUMPAD_3: ::std::os::raw::c_uint = 147; -pub const AKEYCODE_NUMPAD_4: ::std::os::raw::c_uint = 148; -pub const AKEYCODE_NUMPAD_5: ::std::os::raw::c_uint = 149; -pub const AKEYCODE_NUMPAD_6: ::std::os::raw::c_uint = 150; -pub const AKEYCODE_NUMPAD_7: ::std::os::raw::c_uint = 151; -pub const AKEYCODE_NUMPAD_8: ::std::os::raw::c_uint = 152; -pub const AKEYCODE_NUMPAD_9: ::std::os::raw::c_uint = 153; -pub const AKEYCODE_NUMPAD_DIVIDE: ::std::os::raw::c_uint = 154; -pub const AKEYCODE_NUMPAD_MULTIPLY: ::std::os::raw::c_uint = 155; -pub const AKEYCODE_NUMPAD_SUBTRACT: ::std::os::raw::c_uint = 156; -pub const AKEYCODE_NUMPAD_ADD: ::std::os::raw::c_uint = 157; -pub const AKEYCODE_NUMPAD_DOT: ::std::os::raw::c_uint = 158; -pub const AKEYCODE_NUMPAD_COMMA: ::std::os::raw::c_uint = 159; -pub const AKEYCODE_NUMPAD_ENTER: ::std::os::raw::c_uint = 160; -pub const AKEYCODE_NUMPAD_EQUALS: ::std::os::raw::c_uint = 161; -pub const AKEYCODE_NUMPAD_LEFT_PAREN: ::std::os::raw::c_uint = 162; -pub const AKEYCODE_NUMPAD_RIGHT_PAREN: ::std::os::raw::c_uint = 163; -pub const AKEYCODE_VOLUME_MUTE: ::std::os::raw::c_uint = 164; -pub const AKEYCODE_INFO: ::std::os::raw::c_uint = 165; -pub const AKEYCODE_CHANNEL_UP: ::std::os::raw::c_uint = 166; -pub const AKEYCODE_CHANNEL_DOWN: ::std::os::raw::c_uint = 167; -pub const AKEYCODE_ZOOM_IN: ::std::os::raw::c_uint = 168; -pub const AKEYCODE_ZOOM_OUT: ::std::os::raw::c_uint = 169; -pub const AKEYCODE_TV: ::std::os::raw::c_uint = 170; -pub const AKEYCODE_WINDOW: ::std::os::raw::c_uint = 171; -pub const AKEYCODE_GUIDE: ::std::os::raw::c_uint = 172; -pub const AKEYCODE_DVR: ::std::os::raw::c_uint = 173; -pub const AKEYCODE_BOOKMARK: ::std::os::raw::c_uint = 174; -pub const AKEYCODE_CAPTIONS: ::std::os::raw::c_uint = 175; -pub const AKEYCODE_SETTINGS: ::std::os::raw::c_uint = 176; -pub const AKEYCODE_TV_POWER: ::std::os::raw::c_uint = 177; -pub const AKEYCODE_TV_INPUT: ::std::os::raw::c_uint = 178; -pub const AKEYCODE_STB_POWER: ::std::os::raw::c_uint = 179; -pub const AKEYCODE_STB_INPUT: ::std::os::raw::c_uint = 180; -pub const AKEYCODE_AVR_POWER: ::std::os::raw::c_uint = 181; -pub const AKEYCODE_AVR_INPUT: ::std::os::raw::c_uint = 182; -pub const AKEYCODE_PROG_RED: ::std::os::raw::c_uint = 183; -pub const AKEYCODE_PROG_GREEN: ::std::os::raw::c_uint = 184; -pub const AKEYCODE_PROG_YELLOW: ::std::os::raw::c_uint = 185; -pub const AKEYCODE_PROG_BLUE: ::std::os::raw::c_uint = 186; -pub const AKEYCODE_APP_SWITCH: ::std::os::raw::c_uint = 187; -pub const AKEYCODE_BUTTON_1: ::std::os::raw::c_uint = 188; -pub const AKEYCODE_BUTTON_2: ::std::os::raw::c_uint = 189; -pub const AKEYCODE_BUTTON_3: ::std::os::raw::c_uint = 190; -pub const AKEYCODE_BUTTON_4: ::std::os::raw::c_uint = 191; -pub const AKEYCODE_BUTTON_5: ::std::os::raw::c_uint = 192; -pub const AKEYCODE_BUTTON_6: ::std::os::raw::c_uint = 193; -pub const AKEYCODE_BUTTON_7: ::std::os::raw::c_uint = 194; -pub const AKEYCODE_BUTTON_8: ::std::os::raw::c_uint = 195; -pub const AKEYCODE_BUTTON_9: ::std::os::raw::c_uint = 196; -pub const AKEYCODE_BUTTON_10: ::std::os::raw::c_uint = 197; -pub const AKEYCODE_BUTTON_11: ::std::os::raw::c_uint = 198; -pub const AKEYCODE_BUTTON_12: ::std::os::raw::c_uint = 199; -pub const AKEYCODE_BUTTON_13: ::std::os::raw::c_uint = 200; -pub const AKEYCODE_BUTTON_14: ::std::os::raw::c_uint = 201; -pub const AKEYCODE_BUTTON_15: ::std::os::raw::c_uint = 202; -pub const AKEYCODE_BUTTON_16: ::std::os::raw::c_uint = 203; -pub const AKEYCODE_LANGUAGE_SWITCH: ::std::os::raw::c_uint = 204; -pub const AKEYCODE_MANNER_MODE: ::std::os::raw::c_uint = 205; -pub const AKEYCODE_3D_MODE: ::std::os::raw::c_uint = 206; -pub const AKEYCODE_CONTACTS: ::std::os::raw::c_uint = 207; -pub const AKEYCODE_CALENDAR: ::std::os::raw::c_uint = 208; -pub const AKEYCODE_MUSIC: ::std::os::raw::c_uint = 209; -pub const AKEYCODE_CALCULATOR: ::std::os::raw::c_uint = 210; -pub const AKEYCODE_ZENKAKU_HANKAKU: ::std::os::raw::c_uint = 211; -pub const AKEYCODE_EISU: ::std::os::raw::c_uint = 212; -pub const AKEYCODE_MUHENKAN: ::std::os::raw::c_uint = 213; -pub const AKEYCODE_HENKAN: ::std::os::raw::c_uint = 214; -pub const AKEYCODE_KATAKANA_HIRAGANA: ::std::os::raw::c_uint = 215; -pub const AKEYCODE_YEN: ::std::os::raw::c_uint = 216; -pub const AKEYCODE_RO: ::std::os::raw::c_uint = 217; -pub const AKEYCODE_KANA: ::std::os::raw::c_uint = 218; -pub const AKEYCODE_ASSIST: ::std::os::raw::c_uint = 219; -pub const AKEYCODE_BRIGHTNESS_DOWN: ::std::os::raw::c_uint = 220; -pub const AKEYCODE_BRIGHTNESS_UP: ::std::os::raw::c_uint = 221; -pub const AKEYCODE_MEDIA_AUDIO_TRACK: ::std::os::raw::c_uint = 222; -pub const AKEYCODE_SLEEP: ::std::os::raw::c_uint = 223; -pub const AKEYCODE_WAKEUP: ::std::os::raw::c_uint = 224; -pub const AKEYCODE_PAIRING: ::std::os::raw::c_uint = 225; -pub const AKEYCODE_MEDIA_TOP_MENU: ::std::os::raw::c_uint = 226; -pub const AKEYCODE_11: ::std::os::raw::c_uint = 227; -pub const AKEYCODE_12: ::std::os::raw::c_uint = 228; -pub const AKEYCODE_LAST_CHANNEL: ::std::os::raw::c_uint = 229; -pub const AKEYCODE_TV_DATA_SERVICE: ::std::os::raw::c_uint = 230; -pub const AKEYCODE_VOICE_ASSIST: ::std::os::raw::c_uint = 231; -pub const AKEYCODE_TV_RADIO_SERVICE: ::std::os::raw::c_uint = 232; -pub const AKEYCODE_TV_TELETEXT: ::std::os::raw::c_uint = 233; -pub const AKEYCODE_TV_NUMBER_ENTRY: ::std::os::raw::c_uint = 234; -pub const AKEYCODE_TV_TERRESTRIAL_ANALOG: ::std::os::raw::c_uint = 235; -pub const AKEYCODE_TV_TERRESTRIAL_DIGITAL: ::std::os::raw::c_uint = 236; -pub const AKEYCODE_TV_SATELLITE: ::std::os::raw::c_uint = 237; -pub const AKEYCODE_TV_SATELLITE_BS: ::std::os::raw::c_uint = 238; -pub const AKEYCODE_TV_SATELLITE_CS: ::std::os::raw::c_uint = 239; -pub const AKEYCODE_TV_SATELLITE_SERVICE: ::std::os::raw::c_uint = 240; -pub const AKEYCODE_TV_NETWORK: ::std::os::raw::c_uint = 241; -pub const AKEYCODE_TV_ANTENNA_CABLE: ::std::os::raw::c_uint = 242; -pub const AKEYCODE_TV_INPUT_HDMI_1: ::std::os::raw::c_uint = 243; -pub const AKEYCODE_TV_INPUT_HDMI_2: ::std::os::raw::c_uint = 244; -pub const AKEYCODE_TV_INPUT_HDMI_3: ::std::os::raw::c_uint = 245; -pub const AKEYCODE_TV_INPUT_HDMI_4: ::std::os::raw::c_uint = 246; -pub const AKEYCODE_TV_INPUT_COMPOSITE_1: ::std::os::raw::c_uint = 247; -pub const AKEYCODE_TV_INPUT_COMPOSITE_2: ::std::os::raw::c_uint = 248; -pub const AKEYCODE_TV_INPUT_COMPONENT_1: ::std::os::raw::c_uint = 249; -pub const AKEYCODE_TV_INPUT_COMPONENT_2: ::std::os::raw::c_uint = 250; -pub const AKEYCODE_TV_INPUT_VGA_1: ::std::os::raw::c_uint = 251; -pub const AKEYCODE_TV_AUDIO_DESCRIPTION: ::std::os::raw::c_uint = 252; -pub const AKEYCODE_TV_AUDIO_DESCRIPTION_MIX_UP: ::std::os::raw::c_uint = 253; -pub const AKEYCODE_TV_AUDIO_DESCRIPTION_MIX_DOWN: ::std::os::raw::c_uint = 254; -pub const AKEYCODE_TV_ZOOM_MODE: ::std::os::raw::c_uint = 255; -pub const AKEYCODE_TV_CONTENTS_MENU: ::std::os::raw::c_uint = 256; -pub const AKEYCODE_TV_MEDIA_CONTEXT_MENU: ::std::os::raw::c_uint = 257; -pub const AKEYCODE_TV_TIMER_PROGRAMMING: ::std::os::raw::c_uint = 258; -pub const AKEYCODE_HELP: ::std::os::raw::c_uint = 259; -pub const AKEYCODE_NAVIGATE_PREVIOUS: ::std::os::raw::c_uint = 260; -pub const AKEYCODE_NAVIGATE_NEXT: ::std::os::raw::c_uint = 261; -pub const AKEYCODE_NAVIGATE_IN: ::std::os::raw::c_uint = 262; -pub const AKEYCODE_NAVIGATE_OUT: ::std::os::raw::c_uint = 263; -pub const AKEYCODE_STEM_PRIMARY: ::std::os::raw::c_uint = 264; -pub const AKEYCODE_STEM_1: ::std::os::raw::c_uint = 265; -pub const AKEYCODE_STEM_2: ::std::os::raw::c_uint = 266; -pub const AKEYCODE_STEM_3: ::std::os::raw::c_uint = 267; -pub const AKEYCODE_DPAD_UP_LEFT: ::std::os::raw::c_uint = 268; -pub const AKEYCODE_DPAD_DOWN_LEFT: ::std::os::raw::c_uint = 269; -pub const AKEYCODE_DPAD_UP_RIGHT: ::std::os::raw::c_uint = 270; -pub const AKEYCODE_DPAD_DOWN_RIGHT: ::std::os::raw::c_uint = 271; -pub const AKEYCODE_MEDIA_SKIP_FORWARD: ::std::os::raw::c_uint = 272; -pub const AKEYCODE_MEDIA_SKIP_BACKWARD: ::std::os::raw::c_uint = 273; -pub const AKEYCODE_MEDIA_STEP_FORWARD: ::std::os::raw::c_uint = 274; -pub const AKEYCODE_MEDIA_STEP_BACKWARD: ::std::os::raw::c_uint = 275; -pub const AKEYCODE_SOFT_SLEEP: ::std::os::raw::c_uint = 276; -pub const AKEYCODE_CUT: ::std::os::raw::c_uint = 277; -pub const AKEYCODE_COPY: ::std::os::raw::c_uint = 278; -pub const AKEYCODE_PASTE: ::std::os::raw::c_uint = 279; -pub const AKEYCODE_SYSTEM_NAVIGATION_UP: ::std::os::raw::c_uint = 280; -pub const AKEYCODE_SYSTEM_NAVIGATION_DOWN: ::std::os::raw::c_uint = 281; -pub const AKEYCODE_SYSTEM_NAVIGATION_LEFT: ::std::os::raw::c_uint = 282; -pub const AKEYCODE_SYSTEM_NAVIGATION_RIGHT: ::std::os::raw::c_uint = 283; -pub const AKEYCODE_ALL_APPS: ::std::os::raw::c_uint = 284; -pub const AKEYCODE_REFRESH: ::std::os::raw::c_uint = 285; -pub const AKEYCODE_THUMBS_UP: ::std::os::raw::c_uint = 286; -pub const AKEYCODE_THUMBS_DOWN: ::std::os::raw::c_uint = 287; -pub const AKEYCODE_PROFILE_SWITCH: ::std::os::raw::c_uint = 288; +pub const AKEYCODE_UNKNOWN: _bindgen_ty_2 = 0; +pub const AKEYCODE_SOFT_LEFT: _bindgen_ty_2 = 1; +pub const AKEYCODE_SOFT_RIGHT: _bindgen_ty_2 = 2; +pub const AKEYCODE_HOME: _bindgen_ty_2 = 3; +pub const AKEYCODE_BACK: _bindgen_ty_2 = 4; +pub const AKEYCODE_CALL: _bindgen_ty_2 = 5; +pub const AKEYCODE_ENDCALL: _bindgen_ty_2 = 6; +pub const AKEYCODE_0: _bindgen_ty_2 = 7; +pub const AKEYCODE_1: _bindgen_ty_2 = 8; +pub const AKEYCODE_2: _bindgen_ty_2 = 9; +pub const AKEYCODE_3: _bindgen_ty_2 = 10; +pub const AKEYCODE_4: _bindgen_ty_2 = 11; +pub const AKEYCODE_5: _bindgen_ty_2 = 12; +pub const AKEYCODE_6: _bindgen_ty_2 = 13; +pub const AKEYCODE_7: _bindgen_ty_2 = 14; +pub const AKEYCODE_8: _bindgen_ty_2 = 15; +pub const AKEYCODE_9: _bindgen_ty_2 = 16; +pub const AKEYCODE_STAR: _bindgen_ty_2 = 17; +pub const AKEYCODE_POUND: _bindgen_ty_2 = 18; +pub const AKEYCODE_DPAD_UP: _bindgen_ty_2 = 19; +pub const AKEYCODE_DPAD_DOWN: _bindgen_ty_2 = 20; +pub const AKEYCODE_DPAD_LEFT: _bindgen_ty_2 = 21; +pub const AKEYCODE_DPAD_RIGHT: _bindgen_ty_2 = 22; +pub const AKEYCODE_DPAD_CENTER: _bindgen_ty_2 = 23; +pub const AKEYCODE_VOLUME_UP: _bindgen_ty_2 = 24; +pub const AKEYCODE_VOLUME_DOWN: _bindgen_ty_2 = 25; +pub const AKEYCODE_POWER: _bindgen_ty_2 = 26; +pub const AKEYCODE_CAMERA: _bindgen_ty_2 = 27; +pub const AKEYCODE_CLEAR: _bindgen_ty_2 = 28; +pub const AKEYCODE_A: _bindgen_ty_2 = 29; +pub const AKEYCODE_B: _bindgen_ty_2 = 30; +pub const AKEYCODE_C: _bindgen_ty_2 = 31; +pub const AKEYCODE_D: _bindgen_ty_2 = 32; +pub const AKEYCODE_E: _bindgen_ty_2 = 33; +pub const AKEYCODE_F: _bindgen_ty_2 = 34; +pub const AKEYCODE_G: _bindgen_ty_2 = 35; +pub const AKEYCODE_H: _bindgen_ty_2 = 36; +pub const AKEYCODE_I: _bindgen_ty_2 = 37; +pub const AKEYCODE_J: _bindgen_ty_2 = 38; +pub const AKEYCODE_K: _bindgen_ty_2 = 39; +pub const AKEYCODE_L: _bindgen_ty_2 = 40; +pub const AKEYCODE_M: _bindgen_ty_2 = 41; +pub const AKEYCODE_N: _bindgen_ty_2 = 42; +pub const AKEYCODE_O: _bindgen_ty_2 = 43; +pub const AKEYCODE_P: _bindgen_ty_2 = 44; +pub const AKEYCODE_Q: _bindgen_ty_2 = 45; +pub const AKEYCODE_R: _bindgen_ty_2 = 46; +pub const AKEYCODE_S: _bindgen_ty_2 = 47; +pub const AKEYCODE_T: _bindgen_ty_2 = 48; +pub const AKEYCODE_U: _bindgen_ty_2 = 49; +pub const AKEYCODE_V: _bindgen_ty_2 = 50; +pub const AKEYCODE_W: _bindgen_ty_2 = 51; +pub const AKEYCODE_X: _bindgen_ty_2 = 52; +pub const AKEYCODE_Y: _bindgen_ty_2 = 53; +pub const AKEYCODE_Z: _bindgen_ty_2 = 54; +pub const AKEYCODE_COMMA: _bindgen_ty_2 = 55; +pub const AKEYCODE_PERIOD: _bindgen_ty_2 = 56; +pub const AKEYCODE_ALT_LEFT: _bindgen_ty_2 = 57; +pub const AKEYCODE_ALT_RIGHT: _bindgen_ty_2 = 58; +pub const AKEYCODE_SHIFT_LEFT: _bindgen_ty_2 = 59; +pub const AKEYCODE_SHIFT_RIGHT: _bindgen_ty_2 = 60; +pub const AKEYCODE_TAB: _bindgen_ty_2 = 61; +pub const AKEYCODE_SPACE: _bindgen_ty_2 = 62; +pub const AKEYCODE_SYM: _bindgen_ty_2 = 63; +pub const AKEYCODE_EXPLORER: _bindgen_ty_2 = 64; +pub const AKEYCODE_ENVELOPE: _bindgen_ty_2 = 65; +pub const AKEYCODE_ENTER: _bindgen_ty_2 = 66; +pub const AKEYCODE_DEL: _bindgen_ty_2 = 67; +pub const AKEYCODE_GRAVE: _bindgen_ty_2 = 68; +pub const AKEYCODE_MINUS: _bindgen_ty_2 = 69; +pub const AKEYCODE_EQUALS: _bindgen_ty_2 = 70; +pub const AKEYCODE_LEFT_BRACKET: _bindgen_ty_2 = 71; +pub const AKEYCODE_RIGHT_BRACKET: _bindgen_ty_2 = 72; +pub const AKEYCODE_BACKSLASH: _bindgen_ty_2 = 73; +pub const AKEYCODE_SEMICOLON: _bindgen_ty_2 = 74; +pub const AKEYCODE_APOSTROPHE: _bindgen_ty_2 = 75; +pub const AKEYCODE_SLASH: _bindgen_ty_2 = 76; +pub const AKEYCODE_AT: _bindgen_ty_2 = 77; +pub const AKEYCODE_NUM: _bindgen_ty_2 = 78; +pub const AKEYCODE_HEADSETHOOK: _bindgen_ty_2 = 79; +pub const AKEYCODE_FOCUS: _bindgen_ty_2 = 80; +pub const AKEYCODE_PLUS: _bindgen_ty_2 = 81; +pub const AKEYCODE_MENU: _bindgen_ty_2 = 82; +pub const AKEYCODE_NOTIFICATION: _bindgen_ty_2 = 83; +pub const AKEYCODE_SEARCH: _bindgen_ty_2 = 84; +pub const AKEYCODE_MEDIA_PLAY_PAUSE: _bindgen_ty_2 = 85; +pub const AKEYCODE_MEDIA_STOP: _bindgen_ty_2 = 86; +pub const AKEYCODE_MEDIA_NEXT: _bindgen_ty_2 = 87; +pub const AKEYCODE_MEDIA_PREVIOUS: _bindgen_ty_2 = 88; +pub const AKEYCODE_MEDIA_REWIND: _bindgen_ty_2 = 89; +pub const AKEYCODE_MEDIA_FAST_FORWARD: _bindgen_ty_2 = 90; +pub const AKEYCODE_MUTE: _bindgen_ty_2 = 91; +pub const AKEYCODE_PAGE_UP: _bindgen_ty_2 = 92; +pub const AKEYCODE_PAGE_DOWN: _bindgen_ty_2 = 93; +pub const AKEYCODE_PICTSYMBOLS: _bindgen_ty_2 = 94; +pub const AKEYCODE_SWITCH_CHARSET: _bindgen_ty_2 = 95; +pub const AKEYCODE_BUTTON_A: _bindgen_ty_2 = 96; +pub const AKEYCODE_BUTTON_B: _bindgen_ty_2 = 97; +pub const AKEYCODE_BUTTON_C: _bindgen_ty_2 = 98; +pub const AKEYCODE_BUTTON_X: _bindgen_ty_2 = 99; +pub const AKEYCODE_BUTTON_Y: _bindgen_ty_2 = 100; +pub const AKEYCODE_BUTTON_Z: _bindgen_ty_2 = 101; +pub const AKEYCODE_BUTTON_L1: _bindgen_ty_2 = 102; +pub const AKEYCODE_BUTTON_R1: _bindgen_ty_2 = 103; +pub const AKEYCODE_BUTTON_L2: _bindgen_ty_2 = 104; +pub const AKEYCODE_BUTTON_R2: _bindgen_ty_2 = 105; +pub const AKEYCODE_BUTTON_THUMBL: _bindgen_ty_2 = 106; +pub const AKEYCODE_BUTTON_THUMBR: _bindgen_ty_2 = 107; +pub const AKEYCODE_BUTTON_START: _bindgen_ty_2 = 108; +pub const AKEYCODE_BUTTON_SELECT: _bindgen_ty_2 = 109; +pub const AKEYCODE_BUTTON_MODE: _bindgen_ty_2 = 110; +pub const AKEYCODE_ESCAPE: _bindgen_ty_2 = 111; +pub const AKEYCODE_FORWARD_DEL: _bindgen_ty_2 = 112; +pub const AKEYCODE_CTRL_LEFT: _bindgen_ty_2 = 113; +pub const AKEYCODE_CTRL_RIGHT: _bindgen_ty_2 = 114; +pub const AKEYCODE_CAPS_LOCK: _bindgen_ty_2 = 115; +pub const AKEYCODE_SCROLL_LOCK: _bindgen_ty_2 = 116; +pub const AKEYCODE_META_LEFT: _bindgen_ty_2 = 117; +pub const AKEYCODE_META_RIGHT: _bindgen_ty_2 = 118; +pub const AKEYCODE_FUNCTION: _bindgen_ty_2 = 119; +pub const AKEYCODE_SYSRQ: _bindgen_ty_2 = 120; +pub const AKEYCODE_BREAK: _bindgen_ty_2 = 121; +pub const AKEYCODE_MOVE_HOME: _bindgen_ty_2 = 122; +pub const AKEYCODE_MOVE_END: _bindgen_ty_2 = 123; +pub const AKEYCODE_INSERT: _bindgen_ty_2 = 124; +pub const AKEYCODE_FORWARD: _bindgen_ty_2 = 125; +pub const AKEYCODE_MEDIA_PLAY: _bindgen_ty_2 = 126; +pub const AKEYCODE_MEDIA_PAUSE: _bindgen_ty_2 = 127; +pub const AKEYCODE_MEDIA_CLOSE: _bindgen_ty_2 = 128; +pub const AKEYCODE_MEDIA_EJECT: _bindgen_ty_2 = 129; +pub const AKEYCODE_MEDIA_RECORD: _bindgen_ty_2 = 130; +pub const AKEYCODE_F1: _bindgen_ty_2 = 131; +pub const AKEYCODE_F2: _bindgen_ty_2 = 132; +pub const AKEYCODE_F3: _bindgen_ty_2 = 133; +pub const AKEYCODE_F4: _bindgen_ty_2 = 134; +pub const AKEYCODE_F5: _bindgen_ty_2 = 135; +pub const AKEYCODE_F6: _bindgen_ty_2 = 136; +pub const AKEYCODE_F7: _bindgen_ty_2 = 137; +pub const AKEYCODE_F8: _bindgen_ty_2 = 138; +pub const AKEYCODE_F9: _bindgen_ty_2 = 139; +pub const AKEYCODE_F10: _bindgen_ty_2 = 140; +pub const AKEYCODE_F11: _bindgen_ty_2 = 141; +pub const AKEYCODE_F12: _bindgen_ty_2 = 142; +pub const AKEYCODE_NUM_LOCK: _bindgen_ty_2 = 143; +pub const AKEYCODE_NUMPAD_0: _bindgen_ty_2 = 144; +pub const AKEYCODE_NUMPAD_1: _bindgen_ty_2 = 145; +pub const AKEYCODE_NUMPAD_2: _bindgen_ty_2 = 146; +pub const AKEYCODE_NUMPAD_3: _bindgen_ty_2 = 147; +pub const AKEYCODE_NUMPAD_4: _bindgen_ty_2 = 148; +pub const AKEYCODE_NUMPAD_5: _bindgen_ty_2 = 149; +pub const AKEYCODE_NUMPAD_6: _bindgen_ty_2 = 150; +pub const AKEYCODE_NUMPAD_7: _bindgen_ty_2 = 151; +pub const AKEYCODE_NUMPAD_8: _bindgen_ty_2 = 152; +pub const AKEYCODE_NUMPAD_9: _bindgen_ty_2 = 153; +pub const AKEYCODE_NUMPAD_DIVIDE: _bindgen_ty_2 = 154; +pub const AKEYCODE_NUMPAD_MULTIPLY: _bindgen_ty_2 = 155; +pub const AKEYCODE_NUMPAD_SUBTRACT: _bindgen_ty_2 = 156; +pub const AKEYCODE_NUMPAD_ADD: _bindgen_ty_2 = 157; +pub const AKEYCODE_NUMPAD_DOT: _bindgen_ty_2 = 158; +pub const AKEYCODE_NUMPAD_COMMA: _bindgen_ty_2 = 159; +pub const AKEYCODE_NUMPAD_ENTER: _bindgen_ty_2 = 160; +pub const AKEYCODE_NUMPAD_EQUALS: _bindgen_ty_2 = 161; +pub const AKEYCODE_NUMPAD_LEFT_PAREN: _bindgen_ty_2 = 162; +pub const AKEYCODE_NUMPAD_RIGHT_PAREN: _bindgen_ty_2 = 163; +pub const AKEYCODE_VOLUME_MUTE: _bindgen_ty_2 = 164; +pub const AKEYCODE_INFO: _bindgen_ty_2 = 165; +pub const AKEYCODE_CHANNEL_UP: _bindgen_ty_2 = 166; +pub const AKEYCODE_CHANNEL_DOWN: _bindgen_ty_2 = 167; +pub const AKEYCODE_ZOOM_IN: _bindgen_ty_2 = 168; +pub const AKEYCODE_ZOOM_OUT: _bindgen_ty_2 = 169; +pub const AKEYCODE_TV: _bindgen_ty_2 = 170; +pub const AKEYCODE_WINDOW: _bindgen_ty_2 = 171; +pub const AKEYCODE_GUIDE: _bindgen_ty_2 = 172; +pub const AKEYCODE_DVR: _bindgen_ty_2 = 173; +pub const AKEYCODE_BOOKMARK: _bindgen_ty_2 = 174; +pub const AKEYCODE_CAPTIONS: _bindgen_ty_2 = 175; +pub const AKEYCODE_SETTINGS: _bindgen_ty_2 = 176; +pub const AKEYCODE_TV_POWER: _bindgen_ty_2 = 177; +pub const AKEYCODE_TV_INPUT: _bindgen_ty_2 = 178; +pub const AKEYCODE_STB_POWER: _bindgen_ty_2 = 179; +pub const AKEYCODE_STB_INPUT: _bindgen_ty_2 = 180; +pub const AKEYCODE_AVR_POWER: _bindgen_ty_2 = 181; +pub const AKEYCODE_AVR_INPUT: _bindgen_ty_2 = 182; +pub const AKEYCODE_PROG_RED: _bindgen_ty_2 = 183; +pub const AKEYCODE_PROG_GREEN: _bindgen_ty_2 = 184; +pub const AKEYCODE_PROG_YELLOW: _bindgen_ty_2 = 185; +pub const AKEYCODE_PROG_BLUE: _bindgen_ty_2 = 186; +pub const AKEYCODE_APP_SWITCH: _bindgen_ty_2 = 187; +pub const AKEYCODE_BUTTON_1: _bindgen_ty_2 = 188; +pub const AKEYCODE_BUTTON_2: _bindgen_ty_2 = 189; +pub const AKEYCODE_BUTTON_3: _bindgen_ty_2 = 190; +pub const AKEYCODE_BUTTON_4: _bindgen_ty_2 = 191; +pub const AKEYCODE_BUTTON_5: _bindgen_ty_2 = 192; +pub const AKEYCODE_BUTTON_6: _bindgen_ty_2 = 193; +pub const AKEYCODE_BUTTON_7: _bindgen_ty_2 = 194; +pub const AKEYCODE_BUTTON_8: _bindgen_ty_2 = 195; +pub const AKEYCODE_BUTTON_9: _bindgen_ty_2 = 196; +pub const AKEYCODE_BUTTON_10: _bindgen_ty_2 = 197; +pub const AKEYCODE_BUTTON_11: _bindgen_ty_2 = 198; +pub const AKEYCODE_BUTTON_12: _bindgen_ty_2 = 199; +pub const AKEYCODE_BUTTON_13: _bindgen_ty_2 = 200; +pub const AKEYCODE_BUTTON_14: _bindgen_ty_2 = 201; +pub const AKEYCODE_BUTTON_15: _bindgen_ty_2 = 202; +pub const AKEYCODE_BUTTON_16: _bindgen_ty_2 = 203; +pub const AKEYCODE_LANGUAGE_SWITCH: _bindgen_ty_2 = 204; +pub const AKEYCODE_MANNER_MODE: _bindgen_ty_2 = 205; +pub const AKEYCODE_3D_MODE: _bindgen_ty_2 = 206; +pub const AKEYCODE_CONTACTS: _bindgen_ty_2 = 207; +pub const AKEYCODE_CALENDAR: _bindgen_ty_2 = 208; +pub const AKEYCODE_MUSIC: _bindgen_ty_2 = 209; +pub const AKEYCODE_CALCULATOR: _bindgen_ty_2 = 210; +pub const AKEYCODE_ZENKAKU_HANKAKU: _bindgen_ty_2 = 211; +pub const AKEYCODE_EISU: _bindgen_ty_2 = 212; +pub const AKEYCODE_MUHENKAN: _bindgen_ty_2 = 213; +pub const AKEYCODE_HENKAN: _bindgen_ty_2 = 214; +pub const AKEYCODE_KATAKANA_HIRAGANA: _bindgen_ty_2 = 215; +pub const AKEYCODE_YEN: _bindgen_ty_2 = 216; +pub const AKEYCODE_RO: _bindgen_ty_2 = 217; +pub const AKEYCODE_KANA: _bindgen_ty_2 = 218; +pub const AKEYCODE_ASSIST: _bindgen_ty_2 = 219; +pub const AKEYCODE_BRIGHTNESS_DOWN: _bindgen_ty_2 = 220; +pub const AKEYCODE_BRIGHTNESS_UP: _bindgen_ty_2 = 221; +pub const AKEYCODE_MEDIA_AUDIO_TRACK: _bindgen_ty_2 = 222; +pub const AKEYCODE_SLEEP: _bindgen_ty_2 = 223; +pub const AKEYCODE_WAKEUP: _bindgen_ty_2 = 224; +pub const AKEYCODE_PAIRING: _bindgen_ty_2 = 225; +pub const AKEYCODE_MEDIA_TOP_MENU: _bindgen_ty_2 = 226; +pub const AKEYCODE_11: _bindgen_ty_2 = 227; +pub const AKEYCODE_12: _bindgen_ty_2 = 228; +pub const AKEYCODE_LAST_CHANNEL: _bindgen_ty_2 = 229; +pub const AKEYCODE_TV_DATA_SERVICE: _bindgen_ty_2 = 230; +pub const AKEYCODE_VOICE_ASSIST: _bindgen_ty_2 = 231; +pub const AKEYCODE_TV_RADIO_SERVICE: _bindgen_ty_2 = 232; +pub const AKEYCODE_TV_TELETEXT: _bindgen_ty_2 = 233; +pub const AKEYCODE_TV_NUMBER_ENTRY: _bindgen_ty_2 = 234; +pub const AKEYCODE_TV_TERRESTRIAL_ANALOG: _bindgen_ty_2 = 235; +pub const AKEYCODE_TV_TERRESTRIAL_DIGITAL: _bindgen_ty_2 = 236; +pub const AKEYCODE_TV_SATELLITE: _bindgen_ty_2 = 237; +pub const AKEYCODE_TV_SATELLITE_BS: _bindgen_ty_2 = 238; +pub const AKEYCODE_TV_SATELLITE_CS: _bindgen_ty_2 = 239; +pub const AKEYCODE_TV_SATELLITE_SERVICE: _bindgen_ty_2 = 240; +pub const AKEYCODE_TV_NETWORK: _bindgen_ty_2 = 241; +pub const AKEYCODE_TV_ANTENNA_CABLE: _bindgen_ty_2 = 242; +pub const AKEYCODE_TV_INPUT_HDMI_1: _bindgen_ty_2 = 243; +pub const AKEYCODE_TV_INPUT_HDMI_2: _bindgen_ty_2 = 244; +pub const AKEYCODE_TV_INPUT_HDMI_3: _bindgen_ty_2 = 245; +pub const AKEYCODE_TV_INPUT_HDMI_4: _bindgen_ty_2 = 246; +pub const AKEYCODE_TV_INPUT_COMPOSITE_1: _bindgen_ty_2 = 247; +pub const AKEYCODE_TV_INPUT_COMPOSITE_2: _bindgen_ty_2 = 248; +pub const AKEYCODE_TV_INPUT_COMPONENT_1: _bindgen_ty_2 = 249; +pub const AKEYCODE_TV_INPUT_COMPONENT_2: _bindgen_ty_2 = 250; +pub const AKEYCODE_TV_INPUT_VGA_1: _bindgen_ty_2 = 251; +pub const AKEYCODE_TV_AUDIO_DESCRIPTION: _bindgen_ty_2 = 252; +pub const AKEYCODE_TV_AUDIO_DESCRIPTION_MIX_UP: _bindgen_ty_2 = 253; +pub const AKEYCODE_TV_AUDIO_DESCRIPTION_MIX_DOWN: _bindgen_ty_2 = 254; +pub const AKEYCODE_TV_ZOOM_MODE: _bindgen_ty_2 = 255; +pub const AKEYCODE_TV_CONTENTS_MENU: _bindgen_ty_2 = 256; +pub const AKEYCODE_TV_MEDIA_CONTEXT_MENU: _bindgen_ty_2 = 257; +pub const AKEYCODE_TV_TIMER_PROGRAMMING: _bindgen_ty_2 = 258; +pub const AKEYCODE_HELP: _bindgen_ty_2 = 259; +pub const AKEYCODE_NAVIGATE_PREVIOUS: _bindgen_ty_2 = 260; +pub const AKEYCODE_NAVIGATE_NEXT: _bindgen_ty_2 = 261; +pub const AKEYCODE_NAVIGATE_IN: _bindgen_ty_2 = 262; +pub const AKEYCODE_NAVIGATE_OUT: _bindgen_ty_2 = 263; +pub const AKEYCODE_STEM_PRIMARY: _bindgen_ty_2 = 264; +pub const AKEYCODE_STEM_1: _bindgen_ty_2 = 265; +pub const AKEYCODE_STEM_2: _bindgen_ty_2 = 266; +pub const AKEYCODE_STEM_3: _bindgen_ty_2 = 267; +pub const AKEYCODE_DPAD_UP_LEFT: _bindgen_ty_2 = 268; +pub const AKEYCODE_DPAD_DOWN_LEFT: _bindgen_ty_2 = 269; +pub const AKEYCODE_DPAD_UP_RIGHT: _bindgen_ty_2 = 270; +pub const AKEYCODE_DPAD_DOWN_RIGHT: _bindgen_ty_2 = 271; +pub const AKEYCODE_MEDIA_SKIP_FORWARD: _bindgen_ty_2 = 272; +pub const AKEYCODE_MEDIA_SKIP_BACKWARD: _bindgen_ty_2 = 273; +pub const AKEYCODE_MEDIA_STEP_FORWARD: _bindgen_ty_2 = 274; +pub const AKEYCODE_MEDIA_STEP_BACKWARD: _bindgen_ty_2 = 275; +pub const AKEYCODE_SOFT_SLEEP: _bindgen_ty_2 = 276; +pub const AKEYCODE_CUT: _bindgen_ty_2 = 277; +pub const AKEYCODE_COPY: _bindgen_ty_2 = 278; +pub const AKEYCODE_PASTE: _bindgen_ty_2 = 279; +pub const AKEYCODE_SYSTEM_NAVIGATION_UP: _bindgen_ty_2 = 280; +pub const AKEYCODE_SYSTEM_NAVIGATION_DOWN: _bindgen_ty_2 = 281; +pub const AKEYCODE_SYSTEM_NAVIGATION_LEFT: _bindgen_ty_2 = 282; +pub const AKEYCODE_SYSTEM_NAVIGATION_RIGHT: _bindgen_ty_2 = 283; +pub const AKEYCODE_ALL_APPS: _bindgen_ty_2 = 284; +pub const AKEYCODE_REFRESH: _bindgen_ty_2 = 285; +pub const AKEYCODE_THUMBS_UP: _bindgen_ty_2 = 286; +pub const AKEYCODE_THUMBS_DOWN: _bindgen_ty_2 = 287; +pub const AKEYCODE_PROFILE_SWITCH: _bindgen_ty_2 = 288; pub type _bindgen_ty_2 = ::std::os::raw::c_uint; -pub const ALOOPER_PREPARE_ALLOW_NON_CALLBACKS: ::std::os::raw::c_uint = 1; +pub const ALOOPER_PREPARE_ALLOW_NON_CALLBACKS: _bindgen_ty_3 = 1; pub type _bindgen_ty_3 = ::std::os::raw::c_uint; -pub const ALOOPER_POLL_WAKE: ::std::os::raw::c_int = -1; -pub const ALOOPER_POLL_CALLBACK: ::std::os::raw::c_int = -2; -pub const ALOOPER_POLL_TIMEOUT: ::std::os::raw::c_int = -3; -pub const ALOOPER_POLL_ERROR: ::std::os::raw::c_int = -4; +pub const ALOOPER_POLL_WAKE: _bindgen_ty_4 = -1; +pub const ALOOPER_POLL_CALLBACK: _bindgen_ty_4 = -2; +pub const ALOOPER_POLL_TIMEOUT: _bindgen_ty_4 = -3; +pub const ALOOPER_POLL_ERROR: _bindgen_ty_4 = -4; pub type _bindgen_ty_4 = ::std::os::raw::c_int; -pub const ALOOPER_EVENT_INPUT: ::std::os::raw::c_uint = 1; -pub const ALOOPER_EVENT_OUTPUT: ::std::os::raw::c_uint = 2; -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 const ALOOPER_EVENT_INPUT: _bindgen_ty_5 = 1; +pub const ALOOPER_EVENT_OUTPUT: _bindgen_ty_5 = 2; +pub const ALOOPER_EVENT_ERROR: _bindgen_ty_5 = 4; +pub const ALOOPER_EVENT_HANGUP: _bindgen_ty_5 = 8; +pub const ALOOPER_EVENT_INVALID: _bindgen_ty_5 = 16; pub type _bindgen_ty_5 = ::std::os::raw::c_uint; -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; -pub const AKEY_STATE_VIRTUAL: ::std::os::raw::c_int = 2; +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() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + 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::addr_of!((*ptr).version) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(JavaVMAttachArgs), + "::", + stringify!(version) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(JavaVMAttachArgs), + "::", + stringify!(name) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).group) as usize - ptr 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() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + 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::addr_of!((*ptr).optionString) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(JavaVMOption), + "::", + stringify!(optionString) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).extraInfo) as usize - ptr 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() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + 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::addr_of!((*ptr).version) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(JavaVMInitArgs), + "::", + stringify!(version) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).nOptions) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(JavaVMInitArgs), + "::", + stringify!(nOptions) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).options) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(JavaVMInitArgs), + "::", + stringify!(options) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ignoreUnrecognized) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(JavaVMInitArgs), + "::", + stringify!(ignoreUnrecognized) + ) + ); +} +pub const AKEY_STATE_UNKNOWN: _bindgen_ty_6 = -1; +pub const AKEY_STATE_UP: _bindgen_ty_6 = 0; +pub const AKEY_STATE_DOWN: _bindgen_ty_6 = 1; +pub const AKEY_STATE_VIRTUAL: _bindgen_ty_6 = 2; pub type _bindgen_ty_6 = ::std::os::raw::c_int; -pub const AMETA_NONE: ::std::os::raw::c_uint = 0; -pub const AMETA_ALT_ON: ::std::os::raw::c_uint = 2; -pub const AMETA_ALT_LEFT_ON: ::std::os::raw::c_uint = 16; -pub const AMETA_ALT_RIGHT_ON: ::std::os::raw::c_uint = 32; -pub const AMETA_SHIFT_ON: ::std::os::raw::c_uint = 1; -pub const AMETA_SHIFT_LEFT_ON: ::std::os::raw::c_uint = 64; -pub const AMETA_SHIFT_RIGHT_ON: ::std::os::raw::c_uint = 128; -pub const AMETA_SYM_ON: ::std::os::raw::c_uint = 4; -pub const AMETA_FUNCTION_ON: ::std::os::raw::c_uint = 8; -pub const AMETA_CTRL_ON: ::std::os::raw::c_uint = 4096; -pub const AMETA_CTRL_LEFT_ON: ::std::os::raw::c_uint = 8192; -pub const AMETA_CTRL_RIGHT_ON: ::std::os::raw::c_uint = 16384; -pub const AMETA_META_ON: ::std::os::raw::c_uint = 65536; -pub const AMETA_META_LEFT_ON: ::std::os::raw::c_uint = 131072; -pub const AMETA_META_RIGHT_ON: ::std::os::raw::c_uint = 262144; -pub const AMETA_CAPS_LOCK_ON: ::std::os::raw::c_uint = 1048576; -pub const AMETA_NUM_LOCK_ON: ::std::os::raw::c_uint = 2097152; -pub const AMETA_SCROLL_LOCK_ON: ::std::os::raw::c_uint = 4194304; +pub const AMETA_NONE: _bindgen_ty_7 = 0; +pub const AMETA_ALT_ON: _bindgen_ty_7 = 2; +pub const AMETA_ALT_LEFT_ON: _bindgen_ty_7 = 16; +pub const AMETA_ALT_RIGHT_ON: _bindgen_ty_7 = 32; +pub const AMETA_SHIFT_ON: _bindgen_ty_7 = 1; +pub const AMETA_SHIFT_LEFT_ON: _bindgen_ty_7 = 64; +pub const AMETA_SHIFT_RIGHT_ON: _bindgen_ty_7 = 128; +pub const AMETA_SYM_ON: _bindgen_ty_7 = 4; +pub const AMETA_FUNCTION_ON: _bindgen_ty_7 = 8; +pub const AMETA_CTRL_ON: _bindgen_ty_7 = 4096; +pub const AMETA_CTRL_LEFT_ON: _bindgen_ty_7 = 8192; +pub const AMETA_CTRL_RIGHT_ON: _bindgen_ty_7 = 16384; +pub const AMETA_META_ON: _bindgen_ty_7 = 65536; +pub const AMETA_META_LEFT_ON: _bindgen_ty_7 = 131072; +pub const AMETA_META_RIGHT_ON: _bindgen_ty_7 = 262144; +pub const AMETA_CAPS_LOCK_ON: _bindgen_ty_7 = 1048576; +pub const AMETA_NUM_LOCK_ON: _bindgen_ty_7 = 2097152; +pub const AMETA_SCROLL_LOCK_ON: _bindgen_ty_7 = 4194304; pub type _bindgen_ty_7 = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct AInputEvent { _unused: [u8; 0], } -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_KEY: _bindgen_ty_8 = 1; +pub const AINPUT_EVENT_TYPE_MOTION: _bindgen_ty_8 = 2; +pub const AINPUT_EVENT_TYPE_FOCUS: _bindgen_ty_8 = 3; +pub const AINPUT_EVENT_TYPE_CAPTURE: _bindgen_ty_8 = 4; +pub const AINPUT_EVENT_TYPE_DRAG: _bindgen_ty_8 = 5; +pub const AINPUT_EVENT_TYPE_TOUCH_MODE: _bindgen_ty_8 = 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; -pub const AKEY_EVENT_ACTION_MULTIPLE: ::std::os::raw::c_uint = 2; +pub const AKEY_EVENT_ACTION_DOWN: _bindgen_ty_9 = 0; +pub const AKEY_EVENT_ACTION_UP: _bindgen_ty_9 = 1; +pub const AKEY_EVENT_ACTION_MULTIPLE: _bindgen_ty_9 = 2; pub type _bindgen_ty_9 = ::std::os::raw::c_uint; -pub const AKEY_EVENT_FLAG_WOKE_HERE: ::std::os::raw::c_uint = 1; -pub const AKEY_EVENT_FLAG_SOFT_KEYBOARD: ::std::os::raw::c_uint = 2; -pub const AKEY_EVENT_FLAG_KEEP_TOUCH_MODE: ::std::os::raw::c_uint = 4; -pub const AKEY_EVENT_FLAG_FROM_SYSTEM: ::std::os::raw::c_uint = 8; -pub const AKEY_EVENT_FLAG_EDITOR_ACTION: ::std::os::raw::c_uint = 16; -pub const AKEY_EVENT_FLAG_CANCELED: ::std::os::raw::c_uint = 32; -pub const AKEY_EVENT_FLAG_VIRTUAL_HARD_KEY: ::std::os::raw::c_uint = 64; -pub const AKEY_EVENT_FLAG_LONG_PRESS: ::std::os::raw::c_uint = 128; -pub const AKEY_EVENT_FLAG_CANCELED_LONG_PRESS: ::std::os::raw::c_uint = 256; -pub const AKEY_EVENT_FLAG_TRACKING: ::std::os::raw::c_uint = 512; -pub const AKEY_EVENT_FLAG_FALLBACK: ::std::os::raw::c_uint = 1024; +pub const AKEY_EVENT_FLAG_WOKE_HERE: _bindgen_ty_10 = 1; +pub const AKEY_EVENT_FLAG_SOFT_KEYBOARD: _bindgen_ty_10 = 2; +pub const AKEY_EVENT_FLAG_KEEP_TOUCH_MODE: _bindgen_ty_10 = 4; +pub const AKEY_EVENT_FLAG_FROM_SYSTEM: _bindgen_ty_10 = 8; +pub const AKEY_EVENT_FLAG_EDITOR_ACTION: _bindgen_ty_10 = 16; +pub const AKEY_EVENT_FLAG_CANCELED: _bindgen_ty_10 = 32; +pub const AKEY_EVENT_FLAG_VIRTUAL_HARD_KEY: _bindgen_ty_10 = 64; +pub const AKEY_EVENT_FLAG_LONG_PRESS: _bindgen_ty_10 = 128; +pub const AKEY_EVENT_FLAG_CANCELED_LONG_PRESS: _bindgen_ty_10 = 256; +pub const AKEY_EVENT_FLAG_TRACKING: _bindgen_ty_10 = 512; +pub const AKEY_EVENT_FLAG_FALLBACK: _bindgen_ty_10 = 1024; pub type _bindgen_ty_10 = ::std::os::raw::c_uint; -pub const AMOTION_EVENT_ACTION_MASK: ::std::os::raw::c_uint = 255; -pub const AMOTION_EVENT_ACTION_POINTER_INDEX_MASK: ::std::os::raw::c_uint = 65280; -pub const AMOTION_EVENT_ACTION_DOWN: ::std::os::raw::c_uint = 0; -pub const AMOTION_EVENT_ACTION_UP: ::std::os::raw::c_uint = 1; -pub const AMOTION_EVENT_ACTION_MOVE: ::std::os::raw::c_uint = 2; -pub const AMOTION_EVENT_ACTION_CANCEL: ::std::os::raw::c_uint = 3; -pub const AMOTION_EVENT_ACTION_OUTSIDE: ::std::os::raw::c_uint = 4; -pub const AMOTION_EVENT_ACTION_POINTER_DOWN: ::std::os::raw::c_uint = 5; -pub const AMOTION_EVENT_ACTION_POINTER_UP: ::std::os::raw::c_uint = 6; -pub const AMOTION_EVENT_ACTION_HOVER_MOVE: ::std::os::raw::c_uint = 7; -pub const AMOTION_EVENT_ACTION_SCROLL: ::std::os::raw::c_uint = 8; -pub const AMOTION_EVENT_ACTION_HOVER_ENTER: ::std::os::raw::c_uint = 9; -pub const AMOTION_EVENT_ACTION_HOVER_EXIT: ::std::os::raw::c_uint = 10; -pub const AMOTION_EVENT_ACTION_BUTTON_PRESS: ::std::os::raw::c_uint = 11; -pub const AMOTION_EVENT_ACTION_BUTTON_RELEASE: ::std::os::raw::c_uint = 12; +pub const AMOTION_EVENT_ACTION_MASK: _bindgen_ty_11 = 255; +pub const AMOTION_EVENT_ACTION_POINTER_INDEX_MASK: _bindgen_ty_11 = 65280; +pub const AMOTION_EVENT_ACTION_DOWN: _bindgen_ty_11 = 0; +pub const AMOTION_EVENT_ACTION_UP: _bindgen_ty_11 = 1; +pub const AMOTION_EVENT_ACTION_MOVE: _bindgen_ty_11 = 2; +pub const AMOTION_EVENT_ACTION_CANCEL: _bindgen_ty_11 = 3; +pub const AMOTION_EVENT_ACTION_OUTSIDE: _bindgen_ty_11 = 4; +pub const AMOTION_EVENT_ACTION_POINTER_DOWN: _bindgen_ty_11 = 5; +pub const AMOTION_EVENT_ACTION_POINTER_UP: _bindgen_ty_11 = 6; +pub const AMOTION_EVENT_ACTION_HOVER_MOVE: _bindgen_ty_11 = 7; +pub const AMOTION_EVENT_ACTION_SCROLL: _bindgen_ty_11 = 8; +pub const AMOTION_EVENT_ACTION_HOVER_ENTER: _bindgen_ty_11 = 9; +pub const AMOTION_EVENT_ACTION_HOVER_EXIT: _bindgen_ty_11 = 10; +pub const AMOTION_EVENT_ACTION_BUTTON_PRESS: _bindgen_ty_11 = 11; +pub const AMOTION_EVENT_ACTION_BUTTON_RELEASE: _bindgen_ty_11 = 12; pub type _bindgen_ty_11 = ::std::os::raw::c_uint; -pub const AMOTION_EVENT_FLAG_WINDOW_IS_OBSCURED: ::std::os::raw::c_uint = 1; +pub const AMOTION_EVENT_FLAG_WINDOW_IS_OBSCURED: _bindgen_ty_12 = 1; pub type _bindgen_ty_12 = ::std::os::raw::c_uint; -pub const AMOTION_EVENT_EDGE_FLAG_NONE: ::std::os::raw::c_uint = 0; -pub const AMOTION_EVENT_EDGE_FLAG_TOP: ::std::os::raw::c_uint = 1; -pub const AMOTION_EVENT_EDGE_FLAG_BOTTOM: ::std::os::raw::c_uint = 2; -pub const AMOTION_EVENT_EDGE_FLAG_LEFT: ::std::os::raw::c_uint = 4; -pub const AMOTION_EVENT_EDGE_FLAG_RIGHT: ::std::os::raw::c_uint = 8; +pub const AMOTION_EVENT_EDGE_FLAG_NONE: _bindgen_ty_13 = 0; +pub const AMOTION_EVENT_EDGE_FLAG_TOP: _bindgen_ty_13 = 1; +pub const AMOTION_EVENT_EDGE_FLAG_BOTTOM: _bindgen_ty_13 = 2; +pub const AMOTION_EVENT_EDGE_FLAG_LEFT: _bindgen_ty_13 = 4; +pub const AMOTION_EVENT_EDGE_FLAG_RIGHT: _bindgen_ty_13 = 8; pub type _bindgen_ty_13 = ::std::os::raw::c_uint; -pub const AMOTION_EVENT_AXIS_X: ::std::os::raw::c_uint = 0; -pub const AMOTION_EVENT_AXIS_Y: ::std::os::raw::c_uint = 1; -pub const AMOTION_EVENT_AXIS_PRESSURE: ::std::os::raw::c_uint = 2; -pub const AMOTION_EVENT_AXIS_SIZE: ::std::os::raw::c_uint = 3; -pub const AMOTION_EVENT_AXIS_TOUCH_MAJOR: ::std::os::raw::c_uint = 4; -pub const AMOTION_EVENT_AXIS_TOUCH_MINOR: ::std::os::raw::c_uint = 5; -pub const AMOTION_EVENT_AXIS_TOOL_MAJOR: ::std::os::raw::c_uint = 6; -pub const AMOTION_EVENT_AXIS_TOOL_MINOR: ::std::os::raw::c_uint = 7; -pub const AMOTION_EVENT_AXIS_ORIENTATION: ::std::os::raw::c_uint = 8; -pub const AMOTION_EVENT_AXIS_VSCROLL: ::std::os::raw::c_uint = 9; -pub const AMOTION_EVENT_AXIS_HSCROLL: ::std::os::raw::c_uint = 10; -pub const AMOTION_EVENT_AXIS_Z: ::std::os::raw::c_uint = 11; -pub const AMOTION_EVENT_AXIS_RX: ::std::os::raw::c_uint = 12; -pub const AMOTION_EVENT_AXIS_RY: ::std::os::raw::c_uint = 13; -pub const AMOTION_EVENT_AXIS_RZ: ::std::os::raw::c_uint = 14; -pub const AMOTION_EVENT_AXIS_HAT_X: ::std::os::raw::c_uint = 15; -pub const AMOTION_EVENT_AXIS_HAT_Y: ::std::os::raw::c_uint = 16; -pub const AMOTION_EVENT_AXIS_LTRIGGER: ::std::os::raw::c_uint = 17; -pub const AMOTION_EVENT_AXIS_RTRIGGER: ::std::os::raw::c_uint = 18; -pub const AMOTION_EVENT_AXIS_THROTTLE: ::std::os::raw::c_uint = 19; -pub const AMOTION_EVENT_AXIS_RUDDER: ::std::os::raw::c_uint = 20; -pub const AMOTION_EVENT_AXIS_WHEEL: ::std::os::raw::c_uint = 21; -pub const AMOTION_EVENT_AXIS_GAS: ::std::os::raw::c_uint = 22; -pub const AMOTION_EVENT_AXIS_BRAKE: ::std::os::raw::c_uint = 23; -pub const AMOTION_EVENT_AXIS_DISTANCE: ::std::os::raw::c_uint = 24; -pub const AMOTION_EVENT_AXIS_TILT: ::std::os::raw::c_uint = 25; -pub const AMOTION_EVENT_AXIS_SCROLL: ::std::os::raw::c_uint = 26; -pub const AMOTION_EVENT_AXIS_RELATIVE_X: ::std::os::raw::c_uint = 27; -pub const AMOTION_EVENT_AXIS_RELATIVE_Y: ::std::os::raw::c_uint = 28; -pub const AMOTION_EVENT_AXIS_GENERIC_1: ::std::os::raw::c_uint = 32; -pub const AMOTION_EVENT_AXIS_GENERIC_2: ::std::os::raw::c_uint = 33; -pub const AMOTION_EVENT_AXIS_GENERIC_3: ::std::os::raw::c_uint = 34; -pub const AMOTION_EVENT_AXIS_GENERIC_4: ::std::os::raw::c_uint = 35; -pub const AMOTION_EVENT_AXIS_GENERIC_5: ::std::os::raw::c_uint = 36; -pub const AMOTION_EVENT_AXIS_GENERIC_6: ::std::os::raw::c_uint = 37; -pub const AMOTION_EVENT_AXIS_GENERIC_7: ::std::os::raw::c_uint = 38; -pub const AMOTION_EVENT_AXIS_GENERIC_8: ::std::os::raw::c_uint = 39; -pub const AMOTION_EVENT_AXIS_GENERIC_9: ::std::os::raw::c_uint = 40; -pub const AMOTION_EVENT_AXIS_GENERIC_10: ::std::os::raw::c_uint = 41; -pub const AMOTION_EVENT_AXIS_GENERIC_11: ::std::os::raw::c_uint = 42; -pub const AMOTION_EVENT_AXIS_GENERIC_12: ::std::os::raw::c_uint = 43; -pub const AMOTION_EVENT_AXIS_GENERIC_13: ::std::os::raw::c_uint = 44; -pub const AMOTION_EVENT_AXIS_GENERIC_14: ::std::os::raw::c_uint = 45; -pub const AMOTION_EVENT_AXIS_GENERIC_15: ::std::os::raw::c_uint = 46; -pub const AMOTION_EVENT_AXIS_GENERIC_16: ::std::os::raw::c_uint = 47; +pub const AMOTION_EVENT_AXIS_X: _bindgen_ty_14 = 0; +pub const AMOTION_EVENT_AXIS_Y: _bindgen_ty_14 = 1; +pub const AMOTION_EVENT_AXIS_PRESSURE: _bindgen_ty_14 = 2; +pub const AMOTION_EVENT_AXIS_SIZE: _bindgen_ty_14 = 3; +pub const AMOTION_EVENT_AXIS_TOUCH_MAJOR: _bindgen_ty_14 = 4; +pub const AMOTION_EVENT_AXIS_TOUCH_MINOR: _bindgen_ty_14 = 5; +pub const AMOTION_EVENT_AXIS_TOOL_MAJOR: _bindgen_ty_14 = 6; +pub const AMOTION_EVENT_AXIS_TOOL_MINOR: _bindgen_ty_14 = 7; +pub const AMOTION_EVENT_AXIS_ORIENTATION: _bindgen_ty_14 = 8; +pub const AMOTION_EVENT_AXIS_VSCROLL: _bindgen_ty_14 = 9; +pub const AMOTION_EVENT_AXIS_HSCROLL: _bindgen_ty_14 = 10; +pub const AMOTION_EVENT_AXIS_Z: _bindgen_ty_14 = 11; +pub const AMOTION_EVENT_AXIS_RX: _bindgen_ty_14 = 12; +pub const AMOTION_EVENT_AXIS_RY: _bindgen_ty_14 = 13; +pub const AMOTION_EVENT_AXIS_RZ: _bindgen_ty_14 = 14; +pub const AMOTION_EVENT_AXIS_HAT_X: _bindgen_ty_14 = 15; +pub const AMOTION_EVENT_AXIS_HAT_Y: _bindgen_ty_14 = 16; +pub const AMOTION_EVENT_AXIS_LTRIGGER: _bindgen_ty_14 = 17; +pub const AMOTION_EVENT_AXIS_RTRIGGER: _bindgen_ty_14 = 18; +pub const AMOTION_EVENT_AXIS_THROTTLE: _bindgen_ty_14 = 19; +pub const AMOTION_EVENT_AXIS_RUDDER: _bindgen_ty_14 = 20; +pub const AMOTION_EVENT_AXIS_WHEEL: _bindgen_ty_14 = 21; +pub const AMOTION_EVENT_AXIS_GAS: _bindgen_ty_14 = 22; +pub const AMOTION_EVENT_AXIS_BRAKE: _bindgen_ty_14 = 23; +pub const AMOTION_EVENT_AXIS_DISTANCE: _bindgen_ty_14 = 24; +pub const AMOTION_EVENT_AXIS_TILT: _bindgen_ty_14 = 25; +pub const AMOTION_EVENT_AXIS_SCROLL: _bindgen_ty_14 = 26; +pub const AMOTION_EVENT_AXIS_RELATIVE_X: _bindgen_ty_14 = 27; +pub const AMOTION_EVENT_AXIS_RELATIVE_Y: _bindgen_ty_14 = 28; +pub const AMOTION_EVENT_AXIS_GENERIC_1: _bindgen_ty_14 = 32; +pub const AMOTION_EVENT_AXIS_GENERIC_2: _bindgen_ty_14 = 33; +pub const AMOTION_EVENT_AXIS_GENERIC_3: _bindgen_ty_14 = 34; +pub const AMOTION_EVENT_AXIS_GENERIC_4: _bindgen_ty_14 = 35; +pub const AMOTION_EVENT_AXIS_GENERIC_5: _bindgen_ty_14 = 36; +pub const AMOTION_EVENT_AXIS_GENERIC_6: _bindgen_ty_14 = 37; +pub const AMOTION_EVENT_AXIS_GENERIC_7: _bindgen_ty_14 = 38; +pub const AMOTION_EVENT_AXIS_GENERIC_8: _bindgen_ty_14 = 39; +pub const AMOTION_EVENT_AXIS_GENERIC_9: _bindgen_ty_14 = 40; +pub const AMOTION_EVENT_AXIS_GENERIC_10: _bindgen_ty_14 = 41; +pub const AMOTION_EVENT_AXIS_GENERIC_11: _bindgen_ty_14 = 42; +pub const AMOTION_EVENT_AXIS_GENERIC_12: _bindgen_ty_14 = 43; +pub const AMOTION_EVENT_AXIS_GENERIC_13: _bindgen_ty_14 = 44; +pub const AMOTION_EVENT_AXIS_GENERIC_14: _bindgen_ty_14 = 45; +pub const AMOTION_EVENT_AXIS_GENERIC_15: _bindgen_ty_14 = 46; +pub const AMOTION_EVENT_AXIS_GENERIC_16: _bindgen_ty_14 = 47; pub type _bindgen_ty_14 = ::std::os::raw::c_uint; -pub const AMOTION_EVENT_BUTTON_PRIMARY: ::std::os::raw::c_uint = 1; -pub const AMOTION_EVENT_BUTTON_SECONDARY: ::std::os::raw::c_uint = 2; -pub const AMOTION_EVENT_BUTTON_TERTIARY: ::std::os::raw::c_uint = 4; -pub const AMOTION_EVENT_BUTTON_BACK: ::std::os::raw::c_uint = 8; -pub const AMOTION_EVENT_BUTTON_FORWARD: ::std::os::raw::c_uint = 16; -pub const AMOTION_EVENT_BUTTON_STYLUS_PRIMARY: ::std::os::raw::c_uint = 32; -pub const AMOTION_EVENT_BUTTON_STYLUS_SECONDARY: ::std::os::raw::c_uint = 64; +pub const AMOTION_EVENT_BUTTON_PRIMARY: _bindgen_ty_15 = 1; +pub const AMOTION_EVENT_BUTTON_SECONDARY: _bindgen_ty_15 = 2; +pub const AMOTION_EVENT_BUTTON_TERTIARY: _bindgen_ty_15 = 4; +pub const AMOTION_EVENT_BUTTON_BACK: _bindgen_ty_15 = 8; +pub const AMOTION_EVENT_BUTTON_FORWARD: _bindgen_ty_15 = 16; +pub const AMOTION_EVENT_BUTTON_STYLUS_PRIMARY: _bindgen_ty_15 = 32; +pub const AMOTION_EVENT_BUTTON_STYLUS_SECONDARY: _bindgen_ty_15 = 64; pub type _bindgen_ty_15 = ::std::os::raw::c_uint; -pub const AMOTION_EVENT_TOOL_TYPE_UNKNOWN: ::std::os::raw::c_uint = 0; -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_UNKNOWN: _bindgen_ty_16 = 0; +pub const AMOTION_EVENT_TOOL_TYPE_FINGER: _bindgen_ty_16 = 1; +pub const AMOTION_EVENT_TOOL_TYPE_STYLUS: _bindgen_ty_16 = 2; +pub const AMOTION_EVENT_TOOL_TYPE_MOUSE: _bindgen_ty_16 = 3; +pub const AMOTION_EVENT_TOOL_TYPE_ERASER: _bindgen_ty_16 = 4; +pub const AMOTION_EVENT_TOOL_TYPE_PALM: _bindgen_ty_16 = 5; pub type _bindgen_ty_16 = ::std::os::raw::c_uint; -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; -pub const AINPUT_SOURCE_CLASS_POINTER: ::std::os::raw::c_uint = 2; -pub const AINPUT_SOURCE_CLASS_NAVIGATION: ::std::os::raw::c_uint = 4; -pub const AINPUT_SOURCE_CLASS_POSITION: ::std::os::raw::c_uint = 8; -pub const AINPUT_SOURCE_CLASS_JOYSTICK: ::std::os::raw::c_uint = 16; +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: _bindgen_ty_17 = 255; +pub const AINPUT_SOURCE_CLASS_NONE: _bindgen_ty_17 = 0; +pub const AINPUT_SOURCE_CLASS_BUTTON: _bindgen_ty_17 = 1; +pub const AINPUT_SOURCE_CLASS_POINTER: _bindgen_ty_17 = 2; +pub const AINPUT_SOURCE_CLASS_NAVIGATION: _bindgen_ty_17 = 4; +pub const AINPUT_SOURCE_CLASS_POSITION: _bindgen_ty_17 = 8; +pub const AINPUT_SOURCE_CLASS_JOYSTICK: _bindgen_ty_17 = 16; pub type _bindgen_ty_17 = ::std::os::raw::c_uint; -pub const AINPUT_SOURCE_UNKNOWN: ::std::os::raw::c_uint = 0; -pub const AINPUT_SOURCE_KEYBOARD: ::std::os::raw::c_uint = 257; -pub const AINPUT_SOURCE_DPAD: ::std::os::raw::c_uint = 513; -pub const AINPUT_SOURCE_GAMEPAD: ::std::os::raw::c_uint = 1025; -pub const AINPUT_SOURCE_TOUCHSCREEN: ::std::os::raw::c_uint = 4098; -pub const AINPUT_SOURCE_MOUSE: ::std::os::raw::c_uint = 8194; -pub const AINPUT_SOURCE_STYLUS: ::std::os::raw::c_uint = 16386; -pub const AINPUT_SOURCE_BLUETOOTH_STYLUS: ::std::os::raw::c_uint = 49154; -pub const AINPUT_SOURCE_TRACKBALL: ::std::os::raw::c_uint = 65540; -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_ROTARY_ENCODER: ::std::os::raw::c_uint = 4194304; -pub const AINPUT_SOURCE_ANY: ::std::os::raw::c_uint = 4294967040; +pub const AINPUT_SOURCE_UNKNOWN: _bindgen_ty_18 = 0; +pub const AINPUT_SOURCE_KEYBOARD: _bindgen_ty_18 = 257; +pub const AINPUT_SOURCE_DPAD: _bindgen_ty_18 = 513; +pub const AINPUT_SOURCE_GAMEPAD: _bindgen_ty_18 = 1025; +pub const AINPUT_SOURCE_TOUCHSCREEN: _bindgen_ty_18 = 4098; +pub const AINPUT_SOURCE_MOUSE: _bindgen_ty_18 = 8194; +pub const AINPUT_SOURCE_STYLUS: _bindgen_ty_18 = 16386; +pub const AINPUT_SOURCE_BLUETOOTH_STYLUS: _bindgen_ty_18 = 49154; +pub const AINPUT_SOURCE_TRACKBALL: _bindgen_ty_18 = 65540; +pub const AINPUT_SOURCE_MOUSE_RELATIVE: _bindgen_ty_18 = 131076; +pub const AINPUT_SOURCE_TOUCHPAD: _bindgen_ty_18 = 1048584; +pub const AINPUT_SOURCE_TOUCH_NAVIGATION: _bindgen_ty_18 = 2097152; +pub const AINPUT_SOURCE_JOYSTICK: _bindgen_ty_18 = 16777232; +pub const AINPUT_SOURCE_HDMI: _bindgen_ty_18 = 33554433; +pub const AINPUT_SOURCE_SENSOR: _bindgen_ty_18 = 67108864; +pub const AINPUT_SOURCE_ROTARY_ENCODER: _bindgen_ty_18 = 4194304; +pub const AINPUT_SOURCE_ANY: _bindgen_ty_18 = 4294967040; pub type _bindgen_ty_18 = ::std::os::raw::c_uint; -pub const AINPUT_KEYBOARD_TYPE_NONE: ::std::os::raw::c_uint = 0; -pub const AINPUT_KEYBOARD_TYPE_NON_ALPHABETIC: ::std::os::raw::c_uint = 1; -pub const AINPUT_KEYBOARD_TYPE_ALPHABETIC: ::std::os::raw::c_uint = 2; +pub const AINPUT_KEYBOARD_TYPE_NONE: _bindgen_ty_19 = 0; +pub const AINPUT_KEYBOARD_TYPE_NON_ALPHABETIC: _bindgen_ty_19 = 1; +pub const AINPUT_KEYBOARD_TYPE_ALPHABETIC: _bindgen_ty_19 = 2; pub type _bindgen_ty_19 = ::std::os::raw::c_uint; -pub const AINPUT_MOTION_RANGE_X: ::std::os::raw::c_uint = 0; -pub const AINPUT_MOTION_RANGE_Y: ::std::os::raw::c_uint = 1; -pub const AINPUT_MOTION_RANGE_PRESSURE: ::std::os::raw::c_uint = 2; -pub const AINPUT_MOTION_RANGE_SIZE: ::std::os::raw::c_uint = 3; -pub const AINPUT_MOTION_RANGE_TOUCH_MAJOR: ::std::os::raw::c_uint = 4; -pub const AINPUT_MOTION_RANGE_TOUCH_MINOR: ::std::os::raw::c_uint = 5; -pub const AINPUT_MOTION_RANGE_TOOL_MAJOR: ::std::os::raw::c_uint = 6; -pub const AINPUT_MOTION_RANGE_TOOL_MINOR: ::std::os::raw::c_uint = 7; -pub const AINPUT_MOTION_RANGE_ORIENTATION: ::std::os::raw::c_uint = 8; +pub const AINPUT_MOTION_RANGE_X: _bindgen_ty_20 = 0; +pub const AINPUT_MOTION_RANGE_Y: _bindgen_ty_20 = 1; +pub const AINPUT_MOTION_RANGE_PRESSURE: _bindgen_ty_20 = 2; +pub const AINPUT_MOTION_RANGE_SIZE: _bindgen_ty_20 = 3; +pub const AINPUT_MOTION_RANGE_TOUCH_MAJOR: _bindgen_ty_20 = 4; +pub const AINPUT_MOTION_RANGE_TOUCH_MINOR: _bindgen_ty_20 = 5; +pub const AINPUT_MOTION_RANGE_TOOL_MAJOR: _bindgen_ty_20 = 6; +pub const AINPUT_MOTION_RANGE_TOOL_MINOR: _bindgen_ty_20 = 7; +pub const AINPUT_MOTION_RANGE_ORIENTATION: _bindgen_ty_20 = 8; pub type _bindgen_ty_20 = ::std::os::raw::c_uint; extern "C" { pub fn AInputEvent_getType(event: *const AInputEvent) -> i32; @@ -1328,6 +1516,9 @@ 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; } @@ -1352,6 +1543,9 @@ 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; } @@ -1386,168 +1580,169 @@ extern "C" { pub fn AMotionEvent_getYPrecision(motion_event: *const AInputEvent) -> f32; } extern "C" { - pub fn AMotionEvent_getPointerCount(motion_event: *const AInputEvent) -> size_t; + pub fn AMotionEvent_getPointerCount(motion_event: *const AInputEvent) -> usize; } extern "C" { - pub fn AMotionEvent_getPointerId( - motion_event: *const AInputEvent, - pointer_index: size_t, - ) -> i32; + pub fn AMotionEvent_getPointerId(motion_event: *const AInputEvent, pointer_index: usize) + -> i32; } extern "C" { - pub fn AMotionEvent_getToolType(motion_event: *const AInputEvent, pointer_index: size_t) - -> i32; + pub fn AMotionEvent_getToolType(motion_event: *const AInputEvent, pointer_index: usize) -> i32; } extern "C" { - pub fn AMotionEvent_getRawX(motion_event: *const AInputEvent, pointer_index: size_t) -> f32; + pub fn AMotionEvent_getRawX(motion_event: *const AInputEvent, pointer_index: usize) -> f32; } extern "C" { - pub fn AMotionEvent_getRawY(motion_event: *const AInputEvent, pointer_index: size_t) -> f32; + pub fn AMotionEvent_getRawY(motion_event: *const AInputEvent, pointer_index: usize) -> f32; } extern "C" { - pub fn AMotionEvent_getX(motion_event: *const AInputEvent, pointer_index: size_t) -> f32; + pub fn AMotionEvent_getX(motion_event: *const AInputEvent, pointer_index: usize) -> f32; } extern "C" { - pub fn AMotionEvent_getY(motion_event: *const AInputEvent, pointer_index: size_t) -> f32; + pub fn AMotionEvent_getY(motion_event: *const AInputEvent, pointer_index: usize) -> f32; } extern "C" { - pub fn AMotionEvent_getPressure(motion_event: *const AInputEvent, pointer_index: size_t) - -> f32; + pub fn AMotionEvent_getPressure(motion_event: *const AInputEvent, pointer_index: usize) -> f32; } extern "C" { - pub fn AMotionEvent_getSize(motion_event: *const AInputEvent, pointer_index: size_t) -> f32; + pub fn AMotionEvent_getSize(motion_event: *const AInputEvent, pointer_index: usize) -> f32; } extern "C" { pub fn AMotionEvent_getTouchMajor( motion_event: *const AInputEvent, - pointer_index: size_t, + pointer_index: usize, ) -> f32; } extern "C" { pub fn AMotionEvent_getTouchMinor( motion_event: *const AInputEvent, - pointer_index: size_t, + pointer_index: usize, ) -> f32; } extern "C" { - pub fn AMotionEvent_getToolMajor( - motion_event: *const AInputEvent, - pointer_index: size_t, - ) -> f32; + pub fn AMotionEvent_getToolMajor(motion_event: *const AInputEvent, pointer_index: usize) + -> f32; } extern "C" { - pub fn AMotionEvent_getToolMinor( - motion_event: *const AInputEvent, - pointer_index: size_t, - ) -> f32; + pub fn AMotionEvent_getToolMinor(motion_event: *const AInputEvent, pointer_index: usize) + -> f32; } extern "C" { pub fn AMotionEvent_getOrientation( motion_event: *const AInputEvent, - pointer_index: size_t, + pointer_index: usize, ) -> f32; } extern "C" { pub fn AMotionEvent_getAxisValue( motion_event: *const AInputEvent, axis: i32, - pointer_index: size_t, + pointer_index: usize, ) -> f32; } extern "C" { - pub fn AMotionEvent_getHistorySize(motion_event: *const AInputEvent) -> size_t; + pub fn AMotionEvent_getHistorySize(motion_event: *const AInputEvent) -> usize; } extern "C" { pub fn AMotionEvent_getHistoricalEventTime( motion_event: *const AInputEvent, - history_index: size_t, + history_index: usize, ) -> i64; } extern "C" { pub fn AMotionEvent_getHistoricalRawX( motion_event: *const AInputEvent, - pointer_index: size_t, - history_index: size_t, + pointer_index: usize, + history_index: usize, ) -> f32; } extern "C" { pub fn AMotionEvent_getHistoricalRawY( motion_event: *const AInputEvent, - pointer_index: size_t, - history_index: size_t, + pointer_index: usize, + history_index: usize, ) -> f32; } extern "C" { pub fn AMotionEvent_getHistoricalX( motion_event: *const AInputEvent, - pointer_index: size_t, - history_index: size_t, + pointer_index: usize, + history_index: usize, ) -> f32; } extern "C" { pub fn AMotionEvent_getHistoricalY( motion_event: *const AInputEvent, - pointer_index: size_t, - history_index: size_t, + pointer_index: usize, + history_index: usize, ) -> f32; } extern "C" { pub fn AMotionEvent_getHistoricalPressure( motion_event: *const AInputEvent, - pointer_index: size_t, - history_index: size_t, + pointer_index: usize, + history_index: usize, ) -> f32; } extern "C" { pub fn AMotionEvent_getHistoricalSize( motion_event: *const AInputEvent, - pointer_index: size_t, - history_index: size_t, + pointer_index: usize, + history_index: usize, ) -> f32; } extern "C" { pub fn AMotionEvent_getHistoricalTouchMajor( motion_event: *const AInputEvent, - pointer_index: size_t, - history_index: size_t, + pointer_index: usize, + history_index: usize, ) -> f32; } extern "C" { pub fn AMotionEvent_getHistoricalTouchMinor( motion_event: *const AInputEvent, - pointer_index: size_t, - history_index: size_t, + pointer_index: usize, + history_index: usize, ) -> f32; } extern "C" { pub fn AMotionEvent_getHistoricalToolMajor( motion_event: *const AInputEvent, - pointer_index: size_t, - history_index: size_t, + pointer_index: usize, + history_index: usize, ) -> f32; } extern "C" { pub fn AMotionEvent_getHistoricalToolMinor( motion_event: *const AInputEvent, - pointer_index: size_t, - history_index: size_t, + pointer_index: usize, + history_index: usize, ) -> f32; } extern "C" { pub fn AMotionEvent_getHistoricalOrientation( motion_event: *const AInputEvent, - pointer_index: size_t, - history_index: size_t, + pointer_index: usize, + history_index: usize, ) -> f32; } extern "C" { pub fn AMotionEvent_getHistoricalAxisValue( motion_event: *const AInputEvent, axis: i32, - pointer_index: size_t, - history_index: size_t, + pointer_index: usize, + history_index: usize, ) -> 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 { @@ -1581,6 +1776,9 @@ 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 { @@ -1589,6 +1787,8 @@ pub struct imaxdiv_t { } #[test] fn bindgen_test_layout_imaxdiv_t() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 16usize, @@ -1600,7 +1800,7 @@ fn bindgen_test_layout_imaxdiv_t() { concat!("Alignment of ", stringify!(imaxdiv_t)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).quot as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).quot) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1610,7 +1810,7 @@ fn bindgen_test_layout_imaxdiv_t() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).rem as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).rem) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -1655,11 +1855,52 @@ 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; pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_R8G8B8A8_UNORM: AHardwareBuffer_Format = 1; pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_R8G8B8X8_UNORM: AHardwareBuffer_Format = 2; @@ -1679,6 +1920,8 @@ 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; @@ -1771,6 +2014,8 @@ pub struct AHardwareBuffer_Desc { } #[test] fn bindgen_test_layout_AHardwareBuffer_Desc() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 40usize, @@ -1782,7 +2027,7 @@ fn bindgen_test_layout_AHardwareBuffer_Desc() { concat!("Alignment of ", stringify!(AHardwareBuffer_Desc)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).width as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).width) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1792,7 +2037,7 @@ fn bindgen_test_layout_AHardwareBuffer_Desc() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).height as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).height) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -1802,7 +2047,7 @@ fn bindgen_test_layout_AHardwareBuffer_Desc() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).layers as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).layers) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -1812,7 +2057,7 @@ fn bindgen_test_layout_AHardwareBuffer_Desc() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).format as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).format) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", @@ -1822,7 +2067,7 @@ fn bindgen_test_layout_AHardwareBuffer_Desc() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).usage as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).usage) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -1832,7 +2077,7 @@ fn bindgen_test_layout_AHardwareBuffer_Desc() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).stride as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).stride) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -1842,7 +2087,7 @@ fn bindgen_test_layout_AHardwareBuffer_Desc() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).rfu0 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).rfu0) as usize - ptr as usize }, 28usize, concat!( "Offset of field: ", @@ -1852,7 +2097,7 @@ fn bindgen_test_layout_AHardwareBuffer_Desc() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).rfu1 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).rfu1) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -1871,6 +2116,9 @@ pub struct AHardwareBuffer_Plane { } #[test] fn bindgen_test_layout_AHardwareBuffer_Plane() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 12usize, @@ -1882,7 +2130,7 @@ fn bindgen_test_layout_AHardwareBuffer_Plane() { concat!("Alignment of ", stringify!(AHardwareBuffer_Plane)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).data as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).data) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1892,9 +2140,7 @@ fn bindgen_test_layout_AHardwareBuffer_Plane() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pixelStride as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).pixelStride) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -1904,7 +2150,7 @@ fn bindgen_test_layout_AHardwareBuffer_Plane() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).rowStride as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).rowStride) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -1922,6 +2168,9 @@ pub struct AHardwareBuffer_Planes { } #[test] fn bindgen_test_layout_AHardwareBuffer_Planes() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 52usize, @@ -1933,9 +2182,7 @@ fn bindgen_test_layout_AHardwareBuffer_Planes() { concat!("Alignment of ", stringify!(AHardwareBuffer_Planes)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).planeCount as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).planeCount) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1945,7 +2192,7 @@ fn bindgen_test_layout_AHardwareBuffer_Planes() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).planes as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).planes) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -1987,15 +2234,6 @@ 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, @@ -2014,6 +2252,15 @@ 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; } @@ -2028,808 +2275,357 @@ extern "C" { outBytesPerStride: *mut i32, ) -> ::std::os::raw::c_int; } -pub type va_list = __builtin_va_list; -pub type __gnuc_va_list = __builtin_va_list; +extern "C" { + pub fn AHardwareBuffer_getId( + buffer: *const AHardwareBuffer, + outId: *mut u64, + ) -> ::std::os::raw::c_int; +} +#[doc = " \\brief Describe information about a pointer, found in a\n GameActivityMotionEvent.\n\n You can read values directly from this structure, or use helper functions\n (`GameActivityPointerAxes_getX`, `GameActivityPointerAxes_getY` and\n `GameActivityPointerAxes_getAxisValue`).\n\n The X axis and Y axis are enabled by default but any other axis that you want\n to read **must** be enabled first, using\n `GameActivityPointerAxes_enableAxis`.\n\n \\see GameActivityMotionEvent"] #[repr(C)] -pub struct JavaVMAttachArgs { - pub version: jint, - pub name: *const ::std::os::raw::c_char, - pub group: jobject, +#[derive(Debug, Copy, Clone)] +pub struct GameActivityPointerAxes { + pub id: i32, + pub toolType: i32, + pub axisValues: [f32; 48usize], + pub rawX: f32, + pub rawY: f32, } #[test] -fn bindgen_test_layout_JavaVMAttachArgs() { +fn bindgen_test_layout_GameActivityPointerAxes() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 12usize, - concat!("Size of: ", stringify!(JavaVMAttachArgs)) + ::std::mem::size_of::(), + 208usize, + concat!("Size of: ", stringify!(GameActivityPointerAxes)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(JavaVMAttachArgs)) + concat!("Alignment of ", stringify!(GameActivityPointerAxes)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).version as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(JavaVMAttachArgs), + stringify!(GameActivityPointerAxes), "::", - stringify!(version) + stringify!(id) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).name as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).toolType) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", - stringify!(JavaVMAttachArgs), + stringify!(GameActivityPointerAxes), "::", - stringify!(name) + stringify!(toolType) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).group as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).axisValues) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(JavaVMAttachArgs), + stringify!(GameActivityPointerAxes), "::", - stringify!(group) + stringify!(axisValues) ) ); -} -#[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, + unsafe { ::std::ptr::addr_of!((*ptr).rawX) as usize - ptr as usize }, + 200usize, concat!( "Offset of field: ", - stringify!(JavaVMOption), + stringify!(GameActivityPointerAxes), "::", - stringify!(optionString) + stringify!(rawX) ) ); 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; -pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_IME: GameCommonInsetsType = 2; -pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_MANDATORY_SYSTEM_GESTURES: - GameCommonInsetsType = 3; -pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_NAVIGATION_BARS: GameCommonInsetsType = 4; -pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_STATUS_BARS: GameCommonInsetsType = 5; -pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_SYSTEM_BARS: GameCommonInsetsType = 6; -pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_SYSTEM_GESTURES: GameCommonInsetsType = 7; -pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_TAPABLE_ELEMENT: GameCommonInsetsType = 8; -pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_WATERFALL: GameCommonInsetsType = 9; -pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_COUNT: GameCommonInsetsType = 10; -#[doc = " The type of a component for which to retrieve insets. See"] -#[doc = " https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type"] -pub type GameCommonInsetsType = ::std::os::raw::c_uint; -#[doc = " This struct holds a span within a region of text from start (inclusive) to"] -#[doc = " end (exclusive). An empty span or cursor position is specified with"] -#[doc = " start==end. An undefined span is specified with start = end = SPAN_UNDEFINED."] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct GameTextInputSpan { - #[doc = " The start of the region (inclusive)."] - pub start: i32, - #[doc = " The end of the region (exclusive)."] - pub end: i32, -} -#[test] -fn bindgen_test_layout_GameTextInputSpan() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(GameTextInputSpan)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(GameTextInputSpan)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).start as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(GameTextInputSpan), - "::", - stringify!(start) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).end as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(GameTextInputSpan), - "::", - stringify!(end) - ) - ); -} -pub const GameTextInputSpanFlag_SPAN_UNDEFINED: GameTextInputSpanFlag = -1; -#[doc = " Values with special meaning in a GameTextInputSpan."] -pub type GameTextInputSpanFlag = ::std::os::raw::c_int; -#[doc = " This struct holds the state of an editable section of text."] -#[doc = " The text can have a selection and a composing region defined on it."] -#[doc = " A composing region is used by IMEs that allow input using multiple steps to"] -#[doc = " compose a glyph or word. Use functions GameTextInput_getState and"] -#[doc = " GameTextInput_setState to read and modify the state that an IME is editing."] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct GameTextInputState { - #[doc = " Text owned by the state, as a modified UTF-8 string. Null-terminated."] - #[doc = " https://en.wikipedia.org/wiki/UTF-8#Modified_UTF-8"] - pub text_UTF8: *const ::std::os::raw::c_char, - #[doc = " Length in bytes of text_UTF8, *not* including the null at end."] - pub text_length: i32, - #[doc = " A selection defined on the text."] - pub selection: GameTextInputSpan, - #[doc = " A composing region defined on the text."] - pub composingRegion: GameTextInputSpan, -} -#[test] -fn bindgen_test_layout_GameTextInputState() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(GameTextInputState)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(GameTextInputState)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).text_UTF8 as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(GameTextInputState), - "::", - stringify!(text_UTF8) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).text_length as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(GameTextInputState), - "::", - stringify!(text_length) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).selection as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(GameTextInputState), - "::", - stringify!(selection) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).composingRegion as *const _ as usize - }, - 16usize, + unsafe { ::std::ptr::addr_of!((*ptr).rawY) as usize - ptr as usize }, + 204usize, concat!( "Offset of field: ", - stringify!(GameTextInputState), + stringify!(GameActivityPointerAxes), "::", - stringify!(composingRegion) + stringify!(rawY) ) ); } -#[doc = " A callback called by GameTextInput_getState."] -#[doc = " @param context User-defined context."] -#[doc = " @param state State, owned by the library, that will be valid for the duration"] -#[doc = " of the callback."] -pub type GameTextInputGetStateCallback = ::std::option::Option< - unsafe extern "C" fn(context: *mut ::std::os::raw::c_void, state: *const GameTextInputState), ->; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct GameTextInput { - _unused: [u8; 0], -} -extern "C" { - #[doc = " Initialize the GameTextInput library."] - #[doc = " If called twice without GameTextInput_destroy being called, the same pointer"] - #[doc = " will be returned and a warning will be issued."] - #[doc = " @param env A JNI env valid on the calling thread."] - #[doc = " @param max_string_size The maximum length of a string that can be edited. If"] - #[doc = " zero, the maximum defaults to 65536 bytes. A buffer of this size is allocated"] - #[doc = " at initialization."] - #[doc = " @return A handle to the library."] - pub fn GameTextInput_init(env: *mut JNIEnv, max_string_size: u32) -> *mut GameTextInput; -} -extern "C" { - #[doc = " When using GameTextInput, you need to create a gametextinput.InputConnection"] - #[doc = " on the Java side and pass it using this function to the library, unless using"] - #[doc = " GameActivity in which case this will be done for you. See the GameActivity"] - #[doc = " source code or GameTextInput samples for examples of usage."] - #[doc = " @param input A valid GameTextInput library handle."] - #[doc = " @param inputConnection A gametextinput.InputConnection object."] - pub fn GameTextInput_setInputConnection(input: *mut GameTextInput, inputConnection: jobject); -} -extern "C" { - #[doc = " Unless using GameActivity, it is required to call this function from your"] - #[doc = " Java gametextinput.Listener.stateChanged method to convert eventState and"] - #[doc = " trigger any event callbacks. When using GameActivity, this does not need to"] - #[doc = " be called as event processing is handled by the Activity."] - #[doc = " @param input A valid GameTextInput library handle."] - #[doc = " @param eventState A Java gametextinput.State object."] - pub fn GameTextInput_processEvent(input: *mut GameTextInput, eventState: jobject); -} -extern "C" { - #[doc = " Free any resources owned by the GameTextInput library."] - #[doc = " Any subsequent calls to the library will fail until GameTextInput_init is"] - #[doc = " called again."] - #[doc = " @param input A valid GameTextInput library handle."] - pub fn GameTextInput_destroy(input: *mut GameTextInput); -} -pub const ShowImeFlags_SHOW_IME_UNDEFINED: ShowImeFlags = 0; -pub const ShowImeFlags_SHOW_IMPLICIT: ShowImeFlags = 1; -pub const ShowImeFlags_SHOW_FORCED: ShowImeFlags = 2; -#[doc = " Flags to be passed to GameTextInput_showIme."] -pub type ShowImeFlags = ::std::os::raw::c_uint; -extern "C" { - #[doc = " Show the IME. Calls InputMethodManager.showSoftInput()."] - #[doc = " @param input A valid GameTextInput library handle."] - #[doc = " @param flags Defined in ShowImeFlags above. For more information see:"] - #[doc = " https://developer.android.com/reference/android/view/inputmethod/InputMethodManager"] - pub fn GameTextInput_showIme(input: *mut GameTextInput, flags: u32); -} -pub const HideImeFlags_HIDE_IME_UNDEFINED: HideImeFlags = 0; -pub const HideImeFlags_HIDE_IMPLICIT_ONLY: HideImeFlags = 1; -pub const HideImeFlags_HIDE_NOT_ALWAYS: HideImeFlags = 2; -#[doc = " Flags to be passed to GameTextInput_hideIme."] -pub type HideImeFlags = ::std::os::raw::c_uint; -extern "C" { - #[doc = " Show the IME. Calls InputMethodManager.hideSoftInputFromWindow()."] - #[doc = " @param input A valid GameTextInput library handle."] - #[doc = " @param flags Defined in HideImeFlags above. For more information see:"] - #[doc = " https://developer.android.com/reference/android/view/inputmethod/InputMethodManager"] - pub fn GameTextInput_hideIme(input: *mut GameTextInput, flags: u32); -} -extern "C" { - #[doc = " Call a callback with the current GameTextInput state, which may have been"] - #[doc = " modified by changes in the IME and calls to GameTextInput_setState. We use a"] - #[doc = " callback rather than returning the state in order to simplify ownership of"] - #[doc = " text_UTF8 strings. These strings are only valid during the calling of the"] - #[doc = " callback."] - #[doc = " @param input A valid GameTextInput library handle."] - #[doc = " @param callback A function that will be called with valid state."] - #[doc = " @param context Context used by the callback."] - pub fn GameTextInput_getState( - input: *mut GameTextInput, - callback: GameTextInputGetStateCallback, - context: *mut ::std::os::raw::c_void, - ); -} -extern "C" { - #[doc = " Set the current GameTextInput state. This state is reflected to any active"] - #[doc = " IME."] - #[doc = " @param input A valid GameTextInput library handle."] - #[doc = " @param state The state to set. Ownership is maintained by the caller and must"] - #[doc = " remain valid for the duration of the call."] - pub fn GameTextInput_setState(input: *mut GameTextInput, state: *const GameTextInputState); -} -#[doc = " Type of the callback needed by GameTextInput_setEventCallback that will be"] -#[doc = " called every time the IME state changes."] -#[doc = " @param context User-defined context set in GameTextInput_setEventCallback."] -#[doc = " @param current_state Current IME state, owned by the library and valid during"] -#[doc = " the callback."] -pub type GameTextInputEventCallback = ::std::option::Option< - unsafe extern "C" fn( - context: *mut ::std::os::raw::c_void, - current_state: *const GameTextInputState, - ), ->; extern "C" { - #[doc = " Optionally set a callback to be called whenever the IME state changes."] - #[doc = " Not necessary if you are using GameActivity, which handles these callbacks"] - #[doc = " for you."] - #[doc = " @param input A valid GameTextInput library handle."] - #[doc = " @param callback Called by the library when the IME state changes."] - #[doc = " @param context Context passed as first argument to the callback."] - pub fn GameTextInput_setEventCallback( - input: *mut GameTextInput, - callback: GameTextInputEventCallback, - context: *mut ::std::os::raw::c_void, - ); -} -#[doc = " Type of the callback needed by GameTextInput_setImeInsetsCallback that will"] -#[doc = " be called every time the IME window insets change."] -#[doc = " @param context User-defined context set in"] -#[doc = " GameTextInput_setImeWIndowInsetsCallback."] -#[doc = " @param current_insets Current IME insets, owned by the library and valid"] -#[doc = " during the callback."] -pub type GameTextInputImeInsetsCallback = ::std::option::Option< - unsafe extern "C" fn(context: *mut ::std::os::raw::c_void, current_insets: *const ARect), ->; -extern "C" { - #[doc = " Optionally set a callback to be called whenever the IME insets change."] - #[doc = " Not necessary if you are using GameActivity, which handles these callbacks"] - #[doc = " for you."] - #[doc = " @param input A valid GameTextInput library handle."] - #[doc = " @param callback Called by the library when the IME insets change."] - #[doc = " @param context Context passed as first argument to the callback."] - pub fn GameTextInput_setImeInsetsCallback( - input: *mut GameTextInput, - callback: GameTextInputImeInsetsCallback, - context: *mut ::std::os::raw::c_void, - ); -} -extern "C" { - #[doc = " Get the current window insets for the IME."] - #[doc = " @param input A valid GameTextInput library handle."] - #[doc = " @param insets Filled with the current insets by this function."] - pub fn GameTextInput_getImeInsets(input: *const GameTextInput, insets: *mut ARect); -} -extern "C" { - #[doc = " Unless using GameActivity, it is required to call this function from your"] - #[doc = " Java gametextinput.Listener.onImeInsetsChanged method to"] - #[doc = " trigger any event callbacks. When using GameActivity, this does not need to"] - #[doc = " be called as insets processing is handled by the Activity."] - #[doc = " @param input A valid GameTextInput library handle."] - #[doc = " @param eventState A Java gametextinput.State object."] - pub fn GameTextInput_processImeInsets(input: *mut GameTextInput, insets: *const ARect); + #[doc = " \\brief Enable the specified axis, so that its value is reported in the\n GameActivityPointerAxes structures stored in a motion event.\n\n You must enable any axis that you want to read, apart from\n `AMOTION_EVENT_AXIS_X` and `AMOTION_EVENT_AXIS_Y` that are enabled by\n default.\n\n If the axis index is out of range, nothing is done."] + pub fn GameActivityPointerAxes_enableAxis(axis: i32); } extern "C" { - #[doc = " Convert a GameTextInputState struct to a Java gametextinput.State object."] - #[doc = " Don't forget to delete the returned Java local ref when you're done."] - #[doc = " @param input A valid GameTextInput library handle."] - #[doc = " @param state Input state to convert."] - #[doc = " @return A Java object of class gametextinput.State. The caller is required to"] - #[doc = " delete this local reference."] - pub fn GameTextInputState_toJava( - input: *const GameTextInput, - state: *const GameTextInputState, - ) -> jobject; + #[doc = " \\brief Disable the specified axis. Its value won't be reported in the\n GameActivityPointerAxes structures stored in a motion event anymore.\n\n Apart from X and Y, any axis that you want to read **must** be enabled first,\n using `GameActivityPointerAxes_enableAxis`.\n\n If the axis index is out of range, nothing is done."] + pub fn GameActivityPointerAxes_disableAxis(axis: i32); } extern "C" { - #[doc = " Convert from a Java gametextinput.State object into a C GameTextInputState"] - #[doc = " struct."] - #[doc = " @param input A valid GameTextInput library handle."] - #[doc = " @param state A Java gametextinput.State object."] - #[doc = " @param callback A function called with the C struct, valid for the duration"] - #[doc = " of the call."] - #[doc = " @param context Context passed to the callback."] - pub fn GameTextInputState_fromJava( - input: *const GameTextInput, - state: jobject, - callback: GameTextInputGetStateCallback, - context: *mut ::std::os::raw::c_void, - ); + #[doc = " \\brief Get the value of the requested axis.\n\n Apart from X and Y, any axis that you want to read **must** be enabled first,\n using `GameActivityPointerAxes_enableAxis`.\n\n Find the valid enums for the axis (`AMOTION_EVENT_AXIS_X`,\n `AMOTION_EVENT_AXIS_Y`, `AMOTION_EVENT_AXIS_PRESSURE`...)\n in https://developer.android.com/ndk/reference/group/input.\n\n @param pointerInfo The structure containing information about the pointer,\n obtained from GameActivityMotionEvent.\n @param axis The axis to get the value from\n @return The value of the axis, or 0 if the axis is invalid or was not\n enabled."] + pub fn GameActivityPointerAxes_getAxisValue( + pointerInfo: *const GameActivityPointerAxes, + axis: i32, + ) -> f32; } -#[doc = " This structure defines the native side of an android.app.GameActivity."] -#[doc = " It is created by the framework, and handed to the application's native"] -#[doc = " code as it is being launched."] +#[doc = " \\brief Describe a motion event that happened on the GameActivity SurfaceView.\n\n This is 1:1 mapping to the information contained in a Java `MotionEvent`\n (see https://developer.android.com/reference/android/view/MotionEvent)."] #[repr(C)] -pub struct GameActivity { - #[doc = " Pointer to the callback function table of the native application."] - #[doc = " You can set the functions here to your own callbacks. The callbacks"] - #[doc = " pointer itself here should not be changed; it is allocated and managed"] - #[doc = " for you by the framework."] - pub callbacks: *mut GameActivityCallbacks, - #[doc = " The global handle on the process's Java VM."] - pub vm: *mut JavaVM, - #[doc = " JNI context for the main thread of the app. Note that this field"] - #[doc = " can ONLY be used from the main thread of the process; that is, the"] - #[doc = " thread that calls into the GameActivityCallbacks."] - pub env: *mut JNIEnv, - #[doc = " The GameActivity object handle."] - pub javaGameActivity: jobject, - #[doc = " Path to this application's internal data directory."] - pub internalDataPath: *const ::std::os::raw::c_char, - #[doc = " Path to this application's external (removable/mountable) data directory."] - pub externalDataPath: *const ::std::os::raw::c_char, - #[doc = " The platform's SDK version code."] - pub sdkVersion: i32, - #[doc = " This is the native instance of the application. It is not used by"] - #[doc = " the framework, but can be set by the application to its own instance"] - #[doc = " state."] - pub instance: *mut ::std::os::raw::c_void, - #[doc = " Pointer to the Asset Manager instance for the application. The"] - #[doc = " application uses this to access binary assets bundled inside its own .apk"] - #[doc = " file."] - pub assetManager: *mut AAssetManager, - #[doc = " Available starting with Honeycomb: path to the directory containing"] - #[doc = " the application's OBB files (if any). If the app doesn't have any"] - #[doc = " OBB files, this directory may not exist."] - pub obbPath: *const ::std::os::raw::c_char, +#[derive(Debug, Copy, Clone)] +pub struct GameActivityMotionEvent { + pub deviceId: i32, + pub source: i32, + pub action: i32, + pub eventTime: i64, + pub downTime: i64, + pub flags: i32, + pub metaState: i32, + pub actionButton: i32, + pub buttonState: i32, + pub classification: i32, + pub edgeFlags: i32, + pub pointerCount: u32, + pub pointers: [GameActivityPointerAxes; 8usize], + pub historySize: ::std::os::raw::c_int, + pub historicalEventTimesMillis: *mut i64, + pub historicalEventTimesNanos: *mut i64, + pub historicalAxisValues: *mut f32, + pub precisionX: f32, + pub precisionY: f32, } #[test] -fn bindgen_test_layout_GameActivity() { +fn bindgen_test_layout_GameActivityMotionEvent() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 40usize, - concat!("Size of: ", stringify!(GameActivity)) + ::std::mem::size_of::(), + 1744usize, + concat!("Size of: ", stringify!(GameActivityMotionEvent)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(GameActivity)) + concat!("Alignment of ", stringify!(GameActivityMotionEvent)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).callbacks as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).deviceId) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(GameActivity), + stringify!(GameActivityMotionEvent), "::", - stringify!(callbacks) + stringify!(deviceId) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).vm as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).source) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", - stringify!(GameActivity), + stringify!(GameActivityMotionEvent), "::", - stringify!(vm) + stringify!(source) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).env as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).action) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(GameActivity), + stringify!(GameActivityMotionEvent), "::", - stringify!(env) + stringify!(action) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).javaGameActivity as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).eventTime) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", - stringify!(GameActivity), + stringify!(GameActivityMotionEvent), "::", - stringify!(javaGameActivity) + stringify!(eventTime) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).internalDataPath as *const _ as usize }, - 16usize, + unsafe { ::std::ptr::addr_of!((*ptr).downTime) as usize - ptr as usize }, + 20usize, concat!( "Offset of field: ", - stringify!(GameActivity), + stringify!(GameActivityMotionEvent), "::", - stringify!(internalDataPath) + stringify!(downTime) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).externalDataPath as *const _ as usize }, - 20usize, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + 28usize, concat!( "Offset of field: ", - stringify!(GameActivity), + stringify!(GameActivityMotionEvent), "::", - stringify!(externalDataPath) + stringify!(flags) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sdkVersion as *const _ as usize }, - 24usize, + unsafe { ::std::ptr::addr_of!((*ptr).metaState) as usize - ptr as usize }, + 32usize, concat!( "Offset of field: ", - stringify!(GameActivity), + stringify!(GameActivityMotionEvent), "::", - stringify!(sdkVersion) + stringify!(metaState) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).instance as *const _ as usize }, - 28usize, + unsafe { ::std::ptr::addr_of!((*ptr).actionButton) as usize - ptr as usize }, + 36usize, concat!( "Offset of field: ", - stringify!(GameActivity), + stringify!(GameActivityMotionEvent), "::", - stringify!(instance) + stringify!(actionButton) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).assetManager as *const _ as usize }, - 32usize, + unsafe { ::std::ptr::addr_of!((*ptr).buttonState) as usize - ptr as usize }, + 40usize, concat!( "Offset of field: ", - stringify!(GameActivity), + stringify!(GameActivityMotionEvent), "::", - stringify!(assetManager) + stringify!(buttonState) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).obbPath as *const _ as usize }, - 36usize, + unsafe { ::std::ptr::addr_of!((*ptr).classification) as usize - ptr as usize }, + 44usize, concat!( "Offset of field: ", - stringify!(GameActivity), + stringify!(GameActivityMotionEvent), "::", - stringify!(obbPath) + stringify!(classification) ) ); -} -#[doc = " \\brief Describe information about a pointer, found in a"] -#[doc = " GameActivityMotionEvent."] -#[doc = ""] -#[doc = " You can read values directly from this structure, or use helper functions"] -#[doc = " (`GameActivityPointerAxes_getX`, `GameActivityPointerAxes_getY` and"] -#[doc = " `GameActivityPointerAxes_getAxisValue`)."] -#[doc = ""] -#[doc = " The X axis and Y axis are enabled by default but any other axis that you want"] -#[doc = " to read **must** be enabled first, using"] -#[doc = " `GameActivityPointerAxes_enableAxis`."] -#[doc = ""] -#[doc = " \\see GameActivityMotionEvent"] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct GameActivityPointerAxes { - pub id: i32, - pub toolType: i32, - pub axisValues: [f32; 48usize], - pub rawX: f32, - pub rawY: f32, -} -#[test] -fn bindgen_test_layout_GameActivityPointerAxes() { - assert_eq!( - ::std::mem::size_of::(), - 208usize, - concat!("Size of: ", stringify!(GameActivityPointerAxes)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(GameActivityPointerAxes)) - ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).id as *const _ as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).edgeFlags) as usize - ptr as usize }, + 48usize, concat!( "Offset of field: ", - stringify!(GameActivityPointerAxes), + stringify!(GameActivityMotionEvent), "::", - stringify!(id) + stringify!(edgeFlags) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).toolType as *const _ as usize - }, - 4usize, + unsafe { ::std::ptr::addr_of!((*ptr).pointerCount) as usize - ptr as usize }, + 52usize, concat!( "Offset of field: ", - stringify!(GameActivityPointerAxes), + stringify!(GameActivityMotionEvent), "::", - stringify!(toolType) + stringify!(pointerCount) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).axisValues as *const _ as usize - }, - 8usize, + unsafe { ::std::ptr::addr_of!((*ptr).pointers) as usize - ptr as usize }, + 56usize, concat!( "Offset of field: ", - stringify!(GameActivityPointerAxes), + stringify!(GameActivityMotionEvent), "::", - stringify!(axisValues) + stringify!(pointers) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).rawX as *const _ as usize }, - 200usize, + unsafe { ::std::ptr::addr_of!((*ptr).historySize) as usize - ptr as usize }, + 1720usize, concat!( "Offset of field: ", - stringify!(GameActivityPointerAxes), + stringify!(GameActivityMotionEvent), "::", - stringify!(rawX) + stringify!(historySize) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).rawY as *const _ as usize }, - 204usize, + unsafe { ::std::ptr::addr_of!((*ptr).historicalEventTimesMillis) as usize - ptr as usize }, + 1724usize, concat!( "Offset of field: ", - stringify!(GameActivityPointerAxes), + stringify!(GameActivityMotionEvent), "::", - stringify!(rawY) + stringify!(historicalEventTimesMillis) ) ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct GameActivityHistoricalPointerAxes { - pub eventTime: i64, - pub axisValues: [f32; 48usize], -} -#[test] -fn bindgen_test_layout_GameActivityHistoricalPointerAxes() { assert_eq!( - ::std::mem::size_of::(), - 200usize, - concat!("Size of: ", stringify!(GameActivityHistoricalPointerAxes)) + unsafe { ::std::ptr::addr_of!((*ptr).historicalEventTimesNanos) as usize - ptr as usize }, + 1728usize, + concat!( + "Offset of field: ", + stringify!(GameActivityMotionEvent), + "::", + stringify!(historicalEventTimesNanos) + ) ); assert_eq!( - ::std::mem::align_of::(), - 4usize, + unsafe { ::std::ptr::addr_of!((*ptr).historicalAxisValues) as usize - ptr as usize }, + 1732usize, concat!( - "Alignment of ", - stringify!(GameActivityHistoricalPointerAxes) + "Offset of field: ", + stringify!(GameActivityMotionEvent), + "::", + stringify!(historicalAxisValues) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).eventTime as *const _ - as usize - }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).precisionX) as usize - ptr as usize }, + 1736usize, concat!( "Offset of field: ", - stringify!(GameActivityHistoricalPointerAxes), + stringify!(GameActivityMotionEvent), "::", - stringify!(eventTime) + stringify!(precisionX) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).axisValues as *const _ - as usize - }, - 8usize, + unsafe { ::std::ptr::addr_of!((*ptr).precisionY) as usize - ptr as usize }, + 1740usize, concat!( "Offset of field: ", - stringify!(GameActivityHistoricalPointerAxes), + stringify!(GameActivityMotionEvent), "::", - stringify!(axisValues) + stringify!(precisionY) ) ); } extern "C" { - #[doc = " \\brief Enable the specified axis, so that its value is reported in the"] - #[doc = " GameActivityPointerAxes structures stored in a motion event."] - #[doc = ""] - #[doc = " You must enable any axis that you want to read, apart from"] - #[doc = " `AMOTION_EVENT_AXIS_X` and `AMOTION_EVENT_AXIS_Y` that are enabled by"] - #[doc = " default."] - #[doc = ""] - #[doc = " If the axis index is out of range, nothing is done."] - pub fn GameActivityPointerAxes_enableAxis(axis: i32); -} -extern "C" { - #[doc = " \\brief Disable the specified axis. Its value won't be reported in the"] - #[doc = " GameActivityPointerAxes structures stored in a motion event anymore."] - #[doc = ""] - #[doc = " Apart from X and Y, any axis that you want to read **must** be enabled first,"] - #[doc = " using `GameActivityPointerAxes_enableAxis`."] - #[doc = ""] - #[doc = " If the axis index is out of range, nothing is done."] - pub fn GameActivityPointerAxes_disableAxis(axis: i32); + pub fn GameActivityMotionEvent_getHistoricalAxisValue( + event: *const GameActivityMotionEvent, + axis: ::std::os::raw::c_int, + pointerIndex: ::std::os::raw::c_int, + historyPos: ::std::os::raw::c_int, + ) -> f32; } extern "C" { - #[doc = " \\brief Enable the specified axis, so that its value is reported in the"] - #[doc = " GameActivityHistoricalPointerAxes structures associated with a motion event."] - #[doc = ""] - #[doc = " You must enable any axis that you want to read (no axes are enabled by"] - #[doc = " default)."] - #[doc = ""] - #[doc = " If the axis index is out of range, nothing is done."] - pub fn GameActivityHistoricalPointerAxes_enableAxis(axis: i32); + #[doc = " \\brief Handle the freeing of the GameActivityMotionEvent struct."] + pub fn GameActivityMotionEvent_destroy(c_event: *mut GameActivityMotionEvent); } extern "C" { - #[doc = " \\brief Disable the specified axis. Its value won't be reported in the"] - #[doc = " GameActivityHistoricalPointerAxes structures associated with motion events"] - #[doc = " anymore."] - #[doc = ""] - #[doc = " If the axis index is out of range, nothing is done."] - pub fn GameActivityHistoricalPointerAxes_disableAxis(axis: i32); + #[doc = " \\brief Convert a Java `MotionEvent` to a `GameActivityMotionEvent`.\n\n This is done automatically by the GameActivity: see `onTouchEvent` to set\n a callback to consume the received events.\n This function can be used if you re-implement events handling in your own\n activity.\n Ownership of out_event is maintained by the caller."] + pub fn GameActivityMotionEvent_fromJava( + env: *mut JNIEnv, + motionEvent: jobject, + out_event: *mut GameActivityMotionEvent, + ); } -#[doc = " \\brief Describe a motion event that happened on the GameActivity SurfaceView."] -#[doc = ""] -#[doc = " This is 1:1 mapping to the information contained in a Java `MotionEvent`"] -#[doc = " (see https://developer.android.com/reference/android/view/MotionEvent)."] +#[doc = " \\brief Describe a key event that happened on the GameActivity SurfaceView.\n\n This is 1:1 mapping to the information contained in a Java `KeyEvent`\n (see https://developer.android.com/reference/android/view/KeyEvent).\n The only exception is the event times, which are reported as\n nanoseconds in this struct."] #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct GameActivityMotionEvent { +pub struct GameActivityKeyEvent { pub deviceId: i32, pub source: i32, pub action: i32, @@ -2837,374 +2633,534 @@ pub struct GameActivityMotionEvent { pub downTime: i64, pub flags: i32, pub metaState: i32, - pub actionButton: i32, - pub buttonState: i32, - pub classification: i32, - pub edgeFlags: i32, - pub pointerCount: u32, - pub pointers: [GameActivityPointerAxes; 8usize], - pub precisionX: f32, - pub precisionY: f32, - pub historicalStart: i16, - pub historicalCount: i16, + pub modifiers: i32, + pub repeatCount: i32, + pub keyCode: i32, + pub scanCode: i32, + pub unicodeChar: i32, } #[test] -fn bindgen_test_layout_GameActivityMotionEvent() { +fn bindgen_test_layout_GameActivityKeyEvent() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 1732usize, - concat!("Size of: ", stringify!(GameActivityMotionEvent)) + ::std::mem::size_of::(), + 56usize, + concat!("Size of: ", stringify!(GameActivityKeyEvent)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(GameActivityMotionEvent)) + concat!("Alignment of ", stringify!(GameActivityKeyEvent)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).deviceId as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).deviceId) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(GameActivityMotionEvent), + stringify!(GameActivityKeyEvent), "::", stringify!(deviceId) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).source as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).source) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", - stringify!(GameActivityMotionEvent), + stringify!(GameActivityKeyEvent), "::", stringify!(source) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).action as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).action) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(GameActivityMotionEvent), + stringify!(GameActivityKeyEvent), "::", stringify!(action) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).eventTime as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).eventTime) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", - stringify!(GameActivityMotionEvent), + stringify!(GameActivityKeyEvent), "::", stringify!(eventTime) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).downTime as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).downTime) as usize - ptr as usize }, 20usize, concat!( "Offset of field: ", - stringify!(GameActivityMotionEvent), + stringify!(GameActivityKeyEvent), "::", stringify!(downTime) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 28usize, concat!( "Offset of field: ", - stringify!(GameActivityMotionEvent), + stringify!(GameActivityKeyEvent), "::", stringify!(flags) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).metaState as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).metaState) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", - stringify!(GameActivityMotionEvent), + stringify!(GameActivityKeyEvent), "::", stringify!(metaState) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).actionButton as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).modifiers) as usize - ptr as usize }, 36usize, concat!( "Offset of field: ", - stringify!(GameActivityMotionEvent), + stringify!(GameActivityKeyEvent), "::", - stringify!(actionButton) + stringify!(modifiers) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).repeatCount) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(GameActivityKeyEvent), + "::", + stringify!(repeatCount) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).keyCode) as usize - ptr as usize }, + 44usize, + concat!( + "Offset of field: ", + stringify!(GameActivityKeyEvent), + "::", + stringify!(keyCode) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).scanCode) as usize - ptr as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(GameActivityKeyEvent), + "::", + stringify!(scanCode) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).unicodeChar) as usize - ptr as usize }, + 52usize, + concat!( + "Offset of field: ", + stringify!(GameActivityKeyEvent), + "::", + stringify!(unicodeChar) ) ); +} +extern "C" { + #[doc = " \\brief Convert a Java `KeyEvent` to a `GameActivityKeyEvent`.\n\n This is done automatically by the GameActivity: see `onKeyUp` and `onKeyDown`\n to set a callback to consume the received events.\n This function can be used if you re-implement events handling in your own\n activity.\n Ownership of out_event is maintained by the caller."] + pub fn GameActivityKeyEvent_fromJava( + env: *mut JNIEnv, + motionEvent: jobject, + out_event: *mut GameActivityKeyEvent, + ); +} +pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_CAPTION_BAR: GameCommonInsetsType = 0; +pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_DISPLAY_CUTOUT: GameCommonInsetsType = 1; +pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_IME: GameCommonInsetsType = 2; +pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_MANDATORY_SYSTEM_GESTURES: + GameCommonInsetsType = 3; +pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_NAVIGATION_BARS: GameCommonInsetsType = 4; +pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_STATUS_BARS: GameCommonInsetsType = 5; +pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_SYSTEM_BARS: GameCommonInsetsType = 6; +pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_SYSTEM_GESTURES: GameCommonInsetsType = 7; +pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_TAPABLE_ELEMENT: GameCommonInsetsType = 8; +pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_WATERFALL: GameCommonInsetsType = 9; +pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_COUNT: GameCommonInsetsType = 10; +#[doc = " The type of a component for which to retrieve insets. See\n https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type"] +pub type GameCommonInsetsType = ::std::os::raw::c_uint; +#[doc = " This struct holds a span within a region of text from start (inclusive) to\n end (exclusive). An empty span or cursor position is specified with\n start==end. An undefined span is specified with start = end = SPAN_UNDEFINED."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GameTextInputSpan { + #[doc = " The start of the region (inclusive)."] + pub start: i32, + #[doc = " The end of the region (exclusive)."] + pub end: i32, +} +#[test] +fn bindgen_test_layout_GameTextInputSpan() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(GameTextInputSpan)) + ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).buttonState as *const _ as usize - }, - 40usize, - concat!( - "Offset of field: ", - stringify!(GameActivityMotionEvent), - "::", - stringify!(buttonState) - ) + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(GameTextInputSpan)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).classification as *const _ as usize - }, - 44usize, + unsafe { ::std::ptr::addr_of!((*ptr).start) as usize - ptr as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(GameActivityMotionEvent), + stringify!(GameTextInputSpan), "::", - stringify!(classification) + stringify!(start) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).edgeFlags as *const _ as usize - }, - 48usize, + unsafe { ::std::ptr::addr_of!((*ptr).end) as usize - ptr as usize }, + 4usize, concat!( "Offset of field: ", - stringify!(GameActivityMotionEvent), + stringify!(GameTextInputSpan), "::", - stringify!(edgeFlags) + stringify!(end) ) ); +} +pub const GameTextInputSpanFlag_SPAN_UNDEFINED: GameTextInputSpanFlag = -1; +#[doc = " Values with special meaning in a GameTextInputSpan."] +pub type GameTextInputSpanFlag = ::std::os::raw::c_int; +#[doc = " This struct holds the state of an editable section of text.\n The text can have a selection and a composing region defined on it.\n A composing region is used by IMEs that allow input using multiple steps to\n compose a glyph or word. Use functions GameTextInput_getState and\n GameTextInput_setState to read and modify the state that an IME is editing."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GameTextInputState { + #[doc = " Text owned by the state, as a modified UTF-8 string. Null-terminated.\n https://en.wikipedia.org/wiki/UTF-8#Modified_UTF-8"] + pub text_UTF8: *const ::std::os::raw::c_char, + #[doc = " Length in bytes of text_UTF8, *not* including the null at end."] + pub text_length: i32, + #[doc = " A selection defined on the text."] + pub selection: GameTextInputSpan, + #[doc = " A composing region defined on the text."] + pub composingRegion: GameTextInputSpan, +} +#[test] +fn bindgen_test_layout_GameTextInputState() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pointerCount as *const _ as usize - }, - 52usize, - concat!( - "Offset of field: ", - stringify!(GameActivityMotionEvent), - "::", - stringify!(pointerCount) - ) + ::std::mem::size_of::(), + 24usize, + concat!("Size of: ", stringify!(GameTextInputState)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pointers as *const _ as usize - }, - 56usize, - concat!( - "Offset of field: ", - stringify!(GameActivityMotionEvent), - "::", - stringify!(pointers) - ) + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(GameTextInputState)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).precisionX as *const _ as usize - }, - 1720usize, + unsafe { ::std::ptr::addr_of!((*ptr).text_UTF8) as usize - ptr as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(GameActivityMotionEvent), + stringify!(GameTextInputState), "::", - stringify!(precisionX) + stringify!(text_UTF8) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).precisionY as *const _ as usize - }, - 1724usize, + unsafe { ::std::ptr::addr_of!((*ptr).text_length) as usize - ptr as usize }, + 4usize, concat!( "Offset of field: ", - stringify!(GameActivityMotionEvent), + stringify!(GameTextInputState), "::", - stringify!(precisionY) + stringify!(text_length) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).historicalStart as *const _ as usize - }, - 1728usize, + unsafe { ::std::ptr::addr_of!((*ptr).selection) as usize - ptr as usize }, + 8usize, concat!( "Offset of field: ", - stringify!(GameActivityMotionEvent), + stringify!(GameTextInputState), "::", - stringify!(historicalStart) + stringify!(selection) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).historicalCount as *const _ as usize - }, - 1730usize, + unsafe { ::std::ptr::addr_of!((*ptr).composingRegion) as usize - ptr as usize }, + 16usize, concat!( "Offset of field: ", - stringify!(GameActivityMotionEvent), + stringify!(GameTextInputState), "::", - stringify!(historicalCount) + stringify!(composingRegion) ) ); } -#[doc = " \\brief Describe a key event that happened on the GameActivity SurfaceView."] -#[doc = ""] -#[doc = " This is 1:1 mapping to the information contained in a Java `KeyEvent`"] -#[doc = " (see https://developer.android.com/reference/android/view/KeyEvent)."] +#[doc = " A callback called by GameTextInput_getState.\n @param context User-defined context.\n @param state State, owned by the library, that will be valid for the duration\n of the callback."] +pub type GameTextInputGetStateCallback = ::std::option::Option< + unsafe extern "C" fn(context: *mut ::std::os::raw::c_void, state: *const GameTextInputState), +>; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct GameActivityKeyEvent { - pub deviceId: i32, - pub source: i32, - pub action: i32, - pub eventTime: i64, - pub downTime: i64, - pub flags: i32, - pub metaState: i32, - pub modifiers: i32, - pub repeatCount: i32, - pub keyCode: i32, - pub scanCode: i32, +pub struct GameTextInput { + _unused: [u8; 0], +} +extern "C" { + #[doc = " Initialize the GameTextInput library.\n If called twice without GameTextInput_destroy being called, the same pointer\n will be returned and a warning will be issued.\n @param env A JNI env valid on the calling thread.\n @param max_string_size The maximum length of a string that can be edited. If\n zero, the maximum defaults to 65536 bytes. A buffer of this size is allocated\n at initialization.\n @return A handle to the library."] + pub fn GameTextInput_init(env: *mut JNIEnv, max_string_size: u32) -> *mut GameTextInput; +} +extern "C" { + #[doc = " When using GameTextInput, you need to create a gametextinput.InputConnection\n on the Java side and pass it using this function to the library, unless using\n GameActivity in which case this will be done for you. See the GameActivity\n source code or GameTextInput samples for examples of usage.\n @param input A valid GameTextInput library handle.\n @param inputConnection A gametextinput.InputConnection object."] + pub fn GameTextInput_setInputConnection(input: *mut GameTextInput, inputConnection: jobject); +} +extern "C" { + #[doc = " Unless using GameActivity, it is required to call this function from your\n Java gametextinput.Listener.stateChanged method to convert eventState and\n trigger any event callbacks. When using GameActivity, this does not need to\n be called as event processing is handled by the Activity.\n @param input A valid GameTextInput library handle.\n @param eventState A Java gametextinput.State object."] + pub fn GameTextInput_processEvent(input: *mut GameTextInput, eventState: jobject); +} +extern "C" { + #[doc = " Free any resources owned by the GameTextInput library.\n Any subsequent calls to the library will fail until GameTextInput_init is\n called again.\n @param input A valid GameTextInput library handle."] + pub fn GameTextInput_destroy(input: *mut GameTextInput); +} +pub const ShowImeFlags_SHOW_IME_UNDEFINED: ShowImeFlags = 0; +pub const ShowImeFlags_SHOW_IMPLICIT: ShowImeFlags = 1; +pub const ShowImeFlags_SHOW_FORCED: ShowImeFlags = 2; +#[doc = " Flags to be passed to GameTextInput_showIme."] +pub type ShowImeFlags = ::std::os::raw::c_uint; +extern "C" { + #[doc = " Show the IME. Calls InputMethodManager.showSoftInput().\n @param input A valid GameTextInput library handle.\n @param flags Defined in ShowImeFlags above. For more information see:\n https://developer.android.com/reference/android/view/inputmethod/InputMethodManager"] + pub fn GameTextInput_showIme(input: *mut GameTextInput, flags: u32); +} +pub const HideImeFlags_HIDE_IME_UNDEFINED: HideImeFlags = 0; +pub const HideImeFlags_HIDE_IMPLICIT_ONLY: HideImeFlags = 1; +pub const HideImeFlags_HIDE_NOT_ALWAYS: HideImeFlags = 2; +#[doc = " Flags to be passed to GameTextInput_hideIme."] +pub type HideImeFlags = ::std::os::raw::c_uint; +extern "C" { + #[doc = " Show the IME. Calls InputMethodManager.hideSoftInputFromWindow().\n @param input A valid GameTextInput library handle.\n @param flags Defined in HideImeFlags above. For more information see:\n https://developer.android.com/reference/android/view/inputmethod/InputMethodManager"] + pub fn GameTextInput_hideIme(input: *mut GameTextInput, flags: u32); +} +extern "C" { + #[doc = " Restarts the input method. Calls InputMethodManager.restartInput().\n @param input A valid GameTextInput library handle."] + pub fn GameTextInput_restartInput(input: *mut GameTextInput); +} +extern "C" { + #[doc = " Call a callback with the current GameTextInput state, which may have been\n modified by changes in the IME and calls to GameTextInput_setState. We use a\n callback rather than returning the state in order to simplify ownership of\n text_UTF8 strings. These strings are only valid during the calling of the\n callback.\n @param input A valid GameTextInput library handle.\n @param callback A function that will be called with valid state.\n @param context Context used by the callback."] + pub fn GameTextInput_getState( + input: *mut GameTextInput, + callback: GameTextInputGetStateCallback, + context: *mut ::std::os::raw::c_void, + ); +} +extern "C" { + #[doc = " Set the current GameTextInput state. This state is reflected to any active\n IME.\n @param input A valid GameTextInput library handle.\n @param state The state to set. Ownership is maintained by the caller and must\n remain valid for the duration of the call."] + pub fn GameTextInput_setState(input: *mut GameTextInput, state: *const GameTextInputState); +} +#[doc = " Type of the callback needed by GameTextInput_setEventCallback that will be\n called every time the IME state changes.\n @param context User-defined context set in GameTextInput_setEventCallback.\n @param current_state Current IME state, owned by the library and valid during\n the callback."] +pub type GameTextInputEventCallback = ::std::option::Option< + unsafe extern "C" fn( + context: *mut ::std::os::raw::c_void, + current_state: *const GameTextInputState, + ), +>; +extern "C" { + #[doc = " Optionally set a callback to be called whenever the IME state changes.\n Not necessary if you are using GameActivity, which handles these callbacks\n for you.\n @param input A valid GameTextInput library handle.\n @param callback Called by the library when the IME state changes.\n @param context Context passed as first argument to the callback."] + pub fn GameTextInput_setEventCallback( + input: *mut GameTextInput, + callback: GameTextInputEventCallback, + context: *mut ::std::os::raw::c_void, + ); +} +#[doc = " Type of the callback needed by GameTextInput_setImeInsetsCallback that will\n be called every time the IME window insets change.\n @param context User-defined context set in\n GameTextInput_setImeWIndowInsetsCallback.\n @param current_insets Current IME insets, owned by the library and valid\n during the callback."] +pub type GameTextInputImeInsetsCallback = ::std::option::Option< + unsafe extern "C" fn(context: *mut ::std::os::raw::c_void, current_insets: *const ARect), +>; +extern "C" { + #[doc = " Optionally set a callback to be called whenever the IME insets change.\n Not necessary if you are using GameActivity, which handles these callbacks\n for you.\n @param input A valid GameTextInput library handle.\n @param callback Called by the library when the IME insets change.\n @param context Context passed as first argument to the callback."] + pub fn GameTextInput_setImeInsetsCallback( + input: *mut GameTextInput, + callback: GameTextInputImeInsetsCallback, + context: *mut ::std::os::raw::c_void, + ); +} +extern "C" { + #[doc = " Get the current window insets for the IME.\n @param input A valid GameTextInput library handle.\n @param insets Filled with the current insets by this function."] + pub fn GameTextInput_getImeInsets(input: *const GameTextInput, insets: *mut ARect); +} +extern "C" { + #[doc = " Unless using GameActivity, it is required to call this function from your\n Java gametextinput.Listener.onImeInsetsChanged method to\n trigger any event callbacks. When using GameActivity, this does not need to\n be called as insets processing is handled by the Activity.\n @param input A valid GameTextInput library handle.\n @param eventState A Java gametextinput.State object."] + pub fn GameTextInput_processImeInsets(input: *mut GameTextInput, insets: *const ARect); +} +extern "C" { + #[doc = " Convert a GameTextInputState struct to a Java gametextinput.State object.\n Don't forget to delete the returned Java local ref when you're done.\n @param input A valid GameTextInput library handle.\n @param state Input state to convert.\n @return A Java object of class gametextinput.State. The caller is required to\n delete this local reference."] + pub fn GameTextInputState_toJava( + input: *const GameTextInput, + state: *const GameTextInputState, + ) -> jobject; +} +extern "C" { + #[doc = " Convert from a Java gametextinput.State object into a C GameTextInputState\n struct.\n @param input A valid GameTextInput library handle.\n @param state A Java gametextinput.State object.\n @param callback A function called with the C struct, valid for the duration\n of the call.\n @param context Context passed to the callback."] + pub fn GameTextInputState_fromJava( + input: *const GameTextInput, + state: jobject, + callback: GameTextInputGetStateCallback, + context: *mut ::std::os::raw::c_void, + ); +} +#[doc = " This structure defines the native side of an android.app.GameActivity.\n It is created by the framework, and handed to the application's native\n code as it is being launched."] +#[repr(C)] +pub struct GameActivity { + #[doc = " Pointer to the callback function table of the native application.\n You can set the functions here to your own callbacks. The callbacks\n pointer itself here should not be changed; it is allocated and managed\n for you by the framework."] + pub callbacks: *mut GameActivityCallbacks, + #[doc = " The global handle on the process's Java VM."] + pub vm: *mut JavaVM, + #[doc = " JNI context for the main thread of the app. Note that this field\n can ONLY be used from the main thread of the process; that is, the\n thread that calls into the GameActivityCallbacks."] + pub env: *mut JNIEnv, + #[doc = " The GameActivity object handle."] + pub javaGameActivity: jobject, + #[doc = " Path to this application's internal data directory."] + pub internalDataPath: *const ::std::os::raw::c_char, + #[doc = " Path to this application's external (removable/mountable) data directory."] + pub externalDataPath: *const ::std::os::raw::c_char, + #[doc = " The platform's SDK version code."] + pub sdkVersion: i32, + #[doc = " This is the native instance of the application. It is not used by\n the framework, but can be set by the application to its own instance\n state."] + pub instance: *mut ::std::os::raw::c_void, + #[doc = " Pointer to the Asset Manager instance for the application. The\n application uses this to access binary assets bundled inside its own .apk\n file."] + pub assetManager: *mut AAssetManager, + #[doc = " Available starting with Honeycomb: path to the directory containing\n the application's OBB files (if any). If the app doesn't have any\n OBB files, this directory may not exist."] + pub obbPath: *const ::std::os::raw::c_char, } #[test] -fn bindgen_test_layout_GameActivityKeyEvent() { +fn bindgen_test_layout_GameActivity() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 52usize, - concat!("Size of: ", stringify!(GameActivityKeyEvent)) + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(GameActivity)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(GameActivityKeyEvent)) + concat!("Alignment of ", stringify!(GameActivity)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).deviceId as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).callbacks) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(GameActivityKeyEvent), + stringify!(GameActivity), "::", - stringify!(deviceId) + stringify!(callbacks) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).source as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).vm) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", - stringify!(GameActivityKeyEvent), + stringify!(GameActivity), "::", - stringify!(source) + stringify!(vm) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).action as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).env) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(GameActivityKeyEvent), + stringify!(GameActivity), "::", - stringify!(action) + stringify!(env) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).eventTime as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).javaGameActivity) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", - stringify!(GameActivityKeyEvent), - "::", - stringify!(eventTime) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).downTime as *const _ as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(GameActivityKeyEvent), + stringify!(GameActivity), "::", - stringify!(downTime) + stringify!(javaGameActivity) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, - 28usize, + unsafe { ::std::ptr::addr_of!((*ptr).internalDataPath) as usize - ptr as usize }, + 16usize, concat!( "Offset of field: ", - stringify!(GameActivityKeyEvent), + stringify!(GameActivity), "::", - stringify!(flags) + stringify!(internalDataPath) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).metaState as *const _ as usize }, - 32usize, + unsafe { ::std::ptr::addr_of!((*ptr).externalDataPath) as usize - ptr as usize }, + 20usize, concat!( "Offset of field: ", - stringify!(GameActivityKeyEvent), + stringify!(GameActivity), "::", - stringify!(metaState) + stringify!(externalDataPath) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).modifiers as *const _ as usize }, - 36usize, + unsafe { ::std::ptr::addr_of!((*ptr).sdkVersion) as usize - ptr as usize }, + 24usize, concat!( "Offset of field: ", - stringify!(GameActivityKeyEvent), + stringify!(GameActivity), "::", - stringify!(modifiers) + stringify!(sdkVersion) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).repeatCount as *const _ as usize - }, - 40usize, + unsafe { ::std::ptr::addr_of!((*ptr).instance) as usize - ptr as usize }, + 28usize, concat!( "Offset of field: ", - stringify!(GameActivityKeyEvent), + stringify!(GameActivity), "::", - stringify!(repeatCount) + stringify!(instance) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).keyCode as *const _ as usize }, - 44usize, + unsafe { ::std::ptr::addr_of!((*ptr).assetManager) as usize - ptr as usize }, + 32usize, concat!( "Offset of field: ", - stringify!(GameActivityKeyEvent), + stringify!(GameActivity), "::", - stringify!(keyCode) + stringify!(assetManager) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).scanCode as *const _ as usize }, - 48usize, + unsafe { ::std::ptr::addr_of!((*ptr).obbPath) as usize - ptr as usize }, + 36usize, concat!( "Offset of field: ", - stringify!(GameActivityKeyEvent), + stringify!(GameActivity), "::", - stringify!(scanCode) + stringify!(obbPath) ) ); } -#[doc = " A function the user should call from their callback with the data, its length"] -#[doc = " and the library- supplied context."] +#[doc = " A function the user should call from their callback with the data, its length\n and the library- supplied context."] pub type SaveInstanceStateRecallback = ::std::option::Option< unsafe extern "C" fn( bytes: *const ::std::os::raw::c_char, @@ -3216,18 +3172,11 @@ pub type SaveInstanceStateRecallback = ::std::option::Option< #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct GameActivityCallbacks { - #[doc = " GameActivity has started. See Java documentation for Activity.onStart()"] - #[doc = " for more information."] + #[doc = " GameActivity has started. See Java documentation for Activity.onStart()\n for more information."] pub onStart: ::std::option::Option, - #[doc = " GameActivity has resumed. See Java documentation for Activity.onResume()"] - #[doc = " for more information."] + #[doc = " GameActivity has resumed. See Java documentation for Activity.onResume()\n for more information."] pub onResume: ::std::option::Option, - #[doc = " The framework is asking GameActivity to save its current instance state."] - #[doc = " See the Java documentation for Activity.onSaveInstanceState() for more"] - #[doc = " information. The user should call the recallback with their data, its"] - #[doc = " length and the provided context; they retain ownership of the data. Note"] - #[doc = " that the saved state will be persisted, so it can not contain any active"] - #[doc = " entities (pointers to memory, file descriptors, etc)."] + #[doc = " The framework is asking GameActivity to save its current instance state.\n See the Java documentation for Activity.onSaveInstanceState() for more\n information. The user should call the recallback with their data, its\n length and the provided context; they retain ownership of the data. Note\n that the saved state will be persisted, so it can not contain any active\n entities (pointers to memory, file descriptors, etc)."] pub onSaveInstanceState: ::std::option::Option< unsafe extern "C" fn( activity: *mut GameActivity, @@ -3235,27 +3184,20 @@ pub struct GameActivityCallbacks { context: *mut ::std::os::raw::c_void, ), >, - #[doc = " GameActivity has paused. See Java documentation for Activity.onPause()"] - #[doc = " for more information."] + #[doc = " GameActivity has paused. See Java documentation for Activity.onPause()\n for more information."] pub onPause: ::std::option::Option, - #[doc = " GameActivity has stopped. See Java documentation for Activity.onStop()"] - #[doc = " for more information."] + #[doc = " GameActivity has stopped. See Java documentation for Activity.onStop()\n for more information."] pub onStop: ::std::option::Option, - #[doc = " GameActivity is being destroyed. See Java documentation for"] - #[doc = " Activity.onDestroy() for more information."] + #[doc = " GameActivity is being destroyed. See Java documentation for\n Activity.onDestroy() for more information."] pub onDestroy: ::std::option::Option, - #[doc = " Focus has changed in this GameActivity's window. This is often used,"] - #[doc = " for example, to pause a game when it loses input focus."] + #[doc = " Focus has changed in this GameActivity's window. This is often used,\n for example, to pause a game when it loses input focus."] pub onWindowFocusChanged: ::std::option::Option, - #[doc = " The drawing window for this native activity has been created. You"] - #[doc = " can use the given native window object to start drawing."] + #[doc = " The drawing window for this native activity has been created. You\n can use the given native window object to start drawing."] pub onNativeWindowCreated: ::std::option::Option< unsafe extern "C" fn(activity: *mut GameActivity, window: *mut ANativeWindow), >, - #[doc = " The drawing window for this native activity has been resized. You should"] - #[doc = " retrieve the new size from the window and ensure that your rendering in"] - #[doc = " it now matches."] + #[doc = " The drawing window for this native activity has been resized. You should\n retrieve the new size from the window and ensure that your rendering in\n it now matches."] pub onNativeWindowResized: ::std::option::Option< unsafe extern "C" fn( activity: *mut GameActivity, @@ -3264,77 +3206,62 @@ pub struct GameActivityCallbacks { newHeight: i32, ), >, - #[doc = " The drawing window for this native activity needs to be redrawn. To"] - #[doc = " avoid transient artifacts during screen changes (such resizing after"] - #[doc = " rotation), applications should not return from this function until they"] - #[doc = " have finished drawing their window in its current state."] + #[doc = " The drawing window for this native activity needs to be redrawn. To\n avoid transient artifacts during screen changes (such resizing after\n rotation), applications should not return from this function until they\n have finished drawing their window in its current state."] pub onNativeWindowRedrawNeeded: ::std::option::Option< unsafe extern "C" fn(activity: *mut GameActivity, window: *mut ANativeWindow), >, - #[doc = " The drawing window for this native activity is going to be destroyed."] - #[doc = " You MUST ensure that you do not touch the window object after returning"] - #[doc = " from this function: in the common case of drawing to the window from"] - #[doc = " another thread, that means the implementation of this callback must"] - #[doc = " properly synchronize with the other thread to stop its drawing before"] - #[doc = " returning from here."] + #[doc = " The drawing window for this native activity is going to be destroyed.\n You MUST ensure that you do not touch the window object after returning\n from this function: in the common case of drawing to the window from\n another thread, that means the implementation of this callback must\n properly synchronize with the other thread to stop its drawing before\n returning from here."] pub onNativeWindowDestroyed: ::std::option::Option< unsafe extern "C" fn(activity: *mut GameActivity, window: *mut ANativeWindow), >, - #[doc = " The current device AConfiguration has changed. The new configuration can"] - #[doc = " be retrieved from assetManager."] + #[doc = " The current device AConfiguration has changed. The new configuration can\n be retrieved from assetManager."] pub onConfigurationChanged: ::std::option::Option, - #[doc = " The system is running low on memory. Use this callback to release"] - #[doc = " resources you do not need, to help the system avoid killing more"] - #[doc = " important processes."] + #[doc = " The system is running low on memory. Use this callback to release\n resources you do not need, to help the system avoid killing more\n important processes."] pub onTrimMemory: ::std::option::Option< unsafe extern "C" fn(activity: *mut GameActivity, level: ::std::os::raw::c_int), >, - #[doc = " Callback called for every MotionEvent done on the GameActivity"] - #[doc = " SurfaceView. Ownership of `event` is maintained by the library and it is"] - #[doc = " only valid during the callback."] + #[doc = " Callback called for every MotionEvent done on the GameActivity\n SurfaceView. Ownership of `event` is maintained by the library and it is\n only valid during the callback."] pub onTouchEvent: ::std::option::Option< unsafe extern "C" fn( activity: *mut GameActivity, event: *const GameActivityMotionEvent, - historical: *const GameActivityHistoricalPointerAxes, - historicalLen: ::std::os::raw::c_int, ) -> bool, >, - #[doc = " Callback called for every key down event on the GameActivity SurfaceView."] - #[doc = " Ownership of `event` is maintained by the library and it is only valid"] - #[doc = " during the callback."] + #[doc = " Callback called for every key down event on the GameActivity SurfaceView.\n Ownership of `event` is maintained by the library and it is only valid\n during the callback."] pub onKeyDown: ::std::option::Option< unsafe extern "C" fn( activity: *mut GameActivity, event: *const GameActivityKeyEvent, ) -> bool, >, - #[doc = " Callback called for every key up event on the GameActivity SurfaceView."] - #[doc = " Ownership of `event` is maintained by the library and it is only valid"] - #[doc = " during the callback."] + #[doc = " Callback called for every key up event on the GameActivity SurfaceView.\n Ownership of `event` is maintained by the library and it is only valid\n during the callback."] pub onKeyUp: ::std::option::Option< unsafe extern "C" fn( activity: *mut GameActivity, event: *const GameActivityKeyEvent, ) -> bool, >, - #[doc = " Callback called for every soft-keyboard text input event."] - #[doc = " Ownership of `state` is maintained by the library and it is only valid"] - #[doc = " during the callback."] + #[doc = " Callback called for every soft-keyboard text input event.\n Ownership of `state` is maintained by the library and it is only valid\n during the callback."] pub onTextInputEvent: ::std::option::Option< unsafe extern "C" fn(activity: *mut GameActivity, state: *const GameTextInputState), >, - #[doc = " Callback called when WindowInsets of the main app window have changed."] - #[doc = " Call GameActivity_getWindowInsets to retrieve the insets themselves."] + #[doc = " Callback called when WindowInsets of the main app window have changed.\n Call GameActivity_getWindowInsets to retrieve the insets themselves."] pub onWindowInsetsChanged: ::std::option::Option, + #[doc = " Callback called when the rectangle in the window where the content\n should be placed has changed."] + pub onContentRectChanged: ::std::option::Option< + unsafe extern "C" fn(activity: *mut GameActivity, rect: *const ARect), + >, } #[test] fn bindgen_test_layout_GameActivityCallbacks() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 72usize, + 76usize, concat!("Size of: ", stringify!(GameActivityCallbacks)) ); assert_eq!( @@ -3343,7 +3270,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { concat!("Alignment of ", stringify!(GameActivityCallbacks)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).onStart as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).onStart) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -3353,7 +3280,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).onResume as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).onResume) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -3363,10 +3290,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onSaveInstanceState as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).onSaveInstanceState) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -3376,7 +3300,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).onPause as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).onPause) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", @@ -3386,7 +3310,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).onStop as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).onStop) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -3396,7 +3320,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).onDestroy as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).onDestroy) as usize - ptr as usize }, 20usize, concat!( "Offset of field: ", @@ -3406,10 +3330,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onWindowFocusChanged as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).onWindowFocusChanged) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -3419,10 +3340,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onNativeWindowCreated as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).onNativeWindowCreated) as usize - ptr as usize }, 28usize, concat!( "Offset of field: ", @@ -3432,10 +3350,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onNativeWindowResized as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).onNativeWindowResized) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -3445,10 +3360,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onNativeWindowRedrawNeeded as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).onNativeWindowRedrawNeeded) as usize - ptr as usize }, 36usize, concat!( "Offset of field: ", @@ -3458,10 +3370,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onNativeWindowDestroyed as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).onNativeWindowDestroyed) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", @@ -3471,10 +3380,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onConfigurationChanged as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).onConfigurationChanged) as usize - ptr as usize }, 44usize, concat!( "Offset of field: ", @@ -3484,9 +3390,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onTrimMemory as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).onTrimMemory) as usize - ptr as usize }, 48usize, concat!( "Offset of field: ", @@ -3496,9 +3400,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onTouchEvent as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).onTouchEvent) as usize - ptr as usize }, 52usize, concat!( "Offset of field: ", @@ -3508,7 +3410,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).onKeyDown as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).onKeyDown) as usize - ptr as usize }, 56usize, concat!( "Offset of field: ", @@ -3518,7 +3420,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).onKeyUp as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).onKeyUp) as usize - ptr as usize }, 60usize, concat!( "Offset of field: ", @@ -3528,9 +3430,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onTextInputEvent as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).onTextInputEvent) as usize - ptr as usize }, 64usize, concat!( "Offset of field: ", @@ -3540,10 +3440,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onWindowInsetsChanged as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).onWindowInsetsChanged) as usize - ptr as usize }, 68usize, concat!( "Offset of field: ", @@ -3552,269 +3449,124 @@ fn bindgen_test_layout_GameActivityCallbacks() { stringify!(onWindowInsetsChanged) ) ); -} -extern "C" { - #[doc = " \\brief Convert a Java `MotionEvent` to a `GameActivityMotionEvent`."] - #[doc = ""] - #[doc = " This is done automatically by the GameActivity: see `onTouchEvent` to set"] - #[doc = " a callback to consume the received events."] - #[doc = " This function can be used if you re-implement events handling in your own"] - #[doc = " activity. On return, the out_event->historicalStart will be zero, and should"] - #[doc = " be updated to index into whatever buffer out_historical is copied."] - #[doc = " On return the length of out_historical is"] - #[doc = " (out_event->pointerCount x out_event->historicalCount) and is in a"] - #[doc = " pointer-major order (i.e. all axis for a pointer are contiguous)"] - #[doc = " Ownership of out_event is maintained by the caller."] - pub fn GameActivityMotionEvent_fromJava( - env: *mut JNIEnv, - motionEvent: jobject, - out_event: *mut GameActivityMotionEvent, - out_historical: *mut GameActivityHistoricalPointerAxes, - ) -> ::std::os::raw::c_int; -} -extern "C" { - #[doc = " \\brief Convert a Java `KeyEvent` to a `GameActivityKeyEvent`."] - #[doc = ""] - #[doc = " This is done automatically by the GameActivity: see `onKeyUp` and `onKeyDown`"] - #[doc = " to set a callback to consume the received events."] - #[doc = " This function can be used if you re-implement events handling in your own"] - #[doc = " activity."] - #[doc = " Ownership of out_event is maintained by the caller."] - pub fn GameActivityKeyEvent_fromJava( - env: *mut JNIEnv, - motionEvent: jobject, - out_event: *mut GameActivityKeyEvent, + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).onContentRectChanged) as usize - ptr as usize }, + 72usize, + concat!( + "Offset of field: ", + stringify!(GameActivityCallbacks), + "::", + stringify!(onContentRectChanged) + ) ); } -#[doc = " This is the function that must be in the native code to instantiate the"] -#[doc = " application's native activity. It is called with the activity instance (see"] -#[doc = " above); if the code is being instantiated from a previously saved instance,"] -#[doc = " the savedState will be non-NULL and point to the saved data. You must make"] -#[doc = " any copy of this data you need -- it will be released after you return from"] -#[doc = " this function."] +#[doc = " This is the function that must be in the native code to instantiate the\n application's native activity. It is called with the activity instance (see\n above); if the code is being instantiated from a previously saved instance,\n the savedState will be non-NULL and point to the saved data. You must make\n any copy of this data you need -- it will be released after you return from\n this function."] pub type GameActivity_createFunc = ::std::option::Option< unsafe extern "C" fn( activity: *mut GameActivity, savedState: *mut ::std::os::raw::c_void, - savedStateSize: size_t, + savedStateSize: usize, ), >; extern "C" { - #[doc = " Finish the given activity. Its finish() method will be called, causing it"] - #[doc = " to be stopped and destroyed. Note that this method can be called from"] - #[doc = " *any* thread; it will send a message to the main thread of the process"] - #[doc = " where the Java finish call will take place."] + #[doc = " Finish the given activity. Its finish() method will be called, causing it\n to be stopped and destroyed. Note that this method can be called from\n *any* thread; it will send a message to the main thread of the process\n where the Java finish call will take place."] pub fn GameActivity_finish(activity: *mut GameActivity); } -#[doc = " As long as this window is visible to the user, allow the lock"] -#[doc = " screen to activate while the screen is on. This can be used"] -#[doc = " independently, or in combination with {@link"] -#[doc = " GAMEACTIVITY_FLAG_KEEP_SCREEN_ON} and/or {@link"] -#[doc = " GAMEACTIVITY_FLAG_SHOW_WHEN_LOCKED}"] +#[doc = " As long as this window is visible to the user, allow the lock\n screen to activate while the screen is on. This can be used\n independently, or in combination with {@link\n GAMEACTIVITY_FLAG_KEEP_SCREEN_ON} and/or {@link\n GAMEACTIVITY_FLAG_SHOW_WHEN_LOCKED}"] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_ALLOW_LOCK_WHILE_SCREEN_ON: GameActivitySetWindowFlags = 1; #[doc = " Everything behind this window will be dimmed."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_DIM_BEHIND: GameActivitySetWindowFlags = 2; -#[doc = " Blur everything behind this window."] -#[doc = " @deprecated Blurring is no longer supported."] +#[doc = " Blur everything behind this window.\n @deprecated Blurring is no longer supported."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_BLUR_BEHIND: GameActivitySetWindowFlags = 4; -#[doc = " This window won't ever get key input focus, so the"] -#[doc = " user can not send key or other button events to it. Those will"] -#[doc = " instead go to whatever focusable window is behind it. This flag"] -#[doc = " will also enable {@link GAMEACTIVITY_FLAG_NOT_TOUCH_MODAL} whether or not"] -#[doc = " that is explicitly set."] -#[doc = ""] -#[doc = " Setting this flag also implies that the window will not need to"] -#[doc = " interact with"] -#[doc = " a soft input method, so it will be Z-ordered and positioned"] -#[doc = " independently of any active input method (typically this means it"] -#[doc = " gets Z-ordered on top of the input method, so it can use the full"] -#[doc = " screen for its content and cover the input method if needed. You"] -#[doc = " can use {@link GAMEACTIVITY_FLAG_ALT_FOCUSABLE_IM} to modify this"] -#[doc = " behavior."] +#[doc = " This window won't ever get key input focus, so the\n user can not send key or other button events to it. Those will\n instead go to whatever focusable window is behind it. This flag\n will also enable {@link GAMEACTIVITY_FLAG_NOT_TOUCH_MODAL} whether or not\n that is explicitly set.\n\n Setting this flag also implies that the window will not need to\n interact with\n a soft input method, so it will be Z-ordered and positioned\n independently of any active input method (typically this means it\n gets Z-ordered on top of the input method, so it can use the full\n screen for its content and cover the input method if needed. You\n can use {@link GAMEACTIVITY_FLAG_ALT_FOCUSABLE_IM} to modify this\n behavior."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_NOT_FOCUSABLE: GameActivitySetWindowFlags = 8; #[doc = " This window can never receive touch events."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_NOT_TOUCHABLE: GameActivitySetWindowFlags = 16; -#[doc = " Even when this window is focusable (its"] -#[doc = " {@link GAMEACTIVITY_FLAG_NOT_FOCUSABLE} is not set), allow any pointer"] -#[doc = " events outside of the window to be sent to the windows behind it."] -#[doc = " Otherwise it will consume all pointer events itself, regardless of"] -#[doc = " whether they are inside of the window."] +#[doc = " Even when this window is focusable (its\n {@link GAMEACTIVITY_FLAG_NOT_FOCUSABLE} is not set), allow any pointer\n events outside of the window to be sent to the windows behind it.\n Otherwise it will consume all pointer events itself, regardless of\n whether they are inside of the window."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_NOT_TOUCH_MODAL: GameActivitySetWindowFlags = 32; -#[doc = " When set, if the device is asleep when the touch"] -#[doc = " screen is pressed, you will receive this first touch event. Usually"] -#[doc = " the first touch event is consumed by the system since the user can"] -#[doc = " not see what they are pressing on."] -#[doc = ""] -#[doc = " @deprecated This flag has no effect."] +#[doc = " When set, if the device is asleep when the touch\n screen is pressed, you will receive this first touch event. Usually\n the first touch event is consumed by the system since the user can\n not see what they are pressing on.\n\n @deprecated This flag has no effect."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_TOUCHABLE_WHEN_WAKING: GameActivitySetWindowFlags = 64; -#[doc = " As long as this window is visible to the user, keep"] -#[doc = " the device's screen turned on and bright."] +#[doc = " As long as this window is visible to the user, keep\n the device's screen turned on and bright."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_KEEP_SCREEN_ON: GameActivitySetWindowFlags = 128; -#[doc = " Place the window within the entire screen, ignoring"] -#[doc = " decorations around the border (such as the status bar). The"] -#[doc = " window must correctly position its contents to take the screen"] -#[doc = " decoration into account."] +#[doc = " Place the window within the entire screen, ignoring\n decorations around the border (such as the status bar). The\n window must correctly position its contents to take the screen\n decoration into account."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_LAYOUT_IN_SCREEN: GameActivitySetWindowFlags = 256; #[doc = " Allows the window to extend outside of the screen."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_LAYOUT_NO_LIMITS: GameActivitySetWindowFlags = 512; -#[doc = " Hide all screen decorations (such as the status"] -#[doc = " bar) while this window is displayed. This allows the window to"] -#[doc = " use the entire display space for itself -- the status bar will"] -#[doc = " be hidden when an app window with this flag set is on the top"] -#[doc = " layer. A fullscreen window will ignore a value of {@link"] -#[doc = " GAMEACTIVITY_SOFT_INPUT_ADJUST_RESIZE}; the window will stay"] -#[doc = " fullscreen and will not resize."] +#[doc = " Hide all screen decorations (such as the status\n bar) while this window is displayed. This allows the window to\n use the entire display space for itself -- the status bar will\n be hidden when an app window with this flag set is on the top\n layer. A fullscreen window will ignore a value of {@link\n GAMEACTIVITY_SOFT_INPUT_ADJUST_RESIZE}; the window will stay\n fullscreen and will not resize."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_FULLSCREEN: GameActivitySetWindowFlags = 1024; -#[doc = " Override {@link GAMEACTIVITY_FLAG_FULLSCREEN} and force the"] -#[doc = " screen decorations (such as the status bar) to be shown."] +#[doc = " Override {@link GAMEACTIVITY_FLAG_FULLSCREEN} and force the\n screen decorations (such as the status bar) to be shown."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_FORCE_NOT_FULLSCREEN: GameActivitySetWindowFlags = 2048; -#[doc = " Turn on dithering when compositing this window to"] -#[doc = " the screen."] -#[doc = " @deprecated This flag is no longer used."] +#[doc = " Turn on dithering when compositing this window to\n the screen.\n @deprecated This flag is no longer used."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_DITHER: GameActivitySetWindowFlags = 4096; -#[doc = " Treat the content of the window as secure, preventing"] -#[doc = " it from appearing in screenshots or from being viewed on non-secure"] -#[doc = " displays."] +#[doc = " Treat the content of the window as secure, preventing\n it from appearing in screenshots or from being viewed on non-secure\n displays."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_SECURE: GameActivitySetWindowFlags = 8192; -#[doc = " A special mode where the layout parameters are used"] -#[doc = " to perform scaling of the surface when it is composited to the"] -#[doc = " screen."] +#[doc = " A special mode where the layout parameters are used\n to perform scaling of the surface when it is composited to the\n screen."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_SCALED: GameActivitySetWindowFlags = 16384; -#[doc = " Intended for windows that will often be used when the user is"] -#[doc = " holding the screen against their face, it will aggressively"] -#[doc = " filter the event stream to prevent unintended presses in this"] -#[doc = " situation that may not be desired for a particular window, when"] -#[doc = " such an event stream is detected, the application will receive"] -#[doc = " a {@link AMOTION_EVENT_ACTION_CANCEL} to indicate this so"] -#[doc = " applications can handle this accordingly by taking no action on"] -#[doc = " the event until the finger is released."] +#[doc = " Intended for windows that will often be used when the user is\n holding the screen against their face, it will aggressively\n filter the event stream to prevent unintended presses in this\n situation that may not be desired for a particular window, when\n such an event stream is detected, the application will receive\n a {@link AMOTION_EVENT_ACTION_CANCEL} to indicate this so\n applications can handle this accordingly by taking no action on\n the event until the finger is released."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_IGNORE_CHEEK_PRESSES: GameActivitySetWindowFlags = 32768; -#[doc = " A special option only for use in combination with"] -#[doc = " {@link GAMEACTIVITY_FLAG_LAYOUT_IN_SCREEN}. When requesting layout in"] -#[doc = " the screen your window may appear on top of or behind screen decorations"] -#[doc = " such as the status bar. By also including this flag, the window"] -#[doc = " manager will report the inset rectangle needed to ensure your"] -#[doc = " content is not covered by screen decorations."] +#[doc = " A special option only for use in combination with\n {@link GAMEACTIVITY_FLAG_LAYOUT_IN_SCREEN}. When requesting layout in\n the screen your window may appear on top of or behind screen decorations\n such as the status bar. By also including this flag, the window\n manager will report the inset rectangle needed to ensure your\n content is not covered by screen decorations."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_LAYOUT_INSET_DECOR: GameActivitySetWindowFlags = 65536; -#[doc = " Invert the state of {@link GAMEACTIVITY_FLAG_NOT_FOCUSABLE} with"] -#[doc = " respect to how this window interacts with the current method."] -#[doc = " That is, if FLAG_NOT_FOCUSABLE is set and this flag is set,"] -#[doc = " then the window will behave as if it needs to interact with the"] -#[doc = " input method and thus be placed behind/away from it; if {@link"] -#[doc = " GAMEACTIVITY_FLAG_NOT_FOCUSABLE} is not set and this flag is set,"] -#[doc = " then the window will behave as if it doesn't need to interact"] -#[doc = " with the input method and can be placed to use more space and"] -#[doc = " cover the input method."] +#[doc = " Invert the state of {@link GAMEACTIVITY_FLAG_NOT_FOCUSABLE} with\n respect to how this window interacts with the current method.\n That is, if FLAG_NOT_FOCUSABLE is set and this flag is set,\n then the window will behave as if it needs to interact with the\n input method and thus be placed behind/away from it; if {@link\n GAMEACTIVITY_FLAG_NOT_FOCUSABLE} is not set and this flag is set,\n then the window will behave as if it doesn't need to interact\n with the input method and can be placed to use more space and\n cover the input method."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_ALT_FOCUSABLE_IM: GameActivitySetWindowFlags = 131072; -#[doc = " If you have set {@link GAMEACTIVITY_FLAG_NOT_TOUCH_MODAL}, you"] -#[doc = " can set this flag to receive a single special MotionEvent with"] -#[doc = " the action"] -#[doc = " {@link AMOTION_EVENT_ACTION_OUTSIDE} for"] -#[doc = " touches that occur outside of your window. Note that you will not"] -#[doc = " receive the full down/move/up gesture, only the location of the"] -#[doc = " first down as an {@link AMOTION_EVENT_ACTION_OUTSIDE}."] +#[doc = " If you have set {@link GAMEACTIVITY_FLAG_NOT_TOUCH_MODAL}, you\n can set this flag to receive a single special MotionEvent with\n the action\n {@link AMOTION_EVENT_ACTION_OUTSIDE} for\n touches that occur outside of your window. Note that you will not\n receive the full down/move/up gesture, only the location of the\n first down as an {@link AMOTION_EVENT_ACTION_OUTSIDE}."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_WATCH_OUTSIDE_TOUCH: GameActivitySetWindowFlags = 262144; -#[doc = " Special flag to let windows be shown when the screen"] -#[doc = " is locked. This will let application windows take precedence over"] -#[doc = " key guard or any other lock screens. Can be used with"] -#[doc = " {@link GAMEACTIVITY_FLAG_KEEP_SCREEN_ON} to turn screen on and display"] -#[doc = " windows directly before showing the key guard window. Can be used with"] -#[doc = " {@link GAMEACTIVITY_FLAG_DISMISS_KEYGUARD} to automatically fully"] -#[doc = " dismisss non-secure keyguards. This flag only applies to the top-most"] -#[doc = " full-screen window."] +#[doc = " Special flag to let windows be shown when the screen\n is locked. This will let application windows take precedence over\n key guard or any other lock screens. Can be used with\n {@link GAMEACTIVITY_FLAG_KEEP_SCREEN_ON} to turn screen on and display\n windows directly before showing the key guard window. Can be used with\n {@link GAMEACTIVITY_FLAG_DISMISS_KEYGUARD} to automatically fully\n dismisss non-secure keyguards. This flag only applies to the top-most\n full-screen window."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_SHOW_WHEN_LOCKED: GameActivitySetWindowFlags = 524288; -#[doc = " Ask that the system wallpaper be shown behind"] -#[doc = " your window. The window surface must be translucent to be able"] -#[doc = " to actually see the wallpaper behind it; this flag just ensures"] -#[doc = " that the wallpaper surface will be there if this window actually"] -#[doc = " has translucent regions."] +#[doc = " Ask that the system wallpaper be shown behind\n your window. The window surface must be translucent to be able\n to actually see the wallpaper behind it; this flag just ensures\n that the wallpaper surface will be there if this window actually\n has translucent regions."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_SHOW_WALLPAPER: GameActivitySetWindowFlags = 1048576; -#[doc = " When set as a window is being added or made"] -#[doc = " visible, once the window has been shown then the system will"] -#[doc = " poke the power manager's user activity (as if the user had woken"] -#[doc = " up the device) to turn the screen on."] +#[doc = " When set as a window is being added or made\n visible, once the window has been shown then the system will\n poke the power manager's user activity (as if the user had woken\n up the device) to turn the screen on."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_TURN_SCREEN_ON: GameActivitySetWindowFlags = 2097152; -#[doc = " When set the window will cause the keyguard to"] -#[doc = " be dismissed, only if it is not a secure lock keyguard. Because such"] -#[doc = " a keyguard is not needed for security, it will never re-appear if"] -#[doc = " the user navigates to another window (in contrast to"] -#[doc = " {@link GAMEACTIVITY_FLAG_SHOW_WHEN_LOCKED}, which will only temporarily"] -#[doc = " hide both secure and non-secure keyguards but ensure they reappear"] -#[doc = " when the user moves to another UI that doesn't hide them)."] -#[doc = " If the keyguard is currently active and is secure (requires an"] -#[doc = " unlock pattern) than the user will still need to confirm it before"] -#[doc = " seeing this window, unless {@link GAMEACTIVITY_FLAG_SHOW_WHEN_LOCKED} has"] -#[doc = " also been set."] +#[doc = " When set the window will cause the keyguard to\n be dismissed, only if it is not a secure lock keyguard. Because such\n a keyguard is not needed for security, it will never re-appear if\n the user navigates to another window (in contrast to\n {@link GAMEACTIVITY_FLAG_SHOW_WHEN_LOCKED}, which will only temporarily\n hide both secure and non-secure keyguards but ensure they reappear\n when the user moves to another UI that doesn't hide them).\n If the keyguard is currently active and is secure (requires an\n unlock pattern) than the user will still need to confirm it before\n seeing this window, unless {@link GAMEACTIVITY_FLAG_SHOW_WHEN_LOCKED} has\n also been set."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_DISMISS_KEYGUARD: GameActivitySetWindowFlags = 4194304; -#[doc = " Flags for GameActivity_setWindowFlags,"] -#[doc = " as per the Java API at android.view.WindowManager.LayoutParams."] +#[doc = " Flags for GameActivity_setWindowFlags,\n as per the Java API at android.view.WindowManager.LayoutParams."] pub type GameActivitySetWindowFlags = ::std::os::raw::c_uint; extern "C" { - #[doc = " Change the window flags of the given activity. Calls getWindow().setFlags()"] - #[doc = " of the given activity."] - #[doc = " Note that some flags must be set before the window decoration is created,"] - #[doc = " see"] - #[doc = " https://developer.android.com/reference/android/view/Window#setFlags(int,%20int)."] - #[doc = " Note also that this method can be called from"] - #[doc = " *any* thread; it will send a message to the main thread of the process"] - #[doc = " where the Java finish call will take place."] + #[doc = " Change the window flags of the given activity. Calls getWindow().setFlags()\n of the given activity.\n Note that some flags must be set before the window decoration is created,\n see\n https://developer.android.com/reference/android/view/Window#setFlags(int,%20int).\n Note also that this method can be called from\n *any* thread; it will send a message to the main thread of the process\n where the Java finish call will take place."] pub fn GameActivity_setWindowFlags( activity: *mut GameActivity, addFlags: u32, removeFlags: u32, ); } -#[doc = " Implicit request to show the input window, not as the result"] -#[doc = " of a direct request by the user."] +#[doc = " Implicit request to show the input window, not as the result\n of a direct request by the user."] pub const GameActivityShowSoftInputFlags_GAMEACTIVITY_SHOW_SOFT_INPUT_IMPLICIT: GameActivityShowSoftInputFlags = 1; -#[doc = " The user has forced the input method open (such as by"] -#[doc = " long-pressing menu) so it should not be closed until they"] -#[doc = " explicitly do so."] +#[doc = " The user has forced the input method open (such as by\n long-pressing menu) so it should not be closed until they\n explicitly do so."] pub const GameActivityShowSoftInputFlags_GAMEACTIVITY_SHOW_SOFT_INPUT_FORCED: GameActivityShowSoftInputFlags = 2; -#[doc = " Flags for GameActivity_showSoftInput; see the Java InputMethodManager"] -#[doc = " API for documentation."] +#[doc = " Flags for GameActivity_showSoftInput; see the Java InputMethodManager\n API for documentation."] pub type GameActivityShowSoftInputFlags = ::std::os::raw::c_uint; extern "C" { - #[doc = " Show the IME while in the given activity. Calls"] - #[doc = " InputMethodManager.showSoftInput() for the given activity. Note that this"] - #[doc = " method can be called from *any* thread; it will send a message to the main"] - #[doc = " thread of the process where the Java call will take place."] + #[doc = " Show the IME while in the given activity. Calls\n InputMethodManager.showSoftInput() for the given activity. Note that this\n method can be called from *any* thread; it will send a message to the main\n thread of the process where the Java call will take place."] pub fn GameActivity_showSoftInput(activity: *mut GameActivity, flags: u32); } extern "C" { - #[doc = " Set the text entry state (see documentation of the GameTextInputState struct"] - #[doc = " in the Game Text Input library reference)."] - #[doc = ""] - #[doc = " Ownership of the state is maintained by the caller."] + #[doc = " Set the text entry state (see documentation of the GameTextInputState struct\n in the Game Text Input library reference).\n\n Ownership of the state is maintained by the caller."] pub fn GameActivity_setTextInputState( activity: *mut GameActivity, state: *const GameTextInputState, ); } extern "C" { - #[doc = " Get the last-received text entry state (see documentation of the"] - #[doc = " GameTextInputState struct in the Game Text Input library reference)."] - #[doc = ""] + #[doc = " Get the last-received text entry state (see documentation of the\n GameTextInputState struct in the Game Text Input library reference).\n"] pub fn GameActivity_getTextInputState( activity: *mut GameActivity, callback: GameTextInputGetStateCallback, @@ -3825,29 +3577,20 @@ extern "C" { #[doc = " Get a pointer to the GameTextInput library instance."] pub fn GameActivity_getTextInput(activity: *const GameActivity) -> *mut GameTextInput; } -#[doc = " The soft input window should only be hidden if it was not"] -#[doc = " explicitly shown by the user."] +#[doc = " The soft input window should only be hidden if it was not\n explicitly shown by the user."] pub const GameActivityHideSoftInputFlags_GAMEACTIVITY_HIDE_SOFT_INPUT_IMPLICIT_ONLY: GameActivityHideSoftInputFlags = 1; -#[doc = " The soft input window should normally be hidden, unless it was"] -#[doc = " originally shown with {@link GAMEACTIVITY_SHOW_SOFT_INPUT_FORCED}."] +#[doc = " The soft input window should normally be hidden, unless it was\n originally shown with {@link GAMEACTIVITY_SHOW_SOFT_INPUT_FORCED}."] pub const GameActivityHideSoftInputFlags_GAMEACTIVITY_HIDE_SOFT_INPUT_NOT_ALWAYS: GameActivityHideSoftInputFlags = 2; -#[doc = " Flags for GameActivity_hideSoftInput; see the Java InputMethodManager"] -#[doc = " API for documentation."] +#[doc = " Flags for GameActivity_hideSoftInput; see the Java InputMethodManager\n API for documentation."] pub type GameActivityHideSoftInputFlags = ::std::os::raw::c_uint; extern "C" { - #[doc = " Hide the IME while in the given activity. Calls"] - #[doc = " InputMethodManager.hideSoftInput() for the given activity. Note that this"] - #[doc = " method can be called from *any* thread; it will send a message to the main"] - #[doc = " thread of the process where the Java finish call will take place."] + #[doc = " Hide the IME while in the given activity. Calls\n InputMethodManager.hideSoftInput() for the given activity. Note that this\n method can be called from *any* thread; it will send a message to the main\n thread of the process where the Java finish call will take place."] pub fn GameActivity_hideSoftInput(activity: *mut GameActivity, flags: u32); } extern "C" { - #[doc = " Get the current window insets of the particular component. See"] - #[doc = " https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type"] - #[doc = " for more details."] - #[doc = " You can use these insets to influence what you show on the screen."] + #[doc = " Get the current window insets of the particular component. See\n https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type\n for more details.\n You can use these insets to influence what you show on the screen."] pub fn GameActivity_getWindowInsets( activity: *mut GameActivity, type_: GameCommonInsetsType, @@ -3855,14 +3598,7 @@ extern "C" { ); } extern "C" { - #[doc = " Set options on how the IME behaves when it is requested for text input."] - #[doc = " See"] - #[doc = " https://developer.android.com/reference/android/view/inputmethod/EditorInfo"] - #[doc = " for the meaning of inputType, actionId and imeOptions."] - #[doc = ""] - #[doc = " Note that this function will attach the current thread to the JVM if it is"] - #[doc = " not already attached, so the caller must detach the thread from the JVM"] - #[doc = " before the thread is destroyed using DetachCurrentThread."] + #[doc = " Set options on how the IME behaves when it is requested for text input.\n See\n https://developer.android.com/reference/android/view/inputmethod/EditorInfo\n for the meaning of inputType, actionId and imeOptions.\n\n Note that this function will attach the current thread to the JVM if it is\n not already attached, so the caller must detach the thread from the JVM\n before the thread is destroyed using DetachCurrentThread."] pub fn GameActivity_setImeEditorInfo( activity: *mut GameActivity, inputType: ::std::os::raw::c_int, @@ -3870,92 +3606,152 @@ extern "C" { imeOptions: ::std::os::raw::c_int, ); } -pub const ACONFIGURATION_ORIENTATION_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_ORIENTATION_PORT: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_ORIENTATION_LAND: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_ORIENTATION_SQUARE: ::std::os::raw::c_uint = 3; -pub const ACONFIGURATION_TOUCHSCREEN_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_TOUCHSCREEN_NOTOUCH: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_TOUCHSCREEN_STYLUS: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_TOUCHSCREEN_FINGER: ::std::os::raw::c_uint = 3; -pub const ACONFIGURATION_DENSITY_DEFAULT: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_DENSITY_LOW: ::std::os::raw::c_uint = 120; -pub const ACONFIGURATION_DENSITY_MEDIUM: ::std::os::raw::c_uint = 160; -pub const ACONFIGURATION_DENSITY_TV: ::std::os::raw::c_uint = 213; -pub const ACONFIGURATION_DENSITY_HIGH: ::std::os::raw::c_uint = 240; -pub const ACONFIGURATION_DENSITY_XHIGH: ::std::os::raw::c_uint = 320; -pub const ACONFIGURATION_DENSITY_XXHIGH: ::std::os::raw::c_uint = 480; -pub const ACONFIGURATION_DENSITY_XXXHIGH: ::std::os::raw::c_uint = 640; -pub const ACONFIGURATION_DENSITY_ANY: ::std::os::raw::c_uint = 65534; -pub const ACONFIGURATION_DENSITY_NONE: ::std::os::raw::c_uint = 65535; -pub const ACONFIGURATION_KEYBOARD_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_KEYBOARD_NOKEYS: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_KEYBOARD_QWERTY: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_KEYBOARD_12KEY: ::std::os::raw::c_uint = 3; -pub const ACONFIGURATION_NAVIGATION_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_NAVIGATION_NONAV: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_NAVIGATION_DPAD: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_NAVIGATION_TRACKBALL: ::std::os::raw::c_uint = 3; -pub const ACONFIGURATION_NAVIGATION_WHEEL: ::std::os::raw::c_uint = 4; -pub const ACONFIGURATION_KEYSHIDDEN_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_KEYSHIDDEN_NO: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_KEYSHIDDEN_YES: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_KEYSHIDDEN_SOFT: ::std::os::raw::c_uint = 3; -pub const ACONFIGURATION_NAVHIDDEN_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_NAVHIDDEN_NO: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_NAVHIDDEN_YES: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_SCREENSIZE_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_SCREENSIZE_SMALL: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_SCREENSIZE_NORMAL: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_SCREENSIZE_LARGE: ::std::os::raw::c_uint = 3; -pub const ACONFIGURATION_SCREENSIZE_XLARGE: ::std::os::raw::c_uint = 4; -pub const ACONFIGURATION_SCREENLONG_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_SCREENLONG_NO: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_SCREENLONG_YES: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_SCREENROUND_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_SCREENROUND_NO: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_SCREENROUND_YES: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_WIDE_COLOR_GAMUT_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_WIDE_COLOR_GAMUT_NO: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_WIDE_COLOR_GAMUT_YES: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_HDR_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_HDR_NO: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_HDR_YES: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_UI_MODE_TYPE_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_UI_MODE_TYPE_NORMAL: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_UI_MODE_TYPE_DESK: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_UI_MODE_TYPE_CAR: ::std::os::raw::c_uint = 3; -pub const ACONFIGURATION_UI_MODE_TYPE_TELEVISION: ::std::os::raw::c_uint = 4; -pub const ACONFIGURATION_UI_MODE_TYPE_APPLIANCE: ::std::os::raw::c_uint = 5; -pub const ACONFIGURATION_UI_MODE_TYPE_WATCH: ::std::os::raw::c_uint = 6; -pub const ACONFIGURATION_UI_MODE_TYPE_VR_HEADSET: ::std::os::raw::c_uint = 7; -pub const ACONFIGURATION_UI_MODE_NIGHT_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_UI_MODE_NIGHT_NO: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_UI_MODE_NIGHT_YES: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_SCREEN_WIDTH_DP_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_SCREEN_HEIGHT_DP_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_SMALLEST_SCREEN_WIDTH_DP_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_LAYOUTDIR_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_LAYOUTDIR_LTR: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_LAYOUTDIR_RTL: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_MCC: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_MNC: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_LOCALE: ::std::os::raw::c_uint = 4; -pub const ACONFIGURATION_TOUCHSCREEN: ::std::os::raw::c_uint = 8; -pub const ACONFIGURATION_KEYBOARD: ::std::os::raw::c_uint = 16; -pub const ACONFIGURATION_KEYBOARD_HIDDEN: ::std::os::raw::c_uint = 32; -pub const ACONFIGURATION_NAVIGATION: ::std::os::raw::c_uint = 64; -pub const ACONFIGURATION_ORIENTATION: ::std::os::raw::c_uint = 128; -pub const ACONFIGURATION_DENSITY: ::std::os::raw::c_uint = 256; -pub const ACONFIGURATION_SCREEN_SIZE: ::std::os::raw::c_uint = 512; -pub const ACONFIGURATION_VERSION: ::std::os::raw::c_uint = 1024; -pub const ACONFIGURATION_SCREEN_LAYOUT: ::std::os::raw::c_uint = 2048; -pub const ACONFIGURATION_UI_MODE: ::std::os::raw::c_uint = 4096; -pub const ACONFIGURATION_SMALLEST_SCREEN_SIZE: ::std::os::raw::c_uint = 8192; -pub const ACONFIGURATION_LAYOUTDIR: ::std::os::raw::c_uint = 16384; -pub const ACONFIGURATION_SCREEN_ROUND: ::std::os::raw::c_uint = 32768; -pub const ACONFIGURATION_COLOR_MODE: ::std::os::raw::c_uint = 65536; -pub const ACONFIGURATION_MNC_ZERO: ::std::os::raw::c_uint = 65535; +extern "C" { + #[doc = " These are getters for Configuration class members. They may be called from\n any thread."] + pub fn GameActivity_getOrientation(activity: *mut GameActivity) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getColorMode(activity: *mut GameActivity) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getDensityDpi(activity: *mut GameActivity) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getFontScale(activity: *mut GameActivity) -> f32; +} +extern "C" { + pub fn GameActivity_getFontWeightAdjustment( + activity: *mut GameActivity, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getHardKeyboardHidden(activity: *mut GameActivity) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getKeyboard(activity: *mut GameActivity) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getKeyboardHidden(activity: *mut GameActivity) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getMcc(activity: *mut GameActivity) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getMnc(activity: *mut GameActivity) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getNavigation(activity: *mut GameActivity) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getNavigationHidden(activity: *mut GameActivity) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getScreenHeightDp(activity: *mut GameActivity) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getScreenLayout(activity: *mut GameActivity) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getScreenWidthDp(activity: *mut GameActivity) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getSmallestScreenWidthDp( + activity: *mut GameActivity, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getTouchscreen(activity: *mut GameActivity) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getUIMode(activity: *mut GameActivity) -> ::std::os::raw::c_int; +} +pub const ACONFIGURATION_ORIENTATION_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_ORIENTATION_PORT: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_ORIENTATION_LAND: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_ORIENTATION_SQUARE: _bindgen_ty_21 = 3; +pub const ACONFIGURATION_TOUCHSCREEN_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_TOUCHSCREEN_NOTOUCH: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_TOUCHSCREEN_STYLUS: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_TOUCHSCREEN_FINGER: _bindgen_ty_21 = 3; +pub const ACONFIGURATION_DENSITY_DEFAULT: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_DENSITY_LOW: _bindgen_ty_21 = 120; +pub const ACONFIGURATION_DENSITY_MEDIUM: _bindgen_ty_21 = 160; +pub const ACONFIGURATION_DENSITY_TV: _bindgen_ty_21 = 213; +pub const ACONFIGURATION_DENSITY_HIGH: _bindgen_ty_21 = 240; +pub const ACONFIGURATION_DENSITY_XHIGH: _bindgen_ty_21 = 320; +pub const ACONFIGURATION_DENSITY_XXHIGH: _bindgen_ty_21 = 480; +pub const ACONFIGURATION_DENSITY_XXXHIGH: _bindgen_ty_21 = 640; +pub const ACONFIGURATION_DENSITY_ANY: _bindgen_ty_21 = 65534; +pub const ACONFIGURATION_DENSITY_NONE: _bindgen_ty_21 = 65535; +pub const ACONFIGURATION_KEYBOARD_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_KEYBOARD_NOKEYS: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_KEYBOARD_QWERTY: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_KEYBOARD_12KEY: _bindgen_ty_21 = 3; +pub const ACONFIGURATION_NAVIGATION_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_NAVIGATION_NONAV: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_NAVIGATION_DPAD: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_NAVIGATION_TRACKBALL: _bindgen_ty_21 = 3; +pub const ACONFIGURATION_NAVIGATION_WHEEL: _bindgen_ty_21 = 4; +pub const ACONFIGURATION_KEYSHIDDEN_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_KEYSHIDDEN_NO: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_KEYSHIDDEN_YES: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_KEYSHIDDEN_SOFT: _bindgen_ty_21 = 3; +pub const ACONFIGURATION_NAVHIDDEN_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_NAVHIDDEN_NO: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_NAVHIDDEN_YES: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_SCREENSIZE_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_SCREENSIZE_SMALL: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_SCREENSIZE_NORMAL: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_SCREENSIZE_LARGE: _bindgen_ty_21 = 3; +pub const ACONFIGURATION_SCREENSIZE_XLARGE: _bindgen_ty_21 = 4; +pub const ACONFIGURATION_SCREENLONG_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_SCREENLONG_NO: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_SCREENLONG_YES: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_SCREENROUND_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_SCREENROUND_NO: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_SCREENROUND_YES: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_WIDE_COLOR_GAMUT_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_WIDE_COLOR_GAMUT_NO: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_WIDE_COLOR_GAMUT_YES: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_HDR_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_HDR_NO: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_HDR_YES: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_UI_MODE_TYPE_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_UI_MODE_TYPE_NORMAL: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_UI_MODE_TYPE_DESK: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_UI_MODE_TYPE_CAR: _bindgen_ty_21 = 3; +pub const ACONFIGURATION_UI_MODE_TYPE_TELEVISION: _bindgen_ty_21 = 4; +pub const ACONFIGURATION_UI_MODE_TYPE_APPLIANCE: _bindgen_ty_21 = 5; +pub const ACONFIGURATION_UI_MODE_TYPE_WATCH: _bindgen_ty_21 = 6; +pub const ACONFIGURATION_UI_MODE_TYPE_VR_HEADSET: _bindgen_ty_21 = 7; +pub const ACONFIGURATION_UI_MODE_NIGHT_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_UI_MODE_NIGHT_NO: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_UI_MODE_NIGHT_YES: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_SCREEN_WIDTH_DP_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_SCREEN_HEIGHT_DP_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_SMALLEST_SCREEN_WIDTH_DP_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_LAYOUTDIR_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_LAYOUTDIR_LTR: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_LAYOUTDIR_RTL: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_MCC: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_MNC: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_LOCALE: _bindgen_ty_21 = 4; +pub const ACONFIGURATION_TOUCHSCREEN: _bindgen_ty_21 = 8; +pub const ACONFIGURATION_KEYBOARD: _bindgen_ty_21 = 16; +pub const ACONFIGURATION_KEYBOARD_HIDDEN: _bindgen_ty_21 = 32; +pub const ACONFIGURATION_NAVIGATION: _bindgen_ty_21 = 64; +pub const ACONFIGURATION_ORIENTATION: _bindgen_ty_21 = 128; +pub const ACONFIGURATION_DENSITY: _bindgen_ty_21 = 256; +pub const ACONFIGURATION_SCREEN_SIZE: _bindgen_ty_21 = 512; +pub const ACONFIGURATION_VERSION: _bindgen_ty_21 = 1024; +pub const ACONFIGURATION_SCREEN_LAYOUT: _bindgen_ty_21 = 2048; +pub const ACONFIGURATION_UI_MODE: _bindgen_ty_21 = 4096; +pub const ACONFIGURATION_SMALLEST_SCREEN_SIZE: _bindgen_ty_21 = 8192; +pub const ACONFIGURATION_LAYOUTDIR: _bindgen_ty_21 = 16384; +pub const ACONFIGURATION_SCREEN_ROUND: _bindgen_ty_21 = 32768; +pub const ACONFIGURATION_COLOR_MODE: _bindgen_ty_21 = 65536; +pub const ACONFIGURATION_MNC_ZERO: _bindgen_ty_21 = 65535; pub type _bindgen_ty_21 = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -3966,6 +3762,8 @@ pub struct pollfd { } #[test] fn bindgen_test_layout_pollfd() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 8usize, @@ -3977,7 +3775,7 @@ fn bindgen_test_layout_pollfd() { concat!("Alignment of ", stringify!(pollfd)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).fd as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).fd) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -3987,7 +3785,7 @@ fn bindgen_test_layout_pollfd() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).events as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).events) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -3997,7 +3795,7 @@ fn bindgen_test_layout_pollfd() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).revents as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).revents) as usize - ptr as usize }, 6usize, concat!( "Offset of field: ", @@ -4018,6 +3816,8 @@ pub struct _fpx_sw_bytes { } #[test] fn bindgen_test_layout__fpx_sw_bytes() { + const UNINIT: ::std::mem::MaybeUninit<_fpx_sw_bytes> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_fpx_sw_bytes>(), 48usize, @@ -4029,7 +3829,7 @@ fn bindgen_test_layout__fpx_sw_bytes() { concat!("Alignment of ", stringify!(_fpx_sw_bytes)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpx_sw_bytes>())).magic1 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).magic1) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4039,7 +3839,7 @@ fn bindgen_test_layout__fpx_sw_bytes() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpx_sw_bytes>())).extended_size as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).extended_size) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -4049,7 +3849,7 @@ fn bindgen_test_layout__fpx_sw_bytes() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpx_sw_bytes>())).xfeatures as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).xfeatures) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -4059,7 +3859,7 @@ fn bindgen_test_layout__fpx_sw_bytes() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpx_sw_bytes>())).xstate_size as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).xstate_size) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -4069,7 +3869,7 @@ fn bindgen_test_layout__fpx_sw_bytes() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpx_sw_bytes>())).padding as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).padding) as usize - ptr as usize }, 20usize, concat!( "Offset of field: ", @@ -4087,6 +3887,8 @@ pub struct _fpreg { } #[test] fn bindgen_test_layout__fpreg() { + const UNINIT: ::std::mem::MaybeUninit<_fpreg> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_fpreg>(), 10usize, @@ -4098,7 +3900,7 @@ fn bindgen_test_layout__fpreg() { concat!("Alignment of ", stringify!(_fpreg)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpreg>())).significand as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).significand) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4108,7 +3910,7 @@ fn bindgen_test_layout__fpreg() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpreg>())).exponent as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).exponent) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -4127,6 +3929,8 @@ pub struct _fpxreg { } #[test] fn bindgen_test_layout__fpxreg() { + const UNINIT: ::std::mem::MaybeUninit<_fpxreg> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_fpxreg>(), 16usize, @@ -4138,7 +3942,7 @@ fn bindgen_test_layout__fpxreg() { concat!("Alignment of ", stringify!(_fpxreg)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpxreg>())).significand as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).significand) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4148,7 +3952,7 @@ fn bindgen_test_layout__fpxreg() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpxreg>())).exponent as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).exponent) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -4158,7 +3962,7 @@ fn bindgen_test_layout__fpxreg() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpxreg>())).padding as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).padding) as usize - ptr as usize }, 10usize, concat!( "Offset of field: ", @@ -4175,6 +3979,8 @@ pub struct _xmmreg { } #[test] fn bindgen_test_layout__xmmreg() { + const UNINIT: ::std::mem::MaybeUninit<_xmmreg> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_xmmreg>(), 16usize, @@ -4186,7 +3992,7 @@ fn bindgen_test_layout__xmmreg() { concat!("Alignment of ", stringify!(_xmmreg)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_xmmreg>())).element as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).element) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4225,6 +4031,9 @@ pub union _fpstate_32__bindgen_ty_1 { } #[test] fn bindgen_test_layout__fpstate_32__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit<_fpstate_32__bindgen_ty_1> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_fpstate_32__bindgen_ty_1>(), 176usize, @@ -4236,9 +4045,7 @@ fn bindgen_test_layout__fpstate_32__bindgen_ty_1() { concat!("Alignment of ", stringify!(_fpstate_32__bindgen_ty_1)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_fpstate_32__bindgen_ty_1>())).padding1 as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).padding1) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4248,9 +4055,7 @@ fn bindgen_test_layout__fpstate_32__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_fpstate_32__bindgen_ty_1>())).padding as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).padding) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4268,6 +4073,9 @@ pub union _fpstate_32__bindgen_ty_2 { } #[test] fn bindgen_test_layout__fpstate_32__bindgen_ty_2() { + const UNINIT: ::std::mem::MaybeUninit<_fpstate_32__bindgen_ty_2> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_fpstate_32__bindgen_ty_2>(), 48usize, @@ -4279,9 +4087,7 @@ fn bindgen_test_layout__fpstate_32__bindgen_ty_2() { concat!("Alignment of ", stringify!(_fpstate_32__bindgen_ty_2)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_fpstate_32__bindgen_ty_2>())).padding2 as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).padding2) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4291,9 +4097,7 @@ fn bindgen_test_layout__fpstate_32__bindgen_ty_2() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_fpstate_32__bindgen_ty_2>())).sw_reserved as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).sw_reserved) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4305,6 +4109,8 @@ fn bindgen_test_layout__fpstate_32__bindgen_ty_2() { } #[test] fn bindgen_test_layout__fpstate_32() { + const UNINIT: ::std::mem::MaybeUninit<_fpstate_32> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_fpstate_32>(), 624usize, @@ -4316,7 +4122,7 @@ fn bindgen_test_layout__fpstate_32() { concat!("Alignment of ", stringify!(_fpstate_32)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate_32>())).cw as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).cw) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4326,7 +4132,7 @@ fn bindgen_test_layout__fpstate_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate_32>())).sw as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sw) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -4336,7 +4142,7 @@ fn bindgen_test_layout__fpstate_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate_32>())).tag as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tag) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -4346,7 +4152,7 @@ fn bindgen_test_layout__fpstate_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate_32>())).ipoff as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ipoff) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", @@ -4356,7 +4162,7 @@ fn bindgen_test_layout__fpstate_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate_32>())).cssel as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).cssel) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -4366,7 +4172,7 @@ fn bindgen_test_layout__fpstate_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate_32>())).dataoff as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).dataoff) as usize - ptr as usize }, 20usize, concat!( "Offset of field: ", @@ -4376,7 +4182,7 @@ fn bindgen_test_layout__fpstate_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate_32>())).datasel as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).datasel) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -4386,7 +4192,7 @@ fn bindgen_test_layout__fpstate_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate_32>()))._st as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._st) as usize - ptr as usize }, 28usize, concat!( "Offset of field: ", @@ -4396,7 +4202,7 @@ fn bindgen_test_layout__fpstate_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate_32>())).status as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).status) as usize - ptr as usize }, 108usize, concat!( "Offset of field: ", @@ -4406,7 +4212,7 @@ fn bindgen_test_layout__fpstate_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate_32>())).magic as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).magic) as usize - ptr as usize }, 110usize, concat!( "Offset of field: ", @@ -4416,7 +4222,7 @@ fn bindgen_test_layout__fpstate_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate_32>()))._fxsr_env as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._fxsr_env) as usize - ptr as usize }, 112usize, concat!( "Offset of field: ", @@ -4426,7 +4232,7 @@ fn bindgen_test_layout__fpstate_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate_32>())).mxcsr as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).mxcsr) as usize - ptr as usize }, 136usize, concat!( "Offset of field: ", @@ -4436,7 +4242,7 @@ fn bindgen_test_layout__fpstate_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate_32>())).reserved as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).reserved) as usize - ptr as usize }, 140usize, concat!( "Offset of field: ", @@ -4446,7 +4252,7 @@ fn bindgen_test_layout__fpstate_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate_32>()))._fxsr_st as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._fxsr_st) as usize - ptr as usize }, 144usize, concat!( "Offset of field: ", @@ -4456,7 +4262,7 @@ fn bindgen_test_layout__fpstate_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate_32>()))._xmm as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._xmm) as usize - ptr as usize }, 272usize, concat!( "Offset of field: ", @@ -4490,6 +4296,9 @@ pub union _fpstate_64__bindgen_ty_1 { } #[test] fn bindgen_test_layout__fpstate_64__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit<_fpstate_64__bindgen_ty_1> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_fpstate_64__bindgen_ty_1>(), 48usize, @@ -4501,9 +4310,7 @@ fn bindgen_test_layout__fpstate_64__bindgen_ty_1() { concat!("Alignment of ", stringify!(_fpstate_64__bindgen_ty_1)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_fpstate_64__bindgen_ty_1>())).reserved3 as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).reserved3) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4513,9 +4320,7 @@ fn bindgen_test_layout__fpstate_64__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_fpstate_64__bindgen_ty_1>())).sw_reserved as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).sw_reserved) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4527,6 +4332,8 @@ fn bindgen_test_layout__fpstate_64__bindgen_ty_1() { } #[test] fn bindgen_test_layout__fpstate_64() { + const UNINIT: ::std::mem::MaybeUninit<_fpstate_64> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_fpstate_64>(), 512usize, @@ -4538,7 +4345,7 @@ fn bindgen_test_layout__fpstate_64() { concat!("Alignment of ", stringify!(_fpstate_64)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate_64>())).cwd as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).cwd) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4548,7 +4355,7 @@ fn bindgen_test_layout__fpstate_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate_64>())).swd as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).swd) as usize - ptr as usize }, 2usize, concat!( "Offset of field: ", @@ -4558,7 +4365,7 @@ fn bindgen_test_layout__fpstate_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate_64>())).twd as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).twd) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -4568,7 +4375,7 @@ fn bindgen_test_layout__fpstate_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate_64>())).fop as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).fop) as usize - ptr as usize }, 6usize, concat!( "Offset of field: ", @@ -4578,7 +4385,7 @@ fn bindgen_test_layout__fpstate_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate_64>())).rip as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).rip) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -4588,7 +4395,7 @@ fn bindgen_test_layout__fpstate_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate_64>())).rdp as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).rdp) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -4598,7 +4405,7 @@ fn bindgen_test_layout__fpstate_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate_64>())).mxcsr as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).mxcsr) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -4608,7 +4415,7 @@ fn bindgen_test_layout__fpstate_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate_64>())).mxcsr_mask as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).mxcsr_mask) as usize - ptr as usize }, 28usize, concat!( "Offset of field: ", @@ -4618,7 +4425,7 @@ fn bindgen_test_layout__fpstate_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate_64>())).st_space as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).st_space) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -4628,7 +4435,7 @@ fn bindgen_test_layout__fpstate_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate_64>())).xmm_space as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).xmm_space) as usize - ptr as usize }, 160usize, concat!( "Offset of field: ", @@ -4638,7 +4445,7 @@ fn bindgen_test_layout__fpstate_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate_64>())).reserved2 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).reserved2) as usize - ptr as usize }, 416usize, concat!( "Offset of field: ", @@ -4657,6 +4464,8 @@ pub struct _header { } #[test] fn bindgen_test_layout__header() { + const UNINIT: ::std::mem::MaybeUninit<_header> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_header>(), 64usize, @@ -4668,7 +4477,7 @@ fn bindgen_test_layout__header() { concat!("Alignment of ", stringify!(_header)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_header>())).xfeatures as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).xfeatures) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4678,7 +4487,7 @@ fn bindgen_test_layout__header() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_header>())).reserved1 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).reserved1) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -4688,7 +4497,7 @@ fn bindgen_test_layout__header() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_header>())).reserved2 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).reserved2) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -4705,6 +4514,8 @@ pub struct _ymmh_state { } #[test] fn bindgen_test_layout__ymmh_state() { + const UNINIT: ::std::mem::MaybeUninit<_ymmh_state> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_ymmh_state>(), 256usize, @@ -4716,7 +4527,7 @@ fn bindgen_test_layout__ymmh_state() { concat!("Alignment of ", stringify!(_ymmh_state)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_ymmh_state>())).ymmh_space as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ymmh_space) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4735,6 +4546,8 @@ pub struct _xstate { } #[test] fn bindgen_test_layout__xstate() { + const UNINIT: ::std::mem::MaybeUninit<_xstate> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_xstate>(), 944usize, @@ -4746,7 +4559,7 @@ fn bindgen_test_layout__xstate() { concat!("Alignment of ", stringify!(_xstate)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_xstate>())).fpstate as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).fpstate) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4756,7 +4569,7 @@ fn bindgen_test_layout__xstate() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_xstate>())).xstate_hdr as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).xstate_hdr) as usize - ptr as usize }, 624usize, concat!( "Offset of field: ", @@ -4766,7 +4579,7 @@ fn bindgen_test_layout__xstate() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_xstate>())).ymmh as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ymmh) as usize - ptr as usize }, 688usize, concat!( "Offset of field: ", @@ -4810,6 +4623,8 @@ pub struct sigcontext_32 { } #[test] fn bindgen_test_layout_sigcontext_32() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 88usize, @@ -4821,7 +4636,7 @@ fn bindgen_test_layout_sigcontext_32() { concat!("Alignment of ", stringify!(sigcontext_32)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).gs as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).gs) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4831,7 +4646,7 @@ fn bindgen_test_layout_sigcontext_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).__gsh as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).__gsh) as usize - ptr as usize }, 2usize, concat!( "Offset of field: ", @@ -4841,7 +4656,7 @@ fn bindgen_test_layout_sigcontext_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).fs as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).fs) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -4851,7 +4666,7 @@ fn bindgen_test_layout_sigcontext_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).__fsh as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).__fsh) as usize - ptr as usize }, 6usize, concat!( "Offset of field: ", @@ -4861,7 +4676,7 @@ fn bindgen_test_layout_sigcontext_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).es as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).es) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -4871,7 +4686,7 @@ fn bindgen_test_layout_sigcontext_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).__esh as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).__esh) as usize - ptr as usize }, 10usize, concat!( "Offset of field: ", @@ -4881,7 +4696,7 @@ fn bindgen_test_layout_sigcontext_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ds as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ds) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", @@ -4891,7 +4706,7 @@ fn bindgen_test_layout_sigcontext_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).__dsh as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).__dsh) as usize - ptr as usize }, 14usize, concat!( "Offset of field: ", @@ -4901,7 +4716,7 @@ fn bindgen_test_layout_sigcontext_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).di as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).di) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -4911,7 +4726,7 @@ fn bindgen_test_layout_sigcontext_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).si as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).si) as usize - ptr as usize }, 20usize, concat!( "Offset of field: ", @@ -4921,7 +4736,7 @@ fn bindgen_test_layout_sigcontext_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).bp as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).bp) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -4931,7 +4746,7 @@ fn bindgen_test_layout_sigcontext_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sp as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sp) as usize - ptr as usize }, 28usize, concat!( "Offset of field: ", @@ -4941,7 +4756,7 @@ fn bindgen_test_layout_sigcontext_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).bx as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).bx) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -4951,7 +4766,7 @@ fn bindgen_test_layout_sigcontext_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).dx as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).dx) as usize - ptr as usize }, 36usize, concat!( "Offset of field: ", @@ -4961,7 +4776,7 @@ fn bindgen_test_layout_sigcontext_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).cx as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).cx) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", @@ -4971,7 +4786,7 @@ fn bindgen_test_layout_sigcontext_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ax as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ax) as usize - ptr as usize }, 44usize, concat!( "Offset of field: ", @@ -4981,7 +4796,7 @@ fn bindgen_test_layout_sigcontext_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).trapno as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).trapno) as usize - ptr as usize }, 48usize, concat!( "Offset of field: ", @@ -4991,7 +4806,7 @@ fn bindgen_test_layout_sigcontext_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).err as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).err) as usize - ptr as usize }, 52usize, concat!( "Offset of field: ", @@ -5001,7 +4816,7 @@ fn bindgen_test_layout_sigcontext_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ip as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ip) as usize - ptr as usize }, 56usize, concat!( "Offset of field: ", @@ -5011,7 +4826,7 @@ fn bindgen_test_layout_sigcontext_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).cs as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).cs) as usize - ptr as usize }, 60usize, concat!( "Offset of field: ", @@ -5021,7 +4836,7 @@ fn bindgen_test_layout_sigcontext_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).__csh as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).__csh) as usize - ptr as usize }, 62usize, concat!( "Offset of field: ", @@ -5031,7 +4846,7 @@ fn bindgen_test_layout_sigcontext_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 64usize, concat!( "Offset of field: ", @@ -5041,7 +4856,7 @@ fn bindgen_test_layout_sigcontext_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sp_at_signal as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sp_at_signal) as usize - ptr as usize }, 68usize, concat!( "Offset of field: ", @@ -5051,7 +4866,7 @@ fn bindgen_test_layout_sigcontext_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ss as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ss) as usize - ptr as usize }, 72usize, concat!( "Offset of field: ", @@ -5061,7 +4876,7 @@ fn bindgen_test_layout_sigcontext_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).__ssh as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).__ssh) as usize - ptr as usize }, 74usize, concat!( "Offset of field: ", @@ -5071,7 +4886,7 @@ fn bindgen_test_layout_sigcontext_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).fpstate as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).fpstate) as usize - ptr as usize }, 76usize, concat!( "Offset of field: ", @@ -5081,7 +4896,7 @@ fn bindgen_test_layout_sigcontext_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).oldmask as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).oldmask) as usize - ptr as usize }, 80usize, concat!( "Offset of field: ", @@ -5091,7 +4906,7 @@ fn bindgen_test_layout_sigcontext_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).cr2 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).cr2) as usize - ptr as usize }, 84usize, concat!( "Offset of field: ", @@ -5135,6 +4950,8 @@ pub struct sigcontext_64 { } #[test] fn bindgen_test_layout_sigcontext_64() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 256usize, @@ -5146,7 +4963,7 @@ fn bindgen_test_layout_sigcontext_64() { concat!("Alignment of ", stringify!(sigcontext_64)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).r8 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).r8) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5156,7 +4973,7 @@ fn bindgen_test_layout_sigcontext_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).r9 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).r9) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -5166,7 +4983,7 @@ fn bindgen_test_layout_sigcontext_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).r10 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).r10) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -5176,7 +4993,7 @@ fn bindgen_test_layout_sigcontext_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).r11 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).r11) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -5186,7 +5003,7 @@ fn bindgen_test_layout_sigcontext_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).r12 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).r12) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -5196,7 +5013,7 @@ fn bindgen_test_layout_sigcontext_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).r13 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).r13) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", @@ -5206,7 +5023,7 @@ fn bindgen_test_layout_sigcontext_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).r14 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).r14) as usize - ptr as usize }, 48usize, concat!( "Offset of field: ", @@ -5216,7 +5033,7 @@ fn bindgen_test_layout_sigcontext_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).r15 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).r15) as usize - ptr as usize }, 56usize, concat!( "Offset of field: ", @@ -5226,7 +5043,7 @@ fn bindgen_test_layout_sigcontext_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).di as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).di) as usize - ptr as usize }, 64usize, concat!( "Offset of field: ", @@ -5236,7 +5053,7 @@ fn bindgen_test_layout_sigcontext_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).si as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).si) as usize - ptr as usize }, 72usize, concat!( "Offset of field: ", @@ -5246,7 +5063,7 @@ fn bindgen_test_layout_sigcontext_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).bp as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).bp) as usize - ptr as usize }, 80usize, concat!( "Offset of field: ", @@ -5256,7 +5073,7 @@ fn bindgen_test_layout_sigcontext_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).bx as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).bx) as usize - ptr as usize }, 88usize, concat!( "Offset of field: ", @@ -5266,7 +5083,7 @@ fn bindgen_test_layout_sigcontext_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).dx as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).dx) as usize - ptr as usize }, 96usize, concat!( "Offset of field: ", @@ -5276,7 +5093,7 @@ fn bindgen_test_layout_sigcontext_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ax as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ax) as usize - ptr as usize }, 104usize, concat!( "Offset of field: ", @@ -5286,7 +5103,7 @@ fn bindgen_test_layout_sigcontext_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).cx as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).cx) as usize - ptr as usize }, 112usize, concat!( "Offset of field: ", @@ -5296,7 +5113,7 @@ fn bindgen_test_layout_sigcontext_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sp as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sp) as usize - ptr as usize }, 120usize, concat!( "Offset of field: ", @@ -5306,7 +5123,7 @@ fn bindgen_test_layout_sigcontext_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ip as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ip) as usize - ptr as usize }, 128usize, concat!( "Offset of field: ", @@ -5316,7 +5133,7 @@ fn bindgen_test_layout_sigcontext_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 136usize, concat!( "Offset of field: ", @@ -5326,7 +5143,7 @@ fn bindgen_test_layout_sigcontext_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).cs as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).cs) as usize - ptr as usize }, 144usize, concat!( "Offset of field: ", @@ -5336,7 +5153,7 @@ fn bindgen_test_layout_sigcontext_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).gs as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).gs) as usize - ptr as usize }, 146usize, concat!( "Offset of field: ", @@ -5346,7 +5163,7 @@ fn bindgen_test_layout_sigcontext_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).fs as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).fs) as usize - ptr as usize }, 148usize, concat!( "Offset of field: ", @@ -5356,7 +5173,7 @@ fn bindgen_test_layout_sigcontext_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ss as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ss) as usize - ptr as usize }, 150usize, concat!( "Offset of field: ", @@ -5366,7 +5183,7 @@ fn bindgen_test_layout_sigcontext_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).err as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).err) as usize - ptr as usize }, 152usize, concat!( "Offset of field: ", @@ -5376,7 +5193,7 @@ fn bindgen_test_layout_sigcontext_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).trapno as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).trapno) as usize - ptr as usize }, 160usize, concat!( "Offset of field: ", @@ -5386,7 +5203,7 @@ fn bindgen_test_layout_sigcontext_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).oldmask as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).oldmask) as usize - ptr as usize }, 168usize, concat!( "Offset of field: ", @@ -5396,7 +5213,7 @@ fn bindgen_test_layout_sigcontext_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).cr2 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).cr2) as usize - ptr as usize }, 176usize, concat!( "Offset of field: ", @@ -5406,7 +5223,7 @@ fn bindgen_test_layout_sigcontext_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).fpstate as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).fpstate) as usize - ptr as usize }, 184usize, concat!( "Offset of field: ", @@ -5416,7 +5233,7 @@ fn bindgen_test_layout_sigcontext_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved1 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).reserved1) as usize - ptr as usize }, 192usize, concat!( "Offset of field: ", @@ -5460,6 +5277,8 @@ pub struct sigcontext { } #[test] fn bindgen_test_layout_sigcontext() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 88usize, @@ -5471,7 +5290,7 @@ fn bindgen_test_layout_sigcontext() { concat!("Alignment of ", stringify!(sigcontext)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).gs as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).gs) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5481,7 +5300,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).__gsh as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).__gsh) as usize - ptr as usize }, 2usize, concat!( "Offset of field: ", @@ -5491,7 +5310,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).fs as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).fs) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -5501,7 +5320,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).__fsh as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).__fsh) as usize - ptr as usize }, 6usize, concat!( "Offset of field: ", @@ -5511,7 +5330,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).es as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).es) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -5521,7 +5340,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).__esh as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).__esh) as usize - ptr as usize }, 10usize, concat!( "Offset of field: ", @@ -5531,7 +5350,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ds as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ds) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", @@ -5541,7 +5360,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).__dsh as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).__dsh) as usize - ptr as usize }, 14usize, concat!( "Offset of field: ", @@ -5551,7 +5370,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).edi as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).edi) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -5561,7 +5380,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).esi as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).esi) as usize - ptr as usize }, 20usize, concat!( "Offset of field: ", @@ -5571,7 +5390,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ebp as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ebp) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -5581,7 +5400,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).esp as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).esp) as usize - ptr as usize }, 28usize, concat!( "Offset of field: ", @@ -5591,7 +5410,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ebx as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ebx) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -5601,7 +5420,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).edx as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).edx) as usize - ptr as usize }, 36usize, concat!( "Offset of field: ", @@ -5611,7 +5430,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ecx as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ecx) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", @@ -5621,7 +5440,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).eax as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).eax) as usize - ptr as usize }, 44usize, concat!( "Offset of field: ", @@ -5631,7 +5450,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).trapno as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).trapno) as usize - ptr as usize }, 48usize, concat!( "Offset of field: ", @@ -5641,7 +5460,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).err as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).err) as usize - ptr as usize }, 52usize, concat!( "Offset of field: ", @@ -5651,7 +5470,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).eip as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).eip) as usize - ptr as usize }, 56usize, concat!( "Offset of field: ", @@ -5661,7 +5480,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).cs as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).cs) as usize - ptr as usize }, 60usize, concat!( "Offset of field: ", @@ -5671,7 +5490,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).__csh as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).__csh) as usize - ptr as usize }, 62usize, concat!( "Offset of field: ", @@ -5681,7 +5500,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).eflags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).eflags) as usize - ptr as usize }, 64usize, concat!( "Offset of field: ", @@ -5691,7 +5510,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).esp_at_signal as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).esp_at_signal) as usize - ptr as usize }, 68usize, concat!( "Offset of field: ", @@ -5701,7 +5520,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ss as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ss) as usize - ptr as usize }, 72usize, concat!( "Offset of field: ", @@ -5711,7 +5530,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).__ssh as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).__ssh) as usize - ptr as usize }, 74usize, concat!( "Offset of field: ", @@ -5721,7 +5540,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).fpstate as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).fpstate) as usize - ptr as usize }, 76usize, concat!( "Offset of field: ", @@ -5731,7 +5550,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).oldmask as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).oldmask) as usize - ptr as usize }, 80usize, concat!( "Offset of field: ", @@ -5741,7 +5560,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).cr2 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).cr2) as usize - ptr as usize }, 84usize, concat!( "Offset of field: ", @@ -5759,6 +5578,8 @@ pub struct __kernel_timespec { } #[test] fn bindgen_test_layout___kernel_timespec() { + const UNINIT: ::std::mem::MaybeUninit<__kernel_timespec> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__kernel_timespec>(), 16usize, @@ -5770,7 +5591,7 @@ fn bindgen_test_layout___kernel_timespec() { concat!("Alignment of ", stringify!(__kernel_timespec)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_timespec>())).tv_sec as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5780,7 +5601,7 @@ fn bindgen_test_layout___kernel_timespec() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_timespec>())).tv_nsec as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tv_nsec) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -5798,6 +5619,8 @@ pub struct __kernel_itimerspec { } #[test] fn bindgen_test_layout___kernel_itimerspec() { + const UNINIT: ::std::mem::MaybeUninit<__kernel_itimerspec> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__kernel_itimerspec>(), 32usize, @@ -5809,7 +5632,7 @@ fn bindgen_test_layout___kernel_itimerspec() { concat!("Alignment of ", stringify!(__kernel_itimerspec)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_itimerspec>())).it_interval as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).it_interval) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5819,7 +5642,7 @@ fn bindgen_test_layout___kernel_itimerspec() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_itimerspec>())).it_value as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).it_value) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -5831,40 +5654,43 @@ fn bindgen_test_layout___kernel_itimerspec() { } #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct __kernel_old_timeval { - pub tv_sec: __kernel_long_t, - pub tv_usec: __kernel_long_t, +pub struct __kernel_old_timespec { + pub tv_sec: __kernel_old_time_t, + pub tv_nsec: ::std::os::raw::c_long, } #[test] -fn bindgen_test_layout___kernel_old_timeval() { +fn bindgen_test_layout___kernel_old_timespec() { + const UNINIT: ::std::mem::MaybeUninit<__kernel_old_timespec> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::<__kernel_old_timeval>(), + ::std::mem::size_of::<__kernel_old_timespec>(), 8usize, - concat!("Size of: ", stringify!(__kernel_old_timeval)) + concat!("Size of: ", stringify!(__kernel_old_timespec)) ); assert_eq!( - ::std::mem::align_of::<__kernel_old_timeval>(), + ::std::mem::align_of::<__kernel_old_timespec>(), 4usize, - concat!("Alignment of ", stringify!(__kernel_old_timeval)) + concat!("Alignment of ", stringify!(__kernel_old_timespec)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_old_timeval>())).tv_sec as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(__kernel_old_timeval), + stringify!(__kernel_old_timespec), "::", stringify!(tv_sec) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_old_timeval>())).tv_usec as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tv_nsec) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", - stringify!(__kernel_old_timeval), + stringify!(__kernel_old_timespec), "::", - stringify!(tv_usec) + stringify!(tv_nsec) ) ); } @@ -5876,6 +5702,9 @@ pub struct __kernel_sock_timeval { } #[test] fn bindgen_test_layout___kernel_sock_timeval() { + const UNINIT: ::std::mem::MaybeUninit<__kernel_sock_timeval> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__kernel_sock_timeval>(), 16usize, @@ -5887,7 +5716,7 @@ fn bindgen_test_layout___kernel_sock_timeval() { concat!("Alignment of ", stringify!(__kernel_sock_timeval)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_sock_timeval>())).tv_sec as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5897,7 +5726,7 @@ fn bindgen_test_layout___kernel_sock_timeval() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_sock_timeval>())).tv_usec as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tv_usec) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -5910,11 +5739,13 @@ fn bindgen_test_layout___kernel_sock_timeval() { #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct timespec { - pub tv_sec: __kernel_time_t, + pub tv_sec: __kernel_old_time_t, pub tv_nsec: ::std::os::raw::c_long, } #[test] fn bindgen_test_layout_timespec() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 8usize, @@ -5926,7 +5757,7 @@ fn bindgen_test_layout_timespec() { concat!("Alignment of ", stringify!(timespec)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tv_sec as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5936,7 +5767,7 @@ fn bindgen_test_layout_timespec() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tv_nsec as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tv_nsec) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -5949,11 +5780,13 @@ fn bindgen_test_layout_timespec() { #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct timeval { - pub tv_sec: __kernel_time_t, + pub tv_sec: __kernel_old_time_t, pub tv_usec: __kernel_suseconds_t, } #[test] fn bindgen_test_layout_timeval() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 8usize, @@ -5965,7 +5798,7 @@ fn bindgen_test_layout_timeval() { concat!("Alignment of ", stringify!(timeval)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tv_sec as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5975,7 +5808,7 @@ fn bindgen_test_layout_timeval() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tv_usec as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tv_usec) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -5987,51 +5820,14 @@ 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, } #[test] fn bindgen_test_layout_itimerspec() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 16usize, @@ -6043,7 +5839,7 @@ fn bindgen_test_layout_itimerspec() { concat!("Alignment of ", stringify!(itimerspec)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).it_interval as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).it_interval) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6053,7 +5849,7 @@ fn bindgen_test_layout_itimerspec() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).it_value as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).it_value) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -6071,6 +5867,8 @@ pub struct itimerval { } #[test] fn bindgen_test_layout_itimerval() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 16usize, @@ -6082,7 +5880,7 @@ fn bindgen_test_layout_itimerval() { concat!("Alignment of ", stringify!(itimerval)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).it_interval as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).it_interval) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6092,7 +5890,7 @@ fn bindgen_test_layout_itimerval() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).it_value as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).it_value) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -6102,6 +5900,47 @@ 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() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + 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::addr_of!((*ptr).tz_minuteswest) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(timezone), + "::", + stringify!(tz_minuteswest) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tz_dsttime) as usize - ptr 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; @@ -6129,6 +5968,9 @@ pub union __kernel_sigaction__bindgen_ty_1 { } #[test] fn bindgen_test_layout___kernel_sigaction__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit<__kernel_sigaction__bindgen_ty_1> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__kernel_sigaction__bindgen_ty_1>(), 4usize, @@ -6143,10 +5985,7 @@ fn bindgen_test_layout___kernel_sigaction__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__kernel_sigaction__bindgen_ty_1>()))._sa_handler as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._sa_handler) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6156,10 +5995,7 @@ fn bindgen_test_layout___kernel_sigaction__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__kernel_sigaction__bindgen_ty_1>()))._sa_sigaction as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._sa_sigaction) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6171,6 +6007,8 @@ fn bindgen_test_layout___kernel_sigaction__bindgen_ty_1() { } #[test] fn bindgen_test_layout___kernel_sigaction() { + const UNINIT: ::std::mem::MaybeUninit<__kernel_sigaction> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__kernel_sigaction>(), 16usize, @@ -6182,7 +6020,7 @@ fn bindgen_test_layout___kernel_sigaction() { concat!("Alignment of ", stringify!(__kernel_sigaction)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_sigaction>()))._u as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._u) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6192,7 +6030,7 @@ fn bindgen_test_layout___kernel_sigaction() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_sigaction>())).sa_mask as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sa_mask) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -6202,7 +6040,7 @@ fn bindgen_test_layout___kernel_sigaction() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_sigaction>())).sa_flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sa_flags) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -6212,7 +6050,7 @@ fn bindgen_test_layout___kernel_sigaction() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_sigaction>())).sa_restorer as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sa_restorer) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", @@ -6223,13 +6061,16 @@ fn bindgen_test_layout___kernel_sigaction() { ); } #[repr(C)] +#[derive(Debug, Copy, Clone)] pub struct sigaltstack { pub ss_sp: *mut ::std::os::raw::c_void, pub ss_flags: ::std::os::raw::c_int, - pub ss_size: size_t, + pub ss_size: __kernel_size_t, } #[test] fn bindgen_test_layout_sigaltstack() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 12usize, @@ -6241,7 +6082,7 @@ fn bindgen_test_layout_sigaltstack() { concat!("Alignment of ", stringify!(sigaltstack)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ss_sp as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ss_sp) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6251,7 +6092,7 @@ fn bindgen_test_layout_sigaltstack() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ss_flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ss_flags) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -6261,7 +6102,7 @@ fn bindgen_test_layout_sigaltstack() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ss_size as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ss_size) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -6280,6 +6121,8 @@ pub union sigval { } #[test] fn bindgen_test_layout_sigval() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 4usize, @@ -6291,7 +6134,7 @@ fn bindgen_test_layout_sigval() { concat!("Alignment of ", stringify!(sigval)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sival_int as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sival_int) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6301,7 +6144,7 @@ fn bindgen_test_layout_sigval() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sival_ptr as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sival_ptr) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6331,6 +6174,9 @@ pub struct __sifields__bindgen_ty_1 { } #[test] fn bindgen_test_layout___sifields__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_1> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__sifields__bindgen_ty_1>(), 8usize, @@ -6342,7 +6188,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_1() { concat!("Alignment of ", stringify!(__sifields__bindgen_ty_1)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_1>()))._pid as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._pid) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6352,7 +6198,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_1() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_1>()))._uid as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._uid) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -6372,6 +6218,9 @@ pub struct __sifields__bindgen_ty_2 { } #[test] fn bindgen_test_layout___sifields__bindgen_ty_2() { + const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_2> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__sifields__bindgen_ty_2>(), 16usize, @@ -6383,7 +6232,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_2() { concat!("Alignment of ", stringify!(__sifields__bindgen_ty_2)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_2>()))._tid as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._tid) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6393,9 +6242,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_2() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_2>()))._overrun as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._overrun) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -6405,9 +6252,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_2() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_2>()))._sigval as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._sigval) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -6417,9 +6262,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_2() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_2>()))._sys_private as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._sys_private) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", @@ -6438,6 +6281,9 @@ pub struct __sifields__bindgen_ty_3 { } #[test] fn bindgen_test_layout___sifields__bindgen_ty_3() { + const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_3> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__sifields__bindgen_ty_3>(), 12usize, @@ -6449,7 +6295,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_3() { concat!("Alignment of ", stringify!(__sifields__bindgen_ty_3)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_3>()))._pid as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._pid) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6459,7 +6305,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_3() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_3>()))._uid as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._uid) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -6469,9 +6315,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_3() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_3>()))._sigval as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._sigval) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -6492,6 +6336,9 @@ pub struct __sifields__bindgen_ty_4 { } #[test] fn bindgen_test_layout___sifields__bindgen_ty_4() { + const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_4> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__sifields__bindgen_ty_4>(), 20usize, @@ -6503,7 +6350,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_4() { concat!("Alignment of ", stringify!(__sifields__bindgen_ty_4)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_4>()))._pid as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._pid) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6513,7 +6360,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_4() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_4>()))._uid as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._uid) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -6523,9 +6370,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_4() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_4>()))._status as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._status) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -6535,7 +6380,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_4() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_4>()))._utime as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._utime) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", @@ -6545,7 +6390,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_4() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_4>()))._stime as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._stime) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -6564,9 +6409,11 @@ 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)] @@ -6577,6 +6424,9 @@ pub struct __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1 { } #[test] fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1>(), 12usize, @@ -6594,10 +6444,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1>())) - ._dummy_bnd as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._dummy_bnd) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6607,10 +6454,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1>()))._lower - as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._lower) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -6620,10 +6464,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1>()))._upper - as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._upper) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -6641,6 +6482,9 @@ pub struct __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2 { } #[test] fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2() { + const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2>(), 8usize, @@ -6658,10 +6502,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2>())) - ._dummy_pkey as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._dummy_pkey) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6671,10 +6512,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2>()))._pkey - as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._pkey) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -6684,8 +6522,59 @@ 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() { + const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + 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::addr_of!((*ptr)._data) as usize - ptr 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::addr_of!((*ptr)._type) as usize - ptr 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() { + const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_5__bindgen_ty_1> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__sifields__bindgen_ty_5__bindgen_ty_1>(), 12usize, @@ -6703,10 +6592,17 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1>()))._addr_lsb as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._trapno) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__sifields__bindgen_ty_5__bindgen_ty_1), + "::", + stringify!(_trapno) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._addr_lsb) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6716,10 +6612,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1>()))._addr_bnd as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._addr_bnd) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6729,10 +6622,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1>()))._addr_pkey - as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._addr_pkey) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6741,9 +6631,22 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1() { stringify!(_addr_pkey) ) ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._perf) as usize - ptr 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() { + const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_5> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__sifields__bindgen_ty_5>(), 16usize, @@ -6755,7 +6658,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_5() { concat!("Alignment of ", stringify!(__sifields__bindgen_ty_5)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_5>()))._addr as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._addr) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6773,6 +6676,9 @@ pub struct __sifields__bindgen_ty_6 { } #[test] fn bindgen_test_layout___sifields__bindgen_ty_6() { + const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_6> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__sifields__bindgen_ty_6>(), 8usize, @@ -6784,7 +6690,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_6() { concat!("Alignment of ", stringify!(__sifields__bindgen_ty_6)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_6>()))._band as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._band) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6794,7 +6700,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_6() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_6>()))._fd as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._fd) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -6813,6 +6719,9 @@ pub struct __sifields__bindgen_ty_7 { } #[test] fn bindgen_test_layout___sifields__bindgen_ty_7() { + const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_7> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__sifields__bindgen_ty_7>(), 12usize, @@ -6824,9 +6733,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_7() { concat!("Alignment of ", stringify!(__sifields__bindgen_ty_7)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_7>()))._call_addr as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._call_addr) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6836,9 +6743,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_7() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_7>()))._syscall as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._syscall) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -6848,7 +6753,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_7() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_7>()))._arch as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._arch) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -6860,6 +6765,8 @@ fn bindgen_test_layout___sifields__bindgen_ty_7() { } #[test] fn bindgen_test_layout___sifields() { + const UNINIT: ::std::mem::MaybeUninit<__sifields> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__sifields>(), 20usize, @@ -6871,7 +6778,7 @@ fn bindgen_test_layout___sifields() { concat!("Alignment of ", stringify!(__sifields)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields>()))._kill as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._kill) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6881,7 +6788,7 @@ fn bindgen_test_layout___sifields() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields>()))._timer as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._timer) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6891,7 +6798,7 @@ fn bindgen_test_layout___sifields() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields>()))._rt as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._rt) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6901,7 +6808,7 @@ fn bindgen_test_layout___sifields() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields>()))._sigchld as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._sigchld) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6911,7 +6818,7 @@ fn bindgen_test_layout___sifields() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields>()))._sigfault as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._sigfault) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6921,7 +6828,7 @@ fn bindgen_test_layout___sifields() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields>()))._sigpoll as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._sigpoll) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6931,7 +6838,7 @@ fn bindgen_test_layout___sifields() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields>()))._sigsys as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._sigsys) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6962,6 +6869,9 @@ pub struct siginfo__bindgen_ty_1__bindgen_ty_1 { } #[test] fn bindgen_test_layout_siginfo__bindgen_ty_1__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 32usize, @@ -6976,10 +6886,7 @@ fn bindgen_test_layout_siginfo__bindgen_ty_1__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).si_signo as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).si_signo) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6989,10 +6896,7 @@ fn bindgen_test_layout_siginfo__bindgen_ty_1__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).si_errno as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).si_errno) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -7002,10 +6906,7 @@ fn bindgen_test_layout_siginfo__bindgen_ty_1__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).si_code as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).si_code) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -7015,10 +6916,7 @@ fn bindgen_test_layout_siginfo__bindgen_ty_1__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::()))._sifields as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._sifields) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", @@ -7030,6 +6928,9 @@ fn bindgen_test_layout_siginfo__bindgen_ty_1__bindgen_ty_1() { } #[test] fn bindgen_test_layout_siginfo__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 128usize, @@ -7041,7 +6942,7 @@ fn bindgen_test_layout_siginfo__bindgen_ty_1() { concat!("Alignment of ", stringify!(siginfo__bindgen_ty_1)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::()))._si_pad as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._si_pad) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -7088,6 +6989,9 @@ pub struct sigevent__bindgen_ty_1__bindgen_ty_1 { } #[test] fn bindgen_test_layout_sigevent__bindgen_ty_1__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 8usize, @@ -7105,10 +7009,7 @@ fn bindgen_test_layout_sigevent__bindgen_ty_1__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::()))._function as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._function) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -7118,10 +7019,7 @@ fn bindgen_test_layout_sigevent__bindgen_ty_1__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::()))._attribute as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._attribute) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -7133,6 +7031,9 @@ fn bindgen_test_layout_sigevent__bindgen_ty_1__bindgen_ty_1() { } #[test] fn bindgen_test_layout_sigevent__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 52usize, @@ -7144,7 +7045,7 @@ fn bindgen_test_layout_sigevent__bindgen_ty_1() { concat!("Alignment of ", stringify!(sigevent__bindgen_ty_1)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::()))._pad as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._pad) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -7154,7 +7055,7 @@ fn bindgen_test_layout_sigevent__bindgen_ty_1() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::()))._tid as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._tid) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -7164,9 +7065,7 @@ fn bindgen_test_layout_sigevent__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::()))._sigev_thread as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._sigev_thread) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -7178,6 +7077,8 @@ fn bindgen_test_layout_sigevent__bindgen_ty_1() { } #[test] fn bindgen_test_layout_sigevent() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 64usize, @@ -7189,7 +7090,7 @@ fn bindgen_test_layout_sigevent() { concat!("Alignment of ", stringify!(sigevent)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sigev_value as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sigev_value) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -7199,7 +7100,7 @@ fn bindgen_test_layout_sigevent() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sigev_signo as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sigev_signo) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -7209,7 +7110,7 @@ fn bindgen_test_layout_sigevent() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sigev_notify as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sigev_notify) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -7219,7 +7120,7 @@ fn bindgen_test_layout_sigevent() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::()))._sigev_un as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._sigev_un) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", @@ -7240,6 +7141,8 @@ pub struct sigset64_t { } #[test] fn bindgen_test_layout_sigset64_t() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 8usize, @@ -7251,7 +7154,7 @@ fn bindgen_test_layout_sigset64_t() { concat!("Alignment of ", stringify!(sigset64_t)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).__bits as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).__bits) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -7283,6 +7186,9 @@ pub union sigaction__bindgen_ty_1 { } #[test] fn bindgen_test_layout_sigaction__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 4usize, @@ -7294,9 +7200,7 @@ fn bindgen_test_layout_sigaction__bindgen_ty_1() { concat!("Alignment of ", stringify!(sigaction__bindgen_ty_1)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).sa_handler as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).sa_handler) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -7306,9 +7210,7 @@ fn bindgen_test_layout_sigaction__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).sa_sigaction as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).sa_sigaction) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -7320,6 +7222,8 @@ fn bindgen_test_layout_sigaction__bindgen_ty_1() { } #[test] fn bindgen_test_layout_sigaction() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 16usize, @@ -7331,7 +7235,7 @@ fn bindgen_test_layout_sigaction() { concat!("Alignment of ", stringify!(sigaction)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sa_mask as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sa_mask) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -7341,7 +7245,7 @@ fn bindgen_test_layout_sigaction() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sa_flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sa_flags) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -7351,7 +7255,7 @@ fn bindgen_test_layout_sigaction() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sa_restorer as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sa_restorer) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", @@ -7383,6 +7287,9 @@ pub union sigaction64__bindgen_ty_1 { } #[test] fn bindgen_test_layout_sigaction64__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 4usize, @@ -7394,9 +7301,7 @@ fn bindgen_test_layout_sigaction64__bindgen_ty_1() { concat!("Alignment of ", stringify!(sigaction64__bindgen_ty_1)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).sa_handler as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).sa_handler) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -7406,9 +7311,7 @@ fn bindgen_test_layout_sigaction64__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).sa_sigaction as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).sa_sigaction) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -7420,6 +7323,8 @@ fn bindgen_test_layout_sigaction64__bindgen_ty_1() { } #[test] fn bindgen_test_layout_sigaction64() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 20usize, @@ -7431,7 +7336,7 @@ fn bindgen_test_layout_sigaction64() { concat!("Alignment of ", stringify!(sigaction64)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sa_flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sa_flags) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -7441,7 +7346,7 @@ fn bindgen_test_layout_sigaction64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sa_restorer as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sa_restorer) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -7451,7 +7356,7 @@ fn bindgen_test_layout_sigaction64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sa_mask as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sa_mask) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", @@ -7475,6 +7380,8 @@ pub struct user_fpregs_struct { } #[test] fn bindgen_test_layout_user_fpregs_struct() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 108usize, @@ -7486,7 +7393,7 @@ fn bindgen_test_layout_user_fpregs_struct() { concat!("Alignment of ", stringify!(user_fpregs_struct)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).cwd as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).cwd) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -7496,7 +7403,7 @@ fn bindgen_test_layout_user_fpregs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).swd as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).swd) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -7506,7 +7413,7 @@ fn bindgen_test_layout_user_fpregs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).twd as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).twd) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -7516,7 +7423,7 @@ fn bindgen_test_layout_user_fpregs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).fip as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).fip) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", @@ -7526,7 +7433,7 @@ fn bindgen_test_layout_user_fpregs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).fcs as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).fcs) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -7536,7 +7443,7 @@ fn bindgen_test_layout_user_fpregs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).foo as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).foo) as usize - ptr as usize }, 20usize, concat!( "Offset of field: ", @@ -7546,7 +7453,7 @@ fn bindgen_test_layout_user_fpregs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).fos as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).fos) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -7556,7 +7463,7 @@ fn bindgen_test_layout_user_fpregs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).st_space as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).st_space) as usize - ptr as usize }, 28usize, concat!( "Offset of field: ", @@ -7585,6 +7492,8 @@ pub struct user_fpxregs_struct { } #[test] fn bindgen_test_layout_user_fpxregs_struct() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 512usize, @@ -7596,7 +7505,7 @@ fn bindgen_test_layout_user_fpxregs_struct() { concat!("Alignment of ", stringify!(user_fpxregs_struct)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).cwd as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).cwd) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -7606,7 +7515,7 @@ fn bindgen_test_layout_user_fpxregs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).swd as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).swd) as usize - ptr as usize }, 2usize, concat!( "Offset of field: ", @@ -7616,7 +7525,7 @@ fn bindgen_test_layout_user_fpxregs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).twd as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).twd) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -7626,7 +7535,7 @@ fn bindgen_test_layout_user_fpxregs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).fop as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).fop) as usize - ptr as usize }, 6usize, concat!( "Offset of field: ", @@ -7636,7 +7545,7 @@ fn bindgen_test_layout_user_fpxregs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).fip as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).fip) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -7646,7 +7555,7 @@ fn bindgen_test_layout_user_fpxregs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).fcs as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).fcs) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", @@ -7656,7 +7565,7 @@ fn bindgen_test_layout_user_fpxregs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).foo as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).foo) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -7666,7 +7575,7 @@ fn bindgen_test_layout_user_fpxregs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).fos as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).fos) as usize - ptr as usize }, 20usize, concat!( "Offset of field: ", @@ -7676,7 +7585,7 @@ fn bindgen_test_layout_user_fpxregs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).mxcsr as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).mxcsr) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -7686,7 +7595,7 @@ fn bindgen_test_layout_user_fpxregs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).reserved) as usize - ptr as usize }, 28usize, concat!( "Offset of field: ", @@ -7696,7 +7605,7 @@ fn bindgen_test_layout_user_fpxregs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).st_space as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).st_space) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -7706,7 +7615,7 @@ fn bindgen_test_layout_user_fpxregs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).xmm_space as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).xmm_space) as usize - ptr as usize }, 160usize, concat!( "Offset of field: ", @@ -7716,7 +7625,7 @@ fn bindgen_test_layout_user_fpxregs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).padding as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).padding) as usize - ptr as usize }, 288usize, concat!( "Offset of field: ", @@ -7749,6 +7658,8 @@ pub struct user_regs_struct { } #[test] fn bindgen_test_layout_user_regs_struct() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 68usize, @@ -7760,7 +7671,7 @@ fn bindgen_test_layout_user_regs_struct() { concat!("Alignment of ", stringify!(user_regs_struct)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ebx as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ebx) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -7770,7 +7681,7 @@ fn bindgen_test_layout_user_regs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ecx as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ecx) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -7780,7 +7691,7 @@ fn bindgen_test_layout_user_regs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).edx as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).edx) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -7790,7 +7701,7 @@ fn bindgen_test_layout_user_regs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).esi as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).esi) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", @@ -7800,7 +7711,7 @@ fn bindgen_test_layout_user_regs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).edi as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).edi) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -7810,7 +7721,7 @@ fn bindgen_test_layout_user_regs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ebp as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ebp) as usize - ptr as usize }, 20usize, concat!( "Offset of field: ", @@ -7820,7 +7731,7 @@ fn bindgen_test_layout_user_regs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).eax as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).eax) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -7830,7 +7741,7 @@ fn bindgen_test_layout_user_regs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).xds as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).xds) as usize - ptr as usize }, 28usize, concat!( "Offset of field: ", @@ -7840,7 +7751,7 @@ fn bindgen_test_layout_user_regs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).xes as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).xes) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -7850,7 +7761,7 @@ fn bindgen_test_layout_user_regs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).xfs as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).xfs) as usize - ptr as usize }, 36usize, concat!( "Offset of field: ", @@ -7860,7 +7771,7 @@ fn bindgen_test_layout_user_regs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).xgs as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).xgs) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", @@ -7870,7 +7781,7 @@ fn bindgen_test_layout_user_regs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).orig_eax as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).orig_eax) as usize - ptr as usize }, 44usize, concat!( "Offset of field: ", @@ -7880,7 +7791,7 @@ fn bindgen_test_layout_user_regs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).eip as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).eip) as usize - ptr as usize }, 48usize, concat!( "Offset of field: ", @@ -7890,7 +7801,7 @@ fn bindgen_test_layout_user_regs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).xcs as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).xcs) as usize - ptr as usize }, 52usize, concat!( "Offset of field: ", @@ -7900,7 +7811,7 @@ fn bindgen_test_layout_user_regs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).eflags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).eflags) as usize - ptr as usize }, 56usize, concat!( "Offset of field: ", @@ -7910,7 +7821,7 @@ fn bindgen_test_layout_user_regs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).esp as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).esp) as usize - ptr as usize }, 60usize, concat!( "Offset of field: ", @@ -7920,7 +7831,7 @@ fn bindgen_test_layout_user_regs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).xss as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).xss) as usize - ptr as usize }, 64usize, concat!( "Offset of field: ", @@ -7951,6 +7862,8 @@ pub struct user { } #[test] fn bindgen_test_layout_user() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 284usize, @@ -7962,7 +7875,7 @@ fn bindgen_test_layout_user() { concat!("Alignment of ", stringify!(user)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).regs as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).regs) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -7972,7 +7885,7 @@ fn bindgen_test_layout_user() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).u_fpvalid as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).u_fpvalid) as usize - ptr as usize }, 68usize, concat!( "Offset of field: ", @@ -7982,7 +7895,7 @@ fn bindgen_test_layout_user() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).i387 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).i387) as usize - ptr as usize }, 72usize, concat!( "Offset of field: ", @@ -7992,7 +7905,7 @@ fn bindgen_test_layout_user() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).u_tsize as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).u_tsize) as usize - ptr as usize }, 180usize, concat!( "Offset of field: ", @@ -8002,7 +7915,7 @@ fn bindgen_test_layout_user() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).u_dsize as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).u_dsize) as usize - ptr as usize }, 184usize, concat!( "Offset of field: ", @@ -8012,7 +7925,7 @@ fn bindgen_test_layout_user() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).u_ssize as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).u_ssize) as usize - ptr as usize }, 188usize, concat!( "Offset of field: ", @@ -8022,7 +7935,7 @@ fn bindgen_test_layout_user() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).start_code as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).start_code) as usize - ptr as usize }, 192usize, concat!( "Offset of field: ", @@ -8032,7 +7945,7 @@ fn bindgen_test_layout_user() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).start_stack as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).start_stack) as usize - ptr as usize }, 196usize, concat!( "Offset of field: ", @@ -8042,7 +7955,7 @@ fn bindgen_test_layout_user() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).signal as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).signal) as usize - ptr as usize }, 200usize, concat!( "Offset of field: ", @@ -8052,7 +7965,7 @@ fn bindgen_test_layout_user() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).reserved) as usize - ptr as usize }, 204usize, concat!( "Offset of field: ", @@ -8062,7 +7975,7 @@ fn bindgen_test_layout_user() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).u_ar0 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).u_ar0) as usize - ptr as usize }, 208usize, concat!( "Offset of field: ", @@ -8072,7 +7985,7 @@ fn bindgen_test_layout_user() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).u_fpstate as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).u_fpstate) as usize - ptr as usize }, 212usize, concat!( "Offset of field: ", @@ -8082,7 +7995,7 @@ fn bindgen_test_layout_user() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).magic as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).magic) as usize - ptr as usize }, 216usize, concat!( "Offset of field: ", @@ -8092,7 +8005,7 @@ fn bindgen_test_layout_user() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).u_comm as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).u_comm) as usize - ptr as usize }, 220usize, concat!( "Offset of field: ", @@ -8102,7 +8015,7 @@ fn bindgen_test_layout_user() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).u_debugreg as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).u_debugreg) as usize - ptr as usize }, 252usize, concat!( "Offset of field: ", @@ -8112,26 +8025,26 @@ fn bindgen_test_layout_user() { ) ); } -pub const REG_GS: ::std::os::raw::c_uint = 0; -pub const REG_FS: ::std::os::raw::c_uint = 1; -pub const REG_ES: ::std::os::raw::c_uint = 2; -pub const REG_DS: ::std::os::raw::c_uint = 3; -pub const REG_EDI: ::std::os::raw::c_uint = 4; -pub const REG_ESI: ::std::os::raw::c_uint = 5; -pub const REG_EBP: ::std::os::raw::c_uint = 6; -pub const REG_ESP: ::std::os::raw::c_uint = 7; -pub const REG_EBX: ::std::os::raw::c_uint = 8; -pub const REG_EDX: ::std::os::raw::c_uint = 9; -pub const REG_ECX: ::std::os::raw::c_uint = 10; -pub const REG_EAX: ::std::os::raw::c_uint = 11; -pub const REG_TRAPNO: ::std::os::raw::c_uint = 12; -pub const REG_ERR: ::std::os::raw::c_uint = 13; -pub const REG_EIP: ::std::os::raw::c_uint = 14; -pub const REG_CS: ::std::os::raw::c_uint = 15; -pub const REG_EFL: ::std::os::raw::c_uint = 16; -pub const REG_UESP: ::std::os::raw::c_uint = 17; -pub const REG_SS: ::std::os::raw::c_uint = 18; -pub const NGREG: ::std::os::raw::c_uint = 19; +pub const REG_GS: _bindgen_ty_22 = 0; +pub const REG_FS: _bindgen_ty_22 = 1; +pub const REG_ES: _bindgen_ty_22 = 2; +pub const REG_DS: _bindgen_ty_22 = 3; +pub const REG_EDI: _bindgen_ty_22 = 4; +pub const REG_ESI: _bindgen_ty_22 = 5; +pub const REG_EBP: _bindgen_ty_22 = 6; +pub const REG_ESP: _bindgen_ty_22 = 7; +pub const REG_EBX: _bindgen_ty_22 = 8; +pub const REG_EDX: _bindgen_ty_22 = 9; +pub const REG_ECX: _bindgen_ty_22 = 10; +pub const REG_EAX: _bindgen_ty_22 = 11; +pub const REG_TRAPNO: _bindgen_ty_22 = 12; +pub const REG_ERR: _bindgen_ty_22 = 13; +pub const REG_EIP: _bindgen_ty_22 = 14; +pub const REG_CS: _bindgen_ty_22 = 15; +pub const REG_EFL: _bindgen_ty_22 = 16; +pub const REG_UESP: _bindgen_ty_22 = 17; +pub const REG_SS: _bindgen_ty_22 = 18; +pub const NGREG: _bindgen_ty_22 = 19; pub type _bindgen_ty_22 = ::std::os::raw::c_uint; pub type greg_t = ::std::os::raw::c_int; pub type gregset_t = [greg_t; 19usize]; @@ -8143,6 +8056,8 @@ pub struct _libc_fpreg { } #[test] fn bindgen_test_layout__libc_fpreg() { + const UNINIT: ::std::mem::MaybeUninit<_libc_fpreg> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_libc_fpreg>(), 10usize, @@ -8154,7 +8069,7 @@ fn bindgen_test_layout__libc_fpreg() { concat!("Alignment of ", stringify!(_libc_fpreg)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_libc_fpreg>())).significand as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).significand) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -8164,7 +8079,7 @@ fn bindgen_test_layout__libc_fpreg() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_libc_fpreg>())).exponent as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).exponent) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -8189,6 +8104,8 @@ pub struct _libc_fpstate { } #[test] fn bindgen_test_layout__libc_fpstate() { + const UNINIT: ::std::mem::MaybeUninit<_libc_fpstate> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_libc_fpstate>(), 112usize, @@ -8200,7 +8117,7 @@ fn bindgen_test_layout__libc_fpstate() { concat!("Alignment of ", stringify!(_libc_fpstate)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_libc_fpstate>())).cw as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).cw) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -8210,7 +8127,7 @@ fn bindgen_test_layout__libc_fpstate() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_libc_fpstate>())).sw as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sw) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -8220,7 +8137,7 @@ fn bindgen_test_layout__libc_fpstate() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_libc_fpstate>())).tag as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tag) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -8230,7 +8147,7 @@ fn bindgen_test_layout__libc_fpstate() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_libc_fpstate>())).ipoff as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ipoff) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", @@ -8240,7 +8157,7 @@ fn bindgen_test_layout__libc_fpstate() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_libc_fpstate>())).cssel as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).cssel) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -8250,7 +8167,7 @@ fn bindgen_test_layout__libc_fpstate() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_libc_fpstate>())).dataoff as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).dataoff) as usize - ptr as usize }, 20usize, concat!( "Offset of field: ", @@ -8260,7 +8177,7 @@ fn bindgen_test_layout__libc_fpstate() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_libc_fpstate>())).datasel as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).datasel) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -8270,7 +8187,7 @@ fn bindgen_test_layout__libc_fpstate() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_libc_fpstate>()))._st as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._st) as usize - ptr as usize }, 28usize, concat!( "Offset of field: ", @@ -8280,7 +8197,7 @@ fn bindgen_test_layout__libc_fpstate() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_libc_fpstate>())).status as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).status) as usize - ptr as usize }, 108usize, concat!( "Offset of field: ", @@ -8301,6 +8218,8 @@ pub struct mcontext_t { } #[test] fn bindgen_test_layout_mcontext_t() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 88usize, @@ -8312,7 +8231,7 @@ fn bindgen_test_layout_mcontext_t() { concat!("Alignment of ", stringify!(mcontext_t)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).gregs as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).gregs) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -8322,7 +8241,7 @@ fn bindgen_test_layout_mcontext_t() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).fpregs as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).fpregs) as usize - ptr as usize }, 76usize, concat!( "Offset of field: ", @@ -8332,7 +8251,7 @@ fn bindgen_test_layout_mcontext_t() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).oldmask as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).oldmask) as usize - ptr as usize }, 80usize, concat!( "Offset of field: ", @@ -8342,7 +8261,7 @@ fn bindgen_test_layout_mcontext_t() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).cr2 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).cr2) as usize - ptr as usize }, 84usize, concat!( "Offset of field: ", @@ -8353,6 +8272,7 @@ fn bindgen_test_layout_mcontext_t() { ); } #[repr(C)] +#[derive(Copy, Clone)] pub struct ucontext { pub uc_flags: ::std::os::raw::c_ulong, pub uc_link: *mut ucontext, @@ -8375,6 +8295,9 @@ pub struct ucontext__bindgen_ty_1__bindgen_ty_1 { } #[test] fn bindgen_test_layout_ucontext__bindgen_ty_1__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 8usize, @@ -8392,10 +8315,7 @@ fn bindgen_test_layout_ucontext__bindgen_ty_1__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).uc_sigmask as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).uc_sigmask) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -8405,10 +8325,7 @@ fn bindgen_test_layout_ucontext__bindgen_ty_1__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).__padding_rt_sigset - as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).__padding_rt_sigset) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -8420,6 +8337,9 @@ fn bindgen_test_layout_ucontext__bindgen_ty_1__bindgen_ty_1() { } #[test] fn bindgen_test_layout_ucontext__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 8usize, @@ -8431,9 +8351,7 @@ fn bindgen_test_layout_ucontext__bindgen_ty_1() { concat!("Alignment of ", stringify!(ucontext__bindgen_ty_1)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).uc_sigmask64 as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).uc_sigmask64) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -8445,6 +8363,8 @@ fn bindgen_test_layout_ucontext__bindgen_ty_1() { } #[test] fn bindgen_test_layout_ucontext() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 228usize, @@ -8456,7 +8376,7 @@ fn bindgen_test_layout_ucontext() { concat!("Alignment of ", stringify!(ucontext)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).uc_flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).uc_flags) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -8466,7 +8386,7 @@ fn bindgen_test_layout_ucontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).uc_link as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).uc_link) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -8476,7 +8396,7 @@ fn bindgen_test_layout_ucontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).uc_stack as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).uc_stack) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -8486,7 +8406,7 @@ fn bindgen_test_layout_ucontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).uc_mcontext as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).uc_mcontext) as usize - ptr as usize }, 20usize, concat!( "Offset of field: ", @@ -8496,7 +8416,7 @@ fn bindgen_test_layout_ucontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).__fpregs_mem as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).__fpregs_mem) as usize - ptr as usize }, 116usize, concat!( "Offset of field: ", @@ -8710,6 +8630,8 @@ pub struct fd_set { } #[test] fn bindgen_test_layout_fd_set() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 128usize, @@ -8721,7 +8643,7 @@ fn bindgen_test_layout_fd_set() { concat!("Alignment of ", stringify!(fd_set)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).fds_bits as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).fds_bits) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -8732,21 +8654,21 @@ fn bindgen_test_layout_fd_set() { ); } extern "C" { - pub fn __FD_CLR_chk(arg1: ::std::os::raw::c_int, arg2: *mut fd_set, arg3: size_t); + pub fn __FD_CLR_chk(arg1: ::std::os::raw::c_int, arg2: *mut fd_set, arg3: usize); } extern "C" { - pub fn __FD_SET_chk(arg1: ::std::os::raw::c_int, arg2: *mut fd_set, arg3: size_t); + pub fn __FD_SET_chk(arg1: ::std::os::raw::c_int, arg2: *mut fd_set, arg3: usize); } extern "C" { pub fn __FD_ISSET_chk( arg1: ::std::os::raw::c_int, arg2: *const fd_set, - arg3: size_t, + arg3: usize, ) -> ::std::os::raw::c_int; } extern "C" { pub fn select( - __fd_count: ::std::os::raw::c_int, + __max_fd_plus_one: ::std::os::raw::c_int, __read_fds: *mut fd_set, __write_fds: *mut fd_set, __exception_fds: *mut fd_set, @@ -8755,7 +8677,7 @@ extern "C" { } extern "C" { pub fn pselect( - __fd_count: ::std::os::raw::c_int, + __max_fd_plus_one: ::std::os::raw::c_int, __read_fds: *mut fd_set, __write_fds: *mut fd_set, __exception_fds: *mut fd_set, @@ -8765,7 +8687,7 @@ extern "C" { } extern "C" { pub fn pselect64( - __fd_count: ::std::os::raw::c_int, + __max_fd_plus_one: ::std::os::raw::c_int, __read_fds: *mut fd_set, __write_fds: *mut fd_set, __exception_fds: *mut fd_set, @@ -8830,6 +8752,8 @@ pub struct tm { } #[test] fn bindgen_test_layout_tm() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 44usize, @@ -8841,7 +8765,7 @@ fn bindgen_test_layout_tm() { concat!("Alignment of ", stringify!(tm)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tm_sec as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tm_sec) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -8851,7 +8775,7 @@ fn bindgen_test_layout_tm() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tm_min as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tm_min) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -8861,7 +8785,7 @@ fn bindgen_test_layout_tm() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tm_hour as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tm_hour) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -8871,7 +8795,7 @@ fn bindgen_test_layout_tm() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tm_mday as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tm_mday) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", @@ -8881,7 +8805,7 @@ fn bindgen_test_layout_tm() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tm_mon as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tm_mon) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -8891,7 +8815,7 @@ fn bindgen_test_layout_tm() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tm_year as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tm_year) as usize - ptr as usize }, 20usize, concat!( "Offset of field: ", @@ -8901,7 +8825,7 @@ fn bindgen_test_layout_tm() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tm_wday as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tm_wday) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -8911,7 +8835,7 @@ fn bindgen_test_layout_tm() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tm_yday as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tm_yday) as usize - ptr as usize }, 28usize, concat!( "Offset of field: ", @@ -8921,7 +8845,7 @@ fn bindgen_test_layout_tm() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tm_isdst as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tm_isdst) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -8931,7 +8855,7 @@ fn bindgen_test_layout_tm() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tm_gmtoff as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tm_gmtoff) as usize - ptr as usize }, 36usize, concat!( "Offset of field: ", @@ -8941,7 +8865,7 @@ fn bindgen_test_layout_tm() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tm_zone as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tm_zone) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", @@ -9005,19 +8929,19 @@ extern "C" { extern "C" { pub fn strftime( __buf: *mut ::std::os::raw::c_char, - __n: size_t, + __n: usize, __fmt: *const ::std::os::raw::c_char, __tm: *const tm, - ) -> size_t; + ) -> usize; } extern "C" { pub fn strftime_l( __buf: *mut ::std::os::raw::c_char, - __n: size_t, + __n: usize, __fmt: *const ::std::os::raw::c_char, __tm: *const tm, __l: locale_t, - ) -> size_t; + ) -> usize; } extern "C" { pub fn ctime(__t: *const time_t) -> *mut ::std::os::raw::c_char; @@ -9126,12 +9050,17 @@ 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() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 64usize, + 88usize, concat!("Size of: ", stringify!(clone_args)) ); assert_eq!( @@ -9140,7 +9069,7 @@ fn bindgen_test_layout_clone_args() { concat!("Alignment of ", stringify!(clone_args)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -9150,7 +9079,7 @@ fn bindgen_test_layout_clone_args() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pidfd as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pidfd) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -9160,7 +9089,7 @@ fn bindgen_test_layout_clone_args() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).child_tid as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).child_tid) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -9170,7 +9099,7 @@ fn bindgen_test_layout_clone_args() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).parent_tid as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).parent_tid) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -9180,7 +9109,7 @@ fn bindgen_test_layout_clone_args() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).exit_signal as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).exit_signal) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -9190,7 +9119,7 @@ fn bindgen_test_layout_clone_args() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).stack as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).stack) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", @@ -9200,7 +9129,7 @@ fn bindgen_test_layout_clone_args() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).stack_size as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).stack_size) as usize - ptr as usize }, 48usize, concat!( "Offset of field: ", @@ -9210,7 +9139,7 @@ fn bindgen_test_layout_clone_args() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tls as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tls) as usize - ptr as usize }, 56usize, concat!( "Offset of field: ", @@ -9219,6 +9148,36 @@ fn bindgen_test_layout_clone_args() { stringify!(tls) ) ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).set_tid) as usize - ptr as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(clone_args), + "::", + stringify!(set_tid) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).set_tid_size) as usize - ptr as usize }, + 72usize, + concat!( + "Offset of field: ", + stringify!(clone_args), + "::", + stringify!(set_tid_size) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).cgroup) as usize - ptr as usize }, + 80usize, + concat!( + "Offset of field: ", + stringify!(clone_args), + "::", + stringify!(cgroup) + ) + ); } #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -9227,6 +9186,8 @@ pub struct sched_param { } #[test] fn bindgen_test_layout_sched_param() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 4usize, @@ -9238,7 +9199,7 @@ fn bindgen_test_layout_sched_param() { concat!("Alignment of ", stringify!(sched_param)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sched_priority as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sched_priority) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -9276,15 +9237,15 @@ extern "C" { extern "C" { pub fn sched_rr_get_interval(__pid: pid_t, __quantum: *mut timespec) -> ::std::os::raw::c_int; } -pub const PTHREAD_MUTEX_NORMAL: ::std::os::raw::c_uint = 0; -pub const PTHREAD_MUTEX_RECURSIVE: ::std::os::raw::c_uint = 1; -pub const PTHREAD_MUTEX_ERRORCHECK: ::std::os::raw::c_uint = 2; -pub const PTHREAD_MUTEX_ERRORCHECK_NP: ::std::os::raw::c_uint = 2; -pub const PTHREAD_MUTEX_RECURSIVE_NP: ::std::os::raw::c_uint = 1; -pub const PTHREAD_MUTEX_DEFAULT: ::std::os::raw::c_uint = 0; +pub const PTHREAD_MUTEX_NORMAL: _bindgen_ty_23 = 0; +pub const PTHREAD_MUTEX_RECURSIVE: _bindgen_ty_23 = 1; +pub const PTHREAD_MUTEX_ERRORCHECK: _bindgen_ty_23 = 2; +pub const PTHREAD_MUTEX_ERRORCHECK_NP: _bindgen_ty_23 = 2; +pub const PTHREAD_MUTEX_RECURSIVE_NP: _bindgen_ty_23 = 1; +pub const PTHREAD_MUTEX_DEFAULT: _bindgen_ty_23 = 0; pub type _bindgen_ty_23 = ::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 const PTHREAD_RWLOCK_PREFER_READER_NP: _bindgen_ty_24 = 0; +pub const PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP: _bindgen_ty_24 = 1; pub type _bindgen_ty_24 = ::std::os::raw::c_uint; pub type __pthread_cleanup_func_t = ::std::option::Option; @@ -9297,6 +9258,8 @@ pub struct __pthread_cleanup_t { } #[test] fn bindgen_test_layout___pthread_cleanup_t() { + const UNINIT: ::std::mem::MaybeUninit<__pthread_cleanup_t> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__pthread_cleanup_t>(), 12usize, @@ -9308,9 +9271,7 @@ fn bindgen_test_layout___pthread_cleanup_t() { concat!("Alignment of ", stringify!(__pthread_cleanup_t)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_cleanup_t>())).__cleanup_prev as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).__cleanup_prev) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -9320,9 +9281,7 @@ fn bindgen_test_layout___pthread_cleanup_t() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_cleanup_t>())).__cleanup_routine as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).__cleanup_routine) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -9332,9 +9291,7 @@ fn bindgen_test_layout___pthread_cleanup_t() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_cleanup_t>())).__cleanup_arg as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).__cleanup_arg) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -9354,24 +9311,23 @@ extern "C" { extern "C" { pub fn __pthread_cleanup_pop(arg1: *mut __pthread_cleanup_t, arg2: ::std::os::raw::c_int); } -#[doc = " Data associated with an ALooper fd that will be returned as the \"outData\""] -#[doc = " when that source has data ready."] +#[doc = " Data associated with an ALooper fd that will be returned as the \"outData\"\n when that source has data ready."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct android_poll_source { - #[doc = " The identifier of this source. May be LOOPER_ID_MAIN or"] - #[doc = " LOOPER_ID_INPUT."] + #[doc = " The identifier of this source. May be LOOPER_ID_MAIN or\n LOOPER_ID_INPUT."] pub id: i32, #[doc = " The android_app this ident is associated with."] pub app: *mut android_app, - #[doc = " Function to call to perform the standard processing of data from"] - #[doc = " this source."] + #[doc = " Function to call to perform the standard processing of data from\n this source."] pub process: ::std::option::Option< unsafe extern "C" fn(app: *mut android_app, source: *mut android_poll_source), >, } #[test] fn bindgen_test_layout_android_poll_source() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 12usize, @@ -9383,7 +9339,7 @@ fn bindgen_test_layout_android_poll_source() { concat!("Alignment of ", stringify!(android_poll_source)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).id as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -9393,7 +9349,7 @@ fn bindgen_test_layout_android_poll_source() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).app as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).app) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -9403,7 +9359,7 @@ fn bindgen_test_layout_android_poll_source() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).process as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).process) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -9416,37 +9372,26 @@ fn bindgen_test_layout_android_poll_source() { #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct android_input_buffer { - #[doc = " Pointer to a read-only array of pointers to GameActivityMotionEvent."] - #[doc = " Only the first motionEventsCount events are valid."] - pub motionEvents: [GameActivityMotionEvent; 16usize], + #[doc = " Pointer to a read-only array of GameActivityMotionEvent.\n Only the first motionEventsCount events are valid."] + pub motionEvents: *mut GameActivityMotionEvent, #[doc = " The number of valid motion events in `motionEvents`."] pub motionEventsCount: u64, - #[doc = " Pointer to a read-only array of pointers to GameActivityHistoricalPointerAxes."] - #[doc = ""] - #[doc = " Only the first historicalSamplesCount samples are valid."] - #[doc = " Refer to event->historicalStart, event->pointerCount and event->historicalCount"] - #[doc = " to access the specific samples that relate to an event."] - #[doc = ""] - #[doc = " Each slice of samples for one event has a length of"] - #[doc = " (event->pointerCount and event->historicalCount) and is in pointer-major"] - #[doc = " order so the historic samples for each pointer are contiguous."] - #[doc = " E.g. you would access historic sample index 3 for pointer 2 of an event with:"] - #[doc = ""] - #[doc = " historicalAxisSamples[event->historicalStart + (event->historicalCount * 2) + 3];"] - pub historicalAxisSamples: [GameActivityHistoricalPointerAxes; 64usize], - #[doc = " The number of valid historical samples in `historicalAxisSamples`."] - pub historicalSamplesCount: u64, - #[doc = " Pointer to a read-only array of pointers to GameActivityKeyEvent."] - #[doc = " Only the first keyEventsCount events are valid."] - pub keyEvents: [GameActivityKeyEvent; 4usize], + #[doc = " The size of the `motionEvents` buffer."] + pub motionEventsBufferSize: u64, + #[doc = " Pointer to a read-only array of GameActivityKeyEvent.\n Only the first keyEventsCount events are valid."] + pub keyEvents: *mut GameActivityKeyEvent, #[doc = " The number of valid \"Key\" events in `keyEvents`."] pub keyEventsCount: u64, + #[doc = " The size of the `keyEvents` buffer."] + pub keyEventsBufferSize: u64, } #[test] fn bindgen_test_layout_android_input_buffer() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 40744usize, + 40usize, concat!("Size of: ", stringify!(android_input_buffer)) ); assert_eq!( @@ -9455,9 +9400,7 @@ fn bindgen_test_layout_android_input_buffer() { concat!("Alignment of ", stringify!(android_input_buffer)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).motionEvents as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).motionEvents) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -9467,10 +9410,8 @@ fn bindgen_test_layout_android_input_buffer() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).motionEventsCount as *const _ as usize - }, - 27712usize, + unsafe { ::std::ptr::addr_of!((*ptr).motionEventsCount) as usize - ptr as usize }, + 4usize, concat!( "Offset of field: ", stringify!(android_input_buffer), @@ -9479,153 +9420,81 @@ fn bindgen_test_layout_android_input_buffer() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).historicalAxisSamples as *const _ - as usize - }, - 27720usize, + unsafe { ::std::ptr::addr_of!((*ptr).motionEventsBufferSize) as usize - ptr as usize }, + 12usize, concat!( "Offset of field: ", stringify!(android_input_buffer), "::", - stringify!(historicalAxisSamples) + stringify!(motionEventsBufferSize) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).historicalSamplesCount as *const _ - as usize - }, - 40520usize, + unsafe { ::std::ptr::addr_of!((*ptr).keyEvents) as usize - ptr as usize }, + 20usize, concat!( "Offset of field: ", stringify!(android_input_buffer), "::", - stringify!(historicalSamplesCount) + stringify!(keyEvents) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).keyEvents as *const _ as usize }, - 40528usize, + unsafe { ::std::ptr::addr_of!((*ptr).keyEventsCount) as usize - ptr as usize }, + 24usize, concat!( "Offset of field: ", stringify!(android_input_buffer), "::", - stringify!(keyEvents) + stringify!(keyEventsCount) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).keyEventsCount as *const _ as usize - }, - 40736usize, + unsafe { ::std::ptr::addr_of!((*ptr).keyEventsBufferSize) as usize - ptr as usize }, + 32usize, concat!( "Offset of field: ", stringify!(android_input_buffer), "::", - stringify!(keyEventsCount) + stringify!(keyEventsBufferSize) ) ); } -#[doc = " Function pointer declaration for the filtering of key events."] -#[doc = " A function with this signature should be passed to"] -#[doc = " android_app_set_key_event_filter and return false for any events that should"] -#[doc = " not be handled by android_native_app_glue. These events will be handled by"] -#[doc = " the system instead."] +#[doc = " Function pointer declaration for the filtering of key events.\n A function with this signature should be passed to\n android_app_set_key_event_filter and return false for any events that should\n not be handled by android_native_app_glue. These events will be handled by\n the system instead."] pub type android_key_event_filter = ::std::option::Option bool>; -#[doc = " Function pointer definition for the filtering of motion events."] -#[doc = " A function with this signature should be passed to"] -#[doc = " android_app_set_motion_event_filter and return false for any events that"] -#[doc = " should not be handled by android_native_app_glue. These events will be"] -#[doc = " handled by the system instead."] +#[doc = " Function pointer definition for the filtering of motion events.\n A function with this signature should be passed to\n android_app_set_motion_event_filter and return false for any events that\n should not be handled by android_native_app_glue. These events will be\n handled by the system instead."] pub type android_motion_event_filter = ::std::option::Option bool>; -#[doc = " The GameActivity interface provided by "] -#[doc = " is based on a set of application-provided callbacks that will be called"] -#[doc = " by the Activity's main thread when certain events occur."] -#[doc = ""] -#[doc = " This means that each one of this callbacks _should_ _not_ block, or they"] -#[doc = " risk having the system force-close the application. This programming"] -#[doc = " model is direct, lightweight, but constraining."] -#[doc = ""] -#[doc = " The 'android_native_app_glue' static library is used to provide a different"] -#[doc = " execution model where the application can implement its own main event"] -#[doc = " loop in a different thread instead. Here's how it works:"] -#[doc = ""] -#[doc = " 1/ The application must provide a function named \"android_main()\" that"] -#[doc = " will be called when the activity is created, in a new thread that is"] -#[doc = " distinct from the activity's main thread."] -#[doc = ""] -#[doc = " 2/ android_main() receives a pointer to a valid \"android_app\" structure"] -#[doc = " that contains references to other important objects, e.g. the"] -#[doc = " GameActivity obejct instance the application is running in."] -#[doc = ""] -#[doc = " 3/ the \"android_app\" object holds an ALooper instance that already"] -#[doc = " listens to activity lifecycle events (e.g. \"pause\", \"resume\")."] -#[doc = " See APP_CMD_XXX declarations below."] -#[doc = ""] -#[doc = " This corresponds to an ALooper identifier returned by"] -#[doc = " ALooper_pollOnce with value LOOPER_ID_MAIN."] -#[doc = ""] -#[doc = " Your application can use the same ALooper to listen to additional"] -#[doc = " file-descriptors. They can either be callback based, or with return"] -#[doc = " identifiers starting with LOOPER_ID_USER."] -#[doc = ""] -#[doc = " 4/ Whenever you receive a LOOPER_ID_MAIN event,"] -#[doc = " the returned data will point to an android_poll_source structure. You"] -#[doc = " can call the process() function on it, and fill in android_app->onAppCmd"] -#[doc = " to be called for your own processing of the event."] -#[doc = ""] -#[doc = " Alternatively, you can call the low-level functions to read and process"] -#[doc = " the data directly... look at the process_cmd() and process_input()"] -#[doc = " implementations in the glue to see how to do this."] -#[doc = ""] -#[doc = " See the sample named \"native-activity\" that comes with the NDK with a"] -#[doc = " full usage example. Also look at the documentation of GameActivity."] +#[doc = " The GameActivity interface provided by \n is based on a set of application-provided callbacks that will be called\n by the Activity's main thread when certain events occur.\n\n This means that each one of this callbacks _should_ _not_ block, or they\n risk having the system force-close the application. This programming\n model is direct, lightweight, but constraining.\n\n The 'android_native_app_glue' static library is used to provide a different\n execution model where the application can implement its own main event\n loop in a different thread instead. Here's how it works:\n\n 1/ The application must provide a function named \"android_main()\" that\n will be called when the activity is created, in a new thread that is\n distinct from the activity's main thread.\n\n 2/ android_main() receives a pointer to a valid \"android_app\" structure\n that contains references to other important objects, e.g. the\n GameActivity obejct instance the application is running in.\n\n 3/ the \"android_app\" object holds an ALooper instance that already\n listens to activity lifecycle events (e.g. \"pause\", \"resume\").\n See APP_CMD_XXX declarations below.\n\n This corresponds to an ALooper identifier returned by\n ALooper_pollOnce with value LOOPER_ID_MAIN.\n\n Your application can use the same ALooper to listen to additional\n file-descriptors. They can either be callback based, or with return\n identifiers starting with LOOPER_ID_USER.\n\n 4/ Whenever you receive a LOOPER_ID_MAIN event,\n the returned data will point to an android_poll_source structure. You\n can call the process() function on it, and fill in android_app->onAppCmd\n to be called for your own processing of the event.\n\n Alternatively, you can call the low-level functions to read and process\n the data directly... look at the process_cmd() and process_input()\n implementations in the glue to see how to do this.\n\n See the sample named \"native-activity\" that comes with the NDK with a\n full usage example. Also look at the documentation of GameActivity."] #[repr(C)] pub struct android_app { #[doc = " An optional pointer to application-defined state."] pub userData: *mut ::std::os::raw::c_void, - #[doc = " A required callback for processing main app commands (`APP_CMD_*`)."] - #[doc = " This is called each frame if there are app commands that need processing."] + #[doc = " A required callback for processing main app commands (`APP_CMD_*`).\n This is called each frame if there are app commands that need processing."] pub onAppCmd: ::std::option::Option, #[doc = " The GameActivity object instance that this app is running in."] pub activity: *mut GameActivity, #[doc = " The current configuration the app is running in."] pub config: *mut AConfiguration, - #[doc = " The last activity saved state, as provided at creation time."] - #[doc = " It is NULL if there was no state. You can use this as you need; the"] - #[doc = " memory will remain around until you call android_app_exec_cmd() for"] - #[doc = " APP_CMD_RESUME, at which point it will be freed and savedState set to"] - #[doc = " NULL. These variables should only be changed when processing a"] - #[doc = " APP_CMD_SAVE_STATE, at which point they will be initialized to NULL and"] - #[doc = " you can malloc your state and place the information here. In that case"] - #[doc = " the memory will be freed for you later."] + #[doc = " The last activity saved state, as provided at creation time.\n It is NULL if there was no state. You can use this as you need; the\n memory will remain around until you call android_app_exec_cmd() for\n APP_CMD_RESUME, at which point it will be freed and savedState set to\n NULL. These variables should only be changed when processing a\n APP_CMD_SAVE_STATE, at which point they will be initialized to NULL and\n you can malloc your state and place the information here. In that case\n the memory will be freed for you later."] pub savedState: *mut ::std::os::raw::c_void, #[doc = " The size of the activity saved state. It is 0 if `savedState` is NULL."] - pub savedStateSize: size_t, + pub savedStateSize: usize, #[doc = " The ALooper associated with the app's thread."] pub looper: *mut ALooper, #[doc = " When non-NULL, this is the window surface that the app can draw in."] pub window: *mut ANativeWindow, - #[doc = " Current content rectangle of the window; this is the area where the"] - #[doc = " window's content should be placed to be seen by the user."] + #[doc = " Current content rectangle of the window; this is the area where the\n window's content should be placed to be seen by the user."] pub contentRect: ARect, - #[doc = " Current state of the app's activity. May be either APP_CMD_START,"] - #[doc = " APP_CMD_RESUME, APP_CMD_PAUSE, or APP_CMD_STOP."] + #[doc = " Current state of the app's activity. May be either APP_CMD_START,\n APP_CMD_RESUME, APP_CMD_PAUSE, or APP_CMD_STOP."] pub activityState: ::std::os::raw::c_int, - #[doc = " This is non-zero when the application's GameActivity is being"] - #[doc = " destroyed and waiting for the app thread to complete."] + #[doc = " This is non-zero when the application's GameActivity is being\n destroyed and waiting for the app thread to complete."] pub destroyRequested: ::std::os::raw::c_int, - #[doc = " This is used for buffering input from GameActivity. Once ready, the"] - #[doc = " application thread switches the buffers and processes what was"] - #[doc = " accumulated."] + #[doc = " This is used for buffering input from GameActivity. Once ready, the\n application thread switches the buffers and processes what was\n accumulated."] pub inputBuffers: [android_input_buffer; 2usize], pub currentInputBuffer: ::std::os::raw::c_int, - #[doc = " 0 if no text input event is outstanding, 1 if it is."] - #[doc = " Use `GameActivity_getTextInputState` to get information"] - #[doc = " about the text entered by the user."] + #[doc = " 0 if no text input event is outstanding, 1 if it is.\n Use `GameActivity_getTextInputState` to get information\n about the text entered by the user."] pub textInputState: ::std::os::raw::c_int, #[doc = " @cond INTERNAL"] pub mutex: pthread_mutex_t, @@ -9647,9 +9516,11 @@ pub struct android_app { } #[test] fn bindgen_test_layout_android_app() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 81632usize, + 224usize, concat!("Size of: ", stringify!(android_app)) ); assert_eq!( @@ -9658,7 +9529,7 @@ fn bindgen_test_layout_android_app() { concat!("Alignment of ", stringify!(android_app)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).userData as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).userData) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -9668,7 +9539,7 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).onAppCmd as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).onAppCmd) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -9678,7 +9549,7 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).activity as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).activity) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -9688,7 +9559,7 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).config as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).config) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", @@ -9698,7 +9569,7 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).savedState as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).savedState) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -9708,7 +9579,7 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).savedStateSize as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).savedStateSize) as usize - ptr as usize }, 20usize, concat!( "Offset of field: ", @@ -9718,7 +9589,7 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).looper as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).looper) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -9728,7 +9599,7 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).window as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).window) as usize - ptr as usize }, 28usize, concat!( "Offset of field: ", @@ -9738,7 +9609,7 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).contentRect as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).contentRect) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -9748,7 +9619,7 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).activityState as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).activityState) as usize - ptr as usize }, 48usize, concat!( "Offset of field: ", @@ -9758,7 +9629,7 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).destroyRequested as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).destroyRequested) as usize - ptr as usize }, 52usize, concat!( "Offset of field: ", @@ -9768,7 +9639,7 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).inputBuffers as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).inputBuffers) as usize - ptr as usize }, 56usize, concat!( "Offset of field: ", @@ -9778,8 +9649,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).currentInputBuffer as *const _ as usize }, - 81544usize, + unsafe { ::std::ptr::addr_of!((*ptr).currentInputBuffer) as usize - ptr as usize }, + 136usize, concat!( "Offset of field: ", stringify!(android_app), @@ -9788,8 +9659,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).textInputState as *const _ as usize }, - 81548usize, + unsafe { ::std::ptr::addr_of!((*ptr).textInputState) as usize - ptr as usize }, + 140usize, concat!( "Offset of field: ", stringify!(android_app), @@ -9798,8 +9669,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).mutex as *const _ as usize }, - 81552usize, + unsafe { ::std::ptr::addr_of!((*ptr).mutex) as usize - ptr as usize }, + 144usize, concat!( "Offset of field: ", stringify!(android_app), @@ -9808,8 +9679,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).cond as *const _ as usize }, - 81556usize, + unsafe { ::std::ptr::addr_of!((*ptr).cond) as usize - ptr as usize }, + 148usize, concat!( "Offset of field: ", stringify!(android_app), @@ -9818,8 +9689,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).msgread as *const _ as usize }, - 81560usize, + unsafe { ::std::ptr::addr_of!((*ptr).msgread) as usize - ptr as usize }, + 152usize, concat!( "Offset of field: ", stringify!(android_app), @@ -9828,8 +9699,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).msgwrite as *const _ as usize }, - 81564usize, + unsafe { ::std::ptr::addr_of!((*ptr).msgwrite) as usize - ptr as usize }, + 156usize, concat!( "Offset of field: ", stringify!(android_app), @@ -9838,8 +9709,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).thread as *const _ as usize }, - 81568usize, + unsafe { ::std::ptr::addr_of!((*ptr).thread) as usize - ptr as usize }, + 160usize, concat!( "Offset of field: ", stringify!(android_app), @@ -9848,8 +9719,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).cmdPollSource as *const _ as usize }, - 81572usize, + unsafe { ::std::ptr::addr_of!((*ptr).cmdPollSource) as usize - ptr as usize }, + 164usize, concat!( "Offset of field: ", stringify!(android_app), @@ -9858,8 +9729,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).running as *const _ as usize }, - 81584usize, + unsafe { ::std::ptr::addr_of!((*ptr).running) as usize - ptr as usize }, + 176usize, concat!( "Offset of field: ", stringify!(android_app), @@ -9868,8 +9739,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).stateSaved as *const _ as usize }, - 81588usize, + unsafe { ::std::ptr::addr_of!((*ptr).stateSaved) as usize - ptr as usize }, + 180usize, concat!( "Offset of field: ", stringify!(android_app), @@ -9878,8 +9749,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).destroyed as *const _ as usize }, - 81592usize, + unsafe { ::std::ptr::addr_of!((*ptr).destroyed) as usize - ptr as usize }, + 184usize, concat!( "Offset of field: ", stringify!(android_app), @@ -9888,8 +9759,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).redrawNeeded as *const _ as usize }, - 81596usize, + unsafe { ::std::ptr::addr_of!((*ptr).redrawNeeded) as usize - ptr as usize }, + 188usize, concat!( "Offset of field: ", stringify!(android_app), @@ -9898,8 +9769,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pendingWindow as *const _ as usize }, - 81600usize, + unsafe { ::std::ptr::addr_of!((*ptr).pendingWindow) as usize - ptr as usize }, + 192usize, concat!( "Offset of field: ", stringify!(android_app), @@ -9908,8 +9779,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pendingContentRect as *const _ as usize }, - 81604usize, + unsafe { ::std::ptr::addr_of!((*ptr).pendingContentRect) as usize - ptr as usize }, + 196usize, concat!( "Offset of field: ", stringify!(android_app), @@ -9918,8 +9789,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).keyEventFilter as *const _ as usize }, - 81620usize, + unsafe { ::std::ptr::addr_of!((*ptr).keyEventFilter) as usize - ptr as usize }, + 212usize, concat!( "Offset of field: ", stringify!(android_app), @@ -9928,8 +9799,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).motionEventFilter as *const _ as usize }, - 81624usize, + unsafe { ::std::ptr::addr_of!((*ptr).motionEventFilter) as usize - ptr as usize }, + 216usize, concat!( "Offset of field: ", stringify!(android_app), @@ -9938,10 +9809,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).inputAvailableWakeUp as *const _ as usize - }, - 81628usize, + unsafe { ::std::ptr::addr_of!((*ptr).inputAvailableWakeUp) as usize - ptr as usize }, + 220usize, concat!( "Offset of field: ", stringify!(android_app), @@ -9950,8 +9819,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).inputSwapPending as *const _ as usize }, - 81629usize, + unsafe { ::std::ptr::addr_of!((*ptr).inputSwapPending) as usize - ptr as usize }, + 221usize, concat!( "Offset of field: ", stringify!(android_app), @@ -9960,139 +9829,89 @@ fn bindgen_test_layout_android_app() { ) ); } -#[doc = " Looper data ID of commands coming from the app's main thread, which"] -#[doc = " is returned as an identifier from ALooper_pollOnce(). The data for this"] -#[doc = " identifier is a pointer to an android_poll_source structure."] -#[doc = " These can be retrieved and processed with android_app_read_cmd()"] -#[doc = " and android_app_exec_cmd()."] +#[doc = " Looper data ID of commands coming from the app's main thread, which\n is returned as an identifier from ALooper_pollOnce(). The data for this\n identifier is a pointer to an android_poll_source structure.\n These can be retrieved and processed with android_app_read_cmd()\n and android_app_exec_cmd()."] pub const NativeAppGlueLooperId_LOOPER_ID_MAIN: NativeAppGlueLooperId = 1; -#[doc = " Unused. Reserved for future use when usage of AInputQueue will be"] -#[doc = " supported."] +#[doc = " Unused. Reserved for future use when usage of AInputQueue will be\n supported."] pub const NativeAppGlueLooperId_LOOPER_ID_INPUT: NativeAppGlueLooperId = 2; #[doc = " Start of user-defined ALooper identifiers."] pub const NativeAppGlueLooperId_LOOPER_ID_USER: NativeAppGlueLooperId = 3; -#[doc = " Looper ID of commands coming from the app's main thread, an AInputQueue or"] -#[doc = " user-defined sources."] +#[doc = " Looper ID of commands coming from the app's main thread, an AInputQueue or\n user-defined sources."] pub type NativeAppGlueLooperId = ::std::os::raw::c_uint; -#[doc = " Unused. Reserved for future use when usage of AInputQueue will be"] -#[doc = " supported."] +#[doc = " Unused. Reserved for future use when usage of AInputQueue will be\n supported."] pub const NativeAppGlueAppCmd_UNUSED_APP_CMD_INPUT_CHANGED: NativeAppGlueAppCmd = 0; -#[doc = " Command from main thread: a new ANativeWindow is ready for use. Upon"] -#[doc = " receiving this command, android_app->window will contain the new window"] -#[doc = " surface."] +#[doc = " Command from main thread: a new ANativeWindow is ready for use. Upon\n receiving this command, android_app->window will contain the new window\n surface."] pub const NativeAppGlueAppCmd_APP_CMD_INIT_WINDOW: NativeAppGlueAppCmd = 1; -#[doc = " Command from main thread: the existing ANativeWindow needs to be"] -#[doc = " terminated. Upon receiving this command, android_app->window still"] -#[doc = " contains the existing window; after calling android_app_exec_cmd"] -#[doc = " it will be set to NULL."] +#[doc = " Command from main thread: the existing ANativeWindow needs to be\n terminated. Upon receiving this command, android_app->window still\n contains the existing window; after calling android_app_exec_cmd\n it will be set to NULL."] pub const NativeAppGlueAppCmd_APP_CMD_TERM_WINDOW: NativeAppGlueAppCmd = 2; -#[doc = " Command from main thread: the current ANativeWindow has been resized."] -#[doc = " Please redraw with its new size."] +#[doc = " Command from main thread: the current ANativeWindow has been resized.\n Please redraw with its new size."] pub const NativeAppGlueAppCmd_APP_CMD_WINDOW_RESIZED: NativeAppGlueAppCmd = 3; -#[doc = " Command from main thread: the system needs that the current ANativeWindow"] -#[doc = " be redrawn. You should redraw the window before handing this to"] -#[doc = " android_app_exec_cmd() in order to avoid transient drawing glitches."] +#[doc = " Command from main thread: the system needs that the current ANativeWindow\n be redrawn. You should redraw the window before handing this to\n android_app_exec_cmd() in order to avoid transient drawing glitches."] pub const NativeAppGlueAppCmd_APP_CMD_WINDOW_REDRAW_NEEDED: NativeAppGlueAppCmd = 4; -#[doc = " Command from main thread: the content area of the window has changed,"] -#[doc = " such as from the soft input window being shown or hidden. You can"] -#[doc = " find the new content rect in android_app::contentRect."] +#[doc = " Command from main thread: the content area of the window has changed,\n such as from the soft input window being shown or hidden. You can\n find the new content rect in android_app::contentRect."] pub const NativeAppGlueAppCmd_APP_CMD_CONTENT_RECT_CHANGED: NativeAppGlueAppCmd = 5; -#[doc = " Command from main thread: the app's activity window has gained"] -#[doc = " input focus."] +#[doc = " Command from main thread: the app's activity window has gained\n input focus."] pub const NativeAppGlueAppCmd_APP_CMD_GAINED_FOCUS: NativeAppGlueAppCmd = 6; -#[doc = " Command from main thread: the app's activity window has lost"] -#[doc = " input focus."] +#[doc = " Command from main thread: the app's activity window has lost\n input focus."] pub const NativeAppGlueAppCmd_APP_CMD_LOST_FOCUS: NativeAppGlueAppCmd = 7; #[doc = " Command from main thread: the current device configuration has changed."] pub const NativeAppGlueAppCmd_APP_CMD_CONFIG_CHANGED: NativeAppGlueAppCmd = 8; -#[doc = " Command from main thread: the system is running low on memory."] -#[doc = " Try to reduce your memory use."] +#[doc = " Command from main thread: the system is running low on memory.\n Try to reduce your memory use."] pub const NativeAppGlueAppCmd_APP_CMD_LOW_MEMORY: NativeAppGlueAppCmd = 9; #[doc = " Command from main thread: the app's activity has been started."] pub const NativeAppGlueAppCmd_APP_CMD_START: NativeAppGlueAppCmd = 10; #[doc = " Command from main thread: the app's activity has been resumed."] pub const NativeAppGlueAppCmd_APP_CMD_RESUME: NativeAppGlueAppCmd = 11; -#[doc = " Command from main thread: the app should generate a new saved state"] -#[doc = " for itself, to restore from later if needed. If you have saved state,"] -#[doc = " allocate it with malloc and place it in android_app.savedState with"] -#[doc = " the size in android_app.savedStateSize. The will be freed for you"] -#[doc = " later."] +#[doc = " Command from main thread: the app should generate a new saved state\n for itself, to restore from later if needed. If you have saved state,\n allocate it with malloc and place it in android_app.savedState with\n the size in android_app.savedStateSize. The will be freed for you\n later."] pub const NativeAppGlueAppCmd_APP_CMD_SAVE_STATE: NativeAppGlueAppCmd = 12; #[doc = " Command from main thread: the app's activity has been paused."] pub const NativeAppGlueAppCmd_APP_CMD_PAUSE: NativeAppGlueAppCmd = 13; #[doc = " Command from main thread: the app's activity has been stopped."] pub const NativeAppGlueAppCmd_APP_CMD_STOP: NativeAppGlueAppCmd = 14; -#[doc = " Command from main thread: the app's activity is being destroyed,"] -#[doc = " and waiting for the app thread to clean up and exit before proceeding."] +#[doc = " Command from main thread: the app's activity is being destroyed,\n and waiting for the app thread to clean up and exit before proceeding."] pub const NativeAppGlueAppCmd_APP_CMD_DESTROY: NativeAppGlueAppCmd = 15; #[doc = " Command from main thread: the app's insets have changed."] pub const NativeAppGlueAppCmd_APP_CMD_WINDOW_INSETS_CHANGED: NativeAppGlueAppCmd = 16; #[doc = " Commands passed from the application's main Java thread to the game's thread."] pub type NativeAppGlueAppCmd = ::std::os::raw::c_uint; extern "C" { - #[doc = " Call when ALooper_pollAll() returns LOOPER_ID_MAIN, reading the next"] - #[doc = " app command message."] + #[doc = " Call when ALooper_pollAll() returns LOOPER_ID_MAIN, reading the next\n app command message."] pub fn android_app_read_cmd(android_app: *mut android_app) -> i8; } extern "C" { - #[doc = " Call with the command returned by android_app_read_cmd() to do the"] - #[doc = " initial pre-processing of the given command. You can perform your own"] - #[doc = " actions for the command after calling this function."] + #[doc = " Call with the command returned by android_app_read_cmd() to do the\n initial pre-processing of the given command. You can perform your own\n actions for the command after calling this function."] pub fn android_app_pre_exec_cmd(android_app: *mut android_app, cmd: i8); } extern "C" { - #[doc = " Call with the command returned by android_app_read_cmd() to do the"] - #[doc = " final post-processing of the given command. You must have done your own"] - #[doc = " actions for the command before calling this function."] + #[doc = " Call with the command returned by android_app_read_cmd() to do the\n final post-processing of the given command. You must have done your own\n actions for the command before calling this function."] pub fn android_app_post_exec_cmd(android_app: *mut android_app, cmd: i8); } extern "C" { - #[doc = " Call this before processing input events to get the events buffer."] - #[doc = " The function returns NULL if there are no events to process."] + #[doc = " Call this before processing input events to get the events buffer.\n The function returns NULL if there are no events to process."] pub fn android_app_swap_input_buffers( android_app: *mut android_app, ) -> *mut android_input_buffer; } extern "C" { - #[doc = " Clear the array of motion events that were waiting to be handled, and release"] - #[doc = " each of them."] - #[doc = ""] - #[doc = " This method should be called after you have processed the motion events in"] - #[doc = " your game loop. You should handle events at each iteration of your game loop."] + #[doc = " Clear the array of motion events that were waiting to be handled, and release\n each of them.\n\n This method should be called after you have processed the motion events in\n your game loop. You should handle events at each iteration of your game loop."] pub fn android_app_clear_motion_events(inputBuffer: *mut android_input_buffer); } extern "C" { - #[doc = " Clear the array of key events that were waiting to be handled, and release"] - #[doc = " each of them."] - #[doc = ""] - #[doc = " This method should be called after you have processed the key up events in"] - #[doc = " your game loop. You should handle events at each iteration of your game loop."] + #[doc = " Clear the array of key events that were waiting to be handled, and release\n each of them.\n\n This method should be called after you have processed the key up events in\n your game loop. You should handle events at each iteration of your game loop."] pub fn android_app_clear_key_events(inputBuffer: *mut android_input_buffer); } extern "C" { - #[doc = " This is a springboard into the Rust glue layer that wraps calling the"] - #[doc = " main entry for the app itself."] + #[doc = " This is a springboard into the Rust glue layer that wraps calling the\n main entry for the app itself."] pub fn _rust_glue_entry(app: *mut android_app); } extern "C" { - #[doc = " Set the filter to use when processing key events."] - #[doc = " Any events for which the filter returns false will be ignored by"] - #[doc = " android_native_app_glue. If filter is set to NULL, no filtering is done."] - #[doc = ""] - #[doc = " The default key filter will filter out volume and camera button presses."] + #[doc = " Set the filter to use when processing key events.\n Any events for which the filter returns false will be ignored by\n android_native_app_glue. If filter is set to NULL, no filtering is done.\n\n The default key filter will filter out volume and camera button presses."] pub fn android_app_set_key_event_filter( app: *mut android_app, filter: android_key_event_filter, ); } extern "C" { - #[doc = " Set the filter to use when processing touch and motion events."] - #[doc = " Any events for which the filter returns false will be ignored by"] - #[doc = " android_native_app_glue. If filter is set to NULL, no filtering is done."] - #[doc = ""] - #[doc = " Note that the default motion event filter will only allow touchscreen events"] - #[doc = " through, in order to mimic NativeActivity's behaviour, so for controller"] - #[doc = " events to be passed to the app, set the filter to NULL."] + #[doc = " Set the filter to use when processing touch and motion events.\n Any events for which the filter returns false will be ignored by\n android_native_app_glue. If filter is set to NULL, no filtering is done.\n\n Note that the default motion event filter will only allow touchscreen events\n through, in order to mimic NativeActivity's behaviour, so for controller\n events to be passed to the app, set the filter to NULL."] pub fn android_app_set_motion_event_filter( app: *mut android_app, filter: android_motion_event_filter, diff --git a/android-activity/src/game_activity/ffi_x86_64.rs b/android-activity/src/game_activity/ffi_x86_64.rs index 78bf9ff..852e212 100644 --- a/android-activity/src/game_activity/ffi_x86_64.rs +++ b/android-activity/src/game_activity/ffi_x86_64.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.59.2 */ +/* automatically generated by rust-bindgen 0.66.1 */ pub const __BIONIC__: u32 = 1; pub const __WORDSIZE: u32 = 64; @@ -21,10 +21,14 @@ 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 __NDK_MAJOR__: u32 = 21; -pub const __NDK_MINOR__: u32 = 1; +pub const __ANDROID_API_S__: u32 = 31; +pub const __ANDROID_API_T__: u32 = 33; +pub const __ANDROID_API_U__: u32 = 34; +pub const __ANDROID_NDK__: u32 = 1; +pub const __NDK_MAJOR__: u32 = 25; +pub const __NDK_MINOR__: u32 = 2; pub const __NDK_BETA__: u32 = 0; -pub const __NDK_BUILD__: u32 = 6352462; +pub const __NDK_BUILD__: u32 = 9519653; pub const __NDK_CANARY__: u32 = 0; pub const INT8_MIN: i32 = -128; pub const INT8_MAX: u32 = 127; @@ -56,171 +60,176 @@ 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 AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT: u32 = 8; -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"; -pub const PRId8: &[u8; 2usize] = b"d\0"; -pub const PRId16: &[u8; 2usize] = b"d\0"; -pub const PRId32: &[u8; 2usize] = b"d\0"; -pub const PRId64: &[u8; 3usize] = b"ld\0"; -pub const PRIdLEAST8: &[u8; 2usize] = b"d\0"; -pub const PRIdLEAST16: &[u8; 2usize] = b"d\0"; -pub const PRIdLEAST32: &[u8; 2usize] = b"d\0"; -pub const PRIdLEAST64: &[u8; 3usize] = b"ld\0"; -pub const PRIdFAST8: &[u8; 2usize] = b"d\0"; -pub const PRIdFAST16: &[u8; 3usize] = b"ld\0"; -pub const PRIdFAST32: &[u8; 3usize] = b"ld\0"; -pub const PRIdFAST64: &[u8; 3usize] = b"ld\0"; -pub const PRIdMAX: &[u8; 3usize] = b"jd\0"; -pub const PRIdPTR: &[u8; 3usize] = b"ld\0"; -pub const PRIi8: &[u8; 2usize] = b"i\0"; -pub const PRIi16: &[u8; 2usize] = b"i\0"; -pub const PRIi32: &[u8; 2usize] = b"i\0"; -pub const PRIi64: &[u8; 3usize] = b"li\0"; -pub const PRIiLEAST8: &[u8; 2usize] = b"i\0"; -pub const PRIiLEAST16: &[u8; 2usize] = b"i\0"; -pub const PRIiLEAST32: &[u8; 2usize] = b"i\0"; -pub const PRIiLEAST64: &[u8; 3usize] = b"li\0"; -pub const PRIiFAST8: &[u8; 2usize] = b"i\0"; -pub const PRIiFAST16: &[u8; 3usize] = b"li\0"; -pub const PRIiFAST32: &[u8; 3usize] = b"li\0"; -pub const PRIiFAST64: &[u8; 3usize] = b"li\0"; -pub const PRIiMAX: &[u8; 3usize] = b"ji\0"; -pub const PRIiPTR: &[u8; 3usize] = b"li\0"; -pub const PRIo8: &[u8; 2usize] = b"o\0"; -pub const PRIo16: &[u8; 2usize] = b"o\0"; -pub const PRIo32: &[u8; 2usize] = b"o\0"; -pub const PRIo64: &[u8; 3usize] = b"lo\0"; -pub const PRIoLEAST8: &[u8; 2usize] = b"o\0"; -pub const PRIoLEAST16: &[u8; 2usize] = b"o\0"; -pub const PRIoLEAST32: &[u8; 2usize] = b"o\0"; -pub const PRIoLEAST64: &[u8; 3usize] = b"lo\0"; -pub const PRIoFAST8: &[u8; 2usize] = b"o\0"; -pub const PRIoFAST16: &[u8; 3usize] = b"lo\0"; -pub const PRIoFAST32: &[u8; 3usize] = b"lo\0"; -pub const PRIoFAST64: &[u8; 3usize] = b"lo\0"; -pub const PRIoMAX: &[u8; 3usize] = b"jo\0"; -pub const PRIoPTR: &[u8; 3usize] = b"lo\0"; -pub const PRIu8: &[u8; 2usize] = b"u\0"; -pub const PRIu16: &[u8; 2usize] = b"u\0"; -pub const PRIu32: &[u8; 2usize] = b"u\0"; -pub const PRIu64: &[u8; 3usize] = b"lu\0"; -pub const PRIuLEAST8: &[u8; 2usize] = b"u\0"; -pub const PRIuLEAST16: &[u8; 2usize] = b"u\0"; -pub const PRIuLEAST32: &[u8; 2usize] = b"u\0"; -pub const PRIuLEAST64: &[u8; 3usize] = b"lu\0"; -pub const PRIuFAST8: &[u8; 2usize] = b"u\0"; -pub const PRIuFAST16: &[u8; 3usize] = b"lu\0"; -pub const PRIuFAST32: &[u8; 3usize] = b"lu\0"; -pub const PRIuFAST64: &[u8; 3usize] = b"lu\0"; -pub const PRIuMAX: &[u8; 3usize] = b"ju\0"; -pub const PRIuPTR: &[u8; 3usize] = b"lu\0"; -pub const PRIx8: &[u8; 2usize] = b"x\0"; -pub const PRIx16: &[u8; 2usize] = b"x\0"; -pub const PRIx32: &[u8; 2usize] = b"x\0"; -pub const PRIx64: &[u8; 3usize] = b"lx\0"; -pub const PRIxLEAST8: &[u8; 2usize] = b"x\0"; -pub const PRIxLEAST16: &[u8; 2usize] = b"x\0"; -pub const PRIxLEAST32: &[u8; 2usize] = b"x\0"; -pub const PRIxLEAST64: &[u8; 3usize] = b"lx\0"; -pub const PRIxFAST8: &[u8; 2usize] = b"x\0"; -pub const PRIxFAST16: &[u8; 3usize] = b"lx\0"; -pub const PRIxFAST32: &[u8; 3usize] = b"lx\0"; -pub const PRIxFAST64: &[u8; 3usize] = b"lx\0"; -pub const PRIxMAX: &[u8; 3usize] = b"jx\0"; -pub const PRIxPTR: &[u8; 3usize] = b"lx\0"; -pub const PRIX8: &[u8; 2usize] = b"X\0"; -pub const PRIX16: &[u8; 2usize] = b"X\0"; -pub const PRIX32: &[u8; 2usize] = b"X\0"; -pub const PRIX64: &[u8; 3usize] = b"lX\0"; -pub const PRIXLEAST8: &[u8; 2usize] = b"X\0"; -pub const PRIXLEAST16: &[u8; 2usize] = b"X\0"; -pub const PRIXLEAST32: &[u8; 2usize] = b"X\0"; -pub const PRIXLEAST64: &[u8; 3usize] = b"lX\0"; -pub const PRIXFAST8: &[u8; 2usize] = b"X\0"; -pub const PRIXFAST16: &[u8; 3usize] = b"lX\0"; -pub const PRIXFAST32: &[u8; 3usize] = b"lX\0"; -pub const PRIXFAST64: &[u8; 3usize] = b"lX\0"; -pub const PRIXMAX: &[u8; 3usize] = b"jX\0"; -pub const PRIXPTR: &[u8; 3usize] = b"lX\0"; -pub const SCNd8: &[u8; 4usize] = b"hhd\0"; -pub const SCNd16: &[u8; 3usize] = b"hd\0"; -pub const SCNd32: &[u8; 2usize] = b"d\0"; -pub const SCNd64: &[u8; 3usize] = b"ld\0"; -pub const SCNdLEAST8: &[u8; 4usize] = b"hhd\0"; -pub const SCNdLEAST16: &[u8; 3usize] = b"hd\0"; -pub const SCNdLEAST32: &[u8; 2usize] = b"d\0"; -pub const SCNdLEAST64: &[u8; 3usize] = b"ld\0"; -pub const SCNdFAST8: &[u8; 4usize] = b"hhd\0"; -pub const SCNdFAST16: &[u8; 3usize] = b"ld\0"; -pub const SCNdFAST32: &[u8; 3usize] = b"ld\0"; -pub const SCNdFAST64: &[u8; 3usize] = b"ld\0"; -pub const SCNdMAX: &[u8; 3usize] = b"jd\0"; -pub const SCNdPTR: &[u8; 3usize] = b"ld\0"; -pub const SCNi8: &[u8; 4usize] = b"hhi\0"; -pub const SCNi16: &[u8; 3usize] = b"hi\0"; -pub const SCNi32: &[u8; 2usize] = b"i\0"; -pub const SCNi64: &[u8; 3usize] = b"li\0"; -pub const SCNiLEAST8: &[u8; 4usize] = b"hhi\0"; -pub const SCNiLEAST16: &[u8; 3usize] = b"hi\0"; -pub const SCNiLEAST32: &[u8; 2usize] = b"i\0"; -pub const SCNiLEAST64: &[u8; 3usize] = b"li\0"; -pub const SCNiFAST8: &[u8; 4usize] = b"hhi\0"; -pub const SCNiFAST16: &[u8; 3usize] = b"li\0"; -pub const SCNiFAST32: &[u8; 3usize] = b"li\0"; -pub const SCNiFAST64: &[u8; 3usize] = b"li\0"; -pub const SCNiMAX: &[u8; 3usize] = b"ji\0"; -pub const SCNiPTR: &[u8; 3usize] = b"li\0"; -pub const SCNo8: &[u8; 4usize] = b"hho\0"; -pub const SCNo16: &[u8; 3usize] = b"ho\0"; -pub const SCNo32: &[u8; 2usize] = b"o\0"; -pub const SCNo64: &[u8; 3usize] = b"lo\0"; -pub const SCNoLEAST8: &[u8; 4usize] = b"hho\0"; -pub const SCNoLEAST16: &[u8; 3usize] = b"ho\0"; -pub const SCNoLEAST32: &[u8; 2usize] = b"o\0"; -pub const SCNoLEAST64: &[u8; 3usize] = b"lo\0"; -pub const SCNoFAST8: &[u8; 4usize] = b"hho\0"; -pub const SCNoFAST16: &[u8; 3usize] = b"lo\0"; -pub const SCNoFAST32: &[u8; 3usize] = b"lo\0"; -pub const SCNoFAST64: &[u8; 3usize] = b"lo\0"; -pub const SCNoMAX: &[u8; 3usize] = b"jo\0"; -pub const SCNoPTR: &[u8; 3usize] = b"lo\0"; -pub const SCNu8: &[u8; 4usize] = b"hhu\0"; -pub const SCNu16: &[u8; 3usize] = b"hu\0"; -pub const SCNu32: &[u8; 2usize] = b"u\0"; -pub const SCNu64: &[u8; 3usize] = b"lu\0"; -pub const SCNuLEAST8: &[u8; 4usize] = b"hhu\0"; -pub const SCNuLEAST16: &[u8; 3usize] = b"hu\0"; -pub const SCNuLEAST32: &[u8; 2usize] = b"u\0"; -pub const SCNuLEAST64: &[u8; 3usize] = b"lu\0"; -pub const SCNuFAST8: &[u8; 4usize] = b"hhu\0"; -pub const SCNuFAST16: &[u8; 3usize] = b"lu\0"; -pub const SCNuFAST32: &[u8; 3usize] = b"lu\0"; -pub const SCNuFAST64: &[u8; 3usize] = b"lu\0"; -pub const SCNuMAX: &[u8; 3usize] = b"ju\0"; -pub const SCNuPTR: &[u8; 3usize] = b"lu\0"; -pub const SCNx8: &[u8; 4usize] = b"hhx\0"; -pub const SCNx16: &[u8; 3usize] = b"hx\0"; -pub const SCNx32: &[u8; 2usize] = b"x\0"; -pub const SCNx64: &[u8; 3usize] = b"lx\0"; -pub const SCNxLEAST8: &[u8; 4usize] = b"hhx\0"; -pub const SCNxLEAST16: &[u8; 3usize] = b"hx\0"; -pub const SCNxLEAST32: &[u8; 2usize] = b"x\0"; -pub const SCNxLEAST64: &[u8; 3usize] = b"lx\0"; -pub const SCNxFAST8: &[u8; 4usize] = b"hhx\0"; -pub const SCNxFAST16: &[u8; 3usize] = b"lx\0"; -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 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; 2] = b"l\0"; +pub const __PRI_PTR_prefix: &[u8; 2] = b"l\0"; +pub const __PRI_FAST_prefix: &[u8; 2] = b"l\0"; +pub const PRId8: &[u8; 2] = b"d\0"; +pub const PRId16: &[u8; 2] = b"d\0"; +pub const PRId32: &[u8; 2] = b"d\0"; +pub const PRId64: &[u8; 3] = b"ld\0"; +pub const PRIdLEAST8: &[u8; 2] = b"d\0"; +pub const PRIdLEAST16: &[u8; 2] = b"d\0"; +pub const PRIdLEAST32: &[u8; 2] = b"d\0"; +pub const PRIdLEAST64: &[u8; 3] = b"ld\0"; +pub const PRIdFAST8: &[u8; 2] = b"d\0"; +pub const PRIdFAST16: &[u8; 3] = b"ld\0"; +pub const PRIdFAST32: &[u8; 3] = b"ld\0"; +pub const PRIdFAST64: &[u8; 3] = b"ld\0"; +pub const PRIdMAX: &[u8; 3] = b"jd\0"; +pub const PRIdPTR: &[u8; 3] = b"ld\0"; +pub const PRIi8: &[u8; 2] = b"i\0"; +pub const PRIi16: &[u8; 2] = b"i\0"; +pub const PRIi32: &[u8; 2] = b"i\0"; +pub const PRIi64: &[u8; 3] = b"li\0"; +pub const PRIiLEAST8: &[u8; 2] = b"i\0"; +pub const PRIiLEAST16: &[u8; 2] = b"i\0"; +pub const PRIiLEAST32: &[u8; 2] = b"i\0"; +pub const PRIiLEAST64: &[u8; 3] = b"li\0"; +pub const PRIiFAST8: &[u8; 2] = b"i\0"; +pub const PRIiFAST16: &[u8; 3] = b"li\0"; +pub const PRIiFAST32: &[u8; 3] = b"li\0"; +pub const PRIiFAST64: &[u8; 3] = b"li\0"; +pub const PRIiMAX: &[u8; 3] = b"ji\0"; +pub const PRIiPTR: &[u8; 3] = b"li\0"; +pub const PRIo8: &[u8; 2] = b"o\0"; +pub const PRIo16: &[u8; 2] = b"o\0"; +pub const PRIo32: &[u8; 2] = b"o\0"; +pub const PRIo64: &[u8; 3] = b"lo\0"; +pub const PRIoLEAST8: &[u8; 2] = b"o\0"; +pub const PRIoLEAST16: &[u8; 2] = b"o\0"; +pub const PRIoLEAST32: &[u8; 2] = b"o\0"; +pub const PRIoLEAST64: &[u8; 3] = b"lo\0"; +pub const PRIoFAST8: &[u8; 2] = b"o\0"; +pub const PRIoFAST16: &[u8; 3] = b"lo\0"; +pub const PRIoFAST32: &[u8; 3] = b"lo\0"; +pub const PRIoFAST64: &[u8; 3] = b"lo\0"; +pub const PRIoMAX: &[u8; 3] = b"jo\0"; +pub const PRIoPTR: &[u8; 3] = b"lo\0"; +pub const PRIu8: &[u8; 2] = b"u\0"; +pub const PRIu16: &[u8; 2] = b"u\0"; +pub const PRIu32: &[u8; 2] = b"u\0"; +pub const PRIu64: &[u8; 3] = b"lu\0"; +pub const PRIuLEAST8: &[u8; 2] = b"u\0"; +pub const PRIuLEAST16: &[u8; 2] = b"u\0"; +pub const PRIuLEAST32: &[u8; 2] = b"u\0"; +pub const PRIuLEAST64: &[u8; 3] = b"lu\0"; +pub const PRIuFAST8: &[u8; 2] = b"u\0"; +pub const PRIuFAST16: &[u8; 3] = b"lu\0"; +pub const PRIuFAST32: &[u8; 3] = b"lu\0"; +pub const PRIuFAST64: &[u8; 3] = b"lu\0"; +pub const PRIuMAX: &[u8; 3] = b"ju\0"; +pub const PRIuPTR: &[u8; 3] = b"lu\0"; +pub const PRIx8: &[u8; 2] = b"x\0"; +pub const PRIx16: &[u8; 2] = b"x\0"; +pub const PRIx32: &[u8; 2] = b"x\0"; +pub const PRIx64: &[u8; 3] = b"lx\0"; +pub const PRIxLEAST8: &[u8; 2] = b"x\0"; +pub const PRIxLEAST16: &[u8; 2] = b"x\0"; +pub const PRIxLEAST32: &[u8; 2] = b"x\0"; +pub const PRIxLEAST64: &[u8; 3] = b"lx\0"; +pub const PRIxFAST8: &[u8; 2] = b"x\0"; +pub const PRIxFAST16: &[u8; 3] = b"lx\0"; +pub const PRIxFAST32: &[u8; 3] = b"lx\0"; +pub const PRIxFAST64: &[u8; 3] = b"lx\0"; +pub const PRIxMAX: &[u8; 3] = b"jx\0"; +pub const PRIxPTR: &[u8; 3] = b"lx\0"; +pub const PRIX8: &[u8; 2] = b"X\0"; +pub const PRIX16: &[u8; 2] = b"X\0"; +pub const PRIX32: &[u8; 2] = b"X\0"; +pub const PRIX64: &[u8; 3] = b"lX\0"; +pub const PRIXLEAST8: &[u8; 2] = b"X\0"; +pub const PRIXLEAST16: &[u8; 2] = b"X\0"; +pub const PRIXLEAST32: &[u8; 2] = b"X\0"; +pub const PRIXLEAST64: &[u8; 3] = b"lX\0"; +pub const PRIXFAST8: &[u8; 2] = b"X\0"; +pub const PRIXFAST16: &[u8; 3] = b"lX\0"; +pub const PRIXFAST32: &[u8; 3] = b"lX\0"; +pub const PRIXFAST64: &[u8; 3] = b"lX\0"; +pub const PRIXMAX: &[u8; 3] = b"jX\0"; +pub const PRIXPTR: &[u8; 3] = b"lX\0"; +pub const SCNd8: &[u8; 4] = b"hhd\0"; +pub const SCNd16: &[u8; 3] = b"hd\0"; +pub const SCNd32: &[u8; 2] = b"d\0"; +pub const SCNd64: &[u8; 3] = b"ld\0"; +pub const SCNdLEAST8: &[u8; 4] = b"hhd\0"; +pub const SCNdLEAST16: &[u8; 3] = b"hd\0"; +pub const SCNdLEAST32: &[u8; 2] = b"d\0"; +pub const SCNdLEAST64: &[u8; 3] = b"ld\0"; +pub const SCNdFAST8: &[u8; 4] = b"hhd\0"; +pub const SCNdFAST16: &[u8; 3] = b"ld\0"; +pub const SCNdFAST32: &[u8; 3] = b"ld\0"; +pub const SCNdFAST64: &[u8; 3] = b"ld\0"; +pub const SCNdMAX: &[u8; 3] = b"jd\0"; +pub const SCNdPTR: &[u8; 3] = b"ld\0"; +pub const SCNi8: &[u8; 4] = b"hhi\0"; +pub const SCNi16: &[u8; 3] = b"hi\0"; +pub const SCNi32: &[u8; 2] = b"i\0"; +pub const SCNi64: &[u8; 3] = b"li\0"; +pub const SCNiLEAST8: &[u8; 4] = b"hhi\0"; +pub const SCNiLEAST16: &[u8; 3] = b"hi\0"; +pub const SCNiLEAST32: &[u8; 2] = b"i\0"; +pub const SCNiLEAST64: &[u8; 3] = b"li\0"; +pub const SCNiFAST8: &[u8; 4] = b"hhi\0"; +pub const SCNiFAST16: &[u8; 3] = b"li\0"; +pub const SCNiFAST32: &[u8; 3] = b"li\0"; +pub const SCNiFAST64: &[u8; 3] = b"li\0"; +pub const SCNiMAX: &[u8; 3] = b"ji\0"; +pub const SCNiPTR: &[u8; 3] = b"li\0"; +pub const SCNo8: &[u8; 4] = b"hho\0"; +pub const SCNo16: &[u8; 3] = b"ho\0"; +pub const SCNo32: &[u8; 2] = b"o\0"; +pub const SCNo64: &[u8; 3] = b"lo\0"; +pub const SCNoLEAST8: &[u8; 4] = b"hho\0"; +pub const SCNoLEAST16: &[u8; 3] = b"ho\0"; +pub const SCNoLEAST32: &[u8; 2] = b"o\0"; +pub const SCNoLEAST64: &[u8; 3] = b"lo\0"; +pub const SCNoFAST8: &[u8; 4] = b"hho\0"; +pub const SCNoFAST16: &[u8; 3] = b"lo\0"; +pub const SCNoFAST32: &[u8; 3] = b"lo\0"; +pub const SCNoFAST64: &[u8; 3] = b"lo\0"; +pub const SCNoMAX: &[u8; 3] = b"jo\0"; +pub const SCNoPTR: &[u8; 3] = b"lo\0"; +pub const SCNu8: &[u8; 4] = b"hhu\0"; +pub const SCNu16: &[u8; 3] = b"hu\0"; +pub const SCNu32: &[u8; 2] = b"u\0"; +pub const SCNu64: &[u8; 3] = b"lu\0"; +pub const SCNuLEAST8: &[u8; 4] = b"hhu\0"; +pub const SCNuLEAST16: &[u8; 3] = b"hu\0"; +pub const SCNuLEAST32: &[u8; 2] = b"u\0"; +pub const SCNuLEAST64: &[u8; 3] = b"lu\0"; +pub const SCNuFAST8: &[u8; 4] = b"hhu\0"; +pub const SCNuFAST16: &[u8; 3] = b"lu\0"; +pub const SCNuFAST32: &[u8; 3] = b"lu\0"; +pub const SCNuFAST64: &[u8; 3] = b"lu\0"; +pub const SCNuMAX: &[u8; 3] = b"ju\0"; +pub const SCNuPTR: &[u8; 3] = b"lu\0"; +pub const SCNx8: &[u8; 4] = b"hhx\0"; +pub const SCNx16: &[u8; 3] = b"hx\0"; +pub const SCNx32: &[u8; 2] = b"x\0"; +pub const SCNx64: &[u8; 3] = b"lx\0"; +pub const SCNxLEAST8: &[u8; 4] = b"hhx\0"; +pub const SCNxLEAST16: &[u8; 3] = b"hx\0"; +pub const SCNxLEAST32: &[u8; 2] = b"x\0"; +pub const SCNxLEAST64: &[u8; 3] = b"lx\0"; +pub const SCNxFAST8: &[u8; 4] = b"hhx\0"; +pub const SCNxFAST16: &[u8; 3] = b"lx\0"; +pub const SCNxFAST32: &[u8; 3] = b"lx\0"; +pub const SCNxFAST64: &[u8; 3] = b"lx\0"; +pub const SCNxMAX: &[u8; 3] = b"jx\0"; +pub const SCNxPTR: &[u8; 3] = b"lx\0"; 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; +pub const GAMETEXTINPUT_MAJOR_VERSION: u32 = 2; +pub const GAMETEXTINPUT_MINOR_VERSION: u32 = 0; +pub const GAMETEXTINPUT_BUGFIX_VERSION: u32 = 0; +pub const GAMEACTIVITY_MAJOR_VERSION: u32 = 2; +pub const GAMEACTIVITY_MINOR_VERSION: u32 = 0; +pub const GAMEACTIVITY_BUGFIX_VERSION: u32 = 2; pub const POLLIN: u32 = 1; pub const POLLPRI: u32 = 2; pub const POLLOUT: u32 = 4; @@ -464,18 +473,20 @@ 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; @@ -525,7 +536,9 @@ 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 NSIGSEGV: u32 = 7; +pub const SEGV_MTEAERR: u32 = 8; +pub const SEGV_MTESERR: u32 = 9; +pub const NSIGSEGV: u32 = 9; pub const BUS_ADRALN: u32 = 1; pub const BUS_ADRERR: u32 = 2; pub const BUS_OBJERR: u32 = 3; @@ -537,7 +550,8 @@ 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 NSIGTRAP: u32 = 5; +pub const TRAP_PERF: u32 = 6; +pub const NSIGTRAP: u32 = 6; pub const CLD_EXITED: u32 = 1; pub const CLD_KILLED: u32 = 2; pub const CLD_DUMPED: u32 = 3; @@ -553,7 +567,8 @@ 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 NSIGSYS: u32 = 1; +pub const SYS_USER_DISPATCH: u32 = 2; +pub const NSIGSYS: u32 = 2; pub const EMT_TAGOVF: u32 = 1; pub const NSIGEMT: u32 = 1; pub const SIGEV_SIGNAL: u32 = 0; @@ -598,6 +613,12 @@ 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; @@ -629,9 +650,6 @@ pub const PTHREAD_PROCESS_PRIVATE: u32 = 0; pub const PTHREAD_PROCESS_SHARED: u32 = 1; pub const PTHREAD_SCOPE_SYSTEM: u32 = 0; pub const PTHREAD_SCOPE_PROCESS: u32 = 1; -pub const NATIVE_APP_GLUE_MAX_NUM_MOTION_EVENTS: u32 = 16; -pub const NATIVE_APP_GLUE_MAX_HISTORICAL_POINTER_SAMPLES: u32 = 64; -pub const NATIVE_APP_GLUE_MAX_NUM_KEY_EVENTS: u32 = 4; pub const NATIVE_APP_GLUE_MAX_INPUT_BUFFERS: u32 = 2; extern "C" { pub fn android_get_application_target_sdk_version() -> ::std::os::raw::c_int; @@ -650,6 +668,8 @@ pub struct max_align_t { } #[test] fn bindgen_test_layout_max_align_t() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 32usize, @@ -661,9 +681,7 @@ fn bindgen_test_layout_max_align_t() { concat!("Alignment of ", stringify!(max_align_t)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).__clang_max_align_nonce1 as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).__clang_max_align_nonce1) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -673,9 +691,7 @@ fn bindgen_test_layout_max_align_t() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).__clang_max_align_nonce2 as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).__clang_max_align_nonce2) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -728,6 +744,8 @@ pub struct __kernel_fd_set { } #[test] fn bindgen_test_layout___kernel_fd_set() { + const UNINIT: ::std::mem::MaybeUninit<__kernel_fd_set> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__kernel_fd_set>(), 128usize, @@ -739,7 +757,7 @@ fn bindgen_test_layout___kernel_fd_set() { concat!("Alignment of ", stringify!(__kernel_fd_set)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_fd_set>())).fds_bits as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).fds_bits) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -778,6 +796,8 @@ pub struct __kernel_fsid_t { } #[test] fn bindgen_test_layout___kernel_fsid_t() { + const UNINIT: ::std::mem::MaybeUninit<__kernel_fsid_t> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__kernel_fsid_t>(), 8usize, @@ -789,7 +809,7 @@ fn bindgen_test_layout___kernel_fsid_t() { concat!("Alignment of ", stringify!(__kernel_fsid_t)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_fsid_t>())).val as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).val) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -801,6 +821,7 @@ 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; @@ -859,7 +880,6 @@ pub type off64_t = loff_t; pub type __socklen_t = u32; pub type socklen_t = __socklen_t; pub type __va_list = __builtin_va_list; -pub type ssize_t = __kernel_ssize_t; pub type uint_t = ::std::os::raw::c_uint; pub type uint = ::std::os::raw::c_uint; pub type u_char = ::std::os::raw::c_uchar; @@ -870,483 +890,651 @@ pub type u_int32_t = u32; pub type u_int16_t = u16; pub type u_int8_t = u8; pub type u_int64_t = u64; -pub const AASSET_MODE_UNKNOWN: ::std::os::raw::c_uint = 0; -pub const AASSET_MODE_RANDOM: ::std::os::raw::c_uint = 1; -pub const AASSET_MODE_STREAMING: ::std::os::raw::c_uint = 2; -pub const AASSET_MODE_BUFFER: ::std::os::raw::c_uint = 3; +pub const AASSET_MODE_UNKNOWN: _bindgen_ty_1 = 0; +pub const AASSET_MODE_RANDOM: _bindgen_ty_1 = 1; +pub const AASSET_MODE_STREAMING: _bindgen_ty_1 = 2; +pub const AASSET_MODE_BUFFER: _bindgen_ty_1 = 3; pub type _bindgen_ty_1 = ::std::os::raw::c_uint; -pub const AKEYCODE_UNKNOWN: ::std::os::raw::c_uint = 0; -pub const AKEYCODE_SOFT_LEFT: ::std::os::raw::c_uint = 1; -pub const AKEYCODE_SOFT_RIGHT: ::std::os::raw::c_uint = 2; -pub const AKEYCODE_HOME: ::std::os::raw::c_uint = 3; -pub const AKEYCODE_BACK: ::std::os::raw::c_uint = 4; -pub const AKEYCODE_CALL: ::std::os::raw::c_uint = 5; -pub const AKEYCODE_ENDCALL: ::std::os::raw::c_uint = 6; -pub const AKEYCODE_0: ::std::os::raw::c_uint = 7; -pub const AKEYCODE_1: ::std::os::raw::c_uint = 8; -pub const AKEYCODE_2: ::std::os::raw::c_uint = 9; -pub const AKEYCODE_3: ::std::os::raw::c_uint = 10; -pub const AKEYCODE_4: ::std::os::raw::c_uint = 11; -pub const AKEYCODE_5: ::std::os::raw::c_uint = 12; -pub const AKEYCODE_6: ::std::os::raw::c_uint = 13; -pub const AKEYCODE_7: ::std::os::raw::c_uint = 14; -pub const AKEYCODE_8: ::std::os::raw::c_uint = 15; -pub const AKEYCODE_9: ::std::os::raw::c_uint = 16; -pub const AKEYCODE_STAR: ::std::os::raw::c_uint = 17; -pub const AKEYCODE_POUND: ::std::os::raw::c_uint = 18; -pub const AKEYCODE_DPAD_UP: ::std::os::raw::c_uint = 19; -pub const AKEYCODE_DPAD_DOWN: ::std::os::raw::c_uint = 20; -pub const AKEYCODE_DPAD_LEFT: ::std::os::raw::c_uint = 21; -pub const AKEYCODE_DPAD_RIGHT: ::std::os::raw::c_uint = 22; -pub const AKEYCODE_DPAD_CENTER: ::std::os::raw::c_uint = 23; -pub const AKEYCODE_VOLUME_UP: ::std::os::raw::c_uint = 24; -pub const AKEYCODE_VOLUME_DOWN: ::std::os::raw::c_uint = 25; -pub const AKEYCODE_POWER: ::std::os::raw::c_uint = 26; -pub const AKEYCODE_CAMERA: ::std::os::raw::c_uint = 27; -pub const AKEYCODE_CLEAR: ::std::os::raw::c_uint = 28; -pub const AKEYCODE_A: ::std::os::raw::c_uint = 29; -pub const AKEYCODE_B: ::std::os::raw::c_uint = 30; -pub const AKEYCODE_C: ::std::os::raw::c_uint = 31; -pub const AKEYCODE_D: ::std::os::raw::c_uint = 32; -pub const AKEYCODE_E: ::std::os::raw::c_uint = 33; -pub const AKEYCODE_F: ::std::os::raw::c_uint = 34; -pub const AKEYCODE_G: ::std::os::raw::c_uint = 35; -pub const AKEYCODE_H: ::std::os::raw::c_uint = 36; -pub const AKEYCODE_I: ::std::os::raw::c_uint = 37; -pub const AKEYCODE_J: ::std::os::raw::c_uint = 38; -pub const AKEYCODE_K: ::std::os::raw::c_uint = 39; -pub const AKEYCODE_L: ::std::os::raw::c_uint = 40; -pub const AKEYCODE_M: ::std::os::raw::c_uint = 41; -pub const AKEYCODE_N: ::std::os::raw::c_uint = 42; -pub const AKEYCODE_O: ::std::os::raw::c_uint = 43; -pub const AKEYCODE_P: ::std::os::raw::c_uint = 44; -pub const AKEYCODE_Q: ::std::os::raw::c_uint = 45; -pub const AKEYCODE_R: ::std::os::raw::c_uint = 46; -pub const AKEYCODE_S: ::std::os::raw::c_uint = 47; -pub const AKEYCODE_T: ::std::os::raw::c_uint = 48; -pub const AKEYCODE_U: ::std::os::raw::c_uint = 49; -pub const AKEYCODE_V: ::std::os::raw::c_uint = 50; -pub const AKEYCODE_W: ::std::os::raw::c_uint = 51; -pub const AKEYCODE_X: ::std::os::raw::c_uint = 52; -pub const AKEYCODE_Y: ::std::os::raw::c_uint = 53; -pub const AKEYCODE_Z: ::std::os::raw::c_uint = 54; -pub const AKEYCODE_COMMA: ::std::os::raw::c_uint = 55; -pub const AKEYCODE_PERIOD: ::std::os::raw::c_uint = 56; -pub const AKEYCODE_ALT_LEFT: ::std::os::raw::c_uint = 57; -pub const AKEYCODE_ALT_RIGHT: ::std::os::raw::c_uint = 58; -pub const AKEYCODE_SHIFT_LEFT: ::std::os::raw::c_uint = 59; -pub const AKEYCODE_SHIFT_RIGHT: ::std::os::raw::c_uint = 60; -pub const AKEYCODE_TAB: ::std::os::raw::c_uint = 61; -pub const AKEYCODE_SPACE: ::std::os::raw::c_uint = 62; -pub const AKEYCODE_SYM: ::std::os::raw::c_uint = 63; -pub const AKEYCODE_EXPLORER: ::std::os::raw::c_uint = 64; -pub const AKEYCODE_ENVELOPE: ::std::os::raw::c_uint = 65; -pub const AKEYCODE_ENTER: ::std::os::raw::c_uint = 66; -pub const AKEYCODE_DEL: ::std::os::raw::c_uint = 67; -pub const AKEYCODE_GRAVE: ::std::os::raw::c_uint = 68; -pub const AKEYCODE_MINUS: ::std::os::raw::c_uint = 69; -pub const AKEYCODE_EQUALS: ::std::os::raw::c_uint = 70; -pub const AKEYCODE_LEFT_BRACKET: ::std::os::raw::c_uint = 71; -pub const AKEYCODE_RIGHT_BRACKET: ::std::os::raw::c_uint = 72; -pub const AKEYCODE_BACKSLASH: ::std::os::raw::c_uint = 73; -pub const AKEYCODE_SEMICOLON: ::std::os::raw::c_uint = 74; -pub const AKEYCODE_APOSTROPHE: ::std::os::raw::c_uint = 75; -pub const AKEYCODE_SLASH: ::std::os::raw::c_uint = 76; -pub const AKEYCODE_AT: ::std::os::raw::c_uint = 77; -pub const AKEYCODE_NUM: ::std::os::raw::c_uint = 78; -pub const AKEYCODE_HEADSETHOOK: ::std::os::raw::c_uint = 79; -pub const AKEYCODE_FOCUS: ::std::os::raw::c_uint = 80; -pub const AKEYCODE_PLUS: ::std::os::raw::c_uint = 81; -pub const AKEYCODE_MENU: ::std::os::raw::c_uint = 82; -pub const AKEYCODE_NOTIFICATION: ::std::os::raw::c_uint = 83; -pub const AKEYCODE_SEARCH: ::std::os::raw::c_uint = 84; -pub const AKEYCODE_MEDIA_PLAY_PAUSE: ::std::os::raw::c_uint = 85; -pub const AKEYCODE_MEDIA_STOP: ::std::os::raw::c_uint = 86; -pub const AKEYCODE_MEDIA_NEXT: ::std::os::raw::c_uint = 87; -pub const AKEYCODE_MEDIA_PREVIOUS: ::std::os::raw::c_uint = 88; -pub const AKEYCODE_MEDIA_REWIND: ::std::os::raw::c_uint = 89; -pub const AKEYCODE_MEDIA_FAST_FORWARD: ::std::os::raw::c_uint = 90; -pub const AKEYCODE_MUTE: ::std::os::raw::c_uint = 91; -pub const AKEYCODE_PAGE_UP: ::std::os::raw::c_uint = 92; -pub const AKEYCODE_PAGE_DOWN: ::std::os::raw::c_uint = 93; -pub const AKEYCODE_PICTSYMBOLS: ::std::os::raw::c_uint = 94; -pub const AKEYCODE_SWITCH_CHARSET: ::std::os::raw::c_uint = 95; -pub const AKEYCODE_BUTTON_A: ::std::os::raw::c_uint = 96; -pub const AKEYCODE_BUTTON_B: ::std::os::raw::c_uint = 97; -pub const AKEYCODE_BUTTON_C: ::std::os::raw::c_uint = 98; -pub const AKEYCODE_BUTTON_X: ::std::os::raw::c_uint = 99; -pub const AKEYCODE_BUTTON_Y: ::std::os::raw::c_uint = 100; -pub const AKEYCODE_BUTTON_Z: ::std::os::raw::c_uint = 101; -pub const AKEYCODE_BUTTON_L1: ::std::os::raw::c_uint = 102; -pub const AKEYCODE_BUTTON_R1: ::std::os::raw::c_uint = 103; -pub const AKEYCODE_BUTTON_L2: ::std::os::raw::c_uint = 104; -pub const AKEYCODE_BUTTON_R2: ::std::os::raw::c_uint = 105; -pub const AKEYCODE_BUTTON_THUMBL: ::std::os::raw::c_uint = 106; -pub const AKEYCODE_BUTTON_THUMBR: ::std::os::raw::c_uint = 107; -pub const AKEYCODE_BUTTON_START: ::std::os::raw::c_uint = 108; -pub const AKEYCODE_BUTTON_SELECT: ::std::os::raw::c_uint = 109; -pub const AKEYCODE_BUTTON_MODE: ::std::os::raw::c_uint = 110; -pub const AKEYCODE_ESCAPE: ::std::os::raw::c_uint = 111; -pub const AKEYCODE_FORWARD_DEL: ::std::os::raw::c_uint = 112; -pub const AKEYCODE_CTRL_LEFT: ::std::os::raw::c_uint = 113; -pub const AKEYCODE_CTRL_RIGHT: ::std::os::raw::c_uint = 114; -pub const AKEYCODE_CAPS_LOCK: ::std::os::raw::c_uint = 115; -pub const AKEYCODE_SCROLL_LOCK: ::std::os::raw::c_uint = 116; -pub const AKEYCODE_META_LEFT: ::std::os::raw::c_uint = 117; -pub const AKEYCODE_META_RIGHT: ::std::os::raw::c_uint = 118; -pub const AKEYCODE_FUNCTION: ::std::os::raw::c_uint = 119; -pub const AKEYCODE_SYSRQ: ::std::os::raw::c_uint = 120; -pub const AKEYCODE_BREAK: ::std::os::raw::c_uint = 121; -pub const AKEYCODE_MOVE_HOME: ::std::os::raw::c_uint = 122; -pub const AKEYCODE_MOVE_END: ::std::os::raw::c_uint = 123; -pub const AKEYCODE_INSERT: ::std::os::raw::c_uint = 124; -pub const AKEYCODE_FORWARD: ::std::os::raw::c_uint = 125; -pub const AKEYCODE_MEDIA_PLAY: ::std::os::raw::c_uint = 126; -pub const AKEYCODE_MEDIA_PAUSE: ::std::os::raw::c_uint = 127; -pub const AKEYCODE_MEDIA_CLOSE: ::std::os::raw::c_uint = 128; -pub const AKEYCODE_MEDIA_EJECT: ::std::os::raw::c_uint = 129; -pub const AKEYCODE_MEDIA_RECORD: ::std::os::raw::c_uint = 130; -pub const AKEYCODE_F1: ::std::os::raw::c_uint = 131; -pub const AKEYCODE_F2: ::std::os::raw::c_uint = 132; -pub const AKEYCODE_F3: ::std::os::raw::c_uint = 133; -pub const AKEYCODE_F4: ::std::os::raw::c_uint = 134; -pub const AKEYCODE_F5: ::std::os::raw::c_uint = 135; -pub const AKEYCODE_F6: ::std::os::raw::c_uint = 136; -pub const AKEYCODE_F7: ::std::os::raw::c_uint = 137; -pub const AKEYCODE_F8: ::std::os::raw::c_uint = 138; -pub const AKEYCODE_F9: ::std::os::raw::c_uint = 139; -pub const AKEYCODE_F10: ::std::os::raw::c_uint = 140; -pub const AKEYCODE_F11: ::std::os::raw::c_uint = 141; -pub const AKEYCODE_F12: ::std::os::raw::c_uint = 142; -pub const AKEYCODE_NUM_LOCK: ::std::os::raw::c_uint = 143; -pub const AKEYCODE_NUMPAD_0: ::std::os::raw::c_uint = 144; -pub const AKEYCODE_NUMPAD_1: ::std::os::raw::c_uint = 145; -pub const AKEYCODE_NUMPAD_2: ::std::os::raw::c_uint = 146; -pub const AKEYCODE_NUMPAD_3: ::std::os::raw::c_uint = 147; -pub const AKEYCODE_NUMPAD_4: ::std::os::raw::c_uint = 148; -pub const AKEYCODE_NUMPAD_5: ::std::os::raw::c_uint = 149; -pub const AKEYCODE_NUMPAD_6: ::std::os::raw::c_uint = 150; -pub const AKEYCODE_NUMPAD_7: ::std::os::raw::c_uint = 151; -pub const AKEYCODE_NUMPAD_8: ::std::os::raw::c_uint = 152; -pub const AKEYCODE_NUMPAD_9: ::std::os::raw::c_uint = 153; -pub const AKEYCODE_NUMPAD_DIVIDE: ::std::os::raw::c_uint = 154; -pub const AKEYCODE_NUMPAD_MULTIPLY: ::std::os::raw::c_uint = 155; -pub const AKEYCODE_NUMPAD_SUBTRACT: ::std::os::raw::c_uint = 156; -pub const AKEYCODE_NUMPAD_ADD: ::std::os::raw::c_uint = 157; -pub const AKEYCODE_NUMPAD_DOT: ::std::os::raw::c_uint = 158; -pub const AKEYCODE_NUMPAD_COMMA: ::std::os::raw::c_uint = 159; -pub const AKEYCODE_NUMPAD_ENTER: ::std::os::raw::c_uint = 160; -pub const AKEYCODE_NUMPAD_EQUALS: ::std::os::raw::c_uint = 161; -pub const AKEYCODE_NUMPAD_LEFT_PAREN: ::std::os::raw::c_uint = 162; -pub const AKEYCODE_NUMPAD_RIGHT_PAREN: ::std::os::raw::c_uint = 163; -pub const AKEYCODE_VOLUME_MUTE: ::std::os::raw::c_uint = 164; -pub const AKEYCODE_INFO: ::std::os::raw::c_uint = 165; -pub const AKEYCODE_CHANNEL_UP: ::std::os::raw::c_uint = 166; -pub const AKEYCODE_CHANNEL_DOWN: ::std::os::raw::c_uint = 167; -pub const AKEYCODE_ZOOM_IN: ::std::os::raw::c_uint = 168; -pub const AKEYCODE_ZOOM_OUT: ::std::os::raw::c_uint = 169; -pub const AKEYCODE_TV: ::std::os::raw::c_uint = 170; -pub const AKEYCODE_WINDOW: ::std::os::raw::c_uint = 171; -pub const AKEYCODE_GUIDE: ::std::os::raw::c_uint = 172; -pub const AKEYCODE_DVR: ::std::os::raw::c_uint = 173; -pub const AKEYCODE_BOOKMARK: ::std::os::raw::c_uint = 174; -pub const AKEYCODE_CAPTIONS: ::std::os::raw::c_uint = 175; -pub const AKEYCODE_SETTINGS: ::std::os::raw::c_uint = 176; -pub const AKEYCODE_TV_POWER: ::std::os::raw::c_uint = 177; -pub const AKEYCODE_TV_INPUT: ::std::os::raw::c_uint = 178; -pub const AKEYCODE_STB_POWER: ::std::os::raw::c_uint = 179; -pub const AKEYCODE_STB_INPUT: ::std::os::raw::c_uint = 180; -pub const AKEYCODE_AVR_POWER: ::std::os::raw::c_uint = 181; -pub const AKEYCODE_AVR_INPUT: ::std::os::raw::c_uint = 182; -pub const AKEYCODE_PROG_RED: ::std::os::raw::c_uint = 183; -pub const AKEYCODE_PROG_GREEN: ::std::os::raw::c_uint = 184; -pub const AKEYCODE_PROG_YELLOW: ::std::os::raw::c_uint = 185; -pub const AKEYCODE_PROG_BLUE: ::std::os::raw::c_uint = 186; -pub const AKEYCODE_APP_SWITCH: ::std::os::raw::c_uint = 187; -pub const AKEYCODE_BUTTON_1: ::std::os::raw::c_uint = 188; -pub const AKEYCODE_BUTTON_2: ::std::os::raw::c_uint = 189; -pub const AKEYCODE_BUTTON_3: ::std::os::raw::c_uint = 190; -pub const AKEYCODE_BUTTON_4: ::std::os::raw::c_uint = 191; -pub const AKEYCODE_BUTTON_5: ::std::os::raw::c_uint = 192; -pub const AKEYCODE_BUTTON_6: ::std::os::raw::c_uint = 193; -pub const AKEYCODE_BUTTON_7: ::std::os::raw::c_uint = 194; -pub const AKEYCODE_BUTTON_8: ::std::os::raw::c_uint = 195; -pub const AKEYCODE_BUTTON_9: ::std::os::raw::c_uint = 196; -pub const AKEYCODE_BUTTON_10: ::std::os::raw::c_uint = 197; -pub const AKEYCODE_BUTTON_11: ::std::os::raw::c_uint = 198; -pub const AKEYCODE_BUTTON_12: ::std::os::raw::c_uint = 199; -pub const AKEYCODE_BUTTON_13: ::std::os::raw::c_uint = 200; -pub const AKEYCODE_BUTTON_14: ::std::os::raw::c_uint = 201; -pub const AKEYCODE_BUTTON_15: ::std::os::raw::c_uint = 202; -pub const AKEYCODE_BUTTON_16: ::std::os::raw::c_uint = 203; -pub const AKEYCODE_LANGUAGE_SWITCH: ::std::os::raw::c_uint = 204; -pub const AKEYCODE_MANNER_MODE: ::std::os::raw::c_uint = 205; -pub const AKEYCODE_3D_MODE: ::std::os::raw::c_uint = 206; -pub const AKEYCODE_CONTACTS: ::std::os::raw::c_uint = 207; -pub const AKEYCODE_CALENDAR: ::std::os::raw::c_uint = 208; -pub const AKEYCODE_MUSIC: ::std::os::raw::c_uint = 209; -pub const AKEYCODE_CALCULATOR: ::std::os::raw::c_uint = 210; -pub const AKEYCODE_ZENKAKU_HANKAKU: ::std::os::raw::c_uint = 211; -pub const AKEYCODE_EISU: ::std::os::raw::c_uint = 212; -pub const AKEYCODE_MUHENKAN: ::std::os::raw::c_uint = 213; -pub const AKEYCODE_HENKAN: ::std::os::raw::c_uint = 214; -pub const AKEYCODE_KATAKANA_HIRAGANA: ::std::os::raw::c_uint = 215; -pub const AKEYCODE_YEN: ::std::os::raw::c_uint = 216; -pub const AKEYCODE_RO: ::std::os::raw::c_uint = 217; -pub const AKEYCODE_KANA: ::std::os::raw::c_uint = 218; -pub const AKEYCODE_ASSIST: ::std::os::raw::c_uint = 219; -pub const AKEYCODE_BRIGHTNESS_DOWN: ::std::os::raw::c_uint = 220; -pub const AKEYCODE_BRIGHTNESS_UP: ::std::os::raw::c_uint = 221; -pub const AKEYCODE_MEDIA_AUDIO_TRACK: ::std::os::raw::c_uint = 222; -pub const AKEYCODE_SLEEP: ::std::os::raw::c_uint = 223; -pub const AKEYCODE_WAKEUP: ::std::os::raw::c_uint = 224; -pub const AKEYCODE_PAIRING: ::std::os::raw::c_uint = 225; -pub const AKEYCODE_MEDIA_TOP_MENU: ::std::os::raw::c_uint = 226; -pub const AKEYCODE_11: ::std::os::raw::c_uint = 227; -pub const AKEYCODE_12: ::std::os::raw::c_uint = 228; -pub const AKEYCODE_LAST_CHANNEL: ::std::os::raw::c_uint = 229; -pub const AKEYCODE_TV_DATA_SERVICE: ::std::os::raw::c_uint = 230; -pub const AKEYCODE_VOICE_ASSIST: ::std::os::raw::c_uint = 231; -pub const AKEYCODE_TV_RADIO_SERVICE: ::std::os::raw::c_uint = 232; -pub const AKEYCODE_TV_TELETEXT: ::std::os::raw::c_uint = 233; -pub const AKEYCODE_TV_NUMBER_ENTRY: ::std::os::raw::c_uint = 234; -pub const AKEYCODE_TV_TERRESTRIAL_ANALOG: ::std::os::raw::c_uint = 235; -pub const AKEYCODE_TV_TERRESTRIAL_DIGITAL: ::std::os::raw::c_uint = 236; -pub const AKEYCODE_TV_SATELLITE: ::std::os::raw::c_uint = 237; -pub const AKEYCODE_TV_SATELLITE_BS: ::std::os::raw::c_uint = 238; -pub const AKEYCODE_TV_SATELLITE_CS: ::std::os::raw::c_uint = 239; -pub const AKEYCODE_TV_SATELLITE_SERVICE: ::std::os::raw::c_uint = 240; -pub const AKEYCODE_TV_NETWORK: ::std::os::raw::c_uint = 241; -pub const AKEYCODE_TV_ANTENNA_CABLE: ::std::os::raw::c_uint = 242; -pub const AKEYCODE_TV_INPUT_HDMI_1: ::std::os::raw::c_uint = 243; -pub const AKEYCODE_TV_INPUT_HDMI_2: ::std::os::raw::c_uint = 244; -pub const AKEYCODE_TV_INPUT_HDMI_3: ::std::os::raw::c_uint = 245; -pub const AKEYCODE_TV_INPUT_HDMI_4: ::std::os::raw::c_uint = 246; -pub const AKEYCODE_TV_INPUT_COMPOSITE_1: ::std::os::raw::c_uint = 247; -pub const AKEYCODE_TV_INPUT_COMPOSITE_2: ::std::os::raw::c_uint = 248; -pub const AKEYCODE_TV_INPUT_COMPONENT_1: ::std::os::raw::c_uint = 249; -pub const AKEYCODE_TV_INPUT_COMPONENT_2: ::std::os::raw::c_uint = 250; -pub const AKEYCODE_TV_INPUT_VGA_1: ::std::os::raw::c_uint = 251; -pub const AKEYCODE_TV_AUDIO_DESCRIPTION: ::std::os::raw::c_uint = 252; -pub const AKEYCODE_TV_AUDIO_DESCRIPTION_MIX_UP: ::std::os::raw::c_uint = 253; -pub const AKEYCODE_TV_AUDIO_DESCRIPTION_MIX_DOWN: ::std::os::raw::c_uint = 254; -pub const AKEYCODE_TV_ZOOM_MODE: ::std::os::raw::c_uint = 255; -pub const AKEYCODE_TV_CONTENTS_MENU: ::std::os::raw::c_uint = 256; -pub const AKEYCODE_TV_MEDIA_CONTEXT_MENU: ::std::os::raw::c_uint = 257; -pub const AKEYCODE_TV_TIMER_PROGRAMMING: ::std::os::raw::c_uint = 258; -pub const AKEYCODE_HELP: ::std::os::raw::c_uint = 259; -pub const AKEYCODE_NAVIGATE_PREVIOUS: ::std::os::raw::c_uint = 260; -pub const AKEYCODE_NAVIGATE_NEXT: ::std::os::raw::c_uint = 261; -pub const AKEYCODE_NAVIGATE_IN: ::std::os::raw::c_uint = 262; -pub const AKEYCODE_NAVIGATE_OUT: ::std::os::raw::c_uint = 263; -pub const AKEYCODE_STEM_PRIMARY: ::std::os::raw::c_uint = 264; -pub const AKEYCODE_STEM_1: ::std::os::raw::c_uint = 265; -pub const AKEYCODE_STEM_2: ::std::os::raw::c_uint = 266; -pub const AKEYCODE_STEM_3: ::std::os::raw::c_uint = 267; -pub const AKEYCODE_DPAD_UP_LEFT: ::std::os::raw::c_uint = 268; -pub const AKEYCODE_DPAD_DOWN_LEFT: ::std::os::raw::c_uint = 269; -pub const AKEYCODE_DPAD_UP_RIGHT: ::std::os::raw::c_uint = 270; -pub const AKEYCODE_DPAD_DOWN_RIGHT: ::std::os::raw::c_uint = 271; -pub const AKEYCODE_MEDIA_SKIP_FORWARD: ::std::os::raw::c_uint = 272; -pub const AKEYCODE_MEDIA_SKIP_BACKWARD: ::std::os::raw::c_uint = 273; -pub const AKEYCODE_MEDIA_STEP_FORWARD: ::std::os::raw::c_uint = 274; -pub const AKEYCODE_MEDIA_STEP_BACKWARD: ::std::os::raw::c_uint = 275; -pub const AKEYCODE_SOFT_SLEEP: ::std::os::raw::c_uint = 276; -pub const AKEYCODE_CUT: ::std::os::raw::c_uint = 277; -pub const AKEYCODE_COPY: ::std::os::raw::c_uint = 278; -pub const AKEYCODE_PASTE: ::std::os::raw::c_uint = 279; -pub const AKEYCODE_SYSTEM_NAVIGATION_UP: ::std::os::raw::c_uint = 280; -pub const AKEYCODE_SYSTEM_NAVIGATION_DOWN: ::std::os::raw::c_uint = 281; -pub const AKEYCODE_SYSTEM_NAVIGATION_LEFT: ::std::os::raw::c_uint = 282; -pub const AKEYCODE_SYSTEM_NAVIGATION_RIGHT: ::std::os::raw::c_uint = 283; -pub const AKEYCODE_ALL_APPS: ::std::os::raw::c_uint = 284; -pub const AKEYCODE_REFRESH: ::std::os::raw::c_uint = 285; -pub const AKEYCODE_THUMBS_UP: ::std::os::raw::c_uint = 286; -pub const AKEYCODE_THUMBS_DOWN: ::std::os::raw::c_uint = 287; -pub const AKEYCODE_PROFILE_SWITCH: ::std::os::raw::c_uint = 288; +pub const AKEYCODE_UNKNOWN: _bindgen_ty_2 = 0; +pub const AKEYCODE_SOFT_LEFT: _bindgen_ty_2 = 1; +pub const AKEYCODE_SOFT_RIGHT: _bindgen_ty_2 = 2; +pub const AKEYCODE_HOME: _bindgen_ty_2 = 3; +pub const AKEYCODE_BACK: _bindgen_ty_2 = 4; +pub const AKEYCODE_CALL: _bindgen_ty_2 = 5; +pub const AKEYCODE_ENDCALL: _bindgen_ty_2 = 6; +pub const AKEYCODE_0: _bindgen_ty_2 = 7; +pub const AKEYCODE_1: _bindgen_ty_2 = 8; +pub const AKEYCODE_2: _bindgen_ty_2 = 9; +pub const AKEYCODE_3: _bindgen_ty_2 = 10; +pub const AKEYCODE_4: _bindgen_ty_2 = 11; +pub const AKEYCODE_5: _bindgen_ty_2 = 12; +pub const AKEYCODE_6: _bindgen_ty_2 = 13; +pub const AKEYCODE_7: _bindgen_ty_2 = 14; +pub const AKEYCODE_8: _bindgen_ty_2 = 15; +pub const AKEYCODE_9: _bindgen_ty_2 = 16; +pub const AKEYCODE_STAR: _bindgen_ty_2 = 17; +pub const AKEYCODE_POUND: _bindgen_ty_2 = 18; +pub const AKEYCODE_DPAD_UP: _bindgen_ty_2 = 19; +pub const AKEYCODE_DPAD_DOWN: _bindgen_ty_2 = 20; +pub const AKEYCODE_DPAD_LEFT: _bindgen_ty_2 = 21; +pub const AKEYCODE_DPAD_RIGHT: _bindgen_ty_2 = 22; +pub const AKEYCODE_DPAD_CENTER: _bindgen_ty_2 = 23; +pub const AKEYCODE_VOLUME_UP: _bindgen_ty_2 = 24; +pub const AKEYCODE_VOLUME_DOWN: _bindgen_ty_2 = 25; +pub const AKEYCODE_POWER: _bindgen_ty_2 = 26; +pub const AKEYCODE_CAMERA: _bindgen_ty_2 = 27; +pub const AKEYCODE_CLEAR: _bindgen_ty_2 = 28; +pub const AKEYCODE_A: _bindgen_ty_2 = 29; +pub const AKEYCODE_B: _bindgen_ty_2 = 30; +pub const AKEYCODE_C: _bindgen_ty_2 = 31; +pub const AKEYCODE_D: _bindgen_ty_2 = 32; +pub const AKEYCODE_E: _bindgen_ty_2 = 33; +pub const AKEYCODE_F: _bindgen_ty_2 = 34; +pub const AKEYCODE_G: _bindgen_ty_2 = 35; +pub const AKEYCODE_H: _bindgen_ty_2 = 36; +pub const AKEYCODE_I: _bindgen_ty_2 = 37; +pub const AKEYCODE_J: _bindgen_ty_2 = 38; +pub const AKEYCODE_K: _bindgen_ty_2 = 39; +pub const AKEYCODE_L: _bindgen_ty_2 = 40; +pub const AKEYCODE_M: _bindgen_ty_2 = 41; +pub const AKEYCODE_N: _bindgen_ty_2 = 42; +pub const AKEYCODE_O: _bindgen_ty_2 = 43; +pub const AKEYCODE_P: _bindgen_ty_2 = 44; +pub const AKEYCODE_Q: _bindgen_ty_2 = 45; +pub const AKEYCODE_R: _bindgen_ty_2 = 46; +pub const AKEYCODE_S: _bindgen_ty_2 = 47; +pub const AKEYCODE_T: _bindgen_ty_2 = 48; +pub const AKEYCODE_U: _bindgen_ty_2 = 49; +pub const AKEYCODE_V: _bindgen_ty_2 = 50; +pub const AKEYCODE_W: _bindgen_ty_2 = 51; +pub const AKEYCODE_X: _bindgen_ty_2 = 52; +pub const AKEYCODE_Y: _bindgen_ty_2 = 53; +pub const AKEYCODE_Z: _bindgen_ty_2 = 54; +pub const AKEYCODE_COMMA: _bindgen_ty_2 = 55; +pub const AKEYCODE_PERIOD: _bindgen_ty_2 = 56; +pub const AKEYCODE_ALT_LEFT: _bindgen_ty_2 = 57; +pub const AKEYCODE_ALT_RIGHT: _bindgen_ty_2 = 58; +pub const AKEYCODE_SHIFT_LEFT: _bindgen_ty_2 = 59; +pub const AKEYCODE_SHIFT_RIGHT: _bindgen_ty_2 = 60; +pub const AKEYCODE_TAB: _bindgen_ty_2 = 61; +pub const AKEYCODE_SPACE: _bindgen_ty_2 = 62; +pub const AKEYCODE_SYM: _bindgen_ty_2 = 63; +pub const AKEYCODE_EXPLORER: _bindgen_ty_2 = 64; +pub const AKEYCODE_ENVELOPE: _bindgen_ty_2 = 65; +pub const AKEYCODE_ENTER: _bindgen_ty_2 = 66; +pub const AKEYCODE_DEL: _bindgen_ty_2 = 67; +pub const AKEYCODE_GRAVE: _bindgen_ty_2 = 68; +pub const AKEYCODE_MINUS: _bindgen_ty_2 = 69; +pub const AKEYCODE_EQUALS: _bindgen_ty_2 = 70; +pub const AKEYCODE_LEFT_BRACKET: _bindgen_ty_2 = 71; +pub const AKEYCODE_RIGHT_BRACKET: _bindgen_ty_2 = 72; +pub const AKEYCODE_BACKSLASH: _bindgen_ty_2 = 73; +pub const AKEYCODE_SEMICOLON: _bindgen_ty_2 = 74; +pub const AKEYCODE_APOSTROPHE: _bindgen_ty_2 = 75; +pub const AKEYCODE_SLASH: _bindgen_ty_2 = 76; +pub const AKEYCODE_AT: _bindgen_ty_2 = 77; +pub const AKEYCODE_NUM: _bindgen_ty_2 = 78; +pub const AKEYCODE_HEADSETHOOK: _bindgen_ty_2 = 79; +pub const AKEYCODE_FOCUS: _bindgen_ty_2 = 80; +pub const AKEYCODE_PLUS: _bindgen_ty_2 = 81; +pub const AKEYCODE_MENU: _bindgen_ty_2 = 82; +pub const AKEYCODE_NOTIFICATION: _bindgen_ty_2 = 83; +pub const AKEYCODE_SEARCH: _bindgen_ty_2 = 84; +pub const AKEYCODE_MEDIA_PLAY_PAUSE: _bindgen_ty_2 = 85; +pub const AKEYCODE_MEDIA_STOP: _bindgen_ty_2 = 86; +pub const AKEYCODE_MEDIA_NEXT: _bindgen_ty_2 = 87; +pub const AKEYCODE_MEDIA_PREVIOUS: _bindgen_ty_2 = 88; +pub const AKEYCODE_MEDIA_REWIND: _bindgen_ty_2 = 89; +pub const AKEYCODE_MEDIA_FAST_FORWARD: _bindgen_ty_2 = 90; +pub const AKEYCODE_MUTE: _bindgen_ty_2 = 91; +pub const AKEYCODE_PAGE_UP: _bindgen_ty_2 = 92; +pub const AKEYCODE_PAGE_DOWN: _bindgen_ty_2 = 93; +pub const AKEYCODE_PICTSYMBOLS: _bindgen_ty_2 = 94; +pub const AKEYCODE_SWITCH_CHARSET: _bindgen_ty_2 = 95; +pub const AKEYCODE_BUTTON_A: _bindgen_ty_2 = 96; +pub const AKEYCODE_BUTTON_B: _bindgen_ty_2 = 97; +pub const AKEYCODE_BUTTON_C: _bindgen_ty_2 = 98; +pub const AKEYCODE_BUTTON_X: _bindgen_ty_2 = 99; +pub const AKEYCODE_BUTTON_Y: _bindgen_ty_2 = 100; +pub const AKEYCODE_BUTTON_Z: _bindgen_ty_2 = 101; +pub const AKEYCODE_BUTTON_L1: _bindgen_ty_2 = 102; +pub const AKEYCODE_BUTTON_R1: _bindgen_ty_2 = 103; +pub const AKEYCODE_BUTTON_L2: _bindgen_ty_2 = 104; +pub const AKEYCODE_BUTTON_R2: _bindgen_ty_2 = 105; +pub const AKEYCODE_BUTTON_THUMBL: _bindgen_ty_2 = 106; +pub const AKEYCODE_BUTTON_THUMBR: _bindgen_ty_2 = 107; +pub const AKEYCODE_BUTTON_START: _bindgen_ty_2 = 108; +pub const AKEYCODE_BUTTON_SELECT: _bindgen_ty_2 = 109; +pub const AKEYCODE_BUTTON_MODE: _bindgen_ty_2 = 110; +pub const AKEYCODE_ESCAPE: _bindgen_ty_2 = 111; +pub const AKEYCODE_FORWARD_DEL: _bindgen_ty_2 = 112; +pub const AKEYCODE_CTRL_LEFT: _bindgen_ty_2 = 113; +pub const AKEYCODE_CTRL_RIGHT: _bindgen_ty_2 = 114; +pub const AKEYCODE_CAPS_LOCK: _bindgen_ty_2 = 115; +pub const AKEYCODE_SCROLL_LOCK: _bindgen_ty_2 = 116; +pub const AKEYCODE_META_LEFT: _bindgen_ty_2 = 117; +pub const AKEYCODE_META_RIGHT: _bindgen_ty_2 = 118; +pub const AKEYCODE_FUNCTION: _bindgen_ty_2 = 119; +pub const AKEYCODE_SYSRQ: _bindgen_ty_2 = 120; +pub const AKEYCODE_BREAK: _bindgen_ty_2 = 121; +pub const AKEYCODE_MOVE_HOME: _bindgen_ty_2 = 122; +pub const AKEYCODE_MOVE_END: _bindgen_ty_2 = 123; +pub const AKEYCODE_INSERT: _bindgen_ty_2 = 124; +pub const AKEYCODE_FORWARD: _bindgen_ty_2 = 125; +pub const AKEYCODE_MEDIA_PLAY: _bindgen_ty_2 = 126; +pub const AKEYCODE_MEDIA_PAUSE: _bindgen_ty_2 = 127; +pub const AKEYCODE_MEDIA_CLOSE: _bindgen_ty_2 = 128; +pub const AKEYCODE_MEDIA_EJECT: _bindgen_ty_2 = 129; +pub const AKEYCODE_MEDIA_RECORD: _bindgen_ty_2 = 130; +pub const AKEYCODE_F1: _bindgen_ty_2 = 131; +pub const AKEYCODE_F2: _bindgen_ty_2 = 132; +pub const AKEYCODE_F3: _bindgen_ty_2 = 133; +pub const AKEYCODE_F4: _bindgen_ty_2 = 134; +pub const AKEYCODE_F5: _bindgen_ty_2 = 135; +pub const AKEYCODE_F6: _bindgen_ty_2 = 136; +pub const AKEYCODE_F7: _bindgen_ty_2 = 137; +pub const AKEYCODE_F8: _bindgen_ty_2 = 138; +pub const AKEYCODE_F9: _bindgen_ty_2 = 139; +pub const AKEYCODE_F10: _bindgen_ty_2 = 140; +pub const AKEYCODE_F11: _bindgen_ty_2 = 141; +pub const AKEYCODE_F12: _bindgen_ty_2 = 142; +pub const AKEYCODE_NUM_LOCK: _bindgen_ty_2 = 143; +pub const AKEYCODE_NUMPAD_0: _bindgen_ty_2 = 144; +pub const AKEYCODE_NUMPAD_1: _bindgen_ty_2 = 145; +pub const AKEYCODE_NUMPAD_2: _bindgen_ty_2 = 146; +pub const AKEYCODE_NUMPAD_3: _bindgen_ty_2 = 147; +pub const AKEYCODE_NUMPAD_4: _bindgen_ty_2 = 148; +pub const AKEYCODE_NUMPAD_5: _bindgen_ty_2 = 149; +pub const AKEYCODE_NUMPAD_6: _bindgen_ty_2 = 150; +pub const AKEYCODE_NUMPAD_7: _bindgen_ty_2 = 151; +pub const AKEYCODE_NUMPAD_8: _bindgen_ty_2 = 152; +pub const AKEYCODE_NUMPAD_9: _bindgen_ty_2 = 153; +pub const AKEYCODE_NUMPAD_DIVIDE: _bindgen_ty_2 = 154; +pub const AKEYCODE_NUMPAD_MULTIPLY: _bindgen_ty_2 = 155; +pub const AKEYCODE_NUMPAD_SUBTRACT: _bindgen_ty_2 = 156; +pub const AKEYCODE_NUMPAD_ADD: _bindgen_ty_2 = 157; +pub const AKEYCODE_NUMPAD_DOT: _bindgen_ty_2 = 158; +pub const AKEYCODE_NUMPAD_COMMA: _bindgen_ty_2 = 159; +pub const AKEYCODE_NUMPAD_ENTER: _bindgen_ty_2 = 160; +pub const AKEYCODE_NUMPAD_EQUALS: _bindgen_ty_2 = 161; +pub const AKEYCODE_NUMPAD_LEFT_PAREN: _bindgen_ty_2 = 162; +pub const AKEYCODE_NUMPAD_RIGHT_PAREN: _bindgen_ty_2 = 163; +pub const AKEYCODE_VOLUME_MUTE: _bindgen_ty_2 = 164; +pub const AKEYCODE_INFO: _bindgen_ty_2 = 165; +pub const AKEYCODE_CHANNEL_UP: _bindgen_ty_2 = 166; +pub const AKEYCODE_CHANNEL_DOWN: _bindgen_ty_2 = 167; +pub const AKEYCODE_ZOOM_IN: _bindgen_ty_2 = 168; +pub const AKEYCODE_ZOOM_OUT: _bindgen_ty_2 = 169; +pub const AKEYCODE_TV: _bindgen_ty_2 = 170; +pub const AKEYCODE_WINDOW: _bindgen_ty_2 = 171; +pub const AKEYCODE_GUIDE: _bindgen_ty_2 = 172; +pub const AKEYCODE_DVR: _bindgen_ty_2 = 173; +pub const AKEYCODE_BOOKMARK: _bindgen_ty_2 = 174; +pub const AKEYCODE_CAPTIONS: _bindgen_ty_2 = 175; +pub const AKEYCODE_SETTINGS: _bindgen_ty_2 = 176; +pub const AKEYCODE_TV_POWER: _bindgen_ty_2 = 177; +pub const AKEYCODE_TV_INPUT: _bindgen_ty_2 = 178; +pub const AKEYCODE_STB_POWER: _bindgen_ty_2 = 179; +pub const AKEYCODE_STB_INPUT: _bindgen_ty_2 = 180; +pub const AKEYCODE_AVR_POWER: _bindgen_ty_2 = 181; +pub const AKEYCODE_AVR_INPUT: _bindgen_ty_2 = 182; +pub const AKEYCODE_PROG_RED: _bindgen_ty_2 = 183; +pub const AKEYCODE_PROG_GREEN: _bindgen_ty_2 = 184; +pub const AKEYCODE_PROG_YELLOW: _bindgen_ty_2 = 185; +pub const AKEYCODE_PROG_BLUE: _bindgen_ty_2 = 186; +pub const AKEYCODE_APP_SWITCH: _bindgen_ty_2 = 187; +pub const AKEYCODE_BUTTON_1: _bindgen_ty_2 = 188; +pub const AKEYCODE_BUTTON_2: _bindgen_ty_2 = 189; +pub const AKEYCODE_BUTTON_3: _bindgen_ty_2 = 190; +pub const AKEYCODE_BUTTON_4: _bindgen_ty_2 = 191; +pub const AKEYCODE_BUTTON_5: _bindgen_ty_2 = 192; +pub const AKEYCODE_BUTTON_6: _bindgen_ty_2 = 193; +pub const AKEYCODE_BUTTON_7: _bindgen_ty_2 = 194; +pub const AKEYCODE_BUTTON_8: _bindgen_ty_2 = 195; +pub const AKEYCODE_BUTTON_9: _bindgen_ty_2 = 196; +pub const AKEYCODE_BUTTON_10: _bindgen_ty_2 = 197; +pub const AKEYCODE_BUTTON_11: _bindgen_ty_2 = 198; +pub const AKEYCODE_BUTTON_12: _bindgen_ty_2 = 199; +pub const AKEYCODE_BUTTON_13: _bindgen_ty_2 = 200; +pub const AKEYCODE_BUTTON_14: _bindgen_ty_2 = 201; +pub const AKEYCODE_BUTTON_15: _bindgen_ty_2 = 202; +pub const AKEYCODE_BUTTON_16: _bindgen_ty_2 = 203; +pub const AKEYCODE_LANGUAGE_SWITCH: _bindgen_ty_2 = 204; +pub const AKEYCODE_MANNER_MODE: _bindgen_ty_2 = 205; +pub const AKEYCODE_3D_MODE: _bindgen_ty_2 = 206; +pub const AKEYCODE_CONTACTS: _bindgen_ty_2 = 207; +pub const AKEYCODE_CALENDAR: _bindgen_ty_2 = 208; +pub const AKEYCODE_MUSIC: _bindgen_ty_2 = 209; +pub const AKEYCODE_CALCULATOR: _bindgen_ty_2 = 210; +pub const AKEYCODE_ZENKAKU_HANKAKU: _bindgen_ty_2 = 211; +pub const AKEYCODE_EISU: _bindgen_ty_2 = 212; +pub const AKEYCODE_MUHENKAN: _bindgen_ty_2 = 213; +pub const AKEYCODE_HENKAN: _bindgen_ty_2 = 214; +pub const AKEYCODE_KATAKANA_HIRAGANA: _bindgen_ty_2 = 215; +pub const AKEYCODE_YEN: _bindgen_ty_2 = 216; +pub const AKEYCODE_RO: _bindgen_ty_2 = 217; +pub const AKEYCODE_KANA: _bindgen_ty_2 = 218; +pub const AKEYCODE_ASSIST: _bindgen_ty_2 = 219; +pub const AKEYCODE_BRIGHTNESS_DOWN: _bindgen_ty_2 = 220; +pub const AKEYCODE_BRIGHTNESS_UP: _bindgen_ty_2 = 221; +pub const AKEYCODE_MEDIA_AUDIO_TRACK: _bindgen_ty_2 = 222; +pub const AKEYCODE_SLEEP: _bindgen_ty_2 = 223; +pub const AKEYCODE_WAKEUP: _bindgen_ty_2 = 224; +pub const AKEYCODE_PAIRING: _bindgen_ty_2 = 225; +pub const AKEYCODE_MEDIA_TOP_MENU: _bindgen_ty_2 = 226; +pub const AKEYCODE_11: _bindgen_ty_2 = 227; +pub const AKEYCODE_12: _bindgen_ty_2 = 228; +pub const AKEYCODE_LAST_CHANNEL: _bindgen_ty_2 = 229; +pub const AKEYCODE_TV_DATA_SERVICE: _bindgen_ty_2 = 230; +pub const AKEYCODE_VOICE_ASSIST: _bindgen_ty_2 = 231; +pub const AKEYCODE_TV_RADIO_SERVICE: _bindgen_ty_2 = 232; +pub const AKEYCODE_TV_TELETEXT: _bindgen_ty_2 = 233; +pub const AKEYCODE_TV_NUMBER_ENTRY: _bindgen_ty_2 = 234; +pub const AKEYCODE_TV_TERRESTRIAL_ANALOG: _bindgen_ty_2 = 235; +pub const AKEYCODE_TV_TERRESTRIAL_DIGITAL: _bindgen_ty_2 = 236; +pub const AKEYCODE_TV_SATELLITE: _bindgen_ty_2 = 237; +pub const AKEYCODE_TV_SATELLITE_BS: _bindgen_ty_2 = 238; +pub const AKEYCODE_TV_SATELLITE_CS: _bindgen_ty_2 = 239; +pub const AKEYCODE_TV_SATELLITE_SERVICE: _bindgen_ty_2 = 240; +pub const AKEYCODE_TV_NETWORK: _bindgen_ty_2 = 241; +pub const AKEYCODE_TV_ANTENNA_CABLE: _bindgen_ty_2 = 242; +pub const AKEYCODE_TV_INPUT_HDMI_1: _bindgen_ty_2 = 243; +pub const AKEYCODE_TV_INPUT_HDMI_2: _bindgen_ty_2 = 244; +pub const AKEYCODE_TV_INPUT_HDMI_3: _bindgen_ty_2 = 245; +pub const AKEYCODE_TV_INPUT_HDMI_4: _bindgen_ty_2 = 246; +pub const AKEYCODE_TV_INPUT_COMPOSITE_1: _bindgen_ty_2 = 247; +pub const AKEYCODE_TV_INPUT_COMPOSITE_2: _bindgen_ty_2 = 248; +pub const AKEYCODE_TV_INPUT_COMPONENT_1: _bindgen_ty_2 = 249; +pub const AKEYCODE_TV_INPUT_COMPONENT_2: _bindgen_ty_2 = 250; +pub const AKEYCODE_TV_INPUT_VGA_1: _bindgen_ty_2 = 251; +pub const AKEYCODE_TV_AUDIO_DESCRIPTION: _bindgen_ty_2 = 252; +pub const AKEYCODE_TV_AUDIO_DESCRIPTION_MIX_UP: _bindgen_ty_2 = 253; +pub const AKEYCODE_TV_AUDIO_DESCRIPTION_MIX_DOWN: _bindgen_ty_2 = 254; +pub const AKEYCODE_TV_ZOOM_MODE: _bindgen_ty_2 = 255; +pub const AKEYCODE_TV_CONTENTS_MENU: _bindgen_ty_2 = 256; +pub const AKEYCODE_TV_MEDIA_CONTEXT_MENU: _bindgen_ty_2 = 257; +pub const AKEYCODE_TV_TIMER_PROGRAMMING: _bindgen_ty_2 = 258; +pub const AKEYCODE_HELP: _bindgen_ty_2 = 259; +pub const AKEYCODE_NAVIGATE_PREVIOUS: _bindgen_ty_2 = 260; +pub const AKEYCODE_NAVIGATE_NEXT: _bindgen_ty_2 = 261; +pub const AKEYCODE_NAVIGATE_IN: _bindgen_ty_2 = 262; +pub const AKEYCODE_NAVIGATE_OUT: _bindgen_ty_2 = 263; +pub const AKEYCODE_STEM_PRIMARY: _bindgen_ty_2 = 264; +pub const AKEYCODE_STEM_1: _bindgen_ty_2 = 265; +pub const AKEYCODE_STEM_2: _bindgen_ty_2 = 266; +pub const AKEYCODE_STEM_3: _bindgen_ty_2 = 267; +pub const AKEYCODE_DPAD_UP_LEFT: _bindgen_ty_2 = 268; +pub const AKEYCODE_DPAD_DOWN_LEFT: _bindgen_ty_2 = 269; +pub const AKEYCODE_DPAD_UP_RIGHT: _bindgen_ty_2 = 270; +pub const AKEYCODE_DPAD_DOWN_RIGHT: _bindgen_ty_2 = 271; +pub const AKEYCODE_MEDIA_SKIP_FORWARD: _bindgen_ty_2 = 272; +pub const AKEYCODE_MEDIA_SKIP_BACKWARD: _bindgen_ty_2 = 273; +pub const AKEYCODE_MEDIA_STEP_FORWARD: _bindgen_ty_2 = 274; +pub const AKEYCODE_MEDIA_STEP_BACKWARD: _bindgen_ty_2 = 275; +pub const AKEYCODE_SOFT_SLEEP: _bindgen_ty_2 = 276; +pub const AKEYCODE_CUT: _bindgen_ty_2 = 277; +pub const AKEYCODE_COPY: _bindgen_ty_2 = 278; +pub const AKEYCODE_PASTE: _bindgen_ty_2 = 279; +pub const AKEYCODE_SYSTEM_NAVIGATION_UP: _bindgen_ty_2 = 280; +pub const AKEYCODE_SYSTEM_NAVIGATION_DOWN: _bindgen_ty_2 = 281; +pub const AKEYCODE_SYSTEM_NAVIGATION_LEFT: _bindgen_ty_2 = 282; +pub const AKEYCODE_SYSTEM_NAVIGATION_RIGHT: _bindgen_ty_2 = 283; +pub const AKEYCODE_ALL_APPS: _bindgen_ty_2 = 284; +pub const AKEYCODE_REFRESH: _bindgen_ty_2 = 285; +pub const AKEYCODE_THUMBS_UP: _bindgen_ty_2 = 286; +pub const AKEYCODE_THUMBS_DOWN: _bindgen_ty_2 = 287; +pub const AKEYCODE_PROFILE_SWITCH: _bindgen_ty_2 = 288; pub type _bindgen_ty_2 = ::std::os::raw::c_uint; -pub const ALOOPER_PREPARE_ALLOW_NON_CALLBACKS: ::std::os::raw::c_uint = 1; +pub const ALOOPER_PREPARE_ALLOW_NON_CALLBACKS: _bindgen_ty_3 = 1; pub type _bindgen_ty_3 = ::std::os::raw::c_uint; -pub const ALOOPER_POLL_WAKE: ::std::os::raw::c_int = -1; -pub const ALOOPER_POLL_CALLBACK: ::std::os::raw::c_int = -2; -pub const ALOOPER_POLL_TIMEOUT: ::std::os::raw::c_int = -3; -pub const ALOOPER_POLL_ERROR: ::std::os::raw::c_int = -4; +pub const ALOOPER_POLL_WAKE: _bindgen_ty_4 = -1; +pub const ALOOPER_POLL_CALLBACK: _bindgen_ty_4 = -2; +pub const ALOOPER_POLL_TIMEOUT: _bindgen_ty_4 = -3; +pub const ALOOPER_POLL_ERROR: _bindgen_ty_4 = -4; pub type _bindgen_ty_4 = ::std::os::raw::c_int; -pub const ALOOPER_EVENT_INPUT: ::std::os::raw::c_uint = 1; -pub const ALOOPER_EVENT_OUTPUT: ::std::os::raw::c_uint = 2; -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 const ALOOPER_EVENT_INPUT: _bindgen_ty_5 = 1; +pub const ALOOPER_EVENT_OUTPUT: _bindgen_ty_5 = 2; +pub const ALOOPER_EVENT_ERROR: _bindgen_ty_5 = 4; +pub const ALOOPER_EVENT_HANGUP: _bindgen_ty_5 = 8; +pub const ALOOPER_EVENT_INVALID: _bindgen_ty_5 = 16; pub type _bindgen_ty_5 = ::std::os::raw::c_uint; -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; -pub const AKEY_STATE_VIRTUAL: ::std::os::raw::c_int = 2; +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() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + 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::addr_of!((*ptr).version) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(JavaVMAttachArgs), + "::", + stringify!(version) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(JavaVMAttachArgs), + "::", + stringify!(name) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).group) as usize - ptr 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() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + 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::addr_of!((*ptr).optionString) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(JavaVMOption), + "::", + stringify!(optionString) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).extraInfo) as usize - ptr 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() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + 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::addr_of!((*ptr).version) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(JavaVMInitArgs), + "::", + stringify!(version) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).nOptions) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(JavaVMInitArgs), + "::", + stringify!(nOptions) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).options) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(JavaVMInitArgs), + "::", + stringify!(options) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ignoreUnrecognized) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(JavaVMInitArgs), + "::", + stringify!(ignoreUnrecognized) + ) + ); +} +pub const AKEY_STATE_UNKNOWN: _bindgen_ty_6 = -1; +pub const AKEY_STATE_UP: _bindgen_ty_6 = 0; +pub const AKEY_STATE_DOWN: _bindgen_ty_6 = 1; +pub const AKEY_STATE_VIRTUAL: _bindgen_ty_6 = 2; pub type _bindgen_ty_6 = ::std::os::raw::c_int; -pub const AMETA_NONE: ::std::os::raw::c_uint = 0; -pub const AMETA_ALT_ON: ::std::os::raw::c_uint = 2; -pub const AMETA_ALT_LEFT_ON: ::std::os::raw::c_uint = 16; -pub const AMETA_ALT_RIGHT_ON: ::std::os::raw::c_uint = 32; -pub const AMETA_SHIFT_ON: ::std::os::raw::c_uint = 1; -pub const AMETA_SHIFT_LEFT_ON: ::std::os::raw::c_uint = 64; -pub const AMETA_SHIFT_RIGHT_ON: ::std::os::raw::c_uint = 128; -pub const AMETA_SYM_ON: ::std::os::raw::c_uint = 4; -pub const AMETA_FUNCTION_ON: ::std::os::raw::c_uint = 8; -pub const AMETA_CTRL_ON: ::std::os::raw::c_uint = 4096; -pub const AMETA_CTRL_LEFT_ON: ::std::os::raw::c_uint = 8192; -pub const AMETA_CTRL_RIGHT_ON: ::std::os::raw::c_uint = 16384; -pub const AMETA_META_ON: ::std::os::raw::c_uint = 65536; -pub const AMETA_META_LEFT_ON: ::std::os::raw::c_uint = 131072; -pub const AMETA_META_RIGHT_ON: ::std::os::raw::c_uint = 262144; -pub const AMETA_CAPS_LOCK_ON: ::std::os::raw::c_uint = 1048576; -pub const AMETA_NUM_LOCK_ON: ::std::os::raw::c_uint = 2097152; -pub const AMETA_SCROLL_LOCK_ON: ::std::os::raw::c_uint = 4194304; +pub const AMETA_NONE: _bindgen_ty_7 = 0; +pub const AMETA_ALT_ON: _bindgen_ty_7 = 2; +pub const AMETA_ALT_LEFT_ON: _bindgen_ty_7 = 16; +pub const AMETA_ALT_RIGHT_ON: _bindgen_ty_7 = 32; +pub const AMETA_SHIFT_ON: _bindgen_ty_7 = 1; +pub const AMETA_SHIFT_LEFT_ON: _bindgen_ty_7 = 64; +pub const AMETA_SHIFT_RIGHT_ON: _bindgen_ty_7 = 128; +pub const AMETA_SYM_ON: _bindgen_ty_7 = 4; +pub const AMETA_FUNCTION_ON: _bindgen_ty_7 = 8; +pub const AMETA_CTRL_ON: _bindgen_ty_7 = 4096; +pub const AMETA_CTRL_LEFT_ON: _bindgen_ty_7 = 8192; +pub const AMETA_CTRL_RIGHT_ON: _bindgen_ty_7 = 16384; +pub const AMETA_META_ON: _bindgen_ty_7 = 65536; +pub const AMETA_META_LEFT_ON: _bindgen_ty_7 = 131072; +pub const AMETA_META_RIGHT_ON: _bindgen_ty_7 = 262144; +pub const AMETA_CAPS_LOCK_ON: _bindgen_ty_7 = 1048576; +pub const AMETA_NUM_LOCK_ON: _bindgen_ty_7 = 2097152; +pub const AMETA_SCROLL_LOCK_ON: _bindgen_ty_7 = 4194304; pub type _bindgen_ty_7 = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct AInputEvent { _unused: [u8; 0], } -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_KEY: _bindgen_ty_8 = 1; +pub const AINPUT_EVENT_TYPE_MOTION: _bindgen_ty_8 = 2; +pub const AINPUT_EVENT_TYPE_FOCUS: _bindgen_ty_8 = 3; +pub const AINPUT_EVENT_TYPE_CAPTURE: _bindgen_ty_8 = 4; +pub const AINPUT_EVENT_TYPE_DRAG: _bindgen_ty_8 = 5; +pub const AINPUT_EVENT_TYPE_TOUCH_MODE: _bindgen_ty_8 = 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; -pub const AKEY_EVENT_ACTION_MULTIPLE: ::std::os::raw::c_uint = 2; +pub const AKEY_EVENT_ACTION_DOWN: _bindgen_ty_9 = 0; +pub const AKEY_EVENT_ACTION_UP: _bindgen_ty_9 = 1; +pub const AKEY_EVENT_ACTION_MULTIPLE: _bindgen_ty_9 = 2; pub type _bindgen_ty_9 = ::std::os::raw::c_uint; -pub const AKEY_EVENT_FLAG_WOKE_HERE: ::std::os::raw::c_uint = 1; -pub const AKEY_EVENT_FLAG_SOFT_KEYBOARD: ::std::os::raw::c_uint = 2; -pub const AKEY_EVENT_FLAG_KEEP_TOUCH_MODE: ::std::os::raw::c_uint = 4; -pub const AKEY_EVENT_FLAG_FROM_SYSTEM: ::std::os::raw::c_uint = 8; -pub const AKEY_EVENT_FLAG_EDITOR_ACTION: ::std::os::raw::c_uint = 16; -pub const AKEY_EVENT_FLAG_CANCELED: ::std::os::raw::c_uint = 32; -pub const AKEY_EVENT_FLAG_VIRTUAL_HARD_KEY: ::std::os::raw::c_uint = 64; -pub const AKEY_EVENT_FLAG_LONG_PRESS: ::std::os::raw::c_uint = 128; -pub const AKEY_EVENT_FLAG_CANCELED_LONG_PRESS: ::std::os::raw::c_uint = 256; -pub const AKEY_EVENT_FLAG_TRACKING: ::std::os::raw::c_uint = 512; -pub const AKEY_EVENT_FLAG_FALLBACK: ::std::os::raw::c_uint = 1024; +pub const AKEY_EVENT_FLAG_WOKE_HERE: _bindgen_ty_10 = 1; +pub const AKEY_EVENT_FLAG_SOFT_KEYBOARD: _bindgen_ty_10 = 2; +pub const AKEY_EVENT_FLAG_KEEP_TOUCH_MODE: _bindgen_ty_10 = 4; +pub const AKEY_EVENT_FLAG_FROM_SYSTEM: _bindgen_ty_10 = 8; +pub const AKEY_EVENT_FLAG_EDITOR_ACTION: _bindgen_ty_10 = 16; +pub const AKEY_EVENT_FLAG_CANCELED: _bindgen_ty_10 = 32; +pub const AKEY_EVENT_FLAG_VIRTUAL_HARD_KEY: _bindgen_ty_10 = 64; +pub const AKEY_EVENT_FLAG_LONG_PRESS: _bindgen_ty_10 = 128; +pub const AKEY_EVENT_FLAG_CANCELED_LONG_PRESS: _bindgen_ty_10 = 256; +pub const AKEY_EVENT_FLAG_TRACKING: _bindgen_ty_10 = 512; +pub const AKEY_EVENT_FLAG_FALLBACK: _bindgen_ty_10 = 1024; pub type _bindgen_ty_10 = ::std::os::raw::c_uint; -pub const AMOTION_EVENT_ACTION_MASK: ::std::os::raw::c_uint = 255; -pub const AMOTION_EVENT_ACTION_POINTER_INDEX_MASK: ::std::os::raw::c_uint = 65280; -pub const AMOTION_EVENT_ACTION_DOWN: ::std::os::raw::c_uint = 0; -pub const AMOTION_EVENT_ACTION_UP: ::std::os::raw::c_uint = 1; -pub const AMOTION_EVENT_ACTION_MOVE: ::std::os::raw::c_uint = 2; -pub const AMOTION_EVENT_ACTION_CANCEL: ::std::os::raw::c_uint = 3; -pub const AMOTION_EVENT_ACTION_OUTSIDE: ::std::os::raw::c_uint = 4; -pub const AMOTION_EVENT_ACTION_POINTER_DOWN: ::std::os::raw::c_uint = 5; -pub const AMOTION_EVENT_ACTION_POINTER_UP: ::std::os::raw::c_uint = 6; -pub const AMOTION_EVENT_ACTION_HOVER_MOVE: ::std::os::raw::c_uint = 7; -pub const AMOTION_EVENT_ACTION_SCROLL: ::std::os::raw::c_uint = 8; -pub const AMOTION_EVENT_ACTION_HOVER_ENTER: ::std::os::raw::c_uint = 9; -pub const AMOTION_EVENT_ACTION_HOVER_EXIT: ::std::os::raw::c_uint = 10; -pub const AMOTION_EVENT_ACTION_BUTTON_PRESS: ::std::os::raw::c_uint = 11; -pub const AMOTION_EVENT_ACTION_BUTTON_RELEASE: ::std::os::raw::c_uint = 12; +pub const AMOTION_EVENT_ACTION_MASK: _bindgen_ty_11 = 255; +pub const AMOTION_EVENT_ACTION_POINTER_INDEX_MASK: _bindgen_ty_11 = 65280; +pub const AMOTION_EVENT_ACTION_DOWN: _bindgen_ty_11 = 0; +pub const AMOTION_EVENT_ACTION_UP: _bindgen_ty_11 = 1; +pub const AMOTION_EVENT_ACTION_MOVE: _bindgen_ty_11 = 2; +pub const AMOTION_EVENT_ACTION_CANCEL: _bindgen_ty_11 = 3; +pub const AMOTION_EVENT_ACTION_OUTSIDE: _bindgen_ty_11 = 4; +pub const AMOTION_EVENT_ACTION_POINTER_DOWN: _bindgen_ty_11 = 5; +pub const AMOTION_EVENT_ACTION_POINTER_UP: _bindgen_ty_11 = 6; +pub const AMOTION_EVENT_ACTION_HOVER_MOVE: _bindgen_ty_11 = 7; +pub const AMOTION_EVENT_ACTION_SCROLL: _bindgen_ty_11 = 8; +pub const AMOTION_EVENT_ACTION_HOVER_ENTER: _bindgen_ty_11 = 9; +pub const AMOTION_EVENT_ACTION_HOVER_EXIT: _bindgen_ty_11 = 10; +pub const AMOTION_EVENT_ACTION_BUTTON_PRESS: _bindgen_ty_11 = 11; +pub const AMOTION_EVENT_ACTION_BUTTON_RELEASE: _bindgen_ty_11 = 12; pub type _bindgen_ty_11 = ::std::os::raw::c_uint; -pub const AMOTION_EVENT_FLAG_WINDOW_IS_OBSCURED: ::std::os::raw::c_uint = 1; +pub const AMOTION_EVENT_FLAG_WINDOW_IS_OBSCURED: _bindgen_ty_12 = 1; pub type _bindgen_ty_12 = ::std::os::raw::c_uint; -pub const AMOTION_EVENT_EDGE_FLAG_NONE: ::std::os::raw::c_uint = 0; -pub const AMOTION_EVENT_EDGE_FLAG_TOP: ::std::os::raw::c_uint = 1; -pub const AMOTION_EVENT_EDGE_FLAG_BOTTOM: ::std::os::raw::c_uint = 2; -pub const AMOTION_EVENT_EDGE_FLAG_LEFT: ::std::os::raw::c_uint = 4; -pub const AMOTION_EVENT_EDGE_FLAG_RIGHT: ::std::os::raw::c_uint = 8; +pub const AMOTION_EVENT_EDGE_FLAG_NONE: _bindgen_ty_13 = 0; +pub const AMOTION_EVENT_EDGE_FLAG_TOP: _bindgen_ty_13 = 1; +pub const AMOTION_EVENT_EDGE_FLAG_BOTTOM: _bindgen_ty_13 = 2; +pub const AMOTION_EVENT_EDGE_FLAG_LEFT: _bindgen_ty_13 = 4; +pub const AMOTION_EVENT_EDGE_FLAG_RIGHT: _bindgen_ty_13 = 8; pub type _bindgen_ty_13 = ::std::os::raw::c_uint; -pub const AMOTION_EVENT_AXIS_X: ::std::os::raw::c_uint = 0; -pub const AMOTION_EVENT_AXIS_Y: ::std::os::raw::c_uint = 1; -pub const AMOTION_EVENT_AXIS_PRESSURE: ::std::os::raw::c_uint = 2; -pub const AMOTION_EVENT_AXIS_SIZE: ::std::os::raw::c_uint = 3; -pub const AMOTION_EVENT_AXIS_TOUCH_MAJOR: ::std::os::raw::c_uint = 4; -pub const AMOTION_EVENT_AXIS_TOUCH_MINOR: ::std::os::raw::c_uint = 5; -pub const AMOTION_EVENT_AXIS_TOOL_MAJOR: ::std::os::raw::c_uint = 6; -pub const AMOTION_EVENT_AXIS_TOOL_MINOR: ::std::os::raw::c_uint = 7; -pub const AMOTION_EVENT_AXIS_ORIENTATION: ::std::os::raw::c_uint = 8; -pub const AMOTION_EVENT_AXIS_VSCROLL: ::std::os::raw::c_uint = 9; -pub const AMOTION_EVENT_AXIS_HSCROLL: ::std::os::raw::c_uint = 10; -pub const AMOTION_EVENT_AXIS_Z: ::std::os::raw::c_uint = 11; -pub const AMOTION_EVENT_AXIS_RX: ::std::os::raw::c_uint = 12; -pub const AMOTION_EVENT_AXIS_RY: ::std::os::raw::c_uint = 13; -pub const AMOTION_EVENT_AXIS_RZ: ::std::os::raw::c_uint = 14; -pub const AMOTION_EVENT_AXIS_HAT_X: ::std::os::raw::c_uint = 15; -pub const AMOTION_EVENT_AXIS_HAT_Y: ::std::os::raw::c_uint = 16; -pub const AMOTION_EVENT_AXIS_LTRIGGER: ::std::os::raw::c_uint = 17; -pub const AMOTION_EVENT_AXIS_RTRIGGER: ::std::os::raw::c_uint = 18; -pub const AMOTION_EVENT_AXIS_THROTTLE: ::std::os::raw::c_uint = 19; -pub const AMOTION_EVENT_AXIS_RUDDER: ::std::os::raw::c_uint = 20; -pub const AMOTION_EVENT_AXIS_WHEEL: ::std::os::raw::c_uint = 21; -pub const AMOTION_EVENT_AXIS_GAS: ::std::os::raw::c_uint = 22; -pub const AMOTION_EVENT_AXIS_BRAKE: ::std::os::raw::c_uint = 23; -pub const AMOTION_EVENT_AXIS_DISTANCE: ::std::os::raw::c_uint = 24; -pub const AMOTION_EVENT_AXIS_TILT: ::std::os::raw::c_uint = 25; -pub const AMOTION_EVENT_AXIS_SCROLL: ::std::os::raw::c_uint = 26; -pub const AMOTION_EVENT_AXIS_RELATIVE_X: ::std::os::raw::c_uint = 27; -pub const AMOTION_EVENT_AXIS_RELATIVE_Y: ::std::os::raw::c_uint = 28; -pub const AMOTION_EVENT_AXIS_GENERIC_1: ::std::os::raw::c_uint = 32; -pub const AMOTION_EVENT_AXIS_GENERIC_2: ::std::os::raw::c_uint = 33; -pub const AMOTION_EVENT_AXIS_GENERIC_3: ::std::os::raw::c_uint = 34; -pub const AMOTION_EVENT_AXIS_GENERIC_4: ::std::os::raw::c_uint = 35; -pub const AMOTION_EVENT_AXIS_GENERIC_5: ::std::os::raw::c_uint = 36; -pub const AMOTION_EVENT_AXIS_GENERIC_6: ::std::os::raw::c_uint = 37; -pub const AMOTION_EVENT_AXIS_GENERIC_7: ::std::os::raw::c_uint = 38; -pub const AMOTION_EVENT_AXIS_GENERIC_8: ::std::os::raw::c_uint = 39; -pub const AMOTION_EVENT_AXIS_GENERIC_9: ::std::os::raw::c_uint = 40; -pub const AMOTION_EVENT_AXIS_GENERIC_10: ::std::os::raw::c_uint = 41; -pub const AMOTION_EVENT_AXIS_GENERIC_11: ::std::os::raw::c_uint = 42; -pub const AMOTION_EVENT_AXIS_GENERIC_12: ::std::os::raw::c_uint = 43; -pub const AMOTION_EVENT_AXIS_GENERIC_13: ::std::os::raw::c_uint = 44; -pub const AMOTION_EVENT_AXIS_GENERIC_14: ::std::os::raw::c_uint = 45; -pub const AMOTION_EVENT_AXIS_GENERIC_15: ::std::os::raw::c_uint = 46; -pub const AMOTION_EVENT_AXIS_GENERIC_16: ::std::os::raw::c_uint = 47; +pub const AMOTION_EVENT_AXIS_X: _bindgen_ty_14 = 0; +pub const AMOTION_EVENT_AXIS_Y: _bindgen_ty_14 = 1; +pub const AMOTION_EVENT_AXIS_PRESSURE: _bindgen_ty_14 = 2; +pub const AMOTION_EVENT_AXIS_SIZE: _bindgen_ty_14 = 3; +pub const AMOTION_EVENT_AXIS_TOUCH_MAJOR: _bindgen_ty_14 = 4; +pub const AMOTION_EVENT_AXIS_TOUCH_MINOR: _bindgen_ty_14 = 5; +pub const AMOTION_EVENT_AXIS_TOOL_MAJOR: _bindgen_ty_14 = 6; +pub const AMOTION_EVENT_AXIS_TOOL_MINOR: _bindgen_ty_14 = 7; +pub const AMOTION_EVENT_AXIS_ORIENTATION: _bindgen_ty_14 = 8; +pub const AMOTION_EVENT_AXIS_VSCROLL: _bindgen_ty_14 = 9; +pub const AMOTION_EVENT_AXIS_HSCROLL: _bindgen_ty_14 = 10; +pub const AMOTION_EVENT_AXIS_Z: _bindgen_ty_14 = 11; +pub const AMOTION_EVENT_AXIS_RX: _bindgen_ty_14 = 12; +pub const AMOTION_EVENT_AXIS_RY: _bindgen_ty_14 = 13; +pub const AMOTION_EVENT_AXIS_RZ: _bindgen_ty_14 = 14; +pub const AMOTION_EVENT_AXIS_HAT_X: _bindgen_ty_14 = 15; +pub const AMOTION_EVENT_AXIS_HAT_Y: _bindgen_ty_14 = 16; +pub const AMOTION_EVENT_AXIS_LTRIGGER: _bindgen_ty_14 = 17; +pub const AMOTION_EVENT_AXIS_RTRIGGER: _bindgen_ty_14 = 18; +pub const AMOTION_EVENT_AXIS_THROTTLE: _bindgen_ty_14 = 19; +pub const AMOTION_EVENT_AXIS_RUDDER: _bindgen_ty_14 = 20; +pub const AMOTION_EVENT_AXIS_WHEEL: _bindgen_ty_14 = 21; +pub const AMOTION_EVENT_AXIS_GAS: _bindgen_ty_14 = 22; +pub const AMOTION_EVENT_AXIS_BRAKE: _bindgen_ty_14 = 23; +pub const AMOTION_EVENT_AXIS_DISTANCE: _bindgen_ty_14 = 24; +pub const AMOTION_EVENT_AXIS_TILT: _bindgen_ty_14 = 25; +pub const AMOTION_EVENT_AXIS_SCROLL: _bindgen_ty_14 = 26; +pub const AMOTION_EVENT_AXIS_RELATIVE_X: _bindgen_ty_14 = 27; +pub const AMOTION_EVENT_AXIS_RELATIVE_Y: _bindgen_ty_14 = 28; +pub const AMOTION_EVENT_AXIS_GENERIC_1: _bindgen_ty_14 = 32; +pub const AMOTION_EVENT_AXIS_GENERIC_2: _bindgen_ty_14 = 33; +pub const AMOTION_EVENT_AXIS_GENERIC_3: _bindgen_ty_14 = 34; +pub const AMOTION_EVENT_AXIS_GENERIC_4: _bindgen_ty_14 = 35; +pub const AMOTION_EVENT_AXIS_GENERIC_5: _bindgen_ty_14 = 36; +pub const AMOTION_EVENT_AXIS_GENERIC_6: _bindgen_ty_14 = 37; +pub const AMOTION_EVENT_AXIS_GENERIC_7: _bindgen_ty_14 = 38; +pub const AMOTION_EVENT_AXIS_GENERIC_8: _bindgen_ty_14 = 39; +pub const AMOTION_EVENT_AXIS_GENERIC_9: _bindgen_ty_14 = 40; +pub const AMOTION_EVENT_AXIS_GENERIC_10: _bindgen_ty_14 = 41; +pub const AMOTION_EVENT_AXIS_GENERIC_11: _bindgen_ty_14 = 42; +pub const AMOTION_EVENT_AXIS_GENERIC_12: _bindgen_ty_14 = 43; +pub const AMOTION_EVENT_AXIS_GENERIC_13: _bindgen_ty_14 = 44; +pub const AMOTION_EVENT_AXIS_GENERIC_14: _bindgen_ty_14 = 45; +pub const AMOTION_EVENT_AXIS_GENERIC_15: _bindgen_ty_14 = 46; +pub const AMOTION_EVENT_AXIS_GENERIC_16: _bindgen_ty_14 = 47; pub type _bindgen_ty_14 = ::std::os::raw::c_uint; -pub const AMOTION_EVENT_BUTTON_PRIMARY: ::std::os::raw::c_uint = 1; -pub const AMOTION_EVENT_BUTTON_SECONDARY: ::std::os::raw::c_uint = 2; -pub const AMOTION_EVENT_BUTTON_TERTIARY: ::std::os::raw::c_uint = 4; -pub const AMOTION_EVENT_BUTTON_BACK: ::std::os::raw::c_uint = 8; -pub const AMOTION_EVENT_BUTTON_FORWARD: ::std::os::raw::c_uint = 16; -pub const AMOTION_EVENT_BUTTON_STYLUS_PRIMARY: ::std::os::raw::c_uint = 32; -pub const AMOTION_EVENT_BUTTON_STYLUS_SECONDARY: ::std::os::raw::c_uint = 64; +pub const AMOTION_EVENT_BUTTON_PRIMARY: _bindgen_ty_15 = 1; +pub const AMOTION_EVENT_BUTTON_SECONDARY: _bindgen_ty_15 = 2; +pub const AMOTION_EVENT_BUTTON_TERTIARY: _bindgen_ty_15 = 4; +pub const AMOTION_EVENT_BUTTON_BACK: _bindgen_ty_15 = 8; +pub const AMOTION_EVENT_BUTTON_FORWARD: _bindgen_ty_15 = 16; +pub const AMOTION_EVENT_BUTTON_STYLUS_PRIMARY: _bindgen_ty_15 = 32; +pub const AMOTION_EVENT_BUTTON_STYLUS_SECONDARY: _bindgen_ty_15 = 64; pub type _bindgen_ty_15 = ::std::os::raw::c_uint; -pub const AMOTION_EVENT_TOOL_TYPE_UNKNOWN: ::std::os::raw::c_uint = 0; -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_UNKNOWN: _bindgen_ty_16 = 0; +pub const AMOTION_EVENT_TOOL_TYPE_FINGER: _bindgen_ty_16 = 1; +pub const AMOTION_EVENT_TOOL_TYPE_STYLUS: _bindgen_ty_16 = 2; +pub const AMOTION_EVENT_TOOL_TYPE_MOUSE: _bindgen_ty_16 = 3; +pub const AMOTION_EVENT_TOOL_TYPE_ERASER: _bindgen_ty_16 = 4; +pub const AMOTION_EVENT_TOOL_TYPE_PALM: _bindgen_ty_16 = 5; pub type _bindgen_ty_16 = ::std::os::raw::c_uint; -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; -pub const AINPUT_SOURCE_CLASS_POINTER: ::std::os::raw::c_uint = 2; -pub const AINPUT_SOURCE_CLASS_NAVIGATION: ::std::os::raw::c_uint = 4; -pub const AINPUT_SOURCE_CLASS_POSITION: ::std::os::raw::c_uint = 8; -pub const AINPUT_SOURCE_CLASS_JOYSTICK: ::std::os::raw::c_uint = 16; +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: _bindgen_ty_17 = 255; +pub const AINPUT_SOURCE_CLASS_NONE: _bindgen_ty_17 = 0; +pub const AINPUT_SOURCE_CLASS_BUTTON: _bindgen_ty_17 = 1; +pub const AINPUT_SOURCE_CLASS_POINTER: _bindgen_ty_17 = 2; +pub const AINPUT_SOURCE_CLASS_NAVIGATION: _bindgen_ty_17 = 4; +pub const AINPUT_SOURCE_CLASS_POSITION: _bindgen_ty_17 = 8; +pub const AINPUT_SOURCE_CLASS_JOYSTICK: _bindgen_ty_17 = 16; pub type _bindgen_ty_17 = ::std::os::raw::c_uint; -pub const AINPUT_SOURCE_UNKNOWN: ::std::os::raw::c_uint = 0; -pub const AINPUT_SOURCE_KEYBOARD: ::std::os::raw::c_uint = 257; -pub const AINPUT_SOURCE_DPAD: ::std::os::raw::c_uint = 513; -pub const AINPUT_SOURCE_GAMEPAD: ::std::os::raw::c_uint = 1025; -pub const AINPUT_SOURCE_TOUCHSCREEN: ::std::os::raw::c_uint = 4098; -pub const AINPUT_SOURCE_MOUSE: ::std::os::raw::c_uint = 8194; -pub const AINPUT_SOURCE_STYLUS: ::std::os::raw::c_uint = 16386; -pub const AINPUT_SOURCE_BLUETOOTH_STYLUS: ::std::os::raw::c_uint = 49154; -pub const AINPUT_SOURCE_TRACKBALL: ::std::os::raw::c_uint = 65540; -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_ROTARY_ENCODER: ::std::os::raw::c_uint = 4194304; -pub const AINPUT_SOURCE_ANY: ::std::os::raw::c_uint = 4294967040; +pub const AINPUT_SOURCE_UNKNOWN: _bindgen_ty_18 = 0; +pub const AINPUT_SOURCE_KEYBOARD: _bindgen_ty_18 = 257; +pub const AINPUT_SOURCE_DPAD: _bindgen_ty_18 = 513; +pub const AINPUT_SOURCE_GAMEPAD: _bindgen_ty_18 = 1025; +pub const AINPUT_SOURCE_TOUCHSCREEN: _bindgen_ty_18 = 4098; +pub const AINPUT_SOURCE_MOUSE: _bindgen_ty_18 = 8194; +pub const AINPUT_SOURCE_STYLUS: _bindgen_ty_18 = 16386; +pub const AINPUT_SOURCE_BLUETOOTH_STYLUS: _bindgen_ty_18 = 49154; +pub const AINPUT_SOURCE_TRACKBALL: _bindgen_ty_18 = 65540; +pub const AINPUT_SOURCE_MOUSE_RELATIVE: _bindgen_ty_18 = 131076; +pub const AINPUT_SOURCE_TOUCHPAD: _bindgen_ty_18 = 1048584; +pub const AINPUT_SOURCE_TOUCH_NAVIGATION: _bindgen_ty_18 = 2097152; +pub const AINPUT_SOURCE_JOYSTICK: _bindgen_ty_18 = 16777232; +pub const AINPUT_SOURCE_HDMI: _bindgen_ty_18 = 33554433; +pub const AINPUT_SOURCE_SENSOR: _bindgen_ty_18 = 67108864; +pub const AINPUT_SOURCE_ROTARY_ENCODER: _bindgen_ty_18 = 4194304; +pub const AINPUT_SOURCE_ANY: _bindgen_ty_18 = 4294967040; pub type _bindgen_ty_18 = ::std::os::raw::c_uint; -pub const AINPUT_KEYBOARD_TYPE_NONE: ::std::os::raw::c_uint = 0; -pub const AINPUT_KEYBOARD_TYPE_NON_ALPHABETIC: ::std::os::raw::c_uint = 1; -pub const AINPUT_KEYBOARD_TYPE_ALPHABETIC: ::std::os::raw::c_uint = 2; +pub const AINPUT_KEYBOARD_TYPE_NONE: _bindgen_ty_19 = 0; +pub const AINPUT_KEYBOARD_TYPE_NON_ALPHABETIC: _bindgen_ty_19 = 1; +pub const AINPUT_KEYBOARD_TYPE_ALPHABETIC: _bindgen_ty_19 = 2; pub type _bindgen_ty_19 = ::std::os::raw::c_uint; -pub const AINPUT_MOTION_RANGE_X: ::std::os::raw::c_uint = 0; -pub const AINPUT_MOTION_RANGE_Y: ::std::os::raw::c_uint = 1; -pub const AINPUT_MOTION_RANGE_PRESSURE: ::std::os::raw::c_uint = 2; -pub const AINPUT_MOTION_RANGE_SIZE: ::std::os::raw::c_uint = 3; -pub const AINPUT_MOTION_RANGE_TOUCH_MAJOR: ::std::os::raw::c_uint = 4; -pub const AINPUT_MOTION_RANGE_TOUCH_MINOR: ::std::os::raw::c_uint = 5; -pub const AINPUT_MOTION_RANGE_TOOL_MAJOR: ::std::os::raw::c_uint = 6; -pub const AINPUT_MOTION_RANGE_TOOL_MINOR: ::std::os::raw::c_uint = 7; -pub const AINPUT_MOTION_RANGE_ORIENTATION: ::std::os::raw::c_uint = 8; +pub const AINPUT_MOTION_RANGE_X: _bindgen_ty_20 = 0; +pub const AINPUT_MOTION_RANGE_Y: _bindgen_ty_20 = 1; +pub const AINPUT_MOTION_RANGE_PRESSURE: _bindgen_ty_20 = 2; +pub const AINPUT_MOTION_RANGE_SIZE: _bindgen_ty_20 = 3; +pub const AINPUT_MOTION_RANGE_TOUCH_MAJOR: _bindgen_ty_20 = 4; +pub const AINPUT_MOTION_RANGE_TOUCH_MINOR: _bindgen_ty_20 = 5; +pub const AINPUT_MOTION_RANGE_TOOL_MAJOR: _bindgen_ty_20 = 6; +pub const AINPUT_MOTION_RANGE_TOOL_MINOR: _bindgen_ty_20 = 7; +pub const AINPUT_MOTION_RANGE_ORIENTATION: _bindgen_ty_20 = 8; pub type _bindgen_ty_20 = ::std::os::raw::c_uint; extern "C" { pub fn AInputEvent_getType(event: *const AInputEvent) -> i32; @@ -1357,6 +1545,9 @@ 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; } @@ -1381,6 +1572,9 @@ 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; } @@ -1415,168 +1609,169 @@ extern "C" { pub fn AMotionEvent_getYPrecision(motion_event: *const AInputEvent) -> f32; } extern "C" { - pub fn AMotionEvent_getPointerCount(motion_event: *const AInputEvent) -> size_t; + pub fn AMotionEvent_getPointerCount(motion_event: *const AInputEvent) -> usize; } extern "C" { - pub fn AMotionEvent_getPointerId( - motion_event: *const AInputEvent, - pointer_index: size_t, - ) -> i32; + pub fn AMotionEvent_getPointerId(motion_event: *const AInputEvent, pointer_index: usize) + -> i32; } extern "C" { - pub fn AMotionEvent_getToolType(motion_event: *const AInputEvent, pointer_index: size_t) - -> i32; + pub fn AMotionEvent_getToolType(motion_event: *const AInputEvent, pointer_index: usize) -> i32; } extern "C" { - pub fn AMotionEvent_getRawX(motion_event: *const AInputEvent, pointer_index: size_t) -> f32; + pub fn AMotionEvent_getRawX(motion_event: *const AInputEvent, pointer_index: usize) -> f32; } extern "C" { - pub fn AMotionEvent_getRawY(motion_event: *const AInputEvent, pointer_index: size_t) -> f32; + pub fn AMotionEvent_getRawY(motion_event: *const AInputEvent, pointer_index: usize) -> f32; } extern "C" { - pub fn AMotionEvent_getX(motion_event: *const AInputEvent, pointer_index: size_t) -> f32; + pub fn AMotionEvent_getX(motion_event: *const AInputEvent, pointer_index: usize) -> f32; } extern "C" { - pub fn AMotionEvent_getY(motion_event: *const AInputEvent, pointer_index: size_t) -> f32; + pub fn AMotionEvent_getY(motion_event: *const AInputEvent, pointer_index: usize) -> f32; } extern "C" { - pub fn AMotionEvent_getPressure(motion_event: *const AInputEvent, pointer_index: size_t) - -> f32; + pub fn AMotionEvent_getPressure(motion_event: *const AInputEvent, pointer_index: usize) -> f32; } extern "C" { - pub fn AMotionEvent_getSize(motion_event: *const AInputEvent, pointer_index: size_t) -> f32; + pub fn AMotionEvent_getSize(motion_event: *const AInputEvent, pointer_index: usize) -> f32; } extern "C" { pub fn AMotionEvent_getTouchMajor( motion_event: *const AInputEvent, - pointer_index: size_t, + pointer_index: usize, ) -> f32; } extern "C" { pub fn AMotionEvent_getTouchMinor( motion_event: *const AInputEvent, - pointer_index: size_t, + pointer_index: usize, ) -> f32; } extern "C" { - pub fn AMotionEvent_getToolMajor( - motion_event: *const AInputEvent, - pointer_index: size_t, - ) -> f32; + pub fn AMotionEvent_getToolMajor(motion_event: *const AInputEvent, pointer_index: usize) + -> f32; } extern "C" { - pub fn AMotionEvent_getToolMinor( - motion_event: *const AInputEvent, - pointer_index: size_t, - ) -> f32; + pub fn AMotionEvent_getToolMinor(motion_event: *const AInputEvent, pointer_index: usize) + -> f32; } extern "C" { pub fn AMotionEvent_getOrientation( motion_event: *const AInputEvent, - pointer_index: size_t, + pointer_index: usize, ) -> f32; } extern "C" { pub fn AMotionEvent_getAxisValue( motion_event: *const AInputEvent, axis: i32, - pointer_index: size_t, + pointer_index: usize, ) -> f32; } extern "C" { - pub fn AMotionEvent_getHistorySize(motion_event: *const AInputEvent) -> size_t; + pub fn AMotionEvent_getHistorySize(motion_event: *const AInputEvent) -> usize; } extern "C" { pub fn AMotionEvent_getHistoricalEventTime( motion_event: *const AInputEvent, - history_index: size_t, + history_index: usize, ) -> i64; } extern "C" { pub fn AMotionEvent_getHistoricalRawX( motion_event: *const AInputEvent, - pointer_index: size_t, - history_index: size_t, + pointer_index: usize, + history_index: usize, ) -> f32; } extern "C" { pub fn AMotionEvent_getHistoricalRawY( motion_event: *const AInputEvent, - pointer_index: size_t, - history_index: size_t, + pointer_index: usize, + history_index: usize, ) -> f32; } extern "C" { pub fn AMotionEvent_getHistoricalX( motion_event: *const AInputEvent, - pointer_index: size_t, - history_index: size_t, + pointer_index: usize, + history_index: usize, ) -> f32; } extern "C" { pub fn AMotionEvent_getHistoricalY( motion_event: *const AInputEvent, - pointer_index: size_t, - history_index: size_t, + pointer_index: usize, + history_index: usize, ) -> f32; } extern "C" { pub fn AMotionEvent_getHistoricalPressure( motion_event: *const AInputEvent, - pointer_index: size_t, - history_index: size_t, + pointer_index: usize, + history_index: usize, ) -> f32; } extern "C" { pub fn AMotionEvent_getHistoricalSize( motion_event: *const AInputEvent, - pointer_index: size_t, - history_index: size_t, + pointer_index: usize, + history_index: usize, ) -> f32; } extern "C" { pub fn AMotionEvent_getHistoricalTouchMajor( motion_event: *const AInputEvent, - pointer_index: size_t, - history_index: size_t, + pointer_index: usize, + history_index: usize, ) -> f32; } extern "C" { pub fn AMotionEvent_getHistoricalTouchMinor( motion_event: *const AInputEvent, - pointer_index: size_t, - history_index: size_t, + pointer_index: usize, + history_index: usize, ) -> f32; } extern "C" { pub fn AMotionEvent_getHistoricalToolMajor( motion_event: *const AInputEvent, - pointer_index: size_t, - history_index: size_t, + pointer_index: usize, + history_index: usize, ) -> f32; } extern "C" { pub fn AMotionEvent_getHistoricalToolMinor( motion_event: *const AInputEvent, - pointer_index: size_t, - history_index: size_t, + pointer_index: usize, + history_index: usize, ) -> f32; } extern "C" { pub fn AMotionEvent_getHistoricalOrientation( motion_event: *const AInputEvent, - pointer_index: size_t, - history_index: size_t, + pointer_index: usize, + history_index: usize, ) -> f32; } extern "C" { pub fn AMotionEvent_getHistoricalAxisValue( motion_event: *const AInputEvent, axis: i32, - pointer_index: size_t, - history_index: size_t, + pointer_index: usize, + history_index: usize, ) -> 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 { @@ -1610,6 +1805,9 @@ 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 { @@ -1618,6 +1816,8 @@ pub struct imaxdiv_t { } #[test] fn bindgen_test_layout_imaxdiv_t() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 16usize, @@ -1629,7 +1829,7 @@ fn bindgen_test_layout_imaxdiv_t() { concat!("Alignment of ", stringify!(imaxdiv_t)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).quot as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).quot) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1639,7 +1839,7 @@ fn bindgen_test_layout_imaxdiv_t() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).rem as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).rem) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -1684,11 +1884,52 @@ 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; pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_R8G8B8A8_UNORM: AHardwareBuffer_Format = 1; pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_R8G8B8X8_UNORM: AHardwareBuffer_Format = 2; @@ -1708,6 +1949,8 @@ 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; @@ -1800,6 +2043,8 @@ pub struct AHardwareBuffer_Desc { } #[test] fn bindgen_test_layout_AHardwareBuffer_Desc() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 40usize, @@ -1811,7 +2056,7 @@ fn bindgen_test_layout_AHardwareBuffer_Desc() { concat!("Alignment of ", stringify!(AHardwareBuffer_Desc)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).width as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).width) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1821,7 +2066,7 @@ fn bindgen_test_layout_AHardwareBuffer_Desc() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).height as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).height) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -1831,7 +2076,7 @@ fn bindgen_test_layout_AHardwareBuffer_Desc() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).layers as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).layers) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -1841,7 +2086,7 @@ fn bindgen_test_layout_AHardwareBuffer_Desc() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).format as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).format) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", @@ -1851,7 +2096,7 @@ fn bindgen_test_layout_AHardwareBuffer_Desc() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).usage as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).usage) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -1861,7 +2106,7 @@ fn bindgen_test_layout_AHardwareBuffer_Desc() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).stride as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).stride) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -1871,7 +2116,7 @@ fn bindgen_test_layout_AHardwareBuffer_Desc() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).rfu0 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).rfu0) as usize - ptr as usize }, 28usize, concat!( "Offset of field: ", @@ -1881,7 +2126,7 @@ fn bindgen_test_layout_AHardwareBuffer_Desc() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).rfu1 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).rfu1) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -1900,6 +2145,9 @@ pub struct AHardwareBuffer_Plane { } #[test] fn bindgen_test_layout_AHardwareBuffer_Plane() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 16usize, @@ -1911,7 +2159,7 @@ fn bindgen_test_layout_AHardwareBuffer_Plane() { concat!("Alignment of ", stringify!(AHardwareBuffer_Plane)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).data as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).data) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1921,9 +2169,7 @@ fn bindgen_test_layout_AHardwareBuffer_Plane() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pixelStride as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).pixelStride) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -1933,7 +2179,7 @@ fn bindgen_test_layout_AHardwareBuffer_Plane() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).rowStride as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).rowStride) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", @@ -1951,6 +2197,9 @@ pub struct AHardwareBuffer_Planes { } #[test] fn bindgen_test_layout_AHardwareBuffer_Planes() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 72usize, @@ -1962,9 +2211,7 @@ fn bindgen_test_layout_AHardwareBuffer_Planes() { concat!("Alignment of ", stringify!(AHardwareBuffer_Planes)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).planeCount as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).planeCount) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1974,7 +2221,7 @@ fn bindgen_test_layout_AHardwareBuffer_Planes() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).planes as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).planes) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -2016,15 +2263,6 @@ 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, @@ -2043,6 +2281,15 @@ 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; } @@ -2057,1183 +2304,892 @@ extern "C" { outBytesPerStride: *mut i32, ) -> ::std::os::raw::c_int; } -pub type va_list = __builtin_va_list; -pub type __gnuc_va_list = __builtin_va_list; +extern "C" { + pub fn AHardwareBuffer_getId( + buffer: *const AHardwareBuffer, + outId: *mut u64, + ) -> ::std::os::raw::c_int; +} +#[doc = " \\brief Describe information about a pointer, found in a\n GameActivityMotionEvent.\n\n You can read values directly from this structure, or use helper functions\n (`GameActivityPointerAxes_getX`, `GameActivityPointerAxes_getY` and\n `GameActivityPointerAxes_getAxisValue`).\n\n The X axis and Y axis are enabled by default but any other axis that you want\n to read **must** be enabled first, using\n `GameActivityPointerAxes_enableAxis`.\n\n \\see GameActivityMotionEvent"] #[repr(C)] -pub struct JavaVMAttachArgs { - pub version: jint, - pub name: *const ::std::os::raw::c_char, - pub group: jobject, +#[derive(Debug, Copy, Clone)] +pub struct GameActivityPointerAxes { + pub id: i32, + pub toolType: i32, + pub axisValues: [f32; 48usize], + pub rawX: f32, + pub rawY: f32, } #[test] -fn bindgen_test_layout_JavaVMAttachArgs() { +fn bindgen_test_layout_GameActivityPointerAxes() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(JavaVMAttachArgs)) + ::std::mem::size_of::(), + 208usize, + concat!("Size of: ", stringify!(GameActivityPointerAxes)) ); assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(JavaVMAttachArgs)) + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(GameActivityPointerAxes)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).version as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(JavaVMAttachArgs), + stringify!(GameActivityPointerAxes), "::", - stringify!(version) + stringify!(id) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).name as *const _ as usize }, - 8usize, + unsafe { ::std::ptr::addr_of!((*ptr).toolType) as usize - ptr as usize }, + 4usize, concat!( "Offset of field: ", - stringify!(JavaVMAttachArgs), + stringify!(GameActivityPointerAxes), "::", - stringify!(name) + stringify!(toolType) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).group as *const _ as usize }, - 16usize, + unsafe { ::std::ptr::addr_of!((*ptr).axisValues) as usize - ptr as usize }, + 8usize, concat!( "Offset of field: ", - stringify!(JavaVMAttachArgs), + stringify!(GameActivityPointerAxes), "::", - stringify!(group) + stringify!(axisValues) ) ); -} -#[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)) + unsafe { ::std::ptr::addr_of!((*ptr).rawX) as usize - ptr as usize }, + 200usize, + concat!( + "Offset of field: ", + stringify!(GameActivityPointerAxes), + "::", + stringify!(rawX) + ) ); assert_eq!( - ::std::mem::align_of::(), + unsafe { ::std::ptr::addr_of!((*ptr).rawY) as usize - ptr as usize }, + 204usize, + concat!( + "Offset of field: ", + stringify!(GameActivityPointerAxes), + "::", + stringify!(rawY) + ) + ); +} +extern "C" { + #[doc = " \\brief Enable the specified axis, so that its value is reported in the\n GameActivityPointerAxes structures stored in a motion event.\n\n You must enable any axis that you want to read, apart from\n `AMOTION_EVENT_AXIS_X` and `AMOTION_EVENT_AXIS_Y` that are enabled by\n default.\n\n If the axis index is out of range, nothing is done."] + pub fn GameActivityPointerAxes_enableAxis(axis: i32); +} +extern "C" { + #[doc = " \\brief Disable the specified axis. Its value won't be reported in the\n GameActivityPointerAxes structures stored in a motion event anymore.\n\n Apart from X and Y, any axis that you want to read **must** be enabled first,\n using `GameActivityPointerAxes_enableAxis`.\n\n If the axis index is out of range, nothing is done."] + pub fn GameActivityPointerAxes_disableAxis(axis: i32); +} +extern "C" { + #[doc = " \\brief Get the value of the requested axis.\n\n Apart from X and Y, any axis that you want to read **must** be enabled first,\n using `GameActivityPointerAxes_enableAxis`.\n\n Find the valid enums for the axis (`AMOTION_EVENT_AXIS_X`,\n `AMOTION_EVENT_AXIS_Y`, `AMOTION_EVENT_AXIS_PRESSURE`...)\n in https://developer.android.com/ndk/reference/group/input.\n\n @param pointerInfo The structure containing information about the pointer,\n obtained from GameActivityMotionEvent.\n @param axis The axis to get the value from\n @return The value of the axis, or 0 if the axis is invalid or was not\n enabled."] + pub fn GameActivityPointerAxes_getAxisValue( + pointerInfo: *const GameActivityPointerAxes, + axis: i32, + ) -> f32; +} +#[doc = " \\brief Describe a motion event that happened on the GameActivity SurfaceView.\n\n This is 1:1 mapping to the information contained in a Java `MotionEvent`\n (see https://developer.android.com/reference/android/view/MotionEvent)."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GameActivityMotionEvent { + pub deviceId: i32, + pub source: i32, + pub action: i32, + pub eventTime: i64, + pub downTime: i64, + pub flags: i32, + pub metaState: i32, + pub actionButton: i32, + pub buttonState: i32, + pub classification: i32, + pub edgeFlags: i32, + pub pointerCount: u32, + pub pointers: [GameActivityPointerAxes; 8usize], + pub historySize: ::std::os::raw::c_int, + pub historicalEventTimesMillis: *mut i64, + pub historicalEventTimesNanos: *mut i64, + pub historicalAxisValues: *mut f32, + pub precisionX: f32, + pub precisionY: f32, +} +#[test] +fn bindgen_test_layout_GameActivityMotionEvent() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 1760usize, + concat!("Size of: ", stringify!(GameActivityMotionEvent)) + ); + assert_eq!( + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(JavaVMOption)) + concat!("Alignment of ", stringify!(GameActivityMotionEvent)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).optionString as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).deviceId) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(JavaVMOption), + stringify!(GameActivityMotionEvent), "::", - stringify!(optionString) + stringify!(deviceId) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).source) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(GameActivityMotionEvent), + "::", + stringify!(source) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).extraInfo as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).action) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(JavaVMOption), + stringify!(GameActivityMotionEvent), "::", - stringify!(extraInfo) + stringify!(action) ) ); -} -#[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)) + unsafe { ::std::ptr::addr_of!((*ptr).eventTime) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(GameActivityMotionEvent), + "::", + stringify!(eventTime) + ) ); assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(JavaVMInitArgs)) + unsafe { ::std::ptr::addr_of!((*ptr).downTime) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(GameActivityMotionEvent), + "::", + stringify!(downTime) + ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).version as *const _ as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + 32usize, concat!( "Offset of field: ", - stringify!(JavaVMInitArgs), + stringify!(GameActivityMotionEvent), "::", - stringify!(version) + stringify!(flags) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).nOptions as *const _ as usize }, - 4usize, + unsafe { ::std::ptr::addr_of!((*ptr).metaState) as usize - ptr as usize }, + 36usize, concat!( "Offset of field: ", - stringify!(JavaVMInitArgs), + stringify!(GameActivityMotionEvent), "::", - stringify!(nOptions) + stringify!(metaState) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).options as *const _ as usize }, - 8usize, + unsafe { ::std::ptr::addr_of!((*ptr).actionButton) as usize - ptr as usize }, + 40usize, concat!( "Offset of field: ", - stringify!(JavaVMInitArgs), + stringify!(GameActivityMotionEvent), "::", - stringify!(options) + stringify!(actionButton) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ignoreUnrecognized as *const _ as usize - }, - 16usize, + unsafe { ::std::ptr::addr_of!((*ptr).buttonState) as usize - ptr as usize }, + 44usize, concat!( "Offset of field: ", - stringify!(JavaVMInitArgs), + stringify!(GameActivityMotionEvent), "::", - stringify!(ignoreUnrecognized) + stringify!(buttonState) ) ); -} -pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_CAPTION_BAR: GameCommonInsetsType = 0; -pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_DISPLAY_CUTOUT: GameCommonInsetsType = 1; -pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_IME: GameCommonInsetsType = 2; -pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_MANDATORY_SYSTEM_GESTURES: - GameCommonInsetsType = 3; -pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_NAVIGATION_BARS: GameCommonInsetsType = 4; -pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_STATUS_BARS: GameCommonInsetsType = 5; -pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_SYSTEM_BARS: GameCommonInsetsType = 6; -pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_SYSTEM_GESTURES: GameCommonInsetsType = 7; -pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_TAPABLE_ELEMENT: GameCommonInsetsType = 8; -pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_WATERFALL: GameCommonInsetsType = 9; -pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_COUNT: GameCommonInsetsType = 10; -#[doc = " The type of a component for which to retrieve insets. See"] -#[doc = " https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type"] -pub type GameCommonInsetsType = ::std::os::raw::c_uint; -#[doc = " This struct holds a span within a region of text from start (inclusive) to"] -#[doc = " end (exclusive). An empty span or cursor position is specified with"] -#[doc = " start==end. An undefined span is specified with start = end = SPAN_UNDEFINED."] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct GameTextInputSpan { - #[doc = " The start of the region (inclusive)."] - pub start: i32, - #[doc = " The end of the region (exclusive)."] - pub end: i32, -} -#[test] -fn bindgen_test_layout_GameTextInputSpan() { assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(GameTextInputSpan)) + unsafe { ::std::ptr::addr_of!((*ptr).classification) as usize - ptr as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(GameActivityMotionEvent), + "::", + stringify!(classification) + ) ); assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(GameTextInputSpan)) + unsafe { ::std::ptr::addr_of!((*ptr).edgeFlags) as usize - ptr as usize }, + 52usize, + concat!( + "Offset of field: ", + stringify!(GameActivityMotionEvent), + "::", + stringify!(edgeFlags) + ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).start as *const _ as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).pointerCount) as usize - ptr as usize }, + 56usize, concat!( "Offset of field: ", - stringify!(GameTextInputSpan), + stringify!(GameActivityMotionEvent), "::", - stringify!(start) + stringify!(pointerCount) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).end as *const _ as usize }, - 4usize, + unsafe { ::std::ptr::addr_of!((*ptr).pointers) as usize - ptr as usize }, + 60usize, concat!( "Offset of field: ", - stringify!(GameTextInputSpan), + stringify!(GameActivityMotionEvent), "::", - stringify!(end) + stringify!(pointers) ) ); -} -pub const GameTextInputSpanFlag_SPAN_UNDEFINED: GameTextInputSpanFlag = -1; -#[doc = " Values with special meaning in a GameTextInputSpan."] -pub type GameTextInputSpanFlag = ::std::os::raw::c_int; -#[doc = " This struct holds the state of an editable section of text."] -#[doc = " The text can have a selection and a composing region defined on it."] -#[doc = " A composing region is used by IMEs that allow input using multiple steps to"] -#[doc = " compose a glyph or word. Use functions GameTextInput_getState and"] -#[doc = " GameTextInput_setState to read and modify the state that an IME is editing."] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct GameTextInputState { - #[doc = " Text owned by the state, as a modified UTF-8 string. Null-terminated."] - #[doc = " https://en.wikipedia.org/wiki/UTF-8#Modified_UTF-8"] - pub text_UTF8: *const ::std::os::raw::c_char, - #[doc = " Length in bytes of text_UTF8, *not* including the null at end."] - pub text_length: i32, - #[doc = " A selection defined on the text."] - pub selection: GameTextInputSpan, - #[doc = " A composing region defined on the text."] - pub composingRegion: GameTextInputSpan, -} -#[test] -fn bindgen_test_layout_GameTextInputState() { assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(GameTextInputState)) + unsafe { ::std::ptr::addr_of!((*ptr).historySize) as usize - ptr as usize }, + 1724usize, + concat!( + "Offset of field: ", + stringify!(GameActivityMotionEvent), + "::", + stringify!(historySize) + ) ); assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(GameTextInputState)) + unsafe { ::std::ptr::addr_of!((*ptr).historicalEventTimesMillis) as usize - ptr as usize }, + 1728usize, + concat!( + "Offset of field: ", + stringify!(GameActivityMotionEvent), + "::", + stringify!(historicalEventTimesMillis) + ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).text_UTF8 as *const _ as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).historicalEventTimesNanos) as usize - ptr as usize }, + 1736usize, concat!( "Offset of field: ", - stringify!(GameTextInputState), + stringify!(GameActivityMotionEvent), "::", - stringify!(text_UTF8) + stringify!(historicalEventTimesNanos) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).text_length as *const _ as usize }, - 8usize, + unsafe { ::std::ptr::addr_of!((*ptr).historicalAxisValues) as usize - ptr as usize }, + 1744usize, concat!( "Offset of field: ", - stringify!(GameTextInputState), + stringify!(GameActivityMotionEvent), "::", - stringify!(text_length) + stringify!(historicalAxisValues) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).selection as *const _ as usize }, - 12usize, + unsafe { ::std::ptr::addr_of!((*ptr).precisionX) as usize - ptr as usize }, + 1752usize, concat!( "Offset of field: ", - stringify!(GameTextInputState), + stringify!(GameActivityMotionEvent), "::", - stringify!(selection) + stringify!(precisionX) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).composingRegion as *const _ as usize - }, - 20usize, + unsafe { ::std::ptr::addr_of!((*ptr).precisionY) as usize - ptr as usize }, + 1756usize, concat!( "Offset of field: ", - stringify!(GameTextInputState), + stringify!(GameActivityMotionEvent), "::", - stringify!(composingRegion) + stringify!(precisionY) ) ); } -#[doc = " A callback called by GameTextInput_getState."] -#[doc = " @param context User-defined context."] -#[doc = " @param state State, owned by the library, that will be valid for the duration"] -#[doc = " of the callback."] -pub type GameTextInputGetStateCallback = ::std::option::Option< - unsafe extern "C" fn(context: *mut ::std::os::raw::c_void, state: *const GameTextInputState), ->; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct GameTextInput { - _unused: [u8; 0], -} -extern "C" { - #[doc = " Initialize the GameTextInput library."] - #[doc = " If called twice without GameTextInput_destroy being called, the same pointer"] - #[doc = " will be returned and a warning will be issued."] - #[doc = " @param env A JNI env valid on the calling thread."] - #[doc = " @param max_string_size The maximum length of a string that can be edited. If"] - #[doc = " zero, the maximum defaults to 65536 bytes. A buffer of this size is allocated"] - #[doc = " at initialization."] - #[doc = " @return A handle to the library."] - pub fn GameTextInput_init(env: *mut JNIEnv, max_string_size: u32) -> *mut GameTextInput; -} extern "C" { - #[doc = " When using GameTextInput, you need to create a gametextinput.InputConnection"] - #[doc = " on the Java side and pass it using this function to the library, unless using"] - #[doc = " GameActivity in which case this will be done for you. See the GameActivity"] - #[doc = " source code or GameTextInput samples for examples of usage."] - #[doc = " @param input A valid GameTextInput library handle."] - #[doc = " @param inputConnection A gametextinput.InputConnection object."] - pub fn GameTextInput_setInputConnection(input: *mut GameTextInput, inputConnection: jobject); + pub fn GameActivityMotionEvent_getHistoricalAxisValue( + event: *const GameActivityMotionEvent, + axis: ::std::os::raw::c_int, + pointerIndex: ::std::os::raw::c_int, + historyPos: ::std::os::raw::c_int, + ) -> f32; } extern "C" { - #[doc = " Unless using GameActivity, it is required to call this function from your"] - #[doc = " Java gametextinput.Listener.stateChanged method to convert eventState and"] - #[doc = " trigger any event callbacks. When using GameActivity, this does not need to"] - #[doc = " be called as event processing is handled by the Activity."] - #[doc = " @param input A valid GameTextInput library handle."] - #[doc = " @param eventState A Java gametextinput.State object."] - pub fn GameTextInput_processEvent(input: *mut GameTextInput, eventState: jobject); + #[doc = " \\brief Handle the freeing of the GameActivityMotionEvent struct."] + pub fn GameActivityMotionEvent_destroy(c_event: *mut GameActivityMotionEvent); } extern "C" { - #[doc = " Free any resources owned by the GameTextInput library."] - #[doc = " Any subsequent calls to the library will fail until GameTextInput_init is"] - #[doc = " called again."] - #[doc = " @param input A valid GameTextInput library handle."] - pub fn GameTextInput_destroy(input: *mut GameTextInput); + #[doc = " \\brief Convert a Java `MotionEvent` to a `GameActivityMotionEvent`.\n\n This is done automatically by the GameActivity: see `onTouchEvent` to set\n a callback to consume the received events.\n This function can be used if you re-implement events handling in your own\n activity.\n Ownership of out_event is maintained by the caller."] + pub fn GameActivityMotionEvent_fromJava( + env: *mut JNIEnv, + motionEvent: jobject, + out_event: *mut GameActivityMotionEvent, + ); } -pub const ShowImeFlags_SHOW_IME_UNDEFINED: ShowImeFlags = 0; -pub const ShowImeFlags_SHOW_IMPLICIT: ShowImeFlags = 1; -pub const ShowImeFlags_SHOW_FORCED: ShowImeFlags = 2; -#[doc = " Flags to be passed to GameTextInput_showIme."] -pub type ShowImeFlags = ::std::os::raw::c_uint; -extern "C" { - #[doc = " Show the IME. Calls InputMethodManager.showSoftInput()."] - #[doc = " @param input A valid GameTextInput library handle."] - #[doc = " @param flags Defined in ShowImeFlags above. For more information see:"] - #[doc = " https://developer.android.com/reference/android/view/inputmethod/InputMethodManager"] - pub fn GameTextInput_showIme(input: *mut GameTextInput, flags: u32); -} -pub const HideImeFlags_HIDE_IME_UNDEFINED: HideImeFlags = 0; -pub const HideImeFlags_HIDE_IMPLICIT_ONLY: HideImeFlags = 1; -pub const HideImeFlags_HIDE_NOT_ALWAYS: HideImeFlags = 2; -#[doc = " Flags to be passed to GameTextInput_hideIme."] -pub type HideImeFlags = ::std::os::raw::c_uint; -extern "C" { - #[doc = " Show the IME. Calls InputMethodManager.hideSoftInputFromWindow()."] - #[doc = " @param input A valid GameTextInput library handle."] - #[doc = " @param flags Defined in HideImeFlags above. For more information see:"] - #[doc = " https://developer.android.com/reference/android/view/inputmethod/InputMethodManager"] - pub fn GameTextInput_hideIme(input: *mut GameTextInput, flags: u32); -} -extern "C" { - #[doc = " Call a callback with the current GameTextInput state, which may have been"] - #[doc = " modified by changes in the IME and calls to GameTextInput_setState. We use a"] - #[doc = " callback rather than returning the state in order to simplify ownership of"] - #[doc = " text_UTF8 strings. These strings are only valid during the calling of the"] - #[doc = " callback."] - #[doc = " @param input A valid GameTextInput library handle."] - #[doc = " @param callback A function that will be called with valid state."] - #[doc = " @param context Context used by the callback."] - pub fn GameTextInput_getState( - input: *mut GameTextInput, - callback: GameTextInputGetStateCallback, - context: *mut ::std::os::raw::c_void, - ); -} -extern "C" { - #[doc = " Set the current GameTextInput state. This state is reflected to any active"] - #[doc = " IME."] - #[doc = " @param input A valid GameTextInput library handle."] - #[doc = " @param state The state to set. Ownership is maintained by the caller and must"] - #[doc = " remain valid for the duration of the call."] - pub fn GameTextInput_setState(input: *mut GameTextInput, state: *const GameTextInputState); -} -#[doc = " Type of the callback needed by GameTextInput_setEventCallback that will be"] -#[doc = " called every time the IME state changes."] -#[doc = " @param context User-defined context set in GameTextInput_setEventCallback."] -#[doc = " @param current_state Current IME state, owned by the library and valid during"] -#[doc = " the callback."] -pub type GameTextInputEventCallback = ::std::option::Option< - unsafe extern "C" fn( - context: *mut ::std::os::raw::c_void, - current_state: *const GameTextInputState, - ), ->; -extern "C" { - #[doc = " Optionally set a callback to be called whenever the IME state changes."] - #[doc = " Not necessary if you are using GameActivity, which handles these callbacks"] - #[doc = " for you."] - #[doc = " @param input A valid GameTextInput library handle."] - #[doc = " @param callback Called by the library when the IME state changes."] - #[doc = " @param context Context passed as first argument to the callback."] - pub fn GameTextInput_setEventCallback( - input: *mut GameTextInput, - callback: GameTextInputEventCallback, - context: *mut ::std::os::raw::c_void, - ); -} -#[doc = " Type of the callback needed by GameTextInput_setImeInsetsCallback that will"] -#[doc = " be called every time the IME window insets change."] -#[doc = " @param context User-defined context set in"] -#[doc = " GameTextInput_setImeWIndowInsetsCallback."] -#[doc = " @param current_insets Current IME insets, owned by the library and valid"] -#[doc = " during the callback."] -pub type GameTextInputImeInsetsCallback = ::std::option::Option< - unsafe extern "C" fn(context: *mut ::std::os::raw::c_void, current_insets: *const ARect), ->; -extern "C" { - #[doc = " Optionally set a callback to be called whenever the IME insets change."] - #[doc = " Not necessary if you are using GameActivity, which handles these callbacks"] - #[doc = " for you."] - #[doc = " @param input A valid GameTextInput library handle."] - #[doc = " @param callback Called by the library when the IME insets change."] - #[doc = " @param context Context passed as first argument to the callback."] - pub fn GameTextInput_setImeInsetsCallback( - input: *mut GameTextInput, - callback: GameTextInputImeInsetsCallback, - context: *mut ::std::os::raw::c_void, - ); -} -extern "C" { - #[doc = " Get the current window insets for the IME."] - #[doc = " @param input A valid GameTextInput library handle."] - #[doc = " @param insets Filled with the current insets by this function."] - pub fn GameTextInput_getImeInsets(input: *const GameTextInput, insets: *mut ARect); -} -extern "C" { - #[doc = " Unless using GameActivity, it is required to call this function from your"] - #[doc = " Java gametextinput.Listener.onImeInsetsChanged method to"] - #[doc = " trigger any event callbacks. When using GameActivity, this does not need to"] - #[doc = " be called as insets processing is handled by the Activity."] - #[doc = " @param input A valid GameTextInput library handle."] - #[doc = " @param eventState A Java gametextinput.State object."] - pub fn GameTextInput_processImeInsets(input: *mut GameTextInput, insets: *const ARect); -} -extern "C" { - #[doc = " Convert a GameTextInputState struct to a Java gametextinput.State object."] - #[doc = " Don't forget to delete the returned Java local ref when you're done."] - #[doc = " @param input A valid GameTextInput library handle."] - #[doc = " @param state Input state to convert."] - #[doc = " @return A Java object of class gametextinput.State. The caller is required to"] - #[doc = " delete this local reference."] - pub fn GameTextInputState_toJava( - input: *const GameTextInput, - state: *const GameTextInputState, - ) -> jobject; -} -extern "C" { - #[doc = " Convert from a Java gametextinput.State object into a C GameTextInputState"] - #[doc = " struct."] - #[doc = " @param input A valid GameTextInput library handle."] - #[doc = " @param state A Java gametextinput.State object."] - #[doc = " @param callback A function called with the C struct, valid for the duration"] - #[doc = " of the call."] - #[doc = " @param context Context passed to the callback."] - pub fn GameTextInputState_fromJava( - input: *const GameTextInput, - state: jobject, - callback: GameTextInputGetStateCallback, - context: *mut ::std::os::raw::c_void, - ); -} -#[doc = " This structure defines the native side of an android.app.GameActivity."] -#[doc = " It is created by the framework, and handed to the application's native"] -#[doc = " code as it is being launched."] +#[doc = " \\brief Describe a key event that happened on the GameActivity SurfaceView.\n\n This is 1:1 mapping to the information contained in a Java `KeyEvent`\n (see https://developer.android.com/reference/android/view/KeyEvent).\n The only exception is the event times, which are reported as\n nanoseconds in this struct."] #[repr(C)] -pub struct GameActivity { - #[doc = " Pointer to the callback function table of the native application."] - #[doc = " You can set the functions here to your own callbacks. The callbacks"] - #[doc = " pointer itself here should not be changed; it is allocated and managed"] - #[doc = " for you by the framework."] - pub callbacks: *mut GameActivityCallbacks, - #[doc = " The global handle on the process's Java VM."] - pub vm: *mut JavaVM, - #[doc = " JNI context for the main thread of the app. Note that this field"] - #[doc = " can ONLY be used from the main thread of the process; that is, the"] - #[doc = " thread that calls into the GameActivityCallbacks."] - pub env: *mut JNIEnv, - #[doc = " The GameActivity object handle."] - pub javaGameActivity: jobject, - #[doc = " Path to this application's internal data directory."] - pub internalDataPath: *const ::std::os::raw::c_char, - #[doc = " Path to this application's external (removable/mountable) data directory."] - pub externalDataPath: *const ::std::os::raw::c_char, - #[doc = " The platform's SDK version code."] - pub sdkVersion: i32, - #[doc = " This is the native instance of the application. It is not used by"] - #[doc = " the framework, but can be set by the application to its own instance"] - #[doc = " state."] - pub instance: *mut ::std::os::raw::c_void, - #[doc = " Pointer to the Asset Manager instance for the application. The"] - #[doc = " application uses this to access binary assets bundled inside its own .apk"] - #[doc = " file."] - pub assetManager: *mut AAssetManager, - #[doc = " Available starting with Honeycomb: path to the directory containing"] - #[doc = " the application's OBB files (if any). If the app doesn't have any"] - #[doc = " OBB files, this directory may not exist."] - pub obbPath: *const ::std::os::raw::c_char, +#[derive(Debug, Copy, Clone)] +pub struct GameActivityKeyEvent { + pub deviceId: i32, + pub source: i32, + pub action: i32, + pub eventTime: i64, + pub downTime: i64, + pub flags: i32, + pub metaState: i32, + pub modifiers: i32, + pub repeatCount: i32, + pub keyCode: i32, + pub scanCode: i32, + pub unicodeChar: i32, } #[test] -fn bindgen_test_layout_GameActivity() { +fn bindgen_test_layout_GameActivityKeyEvent() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 80usize, - concat!("Size of: ", stringify!(GameActivity)) + ::std::mem::size_of::(), + 64usize, + concat!("Size of: ", stringify!(GameActivityKeyEvent)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(GameActivity)) + concat!("Alignment of ", stringify!(GameActivityKeyEvent)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).callbacks as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).deviceId) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(GameActivity), + stringify!(GameActivityKeyEvent), "::", - stringify!(callbacks) + stringify!(deviceId) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).source) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(GameActivityKeyEvent), + "::", + stringify!(source) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).vm as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).action) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(GameActivity), + stringify!(GameActivityKeyEvent), "::", - stringify!(vm) + stringify!(action) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).env as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).eventTime) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", - stringify!(GameActivity), + stringify!(GameActivityKeyEvent), "::", - stringify!(env) + stringify!(eventTime) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).javaGameActivity as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).downTime) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", - stringify!(GameActivity), + stringify!(GameActivityKeyEvent), "::", - stringify!(javaGameActivity) + stringify!(downTime) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).internalDataPath as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", - stringify!(GameActivity), + stringify!(GameActivityKeyEvent), "::", - stringify!(internalDataPath) + stringify!(flags) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).metaState) as usize - ptr as usize }, + 36usize, + concat!( + "Offset of field: ", + stringify!(GameActivityKeyEvent), + "::", + stringify!(metaState) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).externalDataPath as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).modifiers) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", - stringify!(GameActivity), + stringify!(GameActivityKeyEvent), "::", - stringify!(externalDataPath) + stringify!(modifiers) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sdkVersion as *const _ as usize }, - 48usize, + unsafe { ::std::ptr::addr_of!((*ptr).repeatCount) as usize - ptr as usize }, + 44usize, concat!( "Offset of field: ", - stringify!(GameActivity), + stringify!(GameActivityKeyEvent), "::", - stringify!(sdkVersion) + stringify!(repeatCount) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).instance as *const _ as usize }, - 56usize, + unsafe { ::std::ptr::addr_of!((*ptr).keyCode) as usize - ptr as usize }, + 48usize, concat!( "Offset of field: ", - stringify!(GameActivity), + stringify!(GameActivityKeyEvent), "::", - stringify!(instance) + stringify!(keyCode) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).assetManager as *const _ as usize }, - 64usize, + unsafe { ::std::ptr::addr_of!((*ptr).scanCode) as usize - ptr as usize }, + 52usize, concat!( "Offset of field: ", - stringify!(GameActivity), + stringify!(GameActivityKeyEvent), "::", - stringify!(assetManager) + stringify!(scanCode) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).obbPath as *const _ as usize }, - 72usize, + unsafe { ::std::ptr::addr_of!((*ptr).unicodeChar) as usize - ptr as usize }, + 56usize, concat!( "Offset of field: ", - stringify!(GameActivity), + stringify!(GameActivityKeyEvent), "::", - stringify!(obbPath) + stringify!(unicodeChar) ) ); } -#[doc = " \\brief Describe information about a pointer, found in a"] -#[doc = " GameActivityMotionEvent."] -#[doc = ""] -#[doc = " You can read values directly from this structure, or use helper functions"] -#[doc = " (`GameActivityPointerAxes_getX`, `GameActivityPointerAxes_getY` and"] -#[doc = " `GameActivityPointerAxes_getAxisValue`)."] -#[doc = ""] -#[doc = " The X axis and Y axis are enabled by default but any other axis that you want"] -#[doc = " to read **must** be enabled first, using"] -#[doc = " `GameActivityPointerAxes_enableAxis`."] -#[doc = ""] -#[doc = " \\see GameActivityMotionEvent"] +extern "C" { + #[doc = " \\brief Convert a Java `KeyEvent` to a `GameActivityKeyEvent`.\n\n This is done automatically by the GameActivity: see `onKeyUp` and `onKeyDown`\n to set a callback to consume the received events.\n This function can be used if you re-implement events handling in your own\n activity.\n Ownership of out_event is maintained by the caller."] + pub fn GameActivityKeyEvent_fromJava( + env: *mut JNIEnv, + motionEvent: jobject, + out_event: *mut GameActivityKeyEvent, + ); +} +pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_CAPTION_BAR: GameCommonInsetsType = 0; +pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_DISPLAY_CUTOUT: GameCommonInsetsType = 1; +pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_IME: GameCommonInsetsType = 2; +pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_MANDATORY_SYSTEM_GESTURES: + GameCommonInsetsType = 3; +pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_NAVIGATION_BARS: GameCommonInsetsType = 4; +pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_STATUS_BARS: GameCommonInsetsType = 5; +pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_SYSTEM_BARS: GameCommonInsetsType = 6; +pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_SYSTEM_GESTURES: GameCommonInsetsType = 7; +pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_TAPABLE_ELEMENT: GameCommonInsetsType = 8; +pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_WATERFALL: GameCommonInsetsType = 9; +pub const GameCommonInsetsType_GAMECOMMON_INSETS_TYPE_COUNT: GameCommonInsetsType = 10; +#[doc = " The type of a component for which to retrieve insets. See\n https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type"] +pub type GameCommonInsetsType = ::std::os::raw::c_uint; +#[doc = " This struct holds a span within a region of text from start (inclusive) to\n end (exclusive). An empty span or cursor position is specified with\n start==end. An undefined span is specified with start = end = SPAN_UNDEFINED."] #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct GameActivityPointerAxes { - pub id: i32, - pub toolType: i32, - pub axisValues: [f32; 48usize], - pub rawX: f32, - pub rawY: f32, +pub struct GameTextInputSpan { + #[doc = " The start of the region (inclusive)."] + pub start: i32, + #[doc = " The end of the region (exclusive)."] + pub end: i32, } #[test] -fn bindgen_test_layout_GameActivityPointerAxes() { +fn bindgen_test_layout_GameTextInputSpan() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 208usize, - concat!("Size of: ", stringify!(GameActivityPointerAxes)) + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(GameTextInputSpan)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(GameActivityPointerAxes)) + concat!("Alignment of ", stringify!(GameTextInputSpan)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).id as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).start) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(GameActivityPointerAxes), + stringify!(GameTextInputSpan), "::", - stringify!(id) + stringify!(start) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).toolType as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).end) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", - stringify!(GameActivityPointerAxes), + stringify!(GameTextInputSpan), "::", - stringify!(toolType) + stringify!(end) ) ); +} +pub const GameTextInputSpanFlag_SPAN_UNDEFINED: GameTextInputSpanFlag = -1; +#[doc = " Values with special meaning in a GameTextInputSpan."] +pub type GameTextInputSpanFlag = ::std::os::raw::c_int; +#[doc = " This struct holds the state of an editable section of text.\n The text can have a selection and a composing region defined on it.\n A composing region is used by IMEs that allow input using multiple steps to\n compose a glyph or word. Use functions GameTextInput_getState and\n GameTextInput_setState to read and modify the state that an IME is editing."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GameTextInputState { + #[doc = " Text owned by the state, as a modified UTF-8 string. Null-terminated.\n https://en.wikipedia.org/wiki/UTF-8#Modified_UTF-8"] + pub text_UTF8: *const ::std::os::raw::c_char, + #[doc = " Length in bytes of text_UTF8, *not* including the null at end."] + pub text_length: i32, + #[doc = " A selection defined on the text."] + pub selection: GameTextInputSpan, + #[doc = " A composing region defined on the text."] + pub composingRegion: GameTextInputSpan, +} +#[test] +fn bindgen_test_layout_GameTextInputState() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(GameTextInputState)) + ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).axisValues as *const _ as usize - }, + ::std::mem::align_of::(), 8usize, + concat!("Alignment of ", stringify!(GameTextInputState)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).text_UTF8) as usize - ptr as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(GameActivityPointerAxes), + stringify!(GameTextInputState), "::", - stringify!(axisValues) + stringify!(text_UTF8) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).rawX as *const _ as usize }, - 200usize, + unsafe { ::std::ptr::addr_of!((*ptr).text_length) as usize - ptr as usize }, + 8usize, concat!( "Offset of field: ", - stringify!(GameActivityPointerAxes), + stringify!(GameTextInputState), "::", - stringify!(rawX) + stringify!(text_length) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).rawY as *const _ as usize }, - 204usize, - concat!( - "Offset of field: ", - stringify!(GameActivityPointerAxes), - "::", - stringify!(rawY) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct GameActivityHistoricalPointerAxes { - pub eventTime: i64, - pub axisValues: [f32; 48usize], -} -#[test] -fn bindgen_test_layout_GameActivityHistoricalPointerAxes() { - assert_eq!( - ::std::mem::size_of::(), - 200usize, - concat!("Size of: ", stringify!(GameActivityHistoricalPointerAxes)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(GameActivityHistoricalPointerAxes) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).eventTime as *const _ - as usize - }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).selection) as usize - ptr as usize }, + 12usize, concat!( "Offset of field: ", - stringify!(GameActivityHistoricalPointerAxes), + stringify!(GameTextInputState), "::", - stringify!(eventTime) + stringify!(selection) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).axisValues as *const _ - as usize - }, - 8usize, + unsafe { ::std::ptr::addr_of!((*ptr).composingRegion) as usize - ptr as usize }, + 20usize, concat!( "Offset of field: ", - stringify!(GameActivityHistoricalPointerAxes), + stringify!(GameTextInputState), "::", - stringify!(axisValues) + stringify!(composingRegion) ) ); } +#[doc = " A callback called by GameTextInput_getState.\n @param context User-defined context.\n @param state State, owned by the library, that will be valid for the duration\n of the callback."] +pub type GameTextInputGetStateCallback = ::std::option::Option< + unsafe extern "C" fn(context: *mut ::std::os::raw::c_void, state: *const GameTextInputState), +>; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct GameTextInput { + _unused: [u8; 0], +} extern "C" { - #[doc = " \\brief Enable the specified axis, so that its value is reported in the"] - #[doc = " GameActivityPointerAxes structures stored in a motion event."] - #[doc = ""] - #[doc = " You must enable any axis that you want to read, apart from"] - #[doc = " `AMOTION_EVENT_AXIS_X` and `AMOTION_EVENT_AXIS_Y` that are enabled by"] - #[doc = " default."] - #[doc = ""] - #[doc = " If the axis index is out of range, nothing is done."] - pub fn GameActivityPointerAxes_enableAxis(axis: i32); + #[doc = " Initialize the GameTextInput library.\n If called twice without GameTextInput_destroy being called, the same pointer\n will be returned and a warning will be issued.\n @param env A JNI env valid on the calling thread.\n @param max_string_size The maximum length of a string that can be edited. If\n zero, the maximum defaults to 65536 bytes. A buffer of this size is allocated\n at initialization.\n @return A handle to the library."] + pub fn GameTextInput_init(env: *mut JNIEnv, max_string_size: u32) -> *mut GameTextInput; } extern "C" { - #[doc = " \\brief Disable the specified axis. Its value won't be reported in the"] - #[doc = " GameActivityPointerAxes structures stored in a motion event anymore."] - #[doc = ""] - #[doc = " Apart from X and Y, any axis that you want to read **must** be enabled first,"] - #[doc = " using `GameActivityPointerAxes_enableAxis`."] - #[doc = ""] - #[doc = " If the axis index is out of range, nothing is done."] - pub fn GameActivityPointerAxes_disableAxis(axis: i32); + #[doc = " When using GameTextInput, you need to create a gametextinput.InputConnection\n on the Java side and pass it using this function to the library, unless using\n GameActivity in which case this will be done for you. See the GameActivity\n source code or GameTextInput samples for examples of usage.\n @param input A valid GameTextInput library handle.\n @param inputConnection A gametextinput.InputConnection object."] + pub fn GameTextInput_setInputConnection(input: *mut GameTextInput, inputConnection: jobject); } extern "C" { - #[doc = " \\brief Enable the specified axis, so that its value is reported in the"] - #[doc = " GameActivityHistoricalPointerAxes structures associated with a motion event."] - #[doc = ""] - #[doc = " You must enable any axis that you want to read (no axes are enabled by"] - #[doc = " default)."] - #[doc = ""] - #[doc = " If the axis index is out of range, nothing is done."] - pub fn GameActivityHistoricalPointerAxes_enableAxis(axis: i32); + #[doc = " Unless using GameActivity, it is required to call this function from your\n Java gametextinput.Listener.stateChanged method to convert eventState and\n trigger any event callbacks. When using GameActivity, this does not need to\n be called as event processing is handled by the Activity.\n @param input A valid GameTextInput library handle.\n @param eventState A Java gametextinput.State object."] + pub fn GameTextInput_processEvent(input: *mut GameTextInput, eventState: jobject); } extern "C" { - #[doc = " \\brief Disable the specified axis. Its value won't be reported in the"] - #[doc = " GameActivityHistoricalPointerAxes structures associated with motion events"] - #[doc = " anymore."] - #[doc = ""] - #[doc = " If the axis index is out of range, nothing is done."] - pub fn GameActivityHistoricalPointerAxes_disableAxis(axis: i32); + #[doc = " Free any resources owned by the GameTextInput library.\n Any subsequent calls to the library will fail until GameTextInput_init is\n called again.\n @param input A valid GameTextInput library handle."] + pub fn GameTextInput_destroy(input: *mut GameTextInput); } -#[doc = " \\brief Describe a motion event that happened on the GameActivity SurfaceView."] -#[doc = ""] -#[doc = " This is 1:1 mapping to the information contained in a Java `MotionEvent`"] -#[doc = " (see https://developer.android.com/reference/android/view/MotionEvent)."] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct GameActivityMotionEvent { - pub deviceId: i32, - pub source: i32, - pub action: i32, - pub eventTime: i64, - pub downTime: i64, - pub flags: i32, - pub metaState: i32, - pub actionButton: i32, - pub buttonState: i32, - pub classification: i32, - pub edgeFlags: i32, - pub pointerCount: u32, - pub pointers: [GameActivityPointerAxes; 8usize], - pub precisionX: f32, - pub precisionY: f32, - pub historicalStart: i16, - pub historicalCount: i16, +pub const ShowImeFlags_SHOW_IME_UNDEFINED: ShowImeFlags = 0; +pub const ShowImeFlags_SHOW_IMPLICIT: ShowImeFlags = 1; +pub const ShowImeFlags_SHOW_FORCED: ShowImeFlags = 2; +#[doc = " Flags to be passed to GameTextInput_showIme."] +pub type ShowImeFlags = ::std::os::raw::c_uint; +extern "C" { + #[doc = " Show the IME. Calls InputMethodManager.showSoftInput().\n @param input A valid GameTextInput library handle.\n @param flags Defined in ShowImeFlags above. For more information see:\n https://developer.android.com/reference/android/view/inputmethod/InputMethodManager"] + pub fn GameTextInput_showIme(input: *mut GameTextInput, flags: u32); } -#[test] -fn bindgen_test_layout_GameActivityMotionEvent() { - assert_eq!( - ::std::mem::size_of::(), - 1736usize, - concat!("Size of: ", stringify!(GameActivityMotionEvent)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(GameActivityMotionEvent)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).deviceId as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(GameActivityMotionEvent), - "::", - stringify!(deviceId) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).source as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(GameActivityMotionEvent), - "::", - stringify!(source) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).action as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(GameActivityMotionEvent), - "::", - stringify!(action) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).eventTime as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(GameActivityMotionEvent), - "::", - stringify!(eventTime) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).downTime as *const _ as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(GameActivityMotionEvent), - "::", - stringify!(downTime) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(GameActivityMotionEvent), - "::", - stringify!(flags) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).metaState as *const _ as usize - }, - 36usize, - concat!( - "Offset of field: ", - stringify!(GameActivityMotionEvent), - "::", - stringify!(metaState) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).actionButton as *const _ as usize - }, - 40usize, - concat!( - "Offset of field: ", - stringify!(GameActivityMotionEvent), - "::", - stringify!(actionButton) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).buttonState as *const _ as usize - }, - 44usize, - concat!( - "Offset of field: ", - stringify!(GameActivityMotionEvent), - "::", - stringify!(buttonState) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).classification as *const _ as usize - }, - 48usize, - concat!( - "Offset of field: ", - stringify!(GameActivityMotionEvent), - "::", - stringify!(classification) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).edgeFlags as *const _ as usize - }, - 52usize, - concat!( - "Offset of field: ", - stringify!(GameActivityMotionEvent), - "::", - stringify!(edgeFlags) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pointerCount as *const _ as usize - }, - 56usize, - concat!( - "Offset of field: ", - stringify!(GameActivityMotionEvent), - "::", - stringify!(pointerCount) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pointers as *const _ as usize - }, - 60usize, - concat!( - "Offset of field: ", - stringify!(GameActivityMotionEvent), - "::", - stringify!(pointers) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).precisionX as *const _ as usize - }, - 1724usize, - concat!( - "Offset of field: ", - stringify!(GameActivityMotionEvent), - "::", - stringify!(precisionX) - ) +pub const HideImeFlags_HIDE_IME_UNDEFINED: HideImeFlags = 0; +pub const HideImeFlags_HIDE_IMPLICIT_ONLY: HideImeFlags = 1; +pub const HideImeFlags_HIDE_NOT_ALWAYS: HideImeFlags = 2; +#[doc = " Flags to be passed to GameTextInput_hideIme."] +pub type HideImeFlags = ::std::os::raw::c_uint; +extern "C" { + #[doc = " Show the IME. Calls InputMethodManager.hideSoftInputFromWindow().\n @param input A valid GameTextInput library handle.\n @param flags Defined in HideImeFlags above. For more information see:\n https://developer.android.com/reference/android/view/inputmethod/InputMethodManager"] + pub fn GameTextInput_hideIme(input: *mut GameTextInput, flags: u32); +} +extern "C" { + #[doc = " Restarts the input method. Calls InputMethodManager.restartInput().\n @param input A valid GameTextInput library handle."] + pub fn GameTextInput_restartInput(input: *mut GameTextInput); +} +extern "C" { + #[doc = " Call a callback with the current GameTextInput state, which may have been\n modified by changes in the IME and calls to GameTextInput_setState. We use a\n callback rather than returning the state in order to simplify ownership of\n text_UTF8 strings. These strings are only valid during the calling of the\n callback.\n @param input A valid GameTextInput library handle.\n @param callback A function that will be called with valid state.\n @param context Context used by the callback."] + pub fn GameTextInput_getState( + input: *mut GameTextInput, + callback: GameTextInputGetStateCallback, + context: *mut ::std::os::raw::c_void, ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).precisionY as *const _ as usize - }, - 1728usize, - concat!( - "Offset of field: ", - stringify!(GameActivityMotionEvent), - "::", - stringify!(precisionY) - ) +} +extern "C" { + #[doc = " Set the current GameTextInput state. This state is reflected to any active\n IME.\n @param input A valid GameTextInput library handle.\n @param state The state to set. Ownership is maintained by the caller and must\n remain valid for the duration of the call."] + pub fn GameTextInput_setState(input: *mut GameTextInput, state: *const GameTextInputState); +} +#[doc = " Type of the callback needed by GameTextInput_setEventCallback that will be\n called every time the IME state changes.\n @param context User-defined context set in GameTextInput_setEventCallback.\n @param current_state Current IME state, owned by the library and valid during\n the callback."] +pub type GameTextInputEventCallback = ::std::option::Option< + unsafe extern "C" fn( + context: *mut ::std::os::raw::c_void, + current_state: *const GameTextInputState, + ), +>; +extern "C" { + #[doc = " Optionally set a callback to be called whenever the IME state changes.\n Not necessary if you are using GameActivity, which handles these callbacks\n for you.\n @param input A valid GameTextInput library handle.\n @param callback Called by the library when the IME state changes.\n @param context Context passed as first argument to the callback."] + pub fn GameTextInput_setEventCallback( + input: *mut GameTextInput, + callback: GameTextInputEventCallback, + context: *mut ::std::os::raw::c_void, ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).historicalStart as *const _ as usize - }, - 1732usize, - concat!( - "Offset of field: ", - stringify!(GameActivityMotionEvent), - "::", - stringify!(historicalStart) - ) +} +#[doc = " Type of the callback needed by GameTextInput_setImeInsetsCallback that will\n be called every time the IME window insets change.\n @param context User-defined context set in\n GameTextInput_setImeWIndowInsetsCallback.\n @param current_insets Current IME insets, owned by the library and valid\n during the callback."] +pub type GameTextInputImeInsetsCallback = ::std::option::Option< + unsafe extern "C" fn(context: *mut ::std::os::raw::c_void, current_insets: *const ARect), +>; +extern "C" { + #[doc = " Optionally set a callback to be called whenever the IME insets change.\n Not necessary if you are using GameActivity, which handles these callbacks\n for you.\n @param input A valid GameTextInput library handle.\n @param callback Called by the library when the IME insets change.\n @param context Context passed as first argument to the callback."] + pub fn GameTextInput_setImeInsetsCallback( + input: *mut GameTextInput, + callback: GameTextInputImeInsetsCallback, + context: *mut ::std::os::raw::c_void, ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).historicalCount as *const _ as usize - }, - 1734usize, - concat!( - "Offset of field: ", - stringify!(GameActivityMotionEvent), - "::", - stringify!(historicalCount) - ) +} +extern "C" { + #[doc = " Get the current window insets for the IME.\n @param input A valid GameTextInput library handle.\n @param insets Filled with the current insets by this function."] + pub fn GameTextInput_getImeInsets(input: *const GameTextInput, insets: *mut ARect); +} +extern "C" { + #[doc = " Unless using GameActivity, it is required to call this function from your\n Java gametextinput.Listener.onImeInsetsChanged method to\n trigger any event callbacks. When using GameActivity, this does not need to\n be called as insets processing is handled by the Activity.\n @param input A valid GameTextInput library handle.\n @param eventState A Java gametextinput.State object."] + pub fn GameTextInput_processImeInsets(input: *mut GameTextInput, insets: *const ARect); +} +extern "C" { + #[doc = " Convert a GameTextInputState struct to a Java gametextinput.State object.\n Don't forget to delete the returned Java local ref when you're done.\n @param input A valid GameTextInput library handle.\n @param state Input state to convert.\n @return A Java object of class gametextinput.State. The caller is required to\n delete this local reference."] + pub fn GameTextInputState_toJava( + input: *const GameTextInput, + state: *const GameTextInputState, + ) -> jobject; +} +extern "C" { + #[doc = " Convert from a Java gametextinput.State object into a C GameTextInputState\n struct.\n @param input A valid GameTextInput library handle.\n @param state A Java gametextinput.State object.\n @param callback A function called with the C struct, valid for the duration\n of the call.\n @param context Context passed to the callback."] + pub fn GameTextInputState_fromJava( + input: *const GameTextInput, + state: jobject, + callback: GameTextInputGetStateCallback, + context: *mut ::std::os::raw::c_void, ); } -#[doc = " \\brief Describe a key event that happened on the GameActivity SurfaceView."] -#[doc = ""] -#[doc = " This is 1:1 mapping to the information contained in a Java `KeyEvent`"] -#[doc = " (see https://developer.android.com/reference/android/view/KeyEvent)."] +#[doc = " This structure defines the native side of an android.app.GameActivity.\n It is created by the framework, and handed to the application's native\n code as it is being launched."] #[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct GameActivityKeyEvent { - pub deviceId: i32, - pub source: i32, - pub action: i32, - pub eventTime: i64, - pub downTime: i64, - pub flags: i32, - pub metaState: i32, - pub modifiers: i32, - pub repeatCount: i32, - pub keyCode: i32, - pub scanCode: i32, +pub struct GameActivity { + #[doc = " Pointer to the callback function table of the native application.\n You can set the functions here to your own callbacks. The callbacks\n pointer itself here should not be changed; it is allocated and managed\n for you by the framework."] + pub callbacks: *mut GameActivityCallbacks, + #[doc = " The global handle on the process's Java VM."] + pub vm: *mut JavaVM, + #[doc = " JNI context for the main thread of the app. Note that this field\n can ONLY be used from the main thread of the process; that is, the\n thread that calls into the GameActivityCallbacks."] + pub env: *mut JNIEnv, + #[doc = " The GameActivity object handle."] + pub javaGameActivity: jobject, + #[doc = " Path to this application's internal data directory."] + pub internalDataPath: *const ::std::os::raw::c_char, + #[doc = " Path to this application's external (removable/mountable) data directory."] + pub externalDataPath: *const ::std::os::raw::c_char, + #[doc = " The platform's SDK version code."] + pub sdkVersion: i32, + #[doc = " This is the native instance of the application. It is not used by\n the framework, but can be set by the application to its own instance\n state."] + pub instance: *mut ::std::os::raw::c_void, + #[doc = " Pointer to the Asset Manager instance for the application. The\n application uses this to access binary assets bundled inside its own .apk\n file."] + pub assetManager: *mut AAssetManager, + #[doc = " Available starting with Honeycomb: path to the directory containing\n the application's OBB files (if any). If the app doesn't have any\n OBB files, this directory may not exist."] + pub obbPath: *const ::std::os::raw::c_char, } #[test] -fn bindgen_test_layout_GameActivityKeyEvent() { +fn bindgen_test_layout_GameActivity() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 56usize, - concat!("Size of: ", stringify!(GameActivityKeyEvent)) + ::std::mem::size_of::(), + 80usize, + concat!("Size of: ", stringify!(GameActivity)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(GameActivityKeyEvent)) + concat!("Alignment of ", stringify!(GameActivity)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).deviceId as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).callbacks) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(GameActivityKeyEvent), - "::", - stringify!(deviceId) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).source as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(GameActivityKeyEvent), + stringify!(GameActivity), "::", - stringify!(source) + stringify!(callbacks) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).action as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).vm) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(GameActivityKeyEvent), + stringify!(GameActivity), "::", - stringify!(action) + stringify!(vm) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).eventTime as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).env) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", - stringify!(GameActivityKeyEvent), + stringify!(GameActivity), "::", - stringify!(eventTime) + stringify!(env) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).downTime as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).javaGameActivity) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", - stringify!(GameActivityKeyEvent), + stringify!(GameActivity), "::", - stringify!(downTime) + stringify!(javaGameActivity) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).internalDataPath) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", - stringify!(GameActivityKeyEvent), + stringify!(GameActivity), "::", - stringify!(flags) + stringify!(internalDataPath) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).metaState as *const _ as usize }, - 36usize, + unsafe { ::std::ptr::addr_of!((*ptr).externalDataPath) as usize - ptr as usize }, + 40usize, concat!( "Offset of field: ", - stringify!(GameActivityKeyEvent), + stringify!(GameActivity), "::", - stringify!(metaState) + stringify!(externalDataPath) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).modifiers as *const _ as usize }, - 40usize, + unsafe { ::std::ptr::addr_of!((*ptr).sdkVersion) as usize - ptr as usize }, + 48usize, concat!( "Offset of field: ", - stringify!(GameActivityKeyEvent), + stringify!(GameActivity), "::", - stringify!(modifiers) + stringify!(sdkVersion) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).repeatCount as *const _ as usize - }, - 44usize, + unsafe { ::std::ptr::addr_of!((*ptr).instance) as usize - ptr as usize }, + 56usize, concat!( "Offset of field: ", - stringify!(GameActivityKeyEvent), + stringify!(GameActivity), "::", - stringify!(repeatCount) + stringify!(instance) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).keyCode as *const _ as usize }, - 48usize, + unsafe { ::std::ptr::addr_of!((*ptr).assetManager) as usize - ptr as usize }, + 64usize, concat!( "Offset of field: ", - stringify!(GameActivityKeyEvent), + stringify!(GameActivity), "::", - stringify!(keyCode) + stringify!(assetManager) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).scanCode as *const _ as usize }, - 52usize, + unsafe { ::std::ptr::addr_of!((*ptr).obbPath) as usize - ptr as usize }, + 72usize, concat!( "Offset of field: ", - stringify!(GameActivityKeyEvent), + stringify!(GameActivity), "::", - stringify!(scanCode) + stringify!(obbPath) ) ); } -#[doc = " A function the user should call from their callback with the data, its length"] -#[doc = " and the library- supplied context."] +#[doc = " A function the user should call from their callback with the data, its length\n and the library- supplied context."] pub type SaveInstanceStateRecallback = ::std::option::Option< unsafe extern "C" fn( bytes: *const ::std::os::raw::c_char, @@ -3245,18 +3201,11 @@ pub type SaveInstanceStateRecallback = ::std::option::Option< #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct GameActivityCallbacks { - #[doc = " GameActivity has started. See Java documentation for Activity.onStart()"] - #[doc = " for more information."] + #[doc = " GameActivity has started. See Java documentation for Activity.onStart()\n for more information."] pub onStart: ::std::option::Option, - #[doc = " GameActivity has resumed. See Java documentation for Activity.onResume()"] - #[doc = " for more information."] + #[doc = " GameActivity has resumed. See Java documentation for Activity.onResume()\n for more information."] pub onResume: ::std::option::Option, - #[doc = " The framework is asking GameActivity to save its current instance state."] - #[doc = " See the Java documentation for Activity.onSaveInstanceState() for more"] - #[doc = " information. The user should call the recallback with their data, its"] - #[doc = " length and the provided context; they retain ownership of the data. Note"] - #[doc = " that the saved state will be persisted, so it can not contain any active"] - #[doc = " entities (pointers to memory, file descriptors, etc)."] + #[doc = " The framework is asking GameActivity to save its current instance state.\n See the Java documentation for Activity.onSaveInstanceState() for more\n information. The user should call the recallback with their data, its\n length and the provided context; they retain ownership of the data. Note\n that the saved state will be persisted, so it can not contain any active\n entities (pointers to memory, file descriptors, etc)."] pub onSaveInstanceState: ::std::option::Option< unsafe extern "C" fn( activity: *mut GameActivity, @@ -3264,27 +3213,20 @@ pub struct GameActivityCallbacks { context: *mut ::std::os::raw::c_void, ), >, - #[doc = " GameActivity has paused. See Java documentation for Activity.onPause()"] - #[doc = " for more information."] + #[doc = " GameActivity has paused. See Java documentation for Activity.onPause()\n for more information."] pub onPause: ::std::option::Option, - #[doc = " GameActivity has stopped. See Java documentation for Activity.onStop()"] - #[doc = " for more information."] + #[doc = " GameActivity has stopped. See Java documentation for Activity.onStop()\n for more information."] pub onStop: ::std::option::Option, - #[doc = " GameActivity is being destroyed. See Java documentation for"] - #[doc = " Activity.onDestroy() for more information."] + #[doc = " GameActivity is being destroyed. See Java documentation for\n Activity.onDestroy() for more information."] pub onDestroy: ::std::option::Option, - #[doc = " Focus has changed in this GameActivity's window. This is often used,"] - #[doc = " for example, to pause a game when it loses input focus."] + #[doc = " Focus has changed in this GameActivity's window. This is often used,\n for example, to pause a game when it loses input focus."] pub onWindowFocusChanged: ::std::option::Option, - #[doc = " The drawing window for this native activity has been created. You"] - #[doc = " can use the given native window object to start drawing."] + #[doc = " The drawing window for this native activity has been created. You\n can use the given native window object to start drawing."] pub onNativeWindowCreated: ::std::option::Option< unsafe extern "C" fn(activity: *mut GameActivity, window: *mut ANativeWindow), >, - #[doc = " The drawing window for this native activity has been resized. You should"] - #[doc = " retrieve the new size from the window and ensure that your rendering in"] - #[doc = " it now matches."] + #[doc = " The drawing window for this native activity has been resized. You should\n retrieve the new size from the window and ensure that your rendering in\n it now matches."] pub onNativeWindowResized: ::std::option::Option< unsafe extern "C" fn( activity: *mut GameActivity, @@ -3293,77 +3235,62 @@ pub struct GameActivityCallbacks { newHeight: i32, ), >, - #[doc = " The drawing window for this native activity needs to be redrawn. To"] - #[doc = " avoid transient artifacts during screen changes (such resizing after"] - #[doc = " rotation), applications should not return from this function until they"] - #[doc = " have finished drawing their window in its current state."] + #[doc = " The drawing window for this native activity needs to be redrawn. To\n avoid transient artifacts during screen changes (such resizing after\n rotation), applications should not return from this function until they\n have finished drawing their window in its current state."] pub onNativeWindowRedrawNeeded: ::std::option::Option< unsafe extern "C" fn(activity: *mut GameActivity, window: *mut ANativeWindow), >, - #[doc = " The drawing window for this native activity is going to be destroyed."] - #[doc = " You MUST ensure that you do not touch the window object after returning"] - #[doc = " from this function: in the common case of drawing to the window from"] - #[doc = " another thread, that means the implementation of this callback must"] - #[doc = " properly synchronize with the other thread to stop its drawing before"] - #[doc = " returning from here."] + #[doc = " The drawing window for this native activity is going to be destroyed.\n You MUST ensure that you do not touch the window object after returning\n from this function: in the common case of drawing to the window from\n another thread, that means the implementation of this callback must\n properly synchronize with the other thread to stop its drawing before\n returning from here."] pub onNativeWindowDestroyed: ::std::option::Option< unsafe extern "C" fn(activity: *mut GameActivity, window: *mut ANativeWindow), >, - #[doc = " The current device AConfiguration has changed. The new configuration can"] - #[doc = " be retrieved from assetManager."] + #[doc = " The current device AConfiguration has changed. The new configuration can\n be retrieved from assetManager."] pub onConfigurationChanged: ::std::option::Option, - #[doc = " The system is running low on memory. Use this callback to release"] - #[doc = " resources you do not need, to help the system avoid killing more"] - #[doc = " important processes."] + #[doc = " The system is running low on memory. Use this callback to release\n resources you do not need, to help the system avoid killing more\n important processes."] pub onTrimMemory: ::std::option::Option< unsafe extern "C" fn(activity: *mut GameActivity, level: ::std::os::raw::c_int), >, - #[doc = " Callback called for every MotionEvent done on the GameActivity"] - #[doc = " SurfaceView. Ownership of `event` is maintained by the library and it is"] - #[doc = " only valid during the callback."] + #[doc = " Callback called for every MotionEvent done on the GameActivity\n SurfaceView. Ownership of `event` is maintained by the library and it is\n only valid during the callback."] pub onTouchEvent: ::std::option::Option< unsafe extern "C" fn( activity: *mut GameActivity, event: *const GameActivityMotionEvent, - historical: *const GameActivityHistoricalPointerAxes, - historicalLen: ::std::os::raw::c_int, ) -> bool, >, - #[doc = " Callback called for every key down event on the GameActivity SurfaceView."] - #[doc = " Ownership of `event` is maintained by the library and it is only valid"] - #[doc = " during the callback."] + #[doc = " Callback called for every key down event on the GameActivity SurfaceView.\n Ownership of `event` is maintained by the library and it is only valid\n during the callback."] pub onKeyDown: ::std::option::Option< unsafe extern "C" fn( activity: *mut GameActivity, event: *const GameActivityKeyEvent, ) -> bool, >, - #[doc = " Callback called for every key up event on the GameActivity SurfaceView."] - #[doc = " Ownership of `event` is maintained by the library and it is only valid"] - #[doc = " during the callback."] + #[doc = " Callback called for every key up event on the GameActivity SurfaceView.\n Ownership of `event` is maintained by the library and it is only valid\n during the callback."] pub onKeyUp: ::std::option::Option< unsafe extern "C" fn( activity: *mut GameActivity, event: *const GameActivityKeyEvent, ) -> bool, >, - #[doc = " Callback called for every soft-keyboard text input event."] - #[doc = " Ownership of `state` is maintained by the library and it is only valid"] - #[doc = " during the callback."] + #[doc = " Callback called for every soft-keyboard text input event.\n Ownership of `state` is maintained by the library and it is only valid\n during the callback."] pub onTextInputEvent: ::std::option::Option< unsafe extern "C" fn(activity: *mut GameActivity, state: *const GameTextInputState), >, - #[doc = " Callback called when WindowInsets of the main app window have changed."] - #[doc = " Call GameActivity_getWindowInsets to retrieve the insets themselves."] + #[doc = " Callback called when WindowInsets of the main app window have changed.\n Call GameActivity_getWindowInsets to retrieve the insets themselves."] pub onWindowInsetsChanged: ::std::option::Option, + #[doc = " Callback called when the rectangle in the window where the content\n should be placed has changed."] + pub onContentRectChanged: ::std::option::Option< + unsafe extern "C" fn(activity: *mut GameActivity, rect: *const ARect), + >, } #[test] fn bindgen_test_layout_GameActivityCallbacks() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 144usize, + 152usize, concat!("Size of: ", stringify!(GameActivityCallbacks)) ); assert_eq!( @@ -3372,7 +3299,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { concat!("Alignment of ", stringify!(GameActivityCallbacks)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).onStart as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).onStart) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -3382,7 +3309,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).onResume as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).onResume) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -3392,10 +3319,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onSaveInstanceState as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).onSaveInstanceState) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -3405,7 +3329,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).onPause as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).onPause) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -3415,7 +3339,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).onStop as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).onStop) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -3425,7 +3349,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).onDestroy as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).onDestroy) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", @@ -3435,10 +3359,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onWindowFocusChanged as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).onWindowFocusChanged) as usize - ptr as usize }, 48usize, concat!( "Offset of field: ", @@ -3448,10 +3369,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onNativeWindowCreated as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).onNativeWindowCreated) as usize - ptr as usize }, 56usize, concat!( "Offset of field: ", @@ -3461,10 +3379,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onNativeWindowResized as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).onNativeWindowResized) as usize - ptr as usize }, 64usize, concat!( "Offset of field: ", @@ -3474,10 +3389,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onNativeWindowRedrawNeeded as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).onNativeWindowRedrawNeeded) as usize - ptr as usize }, 72usize, concat!( "Offset of field: ", @@ -3487,10 +3399,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onNativeWindowDestroyed as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).onNativeWindowDestroyed) as usize - ptr as usize }, 80usize, concat!( "Offset of field: ", @@ -3500,10 +3409,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onConfigurationChanged as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).onConfigurationChanged) as usize - ptr as usize }, 88usize, concat!( "Offset of field: ", @@ -3513,9 +3419,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onTrimMemory as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).onTrimMemory) as usize - ptr as usize }, 96usize, concat!( "Offset of field: ", @@ -3525,9 +3429,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onTouchEvent as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).onTouchEvent) as usize - ptr as usize }, 104usize, concat!( "Offset of field: ", @@ -3537,7 +3439,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).onKeyDown as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).onKeyDown) as usize - ptr as usize }, 112usize, concat!( "Offset of field: ", @@ -3547,7 +3449,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).onKeyUp as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).onKeyUp) as usize - ptr as usize }, 120usize, concat!( "Offset of field: ", @@ -3557,9 +3459,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onTextInputEvent as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).onTextInputEvent) as usize - ptr as usize }, 128usize, concat!( "Offset of field: ", @@ -3569,10 +3469,7 @@ fn bindgen_test_layout_GameActivityCallbacks() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onWindowInsetsChanged as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).onWindowInsetsChanged) as usize - ptr as usize }, 136usize, concat!( "Offset of field: ", @@ -3581,269 +3478,124 @@ fn bindgen_test_layout_GameActivityCallbacks() { stringify!(onWindowInsetsChanged) ) ); -} -extern "C" { - #[doc = " \\brief Convert a Java `MotionEvent` to a `GameActivityMotionEvent`."] - #[doc = ""] - #[doc = " This is done automatically by the GameActivity: see `onTouchEvent` to set"] - #[doc = " a callback to consume the received events."] - #[doc = " This function can be used if you re-implement events handling in your own"] - #[doc = " activity. On return, the out_event->historicalStart will be zero, and should"] - #[doc = " be updated to index into whatever buffer out_historical is copied."] - #[doc = " On return the length of out_historical is"] - #[doc = " (out_event->pointerCount x out_event->historicalCount) and is in a"] - #[doc = " pointer-major order (i.e. all axis for a pointer are contiguous)"] - #[doc = " Ownership of out_event is maintained by the caller."] - pub fn GameActivityMotionEvent_fromJava( - env: *mut JNIEnv, - motionEvent: jobject, - out_event: *mut GameActivityMotionEvent, - out_historical: *mut GameActivityHistoricalPointerAxes, - ) -> ::std::os::raw::c_int; -} -extern "C" { - #[doc = " \\brief Convert a Java `KeyEvent` to a `GameActivityKeyEvent`."] - #[doc = ""] - #[doc = " This is done automatically by the GameActivity: see `onKeyUp` and `onKeyDown`"] - #[doc = " to set a callback to consume the received events."] - #[doc = " This function can be used if you re-implement events handling in your own"] - #[doc = " activity."] - #[doc = " Ownership of out_event is maintained by the caller."] - pub fn GameActivityKeyEvent_fromJava( - env: *mut JNIEnv, - motionEvent: jobject, - out_event: *mut GameActivityKeyEvent, + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).onContentRectChanged) as usize - ptr as usize }, + 144usize, + concat!( + "Offset of field: ", + stringify!(GameActivityCallbacks), + "::", + stringify!(onContentRectChanged) + ) ); } -#[doc = " This is the function that must be in the native code to instantiate the"] -#[doc = " application's native activity. It is called with the activity instance (see"] -#[doc = " above); if the code is being instantiated from a previously saved instance,"] -#[doc = " the savedState will be non-NULL and point to the saved data. You must make"] -#[doc = " any copy of this data you need -- it will be released after you return from"] -#[doc = " this function."] +#[doc = " This is the function that must be in the native code to instantiate the\n application's native activity. It is called with the activity instance (see\n above); if the code is being instantiated from a previously saved instance,\n the savedState will be non-NULL and point to the saved data. You must make\n any copy of this data you need -- it will be released after you return from\n this function."] pub type GameActivity_createFunc = ::std::option::Option< unsafe extern "C" fn( activity: *mut GameActivity, savedState: *mut ::std::os::raw::c_void, - savedStateSize: size_t, + savedStateSize: usize, ), >; extern "C" { - #[doc = " Finish the given activity. Its finish() method will be called, causing it"] - #[doc = " to be stopped and destroyed. Note that this method can be called from"] - #[doc = " *any* thread; it will send a message to the main thread of the process"] - #[doc = " where the Java finish call will take place."] + #[doc = " Finish the given activity. Its finish() method will be called, causing it\n to be stopped and destroyed. Note that this method can be called from\n *any* thread; it will send a message to the main thread of the process\n where the Java finish call will take place."] pub fn GameActivity_finish(activity: *mut GameActivity); } -#[doc = " As long as this window is visible to the user, allow the lock"] -#[doc = " screen to activate while the screen is on. This can be used"] -#[doc = " independently, or in combination with {@link"] -#[doc = " GAMEACTIVITY_FLAG_KEEP_SCREEN_ON} and/or {@link"] -#[doc = " GAMEACTIVITY_FLAG_SHOW_WHEN_LOCKED}"] +#[doc = " As long as this window is visible to the user, allow the lock\n screen to activate while the screen is on. This can be used\n independently, or in combination with {@link\n GAMEACTIVITY_FLAG_KEEP_SCREEN_ON} and/or {@link\n GAMEACTIVITY_FLAG_SHOW_WHEN_LOCKED}"] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_ALLOW_LOCK_WHILE_SCREEN_ON: GameActivitySetWindowFlags = 1; #[doc = " Everything behind this window will be dimmed."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_DIM_BEHIND: GameActivitySetWindowFlags = 2; -#[doc = " Blur everything behind this window."] -#[doc = " @deprecated Blurring is no longer supported."] +#[doc = " Blur everything behind this window.\n @deprecated Blurring is no longer supported."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_BLUR_BEHIND: GameActivitySetWindowFlags = 4; -#[doc = " This window won't ever get key input focus, so the"] -#[doc = " user can not send key or other button events to it. Those will"] -#[doc = " instead go to whatever focusable window is behind it. This flag"] -#[doc = " will also enable {@link GAMEACTIVITY_FLAG_NOT_TOUCH_MODAL} whether or not"] -#[doc = " that is explicitly set."] -#[doc = ""] -#[doc = " Setting this flag also implies that the window will not need to"] -#[doc = " interact with"] -#[doc = " a soft input method, so it will be Z-ordered and positioned"] -#[doc = " independently of any active input method (typically this means it"] -#[doc = " gets Z-ordered on top of the input method, so it can use the full"] -#[doc = " screen for its content and cover the input method if needed. You"] -#[doc = " can use {@link GAMEACTIVITY_FLAG_ALT_FOCUSABLE_IM} to modify this"] -#[doc = " behavior."] +#[doc = " This window won't ever get key input focus, so the\n user can not send key or other button events to it. Those will\n instead go to whatever focusable window is behind it. This flag\n will also enable {@link GAMEACTIVITY_FLAG_NOT_TOUCH_MODAL} whether or not\n that is explicitly set.\n\n Setting this flag also implies that the window will not need to\n interact with\n a soft input method, so it will be Z-ordered and positioned\n independently of any active input method (typically this means it\n gets Z-ordered on top of the input method, so it can use the full\n screen for its content and cover the input method if needed. You\n can use {@link GAMEACTIVITY_FLAG_ALT_FOCUSABLE_IM} to modify this\n behavior."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_NOT_FOCUSABLE: GameActivitySetWindowFlags = 8; #[doc = " This window can never receive touch events."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_NOT_TOUCHABLE: GameActivitySetWindowFlags = 16; -#[doc = " Even when this window is focusable (its"] -#[doc = " {@link GAMEACTIVITY_FLAG_NOT_FOCUSABLE} is not set), allow any pointer"] -#[doc = " events outside of the window to be sent to the windows behind it."] -#[doc = " Otherwise it will consume all pointer events itself, regardless of"] -#[doc = " whether they are inside of the window."] +#[doc = " Even when this window is focusable (its\n {@link GAMEACTIVITY_FLAG_NOT_FOCUSABLE} is not set), allow any pointer\n events outside of the window to be sent to the windows behind it.\n Otherwise it will consume all pointer events itself, regardless of\n whether they are inside of the window."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_NOT_TOUCH_MODAL: GameActivitySetWindowFlags = 32; -#[doc = " When set, if the device is asleep when the touch"] -#[doc = " screen is pressed, you will receive this first touch event. Usually"] -#[doc = " the first touch event is consumed by the system since the user can"] -#[doc = " not see what they are pressing on."] -#[doc = ""] -#[doc = " @deprecated This flag has no effect."] +#[doc = " When set, if the device is asleep when the touch\n screen is pressed, you will receive this first touch event. Usually\n the first touch event is consumed by the system since the user can\n not see what they are pressing on.\n\n @deprecated This flag has no effect."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_TOUCHABLE_WHEN_WAKING: GameActivitySetWindowFlags = 64; -#[doc = " As long as this window is visible to the user, keep"] -#[doc = " the device's screen turned on and bright."] +#[doc = " As long as this window is visible to the user, keep\n the device's screen turned on and bright."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_KEEP_SCREEN_ON: GameActivitySetWindowFlags = 128; -#[doc = " Place the window within the entire screen, ignoring"] -#[doc = " decorations around the border (such as the status bar). The"] -#[doc = " window must correctly position its contents to take the screen"] -#[doc = " decoration into account."] +#[doc = " Place the window within the entire screen, ignoring\n decorations around the border (such as the status bar). The\n window must correctly position its contents to take the screen\n decoration into account."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_LAYOUT_IN_SCREEN: GameActivitySetWindowFlags = 256; #[doc = " Allows the window to extend outside of the screen."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_LAYOUT_NO_LIMITS: GameActivitySetWindowFlags = 512; -#[doc = " Hide all screen decorations (such as the status"] -#[doc = " bar) while this window is displayed. This allows the window to"] -#[doc = " use the entire display space for itself -- the status bar will"] -#[doc = " be hidden when an app window with this flag set is on the top"] -#[doc = " layer. A fullscreen window will ignore a value of {@link"] -#[doc = " GAMEACTIVITY_SOFT_INPUT_ADJUST_RESIZE}; the window will stay"] -#[doc = " fullscreen and will not resize."] +#[doc = " Hide all screen decorations (such as the status\n bar) while this window is displayed. This allows the window to\n use the entire display space for itself -- the status bar will\n be hidden when an app window with this flag set is on the top\n layer. A fullscreen window will ignore a value of {@link\n GAMEACTIVITY_SOFT_INPUT_ADJUST_RESIZE}; the window will stay\n fullscreen and will not resize."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_FULLSCREEN: GameActivitySetWindowFlags = 1024; -#[doc = " Override {@link GAMEACTIVITY_FLAG_FULLSCREEN} and force the"] -#[doc = " screen decorations (such as the status bar) to be shown."] +#[doc = " Override {@link GAMEACTIVITY_FLAG_FULLSCREEN} and force the\n screen decorations (such as the status bar) to be shown."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_FORCE_NOT_FULLSCREEN: GameActivitySetWindowFlags = 2048; -#[doc = " Turn on dithering when compositing this window to"] -#[doc = " the screen."] -#[doc = " @deprecated This flag is no longer used."] +#[doc = " Turn on dithering when compositing this window to\n the screen.\n @deprecated This flag is no longer used."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_DITHER: GameActivitySetWindowFlags = 4096; -#[doc = " Treat the content of the window as secure, preventing"] -#[doc = " it from appearing in screenshots or from being viewed on non-secure"] -#[doc = " displays."] +#[doc = " Treat the content of the window as secure, preventing\n it from appearing in screenshots or from being viewed on non-secure\n displays."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_SECURE: GameActivitySetWindowFlags = 8192; -#[doc = " A special mode where the layout parameters are used"] -#[doc = " to perform scaling of the surface when it is composited to the"] -#[doc = " screen."] +#[doc = " A special mode where the layout parameters are used\n to perform scaling of the surface when it is composited to the\n screen."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_SCALED: GameActivitySetWindowFlags = 16384; -#[doc = " Intended for windows that will often be used when the user is"] -#[doc = " holding the screen against their face, it will aggressively"] -#[doc = " filter the event stream to prevent unintended presses in this"] -#[doc = " situation that may not be desired for a particular window, when"] -#[doc = " such an event stream is detected, the application will receive"] -#[doc = " a {@link AMOTION_EVENT_ACTION_CANCEL} to indicate this so"] -#[doc = " applications can handle this accordingly by taking no action on"] -#[doc = " the event until the finger is released."] +#[doc = " Intended for windows that will often be used when the user is\n holding the screen against their face, it will aggressively\n filter the event stream to prevent unintended presses in this\n situation that may not be desired for a particular window, when\n such an event stream is detected, the application will receive\n a {@link AMOTION_EVENT_ACTION_CANCEL} to indicate this so\n applications can handle this accordingly by taking no action on\n the event until the finger is released."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_IGNORE_CHEEK_PRESSES: GameActivitySetWindowFlags = 32768; -#[doc = " A special option only for use in combination with"] -#[doc = " {@link GAMEACTIVITY_FLAG_LAYOUT_IN_SCREEN}. When requesting layout in"] -#[doc = " the screen your window may appear on top of or behind screen decorations"] -#[doc = " such as the status bar. By also including this flag, the window"] -#[doc = " manager will report the inset rectangle needed to ensure your"] -#[doc = " content is not covered by screen decorations."] +#[doc = " A special option only for use in combination with\n {@link GAMEACTIVITY_FLAG_LAYOUT_IN_SCREEN}. When requesting layout in\n the screen your window may appear on top of or behind screen decorations\n such as the status bar. By also including this flag, the window\n manager will report the inset rectangle needed to ensure your\n content is not covered by screen decorations."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_LAYOUT_INSET_DECOR: GameActivitySetWindowFlags = 65536; -#[doc = " Invert the state of {@link GAMEACTIVITY_FLAG_NOT_FOCUSABLE} with"] -#[doc = " respect to how this window interacts with the current method."] -#[doc = " That is, if FLAG_NOT_FOCUSABLE is set and this flag is set,"] -#[doc = " then the window will behave as if it needs to interact with the"] -#[doc = " input method and thus be placed behind/away from it; if {@link"] -#[doc = " GAMEACTIVITY_FLAG_NOT_FOCUSABLE} is not set and this flag is set,"] -#[doc = " then the window will behave as if it doesn't need to interact"] -#[doc = " with the input method and can be placed to use more space and"] -#[doc = " cover the input method."] +#[doc = " Invert the state of {@link GAMEACTIVITY_FLAG_NOT_FOCUSABLE} with\n respect to how this window interacts with the current method.\n That is, if FLAG_NOT_FOCUSABLE is set and this flag is set,\n then the window will behave as if it needs to interact with the\n input method and thus be placed behind/away from it; if {@link\n GAMEACTIVITY_FLAG_NOT_FOCUSABLE} is not set and this flag is set,\n then the window will behave as if it doesn't need to interact\n with the input method and can be placed to use more space and\n cover the input method."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_ALT_FOCUSABLE_IM: GameActivitySetWindowFlags = 131072; -#[doc = " If you have set {@link GAMEACTIVITY_FLAG_NOT_TOUCH_MODAL}, you"] -#[doc = " can set this flag to receive a single special MotionEvent with"] -#[doc = " the action"] -#[doc = " {@link AMOTION_EVENT_ACTION_OUTSIDE} for"] -#[doc = " touches that occur outside of your window. Note that you will not"] -#[doc = " receive the full down/move/up gesture, only the location of the"] -#[doc = " first down as an {@link AMOTION_EVENT_ACTION_OUTSIDE}."] +#[doc = " If you have set {@link GAMEACTIVITY_FLAG_NOT_TOUCH_MODAL}, you\n can set this flag to receive a single special MotionEvent with\n the action\n {@link AMOTION_EVENT_ACTION_OUTSIDE} for\n touches that occur outside of your window. Note that you will not\n receive the full down/move/up gesture, only the location of the\n first down as an {@link AMOTION_EVENT_ACTION_OUTSIDE}."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_WATCH_OUTSIDE_TOUCH: GameActivitySetWindowFlags = 262144; -#[doc = " Special flag to let windows be shown when the screen"] -#[doc = " is locked. This will let application windows take precedence over"] -#[doc = " key guard or any other lock screens. Can be used with"] -#[doc = " {@link GAMEACTIVITY_FLAG_KEEP_SCREEN_ON} to turn screen on and display"] -#[doc = " windows directly before showing the key guard window. Can be used with"] -#[doc = " {@link GAMEACTIVITY_FLAG_DISMISS_KEYGUARD} to automatically fully"] -#[doc = " dismisss non-secure keyguards. This flag only applies to the top-most"] -#[doc = " full-screen window."] +#[doc = " Special flag to let windows be shown when the screen\n is locked. This will let application windows take precedence over\n key guard or any other lock screens. Can be used with\n {@link GAMEACTIVITY_FLAG_KEEP_SCREEN_ON} to turn screen on and display\n windows directly before showing the key guard window. Can be used with\n {@link GAMEACTIVITY_FLAG_DISMISS_KEYGUARD} to automatically fully\n dismisss non-secure keyguards. This flag only applies to the top-most\n full-screen window."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_SHOW_WHEN_LOCKED: GameActivitySetWindowFlags = 524288; -#[doc = " Ask that the system wallpaper be shown behind"] -#[doc = " your window. The window surface must be translucent to be able"] -#[doc = " to actually see the wallpaper behind it; this flag just ensures"] -#[doc = " that the wallpaper surface will be there if this window actually"] -#[doc = " has translucent regions."] +#[doc = " Ask that the system wallpaper be shown behind\n your window. The window surface must be translucent to be able\n to actually see the wallpaper behind it; this flag just ensures\n that the wallpaper surface will be there if this window actually\n has translucent regions."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_SHOW_WALLPAPER: GameActivitySetWindowFlags = 1048576; -#[doc = " When set as a window is being added or made"] -#[doc = " visible, once the window has been shown then the system will"] -#[doc = " poke the power manager's user activity (as if the user had woken"] -#[doc = " up the device) to turn the screen on."] +#[doc = " When set as a window is being added or made\n visible, once the window has been shown then the system will\n poke the power manager's user activity (as if the user had woken\n up the device) to turn the screen on."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_TURN_SCREEN_ON: GameActivitySetWindowFlags = 2097152; -#[doc = " When set the window will cause the keyguard to"] -#[doc = " be dismissed, only if it is not a secure lock keyguard. Because such"] -#[doc = " a keyguard is not needed for security, it will never re-appear if"] -#[doc = " the user navigates to another window (in contrast to"] -#[doc = " {@link GAMEACTIVITY_FLAG_SHOW_WHEN_LOCKED}, which will only temporarily"] -#[doc = " hide both secure and non-secure keyguards but ensure they reappear"] -#[doc = " when the user moves to another UI that doesn't hide them)."] -#[doc = " If the keyguard is currently active and is secure (requires an"] -#[doc = " unlock pattern) than the user will still need to confirm it before"] -#[doc = " seeing this window, unless {@link GAMEACTIVITY_FLAG_SHOW_WHEN_LOCKED} has"] -#[doc = " also been set."] +#[doc = " When set the window will cause the keyguard to\n be dismissed, only if it is not a secure lock keyguard. Because such\n a keyguard is not needed for security, it will never re-appear if\n the user navigates to another window (in contrast to\n {@link GAMEACTIVITY_FLAG_SHOW_WHEN_LOCKED}, which will only temporarily\n hide both secure and non-secure keyguards but ensure they reappear\n when the user moves to another UI that doesn't hide them).\n If the keyguard is currently active and is secure (requires an\n unlock pattern) than the user will still need to confirm it before\n seeing this window, unless {@link GAMEACTIVITY_FLAG_SHOW_WHEN_LOCKED} has\n also been set."] pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_DISMISS_KEYGUARD: GameActivitySetWindowFlags = 4194304; -#[doc = " Flags for GameActivity_setWindowFlags,"] -#[doc = " as per the Java API at android.view.WindowManager.LayoutParams."] +#[doc = " Flags for GameActivity_setWindowFlags,\n as per the Java API at android.view.WindowManager.LayoutParams."] pub type GameActivitySetWindowFlags = ::std::os::raw::c_uint; extern "C" { - #[doc = " Change the window flags of the given activity. Calls getWindow().setFlags()"] - #[doc = " of the given activity."] - #[doc = " Note that some flags must be set before the window decoration is created,"] - #[doc = " see"] - #[doc = " https://developer.android.com/reference/android/view/Window#setFlags(int,%20int)."] - #[doc = " Note also that this method can be called from"] - #[doc = " *any* thread; it will send a message to the main thread of the process"] - #[doc = " where the Java finish call will take place."] + #[doc = " Change the window flags of the given activity. Calls getWindow().setFlags()\n of the given activity.\n Note that some flags must be set before the window decoration is created,\n see\n https://developer.android.com/reference/android/view/Window#setFlags(int,%20int).\n Note also that this method can be called from\n *any* thread; it will send a message to the main thread of the process\n where the Java finish call will take place."] pub fn GameActivity_setWindowFlags( activity: *mut GameActivity, addFlags: u32, removeFlags: u32, ); } -#[doc = " Implicit request to show the input window, not as the result"] -#[doc = " of a direct request by the user."] +#[doc = " Implicit request to show the input window, not as the result\n of a direct request by the user."] pub const GameActivityShowSoftInputFlags_GAMEACTIVITY_SHOW_SOFT_INPUT_IMPLICIT: GameActivityShowSoftInputFlags = 1; -#[doc = " The user has forced the input method open (such as by"] -#[doc = " long-pressing menu) so it should not be closed until they"] -#[doc = " explicitly do so."] +#[doc = " The user has forced the input method open (such as by\n long-pressing menu) so it should not be closed until they\n explicitly do so."] pub const GameActivityShowSoftInputFlags_GAMEACTIVITY_SHOW_SOFT_INPUT_FORCED: GameActivityShowSoftInputFlags = 2; -#[doc = " Flags for GameActivity_showSoftInput; see the Java InputMethodManager"] -#[doc = " API for documentation."] +#[doc = " Flags for GameActivity_showSoftInput; see the Java InputMethodManager\n API for documentation."] pub type GameActivityShowSoftInputFlags = ::std::os::raw::c_uint; extern "C" { - #[doc = " Show the IME while in the given activity. Calls"] - #[doc = " InputMethodManager.showSoftInput() for the given activity. Note that this"] - #[doc = " method can be called from *any* thread; it will send a message to the main"] - #[doc = " thread of the process where the Java call will take place."] + #[doc = " Show the IME while in the given activity. Calls\n InputMethodManager.showSoftInput() for the given activity. Note that this\n method can be called from *any* thread; it will send a message to the main\n thread of the process where the Java call will take place."] pub fn GameActivity_showSoftInput(activity: *mut GameActivity, flags: u32); } extern "C" { - #[doc = " Set the text entry state (see documentation of the GameTextInputState struct"] - #[doc = " in the Game Text Input library reference)."] - #[doc = ""] - #[doc = " Ownership of the state is maintained by the caller."] + #[doc = " Set the text entry state (see documentation of the GameTextInputState struct\n in the Game Text Input library reference).\n\n Ownership of the state is maintained by the caller."] pub fn GameActivity_setTextInputState( activity: *mut GameActivity, state: *const GameTextInputState, ); } extern "C" { - #[doc = " Get the last-received text entry state (see documentation of the"] - #[doc = " GameTextInputState struct in the Game Text Input library reference)."] - #[doc = ""] + #[doc = " Get the last-received text entry state (see documentation of the\n GameTextInputState struct in the Game Text Input library reference).\n"] pub fn GameActivity_getTextInputState( activity: *mut GameActivity, callback: GameTextInputGetStateCallback, @@ -3854,29 +3606,20 @@ extern "C" { #[doc = " Get a pointer to the GameTextInput library instance."] pub fn GameActivity_getTextInput(activity: *const GameActivity) -> *mut GameTextInput; } -#[doc = " The soft input window should only be hidden if it was not"] -#[doc = " explicitly shown by the user."] +#[doc = " The soft input window should only be hidden if it was not\n explicitly shown by the user."] pub const GameActivityHideSoftInputFlags_GAMEACTIVITY_HIDE_SOFT_INPUT_IMPLICIT_ONLY: GameActivityHideSoftInputFlags = 1; -#[doc = " The soft input window should normally be hidden, unless it was"] -#[doc = " originally shown with {@link GAMEACTIVITY_SHOW_SOFT_INPUT_FORCED}."] +#[doc = " The soft input window should normally be hidden, unless it was\n originally shown with {@link GAMEACTIVITY_SHOW_SOFT_INPUT_FORCED}."] pub const GameActivityHideSoftInputFlags_GAMEACTIVITY_HIDE_SOFT_INPUT_NOT_ALWAYS: GameActivityHideSoftInputFlags = 2; -#[doc = " Flags for GameActivity_hideSoftInput; see the Java InputMethodManager"] -#[doc = " API for documentation."] +#[doc = " Flags for GameActivity_hideSoftInput; see the Java InputMethodManager\n API for documentation."] pub type GameActivityHideSoftInputFlags = ::std::os::raw::c_uint; extern "C" { - #[doc = " Hide the IME while in the given activity. Calls"] - #[doc = " InputMethodManager.hideSoftInput() for the given activity. Note that this"] - #[doc = " method can be called from *any* thread; it will send a message to the main"] - #[doc = " thread of the process where the Java finish call will take place."] + #[doc = " Hide the IME while in the given activity. Calls\n InputMethodManager.hideSoftInput() for the given activity. Note that this\n method can be called from *any* thread; it will send a message to the main\n thread of the process where the Java finish call will take place."] pub fn GameActivity_hideSoftInput(activity: *mut GameActivity, flags: u32); } extern "C" { - #[doc = " Get the current window insets of the particular component. See"] - #[doc = " https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type"] - #[doc = " for more details."] - #[doc = " You can use these insets to influence what you show on the screen."] + #[doc = " Get the current window insets of the particular component. See\n https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type\n for more details.\n You can use these insets to influence what you show on the screen."] pub fn GameActivity_getWindowInsets( activity: *mut GameActivity, type_: GameCommonInsetsType, @@ -3884,14 +3627,7 @@ extern "C" { ); } extern "C" { - #[doc = " Set options on how the IME behaves when it is requested for text input."] - #[doc = " See"] - #[doc = " https://developer.android.com/reference/android/view/inputmethod/EditorInfo"] - #[doc = " for the meaning of inputType, actionId and imeOptions."] - #[doc = ""] - #[doc = " Note that this function will attach the current thread to the JVM if it is"] - #[doc = " not already attached, so the caller must detach the thread from the JVM"] - #[doc = " before the thread is destroyed using DetachCurrentThread."] + #[doc = " Set options on how the IME behaves when it is requested for text input.\n See\n https://developer.android.com/reference/android/view/inputmethod/EditorInfo\n for the meaning of inputType, actionId and imeOptions.\n\n Note that this function will attach the current thread to the JVM if it is\n not already attached, so the caller must detach the thread from the JVM\n before the thread is destroyed using DetachCurrentThread."] pub fn GameActivity_setImeEditorInfo( activity: *mut GameActivity, inputType: ::std::os::raw::c_int, @@ -3899,92 +3635,152 @@ extern "C" { imeOptions: ::std::os::raw::c_int, ); } -pub const ACONFIGURATION_ORIENTATION_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_ORIENTATION_PORT: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_ORIENTATION_LAND: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_ORIENTATION_SQUARE: ::std::os::raw::c_uint = 3; -pub const ACONFIGURATION_TOUCHSCREEN_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_TOUCHSCREEN_NOTOUCH: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_TOUCHSCREEN_STYLUS: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_TOUCHSCREEN_FINGER: ::std::os::raw::c_uint = 3; -pub const ACONFIGURATION_DENSITY_DEFAULT: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_DENSITY_LOW: ::std::os::raw::c_uint = 120; -pub const ACONFIGURATION_DENSITY_MEDIUM: ::std::os::raw::c_uint = 160; -pub const ACONFIGURATION_DENSITY_TV: ::std::os::raw::c_uint = 213; -pub const ACONFIGURATION_DENSITY_HIGH: ::std::os::raw::c_uint = 240; -pub const ACONFIGURATION_DENSITY_XHIGH: ::std::os::raw::c_uint = 320; -pub const ACONFIGURATION_DENSITY_XXHIGH: ::std::os::raw::c_uint = 480; -pub const ACONFIGURATION_DENSITY_XXXHIGH: ::std::os::raw::c_uint = 640; -pub const ACONFIGURATION_DENSITY_ANY: ::std::os::raw::c_uint = 65534; -pub const ACONFIGURATION_DENSITY_NONE: ::std::os::raw::c_uint = 65535; -pub const ACONFIGURATION_KEYBOARD_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_KEYBOARD_NOKEYS: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_KEYBOARD_QWERTY: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_KEYBOARD_12KEY: ::std::os::raw::c_uint = 3; -pub const ACONFIGURATION_NAVIGATION_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_NAVIGATION_NONAV: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_NAVIGATION_DPAD: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_NAVIGATION_TRACKBALL: ::std::os::raw::c_uint = 3; -pub const ACONFIGURATION_NAVIGATION_WHEEL: ::std::os::raw::c_uint = 4; -pub const ACONFIGURATION_KEYSHIDDEN_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_KEYSHIDDEN_NO: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_KEYSHIDDEN_YES: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_KEYSHIDDEN_SOFT: ::std::os::raw::c_uint = 3; -pub const ACONFIGURATION_NAVHIDDEN_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_NAVHIDDEN_NO: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_NAVHIDDEN_YES: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_SCREENSIZE_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_SCREENSIZE_SMALL: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_SCREENSIZE_NORMAL: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_SCREENSIZE_LARGE: ::std::os::raw::c_uint = 3; -pub const ACONFIGURATION_SCREENSIZE_XLARGE: ::std::os::raw::c_uint = 4; -pub const ACONFIGURATION_SCREENLONG_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_SCREENLONG_NO: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_SCREENLONG_YES: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_SCREENROUND_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_SCREENROUND_NO: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_SCREENROUND_YES: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_WIDE_COLOR_GAMUT_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_WIDE_COLOR_GAMUT_NO: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_WIDE_COLOR_GAMUT_YES: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_HDR_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_HDR_NO: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_HDR_YES: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_UI_MODE_TYPE_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_UI_MODE_TYPE_NORMAL: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_UI_MODE_TYPE_DESK: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_UI_MODE_TYPE_CAR: ::std::os::raw::c_uint = 3; -pub const ACONFIGURATION_UI_MODE_TYPE_TELEVISION: ::std::os::raw::c_uint = 4; -pub const ACONFIGURATION_UI_MODE_TYPE_APPLIANCE: ::std::os::raw::c_uint = 5; -pub const ACONFIGURATION_UI_MODE_TYPE_WATCH: ::std::os::raw::c_uint = 6; -pub const ACONFIGURATION_UI_MODE_TYPE_VR_HEADSET: ::std::os::raw::c_uint = 7; -pub const ACONFIGURATION_UI_MODE_NIGHT_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_UI_MODE_NIGHT_NO: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_UI_MODE_NIGHT_YES: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_SCREEN_WIDTH_DP_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_SCREEN_HEIGHT_DP_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_SMALLEST_SCREEN_WIDTH_DP_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_LAYOUTDIR_ANY: ::std::os::raw::c_uint = 0; -pub const ACONFIGURATION_LAYOUTDIR_LTR: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_LAYOUTDIR_RTL: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_MCC: ::std::os::raw::c_uint = 1; -pub const ACONFIGURATION_MNC: ::std::os::raw::c_uint = 2; -pub const ACONFIGURATION_LOCALE: ::std::os::raw::c_uint = 4; -pub const ACONFIGURATION_TOUCHSCREEN: ::std::os::raw::c_uint = 8; -pub const ACONFIGURATION_KEYBOARD: ::std::os::raw::c_uint = 16; -pub const ACONFIGURATION_KEYBOARD_HIDDEN: ::std::os::raw::c_uint = 32; -pub const ACONFIGURATION_NAVIGATION: ::std::os::raw::c_uint = 64; -pub const ACONFIGURATION_ORIENTATION: ::std::os::raw::c_uint = 128; -pub const ACONFIGURATION_DENSITY: ::std::os::raw::c_uint = 256; -pub const ACONFIGURATION_SCREEN_SIZE: ::std::os::raw::c_uint = 512; -pub const ACONFIGURATION_VERSION: ::std::os::raw::c_uint = 1024; -pub const ACONFIGURATION_SCREEN_LAYOUT: ::std::os::raw::c_uint = 2048; -pub const ACONFIGURATION_UI_MODE: ::std::os::raw::c_uint = 4096; -pub const ACONFIGURATION_SMALLEST_SCREEN_SIZE: ::std::os::raw::c_uint = 8192; -pub const ACONFIGURATION_LAYOUTDIR: ::std::os::raw::c_uint = 16384; -pub const ACONFIGURATION_SCREEN_ROUND: ::std::os::raw::c_uint = 32768; -pub const ACONFIGURATION_COLOR_MODE: ::std::os::raw::c_uint = 65536; -pub const ACONFIGURATION_MNC_ZERO: ::std::os::raw::c_uint = 65535; +extern "C" { + #[doc = " These are getters for Configuration class members. They may be called from\n any thread."] + pub fn GameActivity_getOrientation(activity: *mut GameActivity) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getColorMode(activity: *mut GameActivity) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getDensityDpi(activity: *mut GameActivity) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getFontScale(activity: *mut GameActivity) -> f32; +} +extern "C" { + pub fn GameActivity_getFontWeightAdjustment( + activity: *mut GameActivity, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getHardKeyboardHidden(activity: *mut GameActivity) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getKeyboard(activity: *mut GameActivity) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getKeyboardHidden(activity: *mut GameActivity) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getMcc(activity: *mut GameActivity) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getMnc(activity: *mut GameActivity) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getNavigation(activity: *mut GameActivity) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getNavigationHidden(activity: *mut GameActivity) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getScreenHeightDp(activity: *mut GameActivity) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getScreenLayout(activity: *mut GameActivity) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getScreenWidthDp(activity: *mut GameActivity) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getSmallestScreenWidthDp( + activity: *mut GameActivity, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getTouchscreen(activity: *mut GameActivity) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GameActivity_getUIMode(activity: *mut GameActivity) -> ::std::os::raw::c_int; +} +pub const ACONFIGURATION_ORIENTATION_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_ORIENTATION_PORT: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_ORIENTATION_LAND: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_ORIENTATION_SQUARE: _bindgen_ty_21 = 3; +pub const ACONFIGURATION_TOUCHSCREEN_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_TOUCHSCREEN_NOTOUCH: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_TOUCHSCREEN_STYLUS: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_TOUCHSCREEN_FINGER: _bindgen_ty_21 = 3; +pub const ACONFIGURATION_DENSITY_DEFAULT: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_DENSITY_LOW: _bindgen_ty_21 = 120; +pub const ACONFIGURATION_DENSITY_MEDIUM: _bindgen_ty_21 = 160; +pub const ACONFIGURATION_DENSITY_TV: _bindgen_ty_21 = 213; +pub const ACONFIGURATION_DENSITY_HIGH: _bindgen_ty_21 = 240; +pub const ACONFIGURATION_DENSITY_XHIGH: _bindgen_ty_21 = 320; +pub const ACONFIGURATION_DENSITY_XXHIGH: _bindgen_ty_21 = 480; +pub const ACONFIGURATION_DENSITY_XXXHIGH: _bindgen_ty_21 = 640; +pub const ACONFIGURATION_DENSITY_ANY: _bindgen_ty_21 = 65534; +pub const ACONFIGURATION_DENSITY_NONE: _bindgen_ty_21 = 65535; +pub const ACONFIGURATION_KEYBOARD_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_KEYBOARD_NOKEYS: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_KEYBOARD_QWERTY: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_KEYBOARD_12KEY: _bindgen_ty_21 = 3; +pub const ACONFIGURATION_NAVIGATION_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_NAVIGATION_NONAV: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_NAVIGATION_DPAD: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_NAVIGATION_TRACKBALL: _bindgen_ty_21 = 3; +pub const ACONFIGURATION_NAVIGATION_WHEEL: _bindgen_ty_21 = 4; +pub const ACONFIGURATION_KEYSHIDDEN_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_KEYSHIDDEN_NO: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_KEYSHIDDEN_YES: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_KEYSHIDDEN_SOFT: _bindgen_ty_21 = 3; +pub const ACONFIGURATION_NAVHIDDEN_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_NAVHIDDEN_NO: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_NAVHIDDEN_YES: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_SCREENSIZE_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_SCREENSIZE_SMALL: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_SCREENSIZE_NORMAL: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_SCREENSIZE_LARGE: _bindgen_ty_21 = 3; +pub const ACONFIGURATION_SCREENSIZE_XLARGE: _bindgen_ty_21 = 4; +pub const ACONFIGURATION_SCREENLONG_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_SCREENLONG_NO: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_SCREENLONG_YES: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_SCREENROUND_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_SCREENROUND_NO: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_SCREENROUND_YES: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_WIDE_COLOR_GAMUT_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_WIDE_COLOR_GAMUT_NO: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_WIDE_COLOR_GAMUT_YES: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_HDR_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_HDR_NO: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_HDR_YES: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_UI_MODE_TYPE_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_UI_MODE_TYPE_NORMAL: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_UI_MODE_TYPE_DESK: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_UI_MODE_TYPE_CAR: _bindgen_ty_21 = 3; +pub const ACONFIGURATION_UI_MODE_TYPE_TELEVISION: _bindgen_ty_21 = 4; +pub const ACONFIGURATION_UI_MODE_TYPE_APPLIANCE: _bindgen_ty_21 = 5; +pub const ACONFIGURATION_UI_MODE_TYPE_WATCH: _bindgen_ty_21 = 6; +pub const ACONFIGURATION_UI_MODE_TYPE_VR_HEADSET: _bindgen_ty_21 = 7; +pub const ACONFIGURATION_UI_MODE_NIGHT_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_UI_MODE_NIGHT_NO: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_UI_MODE_NIGHT_YES: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_SCREEN_WIDTH_DP_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_SCREEN_HEIGHT_DP_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_SMALLEST_SCREEN_WIDTH_DP_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_LAYOUTDIR_ANY: _bindgen_ty_21 = 0; +pub const ACONFIGURATION_LAYOUTDIR_LTR: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_LAYOUTDIR_RTL: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_MCC: _bindgen_ty_21 = 1; +pub const ACONFIGURATION_MNC: _bindgen_ty_21 = 2; +pub const ACONFIGURATION_LOCALE: _bindgen_ty_21 = 4; +pub const ACONFIGURATION_TOUCHSCREEN: _bindgen_ty_21 = 8; +pub const ACONFIGURATION_KEYBOARD: _bindgen_ty_21 = 16; +pub const ACONFIGURATION_KEYBOARD_HIDDEN: _bindgen_ty_21 = 32; +pub const ACONFIGURATION_NAVIGATION: _bindgen_ty_21 = 64; +pub const ACONFIGURATION_ORIENTATION: _bindgen_ty_21 = 128; +pub const ACONFIGURATION_DENSITY: _bindgen_ty_21 = 256; +pub const ACONFIGURATION_SCREEN_SIZE: _bindgen_ty_21 = 512; +pub const ACONFIGURATION_VERSION: _bindgen_ty_21 = 1024; +pub const ACONFIGURATION_SCREEN_LAYOUT: _bindgen_ty_21 = 2048; +pub const ACONFIGURATION_UI_MODE: _bindgen_ty_21 = 4096; +pub const ACONFIGURATION_SMALLEST_SCREEN_SIZE: _bindgen_ty_21 = 8192; +pub const ACONFIGURATION_LAYOUTDIR: _bindgen_ty_21 = 16384; +pub const ACONFIGURATION_SCREEN_ROUND: _bindgen_ty_21 = 32768; +pub const ACONFIGURATION_COLOR_MODE: _bindgen_ty_21 = 65536; +pub const ACONFIGURATION_MNC_ZERO: _bindgen_ty_21 = 65535; pub type _bindgen_ty_21 = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -3995,6 +3791,8 @@ pub struct pollfd { } #[test] fn bindgen_test_layout_pollfd() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 8usize, @@ -4006,7 +3804,7 @@ fn bindgen_test_layout_pollfd() { concat!("Alignment of ", stringify!(pollfd)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).fd as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).fd) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4016,7 +3814,7 @@ fn bindgen_test_layout_pollfd() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).events as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).events) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -4026,7 +3824,7 @@ fn bindgen_test_layout_pollfd() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).revents as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).revents) as usize - ptr as usize }, 6usize, concat!( "Offset of field: ", @@ -4047,6 +3845,8 @@ pub struct _fpx_sw_bytes { } #[test] fn bindgen_test_layout__fpx_sw_bytes() { + const UNINIT: ::std::mem::MaybeUninit<_fpx_sw_bytes> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_fpx_sw_bytes>(), 48usize, @@ -4058,7 +3858,7 @@ fn bindgen_test_layout__fpx_sw_bytes() { concat!("Alignment of ", stringify!(_fpx_sw_bytes)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpx_sw_bytes>())).magic1 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).magic1) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4068,7 +3868,7 @@ fn bindgen_test_layout__fpx_sw_bytes() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpx_sw_bytes>())).extended_size as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).extended_size) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -4078,7 +3878,7 @@ fn bindgen_test_layout__fpx_sw_bytes() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpx_sw_bytes>())).xfeatures as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).xfeatures) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -4088,7 +3888,7 @@ fn bindgen_test_layout__fpx_sw_bytes() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpx_sw_bytes>())).xstate_size as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).xstate_size) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -4098,7 +3898,7 @@ fn bindgen_test_layout__fpx_sw_bytes() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpx_sw_bytes>())).padding as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).padding) as usize - ptr as usize }, 20usize, concat!( "Offset of field: ", @@ -4116,6 +3916,8 @@ pub struct _fpreg { } #[test] fn bindgen_test_layout__fpreg() { + const UNINIT: ::std::mem::MaybeUninit<_fpreg> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_fpreg>(), 10usize, @@ -4127,7 +3929,7 @@ fn bindgen_test_layout__fpreg() { concat!("Alignment of ", stringify!(_fpreg)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpreg>())).significand as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).significand) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4137,7 +3939,7 @@ fn bindgen_test_layout__fpreg() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpreg>())).exponent as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).exponent) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -4156,6 +3958,8 @@ pub struct _fpxreg { } #[test] fn bindgen_test_layout__fpxreg() { + const UNINIT: ::std::mem::MaybeUninit<_fpxreg> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_fpxreg>(), 16usize, @@ -4167,7 +3971,7 @@ fn bindgen_test_layout__fpxreg() { concat!("Alignment of ", stringify!(_fpxreg)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpxreg>())).significand as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).significand) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4177,7 +3981,7 @@ fn bindgen_test_layout__fpxreg() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpxreg>())).exponent as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).exponent) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -4187,7 +3991,7 @@ fn bindgen_test_layout__fpxreg() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpxreg>())).padding as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).padding) as usize - ptr as usize }, 10usize, concat!( "Offset of field: ", @@ -4204,6 +4008,8 @@ pub struct _xmmreg { } #[test] fn bindgen_test_layout__xmmreg() { + const UNINIT: ::std::mem::MaybeUninit<_xmmreg> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_xmmreg>(), 16usize, @@ -4215,7 +4021,7 @@ fn bindgen_test_layout__xmmreg() { concat!("Alignment of ", stringify!(_xmmreg)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_xmmreg>())).element as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).element) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4254,6 +4060,9 @@ pub union _fpstate_32__bindgen_ty_1 { } #[test] fn bindgen_test_layout__fpstate_32__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit<_fpstate_32__bindgen_ty_1> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_fpstate_32__bindgen_ty_1>(), 176usize, @@ -4265,9 +4074,7 @@ fn bindgen_test_layout__fpstate_32__bindgen_ty_1() { concat!("Alignment of ", stringify!(_fpstate_32__bindgen_ty_1)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_fpstate_32__bindgen_ty_1>())).padding1 as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).padding1) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4277,9 +4084,7 @@ fn bindgen_test_layout__fpstate_32__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_fpstate_32__bindgen_ty_1>())).padding as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).padding) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4297,6 +4102,9 @@ pub union _fpstate_32__bindgen_ty_2 { } #[test] fn bindgen_test_layout__fpstate_32__bindgen_ty_2() { + const UNINIT: ::std::mem::MaybeUninit<_fpstate_32__bindgen_ty_2> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_fpstate_32__bindgen_ty_2>(), 48usize, @@ -4308,9 +4116,7 @@ fn bindgen_test_layout__fpstate_32__bindgen_ty_2() { concat!("Alignment of ", stringify!(_fpstate_32__bindgen_ty_2)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_fpstate_32__bindgen_ty_2>())).padding2 as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).padding2) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4320,9 +4126,7 @@ fn bindgen_test_layout__fpstate_32__bindgen_ty_2() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_fpstate_32__bindgen_ty_2>())).sw_reserved as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).sw_reserved) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4334,6 +4138,8 @@ fn bindgen_test_layout__fpstate_32__bindgen_ty_2() { } #[test] fn bindgen_test_layout__fpstate_32() { + const UNINIT: ::std::mem::MaybeUninit<_fpstate_32> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_fpstate_32>(), 624usize, @@ -4345,7 +4151,7 @@ fn bindgen_test_layout__fpstate_32() { concat!("Alignment of ", stringify!(_fpstate_32)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate_32>())).cw as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).cw) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4355,7 +4161,7 @@ fn bindgen_test_layout__fpstate_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate_32>())).sw as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sw) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -4365,7 +4171,7 @@ fn bindgen_test_layout__fpstate_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate_32>())).tag as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tag) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -4375,7 +4181,7 @@ fn bindgen_test_layout__fpstate_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate_32>())).ipoff as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ipoff) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", @@ -4385,7 +4191,7 @@ fn bindgen_test_layout__fpstate_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate_32>())).cssel as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).cssel) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -4395,7 +4201,7 @@ fn bindgen_test_layout__fpstate_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate_32>())).dataoff as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).dataoff) as usize - ptr as usize }, 20usize, concat!( "Offset of field: ", @@ -4405,7 +4211,7 @@ fn bindgen_test_layout__fpstate_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate_32>())).datasel as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).datasel) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -4415,7 +4221,7 @@ fn bindgen_test_layout__fpstate_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate_32>()))._st as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._st) as usize - ptr as usize }, 28usize, concat!( "Offset of field: ", @@ -4425,7 +4231,7 @@ fn bindgen_test_layout__fpstate_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate_32>())).status as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).status) as usize - ptr as usize }, 108usize, concat!( "Offset of field: ", @@ -4435,7 +4241,7 @@ fn bindgen_test_layout__fpstate_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate_32>())).magic as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).magic) as usize - ptr as usize }, 110usize, concat!( "Offset of field: ", @@ -4445,7 +4251,7 @@ fn bindgen_test_layout__fpstate_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate_32>()))._fxsr_env as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._fxsr_env) as usize - ptr as usize }, 112usize, concat!( "Offset of field: ", @@ -4455,7 +4261,7 @@ fn bindgen_test_layout__fpstate_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate_32>())).mxcsr as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).mxcsr) as usize - ptr as usize }, 136usize, concat!( "Offset of field: ", @@ -4465,7 +4271,7 @@ fn bindgen_test_layout__fpstate_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate_32>())).reserved as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).reserved) as usize - ptr as usize }, 140usize, concat!( "Offset of field: ", @@ -4475,7 +4281,7 @@ fn bindgen_test_layout__fpstate_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate_32>()))._fxsr_st as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._fxsr_st) as usize - ptr as usize }, 144usize, concat!( "Offset of field: ", @@ -4485,7 +4291,7 @@ fn bindgen_test_layout__fpstate_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate_32>()))._xmm as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._xmm) as usize - ptr as usize }, 272usize, concat!( "Offset of field: ", @@ -4519,6 +4325,9 @@ pub union _fpstate_64__bindgen_ty_1 { } #[test] fn bindgen_test_layout__fpstate_64__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit<_fpstate_64__bindgen_ty_1> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_fpstate_64__bindgen_ty_1>(), 48usize, @@ -4530,9 +4339,7 @@ fn bindgen_test_layout__fpstate_64__bindgen_ty_1() { concat!("Alignment of ", stringify!(_fpstate_64__bindgen_ty_1)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_fpstate_64__bindgen_ty_1>())).reserved3 as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).reserved3) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4542,9 +4349,7 @@ fn bindgen_test_layout__fpstate_64__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_fpstate_64__bindgen_ty_1>())).sw_reserved as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).sw_reserved) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4556,6 +4361,8 @@ fn bindgen_test_layout__fpstate_64__bindgen_ty_1() { } #[test] fn bindgen_test_layout__fpstate_64() { + const UNINIT: ::std::mem::MaybeUninit<_fpstate_64> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_fpstate_64>(), 512usize, @@ -4567,7 +4374,7 @@ fn bindgen_test_layout__fpstate_64() { concat!("Alignment of ", stringify!(_fpstate_64)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate_64>())).cwd as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).cwd) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4577,7 +4384,7 @@ fn bindgen_test_layout__fpstate_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate_64>())).swd as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).swd) as usize - ptr as usize }, 2usize, concat!( "Offset of field: ", @@ -4587,7 +4394,7 @@ fn bindgen_test_layout__fpstate_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate_64>())).twd as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).twd) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -4597,7 +4404,7 @@ fn bindgen_test_layout__fpstate_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate_64>())).fop as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).fop) as usize - ptr as usize }, 6usize, concat!( "Offset of field: ", @@ -4607,7 +4414,7 @@ fn bindgen_test_layout__fpstate_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate_64>())).rip as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).rip) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -4617,7 +4424,7 @@ fn bindgen_test_layout__fpstate_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate_64>())).rdp as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).rdp) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -4627,7 +4434,7 @@ fn bindgen_test_layout__fpstate_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate_64>())).mxcsr as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).mxcsr) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -4637,7 +4444,7 @@ fn bindgen_test_layout__fpstate_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate_64>())).mxcsr_mask as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).mxcsr_mask) as usize - ptr as usize }, 28usize, concat!( "Offset of field: ", @@ -4647,7 +4454,7 @@ fn bindgen_test_layout__fpstate_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate_64>())).st_space as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).st_space) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -4657,7 +4464,7 @@ fn bindgen_test_layout__fpstate_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate_64>())).xmm_space as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).xmm_space) as usize - ptr as usize }, 160usize, concat!( "Offset of field: ", @@ -4667,7 +4474,7 @@ fn bindgen_test_layout__fpstate_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate_64>())).reserved2 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).reserved2) as usize - ptr as usize }, 416usize, concat!( "Offset of field: ", @@ -4686,6 +4493,8 @@ pub struct _header { } #[test] fn bindgen_test_layout__header() { + const UNINIT: ::std::mem::MaybeUninit<_header> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_header>(), 64usize, @@ -4697,7 +4506,7 @@ fn bindgen_test_layout__header() { concat!("Alignment of ", stringify!(_header)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_header>())).xfeatures as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).xfeatures) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4707,7 +4516,7 @@ fn bindgen_test_layout__header() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_header>())).reserved1 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).reserved1) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -4717,7 +4526,7 @@ fn bindgen_test_layout__header() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_header>())).reserved2 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).reserved2) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -4734,6 +4543,8 @@ pub struct _ymmh_state { } #[test] fn bindgen_test_layout__ymmh_state() { + const UNINIT: ::std::mem::MaybeUninit<_ymmh_state> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_ymmh_state>(), 256usize, @@ -4745,7 +4556,7 @@ fn bindgen_test_layout__ymmh_state() { concat!("Alignment of ", stringify!(_ymmh_state)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_ymmh_state>())).ymmh_space as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ymmh_space) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4764,6 +4575,8 @@ pub struct _xstate { } #[test] fn bindgen_test_layout__xstate() { + const UNINIT: ::std::mem::MaybeUninit<_xstate> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_xstate>(), 832usize, @@ -4775,7 +4588,7 @@ fn bindgen_test_layout__xstate() { concat!("Alignment of ", stringify!(_xstate)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_xstate>())).fpstate as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).fpstate) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4785,7 +4598,7 @@ fn bindgen_test_layout__xstate() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_xstate>())).xstate_hdr as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).xstate_hdr) as usize - ptr as usize }, 512usize, concat!( "Offset of field: ", @@ -4795,7 +4608,7 @@ fn bindgen_test_layout__xstate() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_xstate>())).ymmh as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ymmh) as usize - ptr as usize }, 576usize, concat!( "Offset of field: ", @@ -4839,6 +4652,8 @@ pub struct sigcontext_32 { } #[test] fn bindgen_test_layout_sigcontext_32() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 88usize, @@ -4850,7 +4665,7 @@ fn bindgen_test_layout_sigcontext_32() { concat!("Alignment of ", stringify!(sigcontext_32)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).gs as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).gs) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -4860,7 +4675,7 @@ fn bindgen_test_layout_sigcontext_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).__gsh as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).__gsh) as usize - ptr as usize }, 2usize, concat!( "Offset of field: ", @@ -4870,7 +4685,7 @@ fn bindgen_test_layout_sigcontext_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).fs as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).fs) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -4880,7 +4695,7 @@ fn bindgen_test_layout_sigcontext_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).__fsh as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).__fsh) as usize - ptr as usize }, 6usize, concat!( "Offset of field: ", @@ -4890,7 +4705,7 @@ fn bindgen_test_layout_sigcontext_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).es as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).es) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -4900,7 +4715,7 @@ fn bindgen_test_layout_sigcontext_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).__esh as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).__esh) as usize - ptr as usize }, 10usize, concat!( "Offset of field: ", @@ -4910,7 +4725,7 @@ fn bindgen_test_layout_sigcontext_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ds as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ds) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", @@ -4920,7 +4735,7 @@ fn bindgen_test_layout_sigcontext_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).__dsh as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).__dsh) as usize - ptr as usize }, 14usize, concat!( "Offset of field: ", @@ -4930,7 +4745,7 @@ fn bindgen_test_layout_sigcontext_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).di as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).di) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -4940,7 +4755,7 @@ fn bindgen_test_layout_sigcontext_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).si as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).si) as usize - ptr as usize }, 20usize, concat!( "Offset of field: ", @@ -4950,7 +4765,7 @@ fn bindgen_test_layout_sigcontext_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).bp as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).bp) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -4960,7 +4775,7 @@ fn bindgen_test_layout_sigcontext_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sp as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sp) as usize - ptr as usize }, 28usize, concat!( "Offset of field: ", @@ -4970,7 +4785,7 @@ fn bindgen_test_layout_sigcontext_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).bx as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).bx) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -4980,7 +4795,7 @@ fn bindgen_test_layout_sigcontext_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).dx as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).dx) as usize - ptr as usize }, 36usize, concat!( "Offset of field: ", @@ -4990,7 +4805,7 @@ fn bindgen_test_layout_sigcontext_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).cx as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).cx) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", @@ -5000,7 +4815,7 @@ fn bindgen_test_layout_sigcontext_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ax as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ax) as usize - ptr as usize }, 44usize, concat!( "Offset of field: ", @@ -5010,7 +4825,7 @@ fn bindgen_test_layout_sigcontext_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).trapno as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).trapno) as usize - ptr as usize }, 48usize, concat!( "Offset of field: ", @@ -5020,7 +4835,7 @@ fn bindgen_test_layout_sigcontext_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).err as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).err) as usize - ptr as usize }, 52usize, concat!( "Offset of field: ", @@ -5030,7 +4845,7 @@ fn bindgen_test_layout_sigcontext_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ip as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ip) as usize - ptr as usize }, 56usize, concat!( "Offset of field: ", @@ -5040,7 +4855,7 @@ fn bindgen_test_layout_sigcontext_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).cs as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).cs) as usize - ptr as usize }, 60usize, concat!( "Offset of field: ", @@ -5050,7 +4865,7 @@ fn bindgen_test_layout_sigcontext_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).__csh as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).__csh) as usize - ptr as usize }, 62usize, concat!( "Offset of field: ", @@ -5060,7 +4875,7 @@ fn bindgen_test_layout_sigcontext_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 64usize, concat!( "Offset of field: ", @@ -5070,7 +4885,7 @@ fn bindgen_test_layout_sigcontext_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sp_at_signal as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sp_at_signal) as usize - ptr as usize }, 68usize, concat!( "Offset of field: ", @@ -5080,7 +4895,7 @@ fn bindgen_test_layout_sigcontext_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ss as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ss) as usize - ptr as usize }, 72usize, concat!( "Offset of field: ", @@ -5090,7 +4905,7 @@ fn bindgen_test_layout_sigcontext_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).__ssh as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).__ssh) as usize - ptr as usize }, 74usize, concat!( "Offset of field: ", @@ -5100,7 +4915,7 @@ fn bindgen_test_layout_sigcontext_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).fpstate as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).fpstate) as usize - ptr as usize }, 76usize, concat!( "Offset of field: ", @@ -5110,7 +4925,7 @@ fn bindgen_test_layout_sigcontext_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).oldmask as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).oldmask) as usize - ptr as usize }, 80usize, concat!( "Offset of field: ", @@ -5120,7 +4935,7 @@ fn bindgen_test_layout_sigcontext_32() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).cr2 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).cr2) as usize - ptr as usize }, 84usize, concat!( "Offset of field: ", @@ -5164,6 +4979,8 @@ pub struct sigcontext_64 { } #[test] fn bindgen_test_layout_sigcontext_64() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 256usize, @@ -5175,7 +4992,7 @@ fn bindgen_test_layout_sigcontext_64() { concat!("Alignment of ", stringify!(sigcontext_64)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).r8 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).r8) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5185,7 +5002,7 @@ fn bindgen_test_layout_sigcontext_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).r9 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).r9) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -5195,7 +5012,7 @@ fn bindgen_test_layout_sigcontext_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).r10 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).r10) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -5205,7 +5022,7 @@ fn bindgen_test_layout_sigcontext_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).r11 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).r11) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -5215,7 +5032,7 @@ fn bindgen_test_layout_sigcontext_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).r12 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).r12) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -5225,7 +5042,7 @@ fn bindgen_test_layout_sigcontext_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).r13 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).r13) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", @@ -5235,7 +5052,7 @@ fn bindgen_test_layout_sigcontext_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).r14 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).r14) as usize - ptr as usize }, 48usize, concat!( "Offset of field: ", @@ -5245,7 +5062,7 @@ fn bindgen_test_layout_sigcontext_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).r15 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).r15) as usize - ptr as usize }, 56usize, concat!( "Offset of field: ", @@ -5255,7 +5072,7 @@ fn bindgen_test_layout_sigcontext_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).di as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).di) as usize - ptr as usize }, 64usize, concat!( "Offset of field: ", @@ -5265,7 +5082,7 @@ fn bindgen_test_layout_sigcontext_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).si as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).si) as usize - ptr as usize }, 72usize, concat!( "Offset of field: ", @@ -5275,7 +5092,7 @@ fn bindgen_test_layout_sigcontext_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).bp as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).bp) as usize - ptr as usize }, 80usize, concat!( "Offset of field: ", @@ -5285,7 +5102,7 @@ fn bindgen_test_layout_sigcontext_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).bx as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).bx) as usize - ptr as usize }, 88usize, concat!( "Offset of field: ", @@ -5295,7 +5112,7 @@ fn bindgen_test_layout_sigcontext_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).dx as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).dx) as usize - ptr as usize }, 96usize, concat!( "Offset of field: ", @@ -5305,7 +5122,7 @@ fn bindgen_test_layout_sigcontext_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ax as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ax) as usize - ptr as usize }, 104usize, concat!( "Offset of field: ", @@ -5315,7 +5132,7 @@ fn bindgen_test_layout_sigcontext_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).cx as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).cx) as usize - ptr as usize }, 112usize, concat!( "Offset of field: ", @@ -5325,7 +5142,7 @@ fn bindgen_test_layout_sigcontext_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sp as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sp) as usize - ptr as usize }, 120usize, concat!( "Offset of field: ", @@ -5335,7 +5152,7 @@ fn bindgen_test_layout_sigcontext_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ip as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ip) as usize - ptr as usize }, 128usize, concat!( "Offset of field: ", @@ -5345,7 +5162,7 @@ fn bindgen_test_layout_sigcontext_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 136usize, concat!( "Offset of field: ", @@ -5355,7 +5172,7 @@ fn bindgen_test_layout_sigcontext_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).cs as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).cs) as usize - ptr as usize }, 144usize, concat!( "Offset of field: ", @@ -5365,7 +5182,7 @@ fn bindgen_test_layout_sigcontext_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).gs as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).gs) as usize - ptr as usize }, 146usize, concat!( "Offset of field: ", @@ -5375,7 +5192,7 @@ fn bindgen_test_layout_sigcontext_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).fs as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).fs) as usize - ptr as usize }, 148usize, concat!( "Offset of field: ", @@ -5385,7 +5202,7 @@ fn bindgen_test_layout_sigcontext_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ss as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ss) as usize - ptr as usize }, 150usize, concat!( "Offset of field: ", @@ -5395,7 +5212,7 @@ fn bindgen_test_layout_sigcontext_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).err as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).err) as usize - ptr as usize }, 152usize, concat!( "Offset of field: ", @@ -5405,7 +5222,7 @@ fn bindgen_test_layout_sigcontext_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).trapno as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).trapno) as usize - ptr as usize }, 160usize, concat!( "Offset of field: ", @@ -5415,7 +5232,7 @@ fn bindgen_test_layout_sigcontext_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).oldmask as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).oldmask) as usize - ptr as usize }, 168usize, concat!( "Offset of field: ", @@ -5425,7 +5242,7 @@ fn bindgen_test_layout_sigcontext_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).cr2 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).cr2) as usize - ptr as usize }, 176usize, concat!( "Offset of field: ", @@ -5435,7 +5252,7 @@ fn bindgen_test_layout_sigcontext_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).fpstate as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).fpstate) as usize - ptr as usize }, 184usize, concat!( "Offset of field: ", @@ -5445,7 +5262,7 @@ fn bindgen_test_layout_sigcontext_64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved1 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).reserved1) as usize - ptr as usize }, 192usize, concat!( "Offset of field: ", @@ -5495,6 +5312,9 @@ pub union sigcontext__bindgen_ty_1 { } #[test] fn bindgen_test_layout_sigcontext__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 2usize, @@ -5506,7 +5326,7 @@ fn bindgen_test_layout_sigcontext__bindgen_ty_1() { concat!("Alignment of ", stringify!(sigcontext__bindgen_ty_1)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ss as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ss) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5516,7 +5336,7 @@ fn bindgen_test_layout_sigcontext__bindgen_ty_1() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).__pad0 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).__pad0) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5528,6 +5348,8 @@ fn bindgen_test_layout_sigcontext__bindgen_ty_1() { } #[test] fn bindgen_test_layout_sigcontext() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 256usize, @@ -5539,7 +5361,7 @@ fn bindgen_test_layout_sigcontext() { concat!("Alignment of ", stringify!(sigcontext)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).r8 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).r8) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5549,7 +5371,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).r9 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).r9) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -5559,7 +5381,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).r10 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).r10) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -5569,7 +5391,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).r11 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).r11) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -5579,7 +5401,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).r12 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).r12) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -5589,7 +5411,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).r13 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).r13) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", @@ -5599,7 +5421,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).r14 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).r14) as usize - ptr as usize }, 48usize, concat!( "Offset of field: ", @@ -5609,7 +5431,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).r15 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).r15) as usize - ptr as usize }, 56usize, concat!( "Offset of field: ", @@ -5619,7 +5441,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).rdi as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).rdi) as usize - ptr as usize }, 64usize, concat!( "Offset of field: ", @@ -5629,7 +5451,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).rsi as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).rsi) as usize - ptr as usize }, 72usize, concat!( "Offset of field: ", @@ -5639,7 +5461,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).rbp as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).rbp) as usize - ptr as usize }, 80usize, concat!( "Offset of field: ", @@ -5649,7 +5471,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).rbx as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).rbx) as usize - ptr as usize }, 88usize, concat!( "Offset of field: ", @@ -5659,7 +5481,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).rdx as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).rdx) as usize - ptr as usize }, 96usize, concat!( "Offset of field: ", @@ -5669,7 +5491,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).rax as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).rax) as usize - ptr as usize }, 104usize, concat!( "Offset of field: ", @@ -5679,7 +5501,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).rcx as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).rcx) as usize - ptr as usize }, 112usize, concat!( "Offset of field: ", @@ -5689,7 +5511,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).rsp as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).rsp) as usize - ptr as usize }, 120usize, concat!( "Offset of field: ", @@ -5699,7 +5521,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).rip as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).rip) as usize - ptr as usize }, 128usize, concat!( "Offset of field: ", @@ -5709,7 +5531,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).eflags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).eflags) as usize - ptr as usize }, 136usize, concat!( "Offset of field: ", @@ -5719,7 +5541,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).cs as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).cs) as usize - ptr as usize }, 144usize, concat!( "Offset of field: ", @@ -5729,7 +5551,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).gs as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).gs) as usize - ptr as usize }, 146usize, concat!( "Offset of field: ", @@ -5739,7 +5561,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).fs as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).fs) as usize - ptr as usize }, 148usize, concat!( "Offset of field: ", @@ -5749,7 +5571,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).err as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).err) as usize - ptr as usize }, 152usize, concat!( "Offset of field: ", @@ -5759,7 +5581,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).trapno as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).trapno) as usize - ptr as usize }, 160usize, concat!( "Offset of field: ", @@ -5769,7 +5591,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).oldmask as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).oldmask) as usize - ptr as usize }, 168usize, concat!( "Offset of field: ", @@ -5779,7 +5601,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).cr2 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).cr2) as usize - ptr as usize }, 176usize, concat!( "Offset of field: ", @@ -5789,7 +5611,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).fpstate as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).fpstate) as usize - ptr as usize }, 184usize, concat!( "Offset of field: ", @@ -5799,7 +5621,7 @@ fn bindgen_test_layout_sigcontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved1 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).reserved1) as usize - ptr as usize }, 192usize, concat!( "Offset of field: ", @@ -5817,6 +5639,8 @@ pub struct __kernel_timespec { } #[test] fn bindgen_test_layout___kernel_timespec() { + const UNINIT: ::std::mem::MaybeUninit<__kernel_timespec> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__kernel_timespec>(), 16usize, @@ -5828,7 +5652,7 @@ fn bindgen_test_layout___kernel_timespec() { concat!("Alignment of ", stringify!(__kernel_timespec)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_timespec>())).tv_sec as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5838,7 +5662,7 @@ fn bindgen_test_layout___kernel_timespec() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_timespec>())).tv_nsec as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tv_nsec) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -5856,6 +5680,8 @@ pub struct __kernel_itimerspec { } #[test] fn bindgen_test_layout___kernel_itimerspec() { + const UNINIT: ::std::mem::MaybeUninit<__kernel_itimerspec> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__kernel_itimerspec>(), 32usize, @@ -5867,7 +5693,7 @@ fn bindgen_test_layout___kernel_itimerspec() { concat!("Alignment of ", stringify!(__kernel_itimerspec)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_itimerspec>())).it_interval as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).it_interval) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5877,7 +5703,7 @@ fn bindgen_test_layout___kernel_itimerspec() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_itimerspec>())).it_value as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).it_value) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -5889,40 +5715,43 @@ fn bindgen_test_layout___kernel_itimerspec() { } #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct __kernel_old_timeval { - pub tv_sec: __kernel_long_t, - pub tv_usec: __kernel_long_t, +pub struct __kernel_old_timespec { + pub tv_sec: __kernel_old_time_t, + pub tv_nsec: ::std::os::raw::c_long, } #[test] -fn bindgen_test_layout___kernel_old_timeval() { +fn bindgen_test_layout___kernel_old_timespec() { + const UNINIT: ::std::mem::MaybeUninit<__kernel_old_timespec> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::<__kernel_old_timeval>(), + ::std::mem::size_of::<__kernel_old_timespec>(), 16usize, - concat!("Size of: ", stringify!(__kernel_old_timeval)) + concat!("Size of: ", stringify!(__kernel_old_timespec)) ); assert_eq!( - ::std::mem::align_of::<__kernel_old_timeval>(), + ::std::mem::align_of::<__kernel_old_timespec>(), 8usize, - concat!("Alignment of ", stringify!(__kernel_old_timeval)) + concat!("Alignment of ", stringify!(__kernel_old_timespec)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_old_timeval>())).tv_sec as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(__kernel_old_timeval), + stringify!(__kernel_old_timespec), "::", stringify!(tv_sec) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_old_timeval>())).tv_usec as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tv_nsec) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(__kernel_old_timeval), + stringify!(__kernel_old_timespec), "::", - stringify!(tv_usec) + stringify!(tv_nsec) ) ); } @@ -5934,6 +5763,9 @@ pub struct __kernel_sock_timeval { } #[test] fn bindgen_test_layout___kernel_sock_timeval() { + const UNINIT: ::std::mem::MaybeUninit<__kernel_sock_timeval> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__kernel_sock_timeval>(), 16usize, @@ -5945,7 +5777,7 @@ fn bindgen_test_layout___kernel_sock_timeval() { concat!("Alignment of ", stringify!(__kernel_sock_timeval)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_sock_timeval>())).tv_sec as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5955,7 +5787,7 @@ fn bindgen_test_layout___kernel_sock_timeval() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_sock_timeval>())).tv_usec as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tv_usec) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -5968,11 +5800,13 @@ fn bindgen_test_layout___kernel_sock_timeval() { #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct timespec { - pub tv_sec: __kernel_time_t, + pub tv_sec: __kernel_old_time_t, pub tv_nsec: ::std::os::raw::c_long, } #[test] fn bindgen_test_layout_timespec() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 16usize, @@ -5984,7 +5818,7 @@ fn bindgen_test_layout_timespec() { concat!("Alignment of ", stringify!(timespec)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tv_sec as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -5994,7 +5828,7 @@ fn bindgen_test_layout_timespec() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tv_nsec as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tv_nsec) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -6007,11 +5841,13 @@ fn bindgen_test_layout_timespec() { #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct timeval { - pub tv_sec: __kernel_time_t, + pub tv_sec: __kernel_old_time_t, pub tv_usec: __kernel_suseconds_t, } #[test] fn bindgen_test_layout_timeval() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 16usize, @@ -6023,7 +5859,7 @@ fn bindgen_test_layout_timeval() { concat!("Alignment of ", stringify!(timeval)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tv_sec as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6033,7 +5869,7 @@ fn bindgen_test_layout_timeval() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tv_usec as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tv_usec) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -6045,51 +5881,14 @@ 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, } #[test] fn bindgen_test_layout_itimerspec() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 32usize, @@ -6101,7 +5900,7 @@ fn bindgen_test_layout_itimerspec() { concat!("Alignment of ", stringify!(itimerspec)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).it_interval as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).it_interval) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6111,7 +5910,7 @@ fn bindgen_test_layout_itimerspec() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).it_value as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).it_value) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -6129,6 +5928,8 @@ pub struct itimerval { } #[test] fn bindgen_test_layout_itimerval() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 32usize, @@ -6140,7 +5941,7 @@ fn bindgen_test_layout_itimerval() { concat!("Alignment of ", stringify!(itimerval)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).it_interval as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).it_interval) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6150,7 +5951,7 @@ fn bindgen_test_layout_itimerval() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).it_value as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).it_value) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -6160,6 +5961,47 @@ 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() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + 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::addr_of!((*ptr).tz_minuteswest) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(timezone), + "::", + stringify!(tz_minuteswest) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tz_dsttime) as usize - ptr 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; @@ -6175,6 +6017,8 @@ pub struct __kernel_sigaction { } #[test] fn bindgen_test_layout___kernel_sigaction() { + const UNINIT: ::std::mem::MaybeUninit<__kernel_sigaction> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__kernel_sigaction>(), 32usize, @@ -6186,7 +6030,7 @@ fn bindgen_test_layout___kernel_sigaction() { concat!("Alignment of ", stringify!(__kernel_sigaction)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_sigaction>())).sa_handler as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sa_handler) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6196,7 +6040,7 @@ fn bindgen_test_layout___kernel_sigaction() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_sigaction>())).sa_flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sa_flags) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -6206,7 +6050,7 @@ fn bindgen_test_layout___kernel_sigaction() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_sigaction>())).sa_restorer as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sa_restorer) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -6216,7 +6060,7 @@ fn bindgen_test_layout___kernel_sigaction() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_sigaction>())).sa_mask as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sa_mask) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -6227,13 +6071,16 @@ fn bindgen_test_layout___kernel_sigaction() { ); } #[repr(C)] +#[derive(Debug, Copy, Clone)] pub struct sigaltstack { pub ss_sp: *mut ::std::os::raw::c_void, pub ss_flags: ::std::os::raw::c_int, - pub ss_size: size_t, + pub ss_size: __kernel_size_t, } #[test] fn bindgen_test_layout_sigaltstack() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 24usize, @@ -6245,7 +6092,7 @@ fn bindgen_test_layout_sigaltstack() { concat!("Alignment of ", stringify!(sigaltstack)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ss_sp as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ss_sp) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6255,7 +6102,7 @@ fn bindgen_test_layout_sigaltstack() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ss_flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ss_flags) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -6265,7 +6112,7 @@ fn bindgen_test_layout_sigaltstack() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ss_size as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ss_size) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -6284,6 +6131,8 @@ pub union sigval { } #[test] fn bindgen_test_layout_sigval() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 8usize, @@ -6295,7 +6144,7 @@ fn bindgen_test_layout_sigval() { concat!("Alignment of ", stringify!(sigval)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sival_int as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sival_int) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6305,7 +6154,7 @@ fn bindgen_test_layout_sigval() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sival_ptr as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sival_ptr) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6335,6 +6184,9 @@ pub struct __sifields__bindgen_ty_1 { } #[test] fn bindgen_test_layout___sifields__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_1> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__sifields__bindgen_ty_1>(), 8usize, @@ -6346,7 +6198,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_1() { concat!("Alignment of ", stringify!(__sifields__bindgen_ty_1)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_1>()))._pid as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._pid) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6356,7 +6208,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_1() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_1>()))._uid as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._uid) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -6376,6 +6228,9 @@ pub struct __sifields__bindgen_ty_2 { } #[test] fn bindgen_test_layout___sifields__bindgen_ty_2() { + const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_2> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__sifields__bindgen_ty_2>(), 24usize, @@ -6387,7 +6242,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_2() { concat!("Alignment of ", stringify!(__sifields__bindgen_ty_2)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_2>()))._tid as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._tid) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6397,9 +6252,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_2() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_2>()))._overrun as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._overrun) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -6409,9 +6262,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_2() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_2>()))._sigval as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._sigval) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -6421,9 +6272,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_2() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_2>()))._sys_private as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._sys_private) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -6442,6 +6291,9 @@ pub struct __sifields__bindgen_ty_3 { } #[test] fn bindgen_test_layout___sifields__bindgen_ty_3() { + const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_3> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__sifields__bindgen_ty_3>(), 16usize, @@ -6453,7 +6305,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_3() { concat!("Alignment of ", stringify!(__sifields__bindgen_ty_3)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_3>()))._pid as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._pid) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6463,7 +6315,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_3() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_3>()))._uid as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._uid) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -6473,9 +6325,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_3() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_3>()))._sigval as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._sigval) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -6496,6 +6346,9 @@ pub struct __sifields__bindgen_ty_4 { } #[test] fn bindgen_test_layout___sifields__bindgen_ty_4() { + const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_4> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__sifields__bindgen_ty_4>(), 32usize, @@ -6507,7 +6360,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_4() { concat!("Alignment of ", stringify!(__sifields__bindgen_ty_4)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_4>()))._pid as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._pid) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6517,7 +6370,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_4() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_4>()))._uid as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._uid) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -6527,9 +6380,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_4() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_4>()))._status as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._status) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -6539,7 +6390,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_4() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_4>()))._utime as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._utime) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -6549,7 +6400,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_4() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_4>()))._stime as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._stime) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -6568,9 +6419,11 @@ 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)] @@ -6581,6 +6434,9 @@ pub struct __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1 { } #[test] fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1>(), 24usize, @@ -6598,10 +6454,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1>())) - ._dummy_bnd as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._dummy_bnd) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6611,10 +6464,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1>()))._lower - as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._lower) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -6624,10 +6474,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1>()))._upper - as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._upper) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -6645,6 +6492,9 @@ pub struct __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2 { } #[test] fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2() { + const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2>(), 12usize, @@ -6662,10 +6512,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2>())) - ._dummy_pkey as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._dummy_pkey) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6675,10 +6522,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2>()))._pkey - as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._pkey) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -6688,8 +6532,59 @@ 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() { + const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + 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::addr_of!((*ptr)._data) as usize - ptr 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::addr_of!((*ptr)._type) as usize - ptr 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() { + const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_5__bindgen_ty_1> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__sifields__bindgen_ty_5__bindgen_ty_1>(), 24usize, @@ -6707,10 +6602,17 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1>()))._addr_lsb as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._trapno) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__sifields__bindgen_ty_5__bindgen_ty_1), + "::", + stringify!(_trapno) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._addr_lsb) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6720,10 +6622,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1>()))._addr_bnd as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._addr_bnd) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6733,10 +6632,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_5__bindgen_ty_1>()))._addr_pkey - as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._addr_pkey) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6745,9 +6641,22 @@ fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1() { stringify!(_addr_pkey) ) ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._perf) as usize - ptr 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() { + const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_5> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__sifields__bindgen_ty_5>(), 32usize, @@ -6759,7 +6668,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_5() { concat!("Alignment of ", stringify!(__sifields__bindgen_ty_5)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_5>()))._addr as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._addr) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6777,6 +6686,9 @@ pub struct __sifields__bindgen_ty_6 { } #[test] fn bindgen_test_layout___sifields__bindgen_ty_6() { + const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_6> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__sifields__bindgen_ty_6>(), 16usize, @@ -6788,7 +6700,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_6() { concat!("Alignment of ", stringify!(__sifields__bindgen_ty_6)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_6>()))._band as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._band) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6798,7 +6710,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_6() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_6>()))._fd as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._fd) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -6817,6 +6729,9 @@ pub struct __sifields__bindgen_ty_7 { } #[test] fn bindgen_test_layout___sifields__bindgen_ty_7() { + const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_7> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__sifields__bindgen_ty_7>(), 16usize, @@ -6828,9 +6743,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_7() { concat!("Alignment of ", stringify!(__sifields__bindgen_ty_7)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_7>()))._call_addr as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._call_addr) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6840,9 +6753,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_7() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__sifields__bindgen_ty_7>()))._syscall as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._syscall) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -6852,7 +6763,7 @@ fn bindgen_test_layout___sifields__bindgen_ty_7() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields__bindgen_ty_7>()))._arch as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._arch) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", @@ -6864,6 +6775,8 @@ fn bindgen_test_layout___sifields__bindgen_ty_7() { } #[test] fn bindgen_test_layout___sifields() { + const UNINIT: ::std::mem::MaybeUninit<__sifields> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__sifields>(), 32usize, @@ -6875,7 +6788,7 @@ fn bindgen_test_layout___sifields() { concat!("Alignment of ", stringify!(__sifields)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields>()))._kill as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._kill) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6885,7 +6798,7 @@ fn bindgen_test_layout___sifields() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields>()))._timer as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._timer) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6895,7 +6808,7 @@ fn bindgen_test_layout___sifields() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields>()))._rt as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._rt) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6905,7 +6818,7 @@ fn bindgen_test_layout___sifields() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields>()))._sigchld as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._sigchld) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6915,7 +6828,7 @@ fn bindgen_test_layout___sifields() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields>()))._sigfault as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._sigfault) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6925,7 +6838,7 @@ fn bindgen_test_layout___sifields() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields>()))._sigpoll as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._sigpoll) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6935,7 +6848,7 @@ fn bindgen_test_layout___sifields() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sifields>()))._sigsys as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._sigsys) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6966,6 +6879,9 @@ pub struct siginfo__bindgen_ty_1__bindgen_ty_1 { } #[test] fn bindgen_test_layout_siginfo__bindgen_ty_1__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 48usize, @@ -6980,10 +6896,7 @@ fn bindgen_test_layout_siginfo__bindgen_ty_1__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).si_signo as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).si_signo) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -6993,10 +6906,7 @@ fn bindgen_test_layout_siginfo__bindgen_ty_1__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).si_errno as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).si_errno) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -7006,10 +6916,7 @@ fn bindgen_test_layout_siginfo__bindgen_ty_1__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).si_code as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).si_code) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -7019,10 +6926,7 @@ fn bindgen_test_layout_siginfo__bindgen_ty_1__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::()))._sifields as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._sifields) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -7034,6 +6938,9 @@ fn bindgen_test_layout_siginfo__bindgen_ty_1__bindgen_ty_1() { } #[test] fn bindgen_test_layout_siginfo__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 128usize, @@ -7045,7 +6952,7 @@ fn bindgen_test_layout_siginfo__bindgen_ty_1() { concat!("Alignment of ", stringify!(siginfo__bindgen_ty_1)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::()))._si_pad as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._si_pad) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -7092,6 +6999,9 @@ pub struct sigevent__bindgen_ty_1__bindgen_ty_1 { } #[test] fn bindgen_test_layout_sigevent__bindgen_ty_1__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 16usize, @@ -7109,10 +7019,7 @@ fn bindgen_test_layout_sigevent__bindgen_ty_1__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::()))._function as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._function) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -7122,10 +7029,7 @@ fn bindgen_test_layout_sigevent__bindgen_ty_1__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::()))._attribute as *const _ - as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._attribute) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -7137,6 +7041,9 @@ fn bindgen_test_layout_sigevent__bindgen_ty_1__bindgen_ty_1() { } #[test] fn bindgen_test_layout_sigevent__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 48usize, @@ -7148,7 +7055,7 @@ fn bindgen_test_layout_sigevent__bindgen_ty_1() { concat!("Alignment of ", stringify!(sigevent__bindgen_ty_1)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::()))._pad as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._pad) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -7158,7 +7065,7 @@ fn bindgen_test_layout_sigevent__bindgen_ty_1() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::()))._tid as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._tid) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -7168,9 +7075,7 @@ fn bindgen_test_layout_sigevent__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::()))._sigev_thread as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr)._sigev_thread) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -7182,6 +7087,8 @@ fn bindgen_test_layout_sigevent__bindgen_ty_1() { } #[test] fn bindgen_test_layout_sigevent() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 64usize, @@ -7193,7 +7100,7 @@ fn bindgen_test_layout_sigevent() { concat!("Alignment of ", stringify!(sigevent)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sigev_value as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sigev_value) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -7203,7 +7110,7 @@ fn bindgen_test_layout_sigevent() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sigev_signo as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sigev_signo) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -7213,7 +7120,7 @@ fn bindgen_test_layout_sigevent() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sigev_notify as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sigev_notify) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", @@ -7223,7 +7130,7 @@ fn bindgen_test_layout_sigevent() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::()))._sigev_un as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._sigev_un) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -7260,6 +7167,9 @@ pub union sigaction__bindgen_ty_1 { } #[test] fn bindgen_test_layout_sigaction__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 8usize, @@ -7271,9 +7181,7 @@ fn bindgen_test_layout_sigaction__bindgen_ty_1() { concat!("Alignment of ", stringify!(sigaction__bindgen_ty_1)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).sa_handler as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).sa_handler) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -7283,9 +7191,7 @@ fn bindgen_test_layout_sigaction__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).sa_sigaction as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).sa_sigaction) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -7297,6 +7203,8 @@ fn bindgen_test_layout_sigaction__bindgen_ty_1() { } #[test] fn bindgen_test_layout_sigaction() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 32usize, @@ -7308,7 +7216,7 @@ fn bindgen_test_layout_sigaction() { concat!("Alignment of ", stringify!(sigaction)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sa_flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sa_flags) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -7318,7 +7226,7 @@ fn bindgen_test_layout_sigaction() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sa_mask as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sa_mask) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -7328,7 +7236,7 @@ fn bindgen_test_layout_sigaction() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sa_restorer as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sa_restorer) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -7360,6 +7268,9 @@ pub union sigaction64__bindgen_ty_1 { } #[test] fn bindgen_test_layout_sigaction64__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 8usize, @@ -7371,9 +7282,7 @@ fn bindgen_test_layout_sigaction64__bindgen_ty_1() { concat!("Alignment of ", stringify!(sigaction64__bindgen_ty_1)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).sa_handler as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).sa_handler) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -7383,9 +7292,7 @@ fn bindgen_test_layout_sigaction64__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).sa_sigaction as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).sa_sigaction) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -7397,6 +7304,8 @@ fn bindgen_test_layout_sigaction64__bindgen_ty_1() { } #[test] fn bindgen_test_layout_sigaction64() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 32usize, @@ -7408,7 +7317,7 @@ fn bindgen_test_layout_sigaction64() { concat!("Alignment of ", stringify!(sigaction64)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sa_flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sa_flags) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -7418,7 +7327,7 @@ fn bindgen_test_layout_sigaction64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sa_mask as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sa_mask) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -7428,7 +7337,7 @@ fn bindgen_test_layout_sigaction64() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sa_restorer as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sa_restorer) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -7455,6 +7364,8 @@ pub struct user_fpregs_struct { } #[test] fn bindgen_test_layout_user_fpregs_struct() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 512usize, @@ -7466,7 +7377,7 @@ fn bindgen_test_layout_user_fpregs_struct() { concat!("Alignment of ", stringify!(user_fpregs_struct)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).cwd as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).cwd) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -7476,7 +7387,7 @@ fn bindgen_test_layout_user_fpregs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).swd as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).swd) as usize - ptr as usize }, 2usize, concat!( "Offset of field: ", @@ -7486,7 +7397,7 @@ fn bindgen_test_layout_user_fpregs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ftw as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ftw) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -7496,7 +7407,7 @@ fn bindgen_test_layout_user_fpregs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).fop as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).fop) as usize - ptr as usize }, 6usize, concat!( "Offset of field: ", @@ -7506,7 +7417,7 @@ fn bindgen_test_layout_user_fpregs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).rip as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).rip) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -7516,7 +7427,7 @@ fn bindgen_test_layout_user_fpregs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).rdp as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).rdp) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -7526,7 +7437,7 @@ fn bindgen_test_layout_user_fpregs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).mxcsr as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).mxcsr) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -7536,7 +7447,7 @@ fn bindgen_test_layout_user_fpregs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).mxcr_mask as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).mxcr_mask) as usize - ptr as usize }, 28usize, concat!( "Offset of field: ", @@ -7546,7 +7457,7 @@ fn bindgen_test_layout_user_fpregs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).st_space as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).st_space) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -7556,7 +7467,7 @@ fn bindgen_test_layout_user_fpregs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).xmm_space as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).xmm_space) as usize - ptr as usize }, 160usize, concat!( "Offset of field: ", @@ -7566,7 +7477,7 @@ fn bindgen_test_layout_user_fpregs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).padding as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).padding) as usize - ptr as usize }, 416usize, concat!( "Offset of field: ", @@ -7609,6 +7520,8 @@ pub struct user_regs_struct { } #[test] fn bindgen_test_layout_user_regs_struct() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 216usize, @@ -7620,7 +7533,7 @@ fn bindgen_test_layout_user_regs_struct() { concat!("Alignment of ", stringify!(user_regs_struct)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).r15 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).r15) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -7630,7 +7543,7 @@ fn bindgen_test_layout_user_regs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).r14 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).r14) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -7640,7 +7553,7 @@ fn bindgen_test_layout_user_regs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).r13 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).r13) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -7650,7 +7563,7 @@ fn bindgen_test_layout_user_regs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).r12 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).r12) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -7660,7 +7573,7 @@ fn bindgen_test_layout_user_regs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).rbp as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).rbp) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -7670,7 +7583,7 @@ fn bindgen_test_layout_user_regs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).rbx as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).rbx) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", @@ -7680,7 +7593,7 @@ fn bindgen_test_layout_user_regs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).r11 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).r11) as usize - ptr as usize }, 48usize, concat!( "Offset of field: ", @@ -7690,7 +7603,7 @@ fn bindgen_test_layout_user_regs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).r10 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).r10) as usize - ptr as usize }, 56usize, concat!( "Offset of field: ", @@ -7700,7 +7613,7 @@ fn bindgen_test_layout_user_regs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).r9 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).r9) as usize - ptr as usize }, 64usize, concat!( "Offset of field: ", @@ -7710,7 +7623,7 @@ fn bindgen_test_layout_user_regs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).r8 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).r8) as usize - ptr as usize }, 72usize, concat!( "Offset of field: ", @@ -7720,7 +7633,7 @@ fn bindgen_test_layout_user_regs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).rax as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).rax) as usize - ptr as usize }, 80usize, concat!( "Offset of field: ", @@ -7730,7 +7643,7 @@ fn bindgen_test_layout_user_regs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).rcx as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).rcx) as usize - ptr as usize }, 88usize, concat!( "Offset of field: ", @@ -7740,7 +7653,7 @@ fn bindgen_test_layout_user_regs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).rdx as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).rdx) as usize - ptr as usize }, 96usize, concat!( "Offset of field: ", @@ -7750,7 +7663,7 @@ fn bindgen_test_layout_user_regs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).rsi as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).rsi) as usize - ptr as usize }, 104usize, concat!( "Offset of field: ", @@ -7760,7 +7673,7 @@ fn bindgen_test_layout_user_regs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).rdi as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).rdi) as usize - ptr as usize }, 112usize, concat!( "Offset of field: ", @@ -7770,7 +7683,7 @@ fn bindgen_test_layout_user_regs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).orig_rax as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).orig_rax) as usize - ptr as usize }, 120usize, concat!( "Offset of field: ", @@ -7780,7 +7693,7 @@ fn bindgen_test_layout_user_regs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).rip as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).rip) as usize - ptr as usize }, 128usize, concat!( "Offset of field: ", @@ -7790,7 +7703,7 @@ fn bindgen_test_layout_user_regs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).cs as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).cs) as usize - ptr as usize }, 136usize, concat!( "Offset of field: ", @@ -7800,7 +7713,7 @@ fn bindgen_test_layout_user_regs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).eflags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).eflags) as usize - ptr as usize }, 144usize, concat!( "Offset of field: ", @@ -7810,7 +7723,7 @@ fn bindgen_test_layout_user_regs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).rsp as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).rsp) as usize - ptr as usize }, 152usize, concat!( "Offset of field: ", @@ -7820,7 +7733,7 @@ fn bindgen_test_layout_user_regs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ss as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ss) as usize - ptr as usize }, 160usize, concat!( "Offset of field: ", @@ -7830,7 +7743,7 @@ fn bindgen_test_layout_user_regs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).fs_base as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).fs_base) as usize - ptr as usize }, 168usize, concat!( "Offset of field: ", @@ -7840,7 +7753,7 @@ fn bindgen_test_layout_user_regs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).gs_base as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).gs_base) as usize - ptr as usize }, 176usize, concat!( "Offset of field: ", @@ -7850,7 +7763,7 @@ fn bindgen_test_layout_user_regs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ds as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ds) as usize - ptr as usize }, 184usize, concat!( "Offset of field: ", @@ -7860,7 +7773,7 @@ fn bindgen_test_layout_user_regs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).es as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).es) as usize - ptr as usize }, 192usize, concat!( "Offset of field: ", @@ -7870,7 +7783,7 @@ fn bindgen_test_layout_user_regs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).fs as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).fs) as usize - ptr as usize }, 200usize, concat!( "Offset of field: ", @@ -7880,7 +7793,7 @@ fn bindgen_test_layout_user_regs_struct() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).gs as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).gs) as usize - ptr as usize }, 208usize, concat!( "Offset of field: ", @@ -7915,6 +7828,8 @@ pub struct user { } #[test] fn bindgen_test_layout_user() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 928usize, @@ -7926,7 +7841,7 @@ fn bindgen_test_layout_user() { concat!("Alignment of ", stringify!(user)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).regs as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).regs) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -7936,7 +7851,7 @@ fn bindgen_test_layout_user() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).u_fpvalid as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).u_fpvalid) as usize - ptr as usize }, 216usize, concat!( "Offset of field: ", @@ -7946,7 +7861,7 @@ fn bindgen_test_layout_user() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pad0 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pad0) as usize - ptr as usize }, 220usize, concat!( "Offset of field: ", @@ -7956,7 +7871,7 @@ fn bindgen_test_layout_user() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).i387 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).i387) as usize - ptr as usize }, 224usize, concat!( "Offset of field: ", @@ -7966,7 +7881,7 @@ fn bindgen_test_layout_user() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).u_tsize as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).u_tsize) as usize - ptr as usize }, 736usize, concat!( "Offset of field: ", @@ -7976,7 +7891,7 @@ fn bindgen_test_layout_user() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).u_dsize as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).u_dsize) as usize - ptr as usize }, 744usize, concat!( "Offset of field: ", @@ -7986,7 +7901,7 @@ fn bindgen_test_layout_user() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).u_ssize as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).u_ssize) as usize - ptr as usize }, 752usize, concat!( "Offset of field: ", @@ -7996,7 +7911,7 @@ fn bindgen_test_layout_user() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).start_code as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).start_code) as usize - ptr as usize }, 760usize, concat!( "Offset of field: ", @@ -8006,7 +7921,7 @@ fn bindgen_test_layout_user() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).start_stack as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).start_stack) as usize - ptr as usize }, 768usize, concat!( "Offset of field: ", @@ -8016,7 +7931,7 @@ fn bindgen_test_layout_user() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).signal as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).signal) as usize - ptr as usize }, 776usize, concat!( "Offset of field: ", @@ -8026,7 +7941,7 @@ fn bindgen_test_layout_user() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).reserved) as usize - ptr as usize }, 784usize, concat!( "Offset of field: ", @@ -8036,7 +7951,7 @@ fn bindgen_test_layout_user() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pad1 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pad1) as usize - ptr as usize }, 788usize, concat!( "Offset of field: ", @@ -8046,7 +7961,7 @@ fn bindgen_test_layout_user() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).u_ar0 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).u_ar0) as usize - ptr as usize }, 792usize, concat!( "Offset of field: ", @@ -8056,7 +7971,7 @@ fn bindgen_test_layout_user() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).u_fpstate as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).u_fpstate) as usize - ptr as usize }, 800usize, concat!( "Offset of field: ", @@ -8066,7 +7981,7 @@ fn bindgen_test_layout_user() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).magic as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).magic) as usize - ptr as usize }, 808usize, concat!( "Offset of field: ", @@ -8076,7 +7991,7 @@ fn bindgen_test_layout_user() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).u_comm as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).u_comm) as usize - ptr as usize }, 816usize, concat!( "Offset of field: ", @@ -8086,7 +8001,7 @@ fn bindgen_test_layout_user() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).u_debugreg as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).u_debugreg) as usize - ptr as usize }, 848usize, concat!( "Offset of field: ", @@ -8096,7 +8011,7 @@ fn bindgen_test_layout_user() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).error_code as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).error_code) as usize - ptr as usize }, 912usize, concat!( "Offset of field: ", @@ -8106,7 +8021,7 @@ fn bindgen_test_layout_user() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).fault_address as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).fault_address) as usize - ptr as usize }, 920usize, concat!( "Offset of field: ", @@ -8116,30 +8031,30 @@ fn bindgen_test_layout_user() { ) ); } -pub const REG_R8: ::std::os::raw::c_uint = 0; -pub const REG_R9: ::std::os::raw::c_uint = 1; -pub const REG_R10: ::std::os::raw::c_uint = 2; -pub const REG_R11: ::std::os::raw::c_uint = 3; -pub const REG_R12: ::std::os::raw::c_uint = 4; -pub const REG_R13: ::std::os::raw::c_uint = 5; -pub const REG_R14: ::std::os::raw::c_uint = 6; -pub const REG_R15: ::std::os::raw::c_uint = 7; -pub const REG_RDI: ::std::os::raw::c_uint = 8; -pub const REG_RSI: ::std::os::raw::c_uint = 9; -pub const REG_RBP: ::std::os::raw::c_uint = 10; -pub const REG_RBX: ::std::os::raw::c_uint = 11; -pub const REG_RDX: ::std::os::raw::c_uint = 12; -pub const REG_RAX: ::std::os::raw::c_uint = 13; -pub const REG_RCX: ::std::os::raw::c_uint = 14; -pub const REG_RSP: ::std::os::raw::c_uint = 15; -pub const REG_RIP: ::std::os::raw::c_uint = 16; -pub const REG_EFL: ::std::os::raw::c_uint = 17; -pub const REG_CSGSFS: ::std::os::raw::c_uint = 18; -pub const REG_ERR: ::std::os::raw::c_uint = 19; -pub const REG_TRAPNO: ::std::os::raw::c_uint = 20; -pub const REG_OLDMASK: ::std::os::raw::c_uint = 21; -pub const REG_CR2: ::std::os::raw::c_uint = 22; -pub const NGREG: ::std::os::raw::c_uint = 23; +pub const REG_R8: _bindgen_ty_22 = 0; +pub const REG_R9: _bindgen_ty_22 = 1; +pub const REG_R10: _bindgen_ty_22 = 2; +pub const REG_R11: _bindgen_ty_22 = 3; +pub const REG_R12: _bindgen_ty_22 = 4; +pub const REG_R13: _bindgen_ty_22 = 5; +pub const REG_R14: _bindgen_ty_22 = 6; +pub const REG_R15: _bindgen_ty_22 = 7; +pub const REG_RDI: _bindgen_ty_22 = 8; +pub const REG_RSI: _bindgen_ty_22 = 9; +pub const REG_RBP: _bindgen_ty_22 = 10; +pub const REG_RBX: _bindgen_ty_22 = 11; +pub const REG_RDX: _bindgen_ty_22 = 12; +pub const REG_RAX: _bindgen_ty_22 = 13; +pub const REG_RCX: _bindgen_ty_22 = 14; +pub const REG_RSP: _bindgen_ty_22 = 15; +pub const REG_RIP: _bindgen_ty_22 = 16; +pub const REG_EFL: _bindgen_ty_22 = 17; +pub const REG_CSGSFS: _bindgen_ty_22 = 18; +pub const REG_ERR: _bindgen_ty_22 = 19; +pub const REG_TRAPNO: _bindgen_ty_22 = 20; +pub const REG_OLDMASK: _bindgen_ty_22 = 21; +pub const REG_CR2: _bindgen_ty_22 = 22; +pub const NGREG: _bindgen_ty_22 = 23; pub type _bindgen_ty_22 = ::std::os::raw::c_uint; pub type greg_t = ::std::os::raw::c_long; pub type gregset_t = [greg_t; 23usize]; @@ -8152,6 +8067,8 @@ pub struct _libc_fpxreg { } #[test] fn bindgen_test_layout__libc_fpxreg() { + const UNINIT: ::std::mem::MaybeUninit<_libc_fpxreg> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_libc_fpxreg>(), 16usize, @@ -8163,7 +8080,7 @@ fn bindgen_test_layout__libc_fpxreg() { concat!("Alignment of ", stringify!(_libc_fpxreg)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_libc_fpxreg>())).significand as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).significand) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -8173,7 +8090,7 @@ fn bindgen_test_layout__libc_fpxreg() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_libc_fpxreg>())).exponent as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).exponent) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -8183,7 +8100,7 @@ fn bindgen_test_layout__libc_fpxreg() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_libc_fpxreg>())).padding as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).padding) as usize - ptr as usize }, 10usize, concat!( "Offset of field: ", @@ -8200,6 +8117,8 @@ pub struct _libc_xmmreg { } #[test] fn bindgen_test_layout__libc_xmmreg() { + const UNINIT: ::std::mem::MaybeUninit<_libc_xmmreg> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_libc_xmmreg>(), 16usize, @@ -8211,7 +8130,7 @@ fn bindgen_test_layout__libc_xmmreg() { concat!("Alignment of ", stringify!(_libc_xmmreg)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_libc_xmmreg>())).element as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).element) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -8238,6 +8157,8 @@ pub struct _libc_fpstate { } #[test] fn bindgen_test_layout__libc_fpstate() { + const UNINIT: ::std::mem::MaybeUninit<_libc_fpstate> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_libc_fpstate>(), 512usize, @@ -8249,7 +8170,7 @@ fn bindgen_test_layout__libc_fpstate() { concat!("Alignment of ", stringify!(_libc_fpstate)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_libc_fpstate>())).cwd as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).cwd) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -8259,7 +8180,7 @@ fn bindgen_test_layout__libc_fpstate() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_libc_fpstate>())).swd as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).swd) as usize - ptr as usize }, 2usize, concat!( "Offset of field: ", @@ -8269,7 +8190,7 @@ fn bindgen_test_layout__libc_fpstate() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_libc_fpstate>())).ftw as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ftw) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -8279,7 +8200,7 @@ fn bindgen_test_layout__libc_fpstate() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_libc_fpstate>())).fop as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).fop) as usize - ptr as usize }, 6usize, concat!( "Offset of field: ", @@ -8289,7 +8210,7 @@ fn bindgen_test_layout__libc_fpstate() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_libc_fpstate>())).rip as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).rip) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -8299,7 +8220,7 @@ fn bindgen_test_layout__libc_fpstate() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_libc_fpstate>())).rdp as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).rdp) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -8309,7 +8230,7 @@ fn bindgen_test_layout__libc_fpstate() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_libc_fpstate>())).mxcsr as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).mxcsr) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -8319,7 +8240,7 @@ fn bindgen_test_layout__libc_fpstate() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_libc_fpstate>())).mxcr_mask as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).mxcr_mask) as usize - ptr as usize }, 28usize, concat!( "Offset of field: ", @@ -8329,7 +8250,7 @@ fn bindgen_test_layout__libc_fpstate() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_libc_fpstate>()))._st as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._st) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -8339,7 +8260,7 @@ fn bindgen_test_layout__libc_fpstate() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_libc_fpstate>()))._xmm as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr)._xmm) as usize - ptr as usize }, 160usize, concat!( "Offset of field: ", @@ -8349,7 +8270,7 @@ fn bindgen_test_layout__libc_fpstate() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_libc_fpstate>())).padding as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).padding) as usize - ptr as usize }, 416usize, concat!( "Offset of field: ", @@ -8369,6 +8290,8 @@ pub struct mcontext_t { } #[test] fn bindgen_test_layout_mcontext_t() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 256usize, @@ -8380,7 +8303,7 @@ fn bindgen_test_layout_mcontext_t() { concat!("Alignment of ", stringify!(mcontext_t)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).gregs as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).gregs) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -8390,7 +8313,7 @@ fn bindgen_test_layout_mcontext_t() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).fpregs as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).fpregs) as usize - ptr as usize }, 184usize, concat!( "Offset of field: ", @@ -8400,7 +8323,7 @@ fn bindgen_test_layout_mcontext_t() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).__reserved1 as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).__reserved1) as usize - ptr as usize }, 192usize, concat!( "Offset of field: ", @@ -8411,6 +8334,7 @@ fn bindgen_test_layout_mcontext_t() { ); } #[repr(C)] +#[derive(Copy, Clone)] pub struct ucontext { pub uc_flags: ::std::os::raw::c_ulong, pub uc_link: *mut ucontext, @@ -8427,6 +8351,9 @@ pub union ucontext__bindgen_ty_1 { } #[test] fn bindgen_test_layout_ucontext__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 8usize, @@ -8438,9 +8365,7 @@ fn bindgen_test_layout_ucontext__bindgen_ty_1() { concat!("Alignment of ", stringify!(ucontext__bindgen_ty_1)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).uc_sigmask as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).uc_sigmask) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -8450,9 +8375,7 @@ fn bindgen_test_layout_ucontext__bindgen_ty_1() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).uc_sigmask64 as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).uc_sigmask64) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -8464,6 +8387,8 @@ fn bindgen_test_layout_ucontext__bindgen_ty_1() { } #[test] fn bindgen_test_layout_ucontext() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 816usize, @@ -8475,7 +8400,7 @@ fn bindgen_test_layout_ucontext() { concat!("Alignment of ", stringify!(ucontext)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).uc_flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).uc_flags) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -8485,7 +8410,7 @@ fn bindgen_test_layout_ucontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).uc_link as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).uc_link) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -8495,7 +8420,7 @@ fn bindgen_test_layout_ucontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).uc_stack as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).uc_stack) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -8505,7 +8430,7 @@ fn bindgen_test_layout_ucontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).uc_mcontext as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).uc_mcontext) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", @@ -8515,7 +8440,7 @@ fn bindgen_test_layout_ucontext() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).__fpregs_mem as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).__fpregs_mem) as usize - ptr as usize }, 304usize, concat!( "Offset of field: ", @@ -8729,6 +8654,8 @@ pub struct fd_set { } #[test] fn bindgen_test_layout_fd_set() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 128usize, @@ -8740,7 +8667,7 @@ fn bindgen_test_layout_fd_set() { concat!("Alignment of ", stringify!(fd_set)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).fds_bits as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).fds_bits) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -8751,21 +8678,21 @@ fn bindgen_test_layout_fd_set() { ); } extern "C" { - pub fn __FD_CLR_chk(arg1: ::std::os::raw::c_int, arg2: *mut fd_set, arg3: size_t); + pub fn __FD_CLR_chk(arg1: ::std::os::raw::c_int, arg2: *mut fd_set, arg3: usize); } extern "C" { - pub fn __FD_SET_chk(arg1: ::std::os::raw::c_int, arg2: *mut fd_set, arg3: size_t); + pub fn __FD_SET_chk(arg1: ::std::os::raw::c_int, arg2: *mut fd_set, arg3: usize); } extern "C" { pub fn __FD_ISSET_chk( arg1: ::std::os::raw::c_int, arg2: *const fd_set, - arg3: size_t, + arg3: usize, ) -> ::std::os::raw::c_int; } extern "C" { pub fn select( - __fd_count: ::std::os::raw::c_int, + __max_fd_plus_one: ::std::os::raw::c_int, __read_fds: *mut fd_set, __write_fds: *mut fd_set, __exception_fds: *mut fd_set, @@ -8774,7 +8701,7 @@ extern "C" { } extern "C" { pub fn pselect( - __fd_count: ::std::os::raw::c_int, + __max_fd_plus_one: ::std::os::raw::c_int, __read_fds: *mut fd_set, __write_fds: *mut fd_set, __exception_fds: *mut fd_set, @@ -8784,7 +8711,7 @@ extern "C" { } extern "C" { pub fn pselect64( - __fd_count: ::std::os::raw::c_int, + __max_fd_plus_one: ::std::os::raw::c_int, __read_fds: *mut fd_set, __write_fds: *mut fd_set, __exception_fds: *mut fd_set, @@ -8849,6 +8776,8 @@ pub struct tm { } #[test] fn bindgen_test_layout_tm() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 56usize, @@ -8860,7 +8789,7 @@ fn bindgen_test_layout_tm() { concat!("Alignment of ", stringify!(tm)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tm_sec as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tm_sec) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -8870,7 +8799,7 @@ fn bindgen_test_layout_tm() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tm_min as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tm_min) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -8880,7 +8809,7 @@ fn bindgen_test_layout_tm() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tm_hour as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tm_hour) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -8890,7 +8819,7 @@ fn bindgen_test_layout_tm() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tm_mday as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tm_mday) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", @@ -8900,7 +8829,7 @@ fn bindgen_test_layout_tm() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tm_mon as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tm_mon) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -8910,7 +8839,7 @@ fn bindgen_test_layout_tm() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tm_year as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tm_year) as usize - ptr as usize }, 20usize, concat!( "Offset of field: ", @@ -8920,7 +8849,7 @@ fn bindgen_test_layout_tm() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tm_wday as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tm_wday) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -8930,7 +8859,7 @@ fn bindgen_test_layout_tm() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tm_yday as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tm_yday) as usize - ptr as usize }, 28usize, concat!( "Offset of field: ", @@ -8940,7 +8869,7 @@ fn bindgen_test_layout_tm() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tm_isdst as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tm_isdst) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -8950,7 +8879,7 @@ fn bindgen_test_layout_tm() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tm_gmtoff as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tm_gmtoff) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", @@ -8960,7 +8889,7 @@ fn bindgen_test_layout_tm() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tm_zone as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tm_zone) as usize - ptr as usize }, 48usize, concat!( "Offset of field: ", @@ -9024,19 +8953,19 @@ extern "C" { extern "C" { pub fn strftime( __buf: *mut ::std::os::raw::c_char, - __n: size_t, + __n: usize, __fmt: *const ::std::os::raw::c_char, __tm: *const tm, - ) -> size_t; + ) -> usize; } extern "C" { pub fn strftime_l( __buf: *mut ::std::os::raw::c_char, - __n: size_t, + __n: usize, __fmt: *const ::std::os::raw::c_char, __tm: *const tm, __l: locale_t, - ) -> size_t; + ) -> usize; } extern "C" { pub fn ctime(__t: *const time_t) -> *mut ::std::os::raw::c_char; @@ -9144,12 +9073,17 @@ 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() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 64usize, + 88usize, concat!("Size of: ", stringify!(clone_args)) ); assert_eq!( @@ -9158,7 +9092,7 @@ fn bindgen_test_layout_clone_args() { concat!("Alignment of ", stringify!(clone_args)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -9168,7 +9102,7 @@ fn bindgen_test_layout_clone_args() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pidfd as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pidfd) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -9178,7 +9112,7 @@ fn bindgen_test_layout_clone_args() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).child_tid as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).child_tid) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -9188,7 +9122,7 @@ fn bindgen_test_layout_clone_args() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).parent_tid as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).parent_tid) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -9198,7 +9132,7 @@ fn bindgen_test_layout_clone_args() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).exit_signal as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).exit_signal) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -9208,7 +9142,7 @@ fn bindgen_test_layout_clone_args() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).stack as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).stack) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", @@ -9218,7 +9152,7 @@ fn bindgen_test_layout_clone_args() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).stack_size as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).stack_size) as usize - ptr as usize }, 48usize, concat!( "Offset of field: ", @@ -9228,7 +9162,7 @@ fn bindgen_test_layout_clone_args() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tls as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).tls) as usize - ptr as usize }, 56usize, concat!( "Offset of field: ", @@ -9237,6 +9171,36 @@ fn bindgen_test_layout_clone_args() { stringify!(tls) ) ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).set_tid) as usize - ptr as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(clone_args), + "::", + stringify!(set_tid) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).set_tid_size) as usize - ptr as usize }, + 72usize, + concat!( + "Offset of field: ", + stringify!(clone_args), + "::", + stringify!(set_tid_size) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).cgroup) as usize - ptr as usize }, + 80usize, + concat!( + "Offset of field: ", + stringify!(clone_args), + "::", + stringify!(cgroup) + ) + ); } #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -9245,6 +9209,8 @@ pub struct sched_param { } #[test] fn bindgen_test_layout_sched_param() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 4usize, @@ -9256,7 +9222,7 @@ fn bindgen_test_layout_sched_param() { concat!("Alignment of ", stringify!(sched_param)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sched_priority as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sched_priority) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -9294,15 +9260,15 @@ extern "C" { extern "C" { pub fn sched_rr_get_interval(__pid: pid_t, __quantum: *mut timespec) -> ::std::os::raw::c_int; } -pub const PTHREAD_MUTEX_NORMAL: ::std::os::raw::c_uint = 0; -pub const PTHREAD_MUTEX_RECURSIVE: ::std::os::raw::c_uint = 1; -pub const PTHREAD_MUTEX_ERRORCHECK: ::std::os::raw::c_uint = 2; -pub const PTHREAD_MUTEX_ERRORCHECK_NP: ::std::os::raw::c_uint = 2; -pub const PTHREAD_MUTEX_RECURSIVE_NP: ::std::os::raw::c_uint = 1; -pub const PTHREAD_MUTEX_DEFAULT: ::std::os::raw::c_uint = 0; +pub const PTHREAD_MUTEX_NORMAL: _bindgen_ty_23 = 0; +pub const PTHREAD_MUTEX_RECURSIVE: _bindgen_ty_23 = 1; +pub const PTHREAD_MUTEX_ERRORCHECK: _bindgen_ty_23 = 2; +pub const PTHREAD_MUTEX_ERRORCHECK_NP: _bindgen_ty_23 = 2; +pub const PTHREAD_MUTEX_RECURSIVE_NP: _bindgen_ty_23 = 1; +pub const PTHREAD_MUTEX_DEFAULT: _bindgen_ty_23 = 0; pub type _bindgen_ty_23 = ::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 const PTHREAD_RWLOCK_PREFER_READER_NP: _bindgen_ty_24 = 0; +pub const PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP: _bindgen_ty_24 = 1; pub type _bindgen_ty_24 = ::std::os::raw::c_uint; pub type __pthread_cleanup_func_t = ::std::option::Option; @@ -9315,6 +9281,8 @@ pub struct __pthread_cleanup_t { } #[test] fn bindgen_test_layout___pthread_cleanup_t() { + const UNINIT: ::std::mem::MaybeUninit<__pthread_cleanup_t> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__pthread_cleanup_t>(), 24usize, @@ -9326,9 +9294,7 @@ fn bindgen_test_layout___pthread_cleanup_t() { concat!("Alignment of ", stringify!(__pthread_cleanup_t)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_cleanup_t>())).__cleanup_prev as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).__cleanup_prev) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -9338,9 +9304,7 @@ fn bindgen_test_layout___pthread_cleanup_t() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_cleanup_t>())).__cleanup_routine as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).__cleanup_routine) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -9350,9 +9314,7 @@ fn bindgen_test_layout___pthread_cleanup_t() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_cleanup_t>())).__cleanup_arg as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).__cleanup_arg) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -9372,24 +9334,23 @@ extern "C" { extern "C" { pub fn __pthread_cleanup_pop(arg1: *mut __pthread_cleanup_t, arg2: ::std::os::raw::c_int); } -#[doc = " Data associated with an ALooper fd that will be returned as the \"outData\""] -#[doc = " when that source has data ready."] +#[doc = " Data associated with an ALooper fd that will be returned as the \"outData\"\n when that source has data ready."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct android_poll_source { - #[doc = " The identifier of this source. May be LOOPER_ID_MAIN or"] - #[doc = " LOOPER_ID_INPUT."] + #[doc = " The identifier of this source. May be LOOPER_ID_MAIN or\n LOOPER_ID_INPUT."] pub id: i32, #[doc = " The android_app this ident is associated with."] pub app: *mut android_app, - #[doc = " Function to call to perform the standard processing of data from"] - #[doc = " this source."] + #[doc = " Function to call to perform the standard processing of data from\n this source."] pub process: ::std::option::Option< unsafe extern "C" fn(app: *mut android_app, source: *mut android_poll_source), >, } #[test] fn bindgen_test_layout_android_poll_source() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 24usize, @@ -9401,7 +9362,7 @@ fn bindgen_test_layout_android_poll_source() { concat!("Alignment of ", stringify!(android_poll_source)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).id as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -9411,7 +9372,7 @@ fn bindgen_test_layout_android_poll_source() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).app as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).app) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -9421,7 +9382,7 @@ fn bindgen_test_layout_android_poll_source() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).process as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).process) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -9434,37 +9395,26 @@ fn bindgen_test_layout_android_poll_source() { #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct android_input_buffer { - #[doc = " Pointer to a read-only array of pointers to GameActivityMotionEvent."] - #[doc = " Only the first motionEventsCount events are valid."] - pub motionEvents: [GameActivityMotionEvent; 16usize], + #[doc = " Pointer to a read-only array of GameActivityMotionEvent.\n Only the first motionEventsCount events are valid."] + pub motionEvents: *mut GameActivityMotionEvent, #[doc = " The number of valid motion events in `motionEvents`."] pub motionEventsCount: u64, - #[doc = " Pointer to a read-only array of pointers to GameActivityHistoricalPointerAxes."] - #[doc = ""] - #[doc = " Only the first historicalSamplesCount samples are valid."] - #[doc = " Refer to event->historicalStart, event->pointerCount and event->historicalCount"] - #[doc = " to access the specific samples that relate to an event."] - #[doc = ""] - #[doc = " Each slice of samples for one event has a length of"] - #[doc = " (event->pointerCount and event->historicalCount) and is in pointer-major"] - #[doc = " order so the historic samples for each pointer are contiguous."] - #[doc = " E.g. you would access historic sample index 3 for pointer 2 of an event with:"] - #[doc = ""] - #[doc = " historicalAxisSamples[event->historicalStart + (event->historicalCount * 2) + 3];"] - pub historicalAxisSamples: [GameActivityHistoricalPointerAxes; 64usize], - #[doc = " The number of valid historical samples in `historicalAxisSamples`."] - pub historicalSamplesCount: u64, - #[doc = " Pointer to a read-only array of pointers to GameActivityKeyEvent."] - #[doc = " Only the first keyEventsCount events are valid."] - pub keyEvents: [GameActivityKeyEvent; 4usize], + #[doc = " The size of the `motionEvents` buffer."] + pub motionEventsBufferSize: u64, + #[doc = " Pointer to a read-only array of GameActivityKeyEvent.\n Only the first keyEventsCount events are valid."] + pub keyEvents: *mut GameActivityKeyEvent, #[doc = " The number of valid \"Key\" events in `keyEvents`."] pub keyEventsCount: u64, + #[doc = " The size of the `keyEvents` buffer."] + pub keyEventsBufferSize: u64, } #[test] fn bindgen_test_layout_android_input_buffer() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 40824usize, + 48usize, concat!("Size of: ", stringify!(android_input_buffer)) ); assert_eq!( @@ -9473,9 +9423,7 @@ fn bindgen_test_layout_android_input_buffer() { concat!("Alignment of ", stringify!(android_input_buffer)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).motionEvents as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).motionEvents) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -9485,10 +9433,8 @@ fn bindgen_test_layout_android_input_buffer() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).motionEventsCount as *const _ as usize - }, - 27776usize, + unsafe { ::std::ptr::addr_of!((*ptr).motionEventsCount) as usize - ptr as usize }, + 8usize, concat!( "Offset of field: ", stringify!(android_input_buffer), @@ -9497,153 +9443,81 @@ fn bindgen_test_layout_android_input_buffer() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).historicalAxisSamples as *const _ - as usize - }, - 27784usize, + unsafe { ::std::ptr::addr_of!((*ptr).motionEventsBufferSize) as usize - ptr as usize }, + 16usize, concat!( "Offset of field: ", stringify!(android_input_buffer), "::", - stringify!(historicalAxisSamples) + stringify!(motionEventsBufferSize) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).historicalSamplesCount as *const _ - as usize - }, - 40584usize, + unsafe { ::std::ptr::addr_of!((*ptr).keyEvents) as usize - ptr as usize }, + 24usize, concat!( "Offset of field: ", stringify!(android_input_buffer), "::", - stringify!(historicalSamplesCount) + stringify!(keyEvents) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).keyEvents as *const _ as usize }, - 40592usize, + unsafe { ::std::ptr::addr_of!((*ptr).keyEventsCount) as usize - ptr as usize }, + 32usize, concat!( "Offset of field: ", stringify!(android_input_buffer), "::", - stringify!(keyEvents) + stringify!(keyEventsCount) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).keyEventsCount as *const _ as usize - }, - 40816usize, + unsafe { ::std::ptr::addr_of!((*ptr).keyEventsBufferSize) as usize - ptr as usize }, + 40usize, concat!( "Offset of field: ", stringify!(android_input_buffer), "::", - stringify!(keyEventsCount) + stringify!(keyEventsBufferSize) ) ); } -#[doc = " Function pointer declaration for the filtering of key events."] -#[doc = " A function with this signature should be passed to"] -#[doc = " android_app_set_key_event_filter and return false for any events that should"] -#[doc = " not be handled by android_native_app_glue. These events will be handled by"] -#[doc = " the system instead."] +#[doc = " Function pointer declaration for the filtering of key events.\n A function with this signature should be passed to\n android_app_set_key_event_filter and return false for any events that should\n not be handled by android_native_app_glue. These events will be handled by\n the system instead."] pub type android_key_event_filter = ::std::option::Option bool>; -#[doc = " Function pointer definition for the filtering of motion events."] -#[doc = " A function with this signature should be passed to"] -#[doc = " android_app_set_motion_event_filter and return false for any events that"] -#[doc = " should not be handled by android_native_app_glue. These events will be"] -#[doc = " handled by the system instead."] +#[doc = " Function pointer definition for the filtering of motion events.\n A function with this signature should be passed to\n android_app_set_motion_event_filter and return false for any events that\n should not be handled by android_native_app_glue. These events will be\n handled by the system instead."] pub type android_motion_event_filter = ::std::option::Option bool>; -#[doc = " The GameActivity interface provided by "] -#[doc = " is based on a set of application-provided callbacks that will be called"] -#[doc = " by the Activity's main thread when certain events occur."] -#[doc = ""] -#[doc = " This means that each one of this callbacks _should_ _not_ block, or they"] -#[doc = " risk having the system force-close the application. This programming"] -#[doc = " model is direct, lightweight, but constraining."] -#[doc = ""] -#[doc = " The 'android_native_app_glue' static library is used to provide a different"] -#[doc = " execution model where the application can implement its own main event"] -#[doc = " loop in a different thread instead. Here's how it works:"] -#[doc = ""] -#[doc = " 1/ The application must provide a function named \"android_main()\" that"] -#[doc = " will be called when the activity is created, in a new thread that is"] -#[doc = " distinct from the activity's main thread."] -#[doc = ""] -#[doc = " 2/ android_main() receives a pointer to a valid \"android_app\" structure"] -#[doc = " that contains references to other important objects, e.g. the"] -#[doc = " GameActivity obejct instance the application is running in."] -#[doc = ""] -#[doc = " 3/ the \"android_app\" object holds an ALooper instance that already"] -#[doc = " listens to activity lifecycle events (e.g. \"pause\", \"resume\")."] -#[doc = " See APP_CMD_XXX declarations below."] -#[doc = ""] -#[doc = " This corresponds to an ALooper identifier returned by"] -#[doc = " ALooper_pollOnce with value LOOPER_ID_MAIN."] -#[doc = ""] -#[doc = " Your application can use the same ALooper to listen to additional"] -#[doc = " file-descriptors. They can either be callback based, or with return"] -#[doc = " identifiers starting with LOOPER_ID_USER."] -#[doc = ""] -#[doc = " 4/ Whenever you receive a LOOPER_ID_MAIN event,"] -#[doc = " the returned data will point to an android_poll_source structure. You"] -#[doc = " can call the process() function on it, and fill in android_app->onAppCmd"] -#[doc = " to be called for your own processing of the event."] -#[doc = ""] -#[doc = " Alternatively, you can call the low-level functions to read and process"] -#[doc = " the data directly... look at the process_cmd() and process_input()"] -#[doc = " implementations in the glue to see how to do this."] -#[doc = ""] -#[doc = " See the sample named \"native-activity\" that comes with the NDK with a"] -#[doc = " full usage example. Also look at the documentation of GameActivity."] +#[doc = " The GameActivity interface provided by \n is based on a set of application-provided callbacks that will be called\n by the Activity's main thread when certain events occur.\n\n This means that each one of this callbacks _should_ _not_ block, or they\n risk having the system force-close the application. This programming\n model is direct, lightweight, but constraining.\n\n The 'android_native_app_glue' static library is used to provide a different\n execution model where the application can implement its own main event\n loop in a different thread instead. Here's how it works:\n\n 1/ The application must provide a function named \"android_main()\" that\n will be called when the activity is created, in a new thread that is\n distinct from the activity's main thread.\n\n 2/ android_main() receives a pointer to a valid \"android_app\" structure\n that contains references to other important objects, e.g. the\n GameActivity obejct instance the application is running in.\n\n 3/ the \"android_app\" object holds an ALooper instance that already\n listens to activity lifecycle events (e.g. \"pause\", \"resume\").\n See APP_CMD_XXX declarations below.\n\n This corresponds to an ALooper identifier returned by\n ALooper_pollOnce with value LOOPER_ID_MAIN.\n\n Your application can use the same ALooper to listen to additional\n file-descriptors. They can either be callback based, or with return\n identifiers starting with LOOPER_ID_USER.\n\n 4/ Whenever you receive a LOOPER_ID_MAIN event,\n the returned data will point to an android_poll_source structure. You\n can call the process() function on it, and fill in android_app->onAppCmd\n to be called for your own processing of the event.\n\n Alternatively, you can call the low-level functions to read and process\n the data directly... look at the process_cmd() and process_input()\n implementations in the glue to see how to do this.\n\n See the sample named \"native-activity\" that comes with the NDK with a\n full usage example. Also look at the documentation of GameActivity."] #[repr(C)] pub struct android_app { #[doc = " An optional pointer to application-defined state."] pub userData: *mut ::std::os::raw::c_void, - #[doc = " A required callback for processing main app commands (`APP_CMD_*`)."] - #[doc = " This is called each frame if there are app commands that need processing."] + #[doc = " A required callback for processing main app commands (`APP_CMD_*`).\n This is called each frame if there are app commands that need processing."] pub onAppCmd: ::std::option::Option, #[doc = " The GameActivity object instance that this app is running in."] pub activity: *mut GameActivity, #[doc = " The current configuration the app is running in."] pub config: *mut AConfiguration, - #[doc = " The last activity saved state, as provided at creation time."] - #[doc = " It is NULL if there was no state. You can use this as you need; the"] - #[doc = " memory will remain around until you call android_app_exec_cmd() for"] - #[doc = " APP_CMD_RESUME, at which point it will be freed and savedState set to"] - #[doc = " NULL. These variables should only be changed when processing a"] - #[doc = " APP_CMD_SAVE_STATE, at which point they will be initialized to NULL and"] - #[doc = " you can malloc your state and place the information here. In that case"] - #[doc = " the memory will be freed for you later."] + #[doc = " The last activity saved state, as provided at creation time.\n It is NULL if there was no state. You can use this as you need; the\n memory will remain around until you call android_app_exec_cmd() for\n APP_CMD_RESUME, at which point it will be freed and savedState set to\n NULL. These variables should only be changed when processing a\n APP_CMD_SAVE_STATE, at which point they will be initialized to NULL and\n you can malloc your state and place the information here. In that case\n the memory will be freed for you later."] pub savedState: *mut ::std::os::raw::c_void, #[doc = " The size of the activity saved state. It is 0 if `savedState` is NULL."] - pub savedStateSize: size_t, + pub savedStateSize: usize, #[doc = " The ALooper associated with the app's thread."] pub looper: *mut ALooper, #[doc = " When non-NULL, this is the window surface that the app can draw in."] pub window: *mut ANativeWindow, - #[doc = " Current content rectangle of the window; this is the area where the"] - #[doc = " window's content should be placed to be seen by the user."] + #[doc = " Current content rectangle of the window; this is the area where the\n window's content should be placed to be seen by the user."] pub contentRect: ARect, - #[doc = " Current state of the app's activity. May be either APP_CMD_START,"] - #[doc = " APP_CMD_RESUME, APP_CMD_PAUSE, or APP_CMD_STOP."] + #[doc = " Current state of the app's activity. May be either APP_CMD_START,\n APP_CMD_RESUME, APP_CMD_PAUSE, or APP_CMD_STOP."] pub activityState: ::std::os::raw::c_int, - #[doc = " This is non-zero when the application's GameActivity is being"] - #[doc = " destroyed and waiting for the app thread to complete."] + #[doc = " This is non-zero when the application's GameActivity is being\n destroyed and waiting for the app thread to complete."] pub destroyRequested: ::std::os::raw::c_int, - #[doc = " This is used for buffering input from GameActivity. Once ready, the"] - #[doc = " application thread switches the buffers and processes what was"] - #[doc = " accumulated."] + #[doc = " This is used for buffering input from GameActivity. Once ready, the\n application thread switches the buffers and processes what was\n accumulated."] pub inputBuffers: [android_input_buffer; 2usize], pub currentInputBuffer: ::std::os::raw::c_int, - #[doc = " 0 if no text input event is outstanding, 1 if it is."] - #[doc = " Use `GameActivity_getTextInputState` to get information"] - #[doc = " about the text entered by the user."] + #[doc = " 0 if no text input event is outstanding, 1 if it is.\n Use `GameActivity_getTextInputState` to get information\n about the text entered by the user."] pub textInputState: ::std::os::raw::c_int, #[doc = " @cond INTERNAL"] pub mutex: pthread_mutex_t, @@ -9665,9 +9539,11 @@ pub struct android_app { } #[test] fn bindgen_test_layout_android_app() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 81936usize, + 384usize, concat!("Size of: ", stringify!(android_app)) ); assert_eq!( @@ -9676,7 +9552,7 @@ fn bindgen_test_layout_android_app() { concat!("Alignment of ", stringify!(android_app)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).userData as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).userData) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -9686,7 +9562,7 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).onAppCmd as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).onAppCmd) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -9696,7 +9572,7 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).activity as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).activity) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -9706,7 +9582,7 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).config as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).config) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -9716,7 +9592,7 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).savedState as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).savedState) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -9726,7 +9602,7 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).savedStateSize as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).savedStateSize) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", @@ -9736,7 +9612,7 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).looper as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).looper) as usize - ptr as usize }, 48usize, concat!( "Offset of field: ", @@ -9746,7 +9622,7 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).window as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).window) as usize - ptr as usize }, 56usize, concat!( "Offset of field: ", @@ -9756,7 +9632,7 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).contentRect as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).contentRect) as usize - ptr as usize }, 64usize, concat!( "Offset of field: ", @@ -9766,7 +9642,7 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).activityState as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).activityState) as usize - ptr as usize }, 80usize, concat!( "Offset of field: ", @@ -9776,7 +9652,7 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).destroyRequested as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).destroyRequested) as usize - ptr as usize }, 84usize, concat!( "Offset of field: ", @@ -9786,7 +9662,7 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).inputBuffers as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).inputBuffers) as usize - ptr as usize }, 88usize, concat!( "Offset of field: ", @@ -9796,8 +9672,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).currentInputBuffer as *const _ as usize }, - 81736usize, + unsafe { ::std::ptr::addr_of!((*ptr).currentInputBuffer) as usize - ptr as usize }, + 184usize, concat!( "Offset of field: ", stringify!(android_app), @@ -9806,8 +9682,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).textInputState as *const _ as usize }, - 81740usize, + unsafe { ::std::ptr::addr_of!((*ptr).textInputState) as usize - ptr as usize }, + 188usize, concat!( "Offset of field: ", stringify!(android_app), @@ -9816,8 +9692,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).mutex as *const _ as usize }, - 81744usize, + unsafe { ::std::ptr::addr_of!((*ptr).mutex) as usize - ptr as usize }, + 192usize, concat!( "Offset of field: ", stringify!(android_app), @@ -9826,8 +9702,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).cond as *const _ as usize }, - 81784usize, + unsafe { ::std::ptr::addr_of!((*ptr).cond) as usize - ptr as usize }, + 232usize, concat!( "Offset of field: ", stringify!(android_app), @@ -9836,8 +9712,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).msgread as *const _ as usize }, - 81832usize, + unsafe { ::std::ptr::addr_of!((*ptr).msgread) as usize - ptr as usize }, + 280usize, concat!( "Offset of field: ", stringify!(android_app), @@ -9846,8 +9722,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).msgwrite as *const _ as usize }, - 81836usize, + unsafe { ::std::ptr::addr_of!((*ptr).msgwrite) as usize - ptr as usize }, + 284usize, concat!( "Offset of field: ", stringify!(android_app), @@ -9856,8 +9732,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).thread as *const _ as usize }, - 81840usize, + unsafe { ::std::ptr::addr_of!((*ptr).thread) as usize - ptr as usize }, + 288usize, concat!( "Offset of field: ", stringify!(android_app), @@ -9866,8 +9742,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).cmdPollSource as *const _ as usize }, - 81848usize, + unsafe { ::std::ptr::addr_of!((*ptr).cmdPollSource) as usize - ptr as usize }, + 296usize, concat!( "Offset of field: ", stringify!(android_app), @@ -9876,8 +9752,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).running as *const _ as usize }, - 81872usize, + unsafe { ::std::ptr::addr_of!((*ptr).running) as usize - ptr as usize }, + 320usize, concat!( "Offset of field: ", stringify!(android_app), @@ -9886,8 +9762,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).stateSaved as *const _ as usize }, - 81876usize, + unsafe { ::std::ptr::addr_of!((*ptr).stateSaved) as usize - ptr as usize }, + 324usize, concat!( "Offset of field: ", stringify!(android_app), @@ -9896,8 +9772,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).destroyed as *const _ as usize }, - 81880usize, + unsafe { ::std::ptr::addr_of!((*ptr).destroyed) as usize - ptr as usize }, + 328usize, concat!( "Offset of field: ", stringify!(android_app), @@ -9906,8 +9782,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).redrawNeeded as *const _ as usize }, - 81884usize, + unsafe { ::std::ptr::addr_of!((*ptr).redrawNeeded) as usize - ptr as usize }, + 332usize, concat!( "Offset of field: ", stringify!(android_app), @@ -9916,8 +9792,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pendingWindow as *const _ as usize }, - 81888usize, + unsafe { ::std::ptr::addr_of!((*ptr).pendingWindow) as usize - ptr as usize }, + 336usize, concat!( "Offset of field: ", stringify!(android_app), @@ -9926,8 +9802,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pendingContentRect as *const _ as usize }, - 81896usize, + unsafe { ::std::ptr::addr_of!((*ptr).pendingContentRect) as usize - ptr as usize }, + 344usize, concat!( "Offset of field: ", stringify!(android_app), @@ -9936,8 +9812,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).keyEventFilter as *const _ as usize }, - 81912usize, + unsafe { ::std::ptr::addr_of!((*ptr).keyEventFilter) as usize - ptr as usize }, + 360usize, concat!( "Offset of field: ", stringify!(android_app), @@ -9946,8 +9822,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).motionEventFilter as *const _ as usize }, - 81920usize, + unsafe { ::std::ptr::addr_of!((*ptr).motionEventFilter) as usize - ptr as usize }, + 368usize, concat!( "Offset of field: ", stringify!(android_app), @@ -9956,10 +9832,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).inputAvailableWakeUp as *const _ as usize - }, - 81928usize, + unsafe { ::std::ptr::addr_of!((*ptr).inputAvailableWakeUp) as usize - ptr as usize }, + 376usize, concat!( "Offset of field: ", stringify!(android_app), @@ -9968,8 +9842,8 @@ fn bindgen_test_layout_android_app() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).inputSwapPending as *const _ as usize }, - 81929usize, + unsafe { ::std::ptr::addr_of!((*ptr).inputSwapPending) as usize - ptr as usize }, + 377usize, concat!( "Offset of field: ", stringify!(android_app), @@ -9978,139 +9852,89 @@ fn bindgen_test_layout_android_app() { ) ); } -#[doc = " Looper data ID of commands coming from the app's main thread, which"] -#[doc = " is returned as an identifier from ALooper_pollOnce(). The data for this"] -#[doc = " identifier is a pointer to an android_poll_source structure."] -#[doc = " These can be retrieved and processed with android_app_read_cmd()"] -#[doc = " and android_app_exec_cmd()."] +#[doc = " Looper data ID of commands coming from the app's main thread, which\n is returned as an identifier from ALooper_pollOnce(). The data for this\n identifier is a pointer to an android_poll_source structure.\n These can be retrieved and processed with android_app_read_cmd()\n and android_app_exec_cmd()."] pub const NativeAppGlueLooperId_LOOPER_ID_MAIN: NativeAppGlueLooperId = 1; -#[doc = " Unused. Reserved for future use when usage of AInputQueue will be"] -#[doc = " supported."] +#[doc = " Unused. Reserved for future use when usage of AInputQueue will be\n supported."] pub const NativeAppGlueLooperId_LOOPER_ID_INPUT: NativeAppGlueLooperId = 2; #[doc = " Start of user-defined ALooper identifiers."] pub const NativeAppGlueLooperId_LOOPER_ID_USER: NativeAppGlueLooperId = 3; -#[doc = " Looper ID of commands coming from the app's main thread, an AInputQueue or"] -#[doc = " user-defined sources."] +#[doc = " Looper ID of commands coming from the app's main thread, an AInputQueue or\n user-defined sources."] pub type NativeAppGlueLooperId = ::std::os::raw::c_uint; -#[doc = " Unused. Reserved for future use when usage of AInputQueue will be"] -#[doc = " supported."] +#[doc = " Unused. Reserved for future use when usage of AInputQueue will be\n supported."] pub const NativeAppGlueAppCmd_UNUSED_APP_CMD_INPUT_CHANGED: NativeAppGlueAppCmd = 0; -#[doc = " Command from main thread: a new ANativeWindow is ready for use. Upon"] -#[doc = " receiving this command, android_app->window will contain the new window"] -#[doc = " surface."] +#[doc = " Command from main thread: a new ANativeWindow is ready for use. Upon\n receiving this command, android_app->window will contain the new window\n surface."] pub const NativeAppGlueAppCmd_APP_CMD_INIT_WINDOW: NativeAppGlueAppCmd = 1; -#[doc = " Command from main thread: the existing ANativeWindow needs to be"] -#[doc = " terminated. Upon receiving this command, android_app->window still"] -#[doc = " contains the existing window; after calling android_app_exec_cmd"] -#[doc = " it will be set to NULL."] +#[doc = " Command from main thread: the existing ANativeWindow needs to be\n terminated. Upon receiving this command, android_app->window still\n contains the existing window; after calling android_app_exec_cmd\n it will be set to NULL."] pub const NativeAppGlueAppCmd_APP_CMD_TERM_WINDOW: NativeAppGlueAppCmd = 2; -#[doc = " Command from main thread: the current ANativeWindow has been resized."] -#[doc = " Please redraw with its new size."] +#[doc = " Command from main thread: the current ANativeWindow has been resized.\n Please redraw with its new size."] pub const NativeAppGlueAppCmd_APP_CMD_WINDOW_RESIZED: NativeAppGlueAppCmd = 3; -#[doc = " Command from main thread: the system needs that the current ANativeWindow"] -#[doc = " be redrawn. You should redraw the window before handing this to"] -#[doc = " android_app_exec_cmd() in order to avoid transient drawing glitches."] +#[doc = " Command from main thread: the system needs that the current ANativeWindow\n be redrawn. You should redraw the window before handing this to\n android_app_exec_cmd() in order to avoid transient drawing glitches."] pub const NativeAppGlueAppCmd_APP_CMD_WINDOW_REDRAW_NEEDED: NativeAppGlueAppCmd = 4; -#[doc = " Command from main thread: the content area of the window has changed,"] -#[doc = " such as from the soft input window being shown or hidden. You can"] -#[doc = " find the new content rect in android_app::contentRect."] +#[doc = " Command from main thread: the content area of the window has changed,\n such as from the soft input window being shown or hidden. You can\n find the new content rect in android_app::contentRect."] pub const NativeAppGlueAppCmd_APP_CMD_CONTENT_RECT_CHANGED: NativeAppGlueAppCmd = 5; -#[doc = " Command from main thread: the app's activity window has gained"] -#[doc = " input focus."] +#[doc = " Command from main thread: the app's activity window has gained\n input focus."] pub const NativeAppGlueAppCmd_APP_CMD_GAINED_FOCUS: NativeAppGlueAppCmd = 6; -#[doc = " Command from main thread: the app's activity window has lost"] -#[doc = " input focus."] +#[doc = " Command from main thread: the app's activity window has lost\n input focus."] pub const NativeAppGlueAppCmd_APP_CMD_LOST_FOCUS: NativeAppGlueAppCmd = 7; #[doc = " Command from main thread: the current device configuration has changed."] pub const NativeAppGlueAppCmd_APP_CMD_CONFIG_CHANGED: NativeAppGlueAppCmd = 8; -#[doc = " Command from main thread: the system is running low on memory."] -#[doc = " Try to reduce your memory use."] +#[doc = " Command from main thread: the system is running low on memory.\n Try to reduce your memory use."] pub const NativeAppGlueAppCmd_APP_CMD_LOW_MEMORY: NativeAppGlueAppCmd = 9; #[doc = " Command from main thread: the app's activity has been started."] pub const NativeAppGlueAppCmd_APP_CMD_START: NativeAppGlueAppCmd = 10; #[doc = " Command from main thread: the app's activity has been resumed."] pub const NativeAppGlueAppCmd_APP_CMD_RESUME: NativeAppGlueAppCmd = 11; -#[doc = " Command from main thread: the app should generate a new saved state"] -#[doc = " for itself, to restore from later if needed. If you have saved state,"] -#[doc = " allocate it with malloc and place it in android_app.savedState with"] -#[doc = " the size in android_app.savedStateSize. The will be freed for you"] -#[doc = " later."] +#[doc = " Command from main thread: the app should generate a new saved state\n for itself, to restore from later if needed. If you have saved state,\n allocate it with malloc and place it in android_app.savedState with\n the size in android_app.savedStateSize. The will be freed for you\n later."] pub const NativeAppGlueAppCmd_APP_CMD_SAVE_STATE: NativeAppGlueAppCmd = 12; #[doc = " Command from main thread: the app's activity has been paused."] pub const NativeAppGlueAppCmd_APP_CMD_PAUSE: NativeAppGlueAppCmd = 13; #[doc = " Command from main thread: the app's activity has been stopped."] pub const NativeAppGlueAppCmd_APP_CMD_STOP: NativeAppGlueAppCmd = 14; -#[doc = " Command from main thread: the app's activity is being destroyed,"] -#[doc = " and waiting for the app thread to clean up and exit before proceeding."] +#[doc = " Command from main thread: the app's activity is being destroyed,\n and waiting for the app thread to clean up and exit before proceeding."] pub const NativeAppGlueAppCmd_APP_CMD_DESTROY: NativeAppGlueAppCmd = 15; #[doc = " Command from main thread: the app's insets have changed."] pub const NativeAppGlueAppCmd_APP_CMD_WINDOW_INSETS_CHANGED: NativeAppGlueAppCmd = 16; #[doc = " Commands passed from the application's main Java thread to the game's thread."] pub type NativeAppGlueAppCmd = ::std::os::raw::c_uint; extern "C" { - #[doc = " Call when ALooper_pollAll() returns LOOPER_ID_MAIN, reading the next"] - #[doc = " app command message."] + #[doc = " Call when ALooper_pollAll() returns LOOPER_ID_MAIN, reading the next\n app command message."] pub fn android_app_read_cmd(android_app: *mut android_app) -> i8; } extern "C" { - #[doc = " Call with the command returned by android_app_read_cmd() to do the"] - #[doc = " initial pre-processing of the given command. You can perform your own"] - #[doc = " actions for the command after calling this function."] + #[doc = " Call with the command returned by android_app_read_cmd() to do the\n initial pre-processing of the given command. You can perform your own\n actions for the command after calling this function."] pub fn android_app_pre_exec_cmd(android_app: *mut android_app, cmd: i8); } extern "C" { - #[doc = " Call with the command returned by android_app_read_cmd() to do the"] - #[doc = " final post-processing of the given command. You must have done your own"] - #[doc = " actions for the command before calling this function."] + #[doc = " Call with the command returned by android_app_read_cmd() to do the\n final post-processing of the given command. You must have done your own\n actions for the command before calling this function."] pub fn android_app_post_exec_cmd(android_app: *mut android_app, cmd: i8); } extern "C" { - #[doc = " Call this before processing input events to get the events buffer."] - #[doc = " The function returns NULL if there are no events to process."] + #[doc = " Call this before processing input events to get the events buffer.\n The function returns NULL if there are no events to process."] pub fn android_app_swap_input_buffers( android_app: *mut android_app, ) -> *mut android_input_buffer; } extern "C" { - #[doc = " Clear the array of motion events that were waiting to be handled, and release"] - #[doc = " each of them."] - #[doc = ""] - #[doc = " This method should be called after you have processed the motion events in"] - #[doc = " your game loop. You should handle events at each iteration of your game loop."] + #[doc = " Clear the array of motion events that were waiting to be handled, and release\n each of them.\n\n This method should be called after you have processed the motion events in\n your game loop. You should handle events at each iteration of your game loop."] pub fn android_app_clear_motion_events(inputBuffer: *mut android_input_buffer); } extern "C" { - #[doc = " Clear the array of key events that were waiting to be handled, and release"] - #[doc = " each of them."] - #[doc = ""] - #[doc = " This method should be called after you have processed the key up events in"] - #[doc = " your game loop. You should handle events at each iteration of your game loop."] + #[doc = " Clear the array of key events that were waiting to be handled, and release\n each of them.\n\n This method should be called after you have processed the key up events in\n your game loop. You should handle events at each iteration of your game loop."] pub fn android_app_clear_key_events(inputBuffer: *mut android_input_buffer); } extern "C" { - #[doc = " This is a springboard into the Rust glue layer that wraps calling the"] - #[doc = " main entry for the app itself."] + #[doc = " This is a springboard into the Rust glue layer that wraps calling the\n main entry for the app itself."] pub fn _rust_glue_entry(app: *mut android_app); } extern "C" { - #[doc = " Set the filter to use when processing key events."] - #[doc = " Any events for which the filter returns false will be ignored by"] - #[doc = " android_native_app_glue. If filter is set to NULL, no filtering is done."] - #[doc = ""] - #[doc = " The default key filter will filter out volume and camera button presses."] + #[doc = " Set the filter to use when processing key events.\n Any events for which the filter returns false will be ignored by\n android_native_app_glue. If filter is set to NULL, no filtering is done.\n\n The default key filter will filter out volume and camera button presses."] pub fn android_app_set_key_event_filter( app: *mut android_app, filter: android_key_event_filter, ); } extern "C" { - #[doc = " Set the filter to use when processing touch and motion events."] - #[doc = " Any events for which the filter returns false will be ignored by"] - #[doc = " android_native_app_glue. If filter is set to NULL, no filtering is done."] - #[doc = ""] - #[doc = " Note that the default motion event filter will only allow touchscreen events"] - #[doc = " through, in order to mimic NativeActivity's behaviour, so for controller"] - #[doc = " events to be passed to the app, set the filter to NULL."] + #[doc = " Set the filter to use when processing touch and motion events.\n Any events for which the filter returns false will be ignored by\n android_native_app_glue. If filter is set to NULL, no filtering is done.\n\n Note that the default motion event filter will only allow touchscreen events\n through, in order to mimic NativeActivity's behaviour, so for controller\n events to be passed to the app, set the filter to NULL."] pub fn android_app_set_motion_event_filter( app: *mut android_app, filter: android_motion_event_filter, @@ -10131,6 +9955,8 @@ pub struct __va_list_tag { } #[test] fn bindgen_test_layout___va_list_tag() { + const UNINIT: ::std::mem::MaybeUninit<__va_list_tag> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<__va_list_tag>(), 24usize, @@ -10142,7 +9968,7 @@ fn bindgen_test_layout___va_list_tag() { concat!("Alignment of ", stringify!(__va_list_tag)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__va_list_tag>())).gp_offset as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).gp_offset) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -10152,7 +9978,7 @@ fn bindgen_test_layout___va_list_tag() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__va_list_tag>())).fp_offset as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).fp_offset) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -10162,7 +9988,7 @@ fn bindgen_test_layout___va_list_tag() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__va_list_tag>())).overflow_arg_area as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).overflow_arg_area) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -10172,7 +9998,7 @@ fn bindgen_test_layout___va_list_tag() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__va_list_tag>())).reg_save_area as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).reg_save_area) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", From a604c0aa9f9523f5e35a09fafb14e9550a785f3d Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Sat, 22 Jul 2023 18:09:18 +0100 Subject: [PATCH 20/93] game-activity: Integrate GameActivity 2.0.2 --- android-activity/CHANGELOG.md | 7 ++-- android-activity/build.rs | 9 +++++- android-activity/src/game_activity/mod.rs | 39 ++++++++++++++++------- 3 files changed, 40 insertions(+), 15 deletions(-) diff --git a/android-activity/CHANGELOG.md b/android-activity/CHANGELOG.md index 4453871..35afefa 100644 --- a/android-activity/CHANGELOG.md +++ b/android-activity/CHANGELOG.md @@ -5,11 +5,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Changed +- GameActivity updated to 2.0.2 (requires the corresponding 2.0.2 `.aar` release from Google) ([#88](https://github.com/rust-mobile/android-activity/pull/88)) ## [0.4.3] - 2022-07-30 ### Fixed - Fixed a deadlock in the `native-activity` backend while waiting for the native thread after getting an `onDestroy` callback from Java ([#94](https://github.com/rust-mobile/android-activity/pull/94)) - - Fixed numerous deadlocks in the `game-activity` backend with how it would wait for the native thread in various Java callbacks, after the app has returned from `android_main` ([#98](https://github.com/rust-mobile/android-activity/pull/98)) ## [0.4.2] - 2022-06-17 @@ -26,7 +27,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Removed some overly-verbose logging in the `native-activity` backend ([#49](https://github.com/rust-mobile/android-activity/pull/49)) ### Removed -- Most of the examples were moved to https://github.com/rust-mobile/rust-android-examples ([#50](https://github.com/rust-mobile/android-activity/pull/50)) +- Most of the examples were moved to ([#50](https://github.com/rust-mobile/android-activity/pull/50)) ## [0.4] - 2022-11-10 ### Changed @@ -61,4 +62,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [0.1] - 2022-07-04 ### Added -- Initial release \ No newline at end of file +- Initial release diff --git a/android-activity/build.rs b/android-activity/build.rs index 305b6ba..7fc92e7 100644 --- a/android-activity/build.rs +++ b/android-activity/build.rs @@ -1,13 +1,20 @@ #![allow(dead_code)] fn build_glue_for_game_activity() { - for f in ["GameActivity.h", "GameActivity.cpp"] { + for f in [ + "GameActivity.h", + "GameActivity.cpp", + "GameActivityEvents.h", + "GameActivityEvents.cpp", + "GameActivityLog.h", + ] { println!("cargo:rerun-if-changed=game-activity-csrc/game-activity/{f}"); } cc::Build::new() .cpp(true) .include("game-activity-csrc") .file("game-activity-csrc/game-activity/GameActivity.cpp") + .file("game-activity-csrc/game-activity/GameActivityEvents.cpp") .extra_warnings(false) .cpp_link_stdlib("c++_static") .compile("libgame_activity.a"); diff --git a/android-activity/src/game_activity/mod.rs b/android-activity/src/game_activity/mod.rs index d43dc6e..95aef1d 100644 --- a/android-activity/src/game_activity/mod.rs +++ b/android-activity/src/game_activity/mod.rs @@ -467,7 +467,17 @@ impl<'a> MotionEventsLendingIterator<'a> { } fn next(&mut self) -> Option> { if self.pos < self.count { - let ga_event = unsafe { &(*self.buffer.ptr.as_ptr()).motionEvents[self.pos] }; + // Safety: + // - This iterator currently has exclusive access to the front buffer of events + // - We know the buffer is non-null + // - `pos` is less than the number of events stored in the buffer + let ga_event = unsafe { + (*self.buffer.ptr.as_ptr()) + .motionEvents + .offset(self.pos as isize) + .as_ref() + .unwrap() + }; let event = MotionEvent::new(ga_event); self.pos += 1; Some(event) @@ -496,7 +506,17 @@ impl<'a> KeyEventsLendingIterator<'a> { } fn next(&mut self) -> Option> { if self.pos < self.count { - let ga_event = unsafe { &(*self.buffer.ptr.as_ptr()).keyEvents[self.pos] }; + // Safety: + // - This iterator currently has exclusive access to the front buffer of events + // - We know the buffer is non-null + // - `pos` is less than the number of events stored in the buffer + let ga_event = unsafe { + (*self.buffer.ptr.as_ptr()) + .keyEvents + .offset(self.pos as isize) + .as_ref() + .unwrap() + }; let event = KeyEvent::new(ga_event); self.pos += 1; Some(event) @@ -543,16 +563,15 @@ impl<'a> Drop for InputBuffer<'a> { // // https://github.com/rust-lang/rfcs/issues/2771 extern "C" { - pub fn Java_com_google_androidgamesdk_GameActivity_loadNativeCode_C( + pub fn Java_com_google_androidgamesdk_GameActivity_initializeNativeCode_C( env: *mut JNIEnv, javaGameActivity: jobject, - path: jstring, - funcName: jstring, internalDataDir: jstring, obbDir: jstring, externalDataDir: jstring, jAssetMgr: jobject, savedState: jbyteArray, + javaConfig: jobject, ) -> jlong; pub fn GameActivity_onCreate_C( @@ -563,27 +582,25 @@ extern "C" { } #[no_mangle] -pub unsafe extern "C" fn Java_com_google_androidgamesdk_GameActivity_loadNativeCode( +pub unsafe extern "C" fn Java_com_google_androidgamesdk_GameActivity_initializeNativeCode( env: *mut JNIEnv, java_game_activity: jobject, - path: jstring, - func_name: jstring, internal_data_dir: jstring, obb_dir: jstring, external_data_dir: jstring, jasset_mgr: jobject, saved_state: jbyteArray, + java_config: jobject, ) -> jni_sys::jlong { - Java_com_google_androidgamesdk_GameActivity_loadNativeCode_C( + Java_com_google_androidgamesdk_GameActivity_initializeNativeCode_C( env, java_game_activity, - path, - func_name, internal_data_dir, obb_dir, external_data_dir, jasset_mgr, saved_state, + java_config, ) } From c22a5453df3575e4b990ed606abba6b531c1862c Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Sun, 23 Jul 2023 16:41:14 +0100 Subject: [PATCH 21/93] game-activity: Remove Deref implementations for Key/MotionEvent types --- android-activity/src/game_activity/input.rs | 94 +++++++++------------ 1 file changed, 39 insertions(+), 55 deletions(-) diff --git a/android-activity/src/game_activity/input.rs b/android-activity/src/game_activity/input.rs index 0f29a42..63f04e7 100644 --- a/android-activity/src/game_activity/input.rs +++ b/android-activity/src/game_activity/input.rs @@ -14,7 +14,7 @@ // by masking bits from the `Source`. use num_enum::{IntoPrimitive, TryFromPrimitive}; -use std::{convert::TryInto, ops::Deref}; +use std::convert::TryInto; use crate::game_activity::ffi::{GameActivityKeyEvent, GameActivityMotionEvent}; use crate::input::{Class, Source}; @@ -114,14 +114,6 @@ pub struct MotionEvent<'a> { ga_event: &'a GameActivityMotionEvent, } -impl<'a> Deref for MotionEvent<'a> { - type Target = GameActivityMotionEvent; - - fn deref(&self) -> &Self::Target { - self.ga_event - } -} - /// A motion action. /// /// See [the NDK @@ -295,7 +287,7 @@ impl<'a> MotionEvent<'a> { /// #[inline] pub fn source(&self) -> Source { - let source = self.source as u32; + let source = self.ga_event.source as u32; source.try_into().unwrap_or(Source::Unknown) } @@ -310,7 +302,7 @@ impl<'a> MotionEvent<'a> { /// #[inline] pub fn device_id(&self) -> i32 { - self.deviceId + self.ga_event.deviceId } /// Returns the motion action associated with the event. @@ -318,7 +310,7 @@ impl<'a> MotionEvent<'a> { /// See [the MotionEvent docs](https://developer.android.com/reference/android/view/MotionEvent#getActionMasked()) #[inline] pub fn action(&self) -> MotionAction { - let action = self.action as u32 & ndk_sys::AMOTION_EVENT_ACTION_MASK; + let action = self.ga_event.action as u32 & ndk_sys::AMOTION_EVENT_ACTION_MASK; action.try_into().unwrap() } @@ -327,12 +319,12 @@ impl<'a> MotionEvent<'a> { /// Pointer indices can change per motion event. For an identifier that stays the same, see /// [`Pointer::pointer_id()`]. /// - /// This only has a meaning when the [action](Self::action) is one of [`Up`](MotionAction::Up), + /// This only has a meaning when the [action](self::action) is one of [`Up`](MotionAction::Up), /// [`Down`](MotionAction::Down), [`PointerUp`](MotionAction::PointerUp), /// or [`PointerDown`](MotionAction::PointerDown). #[inline] pub fn pointer_index(&self) -> usize { - let action = self.action as u32; + let action = self.ga_event.action as u32; let index = (action & ndk_sys::AMOTION_EVENT_ACTION_POINTER_INDEX_MASK) >> ndk_sys::AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT; index as usize @@ -345,8 +337,8 @@ impl<'a> MotionEvent<'a> { /// docs](https://developer.android.com/ndk/reference/group/input#amotionevent_getpointerid) // TODO: look at output with out-of-range pointer index // Probably -1 though - pub fn pointer_id_for(&self, pointer_index: usize) -> i32 { - unsafe { ndk_sys::AMotionEvent_getPointerId(self.ptr.as_ptr(), pointer_index) } + pub fn pointer_id_for(&self.ga_event, pointer_index: usize) -> i32 { + unsafe { ndk_sys::AMotionEvent_getPointerId(self.ga_event.ptr.as_ptr(), pointer_index) } } */ @@ -355,7 +347,7 @@ impl<'a> MotionEvent<'a> { /// See [the MotionEvent docs](https://developer.android.com/reference/android/view/MotionEvent#getPointerCount()) #[inline] pub fn pointer_count(&self) -> usize { - self.pointerCount as usize + self.ga_event.pointerCount as usize } /// An iterator over the pointers in this motion event @@ -370,7 +362,7 @@ impl<'a> MotionEvent<'a> { /// The pointer at a given pointer index. Panics if the pointer index is out of bounds. /// - /// If you need to loop over all the pointers, prefer the [`pointers()`](Self::pointers) method. + /// If you need to loop over all the pointers, prefer the [`pointers()`](self::pointers) method. #[inline] pub fn pointer_at_index(&self, index: usize) -> Pointer<'_> { if index >= self.pointer_count() { @@ -386,14 +378,14 @@ impl<'a> MotionEvent<'a> { /// docs](https://developer.android.com/ndk/reference/group/input#amotionevent_gethistorysize) #[inline] pub fn history_size(&self) -> usize { - unsafe { ndk_sys::AMotionEvent_getHistorySize(self.ptr.as_ptr()) as usize } + unsafe { ndk_sys::AMotionEvent_getHistorySize(self.ga_event.ptr.as_ptr()) as usize } } /// An iterator over the historical events contained in this event. #[inline] pub fn history(&self) -> HistoricalMotionEventsIter<'_> { HistoricalMotionEventsIter { - event: self.ptr, + event: self.ga_event.ptr, next_history_index: 0, history_size: self.history_size(), _marker: std::marker::PhantomData, @@ -407,7 +399,7 @@ impl<'a> MotionEvent<'a> { /// docs](https://developer.android.com/ndk/reference/group/input#amotionevent_getmetastate) #[inline] pub fn meta_state(&self) -> MetaState { - MetaState(self.metaState as u32) + MetaState(self.ga_event.metaState as u32) } /// Returns the button state during this event, as a bitfield. @@ -416,7 +408,7 @@ impl<'a> MotionEvent<'a> { /// docs](https://developer.android.com/ndk/reference/group/input#amotionevent_getbuttonstate) #[inline] pub fn button_state(&self) -> ButtonState { - ButtonState(self.buttonState as u32) + ButtonState(self.ga_event.buttonState as u32) } /// Returns the time of the start of this gesture, in the `java.lang.System.nanoTime()` time @@ -426,7 +418,7 @@ impl<'a> MotionEvent<'a> { /// docs](https://developer.android.com/ndk/reference/group/input#amotionevent_getdowntime) #[inline] pub fn down_time(&self) -> i64 { - self.downTime + self.ga_event.downTime } /// Returns a bitfield indicating which edges were touched by this event. @@ -435,7 +427,7 @@ impl<'a> MotionEvent<'a> { /// docs](https://developer.android.com/ndk/reference/group/input#amotionevent_getedgeflags) #[inline] pub fn edge_flags(&self) -> EdgeFlags { - EdgeFlags(self.edgeFlags as u32) + EdgeFlags(self.ga_event.edgeFlags as u32) } /// Returns the time of this event, in the `java.lang.System.nanoTime()` time base @@ -444,7 +436,7 @@ impl<'a> MotionEvent<'a> { /// docs](https://developer.android.com/ndk/reference/group/input#amotionevent_geteventtime) #[inline] pub fn event_time(&self) -> i64 { - self.eventTime + self.ga_event.eventTime } /// The flags associated with a motion event. @@ -453,7 +445,7 @@ impl<'a> MotionEvent<'a> { /// docs](https://developer.android.com/ndk/reference/group/input#amotionevent_getflags) #[inline] pub fn flags(&self) -> MotionEventFlags { - MotionEventFlags(self.flags as u32) + MotionEventFlags(self.ga_event.flags as u32) } /* Missing from GameActivity currently... @@ -462,8 +454,8 @@ impl<'a> MotionEvent<'a> { /// See [the NDK /// docs](https://developer.android.com/ndk/reference/group/input#amotionevent_getxoffset) #[inline] - pub fn x_offset(&self) -> f32 { - self.x_offset + pub fn x_offset(&self.ga_event) -> f32 { + self.ga_event.x_offset } /// Returns the offset in the y direction between the coordinates and the raw coordinates @@ -471,8 +463,8 @@ impl<'a> MotionEvent<'a> { /// See [the NDK /// docs](https://developer.android.com/ndk/reference/group/input#amotionevent_getyoffset) #[inline] - pub fn y_offset(&self) -> f32 { - self.y_offset + pub fn y_offset(&self.ga_event) -> f32 { + self.ga_event.y_offset } */ @@ -482,7 +474,7 @@ impl<'a> MotionEvent<'a> { /// docs](https://developer.android.com/ndk/reference/group/input#amotionevent_getxprecision) #[inline] pub fn x_precision(&self) -> f32 { - self.precisionX + self.ga_event.precisionX } /// Returns the precision of the y value of the coordinates @@ -491,7 +483,7 @@ impl<'a> MotionEvent<'a> { /// docs](https://developer.android.com/ndk/reference/group/input#amotionevent_getyprecision) #[inline] pub fn y_precision(&self) -> f32 { - self.precisionY + self.ga_event.precisionY } } @@ -510,13 +502,13 @@ impl<'a> Pointer<'a> { #[inline] pub fn pointer_id(&self) -> i32 { - let pointer = &self.event.pointers[self.index]; + let pointer = &self.event.ga_event.pointers[self.index]; pointer.id } #[inline] pub fn axis_value(&self, axis: Axis) -> f32 { - let pointer = &self.event.pointers[self.index]; + let pointer = &self.event.ga_event.pointers[self.index]; pointer.axisValues[axis as u32 as usize] } @@ -532,13 +524,13 @@ impl<'a> Pointer<'a> { #[inline] pub fn raw_x(&self) -> f32 { - let pointer = &self.event.pointers[self.index]; + let pointer = &self.event.ga_event.pointers[self.index]; pointer.rawX } #[inline] pub fn raw_y(&self) -> f32 { - let pointer = &self.event.pointers[self.index]; + let pointer = &self.event.ga_event.pointers[self.index]; pointer.rawY } @@ -579,7 +571,7 @@ impl<'a> Pointer<'a> { #[inline] pub fn tool_type(&self) -> ToolType { - let pointer = &self.event.pointers[self.index]; + let pointer = &self.event.ga_event.pointers[self.index]; let tool_type = pointer.toolType as u32; tool_type.try_into().unwrap() } @@ -937,14 +929,6 @@ pub struct KeyEvent<'a> { ga_event: &'a GameActivityKeyEvent, } -impl<'a> Deref for KeyEvent<'a> { - type Target = GameActivityKeyEvent; - - fn deref(&self) -> &Self::Target { - self.ga_event - } -} - /// Key actions. /// /// See [the NDK docs](https://developer.android.com/ndk/reference/group/input#anonymous-enum-27) @@ -1262,7 +1246,7 @@ impl<'a> KeyEvent<'a> { /// #[inline] pub fn source(&self) -> Source { - let source = self.source as u32; + let source = self.ga_event.source as u32; source.try_into().unwrap_or(Source::Unknown) } @@ -1277,7 +1261,7 @@ impl<'a> KeyEvent<'a> { /// #[inline] pub fn device_id(&self) -> i32 { - self.deviceId + self.ga_event.deviceId } /// Returns the key action associated with the event. @@ -1285,7 +1269,7 @@ impl<'a> KeyEvent<'a> { /// See [the KeyEvent docs](https://developer.android.com/reference/android/view/KeyEvent#getAction()) #[inline] pub fn action(&self) -> KeyAction { - let action = self.action as u32; + let action = self.ga_event.action as u32; action.try_into().unwrap() } @@ -1296,7 +1280,7 @@ impl<'a> KeyEvent<'a> { /// docs](https://developer.android.com/ndk/reference/group/input#akeyevent_getdowntime) #[inline] pub fn down_time(&self) -> i64 { - self.downTime + self.ga_event.downTime } /// Returns the time this event occured. This is on the scale of @@ -1306,7 +1290,7 @@ impl<'a> KeyEvent<'a> { /// docs](https://developer.android.com/ndk/reference/group/input#akeyevent_geteventtime) #[inline] pub fn event_time(&self) -> i64 { - self.eventTime + self.ga_event.eventTime } /// Returns the keycode associated with this key event @@ -1315,7 +1299,7 @@ impl<'a> KeyEvent<'a> { /// docs](https://developer.android.com/ndk/reference/group/input#akeyevent_getkeycode) #[inline] pub fn key_code(&self) -> Keycode { - let keycode = self.keyCode as u32; + let keycode = self.ga_event.keyCode as u32; keycode.try_into().unwrap_or(Keycode::Unknown) } @@ -1325,7 +1309,7 @@ impl<'a> KeyEvent<'a> { /// docs](https://developer.android.com/ndk/reference/group/input#akeyevent_getrepeatcount) #[inline] pub fn repeat_count(&self) -> i32 { - self.repeatCount + self.ga_event.repeatCount } /// Returns the hardware keycode of a key. This varies from device to device. @@ -1334,7 +1318,7 @@ impl<'a> KeyEvent<'a> { /// docs](https://developer.android.com/ndk/reference/group/input#akeyevent_getscancode) #[inline] pub fn scan_code(&self) -> i32 { - self.scanCode + self.ga_event.scanCode } } @@ -1397,7 +1381,7 @@ impl<'a> KeyEvent<'a> { /// See [the NDK docs](https://developer.android.com/ndk/reference/group/input#akeyevent_getflags) #[inline] pub fn flags(&self) -> KeyEventFlags { - KeyEventFlags(self.flags as u32) + KeyEventFlags(self.ga_event.flags as u32) } /// Returns the state of the modifiers during this key event, represented by a bitmask. @@ -1406,6 +1390,6 @@ impl<'a> KeyEvent<'a> { /// docs](https://developer.android.com/ndk/reference/group/input#akeyevent_getmetastate) #[inline] pub fn meta_state(&self) -> MetaState { - MetaState(self.metaState as u32) + MetaState(self.ga_event.metaState as u32) } } From 41f30c39ad09f90b7d721626ffbb86bfdc931b81 Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Mon, 12 Sep 2022 17:14:49 +0100 Subject: [PATCH 22/93] Expose TextEvent and input method state This also adds `InputEvent::TextEvent` for notifying applications of IME state changes as well as explicit getter/setter APIs for tracking IME selection + compose region state. (only supported with GameActivity) Fixes: #18 --- android-activity/Cargo.toml | 1 + .../native_app_glue/android_native_app_glue.c | 1 + android-activity/src/game_activity/input.rs | 1 + android-activity/src/game_activity/mod.rs | 140 +++++++++++++++++- android-activity/src/input.rs | 38 +++++ android-activity/src/lib.rs | 10 ++ android-activity/src/native_activity/input.rs | 1 + android-activity/src/native_activity/mod.rs | 16 ++ 8 files changed, 207 insertions(+), 1 deletion(-) diff --git a/android-activity/Cargo.toml b/android-activity/Cargo.toml index d60bca4..25c3449 100644 --- a/android-activity/Cargo.toml +++ b/android-activity/Cargo.toml @@ -25,6 +25,7 @@ native-activity = [] [dependencies] log = "0.4" jni-sys = "0.3" +cesu8 = "1" ndk = "0.7" ndk-sys = "0.4" ndk-context = "0.1" diff --git a/android-activity/game-activity-csrc/game-activity/native_app_glue/android_native_app_glue.c b/android-activity/game-activity-csrc/game-activity/native_app_glue/android_native_app_glue.c index b78a44f..a7bcb85 100644 --- a/android-activity/game-activity-csrc/game-activity/native_app_glue/android_native_app_glue.c +++ b/android-activity/game-activity-csrc/game-activity/native_app_glue/android_native_app_glue.c @@ -674,6 +674,7 @@ static void onTextInputEvent(GameActivity* activity, pthread_mutex_lock(&android_app->mutex); if (!android_app->destroyed) { android_app->textInputState = 1; + notifyInput(android_app); } pthread_mutex_unlock(&android_app->mutex); } diff --git a/android-activity/src/game_activity/input.rs b/android-activity/src/game_activity/input.rs index 63f04e7..ba442b7 100644 --- a/android-activity/src/game_activity/input.rs +++ b/android-activity/src/game_activity/input.rs @@ -26,6 +26,7 @@ use crate::input::{Class, Source}; pub enum InputEvent<'a> { MotionEvent(MotionEvent<'a>), KeyEvent(KeyEvent<'a>), + TextEvent(crate::input::TextInputState), } /// A bitfield representing the state of modifier keys during an event. diff --git a/android-activity/src/game_activity/mod.rs b/android-activity/src/game_activity/mod.rs index 95aef1d..fd9da25 100644 --- a/android-activity/src/game_activity/mod.rs +++ b/android-activity/src/game_activity/mod.rs @@ -32,6 +32,7 @@ use crate::{ mod ffi; pub mod input; +use crate::input::{TextInputState, TextSpan}; use input::{Axis, InputEvent, KeyEvent, MotionEvent}; // The only time it's safe to update the android_app->savedState pointer is @@ -360,6 +361,121 @@ impl AndroidAppInner { } } + unsafe extern "C" fn map_input_state_to_text_event_callback( + context: *mut c_void, + state: *const ffi::GameTextInputState, + ) { + // Java uses a modified UTF-8 format, which is a modified cesu8 format + let out_ptr: *mut TextInputState = context.cast(); + let text_modified_utf8: *const u8 = (*state).text_UTF8.cast(); + let text_modified_utf8 = + std::slice::from_raw_parts(text_modified_utf8, (*state).text_length as usize); + match cesu8::from_java_cesu8(&text_modified_utf8) { + Ok(str) => { + let len = *&str.len(); + (*out_ptr).text = String::from(str); + + let selection_start = (*state).selection.start.clamp(0, len as i32 + 1); + let selection_end = (*state).selection.end.clamp(0, len as i32 + 1); + (*out_ptr).selection = TextSpan { + start: selection_start as usize, + end: selection_end as usize, + }; + if (*state).composingRegion.start < 0 || (*state).composingRegion.end < 0 { + (*out_ptr).compose_region = None; + } else { + (*out_ptr).compose_region = Some(TextSpan { + start: (*state).composingRegion.start as usize, + end: (*state).composingRegion.end as usize, + }); + } + } + Err(err) => { + log::error!("Invalid UTF8 text in TextEvent: {}", err); + } + } + } + + // TODO: move into a trait + pub fn text_input_state(&self) -> TextInputState { + unsafe { + let activity = (*self.native_app.as_ptr()).activity; + let mut out_state = TextInputState { + text: String::new(), + selection: TextSpan { start: 0, end: 0 }, + compose_region: None, + }; + let out_ptr = &mut out_state as *mut TextInputState; + + // NEON WARNING: + // + // It's not clearly documented but the GameActivity API over the + // GameTextInput library directly exposes _modified_ UTF8 text + // from Java so we need to be careful to convert text to and + // from UTF8 + // + // GameTextInput also uses a pre-allocated, fixed-sized buffer for the current + // text state but GameTextInput doesn't actually provide it's own thread + // safe API to safely access this state so we have to cooperate with + // the GameActivity code that does locking when reading/writing the state + // (I.e. we can't just punch through to the GameTextInput layer from here). + // + // Overall this is all quite gnarly - and probably a good reminder of why + // we want to use Rust instead of C/C++. + ffi::GameActivity_getTextInputState( + activity, + Some(AndroidAppInner::map_input_state_to_text_event_callback), + out_ptr.cast(), + ); + + out_state + } + } + + // TODO: move into a trait + pub fn set_text_input_state(&self, state: TextInputState) { + unsafe { + let activity = (*self.native_app.as_ptr()).activity; + let modified_utf8 = cesu8::to_java_cesu8(&state.text); + let text_length = modified_utf8.len() as i32; + let modified_utf8_bytes = modified_utf8.as_ptr(); + let ffi_state = ffi::GameTextInputState { + text_UTF8: modified_utf8_bytes.cast(), // NB: may be signed or unsigned depending on target + text_length, + selection: ffi::GameTextInputSpan { + start: state.selection.start as i32, + end: state.selection.end as i32, + }, + composingRegion: match state.compose_region { + Some(span) => { + // The GameText subclass of InputConnection only has a special case for removing the + // compose region if `start == -1` but the docs for `setComposingRegion` imply that + // the region should effectively be removed if any empty region is given (unlike for the + // selection region, it's not meaningful to maintain an empty compose region) + // + // We aim for more consistent behaviour by normalizing any empty region into `(-1, -1)` + // to remove the compose region. + // + // NB `setComposingRegion` itself is documented to clamp start/end to the text bounds + // so apart from this special-case handling in GameText's implementation of + // `setComposingRegion` then there's nothing special about `(-1, -1)` - it's just an empty + // region that should get clamped to `(0, 0)` and then get removed. + if span.start == span.end { + ffi::GameTextInputSpan { start: -1, end: -1 } + } else { + ffi::GameTextInputSpan { + start: span.start as i32, + end: span.end as i32, + } + } + } + None => ffi::GameTextInputSpan { start: -1, end: -1 }, + }, + }; + ffi::GameActivity_setTextInputState(activity, &ffi_state as *const _); + } + } + pub fn enable_motion_axis(&mut self, axis: Axis) { unsafe { ffi::GameActivityPointerAxes_enableAxis(axis as i32) } } @@ -403,7 +519,7 @@ impl AndroidAppInner { } } - pub fn input_events(&self, mut callback: F) + fn dispatch_key_and_motion_events(&self, mut callback: F) where F: FnMut(&InputEvent) -> InputStatus, { @@ -426,6 +542,28 @@ impl AndroidAppInner { } } + fn dispatch_text_events(&self, mut callback: F) + where + F: FnMut(&InputEvent) -> InputStatus, + { + unsafe { + let app_ptr = self.native_app.as_ptr(); + if (*app_ptr).textInputState != 0 { + let state = self.text_input_state(); + callback(&InputEvent::TextEvent(state)); + (*app_ptr).textInputState = 0; + } + } + } + + pub fn input_events(&self, mut callback: F) + where + F: FnMut(&InputEvent) -> InputStatus, + { + self.dispatch_key_and_motion_events(&mut callback); + self.dispatch_text_events(&mut callback); + } + pub fn internal_data_path(&self) -> Option { unsafe { let app_ptr = self.native_app.as_ptr(); diff --git a/android-activity/src/input.rs b/android-activity/src/input.rs index f28d1a9..372965e 100644 --- a/android-activity/src/input.rs +++ b/android-activity/src/input.rs @@ -81,3 +81,41 @@ impl From for Class { source.into() } } + +/// This struct holds a span within a region of text from `start` to `end`. +/// +/// The `start` index may be greater than the `end` index (swapping `start` and `end` will represent the same span) +/// +/// The lower index is inclusive and the higher index is exclusive. +/// +/// An empty span or cursor position is specified with `start == end`. +/// +#[derive(Debug, Clone, Copy)] +pub struct TextSpan { + /// The start of the span (inclusive) + pub start: usize, + + /// The end of the span (exclusive) + pub end: usize, +} + +#[derive(Debug, Clone)] +pub struct TextInputState { + pub text: String, + + /// A selection defined on the text. + /// + /// To set the cursor position, start and end should have the same value. + /// + /// Changing the selection has no effect on the compose_region. + pub selection: TextSpan, + + /// A composing region defined on the text. + /// + /// When being set, then if there was a composing region, the region is replaced. + /// + /// The given indices will be clamped to the `text` bounds + /// + /// If the resulting region is zero-sized, no region is marked (equivalent to passing `None`) + pub compose_region: Option, +} diff --git a/android-activity/src/lib.rs b/android-activity/src/lib.rs index 6ae6b0c..0650e04 100644 --- a/android-activity/src/lib.rs +++ b/android-activity/src/lib.rs @@ -618,6 +618,16 @@ impl AndroidApp { .hide_soft_input(hide_implicit_only); } + /// Fetch the current input text state, as updated by any active IME. + pub fn text_input_state(&self) -> input::TextInputState { + self.inner.read().unwrap().text_input_state() + } + + /// Forward the given input text `state` to any active IME. + pub fn set_text_input_state(&self, state: input::TextInputState) { + self.inner.read().unwrap().set_text_input_state(state); + } + /// Query and process all out-standing input event /// /// `callback` should return [`InputStatus::Unhandled`] for any input events that aren't directly diff --git a/android-activity/src/native_activity/input.rs b/android-activity/src/native_activity/input.rs index 17e8f4b..08db48f 100644 --- a/android-activity/src/native_activity/input.rs +++ b/android-activity/src/native_activity/input.rs @@ -337,4 +337,5 @@ impl<'a> KeyEvent<'a> { pub enum InputEvent<'a> { MotionEvent(self::MotionEvent<'a>), KeyEvent(self::KeyEvent<'a>), + TextEvent(crate::input::TextInputState), } diff --git a/android-activity/src/native_activity/mod.rs b/android-activity/src/native_activity/mod.rs index e0bb330..3f16550 100644 --- a/android-activity/src/native_activity/mod.rs +++ b/android-activity/src/native_activity/mod.rs @@ -9,6 +9,7 @@ use libc::c_void; use log::{error, trace}; use ndk::{asset::AssetManager, native_window::NativeWindow}; +use crate::input::{TextInputState, TextSpan}; use crate::{ util, AndroidApp, ConfigurationRef, InputStatus, MainEvent, PollEvent, Rect, WindowManagerFlags, }; @@ -341,6 +342,20 @@ impl AndroidAppInner { } } + // TODO: move into a trait + pub fn text_input_state(&self) -> TextInputState { + TextInputState { + text: String::new(), + selection: TextSpan { start: 0, end: 0 }, + compose_region: None, + } + } + + // TODO: move into a trait + pub fn set_text_input_state(&self, _state: TextInputState) { + // NOP: Unsupported + } + pub fn enable_motion_axis(&self, _axis: input::Axis) { // NOP - The InputQueue API doesn't let us optimize which axis values are read } @@ -390,6 +405,7 @@ impl AndroidAppInner { input::InputEvent::KeyEvent(e) => { ndk::event::InputEvent::KeyEvent(e.into_ndk_event()) } + _ => unreachable!(), }; queue.finish_event(ndk_event, matches!(handled, InputStatus::Handled)); } From 74f510a99ac37d803ebe7a1682d042c23a3d075a Mon Sep 17 00:00:00 2001 From: dAxpeDDa Date: Sun, 28 May 2023 20:09:20 +0200 Subject: [PATCH 23/93] Bump `bitflags` to v2 --- android-activity/Cargo.toml | 2 +- android-activity/src/input.rs | 1 + android-activity/src/lib.rs | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/android-activity/Cargo.toml b/android-activity/Cargo.toml index 25c3449..9b70e95 100644 --- a/android-activity/Cargo.toml +++ b/android-activity/Cargo.toml @@ -31,7 +31,7 @@ ndk-sys = "0.4" ndk-context = "0.1" android-properties = "0.2" num_enum = "0.6" -bitflags = "1.3" +bitflags = "2.0" libc = "0.2" [build-dependencies] diff --git a/android-activity/src/input.rs b/android-activity/src/input.rs index 372965e..b9edf7e 100644 --- a/android-activity/src/input.rs +++ b/android-activity/src/input.rs @@ -36,6 +36,7 @@ pub enum Source { } bitflags! { + #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] struct SourceFlags: u32 { const CLASS_MASK = 0x000000ff; diff --git a/android-activity/src/lib.rs b/android-activity/src/lib.rs index 0650e04..e00a902 100644 --- a/android-activity/src/lib.rs +++ b/android-activity/src/lib.rs @@ -275,6 +275,7 @@ pub use activity_impl::AndroidAppWaker; bitflags! { /// Flags for [`AndroidApp::set_window_flags`] /// as per the [android.view.WindowManager.LayoutParams Java API](https://developer.android.com/reference/android/view/WindowManager.LayoutParams) + #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] pub struct WindowManagerFlags: u32 { /// As long as this window is visible to the user, allow the lock /// screen to activate while the screen is on. This can be used From 66cfc68dac2a28e584c02f0ee4278fa7376aafee Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Thu, 3 Aug 2023 17:01:27 +0100 Subject: [PATCH 24/93] Bump MSRV to 1.68 - Lets us build with cargo ndk 3+ - Lets us remove suppression for false-negative clippy warning about unsafe blocks in unsafe functions - Should unblock CI for #102 - 1.68.0 notably also builds the standard library with a newer r25 NDK toolchain which avoid the need for awkward libgcc workarounds, so it's anyway a desirable baseline for Android projects. --- .github/workflows/ci.yml | 6 ++---- android-activity/Cargo.toml | 2 +- android-activity/src/game_activity/mod.rs | 1 - android-activity/src/native_activity/glue.rs | 1 - 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c4d7c13..d465dba 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ jobs: fail-fast: false matrix: # See top README for MSRV policy - rust_version: [1.64.0, stable] + rust_version: [1.68.0, stable] steps: - uses: actions/checkout@v3 @@ -34,9 +34,7 @@ jobs: i686-linux-android - name: Install cargo-ndk - # We're currently sticking with cargo-ndk 2, until we bump our - # MSRV to 1.68+ - run: cargo install cargo-ndk --version "^2" + run: cargo install cargo-ndk - name: Setup Java uses: actions/setup-java@v3 diff --git a/android-activity/Cargo.toml b/android-activity/Cargo.toml index 9b70e95..2927952 100644 --- a/android-activity/Cargo.toml +++ b/android-activity/Cargo.toml @@ -9,7 +9,7 @@ repository = "https://github.com/rust-mobile/android-activity" documentation = "https://docs.rs/android-activity" description = "Glue for building Rust applications on Android with NativeActivity or GameActivity" license = "MIT OR Apache-2.0" -rust-version = "1.64" +rust-version = "1.68.0" [features] # Note: we don't enable any backend by default since features diff --git a/android-activity/src/game_activity/mod.rs b/android-activity/src/game_activity/mod.rs index fd9da25..623a6a6 100644 --- a/android-activity/src/game_activity/mod.rs +++ b/android-activity/src/game_activity/mod.rs @@ -759,7 +759,6 @@ extern "Rust" { // `app_main` function. This is run on a dedicated thread spawned // by android_native_app_glue. #[no_mangle] -#[allow(unused_unsafe)] // Otherwise rust 1.64 moans about using unsafe{} in unsafe functions pub unsafe extern "C" fn _rust_glue_entry(native_app: *mut ffi::android_app) { abort_on_panic(|| { // Maybe make this stdout/stderr redirection an optional / opt-in feature?... diff --git a/android-activity/src/native_activity/glue.rs b/android-activity/src/native_activity/glue.rs index 6682857..58a0a27 100644 --- a/android-activity/src/native_activity/glue.rs +++ b/android-activity/src/native_activity/glue.rs @@ -828,7 +828,6 @@ unsafe extern "C" fn on_content_rect_changed( /// This is the native entrypoint for our cdylib library that `ANativeActivity` will look for via `dlsym` #[no_mangle] -#[allow(unused_unsafe)] // Otherwise rust 1.64 moans about using unsafe{} in unsafe functions extern "C" fn ANativeActivity_onCreate( activity: *mut ndk_sys::ANativeActivity, saved_state: *const libc::c_void, From 1abb02c82087eaed4e2e0ab7a5dc8fd3969916fc Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Fri, 4 Aug 2023 15:37:05 +0100 Subject: [PATCH 25/93] Revert 'Bump MSRV to 1.68' This effectively reverts 66cfc68dac2a28e584c02f0ee4278fa7376aafee and adds some comments explaining that we're currently blocked by Winit's MSRV policy + CI from being able to increase our rust-version. This is a frustrating conflict that I hope can be addressed by updating Winit's CI system to allow different platforms to require more recent versions of Rust (which notably isn't in conflict with setting a conservative rust-version in Winit for supporting Debian on Linux) This re-instates building android-activity with cargo-ndk 2 because building on Android with 1.64 requires a linker workaround that's not implemented in newer version of cargo-ndk. This also reinstates the clippy false-negative warning suppression for unsafe blocks. Again it's frustrating that we can't have good things because of how Winit wants to support Debian which shouldn't be relevant for Android development. Here is an upstream issue to discuss a potential solution for this: https://github.com/rust-windowing/winit/issues/3000 --- .github/workflows/ci.yml | 10 +++++++--- android-activity/Cargo.toml | 14 +++++++++++++- android-activity/src/game_activity/mod.rs | 1 + android-activity/src/native_activity/glue.rs | 1 + 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d465dba..dc71ede 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,8 +16,9 @@ jobs: strategy: fail-fast: false matrix: - # See top README for MSRV policy - rust_version: [1.68.0, stable] + # XXX: We are currently constrained by Winit's MSRV policy + CI system + # See Cargo.toml for details + rust_version: [1.64.0, stable] steps: - uses: actions/checkout@v3 @@ -34,7 +35,10 @@ jobs: i686-linux-android - name: Install cargo-ndk - run: cargo install cargo-ndk + # XXX: We have to use an old version of cargo-ndk that supports the + # libgcc linker workaround for rust < 1.68 because Winit's CI system + # currently requires this crate to be buildable with 1.64 + run: cargo install cargo-ndk --version "^2" - name: Setup Java uses: actions/setup-java@v3 diff --git a/android-activity/Cargo.toml b/android-activity/Cargo.toml index 2927952..5a01bd6 100644 --- a/android-activity/Cargo.toml +++ b/android-activity/Cargo.toml @@ -9,7 +9,19 @@ repository = "https://github.com/rust-mobile/android-activity" documentation = "https://docs.rs/android-activity" description = "Glue for building Rust applications on Android with NativeActivity or GameActivity" license = "MIT OR Apache-2.0" -rust-version = "1.68.0" + +# XXX: Even though we have our own MSRV policy that says we only promise to +# support stable releases over the last three months we actually end up +# constrained by the MSRV policy of Winit, which is currently based on +# supporting Alacritty on Debian Sid, and requires a > 10 month old Rust version +# +# This Winit policiy is unfortunately in conflict with what makes sense for +# Android because versions below 1.68 for Android requires awkward toolchain +# linker workarounds, and can't even be compiled with newer versions of +# `cargo ndk` that removed these linker workarounds. +# +# TODO: Open a PR for Winit's CI to test Android builds using a newer toolchain. +rust-version = "1.64" [features] # Note: we don't enable any backend by default since features diff --git a/android-activity/src/game_activity/mod.rs b/android-activity/src/game_activity/mod.rs index 623a6a6..fd9da25 100644 --- a/android-activity/src/game_activity/mod.rs +++ b/android-activity/src/game_activity/mod.rs @@ -759,6 +759,7 @@ extern "Rust" { // `app_main` function. This is run on a dedicated thread spawned // by android_native_app_glue. #[no_mangle] +#[allow(unused_unsafe)] // Otherwise rust 1.64 moans about using unsafe{} in unsafe functions pub unsafe extern "C" fn _rust_glue_entry(native_app: *mut ffi::android_app) { abort_on_panic(|| { // Maybe make this stdout/stderr redirection an optional / opt-in feature?... diff --git a/android-activity/src/native_activity/glue.rs b/android-activity/src/native_activity/glue.rs index 58a0a27..6682857 100644 --- a/android-activity/src/native_activity/glue.rs +++ b/android-activity/src/native_activity/glue.rs @@ -828,6 +828,7 @@ unsafe extern "C" fn on_content_rect_changed( /// This is the native entrypoint for our cdylib library that `ANativeActivity` will look for via `dlsym` #[no_mangle] +#[allow(unused_unsafe)] // Otherwise rust 1.64 moans about using unsafe{} in unsafe functions extern "C" fn ANativeActivity_onCreate( activity: *mut ndk_sys::ANativeActivity, saved_state: *const libc::c_void, From d0f10a0dd9351af7266751291fff0c4d3268a63a Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Fri, 4 Aug 2023 20:39:22 +0100 Subject: [PATCH 26/93] agdk-mainloop: update for GameActivity 2.0.2 --- examples/agdk-mainloop/.gitignore | 8 ++------ examples/agdk-mainloop/.idea/.gitignore | 3 --- examples/agdk-mainloop/.idea/compiler.xml | 6 ------ examples/agdk-mainloop/.idea/gradle.xml | 19 ------------------- examples/agdk-mainloop/.idea/misc.xml | 5 +---- examples/agdk-mainloop/.idea/vcs.xml | 7 ------- examples/agdk-mainloop/Cargo.toml | 2 +- examples/agdk-mainloop/app/build.gradle | 18 +++++++----------- .../co/realfit/agdkmainloop/MainActivity.java | 5 +++++ .../app/src/main/res/layout/activity_main.xml | 18 ------------------ .../app/src/main/res/values-night/themes.xml | 16 ---------------- .../app/src/main/res/values/themes.xml | 17 ++--------------- 12 files changed, 18 insertions(+), 106 deletions(-) delete mode 100644 examples/agdk-mainloop/.idea/.gitignore delete mode 100644 examples/agdk-mainloop/.idea/compiler.xml delete mode 100644 examples/agdk-mainloop/.idea/gradle.xml delete mode 100644 examples/agdk-mainloop/.idea/vcs.xml delete mode 100644 examples/agdk-mainloop/app/src/main/res/layout/activity_main.xml delete mode 100644 examples/agdk-mainloop/app/src/main/res/values-night/themes.xml diff --git a/examples/agdk-mainloop/.gitignore b/examples/agdk-mainloop/.gitignore index 24ad84c..9f8412d 100644 --- a/examples/agdk-mainloop/.gitignore +++ b/examples/agdk-mainloop/.gitignore @@ -1,12 +1,8 @@ *.iml +.idea .gradle /local.properties -/.idea/caches -/.idea/libraries -/.idea/modules.xml -/.idea/workspace.xml -/.idea/navEditor.xml -/.idea/assetWizardSettings.xml +/.idea .DS_Store /build /captures diff --git a/examples/agdk-mainloop/.idea/.gitignore b/examples/agdk-mainloop/.idea/.gitignore deleted file mode 100644 index 26d3352..0000000 --- a/examples/agdk-mainloop/.idea/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml diff --git a/examples/agdk-mainloop/.idea/compiler.xml b/examples/agdk-mainloop/.idea/compiler.xml deleted file mode 100644 index fb7f4a8..0000000 --- a/examples/agdk-mainloop/.idea/compiler.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/examples/agdk-mainloop/.idea/gradle.xml b/examples/agdk-mainloop/.idea/gradle.xml deleted file mode 100644 index a2d7c21..0000000 --- a/examples/agdk-mainloop/.idea/gradle.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/examples/agdk-mainloop/.idea/misc.xml b/examples/agdk-mainloop/.idea/misc.xml index 2a4d5b5..fb0d77e 100644 --- a/examples/agdk-mainloop/.idea/misc.xml +++ b/examples/agdk-mainloop/.idea/misc.xml @@ -1,9 +1,6 @@ - + - - \ No newline at end of file diff --git a/examples/agdk-mainloop/.idea/vcs.xml b/examples/agdk-mainloop/.idea/vcs.xml deleted file mode 100644 index fdf1fc8..0000000 --- a/examples/agdk-mainloop/.idea/vcs.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/examples/agdk-mainloop/Cargo.toml b/examples/agdk-mainloop/Cargo.toml index 6971468..536146f 100644 --- a/examples/agdk-mainloop/Cargo.toml +++ b/examples/agdk-mainloop/Cargo.toml @@ -14,4 +14,4 @@ ndk = "0.7" [lib] name="main" -crate_type=["cdylib"] \ No newline at end of file +crate_type=["cdylib"] diff --git a/examples/agdk-mainloop/app/build.gradle b/examples/agdk-mainloop/app/build.gradle index cce660e..386a484 100644 --- a/examples/agdk-mainloop/app/build.gradle +++ b/examples/agdk-mainloop/app/build.gradle @@ -12,8 +12,6 @@ android { targetSdk 31 versionCode 1 versionName "1.0" - - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { @@ -38,12 +36,10 @@ android { dependencies { - implementation 'androidx.appcompat:appcompat:1.4.1' - implementation 'com.google.android.material:material:1.5.0' - implementation 'androidx.constraintlayout:constraintlayout:2.1.3' - testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test.ext:junit:1.1.3' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' + implementation "androidx.core:core:1.5.0" + implementation "androidx.constraintlayout:constraintlayout:2.0.4" + implementation 'androidx.fragment:fragment:1.2.5' + implementation 'com.google.oboe:oboe:1.5.0' // To use the Android Frame Pacing library //implementation "androidx.games:games-frame-pacing:1.9.1" @@ -52,12 +48,12 @@ dependencies { //implementation "androidx.games:games-performance-tuner:1.5.0" // To use the Games Activity library - implementation "androidx.games:games-activity:1.1.0" + implementation "androidx.games:games-activity:2.0.2" // To use the Games Controller Library - //implementation "androidx.games:games-controller:1.1.0" + //implementation "androidx.games:games-controller:2.0.2" // To use the Games Text Input Library - //implementation "androidx.games:games-text-input:1.1.0" + //implementation "androidx.games:games-text-input:2.0.2" } diff --git a/examples/agdk-mainloop/app/src/main/java/co/realfit/agdkmainloop/MainActivity.java b/examples/agdk-mainloop/app/src/main/java/co/realfit/agdkmainloop/MainActivity.java index 831dd48..6dea50d 100644 --- a/examples/agdk-mainloop/app/src/main/java/co/realfit/agdkmainloop/MainActivity.java +++ b/examples/agdk-mainloop/app/src/main/java/co/realfit/agdkmainloop/MainActivity.java @@ -63,6 +63,11 @@ protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); } + protected void onResume() { + super.onResume(); + hideSystemUI(); + } + public boolean isGooglePlayGames() { PackageManager pm = getPackageManager(); return pm.hasSystemFeature("com.google.android.play.feature.HPE_EXPERIENCE"); diff --git a/examples/agdk-mainloop/app/src/main/res/layout/activity_main.xml b/examples/agdk-mainloop/app/src/main/res/layout/activity_main.xml deleted file mode 100644 index 4fc2444..0000000 --- a/examples/agdk-mainloop/app/src/main/res/layout/activity_main.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/examples/agdk-mainloop/app/src/main/res/values-night/themes.xml b/examples/agdk-mainloop/app/src/main/res/values-night/themes.xml deleted file mode 100644 index 81c6873..0000000 --- a/examples/agdk-mainloop/app/src/main/res/values-night/themes.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - \ No newline at end of file diff --git a/examples/agdk-mainloop/app/src/main/res/values/themes.xml b/examples/agdk-mainloop/app/src/main/res/values/themes.xml index 83a6c4a..96e0241 100644 --- a/examples/agdk-mainloop/app/src/main/res/values/themes.xml +++ b/examples/agdk-mainloop/app/src/main/res/values/themes.xml @@ -1,16 +1,3 @@ - - - + +